@mintplayer/web-components 2.5.0 → 2.7.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 +9 -8
- package/checkbox/index.mjs +1 -1
- package/chunks/error-text-B45eDAt1.mjs +17 -0
- package/chunks/{form-associated-axmc5sY0.mjs → form-associated-BR-fUvZ1.mjs} +11 -26
- package/chunks/{id-D5QCG603.mjs → id-BstjfRrz.mjs} +97 -72
- package/chunks/{mp-checkbox-Ph2mMRGz.mjs → mp-checkbox-6EJwdUIn.mjs} +6 -5
- package/chunks/{mp-datatable-BwTlh9A_.mjs → mp-datatable-25O1GtvU.mjs} +1 -1
- package/chunks/mp-datetime-picker.element-MPTRHwyc.mjs +530 -0
- package/chunks/{mp-radio-BjW1HNSc.mjs → mp-radio-DvKgrTFL.mjs} +2 -2
- package/chunks/{mp-select-Ctu-v1-p.mjs → mp-select-CKX0eM5C.mjs} +5 -4
- package/chunks/{mp-timepicker.element-Bz393NDQ.mjs → mp-timepicker.element-COZEUIoE.mjs} +56 -52
- package/chunks/{mp-toggle-button-Kz6sIgBJ.mjs → mp-toggle-button-C4Loq_p4.mjs} +5 -4
- package/chunks/{overlay-controller-DPt13i8p.mjs → overlay-controller-D6agzzOI.mjs} +19 -4
- package/datatable/index.mjs +1 -1
- package/datepicker/index.mjs +1 -1
- package/datetime-picker/index.mjs +2 -431
- package/datetime-picker/src/mp-datetime-picker.element.d.ts +66 -0
- package/file-manager/index.mjs +1 -1
- package/navbar/index.mjs +1 -1
- package/otp-input/index.mjs +4 -3
- package/overlay/index.mjs +1 -1
- package/overlay/src/overlay-controller.d.ts +13 -0
- package/package.json +1 -1
- package/query-builder/index.mjs +2 -2
- package/radio/index.mjs +1 -1
- package/radio-group/index.mjs +2 -2
- package/ribbon/index.mjs +1 -1
- package/scheduler/index.mjs +1996 -813
- package/scheduler/src/components/mp-scheduler.d.ts +269 -11
- package/scheduler/src/state/scheduler-state.d.ts +10 -0
- package/scheduler/src/views/timeline-view.d.ts +51 -3
- package/scheduler/src/views/year-view.d.ts +4 -2
- package/scheduler-core/index.mjs +9 -8
- package/scheduler-core/src/models/event.d.ts +6 -2
- package/scheduler-core/src/models/messages.d.ts +60 -0
- package/scheduler-core/src/models/options.d.ts +22 -6
- package/scheduler-core/src/models/permissions.d.ts +35 -4
- package/scheduler-core/src/models/time-slot.d.ts +11 -6
- package/select/index.mjs +1 -1
- package/timepicker/index.mjs +4 -3
- package/timepicker/src/mp-time-list.element.d.ts +44 -7
- package/timepicker/src/mp-timepicker.element.d.ts +5 -0
- package/toggle-button/index.mjs +1 -1
- package/tree-select/index.mjs +1 -1
|
@@ -28,12 +28,28 @@ export declare class MpScheduler extends LitElement {
|
|
|
28
28
|
private boundHandleKeyDown;
|
|
29
29
|
private boundHandleFocusIn;
|
|
30
30
|
private boundHandleValueChange;
|
|
31
|
+
private boundHandleContextMenu;
|
|
32
|
+
private boundHandleDblClick;
|
|
33
|
+
private boundRepositionEditor;
|
|
31
34
|
private nowIndicatorTimer;
|
|
32
35
|
private readonly liveAnnouncer;
|
|
33
|
-
/** Day the
|
|
36
|
+
/** Day the date popover is open for, or null when it is closed. */
|
|
34
37
|
private popoverDate;
|
|
35
|
-
/**
|
|
36
|
-
|
|
38
|
+
/**
|
|
39
|
+
* What the popover lists: one day (month view, or a year mini-day click) or
|
|
40
|
+
* a whole month grouped by day (Space on a year month card, whose focus unit
|
|
41
|
+
* IS the month).
|
|
42
|
+
*/
|
|
43
|
+
private popoverScope;
|
|
44
|
+
/**
|
|
45
|
+
* Element id of the anchor — resolved lazily on every positioning pass, see
|
|
46
|
+
* `openDayPopover`. A full id rather than a date key because the anchor is
|
|
47
|
+
* view-specific: a month day cell (`scheduler-cell-m-…`) or a year month
|
|
48
|
+
* card (`scheduler-cell-y-…`). Year mini-days are deliberately not focusable
|
|
49
|
+
* (screen readers describe months, not days), so in year view the CARD is
|
|
50
|
+
* the anchor and the focus-return target.
|
|
51
|
+
*/
|
|
52
|
+
private popoverAnchorId;
|
|
37
53
|
private boundRepositionPopover;
|
|
38
54
|
/**
|
|
39
55
|
* The month day popover. Not modal: the grid behind stays operable, Escape and
|
|
@@ -42,6 +58,23 @@ export declare class MpScheduler extends LitElement {
|
|
|
42
58
|
* silently behind the user's focus.
|
|
43
59
|
*/
|
|
44
60
|
private readonly dayPopover;
|
|
61
|
+
/** Event the built-in editor is open for, or null when it is closed. */
|
|
62
|
+
private editorEventId;
|
|
63
|
+
/**
|
|
64
|
+
* Inline validation message currently shown in the editor, and WHICH field
|
|
65
|
+
* it is about (D12.14). The field matters: the message is spoken by moving
|
|
66
|
+
* focus to the offending control, whose own description carries it — there
|
|
67
|
+
* is no live region involved, so an unattributed message would be silent.
|
|
68
|
+
*/
|
|
69
|
+
private editorError;
|
|
70
|
+
private readonly editorTitleErrorId;
|
|
71
|
+
/**
|
|
72
|
+
* The built-in event editor (R20/D12.8): a non-modal dialog anchored to the
|
|
73
|
+
* event's own element, resolved lazily by event id — the views rebuild their
|
|
74
|
+
* DOM imperatively, so a captured element would detach under the panel.
|
|
75
|
+
* Same mechanics and traps as the day popover above.
|
|
76
|
+
*/
|
|
77
|
+
private readonly eventEditorOverlay;
|
|
45
78
|
constructor();
|
|
46
79
|
connectedCallback(): void;
|
|
47
80
|
disconnectedCallback(): void;
|
|
@@ -61,6 +94,14 @@ export declare class MpScheduler extends LitElement {
|
|
|
61
94
|
*/
|
|
62
95
|
get readonly(): boolean;
|
|
63
96
|
set readonly(value: boolean);
|
|
97
|
+
/**
|
|
98
|
+
* The built-in event editor's on/off switch (default ON). Attribute and
|
|
99
|
+
* property are the same state, like `readonly`: the ATTRIBUTE (`event-editor`)
|
|
100
|
+
* outranks `options.eventEditor`, and only the literal `"false"` disables —
|
|
101
|
+
* so a wrapper can render the attribute unconditionally from a boolean.
|
|
102
|
+
*/
|
|
103
|
+
get eventEditor(): boolean;
|
|
104
|
+
set eventEditor(value: boolean);
|
|
64
105
|
get events(): SchedulerEvent[];
|
|
65
106
|
set events(value: SchedulerEvent[]);
|
|
66
107
|
get resources(): (Resource | ResourceGroup)[];
|
|
@@ -114,24 +155,216 @@ export declare class MpScheduler extends LitElement {
|
|
|
114
155
|
* drill the "+N more" link used to do.
|
|
115
156
|
*/
|
|
116
157
|
private renderDayPopover;
|
|
158
|
+
private renderPopoverEvent;
|
|
159
|
+
/**
|
|
160
|
+
* The pointer face of the Delete key (R14): before this, `event-delete` was
|
|
161
|
+
* keyboard-only. A SIBLING of the event button — event boxes and popover
|
|
162
|
+
* entries are buttons themselves, so a delete control inside one would be a
|
|
163
|
+
* nested interactive.
|
|
164
|
+
*
|
|
165
|
+
* The popover stays open: `event-delete` is a request, and whether the row
|
|
166
|
+
* disappears is the consumer's call (their listener owns the data, and any
|
|
167
|
+
* confirm/undo). Focus is parked on the next row by INDEX before the list
|
|
168
|
+
* re-renders — the deleted row's button is about to vanish, and focus falling
|
|
169
|
+
* to <body> would dump a keyboard user out of the dialog.
|
|
170
|
+
*/
|
|
171
|
+
private deleteFromPopover;
|
|
172
|
+
/**
|
|
173
|
+
* The month-scoped list: events grouped under a heading per day, each event
|
|
174
|
+
* listed once under the day it starts (clamped to the month, so an event
|
|
175
|
+
* running in from last month sits under the 1st rather than vanishing).
|
|
176
|
+
*/
|
|
177
|
+
private renderPopoverDayGroups;
|
|
117
178
|
/**
|
|
118
|
-
* The
|
|
119
|
-
* The
|
|
120
|
-
*
|
|
179
|
+
* The cell/card the popover hangs off, resolved by element id on every call.
|
|
180
|
+
* The views rebuild their cells imperatively, so a cached element would be
|
|
181
|
+
* detached the moment anything re-renders while the popover is open.
|
|
121
182
|
*/
|
|
122
183
|
private popoverAnchorCell;
|
|
184
|
+
/**
|
|
185
|
+
* The anchor for a popover opened for `day` in the current view: the day's
|
|
186
|
+
* own cell in month view, its month CARD in year view. Every other view has
|
|
187
|
+
* no date-keyed cell — the popover is a month/year surface only.
|
|
188
|
+
*/
|
|
189
|
+
private defaultPopoverAnchorId;
|
|
123
190
|
/** Every event overlapping the given local day, in start order. */
|
|
124
191
|
private eventsOnDay;
|
|
125
192
|
/**
|
|
126
|
-
* Open the
|
|
127
|
-
*
|
|
193
|
+
* Open the date popover for `day`. Anchored on an element resolved LAZILY by
|
|
194
|
+
* id: the views rebuild their DOM imperatively, so a captured element
|
|
128
195
|
* reference would be detached by the next render while the popover is open.
|
|
196
|
+
*
|
|
197
|
+
* `anchorId` overrides the default when the caller knows better — a year
|
|
198
|
+
* mini-day belonging to an ADJACENT month must anchor on the card it was
|
|
199
|
+
* clicked in, which is not the card its own month key names.
|
|
129
200
|
*/
|
|
130
201
|
private openDayPopover;
|
|
131
202
|
private closeDayPopover;
|
|
132
203
|
private selectFromPopover;
|
|
133
204
|
private createFromPopover;
|
|
134
|
-
|
|
205
|
+
/** "Show day" / "Show month" — the drill that matches the popover's scope. */
|
|
206
|
+
private drillFromPopover;
|
|
207
|
+
/** Every event overlapping `day`'s local month, in start order. */
|
|
208
|
+
private eventsInMonth;
|
|
209
|
+
/** The rendered element of an event, by id — never the drag ghost. */
|
|
210
|
+
private eventElementById;
|
|
211
|
+
/**
|
|
212
|
+
* The editor opens when ANY of its fields is permitted for this event
|
|
213
|
+
* (D12.8c) — an all-disabled form is worse than no form. `readonly` and
|
|
214
|
+
* per-event `editable: false` zero every capability, so they kill it
|
|
215
|
+
* wholesale through the same resolver as everything else.
|
|
216
|
+
*/
|
|
217
|
+
private canOpenEditor;
|
|
218
|
+
/**
|
|
219
|
+
* Which of the editor's time fields are live, and what a start change MEANS
|
|
220
|
+
* — the single place that answers both (D12.13).
|
|
221
|
+
*
|
|
222
|
+
* | `moveEvent` | `resizeEvent` | start | end | a start change… |
|
|
223
|
+
* |---|---|---|---|---|
|
|
224
|
+
* | ✓ | ✓ | on | on | shifts both (a move) |
|
|
225
|
+
* | ✓ | ✗ | on | off | shifts both (a move) |
|
|
226
|
+
* | ✗ | ✓ | on | on | resizes the start alone, clamped |
|
|
227
|
+
* | ✗ | ✗ | off | off | — |
|
|
228
|
+
*
|
|
229
|
+
* Editing the END alone is *by definition* a resize, so that field follows
|
|
230
|
+
* `resizeEvent`. Editing the START is a move where one is permitted and a
|
|
231
|
+
* start-resize otherwise. Row 2 closes a leak that predates this: with
|
|
232
|
+
* `moveEvent: true, resizable: false` the editor used to commit a pure
|
|
233
|
+
* duration change that `resizable: false` forbids.
|
|
234
|
+
*
|
|
235
|
+
* `canResize` folds the per-item `{ start, end }` form as **both** edges, so
|
|
236
|
+
* `resizable: { start: false, end: true }` locks the editor's time fields
|
|
237
|
+
* while the end *handle* keeps working — honest, and with no way to commit a
|
|
238
|
+
* half-applied range (B35). Both edges are therefore always writable
|
|
239
|
+
* together or not at all, which is what makes the single `if` at save
|
|
240
|
+
* correct rather than coincidental.
|
|
241
|
+
*/
|
|
242
|
+
private editorTimeFields;
|
|
243
|
+
private tryOpenEventEditor;
|
|
244
|
+
private closeEventEditor;
|
|
245
|
+
/** Right-click on an event box opens the editor (D12.8b). */
|
|
246
|
+
private handleContextMenu;
|
|
247
|
+
/**
|
|
248
|
+
* Minute granularity for the editor's time lists, derived from the grid's own
|
|
249
|
+
* `slotDuration` so the two agree — picking a time the grid cannot represent
|
|
250
|
+
* would be its own small lie. Clamped to the picker's supported steps.
|
|
251
|
+
*/
|
|
252
|
+
private pickerStep;
|
|
253
|
+
private renderEventEditor;
|
|
254
|
+
/**
|
|
255
|
+
* "Inherit from resource" drives the swatch's enabled state: while inheriting,
|
|
256
|
+
* the swatch shows WHAT is inherited but cannot be committed, so there is no
|
|
257
|
+
* gesture that silently overrides. Toggled in the DOM rather than through a
|
|
258
|
+
* re-render on purpose — a re-render would re-run the sibling fields' value
|
|
259
|
+
* bindings and could discard a title the user has typed but not saved.
|
|
260
|
+
*/
|
|
261
|
+
private toggleEditorColorInherit;
|
|
262
|
+
/**
|
|
263
|
+
* The editor's WORKING COPY — what the user has typed and picked so far,
|
|
264
|
+
* held in component state instead of being read back out of the DOM when
|
|
265
|
+
* Save runs.
|
|
266
|
+
*
|
|
267
|
+
* This is the fix for B31, not a tidiness exercise. The panel's controls are
|
|
268
|
+
* Lit bindings fed from the STORED event, and the scheduler re-renders on any
|
|
269
|
+
* state change — including the one that a mousedown on Save itself provokes.
|
|
270
|
+
* The controls were therefore reset to the stored values *between mousedown
|
|
271
|
+
* and click*, and Save, which scraped the DOM, committed those stale values
|
|
272
|
+
* and silently discarded the edit. With the draft as the single authority for
|
|
273
|
+
* both the render and the commit, a re-render can no longer lose an edit.
|
|
274
|
+
* Keyboard move-mode has always worked this way (`keyboardMove`).
|
|
275
|
+
*/
|
|
276
|
+
private editorDraft;
|
|
277
|
+
/** Merge a change into the draft and re-render the panel from it. */
|
|
278
|
+
private updateEditorDraft;
|
|
279
|
+
private editorErrorFieldTouched;
|
|
280
|
+
/**
|
|
281
|
+
* Changing the START moves the event: the end shifts by the same delta, so
|
|
282
|
+
* the duration is preserved (B30/D12.10). This is the contract every other
|
|
283
|
+
* path already implements — a pointer move-drag applies one offset to both
|
|
284
|
+
* edges, and so does keyboard move-mode. Without it, moving an event later
|
|
285
|
+
* in the editor hit "End must be after start" and refused to do anything,
|
|
286
|
+
* which is a dead end on the field a user edits first.
|
|
287
|
+
*
|
|
288
|
+
* Changing the END is left alone: that is a resize, and the only way to
|
|
289
|
+
* express one here.
|
|
290
|
+
*
|
|
291
|
+
* A corollary worth stating, because the opposite looks like an oversight:
|
|
292
|
+
* while it is a move, the START picker carries NO `max`. Duration is an
|
|
293
|
+
* invariant of that transform, so a valid draft stays valid after any start
|
|
294
|
+
* change in either direction — start-after-end is unreachable, and a bound
|
|
295
|
+
* there would only refuse legitimate picks (D12.12/F1).
|
|
296
|
+
*
|
|
297
|
+
* When the user may resize but NOT move (D12.13's row 3), a start change is
|
|
298
|
+
* a start-RESIZE instead: the end holds still and the start is clamped to
|
|
299
|
+
* one slot before it, mirroring the end field's clamp. The draft cannot
|
|
300
|
+
* invert either way, so the two semantics differ only in what they mean.
|
|
301
|
+
*/
|
|
302
|
+
private onEditorStartChange;
|
|
303
|
+
/**
|
|
304
|
+
* The end alone is a RESIZE — it never drags the start with it.
|
|
305
|
+
*
|
|
306
|
+
* It is also the only edge that can invert the range (D12.12): a start
|
|
307
|
+
* change preserves duration, so it keeps a valid draft valid, but an end
|
|
308
|
+
* can be picked before the start. The END picker therefore carries
|
|
309
|
+
* `min = draft.start`, which the CALENDAR half honours date-only — exactly
|
|
310
|
+
* the wanted semantic, since "the same day" must stay fully selectable —
|
|
311
|
+
* and this clamp covers what a bound cannot: the same-day-earlier-time
|
|
312
|
+
* case, and the picker's Today/Now buttons, which ignore bounds entirely.
|
|
313
|
+
*
|
|
314
|
+
* Clamping the field the user just edited is deliberate. Adjusting the
|
|
315
|
+
* OTHER edge instead would change a control they are not focused on
|
|
316
|
+
* (a WCAG 3.2.2 hazard); this corrects their own field and says so.
|
|
317
|
+
*
|
|
318
|
+
* The floor is one grid slot, matching keyboard resize — the editor could
|
|
319
|
+
* otherwise commit a 1-minute event on a 30-minute grid, which no direct
|
|
320
|
+
* gesture can produce.
|
|
321
|
+
*/
|
|
322
|
+
private onEditorEndChange;
|
|
323
|
+
/**
|
|
324
|
+
* The editor's inherit checkbox. `<mp-checkbox>` rather than a bare input so
|
|
325
|
+
* it carries Bootstrap's `.form-check` styling into this shadow root; its
|
|
326
|
+
* `checked`/`disabled` are host properties, so it is read like a native one —
|
|
327
|
+
* but it is NOT an `HTMLInputElement`, hence its own accessor.
|
|
328
|
+
*/
|
|
329
|
+
private editorInheritCheckbox;
|
|
330
|
+
/**
|
|
331
|
+
* Save = the same `event-update` request a committed drag emits, so the
|
|
332
|
+
* consumer's existing handler applies it unchanged. Only fields whose inputs
|
|
333
|
+
* were ENABLED are read back — a disabled field keeps the event's value, so
|
|
334
|
+
* a permission can never be bypassed by a form submit. Validation stays
|
|
335
|
+
* minimal (end > start, non-empty title): the WC owns no data; anything
|
|
336
|
+
* richer belongs in the consumer's listener.
|
|
337
|
+
*/
|
|
338
|
+
private saveEventEditor;
|
|
339
|
+
/**
|
|
340
|
+
* Refuse a Save, and make sure the reason is spoken EXACTLY once (D12.14).
|
|
341
|
+
*
|
|
342
|
+
* The message goes to one channel only — the offending control's own
|
|
343
|
+
* accessible description — and is delivered by moving focus there. It used
|
|
344
|
+
* to go to two (a `role="alert"` node AND the polite live announcer), which
|
|
345
|
+
* screen readers speak twice, often at two different urgencies. The
|
|
346
|
+
* announcer is the wrong channel here for a second reason: it self-clears
|
|
347
|
+
* after 1.5 s, so it cannot hold a message the user may want to re-read,
|
|
348
|
+
* which is exactly what a validation error is. It stays on the SUCCESS
|
|
349
|
+
* path, where the message is transient by nature.
|
|
350
|
+
*
|
|
351
|
+
* Focus has to move for the same reason: with no live region, a description
|
|
352
|
+
* is silent until something lands on the control it describes.
|
|
353
|
+
*/
|
|
354
|
+
private refuseSave;
|
|
355
|
+
/** Mouse face of the rename: double-click the title span. */
|
|
356
|
+
private handleNativeDblClick;
|
|
357
|
+
/**
|
|
358
|
+
* Swap a resource/group title for an inline input — file-manager's proven
|
|
359
|
+
* idiom, keys included: Enter commits, Escape cancels, blur commits. The
|
|
360
|
+
* commit is a `resource-update` request carrying `{ title }`; the consumer
|
|
361
|
+
* applies it (the same contract as the colour swatch). No re-render happens
|
|
362
|
+
* while the input is open — nothing writes state until commit — so the input
|
|
363
|
+
* cannot be torn down mid-word.
|
|
364
|
+
*/
|
|
365
|
+
private beginResourceRename;
|
|
366
|
+
/** The in-grid pointer delete (D12.4b's revised home). */
|
|
367
|
+
private deleteFromEditor;
|
|
135
368
|
/**
|
|
136
369
|
* Route a "+N more" activation through `options.moreLinkBehavior`. Returns the
|
|
137
370
|
* date to drill to when the caller should navigate, or null when the behaviour
|
|
@@ -158,6 +391,7 @@ export declare class MpScheduler extends LitElement {
|
|
|
158
391
|
private updateUI;
|
|
159
392
|
private scheduleDragUpdate;
|
|
160
393
|
private handlePointerDown;
|
|
394
|
+
private allowsGesture;
|
|
161
395
|
private handlePointerMove;
|
|
162
396
|
private handlePointerUp;
|
|
163
397
|
/** Distance from a scroller edge at which auto-scroll engages. */
|
|
@@ -239,6 +473,12 @@ export declare class MpScheduler extends LitElement {
|
|
|
239
473
|
* render that decides whether to draw an affordance.
|
|
240
474
|
*/
|
|
241
475
|
private can;
|
|
476
|
+
/**
|
|
477
|
+
* "May this edge be dragged?" — for the three DIRECT-MANIPULATION surfaces
|
|
478
|
+
* only (resize handles, the pointer gesture, Shift/Alt+Shift+Arrow), where
|
|
479
|
+
* the edge belongs to the gesture. Everything else asks `can('resizeEvent')`.
|
|
480
|
+
*/
|
|
481
|
+
private canResizeEdge;
|
|
242
482
|
/** Recompute the resolved table onto state so views can gate affordances. */
|
|
243
483
|
private syncPermissions;
|
|
244
484
|
/**
|
|
@@ -342,7 +582,17 @@ export declare class MpScheduler extends LitElement {
|
|
|
342
582
|
private commitFocusMove;
|
|
343
583
|
private cellIsWithinView;
|
|
344
584
|
private parseTimeOnDay;
|
|
345
|
-
|
|
585
|
+
/**
|
|
586
|
+
* Walk the timeline's RENDERED row order: visible leaf resources, then the
|
|
587
|
+
* bucket row when it exists — the same list the view draws, so keyboard
|
|
588
|
+
* navigation can reach everything the eye can see (B25).
|
|
589
|
+
*
|
|
590
|
+
* Tri-state result: a string is the next resource row, `null` is the bucket
|
|
591
|
+
* row, `undefined` means "no move" (already at the edge, or nothing to walk).
|
|
592
|
+
* The old version returned `null` for BOTH of the last two, which is exactly
|
|
593
|
+
* why the bucket was unreachable by keyboard.
|
|
594
|
+
*/
|
|
595
|
+
private adjacentRow;
|
|
346
596
|
private getResourceTitle;
|
|
347
597
|
/**
|
|
348
598
|
* Find the cell DOM element for a (slot, resource) pair and call .focus()
|
|
@@ -350,6 +600,14 @@ export declare class MpScheduler extends LitElement {
|
|
|
350
600
|
* drag-near-edge auto-pan (PRD D6).
|
|
351
601
|
*/
|
|
352
602
|
private scrollAndFocusCell;
|
|
603
|
+
/**
|
|
604
|
+
* Resolve the grid cell for a (time, row) pair. Bucket-aware: on the
|
|
605
|
+
* timeline, `null` means the unassigned row, whose slots carry
|
|
606
|
+
* `data-unassigned` instead of a resource id — the old null branch looked up
|
|
607
|
+
* `.scheduler-time-slot`, which belongs to week/day and found nothing there,
|
|
608
|
+
* so keyboard focus could never land in the bucket row (B25).
|
|
609
|
+
*/
|
|
610
|
+
private timeCellElement;
|
|
353
611
|
/** Re-focus whatever cell the keyboard model currently considers focused. */
|
|
354
612
|
private focusFocusedCell;
|
|
355
613
|
/**
|
|
@@ -399,7 +657,7 @@ export declare class MpScheduler extends LitElement {
|
|
|
399
657
|
private minutesPerSlot;
|
|
400
658
|
/** Shift the working event by `deltaMs` along the time axis (preserves duration). */
|
|
401
659
|
private nudgeKeyboardMove;
|
|
402
|
-
/** Walk to the next/previous
|
|
660
|
+
/** Walk to the next/previous row (timeline only). Updates the preview's resourceId. */
|
|
403
661
|
private nudgeKeyboardMoveResource;
|
|
404
662
|
/**
|
|
405
663
|
* Resize one edge of the working event. Clamps to a minimum duration of
|
|
@@ -102,6 +102,16 @@ export declare class SchedulerStateManager {
|
|
|
102
102
|
* drag that re-renders sixty times a second cannot flood the console.
|
|
103
103
|
*/
|
|
104
104
|
private warnUnassignedEvents;
|
|
105
|
+
/** Dangling resource ids already reported; warn once per event id. */
|
|
106
|
+
private readonly warnedDanglingIds;
|
|
107
|
+
/**
|
|
108
|
+
* B29's development signal: an event whose `resourceId` names no known
|
|
109
|
+
* resource renders in the bucket row rather than vanishing, and says so once.
|
|
110
|
+
* Gated on a non-empty resource tree — during input wiring the events
|
|
111
|
+
* routinely arrive before the resources, and warning about that ordering
|
|
112
|
+
* would train consumers to ignore the warning that matters.
|
|
113
|
+
*/
|
|
114
|
+
private warnDanglingEvents;
|
|
105
115
|
/**
|
|
106
116
|
* Subscribe to state changes
|
|
107
117
|
*/
|
|
@@ -48,6 +48,35 @@ export declare class TimelineView extends BaseView {
|
|
|
48
48
|
* unassigned, so a fully-assigned timeline shows no phantom row.
|
|
49
49
|
*/
|
|
50
50
|
private hasUnassignedRow;
|
|
51
|
+
/** Narrowest useful column; below this the titles are gone anyway. */
|
|
52
|
+
private static readonly MIN_COLUMN_PX;
|
|
53
|
+
/** The AG-Grid guard: the frozen column may never leave less than this. */
|
|
54
|
+
private static readonly MIN_GRID_PX;
|
|
55
|
+
private columnDrag;
|
|
56
|
+
private boundColumnDragMove;
|
|
57
|
+
private boundColumnDragEnd;
|
|
58
|
+
/**
|
|
59
|
+
* The WAI-ARIA window-splitter on the resource column's right edge — the
|
|
60
|
+
* same pattern as the repo's splitter. It writes
|
|
61
|
+
* `--scheduler-resource-column-width` on the scroll container, which is the
|
|
62
|
+
* exact channel the consumer configures, so their own value stays the
|
|
63
|
+
* initial and every rule reading the custom property follows for free. The
|
|
64
|
+
* inline style survives view rebuilds AND view switches (clearContainer
|
|
65
|
+
* strips classes and ARIA, not inline style), which is what makes the
|
|
66
|
+
* user's chosen width sticky.
|
|
67
|
+
*
|
|
68
|
+
* Lives inside the corner columnheader, OUTSIDE the `role="grid"` focus
|
|
69
|
+
* model (same reasoning as the add bar, §11.2): a separator is not a grid
|
|
70
|
+
* cell, and a Tab stop inside a roving-tabindex grid is a trap.
|
|
71
|
+
*/
|
|
72
|
+
private createColumnResizer;
|
|
73
|
+
private currentColumnWidth;
|
|
74
|
+
private maxColumnWidth;
|
|
75
|
+
private applyColumnWidth;
|
|
76
|
+
/** aria-valuenow as a percentage of the scroller, per the splitter pattern. */
|
|
77
|
+
private updateResizerValue;
|
|
78
|
+
private onColumnDragMove;
|
|
79
|
+
private onColumnDragEnd;
|
|
51
80
|
/** True when the capability is granted for the whole scheduler. */
|
|
52
81
|
private can;
|
|
53
82
|
/**
|
|
@@ -96,9 +125,12 @@ export declare class TimelineView extends BaseView {
|
|
|
96
125
|
* The "(No resource)" bucket row.
|
|
97
126
|
*
|
|
98
127
|
* Structurally identical to a resource row so keyboard nav, roving tabindex and
|
|
99
|
-
* the grid ARIA chain all treat it as one more row — but its slots carry
|
|
100
|
-
* `data-resource-id`, so a
|
|
101
|
-
*
|
|
128
|
+
* the grid ARIA chain all treat it as one more row — but its slots carry
|
|
129
|
+
* `data-unassigned` instead of a `data-resource-id`, so a drag addressing this
|
|
130
|
+
* row resolves to the tri-state `resourceId: null` ("the bucket") rather than
|
|
131
|
+
* `undefined` ("no resource axis"). An absent attribute could not carry that
|
|
132
|
+
* distinction — it would read exactly like a week-view slot, and a drop here
|
|
133
|
+
* could never mean "unassign".
|
|
102
134
|
*/
|
|
103
135
|
private createUnassignedRow;
|
|
104
136
|
private renderEvents;
|
|
@@ -113,6 +145,22 @@ export declare class TimelineView extends BaseView {
|
|
|
113
145
|
* view while week/day showed it.
|
|
114
146
|
*/
|
|
115
147
|
private renderPreviewEvent;
|
|
148
|
+
/**
|
|
149
|
+
* Which row a drag/preview is currently addressing.
|
|
150
|
+
*
|
|
151
|
+
* Precedence: the preview's own row (a MOVE tracks the pointer's row; a
|
|
152
|
+
* move-mode Up/Down nudge writes it too — `null` meaning the bucket row) →
|
|
153
|
+
* the dragged event's own row (a resize never changes rows, and its preview
|
|
154
|
+
* deliberately carries none) → the row the gesture is happening in (a CREATE
|
|
155
|
+
* has no source event; without this fallback a create-drag showed no
|
|
156
|
+
* feedback at all).
|
|
157
|
+
*
|
|
158
|
+
* The dragged event is resolved from the NORMALIZED store, not
|
|
159
|
+
* `resource.events` — that nested array stopped being a live mirror when the
|
|
160
|
+
* model was normalized, so the old lookup found nothing for any event
|
|
161
|
+
* supplied through the `events` input.
|
|
162
|
+
*/
|
|
163
|
+
private previewRowKey;
|
|
116
164
|
update(state: SchedulerState): void;
|
|
117
165
|
private optionsRequireRerender;
|
|
118
166
|
private updateGreyedSlots;
|
|
@@ -10,9 +10,11 @@ export declare class YearView extends BaseView {
|
|
|
10
10
|
/**
|
|
11
11
|
* Build a `YYYY-MM` key from a Date, which is the unit of focus on year
|
|
12
12
|
* view (PRD scheduler-controlled-selection §5.2 — year cells are months,
|
|
13
|
-
* not days).
|
|
13
|
+
* not days). Public because the month card's element id
|
|
14
|
+
* (`scheduler-cell-y-{key}`) is also the anchor the day popover hangs off
|
|
15
|
+
* in this view.
|
|
14
16
|
*/
|
|
15
|
-
|
|
17
|
+
static monthKey(d: Date): string;
|
|
16
18
|
private createMonthCard;
|
|
17
19
|
/**
|
|
18
20
|
* Apply roving tabindex based on `state.focusedDate`'s month. Year-view's
|
package/scheduler-core/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as $, d as C } from "../chunks/id-
|
|
2
|
-
import { a as U, b as V, c as j, e as G, f as X, R as Y, T as q, g as J, h as K, i as Q, j as Z, k as tt, l as et, m as ot, n as st, o as nt, p as it, q as ct, r as rt, s as at, t as lt, u as dt, v as gt, w as ht } from "../chunks/id-
|
|
1
|
+
import { D as $, d as C } from "../chunks/id-BstjfRrz.mjs";
|
|
2
|
+
import { a as U, b as V, c as j, e as G, f as X, R as Y, T as q, g as J, h as K, i as Q, j as Z, k as tt, l as et, m as ot, n as st, o as nt, p as it, q as ct, r as rt, s as at, t as lt, u as dt, v as gt, w as ht, x as ut } from "../chunks/id-BstjfRrz.mjs";
|
|
3
3
|
class w {
|
|
4
4
|
/**
|
|
5
5
|
* Calculate position for an event part in week/day view
|
|
@@ -104,14 +104,14 @@ function M(o) {
|
|
|
104
104
|
left: o.scrollLeft
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function z(o, t, e = "smooth") {
|
|
108
108
|
const s = o.getBoundingClientRect(), i = t.getBoundingClientRect().top - s.top + o.scrollTop;
|
|
109
109
|
o.scrollTo({
|
|
110
110
|
top: i,
|
|
111
111
|
behavior: e
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function O(o, t) {
|
|
115
115
|
const e = o.getBoundingClientRect(), s = t ? t.getBoundingClientRect() : { top: 0, left: 0, bottom: window.innerHeight, right: window.innerWidth };
|
|
116
116
|
return e.top >= s.top && e.left >= s.left && e.bottom <= s.bottom && e.right <= s.right;
|
|
117
117
|
}
|
|
@@ -164,7 +164,7 @@ export {
|
|
|
164
164
|
P as getElementByData,
|
|
165
165
|
B as getRelativePosition,
|
|
166
166
|
M as getScrollPosition,
|
|
167
|
-
|
|
167
|
+
O as isInViewport,
|
|
168
168
|
it as isResource,
|
|
169
169
|
ct as isResourceGroup,
|
|
170
170
|
rt as lightenColor,
|
|
@@ -173,9 +173,10 @@ export {
|
|
|
173
173
|
at as resolveCapability,
|
|
174
174
|
lt as resolveEventColor,
|
|
175
175
|
dt as resolveMessages,
|
|
176
|
-
gt as
|
|
177
|
-
|
|
176
|
+
gt as resolveResizeEdge,
|
|
177
|
+
ht as resourceService,
|
|
178
|
+
z as scrollToTime,
|
|
178
179
|
A as setCSSVariable,
|
|
179
|
-
|
|
180
|
+
ut as timelineService,
|
|
180
181
|
k as toggleClass
|
|
181
182
|
};
|
|
@@ -70,8 +70,12 @@ export interface PreviewEvent {
|
|
|
70
70
|
start: Date;
|
|
71
71
|
/** End of the preview */
|
|
72
72
|
end: Date;
|
|
73
|
-
/**
|
|
74
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Row the preview belongs to. Same tri-state as `TimeSlot.resourceId`:
|
|
75
|
+
* `undefined` = no row information (no resource axis, or a resize, which
|
|
76
|
+
* never changes rows), `null` = the unassigned bucket row.
|
|
77
|
+
*/
|
|
78
|
+
resourceId?: string | null;
|
|
75
79
|
}
|
|
76
80
|
/**
|
|
77
81
|
* A track/rail containing non-overlapping events
|
|
@@ -40,6 +40,12 @@ export interface SchedulerMessages {
|
|
|
40
40
|
removeResource: string;
|
|
41
41
|
/** {title} */
|
|
42
42
|
resourceColor: string;
|
|
43
|
+
/** Accessible name of the resource-column resize separator. */
|
|
44
|
+
resizeResourceColumn: string;
|
|
45
|
+
/** {title} — accessible name of the inline rename input. */
|
|
46
|
+
renameResourceLabel: string;
|
|
47
|
+
/** {from} {to} — announced after a rename commits. */
|
|
48
|
+
resourceRenamed: string;
|
|
43
49
|
/** {count} — number of hidden events */
|
|
44
50
|
moreEvents: string;
|
|
45
51
|
/** {date} — accessible name of the day popover dialog */
|
|
@@ -54,7 +60,53 @@ export interface SchedulerMessages {
|
|
|
54
60
|
newEvent: string;
|
|
55
61
|
/** Secondary action: drill into the day view. */
|
|
56
62
|
showDay: string;
|
|
63
|
+
/** Secondary action of the month-scoped popover (year view): drill into the month. */
|
|
64
|
+
showMonth: string;
|
|
57
65
|
closePopover: string;
|
|
66
|
+
/** Label of the popover's resource picker on the create action. */
|
|
67
|
+
newEventResource: string;
|
|
68
|
+
/** {title} — accessible name of a per-event delete button. */
|
|
69
|
+
deleteEventLabel: string;
|
|
70
|
+
/** {title} — accessible name of the editor dialog. */
|
|
71
|
+
eventEditorLabel: string;
|
|
72
|
+
editorTitleLabel: string;
|
|
73
|
+
editorStartLabel: string;
|
|
74
|
+
editorEndLabel: string;
|
|
75
|
+
editorColorLabel: string;
|
|
76
|
+
/**
|
|
77
|
+
* Checkbox: keep the event's colour derived from its resource instead of
|
|
78
|
+
* pinning one on the event. Checked whenever the event carries no `color`,
|
|
79
|
+
* which is the state the whole precedence chain assumes.
|
|
80
|
+
*/
|
|
81
|
+
editorInheritColor: string;
|
|
82
|
+
editorSave: string;
|
|
83
|
+
editorCancel: string;
|
|
84
|
+
editorDelete: string;
|
|
85
|
+
/** Inline error + announcement when the edited range is invalid. */
|
|
86
|
+
editorInvalidRange: string;
|
|
87
|
+
/** Inline error + announcement when the title is emptied. */
|
|
88
|
+
editorTitleRequired: string;
|
|
89
|
+
/**
|
|
90
|
+
* {end} — announced when a picked end time was pulled forward to the
|
|
91
|
+
* earliest the grid allows. The correction happens on the field the user
|
|
92
|
+
* just edited, so it must be spoken: silently changing a value the user
|
|
93
|
+
* chose, without saying so, is the failure mode this message exists to
|
|
94
|
+
* avoid (D12.12).
|
|
95
|
+
*/
|
|
96
|
+
editorEndClamped: string;
|
|
97
|
+
/**
|
|
98
|
+
* {start} — the mirror of `editorEndClamped`, announced when a start change
|
|
99
|
+
* is a RESIZE rather than a move (the user may resize but not move, D12.13)
|
|
100
|
+
* and the picked start was pushed back to the latest the grid allows.
|
|
101
|
+
*/
|
|
102
|
+
editorStartClamped: string;
|
|
103
|
+
/**
|
|
104
|
+
* {month} {count} {events} — accessible name of a year-view month card. The
|
|
105
|
+
* event count is the text equivalent of the colour-only `.has-events` dots
|
|
106
|
+
* (WCAG 1.4.1): without it a screen-reader user cannot tell a busy month
|
|
107
|
+
* from an empty one.
|
|
108
|
+
*/
|
|
109
|
+
yearMonthCardLabel: string;
|
|
58
110
|
/** {view} — localized view name */
|
|
59
111
|
viewChanged: string;
|
|
60
112
|
/** {title} */
|
|
@@ -67,6 +119,12 @@ export interface SchedulerMessages {
|
|
|
67
119
|
eventsLoaded: string;
|
|
68
120
|
/** {title} {minutes} — move-mode entry keymap announcement */
|
|
69
121
|
moveModeEntered: string;
|
|
122
|
+
/**
|
|
123
|
+
* {title} {minutes} — the timeline's move-mode entry announcement. Its own
|
|
124
|
+
* key because the generic one promises "arrow keys nudge by N minutes",
|
|
125
|
+
* which is wrong there: on the timeline Up/Down changes the resource.
|
|
126
|
+
*/
|
|
127
|
+
moveModeEnteredTimeline: string;
|
|
70
128
|
/** {start} {end} {day} */
|
|
71
129
|
movedTo: string;
|
|
72
130
|
/** {resource} */
|
|
@@ -85,6 +143,8 @@ export interface SchedulerMessages {
|
|
|
85
143
|
selectionCommitted: string;
|
|
86
144
|
gridInstructions: string;
|
|
87
145
|
eventInstructions: string;
|
|
146
|
+
/** The eventInstructions variant used while the built-in editor is enabled. */
|
|
147
|
+
eventInstructionsWithEditor: string;
|
|
88
148
|
/** Read-only variants: no create/move/resize/delete promises. */
|
|
89
149
|
gridInstructionsReadOnly: string;
|
|
90
150
|
eventInstructionsReadOnly: string;
|
|
@@ -96,15 +96,31 @@ export interface SchedulerOptions {
|
|
|
96
96
|
*/
|
|
97
97
|
moreLinkBehavior?: MoreLinkBehavior;
|
|
98
98
|
/**
|
|
99
|
-
* What clicking a
|
|
99
|
+
* What clicking a day CELL does (month view, and year-view mini-days),
|
|
100
|
+
* beyond emitting `date-click`.
|
|
100
101
|
*
|
|
101
|
-
* Defaults to `'
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
102
|
+
* Defaults to `'popover'` — click a date to see and add its events, which
|
|
103
|
+
* is what the surface exists for. `date-click` still emits FIRST,
|
|
104
|
+
* unconditionally, so a consumer's own handler keeps working; set `'none'`
|
|
105
|
+
* to keep the click purely an event for the consumer. Clicking the day
|
|
106
|
+
* NUMBER in month view always drills into the day view (the navLinks idiom)
|
|
107
|
+
* and is deliberately a separate target: conflating the two would make an
|
|
108
|
+
* empty cell unable to mean "create here".
|
|
106
109
|
*/
|
|
107
110
|
dayClickAction?: 'none' | 'popover';
|
|
111
|
+
/**
|
|
112
|
+
* The built-in event editor: a popover anchored to the event with title,
|
|
113
|
+
* start/end and colour fields plus Save / Delete / Cancel, opened by
|
|
114
|
+
* double-click (double-tap), right-click, or F2 on the selected event.
|
|
115
|
+
*
|
|
116
|
+
* Default `true`. It emits the SAME requests every other surface emits —
|
|
117
|
+
* Save is an `event-update`, Delete an `event-delete` — so a consumer's
|
|
118
|
+
* handlers keep working unchanged, and it doubles as the single-pointer
|
|
119
|
+
* non-drag path to change an event's times (WCAG 2.5.7). Set `false` when
|
|
120
|
+
* the app ships its own editor; `event-dblclick` keeps firing either way.
|
|
121
|
+
* Also exposed as the `event-editor` attribute / `eventEditor` property.
|
|
122
|
+
*/
|
|
123
|
+
eventEditor?: boolean;
|
|
108
124
|
/**
|
|
109
125
|
* Whether every event is expected to name a resource.
|
|
110
126
|
*
|