@zsherman/calendar 0.0.0-stage → 0.1.1
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/CHANGELOG.md +24 -0
- package/LICENSE +373 -0
- package/README.md +13 -2
- package/THIRD_PARTY_NOTICES.md +39 -0
- package/dist/dom/engine/api/calendar.js +284 -0
- package/dist/dom/engine/api/controller.js +39 -0
- package/dist/dom/engine/api/types.js +0 -0
- package/dist/dom/engine/dom/bind.js +41 -0
- package/dist/dom/engine/dom/content.js +57 -0
- package/dist/dom/engine/dom/day-el.js +87 -0
- package/dist/dom/engine/dom/el.js +102 -0
- package/dist/dom/engine/dom/event-el.js +229 -0
- package/dist/dom/engine/dom/index.js +10 -0
- package/dist/dom/engine/dom/keyed.js +64 -0
- package/dist/dom/engine/dom/observe.js +71 -0
- package/dist/dom/engine/dom/slots.js +1 -0
- package/dist/dom/engine/dom/swipe/gesture.js +65 -0
- package/dist/dom/engine/dom/swipe/index.js +372 -0
- package/dist/dom/engine/dom/swipe/transition.js +155 -0
- package/dist/dom/engine/dom/swipe/wheel-session.js +33 -0
- package/dist/dom/engine/dom/swipe/wheel-tracker.js +118 -0
- package/dist/dom/engine/dom/targets.js +102 -0
- package/dist/dom/engine/dom/toolbar.js +138 -0
- package/dist/dom/engine/events/expand.js +155 -0
- package/dist/dom/engine/events/fetch.js +95 -0
- package/dist/dom/engine/events/filter.js +39 -0
- package/dist/dom/engine/events/index.js +10 -0
- package/dist/dom/engine/events/mutation.js +135 -0
- package/dist/dom/engine/events/occurrence.js +63 -0
- package/dist/dom/engine/events/parse.js +201 -0
- package/dist/dom/engine/events/public.js +63 -0
- package/dist/dom/engine/events/range.js +23 -0
- package/dist/dom/engine/events/recurring.js +0 -0
- package/dist/dom/engine/events/slice.js +142 -0
- package/dist/dom/engine/events/store.js +148 -0
- package/dist/dom/engine/events/types.js +0 -0
- package/dist/dom/engine/index.js +54 -0
- package/dist/dom/engine/interaction/action.js +849 -0
- package/dist/dom/engine/interaction/constraints.js +87 -0
- package/dist/dom/engine/interaction/index.js +57 -0
- package/dist/dom/engine/interaction/lib.js +23 -0
- package/dist/dom/engine/interaction/pointer.js +77 -0
- package/dist/dom/engine/keyboard/focus.js +97 -0
- package/dist/dom/engine/keyboard/index.js +7 -0
- package/dist/dom/engine/keyboard/live-region.js +62 -0
- package/dist/dom/engine/keyboard/model.js +188 -0
- package/dist/dom/engine/keyboard/navigation.js +437 -0
- package/dist/dom/engine/keyboard/shortcuts-listener.js +54 -0
- package/dist/dom/engine/keyboard/shortcuts.js +83 -0
- package/dist/dom/engine/layout/business-hours.js +174 -0
- package/dist/dom/engine/layout/cells.js +81 -0
- package/dist/dom/engine/layout/day-grid.js +90 -0
- package/dist/dom/engine/layout/index.js +8 -0
- package/dist/dom/engine/layout/slots.js +69 -0
- package/dist/dom/engine/layout/time-grid.js +123 -0
- package/dist/dom/engine/layout/timeline.js +113 -0
- package/dist/dom/engine/options/diff.js +13 -0
- package/dist/dom/engine/options/index.js +5 -0
- package/dist/dom/engine/options/info.js +0 -0
- package/dist/dom/engine/options/refiners.js +293 -0
- package/dist/dom/engine/options/resolve.js +255 -0
- package/dist/dom/engine/options/schema.js +0 -0
- package/dist/dom/engine/options/theme.js +102 -0
- package/dist/dom/engine/plugins/registry.js +43 -0
- package/dist/dom/engine/plugins/types.js +0 -0
- package/dist/dom/engine/polyfill.js +14 -0
- package/dist/dom/engine/recurrence/edit.js +262 -0
- package/dist/dom/engine/recurrence/engine.js +241 -0
- package/dist/dom/engine/recurrence/index.js +14 -0
- package/dist/dom/engine/recurrence/spec.js +290 -0
- package/dist/dom/engine/recurrence/type.js +40 -0
- package/dist/dom/engine/resources/index.js +1 -0
- package/dist/dom/engine/resources/parse.js +91 -0
- package/dist/dom/engine/resources/types.js +0 -0
- package/dist/dom/engine/signals/index.js +358 -0
- package/dist/dom/engine/state/calendar-state.js +479 -0
- package/dist/dom/engine/state/hooks.js +0 -0
- package/dist/dom/engine/state/index.js +3 -0
- package/dist/dom/engine/state/slots.js +49 -0
- package/dist/dom/engine/state/types.js +0 -0
- package/dist/dom/engine/temporal/date.js +174 -0
- package/dist/dom/engine/temporal/duration.js +109 -0
- package/dist/dom/engine/temporal/env.js +42 -0
- package/dist/dom/engine/temporal/errors.js +10 -0
- package/dist/dom/engine/temporal/format.js +70 -0
- package/dist/dom/engine/temporal/index.js +8 -0
- package/dist/dom/engine/temporal/parse.js +132 -0
- package/dist/dom/engine/temporal/types.js +0 -0
- package/dist/dom/engine/temporal/week.js +32 -0
- package/dist/dom/engine/views/day-grid/index.js +70 -0
- package/dist/dom/engine/views/day-grid/popup.js +130 -0
- package/dist/dom/engine/views/day-grid/view.js +299 -0
- package/dist/dom/engine/views/list/index.js +71 -0
- package/dist/dom/engine/views/list/view.js +117 -0
- package/dist/dom/engine/views/resource-time-grid/index.js +38 -0
- package/dist/dom/engine/views/resource-time-grid/view.js +185 -0
- package/dist/dom/engine/views/resource-timeline/derived.js +103 -0
- package/dist/dom/engine/views/resource-timeline/expander.js +54 -0
- package/dist/dom/engine/views/resource-timeline/index.js +100 -0
- package/dist/dom/engine/views/resource-timeline/now-indicator.js +48 -0
- package/dist/dom/engine/views/resource-timeline/view.js +341 -0
- package/dist/dom/engine/views/shared/business-hours.js +41 -0
- package/dist/dom/engine/views/shared/headers.js +48 -0
- package/dist/dom/engine/views/shared/resource-label.js +56 -0
- package/dist/dom/engine/views/shared/resources.js +13 -0
- package/dist/dom/engine/views/time-grid/day-focus.js +62 -0
- package/dist/dom/engine/views/time-grid/derived.js +77 -0
- package/dist/dom/engine/views/time-grid/event-inspection.js +212 -0
- package/dist/dom/engine/views/time-grid/index.js +58 -0
- package/dist/dom/engine/views/time-grid/now-indicator.js +45 -0
- package/dist/dom/engine/views/time-grid/view.js +332 -0
- package/dist/dom/event-calendar/anchors.js +52 -0
- package/dist/dom/event-calendar/clock.js +30 -0
- package/dist/dom/event-calendar/convert.js +102 -0
- package/dist/dom/event-calendar/drafts.js +28 -0
- package/dist/dom/event-calendar/empty.js +23 -0
- package/dist/dom/event-calendar/event-calendar.js +660 -0
- package/dist/dom/event-calendar/event-calendar.styles.js +98 -0
- package/dist/dom/event-calendar/event-card.js +120 -0
- package/dist/dom/event-calendar/index.js +1 -0
- package/dist/dom/event-calendar/labels.js +41 -0
- package/dist/dom/event-calendar/moves.js +87 -0
- package/dist/dom/event-calendar/runtime.js +25 -0
- package/dist/dom/event-calendar/scroll.js +8 -0
- package/dist/dom/event-calendar/toolbar.js +280 -0
- package/dist/dom/event-calendar/types.js +0 -0
- package/dist/dom/index.js +1 -0
- package/dist/solid/engine/api/calendar.jsx +284 -0
- package/dist/solid/engine/api/controller.jsx +39 -0
- package/dist/solid/engine/api/types.jsx +0 -0
- package/dist/solid/engine/dom/bind.jsx +41 -0
- package/dist/solid/engine/dom/content.jsx +57 -0
- package/dist/solid/engine/dom/day-el.jsx +87 -0
- package/dist/solid/engine/dom/el.jsx +102 -0
- package/dist/solid/engine/dom/event-el.jsx +229 -0
- package/dist/solid/engine/dom/index.jsx +10 -0
- package/dist/solid/engine/dom/keyed.jsx +64 -0
- package/dist/solid/engine/dom/observe.jsx +71 -0
- package/dist/solid/engine/dom/slots.jsx +1 -0
- package/dist/solid/engine/dom/swipe/gesture.jsx +65 -0
- package/dist/solid/engine/dom/swipe/index.jsx +372 -0
- package/dist/solid/engine/dom/swipe/transition.jsx +155 -0
- package/dist/solid/engine/dom/swipe/wheel-session.jsx +33 -0
- package/dist/solid/engine/dom/swipe/wheel-tracker.jsx +118 -0
- package/dist/solid/engine/dom/targets.jsx +102 -0
- package/dist/solid/engine/dom/toolbar.jsx +138 -0
- package/dist/solid/engine/events/expand.jsx +155 -0
- package/dist/solid/engine/events/fetch.jsx +95 -0
- package/dist/solid/engine/events/filter.jsx +39 -0
- package/dist/solid/engine/events/index.jsx +10 -0
- package/dist/solid/engine/events/mutation.jsx +135 -0
- package/dist/solid/engine/events/occurrence.jsx +63 -0
- package/dist/solid/engine/events/parse.jsx +201 -0
- package/dist/solid/engine/events/public.jsx +63 -0
- package/dist/solid/engine/events/range.jsx +23 -0
- package/dist/solid/engine/events/recurring.jsx +0 -0
- package/dist/solid/engine/events/slice.jsx +142 -0
- package/dist/solid/engine/events/store.jsx +148 -0
- package/dist/solid/engine/events/types.jsx +0 -0
- package/dist/solid/engine/index.jsx +54 -0
- package/dist/solid/engine/interaction/action.jsx +849 -0
- package/dist/solid/engine/interaction/constraints.jsx +87 -0
- package/dist/solid/engine/interaction/index.jsx +57 -0
- package/dist/solid/engine/interaction/lib.jsx +23 -0
- package/dist/solid/engine/interaction/pointer.jsx +77 -0
- package/dist/solid/engine/keyboard/focus.jsx +97 -0
- package/dist/solid/engine/keyboard/index.jsx +7 -0
- package/dist/solid/engine/keyboard/live-region.jsx +62 -0
- package/dist/solid/engine/keyboard/model.jsx +188 -0
- package/dist/solid/engine/keyboard/navigation.jsx +437 -0
- package/dist/solid/engine/keyboard/shortcuts-listener.jsx +54 -0
- package/dist/solid/engine/keyboard/shortcuts.jsx +83 -0
- package/dist/solid/engine/layout/business-hours.jsx +174 -0
- package/dist/solid/engine/layout/cells.jsx +81 -0
- package/dist/solid/engine/layout/day-grid.jsx +90 -0
- package/dist/solid/engine/layout/index.jsx +8 -0
- package/dist/solid/engine/layout/slots.jsx +69 -0
- package/dist/solid/engine/layout/time-grid.jsx +123 -0
- package/dist/solid/engine/layout/timeline.jsx +113 -0
- package/dist/solid/engine/options/diff.jsx +13 -0
- package/dist/solid/engine/options/index.jsx +5 -0
- package/dist/solid/engine/options/info.jsx +0 -0
- package/dist/solid/engine/options/refiners.jsx +293 -0
- package/dist/solid/engine/options/resolve.jsx +255 -0
- package/dist/solid/engine/options/schema.jsx +0 -0
- package/dist/solid/engine/options/theme.jsx +102 -0
- package/dist/solid/engine/plugins/registry.jsx +43 -0
- package/dist/solid/engine/plugins/types.jsx +0 -0
- package/dist/solid/engine/polyfill.jsx +14 -0
- package/dist/solid/engine/recurrence/edit.jsx +262 -0
- package/dist/solid/engine/recurrence/engine.jsx +241 -0
- package/dist/solid/engine/recurrence/index.jsx +14 -0
- package/dist/solid/engine/recurrence/spec.jsx +290 -0
- package/dist/solid/engine/recurrence/type.jsx +40 -0
- package/dist/solid/engine/resources/index.jsx +1 -0
- package/dist/solid/engine/resources/parse.jsx +91 -0
- package/dist/solid/engine/resources/types.jsx +0 -0
- package/dist/solid/engine/signals/index.jsx +358 -0
- package/dist/solid/engine/state/calendar-state.jsx +479 -0
- package/dist/solid/engine/state/hooks.jsx +0 -0
- package/dist/solid/engine/state/index.jsx +3 -0
- package/dist/solid/engine/state/slots.jsx +49 -0
- package/dist/solid/engine/state/types.jsx +0 -0
- package/dist/solid/engine/temporal/date.jsx +174 -0
- package/dist/solid/engine/temporal/duration.jsx +109 -0
- package/dist/solid/engine/temporal/env.jsx +42 -0
- package/dist/solid/engine/temporal/errors.jsx +10 -0
- package/dist/solid/engine/temporal/format.jsx +70 -0
- package/dist/solid/engine/temporal/index.jsx +8 -0
- package/dist/solid/engine/temporal/parse.jsx +132 -0
- package/dist/solid/engine/temporal/types.jsx +0 -0
- package/dist/solid/engine/temporal/week.jsx +32 -0
- package/dist/solid/engine/views/day-grid/index.jsx +70 -0
- package/dist/solid/engine/views/day-grid/popup.jsx +130 -0
- package/dist/solid/engine/views/day-grid/view.jsx +299 -0
- package/dist/solid/engine/views/list/index.jsx +71 -0
- package/dist/solid/engine/views/list/view.jsx +117 -0
- package/dist/solid/engine/views/resource-time-grid/index.jsx +38 -0
- package/dist/solid/engine/views/resource-time-grid/view.jsx +185 -0
- package/dist/solid/engine/views/resource-timeline/derived.jsx +103 -0
- package/dist/solid/engine/views/resource-timeline/expander.jsx +54 -0
- package/dist/solid/engine/views/resource-timeline/index.jsx +100 -0
- package/dist/solid/engine/views/resource-timeline/now-indicator.jsx +48 -0
- package/dist/solid/engine/views/resource-timeline/view.jsx +341 -0
- package/dist/solid/engine/views/shared/business-hours.jsx +41 -0
- package/dist/solid/engine/views/shared/headers.jsx +48 -0
- package/dist/solid/engine/views/shared/resource-label.jsx +56 -0
- package/dist/solid/engine/views/shared/resources.jsx +13 -0
- package/dist/solid/engine/views/time-grid/day-focus.jsx +62 -0
- package/dist/solid/engine/views/time-grid/derived.jsx +77 -0
- package/dist/solid/engine/views/time-grid/event-inspection.jsx +212 -0
- package/dist/solid/engine/views/time-grid/index.jsx +58 -0
- package/dist/solid/engine/views/time-grid/now-indicator.jsx +45 -0
- package/dist/solid/engine/views/time-grid/view.jsx +332 -0
- package/dist/solid/event-calendar/anchors.jsx +52 -0
- package/dist/solid/event-calendar/clock.jsx +30 -0
- package/dist/solid/event-calendar/convert.jsx +102 -0
- package/dist/solid/event-calendar/drafts.jsx +28 -0
- package/dist/solid/event-calendar/empty.jsx +12 -0
- package/dist/solid/event-calendar/event-calendar.jsx +535 -0
- package/dist/solid/event-calendar/event-calendar.styles.jsx +98 -0
- package/dist/solid/event-calendar/event-card.jsx +49 -0
- package/dist/solid/event-calendar/index.jsx +1 -0
- package/dist/solid/event-calendar/labels.jsx +41 -0
- package/dist/solid/event-calendar/moves.jsx +87 -0
- package/dist/solid/event-calendar/runtime.jsx +25 -0
- package/dist/solid/event-calendar/scroll.jsx +8 -0
- package/dist/solid/event-calendar/toolbar.jsx +118 -0
- package/dist/solid/event-calendar/types.jsx +0 -0
- package/dist/solid/index.jsx +1 -0
- package/dist/styles.css +1 -0
- package/dist/types/engine/api/calendar.d.ts +91 -0
- package/dist/types/engine/api/controller.d.ts +24 -0
- package/dist/types/engine/api/types.d.ts +10 -0
- package/dist/types/engine/dom/bind.d.ts +14 -0
- package/dist/types/engine/dom/content.d.ts +28 -0
- package/dist/types/engine/dom/day-el.d.ts +25 -0
- package/dist/types/engine/dom/el.d.ts +28 -0
- package/dist/types/engine/dom/event-el.d.ts +22 -0
- package/dist/types/engine/dom/index.d.ts +9 -0
- package/dist/types/engine/dom/keyed.d.ts +10 -0
- package/dist/types/engine/dom/observe.d.ts +23 -0
- package/dist/types/engine/dom/slots.d.ts +2 -0
- package/dist/types/engine/dom/swipe/gesture.d.ts +54 -0
- package/dist/types/engine/dom/swipe/index.d.ts +7 -0
- package/dist/types/engine/dom/swipe/transition.d.ts +30 -0
- package/dist/types/engine/dom/swipe/wheel-session.d.ts +17 -0
- package/dist/types/engine/dom/swipe/wheel-tracker.d.ts +27 -0
- package/dist/types/engine/dom/targets.d.ts +50 -0
- package/dist/types/engine/dom/toolbar.d.ts +4 -0
- package/dist/types/engine/events/expand.d.ts +18 -0
- package/dist/types/engine/events/fetch.d.ts +27 -0
- package/dist/types/engine/events/filter.d.ts +23 -0
- package/dist/types/engine/events/index.d.ts +11 -0
- package/dist/types/engine/events/mutation.d.ts +39 -0
- package/dist/types/engine/events/occurrence.d.ts +21 -0
- package/dist/types/engine/events/parse.d.ts +22 -0
- package/dist/types/engine/events/public.d.ts +13 -0
- package/dist/types/engine/events/range.d.ts +4 -0
- package/dist/types/engine/events/recurring.d.ts +116 -0
- package/dist/types/engine/events/slice.d.ts +56 -0
- package/dist/types/engine/events/store.d.ts +26 -0
- package/dist/types/engine/events/types.d.ts +149 -0
- package/dist/types/engine/index.d.ts +27 -0
- package/dist/types/engine/interaction/action.d.ts +25 -0
- package/dist/types/engine/interaction/constraints.d.ts +43 -0
- package/dist/types/engine/interaction/index.d.ts +6 -0
- package/dist/types/engine/interaction/lib.d.ts +6 -0
- package/dist/types/engine/interaction/pointer.d.ts +3 -0
- package/dist/types/engine/keyboard/focus.d.ts +28 -0
- package/dist/types/engine/keyboard/index.d.ts +8 -0
- package/dist/types/engine/keyboard/live-region.d.ts +6 -0
- package/dist/types/engine/keyboard/model.d.ts +51 -0
- package/dist/types/engine/keyboard/navigation.d.ts +19 -0
- package/dist/types/engine/keyboard/shortcuts-listener.d.ts +7 -0
- package/dist/types/engine/keyboard/shortcuts.d.ts +16 -0
- package/dist/types/engine/layout/business-hours.d.ts +75 -0
- package/dist/types/engine/layout/cells.d.ts +50 -0
- package/dist/types/engine/layout/day-grid.d.ts +29 -0
- package/dist/types/engine/layout/index.d.ts +8 -0
- package/dist/types/engine/layout/slots.d.ts +27 -0
- package/dist/types/engine/layout/time-grid.d.ts +31 -0
- package/dist/types/engine/layout/timeline.d.ts +45 -0
- package/dist/types/engine/options/diff.d.ts +3 -0
- package/dist/types/engine/options/index.d.ts +8 -0
- package/dist/types/engine/options/info.d.ts +195 -0
- package/dist/types/engine/options/refiners.d.ts +76 -0
- package/dist/types/engine/options/resolve.d.ts +28 -0
- package/dist/types/engine/options/schema.d.ts +218 -0
- package/dist/types/engine/options/theme.d.ts +109 -0
- package/dist/types/engine/plugins/registry.d.ts +16 -0
- package/dist/types/engine/plugins/types.d.ts +55 -0
- package/dist/types/engine/polyfill.d.ts +9 -0
- package/dist/types/engine/recurrence/edit.d.ts +21 -0
- package/dist/types/engine/recurrence/engine.d.ts +14 -0
- package/dist/types/engine/recurrence/index.d.ts +12 -0
- package/dist/types/engine/recurrence/spec.d.ts +63 -0
- package/dist/types/engine/recurrence/type.d.ts +10 -0
- package/dist/types/engine/resources/index.d.ts +2 -0
- package/dist/types/engine/resources/parse.d.ts +19 -0
- package/dist/types/engine/resources/types.d.ts +38 -0
- package/dist/types/engine/signals/index.d.ts +52 -0
- package/dist/types/engine/state/calendar-state.d.ts +124 -0
- package/dist/types/engine/state/hooks.d.ts +54 -0
- package/dist/types/engine/state/index.d.ts +6 -0
- package/dist/types/engine/state/slots.d.ts +27 -0
- package/dist/types/engine/state/types.d.ts +34 -0
- package/dist/types/engine/temporal/date.d.ts +59 -0
- package/dist/types/engine/temporal/duration.d.ts +20 -0
- package/dist/types/engine/temporal/env.d.ts +12 -0
- package/dist/types/engine/temporal/errors.d.ts +5 -0
- package/dist/types/engine/temporal/format.d.ts +19 -0
- package/dist/types/engine/temporal/index.d.ts +8 -0
- package/dist/types/engine/temporal/parse.d.ts +23 -0
- package/dist/types/engine/temporal/types.d.ts +58 -0
- package/dist/types/engine/temporal/week.d.ts +9 -0
- package/dist/types/engine/views/day-grid/index.d.ts +4 -0
- package/dist/types/engine/views/day-grid/popup.d.ts +7 -0
- package/dist/types/engine/views/day-grid/view.d.ts +15 -0
- package/dist/types/engine/views/list/index.d.ts +4 -0
- package/dist/types/engine/views/list/view.d.ts +3 -0
- package/dist/types/engine/views/resource-time-grid/index.d.ts +4 -0
- package/dist/types/engine/views/resource-time-grid/view.d.ts +12 -0
- package/dist/types/engine/views/resource-timeline/derived.d.ts +32 -0
- package/dist/types/engine/views/resource-timeline/expander.d.ts +5 -0
- package/dist/types/engine/views/resource-timeline/index.d.ts +6 -0
- package/dist/types/engine/views/resource-timeline/now-indicator.d.ts +5 -0
- package/dist/types/engine/views/resource-timeline/view.d.ts +3 -0
- package/dist/types/engine/views/shared/business-hours.d.ts +14 -0
- package/dist/types/engine/views/shared/headers.d.ts +19 -0
- package/dist/types/engine/views/shared/resource-label.d.ts +12 -0
- package/dist/types/engine/views/shared/resources.d.ts +7 -0
- package/dist/types/engine/views/time-grid/day-focus.d.ts +9 -0
- package/dist/types/engine/views/time-grid/derived.d.ts +32 -0
- package/dist/types/engine/views/time-grid/event-inspection.d.ts +7 -0
- package/dist/types/engine/views/time-grid/index.d.ts +6 -0
- package/dist/types/engine/views/time-grid/now-indicator.d.ts +5 -0
- package/dist/types/engine/views/time-grid/view.d.ts +16 -0
- package/dist/types/event-calendar/anchors.d.ts +20 -0
- package/dist/types/event-calendar/clock.d.ts +10 -0
- package/dist/types/event-calendar/convert.d.ts +30 -0
- package/dist/types/event-calendar/drafts.d.ts +10 -0
- package/dist/types/event-calendar/empty.d.ts +6 -0
- package/dist/types/event-calendar/event-calendar.d.ts +12 -0
- package/dist/types/event-calendar/event-calendar.styles.d.ts +87 -0
- package/dist/types/event-calendar/event-card.d.ts +17 -0
- package/dist/types/event-calendar/index.d.ts +2 -0
- package/dist/types/event-calendar/labels.d.ts +8 -0
- package/dist/types/event-calendar/moves.d.ts +78 -0
- package/dist/types/event-calendar/runtime.d.ts +13 -0
- package/dist/types/event-calendar/scroll.d.ts +10 -0
- package/dist/types/event-calendar/toolbar.d.ts +23 -0
- package/dist/types/event-calendar/types.d.ts +276 -0
- package/dist/types/index.d.ts +1 -0
- package/docs/api.json +405 -0
- package/docs/event-calendar.md +446 -0
- package/docs/llms.txt +39 -0
- package/docs/search-index.json +73 -0
- package/package.json +56 -4
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { CalDate, DateInput, EpochDay, PlainDate, ZonedDateTime } from '../temporal/types.js';
|
|
2
|
+
import type { Content } from '../temporal/format.js';
|
|
3
|
+
import type { BusinessHoursRule, RangeConstraint } from '../layout/business-hours.js';
|
|
4
|
+
import type { OccurrenceInfo, ParsedRecurrence, RecurrenceRule } from './recurring.js';
|
|
5
|
+
export type EventDisplay = 'auto' | 'background' | 'ghost' | 'preview' | 'pointer';
|
|
6
|
+
/** Event input accepted by z-cal. See the events guide for date and update semantics. */
|
|
7
|
+
export interface EventInput {
|
|
8
|
+
id?: string | number;
|
|
9
|
+
resourceId?: string | number | Array<string | number>;
|
|
10
|
+
resourceIds?: string | number | Array<string | number>;
|
|
11
|
+
allDay?: boolean;
|
|
12
|
+
start: DateInput;
|
|
13
|
+
end?: DateInput;
|
|
14
|
+
title?: Content;
|
|
15
|
+
editable?: boolean;
|
|
16
|
+
startEditable?: boolean;
|
|
17
|
+
durationEditable?: boolean;
|
|
18
|
+
display?: EventDisplay;
|
|
19
|
+
extendedProps?: Record<string, unknown>;
|
|
20
|
+
color?: string;
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
textColor?: string;
|
|
23
|
+
className?: string | string[];
|
|
24
|
+
classNames?: string | string[];
|
|
25
|
+
style?: string | string[];
|
|
26
|
+
styles?: string | string[];
|
|
27
|
+
/** Where this event may be dragged or resized; replaces `dragConstraint` / `resizeConstraint` for it. */
|
|
28
|
+
constraint?: RangeConstraint;
|
|
29
|
+
/** `false` keeps other events from being dragged or resized onto this one, and this one off them. */
|
|
30
|
+
overlap?: boolean;
|
|
31
|
+
/** Repeat this event; needs the `Recurrence` plugin (or a plugin providing a recurring type). */
|
|
32
|
+
recurrence?: RecurrenceRule;
|
|
33
|
+
/** Server-expanded occurrence: the id of its series. Reported as `occurrence.seriesId`. */
|
|
34
|
+
recurringEventId?: string | number;
|
|
35
|
+
/** Server-expanded occurrence: its original start (the occurrence key); defaults to `start`. */
|
|
36
|
+
originalStart?: DateInput;
|
|
37
|
+
[extra: string]: unknown;
|
|
38
|
+
}
|
|
39
|
+
/** Time span of one event occurrence with numeric caches for layout. */
|
|
40
|
+
export type EventRange = {
|
|
41
|
+
allDay: true;
|
|
42
|
+
start: PlainDate;
|
|
43
|
+
end: PlainDate;
|
|
44
|
+
startDay: EpochDay;
|
|
45
|
+
endDay: EpochDay;
|
|
46
|
+
/** Instants of the day boundaries in the calendar zone. */
|
|
47
|
+
startMs: number;
|
|
48
|
+
endMs: number;
|
|
49
|
+
} | {
|
|
50
|
+
allDay: false;
|
|
51
|
+
start: ZonedDateTime;
|
|
52
|
+
end: ZonedDateTime;
|
|
53
|
+
startMs: number;
|
|
54
|
+
endMs: number;
|
|
55
|
+
};
|
|
56
|
+
/** Identity and non-temporal data of an event. */
|
|
57
|
+
export interface EventDef {
|
|
58
|
+
defId: string;
|
|
59
|
+
publicId: string;
|
|
60
|
+
sourceId: string;
|
|
61
|
+
title: Content;
|
|
62
|
+
allDay: boolean;
|
|
63
|
+
resourceIds: string[];
|
|
64
|
+
display: EventDisplay;
|
|
65
|
+
editable: boolean | undefined;
|
|
66
|
+
startEditable: boolean | undefined;
|
|
67
|
+
durationEditable: boolean | undefined;
|
|
68
|
+
/** Accent colour: the stylesheet derives a tinted background, text and border from it. */
|
|
69
|
+
color: string | undefined;
|
|
70
|
+
/** Explicit background, used verbatim (does not fall back to `color`). */
|
|
71
|
+
backgroundColor: string | undefined;
|
|
72
|
+
textColor: string | undefined;
|
|
73
|
+
classNames: string[];
|
|
74
|
+
styles: string[];
|
|
75
|
+
extendedProps: Record<string, unknown>;
|
|
76
|
+
/** The original input, kept so the store can be re-parsed when the time zone changes. */
|
|
77
|
+
raw: EventInput;
|
|
78
|
+
/** Parsed rule of a series master (absent on plain events and server-expanded occurrences). */
|
|
79
|
+
recurrence?: ParsedRecurrence;
|
|
80
|
+
/** Per-event drag/resize constraint (inline hours are parsed to seconds). */
|
|
81
|
+
constraint?: string | BusinessHoursRule[];
|
|
82
|
+
overlap?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* One occurrence of an event in time. Plain events have exactly one, with `instanceId === defId`;
|
|
86
|
+
* expanded series have one per occurrence, with `instanceId` = `defId@key`.
|
|
87
|
+
*/
|
|
88
|
+
export interface EventInstance {
|
|
89
|
+
instanceId: string;
|
|
90
|
+
defId: string;
|
|
91
|
+
range: EventRange;
|
|
92
|
+
occurrence?: OccurrenceInfo;
|
|
93
|
+
}
|
|
94
|
+
export interface EventStore {
|
|
95
|
+
defs: ReadonlyMap<string, EventDef>;
|
|
96
|
+
instances: ReadonlyMap<string, EventInstance>;
|
|
97
|
+
/** publicId → defId */
|
|
98
|
+
byPublicId: ReadonlyMap<string, string>;
|
|
99
|
+
}
|
|
100
|
+
/** Public event snapshot used in callbacks and returned by the API. Dates are Temporal values. */
|
|
101
|
+
export interface CalEvent {
|
|
102
|
+
id: string;
|
|
103
|
+
instanceId: string;
|
|
104
|
+
resourceIds: string[];
|
|
105
|
+
allDay: boolean;
|
|
106
|
+
start: CalDate;
|
|
107
|
+
end: CalDate;
|
|
108
|
+
startStr: string;
|
|
109
|
+
endStr: string;
|
|
110
|
+
title: Content;
|
|
111
|
+
editable: boolean | undefined;
|
|
112
|
+
startEditable: boolean | undefined;
|
|
113
|
+
durationEditable: boolean | undefined;
|
|
114
|
+
display: EventDisplay;
|
|
115
|
+
color: string | undefined;
|
|
116
|
+
backgroundColor: string | undefined;
|
|
117
|
+
textColor: string | undefined;
|
|
118
|
+
classNames: string[];
|
|
119
|
+
styles: string[];
|
|
120
|
+
extendedProps: Record<string, unknown>;
|
|
121
|
+
/** Per-event drag/resize constraint; inline hours are reported in seconds from midnight. */
|
|
122
|
+
constraint: RangeConstraint | undefined;
|
|
123
|
+
overlap: boolean | undefined;
|
|
124
|
+
/** Normalized rule of the series this event belongs to (on the master and every occurrence). */
|
|
125
|
+
recurrence: RecurrenceRule | undefined;
|
|
126
|
+
/** Identity of this occurrence inside its series; undefined on plain events and series masters. */
|
|
127
|
+
occurrence: OccurrenceInfo | undefined;
|
|
128
|
+
}
|
|
129
|
+
export interface FetchInfo {
|
|
130
|
+
start: ZonedDateTime;
|
|
131
|
+
end: ZonedDateTime;
|
|
132
|
+
startStr: string;
|
|
133
|
+
endStr: string;
|
|
134
|
+
timeZone: string;
|
|
135
|
+
}
|
|
136
|
+
export type EventSourceFunc = (info: FetchInfo, success: (events: EventInput[]) => void, failure: (error: unknown) => void) => void | Promise<EventInput[]>;
|
|
137
|
+
export type EventSourceInput = EventSourceFunc | {
|
|
138
|
+
events?: EventSourceFunc;
|
|
139
|
+
url?: string;
|
|
140
|
+
method?: string;
|
|
141
|
+
extraParams?: Record<string, string> | (() => Record<string, string>);
|
|
142
|
+
};
|
|
143
|
+
export interface EventSource {
|
|
144
|
+
id: string;
|
|
145
|
+
events: EventSourceFunc | undefined;
|
|
146
|
+
url: string;
|
|
147
|
+
method: string;
|
|
148
|
+
extraParams: Record<string, string> | (() => Record<string, string>);
|
|
149
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const version: string;
|
|
2
|
+
export { signal, computed, effect, batch, untrack, onCleanup, createScope, tick, flushSync, } from './signals/index.js';
|
|
3
|
+
export type { Signal, ReadonlySignal, SignalOptions, EffectPhase, EffectOptions, Dispose, Scope, } from './signals/index.js';
|
|
4
|
+
export * from './temporal/index.js';
|
|
5
|
+
export * from './options/index.js';
|
|
6
|
+
export * from './events/index.js';
|
|
7
|
+
export * from './resources/index.js';
|
|
8
|
+
export * from './state/index.js';
|
|
9
|
+
export * from './layout/index.js';
|
|
10
|
+
export * from './plugins/types.js';
|
|
11
|
+
export { buildRegistry } from './plugins/registry.js';
|
|
12
|
+
export type { PluginRegistry } from './plugins/registry.js';
|
|
13
|
+
export type { ViewApi } from './api/types.js';
|
|
14
|
+
export { createCalendar, destroyCalendar } from './api/calendar.js';
|
|
15
|
+
export type { Calendar, CalendarInit, DateFromPointInfo } from './api/calendar.js';
|
|
16
|
+
export type { CalendarController, ControllerSnapshot } from './api/controller.js';
|
|
17
|
+
export * from './dom/index.js';
|
|
18
|
+
export { DEFAULT_SHORTCUTS, parseShortcuts, resolveView, moveFocus, moveFocusFar, selectionRange, } from './keyboard/index.js';
|
|
19
|
+
export type { CellInfo, GridKind, GridModel, Move, KeyboardFocusTarget } from './keyboard/index.js';
|
|
20
|
+
export { DayGrid } from './views/day-grid/index.js';
|
|
21
|
+
export { TimeGrid } from './views/time-grid/index.js';
|
|
22
|
+
export { List } from './views/list/index.js';
|
|
23
|
+
export { ResourceTimeGrid } from './views/resource-time-grid/index.js';
|
|
24
|
+
export { ResourceTimeline } from './views/resource-timeline/index.js';
|
|
25
|
+
export { Interaction } from './interaction/index.js';
|
|
26
|
+
export { Recurrence, editRecurringEvent, overrideOccurrence, splitSeries, shiftSeries, } from './recurrence/index.js';
|
|
27
|
+
export type { RecurrenceScope, SeriesEdit, SeriesEditOptions } from './recurrence/index.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ParsedEvent } from '../events/parse.js';
|
|
2
|
+
import type { Seg } from '../events/slice.js';
|
|
3
|
+
import type { ViewContext } from '../plugins/types.js';
|
|
4
|
+
import type { EventPointerOptions, SelectionRequest } from '../state/hooks.js';
|
|
5
|
+
import { DAY_IN_SECONDS, isZeroDuration } from '../temporal/duration.js';
|
|
6
|
+
import type { PlainDate, ZonedDateTime } from '../temporal/types.js';
|
|
7
|
+
import { eventDraggable } from './lib.js';
|
|
8
|
+
export interface ActionController {
|
|
9
|
+
drag(event: ParsedEvent, jsEvent: PointerEvent, opts: EventPointerOptions): void;
|
|
10
|
+
resize(seg: Seg, jsEvent: PointerEvent, fromStart: boolean, opts: EventPointerOptions): void;
|
|
11
|
+
select(jsEvent: PointerEvent): void;
|
|
12
|
+
noAction(): void;
|
|
13
|
+
noClick(): void;
|
|
14
|
+
cancelPointer(): void;
|
|
15
|
+
unselect(jsEvent?: Event): void;
|
|
16
|
+
previewSelection(range: SelectionRequest, jsEvent: Event): boolean;
|
|
17
|
+
commitSelection(jsEvent: Event): boolean;
|
|
18
|
+
cancelSelection(): void;
|
|
19
|
+
handleScroll(): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
}
|
|
22
|
+
/** Pointer-driven drag / resize / select state machine (port of vkurko/calendar `Action.svelte`). */
|
|
23
|
+
export declare function createActionController(ctx: ViewContext): ActionController;
|
|
24
|
+
export { eventDraggable, isZeroDuration, DAY_IN_SECONDS };
|
|
25
|
+
export type { PlainDate, ZonedDateTime };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ParsedEvent } from '../events/parse.js';
|
|
2
|
+
import type { CalEvent } from '../events/types.js';
|
|
3
|
+
import { type BusinessHoursRule, type ResolvedBusinessHours } from '../layout/business-hours.js';
|
|
4
|
+
import type { ResolvedOptions } from '../options/refiners.js';
|
|
5
|
+
import type { Resource } from '../resources/types.js';
|
|
6
|
+
import type { CalendarState } from '../state/calendar-state.js';
|
|
7
|
+
import type { CalDate, TimeZoneId } from '../temporal/types.js';
|
|
8
|
+
/** The range a gesture proposes, with the resource it lands on. */
|
|
9
|
+
export interface Candidate {
|
|
10
|
+
allDay: boolean;
|
|
11
|
+
start: CalDate;
|
|
12
|
+
end: CalDate;
|
|
13
|
+
resourceIds: readonly string[];
|
|
14
|
+
/** Column or row the candidate is evaluated against (the drop target, else the origin). */
|
|
15
|
+
resource: Resource | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface ConstraintContext {
|
|
18
|
+
options: Pick<ResolvedOptions, 'businessHours' | 'eventOverlap' | 'selectOverlap'>;
|
|
19
|
+
state: Pick<CalendarState, 'eventStore' | 'events' | 'timeZone'>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Whether `candidate` lies inside business hours: a timed range must be covered by one merged
|
|
23
|
+
* window (windows may chain across midnight); an all-day range needs business time on every day.
|
|
24
|
+
* With `resource` given, its own hours win over `hours`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function withinBusinessHours(hours: ResolvedBusinessHours, candidate: Candidate, tz: TimeZoneId, resource: Resource | undefined): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Evaluate a non-predicate constraint: `'businessHours'` (calendar hours, or the resource's), inline
|
|
29
|
+
* rules, or an event id the candidate must stay inside. Predicates are the caller's business.
|
|
30
|
+
*/
|
|
31
|
+
export declare function passesConstraint(constraint: string | BusinessHoursRule[], candidate: Candidate, ctx: ConstraintContext): boolean;
|
|
32
|
+
/** The instance being dragged or resized, and its public shape at the candidate position. */
|
|
33
|
+
export interface MovingEvent {
|
|
34
|
+
parsed: ParsedEvent;
|
|
35
|
+
calEvent: () => CalEvent;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Whether `candidate` may overlap the visible events. `moving` is the dragged or resized instance
|
|
39
|
+
* (skipped), absent for selections. Helpers never block; background events block only with
|
|
40
|
+
* `overlap: false`. Resources are compared only when both sides have some. `eventOverlap` /
|
|
41
|
+
* `selectOverlap` decide the rest: `false` blocks on any hit, a predicate runs per hit.
|
|
42
|
+
*/
|
|
43
|
+
export declare function passesOverlap(candidate: Candidate, moving: MovingEvent | undefined, ctx: ConstraintContext): boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CalendarPlugin } from '../plugins/types.js';
|
|
2
|
+
/** Drag & drop, resizing, date selection, date clicks and the hover pointer. */
|
|
3
|
+
export declare const Interaction: CalendarPlugin;
|
|
4
|
+
export default Interaction;
|
|
5
|
+
export { createActionController } from './action.js';
|
|
6
|
+
export type { ActionController } from './action.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EventDef } from '../events/types.js';
|
|
2
|
+
export declare function eventDraggable(def: EventDef, eventStartEditable: boolean | undefined, editable: boolean): boolean;
|
|
3
|
+
export declare function eventResizable(def: EventDef, eventDurationEditable: boolean | undefined, editable: boolean): boolean;
|
|
4
|
+
/** Run `fn` on the next animation frame, coalescing calls made before it fires. */
|
|
5
|
+
export declare function createAnimator(): (fn: () => void) => void;
|
|
6
|
+
export declare function limit(value: number, min: number, max: number): number;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type DayTarget } from '../dom/targets.js';
|
|
2
|
+
import type { DayCell } from '../layout/cells.js';
|
|
3
|
+
import type { CalendarState } from '../state/calendar-state.js';
|
|
4
|
+
import type { KeyboardFocus } from '../state/types.js';
|
|
5
|
+
import type { CellInfo, GridKind } from './model.js';
|
|
6
|
+
export interface CellEntry {
|
|
7
|
+
el: HTMLElement;
|
|
8
|
+
target: DayTarget;
|
|
9
|
+
info: CellInfo;
|
|
10
|
+
}
|
|
11
|
+
export declare function cellInfoOf(target: DayTarget): CellInfo;
|
|
12
|
+
/** Every registered day cell inside the view, in DOM order. */
|
|
13
|
+
export declare function collectCells(main: HTMLElement): CellEntry[];
|
|
14
|
+
export declare function gridKind(state: CalendarState, cells: readonly CellEntry[]): GridKind;
|
|
15
|
+
/** Does a rendered cell hold the keyboard tab stop? (Tracked read of `keyboardFocus`.) */
|
|
16
|
+
export declare function isCellFocused(state: CalendarState, cell: DayCell, allDay: boolean): boolean;
|
|
17
|
+
export declare function slotStep(state: CalendarState): number;
|
|
18
|
+
export declare function defaultSeconds(state: CalendarState, cell: CellInfo): number;
|
|
19
|
+
/** Focus for a cell reached without a slot in mind: keep the current slot when the kinds match. */
|
|
20
|
+
export declare function focusForCell(state: CalendarState, cell: CellInfo): KeyboardFocus;
|
|
21
|
+
/** Where the tab stop goes when the view first receives keyboard attention. */
|
|
22
|
+
export declare function entryFocus(state: CalendarState, cells: readonly CellEntry[]): KeyboardFocus | null;
|
|
23
|
+
/**
|
|
24
|
+
* The cell that should hold the tab stop for `focus` once the view re-rendered: the same cell if
|
|
25
|
+
* it still exists, else the same date in another kind, else the nearest visible date.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveFocus(state: CalendarState, cells: readonly CellEntry[], focus: KeyboardFocus): KeyboardFocus | null;
|
|
28
|
+
export declare function elementFor(cells: readonly CellEntry[], focus: KeyboardFocus): HTMLElement | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createKeyboardNavigation, KEYBOARD_CURSOR_ID } from './navigation.js';
|
|
2
|
+
export type { KeyboardNavigationApi, KeyboardFocusTarget } from './navigation.js';
|
|
3
|
+
export { createKeyboardShortcuts } from './shortcuts-listener.js';
|
|
4
|
+
export { createLiveRegion } from './live-region.js';
|
|
5
|
+
export { DEFAULT_SHORTCUTS, parseShortcuts, resolveView } from './shortcuts.js';
|
|
6
|
+
export { moveFocus, moveFocusFar, selectionRange } from './model.js';
|
|
7
|
+
export type { CellInfo, GridKind, GridModel, Move } from './model.js';
|
|
8
|
+
export { isCellFocused } from './focus.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CalendarState } from '../state/calendar-state.js';
|
|
2
|
+
/**
|
|
3
|
+
* A visually hidden polite live region. It announces the title after navigation and view changes and
|
|
4
|
+
* offers `state.announcer` for shorter messages (the keyboard cursor, pending selections).
|
|
5
|
+
*/
|
|
6
|
+
export declare function createLiveRegion(state: CalendarState): void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { KeyboardFocus } from '../state/types.js';
|
|
2
|
+
import type { CalDate, PlainDate, TimeZoneId } from '../temporal/types.js';
|
|
3
|
+
export type GridKind = 'dayGrid' | 'timeGrid' | 'timeline' | 'list';
|
|
4
|
+
/** One rendered day cell, as the movement model sees it. */
|
|
5
|
+
export interface CellInfo {
|
|
6
|
+
row: number;
|
|
7
|
+
col: number;
|
|
8
|
+
date: PlainDate;
|
|
9
|
+
allDay: boolean;
|
|
10
|
+
resourceId: string | undefined;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
/** Visible wall-clock range in seconds (timed cells). */
|
|
13
|
+
minSec: number;
|
|
14
|
+
maxSec: number;
|
|
15
|
+
}
|
|
16
|
+
export interface GridModel {
|
|
17
|
+
kind: GridKind;
|
|
18
|
+
/** Every cell of the view in DOM order. */
|
|
19
|
+
cells: readonly CellInfo[];
|
|
20
|
+
rtl: boolean;
|
|
21
|
+
/** Cursor step for timed cells, in seconds. */
|
|
22
|
+
step: number;
|
|
23
|
+
}
|
|
24
|
+
export type NavigateLand = 'first' | 'last' | 'shift';
|
|
25
|
+
export interface Move {
|
|
26
|
+
focus?: KeyboardFocus;
|
|
27
|
+
/** Leave the current period: `first`/`last` land on that edge of the new range, `shift` keeps the date offset. */
|
|
28
|
+
navigate?: {
|
|
29
|
+
dir: 'prev' | 'next';
|
|
30
|
+
land: NavigateLand;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export declare function cellMatches(cell: CellInfo, focus: KeyboardFocus): boolean;
|
|
34
|
+
/** `step` keeps a timed focus on a whole slot: the last one starts `step` before the range end. */
|
|
35
|
+
export declare function focusOf(cell: CellInfo, seconds?: number, step?: number): KeyboardFocus;
|
|
36
|
+
export declare function clampSeconds(cell: CellInfo, seconds: number, margin: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* Where a key moves the keyboard focus. Returns `null` for keys the model does not handle so the
|
|
39
|
+
* caller leaves the event alone. Left/Right are already swapped for RTL by the caller.
|
|
40
|
+
*/
|
|
41
|
+
export declare function moveFocus(focus: KeyboardFocus, key: string, model: GridModel): Move | null;
|
|
42
|
+
/** Ctrl/Cmd + Home/End: the first or last cell (or slot) of the whole view. */
|
|
43
|
+
export declare function moveFocusFar(focus: KeyboardFocus, key: 'Home' | 'End', model: GridModel): Move | null;
|
|
44
|
+
export interface SelectionRange {
|
|
45
|
+
allDay: boolean;
|
|
46
|
+
start: CalDate;
|
|
47
|
+
end: CalDate;
|
|
48
|
+
resourceId: string | undefined;
|
|
49
|
+
}
|
|
50
|
+
/** Range spanned by a keyboard selection from `anchor` to `head` (end exclusive). */
|
|
51
|
+
export declare function selectionRange(anchor: KeyboardFocus, head: KeyboardFocus, stepSeconds: number, tz: TimeZoneId): SelectionRange | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CalendarState } from '../state/calendar-state.js';
|
|
2
|
+
import type { PlainDate } from '../temporal/types.js';
|
|
3
|
+
export declare const KEYBOARD_CURSOR_ID = "{keyboard}";
|
|
4
|
+
export interface KeyboardFocusTarget {
|
|
5
|
+
date?: PlainDate;
|
|
6
|
+
allDay?: boolean;
|
|
7
|
+
seconds?: number;
|
|
8
|
+
resourceId?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface KeyboardNavigationApi {
|
|
11
|
+
/** Place the tab stop (default: where it is, or the entry cell) and move DOM focus to it. */
|
|
12
|
+
focus(target?: KeyboardFocusTarget): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Roving tab stop across day cells and slots. One cell carries `tabindex="0"` (see `day-el.ts`);
|
|
16
|
+
* arrow keys move it, Enter fires `dateClick`, Shift+Arrow previews a selection through the
|
|
17
|
+
* interaction hooks, and Escape hands focus back from an event to its cell.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createKeyboardNavigation(state: CalendarState): KeyboardNavigationApi;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CalendarState } from '../state/calendar-state.js';
|
|
2
|
+
import type { KeyboardNavigationApi } from './navigation.js';
|
|
3
|
+
/**
|
|
4
|
+
* Single-key shortcuts on the calendar root (or a host-chosen target). Keys never fire while a text
|
|
5
|
+
* field has focus, while a modifier is held, or during a pointer gesture.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createKeyboardShortcuts(state: CalendarState, navigation: KeyboardNavigationApi): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { KeyboardShortcutMap } from '../options/schema.js';
|
|
2
|
+
export interface ResolvedShortcuts {
|
|
3
|
+
keys: KeyboardShortcutMap;
|
|
4
|
+
target: EventTarget | null;
|
|
5
|
+
}
|
|
6
|
+
/** Google Calendar's single-key set: today, paging, and view switching. */
|
|
7
|
+
export declare const DEFAULT_SHORTCUTS: KeyboardShortcutMap;
|
|
8
|
+
export declare function parseShortcuts(input: boolean | {
|
|
9
|
+
keys?: KeyboardShortcutMap;
|
|
10
|
+
target?: EventTarget | null;
|
|
11
|
+
}): false | ResolvedShortcuts;
|
|
12
|
+
export declare function shortcutsEqual(a: false | ResolvedShortcuts, b: false | ResolvedShortcuts): boolean;
|
|
13
|
+
/** Resolve a view request (`{ view }`) against the registered view names; undefined when none fits. */
|
|
14
|
+
export declare function resolveView(name: string, registered: readonly string[]): string | undefined;
|
|
15
|
+
/** Text inputs and editable regions own their keys. */
|
|
16
|
+
export declare function isEditableTarget(target: EventTarget | null): boolean;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { DayOfWeek } from '../options/schema.js';
|
|
2
|
+
import type { Resource } from '../resources/types.js';
|
|
3
|
+
import type { DurationInput, PlainDate, TimeZoneId } from '../temporal/types.js';
|
|
4
|
+
import { type SlotLimits } from './cells.js';
|
|
5
|
+
/** One business-hours rule as written by the application. Missing fields take the weekday 09:00–17:00 defaults. */
|
|
6
|
+
export interface BusinessHoursInput {
|
|
7
|
+
/** Days the rule applies to (Sunday = 0). Default Monday to Friday. */
|
|
8
|
+
daysOfWeek?: DayOfWeek[];
|
|
9
|
+
/** Start of the window as a time of day. Default `09:00`. */
|
|
10
|
+
startTime?: DurationInput;
|
|
11
|
+
/** Exclusive end of the window; may pass midnight (`26:00`). Default `17:00`. */
|
|
12
|
+
endTime?: DurationInput;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Business hours computed per date (and per resource in resource views). `true` returns the default
|
|
16
|
+
* weekday window, `false` or an empty array closes the day.
|
|
17
|
+
*/
|
|
18
|
+
export type BusinessHoursFn = (date: PlainDate, resource?: Resource) => boolean | BusinessHoursInput | BusinessHoursInput[];
|
|
19
|
+
export type BusinessHoursOption = boolean | BusinessHoursInput | BusinessHoursInput[] | BusinessHoursFn;
|
|
20
|
+
/** A parsed rule. Times are seconds from local midnight; itself valid input, so re-parsing is idempotent. */
|
|
21
|
+
export interface BusinessHoursRule {
|
|
22
|
+
daysOfWeek: DayOfWeek[];
|
|
23
|
+
startTime: number;
|
|
24
|
+
endTime: number;
|
|
25
|
+
}
|
|
26
|
+
export type ResolvedBusinessHours = false | BusinessHoursRule[] | BusinessHoursFn;
|
|
27
|
+
/** A business window on one date, in wall-clock seconds from that date's midnight. */
|
|
28
|
+
export interface BusinessWindow {
|
|
29
|
+
startSec: number;
|
|
30
|
+
endSec: number;
|
|
31
|
+
}
|
|
32
|
+
/** A business window as instants. */
|
|
33
|
+
export interface BusinessWindowMs {
|
|
34
|
+
startMs: number;
|
|
35
|
+
endMs: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Where a drag, resize, or selection may land: the calendar's business hours, inline hours, or the
|
|
39
|
+
* id of an event the candidate must stay inside.
|
|
40
|
+
*/
|
|
41
|
+
export type RangeConstraint = 'businessHours' | BusinessHoursInput | BusinessHoursInput[] | (string & {});
|
|
42
|
+
export declare const DEFAULT_BUSINESS_HOURS: BusinessHoursRule;
|
|
43
|
+
/** Normalize a `businessHours` option value. Functions pass through and are evaluated per date. */
|
|
44
|
+
export declare function parseBusinessHours(input: BusinessHoursOption): ResolvedBusinessHours;
|
|
45
|
+
export declare function businessRulesEqual(a: readonly BusinessHoursRule[], b: readonly BusinessHoursRule[]): boolean;
|
|
46
|
+
export declare function businessHoursEqual(a: ResolvedBusinessHours, b: ResolvedBusinessHours): boolean;
|
|
47
|
+
/** Sort windows and merge the ones that overlap or touch. */
|
|
48
|
+
export declare function mergeWindows(windows: BusinessWindow[]): BusinessWindow[];
|
|
49
|
+
/**
|
|
50
|
+
* Merged business windows of a date in wall-clock seconds from its midnight, using the resource's
|
|
51
|
+
* own hours when it has any. Windows of the neighbouring days that reach into `limits` (the
|
|
52
|
+
* whole day by default) are included, shifted by a day, so hours that pass midnight, and slot
|
|
53
|
+
* ranges that do, shade and constrain consistently.
|
|
54
|
+
*/
|
|
55
|
+
export declare function businessWindows(hours: ResolvedBusinessHours, date: PlainDate, resource?: Resource, limits?: SlotLimits): BusinessWindow[];
|
|
56
|
+
/** Whether the date itself (its own rules, midnight to midnight) has no business window at all. */
|
|
57
|
+
export declare function isClosedDay(hours: ResolvedBusinessHours, date: PlainDate, resource?: Resource): boolean;
|
|
58
|
+
/** `businessWindows` as instants, positioned by wall clock so they agree with the grid on DST days. */
|
|
59
|
+
export declare function businessWindowsMs(hours: ResolvedBusinessHours, date: PlainDate, tz: TimeZoneId, resource?: Resource): BusinessWindowMs[];
|
|
60
|
+
/** Merge instant windows that overlap or touch. */
|
|
61
|
+
export declare function mergeWindowsMs(windows: BusinessWindowMs[]): BusinessWindowMs[];
|
|
62
|
+
/**
|
|
63
|
+
* The non-business parts of a cell's visible slot range (`minSec`–`maxSec`, wall-clock seconds), or
|
|
64
|
+
* `null` when the whole range is business time.
|
|
65
|
+
*/
|
|
66
|
+
export declare function nonBusinessGaps(windows: readonly BusinessWindow[], limits: {
|
|
67
|
+
minSec: number;
|
|
68
|
+
maxSec: number;
|
|
69
|
+
}): BusinessWindow[] | null;
|
|
70
|
+
/**
|
|
71
|
+
* A `linear-gradient()` mask that is opaque over the gaps and transparent elsewhere. Stops are in
|
|
72
|
+
* slot units of `axisVar` (`--cx-slot-height` or `--cx-slot-width`), so the shading follows the
|
|
73
|
+
* grid's own slot size, including `expandRows`, and matches wall-clock slicing on DST days.
|
|
74
|
+
*/
|
|
75
|
+
export declare function nonBusinessMask(gaps: readonly BusinessWindow[], minSec: number, slotSeconds: number, axisVar: '--cx-slot-height' | '--cx-slot-width'): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Resource } from '../resources/types.js';
|
|
2
|
+
import type { CalDuration, OpenDayRange, PlainDate, TimeZoneId, ZonedDateTime } from '../temporal/types.js';
|
|
3
|
+
/** One grid cell: a day (optionally for one resource) with numeric boundaries for fast intersection. */
|
|
4
|
+
export interface DayCell {
|
|
5
|
+
/** 1-based, like CSS `grid-column` / `grid-row`. */
|
|
6
|
+
col: number;
|
|
7
|
+
row: number;
|
|
8
|
+
date: PlainDate;
|
|
9
|
+
epochDay: number;
|
|
10
|
+
/** Instants of the day boundaries in the calendar zone. */
|
|
11
|
+
dayStartMs: number;
|
|
12
|
+
dayEndMs: number;
|
|
13
|
+
/** Start of the day as a zoned value (for slot arithmetic). */
|
|
14
|
+
dayStart: ZonedDateTime;
|
|
15
|
+
/** Visible slot range of the day (time grids); equals the day boundaries for all-day grids. */
|
|
16
|
+
slotStartMs: number;
|
|
17
|
+
slotEndMs: number;
|
|
18
|
+
slotStart: ZonedDateTime;
|
|
19
|
+
slotEnd: ZonedDateTime;
|
|
20
|
+
/** Wall-clock seconds from midnight of the visible slot range (time grids position by wall clock). */
|
|
21
|
+
slotMinSec: number;
|
|
22
|
+
slotMaxSec: number;
|
|
23
|
+
tz: TimeZoneId;
|
|
24
|
+
resource: Resource | undefined;
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
highlight: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface CellContext {
|
|
29
|
+
tz: TimeZoneId;
|
|
30
|
+
validRange: OpenDayRange;
|
|
31
|
+
highlightedDates: readonly PlainDate[];
|
|
32
|
+
}
|
|
33
|
+
export interface SlotLimits {
|
|
34
|
+
/** Seconds from midnight. */
|
|
35
|
+
minSec: number;
|
|
36
|
+
maxSec: number;
|
|
37
|
+
}
|
|
38
|
+
export declare const FULL_DAY: SlotLimits;
|
|
39
|
+
export declare function outsideRange(date: PlainDate, range: OpenDayRange): boolean;
|
|
40
|
+
export declare function createCell(date: PlainDate, col: number, row: number, ctx: CellContext, limits?: SlotLimits, resource?: Resource): DayCell;
|
|
41
|
+
/** Number of columns of a day grid: 7 minus hidden days for month/week views, otherwise all dates. */
|
|
42
|
+
export declare function dayGridColsCount(duration: CalDuration, hiddenDays: readonly number[], datesCount: number): number;
|
|
43
|
+
/** Rows of day cells (month view: 6 rows × 7 columns; week/day: 1 row). */
|
|
44
|
+
export declare function dayGridRows(dates: readonly PlainDate[], colsCount: number, ctx: CellContext): DayCell[][];
|
|
45
|
+
/** One row of time-grid columns. */
|
|
46
|
+
export declare function timeGridCells(dates: readonly PlainDate[], limits: SlotLimits, ctx: CellContext): DayCell[];
|
|
47
|
+
/** Resource time grid: columns grouped by resource then date (or date then resource). */
|
|
48
|
+
export declare function resourceTimeGridCells(resources: readonly Resource[], dates: readonly PlainDate[], datesAboveResources: boolean, limits: SlotLimits, ctx: CellContext): DayCell[];
|
|
49
|
+
/** Timeline: one row per resource; each day may have its own slot limits. */
|
|
50
|
+
export declare function timelineRows(resources: readonly Resource[], dates: readonly PlainDate[], limitsFor: (date: PlainDate) => SlotLimits, ctx: CellContext): DayCell[][];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Seg } from '../events/slice.js';
|
|
2
|
+
export interface Placement {
|
|
3
|
+
top: number;
|
|
4
|
+
bottom: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Vertical stacking of all-day segs, one row at a time, in seg order. A seg is placed at the top of its
|
|
8
|
+
* first cell (`topOf`, the day-head height) and pushed below every already-placed seg that shares any of
|
|
9
|
+
* its cells and overlaps it vertically. For start-sorted input this equals vkurko/calendar's
|
|
10
|
+
* `prepareAllDayChunks` + `repositionEvent` (`prev` / `long` links); it also stays overlap-free for
|
|
11
|
+
* arbitrary orders (custom `eventOrder`).
|
|
12
|
+
*
|
|
13
|
+
* `heightOf(seg)` returns the measured height in px (or a default before measurement).
|
|
14
|
+
*/
|
|
15
|
+
export declare function stackAllDaySegs(segs: readonly Seg[], heightOf: (seg: Seg) => number, topOf: (seg: Seg) => number, gap: number): Map<string, Placement>;
|
|
16
|
+
/**
|
|
17
|
+
* `dayMaxEvents: true` pruning: segs whose bottom exceeds the available cell height are hidden in every
|
|
18
|
+
* day they span (so "+N more" appears in each of those days). Port of `day-grid/Event.svelte hide()`.
|
|
19
|
+
* `availableHeight(seg)` = cell height minus the tallest "+more" footer among the seg's cells.
|
|
20
|
+
*/
|
|
21
|
+
export declare function hideOverflowingSegs(segs: readonly Seg[], placements: ReadonlyMap<string, Placement>, availableHeight: (seg: Seg) => number): {
|
|
22
|
+
hidden: Set<string>;
|
|
23
|
+
hiddenByDay: Map<number, Seg[]>;
|
|
24
|
+
};
|
|
25
|
+
/** `dayMaxEvents: N` pruning: keep at most N stacked levels per cell; hidden segs are reported per day. */
|
|
26
|
+
export declare function limitLevels(segs: readonly Seg[], maxLevels: number): {
|
|
27
|
+
hidden: Set<string>;
|
|
28
|
+
hiddenByDay: Map<number, Seg[]>;
|
|
29
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './cells.js';
|
|
2
|
+
export * from './business-hours.js';
|
|
3
|
+
export * from './day-grid.js';
|
|
4
|
+
export * from './time-grid.js';
|
|
5
|
+
export * from './timeline.js';
|
|
6
|
+
export * from './slots.js';
|
|
7
|
+
export { sliceAllDay, sliceDay, sliceTimed, sliceTimeline } from '../events/slice.js';
|
|
8
|
+
export type { Seg } from '../events/slice.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ParsedEvent } from '../events/parse.js';
|
|
2
|
+
import type { CalDuration, PlainDate, TimeZoneId, ZonedDateTime } from '../temporal/types.js';
|
|
3
|
+
import type { SlotLimits } from './cells.js';
|
|
4
|
+
/**
|
|
5
|
+
* Visible time range of the time axis (port of vkurko/calendar `createSlotTimeLimits`). With
|
|
6
|
+
* `flexibleSlotTimeLimits` the limits expand (by at most a day) to fit timed events on the given days.
|
|
7
|
+
*/
|
|
8
|
+
export declare function slotTimeLimits(slotMinTime: CalDuration, slotMaxTime: CalDuration, flexible: boolean | {
|
|
9
|
+
eventFilter: (event: ParsedEvent) => boolean;
|
|
10
|
+
}, days: readonly {
|
|
11
|
+
date: PlainDate;
|
|
12
|
+
dayStartMs: number;
|
|
13
|
+
}[], events: readonly ParsedEvent[]): SlotLimits;
|
|
14
|
+
/** How many slots share one label (port of `slotLabelPeriodicity`). */
|
|
15
|
+
export declare function slotLabelPeriodicity(slotDuration: CalDuration, slotLabelInterval: CalDuration | undefined): number;
|
|
16
|
+
export interface SlotLabel {
|
|
17
|
+
/** Instant of the labelled slot on the given day. */
|
|
18
|
+
time: ZonedDateTime;
|
|
19
|
+
/** Seconds from midnight. */
|
|
20
|
+
seconds: number;
|
|
21
|
+
/** Number of slot rows this label spans (defaults to the periodicity; the last one may be shorter). */
|
|
22
|
+
span: number;
|
|
23
|
+
}
|
|
24
|
+
/** Labelled slots of the time axis (port of `createSlots`). */
|
|
25
|
+
export declare function buildSlotLabels(date: PlainDate, tz: TimeZoneId, slotDuration: CalDuration, periodicity: number, limits: SlotLimits): SlotLabel[];
|
|
26
|
+
/** Total number of slot rows between the limits. */
|
|
27
|
+
export declare function slotCount(slotDuration: CalDuration, limits: SlotLimits): number;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Seg } from '../events/slice.js';
|
|
2
|
+
export interface ColumnPlacement {
|
|
3
|
+
/** Index of the sub-column inside the overlap group. */
|
|
4
|
+
column: number;
|
|
5
|
+
/** Number of sub-columns in the group. */
|
|
6
|
+
columns: number;
|
|
7
|
+
/** Consecutive lanes free for this event’s entire rendered duration. */
|
|
8
|
+
span: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Pack chronologically so a chain uses only its peak simultaneous lane count. Display order
|
|
12
|
+
* breaks equal-start ties. Each card then spans adjacent lanes that are free for its full height.
|
|
13
|
+
*/
|
|
14
|
+
export declare function packTimeGrid(segs: readonly Seg[], geometry?: ReadonlyMap<string, TimedGeometry>): Map<string, ColumnPlacement>;
|
|
15
|
+
/** Connected rendered collisions, isolated by date/resource column. */
|
|
16
|
+
export declare function groupTimeGrid(segs: readonly Seg[], geometry?: ReadonlyMap<string, TimedGeometry>): Seg[][];
|
|
17
|
+
export interface TimedGeometry {
|
|
18
|
+
top: number;
|
|
19
|
+
height: number;
|
|
20
|
+
maxHeight: number;
|
|
21
|
+
}
|
|
22
|
+
export interface TimedStyle extends TimedGeometry {
|
|
23
|
+
/** Fraction of the column width taken by the seg, and its offset, both in [0, 1]. */
|
|
24
|
+
left: number;
|
|
25
|
+
width: number;
|
|
26
|
+
zIndex: number;
|
|
27
|
+
}
|
|
28
|
+
/** Shared rendered bounds for placement and styling; never changes the event's time range. */
|
|
29
|
+
export declare function timedSegGeometry(seg: Seg, slotSeconds: number, slotHeight: number, eventMinHeight?: number): TimedGeometry;
|
|
30
|
+
/** Pixel geometry of a timed seg (port of `time-grid/Event.svelte`). */
|
|
31
|
+
export declare function timedSegStyle(seg: Seg, placement: ColumnPlacement | undefined, slotSeconds: number, slotHeight: number, geometry?: TimedGeometry): TimedStyle;
|