@mintplayer/web-components 2.4.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 (54) 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/{color-CpFtrIoX.mjs → id-BstjfRrz.mjs} +383 -317
  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 +3243 -882
  29. package/scheduler/src/components/mp-scheduler.d.ts +410 -2
  30. package/scheduler/src/events/index.d.ts +0 -1
  31. package/scheduler/src/events/scheduler-event-emitter.d.ts +20 -4
  32. package/scheduler/src/state/scheduler-state.d.ts +59 -7
  33. package/scheduler/src/views/base-view.d.ts +29 -0
  34. package/scheduler/src/views/day-view.d.ts +6 -0
  35. package/scheduler/src/views/timeline-view.d.ts +143 -4
  36. package/scheduler/src/views/week-view.d.ts +6 -0
  37. package/scheduler/src/views/year-view.d.ts +4 -2
  38. package/scheduler-core/index.mjs +63 -58
  39. package/scheduler-core/src/models/event.d.ts +6 -2
  40. package/scheduler-core/src/models/events.d.ts +76 -90
  41. package/scheduler-core/src/models/index.d.ts +1 -0
  42. package/scheduler-core/src/models/messages.d.ts +94 -0
  43. package/scheduler-core/src/models/options.d.ts +72 -16
  44. package/scheduler-core/src/models/permissions.d.ts +114 -0
  45. package/scheduler-core/src/models/time-slot.d.ts +15 -0
  46. package/scheduler-core/src/services/resource.service.d.ts +25 -11
  47. package/scheduler-core/src/utils/color.d.ts +22 -0
  48. package/select/index.mjs +1 -1
  49. package/timepicker/index.mjs +4 -3
  50. package/timepicker/src/mp-time-list.element.d.ts +44 -7
  51. package/timepicker/src/mp-timepicker.element.d.ts +5 -0
  52. package/toggle-button/index.mjs +1 -1
  53. package/tree-select/index.mjs +1 -1
  54. package/scheduler/src/events/event-types.d.ts +0 -58
@@ -1,433 +1,4 @@
1
- import { html as d, unsafeCSS as c, LitElement as b, nothing as p } from "lit";
2
- import { query as s } from "lit/decorators.js";
3
- import { L as m } from "../chunks/live-announcer-Bi0orG4n.mjs";
4
- import { O as h } from "../chunks/overlay-controller-DPt13i8p.mjs";
5
- import "../chunks/mp-calendar.element-u6uS31_j.mjs";
6
- import "../chunks/mp-timepicker.element-Bz393NDQ.mjs";
7
- d`<!-- Rendered dynamically by render(). Codegen-wc emits styles from the
8
- sibling .scss; the template export is intentionally unused. -->`;
9
- const g = c(`:host {
10
- display: inline-block;
11
- position: relative;
12
- box-sizing: border-box;
13
- font-family: inherit;
14
- }
15
-
16
- .input-group {
17
- display: inline-flex;
18
- position: relative;
19
- width: 100%;
20
- align-items: stretch;
21
- border-radius: var(--bs-border-radius, 0.375rem);
22
- }
23
- .input-group:focus-within {
24
- box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
25
- }
26
- .input-group:focus-within input.form-control,
27
- .input-group:focus-within button.trigger {
28
- border-color: var(--bs-primary);
29
- }
30
-
31
- input.form-control {
32
- flex: 1 1 auto;
33
- min-width: 0;
34
- padding: 0.375rem 0.75rem;
35
- font-size: 1rem;
36
- line-height: 1.5;
37
- color: var(--bs-body-color);
38
- background-color: var(--bs-body-bg);
39
- border: 1px solid var(--bs-border-color);
40
- border-inline-end-width: 0;
41
- border-start-start-radius: var(--bs-border-radius, 0.375rem);
42
- border-end-start-radius: var(--bs-border-radius, 0.375rem);
43
- border-start-end-radius: 0;
44
- border-end-end-radius: 0;
45
- outline: 0;
46
- }
47
-
48
- input.form-control:disabled {
49
- background-color: var(--bs-secondary-bg);
50
- opacity: 1;
51
- cursor: not-allowed;
52
- }
53
-
54
- button.trigger {
55
- flex: 0 0 auto;
56
- padding: 0.375rem 0.75rem;
57
- font-size: 1rem;
58
- line-height: 1.5;
59
- color: var(--bs-body-color);
60
- background-color: var(--bs-body-bg);
61
- border: 1px solid var(--bs-border-color);
62
- border-inline-start: 0;
63
- cursor: pointer;
64
- }
65
- button.trigger.clear {
66
- border-inline-start: 0;
67
- border-inline-end: 0;
68
- }
69
- button.trigger.time {
70
- border-start-end-radius: var(--bs-border-radius, 0.375rem);
71
- border-end-end-radius: var(--bs-border-radius, 0.375rem);
72
- }
73
- button.trigger:hover:not(:disabled) {
74
- background-color: var(--bs-secondary-bg);
75
- }
76
- button.trigger:focus-visible {
77
- outline: 2px solid var(--bs-primary);
78
- outline-offset: -2px;
79
- }
80
- button.trigger:disabled {
81
- opacity: 0.65;
82
- cursor: not-allowed;
83
- }
84
- button.trigger svg {
85
- width: 1em;
86
- height: 1em;
87
- vertical-align: -0.125em;
88
- }
89
-
90
- .popup {
91
- position: fixed;
92
- z-index: 1050;
93
- display: none;
94
- padding: 0.5rem;
95
- background-color: var(--bs-body-bg);
96
- border: 1px solid var(--bs-border-color);
97
- border-radius: var(--bs-border-radius, 0.375rem);
98
- box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
99
- max-width: min(360px, 100vw - 16px);
100
- }
101
-
102
- :host([data-open=date]) .popup-date,
103
- :host([data-open=time]) .popup-time {
104
- display: block;
105
- }
106
-
107
- .popup-footer {
108
- display: flex;
109
- justify-content: flex-end;
110
- padding-top: 0.5rem;
111
- }
112
- .popup-footer button {
113
- padding: 0.25rem 0.75rem;
114
- font-size: 0.875rem;
115
- color: #fff;
116
- background-color: var(--bs-primary);
117
- border: 1px solid var(--bs-primary);
118
- border-radius: var(--bs-border-radius, 0.375rem);
119
- cursor: pointer;
120
- }
121
- .popup-footer button:hover {
122
- filter: brightness(0.95);
123
- }
124
- .popup-footer button:focus-visible {
125
- outline: 2px solid var(--bs-primary);
126
- outline-offset: 2px;
127
- }
128
-
129
- @media (pointer: coarse) {
130
- button.trigger,
131
- .popup-footer button {
132
- min-height: 40px;
133
- }
134
- }
135
- @media (prefers-reduced-motion: reduce) {
136
- .popup {
137
- transition: none !important;
138
- }
139
- }`);
140
- var f = Object.defineProperty, l = (u, e, t, i) => {
141
- for (var a = void 0, o = u.length - 1, n; o >= 0; o--)
142
- (n = u[o]) && (a = n(e, t, a) || a);
143
- return a && f(e, t, a), a;
144
- };
145
- const v = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM2 2a1 1 0 0 0-1 1v1h14V3a1 1 0 0 0-1-1H2zm13 3H1v9a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V5z"/></svg>', y = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"/><path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0z"/></svg>', w = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/></svg>';
146
- let C = 0;
147
- class r extends b {
148
- constructor() {
149
- super(...arguments), this.value = null, this.min = null, this.max = null, this.disableDateFn = null, this.firstDayOfWeek = 1, this.locale = void 0, this.hour12 = "auto", this.step = 15, this.defaultTime = { hour: 0, minute: 0 }, this.placeholder = "", this.showClear = !1, this.disabled = !1, this.inputLabel = "Selected date and time", this.dateButtonLabel = "Choose date", this.timeButtonLabel = "Choose time", this.clearLabel = "Clear", this.todayLabel = "Today", this.nowLabel = "Now", this._openPopup = null, this._calendarMonth = null, this.instanceId = `mp-dtp-${++C}`, this.datePopupId = `${this.instanceId}-popup-date`, this.timePopupId = `${this.instanceId}-popup-time`, this.dateOverlay = new h(this, {
150
- anchor: () => this.inputGroupEl ?? this.dateTriggerEl ?? null,
151
- trigger: () => this.dateTriggerEl ?? null,
152
- panel: () => this.datePopupEl ?? null,
153
- panelWidth: "anchor-min",
154
- // APG Date Picker Dialog: opening moves focus onto the calendar grid's
155
- // roving cell. A slotted consumer calendar wins over the shadow default.
156
- initialFocus: () => this.datePopupEl?.querySelector('slot[name="calendar"]')?.assignedElements()[0] ?? this.datePopupEl?.querySelector("mp-calendar") ?? null,
157
- onOpen: () => {
158
- this.dispatchEvent(
159
- new CustomEvent("opened", { detail: "date", bubbles: !0, composed: !0 })
160
- );
161
- },
162
- onClose: () => {
163
- this._openPopup === "date" && (this._openPopup = null), this.dispatchEvent(
164
- new CustomEvent("closed", { detail: "date", bubbles: !0, composed: !0 })
165
- );
166
- }
167
- }), this.timeOverlay = new h(this, {
168
- anchor: () => this.inputGroupEl ?? this.timeTriggerEl ?? null,
169
- trigger: () => this.timeTriggerEl ?? null,
170
- panel: () => this.timePopupEl ?? null,
171
- panelWidth: "anchor-min",
172
- // Opening moves focus onto the time list's active option (its focus()
173
- // override lands there). A slotted consumer list wins over the default.
174
- initialFocus: () => this.timePopupEl?.querySelector('slot[name="time-list"]')?.assignedElements()[0] ?? this.timePopupEl?.querySelector("mp-time-list") ?? null,
175
- onOpen: () => {
176
- this.dispatchEvent(
177
- new CustomEvent("opened", { detail: "time", bubbles: !0, composed: !0 })
178
- );
179
- },
180
- onClose: () => {
181
- this._openPopup === "time" && (this._openPopup = null), this.dispatchEvent(
182
- new CustomEvent("closed", { detail: "time", bubbles: !0, composed: !0 })
183
- );
184
- }
185
- }), this.liveAnnouncer = new m(this), this.lastAnnouncedValue = null, this.onDateTriggerClick = async (e) => {
186
- this.disabled || (e.stopPropagation(), this.dateOverlay.isOpen ? this.dateOverlay.close() : await this.openDate());
187
- }, this.onTimeTriggerClick = async (e) => {
188
- this.disabled || (e.stopPropagation(), this.timeOverlay.isOpen ? this.timeOverlay.close() : await this.openTime());
189
- }, this.onDateTriggerKeyDown = async (e) => {
190
- this.disabled || (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.dateOverlay.isOpen || await this.openDate());
191
- }, this.onTimeTriggerKeyDown = async (e) => {
192
- this.disabled || (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.timeOverlay.isOpen || await this.openTime());
193
- }, this.onClearClick = (e) => {
194
- this.disabled || (e.stopPropagation(), this.clear());
195
- }, this.onCalendarSelectedDateChange = (e) => {
196
- const t = e.detail;
197
- if (!(t instanceof Date)) return;
198
- const i = this.value !== null && this.value.getFullYear() === t.getFullYear() && this.value.getMonth() === t.getMonth() && this.value.getDate() === t.getDate();
199
- this.updateDatePart(t), i && this.dateOverlay.close();
200
- }, this.onCalendarCurrentMonthChange = (e) => {
201
- const t = e.detail;
202
- t instanceof Date && (this._calendarMonth = t);
203
- }, this.onTimeListSelectedTimeChange = (e) => {
204
- const t = e.detail;
205
- t instanceof Date && (this.updateTimePart(t), this.timeOverlay.close());
206
- }, this.onTodayClick = () => {
207
- this.updateDatePart(/* @__PURE__ */ new Date());
208
- }, this.onNowClick = () => {
209
- const e = /* @__PURE__ */ new Date(), t = Math.floor(e.getMinutes() / this.step) * this.step, i = new Date(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), t, 0, 0);
210
- this.updateTimePart(i);
211
- };
212
- }
213
- static {
214
- this.styles = [g];
215
- }
216
- static {
217
- this.properties = {
218
- value: { attribute: !1 },
219
- min: { attribute: !1 },
220
- max: { attribute: !1 },
221
- disableDateFn: { attribute: !1 },
222
- firstDayOfWeek: { attribute: "first-day-of-week", type: Number, reflect: !0 },
223
- locale: { attribute: "locale", type: String, reflect: !0 },
224
- hour12: { attribute: "hour12" },
225
- step: { attribute: "step", type: Number, reflect: !0 },
226
- defaultTime: { attribute: !1 },
227
- placeholder: { attribute: "placeholder", type: String, reflect: !0 },
228
- showClear: { attribute: "show-clear", type: Boolean, reflect: !0 },
229
- disabled: { attribute: "disabled", type: Boolean, reflect: !0 },
230
- inputLabel: { attribute: "input-label", type: String, reflect: !0 },
231
- dateButtonLabel: { attribute: "date-button-label", type: String, reflect: !0 },
232
- timeButtonLabel: { attribute: "time-button-label", type: String, reflect: !0 },
233
- clearLabel: { attribute: "clear-label", type: String, reflect: !0 },
234
- todayLabel: { attribute: "today-label", type: String, reflect: !0 },
235
- nowLabel: { attribute: "now-label", type: String, reflect: !0 },
236
- _openPopup: { state: !0 },
237
- _calendarMonth: { state: !0 }
238
- };
239
- }
240
- willUpdate(e) {
241
- e.has("value") && this.value && !this._calendarMonth && (this._calendarMonth = new Date(this.value.getFullYear(), this.value.getMonth(), 1));
242
- }
243
- updated(e) {
244
- super.updated?.(e), e.has("_openPopup") && (this._openPopup === null ? this.removeAttribute("data-open") : this.setAttribute("data-open", this._openPopup));
245
- }
246
- /* ---- Public API ---- */
247
- setValue(e, t = !0) {
248
- const i = e === null && this.value === null || e instanceof Date && this.value instanceof Date && e.getTime() === this.value.getTime();
249
- this.value = e ? new Date(e.getTime()) : null, e && (this._calendarMonth = new Date(e.getFullYear(), e.getMonth(), 1)), this.requestUpdate(), t && !i && (this.dispatchEvent(
250
- new CustomEvent("value-change", {
251
- detail: this.value ? new Date(this.value.getTime()) : null,
252
- bubbles: !0,
253
- composed: !0
254
- })
255
- ), this.announceValue());
256
- }
257
- /** Polite live-region announce on value change. Skipped on first render. */
258
- announceValue() {
259
- const e = this.value ? this.value.getTime() : null;
260
- if (this.lastAnnouncedValue, e === this.lastAnnouncedValue) return;
261
- if (this.lastAnnouncedValue = e, this.value === null) {
262
- this.liveAnnouncer.announce(`${this.clearLabel}`);
263
- return;
264
- }
265
- const t = this.value.toLocaleString(this.locale ?? void 0, {
266
- dateStyle: "long",
267
- timeStyle: "short",
268
- hour12: this.resolvedHour12()
269
- });
270
- this.liveAnnouncer.announce(`${t} selected`);
271
- }
272
- clear() {
273
- this.disabled || this.setValue(null);
274
- }
275
- get openPopup() {
276
- return this._openPopup;
277
- }
278
- async openDate() {
279
- this.disabled || (this.timeOverlay.isOpen && this.timeOverlay.close(!1), this._openPopup = "date", await this.dateOverlay.open());
280
- }
281
- async openTime() {
282
- this.disabled || (this.dateOverlay.isOpen && this.dateOverlay.close(!1), this._openPopup = "time", await this.timeOverlay.open());
283
- }
284
- closePopups() {
285
- this.dateOverlay.isOpen && this.dateOverlay.close(), this.timeOverlay.isOpen && this.timeOverlay.close();
286
- }
287
- /* ---- Display ---- */
288
- formatDisplay() {
289
- return this.value ? this.value.toLocaleString(this.locale ?? void 0, {
290
- dateStyle: "short",
291
- timeStyle: "short",
292
- hour12: this.resolvedHour12()
293
- }) : "";
294
- }
295
- resolvedHour12() {
296
- if (this.hour12 === !0) return !0;
297
- if (this.hour12 === !1) return !1;
298
- }
299
- /* ---- Value composition ---- */
300
- updateDatePart(e) {
301
- const t = this.value ? { hour: this.value.getHours(), minute: this.value.getMinutes() } : { hour: this.defaultTime.hour, minute: this.defaultTime.minute }, i = new Date(
302
- e.getFullYear(),
303
- e.getMonth(),
304
- e.getDate(),
305
- t.hour,
306
- t.minute,
307
- 0,
308
- 0
309
- );
310
- this.setValue(i);
311
- }
312
- updateTimePart(e) {
313
- const t = /* @__PURE__ */ new Date(), i = this.value ?? t, a = new Date(
314
- i.getFullYear(),
315
- i.getMonth(),
316
- i.getDate(),
317
- e.getHours(),
318
- e.getMinutes(),
319
- 0,
320
- 0
321
- );
322
- this.setValue(a);
323
- }
324
- /* ---- Render ---- */
325
- render() {
326
- const e = this.formatDisplay(), t = this.value !== null, i = this.showClear && t && !this.disabled, a = this._calendarMonth ?? (this.value ? new Date(this.value.getFullYear(), this.value.getMonth(), 1) : /* @__PURE__ */ new Date()), o = this.value ?? null, n = this.value ?? null;
327
- return d`
328
- <div class="input-group">
329
- <input
330
- class="form-control"
331
- type="text"
332
- readonly
333
- aria-readonly="true"
334
- aria-label="${this.inputLabel}"
335
- .value="${e}"
336
- placeholder="${this.placeholder || p}"
337
- ?disabled="${this.disabled}"
338
- />
339
- ${i ? d`<button
340
- class="trigger clear"
341
- type="button"
342
- aria-label="${this.clearLabel}"
343
- ?disabled="${this.disabled}"
344
- @click="${this.onClearClick}"
345
- .innerHTML="${w}"
346
- ></button>` : p}
347
- <button
348
- class="trigger date"
349
- type="button"
350
- aria-haspopup="dialog"
351
- aria-expanded="${this._openPopup === "date" ? "true" : "false"}"
352
- aria-controls="${this.datePopupId}"
353
- aria-label="${this.dateButtonLabel}"
354
- ?disabled="${this.disabled}"
355
- @click="${this.onDateTriggerClick}"
356
- @keydown="${this.onDateTriggerKeyDown}"
357
- .innerHTML="${v}"
358
- ></button>
359
- <button
360
- class="trigger time"
361
- type="button"
362
- aria-haspopup="dialog"
363
- aria-expanded="${this._openPopup === "time" ? "true" : "false"}"
364
- aria-controls="${this.timePopupId}"
365
- aria-label="${this.timeButtonLabel}"
366
- ?disabled="${this.disabled}"
367
- @click="${this.onTimeTriggerClick}"
368
- @keydown="${this.onTimeTriggerKeyDown}"
369
- .innerHTML="${y}"
370
- ></button>
371
- </div>
372
- ${this.liveAnnouncer.template()}
373
-
374
- <div class="popup popup-date" id="${this.datePopupId}" role="dialog" aria-label="${this.dateButtonLabel}">
375
- <slot name="calendar"
376
- @selected-date-change="${this.onCalendarSelectedDateChange}"
377
- @current-month-change="${this.onCalendarCurrentMonthChange}"
378
- >
379
- <mp-calendar
380
- .selectedDate="${o}"
381
- .currentMonth="${a}"
382
- .disableDateFn="${this.disableDateFn}"
383
- .min="${this.min}"
384
- .max="${this.max}"
385
- .firstDayOfWeek="${this.firstDayOfWeek}"
386
- .locale="${this.locale}"
387
- @selected-date-change="${this.onCalendarSelectedDateChange}"
388
- @current-month-change="${this.onCalendarCurrentMonthChange}"
389
- ></mp-calendar>
390
- </slot>
391
- <div class="popup-footer">
392
- <button type="button" @click="${this.onTodayClick}">${this.todayLabel}</button>
393
- </div>
394
- </div>
395
-
396
- <div class="popup popup-time" id="${this.timePopupId}" role="dialog" aria-label="${this.timeButtonLabel}">
397
- <slot name="time-list"
398
- @selected-time-change="${this.onTimeListSelectedTimeChange}"
399
- >
400
- <mp-time-list
401
- .selectedTime="${n}"
402
- .step="${this.step}"
403
- .hour12="${this.hour12}"
404
- .locale="${this.locale}"
405
- @selected-time-change="${this.onTimeListSelectedTimeChange}"
406
- ></mp-time-list>
407
- </slot>
408
- <div class="popup-footer">
409
- <button type="button" @click="${this.onNowClick}">${this.nowLabel}</button>
410
- </div>
411
- </div>
412
- `;
413
- }
414
- }
415
- l([
416
- s("button.date")
417
- ], r.prototype, "dateTriggerEl");
418
- l([
419
- s("button.time")
420
- ], r.prototype, "timeTriggerEl");
421
- l([
422
- s(".input-group")
423
- ], r.prototype, "inputGroupEl");
424
- l([
425
- s(".popup-date")
426
- ], r.prototype, "datePopupEl");
427
- l([
428
- s(".popup-time")
429
- ], r.prototype, "timePopupEl");
430
- typeof customElements < "u" && !customElements.get("mp-datetime-picker") && customElements.define("mp-datetime-picker", r);
1
+ import { M as m } from "../chunks/mp-datetime-picker.element-MPTRHwyc.mjs";
431
2
  export {
432
- r as MpDatetimePickerElement
3
+ m as MpDatetimePickerElement
433
4
  };
@@ -75,6 +75,16 @@ export declare class MpDatetimePickerElement extends LitElement {
75
75
  type: BooleanConstructor;
76
76
  reflect: boolean;
77
77
  };
78
+ invalid: {
79
+ attribute: string;
80
+ type: BooleanConstructor;
81
+ reflect: boolean;
82
+ };
83
+ errorText: {
84
+ attribute: string;
85
+ type: StringConstructor;
86
+ reflect: boolean;
87
+ };
78
88
  inputLabel: {
79
89
  attribute: string;
80
90
  type: StringConstructor;
@@ -124,6 +134,20 @@ export declare class MpDatetimePickerElement extends LitElement {
124
134
  placeholder: string;
125
135
  showClear: boolean;
126
136
  disabled: boolean;
137
+ invalid: boolean;
138
+ /**
139
+ * Validation message, as `errorText` / `error-text`. Rendered as a
140
+ * `.invalid-feedback` node in this shadow root and referenced from the
141
+ * display input, which is the role-bearing control — only while `invalid`
142
+ * is also set, since `aria-errormessage` is defined only on an
143
+ * `aria-invalid` control.
144
+ *
145
+ * Text rather than an IDREF because an IDREF cannot cross a shadow
146
+ * boundary: a consumer's `aria-describedby` on this host would point at a
147
+ * node this element's input cannot see, and the host itself carries no
148
+ * role for it to land on. So the message has to travel in as text.
149
+ */
150
+ errorText: string | null;
127
151
  inputLabel: string;
128
152
  dateButtonLabel: string;
129
153
  timeButtonLabel: string;
@@ -136,6 +160,18 @@ export declare class MpDatetimePickerElement extends LitElement {
136
160
  protected readonly instanceId: string;
137
161
  protected readonly datePopupId: string;
138
162
  protected readonly timePopupId: string;
163
+ protected readonly errorId: string;
164
+ protected displayInputEl?: HTMLInputElement;
165
+ /**
166
+ * Focusing the picker means focusing its display input — the node that
167
+ * carries the accessible name, the invalid state and the error message's
168
+ * description, so it is also the node that must receive focus for a
169
+ * validation message to be spoken.
170
+ *
171
+ * An override rather than `delegatesFocus: true`, which would change what a
172
+ * click anywhere in the input-group focuses for every consumer.
173
+ */
174
+ focus(options?: FocusOptions): void;
139
175
  protected dateTriggerEl?: HTMLButtonElement;
140
176
  protected timeTriggerEl?: HTMLButtonElement;
141
177
  protected inputGroupEl?: HTMLElement;
@@ -169,6 +205,36 @@ export declare class MpDatetimePickerElement extends LitElement {
169
205
  protected onTimeListSelectedTimeChange: (event: Event) => void;
170
206
  protected onTodayClick: () => void;
171
207
  protected onNowClick: () => void;
208
+ /** `Now`, snapped down to the nearest step — the value that button writes. */
209
+ private roundedNow;
210
+ /**
211
+ * `Today` and `Now` used to write their value with no bound check at all, so
212
+ * a footer button escaped a constraint the grid one layer below enforced.
213
+ * They are DISABLED rather than silently ignored — a control that does
214
+ * nothing when pressed is the worse of the two failures.
215
+ */
216
+ private todayOutOfRange;
217
+ /**
218
+ * `Now` writes only the TIME half, onto whichever day is currently selected,
219
+ * so it is bounded by that day's derived range — not by "is now within
220
+ * min..max", which would be a different question entirely.
221
+ */
222
+ private nowOutOfRange;
223
+ /**
224
+ * The time list's bounds for the day being edited (D12.15 #1/#2).
225
+ *
226
+ * A bound only constrains the CLOCK on its own day: an end on a later day
227
+ * gets the full 24 hours, which is what Google Calendar and Outlook both do.
228
+ * Forwarding `min`/`max` verbatim — as this element failed to do at all,
229
+ * while both its siblings did — would instead grey out the same clock range
230
+ * on every day.
231
+ *
232
+ * The day in question is `value ?? today` — not a guess, but exactly what
233
+ * `updateTimePart` will compose the picked time with when no date has been
234
+ * chosen yet. Deriving it from anything else would bound a day the pick is
235
+ * not going to land on.
236
+ */
237
+ private timeBounds;
172
238
  protected render(): TemplateResult;
173
239
  }
174
240
  export {};
@@ -8,7 +8,7 @@ import { createRef as $, ref as x } from "lit/directives/ref.js";
8
8
  import { styleMap as C } from "lit/directives/style-map.js";
9
9
  import "../chunks/mp-splitter-LszuRDbR.mjs";
10
10
  import "../chunks/mp-treeview-tkWu28iF.mjs";
11
- import "../chunks/mp-datatable-BwTlh9A_.mjs";
11
+ import "../chunks/mp-datatable-25O1GtvU.mjs";
12
12
  const k = g(`:host {
13
13
  display: flex;
14
14
  flex-direction: column;
package/navbar/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { unsafeCSS as n, LitElement as d, html as o } from "lit";
2
- import { O as v } from "../chunks/overlay-controller-DPt13i8p.mjs";
2
+ import { O as v } from "../chunks/overlay-controller-D6agzzOI.mjs";
3
3
  const p = n(`.navbar {
4
4
  --bs-navbar-padding-x: 0;
5
5
  --bs-navbar-padding-y: 0.5rem;
@@ -1,6 +1,7 @@
1
1
  import { html as b, unsafeCSS as v, LitElement as f } from "lit";
2
2
  import "lit/directives/ref.js";
3
- import { F as x, e as _ } from "../chunks/form-associated-axmc5sY0.mjs";
3
+ import { e as x } from "../chunks/error-text-B45eDAt1.mjs";
4
+ import { F as _ } from "../chunks/form-associated-BR-fUvZ1.mjs";
4
5
  import { i as y } from "../chunks/invalid-feedback.styles-he0JYrJm.mjs";
5
6
  b`<!-- Hidden input + boxes are rendered dynamically by render(). This file exists
6
7
  so the codegen-wc target produces a \`styles\` export from the sibling .scss;
@@ -129,7 +130,7 @@ const w = v(`:host {
129
130
  }
130
131
  }`);
131
132
  let A = 0;
132
- class o extends x(f) {
133
+ class o extends _(f) {
133
134
  constructor() {
134
135
  super(...arguments), this.type = "numeric", this.case = "upper", this.size = "md", this.disabled = !1, this.inputLabel = null, this.ariaLabelForRender = null, this.invalid = !1, this.errorText = null, this._value = "", this._groups = [...o.DEFAULT_GROUPS], this._revealedIndex = null, this._revealedUntil = 0, this._revealTimer = null, this._inputEl = null, this._isFocused = !1, this._errorId = `mp-otp-input-${++A}-error`, this.onInput = (e) => {
135
136
  const t = e.target, i = t.value, s = this._value, a = s.length === this.totalLength() && s.length > 0, r = this.normaliseValue(i), l = r.length - s.length;
@@ -318,7 +319,7 @@ class o extends x(f) {
318
319
  }
319
320
  // ------- render -------
320
321
  render() {
321
- const e = this._groups, t = this._value, i = this.boundaries(), s = i[i.length - 1], a = this._inputEl?.selectionEnd ?? t.length, r = this._isFocused ? this.activeBoxIndex(a, t.length, i) : null, u = this.type === "numeric" && e.every((h) => h === 1) ? "one-time-code" : "off", c = this.type === "numeric" ? "numeric" : "text", d = this.getAttribute("aria-label") ?? this.inputLabel ?? "One-time code", p = _(this._errorId, this.errorText, this.invalid);
322
+ const e = this._groups, t = this._value, i = this.boundaries(), s = i[i.length - 1], a = this._inputEl?.selectionEnd ?? t.length, r = this._isFocused ? this.activeBoxIndex(a, t.length, i) : null, u = this.type === "numeric" && e.every((h) => h === 1) ? "one-time-code" : "off", c = this.type === "numeric" ? "numeric" : "text", d = this.getAttribute("aria-label") ?? this.inputLabel ?? "One-time code", p = x(this._errorId, this.errorText, this.invalid);
322
323
  return b`
323
324
  <div class="container" part="container">
324
325
  <input
package/overlay/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { O as e } from "../chunks/overlay-controller-DPt13i8p.mjs";
1
+ import { O as e } from "../chunks/overlay-controller-D6agzzOI.mjs";
2
2
  export {
3
3
  e as OverlayController
4
4
  };
@@ -164,6 +164,19 @@ export declare class OverlayController implements ReactiveController {
164
164
  hostConnected(): void;
165
165
  hostDisconnected(): void;
166
166
  get isOpen(): boolean;
167
+ /**
168
+ * Whether this overlay is the top-most dismissible layer — i.e. whether an
169
+ * Escape belongs to IT rather than to something opened on top of it.
170
+ *
171
+ * The controller already applies this to its own document-level Escape
172
+ * handler. It is public because a host that ALSO handles Escape itself must
173
+ * ask the same question: such a handler sits on the element, so it runs
174
+ * before any document-level one, and would otherwise dismiss itself out from
175
+ * under a nested overlay it contains (an editor closing when the user meant
176
+ * to close the date picker inside it). Decline when this is false, and do not
177
+ * stop propagation, so the event still reaches the layer that owns it.
178
+ */
179
+ get isTopmost(): boolean;
167
180
  open(): Promise<void>;
168
181
  close(returnFocus?: boolean): void;
169
182
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintplayer/web-components",
3
- "version": "2.4.0",
3
+ "version": "2.7.0",
4
4
  "description": "Framework-agnostic Lit web components for the @mintplayer/bootstrap design system. Consumed by @mintplayer/ng-bootstrap, @mintplayer/react-bootstrap, and @mintplayer/vue-bootstrap.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,8 +1,8 @@
1
1
  import { html as d, unsafeCSS as S, LitElement as R, nothing as u } from "lit";
2
2
  import { createContext as A, ContextConsumer as p, ContextProvider as k } from "@lit/context";
3
3
  import { createRef as ee, ref as te } from "lit/directives/ref.js";
4
- import "../chunks/mp-select-Ctu-v1-p.mjs";
5
- import "../chunks/mp-checkbox-Ph2mMRGz.mjs";
4
+ import "../chunks/mp-select-CKX0eM5C.mjs";
5
+ import "../chunks/mp-checkbox-6EJwdUIn.mjs";
6
6
  const j = {
7
7
  string: [
8
8
  "equals",
package/radio/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { M as p } from "../chunks/mp-radio-BjW1HNSc.mjs";
1
+ import { M as p } from "../chunks/mp-radio-DvKgrTFL.mjs";
2
2
  export {
3
3
  p as MpRadio
4
4
  };
@@ -1,8 +1,8 @@
1
1
  import { unsafeCSS as d, LitElement as f, html as b } from "lit";
2
2
  import "lit/directives/ref.js";
3
3
  import { l as m, f as c, n as h } from "../chunks/roving-focus-CrL9982a.mjs";
4
- import { F as g } from "../chunks/form-associated-axmc5sY0.mjs";
5
- import "../chunks/mp-radio-BjW1HNSc.mjs";
4
+ import { F as g } from "../chunks/form-associated-BR-fUvZ1.mjs";
5
+ import "../chunks/mp-radio-DvKgrTFL.mjs";
6
6
  const p = d(`:host {
7
7
  display: block;
8
8
  }`);
package/ribbon/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LitElement as k, css as g, nothing as L, html as d } from "lit";
2
2
  import { property as l, state as _, query as S } from "lit/decorators.js";
3
3
  import { L as se } from "../chunks/live-announcer-Bi0orG4n.mjs";
4
- import { O as G } from "../chunks/overlay-controller-DPt13i8p.mjs";
4
+ import { O as G } from "../chunks/overlay-controller-D6agzzOI.mjs";
5
5
  var be = Object.defineProperty, A = (s, e, i, r) => {
6
6
  for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
7
7
  (n = s[o]) && (t = n(e, i, t) || t);