@toolbox-web/grid 1.16.1 → 1.18.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 (65) hide show
  1. package/README.md +126 -41
  2. package/all.js +1046 -936
  3. package/all.js.map +1 -1
  4. package/index.js +394 -369
  5. package/index.js.map +1 -1
  6. package/lib/core/grid.d.ts +13 -3
  7. package/lib/core/grid.d.ts.map +1 -1
  8. package/lib/core/internal/header.d.ts.map +1 -1
  9. package/lib/core/internal/keyboard.d.ts.map +1 -1
  10. package/lib/core/internal/shell.d.ts +11 -0
  11. package/lib/core/internal/shell.d.ts.map +1 -1
  12. package/lib/core/plugin/types.d.ts +1 -0
  13. package/lib/core/plugin/types.d.ts.map +1 -1
  14. package/lib/core/types.d.ts +42 -2
  15. package/lib/core/types.d.ts.map +1 -1
  16. package/lib/plugins/clipboard/index.js.map +1 -1
  17. package/lib/plugins/column-virtualization/index.js.map +1 -1
  18. package/lib/plugins/context-menu/index.js.map +1 -1
  19. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  20. package/lib/plugins/editing/index.js +155 -145
  21. package/lib/plugins/editing/index.js.map +1 -1
  22. package/lib/plugins/export/index.js.map +1 -1
  23. package/lib/plugins/filtering/FilteringPlugin.d.ts +31 -0
  24. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  25. package/lib/plugins/filtering/filter-model.d.ts +30 -3
  26. package/lib/plugins/filtering/filter-model.d.ts.map +1 -1
  27. package/lib/plugins/filtering/index.d.ts +1 -0
  28. package/lib/plugins/filtering/index.d.ts.map +1 -1
  29. package/lib/plugins/filtering/index.js +471 -361
  30. package/lib/plugins/filtering/index.js.map +1 -1
  31. package/lib/plugins/filtering/types.d.ts +32 -0
  32. package/lib/plugins/filtering/types.d.ts.map +1 -1
  33. package/lib/plugins/grouping-columns/index.js.map +1 -1
  34. package/lib/plugins/grouping-rows/index.js.map +1 -1
  35. package/lib/plugins/master-detail/index.js.map +1 -1
  36. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +4 -0
  37. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
  38. package/lib/plugins/multi-sort/index.js +57 -47
  39. package/lib/plugins/multi-sort/index.js.map +1 -1
  40. package/lib/plugins/pinned-columns/index.js.map +1 -1
  41. package/lib/plugins/pinned-rows/index.js.map +1 -1
  42. package/lib/plugins/pivot/index.js.map +1 -1
  43. package/lib/plugins/print/index.js.map +1 -1
  44. package/lib/plugins/reorder/index.js +81 -78
  45. package/lib/plugins/reorder/index.js.map +1 -1
  46. package/lib/plugins/responsive/index.js +58 -55
  47. package/lib/plugins/responsive/index.js.map +1 -1
  48. package/lib/plugins/row-reorder/index.js +5 -2
  49. package/lib/plugins/row-reorder/index.js.map +1 -1
  50. package/lib/plugins/selection/index.js.map +1 -1
  51. package/lib/plugins/server-side/index.js.map +1 -1
  52. package/lib/plugins/tree/index.js.map +1 -1
  53. package/lib/plugins/undo-redo/index.js.map +1 -1
  54. package/lib/plugins/visibility/index.js.map +1 -1
  55. package/package.json +1 -1
  56. package/umd/grid.all.umd.js +29 -29
  57. package/umd/grid.all.umd.js.map +1 -1
  58. package/umd/grid.umd.js +10 -10
  59. package/umd/grid.umd.js.map +1 -1
  60. package/umd/plugins/editing.umd.js +1 -1
  61. package/umd/plugins/editing.umd.js.map +1 -1
  62. package/umd/plugins/filtering.umd.js +1 -1
  63. package/umd/plugins/filtering.umd.js.map +1 -1
  64. package/umd/plugins/multi-sort.umd.js +1 -1
  65. package/umd/plugins/multi-sort.umd.js.map +1 -1
package/index.js CHANGED
@@ -63,8 +63,8 @@ function gt(t) {
63
63
  g && (h.__editorName = g), u && (h.__rendererName = u);
64
64
  const d = i.getAttribute("options");
65
65
  d && (h.options = d.split(",").map((m) => {
66
- const [x, N] = m.includes(":") ? m.split(":") : [m.trim(), m.trim()];
67
- return { value: x.trim(), label: N?.trim() || x.trim() };
66
+ const [x, I] = m.includes(":") ? m.split(":") : [m.trim(), m.trim()];
67
+ return { value: x.trim(), label: I?.trim() || x.trim() };
68
68
  }));
69
69
  const w = i.querySelector("tbw-grid-column-view"), v = i.querySelector("tbw-grid-column-editor"), b = i.querySelector("tbw-grid-column-header");
70
70
  w && (h.__viewTemplate = w), v && (h.__editorTemplate = v), b && (h.__headerTemplate = b);
@@ -349,7 +349,7 @@ class Lt {
349
349
  const e = (this.#o.columns?.length ?? 0) > 0;
350
350
  if (!this.#f && e)
351
351
  return;
352
- const i = this.#N();
352
+ const i = this.#I();
353
353
  this.#f = !1, this.#a = i, Object.freeze(this.#a), this.#a.columns && Object.freeze(this.#a.columns), this.#o = this.#x(this.#a), this.#m();
354
354
  }
355
355
  #x(e) {
@@ -378,7 +378,7 @@ class Lt {
378
378
  n && (!o.renderer && !o.viewRenderer && n.renderer && (o.renderer = n.renderer), !o.format && n.format && (o.format = n.format), !o.editor && n.editor && (o.editor = n.editor), !o.editorParams && n.editorParams && (o.editorParams = n.editorParams));
379
379
  }
380
380
  }
381
- #N() {
381
+ #I() {
382
382
  const e = this.#l ? { ...this.#l } : {}, i = Array.isArray(e.columns) ? [...e.columns] : [], o = (this.#d ?? []).map((s) => ({
383
383
  ...s
384
384
  }));
@@ -646,7 +646,7 @@ function zt(t) {
646
646
  function He(t) {
647
647
  return zt(t) === "rtl";
648
648
  }
649
- function oo(t, e) {
649
+ function no(t, e) {
650
650
  return t === "left" || t === "right" ? t : e === "rtl" ? t === "start" ? "right" : "left" : t === "start" ? "left" : "right";
651
651
  }
652
652
  function Qe(t, e) {
@@ -743,12 +743,12 @@ function Mt(t, e, i, o, n) {
743
743
  }
744
744
  const x = d.classList.contains("changed");
745
745
  y !== x && d.classList.toggle("changed", y);
746
- const N = t.effectiveConfig?.rowClass;
747
- if (N) {
746
+ const I = t.effectiveConfig?.rowClass;
747
+ if (I) {
748
748
  const S = d.getAttribute("data-dynamic-classes");
749
749
  S && S.split(" ").forEach((L) => L && d.classList.remove(L));
750
750
  try {
751
- const L = N(u);
751
+ const L = I(u);
752
752
  if (L && L.length > 0) {
753
753
  const re = L.filter((X) => X && typeof X == "string");
754
754
  re.forEach((X) => d.classList.add(X)), d.setAttribute("data-dynamic-classes", re.join(" "));
@@ -818,8 +818,8 @@ function ae(t, e, i, o) {
818
818
  try {
819
819
  const m = i[d.field], x = _(m, i, d);
820
820
  if (x && x.length > 0) {
821
- const N = x.filter((S) => S && typeof S == "string");
822
- N.forEach((S) => w.classList.add(S)), w.setAttribute("data-dynamic-classes", N.join(" "));
821
+ const I = x.filter((S) => S && typeof S == "string");
822
+ I.forEach((S) => w.classList.add(S)), w.setAttribute("data-dynamic-classes", I.join(" "));
823
823
  } else
824
824
  w.removeAttribute("data-dynamic-classes");
825
825
  } catch (m) {
@@ -1033,6 +1033,7 @@ function kt(t, e) {
1033
1033
  ), v = {
1034
1034
  rowIndex: h,
1035
1035
  colIndex: f,
1036
+ column: p,
1036
1037
  field: u,
1037
1038
  value: d,
1038
1039
  row: g,
@@ -1091,25 +1092,28 @@ function $(t, e) {
1091
1092
  p < u ? a.scrollLeft = p - c.left : g > d && (a.scrollLeft = g - a.clientWidth + c.right);
1092
1093
  }
1093
1094
  }
1094
- if (t._activeEditRows !== void 0 && t._activeEditRows !== -1 && l.classList.contains("editing")) {
1095
+ if (i && l.classList.contains("editing")) {
1095
1096
  const c = l.querySelector(Je);
1096
1097
  if (c && document.activeElement !== c)
1097
1098
  try {
1098
1099
  c.focus({ preventScroll: !0 });
1099
1100
  } catch {
1100
1101
  }
1101
- } else if (!l.contains(document.activeElement)) {
1102
+ } else if (i && !l.contains(document.activeElement)) {
1102
1103
  l.hasAttribute("tabindex") || l.setAttribute("tabindex", "-1");
1103
1104
  try {
1104
1105
  l.focus({ preventScroll: !0 });
1105
1106
  } catch {
1106
1107
  }
1108
+ } else if (!i) {
1109
+ const c = t;
1110
+ document.activeElement !== c && c.focus({ preventScroll: !0 });
1107
1111
  }
1108
1112
  }
1109
1113
  }
1110
1114
  }
1111
1115
  const ie = /* @__PURE__ */ new WeakMap();
1112
- function Nt(t, e) {
1116
+ function It(t, e) {
1113
1117
  const i = Ke(e), o = Pt(e);
1114
1118
  if (i < 0 || o < 0) return;
1115
1119
  t._focusRow = i, t._focusCol = o, Ce(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true");
@@ -1140,7 +1144,7 @@ function ye(t, e, i, o) {
1140
1144
  cell: c !== void 0 && h !== void 0 && c >= 0 && h >= 0 ? { row: c, col: h } : void 0
1141
1145
  };
1142
1146
  }
1143
- function It(t, e, i) {
1147
+ function Nt(t, e, i) {
1144
1148
  const o = ye(t, e, i, "mousedown");
1145
1149
  (t._dispatchCellMouseDown?.(o) ?? !1) && ie.set(t, !0);
1146
1150
  }
@@ -1159,7 +1163,7 @@ function Wt(t, e, i) {
1159
1163
  "mousedown",
1160
1164
  (o) => {
1161
1165
  const n = o.target.closest(".cell[data-col]");
1162
- n && (n.classList.contains("editing") || (o.preventDefault(), Nt(t, n)));
1166
+ n && (n.classList.contains("editing") || (o.preventDefault(), It(t, n)));
1163
1167
  },
1164
1168
  { signal: i }
1165
1169
  ), e.addEventListener(
@@ -1182,7 +1186,7 @@ function Wt(t, e, i) {
1182
1186
  );
1183
1187
  }
1184
1188
  function Ft(t, e, i, o) {
1185
- e.addEventListener("keydown", (n) => kt(t, n), { signal: o }), i.addEventListener("mousedown", (n) => It(t, i, n), { signal: o }), document.addEventListener("mousemove", (n) => qt(t, i, n), { signal: o }), document.addEventListener("mouseup", (n) => $t(t, i, n), { signal: o });
1189
+ e.addEventListener("keydown", (n) => kt(t, n), { signal: o }), i.addEventListener("mousedown", (n) => Nt(t, i, n), { signal: o }), document.addEventListener("mousemove", (n) => qt(t, i, n), { signal: o }), document.addEventListener("mouseup", (n) => $t(t, i, n), { signal: o });
1186
1190
  }
1187
1191
  function Ut(t, e) {
1188
1192
  return t == null && e == null ? 0 : t == null ? -1 : e == null || t > e ? 1 : t < e ? -1 : 0;
@@ -1237,10 +1241,10 @@ function Z(t, e, i, o) {
1237
1241
  o.classList.add("sortable"), o.tabIndex = 0;
1238
1242
  const n = t._sortState?.field === e.field ? t._sortState.direction : 0;
1239
1243
  o.setAttribute("aria-sort", n === 0 ? "none" : n === 1 ? "ascending" : "descending"), o.addEventListener("click", (r) => {
1240
- t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, i, o) || ze(t, e);
1244
+ t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, e, o) || ze(t, e);
1241
1245
  }), o.addEventListener("keydown", (r) => {
1242
1246
  if (r.key === "Enter" || r.key === " ") {
1243
- if (r.preventDefault(), t._dispatchHeaderClick?.(r, i, o)) return;
1247
+ if (r.preventDefault(), t._dispatchHeaderClick?.(r, e, o)) return;
1244
1248
  ze(t, e);
1245
1249
  }
1246
1250
  });
@@ -1258,7 +1262,7 @@ function oe(t) {
1258
1262
  const e = t._headerRowEl;
1259
1263
  e && (e.innerHTML = "", t._visibleColumns.forEach((i, o) => {
1260
1264
  const n = document.createElement("div");
1261
- n.className = "cell", Ge(n, "header-cell"), n.setAttribute("role", "columnheader"), n.setAttribute("aria-colindex", String(o + 1)), n.setAttribute("data-field", i.field), n.setAttribute("data-col", String(o));
1265
+ n.className = "cell", Ge(n, "header-cell"), n.setAttribute("role", "columnheader"), n.setAttribute("aria-colindex", String(o + 1)), n.setAttribute("data-field", i.field), n.setAttribute("data-col", String(o)), i.type && n.setAttribute("data-type", i.type);
1262
1266
  const r = i.header ?? i.field, s = t._sortState?.field === i.field ? t._sortState.direction : 0, l = s === 1 ? "asc" : s === -1 ? "desc" : null;
1263
1267
  if (i.headerRenderer) {
1264
1268
  const a = {
@@ -1612,7 +1616,7 @@ function di(t) {
1612
1616
  }
1613
1617
  return t.position === "left" && r ? (e.appendChild(r), e.appendChild(n)) : (e.appendChild(n), r && e.appendChild(r)), e;
1614
1618
  }
1615
- function I(t) {
1619
+ function N(t) {
1616
1620
  return t ? typeof t == "string" ? t : t.outerHTML : "";
1617
1621
  }
1618
1622
  function hi() {
@@ -1638,7 +1642,7 @@ function st(t) {
1638
1642
  return !!(t?.header?.title || t?.header?.toolbarContents?.length || t?.toolPanels?.length || t?.headerContents?.length || t?.header?.lightDomContent?.length || t?.header?.hasToolButtonsContainer);
1639
1643
  }
1640
1644
  function ui(t, e, i = "☰") {
1641
- const o = t?.header?.title ?? e.lightDomTitle ?? "", n = !!o, r = I(i), s = t?.header?.toolbarContents ?? [], l = [...e.toolbarContents.values()], a = new Set(s.map((d) => d.id)), c = [...s];
1645
+ const o = t?.header?.title ?? e.lightDomTitle ?? "", n = !!o, r = N(i), s = t?.header?.toolbarContents ?? [], l = [...e.toolbarContents.values()], a = new Set(s.map((d) => d.id)), c = [...s];
1642
1646
  for (const d of l)
1643
1647
  a.has(d.id) || c.push(d);
1644
1648
  const h = c.length > 0, f = e.toolPanels.size > 0, p = h && f, g = [...c].sort((d, w) => (d.order ?? 0) - (w.order ?? 0));
@@ -1659,7 +1663,7 @@ function ui(t, e, i = "☰") {
1659
1663
  </div>
1660
1664
  `;
1661
1665
  }
1662
- function Ne(t, e) {
1666
+ function Ie(t, e) {
1663
1667
  const i = t.querySelector("tbw-grid-header");
1664
1668
  if (!i) return;
1665
1669
  if (!e.lightDomTitle) {
@@ -1669,7 +1673,7 @@ function Ne(t, e) {
1669
1673
  const o = i.querySelectorAll("tbw-grid-header-content");
1670
1674
  o.length > 0 && e.lightDomHeaderContent.length === 0 && (e.lightDomHeaderContent = Array.from(o)), i.style.display = "none";
1671
1675
  }
1672
- function Ie(t, e, i) {
1676
+ function Ne(t, e, i) {
1673
1677
  const o = t.querySelector(":scope > tbw-grid-tool-buttons");
1674
1678
  if (!o) return;
1675
1679
  e.hasToolButtonsContainer = !0;
@@ -1747,7 +1751,18 @@ function fi(t, e, i, o) {
1747
1751
  }
1748
1752
  });
1749
1753
  }
1750
- function gi(t, e, i) {
1754
+ function gi(t, e, i, o) {
1755
+ if (!e?.toolPanel?.closeOnClickOutside)
1756
+ return () => {
1757
+ };
1758
+ const n = (r) => {
1759
+ if (!i.isPanelOpen) return;
1760
+ const s = r.target;
1761
+ s && (s.closest(".tbw-tool-panel") || s.closest("[data-panel-toggle]") || o());
1762
+ };
1763
+ return t.addEventListener("mousedown", n), () => t.removeEventListener("mousedown", n);
1764
+ }
1765
+ function pi(t, e, i) {
1751
1766
  const o = t.querySelector(".tbw-tool-panel"), n = t.querySelector("[data-resize-handle]"), r = t.querySelector(".tbw-shell-body");
1752
1767
  if (!o || !n || !r)
1753
1768
  return () => {
@@ -1803,9 +1818,9 @@ function ge(t, e) {
1803
1818
  c && e.headerContentCleanups.set(s.id, c);
1804
1819
  }
1805
1820
  }
1806
- function pi(t, e, i) {
1821
+ function wi(t, e, i) {
1807
1822
  if (!e.isPanelOpen) return;
1808
- const o = I(i?.expand ?? M.expand), n = I(i?.collapse ?? M.collapse);
1823
+ const o = N(i?.expand ?? M.expand), n = N(i?.collapse ?? M.collapse);
1809
1824
  for (const [r, s] of e.toolPanels) {
1810
1825
  const l = e.expandedSections.has(r), a = t.querySelector(`[data-section="${r}"]`), c = a?.querySelector(".tbw-accordion-content");
1811
1826
  if (!a || !c) continue;
@@ -1837,7 +1852,7 @@ function he(t) {
1837
1852
  e();
1838
1853
  t.toolbarContentCleanups.clear();
1839
1854
  }
1840
- function wi(t) {
1855
+ function bi(t) {
1841
1856
  for (const e of t.headerContentCleanups.values())
1842
1857
  e();
1843
1858
  t.headerContentCleanups.clear();
@@ -1854,7 +1869,7 @@ function wi(t) {
1854
1869
  t.toolPanels.get(e)?.onClose?.();
1855
1870
  t.isPanelOpen = !1, t.expandedSections.clear(), t.toolPanels.clear(), t.headerContents.clear(), t.toolbarContents.clear(), t.lightDomHeaderContent = [], t.lightDomToolPanelIds.clear(), t.lightDomToolbarContentIds.clear(), t.lightDomContentMoved = !1;
1856
1871
  }
1857
- function bi(t, e) {
1872
+ function mi(t, e) {
1858
1873
  let i = !1;
1859
1874
  const o = {
1860
1875
  get isInitialized() {
@@ -1883,7 +1898,7 @@ function bi(t, e) {
1883
1898
  s && t.expandedSections.add(s.id);
1884
1899
  }
1885
1900
  const n = e.getShadow();
1886
- $e(n, t), We(n, t), pi(n, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: o.expandedSections });
1901
+ $e(n, t), We(n, t), wi(n, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: o.expandedSections });
1887
1902
  },
1888
1903
  closeToolPanel() {
1889
1904
  if (!t.isPanelOpen) return;
@@ -1919,7 +1934,7 @@ function bi(t, e) {
1919
1934
  const f = s.querySelector(`[data-section="${a}"] .tbw-accordion-content`);
1920
1935
  f && (f.innerHTML = "");
1921
1936
  }
1922
- t.expandedSections.add(n), ue(s, n, !0), mi(s, t, n);
1937
+ t.expandedSections.add(n), ue(s, n, !0), vi(s, t, n);
1923
1938
  }
1924
1939
  e.emit("tool-panel-section-toggle", { id: n, expanded: !l });
1925
1940
  },
@@ -1977,7 +1992,7 @@ function ue(t, e, i) {
1977
1992
  const o = t.querySelector(`[data-section="${e}"]`);
1978
1993
  o && o.classList.toggle("expanded", i);
1979
1994
  }
1980
- function mi(t, e, i) {
1995
+ function vi(t, e, i) {
1981
1996
  const o = e.toolPanels.get(i);
1982
1997
  if (!o?.render) return;
1983
1998
  const n = t.querySelector(`[data-section="${i}"] .tbw-accordion-content`);
@@ -1985,7 +2000,7 @@ function mi(t, e, i) {
1985
2000
  const r = o.render(n);
1986
2001
  r && e.panelCleanups.set(i, r);
1987
2002
  }
1988
- function vi(t, e, i, o) {
2003
+ function Ci(t, e, i, o) {
1989
2004
  const n = st(e), r = [], s = [
1990
2005
  "tbw-grid-header",
1991
2006
  "tbw-grid-tool-buttons",
@@ -2000,7 +2015,7 @@ function vi(t, e, i, o) {
2000
2015
  for (const l of r)
2001
2016
  t.appendChild(l);
2002
2017
  if (n) {
2003
- const l = I(o?.toolPanel ?? M.toolPanel), a = I(o?.expand ?? M.expand), c = I(o?.collapse ?? M.collapse), f = [...e?.header?.toolbarContents ?? []].sort((_, R) => (_.order ?? 0) - (R.order ?? 0)), g = [...e?.toolPanels ?? []].sort((_, R) => (_.order ?? 100) - (R.order ?? 100)), u = {
2018
+ const l = N(o?.toolPanel ?? M.toolPanel), a = N(o?.expand ?? M.expand), c = N(o?.collapse ?? M.collapse), f = [...e?.header?.toolbarContents ?? []].sort((_, R) => (_.order ?? 0) - (R.order ?? 0)), g = [...e?.toolPanels ?? []].sort((_, R) => (_.order ?? 100) - (R.order ?? 100)), u = {
2004
2019
  title: e?.header?.title ?? void 0,
2005
2020
  hasPanels: g.length > 0,
2006
2021
  isPanelOpen: i.isPanelOpen,
@@ -2019,7 +2034,7 @@ function vi(t, e, i, o) {
2019
2034
  panels: g.map((_) => ({
2020
2035
  id: _.id,
2021
2036
  title: _.title,
2022
- icon: I(_.icon),
2037
+ icon: N(_.icon),
2023
2038
  isExpanded: i.expandedSections.has(_.id)
2024
2039
  }))
2025
2040
  }, w = ci(u), v = di(d), b = ke({
@@ -2037,25 +2052,25 @@ function vi(t, e, i, o) {
2037
2052
  const Fe = "tbw-grid-styles";
2038
2053
  let te = "";
2039
2054
  const pe = /* @__PURE__ */ new Map();
2040
- function Ci() {
2055
+ function yi() {
2041
2056
  let t = document.getElementById(Fe);
2042
2057
  return t || (t = document.createElement("style"), t.id = Fe, t.setAttribute("data-tbw-grid", "true"), document.head.appendChild(t)), t;
2043
2058
  }
2044
2059
  function we() {
2045
- const t = Ci(), e = Array.from(pe.values()).join(`
2060
+ const t = yi(), e = Array.from(pe.values()).join(`
2046
2061
  `);
2047
2062
  t.textContent = `${te}
2048
2063
 
2049
2064
  /* Plugin Styles */
2050
2065
  ${e}`;
2051
2066
  }
2052
- function yi(t) {
2067
+ function _i(t) {
2053
2068
  let e = !1;
2054
2069
  for (const { name: i, styles: o } of t)
2055
2070
  pe.has(i) || (pe.set(i, o), e = !0);
2056
2071
  return e && we(), e;
2057
2072
  }
2058
- function _i() {
2073
+ function Ei() {
2059
2074
  try {
2060
2075
  for (const t of Array.from(document.styleSheets))
2061
2076
  try {
@@ -2071,7 +2086,7 @@ function _i() {
2071
2086
  }
2072
2087
  return null;
2073
2088
  }
2074
- async function Ei(t) {
2089
+ async function Si(t) {
2075
2090
  if (te)
2076
2091
  return;
2077
2092
  if (typeof t == "string" && t.length > 0) {
@@ -2079,14 +2094,14 @@ async function Ei(t) {
2079
2094
  return;
2080
2095
  }
2081
2096
  await new Promise((i) => setTimeout(i, 50));
2082
- const e = _i();
2097
+ const e = Ei();
2083
2098
  e ? (te = e, we()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
2084
2099
  "[tbw-grid] Could not find grid.css in document.styleSheets. Grid styling will not work.",
2085
2100
  "Available stylesheets:",
2086
2101
  Array.from(document.styleSheets).map((i) => i.href || "(inline)")
2087
2102
  );
2088
2103
  }
2089
- function Si() {
2104
+ function Ri() {
2090
2105
  return {
2091
2106
  startY: null,
2092
2107
  startX: null,
@@ -2100,19 +2115,19 @@ function Si() {
2100
2115
  momentumRaf: 0
2101
2116
  };
2102
2117
  }
2103
- function Ri(t) {
2118
+ function Ai(t) {
2104
2119
  t.startY = null, t.startX = null, t.scrollTop = null, t.scrollLeft = null, t.lastY = null, t.lastX = null, t.lastTime = null;
2105
2120
  }
2106
2121
  function lt(t) {
2107
2122
  t.momentumRaf && (cancelAnimationFrame(t.momentumRaf), t.momentumRaf = 0);
2108
2123
  }
2109
- function Ai(t, e, i) {
2124
+ function Ti(t, e, i) {
2110
2125
  if (t.touches.length !== 1) return;
2111
2126
  lt(e);
2112
2127
  const o = t.touches[0];
2113
2128
  e.startY = o.clientY, e.startX = o.clientX, e.lastY = o.clientY, e.lastX = o.clientX, e.lastTime = performance.now(), e.scrollTop = i.fauxScrollbar.scrollTop, e.scrollLeft = i.scrollArea?.scrollLeft ?? 0, e.velocityY = 0, e.velocityX = 0;
2114
2129
  }
2115
- function Ti(t, e, i) {
2130
+ function xi(t, e, i) {
2116
2131
  if (t.touches.length !== 1 || e.startY === null || e.startX === null || e.scrollTop === null || e.scrollLeft === null)
2117
2132
  return !1;
2118
2133
  const o = t.touches[0], n = o.clientY, r = o.clientX, s = performance.now(), l = e.startY - n, a = e.startX - r;
@@ -2129,10 +2144,10 @@ function Ti(t, e, i) {
2129
2144
  }
2130
2145
  return g && (i.fauxScrollbar.scrollTop = e.scrollTop + l), u && i.scrollArea && (i.scrollArea.scrollLeft = e.scrollLeft + a), g || u;
2131
2146
  }
2132
- function xi(t, e) {
2133
- (Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Hi(t, e), Ri(t);
2134
- }
2135
2147
  function Hi(t, e) {
2148
+ (Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Li(t, e), Ai(t);
2149
+ }
2150
+ function Li(t, e) {
2136
2151
  const n = () => {
2137
2152
  t.velocityY *= 0.95, t.velocityX *= 0.95;
2138
2153
  const r = t.velocityY * 16, s = t.velocityX * 16;
@@ -2140,19 +2155,19 @@ function Hi(t, e) {
2140
2155
  };
2141
2156
  t.momentumRaf = requestAnimationFrame(n);
2142
2157
  }
2143
- function Li(t, e, i, o) {
2144
- t.addEventListener("touchstart", (n) => Ai(n, e, i), {
2158
+ function Pi(t, e, i, o) {
2159
+ t.addEventListener("touchstart", (n) => Ti(n, e, i), {
2145
2160
  passive: !0,
2146
2161
  signal: o
2147
2162
  }), t.addEventListener(
2148
2163
  "touchmove",
2149
2164
  (n) => {
2150
- Ti(n, e, i) && n.preventDefault();
2165
+ xi(n, e, i) && n.preventDefault();
2151
2166
  },
2152
2167
  { passive: !1, signal: o }
2153
- ), t.addEventListener("touchend", () => xi(e, i), { passive: !0, signal: o });
2168
+ ), t.addEventListener("touchend", () => Hi(e, i), { passive: !0, signal: o });
2154
2169
  }
2155
- const Pi = [
2170
+ const zi = [
2156
2171
  {
2157
2172
  property: "editable",
2158
2173
  pluginName: "editing",
@@ -2192,7 +2207,7 @@ const Pi = [
2192
2207
  description: 'the "sticky" column property (deprecated, use "pinned")',
2193
2208
  isUsed: (t) => t === "left" || t === "right" || t === "start" || t === "end"
2194
2209
  }
2195
- ], zi = [
2210
+ ], Di = [
2196
2211
  {
2197
2212
  property: "columnGroups",
2198
2213
  pluginName: "groupingColumns",
@@ -2201,11 +2216,11 @@ const Pi = [
2201
2216
  isUsed: (t) => Array.isArray(t) && t.length > 0
2202
2217
  }
2203
2218
  ];
2204
- function Di(t) {
2219
+ function Oi(t) {
2205
2220
  return t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
2206
2221
  }
2207
2222
  function be(t) {
2208
- return `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${Di(t)}';`;
2223
+ return `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${Oi(t)}';`;
2209
2224
  }
2210
2225
  function D(t) {
2211
2226
  return t.charAt(0).toUpperCase() + t.slice(1);
@@ -2213,8 +2228,8 @@ function D(t) {
2213
2228
  function Ue(t, e) {
2214
2229
  return t.some((i) => i.name === e);
2215
2230
  }
2216
- function Oi(t, e) {
2217
- const i = Pi, o = zi, n = /* @__PURE__ */ new Map();
2231
+ function Mi(t, e) {
2232
+ const i = zi, o = Di, n = /* @__PURE__ */ new Map();
2218
2233
  function r(l, a, c, h, f = !1) {
2219
2234
  n.has(l) || n.set(l, { description: a, importHint: c, fields: [], isConfigProperty: f });
2220
2235
  const p = n.get(l);
@@ -2264,7 +2279,7 @@ This validation helps catch misconfigurations early. The properties listed above
2264
2279
  );
2265
2280
  }
2266
2281
  }
2267
- function Mi(t) {
2282
+ function ki(t) {
2268
2283
  const e = [], i = [];
2269
2284
  for (const o of t) {
2270
2285
  const r = o.constructor.manifest;
@@ -2287,7 +2302,7 @@ ${e.join(`
2287
2302
 
2288
2303
  `)}`);
2289
2304
  }
2290
- function ki(t, e) {
2305
+ function Ii(t, e) {
2291
2306
  const i = t.name, n = t.constructor.dependencies ?? [];
2292
2307
  for (const r of n) {
2293
2308
  const s = r.name, l = r.required ?? !0, a = r.reason;
@@ -2335,24 +2350,24 @@ ${D(o.name)}Plugin and ${D(s.name)}Plugin are both loaded, but they are currentl
2335
2350
  function at(t, e) {
2336
2351
  return !t || typeof t != "object" ? t : "__rowCacheKey" in t ? t.__rowCacheKey : "rowId" in t && t.rowId != null ? `id:${t.rowId}` : e ? `id:${e(t)}` : t;
2337
2352
  }
2338
- function Ii(t, e, i) {
2353
+ function qi(t, e, i) {
2339
2354
  const o = at(e, i);
2340
2355
  if (typeof o == "string")
2341
2356
  return t.byKey.get(o);
2342
2357
  if (o && typeof o == "object")
2343
2358
  return t.byRef.get(o);
2344
2359
  }
2345
- function qi(t, e, i, o) {
2360
+ function $i(t, e, i, o) {
2346
2361
  const n = at(e, o);
2347
2362
  typeof n == "string" ? t.byKey.set(n, i) : n && typeof n == "object" && t.byRef.set(n, i);
2348
2363
  }
2349
- function $i(t, e, i, o, n) {
2364
+ function Wi(t, e, i, o, n) {
2350
2365
  const r = new Array(t.length);
2351
2366
  let s = 0;
2352
2367
  for (let l = 0; l < t.length; l++) {
2353
2368
  const a = t[l];
2354
2369
  let c = n?.(a, l), h = c !== void 0;
2355
- c === void 0 && (c = Ii(e, a, o.rowId), h = c !== void 0), c === void 0 && (c = i, h = !1), r[l] = { offset: s, height: c, measured: h }, s += c;
2370
+ c === void 0 && (c = qi(e, a, o.rowId), h = c !== void 0), c === void 0 && (c = i, h = !1), r[l] = { offset: s, height: c, measured: h }, s += c;
2356
2371
  }
2357
2372
  return r;
2358
2373
  }
@@ -2365,7 +2380,7 @@ function me(t, e, i) {
2365
2380
  t[r].offset += n;
2366
2381
  }
2367
2382
  }
2368
- function Wi(t) {
2383
+ function Fi(t) {
2369
2384
  if (t.length === 0) return 0;
2370
2385
  const e = t[t.length - 1];
2371
2386
  return e.offset + e.height;
@@ -2385,19 +2400,19 @@ function Ve(t, e) {
2385
2400
  }
2386
2401
  return Math.max(0, Math.min(i, t.length - 1));
2387
2402
  }
2388
- function Fi(t, e) {
2403
+ function Ui(t, e) {
2389
2404
  let i = 0, o = 0;
2390
2405
  for (const n of t)
2391
2406
  n.measured && (i += n.height, o++);
2392
2407
  return o > 0 ? i / o : e;
2393
2408
  }
2394
- function Ui(t) {
2409
+ function Vi(t) {
2395
2410
  let e = 0;
2396
2411
  for (const i of t)
2397
2412
  i.measured && e++;
2398
2413
  return e;
2399
2414
  }
2400
- function Vi(t, e) {
2415
+ function Bi(t, e) {
2401
2416
  const { positionCache: i, heightCache: o, rows: n, start: r, end: s, getPluginHeight: l, getRowId: a } = t;
2402
2417
  let c = !1;
2403
2418
  e.forEach((p) => {
@@ -2414,13 +2429,13 @@ function Vi(t, e) {
2414
2429
  const v = p.offsetHeight;
2415
2430
  if (v > 0) {
2416
2431
  const b = i[u];
2417
- (!b.measured || Math.abs(b.height - v) > 1) && (me(i, u, v), qi(o, d, v, a), c = !0);
2432
+ (!b.measured || Math.abs(b.height - v) > 1) && (me(i, u, v), $i(o, d, v, a), c = !0);
2418
2433
  }
2419
2434
  });
2420
- const h = c ? Ui(i) : 0, f = c ? Fi(i, t.defaultHeight) : 0;
2435
+ const h = c ? Vi(i) : 0, f = c ? Ui(i, t.defaultHeight) : 0;
2421
2436
  return { hasChanges: c, measuredCount: h, averageHeight: f };
2422
2437
  }
2423
- function Bi(t, e, i, o) {
2438
+ function Gi(t, e, i, o) {
2424
2439
  let n = 0, r = 0;
2425
2440
  for (let s = 0; s < t.length; s++) {
2426
2441
  const l = t[s];
@@ -2431,7 +2446,7 @@ function Bi(t, e, i, o) {
2431
2446
  averageHeight: n > 0 ? r / n : i
2432
2447
  };
2433
2448
  }
2434
- function no(t) {
2449
+ function ro(t) {
2435
2450
  const { totalRows: e, viewportHeight: i, scrollTop: o, rowHeight: n, overscan: r } = t, s = Math.ceil(i / n);
2436
2451
  let l = Math.floor(o / n) - r;
2437
2452
  l < 0 && (l = 0);
@@ -2443,7 +2458,7 @@ function no(t) {
2443
2458
  totalHeight: e * n
2444
2459
  };
2445
2460
  }
2446
- function ro(t, e) {
2461
+ function so(t, e) {
2447
2462
  return t <= e;
2448
2463
  }
2449
2464
  class ne {
@@ -2466,7 +2481,7 @@ class ne {
2466
2481
  this.attach(i);
2467
2482
  }
2468
2483
  attach(e) {
2469
- if (ki(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
2484
+ if (Ii(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
2470
2485
  for (const [i, o] of Object.entries(e.cellRenderers))
2471
2486
  this.cellRenderers.set(i, o);
2472
2487
  if (e.headerRenderers)
@@ -2731,7 +2746,7 @@ class ne {
2731
2746
  return e.sort((i, o) => (i.content.order ?? 0) - (o.content.order ?? 0));
2732
2747
  }
2733
2748
  }
2734
- const Gi = "@layer tbw-base{tbw-grid{.tbw-expanding{animation:tbw-expand var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}.tbw-collapsing{animation:tbw-collapse var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}&[data-animation-mode=off]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}tbw-grid .data-grid-row[data-animating=change]{animation:tbw-row-change var(--tbw-row-change-duration) ease-out}tbw-grid .data-grid-row[data-animating=insert]{animation:tbw-row-insert var(--tbw-row-insert-duration) ease-out;will-change:max-height,opacity}tbw-grid .data-grid-row[data-animating=remove]{animation:tbw-row-remove var(--tbw-row-remove-duration) ease-out forwards;will-change:max-height,opacity,transform;pointer-events:none}}@keyframes tbw-expand{0%{opacity:0;max-height:0;transform:translateY(-8px)}to{opacity:1;max-height:500px;transform:translateY(0)}}@keyframes tbw-collapse{0%{opacity:1;max-height:500px;transform:translateY(0)}to{opacity:0;max-height:0;transform:translateY(-8px)}}@keyframes tbw-row-change{0%{background-color:transparent}20%{background-color:var(--tbw-row-change-color)}to{background-color:transparent}}@keyframes tbw-row-insert{0%{opacity:0;max-height:0;overflow:hidden}to{opacity:1;max-height:var(--tbw-row-height, 28px);overflow:hidden}}@keyframes tbw-row-remove{0%{opacity:1;transform:translateY(0);max-height:var(--tbw-row-height, 28px)}to{opacity:0;max-height:0;transform:translateY(-8px)}}@keyframes tbw-spin{to{transform:rotate(360deg)}}@keyframes tbw-fade-in{0%{opacity:0}to{opacity:1}}", Xi = '@layer tbw-base{tbw-grid{color-scheme:inherit;position:relative;display:block;width:100%;height:100%;min-height:0;contain:content;font-family:var(--tbw-font-family);font-size:var(--tbw-font-size);font-feature-settings:"tnum","lnum";background:var(--tbw-color-bg);color:var(--tbw-color-fg);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);overflow:clip;outline:none;&,*{box-sizing:border-box}.tbw-grid-root{position:relative;display:flex;flex-direction:column;height:100%;&.has-shell{display:flex;flex-direction:column;height:100%}&:has(.selected){user-select:none}}.rows-body-wrapper{flex:1;min-height:0;display:flex;flex-direction:row;width:100%;min-width:fit-content}.rows-body{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:visible}.rows-container{display:flex;flex-direction:row;flex:1;min-height:0;overflow:visible}.rows-viewport{flex:1;min-width:0;position:relative;display:block;overflow:clip;.rows{position:absolute;top:0;left:0;min-width:100%;will-change:transform;z-index:var(--tbw-z-layer-rows, 1)}}.faux-vscroll{position:sticky;inset-inline-end:0;flex-shrink:0;width:auto;overflow-y:auto;overflow-x:hidden;z-index:var(--tbw-z-layer-header, 30)}.faux-vscroll-spacer{width:1px}&[data-has-focus]{.cell-focus,.row-focus{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}}.sticky-left,.sticky-right{position:sticky;z-index:25}.sticky-left{box-shadow:1px 0 0 var(--tbw-color-border)}.sticky-right{box-shadow:-1px 0 0 var(--tbw-color-border)}}}', Yi = '@layer tbw-base{tbw-grid{.header{display:block;flex-shrink:0;z-index:var(--tbw-z-layer-header, 30);background:var(--tbw-color-header-bg);overflow:visible}.header-group-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-color-header-bg);z-index:var(--tbw-z-layer-header, 30)}.header-group-cell{display:flex;align-items:center;justify-content:flex-start;padding:var(--tbw-cell-padding-header, 2px 8px);color:var(--tbw-color-header-group-fg, var(--tbw-color-header-fg));font-weight:var(--tbw-font-weight-header-group, var(--tbw-font-weight-header));justify-content:var(--tbw-align-header-group, var(--tbw-align-header, flex-start));&:not(:last-child){border-right:2px solid var(--tbw-color-border)}}.header-row{display:grid;grid-template-columns:var(--tbw-column-template);color:var(--tbw-color-header-fg);font-size:var(--tbw-font-size-header);min-height:var(--tbw-header-height);border-bottom:var(--tbw-border-header);z-index:var(--tbw-z-layer-header, 30);text-transform:var(--tbw-header-text-transform);letter-spacing:var(--tbw-header-letter-spacing);>.cell{display:flex;align-items:center;gap:4px;padding:var(--tbw-cell-padding-header, 2px 8px);background-color:var(--tbw-color-header-bg);font-weight:var(--tbw-font-weight-header);border-right:1px solid var(--tbw-color-border-cell);overflow:visible;min-width:0;>span:first-child{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:inherit}>span[part~=sort-indicator]{flex-shrink:0;opacity:.6;color:var(--tbw-sort-indicator-color);display:var(--tbw-sort-indicator-display, inline-flex);visibility:var(--tbw-sort-indicator-visibility, visible);transition:opacity .15s,visibility 0s,display 0s allow-discrete;transition-behavior:allow-discrete}&:hover>span[part~=sort-indicator]{display:inline-flex;visibility:visible}&[aria-sort=ascending]>span[part~=sort-indicator],&[aria-sort=descending]>span[part~=sort-indicator]{display:inline-flex;visibility:visible;opacity:1;color:var(--tbw-sort-indicator-active-color)}&:last-child{border-right:0;.resize-handle{right:0;width:calc(var(--tbw-resize-handle-width) / 2)}}&.grouped.group-end:not(:last-child){border-right:2px solid var(--tbw-color-border)}&.resizable{position:relative}&.sticky-left,&.sticky-right{background:var(--tbw-color-header-bg);z-index:35}}}.sortable{cursor:pointer;user-select:none}.resize-handle{position:absolute;top:0;right:calc(var(--tbw-resize-handle-width) / -2);width:var(--tbw-resize-handle-width);height:100%;cursor:e-resize;user-select:none;touch-action:none;z-index:20;background:var(--tbw-resize-handle-color);transition:background .12s ease;border-radius:var(--tbw-resize-handle-border-radius);&:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:var(--tbw-resize-indicator-width, 2px);height:0;background:var(--tbw-resize-indicator-color, var(--tbw-color-accent));opacity:0;pointer-events:none;transition:opacity .12s ease,height 0s .12s;z-index:1000}&:hover{background:var(--tbw-resize-handle-color-hover);&:after{height:100vh;opacity:var(--tbw-resize-indicator-opacity, .6);transition:opacity .12s ease,height 0s}}}}}', ji = '@layer tbw-base{.tbw-loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:1000;pointer-events:all;animation:tbw-fade-in .15s ease-out}.tbw-spinner{--tbw-spinner-size: 48px;--tbw-spinner-border-width: 3px;--tbw-spinner-color: var(--tbw-color-accent);--tbw-spinner-track-color: var(--tbw-color-border);width:var(--tbw-spinner-size);height:var(--tbw-spinner-size);border:var(--tbw-spinner-border-width) solid var(--tbw-spinner-track-color);border-top-color:var(--tbw-spinner-color);border-radius:50%;animation:tbw-spin .8s linear infinite}.tbw-spinner--large{--tbw-spinner-size: min(48px, calc(100% - 16px) )}.tbw-spinner--small{--tbw-spinner-size: calc(var(--tbw-row-height, 28px) * .6);--tbw-spinner-border-width: 2px}.data-grid-row.tbw-row-loading{position:relative;pointer-events:none}.tbw-row-loading-overlay{position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:26;animation:tbw-fade-in .15s ease-out;pointer-events:none;display:flex;align-items:center}.tbw-row-loading-spinner{--_spinner-size: calc(var(--tbw-row-height, 28px) * .6);margin-left:var(--tbw-spacing-md);width:var(--_spinner-size);height:var(--_spinner-size);border:2px solid var(--tbw-spinner-track-color, var(--tbw-color-border));border-top-color:var(--tbw-spinner-color, var(--tbw-color-accent));border-radius:50%;animation:tbw-spin .8s linear infinite}.cell.tbw-cell-loading{position:relative;pointer-events:none;&:before{content:"";position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:26;animation:tbw-fade-in .15s ease-out}&:after{--_spinner-size: calc(var(--tbw-row-height, 28px) * .5);content:"";position:absolute;left:var(--tbw-spacing-sm);top:0;bottom:0;margin:auto 0;width:var(--_spinner-size);height:var(--_spinner-size);border:2px solid var(--tbw-spinner-track-color, var(--tbw-color-border));border-top-color:var(--tbw-spinner-color, var(--tbw-color-accent));border-radius:50%;animation:tbw-spin .8s linear infinite;z-index:27}}}', Ki = "@layer tbw-base{@media(forced-colors:active){tbw-grid{--tbw-color-border: CanvasText;--tbw-color-border-strong: CanvasText;--tbw-color-border-cell: CanvasText;--tbw-color-border-header: CanvasText;--tbw-color-fg: CanvasText;--tbw-color-bg: Canvas;--tbw-color-panel-bg: Canvas;--tbw-color-header-bg: Canvas;--tbw-color-header-fg: CanvasText;--tbw-color-accent: Highlight;--tbw-color-accent-fg: HighlightText;--tbw-color-selection: Highlight;--tbw-color-row-hover: Highlight;--tbw-focus-outline: 2px solid Highlight;--tbw-range-border-color: Highlight;.cell:focus,.cell.active-cell{outline:2px solid Highlight!important;outline-offset:-2px}.data-grid-row[aria-selected=true]{background:Highlight!important;color:HighlightText!important}}}@media(prefers-reduced-motion:reduce){tbw-grid[data-animation-mode=reduced-motion]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}}", Qi = "@layer tbw-base{tbw-grid{.data-grid-row{display:grid;grid-template-columns:var(--tbw-column-template);contain:layout style;&:nth-child(2n){background:var(--tbw-color-row-alt)}&:hover{background:var(--tbw-color-row-hover)}>.cell{display:block;padding:var(--tbw-cell-padding, 2px 8px);border-bottom:var(--tbw-row-divider);min-height:var(--tbw-row-height);align-content:center;border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0;white-space:var(--tbw-cell-white-space, nowrap);text-overflow:ellipsis;>*{overflow:hidden;text-overflow:ellipsis;white-space:inherit;min-width:0}&:last-child{border-right:0}&[data-type=boolean]{text-align:center;input[type=checkbox]{margin:0;width:var(--tbw-checkbox-size);height:var(--tbw-checkbox-size);vertical-align:middle}}&.selected:focus-visible,&:focus-visible:not(.cell-focus){outline:none}&.sticky-left,&.sticky-right{background:var(--tbw-color-panel-bg)}}}.selecting .data-grid-row>.cell{user-select:none}}}", Zi = "@layer tbw-base{tbw-grid{.tbw-shell-header{display:flex;align-items:center;gap:8px;min-height:var(--tbw-shell-header-height);padding:0 8px;background:var(--tbw-shell-header-bg);border-bottom:1px solid var(--tbw-shell-header-border);flex-shrink:0}.tbw-shell-title{font-size:var(--tbw-shell-title-font-size);font-weight:var(--tbw-shell-title-font-weight);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-shell-content{flex:1;display:flex;align-items:center;gap:12px;min-width:0;overflow:hidden}.tbw-shell-toolbar{display:flex;align-items:center;gap:var(--tbw-toolbar-button-gap);flex-shrink:0}.tbw-toolbar-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-toolbar-button-size);height:var(--tbw-toolbar-button-size);padding:0;border:1px solid transparent;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg);cursor:pointer;font-size:16px;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease),border-color var(--tbw-transition-duration) var(--tbw-transition-ease);&:hover{background:var(--tbw-color-row-hover)}&:focus-visible{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}&.active{background:var(--tbw-focus-background);border-color:var(--tbw-color-accent)}&:disabled{opacity:.5;cursor:not-allowed}}.tbw-toolbar-separator{width:1px;height:20px;background:var(--tbw-color-border);margin:0 4px}.tbw-shell-body{position:relative;display:flex;flex:1;min-height:0;overflow:visible}.tbw-grid-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:row;overflow:hidden}.tbw-scroll-area{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow-x:auto;overflow-y:hidden;overflow-anchor:none}}}", Ji = "@layer tbw-base{tbw-grid{.tbw-tool-panel{position:absolute;top:0;bottom:0;right:0;width:0;overflow:hidden;background:var(--tbw-tool-panel-bg);border-left:1px solid var(--tbw-tool-panel-border);transition:width var(--tbw-tool-panel-transition);display:flex;flex-direction:column;z-index:30;box-shadow:-2px 0 8px var(--tbw-color-shadow);&[data-position=left]{right:auto;left:0;border-left:none;border-right:1px solid var(--tbw-tool-panel-border);box-shadow:2px 0 8px var(--tbw-color-shadow)}&.open{width:var(--tbw-tool-panel-width)}}.tbw-tool-panel-resize{position:absolute;top:0;bottom:0;width:6px;cursor:col-resize;background:transparent;z-index:10;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease);&[data-handle-position=left]{left:0}&[data-handle-position=right]{right:0}&:hover,&.resizing{background:var(--tbw-color-accent)}}.tbw-tool-panel-header{display:flex;align-items:center;justify-content:space-between;min-height:var(--tbw-tool-panel-header-height);padding:0 12px;border-bottom:1px solid var(--tbw-tool-panel-border);flex-shrink:0}.tbw-tool-panel-title{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-tool-panel-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg-muted);cursor:pointer;font-size:14px;&:hover{background:var(--tbw-color-row-hover);color:var(--tbw-color-fg)}}.tbw-tool-panel-content{flex:1;overflow:auto}.tbw-accordion{display:flex;flex-direction:column;gap:0}.tbw-accordion-section{border-bottom:1px solid var(--tbw-tool-panel-border);&:last-child{border-bottom:none}&.single .tbw-accordion-header{cursor:default;&:hover{background:transparent}}&.expanded{.tbw-accordion-chevron{transform:rotate(90deg)}.tbw-accordion-content{display:block}}}.tbw-accordion-header{display:flex;align-items:center;gap:8px;width:100%;padding:10px 12px;border:none;background:transparent;color:var(--tbw-color-fg);font-size:13px;font-weight:600;text-align:start;cursor:pointer;user-select:none;&:hover{background:var(--tbw-color-row-hover)}}.tbw-accordion-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:10px;color:var(--tbw-color-fg-muted);transition:transform .15s ease;flex-shrink:0}.tbw-accordion-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:14px;flex-shrink:0}.tbw-accordion-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tbw-accordion-content{display:none}}}", eo = "@layer tbw-base{tbw-grid{--tbw-base-icon-size: 1em;--tbw-base-radius: .25em;--tbw-font-size: 1em;--tbw-font-size-sm: .9285em;--tbw-font-size-xs: .7857em;--tbw-font-size-2xs: .7142em;--tbw-spacing-xs: .25em;--tbw-spacing-sm: .375em;--tbw-spacing-md: .5em;--tbw-spacing-lg: .75em;--tbw-spacing-xl: 1em;--tbw-icon-size: var(--tbw-base-icon-size);--tbw-icon-size-sm: .875em;--tbw-checkbox-size: var(--tbw-base-icon-size);--tbw-toggle-size: 1.25em;--tbw-border-radius: var(--tbw-base-radius);--tbw-color-bg: transparent;--tbw-color-panel-bg: light-dark(#eeeeee, #222222);--tbw-color-fg: light-dark(#222222, #eeeeee);--tbw-color-fg-muted: light-dark(#555555, #aaaaaa);--tbw-color-accent: light-dark(#3b82f6, #3b82f6);--tbw-color-accent-fg: light-dark(#ffffff, #000000);--tbw-color-success: light-dark(hsl(122, 39%, 40%), hsl(122, 39%, 49%));--tbw-color-warning: light-dark(hsl(38, 92%, 50%), hsl(38, 92%, 50%));--tbw-color-error: light-dark(hsl(0, 65%, 51%), hsl(0, 65%, 55%));--tbw-color-danger: var(--tbw-color-error);--tbw-color-selection: light-dark(#fff7d6, #333333);--tbw-color-row-alt: var(--tbw-color-bg);--tbw-color-row-hover: light-dark(#f0f6ff, #1c1c1c);--tbw-color-header-bg: color-mix(in hsl, var(--tbw-color-panel-bg) 85%, var(--tbw-color-fg));--tbw-color-header-fg: color-mix(in hsl, var(--tbw-color-fg) 75%, var(--tbw-color-panel-bg));--tbw-color-border: light-dark(#d0d0d4, #454545);--tbw-color-border-strong: light-dark(#777777, #666666);--tbw-color-border-cell: var(--tbw-color-border);--tbw-color-border-header: var(--tbw-color-border);--tbw-color-shadow: light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3));--tbw-font-family: inherit;--tbw-font-size-header: var(--tbw-font-size);--tbw-font-weight-header: bold;--tbw-cell-padding-header: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-cell-padding-v: var(--tbw-spacing-xs);--tbw-cell-padding-h: var(--tbw-spacing-md);--tbw-cell-padding: var(--tbw-cell-padding-v) var(--tbw-cell-padding-h);--tbw-cell-padding-input: var(--tbw-spacing-xs) var(--tbw-spacing-sm);--tbw-row-height: 1.75em;--tbw-header-height: 1.875em;--tbw-cell-white-space: nowrap;--tbw-border-width: 1px;--tbw-border-style: solid;--tbw-border-input: var(--tbw-border-width) var(--tbw-border-style) var(--tbw-color-border-strong);--tbw-border-header: var(--tbw-border-width) var(--tbw-border-style) var(--tbw-color-border-header);--tbw-row-divider: var(--tbw-border-width) var(--tbw-border-style) var(--tbw-color-border-cell);--tbw-row-hover-outline: 0;--tbw-color-active-row-bg: var(--tbw-color-selection);--tbw-active-row-outline: 0;--tbw-focus-outline-width: 2px;--tbw-focus-outline: var(--tbw-focus-outline-width) var(--tbw-border-style) var(--tbw-color-accent);--tbw-focus-outline-offset: -2px;--tbw-focus-background: rgba(from var(--tbw-color-accent) r g b / 12%);--tbw-range-border-color: var(--tbw-color-accent);--tbw-range-selection-bg: rgba(from var(--tbw-range-border-color) r g b / 12%);--tbw-resize-handle-width: var(--tbw-spacing-sm);--tbw-resize-handle-color: transparent;--tbw-resize-handle-color-hover: var(--tbw-color-accent);--tbw-resize-handle-border-radius: 0;--tbw-resize-indicator-width: 2px;--tbw-resize-indicator-color: var(--tbw-color-accent);--tbw-resize-indicator-opacity: .6;--tbw-transition-duration: .12s;--tbw-transition-ease: ease;--tbw-animation-duration: .2s;--tbw-animation-easing: ease-out;--tbw-animation-enabled: 1;--tbw-row-change-duration: .5s;--tbw-row-insert-duration: .3s;--tbw-row-remove-duration: .2s;--tbw-row-change-color: rgba(from var(--tbw-color-accent) r g b / 25%);--tbw-sort-indicator-color: var(--tbw-color-fg-muted);--tbw-sort-indicator-active-color: var(--tbw-color-accent);--tbw-sort-indicator-display: inline-flex;--tbw-sort-indicator-visibility: visible;--tbw-header-text-transform: none;--tbw-header-letter-spacing: normal;--tbw-color-header-separator: var(--tbw-color-border-cell);--tbw-density-scale: 1;--tbw-shell-header-height: 2.75em;--tbw-shell-header-bg: var(--tbw-color-panel-bg);--tbw-shell-header-border: var(--tbw-color-border);--tbw-shell-title-font-size: var(--tbw-font-size);--tbw-shell-title-font-weight: 600;--tbw-tool-panel-width: 17.5em;--tbw-tool-panel-bg: var(--tbw-color-panel-bg);--tbw-tool-panel-border: var(--tbw-color-border);--tbw-tool-panel-header-height: 2.5em;--tbw-tool-panel-transition: var(--tbw-animation-duration) var(--tbw-animation-easing);--tbw-toolbar-button-size: 2em;--tbw-toolbar-button-gap: var(--tbw-spacing-xs);--tbw-panel-padding: var(--tbw-spacing-lg);--tbw-panel-gap: var(--tbw-spacing-md);--tbw-menu-item-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-menu-item-gap: var(--tbw-spacing-md);--tbw-menu-min-width: 10rem;--tbw-button-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-button-padding-sm: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-input-height: var(--tbw-row-height);--tbw-input-padding: 0 var(--tbw-spacing-md);--tbw-detail-padding: var(--tbw-spacing-xl);--tbw-detail-max-height: 31.25rem;--tbw-indicator-size: var(--tbw-spacing-sm)}}", to = `/**
2749
+ const Xi = "@layer tbw-base{tbw-grid{.tbw-expanding{animation:tbw-expand var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}.tbw-collapsing{animation:tbw-collapse var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}&[data-animation-mode=off]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}tbw-grid .data-grid-row[data-animating=change]{animation:tbw-row-change var(--tbw-row-change-duration) ease-out}tbw-grid .data-grid-row[data-animating=insert]{animation:tbw-row-insert var(--tbw-row-insert-duration) ease-out;will-change:max-height,opacity}tbw-grid .data-grid-row[data-animating=remove]{animation:tbw-row-remove var(--tbw-row-remove-duration) ease-out forwards;will-change:max-height,opacity,transform;pointer-events:none}}@keyframes tbw-expand{0%{opacity:0;max-height:0;transform:translateY(-8px)}to{opacity:1;max-height:500px;transform:translateY(0)}}@keyframes tbw-collapse{0%{opacity:1;max-height:500px;transform:translateY(0)}to{opacity:0;max-height:0;transform:translateY(-8px)}}@keyframes tbw-row-change{0%{background-color:transparent}20%{background-color:var(--tbw-row-change-color)}to{background-color:transparent}}@keyframes tbw-row-insert{0%{opacity:0;max-height:0;overflow:hidden}to{opacity:1;max-height:var(--tbw-row-height, 28px);overflow:hidden}}@keyframes tbw-row-remove{0%{opacity:1;transform:translateY(0);max-height:var(--tbw-row-height, 28px)}to{opacity:0;max-height:0;transform:translateY(-8px)}}@keyframes tbw-spin{to{transform:rotate(360deg)}}@keyframes tbw-fade-in{0%{opacity:0}to{opacity:1}}", Yi = '@layer tbw-base{tbw-grid{color-scheme:inherit;position:relative;display:block;width:100%;height:100%;min-height:0;contain:content;font-family:var(--tbw-font-family);font-size:var(--tbw-font-size);font-feature-settings:"tnum","lnum";background:var(--tbw-color-bg);color:var(--tbw-color-fg);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);overflow:clip;outline:none;&,*{box-sizing:border-box}.tbw-grid-root{position:relative;display:flex;flex-direction:column;height:100%;&.has-shell{display:flex;flex-direction:column;height:100%}&:has(.selected){user-select:none}}.rows-body-wrapper{flex:1;min-height:0;display:flex;flex-direction:row;width:100%;min-width:fit-content}.rows-body{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:visible}.rows-container{display:flex;flex-direction:row;flex:1;min-height:0;overflow:visible}.rows-viewport{flex:1;min-width:0;position:relative;display:block;overflow:clip;.rows{position:absolute;top:0;left:0;min-width:100%;will-change:transform;z-index:var(--tbw-z-layer-rows, 1)}}.faux-vscroll{position:sticky;inset-inline-end:0;flex-shrink:0;width:auto;overflow-y:auto;overflow-x:hidden;z-index:var(--tbw-z-layer-header, 30)}.faux-vscroll-spacer{width:1px}&[data-has-focus]{.cell-focus,.row-focus{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}}.sticky-left,.sticky-right{position:sticky;z-index:25}.sticky-left{box-shadow:1px 0 0 var(--tbw-color-border)}.sticky-right{box-shadow:-1px 0 0 var(--tbw-color-border)}}}', ji = '@layer tbw-base{tbw-grid{.header{display:block;flex-shrink:0;z-index:var(--tbw-z-layer-header, 30);background:var(--tbw-color-header-bg);overflow:visible}.header-group-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-color-header-bg);z-index:var(--tbw-z-layer-header, 30)}.header-group-cell{display:flex;align-items:center;justify-content:flex-start;padding:var(--tbw-cell-padding-header, 2px 8px);color:var(--tbw-color-header-group-fg, var(--tbw-color-header-fg));font-weight:var(--tbw-font-weight-header-group, var(--tbw-font-weight-header));justify-content:var(--tbw-align-header-group, var(--tbw-align-header, flex-start));&:not(:last-child){border-right:2px solid var(--tbw-color-border)}}.header-row{display:grid;grid-template-columns:var(--tbw-column-template);color:var(--tbw-color-header-fg);font-size:var(--tbw-font-size-header);min-height:var(--tbw-header-height);border-bottom:var(--tbw-border-header);z-index:var(--tbw-z-layer-header, 30);text-transform:var(--tbw-header-text-transform);letter-spacing:var(--tbw-header-letter-spacing);>.cell{display:flex;align-items:center;gap:4px;padding:var(--tbw-cell-padding-header, 2px 8px);background-color:var(--tbw-color-header-bg);font-weight:var(--tbw-font-weight-header);border-right:1px solid var(--tbw-color-border-cell);overflow:visible;min-width:0;>span:first-child{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:inherit}>span[part~=sort-indicator]{flex-shrink:0;opacity:.6;color:var(--tbw-sort-indicator-color);display:var(--tbw-sort-indicator-display, inline-flex);visibility:var(--tbw-sort-indicator-visibility, visible);transition:opacity .15s,visibility 0s,display 0s allow-discrete;transition-behavior:allow-discrete}&:hover>span[part~=sort-indicator]{display:inline-flex;visibility:visible}&[aria-sort=ascending]>span[part~=sort-indicator],&[aria-sort=descending]>span[part~=sort-indicator]{display:inline-flex;visibility:visible;opacity:1;color:var(--tbw-sort-indicator-active-color)}&:last-child{border-right:0;.resize-handle{right:0;width:calc(var(--tbw-resize-handle-width) / 2)}}&.grouped.group-end:not(:last-child){border-right:2px solid var(--tbw-color-border)}&.resizable{position:relative}&.sticky-left,&.sticky-right{background:var(--tbw-color-header-bg);z-index:35}}}.sortable{cursor:pointer;user-select:none}.resize-handle{position:absolute;top:0;right:calc(var(--tbw-resize-handle-width) / -2);width:var(--tbw-resize-handle-width);height:100%;cursor:e-resize;user-select:none;touch-action:none;z-index:20;background:var(--tbw-resize-handle-color);transition:background .12s ease;border-radius:var(--tbw-resize-handle-border-radius);&:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:var(--tbw-resize-indicator-width, 2px);height:0;background:var(--tbw-resize-indicator-color, var(--tbw-color-accent));opacity:0;pointer-events:none;transition:opacity .12s ease,height 0s .12s;z-index:1000}&:hover{background:var(--tbw-resize-handle-color-hover);&:after{height:100vh;opacity:var(--tbw-resize-indicator-opacity, .6);transition:opacity .12s ease,height 0s}}}}}', Ki = '@layer tbw-base{.tbw-loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:1000;pointer-events:all;animation:tbw-fade-in .15s ease-out}.tbw-spinner{--tbw-spinner-size: 48px;--tbw-spinner-border-width: 3px;--tbw-spinner-color: var(--tbw-color-accent);--tbw-spinner-track-color: var(--tbw-color-border);width:var(--tbw-spinner-size);height:var(--tbw-spinner-size);border:var(--tbw-spinner-border-width) solid var(--tbw-spinner-track-color);border-top-color:var(--tbw-spinner-color);border-radius:50%;animation:tbw-spin .8s linear infinite}.tbw-spinner--large{--tbw-spinner-size: min(48px, calc(100% - 16px) )}.tbw-spinner--small{--tbw-spinner-size: calc(var(--tbw-row-height, 28px) * .6);--tbw-spinner-border-width: 2px}.data-grid-row.tbw-row-loading{position:relative;pointer-events:none}.tbw-row-loading-overlay{position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:26;animation:tbw-fade-in .15s ease-out;pointer-events:none;display:flex;align-items:center}.tbw-row-loading-spinner{--_spinner-size: calc(var(--tbw-row-height, 28px) * .6);margin-left:var(--tbw-spacing-md);width:var(--_spinner-size);height:var(--_spinner-size);border:2px solid var(--tbw-spinner-track-color, var(--tbw-color-border));border-top-color:var(--tbw-spinner-color, var(--tbw-color-accent));border-radius:50%;animation:tbw-spin .8s linear infinite}.cell.tbw-cell-loading{position:relative;pointer-events:none;&:before{content:"";position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:26;animation:tbw-fade-in .15s ease-out}&:after{--_spinner-size: calc(var(--tbw-row-height, 28px) * .5);content:"";position:absolute;left:var(--tbw-spacing-sm);top:0;bottom:0;margin:auto 0;width:var(--_spinner-size);height:var(--_spinner-size);border:2px solid var(--tbw-spinner-track-color, var(--tbw-color-border));border-top-color:var(--tbw-spinner-color, var(--tbw-color-accent));border-radius:50%;animation:tbw-spin .8s linear infinite;z-index:27}}}', Qi = "@layer tbw-base{@media(forced-colors:active){tbw-grid{--tbw-color-border: CanvasText;--tbw-color-border-strong: CanvasText;--tbw-color-border-cell: CanvasText;--tbw-color-border-header: CanvasText;--tbw-color-fg: CanvasText;--tbw-color-bg: Canvas;--tbw-color-panel-bg: Canvas;--tbw-color-header-bg: Canvas;--tbw-color-header-fg: CanvasText;--tbw-color-accent: Highlight;--tbw-color-accent-fg: HighlightText;--tbw-color-selection: Highlight;--tbw-color-row-hover: Highlight;--tbw-focus-outline: 2px solid Highlight;--tbw-range-border-color: Highlight;.cell:focus,.cell.active-cell{outline:2px solid Highlight!important;outline-offset:-2px}.data-grid-row[aria-selected=true]{background:Highlight!important;color:HighlightText!important}}}@media(prefers-reduced-motion:reduce){tbw-grid[data-animation-mode=reduced-motion]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}}", Zi = "@layer tbw-base{tbw-grid{.data-grid-row{display:grid;grid-template-columns:var(--tbw-column-template);contain:layout style;&:nth-child(2n){background:var(--tbw-color-row-alt)}&:hover{background:var(--tbw-color-row-hover)}>.cell{display:block;padding:var(--tbw-cell-padding, 2px 8px);border-bottom:var(--tbw-row-divider);min-height:var(--tbw-row-height);align-content:center;border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0;white-space:var(--tbw-cell-white-space, nowrap);text-overflow:ellipsis;>*{overflow:hidden;text-overflow:ellipsis;white-space:inherit;min-width:0}&:last-child{border-right:0}&[data-type=boolean]{text-align:center;input[type=checkbox]{margin:0;width:var(--tbw-checkbox-size);height:var(--tbw-checkbox-size);vertical-align:middle}}&.selected:focus-visible,&:focus-visible:not(.cell-focus){outline:none}&.sticky-left,&.sticky-right{background:var(--tbw-color-panel-bg)}}}.selecting .data-grid-row>.cell{user-select:none}}}", Ji = "@layer tbw-base{tbw-grid{.tbw-shell-header{display:flex;align-items:center;gap:8px;min-height:var(--tbw-shell-header-height);padding:0 8px;background:var(--tbw-shell-header-bg);border-bottom:1px solid var(--tbw-shell-header-border);flex-shrink:0}.tbw-shell-title{font-size:var(--tbw-shell-title-font-size);font-weight:var(--tbw-shell-title-font-weight);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-shell-content{flex:1;display:flex;align-items:center;gap:12px;min-width:0;overflow:hidden}.tbw-shell-toolbar{display:flex;align-items:center;gap:var(--tbw-toolbar-button-gap);flex-shrink:0}.tbw-toolbar-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-toolbar-button-size);height:var(--tbw-toolbar-button-size);padding:0;border:1px solid transparent;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg);cursor:pointer;font-size:16px;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease),border-color var(--tbw-transition-duration) var(--tbw-transition-ease);&:hover{background:var(--tbw-color-row-hover)}&:focus-visible{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}&.active{background:var(--tbw-focus-background);border-color:var(--tbw-color-accent)}&:disabled{opacity:.5;cursor:not-allowed}}.tbw-toolbar-separator{width:1px;height:20px;background:var(--tbw-color-border);margin:0 4px}.tbw-shell-body{position:relative;display:flex;flex:1;min-height:0;overflow:visible}.tbw-grid-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:row;overflow:hidden}.tbw-scroll-area{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow-x:auto;overflow-y:hidden;overflow-anchor:none}}}", eo = "@layer tbw-base{tbw-grid{.tbw-tool-panel{position:absolute;top:0;bottom:0;right:0;width:0;overflow:hidden;background:var(--tbw-tool-panel-bg);border-left:1px solid var(--tbw-tool-panel-border);transition:width var(--tbw-tool-panel-transition);display:flex;flex-direction:column;z-index:30;box-shadow:-2px 0 8px var(--tbw-color-shadow);&[data-position=left]{right:auto;left:0;border-left:none;border-right:1px solid var(--tbw-tool-panel-border);box-shadow:2px 0 8px var(--tbw-color-shadow)}&.open{width:var(--tbw-tool-panel-width)}}.tbw-tool-panel-resize{position:absolute;top:0;bottom:0;width:6px;cursor:col-resize;background:transparent;z-index:10;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease);&[data-handle-position=left]{left:0}&[data-handle-position=right]{right:0}&:hover,&.resizing{background:var(--tbw-color-accent)}}.tbw-tool-panel-header{display:flex;align-items:center;justify-content:space-between;min-height:var(--tbw-tool-panel-header-height);padding:0 12px;border-bottom:1px solid var(--tbw-tool-panel-border);flex-shrink:0}.tbw-tool-panel-title{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-tool-panel-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg-muted);cursor:pointer;font-size:14px;&:hover{background:var(--tbw-color-row-hover);color:var(--tbw-color-fg)}}.tbw-tool-panel-content{flex:1;overflow:auto}.tbw-accordion{display:flex;flex-direction:column;gap:0}.tbw-accordion-section{border-bottom:1px solid var(--tbw-tool-panel-border);&:last-child{border-bottom:none}&.single .tbw-accordion-header{cursor:default;&:hover{background:transparent}}&.expanded{.tbw-accordion-chevron{transform:rotate(90deg)}.tbw-accordion-content{display:block}}}.tbw-accordion-header{display:flex;align-items:center;gap:8px;width:100%;padding:10px 12px;border:none;background:transparent;color:var(--tbw-color-fg);font-size:13px;font-weight:600;text-align:start;cursor:pointer;user-select:none;&:hover{background:var(--tbw-color-row-hover)}}.tbw-accordion-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:10px;color:var(--tbw-color-fg-muted);transition:transform .15s ease;flex-shrink:0}.tbw-accordion-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:14px;flex-shrink:0}.tbw-accordion-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tbw-accordion-content{display:none}}}", to = "@layer tbw-base{tbw-grid{--tbw-base-icon-size: 1em;--tbw-base-radius: .25em;--tbw-font-size: 1em;--tbw-font-size-sm: .9285em;--tbw-font-size-xs: .7857em;--tbw-font-size-2xs: .7142em;--tbw-spacing-xs: .25em;--tbw-spacing-sm: .375em;--tbw-spacing-md: .5em;--tbw-spacing-lg: .75em;--tbw-spacing-xl: 1em;--tbw-icon-size: var(--tbw-base-icon-size);--tbw-icon-size-sm: .875em;--tbw-checkbox-size: var(--tbw-base-icon-size);--tbw-toggle-size: 1.25em;--tbw-border-radius: var(--tbw-base-radius);--tbw-color-bg: transparent;--tbw-color-panel-bg: light-dark(#eeeeee, #222222);--tbw-color-fg: light-dark(#222222, #eeeeee);--tbw-color-fg-muted: light-dark(#555555, #aaaaaa);--tbw-color-accent: light-dark(#3b82f6, #3b82f6);--tbw-color-accent-fg: light-dark(#ffffff, #000000);--tbw-color-success: light-dark(hsl(122, 39%, 40%), hsl(122, 39%, 49%));--tbw-color-warning: light-dark(hsl(38, 92%, 50%), hsl(38, 92%, 50%));--tbw-color-error: light-dark(hsl(0, 65%, 51%), hsl(0, 65%, 55%));--tbw-color-danger: var(--tbw-color-error);--tbw-color-selection: light-dark(#fff7d6, #333333);--tbw-color-row-alt: var(--tbw-color-bg);--tbw-color-row-hover: light-dark(#f0f6ff, #1c1c1c);--tbw-color-header-bg: color-mix(in hsl, var(--tbw-color-panel-bg) 85%, var(--tbw-color-fg));--tbw-color-header-fg: color-mix(in hsl, var(--tbw-color-fg) 75%, var(--tbw-color-panel-bg));--tbw-color-border: light-dark(#d0d0d4, #454545);--tbw-color-border-strong: light-dark(#777777, #666666);--tbw-color-border-cell: var(--tbw-color-border);--tbw-color-border-header: var(--tbw-color-border);--tbw-color-shadow: light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3));--tbw-font-family: inherit;--tbw-font-size-header: var(--tbw-font-size);--tbw-font-weight-header: bold;--tbw-cell-padding-header: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-cell-padding-v: var(--tbw-spacing-xs);--tbw-cell-padding-h: var(--tbw-spacing-md);--tbw-cell-padding: var(--tbw-cell-padding-v) var(--tbw-cell-padding-h);--tbw-cell-padding-input: var(--tbw-spacing-xs) var(--tbw-spacing-sm);--tbw-row-height: 1.75em;--tbw-header-height: 1.875em;--tbw-cell-white-space: nowrap;--tbw-border-width: 1px;--tbw-border-style: solid;--tbw-border-input: var(--tbw-border-width) var(--tbw-border-style) var(--tbw-color-border-strong);--tbw-border-header: var(--tbw-border-width) var(--tbw-border-style) var(--tbw-color-border-header);--tbw-row-divider: var(--tbw-border-width) var(--tbw-border-style) var(--tbw-color-border-cell);--tbw-row-hover-outline: 0;--tbw-color-active-row-bg: var(--tbw-color-selection);--tbw-active-row-outline: 0;--tbw-focus-outline-width: 2px;--tbw-focus-outline: var(--tbw-focus-outline-width) var(--tbw-border-style) var(--tbw-color-accent);--tbw-focus-outline-offset: -2px;--tbw-focus-background: rgba(from var(--tbw-color-accent) r g b / 12%);--tbw-range-border-color: var(--tbw-color-accent);--tbw-range-selection-bg: rgba(from var(--tbw-range-border-color) r g b / 12%);--tbw-resize-handle-width: var(--tbw-spacing-sm);--tbw-resize-handle-color: transparent;--tbw-resize-handle-color-hover: var(--tbw-color-accent);--tbw-resize-handle-border-radius: 0;--tbw-resize-indicator-width: 2px;--tbw-resize-indicator-color: var(--tbw-color-accent);--tbw-resize-indicator-opacity: .6;--tbw-transition-duration: .12s;--tbw-transition-ease: ease;--tbw-animation-duration: .2s;--tbw-animation-easing: ease-out;--tbw-animation-enabled: 1;--tbw-row-change-duration: .5s;--tbw-row-insert-duration: .3s;--tbw-row-remove-duration: .2s;--tbw-row-change-color: rgba(from var(--tbw-color-accent) r g b / 25%);--tbw-sort-indicator-color: var(--tbw-color-fg-muted);--tbw-sort-indicator-active-color: var(--tbw-color-accent);--tbw-sort-indicator-display: inline-flex;--tbw-sort-indicator-visibility: visible;--tbw-header-text-transform: none;--tbw-header-letter-spacing: normal;--tbw-color-header-separator: var(--tbw-color-border-cell);--tbw-density-scale: 1;--tbw-shell-header-height: 2.75em;--tbw-shell-header-bg: var(--tbw-color-panel-bg);--tbw-shell-header-border: var(--tbw-color-border);--tbw-shell-title-font-size: var(--tbw-font-size);--tbw-shell-title-font-weight: 600;--tbw-tool-panel-width: 17.5em;--tbw-tool-panel-bg: var(--tbw-color-panel-bg);--tbw-tool-panel-border: var(--tbw-color-border);--tbw-tool-panel-header-height: 2.5em;--tbw-tool-panel-transition: var(--tbw-animation-duration) var(--tbw-animation-easing);--tbw-toolbar-button-size: 2em;--tbw-toolbar-button-gap: var(--tbw-spacing-xs);--tbw-panel-padding: var(--tbw-spacing-lg);--tbw-panel-gap: var(--tbw-spacing-md);--tbw-menu-item-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-menu-item-gap: var(--tbw-spacing-md);--tbw-menu-min-width: 10rem;--tbw-button-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-button-padding-sm: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-input-height: var(--tbw-row-height);--tbw-input-padding: 0 var(--tbw-spacing-md);--tbw-detail-padding: var(--tbw-spacing-xl);--tbw-detail-max-height: 31.25rem;--tbw-indicator-size: var(--tbw-spacing-sm)}}", io = `/**
2735
2750
  * tbw-grid Light DOM Styles
2736
2751
  *
2737
2752
  * This stylesheet uses CSS nesting to scope all styles to the tbw-grid element.
@@ -2750,19 +2765,19 @@ const Gi = "@layer tbw-base{tbw-grid{.tbw-expanding{animation:tbw-expand var(--t
2750
2765
  /* Declare layer order - earlier layers have lower priority */
2751
2766
  @layer tbw-base, tbw-plugins, tbw-theme;
2752
2767
 
2753
- ${eo}
2754
- ${Xi}
2768
+ ${to}
2755
2769
  ${Yi}
2756
- ${Qi}
2770
+ ${ji}
2757
2771
  ${Zi}
2758
2772
  ${Ji}
2759
- ${ji}
2760
- ${Gi}
2773
+ ${eo}
2761
2774
  ${Ki}
2775
+ ${Xi}
2776
+ ${Qi}
2762
2777
  `;
2763
2778
  class k extends HTMLElement {
2764
2779
  static tagName = "tbw-grid";
2765
- static version = "1.16.1";
2780
+ static version = "1.18.0";
2766
2781
  static #l = 0;
2767
2782
  static adapters = [];
2768
2783
  static registerAdapter(e) {
@@ -2785,7 +2800,7 @@ class k extends HTMLElement {
2785
2800
  #h;
2786
2801
  #a = [];
2787
2802
  get #o() {
2788
- return this.#t?.effective ?? {};
2803
+ return this.#i?.effective ?? {};
2789
2804
  }
2790
2805
  #f = !1;
2791
2806
  #w = !1;
@@ -2802,12 +2817,12 @@ class k extends HTMLElement {
2802
2817
  #x = !1;
2803
2818
  #m = 0;
2804
2819
  #z;
2805
- #N = Si();
2820
+ #I = Ri();
2806
2821
  #b;
2807
2822
  #y;
2808
2823
  #p;
2809
- #S;
2810
- #J = {
2824
+ #R;
2825
+ #ee = {
2811
2826
  scrollTop: 0,
2812
2827
  scrollLeft: 0,
2813
2828
  scrollHeight: 0,
@@ -2815,23 +2830,24 @@ class k extends HTMLElement {
2815
2830
  clientHeight: 0,
2816
2831
  clientWidth: 0
2817
2832
  };
2818
- #e;
2833
+ #t;
2819
2834
  #_;
2820
- #I = !1;
2835
+ #N = !1;
2821
2836
  #D;
2822
- #V;
2837
+ #G;
2823
2838
  #O;
2824
- #t;
2825
- #i = hi();
2839
+ #i;
2840
+ #e = hi();
2826
2841
  #c;
2827
2842
  #q;
2843
+ #$;
2828
2844
  #M = !1;
2829
2845
  #E = /* @__PURE__ */ new Set();
2830
2846
  #H = /* @__PURE__ */ new Map();
2831
- #$;
2832
- #R = /* @__PURE__ */ new Map();
2847
+ #W;
2848
+ #S = /* @__PURE__ */ new Map();
2833
2849
  _rows = [];
2834
- #B = [];
2850
+ #X = [];
2835
2851
  get _columns() {
2836
2852
  return this.#o.columns ?? [];
2837
2853
  }
@@ -2875,16 +2891,16 @@ class k extends HTMLElement {
2875
2891
  __rowRenderEpoch = 0;
2876
2892
  __didInitialAutoSize = !1;
2877
2893
  get __lightDomColumnsCache() {
2878
- return this.#t?.lightDomColumnsCache;
2894
+ return this.#i?.lightDomColumnsCache;
2879
2895
  }
2880
2896
  set __lightDomColumnsCache(e) {
2881
- this.#t && (this.#t.lightDomColumnsCache = e);
2897
+ this.#i && (this.#i.lightDomColumnsCache = e);
2882
2898
  }
2883
2899
  get __originalColumnNodes() {
2884
- return this.#t?.originalColumnNodes;
2900
+ return this.#i?.originalColumnNodes;
2885
2901
  }
2886
2902
  set __originalColumnNodes(e) {
2887
- this.#t && (this.#t.originalColumnNodes = e);
2903
+ this.#i && (this.#i.originalColumnNodes = e);
2888
2904
  }
2889
2905
  __originalOrder = [];
2890
2906
  __frameworkAdapter;
@@ -2894,7 +2910,7 @@ class k extends HTMLElement {
2894
2910
  }
2895
2911
  set rows(e) {
2896
2912
  const i = this.#a;
2897
- this.#a = e, i !== e && this.#U("rows");
2913
+ this.#a = e, i !== e && this.#V("rows");
2898
2914
  }
2899
2915
  get sourceRows() {
2900
2916
  return this.#a;
@@ -2903,38 +2919,38 @@ class k extends HTMLElement {
2903
2919
  return [...this._columns];
2904
2920
  }
2905
2921
  set columns(e) {
2906
- const i = this.#t?.getColumns();
2907
- this.#t?.setColumns(e), i !== e && this.#U("columns");
2922
+ const i = this.#i?.getColumns();
2923
+ this.#i?.setColumns(e), i !== e && this.#V("columns");
2908
2924
  }
2909
2925
  get gridConfig() {
2910
2926
  return this.#o;
2911
2927
  }
2912
2928
  set gridConfig(e) {
2913
- const i = this.#t?.getGridConfig();
2914
- this.#t?.setGridConfig(e), i !== e && (this.#t.clearLightDomCache(), this.#U("gridConfig"));
2929
+ const i = this.#i?.getGridConfig();
2930
+ this.#i?.setGridConfig(e), i !== e && (this.#i.clearLightDomCache(), this.#V("gridConfig"));
2915
2931
  }
2916
2932
  get fitMode() {
2917
2933
  return this.#o.fitMode ?? "stretch";
2918
2934
  }
2919
2935
  set fitMode(e) {
2920
- const i = this.#t?.getFitMode();
2921
- this.#t?.setFitMode(e), i !== e && this.#U("fitMode");
2936
+ const i = this.#i?.getFitMode();
2937
+ this.#i?.setFitMode(e), i !== e && this.#V("fitMode");
2922
2938
  }
2923
2939
  get loading() {
2924
2940
  return this.#M;
2925
2941
  }
2926
2942
  set loading(e) {
2927
2943
  const i = this.#M;
2928
- this.#M = e, e ? this.setAttribute("loading", "") : this.removeAttribute("loading"), i !== e && this.#he();
2944
+ this.#M = e, e ? this.setAttribute("loading", "") : this.removeAttribute("loading"), i !== e && this.#ue();
2929
2945
  }
2930
2946
  setRowLoading(e, i) {
2931
2947
  const o = this.#E.has(e);
2932
- i ? this.#E.add(e) : this.#E.delete(e), o !== i && this.#j(e, i);
2948
+ i ? this.#E.add(e) : this.#E.delete(e), o !== i && this.#K(e, i);
2933
2949
  }
2934
2950
  setCellLoading(e, i, o) {
2935
2951
  let n = this.#H.get(e);
2936
2952
  const r = n?.has(i) ?? !1;
2937
- o ? (n || (n = /* @__PURE__ */ new Set(), this.#H.set(e, n)), n.add(i)) : (n?.delete(i), n?.size === 0 && this.#H.delete(e)), r !== o && this.#ue(e, i, o);
2953
+ o ? (n || (n = /* @__PURE__ */ new Set(), this.#H.set(e, n)), n.add(i)) : (n?.delete(i), n?.size === 0 && this.#H.delete(e)), r !== o && this.#fe(e, i, o);
2938
2954
  }
2939
2955
  isRowLoading(e) {
2940
2956
  return this.#E.has(e);
@@ -2945,11 +2961,11 @@ class k extends HTMLElement {
2945
2961
  clearAllLoading() {
2946
2962
  this.loading = !1;
2947
2963
  for (const e of this.#E)
2948
- this.#j(e, !1);
2964
+ this.#K(e, !1);
2949
2965
  this.#E.clear();
2950
2966
  for (const [e, i] of this.#H)
2951
2967
  for (const o of i)
2952
- this.#ue(e, o, !1);
2968
+ this.#fe(e, o, !1);
2953
2969
  this.#H.clear();
2954
2970
  }
2955
2971
  get effectiveConfig() {
@@ -2959,28 +2975,28 @@ class k extends HTMLElement {
2959
2975
  return this.#b || (this.#b = new AbortController()), this.#b.signal;
2960
2976
  }
2961
2977
  constructor() {
2962
- super(), this.#be(), this.#d = new Promise((e) => this.#h = e), this.#s = new ti({
2978
+ super(), this.#me(), this.#d = new Promise((e) => this.#h = e), this.#s = new ti({
2963
2979
  mergeConfig: () => {
2964
- this.#t.parseLightDomColumns(this), this.#t.merge(), this.#te(), Oi(this.#o, this.#e?.getPlugins() ?? []), Mi(this.#e?.getPlugins() ?? []), Ni(this.#e?.getPlugins() ?? []), this.#ze(), this.#B = [...this._columns];
2980
+ this.#i.parseLightDomColumns(this), this.#i.merge(), this.#ie(), Mi(this.#o, this.#t?.getPlugins() ?? []), ki(this.#t?.getPlugins() ?? []), Ni(this.#t?.getPlugins() ?? []), this.#De(), this.#X = [...this._columns];
2965
2981
  },
2966
- processColumns: () => this.#xe(),
2967
- processRows: () => this.#Le(),
2982
+ processColumns: () => this.#He(),
2983
+ processRows: () => this.#Pe(),
2968
2984
  renderHeader: () => oe(this),
2969
2985
  updateTemplate: () => V(this),
2970
2986
  renderVirtualWindow: () => this.refreshVirtualWindow(!0, !0),
2971
2987
  afterRender: () => {
2972
- this.#e?.afterRender(), this._virtualization.enabled && this._virtualization.totalHeightEl && queueMicrotask(() => {
2988
+ this.#t?.afterRender(), this._virtualization.enabled && this._virtualization.totalHeightEl && queueMicrotask(() => {
2973
2989
  if (!this._virtualization.totalHeightEl) return;
2974
2990
  const i = this.#T(this._rows.length);
2975
2991
  this._virtualization.totalHeightEl.style.height = `${i}px`;
2976
- }), this.#o.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, Re(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, $(this)), this._virtualization.enabled && !this.#F && this.#Ce(), this.#x && (this.#x = !1, requestAnimationFrame(() => {
2992
+ }), this.#o.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, Re(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, $(this)), this._virtualization.enabled && !this.#U && this.#ye(), this.#x && (this.#x = !1, requestAnimationFrame(() => {
2977
2993
  requestAnimationFrame(() => {
2978
- this.#ve();
2994
+ this.#Ce();
2979
2995
  });
2980
- })), this.#M && this.#he();
2996
+ })), this.#M && this.#ue();
2981
2997
  },
2982
2998
  isConnected: () => this.isConnected && this.#f
2983
- }), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = bi(this.#i, {
2999
+ }), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = mi(this.#e, {
2984
3000
  getShadow: () => this.#n,
2985
3001
  getShellConfig: () => this.#o?.shell,
2986
3002
  getAccordionIcons: () => ({
@@ -2989,7 +3005,7 @@ class k extends HTMLElement {
2989
3005
  }),
2990
3006
  emit: (e, i) => this.#L(e, i),
2991
3007
  refreshShellHeader: () => this.refreshShellHeader()
2992
- }), this.#t = new Lt({
3008
+ }), this.#i = new Lt({
2993
3009
  getRows: () => this.#a,
2994
3010
  getSortState: () => this._sortState,
2995
3011
  setSortState: (e) => {
@@ -3010,23 +3026,23 @@ class k extends HTMLElement {
3010
3026
  setRowHeight: (e) => {
3011
3027
  this._virtualization.rowHeight = e;
3012
3028
  },
3013
- applyAnimationConfig: (e) => this.#Pe(e),
3014
- getShellLightDomTitle: () => this.#i.lightDomTitle,
3015
- getShellToolPanels: () => this.#i.toolPanels,
3016
- getShellHeaderContents: () => this.#i.headerContents,
3017
- getShellToolbarContents: () => this.#i.toolbarContents,
3018
- getShellLightDomHeaderContent: () => this.#i.lightDomHeaderContent,
3019
- getShellHasToolButtonsContainer: () => this.#i.hasToolButtonsContainer
3029
+ applyAnimationConfig: (e) => this.#ze(e),
3030
+ getShellLightDomTitle: () => this.#e.lightDomTitle,
3031
+ getShellToolPanels: () => this.#e.toolPanels,
3032
+ getShellHeaderContents: () => this.#e.headerContents,
3033
+ getShellToolbarContents: () => this.#e.toolbarContents,
3034
+ getShellLightDomHeaderContent: () => this.#e.lightDomHeaderContent,
3035
+ getShellHasToolButtonsContainer: () => this.#e.hasToolButtonsContainer
3020
3036
  });
3021
3037
  }
3022
- async #be() {
3023
- await Ei(to);
3038
+ async #me() {
3039
+ await Si(io);
3024
3040
  }
3025
3041
  getPlugin(e) {
3026
- return this.#e?.getPlugin(e);
3042
+ return this.#t?.getPlugin(e);
3027
3043
  }
3028
3044
  getPluginByName(e) {
3029
- return this.#e?.getPluginByName(e);
3045
+ return this.#t?.getPluginByName(e);
3030
3046
  }
3031
3047
  requestRender() {
3032
3048
  this.#s.requestPhase(A.ROWS, "plugin:requestRender");
@@ -3043,16 +3059,16 @@ class k extends HTMLElement {
3043
3059
  requestAfterRender() {
3044
3060
  this.#s.requestPhase(A.STYLE, "plugin:requestAfterRender");
3045
3061
  }
3046
- #ee() {
3047
- this.#e = new ne(this);
3062
+ #te() {
3063
+ this.#t = new ne(this);
3048
3064
  const e = this.#o?.plugins, i = Array.isArray(e) ? e : [];
3049
- this.#e.attachAll(i);
3065
+ this.#t.attachAll(i);
3050
3066
  }
3051
- #W() {
3052
- const e = this.#e?.getPluginStyles() ?? [];
3053
- yi(e);
3067
+ #F() {
3068
+ const e = this.#t?.getPluginStyles() ?? [];
3069
+ _i(e);
3054
3070
  }
3055
- #te() {
3071
+ #ie() {
3056
3072
  const e = this.#o?.plugins, i = Array.isArray(e) ? e : [];
3057
3073
  if (this.#_ === i)
3058
3074
  return;
@@ -3060,38 +3076,38 @@ class k extends HTMLElement {
3060
3076
  this.#_ = i;
3061
3077
  return;
3062
3078
  }
3063
- this.#e && this.#e.detachAll();
3064
- for (const n of this.#i.toolPanels.keys()) {
3065
- const r = this.#i.lightDomToolPanelIds.has(n), s = this.#i.apiToolPanelIds.has(n);
3079
+ this.#t && this.#t.detachAll();
3080
+ for (const n of this.#e.toolPanels.keys()) {
3081
+ const r = this.#e.lightDomToolPanelIds.has(n), s = this.#e.apiToolPanelIds.has(n);
3066
3082
  if (!r && !s) {
3067
- const l = this.#i.panelCleanups.get(n);
3068
- l && (l(), this.#i.panelCleanups.delete(n)), this.#i.toolPanels.delete(n);
3083
+ const l = this.#e.panelCleanups.get(n);
3084
+ l && (l(), this.#e.panelCleanups.delete(n)), this.#e.toolPanels.delete(n);
3069
3085
  }
3070
3086
  }
3071
- for (const n of this.#i.headerContents.keys()) {
3072
- const r = this.#i.headerContentCleanups.get(n);
3073
- r && (r(), this.#i.headerContentCleanups.delete(n)), this.#i.headerContents.delete(n);
3087
+ for (const n of this.#e.headerContents.keys()) {
3088
+ const r = this.#e.headerContentCleanups.get(n);
3089
+ r && (r(), this.#e.headerContentCleanups.delete(n)), this.#e.headerContents.delete(n);
3074
3090
  }
3075
- this.#ee(), this.#W(), this.#_ = i, this.#re(), this.#ie();
3091
+ this.#te(), this.#F(), this.#_ = i, this.#se(), this.#oe();
3076
3092
  const o = this.#g;
3077
- if (this.#g = this.#e?.getAll().some((n) => n.onScroll) ?? !1, !o && this.#g) {
3093
+ if (this.#g = this.#t?.getAll().some((n) => n.onScroll) ?? !1, !o && this.#g) {
3078
3094
  const r = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
3079
- this.#G(r);
3095
+ this.#Y(r);
3080
3096
  }
3081
3097
  }
3082
- #me() {
3083
- this.#e?.detachAll();
3098
+ #ve() {
3099
+ this.#t?.detachAll();
3084
3100
  }
3085
- #ie() {
3086
- if (!this.#e) return;
3087
- const e = this.#e.getToolPanels();
3101
+ #oe() {
3102
+ if (!this.#t) return;
3103
+ const e = this.#t.getToolPanels();
3088
3104
  for (const { panel: o } of e)
3089
- this.#i.toolPanels.has(o.id) || this.#i.toolPanels.set(o.id, o);
3090
- const i = this.#e.getHeaderContents();
3105
+ this.#e.toolPanels.has(o.id) || this.#e.toolPanels.set(o.id, o);
3106
+ const i = this.#t.getHeaderContents();
3091
3107
  for (const { content: o } of i)
3092
- this.#i.headerContents.has(o.id) || this.#i.headerContents.set(o.id, o);
3108
+ this.#e.headerContents.has(o.id) || this.#e.headerContents.set(o.id, o);
3093
3109
  }
3094
- #oe() {
3110
+ #ne() {
3095
3111
  const e = k.getAdapters();
3096
3112
  if (e.length === 0 && !this.__frameworkAdapter) return;
3097
3113
  const i = this.__frameworkAdapter;
@@ -3108,17 +3124,17 @@ class k extends HTMLElement {
3108
3124
  };
3109
3125
  }
3110
3126
  connectedCallback() {
3111
- this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", k.version), this.id || (this.id = `tbw-grid-${++k.#l}`), this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#b && (this.#b.abort(), this.#I = !1), this.#b = new AbortController(), this.#S && (Oe(this.#S), this.#S = void 0), this.#k(), this.#t.parseLightDomColumns(this), this.#t.merge(), this.#ee();
3127
+ this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", k.version), this.id || (this.id = `tbw-grid-${++k.#l}`), this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#b && (this.#b.abort(), this.#N = !1), this.#b = new AbortController(), this.#R && (Oe(this.#R), this.#R = void 0), this.#k(), this.#i.parseLightDomColumns(this), this.#i.merge(), this.#te();
3112
3128
  const e = this.#o?.plugins;
3113
- this.#_ = Array.isArray(e) ? e : [], this.#ie(), this.#u || (this.#Z(), this.#W(), this.#u = !0), this.#ne(), this.#S = Xt(
3129
+ this.#_ = Array.isArray(e) ? e : [], this.#oe(), this.#u || (this.#J(), this.#F(), this.#u = !0), this.#re(), this.#R = Xt(
3114
3130
  () => {
3115
- this.#ke();
3131
+ this.#Ie();
3116
3132
  },
3117
3133
  { timeout: 100 }
3118
3134
  );
3119
3135
  }
3120
3136
  disconnectedCallback() {
3121
- this.#S && (Oe(this.#S), this.#S = void 0), this.#m && (clearTimeout(this.#m), this.#m = 0), this.#me(), wi(this.#i), this.#c.setInitialized(!1), this.#q?.(), this.#q = void 0, lt(this.#N), this.#b && (this.#b.abort(), this.#b = void 0), this.#D?.abort(), this.#D = void 0, this.#I = !1, this._resizeController && this._resizeController.dispose(), this.#y && (this.#y.disconnect(), this.#y = void 0), this.#p && (this.#p.disconnect(), this.#p = void 0, this.#F = !1), Y(this), this.#A.clear(), this.#_ = void 0;
3137
+ this.#R && (Oe(this.#R), this.#R = void 0), this.#m && (clearTimeout(this.#m), this.#m = 0), this.#ve(), bi(this.#e), this.#c.setInitialized(!1), this.#q?.(), this.#q = void 0, this.#$?.(), this.#$ = void 0, lt(this.#I), this.#b && (this.#b.abort(), this.#b = void 0), this.#D?.abort(), this.#D = void 0, this.#N = !1, this._resizeController && this._resizeController.dispose(), this.#y && (this.#y.disconnect(), this.#y = void 0), this.#p && (this.#p.disconnect(), this.#p = void 0, this.#U = !1), Y(this), this.#A.clear(), this.#_ = void 0;
3122
3138
  for (const e of this._rowPool)
3123
3139
  e.remove();
3124
3140
  this._rowPool.length = 0, this.__rowsBodyEl = null, this.#f = !1;
@@ -3139,25 +3155,25 @@ class k extends HTMLElement {
3139
3155
  }
3140
3156
  else e === "fit-mode" && (this.fitMode = o);
3141
3157
  }
3142
- #ne() {
3158
+ #re() {
3143
3159
  const i = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
3144
3160
  if (this._headerRowEl = i?.querySelector(".header-row"), this._virtualization.totalHeightEl = i?.querySelector(".faux-vscroll-spacer"), this._virtualization.viewportEl = i?.querySelector(".rows-viewport"), this._bodyEl = i?.querySelector(".rows"), this.__rowsBodyEl = i?.querySelector(".rows-body"), this.#c.isInitialized) {
3145
- ge(this.#n, this.#i), de(this.#n, this.#o?.shell, this.#i);
3161
+ ge(this.#n, this.#e), de(this.#n, this.#o?.shell, this.#e);
3146
3162
  const n = this.#o?.shell?.toolPanel?.defaultOpen;
3147
- n && this.#i.toolPanels.has(n) && (this.openToolPanel(), this.#i.expandedSections.add(n));
3163
+ n && this.#e.toolPanels.has(n) && (this.openToolPanel(), this.#e.expandedSections.add(n));
3148
3164
  }
3149
- if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Me(this), this.#P(), this.#G(i), this.#I)
3165
+ if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Me(this), this.#P(), this.#Y(i), this.#N)
3150
3166
  return;
3151
- this.#I = !0;
3167
+ this.#N = !0;
3152
3168
  const o = this.disconnectSignal;
3153
- Ft(this, this, this.#n, o), this.#re(), queueMicrotask(() => this.#ye()), this.#s.requestPhase(A.FULL, "afterConnect");
3154
- }
3155
- #re() {
3156
- const e = this.#o.rowHeight, i = this.#e.hasRowHeightPlugin();
3157
- typeof e == "function" || i ? this._virtualization.variableHeights || (this._virtualization.variableHeights = !0, this._virtualization.rowHeight = typeof e == "number" && e > 0 ? e : this._virtualization.rowHeight || 28, this.#Q(), typeof e != "function" && (this.#x = !0)) : !i && typeof e != "function" && this._virtualization.variableHeights ? (this._virtualization.variableHeights = !1, this._virtualization.positionCache = null) : typeof e == "number" && e > 0 ? (this._virtualization.rowHeight = e, this._virtualization.variableHeights = !1) : requestAnimationFrame(() => this.#se());
3169
+ Ft(this, this, this.#n, o), this.#se(), queueMicrotask(() => this.#_e()), this.#s.requestPhase(A.FULL, "afterConnect");
3158
3170
  }
3159
3171
  #se() {
3160
- if (this.#e.hasExtraHeight())
3172
+ const e = this.#o.rowHeight, i = this.#t.hasRowHeightPlugin();
3173
+ typeof e == "function" || i ? this._virtualization.variableHeights || (this._virtualization.variableHeights = !0, this._virtualization.rowHeight = typeof e == "number" && e > 0 ? e : this._virtualization.rowHeight || 28, this.#Z(), typeof e != "function" && (this.#x = !0)) : !i && typeof e != "function" && this._virtualization.variableHeights ? (this._virtualization.variableHeights = !1, this._virtualization.positionCache = null) : typeof e == "number" && e > 0 ? (this._virtualization.rowHeight = e, this._virtualization.variableHeights = !1) : requestAnimationFrame(() => this.#le());
3174
+ }
3175
+ #le() {
3176
+ if (this.#t.hasExtraHeight())
3161
3177
  return;
3162
3178
  const e = this._bodyEl?.querySelector(".data-grid-row");
3163
3179
  if (!e) return;
@@ -3170,7 +3186,7 @@ class k extends HTMLElement {
3170
3186
  const n = e.getBoundingClientRect(), r = Math.max(n.height, o);
3171
3187
  r > 0 && Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r, this.#s.requestPhase(A.VIRTUALIZATION, "measureRowHeight"));
3172
3188
  }
3173
- #ve() {
3189
+ #Ce() {
3174
3190
  const e = this._bodyEl?.querySelector(".data-grid-row");
3175
3191
  if (!e) return;
3176
3192
  const i = e.querySelectorAll(".cell");
@@ -3180,15 +3196,15 @@ class k extends HTMLElement {
3180
3196
  l > o && (o = l);
3181
3197
  });
3182
3198
  const n = e.getBoundingClientRect(), r = Math.max(n.height, o);
3183
- if (r > 0 && (Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r), this.#Q(), this._virtualization.totalHeightEl)) {
3199
+ if (r > 0 && (Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r), this.#Z(), this._virtualization.totalHeightEl)) {
3184
3200
  const l = this.#T(this._rows.length);
3185
3201
  this._virtualization.totalHeightEl.style.height = `${l}px`;
3186
3202
  }
3187
3203
  }
3188
- #G(e) {
3204
+ #Y(e) {
3189
3205
  this.#D?.abort(), this.#D = new AbortController();
3190
3206
  const i = this.#D.signal, o = e?.querySelector(".faux-vscroll"), n = e?.querySelector(".rows");
3191
- if (this._virtualization.container = o ?? this, this.#g = this.#e?.getAll().some((r) => r.onScroll) ?? !1, o && n) {
3207
+ if (this._virtualization.container = o ?? this, this.#g = this.#t?.getAll().some((r) => r.onScroll) ?? !1, o && n) {
3192
3208
  o.addEventListener(
3193
3209
  "scroll",
3194
3210
  () => {
@@ -3209,21 +3225,21 @@ class k extends HTMLElement {
3209
3225
  n.style.transform = `translateY(${g}px)`;
3210
3226
  }
3211
3227
  this.#r = a, this.#C || (this.#C = requestAnimationFrame(() => {
3212
- this.#C = 0, this.#r !== null && (this.#De(this.#r), this.#r = null);
3228
+ this.#C = 0, this.#r !== null && (this.#Oe(this.#r), this.#r = null);
3213
3229
  }));
3214
3230
  },
3215
3231
  { passive: !0, signal: i }
3216
3232
  );
3217
3233
  const r = this.#n.querySelector(".tbw-scroll-area");
3218
- this.#V = r, this._virtualization.scrollAreaEl = r, r && this.#g && r.addEventListener(
3234
+ this.#G = r, this._virtualization.scrollAreaEl = r, r && this.#g && r.addEventListener(
3219
3235
  "scroll",
3220
3236
  () => {
3221
- const a = this.#J;
3222
- a.scrollTop = o.scrollTop, a.scrollLeft = r.scrollLeft, a.scrollHeight = o.scrollHeight, a.scrollWidth = r.scrollWidth, a.clientHeight = o.clientHeight, a.clientWidth = r.clientWidth, this.#e?.onScroll(a);
3237
+ const a = this.#ee;
3238
+ a.scrollTop = o.scrollTop, a.scrollLeft = r.scrollLeft, a.scrollHeight = o.scrollHeight, a.scrollWidth = r.scrollWidth, a.clientHeight = o.clientHeight, a.clientWidth = r.clientWidth, this.#t?.onScroll(a);
3223
3239
  },
3224
3240
  { passive: !0, signal: i }
3225
3241
  );
3226
- const s = this.#n.querySelector(".tbw-grid-content"), l = this.#V;
3242
+ const s = this.#n.querySelector(".tbw-grid-content"), l = this.#G;
3227
3243
  s && (s.addEventListener(
3228
3244
  "wheel",
3229
3245
  (a) => {
@@ -3237,9 +3253,9 @@ class k extends HTMLElement {
3237
3253
  }
3238
3254
  },
3239
3255
  { passive: !1, signal: i }
3240
- ), Li(
3256
+ ), Pi(
3241
3257
  s,
3242
- this.#N,
3258
+ this.#I,
3243
3259
  { fauxScrollbar: o, scrollArea: l },
3244
3260
  i
3245
3261
  ));
@@ -3261,12 +3277,12 @@ class k extends HTMLElement {
3261
3277
  { signal: i }
3262
3278
  );
3263
3279
  }
3264
- #F = !1;
3265
- #Ce() {
3266
- if (this.#F) return;
3280
+ #U = !1;
3281
+ #ye() {
3282
+ if (this.#U) return;
3267
3283
  const e = this._bodyEl?.querySelector(".data-grid-row");
3268
- e && (this.#F = !0, this.#p?.disconnect(), this.#p = new ResizeObserver(() => {
3269
- this.#se();
3284
+ e && (this.#U = !0, this.#p?.disconnect(), this.#p = new ResizeObserver(() => {
3285
+ this.#le();
3270
3286
  }), this.#p.observe(e));
3271
3287
  }
3272
3288
  addEventListener(e, i, o) {
@@ -3278,7 +3294,7 @@ class k extends HTMLElement {
3278
3294
  #L(e, i) {
3279
3295
  this.dispatchEvent(new CustomEvent(e, { detail: i, bubbles: !0, composed: !0 }));
3280
3296
  }
3281
- #ye() {
3297
+ #_e() {
3282
3298
  this._bodyEl?.querySelectorAll(".data-grid-row")?.forEach((i, o) => {
3283
3299
  const n = o === this._focusRow;
3284
3300
  i.setAttribute("aria-selected", String(n)), i.querySelectorAll(".cell").forEach((r, s) => {
@@ -3286,10 +3302,10 @@ class k extends HTMLElement {
3286
3302
  });
3287
3303
  });
3288
3304
  }
3289
- #U(e) {
3290
- this.#v[e] = !0, !this.#w && (this.#w = !0, queueMicrotask(() => this.#_e()));
3305
+ #V(e) {
3306
+ this.#v[e] = !0, !this.#w && (this.#w = !0, queueMicrotask(() => this.#Ee()));
3291
3307
  }
3292
- #_e() {
3308
+ #Ee() {
3293
3309
  if (!this.#w || !this.#f) {
3294
3310
  this.#w = !1;
3295
3311
  return;
@@ -3301,69 +3317,69 @@ class k extends HTMLElement {
3301
3317
  gridConfig: !1,
3302
3318
  fitMode: !1
3303
3319
  }, e.gridConfig) {
3304
- this.#Ae(), e.rows && this.#le();
3320
+ this.#Te(), e.rows && this.#ae();
3305
3321
  return;
3306
3322
  }
3307
- e.columns && this.#Se(), e.rows && this.#le(), e.fitMode && this.#Re();
3323
+ e.columns && this.#Re(), e.rows && this.#ae(), e.fitMode && this.#Ae();
3308
3324
  }
3309
- #le() {
3310
- this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#X(), this.#s.requestPhase(A.ROWS, "applyRowsUpdate");
3325
+ #ae() {
3326
+ this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#B(), this.#s.requestPhase(A.ROWS, "applyRowsUpdate");
3311
3327
  }
3312
- #X() {
3313
- this.#R.clear();
3328
+ #B() {
3329
+ this.#S.clear();
3314
3330
  const e = this.#o.getRowId;
3315
3331
  this._rows.forEach((i, o) => {
3316
- const n = this.#ae(i, e);
3317
- n !== void 0 && this.#R.set(n, { row: i, index: o });
3332
+ const n = this.#ce(i, e);
3333
+ n !== void 0 && this.#S.set(n, { row: i, index: o });
3318
3334
  });
3319
3335
  }
3320
- #ae(e, i) {
3336
+ #ce(e, i) {
3321
3337
  if (i)
3322
3338
  return i(e);
3323
3339
  const o = e;
3324
3340
  if ("id" in o && o.id != null) return String(o.id);
3325
3341
  if ("_id" in o && o._id != null) return String(o._id);
3326
3342
  }
3327
- #Ee(e, i) {
3328
- const o = this.#ae(e, i);
3343
+ #Se(e, i) {
3344
+ const o = this.#ce(e, i);
3329
3345
  if (o === void 0)
3330
3346
  throw new Error(
3331
3347
  '[tbw-grid] Cannot determine row ID. Configure getRowId in gridConfig or ensure rows have an "id" property.'
3332
3348
  );
3333
3349
  return o;
3334
3350
  }
3335
- #Se() {
3336
- Y(this), this.#t.merge(), this.#P();
3337
- }
3338
3351
  #Re() {
3339
- this.#t.merge(), this.#o.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, Re(this)) : (this._columns.forEach((i) => {
3352
+ Y(this), this.#i.merge(), this.#P();
3353
+ }
3354
+ #Ae() {
3355
+ this.#i.merge(), this.#o.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, Re(this)) : (this._columns.forEach((i) => {
3340
3356
  !i.__userResized && i.__autoSized && delete i.width;
3341
3357
  }), V(this));
3342
3358
  }
3343
- #Ae() {
3344
- Ne(this, this.#i), Ie(this, this.#i);
3359
+ #Te() {
3360
+ Ie(this, this.#e), Ne(this, this.#e);
3345
3361
  const e = !!this.#n.querySelector(".has-shell"), i = !!this.#n.querySelector(".tbw-tool-panel"), o = this.#n.querySelectorAll(".tbw-accordion-section").length;
3346
- this.#t.parseLightDomColumns(this), this.#t.merge(), this.#te(), qe(this, this.#i, this.#oe()), this.#t.markSourcesChanged(), this.#t.merge();
3362
+ this.#i.parseLightDomColumns(this), this.#i.merge(), this.#ie(), qe(this, this.#e, this.#ne()), this.#i.markSourcesChanged(), this.#i.merge();
3347
3363
  const n = st(this.#o?.shell), r = (this.#o?.shell?.toolPanels?.length ?? 0) > 0, s = this.#o?.shell?.toolPanels?.length ?? 0;
3348
3364
  if (e !== n || !i && r || i && s !== o) {
3349
- he(this.#i), this.#Z(), this.#W(), this.#ne(), this.#X();
3365
+ he(this.#e), this.#J(), this.#F(), this.#re(), this.#B();
3350
3366
  return;
3351
3367
  }
3352
- e && this.#Te(), this.#X(), this.#s.requestPhase(A.COLUMNS, "applyGridConfigUpdate");
3368
+ e && this.#xe(), this.#B(), this.#s.requestPhase(A.COLUMNS, "applyGridConfigUpdate");
3353
3369
  }
3354
- #Te() {
3370
+ #xe() {
3355
3371
  const e = this.#n.querySelector(".tbw-shell-header");
3356
3372
  if (!e) return;
3357
- const i = this.#o.shell?.header?.title ?? this.#i.lightDomTitle;
3373
+ const i = this.#o.shell?.header?.title ?? this.#e.lightDomTitle;
3358
3374
  let o = e.querySelector(".tbw-shell-title");
3359
3375
  i ? (o || (o = document.createElement("h2"), o.className = "tbw-shell-title", o.setAttribute("part", "shell-title"), e.insertBefore(o, e.firstChild)), o.textContent = i) : o && o.remove();
3360
3376
  }
3361
- #xe() {
3362
- if (this.#e) {
3363
- const e = this.#B.length > 0 ? this.#B : this._columns, i = e.filter((r) => !r.hidden), o = e.filter((r) => r.hidden), n = this.#e.processColumns([...i]);
3377
+ #He() {
3378
+ if (this.#t) {
3379
+ const e = this.#X.length > 0 ? this.#X : this._columns, i = e.filter((r) => !r.hidden), o = e.filter((r) => r.hidden), n = this.#t.processColumns([...i]);
3364
3380
  if (n !== i) {
3365
3381
  const r = new Set(n.map((l) => l.field));
3366
- !i.some((l) => r.has(l.field)) && n.length > 0 ? this._columns = [...n, ...o] : this._columns = this.#He(
3382
+ !i.some((l) => r.has(l.field)) && n.length > 0 ? this._columns = [...n, ...o] : this._columns = this.#Le(
3367
3383
  e,
3368
3384
  n,
3369
3385
  o
@@ -3372,7 +3388,7 @@ class k extends HTMLElement {
3372
3388
  this._columns = [...e];
3373
3389
  }
3374
3390
  }
3375
- #He(e, i, o) {
3391
+ #Le(e, i, o) {
3376
3392
  if (o.length === 0) return i;
3377
3393
  const n = /* @__PURE__ */ new Map();
3378
3394
  for (const a of i)
@@ -3387,12 +3403,12 @@ class k extends HTMLElement {
3387
3403
  }
3388
3404
  return l.push(...s), l;
3389
3405
  }
3390
- #Le() {
3406
+ #Pe() {
3391
3407
  Y(this);
3392
- const e = Array.isArray(this.#a) ? [...this.#a] : [], i = this.#e?.processRows(e) ?? e;
3393
- this._rows = i, this._virtualization.variableHeights && this.#Q();
3408
+ const e = Array.isArray(this.#a) ? [...this.#a] : [], i = this.#t?.processRows(e) ?? e;
3409
+ this._rows = i, this.#B(), this._virtualization.variableHeights && this.#Z();
3394
3410
  }
3395
- #Pe(e) {
3411
+ #ze(e) {
3396
3412
  const i = {
3397
3413
  ...ft,
3398
3414
  ...e.animation
@@ -3400,30 +3416,30 @@ class k extends HTMLElement {
3400
3416
  let n = 1;
3401
3417
  o === !1 || o === "off" ? n = 0 : (o === !0 || o === "on") && (n = 1), this.style.setProperty("--tbw-animation-duration", `${i.duration}ms`), this.style.setProperty("--tbw-animation-easing", i.easing ?? "ease-out"), this.style.setProperty("--tbw-animation-enabled", String(n)), this.dataset.animationMode = typeof o == "boolean" ? o ? "on" : "off" : o;
3402
3418
  }
3403
- #Y(e, i, o = this.__rowRenderEpoch) {
3404
- if (this.#z || (this.#z = (n, r, s) => this.#e?.renderRow(n, r, s) ?? !1), Mt(this, e, i, o, this.#z), this.#E.size > 0)
3419
+ #j(e, i, o = this.__rowRenderEpoch) {
3420
+ if (this.#z || (this.#z = (n, r, s) => this.#t?.renderRow(n, r, s) ?? !1), Mt(this, e, i, o, this.#z), this.#E.size > 0)
3405
3421
  for (const n of this.#E)
3406
- this.#j(n, !0);
3422
+ this.#K(n, !0);
3407
3423
  }
3408
- #ce = ct();
3409
- #de(e, i) {
3410
- dt(this.#ce, this.__rowsBodyEl, this._bodyEl, e, i);
3424
+ #de = ct();
3425
+ #he(e, i) {
3426
+ dt(this.#de, this.__rowsBodyEl, this._bodyEl, e, i);
3411
3427
  }
3412
- #ze() {
3413
- ut(this.#ce, this.__rowsBodyEl, this.#o, this.#i);
3428
+ #De() {
3429
+ ut(this.#de, this.__rowsBodyEl, this.#o, this.#e);
3414
3430
  }
3415
- #he() {
3431
+ #ue() {
3416
3432
  const e = this.querySelector(".tbw-grid-root");
3417
- e && (this.#M ? (this.#$ || (this.#$ = Kt(this.#o?.loadingRenderer)), Qt(e, this.#$)) : Zt(this.#$));
3433
+ e && (this.#M ? (this.#W || (this.#W = Kt(this.#o?.loadingRenderer)), Qt(e, this.#W)) : Zt(this.#W));
3418
3434
  }
3419
- #j(e, i) {
3420
- const o = this.#R.get(e);
3435
+ #K(e, i) {
3436
+ const o = this.#S.get(e);
3421
3437
  if (!o) return;
3422
3438
  const n = this.findRenderedRowElement?.(o.index);
3423
3439
  n && Jt(n, i);
3424
3440
  }
3425
- #ue(e, i, o) {
3426
- const n = this.#R.get(e);
3441
+ #fe(e, i, o) {
3442
+ const n = this.#S.get(e);
3427
3443
  if (!n) return;
3428
3444
  const r = this.findRenderedRowElement?.(n.index);
3429
3445
  if (!r) return;
@@ -3434,26 +3450,26 @@ class k extends HTMLElement {
3434
3450
  }
3435
3451
  #P() {
3436
3452
  if (this.isConnected && !(!this._headerRowEl || !this._bodyEl)) {
3437
- if (this.#t.parseLightDomColumns(this), this.#O) {
3453
+ if (this.#i.parseLightDomColumns(this), this.#O) {
3438
3454
  const e = this.#O;
3439
- this.#O = void 0, this.#t.merge();
3440
- const i = this.#e?.getAll() ?? [];
3441
- this.#t.applyState(e, i);
3455
+ this.#O = void 0, this.#i.merge();
3456
+ const i = this.#t?.getAll() ?? [];
3457
+ this.#i.applyState(e, i);
3442
3458
  }
3443
3459
  this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#s.requestPhase(A.FULL, "setup");
3444
3460
  }
3445
3461
  }
3446
- #De(e) {
3462
+ #Oe(e) {
3447
3463
  let i = 0, o = 0, n = 0, r = 0, s = 0;
3448
3464
  if (this.#g) {
3449
- const a = this._virtualization.container, c = this.#V;
3465
+ const a = this._virtualization.container, c = this.#G;
3450
3466
  i = c?.scrollLeft ?? 0, o = a?.scrollHeight ?? 0, n = c?.scrollWidth ?? 0, r = a?.clientHeight ?? 0, s = c?.clientWidth ?? 0;
3451
3467
  }
3452
- if (this.refreshVirtualWindow(!1) && this.#e?.onScrollRender(), this._virtualization.variableHeights && (this.#m && clearTimeout(this.#m), this.#m = window.setTimeout(() => {
3453
- this.#m = 0, this.#pe(this._virtualization.start, this._virtualization.end);
3468
+ if (this.refreshVirtualWindow(!1) && this.#t?.onScrollRender(), this._virtualization.variableHeights && (this.#m && clearTimeout(this.#m), this.#m = window.setTimeout(() => {
3469
+ this.#m = 0, this.#we(this._virtualization.start, this._virtualization.end);
3454
3470
  }, 100)), this.#g) {
3455
- const a = this.#J;
3456
- a.scrollTop = e, a.scrollLeft = i, a.scrollHeight = o, a.scrollWidth = n, a.clientHeight = r, a.clientWidth = s, this.#e?.onScroll(a);
3471
+ const a = this.#ee;
3472
+ a.scrollTop = e, a.scrollLeft = i, a.scrollHeight = o, a.scrollWidth = n, a.clientHeight = r, a.clientWidth = s, this.#t?.onScroll(a);
3457
3473
  }
3458
3474
  }
3459
3475
  findHeaderRow() {
@@ -3475,6 +3491,7 @@ class k extends HTMLElement {
3475
3491
  detail: {
3476
3492
  rowIndex: i,
3477
3493
  colIndex: o,
3494
+ column: s,
3478
3495
  field: l,
3479
3496
  value: a,
3480
3497
  row: r,
@@ -3489,11 +3506,12 @@ class k extends HTMLElement {
3489
3506
  row: r,
3490
3507
  rowIndex: i,
3491
3508
  colIndex: o,
3509
+ column: s,
3492
3510
  field: l,
3493
3511
  value: a,
3494
3512
  cellEl: n,
3495
3513
  originalEvent: e
3496
- }, f = this.#e?.onCellClick(h) ?? !1;
3514
+ }, f = this.#t?.onCellClick(h) ?? !1;
3497
3515
  return this.#L("cell-click", h), f;
3498
3516
  }
3499
3517
  _dispatchRowClick(e, i, o, n) {
@@ -3503,53 +3521,52 @@ class k extends HTMLElement {
3503
3521
  row: o,
3504
3522
  rowEl: n,
3505
3523
  originalEvent: e
3506
- }, s = this.#e?.onRowClick(r) ?? !1;
3524
+ }, s = this.#t?.onRowClick(r) ?? !1;
3507
3525
  return this.#L("row-click", r), s;
3508
3526
  }
3509
3527
  _dispatchHeaderClick(e, i, o) {
3510
- const n = this._columns[i];
3511
- if (!n) return !1;
3512
- const r = {
3513
- colIndex: i,
3514
- field: n.field,
3515
- column: n,
3528
+ if (!i) return !1;
3529
+ const n = {
3530
+ colIndex: this._columns.indexOf(i),
3531
+ field: i.field,
3532
+ column: i,
3516
3533
  headerEl: o,
3517
3534
  originalEvent: e
3518
3535
  };
3519
- return this.#e?.onHeaderClick(r) ?? !1;
3536
+ return this.#t?.onHeaderClick(n) ?? !1;
3520
3537
  }
3521
3538
  _dispatchKeyDown(e) {
3522
- return this.#e?.onKeyDown(e) ?? !1;
3539
+ return this.#t?.onKeyDown(e) ?? !1;
3523
3540
  }
3524
3541
  _getHorizontalScrollOffsets(e, i) {
3525
- return this.#e?.getHorizontalScrollOffsets(e, i) ?? { left: 0, right: 0 };
3542
+ return this.#t?.getHorizontalScrollOffsets(e, i) ?? { left: 0, right: 0 };
3526
3543
  }
3527
3544
  queryPlugins(e) {
3528
- return this.#e?.queryPlugins(e) ?? [];
3545
+ return this.#t?.queryPlugins(e) ?? [];
3529
3546
  }
3530
3547
  query(e, i) {
3531
- return this.#e?.queryPlugins({ type: e, context: i }) ?? [];
3548
+ return this.#t?.queryPlugins({ type: e, context: i }) ?? [];
3532
3549
  }
3533
3550
  _dispatchCellMouseDown(e) {
3534
- return this.#e?.onCellMouseDown(e) ?? !1;
3551
+ return this.#t?.onCellMouseDown(e) ?? !1;
3535
3552
  }
3536
3553
  _dispatchCellMouseMove(e) {
3537
- this.#e?.onCellMouseMove(e);
3554
+ this.#t?.onCellMouseMove(e);
3538
3555
  }
3539
3556
  _dispatchCellMouseUp(e) {
3540
- this.#e?.onCellMouseUp(e);
3557
+ this.#t?.onCellMouseUp(e);
3541
3558
  }
3542
3559
  _afterCellRender(e) {
3543
- this.#e?.afterCellRender(e);
3560
+ this.#t?.afterCellRender(e);
3544
3561
  }
3545
3562
  _hasAfterCellRenderHook() {
3546
- return this.#e?.hasAfterCellRenderHook() ?? !1;
3563
+ return this.#t?.hasAfterCellRenderHook() ?? !1;
3547
3564
  }
3548
3565
  _afterRowRender(e) {
3549
- this.#e?.afterRowRender(e);
3566
+ this.#t?.afterRowRender(e);
3550
3567
  }
3551
3568
  _hasAfterRowRenderHook() {
3552
- return this.#e?.hasAfterRowRenderHook() ?? !1;
3569
+ return this.#t?.hasAfterRowRenderHook() ?? !1;
3553
3570
  }
3554
3571
  async ready() {
3555
3572
  return this.#d;
@@ -3561,13 +3578,16 @@ class k extends HTMLElement {
3561
3578
  return Object.freeze({ ...this.#o || {} });
3562
3579
  }
3563
3580
  getRowId(e) {
3564
- return this.#Ee(e, this.#o.getRowId);
3581
+ return this.#Se(e, this.#o.getRowId);
3565
3582
  }
3566
3583
  getRow(e) {
3567
- return this.#R.get(e)?.row;
3584
+ return this.#S.get(e)?.row;
3585
+ }
3586
+ _getRowEntry(e) {
3587
+ return this.#S.get(e);
3568
3588
  }
3569
3589
  updateRow(e, i, o = "api") {
3570
- const n = this.#R.get(e);
3590
+ const n = this.#S.get(e);
3571
3591
  if (!n)
3572
3592
  throw new Error(
3573
3593
  `[tbw-grid] Row with ID "${e}" not found. Ensure the row exists and getRowId is correctly configured.`
@@ -3593,7 +3613,7 @@ class k extends HTMLElement {
3593
3613
  updateRows(e, i = "api") {
3594
3614
  let o = !1;
3595
3615
  for (const { id: n, changes: r } of e) {
3596
- const s = this.#R.get(n);
3616
+ const s = this.#S.get(n);
3597
3617
  if (!s)
3598
3618
  throw new Error(
3599
3619
  `[tbw-grid] Row with ID "${n}" not found. Ensure the row exists and getRowId is correctly configured.`
@@ -3625,50 +3645,50 @@ class k extends HTMLElement {
3625
3645
  return ai(this, e, i);
3626
3646
  }
3627
3647
  setColumnVisible(e, i) {
3628
- const o = this.#t.setColumnVisible(e, i);
3648
+ const o = this.#i.setColumnVisible(e, i);
3629
3649
  return o && this.requestStateChange(), o;
3630
3650
  }
3631
3651
  toggleColumnVisibility(e) {
3632
- const i = this.#t.toggleColumnVisibility(e);
3652
+ const i = this.#i.toggleColumnVisibility(e);
3633
3653
  return i && this.requestStateChange(), i;
3634
3654
  }
3635
3655
  isColumnVisible(e) {
3636
- return this.#t.isColumnVisible(e);
3656
+ return this.#i.isColumnVisible(e);
3637
3657
  }
3638
3658
  showAllColumns() {
3639
- this.#t.showAllColumns(), this.requestStateChange();
3659
+ this.#i.showAllColumns(), this.requestStateChange();
3640
3660
  }
3641
3661
  getAllColumns() {
3642
- return this.#t.getAllColumns();
3662
+ return this.#i.getAllColumns();
3643
3663
  }
3644
3664
  setColumnOrder(e) {
3645
- this.#t.setColumnOrder(e), this.requestStateChange();
3665
+ this.#i.setColumnOrder(e), this.requestStateChange();
3646
3666
  }
3647
3667
  getColumnOrder() {
3648
- return this.#t.getColumnOrder();
3668
+ return this.#i.getColumnOrder();
3649
3669
  }
3650
3670
  getColumnState() {
3651
- const e = this.#e?.getAll() ?? [];
3652
- return this.#t.collectState(e);
3671
+ const e = this.#t?.getAll() ?? [];
3672
+ return this.#i.collectState(e);
3653
3673
  }
3654
3674
  set columnState(e) {
3655
- e && (this.#O = e, this.#t.initialColumnState = e, this.#u && this.#Oe(e));
3675
+ e && (this.#O = e, this.#i.initialColumnState = e, this.#u && this.#Me(e));
3656
3676
  }
3657
3677
  get columnState() {
3658
3678
  return this.getColumnState();
3659
3679
  }
3660
- #Oe(e) {
3661
- const i = this.#e?.getAll() ?? [];
3662
- this.#t.applyState(e, i), this.#P();
3680
+ #Me(e) {
3681
+ const i = this.#t?.getAll() ?? [];
3682
+ this.#i.applyState(e, i), this.#P();
3663
3683
  }
3664
3684
  requestStateChange() {
3665
- const e = this.#e?.getAll() ?? [];
3666
- this.#t.requestStateChange(e);
3685
+ const e = this.#t?.getAll() ?? [];
3686
+ this.#i.requestStateChange(e);
3667
3687
  }
3668
3688
  resetColumnState() {
3669
3689
  this.#O = void 0, this.__originalOrder = [];
3670
- const e = this.#e?.getAll() ?? [];
3671
- this.#t.resetState(e), this.#t.merge(), this.#P();
3690
+ const e = this.#t?.getAll() ?? [];
3691
+ this.#i.resetState(e), this.#i.merge(), this.#P();
3672
3692
  }
3673
3693
  get isToolPanelOpen() {
3674
3694
  return this.#c.isPanelOpen;
@@ -3695,10 +3715,10 @@ class k extends HTMLElement {
3695
3715
  return this.#c.getToolPanels();
3696
3716
  }
3697
3717
  registerToolPanel(e) {
3698
- this.#i.apiToolPanelIds.add(e.id), this.#c.registerToolPanel(e);
3718
+ this.#e.apiToolPanelIds.add(e.id), this.#c.registerToolPanel(e);
3699
3719
  }
3700
3720
  unregisterToolPanel(e) {
3701
- this.#i.apiToolPanelIds.delete(e), this.#c.unregisterToolPanel(e);
3721
+ this.#e.apiToolPanelIds.delete(e), this.#c.unregisterToolPanel(e);
3702
3722
  }
3703
3723
  getHeaderContents() {
3704
3724
  return this.#c.getHeaderContents();
@@ -3718,71 +3738,71 @@ class k extends HTMLElement {
3718
3738
  unregisterToolbarContent(e) {
3719
3739
  this.#c.unregisterToolbarContent(e);
3720
3740
  }
3721
- #K = !1;
3741
+ #Q = !1;
3722
3742
  refreshShellHeader() {
3723
- this.#K || (this.#K = !0, queueMicrotask(() => {
3724
- this.#K = !1, this.isConnected && (this.#k(), this.#t.markSourcesChanged(), this.#t.merge(), he(this.#i), this.#Z(), this.#W(), this.#Me());
3743
+ this.#Q || (this.#Q = !0, queueMicrotask(() => {
3744
+ this.#Q = !1, this.isConnected && (this.#k(), this.#i.markSourcesChanged(), this.#i.merge(), he(this.#e), this.#J(), this.#F(), this.#ke());
3725
3745
  }));
3726
3746
  }
3727
- #Me() {
3747
+ #ke() {
3728
3748
  const i = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
3729
3749
  if (this._headerRowEl = i?.querySelector(".header-row"), this._virtualization.totalHeightEl = i?.querySelector(".faux-vscroll-spacer"), this._virtualization.viewportEl = i?.querySelector(".rows-viewport"), this._bodyEl = i?.querySelector(".rows"), this.__rowsBodyEl = i?.querySelector(".rows-body"), this.#c.isInitialized) {
3730
- ge(this.#n, this.#i), de(this.#n, this.#o?.shell, this.#i);
3750
+ ge(this.#n, this.#e), de(this.#n, this.#o?.shell, this.#e);
3731
3751
  const o = this.#o?.shell?.toolPanel?.defaultOpen;
3732
- o && this.#i.toolPanels.has(o) && (this.openToolPanel(), this.#i.expandedSections.add(o));
3752
+ o && this.#e.toolPanels.has(o) && (this.openToolPanel(), this.#e.expandedSections.add(o));
3733
3753
  }
3734
- this._resizeController = Me(this), this.#G(i), this.#s.requestPhase(A.COLUMNS, "shellRefresh");
3754
+ this._resizeController = Me(this), this.#Y(i), this.#s.requestPhase(A.COLUMNS, "shellRefresh");
3735
3755
  }
3736
3756
  #A = /* @__PURE__ */ new Map();
3737
3757
  registerStyles(e, i) {
3738
3758
  let o = this.#A.get(e);
3739
- o || (o = new CSSStyleSheet(), this.#A.set(e, o)), o.replaceSync(i), this.#fe();
3759
+ o || (o = new CSSStyleSheet(), this.#A.set(e, o)), o.replaceSync(i), this.#ge();
3740
3760
  }
3741
3761
  unregisterStyles(e) {
3742
- this.#A.delete(e) && this.#fe();
3762
+ this.#A.delete(e) && this.#ge();
3743
3763
  }
3744
3764
  getRegisteredStyles() {
3745
3765
  return Array.from(this.#A.keys());
3746
3766
  }
3747
- #fe() {
3767
+ #ge() {
3748
3768
  const e = Array.from(this.#A.values()), i = document.adoptedStyleSheets.filter(
3749
3769
  (o) => !Array.from(this.#A.values()).includes(o)
3750
3770
  );
3751
3771
  document.adoptedStyleSheets = [...i, ...e];
3752
3772
  }
3753
3773
  #k() {
3754
- Ne(this, this.#i), Ie(this, this.#i), qe(this, this.#i, this.#oe());
3774
+ Ie(this, this.#e), Ne(this, this.#e), qe(this, this.#e, this.#ne());
3755
3775
  }
3756
- #ge() {
3776
+ #pe() {
3757
3777
  const e = this.#n.querySelector(".tbw-shell-header");
3758
3778
  if (!e) return;
3759
- he(this.#i);
3779
+ he(this.#e);
3760
3780
  const i = ui(
3761
3781
  this.#o.shell,
3762
- this.#i,
3782
+ this.#e,
3763
3783
  this.#o.icons?.toolPanel
3764
3784
  ), o = document.createElement("div");
3765
3785
  o.innerHTML = i;
3766
3786
  const n = o.firstElementChild;
3767
- n && (e.replaceWith(n), this.#we(), de(this.#n, this.#o?.shell, this.#i));
3787
+ n && (e.replaceWith(n), this.#be(), de(this.#n, this.#o?.shell, this.#e));
3768
3788
  }
3769
- #ke() {
3789
+ #Ie() {
3770
3790
  const e = () => {
3771
- const o = this.#i.lightDomTitle, n = this.#i.hasToolButtonsContainer;
3791
+ const o = this.#e.lightDomTitle, n = this.#e.hasToolButtonsContainer;
3772
3792
  this.#k();
3773
- const r = this.#i.lightDomTitle, s = this.#i.hasToolButtonsContainer;
3774
- (r && !o || s && !n) && (this.#t.markSourcesChanged(), this.#t.merge(), this.#ge());
3793
+ const r = this.#e.lightDomTitle, s = this.#e.hasToolButtonsContainer;
3794
+ (r && !o || s && !n) && (this.#i.markSourcesChanged(), this.#i.merge(), this.#pe());
3775
3795
  }, i = () => {
3776
3796
  this.__lightDomColumnsCache = void 0, this.#P();
3777
3797
  };
3778
- this.#t.registerLightDomHandler("tbw-grid-header", e), this.#t.registerLightDomHandler("tbw-grid-tool-buttons", e), this.#t.registerLightDomHandler("tbw-grid-tool-panel", e), this.#t.registerLightDomHandler("tbw-grid-column", i), this.#t.registerLightDomHandler("tbw-grid-detail", i), this.#t.observeLightDOM(this);
3798
+ this.#i.registerLightDomHandler("tbw-grid-header", e), this.#i.registerLightDomHandler("tbw-grid-tool-buttons", e), this.#i.registerLightDomHandler("tbw-grid-tool-panel", e), this.#i.registerLightDomHandler("tbw-grid-column", i), this.#i.registerLightDomHandler("tbw-grid-detail", i), this.#i.observeLightDOM(this);
3779
3799
  }
3780
3800
  refreshColumns() {
3781
- this.__lightDomColumnsCache = void 0, Y(this), this.#t.parseLightDomColumns(this);
3782
- const e = this.#i.lightDomTitle, i = this.#i.hasToolButtonsContainer;
3801
+ this.__lightDomColumnsCache = void 0, Y(this), this.#i.parseLightDomColumns(this);
3802
+ const e = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
3783
3803
  this.#k();
3784
- const o = this.#i.lightDomTitle, n = this.#i.hasToolButtonsContainer;
3785
- (o && !e || n && !i) && (this.#t.markSourcesChanged(), this.#t.merge(), this.#ge()), this.#s.requestPhase(A.COLUMNS, "refreshColumns");
3804
+ const o = this.#e.lightDomTitle, n = this.#e.hasToolButtonsContainer;
3805
+ (o && !e || n && !i) && (this.#i.markSourcesChanged(), this.#i.merge(), this.#pe()), this.#s.requestPhase(A.COLUMNS, "refreshColumns");
3786
3806
  }
3787
3807
  #Ne() {
3788
3808
  const e = this._virtualization.container, i = this._virtualization.viewportEl ?? e;
@@ -3800,18 +3820,18 @@ class k extends HTMLElement {
3800
3820
  n = o.cachedFauxHeight, r = o.cachedViewportHeight, s = o.cachedScrollAreaHeight || n;
3801
3821
  const l = s - r, a = Math.max(0, n - s);
3802
3822
  let c, h = 0;
3803
- return o.variableHeights && o.positionCache ? c = Wi(o.positionCache) : (c = e * o.rowHeight, h = this.#e?.getExtraHeight() ?? 0), c + l + h + a;
3823
+ return o.variableHeights && o.positionCache ? c = Fi(o.positionCache) : (c = e * o.rowHeight, h = this.#t?.getExtraHeight() ?? 0), c + l + h + a;
3804
3824
  }
3805
- #Q() {
3825
+ #Z() {
3806
3826
  if (!this._virtualization.variableHeights) return;
3807
3827
  const e = this._rows, i = this._virtualization.rowHeight || 28, o = this.#o.rowHeight, n = this.#o.getRowId, r = n ? (l) => n(l) : void 0;
3808
- this._virtualization.positionCache = $i(
3828
+ this._virtualization.positionCache = Wi(
3809
3829
  e,
3810
3830
  this._virtualization.heightCache,
3811
3831
  i,
3812
3832
  { rowId: r },
3813
3833
  (l, a) => {
3814
- const c = this.#e?.getRowHeight?.(l, a);
3834
+ const c = this.#t?.getRowHeight?.(l, a);
3815
3835
  if (c !== void 0) return c;
3816
3836
  if (o) {
3817
3837
  const h = o(l, a);
@@ -3819,11 +3839,11 @@ class k extends HTMLElement {
3819
3839
  }
3820
3840
  }
3821
3841
  );
3822
- const s = Bi(
3842
+ const s = Gi(
3823
3843
  this._virtualization.positionCache,
3824
3844
  e,
3825
3845
  i,
3826
- (l, a) => this.#e?.getRowHeight?.(l, a)
3846
+ (l, a) => this.#t?.getRowHeight?.(l, a)
3827
3847
  );
3828
3848
  this._virtualization.measuredCount = s.measuredCount, s.measuredCount > 0 && (this._virtualization.averageHeight = s.averageHeight);
3829
3849
  }
@@ -3831,16 +3851,16 @@ class k extends HTMLElement {
3831
3851
  if (!this._virtualization.variableHeights || !this._virtualization.positionCache || e < 0 || e >= this._rows.length) return;
3832
3852
  const o = this._virtualization.positionCache, n = this._rows[e];
3833
3853
  let r = i;
3834
- r === void 0 && (r = this.#e?.getRowHeight?.(n, e)), r === void 0 && (r = this._virtualization.rowHeight);
3854
+ r === void 0 && (r = this.#t?.getRowHeight?.(n, e)), r === void 0 && (r = this._virtualization.rowHeight);
3835
3855
  const s = o[e];
3836
3856
  if (!(!s || Math.abs(s.height - r) < 1) && (me(o, e, r), this._virtualization.totalHeightEl)) {
3837
3857
  const l = this.#T(this._rows.length);
3838
3858
  this._virtualization.totalHeightEl.style.height = `${l}px`;
3839
3859
  }
3840
3860
  }
3841
- #pe(e, i) {
3861
+ #we(e, i) {
3842
3862
  if (!this._virtualization.variableHeights || !this._virtualization.positionCache || !this._bodyEl) return;
3843
- const o = this._bodyEl.querySelectorAll(".data-grid-row"), n = this.#o.getRowId, r = Vi(
3863
+ const o = this._bodyEl.querySelectorAll(".data-grid-row"), n = this.#o.getRowId, r = Bi(
3844
3864
  {
3845
3865
  positionCache: this._virtualization.positionCache,
3846
3866
  heightCache: this._virtualization.heightCache,
@@ -3848,7 +3868,7 @@ class k extends HTMLElement {
3848
3868
  defaultHeight: this._virtualization.rowHeight,
3849
3869
  start: e,
3850
3870
  end: i,
3851
- getPluginHeight: (s, l) => this.#e?.getRowHeight?.(s, l),
3871
+ getPluginHeight: (s, l) => this.#t?.getRowHeight?.(s, l),
3852
3872
  getRowId: n ? (s) => n(s) : void 0
3853
3873
  },
3854
3874
  o
@@ -3862,9 +3882,9 @@ class k extends HTMLElement {
3862
3882
  if (!this._bodyEl) return !1;
3863
3883
  const o = this._rows.length;
3864
3884
  if (!this._virtualization.enabled)
3865
- return this.#Y(0, o), i || this.#e?.afterRender(), !0;
3885
+ return this.#j(0, o), i || this.#t?.afterRender(), !0;
3866
3886
  if (this._rows.length <= this._virtualization.bypassThreshold)
3867
- return this._virtualization.start = 0, this._virtualization.end = o, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#Y(0, o, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), e && this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#T(o, !0)}px`), this.#de(o, this._visibleColumns.length), i || this.#e?.afterRender(), !0;
3887
+ return this._virtualization.start = 0, this._virtualization.end = o, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#j(0, o, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), e && this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#T(o, !0)}px`), this.#he(o, this._visibleColumns.length), i || this.#t?.afterRender(), !0;
3868
3888
  const n = this._virtualization.container ?? this, r = this._virtualization.viewportEl ?? n, s = e ? this._virtualization.cachedViewportHeight = r.clientHeight : this._virtualization.cachedViewportHeight || (this._virtualization.cachedViewportHeight = r.clientHeight), l = this._virtualization.rowHeight, a = n.scrollTop;
3869
3889
  let c;
3870
3890
  const h = this._virtualization.positionCache;
@@ -3875,13 +3895,13 @@ class k extends HTMLElement {
3875
3895
  let b = 0;
3876
3896
  const _ = 10;
3877
3897
  for (; b < _; ) {
3878
- const R = this.#e?.getExtraHeightBefore?.(c) ?? 0, E = Math.floor((a - R) / l);
3898
+ const R = this.#t?.getExtraHeightBefore?.(c) ?? 0, E = Math.floor((a - R) / l);
3879
3899
  if (E >= c || E < 0) break;
3880
3900
  c = E, b++;
3881
3901
  }
3882
3902
  }
3883
3903
  c = c - c % 2, c < 0 && (c = 0);
3884
- const f = this.#e?.adjustVirtualStart(c, a, l);
3904
+ const f = this.#t?.adjustVirtualStart(c, a, l);
3885
3905
  f !== void 0 && f < c && (c = f, c = c - c % 2, c < 0 && (c = 0));
3886
3906
  let p;
3887
3907
  if (this._virtualization.variableHeights && h && h.length > 0) {
@@ -3915,45 +3935,50 @@ class k extends HTMLElement {
3915
3935
  if (this._virtualization.variableHeights && h && h[c])
3916
3936
  w = h[c].offset;
3917
3937
  else {
3918
- const b = this.#e?.getExtraHeightBefore?.(c) ?? 0;
3938
+ const b = this.#t?.getExtraHeightBefore?.(c) ?? 0;
3919
3939
  w = c * l + b;
3920
3940
  }
3921
3941
  const v = -(a - w);
3922
- return this._bodyEl.style.transform = `translateY(${v}px)`, this.#Y(c, p, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), e && this._virtualization.variableHeights && this.#pe(c, p), this.#de(o, this._visibleColumns.length), e && !i && (this.#e?.afterRender(), queueMicrotask(() => {
3942
+ return this._bodyEl.style.transform = `translateY(${v}px)`, this.#j(c, p, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), e && this._virtualization.variableHeights && this.#we(c, p), this.#he(o, this._visibleColumns.length), e && !i && (this.#t?.afterRender(), queueMicrotask(() => {
3923
3943
  if (!this._virtualization.totalHeightEl) return;
3924
3944
  const b = this.#T(o);
3925
3945
  this._virtualization.cachedFauxHeight === 0 && this._virtualization.cachedViewportHeight > 0 || (this._virtualization.totalHeightEl.style.height = `${b}px`);
3926
3946
  })), !0;
3927
3947
  }
3928
- #Z() {
3929
- this.#k(), this.#t.markSourcesChanged(), this.#t.merge();
3948
+ #J() {
3949
+ this.#k(), this.#i.markSourcesChanged(), this.#i.merge();
3930
3950
  const e = this.#o?.shell;
3931
- vi(
3951
+ Ci(
3932
3952
  this.#n,
3933
3953
  e,
3934
- { isPanelOpen: this.#i.isPanelOpen, expandedSections: this.#i.expandedSections },
3954
+ { isPanelOpen: this.#e.isPanelOpen, expandedSections: this.#e.expandedSections },
3935
3955
  this.#o?.icons
3936
- ) && (this.#we(), this.#c.setInitialized(!0));
3956
+ ) && (this.#be(), this.#c.setInitialized(!0));
3937
3957
  }
3938
- #we() {
3939
- fi(this.#n, this.#o?.shell, this.#i, {
3958
+ #be() {
3959
+ fi(this.#n, this.#o?.shell, this.#e, {
3940
3960
  onPanelToggle: () => this.toggleToolPanel(),
3941
3961
  onSectionToggle: (e) => this.toggleToolPanelSection(e)
3942
- }), this.#q?.(), this.#q = gi(this.#n, this.#o?.shell, (e) => {
3962
+ }), this.#q?.(), this.#q = pi(this.#n, this.#o?.shell, (e) => {
3943
3963
  this.style.setProperty("--tbw-tool-panel-width", `${e}px`);
3944
- });
3964
+ }), this.#$?.(), this.#$ = gi(
3965
+ this,
3966
+ this.#o?.shell,
3967
+ this.#e,
3968
+ () => this.closeToolPanel()
3969
+ );
3945
3970
  }
3946
3971
  }
3947
3972
  customElements.get(k.tagName) || customElements.define(k.tagName, k);
3948
3973
  globalThis.DataGridElement = k;
3949
- const so = {
3974
+ const lo = {
3950
3975
  CAN_MOVE_COLUMN: "canMoveColumn",
3951
3976
  GET_CONTEXT_MENU_ITEMS: "getContextMenuItems"
3952
3977
  };
3953
- class lo {
3978
+ class ao {
3954
3979
  static dependencies;
3955
3980
  static manifest;
3956
- version = "1.16.1";
3981
+ version = "1.18.0";
3957
3982
  styles;
3958
3983
  cellRenderers;
3959
3984
  headerRenderers;
@@ -4092,7 +4117,7 @@ const H = {
4092
4117
  GROUP_KEY: "data-group-key",
4093
4118
  TREE_LEVEL: "data-tree-level",
4094
4119
  STICKY: "data-sticky"
4095
- }, ao = {
4120
+ }, co = {
4096
4121
  ROOT: `.${H.ROOT}`,
4097
4122
  HEADER: `.${H.HEADER}`,
4098
4123
  HEADER_ROW: `.${H.HEADER_ROW}`,
@@ -4107,7 +4132,7 @@ const H = {
4107
4132
  CELL_AT: (t, e) => `.${H.DATA_ROW}[${ee.ROW_INDEX}="${t}"] .${H.DATA_CELL}[${ee.COL_INDEX}="${e}"]`,
4108
4133
  SELECTED_ROWS: `.${H.DATA_ROW}.${H.SELECTED}`,
4109
4134
  EDITING_CELL: `.${H.DATA_CELL}.${H.EDITING}`
4110
- }, co = {
4135
+ }, ho = {
4111
4136
  COLOR_BG: "--tbw-color-bg",
4112
4137
  COLOR_FG: "--tbw-color-fg",
4113
4138
  COLOR_FG_MUTED: "--tbw-color-fg-muted",
@@ -4126,14 +4151,14 @@ const H = {
4126
4151
  BORDER_RADIUS: "--tbw-border-radius",
4127
4152
  FOCUS_OUTLINE: "--tbw-focus-outline"
4128
4153
  };
4129
- function ho(t) {
4154
+ function uo(t) {
4130
4155
  const e = document.createElement("tbw-grid");
4131
4156
  return t && (e.gridConfig = t), e;
4132
4157
  }
4133
- function uo(t, e = document) {
4158
+ function fo(t, e = document) {
4134
4159
  return e.querySelector(t);
4135
4160
  }
4136
- const fo = {
4161
+ const go = {
4137
4162
  CELL_CHANGE: "cell-change",
4138
4163
  CELL_COMMIT: "cell-commit",
4139
4164
  ROW_COMMIT: "row-commit",
@@ -4148,7 +4173,7 @@ const fo = {
4148
4173
  CELL_ACTIVATE: "cell-activate",
4149
4174
  GROUP_TOGGLE: "group-toggle",
4150
4175
  COLUMN_STATE_CHANGE: "column-state-change"
4151
- }, go = {
4176
+ }, po = {
4152
4177
  SELECTION_CHANGE: "selection-change",
4153
4178
  TREE_EXPAND: "tree-expand",
4154
4179
  FILTER_CHANGE: "filter-change",
@@ -4207,50 +4232,50 @@ const fo = {
4207
4232
  first: (t) => t[0] ?? 0,
4208
4233
  last: (t) => t[t.length - 1] ?? 0
4209
4234
  };
4210
- function io(t) {
4235
+ function oo(t) {
4211
4236
  return Be[t] ?? Be.sum;
4212
4237
  }
4213
- function po(t, e) {
4214
- return io(t)(e);
4238
+ function wo(t, e) {
4239
+ return oo(t)(e);
4215
4240
  }
4216
- const wo = O.register.bind(O), bo = O.unregister.bind(O), mo = O.get.bind(O), vo = O.run.bind(O), Co = O.list.bind(O);
4241
+ const bo = O.register.bind(O), mo = O.unregister.bind(O), vo = O.get.bind(O), Co = O.run.bind(O), yo = O.list.bind(O);
4217
4242
  export {
4218
- lo as BaseGridPlugin,
4243
+ ao as BaseGridPlugin,
4219
4244
  ft as DEFAULT_ANIMATION_CONFIG,
4220
4245
  M as DEFAULT_GRID_ICONS,
4221
- fo as DGEvents,
4246
+ go as DGEvents,
4222
4247
  k as DataGridElement,
4223
4248
  Je as F,
4224
4249
  G as FitModeEnum,
4225
- co as GridCSSVars,
4250
+ ho as GridCSSVars,
4226
4251
  H as GridClasses,
4227
4252
  ee as GridDataAttrs,
4228
4253
  k as GridElement,
4229
- ao as GridSelectors,
4230
- so as PLUGIN_QUERIES,
4231
- go as PluginEvents,
4254
+ co as GridSelectors,
4255
+ lo as PLUGIN_QUERIES,
4256
+ po as PluginEvents,
4232
4257
  ne as PluginManager,
4233
4258
  A as RenderPhase,
4234
4259
  Xe as a,
4235
4260
  O as aggregatorRegistry,
4236
4261
  W as b,
4237
4262
  Vt as builtInSort,
4238
- no as c,
4239
- ho as createGrid,
4263
+ ro as c,
4264
+ uo as createGrid,
4240
4265
  Ke as d,
4241
4266
  Ut as defaultComparator,
4242
4267
  $ as e,
4243
4268
  Ce as f,
4244
4269
  zt as g,
4245
- mo as getAggregator,
4246
- io as getValueAggregator,
4247
- Co as listAggregators,
4248
- uo as queryGrid,
4249
- oo as r,
4250
- wo as registerAggregator,
4251
- vo as runAggregator,
4252
- po as runValueAggregator,
4253
- ro as s,
4254
- bo as unregisterAggregator
4270
+ vo as getAggregator,
4271
+ oo as getValueAggregator,
4272
+ yo as listAggregators,
4273
+ fo as queryGrid,
4274
+ no as r,
4275
+ bo as registerAggregator,
4276
+ Co as runAggregator,
4277
+ wo as runValueAggregator,
4278
+ so as s,
4279
+ mo as unregisterAggregator
4255
4280
  };
4256
4281
  //# sourceMappingURL=index.js.map