components
All repositories: gitoria
1.6 KB
# Date pickerA date picker for input fields. Click a field: a month opens under it; click a day and the field shows it as `YYYY-MM-DD`.Typing works too; a typed date that is not a real day marks the field (`aria-invalid="true"`). Escape, Enter or a clickoutside closes the month; the arrows page through the months. One component gives you as many fields as you name, and eachposts in a form under its own name.Live demo: https://components.hybriel.worldapi.org/date-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 a field gets focus.## Use it in an appCopy `components/date-picker/date-picker.hl` (optionally `shared/tokens.hl` for the app's own accent; it carries its own `Style`), then:```import DatePicker from './date-picker.hl'View {form { method = "get" action = "/book"DatePicker { names = "arrival,departure" }}}```- `names` is a comma-separated list: one field per name (default: one field named `date`).- Do not wrap the picker in a `<label>`; the field's `title` carries its name.- Use ONE `DatePicker` per page (a composed component's members are the page's state) — give it all the fields of the page.- 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 a value from the page and reading it in the host (a composed component's members cannot be read by its host,hybriel#87 — the value goes out through the form), a min/max date, a second `DatePicker` on the same page.
Branches
Latest commits
- 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
- 4bd11128MdEditor: the Table button's empty table is written as a real pipe table (empty cells), so it survives the source switch, a save and a reload (notes#7)mre