@zealakit/chrono-react 0.0.0-stage → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +625 -2
- package/dist/calendar/components.d.ts +346 -0
- package/dist/calendar/components.js +243 -0
- package/dist/calendar/context.d.ts +636 -0
- package/dist/calendar/context.js +21 -0
- package/dist/calendar/index.d.ts +6 -0
- package/dist/calendar/index.js +6 -0
- package/dist/calendar/mini-calendar.d.ts +60 -0
- package/dist/calendar/mini-calendar.js +51 -0
- package/dist/calendar/options.d.ts +4 -0
- package/dist/calendar/options.js +98 -0
- package/dist/calendar/use-calendar.d.ts +340 -0
- package/dist/calendar/use-calendar.js +154 -0
- package/dist/calendar/use-mini-calendar.d.ts +302 -0
- package/dist/calendar/use-mini-calendar.js +56 -0
- package/dist/calendar/utilities.d.ts +9 -0
- package/dist/calendar/utilities.js +8 -0
- package/dist/date/bind-panel.d.ts +30 -0
- package/dist/date/bind-panel.js +125 -0
- package/dist/date/components.d.ts +197 -0
- package/dist/date/components.js +193 -0
- package/dist/date/context.d.ts +34 -0
- package/dist/date/context.js +19 -0
- package/dist/date/index.d.ts +4 -0
- package/dist/date/index.js +4 -0
- package/dist/date/options.d.ts +7 -0
- package/dist/date/options.js +91 -0
- package/dist/date/use-date-input.d.ts +43 -0
- package/dist/date/use-date-input.js +138 -0
- package/dist/date/use-date-panel.d.ts +81 -0
- package/dist/date/use-date-panel.js +21 -0
- package/dist/date/utilities.d.ts +4 -0
- package/dist/date/utilities.js +4 -0
- package/dist/datetime/components.d.ts +121 -0
- package/dist/datetime/components.js +164 -0
- package/dist/datetime/context.d.ts +8 -0
- package/dist/datetime/context.js +18 -0
- package/dist/datetime/index.d.ts +4 -0
- package/dist/datetime/index.js +4 -0
- package/dist/datetime/options.d.ts +5 -0
- package/dist/datetime/options.js +99 -0
- package/dist/datetime/use-datetime-input.d.ts +44 -0
- package/dist/datetime/use-datetime-input.js +145 -0
- package/dist/datetime/use-datetime-panel.d.ts +128 -0
- package/dist/datetime/use-datetime-panel.js +60 -0
- package/dist/datetime/utilities.d.ts +4 -0
- package/dist/datetime/utilities.js +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/shared/defined-options.d.ts +18 -0
- package/dist/shared/defined-options.js +9 -0
- package/dist/shared/merge-props.d.ts +9 -0
- package/dist/shared/merge-props.js +31 -0
- package/dist/shared/modifiers.d.ts +7 -0
- package/dist/shared/modifiers.js +6 -0
- package/dist/shared/part.d.ts +10 -0
- package/dist/shared/part.js +9 -0
- package/dist/shared/slot.d.ts +12 -0
- package/dist/shared/slot.js +57 -0
- package/dist/shared/style-properties.d.ts +8 -0
- package/dist/shared/style-properties.js +13 -0
- package/dist/shared/to-react-props.d.ts +11 -0
- package/dist/shared/to-react-props.js +27 -0
- package/dist/time/bind-panel.d.ts +19 -0
- package/dist/time/bind-panel.js +97 -0
- package/dist/time/components.d.ts +183 -0
- package/dist/time/components.js +169 -0
- package/dist/time/context.d.ts +24 -0
- package/dist/time/context.js +19 -0
- package/dist/time/index.d.ts +4 -0
- package/dist/time/index.js +4 -0
- package/dist/time/options.d.ts +5 -0
- package/dist/time/options.js +85 -0
- package/dist/time/use-time-input.d.ts +43 -0
- package/dist/time/use-time-input.js +138 -0
- package/dist/time/use-time-panel.d.ts +37 -0
- package/dist/time/use-time-panel.js +18 -0
- package/dist/time/utilities.d.ts +4 -0
- package/dist/time/utilities.js +4 -0
- package/dist/vendor/core/calendar/availability.d.ts +39 -0
- package/dist/vendor/core/calendar/availability.js +73 -0
- package/dist/vendor/core/calendar/controllers/calendar-controller.d.ts +251 -0
- package/dist/vendor/core/calendar/controllers/calendar-controller.js +1396 -0
- package/dist/vendor/core/calendar/controllers/drag-engine.d.ts +99 -0
- package/dist/vendor/core/calendar/controllers/drag-engine.js +363 -0
- package/dist/vendor/core/calendar/controllers/mini-calendar-controller.d.ts +66 -0
- package/dist/vendor/core/calendar/controllers/mini-calendar-controller.js +171 -0
- package/dist/vendor/core/calendar/controllers/shared.d.ts +33 -0
- package/dist/vendor/core/calendar/controllers/shared.js +82 -0
- package/dist/vendor/core/calendar/events/agenda-layout.d.ts +21 -0
- package/dist/vendor/core/calendar/events/agenda-layout.js +72 -0
- package/dist/vendor/core/calendar/events/all-day-row.d.ts +22 -0
- package/dist/vendor/core/calendar/events/all-day-row.js +93 -0
- package/dist/vendor/core/calendar/events/background-layout.d.ts +66 -0
- package/dist/vendor/core/calendar/events/background-layout.js +106 -0
- package/dist/vendor/core/calendar/events/index.d.ts +17 -0
- package/dist/vendor/core/calendar/events/index.js +8 -0
- package/dist/vendor/core/calendar/events/month-layout.d.ts +13 -0
- package/dist/vendor/core/calendar/events/month-layout.js +157 -0
- package/dist/vendor/core/calendar/events/normalize.d.ts +33 -0
- package/dist/vendor/core/calendar/events/normalize.js +156 -0
- package/dist/vendor/core/calendar/events/now-indicator.d.ts +18 -0
- package/dist/vendor/core/calendar/events/now-indicator.js +19 -0
- package/dist/vendor/core/calendar/events/overflow.d.ts +36 -0
- package/dist/vendor/core/calendar/events/overflow.js +112 -0
- package/dist/vendor/core/calendar/events/sort.d.ts +21 -0
- package/dist/vendor/core/calendar/events/sort.js +35 -0
- package/dist/vendor/core/calendar/events/time-grid-layout.d.ts +22 -0
- package/dist/vendor/core/calendar/events/time-grid-layout.js +177 -0
- package/dist/vendor/core/calendar/events/types.d.ts +141 -0
- package/dist/vendor/core/calendar/events/types.js +1 -0
- package/dist/vendor/core/calendar/index.d.ts +70 -0
- package/dist/vendor/core/calendar/index.js +37 -0
- package/dist/vendor/core/calendar/interaction/auto-scroll.d.ts +11 -0
- package/dist/vendor/core/calendar/interaction/auto-scroll.js +37 -0
- package/dist/vendor/core/calendar/interaction/drag-geometry.d.ts +52 -0
- package/dist/vendor/core/calendar/interaction/drag-geometry.js +122 -0
- package/dist/vendor/core/calendar/interaction/drag-keyboard.d.ts +38 -0
- package/dist/vendor/core/calendar/interaction/drag-keyboard.js +53 -0
- package/dist/vendor/core/calendar/interaction/drag-pointer.d.ts +24 -0
- package/dist/vendor/core/calendar/interaction/drag-pointer.js +43 -0
- package/dist/vendor/core/calendar/interaction/event-focus.d.ts +28 -0
- package/dist/vendor/core/calendar/interaction/event-focus.js +44 -0
- package/dist/vendor/core/calendar/interaction/gesture-handle.d.ts +17 -0
- package/dist/vendor/core/calendar/interaction/gesture-handle.js +26 -0
- package/dist/vendor/core/calendar/interaction/hit-test.d.ts +17 -0
- package/dist/vendor/core/calendar/interaction/hit-test.js +26 -0
- package/dist/vendor/core/calendar/interaction/pending.d.ts +17 -0
- package/dist/vendor/core/calendar/interaction/pending.js +17 -0
- package/dist/vendor/core/calendar/interaction/pointer.d.ts +21 -0
- package/dist/vendor/core/calendar/interaction/pointer.js +169 -0
- package/dist/vendor/core/calendar/interaction/selection.d.ts +29 -0
- package/dist/vendor/core/calendar/interaction/selection.js +47 -0
- package/dist/vendor/core/calendar/internal/equal.d.ts +3 -0
- package/dist/vendor/core/calendar/internal/equal.js +43 -0
- package/dist/vendor/core/calendar/navigation/navigate.d.ts +33 -0
- package/dist/vendor/core/calendar/navigation/navigate.js +81 -0
- package/dist/vendor/core/calendar/navigation/range.d.ts +15 -0
- package/dist/vendor/core/calendar/navigation/range.js +52 -0
- package/dist/vendor/core/calendar/navigation/title.d.ts +12 -0
- package/dist/vendor/core/calendar/navigation/title.js +39 -0
- package/dist/vendor/core/calendar/navigation/view-definition.d.ts +39 -0
- package/dist/vendor/core/calendar/navigation/view-definition.js +62 -0
- package/dist/vendor/core/calendar/navigation/zoom.d.ts +5 -0
- package/dist/vendor/core/calendar/navigation/zoom.js +11 -0
- package/dist/vendor/core/calendar/recurrence/apply.d.ts +50 -0
- package/dist/vendor/core/calendar/recurrence/apply.js +206 -0
- package/dist/vendor/core/calendar/recurrence/expand.d.ts +27 -0
- package/dist/vendor/core/calendar/recurrence/expand.js +298 -0
- package/dist/vendor/core/calendar/recurrence/pack.d.ts +3 -0
- package/dist/vendor/core/calendar/recurrence/pack.js +248 -0
- package/dist/vendor/core/calendar/recurrence/rrule-types.d.ts +30 -0
- package/dist/vendor/core/calendar/recurrence/rrule-types.js +8 -0
- package/dist/vendor/core/calendar/recurrence/rrule.d.ts +12 -0
- package/dist/vendor/core/calendar/recurrence/rrule.js +278 -0
- package/dist/vendor/core/calendar/recurrence/series.d.ts +25 -0
- package/dist/vendor/core/calendar/recurrence/series.js +163 -0
- package/dist/vendor/core/calendar/recurrence/types.d.ts +30 -0
- package/dist/vendor/core/calendar/recurrence/types.js +1 -0
- package/dist/vendor/core/calendar/resources/keys.d.ts +2 -0
- package/dist/vendor/core/calendar/resources/keys.js +2 -0
- package/dist/vendor/core/calendar/resources/resource-time-grid.d.ts +7 -0
- package/dist/vendor/core/calendar/resources/resource-time-grid.js +129 -0
- package/dist/vendor/core/calendar/resources/timeline-axis.d.ts +10 -0
- package/dist/vendor/core/calendar/resources/timeline-axis.js +98 -0
- package/dist/vendor/core/calendar/resources/timeline-layout.d.ts +7 -0
- package/dist/vendor/core/calendar/resources/timeline-layout.js +109 -0
- package/dist/vendor/core/calendar/resources/tree.d.ts +10 -0
- package/dist/vendor/core/calendar/resources/tree.js +86 -0
- package/dist/vendor/core/calendar/resources/types.d.ts +177 -0
- package/dist/vendor/core/calendar/resources/types.js +1 -0
- package/dist/vendor/core/calendar/resources/views.d.ts +7 -0
- package/dist/vendor/core/calendar/resources/views.js +45 -0
- package/dist/vendor/core/calendar/resources/windowing.d.ts +11 -0
- package/dist/vendor/core/calendar/resources/windowing.js +17 -0
- package/dist/vendor/core/calendar/views/day.d.ts +37 -0
- package/dist/vendor/core/calendar/views/day.js +36 -0
- package/dist/vendor/core/calendar/views/list-layout.d.ts +8 -0
- package/dist/vendor/core/calendar/views/list-layout.js +5 -0
- package/dist/vendor/core/calendar/views/mini-calendar.d.ts +23 -0
- package/dist/vendor/core/calendar/views/mini-calendar.js +31 -0
- package/dist/vendor/core/calendar/views/month-layout.d.ts +30 -0
- package/dist/vendor/core/calendar/views/month-layout.js +63 -0
- package/dist/vendor/core/calendar/views/time-grid-layout.d.ts +26 -0
- package/dist/vendor/core/calendar/views/time-grid-layout.js +27 -0
- package/dist/vendor/core/date/index.d.ts +9 -0
- package/dist/vendor/core/date/index.js +9 -0
- package/dist/vendor/core/date/input/date-input-controller.d.ts +97 -0
- package/dist/vendor/core/date/input/date-input-controller.js +466 -0
- package/dist/vendor/core/date/input/date-range-input-controller.d.ts +43 -0
- package/dist/vendor/core/date/input/date-range-input-controller.js +186 -0
- package/dist/vendor/core/date/input/parse.d.ts +22 -0
- package/dist/vendor/core/date/input/parse.js +78 -0
- package/dist/vendor/core/date/input/validity.d.ts +6 -0
- package/dist/vendor/core/date/input/validity.js +13 -0
- package/dist/vendor/core/date/panel/panel-controller.d.ts +176 -0
- package/dist/vendor/core/date/panel/panel-controller.js +704 -0
- package/dist/vendor/core/date/presets.d.ts +22 -0
- package/dist/vendor/core/date/presets.js +103 -0
- package/dist/vendor/core/date/selection/multiple.d.ts +7 -0
- package/dist/vendor/core/date/selection/multiple.js +29 -0
- package/dist/vendor/core/date/selection/range.d.ts +29 -0
- package/dist/vendor/core/date/selection/range.js +35 -0
- package/dist/vendor/core/date/types.d.ts +12 -0
- package/dist/vendor/core/date/types.js +1 -0
- package/dist/vendor/core/datetime/compose.d.ts +24 -0
- package/dist/vendor/core/datetime/compose.js +49 -0
- package/dist/vendor/core/datetime/constraints.d.ts +42 -0
- package/dist/vendor/core/datetime/constraints.js +56 -0
- package/dist/vendor/core/datetime/index.d.ts +9 -0
- package/dist/vendor/core/datetime/index.js +9 -0
- package/dist/vendor/core/datetime/input/datetime-input-controller.d.ts +96 -0
- package/dist/vendor/core/datetime/input/datetime-input-controller.js +380 -0
- package/dist/vendor/core/datetime/input/datetime-range-input-controller.d.ts +46 -0
- package/dist/vendor/core/datetime/input/datetime-range-input-controller.js +171 -0
- package/dist/vendor/core/datetime/input/parse.d.ts +20 -0
- package/dist/vendor/core/datetime/input/parse.js +56 -0
- package/dist/vendor/core/datetime/panel/controller.d.ts +64 -0
- package/dist/vendor/core/datetime/panel/controller.js +191 -0
- package/dist/vendor/core/datetime/panel/range-controller.d.ts +71 -0
- package/dist/vendor/core/datetime/panel/range-controller.js +205 -0
- package/dist/vendor/core/datetime/types.d.ts +12 -0
- package/dist/vendor/core/datetime/types.js +1 -0
- package/dist/vendor/core/datetime/zone/day-instants.d.ts +19 -0
- package/dist/vendor/core/datetime/zone/day-instants.js +52 -0
- package/dist/vendor/core/datetime/zone/resolve.d.ts +16 -0
- package/dist/vendor/core/datetime/zone/resolve.js +24 -0
- package/dist/vendor/core/dom/auto-scroll.d.ts +37 -0
- package/dist/vendor/core/dom/auto-scroll.js +57 -0
- package/dist/vendor/core/dom/drag-session.d.ts +25 -0
- package/dist/vendor/core/dom/drag-session.js +257 -0
- package/dist/vendor/core/foundation/a11y/announcer.d.ts +12 -0
- package/dist/vendor/core/foundation/a11y/announcer.js +24 -0
- package/dist/vendor/core/foundation/a11y/grid-navigation.d.ts +19 -0
- package/dist/vendor/core/foundation/a11y/grid-navigation.js +76 -0
- package/dist/vendor/core/foundation/a11y/index.d.ts +8 -0
- package/dist/vendor/core/foundation/a11y/index.js +5 -0
- package/dist/vendor/core/foundation/a11y/labels.d.ts +21 -0
- package/dist/vendor/core/foundation/a11y/labels.js +43 -0
- package/dist/vendor/core/foundation/a11y/messages.d.ts +80 -0
- package/dist/vendor/core/foundation/a11y/messages.js +74 -0
- package/dist/vendor/core/foundation/a11y/roving-focus.d.ts +18 -0
- package/dist/vendor/core/foundation/a11y/roving-focus.js +73 -0
- package/dist/vendor/core/foundation/constraints/availability-rules.d.ts +52 -0
- package/dist/vendor/core/foundation/constraints/availability-rules.js +64 -0
- package/dist/vendor/core/foundation/constraints/availability.d.ts +93 -0
- package/dist/vendor/core/foundation/constraints/availability.js +480 -0
- package/dist/vendor/core/foundation/constraints/date.d.ts +21 -0
- package/dist/vendor/core/foundation/constraints/date.js +41 -0
- package/dist/vendor/core/foundation/constraints/index.d.ts +9 -0
- package/dist/vendor/core/foundation/constraints/index.js +4 -0
- package/dist/vendor/core/foundation/constraints/range.d.ts +44 -0
- package/dist/vendor/core/foundation/constraints/range.js +70 -0
- package/dist/vendor/core/foundation/constraints/time.d.ts +30 -0
- package/dist/vendor/core/foundation/constraints/time.js +56 -0
- package/dist/vendor/core/foundation/grid/index.d.ts +8 -0
- package/dist/vendor/core/foundation/grid/index.js +4 -0
- package/dist/vendor/core/foundation/grid/month-grid.d.ts +33 -0
- package/dist/vendor/core/foundation/grid/month-grid.js +52 -0
- package/dist/vendor/core/foundation/grid/time-axis.d.ts +25 -0
- package/dist/vendor/core/foundation/grid/time-axis.js +32 -0
- package/dist/vendor/core/foundation/grid/weekday-headers.d.ts +17 -0
- package/dist/vendor/core/foundation/grid/weekday-headers.js +26 -0
- package/dist/vendor/core/foundation/grid/year-grid.d.ts +29 -0
- package/dist/vendor/core/foundation/grid/year-grid.js +40 -0
- package/dist/vendor/core/foundation/index.d.ts +8 -0
- package/dist/vendor/core/foundation/index.js +8 -0
- package/dist/vendor/core/foundation/input/form.d.ts +7 -0
- package/dist/vendor/core/foundation/input/form.js +10 -0
- package/dist/vendor/core/foundation/input/index.d.ts +6 -0
- package/dist/vendor/core/foundation/input/index.js +3 -0
- package/dist/vendor/core/foundation/input/segment-engine.d.ts +33 -0
- package/dist/vendor/core/foundation/input/segment-engine.js +45 -0
- package/dist/vendor/core/foundation/input/tokenize.d.ts +19 -0
- package/dist/vendor/core/foundation/input/tokenize.js +24 -0
- package/dist/vendor/core/foundation/locale/digits.d.ts +6 -0
- package/dist/vendor/core/foundation/locale/digits.js +35 -0
- package/dist/vendor/core/foundation/locale/direction.d.ts +1 -0
- package/dist/vendor/core/foundation/locale/direction.js +25 -0
- package/dist/vendor/core/foundation/locale/format.d.ts +31 -0
- package/dist/vendor/core/foundation/locale/format.js +77 -0
- package/dist/vendor/core/foundation/locale/hour-cycle.d.ts +12 -0
- package/dist/vendor/core/foundation/locale/hour-cycle.js +41 -0
- package/dist/vendor/core/foundation/locale/index.d.ts +10 -0
- package/dist/vendor/core/foundation/locale/index.js +8 -0
- package/dist/vendor/core/foundation/locale/names.d.ts +6 -0
- package/dist/vendor/core/foundation/locale/names.js +30 -0
- package/dist/vendor/core/foundation/locale/resolve.d.ts +7 -0
- package/dist/vendor/core/foundation/locale/resolve.js +39 -0
- package/dist/vendor/core/foundation/locale/week-info.d.ts +5 -0
- package/dist/vendor/core/foundation/locale/week-info.js +60 -0
- package/dist/vendor/core/foundation/locale/zone-label.d.ts +6 -0
- package/dist/vendor/core/foundation/locale/zone-label.js +24 -0
- package/dist/vendor/core/foundation/ranges/date-range.d.ts +18 -0
- package/dist/vendor/core/foundation/ranges/date-range.js +40 -0
- package/dist/vendor/core/foundation/ranges/index.d.ts +4 -0
- package/dist/vendor/core/foundation/ranges/index.js +2 -0
- package/dist/vendor/core/foundation/ranges/interval.d.ts +24 -0
- package/dist/vendor/core/foundation/ranges/interval.js +54 -0
- package/dist/vendor/core/foundation/store/attributes.d.ts +19 -0
- package/dist/vendor/core/foundation/store/attributes.js +43 -0
- package/dist/vendor/core/foundation/store/controllable.d.ts +19 -0
- package/dist/vendor/core/foundation/store/controllable.js +50 -0
- package/dist/vendor/core/foundation/store/env.d.ts +1 -0
- package/dist/vendor/core/foundation/store/env.js +3 -0
- package/dist/vendor/core/foundation/store/ids.d.ts +9 -0
- package/dist/vendor/core/foundation/store/ids.js +12 -0
- package/dist/vendor/core/foundation/store/index.d.ts +11 -0
- package/dist/vendor/core/foundation/store/index.js +7 -0
- package/dist/vendor/core/foundation/store/store.d.ts +7 -0
- package/dist/vendor/core/foundation/store/store.js +25 -0
- package/dist/vendor/core/foundation/store/ticker.d.ts +11 -0
- package/dist/vendor/core/foundation/store/ticker.js +27 -0
- package/dist/vendor/core/foundation/store/with-optional.d.ts +15 -0
- package/dist/vendor/core/foundation/store/with-optional.js +3 -0
- package/dist/vendor/core/foundation/values/clock.d.ts +4 -0
- package/dist/vendor/core/foundation/values/clock.js +21 -0
- package/dist/vendor/core/foundation/values/compare.d.ts +16 -0
- package/dist/vendor/core/foundation/values/compare.js +70 -0
- package/dist/vendor/core/foundation/values/convert.d.ts +31 -0
- package/dist/vendor/core/foundation/values/convert.js +108 -0
- package/dist/vendor/core/foundation/values/epoch-day.d.ts +15 -0
- package/dist/vendor/core/foundation/values/epoch-day.js +43 -0
- package/dist/vendor/core/foundation/values/index.d.ts +14 -0
- package/dist/vendor/core/foundation/values/index.js +10 -0
- package/dist/vendor/core/foundation/values/iso.d.ts +24 -0
- package/dist/vendor/core/foundation/values/iso.js +111 -0
- package/dist/vendor/core/foundation/values/plain-date-time.d.ts +8 -0
- package/dist/vendor/core/foundation/values/plain-date-time.js +25 -0
- package/dist/vendor/core/foundation/values/plain-date.d.ts +33 -0
- package/dist/vendor/core/foundation/values/plain-date.js +105 -0
- package/dist/vendor/core/foundation/values/plain-time.d.ts +15 -0
- package/dist/vendor/core/foundation/values/plain-time.js +43 -0
- package/dist/vendor/core/foundation/values/types.d.ts +37 -0
- package/dist/vendor/core/foundation/values/types.js +1 -0
- package/dist/vendor/core/foundation/values/week.d.ts +9 -0
- package/dist/vendor/core/foundation/values/week.js +31 -0
- package/dist/vendor/core/foundation/values/year-month.d.ts +10 -0
- package/dist/vendor/core/foundation/values/year-month.js +19 -0
- package/dist/vendor/core/foundation/values/zoned.d.ts +16 -0
- package/dist/vendor/core/foundation/values/zoned.js +152 -0
- package/dist/vendor/core/index.d.ts +5 -0
- package/dist/vendor/core/index.js +5 -0
- package/dist/vendor/core/time/index.d.ts +8 -0
- package/dist/vendor/core/time/index.js +8 -0
- package/dist/vendor/core/time/input/parse.d.ts +19 -0
- package/dist/vendor/core/time/input/parse.js +82 -0
- package/dist/vendor/core/time/input/time-input-controller.d.ts +102 -0
- package/dist/vendor/core/time/input/time-input-controller.js +547 -0
- package/dist/vendor/core/time/input/time-range-input-controller.d.ts +49 -0
- package/dist/vendor/core/time/input/time-range-input-controller.js +178 -0
- package/dist/vendor/core/time/input/validity.d.ts +7 -0
- package/dist/vendor/core/time/input/validity.js +16 -0
- package/dist/vendor/core/time/panel/time-panel-controller.d.ts +163 -0
- package/dist/vendor/core/time/panel/time-panel-controller.js +809 -0
- package/dist/vendor/core/time/selection/range.d.ts +25 -0
- package/dist/vendor/core/time/selection/range.js +35 -0
- package/dist/vendor/core/time/selection/slots.d.ts +46 -0
- package/dist/vendor/core/time/selection/slots.js +76 -0
- package/dist/vendor/core/time/types.d.ts +11 -0
- package/dist/vendor/core/time/types.js +1 -0
- package/package.json +83 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type PlainDate } from "../../foundation/index.js";
|
|
2
|
+
export type ParseContext = {
|
|
3
|
+
locale?: string | undefined;
|
|
4
|
+
today?: PlainDate;
|
|
5
|
+
timeZone?: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
export type ParseResult = {
|
|
8
|
+
date: PlainDate;
|
|
9
|
+
} | {
|
|
10
|
+
error: "empty" | "unparseable" | "invalid-date";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Resolve a two-digit year to the nearest year within 50 years of `today`.
|
|
14
|
+
* A tie (exactly 50 years either way) goes to the past (plan 06 §13.2).
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveTwoDigitYear(year: number, today: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* Parse typed text into a date: ISO, the locale's numeric order with any
|
|
19
|
+
* separators, month names (long or short, any case, accents ignored), CJK
|
|
20
|
+
* `2026年11月17日`, and two-digit years.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseDate(text: string, context?: ParseContext): ParseResult;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { fold, getDatePartOrder, getMonthNames, isValidDate, plainDate, toLatinDigits, today as readToday, tokenize, } from "../../foundation/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a two-digit year to the nearest year within 50 years of `today`.
|
|
4
|
+
* A tie (exactly 50 years either way) goes to the past (plan 06 §13.2).
|
|
5
|
+
*/
|
|
6
|
+
export function resolveTwoDigitYear(year, today) {
|
|
7
|
+
const century = Math.floor(today / 100) * 100;
|
|
8
|
+
let best = century + year;
|
|
9
|
+
for (const candidate of [century - 100 + year, century + year, century + 100 + year]) {
|
|
10
|
+
const distance = Math.abs(candidate - today);
|
|
11
|
+
const bestDistance = Math.abs(best - today);
|
|
12
|
+
if (distance < bestDistance || (distance === bestDistance && candidate < best)) {
|
|
13
|
+
best = candidate;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return best;
|
|
17
|
+
}
|
|
18
|
+
function monthFromWord(word, locale) {
|
|
19
|
+
const needle = fold(word);
|
|
20
|
+
if (needle.length < 3)
|
|
21
|
+
return null;
|
|
22
|
+
for (const width of ["long", "short"]) {
|
|
23
|
+
const names = getMonthNames(locale, width);
|
|
24
|
+
for (let index = 0; index < names.length; index += 1) {
|
|
25
|
+
if (fold(names[index].replace(/\.$/, "")) === needle) {
|
|
26
|
+
return index + 1;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Parse typed text into a date: ISO, the locale's numeric order with any
|
|
34
|
+
* separators, month names (long or short, any case, accents ignored), CJK
|
|
35
|
+
* `2026年11月17日`, and two-digit years.
|
|
36
|
+
*/
|
|
37
|
+
export function parseDate(text, context = {}) {
|
|
38
|
+
const latin = toLatinDigits(text.trim(), context.locale);
|
|
39
|
+
if (latin === "")
|
|
40
|
+
return { error: "empty" };
|
|
41
|
+
const todayYear = (context.today ?? readToday(context.timeZone)).year;
|
|
42
|
+
const finish = (year, yearText, month, day) => {
|
|
43
|
+
const fullYear = yearText.length <= 2 ? resolveTwoDigitYear(year, todayYear) : year;
|
|
44
|
+
return isValidDate(fullYear, month, day)
|
|
45
|
+
? { date: plainDate(fullYear, month, day) }
|
|
46
|
+
: { error: "invalid-date" };
|
|
47
|
+
};
|
|
48
|
+
const tokens = tokenize(latin, context.locale);
|
|
49
|
+
const numbers = tokens.filter((token) => token.type === "number");
|
|
50
|
+
const words = tokens.filter((token) => token.type === "word");
|
|
51
|
+
const { order } = getDatePartOrder(context.locale);
|
|
52
|
+
if (words.length > 1)
|
|
53
|
+
return { error: "unparseable" };
|
|
54
|
+
if (words.length === 1) {
|
|
55
|
+
const month = monthFromWord(words[0]?.text ?? "", context.locale);
|
|
56
|
+
if (month === null || numbers.length !== 2)
|
|
57
|
+
return { error: "unparseable" };
|
|
58
|
+
let first = numbers[0];
|
|
59
|
+
let second = numbers[1];
|
|
60
|
+
const rest = order.filter((part) => part !== "month");
|
|
61
|
+
if (first.text.length === 4 || (rest[0] === "year" && second.text.length !== 4)) {
|
|
62
|
+
[first, second] = [second, first];
|
|
63
|
+
}
|
|
64
|
+
// `first` is the day, `second` the year.
|
|
65
|
+
return finish(second.value, second.text, month, first.value);
|
|
66
|
+
}
|
|
67
|
+
if (numbers.length !== 3)
|
|
68
|
+
return { error: "unparseable" };
|
|
69
|
+
const [a, b, c] = numbers;
|
|
70
|
+
if (a.text.length === 4)
|
|
71
|
+
return finish(a.value, a.text, b.value, c.value);
|
|
72
|
+
const byPart = {};
|
|
73
|
+
order.forEach((part, index) => {
|
|
74
|
+
byPart[part] = [a, b, c][index];
|
|
75
|
+
});
|
|
76
|
+
const year = byPart.year;
|
|
77
|
+
return finish(year.value, year.text, byPart.month.value, byPart.day.value);
|
|
78
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type DateConstraints, type PlainDate } from "../../foundation/index.js";
|
|
2
|
+
export type DateValidity = "empty" | "incomplete" | "invalid-date" | "before-min" | "after-max" | "disabled" | "unavailable" | "valid";
|
|
3
|
+
/** `filled` is how many of the three parts hold a value. */
|
|
4
|
+
export declare function getValidity(filled: number, date: PlainDate | null, constraints: DateConstraints): DateValidity;
|
|
5
|
+
/** A field is invalid when it has content that is not a selectable date. */
|
|
6
|
+
export declare const isInvalid: (validity: string) => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getDateStatus } from "../../foundation/index.js";
|
|
2
|
+
/** `filled` is how many of the three parts hold a value. */
|
|
3
|
+
export function getValidity(filled, date, constraints) {
|
|
4
|
+
if (filled === 0)
|
|
5
|
+
return "empty";
|
|
6
|
+
if (filled < 3)
|
|
7
|
+
return "incomplete";
|
|
8
|
+
if (!date)
|
|
9
|
+
return "invalid-date";
|
|
10
|
+
return getDateStatus(date, constraints).reason ?? "valid";
|
|
11
|
+
}
|
|
12
|
+
/** A field is invalid when it has content that is not a selectable date. */
|
|
13
|
+
export const isInvalid = (validity) => validity !== "valid" && validity !== "empty";
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { type Attributes, type Availability, type AvailabilitySpec, type DateInput, type DateRange, type DayOfWeek, type Messages, type PlainDate, type WeekdayHeader } from "../../foundation/index.js";
|
|
2
|
+
import { type RangeReason } from "../selection/range.js";
|
|
3
|
+
import type { DateRangeValue, DateValue, MultiDateValue, PanelLevel } from "../types.js";
|
|
4
|
+
export type PanelModifiers = {
|
|
5
|
+
shift: boolean;
|
|
6
|
+
ctrl: boolean;
|
|
7
|
+
meta: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type PanelMonthValue = {
|
|
10
|
+
year: number;
|
|
11
|
+
month: number;
|
|
12
|
+
};
|
|
13
|
+
export type PanelKind = "single" | "range" | "multi";
|
|
14
|
+
type Range = {
|
|
15
|
+
start: PlainDate;
|
|
16
|
+
end: PlainDate;
|
|
17
|
+
};
|
|
18
|
+
export type DatePanelBaseOptions = {
|
|
19
|
+
id?: string;
|
|
20
|
+
visibleMonth?: PanelMonthValue;
|
|
21
|
+
defaultVisibleMonth?: PanelMonthValue;
|
|
22
|
+
onVisibleMonthChange?: (month: PanelMonthValue) => void;
|
|
23
|
+
level?: PanelLevel;
|
|
24
|
+
defaultLevel?: PanelLevel;
|
|
25
|
+
onLevelChange?: (level: PanelLevel) => void;
|
|
26
|
+
minLevel?: PanelLevel;
|
|
27
|
+
maxLevel?: PanelLevel;
|
|
28
|
+
/** Months shown side by side. */
|
|
29
|
+
months?: number;
|
|
30
|
+
pageBy?: "month" | "visible";
|
|
31
|
+
/** Show the month of a value that changes from outside (default true). */
|
|
32
|
+
followValue?: boolean;
|
|
33
|
+
autoFocus?: boolean | undefined;
|
|
34
|
+
min?: DateInput | undefined;
|
|
35
|
+
max?: DateInput | undefined;
|
|
36
|
+
isDateDisabled?: (date: PlainDate) => boolean;
|
|
37
|
+
isDateUnavailable?: ((date: PlainDate) => boolean) | undefined;
|
|
38
|
+
/** Availability model (plan 11 V7): fully unavailable days are not selectable, partial days are. */
|
|
39
|
+
availability?: AvailabilitySpec | Availability | undefined;
|
|
40
|
+
locale?: string | undefined;
|
|
41
|
+
weekStartsOn?: DayOfWeek;
|
|
42
|
+
timeZone?: string | undefined;
|
|
43
|
+
now?: number | undefined;
|
|
44
|
+
weekNumbers?: "iso" | "locale" | false;
|
|
45
|
+
readOnly?: boolean | undefined;
|
|
46
|
+
disabled?: boolean | undefined;
|
|
47
|
+
messages?: Partial<Messages> | undefined;
|
|
48
|
+
/** `today()` also picks today (single panel). */
|
|
49
|
+
selectToday?: boolean;
|
|
50
|
+
};
|
|
51
|
+
export type DatePanelOptions = DatePanelBaseOptions & {
|
|
52
|
+
value?: DateValue;
|
|
53
|
+
defaultValue?: DateValue;
|
|
54
|
+
onValueChange?: (value: DateValue) => void;
|
|
55
|
+
onValueCommit?: (value: PlainDate) => void;
|
|
56
|
+
};
|
|
57
|
+
export type DateRangePanelOptions = DatePanelBaseOptions & {
|
|
58
|
+
value?: DateRangeValue;
|
|
59
|
+
defaultValue?: DateRangeValue;
|
|
60
|
+
onValueChange?: (value: DateRangeValue) => void;
|
|
61
|
+
onValueCommit?: (value: DateRange) => void;
|
|
62
|
+
onRangePreviewChange?: (preview: DateRange | null) => void;
|
|
63
|
+
onInvalidRange?: (reason: RangeReason) => void;
|
|
64
|
+
minDays?: number | ((start: PlainDate) => number);
|
|
65
|
+
maxDays?: number | ((start: PlainDate) => number);
|
|
66
|
+
allowUnavailableInside?: boolean;
|
|
67
|
+
allowDisabledInside?: boolean;
|
|
68
|
+
};
|
|
69
|
+
export type MultiDatePanelOptions = DatePanelBaseOptions & {
|
|
70
|
+
value?: MultiDateValue;
|
|
71
|
+
defaultValue?: MultiDateValue;
|
|
72
|
+
onValueChange?: (value: MultiDateValue) => void;
|
|
73
|
+
onValueCommit?: (value: MultiDateValue) => void;
|
|
74
|
+
maxSelected?: number;
|
|
75
|
+
};
|
|
76
|
+
export type PanelDay = {
|
|
77
|
+
date: PlainDate;
|
|
78
|
+
key: string;
|
|
79
|
+
hidden: boolean;
|
|
80
|
+
outsideMonth: boolean;
|
|
81
|
+
today: boolean;
|
|
82
|
+
weekend: boolean;
|
|
83
|
+
selected: boolean;
|
|
84
|
+
disabled: boolean;
|
|
85
|
+
unavailable: boolean;
|
|
86
|
+
partiallyAvailable: boolean;
|
|
87
|
+
blocked: boolean;
|
|
88
|
+
focused: boolean;
|
|
89
|
+
rangeStart: boolean;
|
|
90
|
+
rangeEnd: boolean;
|
|
91
|
+
inRange: boolean;
|
|
92
|
+
preview: boolean;
|
|
93
|
+
};
|
|
94
|
+
export type PanelMonth = {
|
|
95
|
+
key: string;
|
|
96
|
+
title: string;
|
|
97
|
+
weeks: {
|
|
98
|
+
weekNumber: number;
|
|
99
|
+
days: PanelDay[];
|
|
100
|
+
}[];
|
|
101
|
+
};
|
|
102
|
+
/** A month (key `2026-11`) or year (key `2026`) cell of the upper levels. */
|
|
103
|
+
export type PanelCell = {
|
|
104
|
+
key: string;
|
|
105
|
+
year: number;
|
|
106
|
+
month: number;
|
|
107
|
+
label: string;
|
|
108
|
+
text: string;
|
|
109
|
+
selected: boolean;
|
|
110
|
+
disabled: boolean;
|
|
111
|
+
focused: boolean;
|
|
112
|
+
current: boolean;
|
|
113
|
+
outside: boolean;
|
|
114
|
+
};
|
|
115
|
+
export type PanelState = {
|
|
116
|
+
id: string;
|
|
117
|
+
kind: PanelKind;
|
|
118
|
+
level: PanelLevel;
|
|
119
|
+
value: DateValue | DateRangeValue | MultiDateValue;
|
|
120
|
+
draft: boolean;
|
|
121
|
+
preview: Range | null;
|
|
122
|
+
visibleMonth: PanelMonthValue;
|
|
123
|
+
title: string;
|
|
124
|
+
today: PlainDate;
|
|
125
|
+
focusedDate: PlainDate;
|
|
126
|
+
weekdays: WeekdayHeader[];
|
|
127
|
+
weekNumbers: boolean;
|
|
128
|
+
months: PanelMonth[];
|
|
129
|
+
cells: PanelCell[];
|
|
130
|
+
canGoPrev: boolean;
|
|
131
|
+
canGoNext: boolean;
|
|
132
|
+
canGoUp: boolean;
|
|
133
|
+
readOnly: boolean;
|
|
134
|
+
disabled: boolean;
|
|
135
|
+
autoFocus: boolean;
|
|
136
|
+
direction: "ltr" | "rtl";
|
|
137
|
+
locale?: string;
|
|
138
|
+
messages: Messages;
|
|
139
|
+
/** Number of selected dates (multi) or days in the range. */
|
|
140
|
+
count: number;
|
|
141
|
+
};
|
|
142
|
+
export type PanelController<V, O> = {
|
|
143
|
+
getState(): PanelState;
|
|
144
|
+
subscribe(listener: (state: PanelState) => void): () => void;
|
|
145
|
+
setOptions(options: Partial<O>): void;
|
|
146
|
+
/** Controllers are generic over the value type only for the typed `getValue`. */
|
|
147
|
+
getValue(): V;
|
|
148
|
+
pick(date: PlainDate, source: "pointer" | "keyboard"): void;
|
|
149
|
+
/** Multi: add every selectable day from the last toggled day. */
|
|
150
|
+
extendTo(date: PlainDate): void;
|
|
151
|
+
setPreview(date: PlainDate | null): void;
|
|
152
|
+
cancelDraft(): void;
|
|
153
|
+
clear(): void;
|
|
154
|
+
commit(): void;
|
|
155
|
+
today(): void;
|
|
156
|
+
prev(): void;
|
|
157
|
+
next(): void;
|
|
158
|
+
setLevel(level: PanelLevel): void;
|
|
159
|
+
focusDate(date: PlainDate): void;
|
|
160
|
+
handleKeyDown(key: string, modifiers: PanelModifiers): boolean;
|
|
161
|
+
getRootAttributes(): Attributes;
|
|
162
|
+
getTitleAttributes(): Attributes;
|
|
163
|
+
getLevelButtonAttributes(): Attributes;
|
|
164
|
+
getNavAttributes(kind: "prev" | "next"): Attributes;
|
|
165
|
+
getTodayButtonAttributes(): Attributes;
|
|
166
|
+
getGridAttributes(): Attributes;
|
|
167
|
+
getColumnHeaderAttributes(header: WeekdayHeader): Attributes;
|
|
168
|
+
getWeekNumberAttributes(weekNumber: number): Attributes;
|
|
169
|
+
getCellAttributes(day: PanelDay): Attributes;
|
|
170
|
+
getLevelCellAttributes(cell: PanelCell): Attributes;
|
|
171
|
+
destroy(): void;
|
|
172
|
+
};
|
|
173
|
+
export declare const createDatePanelController: (options?: DatePanelOptions) => PanelController<DateValue, DatePanelOptions>;
|
|
174
|
+
export declare const createDateRangePanelController: (options?: DateRangePanelOptions) => PanelController<DateRangeValue, DateRangePanelOptions>;
|
|
175
|
+
export declare const createMultiDatePanelController: (options?: MultiDatePanelOptions) => PanelController<MultiDateValue, MultiDatePanelOptions>;
|
|
176
|
+
export {};
|