@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,23 @@
|
|
|
1
|
+
import { type DateRange, type DayOfWeek, type PlainDate, type WeekInfo } from "../../foundation/index.js";
|
|
2
|
+
import { type MonthLayout } from "./month-layout.js";
|
|
3
|
+
export type MiniCalendarLayoutOptions = {
|
|
4
|
+
month: {
|
|
5
|
+
year: number;
|
|
6
|
+
month: number;
|
|
7
|
+
};
|
|
8
|
+
weekStartsOn: DayOfWeek;
|
|
9
|
+
weekInfo: Pick<WeekInfo, "weekend" | "firstDay" | "minimalDays">;
|
|
10
|
+
locale?: string | undefined;
|
|
11
|
+
today: PlainDate;
|
|
12
|
+
focusedDate: PlainDate;
|
|
13
|
+
/** Days inside it get `inRange` (the main calendar's visible range, C11). */
|
|
14
|
+
highlight?: DateRange | undefined;
|
|
15
|
+
isMarked?: ((date: PlainDate) => boolean) | undefined;
|
|
16
|
+
selectedDate?: PlainDate | undefined;
|
|
17
|
+
isHighlighted?: ((date: PlainDate) => boolean) | undefined;
|
|
18
|
+
min?: PlainDate | undefined;
|
|
19
|
+
max?: PlainDate | undefined;
|
|
20
|
+
weekNumbers?: "iso" | "locale" | false | undefined;
|
|
21
|
+
};
|
|
22
|
+
/** One 6-row month grid. Every day adds `marked`, and `inRange` for the synced range. */
|
|
23
|
+
export declare function getMiniCalendarLayout(options: MiniCalendarLayoutOptions): MonthLayout;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { plainDate, } from "../../foundation/index.js";
|
|
2
|
+
import { getMonthLayout } from "./month-layout.js";
|
|
3
|
+
/** One 6-row month grid. Every day adds `marked`, and `inRange` for the synced range. */
|
|
4
|
+
export function getMiniCalendarLayout(options) {
|
|
5
|
+
const first = plainDate(options.month.year, options.month.month, 1);
|
|
6
|
+
const ctx = {
|
|
7
|
+
definition: {
|
|
8
|
+
id: "mini",
|
|
9
|
+
layout: "month",
|
|
10
|
+
length: { months: 1 },
|
|
11
|
+
align: "month",
|
|
12
|
+
fixedWeeks: true,
|
|
13
|
+
},
|
|
14
|
+
range: { start: first, end: first },
|
|
15
|
+
inRangeOf: options.highlight ?? null,
|
|
16
|
+
visibleRange: { start: first, end: first },
|
|
17
|
+
focusedDate: options.focusedDate,
|
|
18
|
+
hiddenDays: [],
|
|
19
|
+
weekStartsOn: options.weekStartsOn,
|
|
20
|
+
weekInfo: options.weekInfo,
|
|
21
|
+
locale: options.locale,
|
|
22
|
+
today: options.today,
|
|
23
|
+
min: options.min,
|
|
24
|
+
max: options.max,
|
|
25
|
+
selectedDate: options.selectedDate,
|
|
26
|
+
isHighlighted: options.isHighlighted,
|
|
27
|
+
isMarked: options.isMarked,
|
|
28
|
+
weekNumbers: options.weekNumbers ?? false,
|
|
29
|
+
};
|
|
30
|
+
return getMonthLayout(ctx);
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type DateRange, type DayOfWeek, type PlainDate, type WeekInfo, type WeekdayHeader } from "../../foundation/index.js";
|
|
2
|
+
import { type ViewDefinition } from "../navigation/view-definition.js";
|
|
3
|
+
import { type CalendarDay, type DayContext } from "./day.js";
|
|
4
|
+
export type CalendarWeek = {
|
|
5
|
+
weekNumber: number;
|
|
6
|
+
days: CalendarDay[];
|
|
7
|
+
};
|
|
8
|
+
export type MonthGridModel = {
|
|
9
|
+
year: number;
|
|
10
|
+
month: number;
|
|
11
|
+
weeks: CalendarWeek[];
|
|
12
|
+
};
|
|
13
|
+
export type MonthLayout = {
|
|
14
|
+
kind: "month";
|
|
15
|
+
months: MonthGridModel[];
|
|
16
|
+
/** Header cells for the visible columns. */
|
|
17
|
+
weekdays: WeekdayHeader[];
|
|
18
|
+
/** Whether the app asked for week numbers. */
|
|
19
|
+
weekNumbers: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type LayoutContext = DayContext & {
|
|
22
|
+
definition: ViewDefinition;
|
|
23
|
+
visibleRange: DateRange;
|
|
24
|
+
weekStartsOn: DayOfWeek;
|
|
25
|
+
weekInfo: Pick<WeekInfo, "weekend" | "firstDay" | "minimalDays">;
|
|
26
|
+
locale?: string | undefined;
|
|
27
|
+
today: PlainDate;
|
|
28
|
+
weekNumbers: "iso" | "locale" | false;
|
|
29
|
+
};
|
|
30
|
+
export declare function getMonthLayout(ctx: LayoutContext): MonthLayout;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { dayOfWeekFromEpochDay, endOfWeek, fromEpochDay, getIsoWeek, getLocaleWeek, getMonths, getWeekdayHeaders, isDateInRange, isSameDay, startOfWeek, toEpochDay, } from "../../foundation/index.js";
|
|
2
|
+
import { getMonthCount } from "../navigation/view-definition.js";
|
|
3
|
+
import { makeDay } from "./day.js";
|
|
4
|
+
function weekNumberOf(days, ctx) {
|
|
5
|
+
if (ctx.weekNumbers === "locale") {
|
|
6
|
+
return getLocaleWeek(days[0].date, ctx.weekInfo).week;
|
|
7
|
+
}
|
|
8
|
+
const thursday = days.find((day) => day.dayOfWeek === 4) ?? days[0];
|
|
9
|
+
return getIsoWeek(thursday.date).week;
|
|
10
|
+
}
|
|
11
|
+
export function getMonthLayout(ctx) {
|
|
12
|
+
const { definition, range } = ctx;
|
|
13
|
+
const weekdays = getWeekdayHeaders(ctx.locale, {
|
|
14
|
+
weekStartsOn: ctx.weekStartsOn,
|
|
15
|
+
hiddenDays: ctx.hiddenDays,
|
|
16
|
+
});
|
|
17
|
+
const base = {
|
|
18
|
+
kind: "month",
|
|
19
|
+
weekdays,
|
|
20
|
+
weekNumbers: ctx.weekNumbers !== false,
|
|
21
|
+
};
|
|
22
|
+
if (definition.length.months !== undefined) {
|
|
23
|
+
const grids = getMonths(range.start, getMonthCount(definition), {
|
|
24
|
+
weekStartsOn: ctx.weekStartsOn,
|
|
25
|
+
weekInfo: ctx.weekInfo,
|
|
26
|
+
fixedWeeks: definition.fixedWeeks,
|
|
27
|
+
today: ctx.today,
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
...base,
|
|
31
|
+
months: grids.map((grid) => ({
|
|
32
|
+
year: grid.year,
|
|
33
|
+
month: grid.month,
|
|
34
|
+
weeks: grid.weeks.map((week) => {
|
|
35
|
+
const days = week.days.map((day) => makeDay(day, ctx));
|
|
36
|
+
return { weekNumber: weekNumberOf(days, ctx), days };
|
|
37
|
+
}),
|
|
38
|
+
})),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// Days or weeks in a month layout: one block of whole weeks around the range.
|
|
42
|
+
const start = toEpochDay(startOfWeek(range.start, ctx.weekStartsOn));
|
|
43
|
+
const end = toEpochDay(endOfWeek(range.end, ctx.weekStartsOn));
|
|
44
|
+
const weeks = [];
|
|
45
|
+
for (let first = start; first <= end; first += 7) {
|
|
46
|
+
const days = Array.from({ length: 7 }, (_, index) => {
|
|
47
|
+
const date = fromEpochDay(first + index);
|
|
48
|
+
const weekday = dayOfWeekFromEpochDay(first + index);
|
|
49
|
+
return makeDay({
|
|
50
|
+
date,
|
|
51
|
+
dayOfWeek: weekday,
|
|
52
|
+
outsideMonth: !isDateInRange(date, range),
|
|
53
|
+
weekend: ctx.weekInfo.weekend.includes(weekday),
|
|
54
|
+
today: isSameDay(date, ctx.today),
|
|
55
|
+
}, ctx);
|
|
56
|
+
});
|
|
57
|
+
weeks.push({ weekNumber: weekNumberOf(days, ctx), days });
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
...base,
|
|
61
|
+
months: [{ year: range.start.year, month: range.start.month, weeks }],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type DayOfWeek, type TimeSlot, type WeekdayHeader, type TimeInput } from "../../foundation/index.js";
|
|
2
|
+
import { type CalendarDay } from "./day.js";
|
|
3
|
+
import type { LayoutContext } from "./month-layout.js";
|
|
4
|
+
export type TimeGridOptions = {
|
|
5
|
+
start?: TimeInput;
|
|
6
|
+
/** Exclusive. Omit for 24:00. */
|
|
7
|
+
end?: TimeInput;
|
|
8
|
+
/** Minutes per slot (default 30). */
|
|
9
|
+
step?: number;
|
|
10
|
+
workingHours?: {
|
|
11
|
+
start: TimeInput;
|
|
12
|
+
end: TimeInput;
|
|
13
|
+
days?: DayOfWeek[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type TimeGridLayout = {
|
|
17
|
+
kind: "time-grid";
|
|
18
|
+
/** Visible columns only. */
|
|
19
|
+
days: CalendarDay[];
|
|
20
|
+
slots: TimeSlot[];
|
|
21
|
+
/** One header per entry of `days`. */
|
|
22
|
+
weekdays: WeekdayHeader[];
|
|
23
|
+
/** Days of the week that count as working days (all when not set). */
|
|
24
|
+
workingDays: DayOfWeek[];
|
|
25
|
+
};
|
|
26
|
+
export declare function getTimeGridLayout(ctx: LayoutContext, options?: TimeGridOptions): TimeGridLayout;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getTimeAxis, getWeekdayHeaders, toPlainTime, } from "../../foundation/index.js";
|
|
2
|
+
import { visibleDays } from "./day.js";
|
|
3
|
+
export function getTimeGridLayout(ctx, options = {}) {
|
|
4
|
+
const days = visibleDays(ctx);
|
|
5
|
+
const headers = new Map(getWeekdayHeaders(ctx.locale, { weekStartsOn: 1 }).map((header) => [header.dayOfWeek, header]));
|
|
6
|
+
const workingHours = options.workingHours;
|
|
7
|
+
const slots = getTimeAxis({
|
|
8
|
+
start: options.start === undefined ? undefined : toPlainTime(options.start),
|
|
9
|
+
end: options.end === undefined ? undefined : toPlainTime(options.end),
|
|
10
|
+
step: { minutes: options.step ?? 30 },
|
|
11
|
+
workingHours: workingHours
|
|
12
|
+
? [
|
|
13
|
+
{
|
|
14
|
+
start: toPlainTime(workingHours.start),
|
|
15
|
+
end: toPlainTime(workingHours.end),
|
|
16
|
+
},
|
|
17
|
+
]
|
|
18
|
+
: undefined,
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
kind: "time-grid",
|
|
22
|
+
days,
|
|
23
|
+
slots,
|
|
24
|
+
weekdays: days.map((day) => headers.get(day.dayOfWeek)),
|
|
25
|
+
workingDays: workingHours?.days ?? [1, 2, 3, 4, 5, 6, 7],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./panel/panel-controller.js";
|
|
3
|
+
export * from "./selection/range.js";
|
|
4
|
+
export * from "./selection/multiple.js";
|
|
5
|
+
export * from "./input/parse.js";
|
|
6
|
+
export * from "./input/validity.js";
|
|
7
|
+
export * from "./input/date-input-controller.js";
|
|
8
|
+
export * from "./input/date-range-input-controller.js";
|
|
9
|
+
export * from "./presets.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./panel/panel-controller.js";
|
|
3
|
+
export * from "./selection/range.js";
|
|
4
|
+
export * from "./selection/multiple.js";
|
|
5
|
+
export * from "./input/parse.js";
|
|
6
|
+
export * from "./input/validity.js";
|
|
7
|
+
export * from "./input/date-input-controller.js";
|
|
8
|
+
export * from "./input/date-range-input-controller.js";
|
|
9
|
+
export * from "./presets.js";
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type Attributes, type Availability, type AvailabilitySpec, type DateInput, type HiddenInput, type Messages, type PlainDate } from "../../foundation/index.js";
|
|
2
|
+
import type { DateValue, PartName } from "../types.js";
|
|
3
|
+
import { type ParseContext } from "./parse.js";
|
|
4
|
+
import { type DateValidity } from "./validity.js";
|
|
5
|
+
export type FormatContext = {
|
|
6
|
+
locale?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
export type DateInputOptions = {
|
|
9
|
+
id?: string;
|
|
10
|
+
value?: DateValue;
|
|
11
|
+
defaultValue?: DateValue | undefined;
|
|
12
|
+
onValueChange?: (value: DateValue) => void;
|
|
13
|
+
/** On blur or Enter with a valid value. */
|
|
14
|
+
onValueCommit?: (value: PlainDate) => void;
|
|
15
|
+
mode?: "segmented" | "text" | undefined;
|
|
16
|
+
/** The value ↑/↓ starts from on an empty part (default today). */
|
|
17
|
+
placeholderValue?: DateInput;
|
|
18
|
+
parse?: (text: string, context: ParseContext) => PlainDate | null;
|
|
19
|
+
format?: (date: PlainDate, context: FormatContext) => string;
|
|
20
|
+
onInvalidInput?: ((text: string) => void) | undefined;
|
|
21
|
+
name?: string;
|
|
22
|
+
required?: boolean | undefined;
|
|
23
|
+
readOnly?: boolean | undefined;
|
|
24
|
+
disabled?: boolean | undefined;
|
|
25
|
+
min?: DateInput | undefined;
|
|
26
|
+
max?: DateInput | undefined;
|
|
27
|
+
isDateDisabled?: (date: PlainDate) => boolean;
|
|
28
|
+
isDateUnavailable?: ((date: PlainDate) => boolean) | undefined;
|
|
29
|
+
/** Availability model (plan 11 V7): fully unavailable days are not selectable. */
|
|
30
|
+
availability?: AvailabilitySpec | Availability | undefined;
|
|
31
|
+
locale?: string | undefined;
|
|
32
|
+
timeZone?: string | undefined;
|
|
33
|
+
now?: number | undefined;
|
|
34
|
+
messages?: Partial<Messages> | undefined;
|
|
35
|
+
/** Internal: called when focus tries to leave the first (-1) or last (1) part. */
|
|
36
|
+
onFocusEdge?: (direction: 1 | -1) => void;
|
|
37
|
+
};
|
|
38
|
+
export type SegmentView = {
|
|
39
|
+
type: PartName | "literal";
|
|
40
|
+
text: string;
|
|
41
|
+
value: number | null;
|
|
42
|
+
placeholder: string;
|
|
43
|
+
min: number;
|
|
44
|
+
max: number;
|
|
45
|
+
valueText: string;
|
|
46
|
+
editable: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type DateInputState = {
|
|
49
|
+
id: string;
|
|
50
|
+
mode: "segmented" | "text";
|
|
51
|
+
segments: SegmentView[];
|
|
52
|
+
text: string;
|
|
53
|
+
value: DateValue;
|
|
54
|
+
validity: DateValidity;
|
|
55
|
+
/** The part that holds the tab stop (and receives focus after typing). */
|
|
56
|
+
focusedPart: PartName;
|
|
57
|
+
/** Text-mode hint such as `dd/mm/yyyy`. */
|
|
58
|
+
pattern: string;
|
|
59
|
+
required: boolean;
|
|
60
|
+
readOnly: boolean;
|
|
61
|
+
disabled: boolean;
|
|
62
|
+
direction: "ltr" | "rtl";
|
|
63
|
+
locale?: string;
|
|
64
|
+
messages: Messages;
|
|
65
|
+
hidden: HiddenInput[];
|
|
66
|
+
};
|
|
67
|
+
export type KeyModifiers = {
|
|
68
|
+
shift: boolean;
|
|
69
|
+
ctrl: boolean;
|
|
70
|
+
meta: boolean;
|
|
71
|
+
};
|
|
72
|
+
export type DateInputController = {
|
|
73
|
+
getState(): DateInputState;
|
|
74
|
+
subscribe(listener: (state: DateInputState) => void): () => void;
|
|
75
|
+
setOptions(options: Partial<DateInputOptions>): void;
|
|
76
|
+
/** Keyboard input on a segment. Returns true when the key was consumed. */
|
|
77
|
+
handleKeyDown(part: PartName, key: string, modifiers: KeyModifiers): boolean;
|
|
78
|
+
focusPart(part: PartName): void;
|
|
79
|
+
/** Finish pending typing (a 2-digit year). Call when focus leaves a part. */
|
|
80
|
+
settle(): void;
|
|
81
|
+
paste(text: string): boolean;
|
|
82
|
+
setText(text: string): void;
|
|
83
|
+
/** Text mode: parse on blur, Enter and paste. Returns true when the text became a date or was empty. */
|
|
84
|
+
commitText(): boolean;
|
|
85
|
+
/** Fire `onValueCommit` for a valid value (blur, Enter). */
|
|
86
|
+
commit(): void;
|
|
87
|
+
clear(): void;
|
|
88
|
+
/** Restore `defaultValue` (form reset). */
|
|
89
|
+
reset(): void;
|
|
90
|
+
handleTextKeyDown(key: string): boolean;
|
|
91
|
+
getRootAttributes(): Attributes;
|
|
92
|
+
getSegmentAttributes(segment: SegmentView): Attributes;
|
|
93
|
+
getTextFieldAttributes(): Attributes;
|
|
94
|
+
getClearButtonAttributes(): Attributes;
|
|
95
|
+
destroy(): void;
|
|
96
|
+
};
|
|
97
|
+
export declare function createDateInputController(initial?: DateInputOptions): DateInputController;
|