@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.
Files changed (44) hide show
  1. package/a11y/index.mjs +9 -8
  2. package/checkbox/index.mjs +1 -1
  3. package/chunks/error-text-B45eDAt1.mjs +17 -0
  4. package/chunks/{form-associated-axmc5sY0.mjs → form-associated-BR-fUvZ1.mjs} +11 -26
  5. package/chunks/{id-D5QCG603.mjs → id-BstjfRrz.mjs} +97 -72
  6. package/chunks/{mp-checkbox-Ph2mMRGz.mjs → mp-checkbox-6EJwdUIn.mjs} +6 -5
  7. package/chunks/{mp-datatable-BwTlh9A_.mjs → mp-datatable-25O1GtvU.mjs} +1 -1
  8. package/chunks/mp-datetime-picker.element-MPTRHwyc.mjs +530 -0
  9. package/chunks/{mp-radio-BjW1HNSc.mjs → mp-radio-DvKgrTFL.mjs} +2 -2
  10. package/chunks/{mp-select-Ctu-v1-p.mjs → mp-select-CKX0eM5C.mjs} +5 -4
  11. package/chunks/{mp-timepicker.element-Bz393NDQ.mjs → mp-timepicker.element-COZEUIoE.mjs} +56 -52
  12. package/chunks/{mp-toggle-button-Kz6sIgBJ.mjs → mp-toggle-button-C4Loq_p4.mjs} +5 -4
  13. package/chunks/{overlay-controller-DPt13i8p.mjs → overlay-controller-D6agzzOI.mjs} +19 -4
  14. package/datatable/index.mjs +1 -1
  15. package/datepicker/index.mjs +1 -1
  16. package/datetime-picker/index.mjs +2 -431
  17. package/datetime-picker/src/mp-datetime-picker.element.d.ts +66 -0
  18. package/file-manager/index.mjs +1 -1
  19. package/navbar/index.mjs +1 -1
  20. package/otp-input/index.mjs +4 -3
  21. package/overlay/index.mjs +1 -1
  22. package/overlay/src/overlay-controller.d.ts +13 -0
  23. package/package.json +1 -1
  24. package/query-builder/index.mjs +2 -2
  25. package/radio/index.mjs +1 -1
  26. package/radio-group/index.mjs +2 -2
  27. package/ribbon/index.mjs +1 -1
  28. package/scheduler/index.mjs +1996 -813
  29. package/scheduler/src/components/mp-scheduler.d.ts +269 -11
  30. package/scheduler/src/state/scheduler-state.d.ts +10 -0
  31. package/scheduler/src/views/timeline-view.d.ts +51 -3
  32. package/scheduler/src/views/year-view.d.ts +4 -2
  33. package/scheduler-core/index.mjs +9 -8
  34. package/scheduler-core/src/models/event.d.ts +6 -2
  35. package/scheduler-core/src/models/messages.d.ts +60 -0
  36. package/scheduler-core/src/models/options.d.ts +22 -6
  37. package/scheduler-core/src/models/permissions.d.ts +35 -4
  38. package/scheduler-core/src/models/time-slot.d.ts +11 -6
  39. package/select/index.mjs +1 -1
  40. package/timepicker/index.mjs +4 -3
  41. package/timepicker/src/mp-time-list.element.d.ts +44 -7
  42. package/timepicker/src/mp-timepicker.element.d.ts +5 -0
  43. package/toggle-button/index.mjs +1 -1
  44. package/tree-select/index.mjs +1 -1
@@ -19,12 +19,30 @@ export interface SchedulerPermissions {
19
19
  createEvent: boolean;
20
20
  /** Move an existing event in time (or across resources on the timeline). */
21
21
  moveEvent: boolean;
22
- /** Drag/keyboard the START edge. Supersedes the never-implemented `eventStartEditable`. */
23
- resizeEventStart: boolean;
24
- /** Drag/keyboard the END edge. Supersedes the never-implemented `eventDurationEditable`. */
25
- resizeEventEnd: boolean;
22
+ /**
23
+ * Drag/keyboard either edge — one flag, not two.
24
+ *
25
+ * Supersedes `resizeEventStart` / `resizeEventEnd`, which were a misreading
26
+ * of FullCalendar: its `eventStartEditable` means "start editable **through
27
+ * dragging**" (our `moveEvent`), and `eventDurationEditable` covers resize
28
+ * as ONE flag for both edges. Splitting it globally answered a question
29
+ * nobody asks — "no user may ever resize any start edge" — while making an
30
+ * asymmetric commit constructible (B35).
31
+ *
32
+ * Per-edge locking still exists where it belongs: on the ITEM, as
33
+ * `SchedulerEvent.resizable`'s `{ start, end }` form. That is data-dependent
34
+ * ("this shift already clocked in; its start is pinned, you may still extend
35
+ * it"), which is exactly what a per-item flag is for. See `resolveResizeEdge`.
36
+ */
37
+ resizeEvent: boolean;
26
38
  /** Delete/Backspace on a focused event. */
27
39
  deleteEvent: boolean;
40
+ /**
41
+ * Edit an event's non-geometric fields (title, colour) through the built-in
42
+ * event editor. The editor's start/end fields follow `moveEvent` and the
43
+ * resize capabilities instead — time is time, whichever surface changes it.
44
+ */
45
+ editEvent: boolean;
28
46
  /** Extend a multi-cell time range with Shift+Arrow or a slot drag. */
29
47
  selectRange: boolean;
30
48
  /** Add a resource row (timeline). Off by default — see the PRD. */
@@ -81,3 +99,16 @@ export declare function resolveCapability(capability: SchedulerCapability, opts:
81
99
  permissions?: boolean | Partial<SchedulerPermissions>;
82
100
  event?: SchedulerEvent | null;
83
101
  }): boolean;
102
+ /**
103
+ * May this event be resized *from this edge*?
104
+ *
105
+ * Only the three direct-manipulation surfaces ask — the resize handles, the
106
+ * pointer gesture, and Shift+Arrow vs Alt+Shift+Arrow — because there the edge
107
+ * is a property of the **gesture**, not of the permission. Everything else
108
+ * asks `resolveCapability('resizeEvent', …)`.
109
+ */
110
+ export declare function resolveResizeEdge(edge: 'start' | 'end', opts: {
111
+ readonly?: boolean;
112
+ permissions?: boolean | Partial<SchedulerPermissions>;
113
+ event?: SchedulerEvent | null;
114
+ }): boolean;
@@ -9,13 +9,18 @@ export interface TimeSlot {
9
9
  /**
10
10
  * Resource the slot belongs to, for views with a resource axis (timeline).
11
11
  *
12
- * Carried so a pointer create-drag can report WHICH row it happened in:
13
- * without it `event-create` always emitted `resourceId: undefined`, and the
14
- * created event landed nowhere the user was pointing. `undefined` on
15
- * week/day/month/year, which have no resource axis, and on the timeline's
16
- * unassigned bucket row.
12
+ * Carried so a pointer drag can report WHICH row it is happening in:
13
+ * without it `event-create` always emitted `resourceId: undefined`, and a
14
+ * move-drag could not change rows at all.
15
+ *
16
+ * TRI-STATE, deliberately: `undefined` means "this view has no resource
17
+ * axis" (week/day/month/year), `null` means "the timeline's unassigned
18
+ * bucket row". The two must stay distinguishable — collapsing them is what
19
+ * made a drop onto the bucket indistinguishable from a week-view drag, so
20
+ * an event could never be UN-assigned by pointer. Matches the idiom of
21
+ * `eventsByResource: Map<string | null, …>`.
17
22
  */
18
- resourceId?: string;
23
+ resourceId?: string | null;
19
24
  }
20
25
  /**
21
26
  * A row of time slots with associated metadata
package/select/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { M as p } from "../chunks/mp-select-Ctu-v1-p.mjs";
1
+ import { M as p } from "../chunks/mp-select-CKX0eM5C.mjs";
2
2
  export {
3
3
  p as MpSelect
4
4
  };
@@ -1,5 +1,6 @@
1
- import { M as i, a as p } from "../chunks/mp-timepicker.element-Bz393NDQ.mjs";
1
+ import { M as a, a as i, m as s } from "../chunks/mp-timepicker.element-COZEUIoE.mjs";
2
2
  export {
3
- i as MpTimeListElement,
4
- p as MpTimepickerElement
3
+ a as MpTimeListElement,
4
+ i as MpTimepickerElement,
5
+ s as minutesOfDay
5
6
  };
@@ -1,6 +1,17 @@
1
1
  import { LitElement, TemplateResult } from 'lit';
2
2
  export type TimeStep = 1 | 5 | 10 | 15 | 30 | 60;
3
3
  export type Hour12Mode = boolean | 'auto';
4
+ /**
5
+ * A `Date`'s time-of-day as minutes from midnight, for feeding
6
+ * `mp-time-list`'s `minMinutes` / `maxMinutes`.
7
+ *
8
+ * Exported because every composite that owns a time list has to make this
9
+ * conversion, and each one has to decide FIRST whether its bound is a
10
+ * time-of-day (`mp-timepicker`: convert unconditionally) or a datetime
11
+ * (`mp-datetime-picker`: convert only on the bound's own day, `null`
12
+ * otherwise). Naming the step makes that decision visible at the call site.
13
+ */
14
+ export declare function minutesOfDay(d: Date | null | undefined): number | null;
4
15
  /**
5
16
  * mp-time-list — Bootstrap-styled time-slot listbox primitive.
6
17
  *
@@ -33,11 +44,13 @@ export declare class MpTimeListElement extends LitElement {
33
44
  type: NumberConstructor;
34
45
  reflect: boolean;
35
46
  };
36
- min: {
37
- attribute: boolean;
47
+ minMinutes: {
48
+ attribute: string;
49
+ type: NumberConstructor;
38
50
  };
39
- max: {
40
- attribute: boolean;
51
+ maxMinutes: {
52
+ attribute: string;
53
+ type: NumberConstructor;
41
54
  };
42
55
  hour12: {
43
56
  attribute: string;
@@ -53,13 +66,37 @@ export declare class MpTimeListElement extends LitElement {
53
66
  };
54
67
  selectedTime: Date | null;
55
68
  step: TimeStep;
56
- min: Date | null;
57
- max: Date | null;
69
+ /**
70
+ * Earliest / latest selectable slot, as **minutes from midnight** — this
71
+ * element is a pure time-of-day primitive and now says so in its types.
72
+ *
73
+ * They were `min`/`max: Date`, which read like datetime bounds but were
74
+ * compared time-of-day only. That ambiguity is not theoretical: a composite
75
+ * editing a range across two days would grey out the same clock range on
76
+ * *every* day, and `mp-timepicker`'s consumers legitimately pass
77
+ * `new Date(2020, 0, 1, 18, 0)` meaning simply "18:00", which any date-aware
78
+ * reading would disable outright. A `Date` can be mistaken for a datetime
79
+ * bound; `minMinutes: 480` cannot. Deriving the per-day value is the
80
+ * COMPOSITE's job — see `mp-datetime-picker`.
81
+ */
82
+ minMinutes: number | null;
83
+ maxMinutes: number | null;
58
84
  hour12: Hour12Mode;
59
85
  locale: string | undefined;
60
86
  private _focusedMinutes;
61
87
  private readonly instanceId;
62
- /** One tab stop for the whole list; arrows move focus AND the tab stop. */
88
+ /**
89
+ * One tab stop for the whole list; arrows move focus AND the tab stop.
90
+ *
91
+ * `isDisabled: () => false` keeps out-of-range slots IN the traversal —
92
+ * APG-correct (a disabled option should be discoverable, so the user learns
93
+ * the bound exists rather than watching keys do nothing) and consistent with
94
+ * `mp-calendar`, which one popup away was already doing it this way. It is
95
+ * also load-bearing: `moveTo` refuses a disabled target, so with the default
96
+ * predicate PageUp/PageDown became a swallowed keypress the moment bounds
97
+ * were passed — it `preventDefault()`s, then bails. Selection is still
98
+ * refused, in `selectMinutes`, which is where the rule belongs.
99
+ */
63
100
  private readonly roving;
64
101
  connectedCallback(): void;
65
102
  disconnectedCallback(): void;
@@ -78,6 +78,11 @@ export declare class MpTimepickerElement extends LitElement {
78
78
  };
79
79
  selectedTime: Date | null;
80
80
  step: TimeStep;
81
+ /**
82
+ * Earliest / latest selectable time. **Time-of-day only** — the date half is
83
+ * ignored, so `new Date(2020, 0, 1, 18, 0)` simply means "18:00", which is
84
+ * how this component's consumers have always used it.
85
+ */
81
86
  min: Date | null;
82
87
  max: Date | null;
83
88
  hour12: Hour12Mode;
@@ -1,4 +1,4 @@
1
- import { M as e, t as g } from "../chunks/mp-toggle-button-Kz6sIgBJ.mjs";
1
+ import { M as e, t as g } from "../chunks/mp-toggle-button-C4Loq_p4.mjs";
2
2
  export {
3
3
  e as MpToggleButton,
4
4
  g as toggleButtonStyles
@@ -1,6 +1,6 @@
1
1
  import { unsafeCSS as c, LitElement as u, html as a, nothing as o } from "lit";
2
2
  import { repeat as p } from "lit/directives/repeat.js";
3
- import { O as b } from "../chunks/overlay-controller-DPt13i8p.mjs";
3
+ import { O as b } from "../chunks/overlay-controller-D6agzzOI.mjs";
4
4
  import { L as m } from "../chunks/live-announcer-Bi0orG4n.mjs";
5
5
  import { d as _ } from "../chunks/focus-restore-DxuP1Oe2.mjs";
6
6
  import { H as f } from "../chunks/host-aria-WSGs7SPQ.mjs";