@toolbox-web/grid 1.15.0 → 1.16.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 (50) hide show
  1. package/all.js +33 -11
  2. package/all.js.map +1 -1
  3. package/index.js +877 -865
  4. package/index.js.map +1 -1
  5. package/lib/core/internal/columns.d.ts +0 -5
  6. package/lib/core/internal/columns.d.ts.map +1 -1
  7. package/lib/core/internal/rows.d.ts.map +1 -1
  8. package/lib/core/types.d.ts +12 -0
  9. package/lib/core/types.d.ts.map +1 -1
  10. package/lib/plugins/clipboard/index.js.map +1 -1
  11. package/lib/plugins/column-virtualization/index.js.map +1 -1
  12. package/lib/plugins/context-menu/index.js +59 -49
  13. package/lib/plugins/context-menu/index.js.map +1 -1
  14. package/lib/plugins/context-menu/menu.d.ts.map +1 -1
  15. package/lib/plugins/context-menu/types.d.ts +4 -4
  16. package/lib/plugins/context-menu/types.d.ts.map +1 -1
  17. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  18. package/lib/plugins/editing/index.js +228 -216
  19. package/lib/plugins/editing/index.js.map +1 -1
  20. package/lib/plugins/export/index.js.map +1 -1
  21. package/lib/plugins/filtering/filter-model.d.ts.map +1 -1
  22. package/lib/plugins/filtering/index.js +4 -5
  23. package/lib/plugins/filtering/index.js.map +1 -1
  24. package/lib/plugins/grouping-columns/index.js.map +1 -1
  25. package/lib/plugins/grouping-rows/index.js.map +1 -1
  26. package/lib/plugins/master-detail/index.js.map +1 -1
  27. package/lib/plugins/multi-sort/index.js.map +1 -1
  28. package/lib/plugins/pinned-columns/index.js.map +1 -1
  29. package/lib/plugins/pinned-rows/index.js.map +1 -1
  30. package/lib/plugins/pivot/index.js.map +1 -1
  31. package/lib/plugins/print/index.js.map +1 -1
  32. package/lib/plugins/reorder/index.js.map +1 -1
  33. package/lib/plugins/responsive/index.js.map +1 -1
  34. package/lib/plugins/row-reorder/index.js.map +1 -1
  35. package/lib/plugins/selection/index.js.map +1 -1
  36. package/lib/plugins/server-side/index.js.map +1 -1
  37. package/lib/plugins/tree/index.js.map +1 -1
  38. package/lib/plugins/undo-redo/index.js.map +1 -1
  39. package/lib/plugins/visibility/index.js.map +1 -1
  40. package/package.json +1 -1
  41. package/umd/grid.all.umd.js +26 -26
  42. package/umd/grid.all.umd.js.map +1 -1
  43. package/umd/grid.umd.js +21 -21
  44. package/umd/grid.umd.js.map +1 -1
  45. package/umd/plugins/context-menu.umd.js +1 -1
  46. package/umd/plugins/context-menu.umd.js.map +1 -1
  47. package/umd/plugins/editing.umd.js +1 -1
  48. package/umd/plugins/editing.umd.js.map +1 -1
  49. package/umd/plugins/filtering.umd.js +1 -1
  50. package/umd/plugins/filtering.umd.js.map +1 -1
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- function lt() {
1
+ function ct() {
2
2
  return {
3
3
  rowCount: -1,
4
4
  colCount: -1,
@@ -6,32 +6,32 @@ function lt() {
6
6
  ariaDescribedBy: void 0
7
7
  };
8
8
  }
9
- function at(t, e, i, o, n) {
9
+ function dt(t, e, i, o, n) {
10
10
  if (o === t.rowCount && n === t.colCount)
11
11
  return !1;
12
12
  const r = t.rowCount;
13
13
  return t.rowCount = o, t.colCount = n, e && (e.setAttribute("aria-rowcount", String(o)), e.setAttribute("aria-colcount", String(n))), o !== r && i && (o > 0 ? i.setAttribute("role", "rowgroup") : i.removeAttribute("role")), !0;
14
14
  }
15
- function ct(t, e) {
15
+ function ht(t, e) {
16
16
  const i = t?.gridAriaLabel;
17
17
  return i || (t?.shell?.header?.title ?? e?.lightDomTitle ?? void 0);
18
18
  }
19
- function dt(t, e, i, o) {
19
+ function ut(t, e, i, o) {
20
20
  if (!e) return !1;
21
21
  let n = !1;
22
- const r = ct(i, o);
22
+ const r = ht(i, o);
23
23
  r !== t.ariaLabel && (t.ariaLabel = r, r ? e.setAttribute("aria-label", r) : e.removeAttribute("aria-label"), n = !0);
24
24
  const s = i?.gridAriaDescribedBy;
25
25
  return s !== t.ariaDescribedBy && (t.ariaDescribedBy = s, s ? e.setAttribute("aria-describedby", s) : e.removeAttribute("aria-describedby"), n = !0), n;
26
26
  }
27
- const B = {
27
+ const G = {
28
28
  STRETCH: "stretch",
29
29
  FIXED: "fixed"
30
- }, ht = {
30
+ }, ft = {
31
31
  mode: "reduced-motion",
32
32
  duration: 200,
33
33
  easing: "ease-out"
34
- }, _e = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', M = {
34
+ }, Ee = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', M = {
35
35
  expand: "▶",
36
36
  collapse: "▼",
37
37
  sortAsc: "▲",
@@ -40,48 +40,48 @@ const B = {
40
40
  submenuArrow: "▶",
41
41
  dragHandle: "⋮⋮",
42
42
  toolPanel: "☰",
43
- filter: _e,
44
- filterActive: _e,
43
+ filter: Ee,
44
+ filterActive: Ee,
45
45
  print: "🖨️"
46
46
  };
47
- function ut(t) {
47
+ function gt(t) {
48
48
  return Array.from(t.querySelectorAll("tbw-grid-column")).map((i) => {
49
49
  const o = i.getAttribute("field") || "";
50
50
  if (!o) return null;
51
- const n = i.getAttribute("type") || void 0, s = n && (/* @__PURE__ */ new Set(["number", "string", "date", "boolean", "select"])).has(n) ? n : void 0, l = i.getAttribute("header") || void 0, a = i.hasAttribute("sortable"), c = i.hasAttribute("editable"), d = { field: o, type: s, header: l, sortable: a, editable: c }, f = i.getAttribute("width");
51
+ const n = i.getAttribute("type") || void 0, s = n && (/* @__PURE__ */ new Set(["number", "string", "date", "boolean", "select"])).has(n) ? n : void 0, l = i.getAttribute("header") || void 0, a = i.hasAttribute("sortable"), c = i.hasAttribute("editable"), h = { field: o, type: s, header: l, sortable: a, editable: c }, f = i.getAttribute("width");
52
52
  if (f) {
53
- const b = parseFloat(f);
54
- !isNaN(b) && /^\d+(\.\d+)?$/.test(f.trim()) ? d.width = b : d.width = f;
53
+ const m = parseFloat(f);
54
+ !isNaN(m) && /^\d+(\.\d+)?$/.test(f.trim()) ? h.width = m : h.width = f;
55
55
  }
56
- const u = i.getAttribute("minWidth") || i.getAttribute("min-width");
57
- if (u) {
58
- const b = parseFloat(u);
59
- isNaN(b) || (d.minWidth = b);
56
+ const p = i.getAttribute("minWidth") || i.getAttribute("min-width");
57
+ if (p) {
58
+ const m = parseFloat(p);
59
+ isNaN(m) || (h.minWidth = m);
60
60
  }
61
- i.hasAttribute("resizable") && (d.resizable = !0), i.hasAttribute("sizable") && (d.resizable = !0);
62
- const g = i.getAttribute("editor"), p = i.getAttribute("renderer");
63
- g && (d.__editorName = g), p && (d.__rendererName = p);
64
- const h = i.getAttribute("options");
65
- h && (d.options = h.split(",").map((b) => {
66
- const [O, R] = b.includes(":") ? b.split(":") : [b.trim(), b.trim()];
67
- return { value: O.trim(), label: R?.trim() || O.trim() };
61
+ i.hasAttribute("resizable") && (h.resizable = !0), i.hasAttribute("sizable") && (h.resizable = !0);
62
+ const g = i.getAttribute("editor"), u = i.getAttribute("renderer");
63
+ g && (h.__editorName = g), u && (h.__rendererName = u);
64
+ const d = i.getAttribute("options");
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() };
68
68
  }));
69
- const w = i.querySelector("tbw-grid-column-view"), C = i.querySelector("tbw-grid-column-editor"), m = i.querySelector("tbw-grid-column-header");
70
- w && (d.__viewTemplate = w), C && (d.__editorTemplate = C), m && (d.__headerTemplate = m);
71
- const S = globalThis.DataGridElement?.getAdapters?.() ?? [], A = w ?? i, v = S.find((b) => b.canHandle(A));
72
- if (v) {
73
- const b = v.createRenderer(A);
74
- b && (d.viewRenderer = b);
69
+ const w = i.querySelector("tbw-grid-column-view"), v = i.querySelector("tbw-grid-column-editor"), b = i.querySelector("tbw-grid-column-header");
70
+ w && (h.__viewTemplate = w), v && (h.__editorTemplate = v), b && (h.__headerTemplate = b);
71
+ const R = globalThis.DataGridElement?.getAdapters?.() ?? [], E = w ?? i, T = R.find((m) => m.canHandle(E));
72
+ if (T) {
73
+ const m = T.createRenderer(E);
74
+ m && (h.viewRenderer = m);
75
75
  }
76
- const E = C ?? i, _ = S.find((b) => b.canHandle(E));
77
- if (_) {
78
- const b = _.createEditor(E);
79
- b && (d.editor = b);
76
+ const C = v ?? i, y = R.find((m) => m.canHandle(C));
77
+ if (y) {
78
+ const m = y.createEditor(C);
79
+ m && (h.editor = m);
80
80
  }
81
- return d;
81
+ return h;
82
82
  }).filter((i) => !!i);
83
83
  }
84
- function Ee(t, e) {
84
+ function Se(t, e) {
85
85
  if ((!t || !t.length) && (!e || !e.length)) return [];
86
86
  if (!t || !t.length) return e || [];
87
87
  if (!e || !e.length) return t;
@@ -105,7 +105,7 @@ function Ee(t, e) {
105
105
  });
106
106
  return Object.keys(i).forEach((n) => o.push(i[n])), o;
107
107
  }
108
- function Ve(t, e) {
108
+ function Ge(t, e) {
109
109
  try {
110
110
  t.part?.add?.(e);
111
111
  } catch {
@@ -113,9 +113,9 @@ function Ve(t, e) {
113
113
  const i = t.getAttribute("part");
114
114
  i ? i.split(/\s+/).includes(e) || t.setAttribute("part", i + " " + e) : t.setAttribute("part", e);
115
115
  }
116
- function Se(t) {
117
- const e = t.effectiveConfig?.fitMode || t.fitMode || B.STRETCH;
118
- if (e !== B.STRETCH && e !== B.FIXED || t.__didInitialAutoSize || !t.isConnected) return;
116
+ function Re(t) {
117
+ const e = t.effectiveConfig?.fitMode || t.fitMode || G.STRETCH;
118
+ if (e !== G.STRETCH && e !== G.FIXED || t.__didInitialAutoSize || !t.isConnected) return;
119
119
  const i = Array.from(t._headerRowEl?.children || []);
120
120
  if (!i.length) return;
121
121
  let o = !1;
@@ -126,37 +126,41 @@ function Se(t) {
126
126
  for (const a of t._rowPool) {
127
127
  const c = a.children[r];
128
128
  if (c) {
129
- const d = c.scrollWidth;
130
- d > l && (l = d);
129
+ const h = c.scrollWidth;
130
+ h > l && (l = h);
131
131
  }
132
132
  }
133
133
  l > 0 && (n.width = l + 2, n.__autoSized = !0, o = !0);
134
- }), o && U(t), t.__didInitialAutoSize = !0;
134
+ }), o && V(t), t.__didInitialAutoSize = !0;
135
135
  }
136
- function U(t) {
137
- (t.effectiveConfig?.fitMode || t.fitMode || B.STRETCH) === B.STRETCH ? t._gridTemplate = t._visibleColumns.map((i) => {
138
- if (i.width) return `${i.width}px`;
136
+ const pt = /^(?:\d+(?:\.\d+)?(?:px|%|fr|em|rem|ch|vw|vh|vmin|vmax)|calc\(.+\)|min-content|max-content|minmax\(.+\)|fit-content\(.+\)|auto)$/i;
137
+ function Ae(t, e) {
138
+ return typeof t == "number" ? `${t}px` : (pt.test(t) || console.warn(`[tbw-grid] Column '${e ?? "?"}' has an invalid CSS width value: '${t}'. Expected a number (px) or a valid CSS unit string (e.g. '30%', '2fr', 'calc(...)').`), t);
139
+ }
140
+ function V(t) {
141
+ (t.effectiveConfig?.fitMode || t.fitMode || G.STRETCH) === G.STRETCH ? t._gridTemplate = t._visibleColumns.map((i) => {
142
+ if (i.width != null) return Ae(i.width, i.field);
139
143
  const o = i.minWidth;
140
144
  return o != null ? `minmax(${o}px, 1fr)` : "1fr";
141
- }).join(" ").trim() : t._gridTemplate = t._visibleColumns.map((i) => i.width ? `${i.width}px` : "max-content").join(" "), t.style.setProperty("--tbw-column-template", t._gridTemplate);
145
+ }).join(" ").trim() : t._gridTemplate = t._visibleColumns.map((i) => i.width != null ? Ae(i.width, i.field) : "max-content").join(" "), t.style.setProperty("--tbw-column-template", t._gridTemplate);
142
146
  }
143
- function ft(t) {
147
+ function wt(t) {
144
148
  return t == null ? "string" : typeof t == "number" ? "number" : typeof t == "boolean" ? "boolean" : t instanceof Date || typeof t == "string" && /\d{4}-\d{2}-\d{2}/.test(t) && !isNaN(Date.parse(t)) ? "date" : "string";
145
149
  }
146
- function gt(t, e) {
150
+ function bt(t, e) {
147
151
  const i = t[0] || {}, o = Object.keys(i).map((r) => {
148
- const s = i[r], l = ft(s);
152
+ const s = i[r], l = wt(s);
149
153
  return { field: r, header: r.charAt(0).toUpperCase() + r.slice(1), type: l };
150
154
  }), n = {};
151
155
  return o.forEach((r) => {
152
156
  n[r.field] = r.type || "string";
153
157
  }), { columns: o, typeMap: n };
154
158
  }
155
- const pt = /{{\s*([^}]+)\s*}}/g, P = "__DG_EMPTY__", wt = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, bt = /__(proto|defineGetter|defineSetter)|constructor|window|globalThis|global|process|Function|import|eval|Reflect|Proxy|Error|arguments|document|location|cookie|localStorage|sessionStorage|indexedDB|fetch|XMLHttpRequest|WebSocket|Worker|SharedWorker|ServiceWorker|opener|parent|top|frames|self|this\b/;
156
- function mt(t) {
159
+ const mt = /{{\s*([^}]+)\s*}}/g, z = "__DG_EMPTY__", vt = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, Ct = /__(proto|defineGetter|defineSetter)|constructor|window|globalThis|global|process|Function|import|eval|Reflect|Proxy|Error|arguments|document|location|cookie|localStorage|sessionStorage|indexedDB|fetch|XMLHttpRequest|WebSocket|Worker|SharedWorker|ServiceWorker|opener|parent|top|frames|self|this\b/;
160
+ function yt(t) {
157
161
  return !t || typeof t != "string" ? "" : t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
158
162
  }
159
- const vt = /* @__PURE__ */ new Set([
163
+ const _t = /* @__PURE__ */ new Set([
160
164
  "script",
161
165
  "iframe",
162
166
  "object",
@@ -181,23 +185,23 @@ const vt = /* @__PURE__ */ new Set([
181
185
  "plaintext",
182
186
  "xmp",
183
187
  "listing"
184
- ]), Re = /^on\w+$/i, Ct = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), yt = /^\s*(javascript|vbscript|data|blob):/i;
185
- function $(t) {
188
+ ]), Te = /^on\w+$/i, Et = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), St = /^\s*(javascript|vbscript|data|blob):/i;
189
+ function W(t) {
186
190
  if (!t || typeof t != "string") return "";
187
191
  if (t.indexOf("<") === -1) return t;
188
192
  const e = document.createElement("template");
189
- return e.innerHTML = t, _t(e.content), e.innerHTML;
193
+ return e.innerHTML = t, Rt(e.content), e.innerHTML;
190
194
  }
191
- function _t(t) {
195
+ function Rt(t) {
192
196
  const e = [], i = t.querySelectorAll("*");
193
197
  for (const o of i) {
194
198
  const n = o.tagName.toLowerCase();
195
- if (vt.has(n)) {
199
+ if (_t.has(n)) {
196
200
  e.push(o);
197
201
  continue;
198
202
  }
199
203
  if ((n === "svg" || o.namespaceURI === "http://www.w3.org/2000/svg") && Array.from(o.attributes).some(
200
- (l) => Re.test(l.name) || l.name === "href" || l.name === "xlink:href"
204
+ (l) => Te.test(l.name) || l.name === "href" || l.name === "xlink:href"
201
205
  )) {
202
206
  e.push(o);
203
207
  continue;
@@ -205,11 +209,11 @@ function _t(t) {
205
209
  const r = [];
206
210
  for (const s of o.attributes) {
207
211
  const l = s.name.toLowerCase();
208
- if (Re.test(l)) {
212
+ if (Te.test(l)) {
209
213
  r.push(s.name);
210
214
  continue;
211
215
  }
212
- if (Ct.has(l) && yt.test(s.value)) {
216
+ if (Et.has(l) && St.test(s.value)) {
213
217
  r.push(s.name);
214
218
  continue;
215
219
  }
@@ -222,48 +226,48 @@ function _t(t) {
222
226
  }
223
227
  e.forEach((o) => o.remove());
224
228
  }
225
- function Be(t, e) {
229
+ function Xe(t, e) {
226
230
  if (!t || t.indexOf("{{") === -1) return t;
227
- const i = [], o = t.replace(pt, (l, a) => {
228
- const c = Et(a, e);
231
+ const i = [], o = t.replace(mt, (l, a) => {
232
+ const c = At(a, e);
229
233
  return i.push({ expr: a.trim(), result: c }), c;
230
- }), n = St(o), r = i.length && i.every((l) => l.result === "" || l.result === P);
231
- return I.test(t) || r ? "" : n;
234
+ }), n = Tt(o), r = i.length && i.every((l) => l.result === "" || l.result === z);
235
+ return q.test(t) || r ? "" : n;
232
236
  }
233
- function Et(t, e) {
234
- if (t = (t || "").trim(), !t || I.test(t)) return P;
235
- if (t === "value") return e.value == null ? P : String(e.value);
237
+ function At(t, e) {
238
+ if (t = (t || "").trim(), !t || q.test(t)) return z;
239
+ if (t === "value") return e.value == null ? z : String(e.value);
236
240
  if (t.startsWith("row.") && !/[()?]/.test(t) && !t.includes(":")) {
237
241
  const o = t.slice(4), n = e.row ? e.row[o] : void 0;
238
- return n == null ? P : String(n);
242
+ return n == null ? z : String(n);
239
243
  }
240
- if (t.length > 80 || !wt.test(t) || bt.test(t)) return P;
244
+ if (t.length > 80 || !vt.test(t) || Ct.test(t)) return z;
241
245
  const i = t.match(/\./g);
242
- if (i && i.length > 1) return P;
246
+ if (i && i.length > 1) return z;
243
247
  try {
244
248
  const n = new Function("value", "row", `return (${t});`)(e.value, e.row), r = n == null ? "" : String(n);
245
- return I.test(r) ? P : r || P;
249
+ return q.test(r) ? z : r || z;
246
250
  } catch {
247
- return P;
251
+ return z;
248
252
  }
249
253
  }
250
- const I = /Reflect|Proxy|ownKeys/;
251
- function St(t) {
252
- return t && t.replace(new RegExp(P, "g"), "").replace(/Reflect\.[^<>{}\s]+|\bProxy\b|ownKeys\([^)]*\)/g, "");
254
+ const q = /Reflect|Proxy|ownKeys/;
255
+ function Tt(t) {
256
+ return t && t.replace(new RegExp(z, "g"), "").replace(/Reflect\.[^<>{}\s]+|\bProxy\b|ownKeys\([^)]*\)/g, "");
253
257
  }
254
- function Rt(t) {
255
- if (I.test(t.textContent || "")) {
258
+ function xt(t) {
259
+ if (q.test(t.textContent || "")) {
256
260
  for (const e of t.childNodes)
257
- e.nodeType === Node.TEXT_NODE && I.test(e.textContent || "") && (e.textContent = "");
258
- I.test(t.textContent || "") && (t.textContent = "");
261
+ e.nodeType === Node.TEXT_NODE && q.test(e.textContent || "") && (e.textContent = "");
262
+ q.test(t.textContent || "") && (t.textContent = "");
259
263
  }
260
264
  }
261
- function Ae(t) {
262
- const e = I.test(t), i = ((o) => e ? "" : Be(t, o));
265
+ function xe(t) {
266
+ const e = q.test(t), i = ((o) => e ? "" : Xe(t, o));
263
267
  return i.__blocked = e, i;
264
268
  }
265
- const At = 100;
266
- class Tt {
269
+ const Ht = 100;
270
+ class Lt {
267
271
  #l;
268
272
  #n;
269
273
  #u;
@@ -378,19 +382,19 @@ class Tt {
378
382
  const e = this.#l ? { ...this.#l } : {}, i = Array.isArray(e.columns) ? [...e.columns] : [], o = (this.#d ?? []).map((s) => ({
379
383
  ...s
380
384
  }));
381
- let n = Ee(
385
+ let n = Se(
382
386
  i,
383
387
  o
384
388
  );
385
- this.#n && this.#n.length && (n = Ee(
389
+ this.#n && this.#n.length && (n = Se(
386
390
  this.#n,
387
391
  o
388
392
  ));
389
393
  const r = this.#r.getRows();
390
- return n.length === 0 && r.length && (n = gt(r).columns), n.length && (n.forEach((s) => {
394
+ return n.length === 0 && r.length && (n = bt(r).columns), n.length && (n.forEach((s) => {
391
395
  s.sortable === void 0 && (s.sortable = !0), s.resizable === void 0 && (s.resizable = !0), s.__originalWidth === void 0 && typeof s.width == "number" && (s.__originalWidth = s.width);
392
396
  }), n.forEach((s) => {
393
- s.__viewTemplate && !s.__compiledView && (s.__compiledView = Ae(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = Ae(s.__editorTemplate.innerHTML));
397
+ s.__viewTemplate && !s.__compiledView && (s.__compiledView = xe(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = xe(s.__editorTemplate.innerHTML));
394
398
  }), e.columns = n), this.#u && (e.fitMode = this.#u), e.fitMode || (e.fitMode = "stretch"), this.#b(e), e.columnState && !this.#C && (this.#C = e.columnState), e;
395
399
  }
396
400
  #b(e) {
@@ -402,17 +406,17 @@ class Tt {
402
406
  const n = this.#r.getShellToolPanels();
403
407
  if (n.size > 0) {
404
408
  const f = Array.from(n.values());
405
- f.sort((u, g) => (u.order ?? 100) - (g.order ?? 100)), e.shell.toolPanels = f;
409
+ f.sort((p, g) => (p.order ?? 100) - (g.order ?? 100)), e.shell.toolPanels = f;
406
410
  }
407
411
  const r = this.#r.getShellHeaderContents();
408
412
  if (r.size > 0) {
409
413
  const f = Array.from(r.values());
410
- f.sort((u, g) => (u.order ?? 100) - (g.order ?? 100)), e.shell.headerContents = f;
414
+ f.sort((p, g) => (p.order ?? 100) - (g.order ?? 100)), e.shell.headerContents = f;
411
415
  }
412
- const s = this.#r.getShellToolbarContents(), l = Array.from(s.values()), a = this.#l?.shell?.header?.toolbarContents ?? [], c = new Set(a.map((f) => f.id)), d = [...a];
416
+ const s = this.#r.getShellToolbarContents(), l = Array.from(s.values()), a = this.#l?.shell?.header?.toolbarContents ?? [], c = new Set(a.map((f) => f.id)), h = [...a];
413
417
  for (const f of l)
414
- c.has(f.id) || d.push(f);
415
- d.sort((f, u) => (f.order ?? 0) - (u.order ?? 0)), e.shell.header.toolbarContents = d;
418
+ c.has(f.id) || h.push(f);
419
+ h.sort((f, p) => (f.order ?? 0) - (p.order ?? 0)), e.shell.header.toolbarContents = h;
416
420
  }
417
421
  collectState(e) {
418
422
  const i = this.columns, o = this.#y();
@@ -428,8 +432,8 @@ class Tt {
428
432
  a && (s.sort = a);
429
433
  for (const c of e)
430
434
  if (c.getColumnState) {
431
- const d = c.getColumnState(n.field);
432
- d && Object.assign(s, d);
435
+ const h = c.getColumnState(n.field);
436
+ h && Object.assign(s, h);
433
437
  }
434
438
  return s;
435
439
  })
@@ -444,8 +448,8 @@ class Tt {
444
448
  return a.width !== void 0 && (c.width = a.width, c.__renderedWidth = a.width), a.visible !== void 0 && (c.hidden = !a.visible), c;
445
449
  });
446
450
  r.sort((l, a) => {
447
- const c = n.get(l.field)?.order ?? 1 / 0, d = n.get(a.field)?.order ?? 1 / 0;
448
- return c - d;
451
+ const c = n.get(l.field)?.order ?? 1 / 0, h = n.get(a.field)?.order ?? 1 / 0;
452
+ return c - h;
449
453
  }), this.columns = r;
450
454
  const s = e.columns.filter((l) => l.sort !== void 0).sort((l, a) => (l.sort?.priority ?? 0) - (a.sort?.priority ?? 0));
451
455
  if (s.length > 0) {
@@ -485,7 +489,7 @@ class Tt {
485
489
  this.#s = void 0;
486
490
  const i = this.collectState(e);
487
491
  this.#r.emit("column-state-change", i);
488
- }, At);
492
+ }, Ht);
489
493
  }
490
494
  setColumnVisible(e, i) {
491
495
  const o = this.columns, n = o.find((s) => s.field === e);
@@ -533,7 +537,7 @@ class Tt {
533
537
  this.columns = o, this.#r.renderHeader(), this.#r.updateTemplate(), this.#r.refreshVirtualWindow();
534
538
  }
535
539
  parseLightDomColumns(e) {
536
- this.#d || (this.#h = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#h.length ? ut(e) : []);
540
+ this.#d || (this.#h = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#h.length ? gt(e) : []);
537
541
  }
538
542
  clearLightDomCache() {
539
543
  this.#d = void 0;
@@ -586,7 +590,7 @@ class Tt {
586
590
  this.#v?.disconnect(), this.#w = [], this.#s && clearTimeout(this.#s);
587
591
  }
588
592
  }
589
- function me() {
593
+ function ve() {
590
594
  if (typeof window < "u" && window.location) {
591
595
  const t = window.location.hostname;
592
596
  if (t === "localhost" || t === "127.0.0.1" || t === "::1")
@@ -594,10 +598,10 @@ function me() {
594
598
  }
595
599
  return typeof process < "u" && process.env?.NODE_ENV !== "production";
596
600
  }
597
- function Ge(t) {
601
+ function Ye(t) {
598
602
  return `<span role="checkbox" aria-checked="${t}" aria-label="${t}">${t ? "&#x1F5F9;" : "&#9744;"}</span>`;
599
603
  }
600
- function Xe(t) {
604
+ function je(t) {
601
605
  if (t == null || t === "") return "";
602
606
  if (t instanceof Date)
603
607
  return isNaN(t.getTime()) ? "" : t.toLocaleDateString();
@@ -607,7 +611,7 @@ function Xe(t) {
607
611
  }
608
612
  return "";
609
613
  }
610
- function Ye(t) {
614
+ function Ke(t) {
611
615
  if (!t) return -1;
612
616
  const e = t.getAttribute("data-row");
613
617
  if (e) return parseInt(e, 10);
@@ -620,15 +624,15 @@ function Ye(t) {
620
624
  if (n[r] === i) return r;
621
625
  return -1;
622
626
  }
623
- function xt(t) {
627
+ function Pt(t) {
624
628
  if (!t) return -1;
625
629
  const e = t.getAttribute("data-col");
626
630
  return e ? parseInt(e, 10) : -1;
627
631
  }
628
- function ve(t) {
632
+ function Ce(t) {
629
633
  t && t.querySelectorAll(".cell-focus").forEach((e) => e.classList.remove("cell-focus"));
630
634
  }
631
- function Ht(t) {
635
+ function zt(t) {
632
636
  try {
633
637
  if (getComputedStyle(t).direction === "rtl") return "rtl";
634
638
  } catch {
@@ -639,13 +643,13 @@ function Ht(t) {
639
643
  }
640
644
  return "ltr";
641
645
  }
642
- function Te(t) {
643
- return Ht(t) === "rtl";
646
+ function He(t) {
647
+ return zt(t) === "rtl";
644
648
  }
645
- function eo(t, e) {
649
+ function oo(t, e) {
646
650
  return t === "left" || t === "right" ? t : e === "rtl" ? t === "start" ? "right" : "left" : t === "start" ? "left" : "right";
647
651
  }
648
- function je(t, e) {
652
+ function Qe(t, e) {
649
653
  const i = e.renderer || e.viewRenderer;
650
654
  if (i) return i;
651
655
  if (!e.type) return;
@@ -656,7 +660,7 @@ function je(t, e) {
656
660
  return n.renderer;
657
661
  }
658
662
  }
659
- function Ke(t, e) {
663
+ function Ze(t, e) {
660
664
  if (e.format) return e.format;
661
665
  if (!e.type) return;
662
666
  const i = t.__frameworkAdapter;
@@ -666,291 +670,299 @@ function Ke(t, e) {
666
670
  return o.format;
667
671
  }
668
672
  }
669
- const Qe = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
670
- function re(t) {
673
+ const Je = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
674
+ function se(t) {
671
675
  return (t.__editingCellCount ?? 0) > 0;
672
676
  }
673
- function se(t) {
677
+ function le(t) {
674
678
  t.__editingCellCount = 0, t.removeAttribute("data-has-editing"), t.querySelectorAll(".cell.editing").forEach((i) => i.classList.remove("editing"));
675
679
  }
676
- const Ze = document.createElement("template");
677
- Ze.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
678
- const Je = document.createElement("template");
679
- Je.innerHTML = '<div class="data-grid-row" role="row" part="row"></div>';
680
- function Lt() {
681
- return Ze.content.firstElementChild.cloneNode(!0);
680
+ const et = document.createElement("template");
681
+ et.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
682
+ const tt = document.createElement("template");
683
+ tt.innerHTML = '<div class="data-grid-row" role="row" part="row"></div>';
684
+ function Dt() {
685
+ return et.content.firstElementChild.cloneNode(!0);
682
686
  }
683
- function Pt() {
684
- return Je.content.firstElementChild.cloneNode(!0);
687
+ function Ot() {
688
+ return tt.content.firstElementChild.cloneNode(!0);
685
689
  }
686
- function X(t) {
690
+ function Y(t) {
687
691
  t.__cellDisplayCache = void 0, t.__cellCacheEpoch = void 0, t.__hasSpecialColumns = void 0;
688
692
  }
689
- function zt(t, e, i, o, n) {
693
+ function Mt(t, e, i, o, n) {
690
694
  const r = Math.max(0, i - e), s = t._bodyEl, l = t._visibleColumns, a = l.length;
691
695
  let c = t.__cachedHeaderRowCount;
692
696
  for (c === void 0 && (c = t.querySelector(".header-group-row") ? 2 : 1, t.__cachedHeaderRowCount = c); t._rowPool.length < r; ) {
693
- const u = Pt();
694
- t._rowPool.push(u);
697
+ const p = Ot();
698
+ t._rowPool.push(p);
695
699
  }
696
700
  if (t._rowPool.length > r) {
697
- for (let u = r; u < t._rowPool.length; u++) {
698
- const g = t._rowPool[u];
701
+ for (let p = r; p < t._rowPool.length; p++) {
702
+ const g = t._rowPool[p];
699
703
  g.parentNode === s && g.remove();
700
704
  }
701
705
  t._rowPool.length = r;
702
706
  }
703
- const d = n && t.__hasRenderRowPlugins !== !1, f = t._hasAfterRowRenderHook?.() ?? !1;
704
- for (let u = 0; u < r; u++) {
705
- const g = e + u, p = t._rows[g], h = t._rowPool[u];
706
- if (h.setAttribute("aria-rowindex", String(g + c + 1)), d && n(p, h, g)) {
707
- h.__epoch = o, h.__rowDataRef = p, h.parentNode !== s && s.appendChild(h);
707
+ const h = n && t.__hasRenderRowPlugins !== !1, f = t._hasAfterRowRenderHook?.() ?? !1;
708
+ for (let p = 0; p < r; p++) {
709
+ const g = e + p, u = t._rows[g], d = t._rowPool[p];
710
+ if (d.setAttribute("aria-rowindex", String(g + c + 1)), h && n(u, d, g)) {
711
+ d.__epoch = o, d.__rowDataRef = u, d.parentNode !== s && s.appendChild(d);
708
712
  continue;
709
713
  }
710
- const w = h.__epoch, C = h.__rowDataRef;
711
- let m = h.children.length;
712
- m > a && h.lastElementChild?.classList.contains("tbw-row-loading-overlay") && m--;
713
- const S = w === o && m === a, A = C !== p;
714
- let v = !1;
715
- if (S && A) {
716
- for (let R = 0; R < a; R++)
717
- if (l[R].externalView && !h.querySelector(`.cell[data-col="${R}"] [data-external-view]`)) {
718
- v = !0;
714
+ const w = d.__epoch, v = d.__rowDataRef;
715
+ let b = d.children.length;
716
+ b > a && d.lastElementChild?.classList.contains("tbw-row-loading-overlay") && b--;
717
+ const R = w === o && b === a, E = v !== u, T = !!t._isGridEditMode;
718
+ let C = !1;
719
+ if (R && E) {
720
+ for (let S = 0; S < a; S++)
721
+ if (l[S].externalView && !d.querySelector(`.cell[data-col="${S}"] [data-external-view]`)) {
722
+ C = !0;
719
723
  break;
720
724
  }
721
725
  }
722
- if (!S || v) {
723
- const R = re(h), T = t._activeEditRows === g;
724
- R && !T ? (h.__isCustomRow && (h.className = "data-grid-row", h.setAttribute("role", "row"), h.__isCustomRow = !1), se(h), V(t, h, p, g), h.__epoch = o, h.__rowDataRef = p) : R && T ? (le(t, h, p, g), h.__rowDataRef = p) : (h.__isCustomRow && (h.className = "data-grid-row", h.setAttribute("role", "row"), h.__isCustomRow = !1), V(t, h, p, g), h.__epoch = o, h.__rowDataRef = p);
725
- } else if (A) {
726
- const R = re(h), T = t._activeEditRows === g;
727
- R && !T ? (se(h), V(t, h, p, g), h.__epoch = o, h.__rowDataRef = p) : (le(t, h, p, g), h.__rowDataRef = p);
726
+ if (!R || C) {
727
+ const S = se(d), L = T || t._activeEditRows === g;
728
+ S && !L ? (d.__isCustomRow && (d.className = "data-grid-row", d.setAttribute("role", "row"), d.__isCustomRow = !1), le(d), B(t, d, u, g), d.__epoch = o, d.__rowDataRef = u) : S && L ? (ae(t, d, u, g), d.__rowDataRef = u) : (d.__isCustomRow && (d.className = "data-grid-row", d.setAttribute("role", "row"), d.__isCustomRow = !1), B(t, d, u, g), d.__epoch = o, d.__rowDataRef = u);
729
+ } else if (E) {
730
+ const S = se(d), L = T || t._activeEditRows === g;
731
+ S && !L ? (le(d), B(t, d, u, g), d.__epoch = o, d.__rowDataRef = u) : (ae(t, d, u, g), d.__rowDataRef = u);
728
732
  } else {
729
- const R = re(h), T = t._activeEditRows === g;
730
- R && !T ? (se(h), V(t, h, p, g), h.__epoch = o, h.__rowDataRef = p) : le(t, h, p, g);
733
+ const S = se(d), L = T || t._activeEditRows === g;
734
+ S && !L ? (le(d), B(t, d, u, g), d.__epoch = o, d.__rowDataRef = u) : ae(t, d, u, g);
731
735
  }
732
- let E = !1;
733
- const _ = t.changedRowIds;
734
- if (_ && _.length > 0)
736
+ let y = !1;
737
+ const m = t.changedRowIds;
738
+ if (m && m.length > 0)
735
739
  try {
736
- const R = t.getRowId?.(p);
737
- R && (E = _.includes(R));
740
+ const S = t.getRowId?.(u);
741
+ S && (y = m.includes(S));
738
742
  } catch {
739
743
  }
740
- const b = h.classList.contains("changed");
741
- E !== b && h.classList.toggle("changed", E);
742
- const O = t.effectiveConfig?.rowClass;
743
- if (O) {
744
- const R = h.getAttribute("data-dynamic-classes");
745
- R && R.split(" ").forEach((T) => T && h.classList.remove(T));
744
+ const x = d.classList.contains("changed");
745
+ y !== x && d.classList.toggle("changed", y);
746
+ const N = t.effectiveConfig?.rowClass;
747
+ if (N) {
748
+ const S = d.getAttribute("data-dynamic-classes");
749
+ S && S.split(" ").forEach((L) => L && d.classList.remove(L));
746
750
  try {
747
- const T = O(p);
748
- if (T && T.length > 0) {
749
- const ne = T.filter((G) => G && typeof G == "string");
750
- ne.forEach((G) => h.classList.add(G)), h.setAttribute("data-dynamic-classes", ne.join(" "));
751
+ const L = N(u);
752
+ if (L && L.length > 0) {
753
+ const re = L.filter((X) => X && typeof X == "string");
754
+ re.forEach((X) => d.classList.add(X)), d.setAttribute("data-dynamic-classes", re.join(" "));
751
755
  } else
752
- h.removeAttribute("data-dynamic-classes");
753
- } catch (T) {
754
- console.warn("[tbw-grid] rowClass callback error:", T), h.removeAttribute("data-dynamic-classes");
756
+ d.removeAttribute("data-dynamic-classes");
757
+ } catch (L) {
758
+ console.warn("[tbw-grid] rowClass callback error:", L), d.removeAttribute("data-dynamic-classes");
755
759
  }
756
760
  }
757
761
  f && t._afterRowRender?.({
758
- row: p,
762
+ row: u,
759
763
  rowIndex: g,
760
- rowElement: h
761
- }), h.parentNode !== s && s.appendChild(h);
762
- }
763
- }
764
- function le(t, e, i, o) {
765
- const n = e.children, r = t._visibleColumns, s = r.length, l = n.length, a = s < l ? s : l, c = t._focusRow, d = t._focusCol, f = t._hasAfterCellRenderHook?.() ?? !1;
766
- let u = t.__hasSpecialColumns;
767
- if (u === void 0) {
768
- u = !1;
769
- const p = t.__frameworkAdapter;
770
- for (let h = 0; h < s; h++) {
771
- const w = r[h];
772
- if (w.__viewTemplate || w.__compiledView || w.renderer || w.viewRenderer || w.externalView || w.format || w.type === "date" || w.type === "boolean" || w.type && p?.getTypeDefault?.(w.type)?.renderer || w.type && p?.getTypeDefault?.(w.type)?.format) {
773
- u = !0;
764
+ rowElement: d
765
+ }), d.parentNode !== s && s.appendChild(d);
766
+ }
767
+ }
768
+ function ae(t, e, i, o) {
769
+ const n = e.children, r = t._visibleColumns, s = r.length, l = n.length, a = s < l ? s : l, c = t._focusRow, h = t._focusCol, f = t._hasAfterCellRenderHook?.() ?? !1;
770
+ let p = t.__hasSpecialColumns;
771
+ if (p === void 0) {
772
+ p = !1;
773
+ const u = t.__frameworkAdapter;
774
+ for (let d = 0; d < s; d++) {
775
+ const w = r[d];
776
+ if (w.__viewTemplate || w.__compiledView || w.renderer || w.viewRenderer || w.externalView || w.format || w.type === "date" || w.type === "boolean" || w.type && u?.getTypeDefault?.(w.type)?.renderer || w.type && u?.getTypeDefault?.(w.type)?.format) {
777
+ p = !0;
774
778
  break;
775
779
  }
776
780
  }
777
- t.__hasSpecialColumns = u;
781
+ t.__hasSpecialColumns = p;
778
782
  }
779
783
  const g = String(o);
780
- if (!u) {
781
- for (let p = 0; p < a; p++) {
782
- const h = n[p];
783
- if (h.classList.contains("editing")) continue;
784
- const w = r[p], C = i[w.field];
785
- h.textContent = C == null ? "" : String(C), h.getAttribute("data-row") !== g && h.setAttribute("data-row", g);
786
- const m = c === o && d === p, y = h.classList.contains("cell-focus");
787
- m !== y && (h.classList.toggle("cell-focus", m), h.setAttribute("aria-selected", String(m))), f && t._afterCellRender?.({
784
+ if (!p) {
785
+ for (let u = 0; u < a; u++) {
786
+ const d = n[u];
787
+ if (d.classList.contains("editing")) continue;
788
+ d.firstElementChild && t.__frameworkAdapter?.releaseCell?.(d);
789
+ const w = r[u], v = i[w.field];
790
+ d.textContent = v == null ? "" : String(v), d.getAttribute("data-row") !== g && d.setAttribute("data-row", g);
791
+ const b = c === o && h === u, _ = d.classList.contains("cell-focus");
792
+ b !== _ && (d.classList.toggle("cell-focus", b), d.setAttribute("aria-selected", String(b))), f && t._afterCellRender?.({
788
793
  row: i,
789
794
  rowIndex: o,
790
795
  column: w,
791
- colIndex: p,
792
- value: C,
793
- cellElement: h,
796
+ colIndex: u,
797
+ value: v,
798
+ cellElement: d,
794
799
  rowElement: e
795
800
  });
796
801
  }
797
802
  return;
798
803
  }
799
- for (let p = 0; p < a; p++)
800
- if (r[p].externalView && !n[p].querySelector("[data-external-view]")) {
801
- V(t, e, i, o);
804
+ for (let u = 0; u < a; u++)
805
+ if (r[u].externalView && !n[u].querySelector("[data-external-view]")) {
806
+ B(t, e, i, o);
802
807
  return;
803
808
  }
804
- for (let p = 0; p < a; p++) {
805
- const h = r[p], w = n[p];
809
+ for (let u = 0; u < a; u++) {
810
+ const d = r[u], w = n[u];
806
811
  w.getAttribute("data-row") !== g && w.setAttribute("data-row", g);
807
- const C = c === o && d === p, m = w.classList.contains("cell-focus");
808
- C !== m && (w.classList.toggle("cell-focus", C), w.setAttribute("aria-selected", String(C)));
809
- const y = h.cellClass;
810
- if (y) {
811
- const _ = w.getAttribute("data-dynamic-classes");
812
- _ && _.split(" ").forEach((b) => b && w.classList.remove(b));
812
+ const v = c === o && h === u, b = w.classList.contains("cell-focus");
813
+ v !== b && (w.classList.toggle("cell-focus", v), w.setAttribute("aria-selected", String(v)));
814
+ const _ = d.cellClass;
815
+ if (_) {
816
+ const y = w.getAttribute("data-dynamic-classes");
817
+ y && y.split(" ").forEach((m) => m && w.classList.remove(m));
813
818
  try {
814
- const b = i[h.field], O = y(b, i, h);
815
- if (O && O.length > 0) {
816
- const R = O.filter((T) => T && typeof T == "string");
817
- R.forEach((T) => w.classList.add(T)), w.setAttribute("data-dynamic-classes", R.join(" "));
819
+ const m = i[d.field], x = _(m, i, d);
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(" "));
818
823
  } else
819
824
  w.removeAttribute("data-dynamic-classes");
820
- } catch (b) {
821
- console.warn(`[tbw-grid] cellClass callback error for column '${h.field}':`, b), w.removeAttribute("data-dynamic-classes");
825
+ } catch (m) {
826
+ console.warn(`[tbw-grid] cellClass callback error for column '${d.field}':`, m), w.removeAttribute("data-dynamic-classes");
822
827
  }
823
828
  }
824
829
  if (w.classList.contains("editing")) continue;
825
- const S = je(t, h);
826
- if (S) {
827
- const _ = i[h.field], b = S({
830
+ const R = Qe(t, d);
831
+ if (R) {
832
+ const y = i[d.field], m = R({
828
833
  row: i,
829
- value: _,
830
- field: h.field,
831
- column: h,
834
+ value: y,
835
+ field: d.field,
836
+ column: d,
832
837
  cellEl: w
833
838
  });
834
- typeof b == "string" ? w.innerHTML = $(b) : b instanceof Node ? b.parentElement !== w && (w.innerHTML = "", w.appendChild(b)) : b == null && (w.textContent = _ == null ? "" : String(_)), f && t._afterCellRender?.({
839
+ typeof m == "string" ? (t.__frameworkAdapter?.releaseCell?.(w), w.innerHTML = W(m)) : m instanceof Node ? m.parentElement !== w && (t.__frameworkAdapter?.releaseCell?.(w), w.innerHTML = "", w.appendChild(m)) : m == null && (t.__frameworkAdapter?.releaseCell?.(w), w.textContent = y == null ? "" : String(y)), f && t._afterCellRender?.({
835
840
  row: i,
836
841
  rowIndex: o,
837
- column: h,
838
- colIndex: p,
839
- value: _,
842
+ column: d,
843
+ colIndex: u,
844
+ value: y,
840
845
  cellElement: w,
841
846
  rowElement: e
842
847
  });
843
848
  continue;
844
849
  }
845
- if (h.__viewTemplate || h.__compiledView || h.externalView)
850
+ if (d.__viewTemplate || d.__compiledView || d.externalView)
846
851
  continue;
847
- const A = i[h.field];
848
- let v;
849
- const E = Ke(t, h);
850
- if (E) {
852
+ const E = i[d.field];
853
+ let T;
854
+ const C = Ze(t, d);
855
+ if (C) {
851
856
  try {
852
- const _ = E(A, i);
853
- v = _ == null ? "" : String(_);
854
- } catch (_) {
855
- console.warn(`[tbw-grid] Format error in column '${h.field}':`, _), v = A == null ? "" : String(A);
857
+ const y = C(E, i);
858
+ T = y == null ? "" : String(y);
859
+ } catch (y) {
860
+ console.warn(`[tbw-grid] Format error in column '${d.field}':`, y), T = E == null ? "" : String(E);
856
861
  }
857
- w.textContent = v;
858
- } else h.type === "date" ? (v = Xe(A), w.textContent = v) : h.type === "boolean" ? w.innerHTML = Ge(!!A) : (v = A == null ? "" : String(A), w.textContent = v);
862
+ w.textContent = T;
863
+ } else d.type === "date" ? (T = je(E), w.textContent = T) : d.type === "boolean" ? w.innerHTML = Ye(!!E) : (T = E == null ? "" : String(E), w.textContent = T);
859
864
  f && t._afterCellRender?.({
860
865
  row: i,
861
866
  rowIndex: o,
862
- column: h,
863
- colIndex: p,
864
- value: A,
867
+ column: d,
868
+ colIndex: u,
869
+ value: E,
865
870
  cellElement: w,
866
871
  rowElement: e
867
872
  });
868
873
  }
869
874
  }
870
- function V(t, e, i, o) {
871
- e.classList.remove("tbw-row-loading"), e.removeAttribute("aria-busy"), e.innerHTML = "";
872
- const n = t._visibleColumns, r = n.length, s = t._focusRow, l = t._focusCol, a = t, c = t._hasAfterCellRenderHook?.() ?? !1, d = document.createDocumentFragment();
873
- for (let f = 0; f < r; f++) {
874
- const u = n[f], g = Lt();
875
- g.setAttribute("aria-colindex", String(f + 1)), g.setAttribute("data-col", String(f)), g.setAttribute("data-row", String(o)), g.setAttribute("data-field", u.field), g.setAttribute("data-header", u.header ?? u.field), u.type && g.setAttribute("data-type", u.type);
876
- let p = i[u.field];
877
- const h = Ke(t, u);
878
- if (h)
875
+ function B(t, e, i, o) {
876
+ e.classList.remove("tbw-row-loading"), e.removeAttribute("aria-busy");
877
+ const n = t.__frameworkAdapter;
878
+ if (n?.releaseCell) {
879
+ const p = e.children;
880
+ for (let g = p.length - 1; g >= 0; g--)
881
+ n.releaseCell(p[g]);
882
+ }
883
+ e.innerHTML = "";
884
+ const r = t._visibleColumns, s = r.length, l = t._focusRow, a = t._focusCol, c = t, h = t._hasAfterCellRenderHook?.() ?? !1, f = document.createDocumentFragment();
885
+ for (let p = 0; p < s; p++) {
886
+ const g = r[p], u = Dt();
887
+ u.setAttribute("aria-colindex", String(p + 1)), u.setAttribute("data-col", String(p)), u.setAttribute("data-row", String(o)), u.setAttribute("data-field", g.field), u.setAttribute("data-header", g.header ?? g.field), g.type && u.setAttribute("data-type", g.type);
888
+ let d = i[g.field];
889
+ const w = Ze(t, g);
890
+ if (w)
879
891
  try {
880
- p = h(p, i);
881
- } catch (v) {
882
- console.warn(`[tbw-grid] Format error in column '${u.field}':`, v);
892
+ d = w(d, i);
893
+ } catch (C) {
894
+ console.warn(`[tbw-grid] Format error in column '${g.field}':`, C);
883
895
  }
884
- const w = u.__compiledView, C = u.__viewTemplate, m = je(t, u), y = u.externalView;
885
- let S = !1;
886
- if (m) {
887
- const v = m({ row: i, value: p, field: u.field, column: u, cellEl: g });
888
- typeof v == "string" ? (g.innerHTML = $(v), S = !0) : v instanceof Node ? v.parentElement !== g && (g.textContent = "", g.appendChild(v)) : v == null && (g.textContent = p == null ? "" : String(p));
889
- } else if (y) {
890
- const v = y, E = document.createElement("div");
891
- E.setAttribute("data-external-view", ""), E.setAttribute("data-field", u.field), g.appendChild(E);
892
- const _ = { row: i, value: p, field: u.field, column: u };
893
- if (v.mount)
896
+ const v = g.__compiledView, b = g.__viewTemplate, _ = Qe(t, g), R = g.externalView;
897
+ let E = !1;
898
+ if (_) {
899
+ const C = _({ row: i, value: d, field: g.field, column: g, cellEl: u });
900
+ typeof C == "string" ? (u.innerHTML = W(C), E = !0) : C instanceof Node ? C.parentElement !== u && (u.textContent = "", u.appendChild(C)) : C == null && (u.textContent = d == null ? "" : String(d));
901
+ } else if (R) {
902
+ const C = R, y = document.createElement("div");
903
+ y.setAttribute("data-external-view", ""), y.setAttribute("data-field", g.field), u.appendChild(y);
904
+ const m = { row: i, value: d, field: g.field, column: g };
905
+ if (C.mount)
894
906
  try {
895
- v.mount({ placeholder: E, context: _, spec: v });
896
- } catch (b) {
897
- console.warn(`[tbw-grid] External view mount error for column '${u.field}':`, b);
907
+ C.mount({ placeholder: y, context: m, spec: C });
908
+ } catch (x) {
909
+ console.warn(`[tbw-grid] External view mount error for column '${g.field}':`, x);
898
910
  }
899
911
  else
900
912
  queueMicrotask(() => {
901
913
  try {
902
- a.dispatchEvent(
914
+ c.dispatchEvent(
903
915
  new CustomEvent("mount-external-view", {
904
916
  bubbles: !0,
905
917
  composed: !0,
906
- detail: { placeholder: E, spec: v, context: _ }
918
+ detail: { placeholder: y, spec: C, context: m }
907
919
  })
908
920
  );
909
- } catch (b) {
910
- console.warn(`[tbw-grid] External view event dispatch error for column '${u.field}':`, b);
921
+ } catch (x) {
922
+ console.warn(`[tbw-grid] External view event dispatch error for column '${g.field}':`, x);
911
923
  }
912
924
  });
913
- E.setAttribute("data-mounted", "");
914
- } else if (w) {
915
- const v = w({ row: i, value: p, field: u.field, column: u }), E = w.__blocked;
916
- g.innerHTML = E ? "" : $(v), S = !0, E && (g.textContent = "", g.setAttribute("data-blocked-template", ""));
917
- } else if (C) {
918
- const v = C.innerHTML;
919
- /Reflect\.|\bProxy\b|ownKeys\(/.test(v) ? (g.textContent = "", g.setAttribute("data-blocked-template", "")) : (g.innerHTML = $(Be(v, { row: i, value: p })), S = !0);
925
+ y.setAttribute("data-mounted", "");
926
+ } else if (v) {
927
+ const C = v({ row: i, value: d, field: g.field, column: g }), y = v.__blocked;
928
+ u.innerHTML = y ? "" : W(C), E = !0, y && (u.textContent = "", u.setAttribute("data-blocked-template", ""));
929
+ } else if (b) {
930
+ const C = b.innerHTML;
931
+ /Reflect\.|\bProxy\b|ownKeys\(/.test(C) ? (u.textContent = "", u.setAttribute("data-blocked-template", "")) : (u.innerHTML = W(Xe(C, { row: i, value: d })), E = !0);
920
932
  } else
921
- h ? g.textContent = p == null ? "" : String(p) : u.type === "date" ? g.textContent = Xe(p) : u.type === "boolean" ? g.innerHTML = Ge(!!p) : g.textContent = p == null ? "" : String(p);
922
- if (S) {
923
- Rt(g);
924
- const v = g.textContent || "";
925
- /Proxy|Reflect\.ownKeys/.test(v) && (g.textContent = v.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(g.textContent || "") && (g.textContent = ""));
933
+ w ? u.textContent = d == null ? "" : String(d) : g.type === "date" ? u.textContent = je(d) : g.type === "boolean" ? u.innerHTML = Ye(!!d) : u.textContent = d == null ? "" : String(d);
934
+ if (E) {
935
+ xt(u);
936
+ const C = u.textContent || "";
937
+ /Proxy|Reflect\.ownKeys/.test(C) && (u.textContent = C.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(u.textContent || "") && (u.textContent = ""));
926
938
  }
927
- g.hasAttribute("data-blocked-template") && (g.textContent || "").trim().length && (g.textContent = ""), u.editable ? g.tabIndex = 0 : u.type === "boolean" && (g.hasAttribute("tabindex") || (g.tabIndex = 0)), s === o && l === f ? (g.classList.add("cell-focus"), g.setAttribute("aria-selected", "true")) : g.setAttribute("aria-selected", "false");
928
- const A = u.cellClass;
929
- if (A)
939
+ u.hasAttribute("data-blocked-template") && (u.textContent || "").trim().length && (u.textContent = ""), g.editable ? u.tabIndex = 0 : g.type === "boolean" && (u.hasAttribute("tabindex") || (u.tabIndex = 0)), l === o && a === p ? (u.classList.add("cell-focus"), u.setAttribute("aria-selected", "true")) : u.setAttribute("aria-selected", "false");
940
+ const T = g.cellClass;
941
+ if (T)
930
942
  try {
931
- const v = i[u.field], E = A(v, i, u);
932
- if (E && E.length > 0) {
933
- const _ = E.filter((b) => b && typeof b == "string");
934
- _.forEach((b) => g.classList.add(b)), g.setAttribute("data-dynamic-classes", _.join(" "));
943
+ const C = i[g.field], y = T(C, i, g);
944
+ if (y && y.length > 0) {
945
+ const m = y.filter((x) => x && typeof x == "string");
946
+ m.forEach((x) => u.classList.add(x)), u.setAttribute("data-dynamic-classes", m.join(" "));
935
947
  }
936
- } catch (v) {
937
- console.warn(`[tbw-grid] cellClass callback error for column '${u.field}':`, v);
948
+ } catch (C) {
949
+ console.warn(`[tbw-grid] cellClass callback error for column '${g.field}':`, C);
938
950
  }
939
- c && t._afterCellRender?.({
951
+ h && t._afterCellRender?.({
940
952
  row: i,
941
953
  rowIndex: o,
942
- column: u,
943
- colIndex: f,
944
- value: p,
945
- cellElement: g,
954
+ column: g,
955
+ colIndex: p,
956
+ value: d,
957
+ cellElement: u,
946
958
  rowElement: e
947
- }), d.appendChild(g);
959
+ }), f.appendChild(u);
948
960
  }
949
- e.appendChild(d);
961
+ e.appendChild(f);
950
962
  }
951
- function xe(t, e, i) {
963
+ function Le(t, e, i) {
952
964
  if (e.target?.closest(".resize-handle")) return;
953
- const o = i.querySelector(".cell[data-row]"), n = Ye(o);
965
+ const o = i.querySelector(".cell[data-row]"), n = Ke(o);
954
966
  if (n < 0) return;
955
967
  const r = t._rows[n];
956
968
  if (!r || t._dispatchRowClick?.(e, n, r, i))
@@ -963,30 +975,30 @@ function xe(t, e, i) {
963
975
  return;
964
976
  const a = t._focusRow !== n || t._focusCol !== l;
965
977
  if (t._focusRow = n, t._focusCol = l, s.classList.contains("editing")) {
966
- a && (ve(t._bodyEl ?? t), s.classList.add("cell-focus"));
967
- const c = s.querySelector(Qe);
978
+ a && (Ce(t._bodyEl ?? t), s.classList.add("cell-focus"));
979
+ const c = s.querySelector(Je);
968
980
  try {
969
981
  c?.focus({ preventScroll: !0 });
970
982
  } catch {
971
983
  }
972
984
  return;
973
985
  }
974
- q(t);
986
+ $(t);
975
987
  }
976
988
  }
977
989
  }
978
- function Dt(t, e) {
990
+ function kt(t, e) {
979
991
  if (t._dispatchKeyDown?.(e))
980
992
  return;
981
- const i = t._rows.length - 1, o = t._visibleColumns.length - 1, n = t._activeEditRows !== void 0 && t._activeEditRows !== -1, s = t._visibleColumns[t._focusCol]?.type, l = e.composedPath?.() ?? [], a = l.length ? l[0] : e.target, c = (d) => {
982
- if (!d) return !1;
983
- const f = d.tagName;
984
- return !!(f === "INPUT" || f === "SELECT" || f === "TEXTAREA" || d.isContentEditable);
993
+ const i = t._rows.length - 1, o = t._visibleColumns.length - 1, n = t._activeEditRows !== void 0 && t._activeEditRows !== -1, s = t._visibleColumns[t._focusCol]?.type, l = e.composedPath?.() ?? [], a = l.length ? l[0] : e.target, c = (h) => {
994
+ if (!h) return !1;
995
+ const f = h.tagName;
996
+ return !!(f === "INPUT" || f === "SELECT" || f === "TEXTAREA" || h.isContentEditable);
985
997
  };
986
998
  if (!(c(a) && (e.key === "Home" || e.key === "End")) && !(c(a) && (e.key === "ArrowUp" || e.key === "ArrowDown") && a.tagName === "INPUT" && a.type === "number") && !(c(a) && (e.key === "ArrowLeft" || e.key === "ArrowRight")) && !(c(a) && (e.key === "Enter" || e.key === "Escape")) && !(n && s === "select" && (e.key === "ArrowDown" || e.key === "ArrowUp"))) {
987
999
  switch (e.key) {
988
1000
  case "Tab": {
989
- e.preventDefault(), !e.shiftKey ? t._focusCol < o ? t._focusCol += 1 : (typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow < i && (t._focusRow += 1, t._focusCol = 0)) : t._focusCol > 0 ? t._focusCol -= 1 : t._focusRow > 0 && (typeof t.commitActiveRowEdit == "function" && t._activeEditRows === t._focusRow && t.commitActiveRowEdit(), t._focusRow -= 1, t._focusCol = o), q(t);
1001
+ e.preventDefault(), !e.shiftKey ? t._focusCol < o ? t._focusCol += 1 : (typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow < i && (t._focusRow += 1, t._focusCol = 0)) : t._focusCol > 0 ? t._focusCol -= 1 : t._focusRow > 0 && (typeof t.commitActiveRowEdit == "function" && t._activeEditRows === t._focusRow && t.commitActiveRowEdit(), t._focusRow -= 1, t._focusCol = o), $(t);
990
1002
  return;
991
1003
  }
992
1004
  case "ArrowDown":
@@ -996,18 +1008,18 @@ function Dt(t, e) {
996
1008
  n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = Math.max(0, t._focusRow - 1), e.preventDefault();
997
1009
  break;
998
1010
  case "ArrowRight": {
999
- Te(t) ? t._focusCol = Math.max(0, t._focusCol - 1) : t._focusCol = Math.min(o, t._focusCol + 1), e.preventDefault();
1011
+ He(t) ? t._focusCol = Math.max(0, t._focusCol - 1) : t._focusCol = Math.min(o, t._focusCol + 1), e.preventDefault();
1000
1012
  break;
1001
1013
  }
1002
1014
  case "ArrowLeft": {
1003
- Te(t) ? t._focusCol = Math.min(o, t._focusCol + 1) : t._focusCol = Math.max(0, t._focusCol - 1), e.preventDefault();
1015
+ He(t) ? t._focusCol = Math.min(o, t._focusCol + 1) : t._focusCol = Math.max(0, t._focusCol - 1), e.preventDefault();
1004
1016
  break;
1005
1017
  }
1006
1018
  case "Home":
1007
- (e.ctrlKey || e.metaKey) && (n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = 0), t._focusCol = 0, e.preventDefault(), q(t, { forceScrollLeft: !0 });
1019
+ (e.ctrlKey || e.metaKey) && (n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = 0), t._focusCol = 0, e.preventDefault(), $(t, { forceScrollLeft: !0 });
1008
1020
  return;
1009
1021
  case "End":
1010
- (e.ctrlKey || e.metaKey) && (n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = i), t._focusCol = o, e.preventDefault(), q(t, { forceScrollRight: !0 });
1022
+ (e.ctrlKey || e.metaKey) && (n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = i), t._focusCol = o, e.preventDefault(), $(t, { forceScrollRight: !0 });
1011
1023
  return;
1012
1024
  case "PageDown":
1013
1025
  t._focusRow = Math.min(i, t._focusRow + 20), e.preventDefault();
@@ -1016,27 +1028,27 @@ function Dt(t, e) {
1016
1028
  t._focusRow = Math.max(0, t._focusRow - 20), e.preventDefault();
1017
1029
  break;
1018
1030
  case "Enter": {
1019
- const d = t._focusRow, f = t._focusCol, u = t._visibleColumns[f], g = t._rows[d], p = u?.field ?? "", h = p && g ? g[p] : void 0, w = t.querySelector(
1020
- `[data-row="${d}"][data-col="${f}"]`
1021
- ), C = {
1022
- rowIndex: d,
1031
+ const h = t._focusRow, f = t._focusCol, p = t._visibleColumns[f], g = t._rows[h], u = p?.field ?? "", d = u && g ? g[u] : void 0, w = t.querySelector(
1032
+ `[data-row="${h}"][data-col="${f}"]`
1033
+ ), v = {
1034
+ rowIndex: h,
1023
1035
  colIndex: f,
1024
- field: p,
1025
- value: h,
1036
+ field: u,
1037
+ value: d,
1026
1038
  row: g,
1027
1039
  cellEl: w,
1028
1040
  trigger: "keyboard",
1029
1041
  originalEvent: e
1030
- }, m = new CustomEvent("cell-activate", {
1042
+ }, b = new CustomEvent("cell-activate", {
1031
1043
  cancelable: !0,
1032
- detail: C
1044
+ detail: v
1033
1045
  });
1034
- t.dispatchEvent(m);
1035
- const y = new CustomEvent("activate-cell", {
1046
+ t.dispatchEvent(b);
1047
+ const _ = new CustomEvent("activate-cell", {
1036
1048
  cancelable: !0,
1037
- detail: { row: d, col: f }
1049
+ detail: { row: h, col: f }
1038
1050
  });
1039
- if (t.dispatchEvent(y), m.defaultPrevented || y.defaultPrevented) {
1051
+ if (t.dispatchEvent(_), b.defaultPrevented || _.defaultPrevented) {
1040
1052
  e.preventDefault();
1041
1053
  return;
1042
1054
  }
@@ -1045,19 +1057,19 @@ function Dt(t, e) {
1045
1057
  default:
1046
1058
  return;
1047
1059
  }
1048
- q(t);
1060
+ $(t);
1049
1061
  }
1050
1062
  }
1051
- function q(t, e) {
1063
+ function $(t, e) {
1052
1064
  if (t._virtualization?.enabled) {
1053
- const { rowHeight: s, container: l, viewportEl: a } = t._virtualization, c = l, d = a?.clientHeight ?? c?.clientHeight ?? 0;
1054
- if (c && d > 0) {
1065
+ const { rowHeight: s, container: l, viewportEl: a } = t._virtualization, c = l, h = a?.clientHeight ?? c?.clientHeight ?? 0;
1066
+ if (c && h > 0) {
1055
1067
  const f = t._focusRow * s;
1056
- f < c.scrollTop ? c.scrollTop = f : f + s > c.scrollTop + d && (c.scrollTop = f - d + s);
1068
+ f < c.scrollTop ? c.scrollTop = f : f + s > c.scrollTop + h && (c.scrollTop = f - h + s);
1057
1069
  }
1058
1070
  }
1059
1071
  const i = t._activeEditRows !== void 0 && t._activeEditRows !== -1;
1060
- i || t.refreshVirtualWindow(!1), ve(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
1072
+ i || t.refreshVirtualWindow(!1), Ce(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
1061
1073
  s.setAttribute("aria-selected", "false");
1062
1074
  });
1063
1075
  const o = t._focusRow, n = t._virtualization.start ?? 0, r = t._virtualization.end ?? t._rows.length;
@@ -1075,12 +1087,12 @@ function q(t, e) {
1075
1087
  else {
1076
1088
  const c = t._getHorizontalScrollOffsets?.(s ?? void 0, l) ?? { left: 0, right: 0 };
1077
1089
  if (!c.skipScroll) {
1078
- const d = l.getBoundingClientRect(), f = a.getBoundingClientRect(), u = d.left - f.left + a.scrollLeft, g = u + d.width, p = a.scrollLeft + c.left, h = a.scrollLeft + a.clientWidth - c.right;
1079
- u < p ? a.scrollLeft = u - c.left : g > h && (a.scrollLeft = g - a.clientWidth + c.right);
1090
+ const h = l.getBoundingClientRect(), f = a.getBoundingClientRect(), p = h.left - f.left + a.scrollLeft, g = p + h.width, u = a.scrollLeft + c.left, d = a.scrollLeft + a.clientWidth - c.right;
1091
+ p < u ? a.scrollLeft = p - c.left : g > d && (a.scrollLeft = g - a.clientWidth + c.right);
1080
1092
  }
1081
1093
  }
1082
1094
  if (t._activeEditRows !== void 0 && t._activeEditRows !== -1 && l.classList.contains("editing")) {
1083
- const c = l.querySelector(Qe);
1095
+ const c = l.querySelector(Je);
1084
1096
  if (c && document.activeElement !== c)
1085
1097
  try {
1086
1098
  c.focus({ preventScroll: !0 });
@@ -1096,118 +1108,118 @@ function q(t, e) {
1096
1108
  }
1097
1109
  }
1098
1110
  }
1099
- const te = /* @__PURE__ */ new WeakMap();
1100
- function Ot(t, e) {
1101
- const i = Ye(e), o = xt(e);
1102
- i < 0 || o < 0 || (t._focusRow = i, t._focusCol = o, ve(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true"));
1111
+ const ie = /* @__PURE__ */ new WeakMap();
1112
+ function Nt(t, e) {
1113
+ const i = Ke(e), o = Pt(e);
1114
+ i < 0 || o < 0 || (t._focusRow = i, t._focusCol = o, Ce(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true"));
1103
1115
  }
1104
- function Ce(t, e, i, o) {
1116
+ function ye(t, e, i, o) {
1105
1117
  let n = null;
1106
1118
  const r = i.composedPath?.();
1107
1119
  if (r && r.length > 0 ? n = r[0] : n = i.target, n && !e.contains(n)) {
1108
- const h = document.elementFromPoint(i.clientX, i.clientY);
1109
- h && (n = h);
1120
+ const d = document.elementFromPoint(i.clientX, i.clientY);
1121
+ d && (n = d);
1110
1122
  }
1111
1123
  const s = n?.closest?.("[data-col]"), l = n?.closest?.(".data-grid-row"), a = n?.closest?.(".header-row");
1112
- let c, d, f, u, g, p;
1113
- return s && (c = parseInt(s.getAttribute("data-row") ?? "-1", 10), d = parseInt(s.getAttribute("data-col") ?? "-1", 10), c >= 0 && d >= 0 && (f = t._rows[c], p = t._columns[d], u = p?.field, g = f && u ? f[u] : void 0)), {
1124
+ let c, h, f, p, g, u;
1125
+ return s && (c = parseInt(s.getAttribute("data-row") ?? "-1", 10), h = parseInt(s.getAttribute("data-col") ?? "-1", 10), c >= 0 && h >= 0 && (f = t._rows[c], u = t._columns[h], p = u?.field, g = f && p ? f[p] : void 0)), {
1114
1126
  type: o,
1115
1127
  row: f,
1116
1128
  rowIndex: c !== void 0 && c >= 0 ? c : void 0,
1117
- colIndex: d !== void 0 && d >= 0 ? d : void 0,
1118
- field: u,
1129
+ colIndex: h !== void 0 && h >= 0 ? h : void 0,
1130
+ field: p,
1119
1131
  value: g,
1120
- column: p,
1132
+ column: u,
1121
1133
  originalEvent: i,
1122
1134
  cellElement: s ?? void 0,
1123
1135
  rowElement: l ?? void 0,
1124
1136
  isHeader: !!a,
1125
- cell: c !== void 0 && d !== void 0 && c >= 0 && d >= 0 ? { row: c, col: d } : void 0
1137
+ cell: c !== void 0 && h !== void 0 && c >= 0 && h >= 0 ? { row: c, col: h } : void 0
1126
1138
  };
1127
1139
  }
1128
- function Mt(t, e, i) {
1129
- const o = Ce(t, e, i, "mousedown");
1130
- (t._dispatchCellMouseDown?.(o) ?? !1) && te.set(t, !0);
1140
+ function It(t, e, i) {
1141
+ const o = ye(t, e, i, "mousedown");
1142
+ (t._dispatchCellMouseDown?.(o) ?? !1) && ie.set(t, !0);
1131
1143
  }
1132
- function kt(t, e, i) {
1133
- if (!te.get(t)) return;
1134
- const o = Ce(t, e, i, "mousemove");
1144
+ function qt(t, e, i) {
1145
+ if (!ie.get(t)) return;
1146
+ const o = ye(t, e, i, "mousemove");
1135
1147
  t._dispatchCellMouseMove?.(o);
1136
1148
  }
1137
- function Nt(t, e, i) {
1138
- if (!te.get(t)) return;
1139
- const o = Ce(t, e, i, "mouseup");
1140
- t._dispatchCellMouseUp?.(o), te.set(t, !1);
1149
+ function $t(t, e, i) {
1150
+ if (!ie.get(t)) return;
1151
+ const o = ye(t, e, i, "mouseup");
1152
+ t._dispatchCellMouseUp?.(o), ie.set(t, !1);
1141
1153
  }
1142
- function It(t, e, i) {
1154
+ function Wt(t, e, i) {
1143
1155
  e.addEventListener(
1144
1156
  "mousedown",
1145
1157
  (o) => {
1146
1158
  const n = o.target.closest(".cell[data-col]");
1147
- n && (n.classList.contains("editing") || Ot(t, n));
1159
+ n && (n.classList.contains("editing") || Nt(t, n));
1148
1160
  },
1149
1161
  { signal: i }
1150
1162
  ), e.addEventListener(
1151
1163
  "click",
1152
1164
  (o) => {
1153
1165
  const n = o.target.closest(".data-grid-row");
1154
- n && xe(t, o, n);
1166
+ n && Le(t, o, n);
1155
1167
  },
1156
1168
  { signal: i }
1157
1169
  ), e.addEventListener(
1158
1170
  "dblclick",
1159
1171
  (o) => {
1160
1172
  const n = o.target.closest(".data-grid-row");
1161
- n && xe(t, o, n);
1173
+ n && Le(t, o, n);
1162
1174
  },
1163
1175
  { signal: i }
1164
1176
  );
1165
1177
  }
1166
- function qt(t, e, i, o) {
1167
- e.addEventListener("keydown", (n) => Dt(t, n), { signal: o }), i.addEventListener("mousedown", (n) => Mt(t, i, n), { signal: o }), document.addEventListener("mousemove", (n) => kt(t, i, n), { signal: o }), document.addEventListener("mouseup", (n) => Nt(t, i, n), { signal: o });
1178
+ function Ft(t, e, i, o) {
1179
+ 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 });
1168
1180
  }
1169
- function $t(t, e) {
1181
+ function Ut(t, e) {
1170
1182
  return t == null && e == null ? 0 : t == null ? -1 : e == null || t > e ? 1 : t < e ? -1 : 0;
1171
1183
  }
1172
- function Wt(t, e, i) {
1173
- const n = i.find((l) => l.field === e.field)?.sortComparator ?? $t, { field: r, direction: s } = e;
1184
+ function Vt(t, e, i) {
1185
+ const n = i.find((l) => l.field === e.field)?.sortComparator ?? Ut, { field: r, direction: s } = e;
1174
1186
  return [...t].sort((l, a) => n(l[r], a[r], l, a) * s);
1175
1187
  }
1176
- function He(t, e, i, o) {
1177
- t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((n) => n.__epoch = -1), ie(t), t.refreshVirtualWindow(!0), t.dispatchEvent(
1188
+ function Pe(t, e, i, o) {
1189
+ t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((n) => n.__epoch = -1), oe(t), t.refreshVirtualWindow(!0), t.dispatchEvent(
1178
1190
  new CustomEvent("sort-change", { detail: { field: i.field, direction: o } })
1179
1191
  ), t.requestStateChange?.();
1180
1192
  }
1181
- function Le(t, e) {
1182
- !t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()), Pe(t, e, 1)) : t._sortState.direction === 1 ? Pe(t, e, -1) : (t._sortState = null, t.__rowRenderEpoch++, t._rowPool.forEach((o) => o.__epoch = -1), t._rows = t.__originalOrder.slice(), ie(t), t._headerRowEl?.querySelectorAll('[role="columnheader"].sortable')?.forEach((o) => {
1193
+ function ze(t, e) {
1194
+ !t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()), De(t, e, 1)) : t._sortState.direction === 1 ? De(t, e, -1) : (t._sortState = null, t.__rowRenderEpoch++, t._rowPool.forEach((o) => o.__epoch = -1), t._rows = t.__originalOrder.slice(), oe(t), t._headerRowEl?.querySelectorAll('[role="columnheader"].sortable')?.forEach((o) => {
1183
1195
  o.getAttribute("aria-sort") ? (o.getAttribute("aria-sort") === "ascending" || o.getAttribute("aria-sort") === "descending") && (t._sortState || o.setAttribute("aria-sort", "none")) : o.setAttribute("aria-sort", "none");
1184
1196
  }), t.refreshVirtualWindow(!0), t.dispatchEvent(
1185
1197
  new CustomEvent("sort-change", { detail: { field: e.field, direction: 0 } })
1186
1198
  ), t.requestStateChange?.());
1187
1199
  }
1188
- function Pe(t, e, i) {
1200
+ function De(t, e, i) {
1189
1201
  t._sortState = { field: e.field, direction: i };
1190
- const o = { field: e.field, direction: i }, n = t._columns, s = (t.effectiveConfig?.sortHandler ?? Wt)(t._rows, o, n);
1202
+ const o = { field: e.field, direction: i }, n = t._columns, s = (t.effectiveConfig?.sortHandler ?? Vt)(t._rows, o, n);
1191
1203
  s && typeof s.then == "function" ? s.then((l) => {
1192
- He(t, l, e, i);
1193
- }) : He(t, s, e, i);
1204
+ Pe(t, l, e, i);
1205
+ }) : Pe(t, s, e, i);
1194
1206
  }
1195
- function W(t, e) {
1207
+ function F(t, e) {
1196
1208
  return t.effectiveConfig?.sortable !== !1 && e.sortable === !0;
1197
1209
  }
1198
- function Y(t, e) {
1210
+ function j(t, e) {
1199
1211
  return t.effectiveConfig?.resizable !== !1 && e.resizable !== !1;
1200
1212
  }
1201
- function Ft(t, e) {
1213
+ function Bt(t, e) {
1202
1214
  typeof e == "string" ? t.textContent = e : e instanceof HTMLElement && (t.innerHTML = "", t.appendChild(e.cloneNode(!0)));
1203
1215
  }
1204
- function j(t, e) {
1216
+ function K(t, e) {
1205
1217
  const i = document.createElement("span");
1206
- Ve(i, "sort-indicator");
1218
+ Ge(i, "sort-indicator");
1207
1219
  const o = t._sortState?.field === e.field ? t._sortState.direction : 0, n = { ...M, ...t.icons }, r = o === 1 ? n.sortAsc : o === -1 ? n.sortDesc : n.sortNone;
1208
- return Ft(i, r), i;
1220
+ return Bt(i, r), i;
1209
1221
  }
1210
- function K(t, e, i) {
1222
+ function Q(t, e, i) {
1211
1223
  const o = document.createElement("div");
1212
1224
  return o.className = "resize-handle", o.setAttribute("aria-hidden", "true"), o.addEventListener("mousedown", (n) => {
1213
1225
  n.stopPropagation(), n.preventDefault(), t._resizeController.start(n, e, i);
@@ -1215,32 +1227,32 @@ function K(t, e, i) {
1215
1227
  n.stopPropagation(), n.preventDefault(), t._resizeController.resetColumn(e);
1216
1228
  }), o;
1217
1229
  }
1218
- function Q(t, e, i, o) {
1230
+ function Z(t, e, i, o) {
1219
1231
  o.classList.add("sortable"), o.tabIndex = 0;
1220
1232
  const n = t._sortState?.field === e.field ? t._sortState.direction : 0;
1221
1233
  o.setAttribute("aria-sort", n === 0 ? "none" : n === 1 ? "ascending" : "descending"), o.addEventListener("click", (r) => {
1222
- t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, i, o) || Le(t, e);
1234
+ t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, i, o) || ze(t, e);
1223
1235
  }), o.addEventListener("keydown", (r) => {
1224
1236
  if (r.key === "Enter" || r.key === " ") {
1225
1237
  if (r.preventDefault(), t._dispatchHeaderClick?.(r, i, o)) return;
1226
- Le(t, e);
1238
+ ze(t, e);
1227
1239
  }
1228
1240
  });
1229
1241
  }
1230
- function Ut(t, e) {
1242
+ function Gt(t, e) {
1231
1243
  if (e != null)
1232
1244
  if (typeof e == "string") {
1233
1245
  const i = document.createElement("span");
1234
- for (i.innerHTML = $(e); i.firstChild; )
1246
+ for (i.innerHTML = W(e); i.firstChild; )
1235
1247
  t.appendChild(i.firstChild);
1236
1248
  } else e instanceof Node && t.appendChild(e);
1237
1249
  }
1238
- function ie(t) {
1250
+ function oe(t) {
1239
1251
  t._headerRowEl = t.findHeaderRow();
1240
1252
  const e = t._headerRowEl;
1241
1253
  e && (e.innerHTML = "", t._visibleColumns.forEach((i, o) => {
1242
1254
  const n = document.createElement("div");
1243
- n.className = "cell", Ve(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));
1255
+ 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));
1244
1256
  const r = i.header ?? i.field, s = t._sortState?.field === i.field ? t._sortState.direction : 0, l = s === 1 ? "asc" : s === -1 ? "desc" : null;
1245
1257
  if (i.headerRenderer) {
1246
1258
  const a = {
@@ -1249,30 +1261,30 @@ function ie(t) {
1249
1261
  sortState: l,
1250
1262
  filterActive: !1,
1251
1263
  cellEl: n,
1252
- renderSortIcon: () => W(t, i) ? j(t, i) : null,
1264
+ renderSortIcon: () => F(t, i) ? K(t, i) : null,
1253
1265
  renderFilterButton: () => null
1254
1266
  }, c = i.headerRenderer(a);
1255
- Ut(n, c), W(t, i) && Q(t, i, o, n), Y(t, i) && (n.classList.add("resizable"), n.appendChild(K(t, o, n)));
1267
+ Gt(n, c), F(t, i) && Z(t, i, o, n), j(t, i) && (n.classList.add("resizable"), n.appendChild(Q(t, o, n)));
1256
1268
  } else if (i.headerLabelRenderer) {
1257
1269
  const a = {
1258
1270
  column: i,
1259
1271
  value: r
1260
- }, c = i.headerLabelRenderer(a), d = document.createElement("span");
1261
- c == null ? d.textContent = r : typeof c == "string" ? d.innerHTML = $(c) : c instanceof Node && d.appendChild(c), n.appendChild(d), W(t, i) && (Q(t, i, o, n), n.appendChild(j(t, i))), Y(t, i) && (n.classList.add("resizable"), n.appendChild(K(t, o, n)));
1272
+ }, c = i.headerLabelRenderer(a), h = document.createElement("span");
1273
+ c == null ? h.textContent = r : typeof c == "string" ? h.innerHTML = W(c) : c instanceof Node && h.appendChild(c), n.appendChild(h), F(t, i) && (Z(t, i, o, n), n.appendChild(K(t, i))), j(t, i) && (n.classList.add("resizable"), n.appendChild(Q(t, o, n)));
1262
1274
  } else if (i.__headerTemplate)
1263
- Array.from(i.__headerTemplate.childNodes).forEach((a) => n.appendChild(a.cloneNode(!0))), W(t, i) && (Q(t, i, o, n), n.appendChild(j(t, i))), Y(t, i) && (n.classList.add("resizable"), n.appendChild(K(t, o, n)));
1275
+ Array.from(i.__headerTemplate.childNodes).forEach((a) => n.appendChild(a.cloneNode(!0))), F(t, i) && (Z(t, i, o, n), n.appendChild(K(t, i))), j(t, i) && (n.classList.add("resizable"), n.appendChild(Q(t, o, n)));
1264
1276
  else {
1265
1277
  const a = document.createElement("span");
1266
- a.textContent = r, n.appendChild(a), W(t, i) && (Q(t, i, o, n), n.appendChild(j(t, i))), Y(t, i) && (n.classList.add("resizable"), n.appendChild(K(t, o, n)));
1278
+ a.textContent = r, n.appendChild(a), F(t, i) && (Z(t, i, o, n), n.appendChild(K(t, i))), j(t, i) && (n.classList.add("resizable"), n.appendChild(Q(t, o, n)));
1267
1279
  }
1268
1280
  e.appendChild(n);
1269
1281
  }), e.querySelectorAll(".cell.sortable").forEach((i) => {
1270
1282
  i.getAttribute("aria-sort") || i.setAttribute("aria-sort", "none");
1271
1283
  }), e.children.length > 0 ? (e.setAttribute("role", "row"), e.setAttribute("aria-rowindex", "1")) : (e.removeAttribute("role"), e.removeAttribute("aria-rowindex")));
1272
1284
  }
1273
- const et = typeof requestIdleCallback == "function";
1274
- function Vt(t, e) {
1275
- return et ? requestIdleCallback(t, e) : window.setTimeout(() => {
1285
+ const it = typeof requestIdleCallback == "function";
1286
+ function Xt(t, e) {
1287
+ return it ? requestIdleCallback(t, e) : window.setTimeout(() => {
1276
1288
  const i = Date.now();
1277
1289
  t({
1278
1290
  didTimeout: !1,
@@ -1280,14 +1292,14 @@ function Vt(t, e) {
1280
1292
  });
1281
1293
  }, 1);
1282
1294
  }
1283
- function ze(t) {
1284
- et ? cancelIdleCallback(t) : clearTimeout(t);
1295
+ function Oe(t) {
1296
+ it ? cancelIdleCallback(t) : clearTimeout(t);
1285
1297
  }
1286
- function Bt(t) {
1298
+ function Yt(t) {
1287
1299
  const e = document.createElement("div");
1288
1300
  return e.className = `tbw-spinner tbw-spinner--${t}`, e.setAttribute("role", "progressbar"), e.setAttribute("aria-label", "Loading"), e;
1289
1301
  }
1290
- function Gt(t, e) {
1302
+ function jt(t, e) {
1291
1303
  if (e) {
1292
1304
  const o = e({ size: t });
1293
1305
  if (typeof o == "string") {
@@ -1296,19 +1308,19 @@ function Gt(t, e) {
1296
1308
  }
1297
1309
  return o;
1298
1310
  }
1299
- return Bt(t);
1311
+ return Yt(t);
1300
1312
  }
1301
- function Xt(t) {
1313
+ function Kt(t) {
1302
1314
  const e = document.createElement("div");
1303
- return e.className = "tbw-loading-overlay", e.setAttribute("role", "status"), e.setAttribute("aria-live", "polite"), e.appendChild(Gt("large", t)), e;
1315
+ return e.className = "tbw-loading-overlay", e.setAttribute("role", "status"), e.setAttribute("aria-live", "polite"), e.appendChild(jt("large", t)), e;
1304
1316
  }
1305
- function Yt(t, e) {
1317
+ function Qt(t, e) {
1306
1318
  t.appendChild(e);
1307
1319
  }
1308
- function jt(t) {
1320
+ function Zt(t) {
1309
1321
  t?.remove();
1310
1322
  }
1311
- function Kt(t, e) {
1323
+ function Jt(t, e) {
1312
1324
  if (e) {
1313
1325
  if (t.classList.add("tbw-row-loading"), t.setAttribute("aria-busy", "true"), !t.querySelector(".tbw-row-loading-overlay")) {
1314
1326
  const i = document.createElement("div");
@@ -1319,11 +1331,11 @@ function Kt(t, e) {
1319
1331
  } else
1320
1332
  t.classList.remove("tbw-row-loading"), t.removeAttribute("aria-busy"), t.querySelector(".tbw-row-loading-overlay")?.remove();
1321
1333
  }
1322
- function Qt(t, e) {
1334
+ function ei(t, e) {
1323
1335
  e ? (t.classList.add("tbw-cell-loading"), t.setAttribute("aria-busy", "true")) : (t.classList.remove("tbw-cell-loading"), t.removeAttribute("aria-busy"));
1324
1336
  }
1325
- var x = ((t) => (t[t.STYLE = 1] = "STYLE", t[t.VIRTUALIZATION = 2] = "VIRTUALIZATION", t[t.HEADER = 3] = "HEADER", t[t.ROWS = 4] = "ROWS", t[t.COLUMNS = 5] = "COLUMNS", t[t.FULL = 6] = "FULL", t))(x || {});
1326
- class Zt {
1337
+ var A = ((t) => (t[t.STYLE = 1] = "STYLE", t[t.VIRTUALIZATION = 2] = "VIRTUALIZATION", t[t.HEADER = 3] = "HEADER", t[t.ROWS = 4] = "ROWS", t[t.COLUMNS = 5] = "COLUMNS", t[t.FULL = 6] = "FULL", t))(A || {});
1338
+ class ti {
1327
1339
  #l;
1328
1340
  #n = 0;
1329
1341
  #u = 0;
@@ -1366,15 +1378,15 @@ class Zt {
1366
1378
  this.#n = 0, e >= 5 && this.#l.mergeConfig(), e >= 4 && this.#l.processRows(), e >= 5 && (this.#l.processColumns(), this.#l.updateTemplate()), e >= 3 && this.#l.renderHeader(), e >= 2 && this.#l.renderVirtualWindow(), e >= 1 && this.#l.afterRender(), !this.#o && this.#a && (this.#o = !0, this.#a()), this.#h && (this.#h(), this.#h = null, this.#d = null);
1367
1379
  }
1368
1380
  }
1369
- function De(t) {
1381
+ function Me(t) {
1370
1382
  let e = null, i = null, o = null, n = null;
1371
1383
  const r = (a) => {
1372
1384
  if (!e) return;
1373
- const c = a.clientX - e.startX, d = Math.max(40, e.startWidth + c), f = t._visibleColumns[e.colIndex];
1374
- f.width = d, f.__userResized = !0, f.__renderedWidth = d, i == null && (i = requestAnimationFrame(() => {
1385
+ const c = a.clientX - e.startX, h = Math.max(40, e.startWidth + c), f = t._visibleColumns[e.colIndex];
1386
+ f.width = h, f.__userResized = !0, f.__renderedWidth = h, i == null && (i = requestAnimationFrame(() => {
1375
1387
  i = null, t.updateTemplate?.();
1376
1388
  })), t.dispatchEvent(
1377
- new CustomEvent("column-resize", { detail: { field: f.field, width: d } })
1389
+ new CustomEvent("column-resize", { detail: { field: f.field, width: h } })
1378
1390
  );
1379
1391
  };
1380
1392
  let s = !1;
@@ -1388,9 +1400,9 @@ function De(t) {
1388
1400
  get isResizing() {
1389
1401
  return e !== null || s;
1390
1402
  },
1391
- start(a, c, d) {
1403
+ start(a, c, h) {
1392
1404
  a.preventDefault();
1393
- const f = t._visibleColumns[c], u = typeof f?.width == "number" ? f.width : void 0, g = f?.__renderedWidth ?? u ?? d.getBoundingClientRect().width;
1405
+ const f = t._visibleColumns[c], p = typeof f?.width == "number" ? f.width : void 0, g = f?.__renderedWidth ?? p ?? h.getBoundingClientRect().width;
1394
1406
  e = { startX: a.clientX, colIndex: c, startWidth: g }, window.addEventListener("mousemove", r), window.addEventListener("mouseup", l), o === null && (o = document.documentElement.style.cursor), document.documentElement.style.cursor = "e-resize", n === null && (n = document.body.style.userSelect), document.body.style.userSelect = "none";
1395
1407
  },
1396
1408
  resetColumn(a) {
@@ -1404,48 +1416,48 @@ function De(t) {
1404
1416
  }
1405
1417
  };
1406
1418
  }
1407
- const ae = "data-animating", Jt = {
1419
+ const ce = "data-animating", ii = {
1408
1420
  change: "--tbw-row-change-duration",
1409
1421
  insert: "--tbw-row-insert-duration",
1410
1422
  remove: "--tbw-row-remove-duration"
1411
- }, ei = {
1423
+ }, oi = {
1412
1424
  change: 500,
1413
1425
  insert: 300,
1414
1426
  remove: 200
1415
1427
  };
1416
- function ti(t) {
1428
+ function ni(t) {
1417
1429
  const e = t.trim().toLowerCase();
1418
1430
  return e.endsWith("ms") ? parseFloat(e) : e.endsWith("s") ? parseFloat(e) * 1e3 : parseFloat(e);
1419
1431
  }
1420
- function ii(t, e) {
1421
- const i = Jt[e], o = getComputedStyle(t).getPropertyValue(i);
1432
+ function ri(t, e) {
1433
+ const i = ii[e], o = getComputedStyle(t).getPropertyValue(i);
1422
1434
  if (o) {
1423
- const n = ti(o);
1435
+ const n = ni(o);
1424
1436
  if (!isNaN(n) && n > 0)
1425
1437
  return n;
1426
1438
  }
1427
- return ei[e];
1439
+ return oi[e];
1428
1440
  }
1429
- function oi(t, e, i) {
1430
- t.removeAttribute(ae), t.offsetWidth, t.setAttribute(ae, e);
1431
- const o = ii(t, e);
1441
+ function si(t, e, i) {
1442
+ t.removeAttribute(ce), t.offsetWidth, t.setAttribute(ce, e);
1443
+ const o = ri(t, e);
1432
1444
  setTimeout(() => {
1433
- e !== "remove" && t.removeAttribute(ae);
1445
+ e !== "remove" && t.removeAttribute(ce);
1434
1446
  }, o);
1435
1447
  }
1436
- function ye(t, e, i) {
1448
+ function _e(t, e, i) {
1437
1449
  if (e < 0)
1438
1450
  return !1;
1439
1451
  const o = t.findRenderedRowElement?.(e);
1440
- return o ? (oi(o, i), !0) : !1;
1452
+ return o ? (si(o, i), !0) : !1;
1441
1453
  }
1442
- function ni(t, e, i) {
1454
+ function li(t, e, i) {
1443
1455
  let o = 0;
1444
1456
  for (const n of e)
1445
- ye(t, n, i) && o++;
1457
+ _e(t, n, i) && o++;
1446
1458
  return o;
1447
1459
  }
1448
- function ri(t, e, i) {
1460
+ function ai(t, e, i) {
1449
1461
  const o = t._rows ?? [], n = t.getRowId;
1450
1462
  if (!n)
1451
1463
  return !1;
@@ -1457,9 +1469,9 @@ function ri(t, e, i) {
1457
1469
  return !1;
1458
1470
  }
1459
1471
  });
1460
- return r < 0 ? !1 : ye(t, r, i);
1472
+ return r < 0 ? !1 : _e(t, r, i);
1461
1473
  }
1462
- function Z(t, e, i) {
1474
+ function J(t, e, i) {
1463
1475
  const o = document.createElement(t);
1464
1476
  if (e)
1465
1477
  for (const n in e) {
@@ -1468,7 +1480,7 @@ function Z(t, e, i) {
1468
1480
  }
1469
1481
  return o;
1470
1482
  }
1471
- function L(t, e) {
1483
+ function P(t, e) {
1472
1484
  const i = document.createElement("div");
1473
1485
  if (t && (i.className = t), e)
1474
1486
  for (const o in e) {
@@ -1477,7 +1489,7 @@ function L(t, e) {
1477
1489
  }
1478
1490
  return i;
1479
1491
  }
1480
- function tt(t, e, i) {
1492
+ function ot(t, e, i) {
1481
1493
  const o = document.createElement("button");
1482
1494
  if (t && (o.className = t), e)
1483
1495
  for (const n in e) {
@@ -1486,8 +1498,8 @@ function tt(t, e, i) {
1486
1498
  }
1487
1499
  return o;
1488
1500
  }
1489
- const it = document.createElement("template");
1490
- it.innerHTML = `
1501
+ const nt = document.createElement("template");
1502
+ nt.innerHTML = `
1491
1503
  <div class="tbw-scroll-area">
1492
1504
  <div class="rows-body-wrapper">
1493
1505
  <div class="rows-body" role="grid">
@@ -1506,38 +1518,38 @@ it.innerHTML = `
1506
1518
  <div class="faux-vscroll-spacer"></div>
1507
1519
  </div>
1508
1520
  `;
1509
- function ot() {
1510
- return it.content.cloneNode(!0);
1521
+ function rt() {
1522
+ return nt.content.cloneNode(!0);
1511
1523
  }
1512
- function Oe(t) {
1513
- const e = document.createDocumentFragment(), i = L(t.hasShell ? "tbw-grid-root has-shell" : "tbw-grid-root");
1524
+ function ke(t) {
1525
+ const e = document.createDocumentFragment(), i = P(t.hasShell ? "tbw-grid-root has-shell" : "tbw-grid-root");
1514
1526
  if (t.hasShell && t.shellHeader && t.shellBody)
1515
1527
  i.appendChild(t.shellHeader), i.appendChild(t.shellBody);
1516
1528
  else {
1517
- const o = L("tbw-grid-content");
1518
- o.appendChild(ot()), i.appendChild(o);
1529
+ const o = P("tbw-grid-content");
1530
+ o.appendChild(rt()), i.appendChild(o);
1519
1531
  }
1520
1532
  return e.appendChild(i), e;
1521
1533
  }
1522
- function si(t) {
1523
- const e = L("tbw-shell-header", { part: "shell-header", role: "presentation" });
1534
+ function ci(t) {
1535
+ const e = P("tbw-shell-header", { part: "shell-header", role: "presentation" });
1524
1536
  if (t.title) {
1525
- const r = L("tbw-shell-title");
1537
+ const r = P("tbw-shell-title");
1526
1538
  r.textContent = t.title, e.appendChild(r);
1527
1539
  }
1528
- const i = L("tbw-shell-content", {
1540
+ const i = P("tbw-shell-content", {
1529
1541
  part: "shell-content",
1530
1542
  role: "presentation",
1531
1543
  "data-light-dom-header-content": ""
1532
1544
  });
1533
1545
  e.appendChild(i);
1534
- const o = L("tbw-shell-toolbar", { part: "shell-toolbar", role: "presentation" });
1546
+ const o = P("tbw-shell-toolbar", { part: "shell-toolbar", role: "presentation" });
1535
1547
  for (const r of t.configButtons)
1536
- r.hasRender && o.appendChild(L("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1548
+ r.hasRender && o.appendChild(P("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1537
1549
  for (const r of t.apiButtons)
1538
- r.hasRender && o.appendChild(L("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1539
- if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && o.appendChild(L("tbw-toolbar-separator")), t.hasPanels) {
1540
- const r = tt(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
1550
+ r.hasRender && o.appendChild(P("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1551
+ if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && o.appendChild(P("tbw-toolbar-separator")), t.hasPanels) {
1552
+ const r = ot(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
1541
1553
  "data-panel-toggle": "",
1542
1554
  title: "Settings",
1543
1555
  "aria-label": "Toggle settings panel",
@@ -1548,12 +1560,12 @@ function si(t) {
1548
1560
  }
1549
1561
  return e.appendChild(o), e;
1550
1562
  }
1551
- function li(t) {
1552
- const e = L("tbw-shell-body"), i = t.panels.length > 0, o = t.panels.length === 1, n = L("tbw-grid-content");
1553
- n.appendChild(ot());
1563
+ function di(t) {
1564
+ const e = P("tbw-shell-body"), i = t.panels.length > 0, o = t.panels.length === 1, n = P("tbw-grid-content");
1565
+ n.appendChild(rt());
1554
1566
  let r = null;
1555
1567
  if (i) {
1556
- r = Z("aside", {
1568
+ r = J("aside", {
1557
1569
  class: t.isPanelOpen ? "tbw-tool-panel open" : "tbw-tool-panel",
1558
1570
  part: "tool-panel",
1559
1571
  "data-position": t.position,
@@ -1562,29 +1574,29 @@ function li(t) {
1562
1574
  });
1563
1575
  const s = t.position === "left" ? "right" : "left";
1564
1576
  r.appendChild(
1565
- L("tbw-tool-panel-resize", {
1577
+ P("tbw-tool-panel-resize", {
1566
1578
  "data-resize-handle": "",
1567
1579
  "data-handle-position": s,
1568
1580
  "aria-hidden": "true"
1569
1581
  })
1570
1582
  );
1571
- const l = L("tbw-tool-panel-content", { role: "presentation" }), a = L("tbw-accordion");
1583
+ const l = P("tbw-tool-panel-content", { role: "presentation" }), a = P("tbw-accordion");
1572
1584
  for (const c of t.panels) {
1573
- const d = `tbw-accordion-section${c.isExpanded ? " expanded" : ""}${o ? " single" : ""}`, f = L(d, { "data-section": c.id }), u = tt("tbw-accordion-header", {
1585
+ const h = `tbw-accordion-section${c.isExpanded ? " expanded" : ""}${o ? " single" : ""}`, f = P(h, { "data-section": c.id }), p = ot("tbw-accordion-header", {
1574
1586
  "aria-expanded": String(c.isExpanded),
1575
1587
  "aria-controls": `tbw-section-${c.id}`
1576
1588
  });
1577
- if (o && u.setAttribute("aria-disabled", "true"), c.icon) {
1578
- const p = Z("span", { class: "tbw-accordion-icon" });
1579
- p.innerHTML = c.icon, u.appendChild(p);
1589
+ if (o && p.setAttribute("aria-disabled", "true"), c.icon) {
1590
+ const u = J("span", { class: "tbw-accordion-icon" });
1591
+ u.innerHTML = c.icon, p.appendChild(u);
1580
1592
  }
1581
- const g = Z("span", { class: "tbw-accordion-title" });
1582
- if (g.textContent = c.title, u.appendChild(g), !o) {
1583
- const p = Z("span", { class: "tbw-accordion-chevron" });
1584
- p.innerHTML = c.isExpanded ? t.collapseIcon : t.expandIcon, u.appendChild(p);
1593
+ const g = J("span", { class: "tbw-accordion-title" });
1594
+ if (g.textContent = c.title, p.appendChild(g), !o) {
1595
+ const u = J("span", { class: "tbw-accordion-chevron" });
1596
+ u.innerHTML = c.isExpanded ? t.collapseIcon : t.expandIcon, p.appendChild(u);
1585
1597
  }
1586
- f.appendChild(u), f.appendChild(
1587
- L("tbw-accordion-content", {
1598
+ f.appendChild(p), f.appendChild(
1599
+ P("tbw-accordion-content", {
1588
1600
  id: `tbw-section-${c.id}`,
1589
1601
  role: "presentation"
1590
1602
  })
@@ -1594,10 +1606,10 @@ function li(t) {
1594
1606
  }
1595
1607
  return t.position === "left" && r ? (e.appendChild(r), e.appendChild(n)) : (e.appendChild(n), r && e.appendChild(r)), e;
1596
1608
  }
1597
- function N(t) {
1609
+ function I(t) {
1598
1610
  return t ? typeof t == "string" ? t : t.outerHTML : "";
1599
1611
  }
1600
- function ai() {
1612
+ function hi() {
1601
1613
  return {
1602
1614
  toolPanels: /* @__PURE__ */ new Map(),
1603
1615
  headerContents: /* @__PURE__ */ new Map(),
@@ -1616,32 +1628,32 @@ function ai() {
1616
1628
  lightDomContentMoved: !1
1617
1629
  };
1618
1630
  }
1619
- function nt(t) {
1631
+ function st(t) {
1620
1632
  return !!(t?.header?.title || t?.header?.toolbarContents?.length || t?.toolPanels?.length || t?.headerContents?.length || t?.header?.lightDomContent?.length || t?.header?.hasToolButtonsContainer);
1621
1633
  }
1622
- function ci(t, e, i = "☰") {
1623
- 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((h) => h.id)), c = [...s];
1624
- for (const h of l)
1625
- a.has(h.id) || c.push(h);
1626
- const d = c.length > 0, f = e.toolPanels.size > 0, u = d && f, g = [...c].sort((h, w) => (h.order ?? 0) - (w.order ?? 0));
1627
- let p = "";
1628
- for (const h of g)
1629
- p += `<div class="tbw-toolbar-content-slot" data-toolbar-content="${h.id}"></div>`;
1630
- if (u && (p += '<div class="tbw-toolbar-separator"></div>'), f) {
1631
- const h = e.isPanelOpen;
1632
- p += `<button class="${h ? "tbw-toolbar-btn active" : "tbw-toolbar-btn"}" data-panel-toggle title="Settings" aria-label="Toggle settings panel" aria-pressed="${h}" aria-controls="tbw-tool-panel">${r}</button>`;
1634
+ function ui(t, e, i = "☰") {
1635
+ 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];
1636
+ for (const d of l)
1637
+ a.has(d.id) || c.push(d);
1638
+ const h = c.length > 0, f = e.toolPanels.size > 0, p = h && f, g = [...c].sort((d, w) => (d.order ?? 0) - (w.order ?? 0));
1639
+ let u = "";
1640
+ for (const d of g)
1641
+ u += `<div class="tbw-toolbar-content-slot" data-toolbar-content="${d.id}"></div>`;
1642
+ if (p && (u += '<div class="tbw-toolbar-separator"></div>'), f) {
1643
+ const d = e.isPanelOpen;
1644
+ u += `<button class="${d ? "tbw-toolbar-btn active" : "tbw-toolbar-btn"}" data-panel-toggle title="Settings" aria-label="Toggle settings panel" aria-pressed="${d}" aria-controls="tbw-tool-panel">${r}</button>`;
1633
1645
  }
1634
1646
  return `
1635
1647
  <div class="tbw-shell-header" part="shell-header" role="presentation">
1636
- ${n ? `<div class="tbw-shell-title">${mt(o)}</div>` : ""}
1648
+ ${n ? `<div class="tbw-shell-title">${yt(o)}</div>` : ""}
1637
1649
  <div class="tbw-shell-content" part="shell-content" role="presentation" data-light-dom-header-content></div>
1638
1650
  <div class="tbw-shell-toolbar" part="shell-toolbar" role="presentation">
1639
- ${p}
1651
+ ${u}
1640
1652
  </div>
1641
1653
  </div>
1642
1654
  `;
1643
1655
  }
1644
- function Me(t, e) {
1656
+ function Ne(t, e) {
1645
1657
  const i = t.querySelector("tbw-grid-header");
1646
1658
  if (!i) return;
1647
1659
  if (!e.lightDomTitle) {
@@ -1651,7 +1663,7 @@ function Me(t, e) {
1651
1663
  const o = i.querySelectorAll("tbw-grid-header-content");
1652
1664
  o.length > 0 && e.lightDomHeaderContent.length === 0 && (e.lightDomHeaderContent = Array.from(o)), i.style.display = "none";
1653
1665
  }
1654
- function ke(t, e, i) {
1666
+ function Ie(t, e, i) {
1655
1667
  const o = t.querySelector(":scope > tbw-grid-tool-buttons");
1656
1668
  if (!o) return;
1657
1669
  e.hasToolButtonsContainer = !0;
@@ -1671,7 +1683,7 @@ function ke(t, e, i) {
1671
1683
  };
1672
1684
  e.toolbarContents.set(n, r), e.lightDomToolbarContentIds.add(n), o.style.display = "none";
1673
1685
  }
1674
- function Ne(t, e, i) {
1686
+ function qe(t, e, i) {
1675
1687
  t.querySelectorAll(":scope > tbw-grid-tool-panel").forEach((n) => {
1676
1688
  const r = n, s = r.getAttribute("id"), l = r.getAttribute("title");
1677
1689
  if (!s || !l) {
@@ -1680,39 +1692,39 @@ function Ne(t, e, i) {
1680
1692
  );
1681
1693
  return;
1682
1694
  }
1683
- const a = r.getAttribute("icon") ?? void 0, c = r.getAttribute("tooltip") ?? void 0, d = parseInt(r.getAttribute("order") ?? "100", 10);
1695
+ const a = r.getAttribute("icon") ?? void 0, c = r.getAttribute("tooltip") ?? void 0, h = parseInt(r.getAttribute("order") ?? "100", 10);
1684
1696
  let f;
1685
- const u = i?.(r);
1686
- if (u)
1687
- f = u;
1697
+ const p = i?.(r);
1698
+ if (p)
1699
+ f = p;
1688
1700
  else {
1689
- const h = r.innerHTML.trim();
1701
+ const d = r.innerHTML.trim();
1690
1702
  f = (w) => {
1691
- const C = document.createElement("div");
1692
- return C.innerHTML = h, w.appendChild(C), () => C.remove();
1703
+ const v = document.createElement("div");
1704
+ return v.innerHTML = d, w.appendChild(v), () => v.remove();
1693
1705
  };
1694
1706
  }
1695
1707
  const g = e.toolPanels.get(s);
1696
1708
  if (g) {
1697
- if (u) {
1698
- g.render = f, g.order = d, g.icon = a, g.tooltip = c;
1699
- const h = e.panelCleanups.get(s);
1700
- h && (h(), e.panelCleanups.delete(s));
1709
+ if (p) {
1710
+ g.render = f, g.order = h, g.icon = a, g.tooltip = c;
1711
+ const d = e.panelCleanups.get(s);
1712
+ d && (d(), e.panelCleanups.delete(s));
1701
1713
  }
1702
1714
  return;
1703
1715
  }
1704
- const p = {
1716
+ const u = {
1705
1717
  id: s,
1706
1718
  title: l,
1707
1719
  icon: a,
1708
1720
  tooltip: c,
1709
- order: d,
1721
+ order: h,
1710
1722
  render: f
1711
1723
  };
1712
- e.toolPanels.set(s, p), e.lightDomToolPanelIds.add(s), r.style.display = "none";
1724
+ e.toolPanels.set(s, u), e.lightDomToolPanelIds.add(s), r.style.display = "none";
1713
1725
  });
1714
1726
  }
1715
- function di(t, e, i, o) {
1727
+ function fi(t, e, i, o) {
1716
1728
  const n = t.querySelector(".tbw-shell-toolbar");
1717
1729
  n && n.addEventListener("click", (s) => {
1718
1730
  if (s.target.closest("[data-panel-toggle]")) {
@@ -1724,36 +1736,36 @@ function di(t, e, i, o) {
1724
1736
  r && r.addEventListener("click", (s) => {
1725
1737
  const a = s.target.closest(".tbw-accordion-header");
1726
1738
  if (a) {
1727
- const d = a.closest("[data-section]")?.getAttribute("data-section");
1728
- d && o.onSectionToggle(d);
1739
+ const h = a.closest("[data-section]")?.getAttribute("data-section");
1740
+ h && o.onSectionToggle(h);
1729
1741
  }
1730
1742
  });
1731
1743
  }
1732
- function hi(t, e, i) {
1744
+ function gi(t, e, i) {
1733
1745
  const o = t.querySelector(".tbw-tool-panel"), n = t.querySelector("[data-resize-handle]"), r = t.querySelector(".tbw-shell-body");
1734
1746
  if (!o || !n || !r)
1735
1747
  return () => {
1736
1748
  };
1737
1749
  const s = e?.toolPanel?.position ?? "right", l = 200;
1738
- let a = 0, c = 0, d = 0, f = !1;
1739
- const u = (h) => {
1750
+ let a = 0, c = 0, h = 0, f = !1;
1751
+ const p = (d) => {
1740
1752
  if (!f) return;
1741
- h.preventDefault();
1742
- const w = s === "left" ? h.clientX - a : a - h.clientX, C = Math.min(d, Math.max(l, c + w));
1743
- o.style.width = `${C}px`;
1753
+ d.preventDefault();
1754
+ const w = s === "left" ? d.clientX - a : a - d.clientX, v = Math.min(h, Math.max(l, c + w));
1755
+ o.style.width = `${v}px`;
1744
1756
  }, g = () => {
1745
1757
  if (!f) return;
1746
1758
  f = !1, n.classList.remove("resizing"), o.style.transition = "", document.body.style.cursor = "", document.body.style.userSelect = "";
1747
- const h = o.getBoundingClientRect().width;
1748
- i(h), document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", g);
1749
- }, p = (h) => {
1750
- h.preventDefault(), f = !0, a = h.clientX, c = o.getBoundingClientRect().width, d = r.getBoundingClientRect().width - 20, n.classList.add("resizing"), o.style.transition = "none", document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", u), document.addEventListener("mouseup", g);
1759
+ const d = o.getBoundingClientRect().width;
1760
+ i(d), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", g);
1761
+ }, u = (d) => {
1762
+ d.preventDefault(), f = !0, a = d.clientX, c = o.getBoundingClientRect().width, h = r.getBoundingClientRect().width - 20, n.classList.add("resizing"), o.style.transition = "none", document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", p), document.addEventListener("mouseup", g);
1751
1763
  };
1752
- return n.addEventListener("mousedown", p), () => {
1753
- n.removeEventListener("mousedown", p), document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", g);
1764
+ return n.addEventListener("mousedown", u), () => {
1765
+ n.removeEventListener("mousedown", u), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", g);
1754
1766
  };
1755
1767
  }
1756
- function ce(t, e, i) {
1768
+ function de(t, e, i) {
1757
1769
  const o = e?.header?.toolbarContents ?? [], n = [...i.toolbarContents.values()], r = new Set(o.map((l) => l.id)), s = [...o];
1758
1770
  for (const l of n)
1759
1771
  r.has(l.id) || s.push(l);
@@ -1765,7 +1777,7 @@ function ce(t, e, i) {
1765
1777
  c && i.toolbarContentCleanups.set(l.id, c);
1766
1778
  }
1767
1779
  }
1768
- function fe(t, e) {
1780
+ function ge(t, e) {
1769
1781
  const i = e.lightDomHeaderContent.length > 0 && !e.lightDomContentMoved, o = e.headerContents.size > 0;
1770
1782
  if (!i && !o) return;
1771
1783
  const n = t.querySelector(".tbw-shell-content");
@@ -1785,41 +1797,41 @@ function fe(t, e) {
1785
1797
  c && e.headerContentCleanups.set(s.id, c);
1786
1798
  }
1787
1799
  }
1788
- function ui(t, e, i) {
1800
+ function pi(t, e, i) {
1789
1801
  if (!e.isPanelOpen) return;
1790
- const o = N(i?.expand ?? M.expand), n = N(i?.collapse ?? M.collapse);
1802
+ const o = I(i?.expand ?? M.expand), n = I(i?.collapse ?? M.collapse);
1791
1803
  for (const [r, s] of e.toolPanels) {
1792
1804
  const l = e.expandedSections.has(r), a = t.querySelector(`[data-section="${r}"]`), c = a?.querySelector(".tbw-accordion-content");
1793
1805
  if (!a || !c) continue;
1794
1806
  a.classList.toggle("expanded", l);
1795
- const d = a.querySelector(".tbw-accordion-header");
1796
- d && d.setAttribute("aria-expanded", String(l));
1807
+ const h = a.querySelector(".tbw-accordion-header");
1808
+ h && h.setAttribute("aria-expanded", String(l));
1797
1809
  const f = a.querySelector(".tbw-accordion-chevron");
1798
1810
  if (f && (f.innerHTML = l ? n : o), l) {
1799
1811
  if (c.children.length === 0) {
1800
- const u = s.render(c);
1801
- u && e.panelCleanups.set(r, u);
1812
+ const p = s.render(c);
1813
+ p && e.panelCleanups.set(r, p);
1802
1814
  }
1803
1815
  } else {
1804
- const u = e.panelCleanups.get(r);
1805
- u && (u(), e.panelCleanups.delete(r)), c.innerHTML = "";
1816
+ const p = e.panelCleanups.get(r);
1817
+ p && (p(), e.panelCleanups.delete(r)), c.innerHTML = "";
1806
1818
  }
1807
1819
  }
1808
1820
  }
1809
- function Ie(t, e) {
1821
+ function $e(t, e) {
1810
1822
  const i = t.querySelector("[data-panel-toggle]");
1811
1823
  i && (i.classList.toggle("active", e.isPanelOpen), i.setAttribute("aria-pressed", String(e.isPanelOpen)));
1812
1824
  }
1813
- function qe(t, e) {
1825
+ function We(t, e) {
1814
1826
  const i = t.querySelector(".tbw-tool-panel");
1815
1827
  i && (i.classList.toggle("open", e.isPanelOpen), e.isPanelOpen || (i.style.width = ""));
1816
1828
  }
1817
- function de(t) {
1829
+ function he(t) {
1818
1830
  for (const e of t.toolbarContentCleanups.values())
1819
1831
  e();
1820
1832
  t.toolbarContentCleanups.clear();
1821
1833
  }
1822
- function fi(t) {
1834
+ function wi(t) {
1823
1835
  for (const e of t.headerContentCleanups.values())
1824
1836
  e();
1825
1837
  t.headerContentCleanups.clear();
@@ -1836,7 +1848,7 @@ function fi(t) {
1836
1848
  t.toolPanels.get(e)?.onClose?.();
1837
1849
  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;
1838
1850
  }
1839
- function gi(t, e) {
1851
+ function bi(t, e) {
1840
1852
  let i = !1;
1841
1853
  const o = {
1842
1854
  get isInitialized() {
@@ -1865,7 +1877,7 @@ function gi(t, e) {
1865
1877
  s && t.expandedSections.add(s.id);
1866
1878
  }
1867
1879
  const n = e.getShadow();
1868
- Ie(n, t), qe(n, t), ui(n, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: o.expandedSections });
1880
+ $e(n, t), We(n, t), pi(n, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: o.expandedSections });
1869
1881
  },
1870
1882
  closeToolPanel() {
1871
1883
  if (!t.isPanelOpen) return;
@@ -1876,7 +1888,7 @@ function gi(t, e) {
1876
1888
  r.onClose?.();
1877
1889
  t.isPanelOpen = !1;
1878
1890
  const n = e.getShadow();
1879
- Ie(n, t), qe(n, t), e.emit("tool-panel-close", {});
1891
+ $e(n, t), We(n, t), e.emit("tool-panel-close", {});
1880
1892
  },
1881
1893
  toggleToolPanel() {
1882
1894
  t.isPanelOpen ? o.closeToolPanel() : o.openToolPanel();
@@ -1892,16 +1904,16 @@ function gi(t, e) {
1892
1904
  const s = e.getShadow(), l = t.expandedSections.has(n);
1893
1905
  if (l) {
1894
1906
  const a = t.panelCleanups.get(n);
1895
- a && (a(), t.panelCleanups.delete(n)), r.onClose?.(), t.expandedSections.delete(n), he(s, n, !1);
1907
+ a && (a(), t.panelCleanups.delete(n)), r.onClose?.(), t.expandedSections.delete(n), ue(s, n, !1);
1896
1908
  } else {
1897
1909
  for (const [a, c] of t.toolPanels)
1898
1910
  if (a !== n && t.expandedSections.has(a)) {
1899
- const d = t.panelCleanups.get(a);
1900
- d && (d(), t.panelCleanups.delete(a)), c.onClose?.(), t.expandedSections.delete(a), he(s, a, !1);
1911
+ const h = t.panelCleanups.get(a);
1912
+ h && (h(), t.panelCleanups.delete(a)), c.onClose?.(), t.expandedSections.delete(a), ue(s, a, !1);
1901
1913
  const f = s.querySelector(`[data-section="${a}"] .tbw-accordion-content`);
1902
1914
  f && (f.innerHTML = "");
1903
1915
  }
1904
- t.expandedSections.add(n), he(s, n, !0), pi(s, t, n);
1916
+ t.expandedSections.add(n), ue(s, n, !0), mi(s, t, n);
1905
1917
  }
1906
1918
  e.emit("tool-panel-section-toggle", { id: n, expanded: !l });
1907
1919
  },
@@ -1930,7 +1942,7 @@ function gi(t, e) {
1930
1942
  console.warn(`[tbw-grid] Header content "${n.id}" already registered`);
1931
1943
  return;
1932
1944
  }
1933
- t.headerContents.set(n.id, n), i && fe(e.getShadow(), t);
1945
+ t.headerContents.set(n.id, n), i && ge(e.getShadow(), t);
1934
1946
  },
1935
1947
  unregisterHeaderContent(n) {
1936
1948
  const r = t.headerContentCleanups.get(n);
@@ -1955,11 +1967,11 @@ function gi(t, e) {
1955
1967
  };
1956
1968
  return o;
1957
1969
  }
1958
- function he(t, e, i) {
1970
+ function ue(t, e, i) {
1959
1971
  const o = t.querySelector(`[data-section="${e}"]`);
1960
1972
  o && o.classList.toggle("expanded", i);
1961
1973
  }
1962
- function pi(t, e, i) {
1974
+ function mi(t, e, i) {
1963
1975
  const o = e.toolPanels.get(i);
1964
1976
  if (!o?.render) return;
1965
1977
  const n = t.querySelector(`[data-section="${i}"] .tbw-accordion-content`);
@@ -1967,8 +1979,8 @@ function pi(t, e, i) {
1967
1979
  const r = o.render(n);
1968
1980
  r && e.panelCleanups.set(i, r);
1969
1981
  }
1970
- function wi(t, e, i, o) {
1971
- const n = nt(e), r = [], s = [
1982
+ function vi(t, e, i, o) {
1983
+ const n = st(e), r = [], s = [
1972
1984
  "tbw-grid-header",
1973
1985
  "tbw-grid-tool-buttons",
1974
1986
  "tbw-grid-tool-panel",
@@ -1982,62 +1994,62 @@ function wi(t, e, i, o) {
1982
1994
  for (const l of r)
1983
1995
  t.appendChild(l);
1984
1996
  if (n) {
1985
- const l = N(o?.toolPanel ?? M.toolPanel), a = N(o?.expand ?? M.expand), c = N(o?.collapse ?? M.collapse), f = [...e?.header?.toolbarContents ?? []].sort((y, S) => (y.order ?? 0) - (S.order ?? 0)), g = [...e?.toolPanels ?? []].sort((y, S) => (y.order ?? 100) - (S.order ?? 100)), p = {
1997
+ 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 = {
1986
1998
  title: e?.header?.title ?? void 0,
1987
1999
  hasPanels: g.length > 0,
1988
2000
  isPanelOpen: i.isPanelOpen,
1989
2001
  toolPanelIcon: l,
1990
- configButtons: f.map((y) => ({
1991
- id: y.id,
2002
+ configButtons: f.map((_) => ({
2003
+ id: _.id,
1992
2004
  hasElement: !1,
1993
- hasRender: !!y.render
2005
+ hasRender: !!_.render
1994
2006
  })),
1995
2007
  apiButtons: []
1996
- }, h = {
2008
+ }, d = {
1997
2009
  position: e?.toolPanel?.position ?? "right",
1998
2010
  isPanelOpen: i.isPanelOpen,
1999
2011
  expandIcon: a,
2000
2012
  collapseIcon: c,
2001
- panels: g.map((y) => ({
2002
- id: y.id,
2003
- title: y.title,
2004
- icon: N(y.icon),
2005
- isExpanded: i.expandedSections.has(y.id)
2013
+ panels: g.map((_) => ({
2014
+ id: _.id,
2015
+ title: _.title,
2016
+ icon: I(_.icon),
2017
+ isExpanded: i.expandedSections.has(_.id)
2006
2018
  }))
2007
- }, w = si(p), C = li(h), m = Oe({
2019
+ }, w = ci(u), v = di(d), b = ke({
2008
2020
  hasShell: !0,
2009
2021
  shellHeader: w,
2010
- shellBody: C
2022
+ shellBody: v
2011
2023
  });
2012
- t.appendChild(m);
2024
+ t.appendChild(b);
2013
2025
  } else {
2014
- const l = Oe({ hasShell: !1 });
2026
+ const l = ke({ hasShell: !1 });
2015
2027
  t.appendChild(l);
2016
2028
  }
2017
2029
  return n;
2018
2030
  }
2019
- const $e = "tbw-grid-styles";
2020
- let ee = "";
2021
- const ge = /* @__PURE__ */ new Map();
2022
- function bi() {
2023
- let t = document.getElementById($e);
2024
- return t || (t = document.createElement("style"), t.id = $e, t.setAttribute("data-tbw-grid", "true"), document.head.appendChild(t)), t;
2031
+ const Fe = "tbw-grid-styles";
2032
+ let te = "";
2033
+ const pe = /* @__PURE__ */ new Map();
2034
+ function Ci() {
2035
+ let t = document.getElementById(Fe);
2036
+ return t || (t = document.createElement("style"), t.id = Fe, t.setAttribute("data-tbw-grid", "true"), document.head.appendChild(t)), t;
2025
2037
  }
2026
- function pe() {
2027
- const t = bi(), e = Array.from(ge.values()).join(`
2038
+ function we() {
2039
+ const t = Ci(), e = Array.from(pe.values()).join(`
2028
2040
  `);
2029
- t.textContent = `${ee}
2041
+ t.textContent = `${te}
2030
2042
 
2031
2043
  /* Plugin Styles */
2032
2044
  ${e}`;
2033
2045
  }
2034
- function mi(t) {
2046
+ function yi(t) {
2035
2047
  let e = !1;
2036
2048
  for (const { name: i, styles: o } of t)
2037
- ge.has(i) || (ge.set(i, o), e = !0);
2038
- return e && pe(), e;
2049
+ pe.has(i) || (pe.set(i, o), e = !0);
2050
+ return e && we(), e;
2039
2051
  }
2040
- function vi() {
2052
+ function _i() {
2041
2053
  try {
2042
2054
  for (const t of Array.from(document.styleSheets))
2043
2055
  try {
@@ -2053,22 +2065,22 @@ function vi() {
2053
2065
  }
2054
2066
  return null;
2055
2067
  }
2056
- async function Ci(t) {
2057
- if (ee)
2068
+ async function Ei(t) {
2069
+ if (te)
2058
2070
  return;
2059
2071
  if (typeof t == "string" && t.length > 0) {
2060
- ee = t, pe();
2072
+ te = t, we();
2061
2073
  return;
2062
2074
  }
2063
2075
  await new Promise((i) => setTimeout(i, 50));
2064
- const e = vi();
2065
- e ? (ee = e, pe()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
2076
+ const e = _i();
2077
+ e ? (te = e, we()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
2066
2078
  "[tbw-grid] Could not find grid.css in document.styleSheets. Grid styling will not work.",
2067
2079
  "Available stylesheets:",
2068
2080
  Array.from(document.styleSheets).map((i) => i.href || "(inline)")
2069
2081
  );
2070
2082
  }
2071
- function yi() {
2083
+ function Si() {
2072
2084
  return {
2073
2085
  startY: null,
2074
2086
  startX: null,
@@ -2082,39 +2094,39 @@ function yi() {
2082
2094
  momentumRaf: 0
2083
2095
  };
2084
2096
  }
2085
- function _i(t) {
2097
+ function Ri(t) {
2086
2098
  t.startY = null, t.startX = null, t.scrollTop = null, t.scrollLeft = null, t.lastY = null, t.lastX = null, t.lastTime = null;
2087
2099
  }
2088
- function rt(t) {
2100
+ function lt(t) {
2089
2101
  t.momentumRaf && (cancelAnimationFrame(t.momentumRaf), t.momentumRaf = 0);
2090
2102
  }
2091
- function Ei(t, e, i) {
2103
+ function Ai(t, e, i) {
2092
2104
  if (t.touches.length !== 1) return;
2093
- rt(e);
2105
+ lt(e);
2094
2106
  const o = t.touches[0];
2095
2107
  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;
2096
2108
  }
2097
- function Si(t, e, i) {
2109
+ function Ti(t, e, i) {
2098
2110
  if (t.touches.length !== 1 || e.startY === null || e.startX === null || e.scrollTop === null || e.scrollLeft === null)
2099
2111
  return !1;
2100
2112
  const o = t.touches[0], n = o.clientY, r = o.clientX, s = performance.now(), l = e.startY - n, a = e.startX - r;
2101
2113
  if (e.lastTime !== null && e.lastY !== null && e.lastX !== null) {
2102
- const h = s - e.lastTime;
2103
- h > 0 && (e.velocityY = (e.lastY - n) / h, e.velocityX = (e.lastX - r) / h);
2114
+ const d = s - e.lastTime;
2115
+ d > 0 && (e.velocityY = (e.lastY - n) / d, e.velocityX = (e.lastX - r) / d);
2104
2116
  }
2105
2117
  e.lastY = n, e.lastX = r, e.lastTime = s;
2106
- const { scrollTop: c, scrollHeight: d, clientHeight: f } = i.fauxScrollbar, u = d - f, g = l > 0 && c < u || l < 0 && c > 0;
2107
- let p = !1;
2118
+ const { scrollTop: c, scrollHeight: h, clientHeight: f } = i.fauxScrollbar, p = h - f, g = l > 0 && c < p || l < 0 && c > 0;
2119
+ let u = !1;
2108
2120
  if (i.scrollArea) {
2109
- const { scrollLeft: h, scrollWidth: w, clientWidth: C } = i.scrollArea, m = w - C;
2110
- p = a > 0 && h < m || a < 0 && h > 0;
2121
+ const { scrollLeft: d, scrollWidth: w, clientWidth: v } = i.scrollArea, b = w - v;
2122
+ u = a > 0 && d < b || a < 0 && d > 0;
2111
2123
  }
2112
- return g && (i.fauxScrollbar.scrollTop = e.scrollTop + l), p && i.scrollArea && (i.scrollArea.scrollLeft = e.scrollLeft + a), g || p;
2124
+ return g && (i.fauxScrollbar.scrollTop = e.scrollTop + l), u && i.scrollArea && (i.scrollArea.scrollLeft = e.scrollLeft + a), g || u;
2113
2125
  }
2114
- function Ri(t, e) {
2115
- (Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Ai(t, e), _i(t);
2126
+ function xi(t, e) {
2127
+ (Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Hi(t, e), Ri(t);
2116
2128
  }
2117
- function Ai(t, e) {
2129
+ function Hi(t, e) {
2118
2130
  const n = () => {
2119
2131
  t.velocityY *= 0.95, t.velocityX *= 0.95;
2120
2132
  const r = t.velocityY * 16, s = t.velocityX * 16;
@@ -2122,19 +2134,19 @@ function Ai(t, e) {
2122
2134
  };
2123
2135
  t.momentumRaf = requestAnimationFrame(n);
2124
2136
  }
2125
- function Ti(t, e, i, o) {
2126
- t.addEventListener("touchstart", (n) => Ei(n, e, i), {
2137
+ function Li(t, e, i, o) {
2138
+ t.addEventListener("touchstart", (n) => Ai(n, e, i), {
2127
2139
  passive: !0,
2128
2140
  signal: o
2129
2141
  }), t.addEventListener(
2130
2142
  "touchmove",
2131
2143
  (n) => {
2132
- Si(n, e, i) && n.preventDefault();
2144
+ Ti(n, e, i) && n.preventDefault();
2133
2145
  },
2134
2146
  { passive: !1, signal: o }
2135
- ), t.addEventListener("touchend", () => Ri(e, i), { passive: !0, signal: o });
2147
+ ), t.addEventListener("touchend", () => xi(e, i), { passive: !0, signal: o });
2136
2148
  }
2137
- const xi = [
2149
+ const Pi = [
2138
2150
  {
2139
2151
  property: "editable",
2140
2152
  pluginName: "editing",
@@ -2174,7 +2186,7 @@ const xi = [
2174
2186
  description: 'the "sticky" column property (deprecated, use "pinned")',
2175
2187
  isUsed: (t) => t === "left" || t === "right" || t === "start" || t === "end"
2176
2188
  }
2177
- ], Hi = [
2189
+ ], zi = [
2178
2190
  {
2179
2191
  property: "columnGroups",
2180
2192
  pluginName: "groupingColumns",
@@ -2183,56 +2195,56 @@ const xi = [
2183
2195
  isUsed: (t) => Array.isArray(t) && t.length > 0
2184
2196
  }
2185
2197
  ];
2186
- function Li(t) {
2198
+ function Di(t) {
2187
2199
  return t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
2188
2200
  }
2189
- function we(t) {
2190
- return `import { ${z(t)}Plugin } from '@toolbox-web/grid/plugins/${Li(t)}';`;
2201
+ function be(t) {
2202
+ return `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${Di(t)}';`;
2191
2203
  }
2192
- function z(t) {
2204
+ function D(t) {
2193
2205
  return t.charAt(0).toUpperCase() + t.slice(1);
2194
2206
  }
2195
- function We(t, e) {
2207
+ function Ue(t, e) {
2196
2208
  return t.some((i) => i.name === e);
2197
2209
  }
2198
- function Pi(t, e) {
2199
- const i = xi, o = Hi, n = /* @__PURE__ */ new Map();
2200
- function r(l, a, c, d, f = !1) {
2210
+ function Oi(t, e) {
2211
+ const i = Pi, o = zi, n = /* @__PURE__ */ new Map();
2212
+ function r(l, a, c, h, f = !1) {
2201
2213
  n.has(l) || n.set(l, { description: a, importHint: c, fields: [], isConfigProperty: f });
2202
- const u = n.get(l);
2203
- u.fields.includes(d) || u.fields.push(d);
2214
+ const p = n.get(l);
2215
+ p.fields.includes(h) || p.fields.push(h);
2204
2216
  }
2205
2217
  for (const l of o) {
2206
2218
  const a = t[l.property];
2207
- (l.isUsed ? l.isUsed(a) : a !== void 0) && !We(e, l.pluginName) && r(l.pluginName, l.description, we(l.pluginName), l.property, !0);
2219
+ (l.isUsed ? l.isUsed(a) : a !== void 0) && !Ue(e, l.pluginName) && r(l.pluginName, l.description, be(l.pluginName), l.property, !0);
2208
2220
  }
2209
2221
  const s = t.columns;
2210
2222
  if (s && s.length > 0)
2211
2223
  for (const l of s)
2212
2224
  for (const a of i) {
2213
2225
  const c = l[a.property];
2214
- if ((a.isUsed ? a.isUsed(c) : c !== void 0) && !We(e, a.pluginName)) {
2226
+ if ((a.isUsed ? a.isUsed(c) : c !== void 0) && !Ue(e, a.pluginName)) {
2215
2227
  const f = l.field || "<unknown>";
2216
- r(a.pluginName, a.description, we(a.pluginName), f);
2228
+ r(a.pluginName, a.description, be(a.pluginName), f);
2217
2229
  }
2218
2230
  }
2219
2231
  if (n.size > 0) {
2220
2232
  const l = [];
2221
- for (const [a, { description: c, importHint: d, fields: f, isConfigProperty: u }] of n)
2222
- if (u)
2233
+ for (const [a, { description: c, importHint: h, fields: f, isConfigProperty: p }] of n)
2234
+ if (p)
2223
2235
  l.push(
2224
2236
  `Config uses ${c}, but the required plugin is not loaded.
2225
2237
  → Add the plugin to your gridConfig.plugins array:
2226
- ${d}
2227
- plugins: [new ${z(a)}Plugin(), ...]`
2238
+ ${h}
2239
+ plugins: [new ${D(a)}Plugin(), ...]`
2228
2240
  );
2229
2241
  else {
2230
2242
  const g = f.slice(0, 3).join(", ") + (f.length > 3 ? `, ... (${f.length} total)` : "");
2231
2243
  l.push(
2232
2244
  `Column(s) [${g}] use ${c}, but the required plugin is not loaded.
2233
2245
  → Add the plugin to your gridConfig.plugins array:
2234
- ${d}
2235
- plugins: [new ${z(a)}Plugin(), ...]`
2246
+ ${h}
2247
+ plugins: [new ${D(a)}Plugin(), ...]`
2236
2248
  );
2237
2249
  }
2238
2250
  throw new Error(
@@ -2246,7 +2258,7 @@ This validation helps catch misconfigurations early. The properties listed above
2246
2258
  );
2247
2259
  }
2248
2260
  }
2249
- function zi(t) {
2261
+ function Mi(t) {
2250
2262
  const e = [], i = [];
2251
2263
  for (const o of t) {
2252
2264
  const r = o.constructor.manifest;
@@ -2254,12 +2266,12 @@ function zi(t) {
2254
2266
  for (const s of r.configRules) {
2255
2267
  const l = o.config;
2256
2268
  if (s.check(l)) {
2257
- const c = `${`[tbw-grid:${z(o.name)}Plugin]`} Configuration warning: ${s.message}`;
2269
+ const c = `${`[tbw-grid:${D(o.name)}Plugin]`} Configuration warning: ${s.message}`;
2258
2270
  s.severity === "error" ? e.push(c) : i.push(c);
2259
2271
  }
2260
2272
  }
2261
2273
  }
2262
- if (i.length > 0 && me())
2274
+ if (i.length > 0 && ve())
2263
2275
  for (const o of i)
2264
2276
  console.warn(o);
2265
2277
  if (e.length > 0)
@@ -2269,30 +2281,30 @@ ${e.join(`
2269
2281
 
2270
2282
  `)}`);
2271
2283
  }
2272
- function Di(t, e) {
2284
+ function ki(t, e) {
2273
2285
  const i = t.name, n = t.constructor.dependencies ?? [];
2274
2286
  for (const r of n) {
2275
2287
  const s = r.name, l = r.required ?? !0, a = r.reason;
2276
- if (!e.some((d) => d.name === s)) {
2277
- const d = a ?? `${z(i)}Plugin requires ${z(s)}Plugin`, f = we(s);
2288
+ if (!e.some((h) => h.name === s)) {
2289
+ const h = a ?? `${D(i)}Plugin requires ${D(s)}Plugin`, f = be(s);
2278
2290
  if (l)
2279
2291
  throw new Error(
2280
2292
  `[tbw-grid] Plugin dependency error:
2281
2293
 
2282
- ${d}.
2294
+ ${h}.
2283
2295
 
2284
- → Add the plugin to your gridConfig.plugins array BEFORE ${z(i)}Plugin:
2296
+ → Add the plugin to your gridConfig.plugins array BEFORE ${D(i)}Plugin:
2285
2297
  ${f}
2286
- plugins: [new ${z(s)}Plugin(), new ${z(i)}Plugin()]`
2298
+ plugins: [new ${D(s)}Plugin(), new ${D(i)}Plugin()]`
2287
2299
  );
2288
2300
  console.info(
2289
- `[tbw-grid] ${z(i)}Plugin: Optional "${s}" plugin not found. Some features may be unavailable.`
2301
+ `[tbw-grid] ${D(i)}Plugin: Optional "${s}" plugin not found. Some features may be unavailable.`
2290
2302
  );
2291
2303
  }
2292
2304
  }
2293
2305
  }
2294
- function Oi(t) {
2295
- if (!me()) return;
2306
+ function Ni(t) {
2307
+ if (!ve()) return;
2296
2308
  const e = new Set(t.map((o) => o.name)), i = /* @__PURE__ */ new Set();
2297
2309
  for (const o of t) {
2298
2310
  const r = o.constructor.manifest;
@@ -2304,7 +2316,7 @@ function Oi(t) {
2304
2316
  i.add(l), console.warn(
2305
2317
  `[tbw-grid] Plugin incompatibility warning:
2306
2318
 
2307
- ${z(o.name)}Plugin and ${z(s.name)}Plugin are both loaded, but they are currently incompatible.
2319
+ ${D(o.name)}Plugin and ${D(s.name)}Plugin are both loaded, but they are currently incompatible.
2308
2320
 
2309
2321
  → ${s.reason}
2310
2322
 
@@ -2314,31 +2326,31 @@ ${z(o.name)}Plugin and ${z(s.name)}Plugin are both loaded, but they are currentl
2314
2326
  }
2315
2327
  }
2316
2328
  }
2317
- function st(t, e) {
2329
+ function at(t, e) {
2318
2330
  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;
2319
2331
  }
2320
- function Mi(t, e, i) {
2321
- const o = st(e, i);
2332
+ function Ii(t, e, i) {
2333
+ const o = at(e, i);
2322
2334
  if (typeof o == "string")
2323
2335
  return t.byKey.get(o);
2324
2336
  if (o && typeof o == "object")
2325
2337
  return t.byRef.get(o);
2326
2338
  }
2327
- function ki(t, e, i, o) {
2328
- const n = st(e, o);
2339
+ function qi(t, e, i, o) {
2340
+ const n = at(e, o);
2329
2341
  typeof n == "string" ? t.byKey.set(n, i) : n && typeof n == "object" && t.byRef.set(n, i);
2330
2342
  }
2331
- function Ni(t, e, i, o, n) {
2343
+ function $i(t, e, i, o, n) {
2332
2344
  const r = new Array(t.length);
2333
2345
  let s = 0;
2334
2346
  for (let l = 0; l < t.length; l++) {
2335
2347
  const a = t[l];
2336
- let c = n?.(a, l), d = c !== void 0;
2337
- c === void 0 && (c = Mi(e, a, o.rowId), d = c !== void 0), c === void 0 && (c = i, d = !1), r[l] = { offset: s, height: c, measured: d }, s += c;
2348
+ let c = n?.(a, l), h = c !== void 0;
2349
+ 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;
2338
2350
  }
2339
2351
  return r;
2340
2352
  }
2341
- function be(t, e, i) {
2353
+ function me(t, e, i) {
2342
2354
  if (e < 0 || e >= t.length) return;
2343
2355
  const o = t[e], n = i - o.height;
2344
2356
  if (n !== 0) {
@@ -2347,12 +2359,12 @@ function be(t, e, i) {
2347
2359
  t[r].offset += n;
2348
2360
  }
2349
2361
  }
2350
- function Ii(t) {
2362
+ function Wi(t) {
2351
2363
  if (t.length === 0) return 0;
2352
2364
  const e = t[t.length - 1];
2353
2365
  return e.offset + e.height;
2354
2366
  }
2355
- function Fe(t, e) {
2367
+ function Ve(t, e) {
2356
2368
  if (t.length === 0) return -1;
2357
2369
  if (e <= 0) return 0;
2358
2370
  let i = 0, o = t.length - 1;
@@ -2367,42 +2379,42 @@ function Fe(t, e) {
2367
2379
  }
2368
2380
  return Math.max(0, Math.min(i, t.length - 1));
2369
2381
  }
2370
- function qi(t, e) {
2382
+ function Fi(t, e) {
2371
2383
  let i = 0, o = 0;
2372
2384
  for (const n of t)
2373
2385
  n.measured && (i += n.height, o++);
2374
2386
  return o > 0 ? i / o : e;
2375
2387
  }
2376
- function $i(t) {
2388
+ function Ui(t) {
2377
2389
  let e = 0;
2378
2390
  for (const i of t)
2379
2391
  i.measured && e++;
2380
2392
  return e;
2381
2393
  }
2382
- function Wi(t, e) {
2394
+ function Vi(t, e) {
2383
2395
  const { positionCache: i, heightCache: o, rows: n, start: r, end: s, getPluginHeight: l, getRowId: a } = t;
2384
2396
  let c = !1;
2385
- e.forEach((u) => {
2386
- const g = u.dataset.rowIndex;
2397
+ e.forEach((p) => {
2398
+ const g = p.dataset.rowIndex;
2387
2399
  if (!g) return;
2388
- const p = parseInt(g, 10);
2389
- if (p < r || p >= s || p >= n.length) return;
2390
- const h = n[p], w = l?.(h, p);
2400
+ const u = parseInt(g, 10);
2401
+ if (u < r || u >= s || u >= n.length) return;
2402
+ const d = n[u], w = l?.(d, u);
2391
2403
  if (w !== void 0) {
2392
- const m = i[p];
2393
- (!m.measured || Math.abs(m.height - w) > 1) && (be(i, p, w), c = !0);
2404
+ const b = i[u];
2405
+ (!b.measured || Math.abs(b.height - w) > 1) && (me(i, u, w), c = !0);
2394
2406
  return;
2395
2407
  }
2396
- const C = u.offsetHeight;
2397
- if (C > 0) {
2398
- const m = i[p];
2399
- (!m.measured || Math.abs(m.height - C) > 1) && (be(i, p, C), ki(o, h, C, a), c = !0);
2408
+ const v = p.offsetHeight;
2409
+ if (v > 0) {
2410
+ const b = i[u];
2411
+ (!b.measured || Math.abs(b.height - v) > 1) && (me(i, u, v), qi(o, d, v, a), c = !0);
2400
2412
  }
2401
2413
  });
2402
- const d = c ? $i(i) : 0, f = c ? qi(i, t.defaultHeight) : 0;
2403
- return { hasChanges: c, measuredCount: d, averageHeight: f };
2414
+ const h = c ? Ui(i) : 0, f = c ? Fi(i, t.defaultHeight) : 0;
2415
+ return { hasChanges: c, measuredCount: h, averageHeight: f };
2404
2416
  }
2405
- function Fi(t, e, i, o) {
2417
+ function Bi(t, e, i, o) {
2406
2418
  let n = 0, r = 0;
2407
2419
  for (let s = 0; s < t.length; s++) {
2408
2420
  const l = t[s];
@@ -2413,7 +2425,7 @@ function Fi(t, e, i, o) {
2413
2425
  averageHeight: n > 0 ? r / n : i
2414
2426
  };
2415
2427
  }
2416
- function to(t) {
2428
+ function no(t) {
2417
2429
  const { totalRows: e, viewportHeight: i, scrollTop: o, rowHeight: n, overscan: r } = t, s = Math.ceil(i / n);
2418
2430
  let l = Math.floor(o / n) - r;
2419
2431
  l < 0 && (l = 0);
@@ -2425,10 +2437,10 @@ function to(t) {
2425
2437
  totalHeight: e * n
2426
2438
  };
2427
2439
  }
2428
- function io(t, e) {
2440
+ function ro(t, e) {
2429
2441
  return t <= e;
2430
2442
  }
2431
- class oe {
2443
+ class ne {
2432
2444
  constructor(e) {
2433
2445
  this.grid = e;
2434
2446
  }
@@ -2448,7 +2460,7 @@ class oe {
2448
2460
  this.attach(i);
2449
2461
  }
2450
2462
  attach(e) {
2451
- if (Di(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
2463
+ if (ki(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
2452
2464
  for (const [i, o] of Object.entries(e.cellRenderers))
2453
2465
  this.cellRenderers.set(i, o);
2454
2466
  if (e.headerRenderers)
@@ -2471,9 +2483,9 @@ class oe {
2471
2483
  }
2472
2484
  warnDeprecatedHooks(e) {
2473
2485
  const i = e.constructor;
2474
- if (oe.deprecationWarned.has(i) || !me()) return;
2486
+ if (ne.deprecationWarned.has(i) || !ve()) return;
2475
2487
  const o = typeof e.getExtraHeight == "function" || typeof e.getExtraHeightBefore == "function", n = typeof e.getRowHeight == "function";
2476
- o && !n && (oe.deprecationWarned.add(i), console.warn(
2488
+ o && !n && (ne.deprecationWarned.add(i), console.warn(
2477
2489
  `[tbw-grid] Deprecation warning: "${e.name}" uses getExtraHeight() / getExtraHeightBefore() which are deprecated and will be removed in v3.0.
2478
2490
  → Migrate to getRowHeight(row, index) for better variable row height support.
2479
2491
  → See: https://toolbox-web.dev/docs/grid/plugins/migration#row-height-hooks`
@@ -2713,7 +2725,7 @@ class oe {
2713
2725
  return e.sort((i, o) => (i.content.order ?? 0) - (o.content.order ?? 0));
2714
2726
  }
2715
2727
  }
2716
- const Ui = "@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}}", Vi = '@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)}}}', Bi = '@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}}}}}', Gi = '@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}}}', Xi = "@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}}}}", Yi = "@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}}}", Ki = "@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}}}", Qi = "@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)}}", Zi = `/**
2728
+ 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 = `/**
2717
2729
  * tbw-grid Light DOM Styles
2718
2730
  *
2719
2731
  * This stylesheet uses CSS nesting to scope all styles to the tbw-grid element.
@@ -2732,19 +2744,19 @@ const Ui = "@layer tbw-base{tbw-grid{.tbw-expanding{animation:tbw-expand var(--t
2732
2744
  /* Declare layer order - earlier layers have lower priority */
2733
2745
  @layer tbw-base, tbw-plugins, tbw-theme;
2734
2746
 
2735
- ${Qi}
2736
- ${Vi}
2737
- ${Bi}
2747
+ ${eo}
2748
+ ${Xi}
2738
2749
  ${Yi}
2750
+ ${Qi}
2751
+ ${Zi}
2752
+ ${Ji}
2739
2753
  ${ji}
2740
- ${Ki}
2741
2754
  ${Gi}
2742
- ${Ui}
2743
- ${Xi}
2755
+ ${Ki}
2744
2756
  `;
2745
2757
  class k extends HTMLElement {
2746
2758
  static tagName = "tbw-grid";
2747
- static version = "1.15.0";
2759
+ static version = "1.16.0";
2748
2760
  static #l = 0;
2749
2761
  static adapters = [];
2750
2762
  static registerAdapter(e) {
@@ -2784,7 +2796,7 @@ class k extends HTMLElement {
2784
2796
  #x = !1;
2785
2797
  #m = 0;
2786
2798
  #z;
2787
- #N = yi();
2799
+ #N = Si();
2788
2800
  #b;
2789
2801
  #y;
2790
2802
  #p;
@@ -2804,7 +2816,7 @@ class k extends HTMLElement {
2804
2816
  #V;
2805
2817
  #O;
2806
2818
  #t;
2807
- #i = ai();
2819
+ #i = hi();
2808
2820
  #c;
2809
2821
  #q;
2810
2822
  #M = !1;
@@ -2941,28 +2953,28 @@ class k extends HTMLElement {
2941
2953
  return this.#b || (this.#b = new AbortController()), this.#b.signal;
2942
2954
  }
2943
2955
  constructor() {
2944
- super(), this.#be(), this.#d = new Promise((e) => this.#h = e), this.#s = new Zt({
2956
+ super(), this.#be(), this.#d = new Promise((e) => this.#h = e), this.#s = new ti({
2945
2957
  mergeConfig: () => {
2946
- this.#t.parseLightDomColumns(this), this.#t.merge(), this.#te(), Pi(this.#o, this.#e?.getPlugins() ?? []), zi(this.#e?.getPlugins() ?? []), Oi(this.#e?.getPlugins() ?? []), this.#ze(), this.#B = [...this._columns];
2958
+ 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];
2947
2959
  },
2948
2960
  processColumns: () => this.#xe(),
2949
2961
  processRows: () => this.#Le(),
2950
- renderHeader: () => ie(this),
2951
- updateTemplate: () => U(this),
2962
+ renderHeader: () => oe(this),
2963
+ updateTemplate: () => V(this),
2952
2964
  renderVirtualWindow: () => this.refreshVirtualWindow(!0, !0),
2953
2965
  afterRender: () => {
2954
2966
  this.#e?.afterRender(), this._virtualization.enabled && this._virtualization.totalHeightEl && queueMicrotask(() => {
2955
2967
  if (!this._virtualization.totalHeightEl) return;
2956
2968
  const i = this.#T(this._rows.length);
2957
2969
  this._virtualization.totalHeightEl.style.height = `${i}px`;
2958
- }), this.#o.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, Se(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, q(this)), this._virtualization.enabled && !this.#F && this.#Ce(), this.#x && (this.#x = !1, requestAnimationFrame(() => {
2970
+ }), 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(() => {
2959
2971
  requestAnimationFrame(() => {
2960
2972
  this.#ve();
2961
2973
  });
2962
2974
  })), this.#M && this.#he();
2963
2975
  },
2964
2976
  isConnected: () => this.isConnected && this.#f
2965
- }), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = gi(this.#i, {
2977
+ }), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = bi(this.#i, {
2966
2978
  getShadow: () => this.#n,
2967
2979
  getShellConfig: () => this.#o?.shell,
2968
2980
  getAccordionIcons: () => ({
@@ -2971,23 +2983,23 @@ class k extends HTMLElement {
2971
2983
  }),
2972
2984
  emit: (e, i) => this.#L(e, i),
2973
2985
  refreshShellHeader: () => this.refreshShellHeader()
2974
- }), this.#t = new Tt({
2986
+ }), this.#t = new Lt({
2975
2987
  getRows: () => this.#a,
2976
2988
  getSortState: () => this._sortState,
2977
2989
  setSortState: (e) => {
2978
2990
  this._sortState = e;
2979
2991
  },
2980
2992
  onConfigChange: () => {
2981
- this.#s.requestPhase(x.FULL, "configChange");
2993
+ this.#s.requestPhase(A.FULL, "configChange");
2982
2994
  },
2983
2995
  emit: (e, i) => this.#L(e, i),
2984
2996
  clearRowPool: () => {
2985
2997
  this._rowPool.length = 0, this._bodyEl && (this._bodyEl.innerHTML = ""), this.__rowRenderEpoch++;
2986
2998
  },
2987
2999
  setup: () => this.#P(),
2988
- renderHeader: () => ie(this),
2989
- updateTemplate: () => U(this),
2990
- refreshVirtualWindow: () => this.#s.requestPhase(x.VIRTUALIZATION, "configManager"),
3000
+ renderHeader: () => oe(this),
3001
+ updateTemplate: () => V(this),
3002
+ refreshVirtualWindow: () => this.#s.requestPhase(A.VIRTUALIZATION, "configManager"),
2991
3003
  getVirtualization: () => this._virtualization,
2992
3004
  setRowHeight: (e) => {
2993
3005
  this._virtualization.rowHeight = e;
@@ -3002,7 +3014,7 @@ class k extends HTMLElement {
3002
3014
  });
3003
3015
  }
3004
3016
  async #be() {
3005
- await Ci(Zi);
3017
+ await Ei(to);
3006
3018
  }
3007
3019
  getPlugin(e) {
3008
3020
  return this.#e?.getPlugin(e);
@@ -3011,28 +3023,28 @@ class k extends HTMLElement {
3011
3023
  return this.#e?.getPluginByName(e);
3012
3024
  }
3013
3025
  requestRender() {
3014
- this.#s.requestPhase(x.ROWS, "plugin:requestRender");
3026
+ this.#s.requestPhase(A.ROWS, "plugin:requestRender");
3015
3027
  }
3016
3028
  requestColumnsRender() {
3017
- this.#s.requestPhase(x.COLUMNS, "plugin:requestColumnsRender");
3029
+ this.#s.requestPhase(A.COLUMNS, "plugin:requestColumnsRender");
3018
3030
  }
3019
3031
  requestRenderWithFocus() {
3020
- this._restoreFocusAfterRender = !0, this.#s.requestPhase(x.ROWS, "plugin:requestRenderWithFocus");
3032
+ this._restoreFocusAfterRender = !0, this.#s.requestPhase(A.ROWS, "plugin:requestRenderWithFocus");
3021
3033
  }
3022
3034
  updateTemplate() {
3023
- U(this);
3035
+ V(this);
3024
3036
  }
3025
3037
  requestAfterRender() {
3026
- this.#s.requestPhase(x.STYLE, "plugin:requestAfterRender");
3038
+ this.#s.requestPhase(A.STYLE, "plugin:requestAfterRender");
3027
3039
  }
3028
3040
  #ee() {
3029
- this.#e = new oe(this);
3041
+ this.#e = new ne(this);
3030
3042
  const e = this.#o?.plugins, i = Array.isArray(e) ? e : [];
3031
3043
  this.#e.attachAll(i);
3032
3044
  }
3033
3045
  #W() {
3034
3046
  const e = this.#e?.getPluginStyles() ?? [];
3035
- mi(e);
3047
+ yi(e);
3036
3048
  }
3037
3049
  #te() {
3038
3050
  const e = this.#o?.plugins, i = Array.isArray(e) ? e : [];
@@ -3090,9 +3102,9 @@ class k extends HTMLElement {
3090
3102
  };
3091
3103
  }
3092
3104
  connectedCallback() {
3093
- 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 && (ze(this.#S), this.#S = void 0), this.#k(), this.#t.parseLightDomColumns(this), this.#t.merge(), this.#ee();
3105
+ 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();
3094
3106
  const e = this.#o?.plugins;
3095
- this.#_ = Array.isArray(e) ? e : [], this.#ie(), this.#u || (this.#Z(), this.#W(), this.#u = !0), this.#ne(), this.#S = Vt(
3107
+ this.#_ = Array.isArray(e) ? e : [], this.#ie(), this.#u || (this.#Z(), this.#W(), this.#u = !0), this.#ne(), this.#S = Xt(
3096
3108
  () => {
3097
3109
  this.#ke();
3098
3110
  },
@@ -3100,7 +3112,7 @@ class k extends HTMLElement {
3100
3112
  );
3101
3113
  }
3102
3114
  disconnectedCallback() {
3103
- this.#S && (ze(this.#S), this.#S = void 0), this.#m && (clearTimeout(this.#m), this.#m = 0), this.#me(), fi(this.#i), this.#c.setInitialized(!1), this.#q?.(), this.#q = void 0, rt(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), X(this), this.#A.clear(), this.#_ = void 0;
3115
+ 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;
3104
3116
  for (const e of this._rowPool)
3105
3117
  e.remove();
3106
3118
  this._rowPool.length = 0, this.__rowsBodyEl = null, this.#f = !1;
@@ -3124,15 +3136,15 @@ class k extends HTMLElement {
3124
3136
  #ne() {
3125
3137
  const i = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
3126
3138
  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) {
3127
- fe(this.#n, this.#i), ce(this.#n, this.#o?.shell, this.#i);
3139
+ ge(this.#n, this.#i), de(this.#n, this.#o?.shell, this.#i);
3128
3140
  const n = this.#o?.shell?.toolPanel?.defaultOpen;
3129
3141
  n && this.#i.toolPanels.has(n) && (this.openToolPanel(), this.#i.expandedSections.add(n));
3130
3142
  }
3131
- if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = De(this), this.#P(), this.#G(i), this.#I)
3143
+ if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Me(this), this.#P(), this.#G(i), this.#I)
3132
3144
  return;
3133
3145
  this.#I = !0;
3134
3146
  const o = this.disconnectSignal;
3135
- qt(this, this, this.#n, o), this.#re(), queueMicrotask(() => this.#ye()), this.#s.requestPhase(x.FULL, "afterConnect");
3147
+ Ft(this, this, this.#n, o), this.#re(), queueMicrotask(() => this.#ye()), this.#s.requestPhase(A.FULL, "afterConnect");
3136
3148
  }
3137
3149
  #re() {
3138
3150
  const e = this.#o.rowHeight, i = this.#e.hasRowHeightPlugin();
@@ -3150,7 +3162,7 @@ class k extends HTMLElement {
3150
3162
  l > o && (o = l);
3151
3163
  });
3152
3164
  const n = e.getBoundingClientRect(), r = Math.max(n.height, o);
3153
- r > 0 && Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r, this.#s.requestPhase(x.VIRTUALIZATION, "measureRowHeight"));
3165
+ r > 0 && Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r, this.#s.requestPhase(A.VIRTUALIZATION, "measureRowHeight"));
3154
3166
  }
3155
3167
  #ve() {
3156
3168
  const e = this._bodyEl?.querySelector(".data-grid-row");
@@ -3179,15 +3191,15 @@ class k extends HTMLElement {
3179
3191
  if (this._rows.length <= this._virtualization.bypassThreshold)
3180
3192
  n.style.transform = `translateY(${-a}px)`;
3181
3193
  else {
3182
- const d = this._virtualization.positionCache;
3183
- let f, u;
3184
- if (this._virtualization.variableHeights && d && d.length > 0) {
3185
- f = Fe(d, a), f === -1 && (f = 0);
3186
- const p = f - f % 2;
3187
- u = d[p]?.offset ?? p * c;
3194
+ const h = this._virtualization.positionCache;
3195
+ let f, p;
3196
+ if (this._virtualization.variableHeights && h && h.length > 0) {
3197
+ f = Ve(h, a), f === -1 && (f = 0);
3198
+ const u = f - f % 2;
3199
+ p = h[u]?.offset ?? u * c;
3188
3200
  } else
3189
- f = Math.floor(a / c), u = (f - f % 2) * c;
3190
- const g = -(a - u);
3201
+ f = Math.floor(a / c), p = (f - f % 2) * c;
3202
+ const g = -(a - p);
3191
3203
  n.style.transform = `translateY(${g}px)`;
3192
3204
  }
3193
3205
  this.#r = a, this.#C || (this.#C = requestAnimationFrame(() => {
@@ -3211,23 +3223,23 @@ class k extends HTMLElement {
3211
3223
  (a) => {
3212
3224
  const c = a.shiftKey || Math.abs(a.deltaX) > Math.abs(a.deltaY);
3213
3225
  if (c && l) {
3214
- const d = a.shiftKey ? a.deltaY : a.deltaX, { scrollLeft: f, scrollWidth: u, clientWidth: g } = l;
3215
- (d > 0 && f < u - g || d < 0 && f > 0) && (a.preventDefault(), l.scrollLeft += d);
3226
+ const h = a.shiftKey ? a.deltaY : a.deltaX, { scrollLeft: f, scrollWidth: p, clientWidth: g } = l;
3227
+ (h > 0 && f < p - g || h < 0 && f > 0) && (a.preventDefault(), l.scrollLeft += h);
3216
3228
  } else if (!c) {
3217
- const { scrollTop: d, scrollHeight: f, clientHeight: u } = o;
3218
- (a.deltaY > 0 && d < f - u || a.deltaY < 0 && d > 0) && (a.preventDefault(), o.scrollTop += a.deltaY);
3229
+ const { scrollTop: h, scrollHeight: f, clientHeight: p } = o;
3230
+ (a.deltaY > 0 && h < f - p || a.deltaY < 0 && h > 0) && (a.preventDefault(), o.scrollTop += a.deltaY);
3219
3231
  }
3220
3232
  },
3221
3233
  { passive: !1, signal: i }
3222
- ), Ti(
3234
+ ), Li(
3223
3235
  s,
3224
3236
  this.#N,
3225
3237
  { fauxScrollbar: o, scrollArea: l },
3226
3238
  i
3227
3239
  ));
3228
3240
  }
3229
- this._bodyEl && It(this, this._bodyEl, i), this.#y?.disconnect(), this._virtualization.viewportEl && (this.#y = new ResizeObserver(() => {
3230
- this.#Ne(), this.#s.requestPhase(x.VIRTUALIZATION, "resize-observer");
3241
+ this._bodyEl && Wt(this, this._bodyEl, i), this.#y?.disconnect(), this._virtualization.viewportEl && (this.#y = new ResizeObserver(() => {
3242
+ this.#Ne(), this.#s.requestPhase(A.VIRTUALIZATION, "resize-observer");
3231
3243
  }), this.#y.observe(this._virtualization.viewportEl)), this.#n.addEventListener(
3232
3244
  "focusin",
3233
3245
  () => {
@@ -3289,7 +3301,7 @@ class k extends HTMLElement {
3289
3301
  e.columns && this.#Se(), e.rows && this.#le(), e.fitMode && this.#Re();
3290
3302
  }
3291
3303
  #le() {
3292
- this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#X(), this.#s.requestPhase(x.ROWS, "applyRowsUpdate");
3304
+ this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#X(), this.#s.requestPhase(A.ROWS, "applyRowsUpdate");
3293
3305
  }
3294
3306
  #X() {
3295
3307
  this.#R.clear();
@@ -3315,23 +3327,23 @@ class k extends HTMLElement {
3315
3327
  return o;
3316
3328
  }
3317
3329
  #Se() {
3318
- X(this), this.#t.merge(), this.#P();
3330
+ Y(this), this.#t.merge(), this.#P();
3319
3331
  }
3320
3332
  #Re() {
3321
- this.#t.merge(), this.#o.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, Se(this)) : (this._columns.forEach((i) => {
3333
+ this.#t.merge(), this.#o.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, Re(this)) : (this._columns.forEach((i) => {
3322
3334
  !i.__userResized && i.__autoSized && delete i.width;
3323
- }), U(this));
3335
+ }), V(this));
3324
3336
  }
3325
3337
  #Ae() {
3326
- Me(this, this.#i), ke(this, this.#i);
3338
+ Ne(this, this.#i), Ie(this, this.#i);
3327
3339
  const e = !!this.#n.querySelector(".has-shell"), i = !!this.#n.querySelector(".tbw-tool-panel"), o = this.#n.querySelectorAll(".tbw-accordion-section").length;
3328
- this.#t.parseLightDomColumns(this), this.#t.merge(), this.#te(), Ne(this, this.#i, this.#oe()), this.#t.markSourcesChanged(), this.#t.merge();
3329
- const n = nt(this.#o?.shell), r = (this.#o?.shell?.toolPanels?.length ?? 0) > 0, s = this.#o?.shell?.toolPanels?.length ?? 0;
3340
+ this.#t.parseLightDomColumns(this), this.#t.merge(), this.#te(), qe(this, this.#i, this.#oe()), this.#t.markSourcesChanged(), this.#t.merge();
3341
+ const n = st(this.#o?.shell), r = (this.#o?.shell?.toolPanels?.length ?? 0) > 0, s = this.#o?.shell?.toolPanels?.length ?? 0;
3330
3342
  if (e !== n || !i && r || i && s !== o) {
3331
- de(this.#i), this.#Z(), this.#W(), this.#ne(), this.#X();
3343
+ he(this.#i), this.#Z(), this.#W(), this.#ne(), this.#X();
3332
3344
  return;
3333
3345
  }
3334
- e && this.#Te(), this.#X(), this.#s.requestPhase(x.COLUMNS, "applyGridConfigUpdate");
3346
+ e && this.#Te(), this.#X(), this.#s.requestPhase(A.COLUMNS, "applyGridConfigUpdate");
3335
3347
  }
3336
3348
  #Te() {
3337
3349
  const e = this.#n.querySelector(".tbw-shell-header");
@@ -3370,39 +3382,39 @@ class k extends HTMLElement {
3370
3382
  return l.push(...s), l;
3371
3383
  }
3372
3384
  #Le() {
3373
- X(this);
3385
+ Y(this);
3374
3386
  const e = Array.isArray(this.#a) ? [...this.#a] : [], i = this.#e?.processRows(e) ?? e;
3375
3387
  this._rows = i, this._virtualization.variableHeights && this.#Q();
3376
3388
  }
3377
3389
  #Pe(e) {
3378
3390
  const i = {
3379
- ...ht,
3391
+ ...ft,
3380
3392
  ...e.animation
3381
3393
  }, o = i.mode ?? "reduced-motion";
3382
3394
  let n = 1;
3383
3395
  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;
3384
3396
  }
3385
3397
  #Y(e, i, o = this.__rowRenderEpoch) {
3386
- if (this.#z || (this.#z = (n, r, s) => this.#e?.renderRow(n, r, s) ?? !1), zt(this, e, i, o, this.#z), this.#E.size > 0)
3398
+ 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)
3387
3399
  for (const n of this.#E)
3388
3400
  this.#j(n, !0);
3389
3401
  }
3390
- #ce = lt();
3402
+ #ce = ct();
3391
3403
  #de(e, i) {
3392
- at(this.#ce, this.__rowsBodyEl, this._bodyEl, e, i);
3404
+ dt(this.#ce, this.__rowsBodyEl, this._bodyEl, e, i);
3393
3405
  }
3394
3406
  #ze() {
3395
- dt(this.#ce, this.__rowsBodyEl, this.#o, this.#i);
3407
+ ut(this.#ce, this.__rowsBodyEl, this.#o, this.#i);
3396
3408
  }
3397
3409
  #he() {
3398
3410
  const e = this.querySelector(".tbw-grid-root");
3399
- e && (this.#M ? (this.#$ || (this.#$ = Xt(this.#o?.loadingRenderer)), Yt(e, this.#$)) : jt(this.#$));
3411
+ e && (this.#M ? (this.#$ || (this.#$ = Kt(this.#o?.loadingRenderer)), Qt(e, this.#$)) : Zt(this.#$));
3400
3412
  }
3401
3413
  #j(e, i) {
3402
3414
  const o = this.#R.get(e);
3403
3415
  if (!o) return;
3404
3416
  const n = this.findRenderedRowElement?.(o.index);
3405
- n && Kt(n, i);
3417
+ n && Jt(n, i);
3406
3418
  }
3407
3419
  #ue(e, i, o) {
3408
3420
  const n = this.#R.get(e);
@@ -3412,7 +3424,7 @@ class k extends HTMLElement {
3412
3424
  const s = this._visibleColumns.findIndex((a) => a.field === i);
3413
3425
  if (s < 0) return;
3414
3426
  const l = r.children[s];
3415
- l && Qt(l, o);
3427
+ l && ei(l, o);
3416
3428
  }
3417
3429
  #P() {
3418
3430
  if (this.isConnected && !(!this._headerRowEl || !this._bodyEl)) {
@@ -3422,7 +3434,7 @@ class k extends HTMLElement {
3422
3434
  const i = this.#e?.getAll() ?? [];
3423
3435
  this.#t.applyState(e, i);
3424
3436
  }
3425
- this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#s.requestPhase(x.FULL, "setup");
3437
+ this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#s.requestPhase(A.FULL, "setup");
3426
3438
  }
3427
3439
  }
3428
3440
  #De(e) {
@@ -3467,7 +3479,7 @@ class k extends HTMLElement {
3467
3479
  });
3468
3480
  if (this.dispatchEvent(c), c.defaultPrevented)
3469
3481
  return !0;
3470
- const d = {
3482
+ const h = {
3471
3483
  row: r,
3472
3484
  rowIndex: i,
3473
3485
  colIndex: o,
@@ -3475,8 +3487,8 @@ class k extends HTMLElement {
3475
3487
  value: a,
3476
3488
  cellEl: n,
3477
3489
  originalEvent: e
3478
- }, f = this.#e?.onCellClick(d) ?? !1;
3479
- return this.#L("cell-click", d), f;
3490
+ }, f = this.#e?.onCellClick(h) ?? !1;
3491
+ return this.#L("cell-click", h), f;
3480
3492
  }
3481
3493
  _dispatchRowClick(e, i, o, n) {
3482
3494
  if (!o) return !1;
@@ -3537,7 +3549,7 @@ class k extends HTMLElement {
3537
3549
  return this.#d;
3538
3550
  }
3539
3551
  async forceLayout() {
3540
- return this.#s.requestPhase(x.FULL, "forceLayout"), this.#s.whenReady();
3552
+ return this.#s.requestPhase(A.FULL, "forceLayout"), this.#s.whenReady();
3541
3553
  }
3542
3554
  async getConfig() {
3543
3555
  return Object.freeze({ ...this.#o || {} });
@@ -3556,21 +3568,21 @@ class k extends HTMLElement {
3556
3568
  );
3557
3569
  const { row: r, index: s } = n, l = [];
3558
3570
  for (const [a, c] of Object.entries(i)) {
3559
- const d = r[a];
3560
- d !== c && (l.push({ field: a, oldValue: d, newValue: c }), r[a] = c);
3571
+ const h = r[a];
3572
+ h !== c && (l.push({ field: a, oldValue: h, newValue: c }), r[a] = c);
3561
3573
  }
3562
- for (const { field: a, oldValue: c, newValue: d } of l)
3574
+ for (const { field: a, oldValue: c, newValue: h } of l)
3563
3575
  this.#L("cell-change", {
3564
3576
  row: r,
3565
3577
  rowId: e,
3566
3578
  rowIndex: s,
3567
3579
  field: a,
3568
3580
  oldValue: c,
3569
- newValue: d,
3581
+ newValue: h,
3570
3582
  changes: i,
3571
3583
  source: o
3572
3584
  });
3573
- l.length > 0 && this.#s.requestPhase(x.ROWS, "updateRow");
3585
+ l.length > 0 && this.#s.requestPhase(A.ROWS, "updateRow");
3574
3586
  }
3575
3587
  updateRows(e, i = "api") {
3576
3588
  let o = !1;
@@ -3581,30 +3593,30 @@ class k extends HTMLElement {
3581
3593
  `[tbw-grid] Row with ID "${n}" not found. Ensure the row exists and getRowId is correctly configured.`
3582
3594
  );
3583
3595
  const { row: l, index: a } = s;
3584
- for (const [c, d] of Object.entries(r)) {
3596
+ for (const [c, h] of Object.entries(r)) {
3585
3597
  const f = l[c];
3586
- f !== d && (o = !0, l[c] = d, this.#L("cell-change", {
3598
+ f !== h && (o = !0, l[c] = h, this.#L("cell-change", {
3587
3599
  row: l,
3588
3600
  rowId: n,
3589
3601
  rowIndex: a,
3590
3602
  field: c,
3591
3603
  oldValue: f,
3592
- newValue: d,
3604
+ newValue: h,
3593
3605
  changes: r,
3594
3606
  source: i
3595
3607
  }));
3596
3608
  }
3597
3609
  }
3598
- o && this.#s.requestPhase(x.ROWS, "updateRows");
3610
+ o && this.#s.requestPhase(A.ROWS, "updateRows");
3599
3611
  }
3600
3612
  animateRow(e, i) {
3601
- ye(this, e, i);
3613
+ _e(this, e, i);
3602
3614
  }
3603
3615
  animateRows(e, i) {
3604
- ni(this, e, i);
3616
+ li(this, e, i);
3605
3617
  }
3606
3618
  animateRowById(e, i) {
3607
- return ri(this, e, i);
3619
+ return ai(this, e, i);
3608
3620
  }
3609
3621
  setColumnVisible(e, i) {
3610
3622
  const o = this.#t.setColumnVisible(e, i);
@@ -3703,17 +3715,17 @@ class k extends HTMLElement {
3703
3715
  #K = !1;
3704
3716
  refreshShellHeader() {
3705
3717
  this.#K || (this.#K = !0, queueMicrotask(() => {
3706
- this.#K = !1, this.isConnected && (this.#k(), this.#t.markSourcesChanged(), this.#t.merge(), de(this.#i), this.#Z(), this.#W(), this.#Me());
3718
+ this.#K = !1, this.isConnected && (this.#k(), this.#t.markSourcesChanged(), this.#t.merge(), he(this.#i), this.#Z(), this.#W(), this.#Me());
3707
3719
  }));
3708
3720
  }
3709
3721
  #Me() {
3710
3722
  const i = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
3711
3723
  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) {
3712
- fe(this.#n, this.#i), ce(this.#n, this.#o?.shell, this.#i);
3724
+ ge(this.#n, this.#i), de(this.#n, this.#o?.shell, this.#i);
3713
3725
  const o = this.#o?.shell?.toolPanel?.defaultOpen;
3714
3726
  o && this.#i.toolPanels.has(o) && (this.openToolPanel(), this.#i.expandedSections.add(o));
3715
3727
  }
3716
- this._resizeController = De(this), this.#G(i), this.#s.requestPhase(x.COLUMNS, "shellRefresh");
3728
+ this._resizeController = Me(this), this.#G(i), this.#s.requestPhase(A.COLUMNS, "shellRefresh");
3717
3729
  }
3718
3730
  #A = /* @__PURE__ */ new Map();
3719
3731
  registerStyles(e, i) {
@@ -3733,20 +3745,20 @@ class k extends HTMLElement {
3733
3745
  document.adoptedStyleSheets = [...i, ...e];
3734
3746
  }
3735
3747
  #k() {
3736
- Me(this, this.#i), ke(this, this.#i), Ne(this, this.#i, this.#oe());
3748
+ Ne(this, this.#i), Ie(this, this.#i), qe(this, this.#i, this.#oe());
3737
3749
  }
3738
3750
  #ge() {
3739
3751
  const e = this.#n.querySelector(".tbw-shell-header");
3740
3752
  if (!e) return;
3741
- de(this.#i);
3742
- const i = ci(
3753
+ he(this.#i);
3754
+ const i = ui(
3743
3755
  this.#o.shell,
3744
3756
  this.#i,
3745
3757
  this.#o.icons?.toolPanel
3746
3758
  ), o = document.createElement("div");
3747
3759
  o.innerHTML = i;
3748
3760
  const n = o.firstElementChild;
3749
- n && (e.replaceWith(n), this.#we(), ce(this.#n, this.#o?.shell, this.#i));
3761
+ n && (e.replaceWith(n), this.#we(), de(this.#n, this.#o?.shell, this.#i));
3750
3762
  }
3751
3763
  #ke() {
3752
3764
  const e = () => {
@@ -3760,11 +3772,11 @@ class k extends HTMLElement {
3760
3772
  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);
3761
3773
  }
3762
3774
  refreshColumns() {
3763
- this.__lightDomColumnsCache = void 0, X(this), this.#t.parseLightDomColumns(this);
3775
+ this.__lightDomColumnsCache = void 0, Y(this), this.#t.parseLightDomColumns(this);
3764
3776
  const e = this.#i.lightDomTitle, i = this.#i.hasToolButtonsContainer;
3765
3777
  this.#k();
3766
3778
  const o = this.#i.lightDomTitle, n = this.#i.hasToolButtonsContainer;
3767
- (o && !e || n && !i) && (this.#t.markSourcesChanged(), this.#t.merge(), this.#ge()), this.#s.requestPhase(x.COLUMNS, "refreshColumns");
3779
+ (o && !e || n && !i) && (this.#t.markSourcesChanged(), this.#t.merge(), this.#ge()), this.#s.requestPhase(A.COLUMNS, "refreshColumns");
3768
3780
  }
3769
3781
  #Ne() {
3770
3782
  const e = this._virtualization.container, i = this._virtualization.viewportEl ?? e;
@@ -3776,18 +3788,18 @@ class k extends HTMLElement {
3776
3788
  const o = this._virtualization;
3777
3789
  let n, r, s;
3778
3790
  if (i) {
3779
- const u = o.container ?? this, g = o.viewportEl ?? u, p = o.scrollAreaEl;
3780
- n = u.clientHeight, r = g.clientHeight, s = p ? p.clientHeight : n, o.cachedFauxHeight = n, o.cachedViewportHeight = r, o.cachedScrollAreaHeight = s;
3791
+ const p = o.container ?? this, g = o.viewportEl ?? p, u = o.scrollAreaEl;
3792
+ n = p.clientHeight, r = g.clientHeight, s = u ? u.clientHeight : n, o.cachedFauxHeight = n, o.cachedViewportHeight = r, o.cachedScrollAreaHeight = s;
3781
3793
  } else
3782
3794
  n = o.cachedFauxHeight, r = o.cachedViewportHeight, s = o.cachedScrollAreaHeight || n;
3783
3795
  const l = s - r, a = Math.max(0, n - s);
3784
- let c, d = 0;
3785
- return o.variableHeights && o.positionCache ? c = Ii(o.positionCache) : (c = e * o.rowHeight, d = this.#e?.getExtraHeight() ?? 0), c + l + d + a;
3796
+ let c, h = 0;
3797
+ return o.variableHeights && o.positionCache ? c = Wi(o.positionCache) : (c = e * o.rowHeight, h = this.#e?.getExtraHeight() ?? 0), c + l + h + a;
3786
3798
  }
3787
3799
  #Q() {
3788
3800
  if (!this._virtualization.variableHeights) return;
3789
3801
  const e = this._rows, i = this._virtualization.rowHeight || 28, o = this.#o.rowHeight, n = this.#o.getRowId, r = n ? (l) => n(l) : void 0;
3790
- this._virtualization.positionCache = Ni(
3802
+ this._virtualization.positionCache = $i(
3791
3803
  e,
3792
3804
  this._virtualization.heightCache,
3793
3805
  i,
@@ -3796,12 +3808,12 @@ class k extends HTMLElement {
3796
3808
  const c = this.#e?.getRowHeight?.(l, a);
3797
3809
  if (c !== void 0) return c;
3798
3810
  if (o) {
3799
- const d = o(l, a);
3800
- if (d !== void 0 && d > 0) return d;
3811
+ const h = o(l, a);
3812
+ if (h !== void 0 && h > 0) return h;
3801
3813
  }
3802
3814
  }
3803
3815
  );
3804
- const s = Fi(
3816
+ const s = Bi(
3805
3817
  this._virtualization.positionCache,
3806
3818
  e,
3807
3819
  i,
@@ -3815,14 +3827,14 @@ class k extends HTMLElement {
3815
3827
  let r = i;
3816
3828
  r === void 0 && (r = this.#e?.getRowHeight?.(n, e)), r === void 0 && (r = this._virtualization.rowHeight);
3817
3829
  const s = o[e];
3818
- if (!(!s || Math.abs(s.height - r) < 1) && (be(o, e, r), this._virtualization.totalHeightEl)) {
3830
+ if (!(!s || Math.abs(s.height - r) < 1) && (me(o, e, r), this._virtualization.totalHeightEl)) {
3819
3831
  const l = this.#T(this._rows.length);
3820
3832
  this._virtualization.totalHeightEl.style.height = `${l}px`;
3821
3833
  }
3822
3834
  }
3823
3835
  #pe(e, i) {
3824
3836
  if (!this._virtualization.variableHeights || !this._virtualization.positionCache || !this._bodyEl) return;
3825
- const o = this._bodyEl.querySelectorAll(".data-grid-row"), n = this.#o.getRowId, r = Wi(
3837
+ const o = this._bodyEl.querySelectorAll(".data-grid-row"), n = this.#o.getRowId, r = Vi(
3826
3838
  {
3827
3839
  positionCache: this._virtualization.positionCache,
3828
3840
  heightCache: this._virtualization.heightCache,
@@ -3849,68 +3861,68 @@ class k extends HTMLElement {
3849
3861
  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;
3850
3862
  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;
3851
3863
  let c;
3852
- const d = this._virtualization.positionCache;
3853
- if (this._virtualization.variableHeights && d && d.length > 0)
3854
- c = Fe(d, a), c === -1 && (c = 0);
3864
+ const h = this._virtualization.positionCache;
3865
+ if (this._virtualization.variableHeights && h && h.length > 0)
3866
+ c = Ve(h, a), c === -1 && (c = 0);
3855
3867
  else {
3856
3868
  c = Math.floor(a / l);
3857
- let m = 0;
3858
- const y = 10;
3859
- for (; m < y; ) {
3860
- const S = this.#e?.getExtraHeightBefore?.(c) ?? 0, A = Math.floor((a - S) / l);
3861
- if (A >= c || A < 0) break;
3862
- c = A, m++;
3869
+ let b = 0;
3870
+ const _ = 10;
3871
+ for (; b < _; ) {
3872
+ const R = this.#e?.getExtraHeightBefore?.(c) ?? 0, E = Math.floor((a - R) / l);
3873
+ if (E >= c || E < 0) break;
3874
+ c = E, b++;
3863
3875
  }
3864
3876
  }
3865
3877
  c = c - c % 2, c < 0 && (c = 0);
3866
3878
  const f = this.#e?.adjustVirtualStart(c, a, l);
3867
3879
  f !== void 0 && f < c && (c = f, c = c - c % 2, c < 0 && (c = 0));
3868
- let u;
3869
- if (this._virtualization.variableHeights && d && d.length > 0) {
3870
- const m = s + l * 3;
3871
- let y = 0;
3872
- for (u = c; u < o && y < m; )
3873
- y += d[u].height, u++;
3874
- const S = Math.ceil(s / l) + 3;
3875
- u - c < S && (u = Math.min(c + S, o));
3880
+ let p;
3881
+ if (this._virtualization.variableHeights && h && h.length > 0) {
3882
+ const b = s + l * 3;
3883
+ let _ = 0;
3884
+ for (p = c; p < o && _ < b; )
3885
+ _ += h[p].height, p++;
3886
+ const R = Math.ceil(s / l) + 3;
3887
+ p - c < R && (p = Math.min(c + R, o));
3876
3888
  } else {
3877
- const m = Math.ceil(s / l) + 3;
3878
- u = c + m;
3889
+ const b = Math.ceil(s / l) + 3;
3890
+ p = c + b;
3879
3891
  }
3880
- u > o && (u = o);
3881
- const g = this._virtualization.start, p = this._virtualization.end;
3882
- if (!e && c === g && u === p)
3892
+ p > o && (p = o);
3893
+ const g = this._virtualization.start, u = this._virtualization.end;
3894
+ if (!e && c === g && p === u)
3883
3895
  return !1;
3884
- this._virtualization.start = c, this._virtualization.end = u;
3885
- const h = e ? this._virtualization.cachedFauxHeight = n.clientHeight : this._virtualization.cachedFauxHeight || (this._virtualization.cachedFauxHeight = n.clientHeight);
3896
+ this._virtualization.start = c, this._virtualization.end = p;
3897
+ const d = e ? this._virtualization.cachedFauxHeight = n.clientHeight : this._virtualization.cachedFauxHeight || (this._virtualization.cachedFauxHeight = n.clientHeight);
3886
3898
  if (e) {
3887
- const m = this._virtualization.scrollAreaEl;
3888
- m && (this._virtualization.cachedScrollAreaHeight = m.clientHeight);
3899
+ const b = this._virtualization.scrollAreaEl;
3900
+ b && (this._virtualization.cachedScrollAreaHeight = b.clientHeight);
3889
3901
  }
3890
- if (h === 0 && s > 0)
3891
- return this.#s.requestPhase(x.VIRTUALIZATION, "stale-refs-retry"), !1;
3902
+ if (d === 0 && s > 0)
3903
+ return this.#s.requestPhase(A.VIRTUALIZATION, "stale-refs-retry"), !1;
3892
3904
  if (e && this._virtualization.totalHeightEl) {
3893
- const m = this.#T(o);
3894
- this._virtualization.totalHeightEl.style.height = `${m}px`;
3905
+ const b = this.#T(o);
3906
+ this._virtualization.totalHeightEl.style.height = `${b}px`;
3895
3907
  }
3896
3908
  let w;
3897
- if (this._virtualization.variableHeights && d && d[c])
3898
- w = d[c].offset;
3909
+ if (this._virtualization.variableHeights && h && h[c])
3910
+ w = h[c].offset;
3899
3911
  else {
3900
- const m = this.#e?.getExtraHeightBefore?.(c) ?? 0;
3901
- w = c * l + m;
3912
+ const b = this.#e?.getExtraHeightBefore?.(c) ?? 0;
3913
+ w = c * l + b;
3902
3914
  }
3903
- const C = -(a - w);
3904
- return this._bodyEl.style.transform = `translateY(${C}px)`, this.#Y(c, u, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), e && this._virtualization.variableHeights && this.#pe(c, u), this.#de(o, this._visibleColumns.length), e && !i && (this.#e?.afterRender(), queueMicrotask(() => {
3915
+ const v = -(a - w);
3916
+ 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(() => {
3905
3917
  if (!this._virtualization.totalHeightEl) return;
3906
- const m = this.#T(o);
3907
- this._virtualization.cachedFauxHeight === 0 && this._virtualization.cachedViewportHeight > 0 || (this._virtualization.totalHeightEl.style.height = `${m}px`);
3918
+ const b = this.#T(o);
3919
+ this._virtualization.cachedFauxHeight === 0 && this._virtualization.cachedViewportHeight > 0 || (this._virtualization.totalHeightEl.style.height = `${b}px`);
3908
3920
  })), !0;
3909
3921
  }
3910
3922
  #Z() {
3911
3923
  this.#k(), this.#t.markSourcesChanged(), this.#t.merge();
3912
3924
  const e = this.#o?.shell;
3913
- wi(
3925
+ vi(
3914
3926
  this.#n,
3915
3927
  e,
3916
3928
  { isPanelOpen: this.#i.isPanelOpen, expandedSections: this.#i.expandedSections },
@@ -3918,24 +3930,24 @@ class k extends HTMLElement {
3918
3930
  ) && (this.#we(), this.#c.setInitialized(!0));
3919
3931
  }
3920
3932
  #we() {
3921
- di(this.#n, this.#o?.shell, this.#i, {
3933
+ fi(this.#n, this.#o?.shell, this.#i, {
3922
3934
  onPanelToggle: () => this.toggleToolPanel(),
3923
3935
  onSectionToggle: (e) => this.toggleToolPanelSection(e)
3924
- }), this.#q?.(), this.#q = hi(this.#n, this.#o?.shell, (e) => {
3936
+ }), this.#q?.(), this.#q = gi(this.#n, this.#o?.shell, (e) => {
3925
3937
  this.style.setProperty("--tbw-tool-panel-width", `${e}px`);
3926
3938
  });
3927
3939
  }
3928
3940
  }
3929
3941
  customElements.get(k.tagName) || customElements.define(k.tagName, k);
3930
3942
  globalThis.DataGridElement = k;
3931
- const oo = {
3943
+ const so = {
3932
3944
  CAN_MOVE_COLUMN: "canMoveColumn",
3933
3945
  GET_CONTEXT_MENU_ITEMS: "getContextMenuItems"
3934
3946
  };
3935
- class no {
3947
+ class lo {
3936
3948
  static dependencies;
3937
3949
  static manifest;
3938
- version = "1.15.0";
3950
+ version = "1.16.0";
3939
3951
  styles;
3940
3952
  cellRenderers;
3941
3953
  headerRenderers;
@@ -4067,14 +4079,14 @@ const H = {
4067
4079
  GROUP_COUNT: "group-count",
4068
4080
  RANGE_SELECTION: "range-selection",
4069
4081
  SELECTION_OVERLAY: "selection-overlay"
4070
- }, J = {
4082
+ }, ee = {
4071
4083
  ROW_INDEX: "data-row-index",
4072
4084
  COL_INDEX: "data-col-index",
4073
4085
  FIELD: "data-field",
4074
4086
  GROUP_KEY: "data-group-key",
4075
4087
  TREE_LEVEL: "data-tree-level",
4076
4088
  STICKY: "data-sticky"
4077
- }, ro = {
4089
+ }, ao = {
4078
4090
  ROOT: `.${H.ROOT}`,
4079
4091
  HEADER: `.${H.HEADER}`,
4080
4092
  HEADER_ROW: `.${H.HEADER_ROW}`,
@@ -4084,12 +4096,12 @@ const H = {
4084
4096
  DATA_ROW: `.${H.DATA_ROW}`,
4085
4097
  DATA_CELL: `.${H.DATA_CELL}`,
4086
4098
  GROUP_ROW: `.${H.GROUP_ROW}`,
4087
- ROW_BY_INDEX: (t) => `.${H.DATA_ROW}[${J.ROW_INDEX}="${t}"]`,
4088
- CELL_BY_FIELD: (t) => `.${H.DATA_CELL}[${J.FIELD}="${t}"]`,
4089
- CELL_AT: (t, e) => `.${H.DATA_ROW}[${J.ROW_INDEX}="${t}"] .${H.DATA_CELL}[${J.COL_INDEX}="${e}"]`,
4099
+ ROW_BY_INDEX: (t) => `.${H.DATA_ROW}[${ee.ROW_INDEX}="${t}"]`,
4100
+ CELL_BY_FIELD: (t) => `.${H.DATA_CELL}[${ee.FIELD}="${t}"]`,
4101
+ CELL_AT: (t, e) => `.${H.DATA_ROW}[${ee.ROW_INDEX}="${t}"] .${H.DATA_CELL}[${ee.COL_INDEX}="${e}"]`,
4090
4102
  SELECTED_ROWS: `.${H.DATA_ROW}.${H.SELECTED}`,
4091
4103
  EDITING_CELL: `.${H.DATA_CELL}.${H.EDITING}`
4092
- }, so = {
4104
+ }, co = {
4093
4105
  COLOR_BG: "--tbw-color-bg",
4094
4106
  COLOR_FG: "--tbw-color-fg",
4095
4107
  COLOR_FG_MUTED: "--tbw-color-fg-muted",
@@ -4108,14 +4120,14 @@ const H = {
4108
4120
  BORDER_RADIUS: "--tbw-border-radius",
4109
4121
  FOCUS_OUTLINE: "--tbw-focus-outline"
4110
4122
  };
4111
- function lo(t) {
4123
+ function ho(t) {
4112
4124
  const e = document.createElement("tbw-grid");
4113
4125
  return t && (e.gridConfig = t), e;
4114
4126
  }
4115
- function ao(t, e = document) {
4127
+ function uo(t, e = document) {
4116
4128
  return e.querySelector(t);
4117
4129
  }
4118
- const co = {
4130
+ const fo = {
4119
4131
  CELL_CHANGE: "cell-change",
4120
4132
  CELL_COMMIT: "cell-commit",
4121
4133
  ROW_COMMIT: "row-commit",
@@ -4130,7 +4142,7 @@ const co = {
4130
4142
  CELL_ACTIVATE: "cell-activate",
4131
4143
  GROUP_TOGGLE: "group-toggle",
4132
4144
  COLUMN_STATE_CHANGE: "column-state-change"
4133
- }, ho = {
4145
+ }, go = {
4134
4146
  SELECTION_CHANGE: "selection-change",
4135
4147
  TREE_EXPAND: "tree-expand",
4136
4148
  FILTER_CHANGE: "filter-change",
@@ -4148,7 +4160,7 @@ const co = {
4148
4160
  COLUMN_REORDER: "column-reorder",
4149
4161
  DETAIL_EXPAND: "detail-expand",
4150
4162
  GROUP_EXPAND: "group-expand"
4151
- }, ue = {
4163
+ }, fe = {
4152
4164
  sum: (t, e) => t.reduce((i, o) => i + (Number(o[e]) || 0), 0),
4153
4165
  avg: (t, e) => {
4154
4166
  const i = t.reduce((o, n) => o + (Number(n[e]) || 0), 0);
@@ -4159,28 +4171,28 @@ const co = {
4159
4171
  max: (t, e) => t.length ? Math.max(...t.map((i) => Number(i[e]) || -1 / 0)) : 0,
4160
4172
  first: (t, e) => t[0]?.[e],
4161
4173
  last: (t, e) => t[t.length - 1]?.[e]
4162
- }, F = /* @__PURE__ */ new Map(), D = {
4174
+ }, U = /* @__PURE__ */ new Map(), O = {
4163
4175
  register(t, e) {
4164
- F.set(t, e);
4176
+ U.set(t, e);
4165
4177
  },
4166
4178
  unregister(t) {
4167
- F.delete(t);
4179
+ U.delete(t);
4168
4180
  },
4169
4181
  get(t) {
4170
4182
  if (t !== void 0)
4171
- return typeof t == "function" ? t : F.get(t) ?? ue[t];
4183
+ return typeof t == "function" ? t : U.get(t) ?? fe[t];
4172
4184
  },
4173
4185
  run(t, e, i, o) {
4174
4186
  const n = this.get(t);
4175
4187
  return n ? n(e, i, o) : void 0;
4176
4188
  },
4177
4189
  has(t) {
4178
- return F.has(t) || t in ue;
4190
+ return U.has(t) || t in fe;
4179
4191
  },
4180
4192
  list() {
4181
- return [...Object.keys(ue), ...F.keys()];
4193
+ return [...Object.keys(fe), ...U.keys()];
4182
4194
  }
4183
- }, Ue = {
4195
+ }, Be = {
4184
4196
  sum: (t) => t.reduce((e, i) => e + i, 0),
4185
4197
  avg: (t) => t.length ? t.reduce((e, i) => e + i, 0) / t.length : 0,
4186
4198
  count: (t) => t.length,
@@ -4189,50 +4201,50 @@ const co = {
4189
4201
  first: (t) => t[0] ?? 0,
4190
4202
  last: (t) => t[t.length - 1] ?? 0
4191
4203
  };
4192
- function Ji(t) {
4193
- return Ue[t] ?? Ue.sum;
4204
+ function io(t) {
4205
+ return Be[t] ?? Be.sum;
4194
4206
  }
4195
- function uo(t, e) {
4196
- return Ji(t)(e);
4207
+ function po(t, e) {
4208
+ return io(t)(e);
4197
4209
  }
4198
- const fo = D.register.bind(D), go = D.unregister.bind(D), po = D.get.bind(D), wo = D.run.bind(D), bo = D.list.bind(D);
4210
+ 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);
4199
4211
  export {
4200
- no as BaseGridPlugin,
4201
- ht as DEFAULT_ANIMATION_CONFIG,
4212
+ lo as BaseGridPlugin,
4213
+ ft as DEFAULT_ANIMATION_CONFIG,
4202
4214
  M as DEFAULT_GRID_ICONS,
4203
- co as DGEvents,
4215
+ fo as DGEvents,
4204
4216
  k as DataGridElement,
4205
- Qe as F,
4206
- B as FitModeEnum,
4207
- so as GridCSSVars,
4217
+ Je as F,
4218
+ G as FitModeEnum,
4219
+ co as GridCSSVars,
4208
4220
  H as GridClasses,
4209
- J as GridDataAttrs,
4221
+ ee as GridDataAttrs,
4210
4222
  k as GridElement,
4211
- ro as GridSelectors,
4212
- oo as PLUGIN_QUERIES,
4213
- ho as PluginEvents,
4214
- oe as PluginManager,
4215
- x as RenderPhase,
4216
- Be as a,
4217
- D as aggregatorRegistry,
4218
- $ as b,
4219
- Wt as builtInSort,
4220
- to as c,
4221
- lo as createGrid,
4222
- Ye as d,
4223
- $t as defaultComparator,
4224
- q as e,
4225
- ve as f,
4226
- Ht as g,
4227
- po as getAggregator,
4228
- Ji as getValueAggregator,
4229
- bo as listAggregators,
4230
- ao as queryGrid,
4231
- eo as r,
4232
- fo as registerAggregator,
4233
- wo as runAggregator,
4234
- uo as runValueAggregator,
4235
- io as s,
4236
- go as unregisterAggregator
4223
+ ao as GridSelectors,
4224
+ so as PLUGIN_QUERIES,
4225
+ go as PluginEvents,
4226
+ ne as PluginManager,
4227
+ A as RenderPhase,
4228
+ Xe as a,
4229
+ O as aggregatorRegistry,
4230
+ W as b,
4231
+ Vt as builtInSort,
4232
+ no as c,
4233
+ ho as createGrid,
4234
+ Ke as d,
4235
+ Ut as defaultComparator,
4236
+ $ as e,
4237
+ Ce as f,
4238
+ zt as g,
4239
+ mo as getAggregator,
4240
+ io as getValueAggregator,
4241
+ Co as listAggregators,
4242
+ uo as queryGrid,
4243
+ oo as r,
4244
+ wo as registerAggregator,
4245
+ vo as runAggregator,
4246
+ po as runValueAggregator,
4247
+ ro as s,
4248
+ bo as unregisterAggregator
4237
4249
  };
4238
4250
  //# sourceMappingURL=index.js.map