layouts
All repositories: gitoria
1.7 KB
# Date range pickerHTML has no date range field. This is one text field for a period: click it, a month opens under it; click aday for the start, click another for the end. The start and end are marked, the days between are highlighted.The value is `YYYY-MM-DD – YYYY-MM-DD` (start – end). If the second day is before the first, they swap.Typing works too (`2028-02-01 – 2028-02-29`); text that is not two real days marks the field (`aria-invalid="true"`).Escape, Enter, or focusing the field again while only the start is picked drops that start and keeps the old range.Live demo: https://components.hybriel.worldapi.org/range-pickerPure Hybriel: one file, no JavaScript file. The browser's today is read, and the names follow the page language (`<html lang>`, English when none), when the field gets focus.## Use it in an appCopy `components/range-picker/range-picker.hl` (optionally `shared/tokens.hl` for the app's own accent; it carries its own `Style`), then:```import RangePicker from './range-picker.hl'View {form { method = "get" action = "/search"RangePicker { }}}```- The field is named `range` (member `name`); it posts as `range=YYYY-MM-DD – YYYY-MM-DD`.- Do not wrap the picker in a `<label>`.- One per page (a composed component's members are the page's state).- Colours are the semantic tokens only, each with a black/white/grey fallback: the base look is black, white and greys (no frames; root README "Look"); an app that declares the WorldAPI tokens (layouts.worldapi.org's theme) restyles it.## Not yetSetting the range from the page, reading start and end as separate members in the host (a composed component's memberscannot be read by its host, hybriel#87), a second picker on one page.
Branches
Latest commits
- 3dc27d78mail-demo: format Style with nested rules and bare mediamre
- cf9648afhome: format Style with nested rules and bare mediamre
- 846a6242user-menu: format Style with nested rules and bare mediamre
- 4d58708cthree-pane: format Style with nested rules and bare mediamre
- 0bbfc553main-menu: format Style with nested rules and bare mediamre
- 7755199dlist-first: format Style with nested rules and bare mediamre
- 35199303content-first: format Style with nested rules and bare mediamre
- 00f6e698app-sidebar: format Style with nested rules and bare mediamre
- bb2f29c9app-header: format Style with nested rules and bare mediamre
- 3aca2d7fSync components from 8176eb1 with reviewed nested stylesmre
- 87e4003dRe-vendor layouts to Hybriel set day35mre
- d8628cfflayouts: a startup error prints its message before exit 1 (hybriel#247)mre
- 180fd76elayouts: MdEditor from components 59704ce (text on the clipboard always pastes, a file manager copy still attaches; pipe rows; empty Table-button table; tickets#49, notes#5)mre
- a3eda8afRe-vendor Hybriel master 7a684920 (binary 74ab3715): plugins whole, startup fault exits 1; files-upload gate 340/0mre
- 025d5880WIP re-vendor Hybriel set-day27b (a9712e61, master f5ff97bf): plugins whole, startup fault exits 1; NOT deployable: files-upload emit refused (see .scratch/rv27-upload)mre
- 42183a71Merge sb3-standby: layouts deploys through its standbymre
- 408de1f2layouts: no jobs switch needed in the standbymre
- 0b85f57elayouts: a standby container (port 45019, profile standby); deploy hands over through standby-swap.sh without a gapmre
- 31e40b8bMerge dm3-media: range handling in the layouts media routemre
- 856dcacbLayouts media route: read suffix ranges and ignore range lists and garbage, like the components route (the layouts copy still answered 416 for the last bytes)mre