gitoria

components

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit64a2bc2764a2bc27Document CS23b style formatting proof and review statusmre64a2bc27/components/range-picker/README.md

1.7 KB

  1. # Date range picker
  2. HTML has no date range field. This is one text field for a period: click it, a month opens under it; click a
  3. day for the start, click another for the end. The start and end are marked, the days between are highlighted.
  4. The value is `YYYY-MM-DD – YYYY-MM-DD` (start – end). If the second day is before the first, they swap.
  5. Typing works too (`2028-02-01 – 2028-02-29`); text that is not two real days marks the field (`aria-invalid="true"`).
  6. Escape, Enter, or focusing the field again while only the start is picked drops that start and keeps the old range.
  7. Live demo: https://components.hybriel.worldapi.org/range-picker
  8. Pure 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.
  9. ## Use it in an app
  10. Copy `components/range-picker/range-picker.hl` (optionally `shared/tokens.hl` for the app's own accent; it carries its own `Style`), then:
  11. ```
  12. import RangePicker from './range-picker.hl'
  13. View {
  14. form { method = "get" action = "/search"
  15. RangePicker { }
  16. }
  17. }
  18. ```
  19. - The field is named `range` (member `name`); it posts as `range=YYYY-MM-DD – YYYY-MM-DD`.
  20. - Do not wrap the picker in a `<label>`.
  21. - One per page (a composed component's members are the page's state).
  22. - 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.
  23. ## Not yet
  24. Setting the range from the page, reading start and end as separate members in the host (a composed component's members
  25. cannot be read by its host, hybriel#87), a second picker on one page.

Branches

Latest commits

  • 64a2bc27Document CS23b style formatting proof and review statusmre
  • 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