@mintplayer/web-components 2.5.0 → 2.8.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/calendar/index.mjs +1 -1
- package/calendar/src/mp-calendar.element.d.ts +19 -1
- 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-DNZVAnGC.mjs} +290 -160
- package/chunks/{mp-calendar.element-u6uS31_j.mjs → mp-calendar.element-CJ8-t-Zn.mjs} +71 -39
- 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-D1CiLbHm.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 +2 -2
- 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 +2775 -1025
- package/scheduler/src/components/mp-scheduler.d.ts +454 -11
- package/scheduler/src/input/input-handler.d.ts +22 -0
- package/scheduler/src/state/scheduler-state.d.ts +10 -0
- package/scheduler/src/views/base-view.d.ts +30 -1
- package/scheduler/src/views/index.d.ts +1 -1
- package/scheduler/src/views/timeline-view.d.ts +87 -15
- package/scheduler/src/views/year-view.d.ts +11 -2
- package/scheduler-core/index.mjs +44 -41
- package/scheduler-core/src/models/event.d.ts +6 -2
- package/scheduler-core/src/models/messages.d.ts +89 -0
- package/scheduler-core/src/models/options.d.ts +46 -13
- package/scheduler-core/src/models/permissions.d.ts +35 -4
- package/scheduler-core/src/models/time-slot.d.ts +11 -6
- package/scheduler-core/src/services/date.service.d.ts +64 -10
- package/scheduler-core/src/utils/color.d.ts +19 -0
- 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,44 @@ export declare class MpScheduler extends LitElement {
|
|
|
42
58
|
* silently behind the user's focus.
|
|
43
59
|
*/
|
|
44
60
|
private readonly dayPopover;
|
|
61
|
+
/** Resource/group whose actions panel is open, or null when it is closed. */
|
|
62
|
+
private rowMenuResourceId;
|
|
63
|
+
/**
|
|
64
|
+
* The row-actions panel (R1/R3/R4): the four controls that used to sit inline
|
|
65
|
+
* in the pinned resource column, moved behind one 24px trigger so the column
|
|
66
|
+
* can be narrow enough to use on a phone.
|
|
67
|
+
*
|
|
68
|
+
* A `role="dialog"`, deliberately NOT a `role="menu"`. A menu owns only
|
|
69
|
+
* `menuitem`-family children, and this panel contains a native
|
|
70
|
+
* `<input type="color">` — a form control inside a menu is an invalid owned
|
|
71
|
+
* child, and "a menu that is really a dialog" is the shape to avoid. Keeping
|
|
72
|
+
* the native input is worth the distinction: it is keyboard-operable,
|
|
73
|
+
* localized and screen-reader labelled by the platform for free.
|
|
74
|
+
*
|
|
75
|
+
* Same mechanics as the two overlays above, including the two traps: the
|
|
76
|
+
* anchor resolves LAZILY by id (the timeline rebuilds its DOM on every state
|
|
77
|
+
* change, so a captured element detaches under the open panel), and `onClose`
|
|
78
|
+
* mirrors dismissal back into state or the panel stays rendered after an
|
|
79
|
+
* outside-click.
|
|
80
|
+
*/
|
|
81
|
+
private readonly rowMenuOverlay;
|
|
82
|
+
/** Event the built-in editor is open for, or null when it is closed. */
|
|
83
|
+
private editorEventId;
|
|
84
|
+
/**
|
|
85
|
+
* Inline validation message currently shown in the editor, and WHICH field
|
|
86
|
+
* it is about (D12.14). The field matters: the message is spoken by moving
|
|
87
|
+
* focus to the offending control, whose own description carries it — there
|
|
88
|
+
* is no live region involved, so an unattributed message would be silent.
|
|
89
|
+
*/
|
|
90
|
+
private editorError;
|
|
91
|
+
private readonly editorTitleErrorId;
|
|
92
|
+
/**
|
|
93
|
+
* The built-in event editor (R20/D12.8): a non-modal dialog anchored to the
|
|
94
|
+
* event's own element, resolved lazily by event id — the views rebuild their
|
|
95
|
+
* DOM imperatively, so a captured element would detach under the panel.
|
|
96
|
+
* Same mechanics and traps as the day popover above.
|
|
97
|
+
*/
|
|
98
|
+
private readonly eventEditorOverlay;
|
|
45
99
|
constructor();
|
|
46
100
|
connectedCallback(): void;
|
|
47
101
|
disconnectedCallback(): void;
|
|
@@ -61,6 +115,14 @@ export declare class MpScheduler extends LitElement {
|
|
|
61
115
|
*/
|
|
62
116
|
get readonly(): boolean;
|
|
63
117
|
set readonly(value: boolean);
|
|
118
|
+
/**
|
|
119
|
+
* The built-in event editor's on/off switch (default ON). Attribute and
|
|
120
|
+
* property are the same state, like `readonly`: the ATTRIBUTE (`event-editor`)
|
|
121
|
+
* outranks `options.eventEditor`, and only the literal `"false"` disables —
|
|
122
|
+
* so a wrapper can render the attribute unconditionally from a boolean.
|
|
123
|
+
*/
|
|
124
|
+
get eventEditor(): boolean;
|
|
125
|
+
set eventEditor(value: boolean);
|
|
64
126
|
get events(): SchedulerEvent[];
|
|
65
127
|
set events(value: SchedulerEvent[]);
|
|
66
128
|
get resources(): (Resource | ResourceGroup)[];
|
|
@@ -96,6 +158,14 @@ export declare class MpScheduler extends LitElement {
|
|
|
96
158
|
* Localized string lookup: options.messages overrides merged onto the
|
|
97
159
|
* English defaults, with {placeholder} interpolation.
|
|
98
160
|
*/
|
|
161
|
+
/**
|
|
162
|
+
* Which keymap the grid advertises (audit M6). The keys genuinely differ per
|
|
163
|
+
* view, so the single global string was not merely vague — it was false: it
|
|
164
|
+
* promised that Enter creates an event, which in year view opens the month
|
|
165
|
+
* instead, and it never mentioned Space, the only way to reach the popover
|
|
166
|
+
* in month or year.
|
|
167
|
+
*/
|
|
168
|
+
private gridInstructionsKey;
|
|
99
169
|
private msg;
|
|
100
170
|
render(): TemplateResult;
|
|
101
171
|
/**
|
|
@@ -113,25 +183,307 @@ export declare class MpScheduler extends LitElement {
|
|
|
113
183
|
* is `event-selected`, "New event" is `event-create`, "Show day" is the same
|
|
114
184
|
* drill the "+N more" link used to do.
|
|
115
185
|
*/
|
|
186
|
+
/**
|
|
187
|
+
* The open panel's trigger, resolved by id because the timeline rebuilds its
|
|
188
|
+
* DOM on every state change.
|
|
189
|
+
*
|
|
190
|
+
* Matched by reading `dataset` rather than by building an attribute selector:
|
|
191
|
+
* a resource id is consumer data and may contain quotes or brackets, and
|
|
192
|
+
* `CSS.escape` is not available everywhere (jsdom has no `CSS` global at all,
|
|
193
|
+
* which threw here). Scanning a handful of buttons costs nothing.
|
|
194
|
+
*/
|
|
195
|
+
private rowMenuTriggerById;
|
|
196
|
+
/**
|
|
197
|
+
* `aria-expanded` belongs on the trigger and must change in the same beat as
|
|
198
|
+
* the visual state. The trigger is imperative DOM (the timeline builds it), so
|
|
199
|
+
* it cannot ride Lit's render — it is written here and re-asserted after every
|
|
200
|
+
* rebuild.
|
|
201
|
+
*/
|
|
202
|
+
private syncRowMenuTriggerState;
|
|
203
|
+
/** Move focus from the focused cell onto its row's actions trigger. */
|
|
204
|
+
private focusRowTrigger;
|
|
205
|
+
/**
|
|
206
|
+
* Keys while the row's trigger has focus. It sits outside the roving cell
|
|
207
|
+
* model, so it needs its own small map: open, or hand focus back to the grid.
|
|
208
|
+
*/
|
|
209
|
+
private handleRowTriggerKeyDown;
|
|
210
|
+
/**
|
|
211
|
+
* Open the actions panel for a row, or re-target it if another row's is open.
|
|
212
|
+
*
|
|
213
|
+
* `OverlayController.open()` is a no-op while already open, and the anchor is
|
|
214
|
+
* resolved lazily by id — so simply changing the id repainted the panel's
|
|
215
|
+
* CONTENTS for the new row while leaving it positioned under the previous
|
|
216
|
+
* row's trigger. The outside-mousedown dismissal cannot break the tie either:
|
|
217
|
+
* it ignores any press whose composed path includes the host, and every
|
|
218
|
+
* trigger is inside the host. Nothing was going to close it.
|
|
219
|
+
*
|
|
220
|
+
* So a different row is treated as what it is — a different dialog: close,
|
|
221
|
+
* then open. `close(false)` deliberately does NOT return focus, because the
|
|
222
|
+
* user's focus is already on the new trigger; handing it back to the old one
|
|
223
|
+
* would flicker, and would make the following `open()` capture the wrong
|
|
224
|
+
* element as its Escape target.
|
|
225
|
+
*/
|
|
226
|
+
private openRowMenu;
|
|
227
|
+
private closeRowMenu;
|
|
228
|
+
/**
|
|
229
|
+
* The row-actions panel. Built from the SAME permission list the trigger
|
|
230
|
+
* consults, so a button never promises a panel that turns out to be empty.
|
|
231
|
+
*/
|
|
232
|
+
private renderRowMenu;
|
|
116
233
|
private renderDayPopover;
|
|
234
|
+
private renderPopoverEvent;
|
|
117
235
|
/**
|
|
118
|
-
* The
|
|
119
|
-
*
|
|
120
|
-
*
|
|
236
|
+
* The pointer face of the Delete key (R14): before this, `event-delete` was
|
|
237
|
+
* keyboard-only. A SIBLING of the event button — event boxes and popover
|
|
238
|
+
* entries are buttons themselves, so a delete control inside one would be a
|
|
239
|
+
* nested interactive.
|
|
240
|
+
*
|
|
241
|
+
* The popover stays open: `event-delete` is a request, and whether the row
|
|
242
|
+
* disappears is the consumer's call (their listener owns the data, and any
|
|
243
|
+
* confirm/undo). Focus is parked on the next row by INDEX before the list
|
|
244
|
+
* re-renders — the deleted row's button is about to vanish, and focus falling
|
|
245
|
+
* to <body> would dump a keyboard user out of the dialog.
|
|
246
|
+
*/
|
|
247
|
+
private deleteFromPopover;
|
|
248
|
+
/**
|
|
249
|
+
* The month-scoped list: events grouped under a heading per day, each event
|
|
250
|
+
* listed once under the day it starts (clamped to the month, so an event
|
|
251
|
+
* running in from last month sits under the 1st rather than vanishing).
|
|
252
|
+
*/
|
|
253
|
+
private renderPopoverDayGroups;
|
|
254
|
+
/**
|
|
255
|
+
* The cell/card the popover hangs off, resolved by element id on every call.
|
|
256
|
+
* The views rebuild their cells imperatively, so a cached element would be
|
|
257
|
+
* detached the moment anything re-renders while the popover is open.
|
|
121
258
|
*/
|
|
122
259
|
private popoverAnchorCell;
|
|
260
|
+
/**
|
|
261
|
+
* The anchor for a popover opened for `day` in the current view: the day's
|
|
262
|
+
* own cell in month view, its month CARD in year view. Every other view has
|
|
263
|
+
* no date-keyed cell — the popover is a month/year surface only.
|
|
264
|
+
*/
|
|
265
|
+
private defaultPopoverAnchorId;
|
|
123
266
|
/** Every event overlapping the given local day, in start order. */
|
|
124
267
|
private eventsOnDay;
|
|
125
268
|
/**
|
|
126
|
-
* Open the
|
|
127
|
-
*
|
|
269
|
+
* Open the date popover for `day`. Anchored on an element resolved LAZILY by
|
|
270
|
+
* id: the views rebuild their DOM imperatively, so a captured element
|
|
128
271
|
* reference would be detached by the next render while the popover is open.
|
|
272
|
+
*
|
|
273
|
+
* `anchorId` overrides the default when the caller knows better — a year
|
|
274
|
+
* mini-day belonging to an ADJACENT month must anchor on the card it was
|
|
275
|
+
* clicked in, which is not the card its own month key names.
|
|
129
276
|
*/
|
|
130
277
|
private openDayPopover;
|
|
131
278
|
private closeDayPopover;
|
|
132
279
|
private selectFromPopover;
|
|
133
280
|
private createFromPopover;
|
|
134
|
-
|
|
281
|
+
/** "Show day" / "Show month" — the drill that matches the popover's scope. */
|
|
282
|
+
private drillFromPopover;
|
|
283
|
+
/** Every event overlapping `day`'s local month, in start order. */
|
|
284
|
+
private eventsInMonth;
|
|
285
|
+
/** The rendered element of an event, by id — never the drag ghost. */
|
|
286
|
+
private eventElementById;
|
|
287
|
+
/**
|
|
288
|
+
* The editor opens when ANY of its fields is permitted for this event
|
|
289
|
+
* (D12.8c) — an all-disabled form is worse than no form. `readonly` and
|
|
290
|
+
* per-event `editable: false` zero every capability, so they kill it
|
|
291
|
+
* wholesale through the same resolver as everything else.
|
|
292
|
+
*/
|
|
293
|
+
private canOpenEditor;
|
|
294
|
+
/**
|
|
295
|
+
* Which of the editor's time fields are live, and what a start change MEANS
|
|
296
|
+
* — the single place that answers both (D12.13).
|
|
297
|
+
*
|
|
298
|
+
* | `moveEvent` | `resizeEvent` | start | end | a start change… |
|
|
299
|
+
* |---|---|---|---|---|
|
|
300
|
+
* | ✓ | ✓ | on | on | shifts both (a move) |
|
|
301
|
+
* | ✓ | ✗ | on | off | shifts both (a move) |
|
|
302
|
+
* | ✗ | ✓ | on | on | resizes the start alone, clamped |
|
|
303
|
+
* | ✗ | ✗ | off | off | — |
|
|
304
|
+
*
|
|
305
|
+
* Editing the END alone is *by definition* a resize, so that field follows
|
|
306
|
+
* `resizeEvent`. Editing the START is a move where one is permitted and a
|
|
307
|
+
* start-resize otherwise. Row 2 closes a leak that predates this: with
|
|
308
|
+
* `moveEvent: true, resizable: false` the editor used to commit a pure
|
|
309
|
+
* duration change that `resizable: false` forbids.
|
|
310
|
+
*
|
|
311
|
+
* `canResize` folds the per-item `{ start, end }` form as **both** edges, so
|
|
312
|
+
* `resizable: { start: false, end: true }` locks the editor's time fields
|
|
313
|
+
* while the end *handle* keeps working — honest, and with no way to commit a
|
|
314
|
+
* half-applied range (B35). Both edges are therefore always writable
|
|
315
|
+
* together or not at all, which is what makes the single `if` at save
|
|
316
|
+
* correct rather than coincidental.
|
|
317
|
+
*/
|
|
318
|
+
private editorTimeFields;
|
|
319
|
+
private tryOpenEventEditor;
|
|
320
|
+
private closeEventEditor;
|
|
321
|
+
/**
|
|
322
|
+
* Right-click on an event box opens the editor (D12.8b) — on a POINTING device
|
|
323
|
+
* only.
|
|
324
|
+
*
|
|
325
|
+
* On touch the browser synthesizes `contextmenu` from a long-press at roughly
|
|
326
|
+
* 500ms, which lands ~100ms before our own 600ms hold-to-drag arms. Acting on
|
|
327
|
+
* it made dragging unreachable on a phone (R9): the editor opened every time
|
|
328
|
+
* and the drag never started. So a touch-originated `contextmenu` is consumed
|
|
329
|
+
* and discarded here, leaving the gesture to the hold timer.
|
|
330
|
+
*
|
|
331
|
+
* `preventDefault` on the touch path is what stops the *platform* menu from
|
|
332
|
+
* appearing over an arming drag. It is called for every touch target, not just
|
|
333
|
+
* events, because the hold timer arms on every target — a long-press on empty
|
|
334
|
+
* grid arms drag-to-create, and used to do so underneath Android's own menu.
|
|
335
|
+
*/
|
|
336
|
+
private handleContextMenu;
|
|
337
|
+
/**
|
|
338
|
+
* Did this `contextmenu` come from a finger?
|
|
339
|
+
*
|
|
340
|
+
* Two signals, because no single one is portable. Chromium delivers
|
|
341
|
+
* `contextmenu` as a `PointerEvent` and its `pointerType` is authoritative when
|
|
342
|
+
* present; Firefox and WebKit deliver a bare `MouseEvent` with no such field,
|
|
343
|
+
* so those fall back to the device recorded at `touchstart`/`mousedown`.
|
|
344
|
+
*
|
|
345
|
+
* Measured, not assumed — see the spike in the PRD (§14.3). The browser's
|
|
346
|
+
* long-press gesture cannot be synthesized through CDP, so this decision is the
|
|
347
|
+
* only part of the touch story an automated test can reach.
|
|
348
|
+
*/
|
|
349
|
+
private isTouchContextMenu;
|
|
350
|
+
/**
|
|
351
|
+
* Does the editor's time list use a 12-hour clock?
|
|
352
|
+
*
|
|
353
|
+
* `mp-datetime-picker.hour12` is a boolean, so an unset `timeFormat` has to be
|
|
354
|
+
* resolved rather than read as false — otherwise a US user gets a 24-hour
|
|
355
|
+
* picker inside a scheduler that renders 12-hour times everywhere else.
|
|
356
|
+
* `detectTimeFormat` is the `Intl` probe written for this and, until now,
|
|
357
|
+
* never called from the component.
|
|
358
|
+
*/
|
|
359
|
+
/**
|
|
360
|
+
* The week's first day: the consumer's choice, else the locale's convention.
|
|
361
|
+
* Mirrors `BaseView.firstDayOfWeek` — resolved at the point of use so a later
|
|
362
|
+
* locale change is picked up, never written back into `options`.
|
|
363
|
+
*/
|
|
364
|
+
private firstDayOfWeek;
|
|
365
|
+
private resolvedHour12;
|
|
366
|
+
/**
|
|
367
|
+
* Minute granularity for the editor's time lists, derived from the grid's own
|
|
368
|
+
* `slotDuration` so the two agree — picking a time the grid cannot represent
|
|
369
|
+
* would be its own small lie. Clamped to the picker's supported steps.
|
|
370
|
+
*/
|
|
371
|
+
private pickerStep;
|
|
372
|
+
private renderEventEditor;
|
|
373
|
+
/**
|
|
374
|
+
* "Inherit from resource" drives the swatch's enabled state: while inheriting,
|
|
375
|
+
* the swatch shows WHAT is inherited but cannot be committed, so there is no
|
|
376
|
+
* gesture that silently overrides. Toggled in the DOM rather than through a
|
|
377
|
+
* re-render on purpose — a re-render would re-run the sibling fields' value
|
|
378
|
+
* bindings and could discard a title the user has typed but not saved.
|
|
379
|
+
*/
|
|
380
|
+
private toggleEditorColorInherit;
|
|
381
|
+
/**
|
|
382
|
+
* The editor's WORKING COPY — what the user has typed and picked so far,
|
|
383
|
+
* held in component state instead of being read back out of the DOM when
|
|
384
|
+
* Save runs.
|
|
385
|
+
*
|
|
386
|
+
* This is the fix for B31, not a tidiness exercise. The panel's controls are
|
|
387
|
+
* Lit bindings fed from the STORED event, and the scheduler re-renders on any
|
|
388
|
+
* state change — including the one that a mousedown on Save itself provokes.
|
|
389
|
+
* The controls were therefore reset to the stored values *between mousedown
|
|
390
|
+
* and click*, and Save, which scraped the DOM, committed those stale values
|
|
391
|
+
* and silently discarded the edit. With the draft as the single authority for
|
|
392
|
+
* both the render and the commit, a re-render can no longer lose an edit.
|
|
393
|
+
* Keyboard move-mode has always worked this way (`keyboardMove`).
|
|
394
|
+
*/
|
|
395
|
+
private editorDraft;
|
|
396
|
+
/** Merge a change into the draft and re-render the panel from it. */
|
|
397
|
+
private updateEditorDraft;
|
|
398
|
+
private editorErrorFieldTouched;
|
|
399
|
+
/**
|
|
400
|
+
* Changing the START moves the event: the end shifts by the same delta, so
|
|
401
|
+
* the duration is preserved (B30/D12.10). This is the contract every other
|
|
402
|
+
* path already implements — a pointer move-drag applies one offset to both
|
|
403
|
+
* edges, and so does keyboard move-mode. Without it, moving an event later
|
|
404
|
+
* in the editor hit "End must be after start" and refused to do anything,
|
|
405
|
+
* which is a dead end on the field a user edits first.
|
|
406
|
+
*
|
|
407
|
+
* Changing the END is left alone: that is a resize, and the only way to
|
|
408
|
+
* express one here.
|
|
409
|
+
*
|
|
410
|
+
* A corollary worth stating, because the opposite looks like an oversight:
|
|
411
|
+
* while it is a move, the START picker carries NO `max`. Duration is an
|
|
412
|
+
* invariant of that transform, so a valid draft stays valid after any start
|
|
413
|
+
* change in either direction — start-after-end is unreachable, and a bound
|
|
414
|
+
* there would only refuse legitimate picks (D12.12/F1).
|
|
415
|
+
*
|
|
416
|
+
* When the user may resize but NOT move (D12.13's row 3), a start change is
|
|
417
|
+
* a start-RESIZE instead: the end holds still and the start is clamped to
|
|
418
|
+
* one slot before it, mirroring the end field's clamp. The draft cannot
|
|
419
|
+
* invert either way, so the two semantics differ only in what they mean.
|
|
420
|
+
*/
|
|
421
|
+
private onEditorStartChange;
|
|
422
|
+
/**
|
|
423
|
+
* The end alone is a RESIZE — it never drags the start with it.
|
|
424
|
+
*
|
|
425
|
+
* It is also the only edge that can invert the range (D12.12): a start
|
|
426
|
+
* change preserves duration, so it keeps a valid draft valid, but an end
|
|
427
|
+
* can be picked before the start. The END picker therefore carries
|
|
428
|
+
* `min = draft.start`, which the CALENDAR half honours date-only — exactly
|
|
429
|
+
* the wanted semantic, since "the same day" must stay fully selectable —
|
|
430
|
+
* and this clamp covers what a bound cannot: the same-day-earlier-time
|
|
431
|
+
* case, and the picker's Today/Now buttons, which ignore bounds entirely.
|
|
432
|
+
*
|
|
433
|
+
* Clamping the field the user just edited is deliberate. Adjusting the
|
|
434
|
+
* OTHER edge instead would change a control they are not focused on
|
|
435
|
+
* (a WCAG 3.2.2 hazard); this corrects their own field and says so.
|
|
436
|
+
*
|
|
437
|
+
* The floor is one grid slot, matching keyboard resize — the editor could
|
|
438
|
+
* otherwise commit a 1-minute event on a 30-minute grid, which no direct
|
|
439
|
+
* gesture can produce.
|
|
440
|
+
*/
|
|
441
|
+
private onEditorEndChange;
|
|
442
|
+
/**
|
|
443
|
+
* The editor's inherit checkbox. `<mp-checkbox>` rather than a bare input so
|
|
444
|
+
* it carries Bootstrap's `.form-check` styling into this shadow root; its
|
|
445
|
+
* `checked`/`disabled` are host properties, so it is read like a native one —
|
|
446
|
+
* but it is NOT an `HTMLInputElement`, hence its own accessor.
|
|
447
|
+
*/
|
|
448
|
+
private editorInheritCheckbox;
|
|
449
|
+
/**
|
|
450
|
+
* Save = the same `event-update` request a committed drag emits, so the
|
|
451
|
+
* consumer's existing handler applies it unchanged. Only fields whose inputs
|
|
452
|
+
* were ENABLED are read back — a disabled field keeps the event's value, so
|
|
453
|
+
* a permission can never be bypassed by a form submit. Validation stays
|
|
454
|
+
* minimal (end > start, non-empty title): the WC owns no data; anything
|
|
455
|
+
* richer belongs in the consumer's listener.
|
|
456
|
+
*/
|
|
457
|
+
private saveEventEditor;
|
|
458
|
+
/**
|
|
459
|
+
* Refuse a Save, and make sure the reason is spoken EXACTLY once (D12.14).
|
|
460
|
+
*
|
|
461
|
+
* The message goes to one channel only — the offending control's own
|
|
462
|
+
* accessible description — and is delivered by moving focus there. It used
|
|
463
|
+
* to go to two (a `role="alert"` node AND the polite live announcer), which
|
|
464
|
+
* screen readers speak twice, often at two different urgencies. The
|
|
465
|
+
* announcer is the wrong channel here for a second reason: it self-clears
|
|
466
|
+
* after 1.5 s, so it cannot hold a message the user may want to re-read,
|
|
467
|
+
* which is exactly what a validation error is. It stays on the SUCCESS
|
|
468
|
+
* path, where the message is transient by nature.
|
|
469
|
+
*
|
|
470
|
+
* Focus has to move for the same reason: with no live region, a description
|
|
471
|
+
* is silent until something lands on the control it describes.
|
|
472
|
+
*/
|
|
473
|
+
private refuseSave;
|
|
474
|
+
/** Mouse face of the rename: double-click the title span. */
|
|
475
|
+
private handleNativeDblClick;
|
|
476
|
+
/**
|
|
477
|
+
* Swap a resource/group title for an inline input — file-manager's proven
|
|
478
|
+
* idiom, keys included: Enter commits, Escape cancels, blur commits. The
|
|
479
|
+
* commit is a `resource-update` request carrying `{ title }`; the consumer
|
|
480
|
+
* applies it (the same contract as the colour swatch). No re-render happens
|
|
481
|
+
* while the input is open — nothing writes state until commit — so the input
|
|
482
|
+
* cannot be torn down mid-word.
|
|
483
|
+
*/
|
|
484
|
+
private beginResourceRename;
|
|
485
|
+
/** The in-grid pointer delete (D12.4b's revised home). */
|
|
486
|
+
private deleteFromEditor;
|
|
135
487
|
/**
|
|
136
488
|
* Route a "+N more" activation through `options.moreLinkBehavior`. Returns the
|
|
137
489
|
* date to drill to when the caller should navigate, or null when the behaviour
|
|
@@ -153,11 +505,24 @@ export declare class MpScheduler extends LitElement {
|
|
|
153
505
|
private observeHeaderWidth;
|
|
154
506
|
private renderView;
|
|
155
507
|
private onStateChange;
|
|
508
|
+
/** The view the `scheduler-kbd-grid` description was last rendered for. */
|
|
509
|
+
private keymapView;
|
|
156
510
|
private previousIsLoading;
|
|
157
511
|
private detectAndEmitChanges;
|
|
512
|
+
/**
|
|
513
|
+
* Re-apply the header's localized labels.
|
|
514
|
+
*
|
|
515
|
+
* The chrome is built imperatively once, in `firstUpdated`, so its button text
|
|
516
|
+
* froze at whatever `options.messages` held at that moment. The TITLE updated
|
|
517
|
+
* on every state change and the buttons did not, so switching language at
|
|
518
|
+
* runtime produced a half-translated header — Dutch dates over English
|
|
519
|
+
* buttons. Cheap enough to redo unconditionally: eight string assignments.
|
|
520
|
+
*/
|
|
521
|
+
private applyHeaderLabels;
|
|
158
522
|
private updateUI;
|
|
159
523
|
private scheduleDragUpdate;
|
|
160
524
|
private handlePointerDown;
|
|
525
|
+
private allowsGesture;
|
|
161
526
|
private handlePointerMove;
|
|
162
527
|
private handlePointerUp;
|
|
163
528
|
/** Distance from a scroller edge at which auto-scroll engages. */
|
|
@@ -226,9 +591,32 @@ export declare class MpScheduler extends LitElement {
|
|
|
226
591
|
* to the host. Use composedPath()[0] for the actual focused element.
|
|
227
592
|
*/
|
|
228
593
|
private handleFocusIn;
|
|
594
|
+
/**
|
|
595
|
+
* Is this key event coming from inside one of the open panels?
|
|
596
|
+
*
|
|
597
|
+
* The dialogs are deliberately NON-modal, which invites the user to Shift+Tab
|
|
598
|
+
* back to the grid while one is open. The guards below used to return
|
|
599
|
+
* unconditionally on `isOpen`, so every arrow, Enter and Escape in the grid
|
|
600
|
+
* was swallowed and the widget read as broken (audit M12). Claiming keys only
|
|
601
|
+
* when focus is actually inside the panel fixes that without weakening the
|
|
602
|
+
* Escape arbitration, which is the reason the guards exist.
|
|
603
|
+
*/
|
|
604
|
+
private eventInsidePanel;
|
|
229
605
|
private handleKeyDown;
|
|
230
606
|
/** Keyboard face of the more-link / year-month-header click delegation. */
|
|
231
607
|
private activateFocusedDrillControl;
|
|
608
|
+
/**
|
|
609
|
+
* Drill into `view` at `date` from a control that the resulting rebuild will
|
|
610
|
+
* destroy — which is every drill-down control, by definition.
|
|
611
|
+
*
|
|
612
|
+
* The focus restore has to happen HERE rather than being left to the view
|
|
613
|
+
* switch. `setDate` rebuilds the current view first, and that rebuild already
|
|
614
|
+
* drops focus to `<body>`; by the time the switch looks for something worth
|
|
615
|
+
* restoring, there is nothing focused inside the widget and it correctly
|
|
616
|
+
* declines to steal focus from wherever it went. So the switch's own
|
|
617
|
+
* restoration can never cover this path.
|
|
618
|
+
*/
|
|
619
|
+
private drillTo;
|
|
232
620
|
private getFocusedKind;
|
|
233
621
|
private handleAltShortcut;
|
|
234
622
|
/**
|
|
@@ -239,6 +627,12 @@ export declare class MpScheduler extends LitElement {
|
|
|
239
627
|
* render that decides whether to draw an affordance.
|
|
240
628
|
*/
|
|
241
629
|
private can;
|
|
630
|
+
/**
|
|
631
|
+
* "May this edge be dragged?" — for the three DIRECT-MANIPULATION surfaces
|
|
632
|
+
* only (resize handles, the pointer gesture, Shift/Alt+Shift+Arrow), where
|
|
633
|
+
* the edge belongs to the gesture. Everything else asks `can('resizeEvent')`.
|
|
634
|
+
*/
|
|
635
|
+
private canResizeEdge;
|
|
242
636
|
/** Recompute the resolved table onto state so views can gate affordances. */
|
|
243
637
|
private syncPermissions;
|
|
244
638
|
/**
|
|
@@ -342,7 +736,34 @@ export declare class MpScheduler extends LitElement {
|
|
|
342
736
|
private commitFocusMove;
|
|
343
737
|
private cellIsWithinView;
|
|
344
738
|
private parseTimeOnDay;
|
|
345
|
-
|
|
739
|
+
/**
|
|
740
|
+
* Walk the timeline's RENDERED row order: visible leaf resources, then the
|
|
741
|
+
* bucket row when it exists — the same list the view draws, so keyboard
|
|
742
|
+
* navigation can reach everything the eye can see (B25).
|
|
743
|
+
*
|
|
744
|
+
* Tri-state result: a string is the next resource row, `null` is the bucket
|
|
745
|
+
* row, `undefined` means "no move" (already at the edge, or nothing to walk).
|
|
746
|
+
* The old version returned `null` for BOTH of the last two, which is exactly
|
|
747
|
+
* why the bucket was unreachable by keyboard.
|
|
748
|
+
*/
|
|
749
|
+
private adjacentRow;
|
|
750
|
+
/**
|
|
751
|
+
* The rows a keyboard user can land on, in the order the timeline draws them.
|
|
752
|
+
*
|
|
753
|
+
* `includeGroups` is the whole difference between navigating and moving.
|
|
754
|
+
* Arrow keys navigate, and a group row is a real row with real gridcells that
|
|
755
|
+
* can even hold the grid's only tab stop — skipping it is what made the first
|
|
756
|
+
* arrow press teleport the user to an unrelated row (audit M10). Move-mode
|
|
757
|
+
* carries an event with it, and a group row renders no events container, so a
|
|
758
|
+
* group must never be offered as a destination there.
|
|
759
|
+
*/
|
|
760
|
+
private navigableRows;
|
|
761
|
+
/**
|
|
762
|
+
* Title of any row, group rows included. `getAllResources` returns leaves
|
|
763
|
+
* only by design, so while that was the lookup, arrowing onto a group row
|
|
764
|
+
* announced the time with no row name at all — swapping M10's teleport for a
|
|
765
|
+
* silent row rather than fixing it.
|
|
766
|
+
*/
|
|
346
767
|
private getResourceTitle;
|
|
347
768
|
/**
|
|
348
769
|
* Find the cell DOM element for a (slot, resource) pair and call .focus()
|
|
@@ -350,7 +771,29 @@ export declare class MpScheduler extends LitElement {
|
|
|
350
771
|
* drag-near-edge auto-pan (PRD D6).
|
|
351
772
|
*/
|
|
352
773
|
private scrollAndFocusCell;
|
|
774
|
+
/**
|
|
775
|
+
* Resolve the grid cell for a (time, row) pair. Bucket-aware: on the
|
|
776
|
+
* timeline, `null` means the unassigned row, whose slots carry
|
|
777
|
+
* `data-unassigned` instead of a resource id — the old null branch looked up
|
|
778
|
+
* `.scheduler-time-slot`, which belongs to week/day and found nothing there,
|
|
779
|
+
* so keyboard focus could never land in the bucket row (B25).
|
|
780
|
+
*/
|
|
781
|
+
private timeCellElement;
|
|
353
782
|
/** Re-focus whatever cell the keyboard model currently considers focused. */
|
|
783
|
+
/**
|
|
784
|
+
* Put focus back inside the grid after a rebuild or a view switch.
|
|
785
|
+
*
|
|
786
|
+
* The fallback is the point. `focusedCell` is null whenever the user never
|
|
787
|
+
* entered the grid, and after a view switch it can name a cell the new view
|
|
788
|
+
* does not render — in both cases this used to do nothing at all and focus
|
|
789
|
+
* stayed on `<body>`. That is reachable from every drill-down control (the
|
|
790
|
+
* week day-number, the more-link, the year month-header): activating one
|
|
791
|
+
* destroys the element the user is standing on by definition, since it
|
|
792
|
+
* rebuilds the view underneath them.
|
|
793
|
+
*
|
|
794
|
+
* Every view promotes exactly one cell to `tabindex="0"` as its roving tab
|
|
795
|
+
* stop, so that cell is the correct "wherever this view considers current".
|
|
796
|
+
*/
|
|
354
797
|
private focusFocusedCell;
|
|
355
798
|
/**
|
|
356
799
|
* Parse a `YYYY-MM-DD` day key as a LOCAL date.
|
|
@@ -399,7 +842,7 @@ export declare class MpScheduler extends LitElement {
|
|
|
399
842
|
private minutesPerSlot;
|
|
400
843
|
/** Shift the working event by `deltaMs` along the time axis (preserves duration). */
|
|
401
844
|
private nudgeKeyboardMove;
|
|
402
|
-
/** Walk to the next/previous
|
|
845
|
+
/** Walk to the next/previous row (timeline only). Updates the preview's resourceId. */
|
|
403
846
|
private nudgeKeyboardMoveResource;
|
|
404
847
|
/**
|
|
405
848
|
* Resize one edge of the working event. Clamps to a minimum duration of
|
|
@@ -48,6 +48,20 @@ export interface InputHandlerConfig {
|
|
|
48
48
|
export declare class InputHandler {
|
|
49
49
|
private readonly config;
|
|
50
50
|
private readonly callbacks;
|
|
51
|
+
/**
|
|
52
|
+
* Which device produced the gesture in progress.
|
|
53
|
+
*
|
|
54
|
+
* `contextmenu` cannot be trusted to say so itself: Chromium delivers it as a
|
|
55
|
+
* `PointerEvent` carrying `pointerType`, but Firefox and WebKit send a bare
|
|
56
|
+
* `MouseEvent` with no such field. Recording it where the gesture actually
|
|
57
|
+
* starts is the only engine-independent answer, and the scheduler needs one —
|
|
58
|
+
* a touch `contextmenu` must yield to hold-to-drag rather than open the editor.
|
|
59
|
+
*
|
|
60
|
+
* Pen is deliberately NOT tracked as touch: a stylus drives the mouse path
|
|
61
|
+
* (`mousedown`/`mousemove` with its 5px threshold), never the hold, so it wants
|
|
62
|
+
* the desktop context menu.
|
|
63
|
+
*/
|
|
64
|
+
private lastPointerType;
|
|
51
65
|
private touchHoldTimer;
|
|
52
66
|
private touchStartPosition;
|
|
53
67
|
private isTouchDragMode;
|
|
@@ -68,6 +82,14 @@ export declare class InputHandler {
|
|
|
68
82
|
private readonly boundHandleTouchEnd;
|
|
69
83
|
private readonly boundHandleTouchCancel;
|
|
70
84
|
constructor(config: InputHandlerConfig, callbacks: InputHandlerCallbacks);
|
|
85
|
+
/**
|
|
86
|
+
* True when the gesture in progress came from a finger.
|
|
87
|
+
*
|
|
88
|
+
* The caller is `contextmenu` arbitration: on touch the browser fires that
|
|
89
|
+
* event ~100ms before our 600ms hold arms, so acting on it would make
|
|
90
|
+
* hold-to-drag unreachable.
|
|
91
|
+
*/
|
|
92
|
+
isTouchGesture(): boolean;
|
|
71
93
|
/**
|
|
72
94
|
* Attach all event listeners.
|
|
73
95
|
*/
|
|
@@ -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
|
*/
|