@toolbox-web/grid 1.19.0 → 1.19.2

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 +97 -86
  2. package/all.js.map +1 -1
  3. package/index.js +367 -341
  4. package/index.js.map +1 -1
  5. package/lib/core/grid.d.ts.map +1 -1
  6. package/lib/core/internal/rows.d.ts.map +1 -1
  7. package/lib/core/internal/utils.d.ts +2 -2
  8. package/lib/core/internal/utils.d.ts.map +1 -1
  9. package/lib/core/plugin/types.d.ts +0 -2
  10. package/lib/core/plugin/types.d.ts.map +1 -1
  11. package/lib/core/types.d.ts +11 -0
  12. package/lib/core/types.d.ts.map +1 -1
  13. package/lib/plugins/clipboard/index.js.map +1 -1
  14. package/lib/plugins/column-virtualization/index.js.map +1 -1
  15. package/lib/plugins/context-menu/index.js.map +1 -1
  16. package/lib/plugins/editing/index.js.map +1 -1
  17. package/lib/plugins/export/index.js.map +1 -1
  18. package/lib/plugins/filtering/index.js.map +1 -1
  19. package/lib/plugins/grouping-columns/index.js.map +1 -1
  20. package/lib/plugins/grouping-rows/index.js.map +1 -1
  21. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
  22. package/lib/plugins/master-detail/index.js +62 -55
  23. package/lib/plugins/master-detail/index.js.map +1 -1
  24. package/lib/plugins/multi-sort/index.js.map +1 -1
  25. package/lib/plugins/pinned-columns/index.js.map +1 -1
  26. package/lib/plugins/pinned-rows/index.js.map +1 -1
  27. package/lib/plugins/pivot/index.js.map +1 -1
  28. package/lib/plugins/print/index.js.map +1 -1
  29. package/lib/plugins/reorder/index.js.map +1 -1
  30. package/lib/plugins/responsive/index.js.map +1 -1
  31. package/lib/plugins/row-reorder/index.js.map +1 -1
  32. package/lib/plugins/selection/SelectionPlugin.d.ts +3 -0
  33. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  34. package/lib/plugins/selection/index.js +179 -175
  35. package/lib/plugins/selection/index.js.map +1 -1
  36. package/lib/plugins/selection/types.d.ts +26 -0
  37. package/lib/plugins/selection/types.d.ts.map +1 -1
  38. package/lib/plugins/server-side/index.js.map +1 -1
  39. package/lib/plugins/tree/index.js.map +1 -1
  40. package/lib/plugins/undo-redo/index.js.map +1 -1
  41. package/lib/plugins/visibility/index.js.map +1 -1
  42. package/package.json +1 -1
  43. package/umd/grid.all.umd.js +24 -24
  44. package/umd/grid.all.umd.js.map +1 -1
  45. package/umd/grid.umd.js +11 -11
  46. package/umd/grid.umd.js.map +1 -1
  47. package/umd/plugins/master-detail.umd.js +1 -1
  48. package/umd/plugins/master-detail.umd.js.map +1 -1
  49. package/umd/plugins/selection.umd.js +2 -2
  50. package/umd/plugins/selection.umd.js.map +1 -1
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- function ct() {
1
+ function dt() {
2
2
  return {
3
3
  rowCount: -1,
4
4
  colCount: -1,
@@ -6,20 +6,20 @@ function ct() {
6
6
  ariaDescribedBy: void 0
7
7
  };
8
8
  }
9
- function dt(t, e, i, o, n) {
9
+ function ht(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 ht(t, e) {
15
+ function ut(t, e) {
16
16
  const i = t?.gridAriaLabel;
17
17
  return i || (t?.shell?.header?.title ?? e?.lightDomTitle ?? void 0);
18
18
  }
19
- function ut(t, e, i, o) {
19
+ function ft(t, e, i, o) {
20
20
  if (!e) return !1;
21
21
  let n = !1;
22
- const r = ht(i, o);
22
+ const r = ut(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;
@@ -27,11 +27,11 @@ function ut(t, e, i, o) {
27
27
  const G = {
28
28
  STRETCH: "stretch",
29
29
  FIXED: "fixed"
30
- }, ft = {
30
+ }, gt = {
31
31
  mode: "reduced-motion",
32
32
  duration: 200,
33
33
  easing: "ease-out"
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 = {
34
+ }, Re = '<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 G = {
40
40
  submenuArrow: "▶",
41
41
  dragHandle: "⋮⋮",
42
42
  toolPanel: "☰",
43
- filter: Ee,
44
- filterActive: Ee,
43
+ filter: Re,
44
+ filterActive: Re,
45
45
  print: "🖨️"
46
46
  };
47
- function gt(t) {
47
+ function pt(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
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 m = parseFloat(f);
54
- !isNaN(m) && /^\d+(\.\d+)?$/.test(f.trim()) ? h.width = m : h.width = f;
53
+ const b = parseFloat(f);
54
+ !isNaN(b) && /^\d+(\.\d+)?$/.test(f.trim()) ? h.width = b : h.width = f;
55
55
  }
56
56
  const p = i.getAttribute("minWidth") || i.getAttribute("min-width");
57
57
  if (p) {
58
- const m = parseFloat(p);
59
- isNaN(m) || (h.minWidth = m);
58
+ const b = parseFloat(p);
59
+ isNaN(b) || (h.minWidth = b);
60
60
  }
61
61
  i.hasAttribute("resizable") && (h.resizable = !0), i.hasAttribute("sizable") && (h.resizable = !0);
62
62
  const g = i.getAttribute("editor"), u = i.getAttribute("renderer");
63
63
  g && (h.__editorName = g), u && (h.__rendererName = u);
64
64
  const d = i.getAttribute("options");
65
- d && (h.options = d.split(",").map((m) => {
66
- const [x, I] = m.includes(":") ? m.split(":") : [m.trim(), m.trim()];
67
- return { value: x.trim(), label: I?.trim() || x.trim() };
65
+ d && (h.options = d.split(",").map((b) => {
66
+ const [T, N] = b.includes(":") ? b.split(":") : [b.trim(), b.trim()];
67
+ return { value: T.trim(), label: N?.trim() || T.trim() };
68
68
  }));
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);
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 && (h.__viewTemplate = w), C && (h.__editorTemplate = C), m && (h.__headerTemplate = m);
71
+ const R = globalThis.DataGridElement?.getAdapters?.() ?? [], E = w ?? i, x = R.find((b) => b.canHandle(E));
72
+ if (x) {
73
+ const b = x.createRenderer(E);
74
+ b && (h.viewRenderer = b);
75
75
  }
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);
76
+ const y = C ?? i, v = R.find((b) => b.canHandle(y));
77
+ if (v) {
78
+ const b = v.createEditor(y);
79
+ b && (h.editor = b);
80
80
  }
81
81
  return h;
82
82
  }).filter((i) => !!i);
83
83
  }
84
- function Se(t, e) {
84
+ function Ae(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 Se(t, e) {
105
105
  });
106
106
  return Object.keys(i).forEach((n) => o.push(i[n])), o;
107
107
  }
108
- function Ge(t, e) {
108
+ function Ye(t, e) {
109
109
  try {
110
110
  t.part?.add?.(e);
111
111
  } catch {
@@ -113,7 +113,7 @@ function Ge(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 Re(t) {
116
+ function Te(t) {
117
117
  const e = t.effectiveConfig?.fitMode || t.fitMode || G.STRETCH;
118
118
  if (e !== G.STRETCH && e !== G.FIXED || t.__didInitialAutoSize || !t.isConnected) return;
119
119
  const i = Array.from(t._headerRowEl?.children || []);
@@ -133,34 +133,34 @@ function Re(t) {
133
133
  l > 0 && (n.width = l + 2, n.__autoSized = !0, o = !0);
134
134
  }), o && V(t), t.__didInitialAutoSize = !0;
135
135
  }
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);
136
+ const wt = /^(?:\d+(?:\.\d+)?(?:px|%|fr|em|rem|ch|vw|vh|vmin|vmax)|calc\(.+\)|min-content|max-content|minmax\(.+\)|fit-content\(.+\)|auto)$/i;
137
+ function xe(t, e) {
138
+ return typeof t == "number" ? `${t}px` : (wt.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
139
  }
140
140
  function V(t) {
141
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);
142
+ if (i.width != null) return xe(i.width, i.field);
143
143
  const o = i.minWidth;
144
144
  return o != null ? `minmax(${o}px, 1fr)` : "1fr";
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);
145
+ }).join(" ").trim() : t._gridTemplate = t._visibleColumns.map((i) => i.width != null ? xe(i.width, i.field) : "max-content").join(" "), t.style.setProperty("--tbw-column-template", t._gridTemplate);
146
146
  }
147
- function wt(t) {
147
+ function bt(t) {
148
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";
149
149
  }
150
- function bt(t, e) {
150
+ function mt(t, e) {
151
151
  const i = t[0] || {}, o = Object.keys(i).map((r) => {
152
- const s = i[r], l = wt(s);
152
+ const s = i[r], l = bt(s);
153
153
  return { field: r, header: r.charAt(0).toUpperCase() + r.slice(1), type: l };
154
154
  }), n = {};
155
155
  return o.forEach((r) => {
156
156
  n[r.field] = r.type || "string";
157
157
  }), { columns: o, typeMap: n };
158
158
  }
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) {
159
+ const vt = /{{\s*([^}]+)\s*}}/g, z = "__DG_EMPTY__", Ct = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, yt = /__(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 _t(t) {
161
161
  return !t || typeof t != "string" ? "" : t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
162
162
  }
163
- const _t = /* @__PURE__ */ new Set([
163
+ const Et = /* @__PURE__ */ new Set([
164
164
  "script",
165
165
  "iframe",
166
166
  "object",
@@ -185,23 +185,23 @@ const _t = /* @__PURE__ */ new Set([
185
185
  "plaintext",
186
186
  "xmp",
187
187
  "listing"
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) {
188
+ ]), He = /^on\w+$/i, St = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), Rt = /^\s*(javascript|vbscript|data|blob):/i;
189
+ function k(t) {
190
190
  if (!t || typeof t != "string") return "";
191
191
  if (t.indexOf("<") === -1) return t;
192
192
  const e = document.createElement("template");
193
- return e.innerHTML = t, Rt(e.content), e.innerHTML;
193
+ return e.innerHTML = t, At(e.content), e.innerHTML;
194
194
  }
195
- function Rt(t) {
195
+ function At(t) {
196
196
  const e = [], i = t.querySelectorAll("*");
197
197
  for (const o of i) {
198
198
  const n = o.tagName.toLowerCase();
199
- if (_t.has(n)) {
199
+ if (Et.has(n)) {
200
200
  e.push(o);
201
201
  continue;
202
202
  }
203
203
  if ((n === "svg" || o.namespaceURI === "http://www.w3.org/2000/svg") && Array.from(o.attributes).some(
204
- (l) => Te.test(l.name) || l.name === "href" || l.name === "xlink:href"
204
+ (l) => He.test(l.name) || l.name === "href" || l.name === "xlink:href"
205
205
  )) {
206
206
  e.push(o);
207
207
  continue;
@@ -209,11 +209,11 @@ function Rt(t) {
209
209
  const r = [];
210
210
  for (const s of o.attributes) {
211
211
  const l = s.name.toLowerCase();
212
- if (Te.test(l)) {
212
+ if (He.test(l)) {
213
213
  r.push(s.name);
214
214
  continue;
215
215
  }
216
- if (Et.has(l) && St.test(s.value)) {
216
+ if (St.has(l) && Rt.test(s.value)) {
217
217
  r.push(s.name);
218
218
  continue;
219
219
  }
@@ -226,44 +226,44 @@ function Rt(t) {
226
226
  }
227
227
  e.forEach((o) => o.remove());
228
228
  }
229
- function Xe(t, e) {
229
+ function Ce(t, e) {
230
230
  if (!t || t.indexOf("{{") === -1) return t;
231
- const i = [], o = t.replace(mt, (l, a) => {
232
- const c = At(a, e);
231
+ const i = [], o = t.replace(vt, (l, a) => {
232
+ const c = Tt(a, e);
233
233
  return i.push({ expr: a.trim(), result: c }), c;
234
- }), n = Tt(o), r = i.length && i.every((l) => l.result === "" || l.result === z);
235
- return q.test(t) || r ? "" : n;
234
+ }), n = xt(o), r = i.length && i.every((l) => l.result === "" || l.result === z);
235
+ return $.test(t) || r ? "" : n;
236
236
  }
237
- function At(t, e) {
238
- if (t = (t || "").trim(), !t || q.test(t)) return z;
237
+ function Tt(t, e) {
238
+ if (t = (t || "").trim(), !t || $.test(t)) return z;
239
239
  if (t === "value") return e.value == null ? z : String(e.value);
240
240
  if (t.startsWith("row.") && !/[()?]/.test(t) && !t.includes(":")) {
241
241
  const o = t.slice(4), n = e.row ? e.row[o] : void 0;
242
242
  return n == null ? z : String(n);
243
243
  }
244
- if (t.length > 80 || !vt.test(t) || Ct.test(t)) return z;
244
+ if (t.length > 80 || !Ct.test(t) || yt.test(t)) return z;
245
245
  const i = t.match(/\./g);
246
246
  if (i && i.length > 1) return z;
247
247
  try {
248
248
  const n = new Function("value", "row", `return (${t});`)(e.value, e.row), r = n == null ? "" : String(n);
249
- return q.test(r) ? z : r || z;
249
+ return $.test(r) ? z : r || z;
250
250
  } catch {
251
251
  return z;
252
252
  }
253
253
  }
254
- const q = /Reflect|Proxy|ownKeys/;
255
- function Tt(t) {
254
+ const $ = /Reflect|Proxy|ownKeys/;
255
+ function xt(t) {
256
256
  return t && t.replace(new RegExp(z, "g"), "").replace(/Reflect\.[^<>{}\s]+|\bProxy\b|ownKeys\([^)]*\)/g, "");
257
257
  }
258
- function xt(t) {
259
- if (q.test(t.textContent || "")) {
258
+ function ge(t) {
259
+ if ($.test(t.textContent || "")) {
260
260
  for (const e of t.childNodes)
261
- e.nodeType === Node.TEXT_NODE && q.test(e.textContent || "") && (e.textContent = "");
262
- q.test(t.textContent || "") && (t.textContent = "");
261
+ e.nodeType === Node.TEXT_NODE && $.test(e.textContent || "") && (e.textContent = "");
262
+ $.test(t.textContent || "") && (t.textContent = "");
263
263
  }
264
264
  }
265
- function xe(t) {
266
- const e = q.test(t), i = ((o) => e ? "" : Xe(t, o));
265
+ function Le(t) {
266
+ const e = $.test(t), i = ((o) => e ? "" : Ce(t, o));
267
267
  return i.__blocked = e, i;
268
268
  }
269
269
  const Ht = 100;
@@ -382,19 +382,19 @@ class Lt {
382
382
  const e = this.#l ? { ...this.#l } : {}, i = Array.isArray(e.columns) ? [...e.columns] : [], o = (this.#d ?? []).map((s) => ({
383
383
  ...s
384
384
  }));
385
- let n = Se(
385
+ let n = Ae(
386
386
  i,
387
387
  o
388
388
  );
389
- this.#n && this.#n.length && (n = Se(
389
+ this.#n && this.#n.length && (n = Ae(
390
390
  this.#n,
391
391
  o
392
392
  ));
393
393
  const r = this.#r.getRows();
394
- return n.length === 0 && r.length && (n = bt(r).columns), n.length && (n.forEach((s) => {
394
+ return n.length === 0 && r.length && (n = mt(r).columns), n.length && (n.forEach((s) => {
395
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);
396
396
  }), n.forEach((s) => {
397
- s.__viewTemplate && !s.__compiledView && (s.__compiledView = xe(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = xe(s.__editorTemplate.innerHTML));
397
+ s.__viewTemplate && !s.__compiledView && (s.__compiledView = Le(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = Le(s.__editorTemplate.innerHTML));
398
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;
399
399
  }
400
400
  #b(e) {
@@ -537,7 +537,7 @@ class Lt {
537
537
  this.columns = o, this.#r.renderHeader(), this.#r.updateTemplate(), this.#r.refreshVirtualWindow();
538
538
  }
539
539
  parseLightDomColumns(e) {
540
- this.#d || (this.#h = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#h.length ? gt(e) : []);
540
+ this.#d || (this.#h = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#h.length ? pt(e) : []);
541
541
  }
542
542
  clearLightDomCache() {
543
543
  this.#d = void 0;
@@ -590,7 +590,7 @@ class Lt {
590
590
  this.#v?.disconnect(), this.#w = [], this.#s && clearTimeout(this.#s);
591
591
  }
592
592
  }
593
- function ve() {
593
+ function ye() {
594
594
  if (typeof window < "u" && window.location) {
595
595
  const t = window.location.hostname;
596
596
  if (t === "localhost" || t === "127.0.0.1" || t === "::1")
@@ -598,10 +598,10 @@ function ve() {
598
598
  }
599
599
  return typeof process < "u" && process.env?.NODE_ENV !== "production";
600
600
  }
601
- function Ye(t) {
601
+ function je(t) {
602
602
  return `<span role="checkbox" aria-checked="${t}" aria-label="${t}">${t ? "&#x1F5F9;" : "&#9744;"}</span>`;
603
603
  }
604
- function je(t) {
604
+ function Ke(t) {
605
605
  if (t == null || t === "") return "";
606
606
  if (t instanceof Date)
607
607
  return isNaN(t.getTime()) ? "" : t.toLocaleDateString();
@@ -611,7 +611,7 @@ function je(t) {
611
611
  }
612
612
  return "";
613
613
  }
614
- function Ke(t) {
614
+ function Qe(t) {
615
615
  if (!t) return -1;
616
616
  const e = t.getAttribute("data-row");
617
617
  if (e) return parseInt(e, 10);
@@ -629,7 +629,7 @@ function Pt(t) {
629
629
  const e = t.getAttribute("data-col");
630
630
  return e ? parseInt(e, 10) : -1;
631
631
  }
632
- function Ce(t) {
632
+ function _e(t) {
633
633
  t && t.querySelectorAll(".cell-focus").forEach((e) => e.classList.remove("cell-focus"));
634
634
  }
635
635
  function zt(t) {
@@ -643,13 +643,13 @@ function zt(t) {
643
643
  }
644
644
  return "ltr";
645
645
  }
646
- function He(t) {
646
+ function Pe(t) {
647
647
  return zt(t) === "rtl";
648
648
  }
649
649
  function no(t, e) {
650
650
  return t === "left" || t === "right" ? t : e === "rtl" ? t === "start" ? "right" : "left" : t === "start" ? "left" : "right";
651
651
  }
652
- function Qe(t, e) {
652
+ function Ze(t, e) {
653
653
  const i = e.renderer || e.viewRenderer;
654
654
  if (i) return i;
655
655
  if (!e.type) return;
@@ -660,7 +660,7 @@ function Qe(t, e) {
660
660
  return n.renderer;
661
661
  }
662
662
  }
663
- function Ze(t, e) {
663
+ function Je(t, e) {
664
664
  if (e.format) return e.format;
665
665
  if (!e.type) return;
666
666
  const i = t.__frameworkAdapter;
@@ -670,22 +670,22 @@ function Ze(t, e) {
670
670
  return o.format;
671
671
  }
672
672
  }
673
- const Je = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
673
+ const et = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
674
674
  function se(t) {
675
675
  return (t.__editingCellCount ?? 0) > 0;
676
676
  }
677
677
  function le(t) {
678
678
  t.__editingCellCount = 0, t.removeAttribute("data-has-editing"), t.querySelectorAll(".cell.editing").forEach((i) => i.classList.remove("editing"));
679
679
  }
680
- const et = document.createElement("template");
681
- et.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
682
680
  const tt = document.createElement("template");
683
- tt.innerHTML = '<div class="data-grid-row" role="row" part="row"></div>';
681
+ tt.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
682
+ const it = document.createElement("template");
683
+ it.innerHTML = '<div class="data-grid-row" role="row" part="row"></div>';
684
684
  function Dt() {
685
- return et.content.firstElementChild.cloneNode(!0);
685
+ return tt.content.firstElementChild.cloneNode(!0);
686
686
  }
687
687
  function Ot() {
688
- return tt.content.firstElementChild.cloneNode(!0);
688
+ return it.content.firstElementChild.cloneNode(!0);
689
689
  }
690
690
  function Y(t) {
691
691
  t.__cellDisplayCache = void 0, t.__cellCacheEpoch = void 0, t.__hasSpecialColumns = void 0;
@@ -711,44 +711,44 @@ function Mt(t, e, i, o, n) {
711
711
  d.__epoch = o, d.__rowDataRef = u, d.parentNode !== s && s.appendChild(d);
712
712
  continue;
713
713
  }
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;
714
+ const w = d.__epoch, C = d.__rowDataRef;
715
+ let m = d.children.length;
716
+ m > a && d.lastElementChild?.classList.contains("tbw-row-loading-overlay") && m--;
717
+ const R = w === o && m === a, E = C !== u, x = !!t._isGridEditMode;
718
+ let y = !1;
719
719
  if (R && E) {
720
720
  for (let S = 0; S < a; S++)
721
721
  if (l[S].externalView && !d.querySelector(`.cell[data-col="${S}"] [data-external-view]`)) {
722
- C = !0;
722
+ y = !0;
723
723
  break;
724
724
  }
725
725
  }
726
- if (!R || C) {
727
- const S = se(d), L = T || t._activeEditRows === g;
726
+ if (!R || y) {
727
+ const S = se(d), L = x || t._activeEditRows === g;
728
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
729
  } else if (E) {
730
- const S = se(d), L = T || t._activeEditRows === g;
730
+ const S = se(d), L = x || t._activeEditRows === g;
731
731
  S && !L ? (le(d), B(t, d, u, g), d.__epoch = o, d.__rowDataRef = u) : (ae(t, d, u, g), d.__rowDataRef = u);
732
732
  } else {
733
- const S = se(d), L = T || t._activeEditRows === g;
733
+ const S = se(d), L = x || t._activeEditRows === g;
734
734
  S && !L ? (le(d), B(t, d, u, g), d.__epoch = o, d.__rowDataRef = u) : ae(t, d, u, g);
735
735
  }
736
- let y = !1;
737
- const m = t.changedRowIds;
738
- if (m && m.length > 0)
736
+ let v = !1;
737
+ const b = t.changedRowIds;
738
+ if (b && b.length > 0)
739
739
  try {
740
740
  const S = t.getRowId?.(u);
741
- S && (y = m.includes(S));
741
+ S && (v = b.includes(S));
742
742
  } catch {
743
743
  }
744
- const x = d.classList.contains("changed");
745
- y !== x && d.classList.toggle("changed", y);
746
- const I = t.effectiveConfig?.rowClass;
747
- if (I) {
744
+ const T = d.classList.contains("changed");
745
+ v !== T && d.classList.toggle("changed", v);
746
+ const N = t.effectiveConfig?.rowClass;
747
+ if (N) {
748
748
  const S = d.getAttribute("data-dynamic-classes");
749
749
  S && S.split(" ").forEach((L) => L && d.classList.remove(L));
750
750
  try {
751
- const L = I(u);
751
+ const L = N(u);
752
752
  if (L && L.length > 0) {
753
753
  const re = L.filter((X) => X && typeof X == "string");
754
754
  re.forEach((X) => d.classList.add(X)), d.setAttribute("data-dynamic-classes", re.join(" "));
@@ -786,15 +786,15 @@ function ae(t, e, i, o) {
786
786
  const d = n[u];
787
787
  if (d.classList.contains("editing")) continue;
788
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?.({
789
+ const w = r[u], C = i[w.field];
790
+ d.textContent = C == null ? "" : String(C), d.getAttribute("data-row") !== g && d.setAttribute("data-row", g);
791
+ const m = c === o && h === u, _ = d.classList.contains("cell-focus");
792
+ m !== _ && (d.classList.toggle("cell-focus", m), d.setAttribute("aria-selected", String(m))), f && t._afterCellRender?.({
793
793
  row: i,
794
794
  rowIndex: o,
795
795
  column: w,
796
796
  colIndex: u,
797
- value: v,
797
+ value: C,
798
798
  cellElement: d,
799
799
  rowElement: e
800
800
  });
@@ -809,58 +809,84 @@ function ae(t, e, i, o) {
809
809
  for (let u = 0; u < a; u++) {
810
810
  const d = r[u], w = n[u];
811
811
  w.getAttribute("data-row") !== g && w.setAttribute("data-row", g);
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)));
812
+ const C = c === o && h === u, m = w.classList.contains("cell-focus");
813
+ C !== m && (w.classList.toggle("cell-focus", C), w.setAttribute("aria-selected", String(C)));
814
814
  const _ = d.cellClass;
815
815
  if (_) {
816
- const y = w.getAttribute("data-dynamic-classes");
817
- y && y.split(" ").forEach((m) => m && w.classList.remove(m));
816
+ const v = w.getAttribute("data-dynamic-classes");
817
+ v && v.split(" ").forEach((b) => b && w.classList.remove(b));
818
818
  try {
819
- const m = i[d.field], x = _(m, i, d);
820
- if (x && x.length > 0) {
821
- const I = x.filter((S) => S && typeof S == "string");
822
- I.forEach((S) => w.classList.add(S)), w.setAttribute("data-dynamic-classes", I.join(" "));
819
+ const b = i[d.field], T = _(b, i, d);
820
+ if (T && T.length > 0) {
821
+ const N = T.filter((S) => S && typeof S == "string");
822
+ N.forEach((S) => w.classList.add(S)), w.setAttribute("data-dynamic-classes", N.join(" "));
823
823
  } else
824
824
  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");
825
+ } catch (b) {
826
+ console.warn(`[tbw-grid] cellClass callback error for column '${d.field}':`, b), w.removeAttribute("data-dynamic-classes");
827
827
  }
828
828
  }
829
829
  if (w.classList.contains("editing")) continue;
830
- const R = Qe(t, d);
830
+ const R = Ze(t, d);
831
831
  if (R) {
832
- const y = i[d.field], m = R({
832
+ const v = i[d.field], b = R({
833
833
  row: i,
834
- value: y,
834
+ value: v,
835
835
  field: d.field,
836
836
  column: d,
837
837
  cellEl: w
838
838
  });
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?.({
839
+ typeof b == "string" ? (t.__frameworkAdapter?.releaseCell?.(w), w.innerHTML = k(b)) : b instanceof Node ? b.parentElement !== w && (t.__frameworkAdapter?.releaseCell?.(w), w.innerHTML = "", w.appendChild(b)) : b == null && (t.__frameworkAdapter?.releaseCell?.(w), w.textContent = v == null ? "" : String(v)), f && t._afterCellRender?.({
840
+ row: i,
841
+ rowIndex: o,
842
+ column: d,
843
+ colIndex: u,
844
+ value: v,
845
+ cellElement: w,
846
+ rowElement: e
847
+ });
848
+ continue;
849
+ }
850
+ if (d.__compiledView) {
851
+ const v = i[d.field], b = d.__compiledView({ row: i, value: v, field: d.field, column: d });
852
+ d.__compiledView.__blocked ? w.textContent = "" : (w.firstElementChild && t.__frameworkAdapter?.releaseCell?.(w), w.innerHTML = k(b), ge(w)), f && t._afterCellRender?.({
840
853
  row: i,
841
854
  rowIndex: o,
842
855
  column: d,
843
856
  colIndex: u,
844
- value: y,
857
+ value: v,
845
858
  cellElement: w,
846
859
  rowElement: e
847
860
  });
848
861
  continue;
849
862
  }
850
- if (d.__viewTemplate || d.__compiledView || d.externalView)
863
+ if (d.__viewTemplate) {
864
+ const v = i[d.field], b = d.__viewTemplate.innerHTML;
865
+ /Reflect\.|\bProxy\b|ownKeys\(/.test(b) ? w.textContent = "" : (w.firstElementChild && t.__frameworkAdapter?.releaseCell?.(w), w.innerHTML = k(Ce(b, { row: i, value: v })), ge(w)), f && t._afterCellRender?.({
866
+ row: i,
867
+ rowIndex: o,
868
+ column: d,
869
+ colIndex: u,
870
+ value: v,
871
+ cellElement: w,
872
+ rowElement: e
873
+ });
874
+ continue;
875
+ }
876
+ if (d.externalView)
851
877
  continue;
852
878
  const E = i[d.field];
853
- let T;
854
- const C = Ze(t, d);
855
- if (C) {
879
+ let x;
880
+ const y = Je(t, d);
881
+ if (y) {
856
882
  try {
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);
883
+ const v = y(E, i);
884
+ x = v == null ? "" : String(v);
885
+ } catch (v) {
886
+ console.warn(`[tbw-grid] Format error in column '${d.field}':`, v), x = E == null ? "" : String(E);
861
887
  }
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);
888
+ w.textContent = x;
889
+ } else d.type === "date" ? (x = Ke(E), w.textContent = x) : d.type === "boolean" ? w.innerHTML = je(!!E) : (x = E == null ? "" : String(E), w.textContent = x);
864
890
  f && t._afterCellRender?.({
865
891
  row: i,
866
892
  rowIndex: o,
@@ -886,27 +912,27 @@ function B(t, e, i, o) {
886
912
  const g = r[p], u = Dt();
887
913
  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
914
  let d = i[g.field];
889
- const w = Ze(t, g);
915
+ const w = Je(t, g);
890
916
  if (w)
891
917
  try {
892
918
  d = w(d, i);
893
- } catch (C) {
894
- console.warn(`[tbw-grid] Format error in column '${g.field}':`, C);
919
+ } catch (y) {
920
+ console.warn(`[tbw-grid] Format error in column '${g.field}':`, y);
895
921
  }
896
- const v = g.__compiledView, b = g.__viewTemplate, _ = Qe(t, g), R = g.externalView;
922
+ const C = g.__compiledView, m = g.__viewTemplate, _ = Ze(t, g), R = g.externalView;
897
923
  let E = !1;
898
924
  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));
925
+ const y = _({ row: i, value: d, field: g.field, column: g, cellEl: u });
926
+ typeof y == "string" ? (u.innerHTML = k(y), E = !0) : y instanceof Node ? y.parentElement !== u && (u.textContent = "", u.appendChild(y)) : y == null && (u.textContent = d == null ? "" : String(d));
901
927
  } 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)
928
+ const y = R, v = document.createElement("div");
929
+ v.setAttribute("data-external-view", ""), v.setAttribute("data-field", g.field), u.appendChild(v);
930
+ const b = { row: i, value: d, field: g.field, column: g };
931
+ if (y.mount)
906
932
  try {
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);
933
+ y.mount({ placeholder: v, context: b, spec: y });
934
+ } catch (T) {
935
+ console.warn(`[tbw-grid] External view mount error for column '${g.field}':`, T);
910
936
  }
911
937
  else
912
938
  queueMicrotask(() => {
@@ -915,38 +941,38 @@ function B(t, e, i, o) {
915
941
  new CustomEvent("mount-external-view", {
916
942
  bubbles: !0,
917
943
  composed: !0,
918
- detail: { placeholder: y, spec: C, context: m }
944
+ detail: { placeholder: v, spec: y, context: b }
919
945
  })
920
946
  );
921
- } catch (x) {
922
- console.warn(`[tbw-grid] External view event dispatch error for column '${g.field}':`, x);
947
+ } catch (T) {
948
+ console.warn(`[tbw-grid] External view event dispatch error for column '${g.field}':`, T);
923
949
  }
924
950
  });
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);
951
+ v.setAttribute("data-mounted", "");
952
+ } else if (C) {
953
+ const y = C({ row: i, value: d, field: g.field, column: g }), v = C.__blocked;
954
+ u.innerHTML = v ? "" : k(y), E = !0, v && (u.textContent = "", u.setAttribute("data-blocked-template", ""));
955
+ } else if (m) {
956
+ const y = m.innerHTML;
957
+ /Reflect\.|\bProxy\b|ownKeys\(/.test(y) ? (u.textContent = "", u.setAttribute("data-blocked-template", "")) : (u.innerHTML = k(Ce(y, { row: i, value: d })), E = !0);
932
958
  } else
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);
959
+ w ? u.textContent = d == null ? "" : String(d) : g.type === "date" ? u.textContent = Ke(d) : g.type === "boolean" ? u.innerHTML = je(!!d) : u.textContent = d == null ? "" : String(d);
934
960
  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 = ""));
961
+ ge(u);
962
+ const y = u.textContent || "";
963
+ /Proxy|Reflect\.ownKeys/.test(y) && (u.textContent = y.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(u.textContent || "") && (u.textContent = ""));
938
964
  }
939
965
  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)
966
+ const x = g.cellClass;
967
+ if (x)
942
968
  try {
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(" "));
969
+ const y = i[g.field], v = x(y, i, g);
970
+ if (v && v.length > 0) {
971
+ const b = v.filter((T) => T && typeof T == "string");
972
+ b.forEach((T) => u.classList.add(T)), u.setAttribute("data-dynamic-classes", b.join(" "));
947
973
  }
948
- } catch (C) {
949
- console.warn(`[tbw-grid] cellClass callback error for column '${g.field}':`, C);
974
+ } catch (y) {
975
+ console.warn(`[tbw-grid] cellClass callback error for column '${g.field}':`, y);
950
976
  }
951
977
  h && t._afterCellRender?.({
952
978
  row: i,
@@ -960,9 +986,9 @@ function B(t, e, i, o) {
960
986
  }
961
987
  e.appendChild(f);
962
988
  }
963
- function Le(t, e, i) {
989
+ function ze(t, e, i) {
964
990
  if (e.target?.closest(".resize-handle")) return;
965
- const o = i.querySelector(".cell[data-row]"), n = Ke(o);
991
+ const o = i.querySelector(".cell[data-row]"), n = Qe(o);
966
992
  if (n < 0) return;
967
993
  const r = t._rows[n];
968
994
  if (!r || t._dispatchRowClick?.(e, n, r, i))
@@ -975,15 +1001,15 @@ function Le(t, e, i) {
975
1001
  return;
976
1002
  const a = t._focusRow !== n || t._focusCol !== l;
977
1003
  if (t._focusRow = n, t._focusCol = l, s.classList.contains("editing")) {
978
- a && (Ce(t._bodyEl ?? t), s.classList.add("cell-focus"));
979
- const c = s.querySelector(Je);
1004
+ a && (_e(t._bodyEl ?? t), s.classList.add("cell-focus"));
1005
+ const c = s.querySelector(et);
980
1006
  try {
981
1007
  c?.focus({ preventScroll: !0 });
982
1008
  } catch {
983
1009
  }
984
1010
  return;
985
1011
  }
986
- $(t);
1012
+ W(t);
987
1013
  }
988
1014
  }
989
1015
  }
@@ -998,7 +1024,7 @@ function kt(t, e) {
998
1024
  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"))) {
999
1025
  switch (e.key) {
1000
1026
  case "Tab": {
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);
1027
+ 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), W(t);
1002
1028
  return;
1003
1029
  }
1004
1030
  case "ArrowDown":
@@ -1008,18 +1034,18 @@ function kt(t, e) {
1008
1034
  n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = Math.max(0, t._focusRow - 1), e.preventDefault();
1009
1035
  break;
1010
1036
  case "ArrowRight": {
1011
- He(t) ? t._focusCol = Math.max(0, t._focusCol - 1) : t._focusCol = Math.min(o, t._focusCol + 1), e.preventDefault();
1037
+ Pe(t) ? t._focusCol = Math.max(0, t._focusCol - 1) : t._focusCol = Math.min(o, t._focusCol + 1), e.preventDefault();
1012
1038
  break;
1013
1039
  }
1014
1040
  case "ArrowLeft": {
1015
- He(t) ? t._focusCol = Math.min(o, t._focusCol + 1) : t._focusCol = Math.max(0, t._focusCol - 1), e.preventDefault();
1041
+ Pe(t) ? t._focusCol = Math.min(o, t._focusCol + 1) : t._focusCol = Math.max(0, t._focusCol - 1), e.preventDefault();
1016
1042
  break;
1017
1043
  }
1018
1044
  case "Home":
1019
- (e.ctrlKey || e.metaKey) && (n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = 0), t._focusCol = 0, e.preventDefault(), $(t, { forceScrollLeft: !0 });
1045
+ (e.ctrlKey || e.metaKey) && (n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = 0), t._focusCol = 0, e.preventDefault(), W(t, { forceScrollLeft: !0 });
1020
1046
  return;
1021
1047
  case "End":
1022
- (e.ctrlKey || e.metaKey) && (n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = i), t._focusCol = o, e.preventDefault(), $(t, { forceScrollRight: !0 });
1048
+ (e.ctrlKey || e.metaKey) && (n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = i), t._focusCol = o, e.preventDefault(), W(t, { forceScrollRight: !0 });
1023
1049
  return;
1024
1050
  case "PageDown":
1025
1051
  t._focusRow = Math.min(i, t._focusRow + 20), e.preventDefault();
@@ -1030,7 +1056,7 @@ function kt(t, e) {
1030
1056
  case "Enter": {
1031
1057
  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
1058
  `[data-row="${h}"][data-col="${f}"]`
1033
- ), v = {
1059
+ ), C = {
1034
1060
  rowIndex: h,
1035
1061
  colIndex: f,
1036
1062
  column: p,
@@ -1040,16 +1066,16 @@ function kt(t, e) {
1040
1066
  cellEl: w,
1041
1067
  trigger: "keyboard",
1042
1068
  originalEvent: e
1043
- }, b = new CustomEvent("cell-activate", {
1069
+ }, m = new CustomEvent("cell-activate", {
1044
1070
  cancelable: !0,
1045
- detail: v
1071
+ detail: C
1046
1072
  });
1047
- t.dispatchEvent(b);
1073
+ t.dispatchEvent(m);
1048
1074
  const _ = new CustomEvent("activate-cell", {
1049
1075
  cancelable: !0,
1050
1076
  detail: { row: h, col: f }
1051
1077
  });
1052
- if (t.dispatchEvent(_), b.defaultPrevented || _.defaultPrevented) {
1078
+ if (t.dispatchEvent(_), m.defaultPrevented || _.defaultPrevented) {
1053
1079
  e.preventDefault();
1054
1080
  return;
1055
1081
  }
@@ -1058,10 +1084,10 @@ function kt(t, e) {
1058
1084
  default:
1059
1085
  return;
1060
1086
  }
1061
- $(t);
1087
+ W(t);
1062
1088
  }
1063
1089
  }
1064
- function $(t, e) {
1090
+ function W(t, e) {
1065
1091
  if (t._virtualization?.enabled) {
1066
1092
  const { rowHeight: s, container: l, viewportEl: a } = t._virtualization, c = l, h = a?.clientHeight ?? c?.clientHeight ?? 0;
1067
1093
  if (c && h > 0) {
@@ -1070,7 +1096,7 @@ function $(t, e) {
1070
1096
  }
1071
1097
  }
1072
1098
  const i = t._activeEditRows !== void 0 && t._activeEditRows !== -1;
1073
- i || t.refreshVirtualWindow(!1), Ce(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
1099
+ i || t.refreshVirtualWindow(!1), _e(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
1074
1100
  s.setAttribute("aria-selected", "false");
1075
1101
  });
1076
1102
  const o = t._focusRow, n = t._virtualization.start ?? 0, r = t._virtualization.end ?? t._rows.length;
@@ -1093,7 +1119,7 @@ function $(t, e) {
1093
1119
  }
1094
1120
  }
1095
1121
  if (i && l.classList.contains("editing")) {
1096
- const c = l.querySelector(Je);
1122
+ const c = l.querySelector(et);
1097
1123
  if (c && document.activeElement !== c)
1098
1124
  try {
1099
1125
  c.focus({ preventScroll: !0 });
@@ -1114,13 +1140,13 @@ function $(t, e) {
1114
1140
  }
1115
1141
  const ie = /* @__PURE__ */ new WeakMap();
1116
1142
  function It(t, e) {
1117
- const i = Ke(e), o = Pt(e);
1143
+ const i = Qe(e), o = Pt(e);
1118
1144
  if (i < 0 || o < 0) return;
1119
- t._focusRow = i, t._focusCol = o, Ce(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true");
1145
+ t._focusRow = i, t._focusCol = o, _e(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true");
1120
1146
  const n = e.closest("tbw-grid");
1121
1147
  n && document.activeElement !== n && n.focus({ preventScroll: !0 });
1122
1148
  }
1123
- function ye(t, e, i, o) {
1149
+ function Ee(t, e, i, o) {
1124
1150
  let n = null;
1125
1151
  const r = i.composedPath?.();
1126
1152
  if (r && r.length > 0 ? n = r[0] : n = i.target, n && !e.contains(n)) {
@@ -1145,17 +1171,17 @@ function ye(t, e, i, o) {
1145
1171
  };
1146
1172
  }
1147
1173
  function Nt(t, e, i) {
1148
- const o = ye(t, e, i, "mousedown");
1174
+ const o = Ee(t, e, i, "mousedown");
1149
1175
  (t._dispatchCellMouseDown?.(o) ?? !1) && ie.set(t, !0);
1150
1176
  }
1151
1177
  function qt(t, e, i) {
1152
1178
  if (!ie.get(t)) return;
1153
- const o = ye(t, e, i, "mousemove");
1179
+ const o = Ee(t, e, i, "mousemove");
1154
1180
  t._dispatchCellMouseMove?.(o);
1155
1181
  }
1156
1182
  function $t(t, e, i) {
1157
1183
  if (!ie.get(t)) return;
1158
- const o = ye(t, e, i, "mouseup");
1184
+ const o = Ee(t, e, i, "mouseup");
1159
1185
  t._dispatchCellMouseUp?.(o), ie.set(t, !1);
1160
1186
  }
1161
1187
  function Wt(t, e, i) {
@@ -1170,7 +1196,7 @@ function Wt(t, e, i) {
1170
1196
  "click",
1171
1197
  (o) => {
1172
1198
  const n = o.target.closest(".data-grid-row");
1173
- if (n && Le(t, o, n), !document.activeElement?.closest(".cell.editing")) {
1199
+ if (n && ze(t, o, n), !document.activeElement?.closest(".cell.editing")) {
1174
1200
  const r = o.target.closest("tbw-grid");
1175
1201
  r && r.focus({ preventScroll: !0 });
1176
1202
  }
@@ -1180,7 +1206,7 @@ function Wt(t, e, i) {
1180
1206
  "dblclick",
1181
1207
  (o) => {
1182
1208
  const n = o.target.closest(".data-grid-row");
1183
- n && Le(t, o, n);
1209
+ n && ze(t, o, n);
1184
1210
  },
1185
1211
  { signal: i }
1186
1212
  );
@@ -1195,24 +1221,24 @@ function Vt(t, e, i) {
1195
1221
  const n = i.find((l) => l.field === e.field)?.sortComparator ?? Ut, { field: r, direction: s } = e;
1196
1222
  return [...t].sort((l, a) => n(l[r], a[r], l, a) * s);
1197
1223
  }
1198
- function Pe(t, e, i, o) {
1224
+ function De(t, e, i, o) {
1199
1225
  t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((n) => n.__epoch = -1), oe(t), t.refreshVirtualWindow(!0), t.dispatchEvent(
1200
1226
  new CustomEvent("sort-change", { detail: { field: i.field, direction: o } })
1201
1227
  ), t.requestStateChange?.();
1202
1228
  }
1203
- function ze(t, e) {
1204
- !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) => {
1229
+ function Oe(t, e) {
1230
+ !t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()), Me(t, e, 1)) : t._sortState.direction === 1 ? Me(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) => {
1205
1231
  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");
1206
1232
  }), t.refreshVirtualWindow(!0), t.dispatchEvent(
1207
1233
  new CustomEvent("sort-change", { detail: { field: e.field, direction: 0 } })
1208
1234
  ), t.requestStateChange?.());
1209
1235
  }
1210
- function De(t, e, i) {
1236
+ function Me(t, e, i) {
1211
1237
  t._sortState = { field: e.field, direction: i };
1212
1238
  const o = { field: e.field, direction: i }, n = t._columns, s = (t.effectiveConfig?.sortHandler ?? Vt)(t._rows, o, n);
1213
1239
  s && typeof s.then == "function" ? s.then((l) => {
1214
- Pe(t, l, e, i);
1215
- }) : Pe(t, s, e, i);
1240
+ De(t, l, e, i);
1241
+ }) : De(t, s, e, i);
1216
1242
  }
1217
1243
  function F(t, e) {
1218
1244
  return t.effectiveConfig?.sortable !== !1 && e.sortable === !0;
@@ -1225,7 +1251,7 @@ function Bt(t, e) {
1225
1251
  }
1226
1252
  function K(t, e) {
1227
1253
  const i = document.createElement("span");
1228
- Ge(i, "sort-indicator");
1254
+ Ye(i, "sort-indicator");
1229
1255
  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;
1230
1256
  return Bt(i, r), i;
1231
1257
  }
@@ -1241,11 +1267,11 @@ function Z(t, e, i, o) {
1241
1267
  o.classList.add("sortable"), o.tabIndex = 0;
1242
1268
  const n = t._sortState?.field === e.field ? t._sortState.direction : 0;
1243
1269
  o.setAttribute("aria-sort", n === 0 ? "none" : n === 1 ? "ascending" : "descending"), o.addEventListener("click", (r) => {
1244
- t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, e, o) || ze(t, e);
1270
+ t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, e, o) || Oe(t, e);
1245
1271
  }), o.addEventListener("keydown", (r) => {
1246
1272
  if (r.key === "Enter" || r.key === " ") {
1247
1273
  if (r.preventDefault(), t._dispatchHeaderClick?.(r, e, o)) return;
1248
- ze(t, e);
1274
+ Oe(t, e);
1249
1275
  }
1250
1276
  });
1251
1277
  }
@@ -1253,7 +1279,7 @@ function Gt(t, e) {
1253
1279
  if (e != null)
1254
1280
  if (typeof e == "string") {
1255
1281
  const i = document.createElement("span");
1256
- for (i.innerHTML = W(e); i.firstChild; )
1282
+ for (i.innerHTML = k(e); i.firstChild; )
1257
1283
  t.appendChild(i.firstChild);
1258
1284
  } else e instanceof Node && t.appendChild(e);
1259
1285
  }
@@ -1262,7 +1288,7 @@ function oe(t) {
1262
1288
  const e = t._headerRowEl;
1263
1289
  e && (e.innerHTML = "", t._visibleColumns.forEach((i, o) => {
1264
1290
  const n = document.createElement("div");
1265
- n.className = "cell", Ge(n, "header-cell"), n.setAttribute("role", "columnheader"), n.setAttribute("aria-colindex", String(o + 1)), n.setAttribute("data-field", i.field), n.setAttribute("data-col", String(o)), i.type && n.setAttribute("data-type", i.type);
1291
+ n.className = "cell", Ye(n, "header-cell"), n.setAttribute("role", "columnheader"), n.setAttribute("aria-colindex", String(o + 1)), n.setAttribute("data-field", i.field), n.setAttribute("data-col", String(o)), i.type && n.setAttribute("data-type", i.type);
1266
1292
  const r = i.header ?? i.field, s = t._sortState?.field === i.field ? t._sortState.direction : 0, l = s === 1 ? "asc" : s === -1 ? "desc" : null;
1267
1293
  if (i.headerRenderer) {
1268
1294
  const a = {
@@ -1280,7 +1306,7 @@ function oe(t) {
1280
1306
  column: i,
1281
1307
  value: r
1282
1308
  }, c = i.headerLabelRenderer(a), h = document.createElement("span");
1283
- 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)));
1309
+ c == null ? h.textContent = r : typeof c == "string" ? h.innerHTML = k(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)));
1284
1310
  } else if (i.__headerTemplate)
1285
1311
  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)));
1286
1312
  else {
@@ -1292,9 +1318,9 @@ function oe(t) {
1292
1318
  i.getAttribute("aria-sort") || i.setAttribute("aria-sort", "none");
1293
1319
  }), e.children.length > 0 ? (e.setAttribute("role", "row"), e.setAttribute("aria-rowindex", "1")) : (e.removeAttribute("role"), e.removeAttribute("aria-rowindex")));
1294
1320
  }
1295
- const it = typeof requestIdleCallback == "function";
1321
+ const ot = typeof requestIdleCallback == "function";
1296
1322
  function Xt(t, e) {
1297
- return it ? requestIdleCallback(t, e) : window.setTimeout(() => {
1323
+ return ot ? requestIdleCallback(t, e) : window.setTimeout(() => {
1298
1324
  const i = Date.now();
1299
1325
  t({
1300
1326
  didTimeout: !1,
@@ -1302,8 +1328,8 @@ function Xt(t, e) {
1302
1328
  });
1303
1329
  }, 1);
1304
1330
  }
1305
- function Oe(t) {
1306
- it ? cancelIdleCallback(t) : clearTimeout(t);
1331
+ function ke(t) {
1332
+ ot ? cancelIdleCallback(t) : clearTimeout(t);
1307
1333
  }
1308
1334
  function Yt(t) {
1309
1335
  const e = document.createElement("div");
@@ -1388,7 +1414,7 @@ class ti {
1388
1414
  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);
1389
1415
  }
1390
1416
  }
1391
- function Me(t) {
1417
+ function Ie(t) {
1392
1418
  let e = null, i = null, o = null, n = null;
1393
1419
  const r = (a) => {
1394
1420
  if (!e) return;
@@ -1455,7 +1481,7 @@ function si(t, e, i) {
1455
1481
  e !== "remove" && t.removeAttribute(ce);
1456
1482
  }, o);
1457
1483
  }
1458
- function _e(t, e, i) {
1484
+ function Se(t, e, i) {
1459
1485
  if (e < 0)
1460
1486
  return !1;
1461
1487
  const o = t.findRenderedRowElement?.(e);
@@ -1464,7 +1490,7 @@ function _e(t, e, i) {
1464
1490
  function li(t, e, i) {
1465
1491
  let o = 0;
1466
1492
  for (const n of e)
1467
- _e(t, n, i) && o++;
1493
+ Se(t, n, i) && o++;
1468
1494
  return o;
1469
1495
  }
1470
1496
  function ai(t, e, i) {
@@ -1479,7 +1505,7 @@ function ai(t, e, i) {
1479
1505
  return !1;
1480
1506
  }
1481
1507
  });
1482
- return r < 0 ? !1 : _e(t, r, i);
1508
+ return r < 0 ? !1 : Se(t, r, i);
1483
1509
  }
1484
1510
  function J(t, e, i) {
1485
1511
  const o = document.createElement(t);
@@ -1499,7 +1525,7 @@ function P(t, e) {
1499
1525
  }
1500
1526
  return i;
1501
1527
  }
1502
- function ot(t, e, i) {
1528
+ function nt(t, e, i) {
1503
1529
  const o = document.createElement("button");
1504
1530
  if (t && (o.className = t), e)
1505
1531
  for (const n in e) {
@@ -1508,8 +1534,8 @@ function ot(t, e, i) {
1508
1534
  }
1509
1535
  return o;
1510
1536
  }
1511
- const nt = document.createElement("template");
1512
- nt.innerHTML = `
1537
+ const rt = document.createElement("template");
1538
+ rt.innerHTML = `
1513
1539
  <div class="tbw-scroll-area">
1514
1540
  <div class="rows-body-wrapper">
1515
1541
  <div class="rows-body" role="grid">
@@ -1528,16 +1554,16 @@ nt.innerHTML = `
1528
1554
  <div class="faux-vscroll-spacer"></div>
1529
1555
  </div>
1530
1556
  `;
1531
- function rt() {
1532
- return nt.content.cloneNode(!0);
1557
+ function st() {
1558
+ return rt.content.cloneNode(!0);
1533
1559
  }
1534
- function ke(t) {
1560
+ function Ne(t) {
1535
1561
  const e = document.createDocumentFragment(), i = P(t.hasShell ? "tbw-grid-root has-shell" : "tbw-grid-root");
1536
1562
  if (t.hasShell && t.shellHeader && t.shellBody)
1537
1563
  i.appendChild(t.shellHeader), i.appendChild(t.shellBody);
1538
1564
  else {
1539
1565
  const o = P("tbw-grid-content");
1540
- o.appendChild(rt()), i.appendChild(o);
1566
+ o.appendChild(st()), i.appendChild(o);
1541
1567
  }
1542
1568
  return e.appendChild(i), e;
1543
1569
  }
@@ -1559,7 +1585,7 @@ function ci(t) {
1559
1585
  for (const r of t.apiButtons)
1560
1586
  r.hasRender && o.appendChild(P("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1561
1587
  if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && o.appendChild(P("tbw-toolbar-separator")), t.hasPanels) {
1562
- const r = ot(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
1588
+ const r = nt(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
1563
1589
  "data-panel-toggle": "",
1564
1590
  title: "Settings",
1565
1591
  "aria-label": "Toggle settings panel",
@@ -1572,7 +1598,7 @@ function ci(t) {
1572
1598
  }
1573
1599
  function di(t) {
1574
1600
  const e = P("tbw-shell-body"), i = t.panels.length > 0, o = t.panels.length === 1, n = P("tbw-grid-content");
1575
- n.appendChild(rt());
1601
+ n.appendChild(st());
1576
1602
  let r = null;
1577
1603
  if (i) {
1578
1604
  r = J("aside", {
@@ -1592,7 +1618,7 @@ function di(t) {
1592
1618
  );
1593
1619
  const l = P("tbw-tool-panel-content", { role: "presentation" }), a = P("tbw-accordion");
1594
1620
  for (const c of t.panels) {
1595
- const h = `tbw-accordion-section${c.isExpanded ? " expanded" : ""}${o ? " single" : ""}`, f = P(h, { "data-section": c.id }), p = ot("tbw-accordion-header", {
1621
+ const h = `tbw-accordion-section${c.isExpanded ? " expanded" : ""}${o ? " single" : ""}`, f = P(h, { "data-section": c.id }), p = nt("tbw-accordion-header", {
1596
1622
  "aria-expanded": String(c.isExpanded),
1597
1623
  "aria-controls": `tbw-section-${c.id}`
1598
1624
  });
@@ -1616,7 +1642,7 @@ function di(t) {
1616
1642
  }
1617
1643
  return t.position === "left" && r ? (e.appendChild(r), e.appendChild(n)) : (e.appendChild(n), r && e.appendChild(r)), e;
1618
1644
  }
1619
- function N(t) {
1645
+ function q(t) {
1620
1646
  return t ? typeof t == "string" ? t : t.outerHTML : "";
1621
1647
  }
1622
1648
  function hi() {
@@ -1638,11 +1664,11 @@ function hi() {
1638
1664
  lightDomContentMoved: !1
1639
1665
  };
1640
1666
  }
1641
- function st(t) {
1667
+ function lt(t) {
1642
1668
  return !!(t?.header?.title || t?.header?.toolbarContents?.length || t?.toolPanels?.length || t?.headerContents?.length || t?.header?.lightDomContent?.length || t?.header?.hasToolButtonsContainer);
1643
1669
  }
1644
1670
  function ui(t, e, i = "☰") {
1645
- const o = t?.header?.title ?? e.lightDomTitle ?? "", n = !!o, r = N(i), s = t?.header?.toolbarContents ?? [], l = [...e.toolbarContents.values()], a = new Set(s.map((d) => d.id)), c = [...s];
1671
+ const o = t?.header?.title ?? e.lightDomTitle ?? "", n = !!o, r = q(i), s = t?.header?.toolbarContents ?? [], l = [...e.toolbarContents.values()], a = new Set(s.map((d) => d.id)), c = [...s];
1646
1672
  for (const d of l)
1647
1673
  a.has(d.id) || c.push(d);
1648
1674
  const h = c.length > 0, f = e.toolPanels.size > 0, p = h && f, g = [...c].sort((d, w) => (d.order ?? 0) - (w.order ?? 0));
@@ -1655,7 +1681,7 @@ function ui(t, e, i = "☰") {
1655
1681
  }
1656
1682
  return `
1657
1683
  <div class="tbw-shell-header" part="shell-header" role="presentation">
1658
- ${n ? `<div class="tbw-shell-title">${yt(o)}</div>` : ""}
1684
+ ${n ? `<div class="tbw-shell-title">${_t(o)}</div>` : ""}
1659
1685
  <div class="tbw-shell-content" part="shell-content" role="presentation" data-light-dom-header-content></div>
1660
1686
  <div class="tbw-shell-toolbar" part="shell-toolbar" role="presentation">
1661
1687
  ${u}
@@ -1663,7 +1689,7 @@ function ui(t, e, i = "☰") {
1663
1689
  </div>
1664
1690
  `;
1665
1691
  }
1666
- function Ie(t, e) {
1692
+ function qe(t, e) {
1667
1693
  const i = t.querySelector("tbw-grid-header");
1668
1694
  if (!i) return;
1669
1695
  if (!e.lightDomTitle) {
@@ -1673,7 +1699,7 @@ function Ie(t, e) {
1673
1699
  const o = i.querySelectorAll("tbw-grid-header-content");
1674
1700
  o.length > 0 && e.lightDomHeaderContent.length === 0 && (e.lightDomHeaderContent = Array.from(o)), i.style.display = "none";
1675
1701
  }
1676
- function Ne(t, e, i) {
1702
+ function $e(t, e, i) {
1677
1703
  const o = t.querySelector(":scope > tbw-grid-tool-buttons");
1678
1704
  if (!o) return;
1679
1705
  e.hasToolButtonsContainer = !0;
@@ -1693,7 +1719,7 @@ function Ne(t, e, i) {
1693
1719
  };
1694
1720
  e.toolbarContents.set(n, r), e.lightDomToolbarContentIds.add(n), o.style.display = "none";
1695
1721
  }
1696
- function qe(t, e, i) {
1722
+ function We(t, e, i) {
1697
1723
  t.querySelectorAll(":scope > tbw-grid-tool-panel").forEach((n) => {
1698
1724
  const r = n, s = r.getAttribute("id"), l = r.getAttribute("title");
1699
1725
  if (!s || !l) {
@@ -1710,8 +1736,8 @@ function qe(t, e, i) {
1710
1736
  else {
1711
1737
  const d = r.innerHTML.trim();
1712
1738
  f = (w) => {
1713
- const v = document.createElement("div");
1714
- return v.innerHTML = d, w.appendChild(v), () => v.remove();
1739
+ const C = document.createElement("div");
1740
+ return C.innerHTML = d, w.appendChild(C), () => C.remove();
1715
1741
  };
1716
1742
  }
1717
1743
  const g = e.toolPanels.get(s);
@@ -1772,8 +1798,8 @@ function pi(t, e, i) {
1772
1798
  const p = (d) => {
1773
1799
  if (!f) return;
1774
1800
  d.preventDefault();
1775
- const w = s === "left" ? d.clientX - a : a - d.clientX, v = Math.min(h, Math.max(l, c + w));
1776
- o.style.width = `${v}px`;
1801
+ const w = s === "left" ? d.clientX - a : a - d.clientX, C = Math.min(h, Math.max(l, c + w));
1802
+ o.style.width = `${C}px`;
1777
1803
  }, g = () => {
1778
1804
  if (!f) return;
1779
1805
  f = !1, n.classList.remove("resizing"), o.style.transition = "", document.body.style.cursor = "", document.body.style.userSelect = "";
@@ -1798,7 +1824,7 @@ function de(t, e, i) {
1798
1824
  c && i.toolbarContentCleanups.set(l.id, c);
1799
1825
  }
1800
1826
  }
1801
- function ge(t, e) {
1827
+ function pe(t, e) {
1802
1828
  const i = e.lightDomHeaderContent.length > 0 && !e.lightDomContentMoved, o = e.headerContents.size > 0;
1803
1829
  if (!i && !o) return;
1804
1830
  const n = t.querySelector(".tbw-shell-content");
@@ -1820,7 +1846,7 @@ function ge(t, e) {
1820
1846
  }
1821
1847
  function wi(t, e, i) {
1822
1848
  if (!e.isPanelOpen) return;
1823
- const o = N(i?.expand ?? M.expand), n = N(i?.collapse ?? M.collapse);
1849
+ const o = q(i?.expand ?? M.expand), n = q(i?.collapse ?? M.collapse);
1824
1850
  for (const [r, s] of e.toolPanels) {
1825
1851
  const l = e.expandedSections.has(r), a = t.querySelector(`[data-section="${r}"]`), c = a?.querySelector(".tbw-accordion-content");
1826
1852
  if (!a || !c) continue;
@@ -1839,11 +1865,11 @@ function wi(t, e, i) {
1839
1865
  }
1840
1866
  }
1841
1867
  }
1842
- function $e(t, e) {
1868
+ function Fe(t, e) {
1843
1869
  const i = t.querySelector("[data-panel-toggle]");
1844
1870
  i && (i.classList.toggle("active", e.isPanelOpen), i.setAttribute("aria-pressed", String(e.isPanelOpen)));
1845
1871
  }
1846
- function We(t, e) {
1872
+ function Ue(t, e) {
1847
1873
  const i = t.querySelector(".tbw-tool-panel");
1848
1874
  i && (i.classList.toggle("open", e.isPanelOpen), e.isPanelOpen || (i.style.width = ""));
1849
1875
  }
@@ -1898,7 +1924,7 @@ function mi(t, e) {
1898
1924
  s && t.expandedSections.add(s.id);
1899
1925
  }
1900
1926
  const n = e.getShadow();
1901
- $e(n, t), We(n, t), wi(n, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: o.expandedSections });
1927
+ Fe(n, t), Ue(n, t), wi(n, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: o.expandedSections });
1902
1928
  },
1903
1929
  closeToolPanel() {
1904
1930
  if (!t.isPanelOpen) return;
@@ -1909,7 +1935,7 @@ function mi(t, e) {
1909
1935
  r.onClose?.();
1910
1936
  t.isPanelOpen = !1;
1911
1937
  const n = e.getShadow();
1912
- $e(n, t), We(n, t), e.emit("tool-panel-close", {});
1938
+ Fe(n, t), Ue(n, t), e.emit("tool-panel-close", {});
1913
1939
  },
1914
1940
  toggleToolPanel() {
1915
1941
  t.isPanelOpen ? o.closeToolPanel() : o.openToolPanel();
@@ -1963,7 +1989,7 @@ function mi(t, e) {
1963
1989
  console.warn(`[tbw-grid] Header content "${n.id}" already registered`);
1964
1990
  return;
1965
1991
  }
1966
- t.headerContents.set(n.id, n), i && ge(e.getShadow(), t);
1992
+ t.headerContents.set(n.id, n), i && pe(e.getShadow(), t);
1967
1993
  },
1968
1994
  unregisterHeaderContent(n) {
1969
1995
  const r = t.headerContentCleanups.get(n);
@@ -2001,7 +2027,7 @@ function vi(t, e, i) {
2001
2027
  r && e.panelCleanups.set(i, r);
2002
2028
  }
2003
2029
  function Ci(t, e, i, o) {
2004
- const n = st(e), r = [], s = [
2030
+ const n = lt(e), r = [], s = [
2005
2031
  "tbw-grid-header",
2006
2032
  "tbw-grid-tool-buttons",
2007
2033
  "tbw-grid-tool-panel",
@@ -2015,7 +2041,7 @@ function Ci(t, e, i, o) {
2015
2041
  for (const l of r)
2016
2042
  t.appendChild(l);
2017
2043
  if (n) {
2018
- const l = N(o?.toolPanel ?? M.toolPanel), a = N(o?.expand ?? M.expand), c = N(o?.collapse ?? M.collapse), f = [...e?.header?.toolbarContents ?? []].sort((_, R) => (_.order ?? 0) - (R.order ?? 0)), g = [...e?.toolPanels ?? []].sort((_, R) => (_.order ?? 100) - (R.order ?? 100)), u = {
2044
+ const l = q(o?.toolPanel ?? M.toolPanel), a = q(o?.expand ?? M.expand), c = q(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 = {
2019
2045
  title: e?.header?.title ?? void 0,
2020
2046
  hasPanels: g.length > 0,
2021
2047
  isPanelOpen: i.isPanelOpen,
@@ -2034,30 +2060,30 @@ function Ci(t, e, i, o) {
2034
2060
  panels: g.map((_) => ({
2035
2061
  id: _.id,
2036
2062
  title: _.title,
2037
- icon: N(_.icon),
2063
+ icon: q(_.icon),
2038
2064
  isExpanded: i.expandedSections.has(_.id)
2039
2065
  }))
2040
- }, w = ci(u), v = di(d), b = ke({
2066
+ }, w = ci(u), C = di(d), m = Ne({
2041
2067
  hasShell: !0,
2042
2068
  shellHeader: w,
2043
- shellBody: v
2069
+ shellBody: C
2044
2070
  });
2045
- t.appendChild(b);
2071
+ t.appendChild(m);
2046
2072
  } else {
2047
- const l = ke({ hasShell: !1 });
2073
+ const l = Ne({ hasShell: !1 });
2048
2074
  t.appendChild(l);
2049
2075
  }
2050
2076
  return n;
2051
2077
  }
2052
- const Fe = "tbw-grid-styles";
2078
+ const Ve = "tbw-grid-styles";
2053
2079
  let te = "";
2054
- const pe = /* @__PURE__ */ new Map();
2080
+ const we = /* @__PURE__ */ new Map();
2055
2081
  function yi() {
2056
- let t = document.getElementById(Fe);
2057
- return t || (t = document.createElement("style"), t.id = Fe, t.setAttribute("data-tbw-grid", "true"), document.head.appendChild(t)), t;
2082
+ let t = document.getElementById(Ve);
2083
+ return t || (t = document.createElement("style"), t.id = Ve, t.setAttribute("data-tbw-grid", "true"), document.head.appendChild(t)), t;
2058
2084
  }
2059
- function we() {
2060
- const t = yi(), e = Array.from(pe.values()).join(`
2085
+ function be() {
2086
+ const t = yi(), e = Array.from(we.values()).join(`
2061
2087
  `);
2062
2088
  t.textContent = `${te}
2063
2089
 
@@ -2067,8 +2093,8 @@ ${e}`;
2067
2093
  function _i(t) {
2068
2094
  let e = !1;
2069
2095
  for (const { name: i, styles: o } of t)
2070
- pe.has(i) || (pe.set(i, o), e = !0);
2071
- return e && we(), e;
2096
+ we.has(i) || (we.set(i, o), e = !0);
2097
+ return e && be(), e;
2072
2098
  }
2073
2099
  function Ei() {
2074
2100
  try {
@@ -2090,12 +2116,12 @@ async function Si(t) {
2090
2116
  if (te)
2091
2117
  return;
2092
2118
  if (typeof t == "string" && t.length > 0) {
2093
- te = t, we();
2119
+ te = t, be();
2094
2120
  return;
2095
2121
  }
2096
2122
  await new Promise((i) => setTimeout(i, 50));
2097
2123
  const e = Ei();
2098
- e ? (te = e, we()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
2124
+ e ? (te = e, be()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
2099
2125
  "[tbw-grid] Could not find grid.css in document.styleSheets. Grid styling will not work.",
2100
2126
  "Available stylesheets:",
2101
2127
  Array.from(document.styleSheets).map((i) => i.href || "(inline)")
@@ -2118,12 +2144,12 @@ function Ri() {
2118
2144
  function Ai(t) {
2119
2145
  t.startY = null, t.startX = null, t.scrollTop = null, t.scrollLeft = null, t.lastY = null, t.lastX = null, t.lastTime = null;
2120
2146
  }
2121
- function lt(t) {
2147
+ function at(t) {
2122
2148
  t.momentumRaf && (cancelAnimationFrame(t.momentumRaf), t.momentumRaf = 0);
2123
2149
  }
2124
2150
  function Ti(t, e, i) {
2125
2151
  if (t.touches.length !== 1) return;
2126
- lt(e);
2152
+ at(e);
2127
2153
  const o = t.touches[0];
2128
2154
  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;
2129
2155
  }
@@ -2139,8 +2165,8 @@ function xi(t, e, i) {
2139
2165
  const { scrollTop: c, scrollHeight: h, clientHeight: f } = i.fauxScrollbar, p = h - f, g = l > 0 && c < p || l < 0 && c > 0;
2140
2166
  let u = !1;
2141
2167
  if (i.scrollArea) {
2142
- const { scrollLeft: d, scrollWidth: w, clientWidth: v } = i.scrollArea, b = w - v;
2143
- u = a > 0 && d < b || a < 0 && d > 0;
2168
+ const { scrollLeft: d, scrollWidth: w, clientWidth: C } = i.scrollArea, m = w - C;
2169
+ u = a > 0 && d < m || a < 0 && d > 0;
2144
2170
  }
2145
2171
  return g && (i.fauxScrollbar.scrollTop = e.scrollTop + l), u && i.scrollArea && (i.scrollArea.scrollLeft = e.scrollLeft + a), g || u;
2146
2172
  }
@@ -2219,13 +2245,13 @@ const zi = [
2219
2245
  function Oi(t) {
2220
2246
  return t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
2221
2247
  }
2222
- function be(t) {
2248
+ function me(t) {
2223
2249
  return `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${Oi(t)}';`;
2224
2250
  }
2225
2251
  function D(t) {
2226
2252
  return t.charAt(0).toUpperCase() + t.slice(1);
2227
2253
  }
2228
- function Ue(t, e) {
2254
+ function Be(t, e) {
2229
2255
  return t.some((i) => i.name === e);
2230
2256
  }
2231
2257
  function Mi(t, e) {
@@ -2237,16 +2263,16 @@ function Mi(t, e) {
2237
2263
  }
2238
2264
  for (const l of o) {
2239
2265
  const a = t[l.property];
2240
- (l.isUsed ? l.isUsed(a) : a !== void 0) && !Ue(e, l.pluginName) && r(l.pluginName, l.description, be(l.pluginName), l.property, !0);
2266
+ (l.isUsed ? l.isUsed(a) : a !== void 0) && !Be(e, l.pluginName) && r(l.pluginName, l.description, me(l.pluginName), l.property, !0);
2241
2267
  }
2242
2268
  const s = t.columns;
2243
2269
  if (s && s.length > 0)
2244
2270
  for (const l of s)
2245
2271
  for (const a of i) {
2246
2272
  const c = l[a.property];
2247
- if ((a.isUsed ? a.isUsed(c) : c !== void 0) && !Ue(e, a.pluginName)) {
2273
+ if ((a.isUsed ? a.isUsed(c) : c !== void 0) && !Be(e, a.pluginName)) {
2248
2274
  const f = l.field || "<unknown>";
2249
- r(a.pluginName, a.description, be(a.pluginName), f);
2275
+ r(a.pluginName, a.description, me(a.pluginName), f);
2250
2276
  }
2251
2277
  }
2252
2278
  if (n.size > 0) {
@@ -2292,7 +2318,7 @@ function ki(t) {
2292
2318
  }
2293
2319
  }
2294
2320
  }
2295
- if (i.length > 0 && ve())
2321
+ if (i.length > 0 && ye())
2296
2322
  for (const o of i)
2297
2323
  console.warn(o);
2298
2324
  if (e.length > 0)
@@ -2307,7 +2333,7 @@ function Ii(t, e) {
2307
2333
  for (const r of n) {
2308
2334
  const s = r.name, l = r.required ?? !0, a = r.reason;
2309
2335
  if (!e.some((h) => h.name === s)) {
2310
- const h = a ?? `${D(i)}Plugin requires ${D(s)}Plugin`, f = be(s);
2336
+ const h = a ?? `${D(i)}Plugin requires ${D(s)}Plugin`, f = me(s);
2311
2337
  if (l)
2312
2338
  throw new Error(
2313
2339
  `[tbw-grid] Plugin dependency error:
@@ -2325,7 +2351,7 @@ ${h}.
2325
2351
  }
2326
2352
  }
2327
2353
  function Ni(t) {
2328
- if (!ve()) return;
2354
+ if (!ye()) return;
2329
2355
  const e = new Set(t.map((o) => o.name)), i = /* @__PURE__ */ new Set();
2330
2356
  for (const o of t) {
2331
2357
  const r = o.constructor.manifest;
@@ -2347,18 +2373,18 @@ ${D(o.name)}Plugin and ${D(s.name)}Plugin are both loaded, but they are currentl
2347
2373
  }
2348
2374
  }
2349
2375
  }
2350
- function at(t, e) {
2376
+ function ct(t, e) {
2351
2377
  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;
2352
2378
  }
2353
2379
  function qi(t, e, i) {
2354
- const o = at(e, i);
2380
+ const o = ct(e, i);
2355
2381
  if (typeof o == "string")
2356
2382
  return t.byKey.get(o);
2357
2383
  if (o && typeof o == "object")
2358
2384
  return t.byRef.get(o);
2359
2385
  }
2360
2386
  function $i(t, e, i, o) {
2361
- const n = at(e, o);
2387
+ const n = ct(e, o);
2362
2388
  typeof n == "string" ? t.byKey.set(n, i) : n && typeof n == "object" && t.byRef.set(n, i);
2363
2389
  }
2364
2390
  function Wi(t, e, i, o, n) {
@@ -2371,7 +2397,7 @@ function Wi(t, e, i, o, n) {
2371
2397
  }
2372
2398
  return r;
2373
2399
  }
2374
- function me(t, e, i) {
2400
+ function ve(t, e, i) {
2375
2401
  if (e < 0 || e >= t.length) return;
2376
2402
  const o = t[e], n = i - o.height;
2377
2403
  if (n !== 0) {
@@ -2385,7 +2411,7 @@ function Fi(t) {
2385
2411
  const e = t[t.length - 1];
2386
2412
  return e.offset + e.height;
2387
2413
  }
2388
- function Ve(t, e) {
2414
+ function Ge(t, e) {
2389
2415
  if (t.length === 0) return -1;
2390
2416
  if (e <= 0) return 0;
2391
2417
  let i = 0, o = t.length - 1;
@@ -2422,14 +2448,14 @@ function Bi(t, e) {
2422
2448
  if (u < r || u >= s || u >= n.length) return;
2423
2449
  const d = n[u], w = l?.(d, u);
2424
2450
  if (w !== void 0) {
2425
- const b = i[u];
2426
- (!b.measured || Math.abs(b.height - w) > 1) && (me(i, u, w), c = !0);
2451
+ const m = i[u];
2452
+ (!m.measured || Math.abs(m.height - w) > 1) && (ve(i, u, w), c = !0);
2427
2453
  return;
2428
2454
  }
2429
- const v = p.offsetHeight;
2430
- if (v > 0) {
2431
- const b = i[u];
2432
- (!b.measured || Math.abs(b.height - v) > 1) && (me(i, u, v), $i(o, d, v, a), c = !0);
2455
+ const C = p.offsetHeight;
2456
+ if (C > 0) {
2457
+ const m = i[u];
2458
+ (!m.measured || Math.abs(m.height - C) > 1) && (ve(i, u, C), $i(o, d, C, a), c = !0);
2433
2459
  }
2434
2460
  });
2435
2461
  const h = c ? Vi(i) : 0, f = c ? Ui(i, t.defaultHeight) : 0;
@@ -2504,7 +2530,7 @@ class ne {
2504
2530
  }
2505
2531
  warnDeprecatedHooks(e) {
2506
2532
  const i = e.constructor;
2507
- if (ne.deprecationWarned.has(i) || !ve()) return;
2533
+ if (ne.deprecationWarned.has(i) || !ye()) return;
2508
2534
  const o = typeof e.getExtraHeight == "function" || typeof e.getExtraHeightBefore == "function", n = typeof e.getRowHeight == "function";
2509
2535
  o && !n && (ne.deprecationWarned.add(i), console.warn(
2510
2536
  `[tbw-grid] Deprecation warning: "${e.name}" uses getExtraHeight() / getExtraHeightBefore() which are deprecated and will be removed in v3.0.
@@ -2775,9 +2801,9 @@ ${Ki}
2775
2801
  ${Xi}
2776
2802
  ${Qi}
2777
2803
  `;
2778
- class k extends HTMLElement {
2804
+ class I extends HTMLElement {
2779
2805
  static tagName = "tbw-grid";
2780
- static version = "1.19.0";
2806
+ static version = "1.19.2";
2781
2807
  static #l = 0;
2782
2808
  static adapters = [];
2783
2809
  static registerAdapter(e) {
@@ -2989,7 +3015,7 @@ class k extends HTMLElement {
2989
3015
  if (!this._virtualization.totalHeightEl) return;
2990
3016
  const i = this.#T(this._rows.length);
2991
3017
  this._virtualization.totalHeightEl.style.height = `${i}px`;
2992
- }), this.#o.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, Re(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, $(this)), this._virtualization.enabled && !this.#U && this.#ye(), this.#x && (this.#x = !1, requestAnimationFrame(() => {
3018
+ }), this.#o.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, Te(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, W(this)), this._virtualization.enabled && !this.#U && this.#ye(), this.#x && (this.#x = !1, requestAnimationFrame(() => {
2993
3019
  requestAnimationFrame(() => {
2994
3020
  this.#Ce();
2995
3021
  });
@@ -3108,7 +3134,7 @@ class k extends HTMLElement {
3108
3134
  this.#e.headerContents.has(o.id) || this.#e.headerContents.set(o.id, o);
3109
3135
  }
3110
3136
  #ne() {
3111
- const e = k.getAdapters();
3137
+ const e = I.getAdapters();
3112
3138
  if (e.length === 0 && !this.__frameworkAdapter) return;
3113
3139
  const i = this.__frameworkAdapter;
3114
3140
  return (o) => {
@@ -3124,7 +3150,7 @@ class k extends HTMLElement {
3124
3150
  };
3125
3151
  }
3126
3152
  connectedCallback() {
3127
- this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", k.version), this.id || (this.id = `tbw-grid-${++k.#l}`), this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#b && (this.#b.abort(), this.#N = !1), this.#b = new AbortController(), this.#R && (Oe(this.#R), this.#R = void 0), this.#k(), this.#i.parseLightDomColumns(this), this.#i.merge(), this.#te();
3153
+ this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", I.version), this.id || (this.id = `tbw-grid-${++I.#l}`), this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#b && (this.#b.abort(), this.#N = !1), this.#b = new AbortController(), this.#R && (ke(this.#R), this.#R = void 0), this.#k(), this.#i.parseLightDomColumns(this), this.#i.merge(), this.#te();
3128
3154
  const e = this.#o?.plugins;
3129
3155
  this.#_ = Array.isArray(e) ? e : [], this.#oe(), this.#u || (this.#J(), this.#F(), this.#u = !0), this.#re(), this.#R = Xt(
3130
3156
  () => {
@@ -3134,7 +3160,7 @@ class k extends HTMLElement {
3134
3160
  );
3135
3161
  }
3136
3162
  disconnectedCallback() {
3137
- this.#R && (Oe(this.#R), this.#R = void 0), this.#m && (clearTimeout(this.#m), this.#m = 0), this.#ve(), bi(this.#e), this.#c.setInitialized(!1), this.#q?.(), this.#q = void 0, this.#$?.(), this.#$ = void 0, lt(this.#I), this.#b && (this.#b.abort(), this.#b = void 0), this.#D?.abort(), this.#D = void 0, this.#N = !1, this._resizeController && this._resizeController.dispose(), this.#y && (this.#y.disconnect(), this.#y = void 0), this.#p && (this.#p.disconnect(), this.#p = void 0, this.#U = !1), Y(this), this.#A.clear(), this.#_ = void 0;
3163
+ this.#R && (ke(this.#R), this.#R = void 0), this.#m && (clearTimeout(this.#m), this.#m = 0), this.#ve(), bi(this.#e), this.#c.setInitialized(!1), this.#q?.(), this.#q = void 0, this.#$?.(), this.#$ = void 0, at(this.#I), this.#b && (this.#b.abort(), this.#b = void 0), this.#D?.abort(), this.#D = void 0, this.#N = !1, this._resizeController && this._resizeController.dispose(), this.#y && (this.#y.disconnect(), this.#y = void 0), this.#p && (this.#p.disconnect(), this.#p = void 0, this.#U = !1), Y(this), this.#A.clear(), this.#_ = void 0;
3138
3164
  for (const e of this._rowPool)
3139
3165
  e.remove();
3140
3166
  this._rowPool.length = 0, this.__rowsBodyEl = null, this.#f = !1;
@@ -3158,11 +3184,11 @@ class k extends HTMLElement {
3158
3184
  #re() {
3159
3185
  const i = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
3160
3186
  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) {
3161
- ge(this.#n, this.#e), de(this.#n, this.#o?.shell, this.#e);
3187
+ pe(this.#n, this.#e), de(this.#n, this.#o?.shell, this.#e);
3162
3188
  const n = this.#o?.shell?.toolPanel?.defaultOpen;
3163
3189
  n && this.#e.toolPanels.has(n) && (this.openToolPanel(), this.#e.expandedSections.add(n));
3164
3190
  }
3165
- if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Me(this), this.#P(), this.#Y(i), this.#N)
3191
+ if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Ie(this), this.#P(), this.#Y(i), this.#N)
3166
3192
  return;
3167
3193
  this.#N = !0;
3168
3194
  const o = this.disconnectSignal;
@@ -3216,7 +3242,7 @@ class k extends HTMLElement {
3216
3242
  const h = this._virtualization.positionCache;
3217
3243
  let f, p;
3218
3244
  if (this._virtualization.variableHeights && h && h.length > 0) {
3219
- f = Ve(h, a), f === -1 && (f = 0);
3245
+ f = Ge(h, a), f === -1 && (f = 0);
3220
3246
  const u = f - f % 2;
3221
3247
  p = h[u]?.offset ?? u * c;
3222
3248
  } else
@@ -3352,15 +3378,15 @@ class k extends HTMLElement {
3352
3378
  Y(this), this.#i.merge(), this.#P();
3353
3379
  }
3354
3380
  #Ae() {
3355
- this.#i.merge(), this.#o.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, Re(this)) : (this._columns.forEach((i) => {
3381
+ this.#i.merge(), this.#o.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, Te(this)) : (this._columns.forEach((i) => {
3356
3382
  !i.__userResized && i.__autoSized && delete i.width;
3357
3383
  }), V(this));
3358
3384
  }
3359
3385
  #Te() {
3360
- Ie(this, this.#e), Ne(this, this.#e);
3386
+ qe(this, this.#e), $e(this, this.#e);
3361
3387
  const e = !!this.#n.querySelector(".has-shell"), i = !!this.#n.querySelector(".tbw-tool-panel"), o = this.#n.querySelectorAll(".tbw-accordion-section").length;
3362
- this.#i.parseLightDomColumns(this), this.#i.merge(), this.#ie(), qe(this, this.#e, this.#ne()), this.#i.markSourcesChanged(), this.#i.merge();
3363
- const n = st(this.#o?.shell), r = (this.#o?.shell?.toolPanels?.length ?? 0) > 0, s = this.#o?.shell?.toolPanels?.length ?? 0;
3388
+ this.#i.parseLightDomColumns(this), this.#i.merge(), this.#ie(), We(this, this.#e, this.#ne()), this.#i.markSourcesChanged(), this.#i.merge();
3389
+ const n = lt(this.#o?.shell), r = (this.#o?.shell?.toolPanels?.length ?? 0) > 0, s = this.#o?.shell?.toolPanels?.length ?? 0;
3364
3390
  if (e !== n || !i && r || i && s !== o) {
3365
3391
  he(this.#e), this.#J(), this.#F(), this.#re(), this.#B();
3366
3392
  return;
@@ -3375,7 +3401,7 @@ class k extends HTMLElement {
3375
3401
  i ? (o || (o = document.createElement("h2"), o.className = "tbw-shell-title", o.setAttribute("part", "shell-title"), e.insertBefore(o, e.firstChild)), o.textContent = i) : o && o.remove();
3376
3402
  }
3377
3403
  #He() {
3378
- if (this.#t) {
3404
+ if (this.__rowRenderEpoch++, this.#t) {
3379
3405
  const e = this.#X.length > 0 ? this.#X : this._columns, i = e.filter((r) => !r.hidden), o = e.filter((r) => r.hidden), n = this.#t.processColumns([...i]);
3380
3406
  if (n !== i) {
3381
3407
  const r = new Set(n.map((l) => l.field));
@@ -3410,7 +3436,7 @@ class k extends HTMLElement {
3410
3436
  }
3411
3437
  #ze(e) {
3412
3438
  const i = {
3413
- ...ft,
3439
+ ...gt,
3414
3440
  ...e.animation
3415
3441
  }, o = i.mode ?? "reduced-motion";
3416
3442
  let n = 1;
@@ -3421,12 +3447,12 @@ class k extends HTMLElement {
3421
3447
  for (const n of this.#E)
3422
3448
  this.#K(n, !0);
3423
3449
  }
3424
- #de = ct();
3450
+ #de = dt();
3425
3451
  #he(e, i) {
3426
- dt(this.#de, this.__rowsBodyEl, this._bodyEl, e, i);
3452
+ ht(this.#de, this.__rowsBodyEl, this._bodyEl, e, i);
3427
3453
  }
3428
3454
  #De() {
3429
- ut(this.#de, this.__rowsBodyEl, this.#o, this.#e);
3455
+ ft(this.#de, this.__rowsBodyEl, this.#o, this.#e);
3430
3456
  }
3431
3457
  #ue() {
3432
3458
  const e = this.querySelector(".tbw-grid-root");
@@ -3636,7 +3662,7 @@ class k extends HTMLElement {
3636
3662
  o && this.#s.requestPhase(A.ROWS, "updateRows");
3637
3663
  }
3638
3664
  animateRow(e, i) {
3639
- _e(this, e, i);
3665
+ Se(this, e, i);
3640
3666
  }
3641
3667
  animateRows(e, i) {
3642
3668
  li(this, e, i);
@@ -3747,11 +3773,11 @@ class k extends HTMLElement {
3747
3773
  #ke() {
3748
3774
  const i = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
3749
3775
  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) {
3750
- ge(this.#n, this.#e), de(this.#n, this.#o?.shell, this.#e);
3776
+ pe(this.#n, this.#e), de(this.#n, this.#o?.shell, this.#e);
3751
3777
  const o = this.#o?.shell?.toolPanel?.defaultOpen;
3752
3778
  o && this.#e.toolPanels.has(o) && (this.openToolPanel(), this.#e.expandedSections.add(o));
3753
3779
  }
3754
- this._resizeController = Me(this), this.#Y(i), this.#s.requestPhase(A.COLUMNS, "shellRefresh");
3780
+ this._resizeController = Ie(this), this.#Y(i), this.#s.requestPhase(A.COLUMNS, "shellRefresh");
3755
3781
  }
3756
3782
  #A = /* @__PURE__ */ new Map();
3757
3783
  registerStyles(e, i) {
@@ -3771,7 +3797,7 @@ class k extends HTMLElement {
3771
3797
  document.adoptedStyleSheets = [...i, ...e];
3772
3798
  }
3773
3799
  #k() {
3774
- Ie(this, this.#e), Ne(this, this.#e), qe(this, this.#e, this.#ne());
3800
+ qe(this, this.#e), $e(this, this.#e), We(this, this.#e, this.#ne());
3775
3801
  }
3776
3802
  #pe() {
3777
3803
  const e = this.#n.querySelector(".tbw-shell-header");
@@ -3853,7 +3879,7 @@ class k extends HTMLElement {
3853
3879
  let r = i;
3854
3880
  r === void 0 && (r = this.#t?.getRowHeight?.(n, e)), r === void 0 && (r = this._virtualization.rowHeight);
3855
3881
  const s = o[e];
3856
- if (!(!s || Math.abs(s.height - r) < 1) && (me(o, e, r), this._virtualization.totalHeightEl)) {
3882
+ if (!(!s || Math.abs(s.height - r) < 1) && (ve(o, e, r), this._virtualization.totalHeightEl)) {
3857
3883
  const l = this.#T(this._rows.length);
3858
3884
  this._virtualization.totalHeightEl.style.height = `${l}px`;
3859
3885
  }
@@ -3884,20 +3910,20 @@ class k extends HTMLElement {
3884
3910
  if (!this._virtualization.enabled)
3885
3911
  return this.#j(0, o), i || this.#t?.afterRender(), !0;
3886
3912
  if (this._rows.length <= this._virtualization.bypassThreshold)
3887
- return this._virtualization.start = 0, this._virtualization.end = o, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#j(0, o, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), e && this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#T(o, !0)}px`), this.#he(o, this._visibleColumns.length), i || this.#t?.afterRender(), !0;
3913
+ return this._virtualization.start = 0, this._virtualization.end = o, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#j(0, o, this.__rowRenderEpoch), e && this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#T(o, !0)}px`), this.#he(o, this._visibleColumns.length), i || this.#t?.afterRender(), !0;
3888
3914
  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;
3889
3915
  let c;
3890
3916
  const h = this._virtualization.positionCache;
3891
3917
  if (this._virtualization.variableHeights && h && h.length > 0)
3892
- c = Ve(h, a), c === -1 && (c = 0);
3918
+ c = Ge(h, a), c === -1 && (c = 0);
3893
3919
  else {
3894
3920
  c = Math.floor(a / l);
3895
- let b = 0;
3921
+ let m = 0;
3896
3922
  const _ = 10;
3897
- for (; b < _; ) {
3923
+ for (; m < _; ) {
3898
3924
  const R = this.#t?.getExtraHeightBefore?.(c) ?? 0, E = Math.floor((a - R) / l);
3899
3925
  if (E >= c || E < 0) break;
3900
- c = E, b++;
3926
+ c = E, m++;
3901
3927
  }
3902
3928
  }
3903
3929
  c = c - c % 2, c < 0 && (c = 0);
@@ -3905,15 +3931,15 @@ class k extends HTMLElement {
3905
3931
  f !== void 0 && f < c && (c = f, c = c - c % 2, c < 0 && (c = 0));
3906
3932
  let p;
3907
3933
  if (this._virtualization.variableHeights && h && h.length > 0) {
3908
- const b = s + l * 3;
3934
+ const m = s + l * 3;
3909
3935
  let _ = 0;
3910
- for (p = c; p < o && _ < b; )
3936
+ for (p = c; p < o && _ < m; )
3911
3937
  _ += h[p].height, p++;
3912
3938
  const R = Math.ceil(s / l) + 3;
3913
3939
  p - c < R && (p = Math.min(c + R, o));
3914
3940
  } else {
3915
- const b = Math.ceil(s / l) + 3;
3916
- p = c + b;
3941
+ const m = Math.ceil(s / l) + 3;
3942
+ p = c + m;
3917
3943
  }
3918
3944
  p > o && (p = o);
3919
3945
  const g = this._virtualization.start, u = this._virtualization.end;
@@ -3922,27 +3948,27 @@ class k extends HTMLElement {
3922
3948
  this._virtualization.start = c, this._virtualization.end = p;
3923
3949
  const d = e ? this._virtualization.cachedFauxHeight = n.clientHeight : this._virtualization.cachedFauxHeight || (this._virtualization.cachedFauxHeight = n.clientHeight);
3924
3950
  if (e) {
3925
- const b = this._virtualization.scrollAreaEl;
3926
- b && (this._virtualization.cachedScrollAreaHeight = b.clientHeight);
3951
+ const m = this._virtualization.scrollAreaEl;
3952
+ m && (this._virtualization.cachedScrollAreaHeight = m.clientHeight);
3927
3953
  }
3928
3954
  if (d === 0 && s > 0)
3929
3955
  return this.#s.requestPhase(A.VIRTUALIZATION, "stale-refs-retry"), !1;
3930
3956
  if (e && this._virtualization.totalHeightEl) {
3931
- const b = this.#T(o);
3932
- this._virtualization.totalHeightEl.style.height = `${b}px`;
3957
+ const m = this.#T(o);
3958
+ this._virtualization.totalHeightEl.style.height = `${m}px`;
3933
3959
  }
3934
3960
  let w;
3935
3961
  if (this._virtualization.variableHeights && h && h[c])
3936
3962
  w = h[c].offset;
3937
3963
  else {
3938
- const b = this.#t?.getExtraHeightBefore?.(c) ?? 0;
3939
- w = c * l + b;
3964
+ const m = this.#t?.getExtraHeightBefore?.(c) ?? 0;
3965
+ w = c * l + m;
3940
3966
  }
3941
- const v = -(a - w);
3942
- return this._bodyEl.style.transform = `translateY(${v}px)`, this.#j(c, p, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), e && this._virtualization.variableHeights && this.#we(c, p), this.#he(o, this._visibleColumns.length), e && !i && (this.#t?.afterRender(), queueMicrotask(() => {
3967
+ const C = -(a - w);
3968
+ return this._bodyEl.style.transform = `translateY(${C}px)`, this.#j(c, p, this.__rowRenderEpoch), e && this._virtualization.variableHeights && this.#we(c, p), this.#he(o, this._visibleColumns.length), e && !i && (this.#t?.afterRender(), queueMicrotask(() => {
3943
3969
  if (!this._virtualization.totalHeightEl) return;
3944
- const b = this.#T(o);
3945
- this._virtualization.cachedFauxHeight === 0 && this._virtualization.cachedViewportHeight > 0 || (this._virtualization.totalHeightEl.style.height = `${b}px`);
3970
+ const m = this.#T(o);
3971
+ this._virtualization.cachedFauxHeight === 0 && this._virtualization.cachedViewportHeight > 0 || (this._virtualization.totalHeightEl.style.height = `${m}px`);
3946
3972
  })), !0;
3947
3973
  }
3948
3974
  #J() {
@@ -3969,8 +3995,8 @@ class k extends HTMLElement {
3969
3995
  );
3970
3996
  }
3971
3997
  }
3972
- customElements.get(k.tagName) || customElements.define(k.tagName, k);
3973
- globalThis.DataGridElement = k;
3998
+ customElements.get(I.tagName) || customElements.define(I.tagName, I);
3999
+ globalThis.DataGridElement = I;
3974
4000
  const lo = {
3975
4001
  CAN_MOVE_COLUMN: "canMoveColumn",
3976
4002
  GET_CONTEXT_MENU_ITEMS: "getContextMenuItems"
@@ -3978,7 +4004,7 @@ const lo = {
3978
4004
  class ao {
3979
4005
  static dependencies;
3980
4006
  static manifest;
3981
- version = "1.19.0";
4007
+ version = "1.19.2";
3982
4008
  styles;
3983
4009
  cellRenderers;
3984
4010
  headerRenderers;
@@ -4223,7 +4249,7 @@ const go = {
4223
4249
  list() {
4224
4250
  return [...Object.keys(fe), ...U.keys()];
4225
4251
  }
4226
- }, Be = {
4252
+ }, Xe = {
4227
4253
  sum: (t) => t.reduce((e, i) => e + i, 0),
4228
4254
  avg: (t) => t.length ? t.reduce((e, i) => e + i, 0) / t.length : 0,
4229
4255
  count: (t) => t.length,
@@ -4233,7 +4259,7 @@ const go = {
4233
4259
  last: (t) => t[t.length - 1] ?? 0
4234
4260
  };
4235
4261
  function oo(t) {
4236
- return Be[t] ?? Be.sum;
4262
+ return Xe[t] ?? Xe.sum;
4237
4263
  }
4238
4264
  function wo(t, e) {
4239
4265
  return oo(t)(e);
@@ -4241,31 +4267,31 @@ function wo(t, e) {
4241
4267
  const bo = O.register.bind(O), mo = O.unregister.bind(O), vo = O.get.bind(O), Co = O.run.bind(O), yo = O.list.bind(O);
4242
4268
  export {
4243
4269
  ao as BaseGridPlugin,
4244
- ft as DEFAULT_ANIMATION_CONFIG,
4270
+ gt as DEFAULT_ANIMATION_CONFIG,
4245
4271
  M as DEFAULT_GRID_ICONS,
4246
4272
  go as DGEvents,
4247
- k as DataGridElement,
4248
- Je as F,
4273
+ I as DataGridElement,
4274
+ et as F,
4249
4275
  G as FitModeEnum,
4250
4276
  ho as GridCSSVars,
4251
4277
  H as GridClasses,
4252
4278
  ee as GridDataAttrs,
4253
- k as GridElement,
4279
+ I as GridElement,
4254
4280
  co as GridSelectors,
4255
4281
  lo as PLUGIN_QUERIES,
4256
4282
  po as PluginEvents,
4257
4283
  ne as PluginManager,
4258
4284
  A as RenderPhase,
4259
- Xe as a,
4285
+ Ce as a,
4260
4286
  O as aggregatorRegistry,
4261
- W as b,
4287
+ k as b,
4262
4288
  Vt as builtInSort,
4263
4289
  ro as c,
4264
4290
  uo as createGrid,
4265
- Ke as d,
4291
+ Qe as d,
4266
4292
  Ut as defaultComparator,
4267
- $ as e,
4268
- Ce as f,
4293
+ W as e,
4294
+ _e as f,
4269
4295
  zt as g,
4270
4296
  vo as getAggregator,
4271
4297
  oo as getValueAggregator,