@mintplayer/web-components 1.0.0 → 1.1.0
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/a11y/index.mjs +2 -56
- package/calendar/index.mjs +2 -363
- package/checkbox/index.mjs +4 -0
- package/checkbox/src/components/index.d.ts +2 -0
- package/checkbox/src/components/mp-checkbox.d.ts +69 -0
- package/checkbox/src/index.d.ts +2 -0
- package/chunks/color-C4VT0EL7.mjs +847 -0
- package/chunks/form-check.styles-jBlHetYX.mjs +151 -0
- package/chunks/live-announcer-CZDTKulf.mjs +58 -0
- package/chunks/mp-calendar.element-UC68iDbi.mjs +365 -0
- package/chunks/mp-checkbox-BokLL7BS.mjs +211 -0
- package/chunks/mp-datatable-CpAu8JJD.mjs +750 -0
- package/chunks/mp-pagination-BGxsawFL.mjs +326 -0
- package/chunks/mp-select-BDS1-YGn.mjs +254 -0
- package/chunks/mp-splitter-C8cGCmac.mjs +633 -0
- package/chunks/mp-tab-page-D1b4x-y2.mjs +414 -0
- package/chunks/mp-timepicker.element-BwEiwX92.mjs +428 -0
- package/chunks/mp-toggle-button-dLZNDUVz.mjs +534 -0
- package/chunks/mp-treeview-Bfq4_IVW.mjs +474 -0
- package/code-snippet/index.mjs +16 -13
- package/datatable/index.mjs +7 -0
- package/datatable/src/components/index.d.ts +2 -0
- package/datatable/src/components/mp-datatable.d.ts +156 -0
- package/datatable/src/index.d.ts +6 -0
- package/datatable/src/sort/compute-next-sort.d.ts +18 -0
- package/datatable/src/sort/index.d.ts +3 -0
- package/datatable/src/sort/sort-rows.d.ts +6 -0
- package/datatable/src/styles/datatable.styles.d.ts +2 -0
- package/datatable/src/styles/index.d.ts +1 -0
- package/datatable/src/types/column-def.d.ts +30 -0
- package/datatable/src/types/index.d.ts +1 -0
- package/datepicker/index.mjs +240 -0
- package/datepicker/src/index.d.ts +1 -0
- package/datepicker/src/mp-datepicker.element.d.ts +94 -0
- package/datepicker/src/mp-datepicker.element.template.d.ts +2 -0
- package/datetime-picker/index.mjs +427 -0
- package/datetime-picker/src/index.d.ts +1 -0
- package/datetime-picker/src/mp-datetime-picker.element.d.ts +174 -0
- package/datetime-picker/src/mp-datetime-picker.element.template.d.ts +2 -0
- package/dock/index.mjs +2402 -0
- package/dock/src/components/index.d.ts +1 -0
- package/dock/src/components/mint-dock-manager.element.d.ts +313 -0
- package/dock/src/components/mint-dock-manager.element.template.d.ts +2 -0
- package/dock/src/index.d.ts +2 -0
- package/dock/src/types/dock-layout.d.ts +65 -0
- package/dock/src/types/index.d.ts +1 -0
- package/file-manager/index.mjs +1263 -0
- package/file-manager/src/components/index.d.ts +2 -0
- package/file-manager/src/components/mp-file-manager.d.ts +320 -0
- package/file-manager/src/index.d.ts +5 -0
- package/file-manager/src/styles/file-manager.styles.d.ts +2 -0
- package/file-manager/src/styles/index.d.ts +1 -0
- package/file-manager/src/types/file-system-node.d.ts +24 -0
- package/file-manager/src/types/index.d.ts +3 -0
- package/file-manager/src/types/messages.d.ts +43 -0
- package/multi-range/index.mjs +407 -0
- package/multi-range/src/index.d.ts +2 -0
- package/multi-range/src/mint-multi-range.element.d.ts +124 -0
- package/multi-range/src/mint-multi-range.element.template.d.ts +2 -0
- package/multi-range/src/types/multi-range-orientation.d.ts +1 -0
- package/otp-input/index.mjs +362 -0
- package/otp-input/src/index.d.ts +4 -0
- package/otp-input/src/mint-otp-input.element.d.ts +134 -0
- package/otp-input/src/mint-otp-input.element.template.d.ts +2 -0
- package/otp-input/src/types/otp-input-case.d.ts +1 -0
- package/otp-input/src/types/otp-input-size.d.ts +1 -0
- package/otp-input/src/types/otp-input-type.d.ts +1 -0
- package/overlay/index.mjs +260 -0
- package/overlay/src/index.d.ts +2 -0
- package/overlay/src/overlay-controller.d.ts +205 -0
- package/package.json +1 -1
- package/pagination/index.mjs +5 -0
- package/pagination/src/components/index.d.ts +2 -0
- package/pagination/src/components/mp-pagination.d.ts +95 -0
- package/pagination/src/index.d.ts +2 -0
- package/pagination/src/styles/index.d.ts +1 -0
- package/pagination/src/styles/pagination.styles.d.ts +2 -0
- package/query-builder/index.mjs +3720 -0
- package/query-builder/src/context.d.ts +14 -0
- package/query-builder/src/dnd/drag-controller.d.ts +69 -0
- package/query-builder/src/index.d.ts +23 -0
- package/query-builder/src/model/default-tree.d.ts +7 -0
- package/query-builder/src/model/editor.d.ts +15 -0
- package/query-builder/src/model/errors.d.ts +6 -0
- package/query-builder/src/model/expression.d.ts +22 -0
- package/query-builder/src/model/field-def.d.ts +17 -0
- package/query-builder/src/model/messages.d.ts +17 -0
- package/query-builder/src/model/operator-overrides.d.ts +21 -0
- package/query-builder/src/model/operators.d.ts +8 -0
- package/query-builder/src/model/saved-query.d.ts +6 -0
- package/query-builder/src/model/sort.d.ts +9 -0
- package/query-builder/src/model/tree-ops.d.ts +56 -0
- package/query-builder/src/mp-query-builder.element.d.ts +158 -0
- package/query-builder/src/mp-query-builder.element.template.d.ts +2 -0
- package/query-builder/src/mp-query-condition.element.d.ts +44 -0
- package/query-builder/src/mp-query-condition.element.template.d.ts +2 -0
- package/query-builder/src/mp-query-group.element.d.ts +52 -0
- package/query-builder/src/mp-query-group.element.template.d.ts +2 -0
- package/query-builder/src/mp-query-subquery.element.d.ts +37 -0
- package/query-builder/src/mp-query-subquery.element.template.d.ts +2 -0
- package/query-builder/src/preview/render-expression.d.ts +23 -0
- package/query-builder/src/value-editors/builtin-editors.d.ts +6 -0
- package/query-builder/src/visitor/visit-tree.d.ts +29 -0
- package/query-builder/src/visitor/visitor-types.d.ts +15 -0
- package/radio/index.mjs +162 -0
- package/radio/src/components/index.d.ts +2 -0
- package/radio/src/components/mp-radio.d.ts +63 -0
- package/radio/src/index.d.ts +2 -0
- package/ribbon/index.mjs +3151 -0
- package/ribbon/src/index.d.ts +10 -0
- package/ribbon/src/items/index.d.ts +15 -0
- package/ribbon/src/items/mp-ribbon-button.element.d.ts +10 -0
- package/ribbon/src/items/mp-ribbon-checkbox.element.d.ts +11 -0
- package/ribbon/src/items/mp-ribbon-color-picker.element.d.ts +12 -0
- package/ribbon/src/items/mp-ribbon-combobox.element.d.ts +19 -0
- package/ribbon/src/items/mp-ribbon-dropdown-button.element.d.ts +16 -0
- package/ribbon/src/items/mp-ribbon-gallery-item.element.d.ts +15 -0
- package/ribbon/src/items/mp-ribbon-gallery.element.d.ts +11 -0
- package/ribbon/src/items/mp-ribbon-group-button.element.d.ts +18 -0
- package/ribbon/src/items/mp-ribbon-item-base.d.ts +68 -0
- package/ribbon/src/items/mp-ribbon-menu-item.element.d.ts +13 -0
- package/ribbon/src/items/mp-ribbon-menu-separator.element.d.ts +6 -0
- package/ribbon/src/items/mp-ribbon-split-button.element.d.ts +23 -0
- package/ribbon/src/items/mp-ribbon-template-item.element.d.ts +12 -0
- package/ribbon/src/items/mp-ribbon-toggle-button.element.d.ts +12 -0
- package/ribbon/src/mp-quick-access-toolbar.element.d.ts +35 -0
- package/ribbon/src/mp-ribbon-contextual-tab-set.element.d.ts +18 -0
- package/ribbon/src/mp-ribbon-group.element.d.ts +59 -0
- package/ribbon/src/mp-ribbon-tab.element.d.ts +72 -0
- package/ribbon/src/mp-ribbon.element.d.ts +211 -0
- package/ribbon/src/types/ribbon.types.d.ts +4 -0
- package/scheduler/index.mjs +3567 -0
- package/scheduler/src/components/mp-scheduler.d.ts +238 -0
- package/scheduler/src/drag/drag-manager.d.ts +90 -0
- package/scheduler/src/drag/drag-preview.d.ts +42 -0
- package/scheduler/src/drag/drag-state-machine.d.ts +102 -0
- package/scheduler/src/drag/drag-types.d.ts +104 -0
- package/scheduler/src/drag/index.d.ts +4 -0
- package/scheduler/src/events/event-types.d.ts +58 -0
- package/scheduler/src/events/index.d.ts +2 -0
- package/scheduler/src/events/scheduler-event-emitter.d.ts +52 -0
- package/scheduler/src/index.d.ts +6 -0
- package/scheduler/src/input/index.d.ts +2 -0
- package/scheduler/src/input/input-handler.d.ts +105 -0
- package/scheduler/src/input/pointer-event.d.ts +39 -0
- package/scheduler/src/state/scheduler-state.d.ts +189 -0
- package/scheduler/src/styles/scheduler.styles.d.ts +2 -0
- package/scheduler/src/views/base-view.d.ts +87 -0
- package/scheduler/src/views/day-view.d.ts +25 -0
- package/scheduler/src/views/index.d.ts +6 -0
- package/scheduler/src/views/month-view.d.ts +27 -0
- package/scheduler/src/views/timeline-view.d.ts +23 -0
- package/scheduler/src/views/week-view.d.ts +28 -0
- package/scheduler/src/views/year-view.d.ts +25 -0
- package/scheduler-core/index.mjs +174 -0
- package/scheduler-core/src/index.d.ts +3 -0
- package/scheduler-core/src/models/drag-state.d.ts +43 -0
- package/scheduler-core/src/models/event.d.ts +111 -0
- package/scheduler-core/src/models/events.d.ts +108 -0
- package/scheduler-core/src/models/index.d.ts +7 -0
- package/scheduler-core/src/models/options.d.ts +88 -0
- package/scheduler-core/src/models/resource.d.ts +58 -0
- package/scheduler-core/src/models/time-slot.d.ts +31 -0
- package/scheduler-core/src/models/types.d.ts +20 -0
- package/scheduler-core/src/services/date.service.d.ts +140 -0
- package/scheduler-core/src/services/index.d.ts +4 -0
- package/scheduler-core/src/services/position.service.d.ts +35 -0
- package/scheduler-core/src/services/resource.service.d.ts +83 -0
- package/scheduler-core/src/services/timeline.service.d.ts +103 -0
- package/scheduler-core/src/utils/color.d.ts +24 -0
- package/scheduler-core/src/utils/dom.d.ts +54 -0
- package/scheduler-core/src/utils/id.d.ts +16 -0
- package/scheduler-core/src/utils/index.d.ts +3 -0
- package/select/index.mjs +4 -0
- package/select/src/components/index.d.ts +2 -0
- package/select/src/components/mp-select.d.ts +82 -0
- package/select/src/index.d.ts +2 -0
- package/splitter/index.mjs +10 -0
- package/splitter/src/components/index.d.ts +2 -0
- package/splitter/src/components/mp-splitter.d.ts +109 -0
- package/splitter/src/index.d.ts +11 -0
- package/splitter/src/input/index.d.ts +4 -0
- package/splitter/src/input/input-handler.d.ts +36 -0
- package/splitter/src/input/pointer-event.d.ts +9 -0
- package/splitter/src/managers/index.d.ts +2 -0
- package/splitter/src/managers/resize-manager.d.ts +13 -0
- package/splitter/src/state/index.d.ts +2 -0
- package/splitter/src/state/splitter-state.d.ts +24 -0
- package/splitter/src/styles/index.d.ts +1 -0
- package/splitter/src/styles/splitter.styles.d.ts +2 -0
- package/splitter/src/types/direction.d.ts +1 -0
- package/splitter/src/types/index.d.ts +5 -0
- package/splitter/src/types/panel-info.d.ts +6 -0
- package/splitter/src/types/point.d.ts +4 -0
- package/splitter/src/types/resize-operation.d.ts +13 -0
- package/tab-control/index.mjs +6 -0
- package/tab-control/src/components/index.d.ts +3 -0
- package/tab-control/src/components/mp-tab-control.d.ts +50 -0
- package/tab-control/src/components/mp-tab-page.d.ts +35 -0
- package/tab-control/src/index.d.ts +4 -0
- package/tab-control/src/styles/index.d.ts +1 -0
- package/tab-control/src/styles/tab-control.styles.d.ts +2 -0
- package/tab-control/src/types/index.d.ts +1 -0
- package/tab-control/src/types/tabs-position.d.ts +1 -0
- package/tile-manager/index.mjs +867 -0
- package/tile-manager/src/components/index.d.ts +2 -0
- package/tile-manager/src/components/mint-tile-manager.element.d.ts +204 -0
- package/tile-manager/src/components/mint-tile-manager.element.template.d.ts +2 -0
- package/tile-manager/src/index.d.ts +4 -0
- package/tile-manager/src/types/grid-rect.d.ts +12 -0
- package/tile-manager/src/types/index.d.ts +3 -0
- package/tile-manager/src/types/tile-layout-snapshot.d.ts +15 -0
- package/tile-manager/src/types/tile-position.d.ts +10 -0
- package/tile-manager/src/utils/index.d.ts +1 -0
- package/tile-manager/src/utils/pack.d.ts +24 -0
- package/timepicker/index.mjs +5 -0
- package/timepicker/src/index.d.ts +2 -0
- package/timepicker/src/mp-time-list.element.d.ts +76 -0
- package/timepicker/src/mp-time-list.element.template.d.ts +2 -0
- package/timepicker/src/mp-timepicker.element.d.ts +87 -0
- package/timepicker/src/mp-timepicker.element.template.d.ts +2 -0
- package/toggle-button/index.mjs +5 -0
- package/toggle-button/src/components/index.d.ts +2 -0
- package/toggle-button/src/components/mp-toggle-button.d.ts +50 -0
- package/toggle-button/src/index.d.ts +3 -0
- package/toggle-button/src/styles/index.d.ts +1 -0
- package/toggle-button/src/styles/toggle-button.styles.d.ts +2 -0
- package/treeview/index.mjs +5 -0
- package/treeview/src/components/index.d.ts +2 -0
- package/treeview/src/components/mp-treeview.d.ts +113 -0
- package/treeview/src/index.d.ts +4 -0
- package/treeview/src/styles/index.d.ts +1 -0
- package/treeview/src/styles/treeview.styles.d.ts +2 -0
- package/treeview/src/types/index.d.ts +1 -0
- package/treeview/src/types/tree-node.d.ts +14 -0
- package/custom-elements.json +0 -1774
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import { ViewType, SchedulerEvent, Resource, ResourceGroup, SchedulerOptions } from '@mintplayer/web-components/scheduler-core';
|
|
3
|
+
/**
|
|
4
|
+
* MpScheduler Web Component
|
|
5
|
+
*
|
|
6
|
+
* A fully-featured scheduler/calendar component.
|
|
7
|
+
* Refactored for clarity with separated concerns:
|
|
8
|
+
* - DragManager: Handles all drag operations
|
|
9
|
+
* - InputHandler: Normalizes mouse/touch input
|
|
10
|
+
* - SchedulerEventEmitter: Dispatches custom events
|
|
11
|
+
*/
|
|
12
|
+
export declare class MpScheduler extends LitElement {
|
|
13
|
+
static styles: import('lit').CSSResult[];
|
|
14
|
+
static get observedAttributes(): string[];
|
|
15
|
+
private stateManager;
|
|
16
|
+
private currentView;
|
|
17
|
+
private currentViewType;
|
|
18
|
+
private contentContainer;
|
|
19
|
+
private dragManager;
|
|
20
|
+
private inputHandler;
|
|
21
|
+
private eventEmitter;
|
|
22
|
+
private previousView;
|
|
23
|
+
private previousDate;
|
|
24
|
+
private previousSelectedEventId;
|
|
25
|
+
private previousRangeKey;
|
|
26
|
+
private pendingDragUpdate;
|
|
27
|
+
private latestDragState;
|
|
28
|
+
private boundHandleKeyDown;
|
|
29
|
+
private boundHandleFocusIn;
|
|
30
|
+
private nowIndicatorTimer;
|
|
31
|
+
private readonly liveAnnouncer;
|
|
32
|
+
constructor();
|
|
33
|
+
connectedCallback(): void;
|
|
34
|
+
disconnectedCallback(): void;
|
|
35
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
36
|
+
get view(): ViewType;
|
|
37
|
+
set view(value: ViewType);
|
|
38
|
+
get date(): Date;
|
|
39
|
+
set date(value: Date);
|
|
40
|
+
get events(): SchedulerEvent[];
|
|
41
|
+
set events(value: SchedulerEvent[]);
|
|
42
|
+
get resources(): (Resource | ResourceGroup)[];
|
|
43
|
+
set resources(value: (Resource | ResourceGroup)[]);
|
|
44
|
+
get options(): SchedulerOptions;
|
|
45
|
+
set options(value: Partial<SchedulerOptions>);
|
|
46
|
+
get selectedEvent(): SchedulerEvent | null;
|
|
47
|
+
set selectedEvent(value: SchedulerEvent | null);
|
|
48
|
+
get selectedRange(): {
|
|
49
|
+
start: Date;
|
|
50
|
+
end: Date;
|
|
51
|
+
} | null;
|
|
52
|
+
next(): void;
|
|
53
|
+
prev(): void;
|
|
54
|
+
today(): void;
|
|
55
|
+
gotoDate(date: Date): void;
|
|
56
|
+
changeView(view: ViewType): void;
|
|
57
|
+
/**
|
|
58
|
+
* Clear the time-range selection and the focused-cell selection. Public
|
|
59
|
+
* because — per PRD scheduler-controlled-selection — the WC no longer
|
|
60
|
+
* auto-clears on commit; consumers call this from their `event-create`
|
|
61
|
+
* handler if they want the post-create selection cleared.
|
|
62
|
+
*/
|
|
63
|
+
clearSelection(): void;
|
|
64
|
+
addEvent(event: SchedulerEvent): void;
|
|
65
|
+
updateEvent(event: SchedulerEvent): void;
|
|
66
|
+
removeEvent(eventId: string): void;
|
|
67
|
+
getEventById(eventId: string): SchedulerEvent | null;
|
|
68
|
+
refetchEvents(): void;
|
|
69
|
+
render(): TemplateResult;
|
|
70
|
+
protected firstUpdated(): void;
|
|
71
|
+
private populateHeader;
|
|
72
|
+
private updateTitle;
|
|
73
|
+
private renderView;
|
|
74
|
+
private onStateChange;
|
|
75
|
+
private detectAndEmitChanges;
|
|
76
|
+
private updateUI;
|
|
77
|
+
private scheduleDragUpdate;
|
|
78
|
+
private handlePointerDown;
|
|
79
|
+
private handlePointerMove;
|
|
80
|
+
private handlePointerUp;
|
|
81
|
+
private handleDragComplete;
|
|
82
|
+
private handleClick;
|
|
83
|
+
private handleDoubleClick;
|
|
84
|
+
/**
|
|
85
|
+
* When focus lands on an event block (Tab, programmatic, or click), select
|
|
86
|
+
* the event and emit `event-selected` for mouse-parity (PRD §6.5 D3). The
|
|
87
|
+
* subsequent setSelectedEvent call routes through detectAndEmitChanges
|
|
88
|
+
* which fires `selection-change`.
|
|
89
|
+
*
|
|
90
|
+
* `focusin` bubbles across shadow boundaries but `e.target` is retargeted
|
|
91
|
+
* to the host. Use composedPath()[0] for the actual focused element.
|
|
92
|
+
*/
|
|
93
|
+
private handleFocusIn;
|
|
94
|
+
private handleKeyDown;
|
|
95
|
+
private getFocusedKind;
|
|
96
|
+
private handleAltShortcut;
|
|
97
|
+
private handleEventKeyDown;
|
|
98
|
+
/**
|
|
99
|
+
* Inter-event arrow nav (PRD scheduler-controlled-selection §5.3): walk
|
|
100
|
+
* the events in document order (start time, with id as tiebreaker) by ±1.
|
|
101
|
+
* No wrap at the ends — matches the APG list/feed pattern.
|
|
102
|
+
*/
|
|
103
|
+
private focusAdjacentEvent;
|
|
104
|
+
private handleCellKeyDown;
|
|
105
|
+
/**
|
|
106
|
+
* If a cell is the active element but state.focusedCell is empty (e.g.
|
|
107
|
+
* Tab landed on the fallback first cell), seed the state from the
|
|
108
|
+
* active element's data attributes.
|
|
109
|
+
*/
|
|
110
|
+
private initFocusedCellFromActive;
|
|
111
|
+
/**
|
|
112
|
+
* Month-view keyboard handler (PRD scheduler-controlled-selection §5.1).
|
|
113
|
+
* Arrows walk days; ArrowUp/Down ± one week; cross-month moves auto-
|
|
114
|
+
* advance the displayed date so the new month renders. Enter emits
|
|
115
|
+
* `event-create` for the focused day's full range.
|
|
116
|
+
*/
|
|
117
|
+
private handleMonthCellKeyDown;
|
|
118
|
+
/**
|
|
119
|
+
* Year-view keyboard handler (PRD scheduler-controlled-selection §5.2).
|
|
120
|
+
* The focus unit is a month — ArrowLeft/Right ± 1, ArrowUp/Down ± 3 to
|
|
121
|
+
* mirror the visual 4×3 layout. Cross-year auto-advances. Enter emits
|
|
122
|
+
* `event-create` for the focused month's full range.
|
|
123
|
+
*/
|
|
124
|
+
private handleYearCellKeyDown;
|
|
125
|
+
/**
|
|
126
|
+
* Sync `focusedDate` from the currently-active month/year cell. Runs at
|
|
127
|
+
* the top of every Phase B keydown so click-driven and Tab-driven focus
|
|
128
|
+
* moves are reflected in state before arrow keys read it.
|
|
129
|
+
*/
|
|
130
|
+
private syncFocusedDateFromActive;
|
|
131
|
+
private moveFocusedDateByDays;
|
|
132
|
+
private moveFocusedDateByMonths;
|
|
133
|
+
/**
|
|
134
|
+
* Apply a focused-date update. If the new date crosses the displayed
|
|
135
|
+
* period (different month on month view; different year on year view),
|
|
136
|
+
* also bump `state.date` so the view re-renders to the new period —
|
|
137
|
+
* APG date-picker auto-advance behaviour. Then schedule a focus
|
|
138
|
+
* restoration on the matching cell after the next render.
|
|
139
|
+
*/
|
|
140
|
+
private commitFocusedDate;
|
|
141
|
+
/**
|
|
142
|
+
* Find the month/year date-cell DOM element by id and focus it. Keys are
|
|
143
|
+
* built from *local* date components to match `MonthView.dayKey()` /
|
|
144
|
+
* `YearView.monthKey()` — see those helpers for why ISO is unsafe across
|
|
145
|
+
* non-UTC timezones.
|
|
146
|
+
*/
|
|
147
|
+
private scrollAndFocusDateCell;
|
|
148
|
+
/**
|
|
149
|
+
* Emit `event-create` covering the focused day (month view) or focused
|
|
150
|
+
* month (year view). No internal mutation per PRD
|
|
151
|
+
* scheduler-controlled-selection — consumer constructs the actual event.
|
|
152
|
+
*/
|
|
153
|
+
private commitFocusedDateAsCreate;
|
|
154
|
+
private moveCellByTime;
|
|
155
|
+
/** Week view ArrowLeft/Right: ±1 day, same time-of-day. No-op on day view. */
|
|
156
|
+
private moveCellByDay;
|
|
157
|
+
/** Timeline ArrowUp/Down: ±1 resource, same time-of-day. PRD D1: cross-resource
|
|
158
|
+
* Shift+Arrow is intentionally ignored (resource is categorical). */
|
|
159
|
+
private moveCellByResource;
|
|
160
|
+
private moveCellToColumnExtreme;
|
|
161
|
+
private moveCellToViewExtreme;
|
|
162
|
+
/**
|
|
163
|
+
* PageUp/PageDown — advance one period (week or day) and re-focus the same
|
|
164
|
+
* day-of-week + time-of-day in the new period. Selection is cleared since
|
|
165
|
+
* crossing a period boundary breaks the linear-range invariant.
|
|
166
|
+
*/
|
|
167
|
+
private moveCellByPeriod;
|
|
168
|
+
/**
|
|
169
|
+
* Apply the focus move to state and DOM. `extend` grows the selection
|
|
170
|
+
* range; otherwise selection is cleared. Live-region announces the new
|
|
171
|
+
* focused cell or selection range.
|
|
172
|
+
*/
|
|
173
|
+
private commitFocusMove;
|
|
174
|
+
private cellIsWithinView;
|
|
175
|
+
private parseTimeOnDay;
|
|
176
|
+
private adjacentResource;
|
|
177
|
+
private getResourceTitle;
|
|
178
|
+
/**
|
|
179
|
+
* Find the cell DOM element for a (slot, resource) pair and call .focus()
|
|
180
|
+
* on it. scrollIntoView with block:nearest provides parity with mouse
|
|
181
|
+
* drag-near-edge auto-pan (PRD D6).
|
|
182
|
+
*/
|
|
183
|
+
private scrollAndFocusCell;
|
|
184
|
+
/** Re-focus whatever cell the keyboard model currently considers focused. */
|
|
185
|
+
private focusFocusedCell;
|
|
186
|
+
private cssEscape;
|
|
187
|
+
/**
|
|
188
|
+
* Emit `event-create` covering the active selection range, or a single
|
|
189
|
+
* cell when no selection is active. Per PRD scheduler-controlled-selection,
|
|
190
|
+
* this is a *request* — no internal state mutation, no auto-clear, no
|
|
191
|
+
* auto-focus. The consumer constructs the SchedulerEvent and decides
|
|
192
|
+
* whether/when to clear the selection.
|
|
193
|
+
*/
|
|
194
|
+
private createEventFromCellOrSelection;
|
|
195
|
+
/**
|
|
196
|
+
* Active keyboard-driven event move. Captures the original time range and
|
|
197
|
+
* (timeline) resource so Escape can revert; the working copy is mutated in
|
|
198
|
+
* place by arrow keys and committed or rolled back on Enter / Escape.
|
|
199
|
+
*/
|
|
200
|
+
private keyboardMove;
|
|
201
|
+
/**
|
|
202
|
+
* Enter keyboard event-move mode. Captures the working copy and a snapshot
|
|
203
|
+
* of the resource (timeline). Visual feedback is provided by routing the
|
|
204
|
+
* working start/end through the existing previewEvent state — the same
|
|
205
|
+
* channel used for mouse drag — so the event renders at the projected
|
|
206
|
+
* destination as the user nudges.
|
|
207
|
+
*/
|
|
208
|
+
private enterEventMoveMode;
|
|
209
|
+
/**
|
|
210
|
+
* Move-mode keymap. Layered on the existing M-mode foundation:
|
|
211
|
+
* - bare Arrow keys nudge the event
|
|
212
|
+
* - Shift+Arrow resizes the end edge
|
|
213
|
+
* - Alt+Shift+Arrow resizes the start edge
|
|
214
|
+
* - on week view, Shift+ArrowLeft/Right pushes the end edge across the
|
|
215
|
+
* day boundary (PRD D5) — symmetric with Shift+ArrowDown for time.
|
|
216
|
+
* - Enter commits, Escape reverts.
|
|
217
|
+
*/
|
|
218
|
+
private handleKeyboardMove;
|
|
219
|
+
private minutesPerSlot;
|
|
220
|
+
/** Shift the working event by `deltaMs` along the time axis (preserves duration). */
|
|
221
|
+
private nudgeKeyboardMove;
|
|
222
|
+
/** Walk to the next/previous resource (timeline only). Updates the preview's resourceId. */
|
|
223
|
+
private nudgeKeyboardMoveResource;
|
|
224
|
+
/**
|
|
225
|
+
* Resize one edge of the working event. Clamps to a minimum duration of
|
|
226
|
+
* one slot to keep the event valid, and refuses to invert (start ≤ end).
|
|
227
|
+
*/
|
|
228
|
+
private resizeKeyboardMoveEdge;
|
|
229
|
+
/** Mirror keyboardMove.working* into state.previewEvent so views render the destination,
|
|
230
|
+
* then scroll the destination into view so the sighted-keyboard user can see it (PRD D6). */
|
|
231
|
+
private applyKeyboardMovePreview;
|
|
232
|
+
private commitEventMoveMode;
|
|
233
|
+
private cancelEventMoveMode;
|
|
234
|
+
private startNowIndicatorTimer;
|
|
235
|
+
private stopNowIndicatorTimer;
|
|
236
|
+
private getSlotAtPosition;
|
|
237
|
+
private getSlotFromElement;
|
|
238
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { SchedulerEvent, TimeSlot } from '@mintplayer/web-components/scheduler-core';
|
|
2
|
+
import { SchedulerStateManager } from '../state/scheduler-state';
|
|
3
|
+
import { DragConfig, DragCompletionResult, PointerTarget } from './drag-types';
|
|
4
|
+
import { NormalizedPointerEvent } from '../input/pointer-event';
|
|
5
|
+
/**
|
|
6
|
+
* Callback for when a drag operation completes.
|
|
7
|
+
*/
|
|
8
|
+
export interface DragCompleteCallback {
|
|
9
|
+
(result: DragCompletionResult, originalEvent: Event): void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Coordinates drag operations between the state machine and scheduler state.
|
|
13
|
+
* Handles RAF scheduling for smooth drag updates.
|
|
14
|
+
*/
|
|
15
|
+
export declare class DragManager {
|
|
16
|
+
private readonly stateMachine;
|
|
17
|
+
private readonly stateManager;
|
|
18
|
+
private readonly config;
|
|
19
|
+
private pendingUpdate;
|
|
20
|
+
private latestPointer;
|
|
21
|
+
private getSlotAtPosition;
|
|
22
|
+
constructor(stateManager: SchedulerStateManager, config?: Partial<DragConfig>);
|
|
23
|
+
/**
|
|
24
|
+
* Set the function used to get a slot at a position.
|
|
25
|
+
* This must be set before handling pointer events.
|
|
26
|
+
*/
|
|
27
|
+
setSlotResolver(resolver: (x: number, y: number) => TimeSlot | null): void;
|
|
28
|
+
/**
|
|
29
|
+
* Handle pointer down - may start pending drag.
|
|
30
|
+
* @param immediate If true, skip pending state (for touch-initiated drags)
|
|
31
|
+
*/
|
|
32
|
+
handlePointerDown(pointer: NormalizedPointerEvent, target: PointerTarget, immediate?: boolean): void;
|
|
33
|
+
/**
|
|
34
|
+
* Handle pointer move - may activate drag or update preview.
|
|
35
|
+
*/
|
|
36
|
+
handlePointerMove(pointer: NormalizedPointerEvent): void;
|
|
37
|
+
/**
|
|
38
|
+
* Handle pointer up - finalize or cancel drag.
|
|
39
|
+
* Returns the completion result if a drag was completed.
|
|
40
|
+
*/
|
|
41
|
+
handlePointerUp(pointer: NormalizedPointerEvent): DragCompletionResult | null;
|
|
42
|
+
/**
|
|
43
|
+
* Cancel any in-progress drag operation.
|
|
44
|
+
*/
|
|
45
|
+
cancel(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Check if a drag operation is in progress.
|
|
48
|
+
*/
|
|
49
|
+
isActive(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Check if waiting for drag threshold.
|
|
52
|
+
*/
|
|
53
|
+
isPending(): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Check if in any drag-related state.
|
|
56
|
+
*/
|
|
57
|
+
isDragging(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Get the current drag phase.
|
|
60
|
+
*/
|
|
61
|
+
getPhase(): string;
|
|
62
|
+
/**
|
|
63
|
+
* Reset the drag manager state.
|
|
64
|
+
*/
|
|
65
|
+
reset(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Clean up resources.
|
|
68
|
+
*/
|
|
69
|
+
destroy(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Create a new event from a completed create drag.
|
|
72
|
+
*/
|
|
73
|
+
createEventFromResult(result: DragCompletionResult): SchedulerEvent;
|
|
74
|
+
/**
|
|
75
|
+
* Update an event from a completed move/resize drag.
|
|
76
|
+
*/
|
|
77
|
+
updateEventFromResult(result: DragCompletionResult, event: SchedulerEvent): SchedulerEvent;
|
|
78
|
+
/**
|
|
79
|
+
* Process pending pointer move using RAF.
|
|
80
|
+
*/
|
|
81
|
+
private processPendingMove;
|
|
82
|
+
/**
|
|
83
|
+
* Sync state machine state to scheduler state manager.
|
|
84
|
+
*/
|
|
85
|
+
private syncToStateManager;
|
|
86
|
+
/**
|
|
87
|
+
* Cancel any pending RAF update.
|
|
88
|
+
*/
|
|
89
|
+
private cancelPendingUpdate;
|
|
90
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DragOperationType, PreviewEvent, SchedulerEvent, TimeSlot } from '@mintplayer/web-components/scheduler-core';
|
|
2
|
+
import { DragConfig } from './drag-types';
|
|
3
|
+
/**
|
|
4
|
+
* Calculates preview positions for drag operations.
|
|
5
|
+
* Handles create, move, and resize operations.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DragPreviewCalculator {
|
|
8
|
+
private readonly config;
|
|
9
|
+
constructor(config?: Partial<DragConfig>);
|
|
10
|
+
/**
|
|
11
|
+
* Calculate the preview event position based on drag state.
|
|
12
|
+
*
|
|
13
|
+
* @param type - The type of drag operation
|
|
14
|
+
* @param startSlot - The slot where the drag started
|
|
15
|
+
* @param currentSlot - The current slot under the pointer
|
|
16
|
+
* @param originalEvent - The original event being moved/resized (null for create)
|
|
17
|
+
* @returns The preview event with new start/end, or null if invalid
|
|
18
|
+
*/
|
|
19
|
+
calculatePreview(type: DragOperationType, startSlot: TimeSlot, currentSlot: TimeSlot, originalEvent: SchedulerEvent | null): PreviewEvent | null;
|
|
20
|
+
/**
|
|
21
|
+
* Calculate preview for creating a new event.
|
|
22
|
+
* Extends selection from start slot to current slot.
|
|
23
|
+
*/
|
|
24
|
+
private calculateCreatePreview;
|
|
25
|
+
/**
|
|
26
|
+
* Calculate preview for moving an existing event.
|
|
27
|
+
* Preserves event duration, applies offset from drag start.
|
|
28
|
+
*/
|
|
29
|
+
private calculateMovePreview;
|
|
30
|
+
/**
|
|
31
|
+
* Calculate preview for resizing event start.
|
|
32
|
+
* Moves start time while keeping end fixed.
|
|
33
|
+
* Enforces minimum duration.
|
|
34
|
+
*/
|
|
35
|
+
private calculateResizeStartPreview;
|
|
36
|
+
/**
|
|
37
|
+
* Calculate preview for resizing event end.
|
|
38
|
+
* Moves end time while keeping start fixed.
|
|
39
|
+
* Enforces minimum duration.
|
|
40
|
+
*/
|
|
41
|
+
private calculateResizeEndPreview;
|
|
42
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { PreviewEvent } from '@mintplayer/web-components/scheduler-core';
|
|
2
|
+
import { DragMachineState, DragMachineEvent, DragConfig, DragCompletionResult } from './drag-types';
|
|
3
|
+
/**
|
|
4
|
+
* Explicit state machine for drag operations.
|
|
5
|
+
*
|
|
6
|
+
* States:
|
|
7
|
+
* - idle: No drag operation in progress
|
|
8
|
+
* - pending: Pointer is down, waiting for movement to exceed threshold
|
|
9
|
+
* - active: Drag is in progress, preview is being updated
|
|
10
|
+
* - completing: Drag just finished, result is available
|
|
11
|
+
*
|
|
12
|
+
* Transitions:
|
|
13
|
+
* - idle + POINTER_DOWN (on valid target) → pending
|
|
14
|
+
* - pending + POINTER_MOVE (threshold exceeded) → active
|
|
15
|
+
* - pending + POINTER_UP → idle (treated as click)
|
|
16
|
+
* - pending + CANCEL → idle
|
|
17
|
+
* - active + POINTER_MOVE → active (update preview)
|
|
18
|
+
* - active + POINTER_UP → completing
|
|
19
|
+
* - active + CANCEL → idle
|
|
20
|
+
* - completing → idle (after result is consumed)
|
|
21
|
+
*/
|
|
22
|
+
export declare class DragStateMachine {
|
|
23
|
+
private state;
|
|
24
|
+
private readonly config;
|
|
25
|
+
private readonly previewCalculator;
|
|
26
|
+
constructor(config?: Partial<DragConfig>);
|
|
27
|
+
/**
|
|
28
|
+
* Get current state (read-only).
|
|
29
|
+
*/
|
|
30
|
+
getState(): Readonly<DragMachineState>;
|
|
31
|
+
/**
|
|
32
|
+
* Get the current phase.
|
|
33
|
+
*/
|
|
34
|
+
getPhase(): DragMachineState['phase'];
|
|
35
|
+
/**
|
|
36
|
+
* Check if drag is currently active.
|
|
37
|
+
*/
|
|
38
|
+
isActive(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Check if drag is pending (waiting for threshold).
|
|
41
|
+
*/
|
|
42
|
+
isPending(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Check if in any drag-related state (pending or active).
|
|
45
|
+
*/
|
|
46
|
+
isDragging(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Get the preview event if in active state.
|
|
49
|
+
*/
|
|
50
|
+
getPreview(): PreviewEvent | null;
|
|
51
|
+
/**
|
|
52
|
+
* Get the completion result if in completing state.
|
|
53
|
+
*/
|
|
54
|
+
getCompletionResult(): DragCompletionResult | null;
|
|
55
|
+
/**
|
|
56
|
+
* Process an event and transition to new state.
|
|
57
|
+
* Returns true if state changed.
|
|
58
|
+
*/
|
|
59
|
+
send(event: DragMachineEvent): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Reset to idle state.
|
|
62
|
+
*/
|
|
63
|
+
reset(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Consume the completion result and return to idle.
|
|
66
|
+
* Call this after handling a completed drag.
|
|
67
|
+
*/
|
|
68
|
+
consumeResult(): DragCompletionResult | null;
|
|
69
|
+
/**
|
|
70
|
+
* Pure transition function.
|
|
71
|
+
* Given current state and event, returns new state.
|
|
72
|
+
*/
|
|
73
|
+
private transition;
|
|
74
|
+
/**
|
|
75
|
+
* Transitions from idle state.
|
|
76
|
+
*/
|
|
77
|
+
private transitionFromIdle;
|
|
78
|
+
/**
|
|
79
|
+
* Transitions from pending state.
|
|
80
|
+
*/
|
|
81
|
+
private transitionFromPending;
|
|
82
|
+
/**
|
|
83
|
+
* Transitions from active state.
|
|
84
|
+
*/
|
|
85
|
+
private transitionFromActive;
|
|
86
|
+
/**
|
|
87
|
+
* Transitions from completing state.
|
|
88
|
+
*/
|
|
89
|
+
private transitionFromCompleting;
|
|
90
|
+
/**
|
|
91
|
+
* Activate drag from pending state.
|
|
92
|
+
*/
|
|
93
|
+
private activateDrag;
|
|
94
|
+
/**
|
|
95
|
+
* Get operation type from pointer target.
|
|
96
|
+
*/
|
|
97
|
+
private getOperationType;
|
|
98
|
+
/**
|
|
99
|
+
* Get initial preview for a pending drag (used for click detection).
|
|
100
|
+
*/
|
|
101
|
+
private getInitialPreview;
|
|
102
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { DragOperationType, PreviewEvent, SchedulerEvent, TimeSlot } from '@mintplayer/web-components/scheduler-core';
|
|
2
|
+
/**
|
|
3
|
+
* Simple position with x/y coordinates.
|
|
4
|
+
*/
|
|
5
|
+
export interface Position {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Result of analyzing what element the pointer is over.
|
|
11
|
+
*/
|
|
12
|
+
export interface PointerTarget {
|
|
13
|
+
/** Type of target element */
|
|
14
|
+
type: 'event' | 'resize-handle' | 'slot' | 'none';
|
|
15
|
+
/** The scheduler event if pointer is over an event */
|
|
16
|
+
event?: SchedulerEvent;
|
|
17
|
+
/** The slot element if pointer is over a slot */
|
|
18
|
+
slotElement?: HTMLElement;
|
|
19
|
+
/** The resize handle type if pointer is over a resize handle */
|
|
20
|
+
resizeHandle?: 'start' | 'end';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Drag operation phases - explicit state machine states.
|
|
24
|
+
*
|
|
25
|
+
* - idle: No drag operation in progress
|
|
26
|
+
* - pending: Pointer down, waiting for movement to exceed threshold
|
|
27
|
+
* - active: Drag in progress, preview is being updated
|
|
28
|
+
* - completing: Pointer up, finalizing the operation
|
|
29
|
+
*/
|
|
30
|
+
export type DragPhase = 'idle' | 'pending' | 'active' | 'completing';
|
|
31
|
+
/**
|
|
32
|
+
* State machine state with discriminated union.
|
|
33
|
+
* The `phase` field determines which other fields are valid.
|
|
34
|
+
*/
|
|
35
|
+
export type DragMachineState = {
|
|
36
|
+
phase: 'idle';
|
|
37
|
+
} | {
|
|
38
|
+
phase: 'pending';
|
|
39
|
+
operationType: DragOperationType;
|
|
40
|
+
event: SchedulerEvent | null;
|
|
41
|
+
startPosition: Position;
|
|
42
|
+
startSlot: TimeSlot | null;
|
|
43
|
+
slotElement?: HTMLElement;
|
|
44
|
+
} | {
|
|
45
|
+
phase: 'active';
|
|
46
|
+
operationType: DragOperationType;
|
|
47
|
+
event: SchedulerEvent | null;
|
|
48
|
+
startSlot: TimeSlot;
|
|
49
|
+
currentSlot: TimeSlot;
|
|
50
|
+
preview: PreviewEvent;
|
|
51
|
+
originalEvent?: SchedulerEvent;
|
|
52
|
+
} | {
|
|
53
|
+
phase: 'completing';
|
|
54
|
+
result: DragCompletionResult;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Result of a completed drag operation.
|
|
58
|
+
*/
|
|
59
|
+
export interface DragCompletionResult {
|
|
60
|
+
/** Type of operation that was completed */
|
|
61
|
+
type: DragOperationType;
|
|
62
|
+
/** The final preview (new event position) */
|
|
63
|
+
preview: PreviewEvent;
|
|
64
|
+
/** The event that was moved/resized (null for create) */
|
|
65
|
+
event: SchedulerEvent | null;
|
|
66
|
+
/** Original event before modification */
|
|
67
|
+
originalEvent?: SchedulerEvent;
|
|
68
|
+
/** Whether this was a click (no actual drag occurred) */
|
|
69
|
+
wasClick: boolean;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Events that can trigger state transitions in the drag state machine.
|
|
73
|
+
*/
|
|
74
|
+
export type DragMachineEvent = {
|
|
75
|
+
type: 'POINTER_DOWN';
|
|
76
|
+
target: PointerTarget;
|
|
77
|
+
position: Position;
|
|
78
|
+
slot: TimeSlot | null;
|
|
79
|
+
slotElement?: HTMLElement;
|
|
80
|
+
/** If true, skip pending state and go directly to active (for touch drags) */
|
|
81
|
+
immediate?: boolean;
|
|
82
|
+
} | {
|
|
83
|
+
type: 'POINTER_MOVE';
|
|
84
|
+
position: Position;
|
|
85
|
+
slot: TimeSlot | null;
|
|
86
|
+
} | {
|
|
87
|
+
type: 'POINTER_UP';
|
|
88
|
+
position: Position;
|
|
89
|
+
} | {
|
|
90
|
+
type: 'CANCEL';
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Configuration for the drag state machine.
|
|
94
|
+
*/
|
|
95
|
+
export interface DragConfig {
|
|
96
|
+
/** Pixels of movement before drag activates (default: 5) */
|
|
97
|
+
dragThreshold: number;
|
|
98
|
+
/** Minimum event duration in milliseconds (default: 30 minutes) */
|
|
99
|
+
minDurationMs: number;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Default drag configuration.
|
|
103
|
+
*/
|
|
104
|
+
export declare const DEFAULT_DRAG_CONFIG: DragConfig;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { SchedulerEvent, ViewType } from '@mintplayer/web-components/scheduler-core';
|
|
2
|
+
/**
|
|
3
|
+
* Time range carried by selection-change and event-create. `start` is the
|
|
4
|
+
* inclusive lower edge, `end` is the exclusive upper edge of the last
|
|
5
|
+
* selected slot — matching the natural slot-pair shape produced by
|
|
6
|
+
* `selectionRange()` in `views/base-view.ts`.
|
|
7
|
+
*/
|
|
8
|
+
export interface TimeRange {
|
|
9
|
+
start: Date;
|
|
10
|
+
end: Date;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* All custom events the scheduler can emit.
|
|
14
|
+
* Using a discriminated union for type safety.
|
|
15
|
+
*/
|
|
16
|
+
export type SchedulerCustomEvent = {
|
|
17
|
+
type: 'event-selected';
|
|
18
|
+
event: SchedulerEvent;
|
|
19
|
+
originalEvent: Event;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'event-dblclick';
|
|
22
|
+
event: SchedulerEvent;
|
|
23
|
+
originalEvent: Event;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'event-create';
|
|
26
|
+
range: TimeRange;
|
|
27
|
+
view: ViewType;
|
|
28
|
+
resourceId?: string;
|
|
29
|
+
originalEvent: Event;
|
|
30
|
+
} | {
|
|
31
|
+
type: 'event-update';
|
|
32
|
+
event: SchedulerEvent;
|
|
33
|
+
oldEvent: SchedulerEvent;
|
|
34
|
+
originalEvent: Event;
|
|
35
|
+
} | {
|
|
36
|
+
type: 'event-delete';
|
|
37
|
+
event: SchedulerEvent;
|
|
38
|
+
} | {
|
|
39
|
+
type: 'date-click';
|
|
40
|
+
date: Date;
|
|
41
|
+
originalEvent: Event;
|
|
42
|
+
} | {
|
|
43
|
+
type: 'view-change';
|
|
44
|
+
view: ViewType;
|
|
45
|
+
date: Date;
|
|
46
|
+
} | {
|
|
47
|
+
type: 'selection-change';
|
|
48
|
+
selectedEvent: SchedulerEvent | null;
|
|
49
|
+
range: TimeRange | null;
|
|
50
|
+
view: ViewType;
|
|
51
|
+
resourceId?: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Type helper to extract the detail type for a specific event.
|
|
55
|
+
*/
|
|
56
|
+
export type EventDetail<T extends SchedulerCustomEvent['type']> = Omit<Extract<SchedulerCustomEvent, {
|
|
57
|
+
type: T;
|
|
58
|
+
}>, 'type'>;
|