@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,73 @@
|
|
|
1
|
+
import { compileAvailability, toPlainDate, toPlainDateTime, } from "../foundation/index.js";
|
|
2
|
+
import { withOptional } from "../foundation/store/with-optional.js";
|
|
3
|
+
const pad = (value) => String(value).padStart(2, "0");
|
|
4
|
+
/** The wall-clock ISO form of a date or date-time value, without a zone suffix. */
|
|
5
|
+
export function wallIso(value, timeZone, allDay) {
|
|
6
|
+
if (timeZone !== undefined || allDay) {
|
|
7
|
+
const zone = timeZone ?? "UTC";
|
|
8
|
+
if (allDay) {
|
|
9
|
+
return wallIso(toPlainDate(value, zone));
|
|
10
|
+
}
|
|
11
|
+
return wallIso(toPlainDateTime(value, zone));
|
|
12
|
+
}
|
|
13
|
+
if (typeof value === "object" && !("year" in value)) {
|
|
14
|
+
// A `Date`: read through the foundation (UTC), never the host zone.
|
|
15
|
+
return wallIso(toPlainDate(value, "UTC"));
|
|
16
|
+
}
|
|
17
|
+
if (typeof value === "string") {
|
|
18
|
+
const match = /^(\d{4}-\d{2}-\d{2})(?:T(\d{2}:\d{2}(?::\d{2})?))?/.exec(value);
|
|
19
|
+
if (match) {
|
|
20
|
+
return match[2] ? `${match[1]}T${match[2]}` : match[1];
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
const date = `${value.year}-${pad(value.month)}-${pad(value.day)}`;
|
|
25
|
+
if ("hour" in value) {
|
|
26
|
+
return `${date}T${pad(value.hour)}:${pad(value.minute)}:${pad(value.second)}`;
|
|
27
|
+
}
|
|
28
|
+
return date;
|
|
29
|
+
}
|
|
30
|
+
function eventResourceMatch(event, resourceId) {
|
|
31
|
+
if (resourceId === undefined) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
const value = event.resourceId;
|
|
35
|
+
if (value === undefined) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return Array.isArray(value) ? value.includes(resourceId) : value === resourceId;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Turn bookings into `blocked` rules (plan 11 V11). All-day events run
|
|
42
|
+
* `[start, end)` on dates; timed events on wall times. Pass `excludeId` while
|
|
43
|
+
* dragging so the moved event does not block itself (R6).
|
|
44
|
+
*/
|
|
45
|
+
export function availabilityFromEvents(events, options = {}) {
|
|
46
|
+
const rules = [];
|
|
47
|
+
for (const event of events) {
|
|
48
|
+
if (options.excludeId !== undefined && event.id === options.excludeId) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (!eventResourceMatch(event, options.resourceId)) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
rules.push(withOptional({
|
|
55
|
+
type: "range",
|
|
56
|
+
start: wallIso(event.start, options.timeZone, event.allDay),
|
|
57
|
+
end: wallIso(event.end, options.timeZone, event.allDay),
|
|
58
|
+
id: String(event.id),
|
|
59
|
+
reason: options.reason?.(event),
|
|
60
|
+
data: event,
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
return options.timeZone === undefined
|
|
64
|
+
? { blocked: rules }
|
|
65
|
+
: { blocked: rules, timeZone: options.timeZone };
|
|
66
|
+
}
|
|
67
|
+
export function resolveCalendarAvailability(input, context, options = {}) {
|
|
68
|
+
if (input === undefined) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
const value = typeof input === "function" ? input(context) : input;
|
|
72
|
+
return compileAvailability(value, options);
|
|
73
|
+
}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { type Attributes, type AvailabilityRule, type AvailabilitySpec, type DateInput, type DateRange, type DayOfWeek, type Messages, type PlainDate, type TimeSlot, type WeekdayHeader } from "../../foundation/index.js";
|
|
2
|
+
import { type CalendarAvailabilityInput } from "../availability.js";
|
|
3
|
+
import { type BackgroundMode, type BackgroundPiece, type TimelineBackgroundPiece } from "../events/background-layout.js";
|
|
4
|
+
import { type CalendarTitle } from "../navigation/title.js";
|
|
5
|
+
import { type CustomViews, type ViewDefinition } from "../navigation/view-definition.js";
|
|
6
|
+
import { type CalendarDay } from "../views/day.js";
|
|
7
|
+
import { type ListLayout } from "../views/list-layout.js";
|
|
8
|
+
import { type MonthLayout } from "../views/month-layout.js";
|
|
9
|
+
import { type TimeGridLayout, type TimeGridOptions } from "../views/time-grid-layout.js";
|
|
10
|
+
import { type DayOverflow } from "../events/index.js";
|
|
11
|
+
import type { AllDayRowSegment, CalendarEventInput, CalendarEvents, SelectionProposal } from "../events/types.js";
|
|
12
|
+
import { type NowIndicator } from "../events/now-indicator.js";
|
|
13
|
+
import { type SelectionCell, type SelectionRange } from "../interaction/selection.js";
|
|
14
|
+
import { type FocusState } from "../interaction/event-focus.js";
|
|
15
|
+
import type { ResourceId, ResourceInput, ResourceLayout, ResourceColumn, ResourceGrouping, ResourceGroupHeader, TimelineHeaderCell, TimelineRow, TimelineSlot, WindowRange } from "../resources/types.js";
|
|
16
|
+
import type { PendingChange } from "../interaction/pending.js";
|
|
17
|
+
import { type DragState, type EventChangeProposal } from "./drag-engine.js";
|
|
18
|
+
import type { HitPoint, HitTarget } from "../interaction/hit-test.js";
|
|
19
|
+
import type { RecurrenceInfo, RecurrencePack, RRuleError } from "../recurrence/types.js";
|
|
20
|
+
import { type Modifiers } from "./shared.js";
|
|
21
|
+
export type CalendarMessages = Messages;
|
|
22
|
+
export type CalendarLayout = MonthLayout | TimeGridLayout | ListLayout;
|
|
23
|
+
export type CalendarOptions<TEvent extends CalendarEventInput = CalendarEventInput> = {
|
|
24
|
+
id?: string;
|
|
25
|
+
view?: string;
|
|
26
|
+
defaultView?: string;
|
|
27
|
+
onViewChange?: (view: string) => void;
|
|
28
|
+
date?: DateInput;
|
|
29
|
+
defaultDate?: DateInput;
|
|
30
|
+
onDateChange?: (date: PlainDate) => void;
|
|
31
|
+
onVisibleRangeChange?: (range: DateRange, info: {
|
|
32
|
+
view: string;
|
|
33
|
+
}) => void;
|
|
34
|
+
onDateActivate?: (date: PlainDate, info: {
|
|
35
|
+
view: string;
|
|
36
|
+
source: "pointer" | "keyboard";
|
|
37
|
+
}) => void;
|
|
38
|
+
views?: CustomViews;
|
|
39
|
+
locale?: string;
|
|
40
|
+
weekStartsOn?: DayOfWeek;
|
|
41
|
+
hiddenDays?: DayOfWeek[];
|
|
42
|
+
timeZone?: string;
|
|
43
|
+
now?: number;
|
|
44
|
+
min?: DateInput;
|
|
45
|
+
max?: DateInput;
|
|
46
|
+
timeGrid?: TimeGridOptions;
|
|
47
|
+
weekNumbers?: "iso" | "locale" | false;
|
|
48
|
+
messages?: Partial<CalendarMessages>;
|
|
49
|
+
selectedDate?: DateInput;
|
|
50
|
+
highlightedDates?: readonly DateInput[] | ((date: PlainDate) => boolean);
|
|
51
|
+
/** Events to lay out (plan 05 E1). */
|
|
52
|
+
events?: readonly TEvent[];
|
|
53
|
+
/** The opt-in recurrence pack (plan 12 RR2). */
|
|
54
|
+
recurrence?: RecurrencePack;
|
|
55
|
+
onRecurrenceError?: (event: CalendarEventInput, error: RRuleError) => void;
|
|
56
|
+
eventLimit?: number | "auto";
|
|
57
|
+
allDayEventLimit?: number;
|
|
58
|
+
minEventDuration?: number;
|
|
59
|
+
longEventsInAllDayRow?: boolean;
|
|
60
|
+
selectedEventId?: string | number | null;
|
|
61
|
+
defaultSelectedEventId?: string | number | null;
|
|
62
|
+
onSelectedEventChange?: (id: string | number | null, event: TEvent | null) => void;
|
|
63
|
+
onEventActivate?: (event: TEvent, info: {
|
|
64
|
+
source: "pointer" | "keyboard";
|
|
65
|
+
dayKey: string;
|
|
66
|
+
}) => void;
|
|
67
|
+
onMoreActivate?: (date: PlainDate, events: TEvent[]) => void;
|
|
68
|
+
getEventLabel?: (event: TEvent) => string;
|
|
69
|
+
selectable?: boolean;
|
|
70
|
+
maxSelectionDuration?: number;
|
|
71
|
+
selection?: SelectionProposal | null;
|
|
72
|
+
onSelectionChange?: (selection: SelectionProposal | null) => void;
|
|
73
|
+
onSelectRange?: (proposal: SelectionProposal) => void;
|
|
74
|
+
validateSelection?: (proposal: SelectionProposal) => boolean;
|
|
75
|
+
hitTest?: (point: HitPoint) => HitTarget | null;
|
|
76
|
+
announcer?: HTMLElement | false;
|
|
77
|
+
/** Moving and resizing events (plan 09). Off by default. */
|
|
78
|
+
editable?: boolean;
|
|
79
|
+
isEventEditable?: (event: TEvent, kind: "move" | "resize-start" | "resize-end") => boolean;
|
|
80
|
+
/** Minutes; default the time grid's slot length. */
|
|
81
|
+
snapDuration?: number;
|
|
82
|
+
allowAllDayConversion?: boolean;
|
|
83
|
+
/** Minutes; default 60. */
|
|
84
|
+
defaultTimedDuration?: number;
|
|
85
|
+
onEventChange?: (proposal: EventChangeProposal<TEvent>) => void | boolean | Promise<boolean>;
|
|
86
|
+
validateEventChange?: (proposal: EventChangeProposal<TEvent>) => boolean;
|
|
87
|
+
/** The availability model (plan 11 V4): a spec, a compiled model, or a function of the drag context. */
|
|
88
|
+
availability?: CalendarAvailabilityInput;
|
|
89
|
+
/** Which background pieces the layout exposes (plan 11 V9); default `"unavailable"`. */
|
|
90
|
+
backgrounds?: BackgroundMode;
|
|
91
|
+
/** Block selection and moves over unavailable time (plan 11 V10); default `true`. */
|
|
92
|
+
availabilityBlocksInteraction?: boolean;
|
|
93
|
+
getResourceAvailability?: (resource: ResourceInput) => AvailabilitySpec;
|
|
94
|
+
getAvailabilityLabel?: (rules: readonly AvailabilityRule[]) => string;
|
|
95
|
+
/** Milliseconds; default 10000. */
|
|
96
|
+
pendingTimeout?: number;
|
|
97
|
+
autoScroll?: boolean;
|
|
98
|
+
scrollContainer?: HTMLElement | null;
|
|
99
|
+
keyboardShortcuts?: {
|
|
100
|
+
move?: string;
|
|
101
|
+
resizeEnd?: string;
|
|
102
|
+
resizeStart?: string;
|
|
103
|
+
} | false;
|
|
104
|
+
/** Resources for resource views (plan 10 R1). Pass `resourceViews` as `views` to use them. */
|
|
105
|
+
resources?: readonly ResourceInput[];
|
|
106
|
+
getResourceLabel?: (resource: ResourceInput) => string;
|
|
107
|
+
resourceGrouping?: ResourceGrouping;
|
|
108
|
+
collapsedResourceIds?: readonly ResourceId[];
|
|
109
|
+
defaultCollapsedResourceIds?: readonly ResourceId[];
|
|
110
|
+
onCollapsedResourceIdsChange?: (ids: readonly ResourceId[]) => void;
|
|
111
|
+
/** View ids from finest to coarsest, for `zoomIn` / `zoomOut` (plan 10 R8). */
|
|
112
|
+
zoomLevels?: readonly string[];
|
|
113
|
+
/** Half-open window over the rows (timeline) or leaf columns (time grid). */
|
|
114
|
+
resourceWindow?: WindowRange;
|
|
115
|
+
slotWindow?: WindowRange;
|
|
116
|
+
};
|
|
117
|
+
export type CalendarState<TEvent extends CalendarEventInput = CalendarEventInput> = {
|
|
118
|
+
id: string;
|
|
119
|
+
view: string;
|
|
120
|
+
definition: ViewDefinition;
|
|
121
|
+
date: PlainDate;
|
|
122
|
+
focusedDate: PlainDate;
|
|
123
|
+
today: PlainDate;
|
|
124
|
+
range: DateRange;
|
|
125
|
+
visibleRange: DateRange;
|
|
126
|
+
title: CalendarTitle;
|
|
127
|
+
layout: CalendarLayout;
|
|
128
|
+
canGoPrev: boolean;
|
|
129
|
+
canGoNext: boolean;
|
|
130
|
+
direction: "ltr" | "rtl";
|
|
131
|
+
locale?: string;
|
|
132
|
+
hiddenDays: DayOfWeek[];
|
|
133
|
+
messages: CalendarMessages;
|
|
134
|
+
/** The segments of the active layout. */
|
|
135
|
+
events: CalendarEvents<TEvent>;
|
|
136
|
+
/** Per-day overflow (month view). */
|
|
137
|
+
more: DayOverflow<TEvent>[];
|
|
138
|
+
/** The time-grid all-day row (empty outside time-grid views). */
|
|
139
|
+
allDayRow: AllDayRowSegment<TEvent>[];
|
|
140
|
+
nowIndicator: NowIndicator | null;
|
|
141
|
+
selection: SelectionRange | null;
|
|
142
|
+
selectedEventId: string | number | null;
|
|
143
|
+
focus: FocusState;
|
|
144
|
+
/** The active edit and its preview (plan 09 M9), or `null`. */
|
|
145
|
+
drag: DragState<TEvent> | null;
|
|
146
|
+
/** Accepted changes `events` does not show yet (plan 09 M3). */
|
|
147
|
+
pending: PendingChange[];
|
|
148
|
+
/** The resource layout of a resource view (plan 10), else `null`. */
|
|
149
|
+
resources: ResourceLayout<TEvent> | null;
|
|
150
|
+
/** Shaded availability pieces for the active time grid or timeline (plan 11 V9). */
|
|
151
|
+
backgrounds: (BackgroundPiece | TimelineBackgroundPiece)[];
|
|
152
|
+
};
|
|
153
|
+
/** A piece of a resource view: a resource time grid piece or a timeline piece. */
|
|
154
|
+
export type ResourcePieceLike<TEvent extends CalendarEventInput> = {
|
|
155
|
+
key: string;
|
|
156
|
+
event: TEvent;
|
|
157
|
+
resourceKey: string;
|
|
158
|
+
past: boolean;
|
|
159
|
+
continuesBefore: boolean;
|
|
160
|
+
continuesAfter: boolean;
|
|
161
|
+
allDay: boolean;
|
|
162
|
+
lane?: number;
|
|
163
|
+
left?: number;
|
|
164
|
+
width?: number;
|
|
165
|
+
top?: number;
|
|
166
|
+
height?: number;
|
|
167
|
+
column?: number;
|
|
168
|
+
columns?: number;
|
|
169
|
+
span?: number;
|
|
170
|
+
recurrence?: RecurrenceInfo<TEvent>;
|
|
171
|
+
};
|
|
172
|
+
export type CalendarController<TEvent extends CalendarEventInput = CalendarEventInput> = {
|
|
173
|
+
getState(): CalendarState<TEvent>;
|
|
174
|
+
subscribe(listener: (state: CalendarState<TEvent>) => void): () => void;
|
|
175
|
+
setOptions(options: Partial<CalendarOptions<TEvent>>): void;
|
|
176
|
+
start(): void;
|
|
177
|
+
prev(): void;
|
|
178
|
+
next(): void;
|
|
179
|
+
today(): void;
|
|
180
|
+
goTo(date: DateInput): void;
|
|
181
|
+
setView(view: string): void;
|
|
182
|
+
setRange(range: DateRange): void;
|
|
183
|
+
focusDate(date: PlainDate): void;
|
|
184
|
+
activateDate(date: PlainDate, source: "pointer" | "keyboard"): void;
|
|
185
|
+
handleKeyDown(key: string, modifiers: Modifiers): boolean;
|
|
186
|
+
selectEvent(id: string | number | null): void;
|
|
187
|
+
activateEvent(key: string, source: "pointer" | "keyboard"): void;
|
|
188
|
+
activateMore(cellKey: string): void;
|
|
189
|
+
enterCell(cellKey: string): void;
|
|
190
|
+
exitCell(): void;
|
|
191
|
+
startSelection(target: SelectionCell, source: "pointer" | "keyboard"): void;
|
|
192
|
+
extendSelection(target: SelectionCell): void;
|
|
193
|
+
confirmSelection(): void;
|
|
194
|
+
cancelSelection(): void;
|
|
195
|
+
clearSelection(): void;
|
|
196
|
+
setEventLimit(limit: number): void;
|
|
197
|
+
startMove(segmentKey: string, source?: "pointer" | "keyboard"): boolean;
|
|
198
|
+
startResize(segmentKey: string, edge: "start" | "end", source?: "pointer" | "keyboard"): boolean;
|
|
199
|
+
updateDrag(target: HitTarget): void;
|
|
200
|
+
dropDrag(): void;
|
|
201
|
+
cancelDrag(): void;
|
|
202
|
+
toggleResource(id: ResourceId): void;
|
|
203
|
+
zoomIn(): void;
|
|
204
|
+
zoomOut(): void;
|
|
205
|
+
getResourceHeaderAttributes(column: ResourceColumn): Attributes;
|
|
206
|
+
getResourceGroupHeaderAttributes(group: ResourceGroupHeader): Attributes;
|
|
207
|
+
getTimelineAttributes(): Attributes;
|
|
208
|
+
getTimelineHeaderCellAttributes(cell: TimelineHeaderCell): Attributes;
|
|
209
|
+
getTimelineRowAttributes(row: TimelineRow): Attributes;
|
|
210
|
+
getTimelineRowHeaderAttributes(row: TimelineRow): Attributes;
|
|
211
|
+
getTimelineCellAttributes(row: TimelineRow, slot: TimelineSlot): Attributes;
|
|
212
|
+
getResourcePieceAttributes(piece: ResourcePieceLike<TEvent>): Attributes;
|
|
213
|
+
getResizeHandleAttributes(segment: CalendarEvents<TEvent>[number], edge: "start" | "end"): Attributes;
|
|
214
|
+
getDragPreviewAttributes(piece: CalendarEvents<TEvent>[number]): Attributes;
|
|
215
|
+
/** The drag preview pieces hosted by one cell (`allDay`: the all-day row cell). */
|
|
216
|
+
getCellDragPreviewSegments(day: {
|
|
217
|
+
key: string;
|
|
218
|
+
}, allDay?: boolean): CalendarEvents<TEvent>[number][];
|
|
219
|
+
/** The raw `eventLimit` option, so adapters can measure when it is `"auto"`. */
|
|
220
|
+
getEventLimit(): number | "auto" | undefined;
|
|
221
|
+
mount(root: HTMLElement | null): void;
|
|
222
|
+
unmount(): void;
|
|
223
|
+
getRootAttributes(): Attributes;
|
|
224
|
+
getTitleAttributes(): Attributes;
|
|
225
|
+
getNavAttributes(kind: "prev" | "next" | "today"): Attributes;
|
|
226
|
+
getViewButtonAttributes(view: string): Attributes;
|
|
227
|
+
getGridAttributes(monthIndex?: number): Attributes;
|
|
228
|
+
getColumnHeaderAttributes(day: CalendarDay | WeekdayHeader): Attributes;
|
|
229
|
+
getCellAttributes(day: CalendarDay): Attributes;
|
|
230
|
+
getWeekNumberAttributes(weekNumber: number): Attributes;
|
|
231
|
+
getTimeGridAttributes(): Attributes;
|
|
232
|
+
getSlotAttributes(slot: TimeSlot, day: CalendarDay): Attributes;
|
|
233
|
+
getAgendaAttributes(): Attributes;
|
|
234
|
+
getAgendaDayAttributes(day: CalendarDay): Attributes;
|
|
235
|
+
getEventAttributes(segment: CalendarEvents<TEvent>[number]): Attributes;
|
|
236
|
+
getCellEventSegments(day: {
|
|
237
|
+
key: string;
|
|
238
|
+
}): CalendarEvents<TEvent>[number][];
|
|
239
|
+
/** Attribute record for one availability background piece (plan 11 V9). */
|
|
240
|
+
getBackgroundAttributes(piece: BackgroundPiece | TimelineBackgroundPiece): Attributes;
|
|
241
|
+
/** The segment for an event key (adapters map `data-chrono-event-key` back to it). */
|
|
242
|
+
getEventSegment(key: string): CalendarEvents<TEvent>[number] | undefined;
|
|
243
|
+
getMoreAttributes(day: CalendarDay): Attributes;
|
|
244
|
+
getAllDayCellAttributes(day: CalendarDay): Attributes;
|
|
245
|
+
getNowIndicatorAttributes(): Attributes;
|
|
246
|
+
getSelectionPreviewAttributes(day: CalendarDay): Attributes;
|
|
247
|
+
destroy(): void;
|
|
248
|
+
};
|
|
249
|
+
export declare function createCalendarController<TEvent extends CalendarEventInput = CalendarEventInput>(initial?: CalendarOptions<TEvent> & {
|
|
250
|
+
lazyStart?: boolean;
|
|
251
|
+
}): CalendarController<TEvent>;
|