@mintplayer/web-components 2.2.0 → 2.4.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 (115) hide show
  1. package/a11y/index.mjs +26 -2
  2. package/a11y/src/dismiss-stack.d.ts +25 -0
  3. package/a11y/src/error-text.d.ts +41 -0
  4. package/a11y/src/focus-restore.d.ts +116 -0
  5. package/a11y/src/focus-trap.d.ts +69 -0
  6. package/a11y/src/form-associated.d.ts +48 -0
  7. package/a11y/src/host-aria.d.ts +154 -0
  8. package/a11y/src/index.d.ts +16 -0
  9. package/a11y/src/inert-regions.d.ts +52 -0
  10. package/a11y/src/live-announcer.d.ts +8 -0
  11. package/a11y/src/roving-focus.d.ts +118 -0
  12. package/a11y/src/testing/expect-idref-resolves.d.ts +31 -0
  13. package/a11y/src/testing/index.d.ts +1 -0
  14. package/accordion/index.mjs +180 -174
  15. package/accordion/src/components/mp-accordion.d.ts +18 -13
  16. package/calendar/index.mjs +1 -1
  17. package/calendar/src/mp-calendar.element.d.ts +2 -0
  18. package/carousel/index.mjs +211 -164
  19. package/carousel/src/components/mp-carousel.d.ts +1 -0
  20. package/checkbox/index.mjs +1 -1
  21. package/checkbox/src/components/mp-checkbox.d.ts +59 -1
  22. package/chunks/color-CpFtrIoX.mjs +899 -0
  23. package/chunks/focus-restore-DxuP1Oe2.mjs +94 -0
  24. package/chunks/focus-trap-DTOLJ5bb.mjs +121 -0
  25. package/chunks/form-associated-axmc5sY0.mjs +58 -0
  26. package/chunks/host-aria-WSGs7SPQ.mjs +152 -0
  27. package/chunks/inert-regions-DXCnn1LN.mjs +48 -0
  28. package/chunks/invalid-feedback.styles-he0JYrJm.mjs +11 -0
  29. package/chunks/{live-announcer-CZDTKulf.mjs → live-announcer-Bi0orG4n.mjs} +9 -9
  30. package/chunks/{mp-calendar.element-UC68iDbi.mjs → mp-calendar.element-u6uS31_j.mjs} +136 -105
  31. package/chunks/mp-checkbox-Ph2mMRGz.mjs +312 -0
  32. package/chunks/{mp-datatable-Bfw0KGkV.mjs → mp-datatable-BwTlh9A_.mjs} +265 -103
  33. package/chunks/{mp-pagination-BGxsawFL.mjs → mp-pagination-Dea75mD4.mjs} +25 -22
  34. package/chunks/mp-radio-BjW1HNSc.mjs +300 -0
  35. package/chunks/{mp-select-BDS1-YGn.mjs → mp-select-Ctu-v1-p.mjs} +163 -40
  36. package/chunks/{mp-splitter-C8cGCmac.mjs → mp-splitter-LszuRDbR.mjs} +53 -46
  37. package/chunks/{mp-tab-page-D1b4x-y2.mjs → mp-tab-page-CaCzX1ym.mjs} +46 -45
  38. package/chunks/{mp-timepicker.element-BwEiwX92.mjs → mp-timepicker.element-Bz393NDQ.mjs} +93 -86
  39. package/chunks/{mp-toggle-button-dLZNDUVz.mjs → mp-toggle-button-Kz6sIgBJ.mjs} +131 -37
  40. package/chunks/{mp-treeview-C48F63xb.mjs → mp-treeview-tkWu28iF.mjs} +67 -43
  41. package/chunks/overlay-controller-DPt13i8p.mjs +314 -0
  42. package/chunks/roving-focus-CrL9982a.mjs +129 -0
  43. package/code-snippet/index.mjs +21 -13
  44. package/code-snippet/src/mp-code-snippet.element.d.ts +6 -0
  45. package/datatable/index.mjs +1 -1
  46. package/datatable/src/components/mp-datatable.d.ts +50 -0
  47. package/datatable/src/types/index.d.ts +2 -0
  48. package/datatable/src/types/labels.d.ts +30 -0
  49. package/datepicker/index.mjs +45 -22
  50. package/datepicker/src/mp-datepicker.element.d.ts +30 -0
  51. package/datetime-picker/index.mjs +15 -9
  52. package/dock/index.mjs +365 -209
  53. package/dock/src/components/mint-dock-manager.element.d.ts +63 -3
  54. package/dropdown-menu/index.mjs +135 -90
  55. package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +12 -3
  56. package/file-manager/index.mjs +279 -214
  57. package/file-manager/src/components/mp-file-manager.d.ts +22 -0
  58. package/file-manager/src/types/messages.d.ts +9 -0
  59. package/multi-range/index.mjs +26 -10
  60. package/multi-range/src/mint-multi-range.element.d.ts +7 -0
  61. package/navbar/index.mjs +53 -39
  62. package/navbar/src/components/mp-navbar.d.ts +1 -0
  63. package/otp-input/index.mjs +82 -48
  64. package/otp-input/src/mint-otp-input.element.d.ts +31 -3
  65. package/overlay/index.mjs +2 -258
  66. package/overlay/src/overlay-controller.d.ts +64 -4
  67. package/package.json +9 -1
  68. package/pagination/index.mjs +1 -1
  69. package/query-builder/index.mjs +117 -87
  70. package/query-builder/src/model/messages.d.ts +9 -0
  71. package/radio/index.mjs +2 -160
  72. package/radio/src/components/mp-radio.d.ts +58 -3
  73. package/radio-group/index.d.ts +1 -0
  74. package/radio-group/index.mjs +145 -0
  75. package/radio-group/src/components/mp-radio-group.d.ts +52 -0
  76. package/radio-group/src/index.d.ts +1 -0
  77. package/radio-group/src/styles/radio-group.styles.d.ts +2 -0
  78. package/ribbon/index.mjs +316 -304
  79. package/ribbon/src/mp-ribbon.element.d.ts +16 -0
  80. package/scheduler/index.mjs +892 -493
  81. package/scheduler/src/components/mp-scheduler.d.ts +30 -0
  82. package/scheduler/src/input/input-handler.d.ts +2 -0
  83. package/scheduler/src/views/base-view.d.ts +43 -6
  84. package/scheduler/src/views/timeline-view.d.ts +6 -0
  85. package/scheduler-core/index.mjs +73 -70
  86. package/scheduler-core/src/models/index.d.ts +1 -0
  87. package/scheduler-core/src/models/messages.d.ts +69 -0
  88. package/scheduler-core/src/models/options.d.ts +4 -0
  89. package/select/index.mjs +1 -1
  90. package/select/src/components/mp-select.d.ts +60 -3
  91. package/shell/index.mjs +142 -31
  92. package/shell/src/components/mp-shell.d.ts +1 -0
  93. package/signature-pad/index.d.ts +1 -0
  94. package/signature-pad/index.mjs +230 -0
  95. package/signature-pad/src/index.d.ts +2 -0
  96. package/signature-pad/src/mp-signature-pad.element.d.ts +143 -0
  97. package/signature-pad/src/mp-signature-pad.element.template.d.ts +2 -0
  98. package/signature-pad/src/types/signature.d.ts +12 -0
  99. package/splitter/index.mjs +1 -1
  100. package/splitter/src/components/mp-splitter.d.ts +7 -0
  101. package/tab-control/index.mjs +1 -1
  102. package/tile-manager/index.mjs +110 -93
  103. package/timeline/index.mjs +138 -54
  104. package/timeline/src/components/mp-timeline.d.ts +15 -0
  105. package/timepicker/index.mjs +1 -1
  106. package/timepicker/src/mp-time-list.element.d.ts +13 -4
  107. package/timepicker/src/mp-timepicker.element.d.ts +29 -0
  108. package/toggle-button/index.mjs +1 -1
  109. package/toggle-button/src/components/mp-toggle-button.d.ts +32 -1
  110. package/tree-select/index.mjs +233 -121
  111. package/tree-select/src/components/mp-tree-select.d.ts +37 -0
  112. package/treeview/index.mjs +1 -1
  113. package/treeview/src/components/mp-treeview.d.ts +10 -1
  114. package/chunks/color-CyamnJnn.mjs +0 -847
  115. package/chunks/mp-checkbox-BokLL7BS.mjs +0 -211
@@ -54,6 +54,8 @@ export declare class MpScheduler extends LitElement {
54
54
  today(): void;
55
55
  gotoDate(date: Date): void;
56
56
  changeView(view: ViewType): void;
57
+ /** Localized display name of a view (also the view-switcher button text). */
58
+ private viewLabel;
57
59
  /**
58
60
  * Clear the time-range selection and the focused-cell selection. Public
59
61
  * because — per PRD scheduler-controlled-selection — the WC no longer
@@ -66,18 +68,44 @@ export declare class MpScheduler extends LitElement {
66
68
  removeEvent(eventId: string): void;
67
69
  getEventById(eventId: string): SchedulerEvent | null;
68
70
  refetchEvents(): void;
71
+ /**
72
+ * Localized string lookup: options.messages overrides merged onto the
73
+ * English defaults, with {placeholder} interpolation.
74
+ */
75
+ private msg;
69
76
  render(): TemplateResult;
70
77
  protected firstUpdated(): void;
71
78
  private populateHeader;
72
79
  private updateTitle;
80
+ /** Header width below which the layout wraps and the title compacts (D9). */
81
+ private static readonly NARROW_HEADER_WIDTH;
82
+ private headerResizeObserver;
83
+ private headerIsNarrow;
84
+ /**
85
+ * Component-width (not viewport) driven narrow mode — the scheduler can sit
86
+ * in a pane far narrower than the screen (splitter/dock). CSS keys the
87
+ * wrapped layout off [data-narrow]; the title text swap needs JS anyway.
88
+ */
89
+ private observeHeaderWidth;
73
90
  private renderView;
74
91
  private onStateChange;
92
+ private previousIsLoading;
75
93
  private detectAndEmitChanges;
76
94
  private updateUI;
77
95
  private scheduleDragUpdate;
78
96
  private handlePointerDown;
79
97
  private handlePointerMove;
80
98
  private handlePointerUp;
99
+ /**
100
+ * Two activations of the same event within this window = a double
101
+ * click/tap. Native dblclick cannot be relied on here: the first click's
102
+ * selection re-render replaces the event node, which resets the browser's
103
+ * double-click tracking — so `event-dblclick` is synthesized from
104
+ * consecutive activations instead (and works for touch double-tap too).
105
+ */
106
+ private static readonly DBLCLICK_WINDOW_MS;
107
+ private lastEventActivation;
108
+ private registerEventActivation;
81
109
  private handleDragComplete;
82
110
  private handleClick;
83
111
  private handleDoubleClick;
@@ -92,6 +120,8 @@ export declare class MpScheduler extends LitElement {
92
120
  */
93
121
  private handleFocusIn;
94
122
  private handleKeyDown;
123
+ /** Keyboard face of the more-link / year-month-header click delegation. */
124
+ private activateFocusedDrillControl;
95
125
  private getFocusedKind;
96
126
  private handleAltShortcut;
97
127
  private handleEventKeyDown;
@@ -34,6 +34,8 @@ export interface InputHandlerConfig {
34
34
  isEditable: () => boolean;
35
35
  /** Whether selection is enabled */
36
36
  isSelectable: () => boolean;
37
+ /** Whether the given event is the currently-selected one */
38
+ isEventSelected?: (eventId: string) => boolean;
37
39
  /** Touch hold duration in ms before drag activates (default: 500) */
38
40
  touchHoldDuration?: number;
39
41
  /** Movement threshold before touch hold is cancelled (default: 10) */
@@ -1,11 +1,12 @@
1
- import { SchedulerEvent, TimeSlot } from '@mintplayer/web-components/scheduler-core';
1
+ import { SchedulerEvent, SchedulerEventPart, SchedulerOptions, TimeSlot } from '@mintplayer/web-components/scheduler-core';
2
2
  import { SchedulerState } from '../state/scheduler-state';
3
3
  /**
4
4
  * Build the descriptive aria-label for an event block. Used by every view.
5
5
  * Format: "{title}, {start}–{end} on {resource}". Resource is omitted when
6
6
  * the event has no resource or the caller doesn't have it (week/day views).
7
+ * Strings and date formatting follow options.messages / options.locale.
7
8
  */
8
- export declare function formatEventAriaLabel(event: SchedulerEvent, resourceTitle: string | null, timeFormat?: '12h' | '24h'): string;
9
+ export declare function formatEventAriaLabel(event: SchedulerEvent, resourceTitle: string | null, options: SchedulerOptions): string;
9
10
  /**
10
11
  * Normalised selection range — covers anchor.start through extent.end (or
11
12
  * the reverse if the user shift-arrowed backwards), with the resource pinned
@@ -28,22 +29,22 @@ export declare function isSlotInSelection(slot: TimeSlot, state: SchedulerState,
28
29
  * Includes weekday + date so screen readers don't lose the user across
29
30
  * cross-day moves.
30
31
  */
31
- export declare function formatCellAnnouncement(slot: TimeSlot, timeFormat?: '12h' | '24h', resourceTitle?: string | null): string;
32
+ export declare function formatCellAnnouncement(slot: TimeSlot, options: SchedulerOptions, resourceTitle?: string | null): string;
32
33
  /**
33
34
  * Live-region announcement after Shift+Arrow grows or shrinks the range.
34
35
  * Reads "Selection: {start time, day} to {end time, day}, {N} slots".
35
36
  */
36
- export declare function formatSelectionAnnouncement(state: SchedulerState, slotDuration: number, timeFormat?: '12h' | '24h'): string;
37
+ export declare function formatSelectionAnnouncement(state: SchedulerState, slotDuration: number): string;
37
38
  /**
38
39
  * Live-region announcement for an in-progress keyboard event move.
39
40
  */
40
- export declare function formatMoveAnnouncement(start: Date, end: Date, timeFormat?: '12h' | '24h'): string;
41
+ export declare function formatMoveAnnouncement(start: Date, end: Date, options: SchedulerOptions): string;
41
42
  /**
42
43
  * Live-region announcement for an in-progress keyboard event resize. The
43
44
  * `edge` field tells the user which side they're stretching, so they can
44
45
  * tell Shift+ArrowDown (end edge) from Alt+Shift+ArrowDown (start edge).
45
46
  */
46
- export declare function formatResizeAnnouncement(start: Date, end: Date, edge: 'start' | 'end', timeFormat?: '12h' | '24h'): string;
47
+ export declare function formatResizeAnnouncement(start: Date, end: Date, edge: 'start' | 'end', options: SchedulerOptions): string;
47
48
  /**
48
49
  * Base class for scheduler views
49
50
  */
@@ -84,4 +85,40 @@ export declare abstract class BaseView {
84
85
  * Helper to clear container
85
86
  */
86
87
  protected clearContainer(): void;
88
+ /**
89
+ * Append the start/end resize handles for an event part. The handle strip
90
+ * is the pointer hit zone the drag machine targets via
91
+ * closest('.resize-handle'); the glyph inside it is a purely decorative
92
+ * affordance revealed by the .selected class — never focusable, the
93
+ * keyboard resize path lives on the event element (move-mode).
94
+ * Position classes are per-view: ['top','bottom'] for time grids,
95
+ * ['left','right'] for the timeline.
96
+ */
97
+ protected appendResizeHandles(eventEl: HTMLElement, part: SchedulerEventPart, [startClass, endClass]?: [string, string]): void;
98
+ private createResizeHandle;
99
+ /**
100
+ * Retrofit the ARIA grid chain onto a rendered view (wc-aria PRD step 5.7):
101
+ * the container claims `grid`, layout-only wrappers become `presentation`
102
+ * so they stop breaking the chain, the header strip becomes the
103
+ * column-header row, and the cell groups named by `rows` become rows. The
104
+ * cells themselves already carry role="gridcell" + ids + roving tabindex.
105
+ *
106
+ * The mapping is pragmatic, not ideal: week/day DOM is COLUMN-major (a row
107
+ * here is one day's column of time cells), because the layout was built
108
+ * for CSS first. The cells' focus announcements carry full day+time, so
109
+ * navigation stays understandable.
110
+ */
111
+ protected applyGridRoles(config: {
112
+ columnHeaderRow?: string;
113
+ columnHeaders?: string;
114
+ presentation?: string[];
115
+ rows?: string;
116
+ /** Extra gridcells (e.g. a per-row events overlay whose buttons need a
117
+ * cell to live in — rows may not own buttons directly). */
118
+ cells?: string;
119
+ /** Grids where Shift+Arrow extends a multi-cell range (week/day). */
120
+ multiselectable?: boolean;
121
+ }): void;
122
+ /** aria-current="date" on every element the views styled `.today`. */
123
+ protected markToday(): void;
87
124
  }
@@ -16,6 +16,12 @@ export declare class TimelineView extends BaseView {
16
16
  private createResourceRow;
17
17
  private renderEvents;
18
18
  private createEventElement;
19
+ /**
20
+ * Dashed ghost showing where the dragged event will land, rendered in the
21
+ * dragged event's own resource row (pointer drags don't change resource).
22
+ * Mirrors week-view.renderPreviewEvent for the horizontal axis.
23
+ */
24
+ private renderPreviewEvent;
19
25
  update(state: SchedulerState): void;
20
26
  private optionsRequireRerender;
21
27
  private updateGreyedSlots;
@@ -1,17 +1,17 @@
1
- import { D as T, d as C } from "../chunks/color-CyamnJnn.mjs";
2
- import { a as N, b as X, R as Y, T as G, c as U, e as _, g as q, f as J, h as K, i as Q, j as Z, k as tt, l as et, m as ot, n as nt, r as st, t as ct } from "../chunks/color-CyamnJnn.mjs";
3
- class x {
1
+ import { D as $, d as C } from "../chunks/color-CpFtrIoX.mjs";
2
+ import { a as G, b as N, c as U, R as X, T as Y, e as _, f 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 ct, r as it, q as rt, t as at } from "../chunks/color-CpFtrIoX.mjs";
3
+ class w {
4
4
  /**
5
5
  * Calculate position for an event part in week/day view
6
6
  */
7
- calculateWeekPosition(t, e, n, s, c, l = {}) {
8
- const i = { ...T, ...l };
7
+ calculateWeekPosition(t, e, s, n, c, l = {}) {
8
+ const i = { ...$, ...l };
9
9
  new Date(t.start).setHours(0, 0, 0, 0);
10
- const a = C.getSecondsFromMidnight(t.start), u = C.getSecondsFromMidnight(t.end) - a, [d] = i.slotMinTime.split(":").map(Number), [f] = i.slotMaxTime.split(":").map(Number), g = (f - d) * 3600, m = (a - d * 3600) / g * 100, R = u / g * 100, S = 10, p = (100 - S) / c, $ = p / n, w = S + s * p + e * $;
10
+ const a = C.getSecondsFromMidnight(t.start), u = C.getSecondsFromMidnight(t.end) - a, [d] = i.slotMinTime.split(":").map(Number), [f] = i.slotMaxTime.split(":").map(Number), g = (f - d) * 3600, m = (a - d * 3600) / g * 100, R = u / g * 100, S = 10, p = (100 - S) / c, T = p / s, v = S + n * p + e * T;
11
11
  return {
12
12
  top: m,
13
- left: w,
14
- width: $,
13
+ left: v,
14
+ width: T,
15
15
  height: R,
16
16
  zIndex: e + 1
17
17
  };
@@ -19,9 +19,9 @@ class x {
19
19
  /**
20
20
  * Calculate position for an event in timeline view
21
21
  */
22
- calculateTimelinePosition(t, e, n, s, c, l = {}) {
23
- ({ ...T, ...l });
24
- const i = c.getTime() - s.getTime(), r = Math.max(t.start.getTime(), s.getTime()), a = Math.min(t.end.getTime(), c.getTime()), h = r - s.getTime(), u = a - r, d = h / i * 100, f = u / i * 100, g = 100 / n;
22
+ calculateTimelinePosition(t, e, s, n, c, l = {}) {
23
+ ({ ...$, ...l });
24
+ const i = c.getTime() - n.getTime(), r = Math.max(t.start.getTime(), n.getTime()), a = Math.min(t.end.getTime(), c.getTime()), h = r - n.getTime(), u = a - r, d = h / i * 100, f = u / i * 100, g = 100 / s;
25
25
  return {
26
26
  top: e * g,
27
27
  left: d,
@@ -33,8 +33,8 @@ class x {
33
33
  /**
34
34
  * Calculate position for an all-day event in month view
35
35
  */
36
- calculateMonthEventPosition(t, e, n, s, c, l = 7) {
37
- const i = 100 / l, r = 100 / n, a = s * i, h = (c - s + 1) * i;
36
+ calculateMonthEventPosition(t, e, s, n, c, l = 7) {
37
+ const i = 100 / l, r = 100 / s, a = n * i, h = (c - n + 1) * i;
38
38
  return {
39
39
  top: e * r,
40
40
  left: a,
@@ -46,12 +46,12 @@ class x {
46
46
  /**
47
47
  * Convert percentage-based position to pixel-based
48
48
  */
49
- toPixelPosition(t, e, n) {
49
+ toPixelPosition(t, e, s) {
50
50
  return {
51
- top: t.top / 100 * n,
51
+ top: t.top / 100 * s,
52
52
  left: t.left / 100 * e,
53
53
  width: t.width / 100 * e,
54
- height: t.height / 100 * n,
54
+ height: t.height / 100 * s,
55
55
  zIndex: t.zIndex
56
56
  };
57
57
  }
@@ -82,93 +82,96 @@ class x {
82
82
  };
83
83
  }
84
84
  }
85
- const P = new x();
86
- function z(o, t) {
87
- const e = Object.entries(t).map(([n, s]) => `[data-${n}="${s}"]`).join("");
85
+ const P = new w();
86
+ function M(o, t) {
87
+ const e = Object.entries(t).map(([s, n]) => `[data-${s}="${n}"]`).join("");
88
88
  return o.querySelector(e);
89
89
  }
90
- function B(o) {
90
+ function z(o) {
91
91
  const t = o.dataset, e = {};
92
- for (const n in t) {
93
- const s = t[n];
94
- s !== void 0 && (e[n] = s);
92
+ for (const s in t) {
93
+ const n = t[s];
94
+ n !== void 0 && (e[s] = n);
95
95
  }
96
96
  return e;
97
97
  }
98
- function D(o, t) {
98
+ function B(o, t) {
99
99
  return o.closest(`[data-${t}]`);
100
100
  }
101
- function W(o) {
101
+ function D(o) {
102
102
  return {
103
103
  top: o.scrollTop,
104
104
  left: o.scrollLeft
105
105
  };
106
106
  }
107
- function L(o, t, e = "smooth") {
108
- const n = o.getBoundingClientRect(), c = t.getBoundingClientRect().top - n.top + o.scrollTop;
107
+ function E(o, t, e = "smooth") {
108
+ const s = o.getBoundingClientRect(), c = t.getBoundingClientRect().top - s.top + o.scrollTop;
109
109
  o.scrollTo({
110
110
  top: c,
111
111
  behavior: e
112
112
  });
113
113
  }
114
- function M(o, t) {
115
- const e = o.getBoundingClientRect(), n = t ? t.getBoundingClientRect() : { top: 0, left: 0, bottom: window.innerHeight, right: window.innerWidth };
116
- return e.top >= n.top && e.left >= n.left && e.bottom <= n.bottom && e.right <= n.right;
114
+ function L(o, t) {
115
+ const e = o.getBoundingClientRect(), s = t ? t.getBoundingClientRect() : { top: 0, left: 0, bottom: window.innerHeight, right: window.innerWidth };
116
+ return e.top >= s.top && e.left >= s.left && e.bottom <= s.bottom && e.right <= s.right;
117
117
  }
118
- function O(o, t) {
119
- const e = t.getBoundingClientRect(), n = "touches" in o ? o.touches[0].clientX : o.clientX, s = "touches" in o ? o.touches[0].clientY : o.clientY;
118
+ function W(o, t) {
119
+ const e = t.getBoundingClientRect(), s = "touches" in o ? o.touches[0].clientX : o.clientX, n = "touches" in o ? o.touches[0].clientY : o.clientY;
120
120
  return {
121
- x: n - e.left,
122
- y: s - e.top
121
+ x: s - e.left,
122
+ y: n - e.top
123
123
  };
124
124
  }
125
- function k(o, t, e) {
125
+ function O(o, t, e) {
126
126
  o.style.setProperty(`--${t}`, e);
127
127
  }
128
- function E(o, t) {
128
+ function A(o, t) {
129
129
  return getComputedStyle(o).getPropertyValue(`--${t}`).trim();
130
130
  }
131
- function H(o, ...t) {
131
+ function k(o, ...t) {
132
132
  o.classList.add(...t.filter(Boolean));
133
133
  }
134
- function j(o, ...t) {
134
+ function F(o, ...t) {
135
135
  o.classList.remove(...t.filter(Boolean));
136
136
  }
137
- function A(o, t, e) {
137
+ function H(o, t, e) {
138
138
  o.classList.toggle(t, e);
139
139
  }
140
140
  export {
141
- N as DEFAULT_COLORS,
142
- T as DEFAULT_OPTIONS,
143
- X as DateService,
144
- x as PositionService,
145
- Y as ResourceService,
146
- G as TimelineService,
147
- U as addAlpha,
148
- H as addClasses,
149
- _ as darkenColor,
141
+ G as DEFAULT_COLORS,
142
+ N as DEFAULT_MESSAGES,
143
+ $ as DEFAULT_OPTIONS,
144
+ U as DateService,
145
+ w as PositionService,
146
+ X as ResourceService,
147
+ Y as TimelineService,
148
+ _ as addAlpha,
149
+ k as addClasses,
150
+ q as darkenColor,
150
151
  C as dateService,
151
- D as findClosestWithData,
152
- q as generateEventId,
153
- J as generateGroupId,
154
- K as generateId,
155
- Q as generateResourceId,
156
- E as getCSSVariable,
157
- Z as getColorByIndex,
158
- tt as getContrastColor,
159
- B as getDataAttributes,
160
- z as getElementByData,
161
- O as getRelativePosition,
162
- W as getScrollPosition,
163
- M as isInViewport,
164
- et as isResource,
165
- ot as isResourceGroup,
166
- nt as lightenColor,
152
+ B as findClosestWithData,
153
+ J as formatMessage,
154
+ K as generateEventId,
155
+ Q as generateGroupId,
156
+ Z as generateId,
157
+ tt as generateResourceId,
158
+ A as getCSSVariable,
159
+ et as getColorByIndex,
160
+ ot as getContrastColor,
161
+ z as getDataAttributes,
162
+ M as getElementByData,
163
+ W as getRelativePosition,
164
+ D as getScrollPosition,
165
+ L as isInViewport,
166
+ st as isResource,
167
+ nt as isResourceGroup,
168
+ ct as lightenColor,
167
169
  P as positionService,
168
- j as removeClasses,
169
- st as resourceService,
170
- L as scrollToTime,
171
- k as setCSSVariable,
172
- ct as timelineService,
173
- A as toggleClass
170
+ F as removeClasses,
171
+ it as resolveMessages,
172
+ rt as resourceService,
173
+ E as scrollToTime,
174
+ O as setCSSVariable,
175
+ at as timelineService,
176
+ H as toggleClass
174
177
  };
@@ -3,5 +3,6 @@ export * from './event';
3
3
  export * from './resource';
4
4
  export * from './time-slot';
5
5
  export * from './options';
6
+ export * from './messages';
6
7
  export * from './drag-state';
7
8
  export * from './events';
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Every user-facing string the scheduler renders or announces. Consumers
3
+ * localize by passing a partial table via `options.messages`; anything not
4
+ * overridden falls back to the English default. Templates interpolate
5
+ * `{placeholder}` tokens via `formatMessage` — plain substitution, no
6
+ * pluralization rules (the only plural, slot count, uses two explicit keys).
7
+ */
8
+ export interface SchedulerMessages {
9
+ navLabel: string;
10
+ previousPeriod: string;
11
+ nextPeriod: string;
12
+ jumpToToday: string;
13
+ today: string;
14
+ switchView: string;
15
+ viewYear: string;
16
+ viewMonth: string;
17
+ viewWeek: string;
18
+ viewDay: string;
19
+ viewTimeline: string;
20
+ resourcesHeader: string;
21
+ /** {date} — formatted first day of the visible week */
22
+ timelineGridLabel: string;
23
+ /** {title} — resource group title */
24
+ expandGroup: string;
25
+ /** {title} — resource group title */
26
+ collapseGroup: string;
27
+ /** {count} — number of hidden events */
28
+ moreEvents: string;
29
+ /** {view} — localized view name */
30
+ viewChanged: string;
31
+ /** {title} */
32
+ eventAdded: string;
33
+ /** {title} */
34
+ eventUpdated: string;
35
+ /** {title} */
36
+ eventRemoved: string;
37
+ loadingEvents: string;
38
+ eventsLoaded: string;
39
+ /** {title} {minutes} — move-mode entry keymap announcement */
40
+ moveModeEntered: string;
41
+ /** {start} {end} {day} */
42
+ movedTo: string;
43
+ /** {resource} */
44
+ movedToResource: string;
45
+ /** {edge} {start} {end} — edge is startEdge/endEdge below */
46
+ resizedEdge: string;
47
+ startEdge: string;
48
+ endEdge: string;
49
+ moveCommitted: string;
50
+ moveCancelled: string;
51
+ /** {start} {end} {count} {slots} — slots is slotSingular/slotPlural */
52
+ selection: string;
53
+ slotSingular: string;
54
+ slotPlural: string;
55
+ /** {start} {end} */
56
+ selectionCommitted: string;
57
+ gridInstructions: string;
58
+ eventInstructions: string;
59
+ /** {resource} */
60
+ eventOnResource: string;
61
+ }
62
+ export declare const DEFAULT_MESSAGES: SchedulerMessages;
63
+ /**
64
+ * Interpolate `{placeholder}` tokens. Unknown tokens are left verbatim so a
65
+ * typo'd override is visible rather than silently swallowed.
66
+ */
67
+ export declare function formatMessage(template: string, params?: Record<string, string | number>): string;
68
+ /** Merge a consumer's partial override table onto the English defaults. */
69
+ export declare function resolveMessages(overrides?: Partial<SchedulerMessages>): SchedulerMessages;
@@ -1,3 +1,4 @@
1
+ import { SchedulerMessages } from './messages';
1
2
  import { DayOfWeek, TimeFormat, ViewType } from './types';
2
3
  /**
3
4
  * Business hours configuration
@@ -73,6 +74,9 @@ export interface SchedulerOptions {
73
74
  dragScroll?: boolean;
74
75
  /** Snap duration in seconds */
75
76
  snapDuration?: number;
77
+ /** Override any user-facing string (labels, announcements, instructions).
78
+ * Merged onto the English defaults — see SchedulerMessages. */
79
+ messages?: Partial<SchedulerMessages>;
76
80
  /** Whether to show current time indicator */
77
81
  nowIndicator?: boolean;
78
82
  /** Whether to show week numbers */
package/select/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { M as p } from "../chunks/mp-select-BDS1-YGn.mjs";
1
+ import { M as p } from "../chunks/mp-select-Ctu-v1-p.mjs";
2
2
  export {
3
3
  p as MpSelect
4
4
  };
@@ -5,10 +5,18 @@ export interface MpSelectOption {
5
5
  label: string;
6
6
  disabled?: boolean;
7
7
  }
8
+ export interface MpSelectOptgroup {
9
+ label: string;
10
+ disabled?: boolean;
11
+ options: MpSelectOption[];
12
+ }
13
+ /** One entry of the rendered list: a plain option, or a labelled group of them. */
14
+ export type MpSelectItem = MpSelectOption | MpSelectOptgroup;
8
15
  export interface SelectChangeEventDetail {
9
16
  value: string | null;
10
17
  values: string[];
11
18
  }
19
+ declare const MpSelect_base: typeof LitElement & (new (...args: any[]) => import('@mintplayer/web-components/a11y').FormAssociatedElement);
12
20
  /**
13
21
  * `<mp-select>` — Bootstrap-styled native `<select>` wrapped in a Lit element.
14
22
  *
@@ -34,7 +42,7 @@ export interface SelectChangeEventDetail {
34
42
  * a `composed: true` `change` event so consumers using the native event
35
43
  * name continue to fire.
36
44
  */
37
- export declare class MpSelect extends LitElement {
45
+ export declare class MpSelect extends MpSelect_base {
38
46
  static styles: import('lit').CSSResult[];
39
47
  static shadowRootOptions: {
40
48
  delegatesFocus: boolean;
@@ -50,11 +58,21 @@ export declare class MpSelect extends LitElement {
50
58
  private _numberVisible;
51
59
  private _disabled;
52
60
  private _value;
61
+ private _inputLabel;
62
+ private _errorText;
63
+ private readonly _errorId;
53
64
  private _values;
54
65
  private _options;
55
66
  private _slotOptions;
56
67
  private readonly _selectRef;
57
68
  private _slotObserver;
69
+ /**
70
+ * Tier-2 naming. No `role` is passed on purpose: the inner `<select>` already
71
+ * carries the real role, and adding one to the host would announce the control
72
+ * twice. For the same reason the references are targeted at that `<select>`
73
+ * rather than at the host's `ElementInternals`.
74
+ */
75
+ private readonly hostAria;
58
76
  get size(): MpSelectSize;
59
77
  set size(value: MpSelectSize);
60
78
  get multiple(): boolean;
@@ -63,20 +81,59 @@ export declare class MpSelect extends LitElement {
63
81
  set numberVisible(value: number | null);
64
82
  get disabled(): boolean;
65
83
  set disabled(value: boolean);
84
+ /**
85
+ * Accessible name for the inner `<select>`, as `inputLabel` / `input-label`.
86
+ *
87
+ * Named for where it lands rather than what it is: the value is written to the
88
+ * control *inside* the shadow root, not to the host. Plain `label` was rejected
89
+ * because `<option label>` and `<optgroup label>` are literally in play in this
90
+ * component's own markup, so `label` would read as one of those.
91
+ *
92
+ * This is the tier-1 naming path — always available, and the documented fallback
93
+ * where cross-root element references are not. `aria-labelledby` on the host is
94
+ * tier 2 and takes precedence, being a live reference rather than a copied
95
+ * string.
96
+ */
97
+ get inputLabel(): string | null;
98
+ set inputLabel(value: string | null);
99
+ /**
100
+ * Validation message, as `errorText` / `error-text`. Rendered as a
101
+ * `.invalid-feedback` node inside the shadow root and referenced from the inner
102
+ * `<select>` by `aria-errormessage` **and** `aria-describedby`, but only while
103
+ * `invalid` is set — `aria-errormessage` is meaningless on a control that is not
104
+ * `aria-invalid`. Text rather than a node, for the same reason `inputLabel`
105
+ * exists: a consumer's own element is outside this shadow root, where an IDREF
106
+ * from the `<select>` cannot reach it.
107
+ */
108
+ get errorText(): string | null;
109
+ set errorText(value: string | null);
66
110
  get value(): string | null;
67
111
  set value(value: string | null);
68
112
  get values(): string[];
69
113
  set values(value: string[]);
70
- get options(): MpSelectOption[] | null;
71
- set options(value: MpSelectOption[] | null);
114
+ get options(): MpSelectItem[] | null;
115
+ set options(value: MpSelectItem[] | null);
72
116
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
73
117
  disconnectedCallback(): void;
74
118
  render(): TemplateResult;
75
119
  protected updated(): void;
120
+ private renderOption;
76
121
  private isSelected;
122
+ /**
123
+ * Mirror slotted <option>/<optgroup> children. Optgroups previously
124
+ * vanished WITH ALL THEIR OPTIONS (audit Critical): the filter kept only
125
+ * top-level OPTION tags, so anything grouped never reached the shadow
126
+ * <select>.
127
+ */
128
+ private collectSlotItems;
77
129
  private onSlotChange;
78
130
  private observeSlottedMutations;
79
131
  private refreshSlotOptions;
80
132
  private onNativeChange;
81
133
  private reflectBoolean;
134
+ formValue(): string | FormData | null;
135
+ formReset(): void;
136
+ formRestore(state: string | FormData | File | null): void;
137
+ formValidityAnchor(): HTMLElement | null;
82
138
  }
139
+ export {};