components
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
- a72b57cficons: nest Style rules in the language's formmre
- 927616e2pagination: nest Style rules in the language's formmre
- aab8ad29code-editor: nest Style rules in the language's formmre
- ba30727afile-upload: nest Style rules in the language's formmre
- 42fefa4emodal: nest Style rules in the language's formmre
- 6fd953e3range-picker: nest Style rules in the language's formmre
- f661951ddate-picker: nest Style rules in the language's formmre
- 363577e6media-player: nest Style rules in the language's formmre
- 0b3fd8c9comments: nest Style rules in the language's formmre
- 67e043c8plugins/web/README.md from hybriel cb9e480dmre
- 519b56e9styles.hl: Style in the language's form (nested like the View, one declaration per line, bare @media)mre
- 29f63d01md-editor: Style in the language's form (nested like the View, one declaration per line, bare @media)mre
- 869f49c7files-upload: Style in the language's form (nested like the View, one declaration per line, bare @media)mre
- f60dab20month-view: Style in the language's form (nested like the View, one declaration per line, bare @media)mre
- 5b3c349aRe-vendor to Hybriel set day35 (cb9e480d): plugins core and web sources, README vendoring notemre
- 3449b117components: a startup error prints its message before exit 1 (hybriel#247)mre
- 59704ce1Merge branch 'n5b-pipes'mre
- 23b9164aMdEditor: a clipboard whose text is only the names or file:// paths of its files (a file manager copy) is about the files, as before; any other text wins (tickets#49); gate casesmre
- b0f1ec28MdEditor: a clipboard with text always pastes the text, also when a picture is on it too (a spreadsheet or office app), files on or off; a picture alone still goes to the files; real Ctrl+V gate tests/md-paste-files.mjs (tickets#49)mre
- ad4e929bMdEditor: pipe rows without a delimiter row are a table (first row = header, short rows padded, written back without an invented | --- | line) (notes#5)mre