@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,177 @@
|
|
|
1
|
+
import { compare, splitIntervalByDay, toEpochDay, toSecondOfDay, } from "../../foundation/index.js";
|
|
2
|
+
import { wallSecondsOf } from "./normalize.js";
|
|
3
|
+
import { compareEventIds } from "./sort.js";
|
|
4
|
+
import { withOptional } from "../../foundation/store/with-optional.js";
|
|
5
|
+
const SECONDS_PER_DAY = 86400;
|
|
6
|
+
function secondsInDay(value, date) {
|
|
7
|
+
return wallSecondsOf(value) - toEpochDay(date) * SECONDS_PER_DAY;
|
|
8
|
+
}
|
|
9
|
+
function compareTimed(a, b) {
|
|
10
|
+
if (a.startSec !== b.startSec) {
|
|
11
|
+
return a.startSec - b.startSec;
|
|
12
|
+
}
|
|
13
|
+
const da = wallSecondsOf(a.end) - wallSecondsOf(a.start);
|
|
14
|
+
const db = wallSecondsOf(b.end) - wallSecondsOf(b.start);
|
|
15
|
+
if (da !== db) {
|
|
16
|
+
return db - da;
|
|
17
|
+
}
|
|
18
|
+
return compareEventIds(a.event.id, b.event.id);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Assign overlap columns within a cluster and expand each event rightward
|
|
22
|
+
* (plan 05 E8). Members must be sorted by `compareTimed`.
|
|
23
|
+
*/
|
|
24
|
+
function assignColumns(members) {
|
|
25
|
+
const columnEnds = [];
|
|
26
|
+
for (const item of members) {
|
|
27
|
+
let column = 0;
|
|
28
|
+
while (column < columnEnds.length && columnEnds[column] > item.startSec) {
|
|
29
|
+
column += 1;
|
|
30
|
+
}
|
|
31
|
+
if (column === columnEnds.length) {
|
|
32
|
+
columnEnds.push(item.endSec);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
columnEnds[column] = item.endSec;
|
|
36
|
+
}
|
|
37
|
+
item.column = column;
|
|
38
|
+
}
|
|
39
|
+
const columns = columnEnds.length;
|
|
40
|
+
for (const item of members) {
|
|
41
|
+
item.columns = columns;
|
|
42
|
+
let span = 1;
|
|
43
|
+
while (item.column + span < columns) {
|
|
44
|
+
const column = item.column + span;
|
|
45
|
+
const overlap = members.some((other) => other.column === column && other.startSec < item.endSec && item.startSec < other.endSec);
|
|
46
|
+
if (overlap) {
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
span += 1;
|
|
50
|
+
}
|
|
51
|
+
item.span = span;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The timed area of a week / work week / day time grid (plan 05 §2.4): split
|
|
56
|
+
* each event per day, clip to the axis, lay out overlapping events into
|
|
57
|
+
* columns with rightward expansion. All-day and long events are handled by
|
|
58
|
+
* `layoutAllDayRow`, not here.
|
|
59
|
+
*/
|
|
60
|
+
export function layoutTimeGridEvents(events, days, options = {}) {
|
|
61
|
+
const axisStart = options.dayStart ? toSecondOfDay(options.dayStart) : 0;
|
|
62
|
+
const axisEnd = options.dayEnd ? toSecondOfDay(options.dayEnd) : SECONDS_PER_DAY;
|
|
63
|
+
const axisLength = axisEnd - axisStart;
|
|
64
|
+
const minDuration = (options.minEventDuration ?? 15) * 60;
|
|
65
|
+
const longEvents = options.longEventsInAllDayRow ?? true;
|
|
66
|
+
const now = options.now;
|
|
67
|
+
const columnByDay = new Map();
|
|
68
|
+
for (let index = 0; index < days.length; index += 1) {
|
|
69
|
+
columnByDay.set(toEpochDay(days[index].date), index);
|
|
70
|
+
}
|
|
71
|
+
const byDay = new Map();
|
|
72
|
+
for (const event of events) {
|
|
73
|
+
if (event.allDay) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (longEvents && wallSecondsOf(event.end) - wallSecondsOf(event.start) >= SECONDS_PER_DAY) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
// `splitIntervalByDay` returns nothing for an empty interval, so a
|
|
80
|
+
// zero-length event (no `end`) becomes one piece by hand.
|
|
81
|
+
const pieces = compare(event.start, event.end) === 0
|
|
82
|
+
? [
|
|
83
|
+
{
|
|
84
|
+
date: event.start,
|
|
85
|
+
start: event.start,
|
|
86
|
+
end: event.end,
|
|
87
|
+
continuesBefore: false,
|
|
88
|
+
continuesAfter: false,
|
|
89
|
+
},
|
|
90
|
+
]
|
|
91
|
+
: splitIntervalByDay({ start: event.start, end: event.end });
|
|
92
|
+
for (const piece of pieces) {
|
|
93
|
+
const dayIndex = columnByDay.get(toEpochDay(piece.date));
|
|
94
|
+
if (dayIndex === undefined) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const dayKey = days[dayIndex]?.key;
|
|
98
|
+
const startSec = secondsInDay(piece.start, piece.date);
|
|
99
|
+
const endSec = secondsInDay(piece.end, piece.date);
|
|
100
|
+
const clippedStart = Math.max(startSec, axisStart);
|
|
101
|
+
const clippedEnd = Math.min(endSec, axisEnd);
|
|
102
|
+
// A zero-length event (no `end`) is kept when it starts inside the axis
|
|
103
|
+
// and drawn at the minimum height; anything else must overlap the axis.
|
|
104
|
+
const zeroLength = startSec === endSec;
|
|
105
|
+
if (zeroLength ? startSec < axisStart || startSec >= axisEnd : clippedEnd <= clippedStart) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const realHeight = (clippedEnd - clippedStart) / axisLength;
|
|
109
|
+
const timed = {
|
|
110
|
+
key: `${event.key}:${dayKey}`,
|
|
111
|
+
event: event.event,
|
|
112
|
+
start: event.start,
|
|
113
|
+
end: event.end,
|
|
114
|
+
dayKey,
|
|
115
|
+
top: (clippedStart - axisStart) / axisLength,
|
|
116
|
+
height: Math.max(realHeight, minDuration / axisLength),
|
|
117
|
+
continuesBefore: piece.continuesBefore,
|
|
118
|
+
continuesAfter: piece.continuesAfter,
|
|
119
|
+
past: now !== undefined && compare(event.end, now) <= 0,
|
|
120
|
+
recurrence: event.recurrence,
|
|
121
|
+
startSec: clippedStart,
|
|
122
|
+
// Overlap follows the drawn extent, so minimum-height events never
|
|
123
|
+
// sit on top of their neighbours.
|
|
124
|
+
endSec: Math.max(clippedEnd, clippedStart + minDuration),
|
|
125
|
+
column: 0,
|
|
126
|
+
columns: 1,
|
|
127
|
+
span: 1,
|
|
128
|
+
};
|
|
129
|
+
const list = byDay.get(dayKey);
|
|
130
|
+
if (list) {
|
|
131
|
+
list.push(timed);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
byDay.set(dayKey, [timed]);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const result = [];
|
|
139
|
+
for (const group of byDay.values()) {
|
|
140
|
+
group.sort(compareTimed);
|
|
141
|
+
// Cluster transitively overlapping events (sorted order keeps this linear).
|
|
142
|
+
const clusters = [];
|
|
143
|
+
for (const item of group) {
|
|
144
|
+
const cluster = clusters.find((c) => c.end > item.startSec);
|
|
145
|
+
if (!cluster) {
|
|
146
|
+
clusters.push({ members: [item], end: item.endSec });
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
cluster.members.push(item);
|
|
150
|
+
cluster.end = Math.max(cluster.end, item.endSec);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
for (const cluster of clusters) {
|
|
154
|
+
assignColumns(cluster.members);
|
|
155
|
+
}
|
|
156
|
+
for (const item of group) {
|
|
157
|
+
result.push(withOptional({
|
|
158
|
+
key: item.key,
|
|
159
|
+
event: item.event,
|
|
160
|
+
start: item.start,
|
|
161
|
+
end: item.end,
|
|
162
|
+
allDay: false,
|
|
163
|
+
continuesBefore: item.continuesBefore,
|
|
164
|
+
continuesAfter: item.continuesAfter,
|
|
165
|
+
past: item.past,
|
|
166
|
+
recurrence: item.recurrence,
|
|
167
|
+
dayKey: item.dayKey,
|
|
168
|
+
top: item.top,
|
|
169
|
+
height: item.height,
|
|
170
|
+
column: item.column,
|
|
171
|
+
columns: item.columns,
|
|
172
|
+
span: item.span,
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { DateInput, DateTimeInput, PlainDate, PlainDateTime, ZonedDateTime } from "../../foundation/index.js";
|
|
2
|
+
import type { RRule } from "../recurrence/rrule-types.js";
|
|
3
|
+
/** An event id: a string or a number (plan 05 E1). */
|
|
4
|
+
export type EventId = string | number;
|
|
5
|
+
/**
|
|
6
|
+
* The month grid structure the event layout reads: per month, per week row,
|
|
7
|
+
* the visible days in column order. `MonthLayout` (the controller's state)
|
|
8
|
+
* satisfies this shape.
|
|
9
|
+
*/
|
|
10
|
+
export type MonthEventLayout = {
|
|
11
|
+
months: {
|
|
12
|
+
weeks: {
|
|
13
|
+
days: {
|
|
14
|
+
date: PlainDate;
|
|
15
|
+
hidden: boolean;
|
|
16
|
+
outsideMonth: boolean;
|
|
17
|
+
/** ISO date, the cell's `data-chrono-key`. */
|
|
18
|
+
key: string;
|
|
19
|
+
}[];
|
|
20
|
+
}[];
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* What the app passes for one event (plan 05 E1). The app's own fields pass
|
|
25
|
+
* through untouched on the original object; Chrono only reads these keys.
|
|
26
|
+
*/
|
|
27
|
+
export type CalendarEventInput = {
|
|
28
|
+
id: EventId;
|
|
29
|
+
/** `DateTimeInput` when timed, `DateInput` when `allDay`. */
|
|
30
|
+
start: DateTimeInput | DateInput;
|
|
31
|
+
end: DateTimeInput | DateInput;
|
|
32
|
+
allDay?: boolean;
|
|
33
|
+
recurringId?: string | number;
|
|
34
|
+
calendarId?: string | number;
|
|
35
|
+
/** RFC 5545 rule or parsed rule: the event is a series (plan 12 RR1). */
|
|
36
|
+
rrule?: string | RRule;
|
|
37
|
+
/** Occurrence starts removed from the rule (RR1). */
|
|
38
|
+
exdates?: readonly (DateTimeInput | DateInput)[] | undefined;
|
|
39
|
+
/** Extra occurrence starts (RR1). */
|
|
40
|
+
rdates?: readonly (DateTimeInput | DateInput)[] | undefined;
|
|
41
|
+
/** With `recurringId`: the original occurrence this event replaces (RR6). */
|
|
42
|
+
recurrenceId?: DateTimeInput | DateInput;
|
|
43
|
+
/** Resource(s) the event belongs to, for resource views (plan 10 R2). */
|
|
44
|
+
resourceId?: EventId | readonly EventId[];
|
|
45
|
+
/** Per-event edit permissions (plan 09 M1); `false` wins over the calendar option. */
|
|
46
|
+
editable?: boolean;
|
|
47
|
+
movable?: boolean;
|
|
48
|
+
resizable?: boolean;
|
|
49
|
+
};
|
|
50
|
+
/** The series occurrence an event replaces or belongs to (plan 12 RR7). */
|
|
51
|
+
export type RecurrenceInfo<TEvent extends CalendarEventInput> = {
|
|
52
|
+
recurringId: EventId;
|
|
53
|
+
/** Original occurrence start, wall time in the display zone. */
|
|
54
|
+
occurrenceStart: PlainDateTime;
|
|
55
|
+
isOverride: boolean;
|
|
56
|
+
/** The series object, so render callbacks can read its app fields. */
|
|
57
|
+
series: TEvent;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* An event after parsing and zone conversion (plan 05 §2.2). `start`/`end` are
|
|
61
|
+
* wall time in the display zone, half-open `[start, end)`; all-day events run
|
|
62
|
+
* from midnight of the first day to midnight of the exclusive end day (E3).
|
|
63
|
+
* `key` is the unique internal id (dedupe suffix on repeated ids).
|
|
64
|
+
*/
|
|
65
|
+
export type NormalizedEvent<TEvent extends CalendarEventInput = CalendarEventInput> = {
|
|
66
|
+
id: EventId;
|
|
67
|
+
key: string;
|
|
68
|
+
/** The app's original object, unchanged. */
|
|
69
|
+
event: TEvent;
|
|
70
|
+
start: PlainDateTime;
|
|
71
|
+
end: PlainDateTime;
|
|
72
|
+
allDay: boolean;
|
|
73
|
+
recurringId?: string | number;
|
|
74
|
+
calendarId?: string | number;
|
|
75
|
+
/** Resource ids the event is shown in (empty or missing outside resource views). */
|
|
76
|
+
resourceIds?: readonly EventId[];
|
|
77
|
+
/** Series/override identity (plan 12 RR7). */
|
|
78
|
+
recurrence?: RecurrenceInfo<TEvent>;
|
|
79
|
+
};
|
|
80
|
+
/** Fields every layout segment shares (plan 05 §2.2). */
|
|
81
|
+
export type EventSegmentBase<TEvent extends CalendarEventInput = CalendarEventInput> = {
|
|
82
|
+
/** `${normalized.key}:${firstDayKey}` — unique per segment. */
|
|
83
|
+
key: string;
|
|
84
|
+
event: TEvent;
|
|
85
|
+
/** Real values in the display zone (not clipped to the segment). */
|
|
86
|
+
start: PlainDateTime;
|
|
87
|
+
end: PlainDateTime;
|
|
88
|
+
allDay: boolean;
|
|
89
|
+
continuesBefore: boolean;
|
|
90
|
+
continuesAfter: boolean;
|
|
91
|
+
/** The whole event ended before `now`. */
|
|
92
|
+
past: boolean;
|
|
93
|
+
/** Series/override identity (plan 12 RR7). */
|
|
94
|
+
recurrence?: RecurrenceInfo<TEvent>;
|
|
95
|
+
};
|
|
96
|
+
/** A piece of an event in the month view (plan 05 §2.2). */
|
|
97
|
+
export type MonthSegment<TEvent extends CalendarEventInput = CalendarEventInput> = EventSegmentBase<TEvent> & {
|
|
98
|
+
/** Index into the month layout's `months`. */
|
|
99
|
+
month: number;
|
|
100
|
+
/** Index into that month's `weeks`. */
|
|
101
|
+
week: number;
|
|
102
|
+
/** First visible column the piece occupies. */
|
|
103
|
+
startColumn: number;
|
|
104
|
+
/** Number of visible columns it occupies. */
|
|
105
|
+
days: number;
|
|
106
|
+
lane: number;
|
|
107
|
+
hidden: boolean;
|
|
108
|
+
};
|
|
109
|
+
/** A piece of an event in a time-grid day (plan 05 §2.2). */
|
|
110
|
+
export type TimeGridSegment<TEvent extends CalendarEventInput = CalendarEventInput> = EventSegmentBase<TEvent> & {
|
|
111
|
+
dayKey: string;
|
|
112
|
+
/** Fractions 0–1 of the visible axis. */
|
|
113
|
+
top: number;
|
|
114
|
+
height: number;
|
|
115
|
+
column: number;
|
|
116
|
+
columns: number;
|
|
117
|
+
span: number;
|
|
118
|
+
};
|
|
119
|
+
/** A piece of an event in the time-grid all-day row (plan 05 §2.4). */
|
|
120
|
+
export type AllDayRowSegment<TEvent extends CalendarEventInput = CalendarEventInput> = EventSegmentBase<TEvent> & {
|
|
121
|
+
/** ISO date of the first covered day. */
|
|
122
|
+
dayKey: string;
|
|
123
|
+
startColumn: number;
|
|
124
|
+
days: number;
|
|
125
|
+
lane: number;
|
|
126
|
+
hidden: boolean;
|
|
127
|
+
};
|
|
128
|
+
/** One event of one agenda day (plan 05 §2.2). */
|
|
129
|
+
export type AgendaItem<TEvent extends CalendarEventInput = CalendarEventInput> = EventSegmentBase<TEvent> & {
|
|
130
|
+
dayKey: string;
|
|
131
|
+
};
|
|
132
|
+
/** A proposed range creation (plan 05 E14, §2.6). */
|
|
133
|
+
export type SelectionProposal = {
|
|
134
|
+
kind: "create";
|
|
135
|
+
start: PlainDateTime | ZonedDateTime | PlainDate;
|
|
136
|
+
end: PlainDateTime | ZonedDateTime | PlainDate;
|
|
137
|
+
allDay: boolean;
|
|
138
|
+
source: "pointer" | "keyboard";
|
|
139
|
+
};
|
|
140
|
+
/** The segments of the active layout (plan 05 §2.6). */
|
|
141
|
+
export type CalendarEvents<TEvent extends CalendarEventInput = CalendarEventInput> = MonthSegment<TEvent>[] | TimeGridSegment<TEvent>[] | AgendaItem<TEvent>[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export { type CustomViews, type ViewDefinition, type ViewLayout, type ViewLength, getBuiltInViews, getMonthCount, resolveView, resolveViews, } from "./navigation/view-definition.js";
|
|
2
|
+
export { getRange, getVisibleRange } from "./navigation/range.js";
|
|
3
|
+
export type { RangeContext } from "./navigation/range.js";
|
|
4
|
+
export { canNavigate, firstVisibleDay, getDefinition, getHiddenDays, navigate, } from "./navigation/navigate.js";
|
|
5
|
+
export type { NavigationAction, NavigationContext, NavigationState, } from "./navigation/navigate.js";
|
|
6
|
+
export { getCalendarTitle } from "./navigation/title.js";
|
|
7
|
+
export type { CalendarTitle } from "./navigation/title.js";
|
|
8
|
+
export type { CalendarDay, DayContext } from "./views/day.js";
|
|
9
|
+
export { getMonthLayout } from "./views/month-layout.js";
|
|
10
|
+
export type { CalendarWeek, LayoutContext, MonthGridModel, MonthLayout, } from "./views/month-layout.js";
|
|
11
|
+
export { getTimeGridLayout } from "./views/time-grid-layout.js";
|
|
12
|
+
export type { TimeGridLayout, TimeGridOptions } from "./views/time-grid-layout.js";
|
|
13
|
+
export { getListLayout } from "./views/list-layout.js";
|
|
14
|
+
export type { ListLayout } from "./views/list-layout.js";
|
|
15
|
+
export { getMiniCalendarLayout } from "./views/mini-calendar.js";
|
|
16
|
+
export type { MiniCalendarLayoutOptions } from "./views/mini-calendar.js";
|
|
17
|
+
export { createCalendarController } from "./controllers/calendar-controller.js";
|
|
18
|
+
export type { CalendarController, CalendarLayout, CalendarMessages, CalendarOptions, CalendarState, } from "./controllers/calendar-controller.js";
|
|
19
|
+
export { createMiniCalendarController } from "./controllers/mini-calendar-controller.js";
|
|
20
|
+
export type { MiniCalendarController, MiniCalendarOptions, MiniCalendarState, MonthValue, } from "./controllers/mini-calendar-controller.js";
|
|
21
|
+
export type { Modifiers } from "./controllers/shared.js";
|
|
22
|
+
export { normalizeEvents, coveredDays, wallSecondsOf } from "./events/normalize.js";
|
|
23
|
+
export type { NormalizeOptions } from "./events/normalize.js";
|
|
24
|
+
export { compareEventIds, compareMonthSegments } from "./events/sort.js";
|
|
25
|
+
export type { SortableSegment } from "./events/sort.js";
|
|
26
|
+
export { layoutMonthEvents } from "./events/month-layout.js";
|
|
27
|
+
export type { MonthLayoutEventsOptions } from "./events/month-layout.js";
|
|
28
|
+
export { layoutAllDayRow } from "./events/all-day-row.js";
|
|
29
|
+
export type { AllDayRowOptions } from "./events/all-day-row.js";
|
|
30
|
+
export { layoutTimeGridEvents } from "./events/time-grid-layout.js";
|
|
31
|
+
export type { TimeGridEventsOptions } from "./events/time-grid-layout.js";
|
|
32
|
+
export { getNowIndicator } from "./events/now-indicator.js";
|
|
33
|
+
export type { NowIndicator, NowIndicatorDay } from "./events/now-indicator.js";
|
|
34
|
+
export { layoutAgenda } from "./events/agenda-layout.js";
|
|
35
|
+
export type { AgendaDay, AgendaOptions } from "./events/agenda-layout.js";
|
|
36
|
+
export { enterCell, isExitKey, stepFocus } from "./interaction/event-focus.js";
|
|
37
|
+
export type { FocusItems, FocusMode, FocusState } from "./interaction/event-focus.js";
|
|
38
|
+
export { computeSelection, selectionPieces } from "./interaction/selection.js";
|
|
39
|
+
export type { SelectionCell, SelectionOptions, SelectionRange } from "./interaction/selection.js";
|
|
40
|
+
export { applyEventLimit, applyPieceLimit } from "./events/overflow.js";
|
|
41
|
+
export type { DayOverflow, OverflowResult } from "./events/overflow.js";
|
|
42
|
+
export type { AgendaItem, AllDayRowSegment, CalendarEventInput, CalendarEvents, EventId, EventSegmentBase, MonthEventLayout, MonthSegment, NormalizedEvent, SelectionProposal, TimeGridSegment, } from "./events/types.js";
|
|
43
|
+
export { autoScrollSpeed, createAutoScroll } from "./interaction/auto-scroll.js";
|
|
44
|
+
export type { AutoScroll } from "./interaction/auto-scroll.js";
|
|
45
|
+
export { moveEvent, nudgeEvent, resizeEvent, snapTo } from "./interaction/drag-geometry.js";
|
|
46
|
+
export type { DragTarget, EditValue, GeometryOptions, Grab } from "./interaction/drag-geometry.js";
|
|
47
|
+
export { editStep, matchShortcut } from "./interaction/drag-keyboard.js";
|
|
48
|
+
export type { EditKind, KeyStep, Shortcuts } from "./interaction/drag-keyboard.js";
|
|
49
|
+
export type { PendingChange } from "./interaction/pending.js";
|
|
50
|
+
export type { ChangeValue, DragState, EventChangeProposal } from "./controllers/drag-engine.js";
|
|
51
|
+
export { resourceViews } from "./resources/views.js";
|
|
52
|
+
export { resourceCellKey } from "./resources/keys.js";
|
|
53
|
+
export { buildResourceTree } from "./resources/tree.js";
|
|
54
|
+
export { layoutResourceTimeGrid } from "./resources/resource-time-grid.js";
|
|
55
|
+
export { layoutTimeline } from "./resources/timeline-layout.js";
|
|
56
|
+
export { buildTimelineAxis, slotKeyOf } from "./resources/timeline-axis.js";
|
|
57
|
+
export { clampWindow } from "./resources/windowing.js";
|
|
58
|
+
export { zoomTarget } from "./navigation/zoom.js";
|
|
59
|
+
export type { ResourceAllDayPiece, ResourceBuildContext, ResourceColumn, ResourceGrouping, ResourceGroupHeader, ResourceId, ResourceInput, ResourceLayout, ResourceRow, ResourceTimeGridLayout, ResourceTimeGridPiece, ResourceWindowInfo, TimelineAxis, TimelineHeaderCell, TimelineLayout, TimelinePiece, TimelineRow, TimelineSlot, TimelineSlotDuration, TimelineUnit, WindowRange, } from "./resources/types.js";
|
|
60
|
+
export type { ResourcePieceLike } from "./controllers/calendar-controller.js";
|
|
61
|
+
export { availabilityFromEvents, resolveCalendarAvailability, wallIso } from "./availability.js";
|
|
62
|
+
export type { AvailabilityContext, AvailabilityFromEventsOptions, CalendarAvailabilityInput, } from "./availability.js";
|
|
63
|
+
export { backgroundAttributes, layoutBackgrounds, layoutTimelineBackgrounds, } from "./events/background-layout.js";
|
|
64
|
+
export type { BackgroundDay, BackgroundLayoutOptions, BackgroundMode, BackgroundPiece, BackgroundStatus, TimelineBackgroundOptions, TimelineBackgroundPiece, } from "./events/background-layout.js";
|
|
65
|
+
export { parseRRule, stringifyRRule } from "./recurrence/rrule.js";
|
|
66
|
+
export { expandRecurrence } from "./recurrence/series.js";
|
|
67
|
+
export { recurrence } from "./recurrence/pack.js";
|
|
68
|
+
export { applyRecurrenceChange, applyRecurrenceDelete } from "./recurrence/apply.js";
|
|
69
|
+
export type { ApplyRecurrenceOptions, RecurrenceChangeResult, RecurrenceDeleteResult, RecurrenceOverride, RecurrenceScope, } from "./recurrence/apply.js";
|
|
70
|
+
export type { RRule, RRuleByDay, RRuleError, RRuleErrorCode, RRuleFreq, RRuleUntil, RecurrenceErrorHandler, RecurrenceExpandOptions, RecurrenceInfo, RecurrenceOccurrence, RecurrencePack, } from "./recurrence/types.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { getBuiltInViews, getMonthCount, resolveView, resolveViews, } from "./navigation/view-definition.js";
|
|
2
|
+
export { getRange, getVisibleRange } from "./navigation/range.js";
|
|
3
|
+
export { canNavigate, firstVisibleDay, getDefinition, getHiddenDays, navigate, } from "./navigation/navigate.js";
|
|
4
|
+
export { getCalendarTitle } from "./navigation/title.js";
|
|
5
|
+
export { getMonthLayout } from "./views/month-layout.js";
|
|
6
|
+
export { getTimeGridLayout } from "./views/time-grid-layout.js";
|
|
7
|
+
export { getListLayout } from "./views/list-layout.js";
|
|
8
|
+
export { getMiniCalendarLayout } from "./views/mini-calendar.js";
|
|
9
|
+
export { createCalendarController } from "./controllers/calendar-controller.js";
|
|
10
|
+
export { createMiniCalendarController } from "./controllers/mini-calendar-controller.js";
|
|
11
|
+
export { normalizeEvents, coveredDays, wallSecondsOf } from "./events/normalize.js";
|
|
12
|
+
export { compareEventIds, compareMonthSegments } from "./events/sort.js";
|
|
13
|
+
export { layoutMonthEvents } from "./events/month-layout.js";
|
|
14
|
+
export { layoutAllDayRow } from "./events/all-day-row.js";
|
|
15
|
+
export { layoutTimeGridEvents } from "./events/time-grid-layout.js";
|
|
16
|
+
export { getNowIndicator } from "./events/now-indicator.js";
|
|
17
|
+
export { layoutAgenda } from "./events/agenda-layout.js";
|
|
18
|
+
export { enterCell, isExitKey, stepFocus } from "./interaction/event-focus.js";
|
|
19
|
+
export { computeSelection, selectionPieces } from "./interaction/selection.js";
|
|
20
|
+
export { applyEventLimit, applyPieceLimit } from "./events/overflow.js";
|
|
21
|
+
export { autoScrollSpeed, createAutoScroll } from "./interaction/auto-scroll.js";
|
|
22
|
+
export { moveEvent, nudgeEvent, resizeEvent, snapTo } from "./interaction/drag-geometry.js";
|
|
23
|
+
export { editStep, matchShortcut } from "./interaction/drag-keyboard.js";
|
|
24
|
+
export { resourceViews } from "./resources/views.js";
|
|
25
|
+
export { resourceCellKey } from "./resources/keys.js";
|
|
26
|
+
export { buildResourceTree } from "./resources/tree.js";
|
|
27
|
+
export { layoutResourceTimeGrid } from "./resources/resource-time-grid.js";
|
|
28
|
+
export { layoutTimeline } from "./resources/timeline-layout.js";
|
|
29
|
+
export { buildTimelineAxis, slotKeyOf } from "./resources/timeline-axis.js";
|
|
30
|
+
export { clampWindow } from "./resources/windowing.js";
|
|
31
|
+
export { zoomTarget } from "./navigation/zoom.js";
|
|
32
|
+
export { availabilityFromEvents, resolveCalendarAvailability, wallIso } from "./availability.js";
|
|
33
|
+
export { backgroundAttributes, layoutBackgrounds, layoutTimelineBackgrounds, } from "./events/background-layout.js";
|
|
34
|
+
export { parseRRule, stringifyRRule } from "./recurrence/rrule.js";
|
|
35
|
+
export { expandRecurrence } from "./recurrence/series.js";
|
|
36
|
+
export { recurrence } from "./recurrence/pack.js";
|
|
37
|
+
export { applyRecurrenceChange, applyRecurrenceDelete } from "./recurrence/apply.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { autoScrollSpeed } from "../../dom/auto-scroll.js";
|
|
2
|
+
export type AutoScroll = {
|
|
3
|
+
/** Start the loop for the pointer position; call again to move the point. */
|
|
4
|
+
update(point: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}): void;
|
|
8
|
+
stop(): void;
|
|
9
|
+
};
|
|
10
|
+
/** A rAF loop that scrolls `getContainer()` toward the pointer; stops when asked. */
|
|
11
|
+
export declare function createAutoScroll(getContainer: () => HTMLElement | null): AutoScroll;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public edge auto-scroll helper (calendar API). The generic maths and the
|
|
3
|
+
* scrollable-ancestor lookup live in the private `src/dom/auto-scroll.ts`
|
|
4
|
+
* (plan 08-2 Step 4); this module keeps the published `createAutoScroll`
|
|
5
|
+
* behaviour and its own loop for backwards compatibility. The calendar's own
|
|
6
|
+
* drag uses the drag session's single frame loop instead (NP9).
|
|
7
|
+
*/
|
|
8
|
+
import { applyAutoScroll, cancelFrame, scheduleFrame } from "../../dom/auto-scroll.js";
|
|
9
|
+
export { autoScrollSpeed } from "../../dom/auto-scroll.js";
|
|
10
|
+
/** A rAF loop that scrolls `getContainer()` toward the pointer; stops when asked. */
|
|
11
|
+
export function createAutoScroll(getContainer) {
|
|
12
|
+
let point = null;
|
|
13
|
+
let handle = 0;
|
|
14
|
+
const tick = () => {
|
|
15
|
+
handle = 0;
|
|
16
|
+
const container = getContainer();
|
|
17
|
+
if (!point || !container) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
applyAutoScroll(container, point);
|
|
21
|
+
handle = scheduleFrame(tick);
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
update(next) {
|
|
25
|
+
point = next;
|
|
26
|
+
if (handle === 0)
|
|
27
|
+
handle = scheduleFrame(tick);
|
|
28
|
+
},
|
|
29
|
+
stop() {
|
|
30
|
+
point = null;
|
|
31
|
+
if (handle !== 0) {
|
|
32
|
+
cancelFrame(handle);
|
|
33
|
+
handle = 0;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type PlainDate, type PlainDateTime, type PlainTime } from "../../foundation/index.js";
|
|
2
|
+
/** An event position in display-zone wall time; all-day ends are exclusive midnights (plan 05 E3). */
|
|
3
|
+
export type EditValue = {
|
|
4
|
+
start: PlainDateTime;
|
|
5
|
+
end: PlainDateTime;
|
|
6
|
+
allDay: boolean;
|
|
7
|
+
};
|
|
8
|
+
/** Where the pointer is: a day, a time-grid slot, or the all-day row. */
|
|
9
|
+
export type DragTarget = {
|
|
10
|
+
date: PlainDate;
|
|
11
|
+
/** Start of the slot under the pointer (time grid). */
|
|
12
|
+
time?: PlainTime;
|
|
13
|
+
allDayRow?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/** What part of the event the pointer grabbed (plan 09 §13.2). */
|
|
16
|
+
export type Grab = {
|
|
17
|
+
/** Month / all-day row: which day of the event, 0-based. */
|
|
18
|
+
dayOffset: number;
|
|
19
|
+
/** Time grid: minutes from the event's start to the grabbed slot. */
|
|
20
|
+
minuteOffset: number;
|
|
21
|
+
};
|
|
22
|
+
export type GeometryOptions = {
|
|
23
|
+
view: "month" | "time-grid";
|
|
24
|
+
/** Minutes. */
|
|
25
|
+
snap: number;
|
|
26
|
+
/** The grid's slot length in minutes (a resize to a slot reaches the slot's end). */
|
|
27
|
+
slot: number;
|
|
28
|
+
allowAllDayConversion: boolean;
|
|
29
|
+
/** Minutes. */
|
|
30
|
+
defaultTimedDuration: number;
|
|
31
|
+
};
|
|
32
|
+
export declare const toSeconds: (value: PlainDateTime) => number;
|
|
33
|
+
export declare function fromSeconds(seconds: number): PlainDateTime;
|
|
34
|
+
/** Nearest multiple of `size`; an exact tie rounds up (plan 09 §13.2). */
|
|
35
|
+
export declare const snapTo: (seconds: number, size: number) => number;
|
|
36
|
+
/** How far into the event (in days / minutes) the press happened. */
|
|
37
|
+
export declare function grabOf(value: EditValue, target: DragTarget): Grab;
|
|
38
|
+
/**
|
|
39
|
+
* Move an event so the grabbed part follows the pointer (plan 09 M4, M6). Returns
|
|
40
|
+
* `null` when the target is not allowed (all-day conversion switched off).
|
|
41
|
+
*/
|
|
42
|
+
export declare function moveEvent(from: EditValue, grab: Grab, target: DragTarget, options: GeometryOptions): EditValue | null;
|
|
43
|
+
/**
|
|
44
|
+
* Move one edge to the pointer (plan 09 M5). The edge never crosses the other one:
|
|
45
|
+
* it stops one snap unit (one day for all-day) away.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resizeEvent(from: EditValue, edge: "start" | "end", target: DragTarget, options: GeometryOptions): EditValue;
|
|
48
|
+
/** A keyboard step (plan 09 M10): shift by days and minutes. */
|
|
49
|
+
export declare function nudgeEvent(from: EditValue, kind: "move" | "resize-start" | "resize-end", step: {
|
|
50
|
+
days: number;
|
|
51
|
+
minutes: number;
|
|
52
|
+
}, options: GeometryOptions): EditValue;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { fromEpochDay, fromSecondOfDay, plainDateTime, plainTime, toEpochDay, toSecondOfDay, } from "../../foundation/index.js";
|
|
2
|
+
const DAY = 86400;
|
|
3
|
+
const MIDNIGHT = plainTime(0, 0, 0);
|
|
4
|
+
export const toSeconds = (value) => toEpochDay(value) * DAY + toSecondOfDay(value);
|
|
5
|
+
export function fromSeconds(seconds) {
|
|
6
|
+
const day = Math.floor(seconds / DAY);
|
|
7
|
+
return plainDateTime(fromEpochDay(day), fromSecondOfDay(seconds - day * DAY));
|
|
8
|
+
}
|
|
9
|
+
/** Nearest multiple of `size`; an exact tie rounds up (plan 09 §13.2). */
|
|
10
|
+
export const snapTo = (seconds, size) => Math.floor(seconds / size + 0.5) * size;
|
|
11
|
+
const midnight = (date) => plainDateTime(date, MIDNIGHT);
|
|
12
|
+
const shiftDays = (value, days) => fromSeconds(toSeconds(value) + days * DAY);
|
|
13
|
+
const dayDiff = (a, b) => toEpochDay(a) - toEpochDay(b);
|
|
14
|
+
/** How far into the event (in days / minutes) the press happened. */
|
|
15
|
+
export function grabOf(value, target) {
|
|
16
|
+
const press = target.time ? plainDateTime(target.date, target.time) : midnight(target.date);
|
|
17
|
+
const spanDays = Math.max(1, dayDiff(value.end, value.start) + (toSecondOfDay(value.end) > 0 && !value.allDay ? 1 : 0));
|
|
18
|
+
return {
|
|
19
|
+
dayOffset: Math.min(Math.max(0, dayDiff(target.date, value.start)), spanDays - 1),
|
|
20
|
+
minuteOffset: Math.max(0, Math.round((toSeconds(press) - toSeconds(value.start)) / 60)),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Move an event so the grabbed part follows the pointer (plan 09 M4, M6). Returns
|
|
25
|
+
* `null` when the target is not allowed (all-day conversion switched off).
|
|
26
|
+
*/
|
|
27
|
+
export function moveEvent(from, grab, target, options) {
|
|
28
|
+
const duration = toSeconds(from.end) - toSeconds(from.start);
|
|
29
|
+
const dayLevel = options.view === "month" || target.allDayRow === true;
|
|
30
|
+
if (dayLevel) {
|
|
31
|
+
if (options.view === "time-grid" && !from.allDay) {
|
|
32
|
+
// A timed event dropped on the all-day row becomes all-day.
|
|
33
|
+
if (!options.allowAllDayConversion)
|
|
34
|
+
return null;
|
|
35
|
+
const days = Math.max(1, Math.ceil(duration / DAY));
|
|
36
|
+
const start = midnight(target.date);
|
|
37
|
+
return { start, end: shiftDays(start, days), allDay: true };
|
|
38
|
+
}
|
|
39
|
+
const delta = dayDiff(target.date, from.start) - grab.dayOffset;
|
|
40
|
+
return {
|
|
41
|
+
start: shiftDays(from.start, delta),
|
|
42
|
+
end: shiftDays(from.end, delta),
|
|
43
|
+
allDay: from.allDay,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
if (!target.time)
|
|
47
|
+
return null;
|
|
48
|
+
const targetSeconds = toSeconds(plainDateTime(target.date, target.time));
|
|
49
|
+
if (from.allDay) {
|
|
50
|
+
// An all-day event dropped in the timed area becomes timed.
|
|
51
|
+
if (!options.allowAllDayConversion)
|
|
52
|
+
return null;
|
|
53
|
+
const start = fromSeconds(snapTo(targetSeconds, options.snap * 60));
|
|
54
|
+
return {
|
|
55
|
+
start,
|
|
56
|
+
end: fromSeconds(toSeconds(start) + options.defaultTimedDuration * 60),
|
|
57
|
+
allDay: false,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const start = fromSeconds(snapTo(targetSeconds - grab.minuteOffset * 60, options.snap * 60));
|
|
61
|
+
return {
|
|
62
|
+
start,
|
|
63
|
+
end: fromSeconds(toSeconds(start) + duration),
|
|
64
|
+
allDay: false,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Move one edge to the pointer (plan 09 M5). The edge never crosses the other one:
|
|
69
|
+
* it stops one snap unit (one day for all-day) away.
|
|
70
|
+
*/
|
|
71
|
+
export function resizeEvent(from, edge, target, options) {
|
|
72
|
+
const snap = options.snap * 60;
|
|
73
|
+
const timedGrid = options.view === "time-grid" && !from.allDay && target.time !== undefined;
|
|
74
|
+
if (timedGrid && target.time) {
|
|
75
|
+
const wall = toSeconds(plainDateTime(target.date, target.time));
|
|
76
|
+
if (edge === "end") {
|
|
77
|
+
const end = Math.max(snapTo(wall + options.slot * 60, snap), toSeconds(from.start) + snap);
|
|
78
|
+
return { ...from, end: fromSeconds(end) };
|
|
79
|
+
}
|
|
80
|
+
const start = Math.min(snapTo(wall, snap), toSeconds(from.end) - snap);
|
|
81
|
+
return { ...from, start: fromSeconds(start) };
|
|
82
|
+
}
|
|
83
|
+
if (from.allDay) {
|
|
84
|
+
if (edge === "end") {
|
|
85
|
+
const end = Math.max(toSeconds(midnight(target.date)) + DAY, toSeconds(from.start) + DAY);
|
|
86
|
+
return { ...from, end: fromSeconds(end) };
|
|
87
|
+
}
|
|
88
|
+
const start = Math.min(toSeconds(midnight(target.date)), toSeconds(from.end) - DAY);
|
|
89
|
+
return { ...from, start: fromSeconds(start) };
|
|
90
|
+
}
|
|
91
|
+
// A timed event in the month grid: move the edge's day, keep its time of day.
|
|
92
|
+
if (edge === "end") {
|
|
93
|
+
const wall = toSeconds(plainDateTime(target.date, plainTime(from.end.hour, from.end.minute, from.end.second)));
|
|
94
|
+
return {
|
|
95
|
+
...from,
|
|
96
|
+
end: fromSeconds(Math.max(wall, toSeconds(from.start) + snap)),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const wall = toSeconds(plainDateTime(target.date, plainTime(from.start.hour, from.start.minute, from.start.second)));
|
|
100
|
+
return {
|
|
101
|
+
...from,
|
|
102
|
+
start: fromSeconds(Math.min(wall, toSeconds(from.end) - snap)),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/** A keyboard step (plan 09 M10): shift by days and minutes. */
|
|
106
|
+
export function nudgeEvent(from, kind, step, options) {
|
|
107
|
+
const delta = step.days * DAY + step.minutes * 60;
|
|
108
|
+
const unit = from.allDay ? DAY : options.snap * 60;
|
|
109
|
+
if (kind === "move") {
|
|
110
|
+
return {
|
|
111
|
+
...from,
|
|
112
|
+
start: fromSeconds(toSeconds(from.start) + delta),
|
|
113
|
+
end: fromSeconds(toSeconds(from.end) + delta),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
if (kind === "resize-end") {
|
|
117
|
+
const end = Math.max(toSeconds(from.end) + delta, toSeconds(from.start) + unit);
|
|
118
|
+
return { ...from, end: fromSeconds(end) };
|
|
119
|
+
}
|
|
120
|
+
const start = Math.min(toSeconds(from.start) + delta, toSeconds(from.end) - unit);
|
|
121
|
+
return { ...from, start: fromSeconds(start) };
|
|
122
|
+
}
|