@mintplayer/web-components 2.1.1 → 2.3.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 +26 -2
- package/a11y/src/dismiss-stack.d.ts +25 -0
- package/a11y/src/error-text.d.ts +41 -0
- package/a11y/src/focus-restore.d.ts +116 -0
- package/a11y/src/focus-trap.d.ts +69 -0
- package/a11y/src/form-associated.d.ts +48 -0
- package/a11y/src/host-aria.d.ts +154 -0
- package/a11y/src/index.d.ts +16 -0
- package/a11y/src/inert-regions.d.ts +52 -0
- package/a11y/src/live-announcer.d.ts +8 -0
- package/a11y/src/roving-focus.d.ts +118 -0
- package/a11y/src/testing/expect-idref-resolves.d.ts +31 -0
- package/a11y/src/testing/index.d.ts +1 -0
- package/accordion/index.d.ts +1 -0
- package/accordion/index.mjs +549 -0
- package/accordion/src/components/index.d.ts +3 -0
- package/accordion/src/components/mp-accordion-tab.d.ts +30 -0
- package/accordion/src/components/mp-accordion.d.ts +66 -0
- package/accordion/src/index.d.ts +3 -0
- package/accordion/src/styles/index.d.ts +1 -0
- package/calendar/index.mjs +1 -1
- package/calendar/src/mp-calendar.element.d.ts +2 -0
- package/carousel/index.d.ts +1 -0
- package/carousel/index.mjs +994 -0
- package/carousel/src/components/index.d.ts +1 -0
- package/carousel/src/components/mp-carousel.d.ts +58 -0
- package/carousel/src/index.d.ts +3 -0
- package/carousel/src/styles/index.d.ts +1 -0
- package/carousel/src/types/carousel.d.ts +10 -0
- package/carousel/src/types/index.d.ts +1 -0
- package/checkbox/index.mjs +1 -1
- package/checkbox/src/components/mp-checkbox.d.ts +59 -1
- package/chunks/focus-restore-DxuP1Oe2.mjs +94 -0
- package/chunks/focus-trap-DTOLJ5bb.mjs +121 -0
- package/chunks/form-associated-axmc5sY0.mjs +58 -0
- package/chunks/host-aria-WSGs7SPQ.mjs +152 -0
- package/chunks/inert-regions-DXCnn1LN.mjs +48 -0
- package/chunks/invalid-feedback.styles-he0JYrJm.mjs +11 -0
- package/chunks/{live-announcer-CZDTKulf.mjs → live-announcer-Bi0orG4n.mjs} +9 -9
- package/chunks/{mp-calendar.element-UC68iDbi.mjs → mp-calendar.element-u6uS31_j.mjs} +136 -105
- package/chunks/mp-checkbox-Ph2mMRGz.mjs +312 -0
- package/chunks/{mp-datatable-Bfw0KGkV.mjs → mp-datatable-BwTlh9A_.mjs} +265 -103
- package/chunks/{mp-pagination-BGxsawFL.mjs → mp-pagination-Dea75mD4.mjs} +25 -22
- package/chunks/mp-radio-BjW1HNSc.mjs +300 -0
- package/chunks/{mp-select-BDS1-YGn.mjs → mp-select-Ctu-v1-p.mjs} +163 -40
- package/chunks/{mp-splitter-C8cGCmac.mjs → mp-splitter-LszuRDbR.mjs} +53 -46
- package/chunks/{mp-tab-page-D1b4x-y2.mjs → mp-tab-page-CaCzX1ym.mjs} +46 -45
- package/chunks/{mp-timepicker.element-BwEiwX92.mjs → mp-timepicker.element-Bz393NDQ.mjs} +93 -86
- package/chunks/{mp-toggle-button-dLZNDUVz.mjs → mp-toggle-button-Kz6sIgBJ.mjs} +131 -37
- package/chunks/{mp-treeview-C48F63xb.mjs → mp-treeview-tkWu28iF.mjs} +67 -43
- package/chunks/overlay-controller-DPt13i8p.mjs +314 -0
- package/chunks/roving-focus-CrL9982a.mjs +129 -0
- package/code-snippet/index.mjs +21 -13
- package/code-snippet/src/mp-code-snippet.element.d.ts +6 -0
- package/datatable/index.mjs +1 -1
- package/datatable/src/components/mp-datatable.d.ts +50 -0
- package/datatable/src/types/index.d.ts +2 -0
- package/datatable/src/types/labels.d.ts +30 -0
- package/datepicker/index.mjs +45 -22
- package/datepicker/src/mp-datepicker.element.d.ts +30 -0
- package/datetime-picker/index.mjs +15 -9
- package/dock/index.mjs +365 -209
- package/dock/src/components/mint-dock-manager.element.d.ts +63 -3
- package/dropdown-menu/index.mjs +135 -90
- package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +12 -3
- package/file-manager/index.mjs +279 -214
- package/file-manager/src/components/mp-file-manager.d.ts +22 -0
- package/file-manager/src/types/messages.d.ts +9 -0
- package/multi-range/index.mjs +26 -10
- package/multi-range/src/mint-multi-range.element.d.ts +7 -0
- package/navbar/index.mjs +53 -39
- package/navbar/src/components/mp-navbar.d.ts +1 -0
- package/otp-input/index.mjs +82 -48
- package/otp-input/src/mint-otp-input.element.d.ts +31 -3
- package/overlay/index.mjs +2 -258
- package/overlay/src/overlay-controller.d.ts +64 -4
- package/package.json +21 -1
- package/pagination/index.mjs +1 -1
- package/query-builder/index.mjs +117 -87
- package/query-builder/src/model/messages.d.ts +9 -0
- package/radio/index.mjs +2 -160
- package/radio/src/components/mp-radio.d.ts +58 -3
- package/radio-group/index.d.ts +1 -0
- package/radio-group/index.mjs +145 -0
- package/radio-group/src/components/mp-radio-group.d.ts +52 -0
- package/radio-group/src/index.d.ts +1 -0
- package/radio-group/src/styles/radio-group.styles.d.ts +2 -0
- package/ribbon/index.mjs +316 -304
- package/ribbon/src/mp-ribbon.element.d.ts +16 -0
- package/scheduler/index.mjs +219 -132
- package/scheduler/src/components/mp-scheduler.d.ts +3 -0
- package/scheduler/src/views/base-view.d.ts +23 -0
- package/select/index.mjs +1 -1
- package/select/src/components/mp-select.d.ts +60 -3
- package/shell/index.mjs +142 -31
- package/shell/src/components/mp-shell.d.ts +1 -0
- package/signature-pad/index.d.ts +1 -0
- package/signature-pad/index.mjs +230 -0
- package/signature-pad/src/index.d.ts +2 -0
- package/signature-pad/src/mp-signature-pad.element.d.ts +143 -0
- package/signature-pad/src/mp-signature-pad.element.template.d.ts +2 -0
- package/signature-pad/src/types/signature.d.ts +12 -0
- package/splitter/index.mjs +1 -1
- package/splitter/src/components/mp-splitter.d.ts +7 -0
- package/splitter/src/index.d.ts +1 -1
- package/swiper-core/index.d.ts +1 -0
- package/swiper-core/index.mjs +184 -0
- package/swiper-core/src/index-machine.d.ts +59 -0
- package/swiper-core/src/index.d.ts +4 -0
- package/swiper-core/src/keymap.d.ts +2 -0
- package/swiper-core/src/models/index.d.ts +1 -0
- package/swiper-core/src/models/types.d.ts +99 -0
- package/swiper-core/src/pointer-arbiter.d.ts +45 -0
- package/tab-control/index.mjs +1 -1
- package/tile-manager/index.mjs +110 -93
- package/timeline/index.mjs +138 -54
- package/timeline/src/components/mp-timeline.d.ts +15 -0
- package/timepicker/index.mjs +1 -1
- package/timepicker/src/mp-time-list.element.d.ts +13 -4
- package/timepicker/src/mp-timepicker.element.d.ts +29 -0
- package/toggle-button/index.mjs +1 -1
- package/toggle-button/src/components/mp-toggle-button.d.ts +32 -1
- package/tree-select/index.mjs +233 -121
- package/tree-select/src/components/mp-tree-select.d.ts +37 -0
- package/treeview/index.mjs +1 -1
- package/treeview/src/components/mp-treeview.d.ts +10 -1
- package/chunks/mp-checkbox-BokLL7BS.mjs +0 -211
- package/dropdown/src/styles/dropdown.styles.d.ts +0 -2
package/scheduler/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { unsafeCSS as W, LitElement as B, html as U } from "lit";
|
|
2
|
-
import { L as O } from "../chunks/live-announcer-
|
|
3
|
-
import { D as N, d as h, t as M, k as I, r as S, m as $, l as
|
|
2
|
+
import { L as O } from "../chunks/live-announcer-Bi0orG4n.mjs";
|
|
3
|
+
import { D as N, d as h, t as M, k as I, r as S, m as $, l as H, g as V } from "../chunks/color-CyamnJnn.mjs";
|
|
4
4
|
function q(g = {}) {
|
|
5
5
|
const e = { ...N, ...g };
|
|
6
6
|
return {
|
|
@@ -291,7 +291,7 @@ class Y {
|
|
|
291
291
|
this.setState({ focusedDate: e });
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function P(g, e, t = "24h") {
|
|
295
295
|
const s = h.formatTime(g.start, t), n = h.formatTime(g.end, t), i = g.start.toLocaleDateString(void 0, { weekday: "long", month: "short", day: "numeric" }), o = [`${g.title}, ${s}–${n}`, i];
|
|
296
296
|
return e && o.push(`on ${e}`), o.join(", ");
|
|
297
297
|
}
|
|
@@ -366,6 +366,30 @@ class x {
|
|
|
366
366
|
clearContainer() {
|
|
367
367
|
this.container.innerHTML = "";
|
|
368
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* Retrofit the ARIA grid chain onto a rendered view (wc-aria PRD step 5.7):
|
|
371
|
+
* the container claims `grid`, layout-only wrappers become `presentation`
|
|
372
|
+
* so they stop breaking the chain, the header strip becomes the
|
|
373
|
+
* column-header row, and the cell groups named by `rows` become rows. The
|
|
374
|
+
* cells themselves already carry role="gridcell" + ids + roving tabindex.
|
|
375
|
+
*
|
|
376
|
+
* The mapping is pragmatic, not ideal: week/day DOM is COLUMN-major (a row
|
|
377
|
+
* here is one day's column of time cells), because the layout was built
|
|
378
|
+
* for CSS first. The cells' focus announcements carry full day+time, so
|
|
379
|
+
* navigation stays understandable.
|
|
380
|
+
*/
|
|
381
|
+
applyGridRoles(e) {
|
|
382
|
+
const t = this.container;
|
|
383
|
+
t.getAttribute("role") !== "grid" && t.setAttribute("role", "grid");
|
|
384
|
+
const s = (n, i) => t.querySelectorAll(n).forEach((o) => {
|
|
385
|
+
o.hasAttribute("role") || o.setAttribute("role", i);
|
|
386
|
+
});
|
|
387
|
+
e.columnHeaderRow && s(e.columnHeaderRow, "row"), e.columnHeaders && s(e.columnHeaders, "columnheader"), (e.presentation ?? []).forEach((n) => s(n, "presentation")), e.rows && s(e.rows, "row"), e.cells && s(e.cells, "gridcell");
|
|
388
|
+
}
|
|
389
|
+
/** aria-current="date" on every element the views styled `.today`. */
|
|
390
|
+
markToday() {
|
|
391
|
+
this.container.querySelectorAll(".today").forEach((e) => e.setAttribute("aria-current", "date"));
|
|
392
|
+
}
|
|
369
393
|
}
|
|
370
394
|
class A extends x {
|
|
371
395
|
constructor() {
|
|
@@ -379,7 +403,7 @@ class A extends x {
|
|
|
379
403
|
const o = this.createMonthCard(i);
|
|
380
404
|
n.appendChild(o);
|
|
381
405
|
}
|
|
382
|
-
this.container.appendChild(n), this.updateMonthCardFocus();
|
|
406
|
+
this.container.appendChild(n), this.applyGridRoles({ rows: ".scheduler-year-grid" }), this.markToday(), this.updateMonthCardFocus();
|
|
383
407
|
}
|
|
384
408
|
/**
|
|
385
409
|
* Build a `YYYY-MM` key from a Date, which is the unit of focus on year
|
|
@@ -393,24 +417,24 @@ class A extends x {
|
|
|
393
417
|
const { events: t, options: s } = this.state, n = this.createElement("div", "scheduler-year-month"), i = A.monthKey(e);
|
|
394
418
|
n.setAttribute("role", "gridcell"), n.setAttribute("tabindex", "-1"), n.setAttribute("aria-selected", "false"), n.id = `scheduler-cell-y-${i}`, this.setData(n, { month: e.toISOString() }), this.monthCards.set(i, n);
|
|
395
419
|
const o = this.createElement("div", "scheduler-year-month-header");
|
|
396
|
-
o.textContent = h.getMonthName(e, s.locale), this.setData(o, { month: e.toISOString() }), n.appendChild(o);
|
|
420
|
+
o.textContent = h.getMonthName(e, s.locale), o.setAttribute("role", "button"), o.setAttribute("tabindex", "0"), this.setData(o, { month: e.toISOString() }), n.appendChild(o);
|
|
397
421
|
const r = this.createElement("div", "scheduler-mini-month"), a = h.getMonthWeeks(e, s.firstDayOfWeek), l = a[0];
|
|
398
422
|
for (const m of l) {
|
|
399
|
-
const
|
|
400
|
-
|
|
423
|
+
const v = this.createElement("div", "scheduler-mini-day", "header");
|
|
424
|
+
v.textContent = h.getDayName(m, s.locale, "narrow"), v.style.fontWeight = "600", v.style.color = "#666", r.appendChild(v);
|
|
401
425
|
}
|
|
402
|
-
const d = h.getMonthStart(e), c = h.getMonthEnd(e), u = M.filterByRange(t, d, c),
|
|
426
|
+
const d = h.getMonthStart(e), c = h.getMonthEnd(e), u = M.filterByRange(t, d, c), p = /* @__PURE__ */ new Set();
|
|
403
427
|
for (const m of u) {
|
|
404
|
-
const
|
|
405
|
-
for (
|
|
406
|
-
|
|
428
|
+
const v = new Date(m.start);
|
|
429
|
+
for (v.setHours(0, 0, 0, 0); v <= m.end; )
|
|
430
|
+
p.add(v.toISOString().split("T")[0]), v.setDate(v.getDate() + 1);
|
|
407
431
|
}
|
|
408
432
|
for (const m of a)
|
|
409
|
-
for (const
|
|
433
|
+
for (const v of m) {
|
|
410
434
|
const f = this.createElement("div", "scheduler-mini-day");
|
|
411
|
-
f.textContent = String(
|
|
412
|
-
const b =
|
|
413
|
-
|
|
435
|
+
f.textContent = String(v.getDate()), this.setData(f, { date: v.toISOString() }), h.isSameMonth(v, e) || f.classList.add("other-month"), h.isToday(v) && f.classList.add("today");
|
|
436
|
+
const b = v.toISOString().split("T")[0];
|
|
437
|
+
p.has(b) && f.classList.add("has-events"), r.appendChild(f);
|
|
414
438
|
}
|
|
415
439
|
return n.appendChild(r), n;
|
|
416
440
|
}
|
|
@@ -454,12 +478,20 @@ class T extends x {
|
|
|
454
478
|
}
|
|
455
479
|
this.container.appendChild(n);
|
|
456
480
|
const o = this.createElement("div", "scheduler-month-grid");
|
|
457
|
-
for (const r of s)
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
481
|
+
for (const r of s) {
|
|
482
|
+
const a = this.createElement("div", "scheduler-month-week");
|
|
483
|
+
for (const l of r) {
|
|
484
|
+
const d = this.createDayCell(l);
|
|
485
|
+
a.appendChild(d);
|
|
461
486
|
}
|
|
462
|
-
|
|
487
|
+
o.appendChild(a);
|
|
488
|
+
}
|
|
489
|
+
this.container.appendChild(o), this.renderEvents(), this.updateDayCellFocus(), this.applyGridRoles({
|
|
490
|
+
columnHeaderRow: ":scope > .scheduler-day-headers",
|
|
491
|
+
columnHeaders: ".scheduler-day-headers > .scheduler-day-header",
|
|
492
|
+
presentation: [".scheduler-month-grid"],
|
|
493
|
+
rows: ".scheduler-month-week"
|
|
494
|
+
}), this.markToday();
|
|
463
495
|
}
|
|
464
496
|
/**
|
|
465
497
|
* Build a `YYYY-MM-DD` key from a Date using *local* components. Using
|
|
@@ -502,27 +534,27 @@ class T extends x {
|
|
|
502
534
|
o.setHours(23, 59, 59, 999);
|
|
503
535
|
const r = M.filterByRange(t, i, o), a = /* @__PURE__ */ new Map();
|
|
504
536
|
for (const d of r) {
|
|
505
|
-
const c = new Date(d.start), u = new Date(d.end),
|
|
506
|
-
for (
|
|
507
|
-
const m = T.dayKey(
|
|
508
|
-
a.has(m) || a.set(m, []), a.get(m).push(d),
|
|
537
|
+
const c = new Date(d.start), u = new Date(d.end), p = new Date(c);
|
|
538
|
+
for (p.setHours(0, 0, 0, 0); p <= u; ) {
|
|
539
|
+
const m = T.dayKey(p);
|
|
540
|
+
a.has(m) || a.set(m, []), a.get(m).push(d), p.setDate(p.getDate() + 1);
|
|
509
541
|
}
|
|
510
542
|
}
|
|
511
543
|
const l = typeof s.dayMaxEvents == "number" ? s.dayMaxEvents : 3;
|
|
512
544
|
for (const [d, c] of a) {
|
|
513
545
|
const u = this.dayCells.get(d);
|
|
514
546
|
if (!u) continue;
|
|
515
|
-
const
|
|
516
|
-
if (!
|
|
517
|
-
|
|
518
|
-
const m = c.slice(0, l),
|
|
547
|
+
const p = u.querySelector(".month-events");
|
|
548
|
+
if (!p) continue;
|
|
549
|
+
p.innerHTML = "";
|
|
550
|
+
const m = c.slice(0, l), v = c.length - m.length;
|
|
519
551
|
for (const f of m) {
|
|
520
552
|
const b = this.createElement("div", "scheduler-month-event");
|
|
521
|
-
b.textContent = f.title, b.style.backgroundColor = f.color ?? "#3788d8", b.style.color = f.textColor ?? I(f.color ?? "#3788d8"), this.setData(b, { eventId: f.id }),
|
|
553
|
+
b.textContent = f.title, b.style.backgroundColor = f.color ?? "#3788d8", b.style.color = f.textColor ?? I(f.color ?? "#3788d8"), b.setAttribute("role", "button"), b.setAttribute("tabindex", "0"), b.setAttribute("aria-label", P(f, null, this.state.options.timeFormat)), this.setData(b, { eventId: f.id }), p.appendChild(b);
|
|
522
554
|
}
|
|
523
|
-
if (
|
|
555
|
+
if (v > 0) {
|
|
524
556
|
const f = this.createElement("div", "scheduler-more-link");
|
|
525
|
-
f.textContent = `+${
|
|
557
|
+
f.textContent = `+${v} more`, f.setAttribute("role", "button"), f.setAttribute("tabindex", "0"), this.setData(f, { date: d }), p.appendChild(f);
|
|
526
558
|
}
|
|
527
559
|
}
|
|
528
560
|
}
|
|
@@ -554,8 +586,8 @@ class J extends x {
|
|
|
554
586
|
h.isToday(d) && c.classList.add("today");
|
|
555
587
|
const u = this.createElement("div", "day-name");
|
|
556
588
|
u.textContent = h.getDayName(d, t.locale);
|
|
557
|
-
const
|
|
558
|
-
|
|
589
|
+
const p = this.createElement("div", "day-number");
|
|
590
|
+
p.textContent = String(d.getDate()), c.appendChild(u), c.appendChild(p), n.appendChild(c);
|
|
559
591
|
}
|
|
560
592
|
this.container.appendChild(n);
|
|
561
593
|
const o = this.createElement("div", "scheduler-time-grid"), r = this.createElement("div", "scheduler-time-gutter"), a = h.getTimeSlots(
|
|
@@ -575,17 +607,17 @@ class J extends x {
|
|
|
575
607
|
const c = s[d], u = this.createElement("div", "scheduler-day-column");
|
|
576
608
|
this.setData(u, { dayIndex: d });
|
|
577
609
|
for (let m = 0; m < a.length; m++) {
|
|
578
|
-
const
|
|
610
|
+
const v = a[m], f = new Date(c);
|
|
579
611
|
f.setHours(
|
|
580
|
-
|
|
581
|
-
|
|
612
|
+
v.start.getHours(),
|
|
613
|
+
v.start.getMinutes(),
|
|
582
614
|
0,
|
|
583
615
|
0
|
|
584
616
|
);
|
|
585
617
|
const b = new Date(c);
|
|
586
618
|
b.setHours(
|
|
587
|
-
|
|
588
|
-
|
|
619
|
+
v.end.getHours(),
|
|
620
|
+
v.end.getMinutes(),
|
|
589
621
|
0,
|
|
590
622
|
0
|
|
591
623
|
);
|
|
@@ -596,13 +628,29 @@ class J extends x {
|
|
|
596
628
|
start: f.toISOString(),
|
|
597
629
|
end: b.toISOString()
|
|
598
630
|
});
|
|
599
|
-
const
|
|
600
|
-
this.slotElements.set(
|
|
631
|
+
const w = `${d}-${m}`;
|
|
632
|
+
this.slotElements.set(w, y), u.appendChild(y);
|
|
601
633
|
}
|
|
602
|
-
const
|
|
603
|
-
u.appendChild(
|
|
604
|
-
}
|
|
605
|
-
o.appendChild(l), this.container.appendChild(o), this.renderEvents(), this.updateCellFocusAndSelection(), this.renderNowIndicator(s, a)
|
|
634
|
+
const p = this.createElement("div", "scheduler-events-container");
|
|
635
|
+
u.appendChild(p), this.dayColumns.push(u), l.appendChild(u);
|
|
636
|
+
}
|
|
637
|
+
o.appendChild(l), this.container.appendChild(o), this.renderEvents(), this.updateCellFocusAndSelection(), this.renderNowIndicator(s, a), this.applyGridRoles({
|
|
638
|
+
columnHeaderRow: ":scope > .scheduler-day-headers",
|
|
639
|
+
columnHeaders: ".scheduler-day-headers > .scheduler-day-header",
|
|
640
|
+
presentation: [
|
|
641
|
+
".scheduler-time-gutter-space",
|
|
642
|
+
".scheduler-time-grid",
|
|
643
|
+
".scheduler-time-gutter",
|
|
644
|
+
".scheduler-time-slot-label",
|
|
645
|
+
".scheduler-days-container"
|
|
646
|
+
],
|
|
647
|
+
rows: ".scheduler-day-column",
|
|
648
|
+
// The events overlay is a CELL, not presentation: a presentational
|
|
649
|
+
// wrapper leaves its role=button events owned directly by the row,
|
|
650
|
+
// which is invalid (axe aria-required-children). A gridcell may
|
|
651
|
+
// contain buttons.
|
|
652
|
+
cells: ".scheduler-events-container"
|
|
653
|
+
}), this.markToday();
|
|
606
654
|
}
|
|
607
655
|
update(e) {
|
|
608
656
|
const t = this.state.date.getTime() !== e.date.getTime(), s = this.optionsRequireRerender(this.state.options, e.options), n = this.state.selectedEvent?.id !== e.selectedEvent?.id;
|
|
@@ -646,16 +694,16 @@ class J extends x {
|
|
|
646
694
|
}
|
|
647
695
|
const l = M.filterPartsByRange(a, i, o), d = M.getTimelinedParts(l);
|
|
648
696
|
this.eventElements.forEach((c) => c.remove()), this.eventElements.clear();
|
|
649
|
-
for (const { part: c, trackIndex: u, totalTracks:
|
|
697
|
+
for (const { part: c, trackIndex: u, totalTracks: p, colspan: m } of d) {
|
|
650
698
|
if (!c.event) continue;
|
|
651
|
-
const
|
|
652
|
-
if (
|
|
653
|
-
const b = this.dayColumns[
|
|
699
|
+
const v = n.findIndex((w) => h.isSameDay(w, c.start));
|
|
700
|
+
if (v === -1) continue;
|
|
701
|
+
const b = this.dayColumns[v].querySelector(".scheduler-events-container");
|
|
654
702
|
if (!b) continue;
|
|
655
703
|
const y = this.createEventElement(
|
|
656
704
|
c,
|
|
657
705
|
u,
|
|
658
|
-
|
|
706
|
+
p,
|
|
659
707
|
m,
|
|
660
708
|
s.slotDuration ?? 1800
|
|
661
709
|
);
|
|
@@ -663,26 +711,26 @@ class J extends x {
|
|
|
663
711
|
}
|
|
664
712
|
}
|
|
665
713
|
createEventElement(e, t, s, n, i) {
|
|
666
|
-
const o = e.event, r = this.createElement("div", "scheduler-event"), a = this.state.selectedEvent?.id === o.id
|
|
667
|
-
r.setAttribute("role", "button"), r.setAttribute("tabindex", "0"), r.setAttribute(
|
|
714
|
+
const o = e.event, r = this.createElement("div", "scheduler-event"), a = this.state.selectedEvent?.id === o.id;
|
|
715
|
+
this.state.keyboardMoveEventId, o.id, r.setAttribute("role", "button"), r.setAttribute("tabindex", "0"), r.setAttribute(
|
|
668
716
|
"aria-label",
|
|
669
|
-
|
|
670
|
-
),
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
const
|
|
674
|
-
r.style.top = `${
|
|
675
|
-
const
|
|
676
|
-
|
|
677
|
-
const
|
|
678
|
-
if (
|
|
717
|
+
P(o, null, this.state.options.timeFormat)
|
|
718
|
+
), r.setAttribute("aria-pressed", a ? "true" : "false"), a && r.classList.add("selected");
|
|
719
|
+
const l = new Date(e.start);
|
|
720
|
+
l.setHours(0, 0, 0, 0);
|
|
721
|
+
const d = (e.start.getTime() - l.getTime()) / (1e3 * 60), u = (e.end.getTime() - l.getTime()) / (1e3 * 60) - d, p = i / 60, m = d / p * 40, v = Math.max(u / p * 40, 20), f = t / s * 100, b = n / s * 100;
|
|
722
|
+
r.style.top = `${m}px`, r.style.height = `${v}px`, r.style.left = `${f}%`, r.style.width = `calc(${b}% - 2px)`, r.style.backgroundColor = o.color ?? "#3788d8", r.style.color = o.textColor ?? I(o.color ?? "#3788d8"), this.setData(r, { eventId: o.id });
|
|
723
|
+
const y = this.createElement("div", "event-title");
|
|
724
|
+
y.textContent = o.title, r.appendChild(y);
|
|
725
|
+
const w = this.createElement("div", "event-time");
|
|
726
|
+
if (w.textContent = `${h.formatTime(e.start, this.state.options.timeFormat)} - ${h.formatTime(e.end, this.state.options.timeFormat)}`, r.appendChild(w), o.resizable !== !1) {
|
|
679
727
|
if (e.isStart) {
|
|
680
|
-
const
|
|
681
|
-
this.setData(
|
|
728
|
+
const E = this.createElement("div", "resize-handle", "top");
|
|
729
|
+
this.setData(E, { handle: "start" }), r.appendChild(E);
|
|
682
730
|
}
|
|
683
731
|
if (e.isEnd) {
|
|
684
|
-
const
|
|
685
|
-
this.setData(
|
|
732
|
+
const E = this.createElement("div", "resize-handle", "bottom");
|
|
733
|
+
this.setData(E, { handle: "end" }), r.appendChild(E);
|
|
686
734
|
}
|
|
687
735
|
}
|
|
688
736
|
return r;
|
|
@@ -698,8 +746,8 @@ class J extends x {
|
|
|
698
746
|
if (!a) return;
|
|
699
747
|
const l = this.createElement("div", "scheduler-event", "preview"), d = new Date(t.start);
|
|
700
748
|
d.setHours(0, 0, 0, 0);
|
|
701
|
-
const c = (t.start.getTime() - d.getTime()) / (1e3 * 60),
|
|
702
|
-
l.style.top = `${
|
|
749
|
+
const c = (t.start.getTime() - d.getTime()) / (1e3 * 60), p = (t.end.getTime() - d.getTime()) / (1e3 * 60) - c, m = (s.slotDuration ?? 1800) / 60, v = c / m * 40, f = Math.max(p / m * 40, 20);
|
|
750
|
+
l.style.top = `${v}px`, l.style.height = `${f}px`, l.style.left = "0", l.style.width = "100%", a.appendChild(l);
|
|
703
751
|
}
|
|
704
752
|
updateGreyedSlots() {
|
|
705
753
|
const { dragState: e, previewEvent: t, options: s, date: n } = this.state;
|
|
@@ -728,7 +776,7 @@ class J extends x {
|
|
|
728
776
|
0,
|
|
729
777
|
0
|
|
730
778
|
), c < t.end && u > t.start) {
|
|
731
|
-
const
|
|
779
|
+
const p = `${r}-${l}`, m = this.slotElements.get(p);
|
|
732
780
|
m && m.classList.add("greyed");
|
|
733
781
|
}
|
|
734
782
|
}
|
|
@@ -791,22 +839,38 @@ class Z extends x {
|
|
|
791
839
|
t.slotMaxTime
|
|
792
840
|
);
|
|
793
841
|
for (const m of c) {
|
|
794
|
-
const
|
|
795
|
-
|
|
842
|
+
const v = this.createElement("div", "scheduler-time-slot-label");
|
|
843
|
+
v.textContent = h.formatTime(m.start, t.timeFormat), d.appendChild(v);
|
|
796
844
|
}
|
|
797
845
|
l.appendChild(d);
|
|
798
846
|
const u = this.createElement("div", "scheduler-days-container");
|
|
799
847
|
this.dayColumn = this.createElement("div", "scheduler-day-column");
|
|
800
|
-
const
|
|
848
|
+
const p = this.dayColumn;
|
|
801
849
|
for (let m = 0; m < c.length; m++) {
|
|
802
|
-
const
|
|
850
|
+
const v = c[m], f = this.createElement("div", "scheduler-time-slot");
|
|
803
851
|
f.setAttribute("role", "gridcell"), f.setAttribute("tabindex", "-1"), f.setAttribute("aria-selected", "false"), f.id = `scheduler-cell-d-${m}`, this.setData(f, {
|
|
804
852
|
slotIndex: m,
|
|
805
|
-
start:
|
|
806
|
-
end:
|
|
807
|
-
}), this.slotElements.set(m, f),
|
|
808
|
-
}
|
|
809
|
-
this.eventsContainer = this.createElement("div", "scheduler-events-container"),
|
|
853
|
+
start: v.start.toISOString(),
|
|
854
|
+
end: v.end.toISOString()
|
|
855
|
+
}), this.slotElements.set(m, f), p.appendChild(f);
|
|
856
|
+
}
|
|
857
|
+
this.eventsContainer = this.createElement("div", "scheduler-events-container"), p.appendChild(this.eventsContainer), u.appendChild(p), l.appendChild(u), this.container.appendChild(l), this.renderEvents(), this.updateCellFocusAndSelection(), h.isToday(e) && t.nowIndicator && this.renderNowIndicator(p), this.applyGridRoles({
|
|
858
|
+
columnHeaderRow: ":scope > .scheduler-day-headers",
|
|
859
|
+
columnHeaders: ".scheduler-day-headers > .scheduler-day-header",
|
|
860
|
+
presentation: [
|
|
861
|
+
".scheduler-time-gutter-space",
|
|
862
|
+
".scheduler-time-grid",
|
|
863
|
+
".scheduler-time-gutter",
|
|
864
|
+
".scheduler-time-slot-label",
|
|
865
|
+
".scheduler-days-container"
|
|
866
|
+
],
|
|
867
|
+
rows: ".scheduler-day-column",
|
|
868
|
+
// The events overlay is a CELL, not presentation: a presentational
|
|
869
|
+
// wrapper leaves its role=button events owned directly by the row,
|
|
870
|
+
// which is invalid (axe aria-required-children). A gridcell may
|
|
871
|
+
// contain buttons.
|
|
872
|
+
cells: ".scheduler-events-container"
|
|
873
|
+
}), this.markToday();
|
|
810
874
|
}
|
|
811
875
|
/**
|
|
812
876
|
* Apply roving tabindex + aria-selected + `.selected` class to each cached
|
|
@@ -841,37 +905,37 @@ class Z extends x {
|
|
|
841
905
|
const a = M.getTimelinedParts(r);
|
|
842
906
|
for (const { part: l, trackIndex: d, totalTracks: c, colspan: u } of a) {
|
|
843
907
|
if (!l.event) continue;
|
|
844
|
-
const
|
|
908
|
+
const p = this.createEventElement(
|
|
845
909
|
l,
|
|
846
910
|
d,
|
|
847
911
|
c,
|
|
848
912
|
u,
|
|
849
913
|
s.slotDuration ?? 1800
|
|
850
914
|
);
|
|
851
|
-
this.eventsContainer.appendChild(
|
|
915
|
+
this.eventsContainer.appendChild(p);
|
|
852
916
|
}
|
|
853
917
|
}
|
|
854
918
|
createEventElement(e, t, s, n, i) {
|
|
855
|
-
const o = e.event, r = this.createElement("div", "scheduler-event"), a = this.state.selectedEvent?.id === o.id
|
|
856
|
-
r.setAttribute("role", "button"), r.setAttribute("tabindex", "0"), r.setAttribute(
|
|
919
|
+
const o = e.event, r = this.createElement("div", "scheduler-event"), a = this.state.selectedEvent?.id === o.id;
|
|
920
|
+
this.state.keyboardMoveEventId, o.id, r.setAttribute("role", "button"), r.setAttribute("tabindex", "0"), r.setAttribute(
|
|
857
921
|
"aria-label",
|
|
858
|
-
|
|
859
|
-
),
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
const
|
|
863
|
-
r.style.top = `${
|
|
864
|
-
const
|
|
865
|
-
|
|
866
|
-
const
|
|
867
|
-
if (
|
|
922
|
+
P(o, null, this.state.options.timeFormat)
|
|
923
|
+
), r.setAttribute("aria-pressed", a ? "true" : "false"), a && r.classList.add("selected");
|
|
924
|
+
const l = new Date(e.start);
|
|
925
|
+
l.setHours(0, 0, 0, 0);
|
|
926
|
+
const d = (e.start.getTime() - l.getTime()) / (1e3 * 60), u = (e.end.getTime() - l.getTime()) / (1e3 * 60) - d, p = i / 60, m = d / p * 40, v = Math.max(u / p * 40, 20), f = t / s * 100, b = n / s * 100;
|
|
927
|
+
r.style.top = `${m}px`, r.style.height = `${v}px`, r.style.left = `${f}%`, r.style.width = `calc(${b}% - 2px)`, r.style.backgroundColor = o.color ?? "#3788d8", r.style.color = o.textColor ?? I(o.color ?? "#3788d8"), this.setData(r, { eventId: o.id });
|
|
928
|
+
const y = this.createElement("div", "event-title");
|
|
929
|
+
y.textContent = o.title, r.appendChild(y);
|
|
930
|
+
const w = this.createElement("div", "event-time");
|
|
931
|
+
if (w.textContent = `${h.formatTime(e.start, this.state.options.timeFormat)} - ${h.formatTime(e.end, this.state.options.timeFormat)}`, r.appendChild(w), o.resizable !== !1) {
|
|
868
932
|
if (e.isStart) {
|
|
869
|
-
const
|
|
870
|
-
this.setData(
|
|
933
|
+
const E = this.createElement("div", "resize-handle", "top");
|
|
934
|
+
this.setData(E, { handle: "start" }), r.appendChild(E);
|
|
871
935
|
}
|
|
872
936
|
if (e.isEnd) {
|
|
873
|
-
const
|
|
874
|
-
this.setData(
|
|
937
|
+
const E = this.createElement("div", "resize-handle", "bottom");
|
|
938
|
+
this.setData(E, { handle: "end" }), r.appendChild(E);
|
|
875
939
|
}
|
|
876
940
|
}
|
|
877
941
|
return r;
|
|
@@ -949,39 +1013,39 @@ class Q extends x {
|
|
|
949
1013
|
d.setAttribute("role", "columnheader"), d.textContent = "Resources", l.appendChild(d);
|
|
950
1014
|
const c = this.createElement("div", "scheduler-timeline-slots-header");
|
|
951
1015
|
for (const y of i) {
|
|
952
|
-
const
|
|
1016
|
+
const E = h.getTimeSlots(
|
|
953
1017
|
y,
|
|
954
1018
|
t.slotDuration,
|
|
955
1019
|
t.slotMinTime,
|
|
956
1020
|
t.slotMaxTime
|
|
957
|
-
).length,
|
|
958
|
-
|
|
1021
|
+
).length, D = this.createElement("div", "scheduler-timeline-slot-header");
|
|
1022
|
+
D.setAttribute("role", "columnheader"), D.style.width = `${E * this.slotWidth}px`, D.textContent = h.formatDateWithWeekday(y, t.locale), D.style.borderBottom = "1px solid var(--scheduler-border-color)", c.appendChild(D);
|
|
959
1023
|
}
|
|
960
1024
|
l.appendChild(c), a.appendChild(l);
|
|
961
|
-
const u = this.createElement("div", "scheduler-timeline-header"),
|
|
962
|
-
|
|
1025
|
+
const u = this.createElement("div", "scheduler-timeline-header"), p = this.createElement("div", "scheduler-resource-header");
|
|
1026
|
+
p.style.borderBottom = "1px solid var(--scheduler-border-color)", u.appendChild(p);
|
|
963
1027
|
const m = this.createElement("div", "scheduler-timeline-slots-header");
|
|
964
1028
|
for (const y of i) {
|
|
965
|
-
const
|
|
1029
|
+
const w = h.getTimeSlots(
|
|
966
1030
|
y,
|
|
967
1031
|
t.slotDuration,
|
|
968
1032
|
t.slotMinTime,
|
|
969
1033
|
t.slotMaxTime
|
|
970
1034
|
);
|
|
971
|
-
for (const
|
|
972
|
-
const
|
|
973
|
-
|
|
1035
|
+
for (const E of w) {
|
|
1036
|
+
const D = this.createElement("div", "scheduler-timeline-slot-header");
|
|
1037
|
+
D.setAttribute("role", "columnheader"), D.style.width = `${this.slotWidth}px`, D.textContent = h.formatTime(E.start, t.timeFormat), D.style.fontSize = "10px", m.appendChild(D);
|
|
974
1038
|
}
|
|
975
1039
|
}
|
|
976
1040
|
u.appendChild(m), a.appendChild(u);
|
|
977
|
-
const
|
|
1041
|
+
const v = this.createElement("div", "scheduler-timeline-body"), f = S.flatten(s, n);
|
|
978
1042
|
let b = 2;
|
|
979
1043
|
for (const y of f) {
|
|
980
1044
|
if (!y.visible) continue;
|
|
981
|
-
const
|
|
982
|
-
|
|
1045
|
+
const w = this.createResourceRow(y, i);
|
|
1046
|
+
w.setAttribute("aria-rowindex", String(b)), v.appendChild(w), b++;
|
|
983
1047
|
}
|
|
984
|
-
a.appendChild(
|
|
1048
|
+
a.appendChild(v), this.container.appendChild(a), this.renderEvents(i), this.updateCellFocusAndSelection();
|
|
985
1049
|
}
|
|
986
1050
|
/**
|
|
987
1051
|
* Apply roving tabindex + aria-selected + `.selected` class to each
|
|
@@ -1014,6 +1078,7 @@ class Q extends x {
|
|
|
1014
1078
|
const o = this.createElement("span");
|
|
1015
1079
|
o.textContent = e.item.title, i.appendChild(o), n.appendChild(i);
|
|
1016
1080
|
const r = this.createElement("div", "scheduler-timeline-slots");
|
|
1081
|
+
r.setAttribute("role", "presentation");
|
|
1017
1082
|
for (const a of t) {
|
|
1018
1083
|
const l = h.getTimeSlots(
|
|
1019
1084
|
a,
|
|
@@ -1030,9 +1095,9 @@ class Q extends x {
|
|
|
1030
1095
|
}), r.appendChild(c);
|
|
1031
1096
|
}
|
|
1032
1097
|
}
|
|
1033
|
-
if (
|
|
1098
|
+
if (H(e.item)) {
|
|
1034
1099
|
const a = this.createElement("div", "scheduler-timeline-events");
|
|
1035
|
-
r.appendChild(a);
|
|
1100
|
+
a.setAttribute("role", "gridcell"), r.appendChild(a);
|
|
1036
1101
|
}
|
|
1037
1102
|
return n.appendChild(r), this.rowElements.set(e.item.id, n), n;
|
|
1038
1103
|
}
|
|
@@ -1046,9 +1111,9 @@ class Q extends x {
|
|
|
1046
1111
|
n.slotMaxTime
|
|
1047
1112
|
).length * 7 * this.slotWidth, c = S.getAllResources(s);
|
|
1048
1113
|
for (const u of c) {
|
|
1049
|
-
const
|
|
1050
|
-
if (!
|
|
1051
|
-
const m =
|
|
1114
|
+
const p = this.rowElements.get(u.id);
|
|
1115
|
+
if (!p) continue;
|
|
1116
|
+
const m = p.querySelector(".scheduler-timeline-events");
|
|
1052
1117
|
if (!m) continue;
|
|
1053
1118
|
m.innerHTML = "";
|
|
1054
1119
|
const f = (u.events ?? []).filter(
|
|
@@ -1063,13 +1128,13 @@ class Q extends x {
|
|
|
1063
1128
|
dayIndex: 0,
|
|
1064
1129
|
totalDays: 1
|
|
1065
1130
|
})), b = M.getTimelinedParts(f);
|
|
1066
|
-
for (const { part: y, trackIndex:
|
|
1131
|
+
for (const { part: y, trackIndex: w, totalTracks: E, colspan: D } of b) {
|
|
1067
1132
|
if (!y.event) continue;
|
|
1068
1133
|
const K = this.createEventElement(
|
|
1069
1134
|
y.event,
|
|
1135
|
+
w,
|
|
1070
1136
|
E,
|
|
1071
1137
|
D,
|
|
1072
|
-
w,
|
|
1073
1138
|
o,
|
|
1074
1139
|
d,
|
|
1075
1140
|
n.slotDuration ?? 1800,
|
|
@@ -1080,13 +1145,13 @@ class Q extends x {
|
|
|
1080
1145
|
}
|
|
1081
1146
|
}
|
|
1082
1147
|
createEventElement(e, t, s, n, i, o, r, a = null) {
|
|
1083
|
-
const l = this.createElement("div", "scheduler-timeline-event"), d = this.state.selectedEvent?.id === e.id
|
|
1084
|
-
l.setAttribute("role", "button"), l.setAttribute("tabindex", "0"), l.setAttribute(
|
|
1148
|
+
const l = this.createElement("div", "scheduler-timeline-event"), d = this.state.selectedEvent?.id === e.id;
|
|
1149
|
+
this.state.keyboardMoveEventId, e.id, l.setAttribute("role", "button"), l.setAttribute("tabindex", "0"), l.setAttribute(
|
|
1085
1150
|
"aria-label",
|
|
1086
|
-
|
|
1087
|
-
),
|
|
1088
|
-
const
|
|
1089
|
-
return l.style.left = `${
|
|
1151
|
+
P(e, a, this.state.options.timeFormat)
|
|
1152
|
+
), l.setAttribute("aria-pressed", d ? "true" : "false"), d && l.classList.add("selected");
|
|
1153
|
+
const c = Math.max(e.start.getTime(), i.getTime()), u = i.getTime() + 10080 * 60 * 1e3, p = Math.min(e.end.getTime(), u), m = c - i.getTime(), v = p - c, f = u - i.getTime(), b = m / f * o, y = Math.max(v / f * o, 20), w = t / s * 100, E = n / s * 100;
|
|
1154
|
+
return l.style.left = `${b}px`, l.style.width = `${y}px`, l.style.top = `${w}%`, l.style.height = `${E}%`, l.style.backgroundColor = e.color ?? "#3788d8", l.style.color = e.textColor ?? I(e.color ?? "#3788d8"), this.setData(l, { eventId: e.id }), l.textContent = e.title, l;
|
|
1090
1155
|
}
|
|
1091
1156
|
update(e) {
|
|
1092
1157
|
const t = this.state.date.getTime() !== e.date.getTime(), s = this.optionsRequireRerender(this.state.options, e.options);
|
|
@@ -1428,6 +1493,10 @@ const ee = W(`:host {
|
|
|
1428
1493
|
}
|
|
1429
1494
|
|
|
1430
1495
|
/* Month View */
|
|
1496
|
+
.scheduler-month-week {
|
|
1497
|
+
display: contents;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1431
1500
|
.scheduler-month-grid {
|
|
1432
1501
|
display: grid;
|
|
1433
1502
|
grid-template-columns: repeat(7, 1fr);
|
|
@@ -1871,7 +1940,7 @@ function C(g) {
|
|
|
1871
1940
|
isPrimary: !0
|
|
1872
1941
|
};
|
|
1873
1942
|
}
|
|
1874
|
-
function
|
|
1943
|
+
function F(g) {
|
|
1875
1944
|
const e = g.touches[0] || g.changedTouches[0];
|
|
1876
1945
|
return e ? {
|
|
1877
1946
|
pointerId: e.identifier,
|
|
@@ -2375,7 +2444,7 @@ class re {
|
|
|
2375
2444
|
this.cancelTouchHold();
|
|
2376
2445
|
return;
|
|
2377
2446
|
}
|
|
2378
|
-
const t =
|
|
2447
|
+
const t = F(e);
|
|
2379
2448
|
if (!t) return;
|
|
2380
2449
|
const s = this.analyzeTarget(t.target);
|
|
2381
2450
|
if (s.type === "none" || s.type === "slot" && !this.config.isSelectable()) return;
|
|
@@ -2398,7 +2467,7 @@ class re {
|
|
|
2398
2467
|
this.cancelTouchHold(), this.exitPanMode();
|
|
2399
2468
|
return;
|
|
2400
2469
|
}
|
|
2401
|
-
const t =
|
|
2470
|
+
const t = F(e);
|
|
2402
2471
|
if (t) {
|
|
2403
2472
|
if (this.isPanMode) {
|
|
2404
2473
|
e.preventDefault(), this.performPan(t.clientX, t.clientY);
|
|
@@ -2420,7 +2489,7 @@ class re {
|
|
|
2420
2489
|
}
|
|
2421
2490
|
}
|
|
2422
2491
|
handleTouchEnd(e) {
|
|
2423
|
-
const t =
|
|
2492
|
+
const t = F(e);
|
|
2424
2493
|
if (this.isPanMode) {
|
|
2425
2494
|
this.exitPanMode();
|
|
2426
2495
|
return;
|
|
@@ -2574,7 +2643,7 @@ class ae {
|
|
|
2574
2643
|
}
|
|
2575
2644
|
class le extends B {
|
|
2576
2645
|
constructor() {
|
|
2577
|
-
super(), this.currentView = null, this.currentViewType = null, this.contentContainer = null, this.inputHandler = null, this.previousView = null, this.previousDate = null, this.previousSelectedEventId = null, this.previousRangeKey = "__init__", this.pendingDragUpdate = null, this.latestDragState = null, this.nowIndicatorTimer = null, this.liveAnnouncer = new O(this), this.keyboardMove = null, this.stateManager = new Y(), this.eventEmitter = new ae(this), this.dragManager = new ne(this.stateManager), this.dragManager.setSlotResolver((e, t) => this.getSlotAtPosition(e, t)), this.boundHandleKeyDown = this.handleKeyDown.bind(this), this.boundHandleFocusIn = this.handleFocusIn.bind(this), this.stateManager.subscribe((e) => this.onStateChange(e));
|
|
2646
|
+
super(), this.currentView = null, this.currentViewType = null, this.contentContainer = null, this.inputHandler = null, this.previousView = null, this.previousDate = null, this.previousSelectedEventId = null, this.previousRangeKey = "__init__", this.pendingDragUpdate = null, this.latestDragState = null, this.nowIndicatorTimer = null, this.liveAnnouncer = new O(this), this.previousIsLoading = null, this.keyboardMove = null, this.stateManager = new Y(), this.eventEmitter = new ae(this), this.dragManager = new ne(this.stateManager), this.dragManager.setSlotResolver((e, t) => this.getSlotAtPosition(e, t)), this.boundHandleKeyDown = this.handleKeyDown.bind(this), this.boundHandleFocusIn = this.handleFocusIn.bind(this), this.stateManager.subscribe((e) => this.onStateChange(e));
|
|
2578
2647
|
}
|
|
2579
2648
|
static {
|
|
2580
2649
|
this.styles = [ee];
|
|
@@ -2840,7 +2909,7 @@ class le extends B {
|
|
|
2840
2909
|
// State Change Handling
|
|
2841
2910
|
// ============================================
|
|
2842
2911
|
onStateChange(e) {
|
|
2843
|
-
this.detectAndEmitChanges(e), this.updateUI(e);
|
|
2912
|
+
e.isLoading !== this.previousIsLoading && (this.previousIsLoading !== null && this.liveAnnouncer.announce(e.isLoading ? "Loading events." : "Events loaded."), this.previousIsLoading = e.isLoading), this.detectAndEmitChanges(e), this.updateUI(e);
|
|
2844
2913
|
}
|
|
2845
2914
|
detectAndEmitChanges(e) {
|
|
2846
2915
|
const t = this.previousView !== null && this.previousView !== e.view, s = this.previousDate !== null && this.previousDate.getTime() !== e.date.getTime(), n = e.selectedEvent?.id ?? null, i = k(e), o = i ? `${i.start.getTime()}-${i.end.getTime()}-${e.selectionResourceId ?? ""}` : null, r = this.previousSelectedEventId !== n || this.previousRangeKey !== o;
|
|
@@ -2956,7 +3025,7 @@ class le extends B {
|
|
|
2956
3025
|
const s = (e.composedPath?.() ?? [])[0] ?? e.target;
|
|
2957
3026
|
if (!s || !s.dataset) return;
|
|
2958
3027
|
const n = s.dataset.eventId;
|
|
2959
|
-
if (!n || !s.classList.contains("scheduler-event") && !s.classList.contains("scheduler-timeline-event"))
|
|
3028
|
+
if (!n || !s.classList.contains("scheduler-event") && !s.classList.contains("scheduler-timeline-event") && !s.classList.contains("scheduler-month-event"))
|
|
2960
3029
|
return;
|
|
2961
3030
|
const i = this.getEventById(n);
|
|
2962
3031
|
i && this.stateManager.getState().selectedEvent?.id !== i.id && (this.stateManager.setSelectedEvent(i), this.eventEmitter.emitEventSelected(i, e), requestAnimationFrame(() => {
|
|
@@ -2975,12 +3044,30 @@ class le extends B {
|
|
|
2975
3044
|
}
|
|
2976
3045
|
if (e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey && this.handleAltShortcut(e))
|
|
2977
3046
|
return;
|
|
3047
|
+
if ((e.key === "Enter" || e.key === " ") && this.activateFocusedDrillControl()) {
|
|
3048
|
+
e.preventDefault();
|
|
3049
|
+
return;
|
|
3050
|
+
}
|
|
2978
3051
|
const t = this.getFocusedKind();
|
|
2979
3052
|
t === "cell" ? this.handleCellKeyDown(e) : t === "event" && this.handleEventKeyDown(e);
|
|
2980
3053
|
}
|
|
3054
|
+
/** Keyboard face of the more-link / year-month-header click delegation. */
|
|
3055
|
+
activateFocusedDrillControl() {
|
|
3056
|
+
const e = this.shadowRoot?.activeElement;
|
|
3057
|
+
if (!e) return !1;
|
|
3058
|
+
if (e.classList.contains("scheduler-more-link")) {
|
|
3059
|
+
const t = e.dataset.date;
|
|
3060
|
+
return t ? (this.stateManager.setDate(new Date(t)), this.stateManager.setView("day"), !0) : !1;
|
|
3061
|
+
}
|
|
3062
|
+
if (e.classList.contains("scheduler-year-month-header")) {
|
|
3063
|
+
const t = e.dataset.month;
|
|
3064
|
+
return t ? (this.stateManager.setDate(new Date(t)), this.stateManager.setView("month"), !0) : !1;
|
|
3065
|
+
}
|
|
3066
|
+
return !1;
|
|
3067
|
+
}
|
|
2981
3068
|
getFocusedKind() {
|
|
2982
3069
|
const e = this.shadowRoot?.activeElement;
|
|
2983
|
-
return e ? e.classList.contains("scheduler-time-slot") || e.classList.contains("scheduler-timeline-slot") || e.classList.contains("scheduler-month-day") || e.classList.contains("scheduler-year-month") ? "cell" : e.classList.contains("scheduler-event") || e.classList.contains("scheduler-timeline-event") ? "event" : "other" : "other";
|
|
3070
|
+
return e ? e.classList.contains("scheduler-time-slot") || e.classList.contains("scheduler-timeline-slot") || e.classList.contains("scheduler-month-day") || e.classList.contains("scheduler-year-month") ? "cell" : e.classList.contains("scheduler-event") || e.classList.contains("scheduler-timeline-event") || e.classList.contains("scheduler-month-event") ? "event" : "other" : "other";
|
|
2984
3071
|
}
|
|
2985
3072
|
handleAltShortcut(e) {
|
|
2986
3073
|
switch (e.key.toLowerCase()) {
|
|
@@ -3257,7 +3344,7 @@ class le extends B {
|
|
|
3257
3344
|
break;
|
|
3258
3345
|
}
|
|
3259
3346
|
case "timeline": {
|
|
3260
|
-
const r = S.flatten(s.resources, s.collapsedGroups).filter((c) => c.visible &&
|
|
3347
|
+
const r = S.flatten(s.resources, s.collapsedGroups).filter((c) => c.visible && H(c.item));
|
|
3261
3348
|
if (r.length === 0) return;
|
|
3262
3349
|
i = e === "start" ? r[0].item.id : r[r.length - 1].item.id;
|
|
3263
3350
|
const a = h.getWeekDays(s.date, s.options.firstDayOfWeek), l = e === "start" ? a[0] : a[6], d = h.getTimeSlots(l, s.options.slotDuration, s.options.slotMinTime, s.options.slotMaxTime);
|
|
@@ -3280,7 +3367,7 @@ class le extends B {
|
|
|
3280
3367
|
if (i.view === "day")
|
|
3281
3368
|
o = new Date(i.date), o.setHours(s.start.getHours(), s.start.getMinutes(), s.start.getSeconds(), 0);
|
|
3282
3369
|
else {
|
|
3283
|
-
const l = h.getWeekDays(n, t.options.firstDayOfWeek), d = h.getWeekDays(i.date, i.options.firstDayOfWeek), c = l.findIndex((
|
|
3370
|
+
const l = h.getWeekDays(n, t.options.firstDayOfWeek), d = h.getWeekDays(i.date, i.options.firstDayOfWeek), c = l.findIndex((p) => h.isSameDay(p, s.start)), u = d[Math.max(0, c)] ?? d[0];
|
|
3284
3371
|
o = new Date(u), o.setHours(s.start.getHours(), s.start.getMinutes(), s.start.getSeconds(), 0);
|
|
3285
3372
|
}
|
|
3286
3373
|
const r = (i.options.slotDuration ?? 1800) * 1e3, a = { start: o, end: new Date(o.getTime() + r) };
|
|
@@ -3324,7 +3411,7 @@ class le extends B {
|
|
|
3324
3411
|
return o.setHours(0, 0, 0, 0), o.setSeconds((s ?? 0) * 3600 + (n ?? 0) * 60 + (i ?? 0)), o;
|
|
3325
3412
|
}
|
|
3326
3413
|
adjacentResource(e, t, s) {
|
|
3327
|
-
const i = S.flatten(s.resources, s.collapsedGroups).filter((a) => a.visible &&
|
|
3414
|
+
const i = S.flatten(s.resources, s.collapsedGroups).filter((a) => a.visible && H(a.item));
|
|
3328
3415
|
if (i.length === 0) return null;
|
|
3329
3416
|
if (!e) return i[0].item.id;
|
|
3330
3417
|
const o = i.findIndex((a) => a.item.id === e);
|