@mintplayer/web-components 2.16.0 → 2.17.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 (117) hide show
  1. package/accordion/index.mjs +5 -5
  2. package/calendar/index.mjs +1 -1
  3. package/carousel/index.mjs +57 -143
  4. package/charts/core/index.mjs +30 -20
  5. package/charts/core/src/attributes.d.ts +18 -0
  6. package/charts/core/src/index.d.ts +2 -0
  7. package/charts/core/src/view-window.d.ts +46 -0
  8. package/charts/hierarchy/index.mjs +245 -256
  9. package/charts/hierarchy/src/components/mp-hierarchy-chart.d.ts +1 -3
  10. package/charts/sparkline/index.mjs +27 -26
  11. package/charts/trend/index.mjs +21 -20
  12. package/checkbox/index.mjs +1 -1
  13. package/checkbox/src/components/mp-checkbox.d.ts +1 -0
  14. package/chunks/attributes-L3eKsbdy.mjs +16 -0
  15. package/chunks/color-mode-warning-71FmlzWX.mjs +13 -0
  16. package/chunks/{form-check.styles-B0pxJ6YC.mjs → form-check.styles-DqvBnspm.mjs} +24 -3
  17. package/chunks/{mp-calendar.element-CJ8-t-Zn.mjs → mp-calendar.element-BIHS9SZZ.mjs} +11 -6
  18. package/chunks/{mp-checkbox-CzwS7Y_t.mjs → mp-checkbox-zV83gILn.mjs} +44 -36
  19. package/chunks/{mp-datatable-B7st6G-I.mjs → mp-datatable-eRpl7-2V.mjs} +173 -173
  20. package/chunks/{mp-datetime-picker.element-DsWA1AFs.mjs → mp-datetime-picker.element-Cxu5-qRE.mjs} +29 -32
  21. package/chunks/{mp-pagination-Dea75mD4.mjs → mp-pagination-hGy4dL7p.mjs} +9 -4
  22. package/chunks/{mp-radio-cL46sUA0.mjs → mp-radio-BhRVNdKp.mjs} +32 -28
  23. package/chunks/{mp-select-BNrbPwN4.mjs → mp-select-CgqYFvUj.mjs} +41 -26
  24. package/chunks/{mp-splitter-Ckn1kN4v.mjs → mp-splitter-DLehrw3Y.mjs} +144 -120
  25. package/chunks/{mp-timepicker.element-CwaAAOcm.mjs → mp-timepicker.element-BiB9lkgc.mjs} +58 -45
  26. package/chunks/{mp-toggle-button-eo_aTQtu.mjs → mp-toggle-button-CaS9uYLE.mjs} +26 -24
  27. package/chunks/{mp-treeview-C8iltDbq.mjs → mp-treeview-CaMTDrvY.mjs} +51 -50
  28. package/chunks/{overlay-controller-DifgO6jT.mjs → overlay-controller-BHDagokg.mjs} +96 -92
  29. package/chunks/{id-DNZVAnGC.mjs → resource.service--lqLwEqk.mjs} +144 -206
  30. package/chunks/view-window-DGvFiDnW.mjs +263 -0
  31. package/code-snippet/index.mjs +70 -66
  32. package/code-snippet/src/hljs-loaders.generated.d.ts +1 -1
  33. package/custom-elements.json +65750 -0
  34. package/datatable/index.mjs +1 -1
  35. package/datatable/src/components/column-resize.d.ts +11 -0
  36. package/datatable/src/components/mp-datatable.d.ts +5 -0
  37. package/datepicker/index.mjs +10 -9
  38. package/datetime-picker/index.mjs +1 -1
  39. package/datetime-picker/src/mp-datetime-picker.element.d.ts +3 -0
  40. package/dock/index.mjs +430 -463
  41. package/dock/src/components/mint-dock-manager.element.d.ts +25 -2
  42. package/dock/src/core/resize.d.ts +60 -0
  43. package/dropdown-menu/index.mjs +4 -2
  44. package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +6 -1
  45. package/dropdown-menu/src/index.d.ts +1 -1
  46. package/dropdown-menu/src/types/dropdown.d.ts +14 -1
  47. package/dropdown-menu/src/types/index.d.ts +1 -1
  48. package/file-manager/index.mjs +63 -61
  49. package/file-manager/src/components/mp-file-manager.d.ts +4 -3
  50. package/multi-range/index.mjs +56 -50
  51. package/multi-range/src/mint-multi-range.element.d.ts +4 -10
  52. package/multi-range/src/pointer-geometry.d.ts +31 -0
  53. package/navbar/index.mjs +89 -439
  54. package/overlay/index.mjs +1 -1
  55. package/overlay/src/overlay-controller.d.ts +0 -14
  56. package/overlay/src/placement.d.ts +48 -0
  57. package/package.json +7 -1
  58. package/pagination/index.mjs +1 -1
  59. package/phone-input/index.mjs +44 -40
  60. package/phone-input/src/components/stack.d.ts +8 -0
  61. package/query-builder/index.mjs +418 -466
  62. package/query-builder/src/dnd/drag-controller.d.ts +12 -8
  63. package/query-builder/src/mp-query-builder.element.d.ts +5 -1
  64. package/query-builder/src/mp-query-condition.element.d.ts +1 -0
  65. package/radio/index.mjs +1 -1
  66. package/radio-group/index.mjs +1 -1
  67. package/ribbon/index.mjs +477 -498
  68. package/ribbon/src/core/band-text-color.d.ts +10 -0
  69. package/ribbon/src/core/key-tip-allocator.d.ts +10 -0
  70. package/ribbon/src/core/plan-reduce-steps.d.ts +62 -0
  71. package/ribbon/src/mp-ribbon.element.d.ts +0 -27
  72. package/scheduler/index.mjs +726 -711
  73. package/scheduler/src/components/mp-scheduler.d.ts +19 -3
  74. package/scheduler/src/drag/drag-manager.d.ts +1 -9
  75. package/scheduler/src/input/input-handler.d.ts +12 -2
  76. package/scheduler/src/utils/geometry.d.ts +39 -0
  77. package/scheduler/src/views/timeline-view.d.ts +0 -1
  78. package/scheduler-core/index.mjs +84 -71
  79. package/scheduler-core/src/services/resource.service.d.ts +0 -12
  80. package/scheduler-core/src/services/timeline.service.d.ts +0 -9
  81. package/select/index.mjs +1 -1
  82. package/select/src/components/mp-select.d.ts +1 -0
  83. package/signature-pad/index.mjs +21 -23
  84. package/signature-pad/src/canvas-point.d.ts +26 -0
  85. package/signature-pad/src/mp-signature-pad.element.d.ts +1 -7
  86. package/splitter/index.mjs +1 -1
  87. package/splitter/src/components/mp-splitter.d.ts +16 -0
  88. package/splitter/src/managers/index.d.ts +1 -0
  89. package/splitter/src/managers/rescale-panel-sizes.d.ts +14 -0
  90. package/swiper-core/index.mjs +2 -2
  91. package/theming/bs-theme-preboot.js +1 -0
  92. package/theming/color-mode.css +36 -0
  93. package/theming/index.d.ts +1 -0
  94. package/theming/index.mjs +327 -0
  95. package/theming/src/components/mp-theme-toggle.d.ts +71 -0
  96. package/theming/src/cookie.d.ts +31 -0
  97. package/theming/src/index.d.ts +5 -0
  98. package/theming/src/preboot.d.ts +1 -0
  99. package/theming/src/resolve.d.ts +36 -0
  100. package/theming/src/store.d.ts +27 -0
  101. package/theming/src/styles/theme-toggle.styles.d.ts +2 -0
  102. package/theming/src/testing/fake-broadcast-channel.d.ts +35 -0
  103. package/theming/src/toggle-modes.d.ts +23 -0
  104. package/tile-manager/index.mjs +252 -211
  105. package/tile-manager/src/components/mint-tile-manager.element.d.ts +8 -0
  106. package/tile-manager/src/utils/grid-geometry.d.ts +49 -0
  107. package/timeline/index.mjs +156 -164
  108. package/timeline/src/components/mp-timeline.d.ts +41 -7
  109. package/timepicker/index.mjs +7 -4
  110. package/timepicker/src/mp-time-list.element.d.ts +26 -0
  111. package/timepicker/src/mp-timepicker.element.d.ts +3 -0
  112. package/toggle-button/index.mjs +1 -1
  113. package/tree-select/index.mjs +21 -9
  114. package/treeview/index.mjs +1 -1
  115. package/treeview/src/components/mp-treeview.d.ts +6 -4
  116. package/chunks/color-DIeST-IS.mjs +0 -224
  117. package/query-builder/src/mp-query-condition.element.template.d.ts +0 -2
@@ -1,30 +1,30 @@
1
- import { unsafeCSS as F, LitElement as E, nothing as u, render as v } from "lit";
2
- import { O as I } from "./overlay-controller-DifgO6jT.mjs";
3
- import { s as L, i as M } from "./install-light-styles-DbCAGFOC.mjs";
4
- import { L as P } from "./live-announcer-Bi0orG4n.mjs";
5
- import { a as k, F as z } from "./focus-restore-DxuP1Oe2.mjs";
6
- import { H as q } from "./host-aria-WSGs7SPQ.mjs";
7
- import { repeat as x } from "lit/directives/repeat.js";
8
- import { live as K } from "lit/directives/live.js";
9
- import { classMap as C } from "lit/directives/class-map.js";
1
+ import { unsafeCSS as L, LitElement as P, nothing as u, render as v } from "lit";
2
+ import { O as M } from "./overlay-controller-BHDagokg.mjs";
3
+ import { s as k, i as z } from "./install-light-styles-DbCAGFOC.mjs";
4
+ import { L as q } from "./live-announcer-Bi0orG4n.mjs";
5
+ import { a as K, F as A } from "./focus-restore-DxuP1Oe2.mjs";
6
+ import { H as U } from "./host-aria-WSGs7SPQ.mjs";
7
+ import { repeat as C } from "lit/directives/repeat.js";
8
+ import { live as T } from "lit/directives/live.js";
9
+ import { classMap as x } from "lit/directives/class-map.js";
10
10
  import { styleMap as _ } from "lit/directives/style-map.js";
11
- import "./mp-pagination-Dea75mD4.mjs";
12
- import "./mp-checkbox-CzwS7Y_t.mjs";
13
- const A = {
11
+ import "./mp-pagination-hGy4dL7p.mjs";
12
+ import "./mp-checkbox-zV83gILn.mjs";
13
+ const O = {
14
14
  eq: "equals",
15
15
  neq: "does not equal",
16
16
  lt: "is less than",
17
17
  lte: "is at most",
18
18
  gt: "is greater than",
19
19
  gte: "is at least"
20
- }, U = {
20
+ }, D = {
21
21
  eq: "=",
22
22
  neq: "≠",
23
23
  lt: "<",
24
24
  lte: "≤",
25
25
  gt: ">",
26
26
  gte: "≥"
27
- }, T = ["eq", "neq", "lt", "lte", "gt", "gte"], O = {
27
+ }, N = ["eq", "neq", "lt", "lte", "gt", "gte"], W = {
28
28
  treeChevronColumn: "Expand or collapse",
29
29
  deselectAll: "Deselect all",
30
30
  selectAll: "Select all",
@@ -32,39 +32,39 @@ const A = {
32
32
  collapseRow: "Collapse row",
33
33
  loading: "Loading",
34
34
  rowsPerPage: "Rows per page",
35
- resizeColumn: (n) => `Resize column ${n}`,
36
- selectRow: (n) => `Select row ${n}`,
37
- filterColumn: (n) => `Filter ${n}`,
38
- filterColumnActive: (n, e) => e ? `Filter ${n}, filtered by ${e}` : `Filter ${n}, filtered`,
39
- filterClear: (n) => `Clear the filter on ${n}`,
35
+ resizeColumn: (l) => `Resize column ${l}`,
36
+ selectRow: (l) => `Select row ${l}`,
37
+ filterColumn: (l) => `Filter ${l}`,
38
+ filterColumnActive: (l, e) => e ? `Filter ${l}, filtered by ${e}` : `Filter ${l}, filtered`,
39
+ filterClear: (l) => `Clear the filter on ${l}`,
40
40
  filterSearch: "Search values",
41
41
  filterInvert: "Exclude the selected values",
42
- filterGroup: (n) => `Values of ${n}`,
42
+ filterGroup: (l) => `Values of ${l}`,
43
43
  filterHasMore: "More values exist — refine the search to see them",
44
44
  filterNoValues: "No values available",
45
- filterValue(n) {
46
- return n == null ? this.filterNone : n === "" ? this.filterEmpty : n === !0 ? this.filterTrue : n === !1 ? this.filterFalse : n instanceof Date ? n.toLocaleDateString() : String(n);
45
+ filterValue(l) {
46
+ return l == null ? this.filterNone : l === "" ? this.filterEmpty : l === !0 ? this.filterTrue : l === !1 ? this.filterFalse : l instanceof Date ? l.toLocaleDateString() : String(l);
47
47
  },
48
48
  filterNone: "(none)",
49
49
  filterEmpty: "(empty)",
50
50
  filterTrue: "Yes",
51
51
  filterFalse: "No",
52
- announceFilter: (n, e) => e === 0 ? `Filter cleared on ${n}` : e === 1 ? `1 value selected in ${n}` : `${e} values selected in ${n}`,
52
+ announceFilter: (l, e) => e === 0 ? `Filter cleared on ${l}` : e === 1 ? `1 value selected in ${l}` : `${e} values selected in ${l}`,
53
53
  filterOperator: "Comparison",
54
54
  filterOperand: "Value to compare with",
55
- filterOperatorLabel: (n) => A[n],
56
- announceComparisonFilter: (n, e, t) => t === "" ? `Filter cleared on ${n}` : `${n} ${e} ${t}`,
57
- announceSorted: (n, e) => e === "none" ? `Sorting removed from ${n}` : `Sorted by ${n}, ${e}`,
58
- announcePage: (n, e) => `Page ${n} of ${e}`,
59
- announceSelection: (n) => n === 1 ? "1 row selected" : `${n} rows selected`,
60
- announceLoaded: (n) => n === 1 ? "Loaded 1 row" : `Loaded ${n} rows`
61
- }, D = F(`@charset "UTF-8";
55
+ filterOperatorLabel: (l) => O[l],
56
+ announceComparisonFilter: (l, e, t) => t === "" ? `Filter cleared on ${l}` : `${l} ${e} ${t}`,
57
+ announceSorted: (l, e) => e === "none" ? `Sorting removed from ${l}` : `Sorted by ${l}, ${e}`,
58
+ announcePage: (l, e) => `Page ${l} of ${e}`,
59
+ announceSelection: (l) => l === 1 ? "1 row selected" : `${l} rows selected`,
60
+ announceLoaded: (l) => l === 1 ? "Loaded 1 row" : `Loaded ${l} rows`
61
+ }, H = L(`@charset "UTF-8";
62
62
  mp-datatable {
63
63
  display: block;
64
64
  width: 100%;
65
65
  position: relative;
66
66
  --mp-datatable-border-color: var(--bs-border-color, rgba(0, 0, 0, 0.125));
67
- --mp-datatable-row-hover-bg: var(--bs-table-hover-bg, rgba(0, 0, 0, 0.04));
67
+ --mp-datatable-row-hover-bg: var(--bs-table-hover-bg, rgba(var(--bs-emphasis-color-rgb), 0.04));
68
68
  --mp-datatable-row-selected-bg: var(--bs-list-group-active-bg, var(--bs-primary, #0d6efd));
69
69
  --mp-datatable-row-selected-color: var(--bs-list-group-active-color, #fff);
70
70
  --mp-datatable-cut-opacity: 0.55;
@@ -358,7 +358,7 @@ tr.filter-row[data-mps=datatable] th[data-mps=datatable] {
358
358
  }
359
359
 
360
360
  .filter-trigger:hover[data-mps=datatable] {
361
- background-color: var(--mp-datatable-row-hover-bg, rgba(0, 0, 0, 0.04));
361
+ background-color: var(--mp-datatable-row-hover-bg, rgba(var(--bs-emphasis-color-rgb), 0.04));
362
362
  }
363
363
 
364
364
  .filter-trigger:focus-visible[data-mps=datatable] {
@@ -367,7 +367,7 @@ tr.filter-row[data-mps=datatable] th[data-mps=datatable] {
367
367
  }
368
368
 
369
369
  .filter-trigger[aria-expanded=true][data-mps=datatable] {
370
- background-color: var(--mp-datatable-row-hover-bg, rgba(0, 0, 0, 0.04));
370
+ background-color: var(--mp-datatable-row-hover-bg, rgba(var(--bs-emphasis-color-rgb), 0.04));
371
371
  border-color: var(--mp-datatable-border-color);
372
372
  }
373
373
 
@@ -514,7 +514,7 @@ tr.filter-row[data-mps=datatable] th[data-mps=datatable] {
514
514
  }
515
515
 
516
516
  .filter-option:hover[data-mps=datatable] {
517
- background-color: var(--mp-datatable-row-hover-bg, rgba(0, 0, 0, 0.04));
517
+ background-color: var(--mp-datatable-row-hover-bg, rgba(var(--bs-emphasis-color-rgb), 0.04));
518
518
  }
519
519
 
520
520
  .filter-remaining[data-mps=datatable] {
@@ -544,52 +544,56 @@ tr.filter-row[data-mps=datatable] th[data-mps=datatable] {
544
544
  transition: none !important;
545
545
  }
546
546
  }`);
547
- function N(n, e, t) {
547
+ function B(l, e, t) {
548
548
  if (t) {
549
- const i = n.findIndex((s) => s.property === e);
550
- return i === -1 ? [...n, { property: e, direction: "ascending" }] : n[i].direction === "ascending" ? n.map(
549
+ const i = l.findIndex((s) => s.property === e);
550
+ return i === -1 ? [...l, { property: e, direction: "ascending" }] : l[i].direction === "ascending" ? l.map(
551
551
  (s, r) => r === i ? { ...s, direction: "descending" } : s
552
- ) : n.filter((s, r) => r !== i);
552
+ ) : l.filter((s, r) => r !== i);
553
553
  }
554
- const a = n.length === 1 && n[0].property === e;
554
+ const a = l.length === 1 && l[0].property === e;
555
555
  return [
556
556
  {
557
557
  property: e,
558
- direction: a && n[0].direction === "ascending" ? "descending" : "ascending"
558
+ direction: a && l[0].direction === "ascending" ? "descending" : "ascending"
559
559
  }
560
560
  ];
561
561
  }
562
- function y(n, e) {
563
- return e.length === 0 ? n.slice() : n.map((t, a) => ({ row: t, index: a })).sort((t, a) => {
562
+ function y(l, e) {
563
+ return e.length === 0 ? l.slice() : l.map((t, a) => ({ row: t, index: a })).sort((t, a) => {
564
564
  for (const i of e) {
565
- const s = S(t.row, i.property), r = S(a.row, i.property), o = W(s, r);
565
+ const s = S(t.row, i.property), r = S(a.row, i.property), o = V(s, r);
566
566
  if (o !== 0)
567
567
  return i.direction === "ascending" ? o : -o;
568
568
  }
569
569
  return t.index - a.index;
570
570
  }).map(({ row: t }) => t);
571
571
  }
572
- function S(n, e) {
573
- if (!(n == null || typeof n != "object"))
574
- return n[e];
572
+ function S(l, e) {
573
+ if (!(l == null || typeof l != "object"))
574
+ return l[e];
575
575
  }
576
- function W(n, e) {
577
- return n === e ? 0 : n == null ? 1 : e == null ? -1 : typeof n == "number" && typeof e == "number" ? n - e : n instanceof Date && e instanceof Date ? n.getTime() - e.getTime() : String(n).localeCompare(String(e));
576
+ function V(l, e) {
577
+ return l === e ? 0 : l == null ? 1 : e == null ? -1 : typeof l == "number" && typeof e == "number" ? l - e : l instanceof Date && e instanceof Date ? l.getTime() - e.getTime() : String(l).localeCompare(String(e));
578
578
  }
579
- const h = L("datatable");
580
- function $(n, e) {
581
- return n === e || n !== n && e !== e;
579
+ const F = 40, $ = 10;
580
+ function R(l, e) {
581
+ return Math.max(F, l + e);
582
582
  }
583
- function g(n, e) {
584
- return n.some((t) => $(t.value, e));
583
+ const h = k("datatable");
584
+ function E(l, e) {
585
+ return l === e || l !== l && e !== e;
585
586
  }
586
- const H = 250;
587
- let B = 0;
588
- class V extends E {
587
+ function g(l, e) {
588
+ return l.some((t) => E(t.value, e));
589
+ }
590
+ const G = 250;
591
+ let j = 0;
592
+ class X extends P {
589
593
  constructor() {
590
- super(...arguments), this.instanceId = `mp-datatable-${++B}`, this._caption = null, this._inputLabel = null, this.hostAria = new q(this, {
594
+ super(...arguments), this.instanceId = `mp-datatable-${++j}`, this._caption = null, this._inputLabel = null, this.hostAria = new U(this, {
591
595
  referenceTarget: () => this.renderRoot?.querySelector("table") ?? null
592
- }), this.labels = void 0, this._columns = [], this._data = [], this._sortColumns = [], this._selectionMode = "none", this._selectedIds = /* @__PURE__ */ new Set(), this._cutIds = /* @__PURE__ */ new Set(), this._focusedRowKey = null, this.liveAnnouncer = new P(this), this.rowFocusRestore = new k(this, new z(
596
+ }), this.labels = void 0, this._columns = [], this._data = [], this._sortColumns = [], this._selectionMode = "none", this._selectedIds = /* @__PURE__ */ new Set(), this._cutIds = /* @__PURE__ */ new Set(), this._focusedRowKey = null, this.liveAnnouncer = new q(this), this.rowFocusRestore = new K(this, new A(
593
597
  () => this.renderRoot ?? null,
594
598
  {
595
599
  selector: 'tbody tr[data-row-key]:not([data-placeholder="true"])',
@@ -599,7 +603,7 @@ class V extends E {
599
603
  )), this._rowKey = (e, t) => {
600
604
  const a = e;
601
605
  return a && a.id != null ? String(a.id) : `row-${t}`;
602
- }, this._columnWidths = /* @__PURE__ */ new Map(), this._hasMeasuredInitial = !1, this._loading = !1, this._emptyMessage = "No data", this._pagination = !1, this._page = 1, this._perPage = 20, this._perPageOptions = [10, 20, 50], this._autoSort = !0, this._totalRecords = null, this._virtualScroll = !1, this._itemSize = 40, this._virtualBuffer = 10, this._virtualRange = { startIndex: 0, endIndex: 0 }, this._scrollElement = null, this._resizeObserver = null, this._scrollListener = null, this._viewportHeight = 0, this._openFilterColumn = null, this._mountedFilterColumn = null, this._consumerMountedFilter = !1, this._filterUid = `mp-dt-${Math.random().toString(36).slice(2, 9)}`, this._distincts = null, this._filterStates = /* @__PURE__ */ new Map(), this._tree = !1, this._idKey = null, this._childCountKey = null, this._treeIndent = 1.25, this._expandedIds = /* @__PURE__ */ new Set(), this._selectionStrategy = "flat", this._childCache = /* @__PURE__ */ new Map(), this._childTotals = /* @__PURE__ */ new Map(), this._pendingFetches = /* @__PURE__ */ new Set(), this._pageCache = /* @__PURE__ */ new Map(), this._pendingPageFetches = /* @__PURE__ */ new Set(), this._fetch = null, this._fetchGeneration = 0, this._initialFetchDone = !1, this._reloadScheduled = !1, this._lastReloadKey = null, this._cachedFlatList = null, this._cachedIndeterminateKeys = null, this._resizableColumns = !0, this.filterOverlay = new I(this, {
606
+ }, this._columnWidths = /* @__PURE__ */ new Map(), this._hasMeasuredInitial = !1, this._loading = !1, this._emptyMessage = "No data", this._pagination = !1, this._page = 1, this._perPage = 20, this._perPageOptions = [10, 20, 50], this._autoSort = !0, this._totalRecords = null, this._virtualScroll = !1, this._itemSize = 40, this._virtualBuffer = 10, this._virtualRange = { startIndex: 0, endIndex: 0 }, this._scrollElement = null, this._resizeObserver = null, this._scrollListener = null, this._viewportHeight = 0, this._openFilterColumn = null, this._mountedFilterColumn = null, this._consumerMountedFilter = !1, this._filterUid = `mp-dt-${Math.random().toString(36).slice(2, 9)}`, this._distincts = null, this._filterStates = /* @__PURE__ */ new Map(), this._tree = !1, this._idKey = null, this._childCountKey = null, this._treeIndent = 1.25, this._expandedIds = /* @__PURE__ */ new Set(), this._selectionStrategy = "flat", this._childCache = /* @__PURE__ */ new Map(), this._childTotals = /* @__PURE__ */ new Map(), this._pendingFetches = /* @__PURE__ */ new Set(), this._pageCache = /* @__PURE__ */ new Map(), this._pendingPageFetches = /* @__PURE__ */ new Set(), this._fetch = null, this._fetchGeneration = 0, this._initialFetchDone = !1, this._reloadScheduled = !1, this._lastReloadKey = null, this._cachedFlatList = null, this._cachedIndeterminateKeys = null, this._resizableColumns = !0, this.filterOverlay = new M(this, {
603
607
  portal: !0,
604
608
  modal: !0,
605
609
  scrollStrategy: "reposition",
@@ -632,8 +636,8 @@ class V extends E {
632
636
  }
633
637
  }), this._selectionAnchorKey = null, this.resizeState = null, this.onColumnResizeMove = (e) => {
634
638
  if (!this.resizeState) return;
635
- const t = e.clientX - this.resizeState.startX, a = Math.max(40, this.resizeState.startWidth + t);
636
- this._columnWidths = new Map(this._columnWidths), this._columnWidths.set(this.resizeState.columnName, a), this.requestUpdate();
639
+ const t = R(this.resizeState.startWidth, e.clientX - this.resizeState.startX);
640
+ this._columnWidths = new Map(this._columnWidths), this._columnWidths.set(this.resizeState.columnName, t), this.requestUpdate();
637
641
  }, this.onColumnResizeEnd = (e) => {
638
642
  if (this.resizeState) {
639
643
  this.resizeState.handle.classList.remove("active"), this.resizeState.handle.removeEventListener("pointermove", this.onColumnResizeMove), this.resizeState.handle.removeEventListener("pointerup", this.onColumnResizeEnd), this.resizeState.handle.removeEventListener("pointercancel", this.onColumnResizeEnd);
@@ -695,7 +699,7 @@ class V extends E {
695
699
  }
696
700
  /** Merged view of labels — consumer keys over the English defaults. */
697
701
  get mergedLabels() {
698
- return { ...O, ...this.labels ?? {} };
702
+ return { ...W, ...this.labels ?? {} };
699
703
  }
700
704
  /** Optional invisible accessible name for the <table>. Host aria-label wins. */
701
705
  get inputLabel() {
@@ -736,7 +740,7 @@ class V extends E {
736
740
  return this._itemSize;
737
741
  }
738
742
  set itemSize(e) {
739
- const t = Math.max(1, Math.floor(e || 0)) || 40;
743
+ const t = Number.isFinite(e) && e > 0 ? Math.max(1, Math.floor(e)) : 40;
740
744
  this._itemSize !== t && (this._itemSize = t, this.requestUpdate());
741
745
  }
742
746
  /** Off-screen row buffer (each side) for virtual scrolling. */
@@ -979,12 +983,12 @@ class V extends E {
979
983
  else if (e === "aria-labelledby" || e === "aria-describedby")
980
984
  this.hostAria.syncReferences();
981
985
  else if (e === "selection-mode") {
982
- const i = a;
986
+ const i = a ?? "none";
983
987
  (i === "none" || i === "single" || i === "multiple") && (this.selectionMode = i);
984
988
  } else if (e === "pagination")
985
989
  this.pagination = a !== null;
986
990
  else if (e === "resizable-columns")
987
- this.resizableColumns = a !== null;
991
+ this.resizableColumns = a !== "false";
988
992
  else if (e === "auto-sort")
989
993
  this.autoSort = a !== "false";
990
994
  else if (e === "empty-message")
@@ -997,7 +1001,7 @@ class V extends E {
997
1001
  } else if (e === "tree")
998
1002
  this.tree = a !== null;
999
1003
  else if (e === "tree-indent") {
1000
- const i = Number(a);
1004
+ const i = a === null ? 1.25 : Number(a);
1001
1005
  Number.isFinite(i) && (this.treeIndent = i);
1002
1006
  } else e === "selection-strategy" && (this.selectionStrategy = a === "cascading" ? "cascading" : "flat");
1003
1007
  }
@@ -1087,8 +1091,8 @@ class V extends E {
1087
1091
  maybeFetchPlaceholdersInViewport() {
1088
1092
  const e = this.getFlatList(), { startIndex: t, endIndex: a } = this._virtualRange, i = this._virtualScroll ? t : 0, s = this._virtualScroll ? a : e.length, r = /* @__PURE__ */ new Set();
1089
1093
  for (let o = i; o < s; o++) {
1090
- const l = e[o];
1091
- !l.isPlaceholder || l.parentId == null || this._childCache.has(l.parentId) || this._pendingFetches.has(l.parentId) || r.add(l.parentId);
1094
+ const n = e[o];
1095
+ !n.isPlaceholder || n.parentId == null || this._childCache.has(n.parentId) || this._pendingFetches.has(n.parentId) || r.add(n.parentId);
1092
1096
  }
1093
1097
  for (const o of r) this.fetchChildren(o);
1094
1098
  }
@@ -1102,20 +1106,20 @@ class V extends E {
1102
1106
  maybeFetchPagesInViewport() {
1103
1107
  const e = this.getFlatList(), { startIndex: t, endIndex: a } = this._virtualRange, i = this._virtualScroll ? t : 0, s = this._virtualScroll ? a : e.length, r = /* @__PURE__ */ new Set();
1104
1108
  for (let o = i; o < s; o++) {
1105
- const l = e[o];
1106
- !l.isPlaceholder || l.page == null || l.page <= 1 || this._pageCache.has(l.page) || this._pendingPageFetches.has(l.page) || r.add(l.page);
1109
+ const n = e[o];
1110
+ !n.isPlaceholder || n.page == null || n.page <= 1 || this._pageCache.has(n.page) || this._pendingPageFetches.has(n.page) || r.add(n.page);
1107
1111
  }
1108
1112
  for (const o of r) this.fetchWindowPage(o);
1109
1113
  }
1110
1114
  render() {
1111
- const e = this.computeVisibleRows(), t = this._totalRecords ?? this._data.length, a = this.pagination && !this._tree ? Math.max(1, Math.ceil(t / this._perPage)) : 1, i = this._selectionMode === "multiple", s = this._columns.length + (i ? 1 : 0) + (this._tree ? 1 : 0), r = this.getVirtualSpacerHeights(), o = this.hasFilterRow ? 2 : 1, l = (this._tree || this.isRootWindowed() ? this.getFlatList().length : this._data.length) + o;
1115
+ const e = this.computeVisibleRows(), t = this._totalRecords ?? this._data.length, a = this.pagination && !this._tree ? Math.max(1, Math.ceil(t / this._perPage)) : 1, i = this._selectionMode === "multiple", s = this._columns.length + (i ? 1 : 0) + (this._tree ? 1 : 0), r = this.getVirtualSpacerHeights(), o = this.hasFilterRow ? 2 : 1, n = (this._tree || this.isRootWindowed() ? this.getFlatList().length : this._data.length) + o;
1112
1116
  return h`
1113
1117
  ${this.liveAnnouncer.template()}
1114
1118
  <div class="datatable-shell">
1115
1119
  <div class="datatable-scroll ${this._virtualScroll ? "datatable-virtual" : ""}" role="presentation">
1116
1120
  <table
1117
1121
  role=${this._tree ? "treegrid" : this._selectionMode !== "none" ? "grid" : u}
1118
- aria-rowcount=${l}
1122
+ aria-rowcount=${n}
1119
1123
  aria-colcount=${s}
1120
1124
  aria-busy=${this._loading ? "true" : u}
1121
1125
  aria-label=${this.getAttribute("aria-label") ?? this._inputLabel ?? u}
@@ -1142,7 +1146,7 @@ class V extends E {
1142
1146
  <tbody>
1143
1147
  ${this._loading ? h`<tr><td colspan=${s} class="loading-state">Loading…</td></tr>` : e.length === 0 ? h`<tr><td colspan=${s} class="empty-state">${this._emptyMessage}</td></tr>` : h`
1144
1148
  ${r.top > 0 ? h`<tr class="virtual-spacer" aria-hidden="true"><td colspan=${s} style=${_({ height: `${r.top}px`, padding: "0", border: "0" })}></td></tr>` : u}
1145
- ${x(
1149
+ ${C(
1146
1150
  e,
1147
1151
  ({ key: d }) => d,
1148
1152
  ({ key: d, rowIndex: c, flat: p }) => this.renderRow(p, d, c, i)
@@ -1274,7 +1278,7 @@ class V extends E {
1274
1278
  applyComparison(e, t, a) {
1275
1279
  const i = this.filterState(e);
1276
1280
  if (!i) return;
1277
- const s = this._columns.find((l) => l.name === e), r = this.parseOperand(a, s?.filterInputType);
1281
+ const s = this._columns.find((n) => n.name === e), r = this.parseOperand(a, s?.filterInputType);
1278
1282
  i.operandText = a, i.selection = { ...i.selection, operator: t, operand: r }, this.notifyFilterListeners(i);
1279
1283
  const o = this.mergedLabels;
1280
1284
  this.liveAnnouncer.announce(
@@ -1309,7 +1313,7 @@ class V extends E {
1309
1313
  const i = a.loadedTerm ?? "";
1310
1314
  (a.loaded?.hasMore || !t.startsWith(i)) && (a.debounce != null && clearTimeout(a.debounce), a.debounce = setTimeout(() => {
1311
1315
  a.debounce = null, this.loadDistincts(e, t);
1312
- }, H));
1316
+ }, G));
1313
1317
  }
1314
1318
  /**
1315
1319
  * Loads (or recomputes) one column's value list.
@@ -1490,7 +1494,7 @@ class V extends E {
1490
1494
  this.renderComparisonFilterPanel(e, t, a);
1491
1495
  return;
1492
1496
  }
1493
- const i = this.mergedLabels, s = e.label ?? e.name, r = t.view, o = t.selection.values, l = [
1497
+ const i = this.mergedLabels, s = e.label ?? e.name, r = t.view, o = t.selection.values, n = [
1494
1498
  ...o,
1495
1499
  ...(r?.matching ?? []).filter((c) => !g(o, c.value)),
1496
1500
  ...(r?.remaining ?? []).filter((c) => !g(o, c.value))
@@ -1522,11 +1526,11 @@ class V extends E {
1522
1526
  </button>
1523
1527
  <div class="filter-options" role="group" aria-label=${i.filterGroup(s)}>
1524
1528
  ${t.loading ? h`<span class="filter-loading">${i.loading}</span>` : u}
1525
- ${x(
1526
- l,
1529
+ ${C(
1530
+ n,
1527
1531
  (c) => c.value,
1528
1532
  (c) => h`
1529
- <label class=${C({ "filter-option": !0, "filter-remaining": d(c.value) })}>
1533
+ <label class=${x({ "filter-option": !0, "filter-remaining": d(c.value) })}>
1530
1534
  <input
1531
1535
  type="checkbox"
1532
1536
  .checked=${g(o, c.value)}
@@ -1536,7 +1540,7 @@ class V extends E {
1536
1540
  </label>
1537
1541
  `
1538
1542
  )}
1539
- ${l.length === 0 && !t.loading ? h`<span class="filter-no-values">${i.filterNoValues}</span>` : u}
1543
+ ${n.length === 0 && !t.loading ? h`<span class="filter-no-values">${i.filterNoValues}</span>` : u}
1540
1544
  </div>
1541
1545
  ${r?.hasMore ? h`<span class="filter-has-more">${i.filterHasMore}</span>` : u}
1542
1546
  `,
@@ -1552,13 +1556,13 @@ class V extends E {
1552
1556
  * displayed.
1553
1557
  */
1554
1558
  renderComparisonFilterPanel(e, t, a) {
1555
- const i = this.mergedLabels, s = e.label ?? e.name, r = e.filterOperators?.length ? e.filterOperators : T, o = t.selection.operator ?? r[0], l = t.selection.operand, d = e.filterInputType ?? "number", c = () => a.querySelector(".filter-operand")?.value ?? "", p = () => a.querySelector(".filter-operator")?.value ?? o;
1559
+ const i = this.mergedLabels, s = e.label ?? e.name, r = e.filterOperators?.length ? e.filterOperators : N, o = t.selection.operator ?? r[0], n = t.selection.operand, d = e.filterInputType ?? "number", c = () => a.querySelector(".filter-operand")?.value ?? "", p = () => a.querySelector(".filter-operator")?.value ?? o;
1556
1560
  v(
1557
1561
  h`
1558
1562
  <button
1559
1563
  type="button"
1560
1564
  class="filter-clear"
1561
- ?disabled=${l == null}
1565
+ ?disabled=${n == null}
1562
1566
  @click=${() => this.onFilterClear(e.name)}
1563
1567
  >
1564
1568
  ${i.filterClear(s)}
@@ -1572,7 +1576,7 @@ class V extends E {
1572
1576
  ${r.map(
1573
1577
  (f) => h`
1574
1578
  <option value=${f} ?selected=${f === o}>
1575
- ${U[f]} ${i.filterOperatorLabel(f)}
1579
+ ${D[f]} ${i.filterOperatorLabel(f)}
1576
1580
  </option>
1577
1581
  `
1578
1582
  )}
@@ -1580,7 +1584,7 @@ class V extends E {
1580
1584
  <input
1581
1585
  class="filter-operand"
1582
1586
  type=${d}
1583
- .value=${K(t.operandText)}
1587
+ .value=${T(t.operandText)}
1584
1588
  aria-label=${i.filterOperand}
1585
1589
  @input=${() => this.applyComparison(e.name, p(), c())}
1586
1590
  />
@@ -1592,7 +1596,7 @@ class V extends E {
1592
1596
  onFilterToggle(e, t, a) {
1593
1597
  const i = this.filterState(e);
1594
1598
  if (!i) return;
1595
- const s = a ? [...i.selection.values, t] : i.selection.values.filter((r) => !$(r.value, t.value));
1599
+ const s = a ? [...i.selection.values, t] : i.selection.values.filter((r) => !E(r.value, t.value));
1596
1600
  i.ctx.apply(s, i.selection.inverse);
1597
1601
  }
1598
1602
  onFilterClear(e) {
@@ -1627,7 +1631,7 @@ class V extends E {
1627
1631
  <th class="filter-cell p-0" data-column=${e.name} scope="col">
1628
1632
  <button
1629
1633
  type="button"
1630
- class=${C({
1634
+ class=${x({
1631
1635
  "filter-trigger": !0,
1632
1636
  "p-2": !0,
1633
1637
  "rounded-0": !0,
@@ -1649,14 +1653,14 @@ class V extends E {
1649
1653
  `;
1650
1654
  }
1651
1655
  renderHeader(e, t) {
1652
- const a = e.sortable ?? !0, i = this._sortColumns.findIndex((d) => d.property === e.name), s = i >= 0 ? this._sortColumns[i].direction : null, r = this._columnWidths.get(e.name) ?? e.width, o = e.headerRenderer ? e.headerRenderer(e) : e.label ?? e.name, l = {};
1653
- return typeof r == "number" && (l.width = `${r}px`, l.minWidth = `${r}px`), h`
1656
+ const a = e.sortable ?? !0, i = this._sortColumns.findIndex((d) => d.property === e.name), s = i >= 0 ? this._sortColumns[i].direction : null, r = this._columnWidths.get(e.name) ?? e.width, o = e.headerRenderer ? e.headerRenderer(e) : e.label ?? e.name, n = {};
1657
+ return typeof r == "number" && (n.width = `${r}px`, n.minWidth = `${r}px`), h`
1654
1658
  <th
1655
1659
  scope="col"
1656
1660
  data-column=${e.name}
1657
1661
  data-sortable=${a ? "true" : "false"}
1658
1662
  aria-sort=${s ? s === "ascending" ? "ascending" : "descending" : "none"}
1659
- style=${_(l)}
1663
+ style=${_(n)}
1660
1664
  >
1661
1665
  ${a ? h`<button
1662
1666
  type="button"
@@ -1674,7 +1678,7 @@ class V extends E {
1674
1678
  tabindex="0"
1675
1679
  aria-orientation="vertical"
1676
1680
  aria-label=${this.mergedLabels.resizeColumn(e.label ?? e.name)}
1677
- aria-valuemin="40"
1681
+ aria-valuemin=${F}
1678
1682
  aria-valuenow=${Math.round(r ?? 0) || u}
1679
1683
  @pointerdown=${(d) => this.startColumnResize(e, d)}
1680
1684
  @keydown=${(d) => this.onResizeHandleKeydown(e, d)}
@@ -1683,30 +1687,30 @@ class V extends E {
1683
1687
  `;
1684
1688
  }
1685
1689
  renderRow(e, t, a, i) {
1686
- const { row: s, depth: r, isExpanded: o, isPlaceholder: l } = e, d = !l && this._selectedIds.has(t), c = !l && this._cutIds.has(t), p = !l && this._focusedRowKey === t, f = l ? 0 : this.extractChildCount(s), b = this._tree && !l && f > 0, R = !l && s != null && this.isParentIndeterminate(s);
1690
+ const { row: s, depth: r, isExpanded: o, isPlaceholder: n } = e, d = !n && this._selectedIds.has(t), c = !n && this._cutIds.has(t), p = !n && this._focusedRowKey === t, f = n ? 0 : this.extractChildCount(s), b = this._tree && !n && f > 0, I = !n && s != null && this.isParentIndeterminate(s);
1687
1691
  return h`
1688
1692
  <tr
1689
1693
  role="row"
1690
1694
  aria-rowindex=${a + 1 + (this.hasFilterRow ? 2 : 1)}
1691
1695
  aria-level=${this._tree ? r + 1 : u}
1692
1696
  aria-expanded=${this._tree && f > 0 ? o ? "true" : "false" : u}
1693
- aria-busy=${l ? "true" : u}
1694
- aria-selected=${!l && this._selectionMode !== "none" ? d ? "true" : "false" : u}
1697
+ aria-busy=${n ? "true" : u}
1698
+ aria-selected=${!n && this._selectionMode !== "none" ? d ? "true" : "false" : u}
1695
1699
  data-row-key=${t}
1696
1700
  data-selected=${d ? "true" : "false"}
1697
1701
  data-cut=${c ? "true" : "false"}
1698
1702
  data-focused=${p ? "true" : "false"}
1699
- data-placeholder=${l ? "true" : "false"}
1703
+ data-placeholder=${n ? "true" : "false"}
1700
1704
  data-depth=${this._tree ? String(r) : u}
1701
- data-clickable=${!l && (this._selectionMode !== "none" || this.hasRowClickListeners()) ? "true" : "false"}
1702
- tabindex=${!l && (this._selectionMode !== "none" || this._tree) ? this._focusedRowKey === t || this._focusedRowKey === null && a === 0 ? "0" : "-1" : u}
1703
- @focus=${l ? null : () => {
1705
+ data-clickable=${!n && (this._selectionMode !== "none" || this.hasRowClickListeners()) ? "true" : "false"}
1706
+ tabindex=${!n && (this._selectionMode !== "none" || this._tree) ? this._focusedRowKey === t || this._focusedRowKey === null && a === 0 ? "0" : "-1" : u}
1707
+ @focus=${n ? null : () => {
1704
1708
  this._focusedRowKey = t, this.requestUpdate();
1705
1709
  }}
1706
- @click=${l ? null : (m) => this.onRowClick(s, t, a, m)}
1707
- @dblclick=${l ? null : (m) => this.onRowDblClick(s, t, a, m)}
1708
- @contextmenu=${l ? null : (m) => this.onRowContextMenu(s, t, a, m)}
1709
- @keydown=${l ? null : (m) => this.onRowKeydown(s, t, a, e.parentId, r, o, f, m)}
1710
+ @click=${n ? null : (m) => this.onRowClick(s, t, a, m)}
1711
+ @dblclick=${n ? null : (m) => this.onRowDblClick(s, t, a, m)}
1712
+ @contextmenu=${n ? null : (m) => this.onRowContextMenu(s, t, a, m)}
1713
+ @keydown=${n ? null : (m) => this.onRowKeydown(s, t, a, e.parentId, r, o, f, m)}
1710
1714
  >
1711
1715
  ${this._tree ? h`<td class="tree-chevron-cell" style=${_({ paddingInlineStart: `${r * this._treeIndent}rem` })}>
1712
1716
  ${b ? h`<button
@@ -1719,14 +1723,14 @@ class V extends E {
1719
1723
  >${o ? "▾" : "▸"}</button>` : u}
1720
1724
  </td>` : u}
1721
1725
  ${i ? h`<td class="checkbox-cell" @click=${(m) => m.stopPropagation()}>
1722
- ${l ? u : h`<mp-checkbox
1726
+ ${n ? u : h`<mp-checkbox
1723
1727
  aria-label=${this.mergedLabels.selectRow(a + 1)}
1724
1728
  .checked=${d}
1725
- .indeterminate=${R}
1726
- @change=${(m) => this.onRowCheckboxToggle(s, t, a, m)}
1729
+ .indeterminate=${I}
1730
+ @change=${() => this.onRowCheckboxToggle(s, t)}
1727
1731
  ></mp-checkbox>`}
1728
1732
  </td>` : u}
1729
- ${this._rowRenderer ? this.renderRowFromRenderer(s, a, { depth: r, isExpanded: o, isPlaceholder: l }) : l ? h`<td colspan=${this._columns.length} class="tree-placeholder-cell" aria-label=${this.mergedLabels.loading}>…</td>` : this._columns.map((m) => this.renderCell(s, m, a))}
1733
+ ${this._rowRenderer ? this.renderRowFromRenderer(s, a, { depth: r, isExpanded: o, isPlaceholder: n }) : n ? h`<td colspan=${this._columns.length} class="tree-placeholder-cell" aria-label=${this.mergedLabels.loading}>…</td>` : this._columns.map((m) => this.renderCell(s, m, a))}
1730
1734
  </tr>
1731
1735
  `;
1732
1736
  }
@@ -1734,7 +1738,7 @@ class V extends E {
1734
1738
  const i = this._rowRenderer(e, t, a);
1735
1739
  if (i == null)
1736
1740
  return a.isPlaceholder ? h`<td colspan=${this._columns.length} class="tree-placeholder-cell" aria-label=${this.mergedLabels.loading}>…</td>` : this._columns.map((s) => this.renderCell(e, s, t));
1737
- if (Array.isArray(i) || j(i)) {
1741
+ if (Array.isArray(i) || J(i)) {
1738
1742
  const s = [];
1739
1743
  for (const r of i) s.push(r);
1740
1744
  return s;
@@ -1742,7 +1746,7 @@ class V extends E {
1742
1746
  return i;
1743
1747
  }
1744
1748
  renderCell(e, t, a) {
1745
- const i = t.cellRenderer ? t.cellRenderer(e, t, a) : G(e, t);
1749
+ const i = t.cellRenderer ? t.cellRenderer(e, t, a) : Y(e, t);
1746
1750
  return h`<td class=${t.cellClass ?? ""} data-column=${t.name}>${w(i)}</td>`;
1747
1751
  }
1748
1752
  renderFooter(e) {
@@ -1807,12 +1811,12 @@ class V extends E {
1807
1811
  if (this._cachedFlatList !== null) return this._cachedFlatList;
1808
1812
  if (!this._tree) {
1809
1813
  if (this.isRootWindowed()) {
1810
- const r = this._totalRecords ?? this._data.length, o = Math.max(1, this._perPage), l = new Array(r);
1814
+ const r = this._totalRecords ?? this._data.length, o = Math.max(1, this._perPage), n = new Array(r);
1811
1815
  for (let d = 0; d < r; d++) {
1812
1816
  const c = Math.floor(d / o) + 1, p = d % o, f = c === 1 ? this._data[p] : this._pageCache.get(c)?.[p];
1813
- l[d] = f !== void 0 ? { row: f, key: this._rowKey(f, d), depth: 0, parentId: null, isExpanded: !1, isPlaceholder: !1 } : { row: void 0, key: `__placeholder-flat-${d}`, depth: 0, parentId: null, page: c, isExpanded: !1, isPlaceholder: !0 };
1817
+ n[d] = f !== void 0 ? { row: f, key: this._rowKey(f, d), depth: 0, parentId: null, isExpanded: !1, isPlaceholder: !1 } : { row: void 0, key: `__placeholder-flat-${d}`, depth: 0, parentId: null, page: c, isExpanded: !1, isPlaceholder: !0 };
1814
1818
  }
1815
- return this._cachedFlatList = l;
1819
+ return this._cachedFlatList = n;
1816
1820
  }
1817
1821
  const s = (() => {
1818
1822
  let r = this._data;
@@ -1832,22 +1836,22 @@ class V extends E {
1832
1836
  }));
1833
1837
  }
1834
1838
  const e = [], t = Math.max(1, this._perPage), a = (s) => this._autoSort && this._sortColumns.length > 0 ? y(s, this._sortColumns) : s, i = (s, r, o) => {
1835
- const l = this.extractId(s), d = l != null && this._expandedIds.has(l), c = this.extractChildCount(s);
1836
- if (e.push({ row: s, key: this._rowKey(s, e.length), depth: r, parentId: o, isExpanded: d, isPlaceholder: !1 }), !d || c === 0 || l == null) return;
1837
- const p = this._childCache.get(l);
1839
+ const n = this.extractId(s), d = n != null && this._expandedIds.has(n), c = this.extractChildCount(s);
1840
+ if (e.push({ row: s, key: this._rowKey(s, e.length), depth: r, parentId: o, isExpanded: d, isPlaceholder: !1 }), !d || c === 0 || n == null) return;
1841
+ const p = this._childCache.get(n);
1838
1842
  if (p && p.length > 0) {
1839
- for (const b of a(p)) i(b, r + 1, l);
1840
- const f = this._childTotals.get(l) ?? p.length;
1843
+ for (const b of a(p)) i(b, r + 1, n);
1844
+ const f = this._childTotals.get(n) ?? p.length;
1841
1845
  for (let b = 0; b < Math.max(0, f - p.length); b++)
1842
- e.push({ row: void 0, key: `__placeholder-${String(l)}-${p.length + b}`, depth: r + 1, parentId: l, isExpanded: !1, isPlaceholder: !0 });
1846
+ e.push({ row: void 0, key: `__placeholder-${String(n)}-${p.length + b}`, depth: r + 1, parentId: n, isExpanded: !1, isPlaceholder: !0 });
1843
1847
  } else
1844
1848
  for (let f = 0; f < c; f++)
1845
- e.push({ row: void 0, key: `__placeholder-${String(l)}-${f}`, depth: r + 1, parentId: l, isExpanded: !1, isPlaceholder: !0 });
1849
+ e.push({ row: void 0, key: `__placeholder-${String(n)}-${f}`, depth: r + 1, parentId: n, isExpanded: !1, isPlaceholder: !0 });
1846
1850
  };
1847
1851
  if (this.isRootWindowed()) {
1848
1852
  const s = this._totalRecords ?? this._data.length;
1849
1853
  for (let r = 0; r < s; r++) {
1850
- const o = Math.floor(r / t) + 1, l = r % t, d = o === 1 ? this._data[l] : this._pageCache.get(o)?.[l];
1854
+ const o = Math.floor(r / t) + 1, n = r % t, d = o === 1 ? this._data[n] : this._pageCache.get(o)?.[n];
1851
1855
  d === void 0 ? e.push({ row: void 0, key: `__placeholder-root-${r}`, depth: 0, parentId: null, page: o, isExpanded: !1, isPlaceholder: !0 }) : i(d, 0, null);
1852
1856
  }
1853
1857
  } else {
@@ -1911,8 +1915,8 @@ class V extends E {
1911
1915
  const s = this._childCache.get(i);
1912
1916
  if (!s || s.length === 0) return { selected: 0, total: 0 };
1913
1917
  let r = 0, o = 0;
1914
- for (const l of s) {
1915
- const d = this._rowKey(l, -1), c = this._selectedIds.has(d) ? 1 : 0, p = t(l);
1918
+ for (const n of s) {
1919
+ const d = this._rowKey(n, -1), c = this._selectedIds.has(d) ? 1 : 0, p = t(n);
1916
1920
  r += c + p.selected, o += 1 + p.total;
1917
1921
  }
1918
1922
  return o > 0 && r > 0 && r < o && e.add(this._rowKey(a, -1)), { selected: r, total: o };
@@ -2029,33 +2033,33 @@ class V extends E {
2029
2033
  }));
2030
2034
  }
2031
2035
  /** Keyboard handling on a tree-mode row. Arrow keys + Enter/Space toggle expansion. */
2032
- onRowKeydown(e, t, a, i, s, r, o, l) {
2033
- if (!l.altKey && l.composedPath()[0] === l.currentTarget) {
2034
- if (l.key === "ArrowDown" || l.key === "ArrowUp") {
2035
- l.preventDefault();
2036
+ onRowKeydown(e, t, a, i, s, r, o, n) {
2037
+ if (!n.altKey && n.composedPath()[0] === n.currentTarget) {
2038
+ if (n.key === "ArrowDown" || n.key === "ArrowUp") {
2039
+ n.preventDefault();
2036
2040
  const d = Array.from(
2037
2041
  this.renderRoot.querySelectorAll("tbody tr[data-row-key]")
2038
- ), c = d.findIndex((f) => f.dataset.rowKey === t), p = d[c + (l.key === "ArrowDown" ? 1 : -1)];
2042
+ ), c = d.findIndex((f) => f.dataset.rowKey === t), p = d[c + (n.key === "ArrowDown" ? 1 : -1)];
2039
2043
  p && p.focus();
2040
2044
  return;
2041
2045
  }
2042
2046
  if (this._tree) {
2043
- if (l.key === "ArrowRight" && o > 0 && !r) {
2044
- this.toggleExpand(e, i, s, l);
2047
+ if (n.key === "ArrowRight" && o > 0 && !r) {
2048
+ this.toggleExpand(e, i, s, n);
2045
2049
  return;
2046
2050
  }
2047
- if (l.key === "ArrowLeft" && r) {
2048
- this.toggleExpand(e, i, s, l);
2051
+ if (n.key === "ArrowLeft" && r) {
2052
+ this.toggleExpand(e, i, s, n);
2049
2053
  return;
2050
2054
  }
2051
- if ((l.key === "Enter" || l.key === " ") && o > 0) {
2052
- this.toggleExpand(e, i, s, l);
2055
+ if ((n.key === "Enter" || n.key === " ") && o > 0) {
2056
+ this.toggleExpand(e, i, s, n);
2053
2057
  return;
2054
2058
  }
2055
2059
  }
2056
- (l.key === "Enter" || l.key === " ") && this._selectionMode !== "none" && (l.preventDefault(), this._focusedRowKey = t, this.handleSelectionOnClick(t, l), this.requestUpdate(), this.dispatchEvent(
2060
+ (n.key === "Enter" || n.key === " ") && this._selectionMode !== "none" && (n.preventDefault(), this._focusedRowKey = t, this.handleSelectionOnClick(t, n), this.requestUpdate(), this.dispatchEvent(
2057
2061
  new CustomEvent("mp-datatable-row-click", {
2058
- detail: { row: e, rowIndex: a, rowKey: t, originalEvent: l },
2062
+ detail: { row: e, rowIndex: a, rowKey: t, originalEvent: n },
2059
2063
  bubbles: !0,
2060
2064
  composed: !0
2061
2065
  })
@@ -2065,19 +2069,22 @@ class V extends E {
2065
2069
  hasRowClickListeners() {
2066
2070
  return !0;
2067
2071
  }
2072
+ /**
2073
+ * Bound only to the sort <button>, which renders only for sortable columns;
2074
+ * the resize handle is the button's sibling, so its clicks never land here.
2075
+ */
2068
2076
  onHeaderClick(e, t) {
2069
- if (!(e.sortable ?? !0) || t.target.closest(".resize-handle")) return;
2070
- const s = N(this._sortColumns, e.name, t.shiftKey);
2071
- this._sortColumns = s, this._page = 1;
2072
- const r = s.find((o) => o.property === e.name);
2077
+ const a = B(this._sortColumns, e.name, t.shiftKey);
2078
+ this._sortColumns = a, this._page = 1;
2079
+ const i = a.find((s) => s.property === e.name);
2073
2080
  this.liveAnnouncer.announce(
2074
2081
  this.mergedLabels.announceSorted(
2075
2082
  e.label ?? e.name,
2076
- r ? r.direction === "ascending" ? "ascending" : "descending" : "none"
2083
+ i ? i.direction === "ascending" ? "ascending" : "descending" : "none"
2077
2084
  )
2078
2085
  ), this.requestUpdate(), this.scheduleFetchReload(), this.dispatchEvent(
2079
2086
  new CustomEvent("mp-datatable-sort-change", {
2080
- detail: { sortColumns: s },
2087
+ detail: { sortColumns: a },
2081
2088
  bubbles: !0,
2082
2089
  composed: !0
2083
2090
  })
@@ -2109,25 +2116,15 @@ class V extends E {
2109
2116
  composed: !0,
2110
2117
  cancelable: !0
2111
2118
  })
2112
- );
2119
+ ) || i.preventDefault();
2113
2120
  }
2114
- onRowCheckboxToggle(e, t, a, i) {
2115
- if (this._selectionMode !== "none") {
2116
- if (this._selectionMode === "single")
2117
- this._selectedIds = /* @__PURE__ */ new Set([t]);
2118
- else {
2119
- const s = new Set(this._selectedIds), r = !s.has(t);
2120
- if (r ? s.add(t) : s.delete(t), this._tree && this._selectionStrategy === "cascading" && e != null) {
2121
- const o = this.collectDescendantKeys(e);
2122
- if (r)
2123
- for (const l of o) s.add(l);
2124
- else
2125
- for (const l of o) s.delete(l);
2126
- }
2127
- this._selectedIds = s;
2128
- }
2129
- this.emitSelectionChange(), this.requestUpdate();
2130
- }
2121
+ /** Row checkboxes render only in `'multiple'` mode, so this is multi-select toggling. */
2122
+ onRowCheckboxToggle(e, t) {
2123
+ const a = !this._selectedIds.has(t), i = /* @__PURE__ */ new Set([
2124
+ t,
2125
+ ...this._tree && this._selectionStrategy === "cascading" ? this.collectDescendantKeys(e) : []
2126
+ ]);
2127
+ this._selectedIds = a ? /* @__PURE__ */ new Set([...this._selectedIds, ...i]) : new Set([...this._selectedIds].filter((s) => !i.has(s))), this.emitSelectionChange(), this.requestUpdate();
2131
2128
  }
2132
2129
  /**
2133
2130
  * Clears the entire selection. The header checkbox is only rendered when
@@ -2148,8 +2145,8 @@ class V extends E {
2148
2145
  if (t.shiftKey && this._selectionAnchorKey && this._selectionAnchorKey !== e) {
2149
2146
  const a = this.computeVisibleRows(), i = a.findIndex((r) => r.key === this._selectionAnchorKey), s = a.findIndex((r) => r.key === e);
2150
2147
  if (i >= 0 && s >= 0) {
2151
- const [r, o] = i < s ? [i, s] : [s, i], l = a.slice(r, o + 1).map((d) => d.key);
2152
- this._selectedIds = /* @__PURE__ */ new Set([...this._selectedIds, ...l]), this.emitSelectionChange();
2148
+ const [r, o] = i < s ? [i, s] : [s, i], n = a.slice(r, o + 1).map((d) => d.key);
2149
+ this._selectedIds = /* @__PURE__ */ new Set([...this._selectedIds, ...n]), this.emitSelectionChange();
2153
2150
  return;
2154
2151
  }
2155
2152
  }
@@ -2204,7 +2201,10 @@ class V extends E {
2204
2201
  onResizeHandleKeydown(e, t) {
2205
2202
  if (!this._resizableColumns || t.key !== "ArrowLeft" && t.key !== "ArrowRight") return;
2206
2203
  t.preventDefault(), t.stopPropagation();
2207
- const i = t.currentTarget.closest("th"), s = this._columnWidths.get(e.name) ?? i?.getBoundingClientRect().width ?? 100, r = Math.max(40, s + (t.key === "ArrowRight" ? 10 : -10));
2204
+ const i = t.currentTarget.closest("th"), s = this._columnWidths.get(e.name) ?? i?.getBoundingClientRect().width ?? 100, r = R(
2205
+ s,
2206
+ t.key === "ArrowRight" ? $ : -$
2207
+ );
2208
2208
  this._columnWidths = new Map(this._columnWidths), this._columnWidths.set(e.name, r), this.requestUpdate();
2209
2209
  }
2210
2210
  startColumnResize(e, t) {
@@ -2216,23 +2216,23 @@ class V extends E {
2216
2216
  this.resizeState = { columnName: e.name, startX: t.clientX, startWidth: s, handle: a }, a.classList.add("active"), a.setPointerCapture(t.pointerId), a.addEventListener("pointermove", this.onColumnResizeMove), a.addEventListener("pointerup", this.onColumnResizeEnd), a.addEventListener("pointercancel", this.onColumnResizeEnd);
2217
2217
  }
2218
2218
  }
2219
- function G(n, e) {
2220
- if (n == null || typeof n != "object") return "";
2221
- const t = n[e.name];
2219
+ function Y(l, e) {
2220
+ if (l == null || typeof l != "object") return "";
2221
+ const t = l[e.name];
2222
2222
  return t == null ? "" : String(t);
2223
2223
  }
2224
- function j(n) {
2225
- return n != null && typeof n != "string" && typeof n[Symbol.iterator] == "function";
2224
+ function J(l) {
2225
+ return l != null && typeof l != "string" && typeof l[Symbol.iterator] == "function";
2226
2226
  }
2227
- function w(n) {
2228
- return n == null || n === !1 ? u : (n instanceof Node || typeof n == "object" && "_$litType$" in n, n);
2227
+ function w(l) {
2228
+ return l == null || l === !1 ? u : (l instanceof Node || typeof l == "object" && "_$litType$" in l, l);
2229
2229
  }
2230
- M("datatable", D);
2231
- typeof customElements < "u" && !customElements.get("mp-datatable") && customElements.define("mp-datatable", V);
2230
+ z("datatable", H);
2231
+ typeof customElements < "u" && !customElements.get("mp-datatable") && customElements.define("mp-datatable", X);
2232
2232
  export {
2233
- O as D,
2234
- V as M,
2235
- N as c,
2236
- D as d,
2233
+ W as D,
2234
+ X as M,
2235
+ B as c,
2236
+ H as d,
2237
2237
  y as s
2238
2238
  };