@toolbox-web/grid 1.10.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -24,33 +24,33 @@ function et(t) {
24
24
  if (!n) return null;
25
25
  const i = o.getAttribute("type") || void 0, s = i && (/* @__PURE__ */ new Set(["number", "string", "date", "boolean", "select"])).has(i) ? i : void 0, l = o.getAttribute("header") || void 0, a = o.hasAttribute("sortable"), c = o.hasAttribute("editable"), d = { field: n, type: s, header: l, sortable: a, editable: c }, u = o.getAttribute("width");
26
26
  if (u) {
27
- const m = parseFloat(u);
28
- !isNaN(m) && /^\d+(\.\d+)?$/.test(u.trim()) ? d.width = m : d.width = u;
27
+ const b = parseFloat(u);
28
+ !isNaN(b) && /^\d+(\.\d+)?$/.test(u.trim()) ? d.width = b : d.width = u;
29
29
  }
30
30
  const p = o.getAttribute("minWidth") || o.getAttribute("min-width");
31
31
  if (p) {
32
- const m = parseFloat(p);
33
- isNaN(m) || (d.minWidth = m);
32
+ const b = parseFloat(p);
33
+ isNaN(b) || (d.minWidth = b);
34
34
  }
35
35
  o.hasAttribute("resizable") && (d.resizable = !0), o.hasAttribute("sizable") && (d.resizable = !0);
36
36
  const f = o.getAttribute("editor"), g = o.getAttribute("renderer");
37
37
  f && (d.__editorName = f), g && (d.__rendererName = g);
38
38
  const h = o.getAttribute("options");
39
- h && (d.options = h.split(",").map((m) => {
40
- const [z, R] = m.includes(":") ? m.split(":") : [m.trim(), m.trim()];
39
+ h && (d.options = h.split(",").map((b) => {
40
+ const [z, R] = b.includes(":") ? b.split(":") : [b.trim(), b.trim()];
41
41
  return { value: z.trim(), label: R?.trim() || z.trim() };
42
42
  }));
43
- const w = o.querySelector("tbw-grid-column-view"), b = o.querySelector("tbw-grid-column-editor"), S = o.querySelector("tbw-grid-column-header");
44
- w && (d.__viewTemplate = w), b && (d.__editorTemplate = b), S && (d.__headerTemplate = S);
45
- const _ = globalThis.DataGridElement?.getAdapters?.() ?? [], A = w ?? o, v = _.find((m) => m.canHandle(A));
46
- if (v) {
47
- const m = v.createRenderer(A);
48
- m && (d.viewRenderer = m);
49
- }
50
- const E = b ?? o, y = _.find((m) => m.canHandle(E));
43
+ const w = o.querySelector("tbw-grid-column-view"), v = o.querySelector("tbw-grid-column-editor"), S = o.querySelector("tbw-grid-column-header");
44
+ w && (d.__viewTemplate = w), v && (d.__editorTemplate = v), S && (d.__headerTemplate = S);
45
+ const _ = globalThis.DataGridElement?.getAdapters?.() ?? [], A = w ?? o, m = _.find((b) => b.canHandle(A));
46
+ if (m) {
47
+ const b = m.createRenderer(A);
48
+ b && (d.viewRenderer = b);
49
+ }
50
+ const E = v ?? o, y = _.find((b) => b.canHandle(E));
51
51
  if (y) {
52
- const m = y.createEditor(E);
53
- m && (d.editor = m);
52
+ const b = y.createEditor(E);
53
+ b && (d.editor = b);
54
54
  }
55
55
  return d;
56
56
  }).filter((o) => !!o);
@@ -126,7 +126,7 @@ function ot(t, e) {
126
126
  i[r.field] = r.type || "string";
127
127
  }), { columns: n, typeMap: i };
128
128
  }
129
- const nt = /{{\s*([^}]+)\s*}}/g, D = "__DG_EMPTY__", it = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, rt = /__(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/;
129
+ const nt = /{{\s*([^}]+)\s*}}/g, O = "__DG_EMPTY__", it = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, rt = /__(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/;
130
130
  function st(t) {
131
131
  return !t || typeof t != "string" ? "" : t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
132
132
  }
@@ -201,28 +201,28 @@ function Ne(t, e) {
201
201
  const o = [], n = t.replace(nt, (l, a) => {
202
202
  const c = ht(a, e);
203
203
  return o.push({ expr: a.trim(), result: c }), c;
204
- }), i = ut(n), r = o.length && o.every((l) => l.result === "" || l.result === D);
204
+ }), i = ut(n), r = o.length && o.every((l) => l.result === "" || l.result === O);
205
205
  return /Reflect\.|\bProxy\b|ownKeys\(/.test(t) || r ? "" : i;
206
206
  }
207
207
  function ht(t, e) {
208
- if (t = (t || "").trim(), !t || /\b(Reflect|Proxy|ownKeys)\b/.test(t)) return D;
209
- if (t === "value") return e.value == null ? D : String(e.value);
208
+ if (t = (t || "").trim(), !t || /\b(Reflect|Proxy|ownKeys)\b/.test(t)) return O;
209
+ if (t === "value") return e.value == null ? O : String(e.value);
210
210
  if (t.startsWith("row.") && !/[()?]/.test(t) && !t.includes(":")) {
211
211
  const n = t.slice(4), i = e.row ? e.row[n] : void 0;
212
- return i == null ? D : String(i);
212
+ return i == null ? O : String(i);
213
213
  }
214
- if (t.length > 80 || !it.test(t) || rt.test(t)) return D;
214
+ if (t.length > 80 || !it.test(t) || rt.test(t)) return O;
215
215
  const o = t.match(/\./g);
216
- if (o && o.length > 1) return D;
216
+ if (o && o.length > 1) return O;
217
217
  try {
218
218
  const i = new Function("value", "row", `return (${t});`)(e.value, e.row), r = i == null ? "" : String(i);
219
- return /Reflect|Proxy|ownKeys/.test(r) ? D : r || D;
219
+ return /Reflect|Proxy|ownKeys/.test(r) ? O : r || O;
220
220
  } catch {
221
- return D;
221
+ return O;
222
222
  }
223
223
  }
224
224
  function ut(t) {
225
- return t && t.replace(new RegExp(D, "g"), "").replace(/Reflect\.[^<>{}\s]+/g, "").replace(/\bProxy\b/g, "").replace(/ownKeys\([^)]*\)/g, "");
225
+ return t && t.replace(new RegExp(O, "g"), "").replace(/Reflect\.[^<>{}\s]+/g, "").replace(/\bProxy\b/g, "").replace(/ownKeys\([^)]*\)/g, "");
226
226
  }
227
227
  function ft(t) {
228
228
  if (/Reflect|Proxy|ownKeys/.test(t.textContent || "")) {
@@ -250,12 +250,12 @@ class gt {
250
250
  #a = {};
251
251
  #n = {};
252
252
  #f = !0;
253
- #g = [];
254
- #m;
253
+ #p = [];
254
+ #b;
255
255
  #s;
256
- #v;
256
+ #m;
257
257
  #r;
258
- #w;
258
+ #g;
259
259
  constructor(e) {
260
260
  this.#r = e;
261
261
  }
@@ -284,16 +284,16 @@ class gt {
284
284
  this.#h = e;
285
285
  }
286
286
  get lightDomTitle() {
287
- return this.#w;
287
+ return this.#g;
288
288
  }
289
289
  set lightDomTitle(e) {
290
- this.#w = e;
290
+ this.#g = e;
291
291
  }
292
292
  get initialColumnState() {
293
- return this.#v;
293
+ return this.#m;
294
294
  }
295
295
  set initialColumnState(e) {
296
- this.#v = e;
296
+ this.#m = e;
297
297
  }
298
298
  get sourcesChanged() {
299
299
  return this.#f;
@@ -323,10 +323,10 @@ class gt {
323
323
  const e = (this.#n.columns?.length ?? 0) > 0;
324
324
  if (!this.#f && e)
325
325
  return;
326
- const o = this.#b();
327
- this.#f = !1, this.#a = o, Object.freeze(this.#a), this.#a.columns && Object.freeze(this.#a.columns), this.#n = this.#R(this.#a), this.#H();
326
+ const o = this.#C();
327
+ this.#f = !1, this.#a = o, Object.freeze(this.#a), this.#a.columns && Object.freeze(this.#a.columns), this.#n = this.#x(this.#a), this.#O();
328
328
  }
329
- #R(e) {
329
+ #x(e) {
330
330
  const o = { ...e };
331
331
  return e.columns && (o.columns = e.columns.map((n) => ({ ...n }))), e.shell && (o.shell = {
332
332
  ...e.shell,
@@ -336,13 +336,23 @@ class gt {
336
336
  headerContents: e.shell.headerContents?.map((n) => ({ ...n }))
337
337
  }), o;
338
338
  }
339
- #H() {
339
+ #O() {
340
340
  const e = this.#n;
341
- e.rowHeight && e.rowHeight > 0 && this.#r.setRowHeight(e.rowHeight), e.fitMode === "fixed" && this.columns.forEach((n) => {
341
+ this.#w(), e.rowHeight && e.rowHeight > 0 && this.#r.setRowHeight(e.rowHeight), e.fitMode === "fixed" && this.columns.forEach((n) => {
342
342
  n.width == null && (n.width = 80);
343
343
  }), this.#r.applyAnimationConfig(e);
344
344
  }
345
- #b() {
345
+ #w() {
346
+ const e = this.#n.typeDefaults;
347
+ if (!e) return;
348
+ const o = this.columns;
349
+ for (const n of o) {
350
+ if (!n.type) continue;
351
+ const i = e[n.type];
352
+ i && (!n.renderer && !n.viewRenderer && i.renderer && (n.renderer = i.renderer), !n.format && i.format && (n.format = i.format), !n.editor && i.editor && (n.editor = i.editor), !n.editorParams && i.editorParams && (n.editorParams = i.editorParams));
353
+ }
354
+ }
355
+ #C() {
346
356
  const e = this.#l ? { ...this.#l } : {}, o = Array.isArray(e.columns) ? [...e.columns] : [], n = (this.#d ?? []).map((s) => ({
347
357
  ...s
348
358
  }));
@@ -359,12 +369,12 @@ class gt {
359
369
  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);
360
370
  }), i.forEach((s) => {
361
371
  s.__viewTemplate && !s.__compiledView && (s.__compiledView = ye(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = ye(s.__editorTemplate.innerHTML));
362
- }), e.columns = i), this.#u && (e.fitMode = this.#u), e.fitMode || (e.fitMode = "stretch"), this.#C(e), e.columnState && !this.#v && (this.#v = e.columnState), e;
372
+ }), e.columns = i), this.#u && (e.fitMode = this.#u), e.fitMode || (e.fitMode = "stretch"), this.#y(e), e.columnState && !this.#m && (this.#m = e.columnState), e;
363
373
  }
364
- #C(e) {
374
+ #y(e) {
365
375
  e.shell = e.shell ? { ...e.shell } : {}, e.shell.header = e.shell.header ? { ...e.shell.header } : {};
366
376
  const o = this.#r.getShellLightDomTitle();
367
- o && (this.#w = o), this.#w && !e.shell.header.title && (e.shell.header.title = this.#w);
377
+ o && (this.#g = o), this.#g && !e.shell.header.title && (e.shell.header.title = this.#g);
368
378
  const n = this.#r.getShellLightDomHeaderContent();
369
379
  n?.length > 0 && (e.shell.header.lightDomContent = n), this.#r.getShellHasToolButtonsContainer() && (e.shell.header.hasToolButtonsContainer = !0);
370
380
  const i = this.#r.getShellToolPanels();
@@ -383,7 +393,7 @@ class gt {
383
393
  d.sort((u, p) => (u.order ?? 0) - (p.order ?? 0)), e.shell.header.toolbarContents = d;
384
394
  }
385
395
  collectState(e) {
386
- const o = this.columns, n = this.#y();
396
+ const o = this.columns, n = this.#v();
387
397
  return {
388
398
  columns: o.map((i, r) => {
389
399
  const s = {
@@ -430,7 +440,7 @@ class gt {
430
440
  l.applyColumnState(a.field, a);
431
441
  }
432
442
  resetState(e) {
433
- this.#v = void 0, this.#r.setSortState(null), this.#n = this.#R(this.#a), this.#H();
443
+ this.#m = void 0, this.#r.setSortState(null), this.#n = this.#x(this.#a), this.#O();
434
444
  for (const o of e)
435
445
  if (o.applyColumnState)
436
446
  for (const n of this.columns)
@@ -441,7 +451,7 @@ class gt {
441
451
  });
442
452
  this.requestStateChange(e);
443
453
  }
444
- #y() {
454
+ #v() {
445
455
  const e = /* @__PURE__ */ new Map(), o = this.#r.getSortState();
446
456
  return o && e.set(o.field, {
447
457
  direction: o.direction === 1 ? "asc" : "desc",
@@ -506,37 +516,37 @@ class gt {
506
516
  clearLightDomCache() {
507
517
  this.#d = void 0;
508
518
  }
509
- #p = /* @__PURE__ */ new Map();
519
+ #_ = /* @__PURE__ */ new Map();
510
520
  registerLightDomHandler(e, o) {
511
- this.#p.set(e.toLowerCase(), o);
521
+ this.#_.set(e.toLowerCase(), o);
512
522
  }
513
523
  unregisterLightDomHandler(e) {
514
- this.#p.delete(e.toLowerCase());
524
+ this.#_.delete(e.toLowerCase());
515
525
  }
516
526
  observeLightDOM(e) {
517
- this.#m && this.#m.disconnect();
527
+ this.#b && this.#b.disconnect();
518
528
  const o = /* @__PURE__ */ new Set();
519
529
  let n = null;
520
530
  const i = () => {
521
531
  n = null;
522
532
  for (const r of o)
523
- this.#p.get(r)?.();
533
+ this.#_.get(r)?.();
524
534
  o.clear();
525
535
  };
526
- this.#m = new MutationObserver((r) => {
536
+ this.#b = new MutationObserver((r) => {
527
537
  for (const s of r) {
528
538
  for (const l of s.addedNodes) {
529
539
  if (l.nodeType !== Node.ELEMENT_NODE) continue;
530
540
  const c = l.tagName.toLowerCase();
531
- this.#p.has(c) && o.add(c);
541
+ this.#_.has(c) && o.add(c);
532
542
  }
533
543
  if (s.type === "attributes" && s.target.nodeType === Node.ELEMENT_NODE) {
534
544
  const a = s.target.tagName.toLowerCase();
535
- this.#p.has(a) && o.add(a);
545
+ this.#_.has(a) && o.add(a);
536
546
  }
537
547
  }
538
548
  o.size > 0 && !n && (n = setTimeout(i, 0));
539
- }), this.#m.observe(e, {
549
+ }), this.#b.observe(e, {
540
550
  childList: !0,
541
551
  subtree: !0,
542
552
  attributes: !0,
@@ -544,14 +554,14 @@ class gt {
544
554
  });
545
555
  }
546
556
  onChange(e) {
547
- this.#g.push(e);
557
+ this.#p.push(e);
548
558
  }
549
559
  notifyChange() {
550
- for (const e of this.#g)
560
+ for (const e of this.#p)
551
561
  e();
552
562
  }
553
563
  dispose() {
554
- this.#m?.disconnect(), this.#g = [], this.#s && clearTimeout(this.#s);
564
+ this.#b?.disconnect(), this.#p = [], this.#s && clearTimeout(this.#s);
555
565
  }
556
566
  }
557
567
  function Ie(t) {
@@ -609,27 +619,21 @@ function $e(t, e) {
609
619
  const o = e.renderer || e.viewRenderer;
610
620
  if (o) return o;
611
621
  if (!e.type) return;
612
- const n = t.effectiveConfig?.typeDefaults;
613
- if (n?.[e.type]?.renderer)
614
- return n[e.type].renderer;
615
- const i = t.__frameworkAdapter;
616
- if (i?.getTypeDefault) {
617
- const r = i.getTypeDefault(e.type);
618
- if (r?.renderer)
619
- return r.renderer;
622
+ const n = t.__frameworkAdapter;
623
+ if (n?.getTypeDefault) {
624
+ const i = n.getTypeDefault(e.type);
625
+ if (i?.renderer)
626
+ return i.renderer;
620
627
  }
621
628
  }
622
629
  function Fe(t, e) {
623
630
  if (e.format) return e.format;
624
631
  if (!e.type) return;
625
- const o = t.effectiveConfig?.typeDefaults;
626
- if (o?.[e.type]?.format)
627
- return o[e.type].format;
628
- const n = t.__frameworkAdapter;
629
- if (n?.getTypeDefault) {
630
- const i = n.getTypeDefault(e.type);
631
- if (i?.format)
632
- return i.format;
632
+ const o = t.__frameworkAdapter;
633
+ if (o?.getTypeDefault) {
634
+ const n = o.getTypeDefault(e.type);
635
+ if (n?.format)
636
+ return n.format;
633
637
  }
634
638
  }
635
639
  const Ue = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
@@ -673,16 +677,16 @@ function Ct(t, e, o, n, i) {
673
677
  h.__epoch = n, h.__rowDataRef = g, h.parentNode !== s && s.appendChild(h);
674
678
  continue;
675
679
  }
676
- const w = h.__epoch, b = h.__rowDataRef, S = h.children.length, _ = w === n && S === a, A = b !== g;
677
- let v = !1;
680
+ const w = h.__epoch, v = h.__rowDataRef, S = h.children.length, _ = w === n && S === a, A = v !== g;
681
+ let m = !1;
678
682
  if (_ && A) {
679
683
  for (let R = 0; R < a; R++)
680
684
  if (l[R].externalView && !h.querySelector(`.cell[data-col="${R}"] [data-external-view]`)) {
681
- v = !0;
685
+ m = !0;
682
686
  break;
683
687
  }
684
688
  }
685
- if (!_ || v) {
689
+ if (!_ || m) {
686
690
  const R = re(h), x = t._activeEditRows === f;
687
691
  R && !x ? (h.__isCustomRow && (h.className = "data-grid-row", h.setAttribute("role", "row"), h.__isCustomRow = !1), se(h), G(t, h, g, f), h.__epoch = n, h.__rowDataRef = g) : R && x ? (le(t, h, g, f), h.__rowDataRef = g) : (h.__isCustomRow && (h.className = "data-grid-row", h.setAttribute("role", "row"), h.__isCustomRow = !1), G(t, h, g, f), h.__epoch = n, h.__rowDataRef = g);
688
692
  } else if (A) {
@@ -700,8 +704,8 @@ function Ct(t, e, o, n, i) {
700
704
  R && (E = y.includes(R));
701
705
  } catch {
702
706
  }
703
- const m = h.classList.contains("changed");
704
- E !== m && h.classList.toggle("changed", E);
707
+ const b = h.classList.contains("changed");
708
+ E !== b && h.classList.toggle("changed", E);
705
709
  const z = t.effectiveConfig?.rowClass;
706
710
  if (z) {
707
711
  const R = h.getAttribute("data-dynamic-classes");
@@ -729,10 +733,10 @@ function le(t, e, o, n) {
729
733
  let p = t.__hasSpecialColumns;
730
734
  if (p === void 0) {
731
735
  p = !1;
732
- const g = t.effectiveConfig?.typeDefaults, h = t.__frameworkAdapter;
733
- for (let w = 0; w < s; w++) {
734
- const b = r[w];
735
- if (b.__viewTemplate || b.__compiledView || b.renderer || b.viewRenderer || b.externalView || b.format || b.type === "date" || b.type === "boolean" || b.type && g?.[b.type]?.renderer || b.type && g?.[b.type]?.format || b.type && h?.getTypeDefault?.(b.type)?.renderer || b.type && h?.getTypeDefault?.(b.type)?.format) {
736
+ const g = t.__frameworkAdapter;
737
+ for (let h = 0; h < s; h++) {
738
+ const w = r[h];
739
+ if (w.__viewTemplate || w.__compiledView || w.renderer || w.viewRenderer || w.externalView || w.format || w.type === "date" || w.type === "boolean" || w.type && g?.getTypeDefault?.(w.type)?.renderer || w.type && g?.getTypeDefault?.(w.type)?.format) {
736
740
  p = !0;
737
741
  break;
738
742
  }
@@ -744,15 +748,15 @@ function le(t, e, o, n) {
744
748
  for (let g = 0; g < a; g++) {
745
749
  const h = i[g];
746
750
  if (h.classList.contains("editing")) continue;
747
- const w = r[g], b = o[w.field];
748
- h.textContent = b == null ? "" : String(b), h.getAttribute("data-row") !== f && h.setAttribute("data-row", f);
751
+ const w = r[g], v = o[w.field];
752
+ h.textContent = v == null ? "" : String(v), h.getAttribute("data-row") !== f && h.setAttribute("data-row", f);
749
753
  const S = c === n && d === g, C = h.classList.contains("cell-focus");
750
754
  S !== C && (h.classList.toggle("cell-focus", S), h.setAttribute("aria-selected", String(S))), u && t._afterCellRender?.({
751
755
  row: o,
752
756
  rowIndex: n,
753
757
  column: w,
754
758
  colIndex: g,
755
- value: b,
759
+ value: v,
756
760
  cellElement: h,
757
761
  rowElement: e
758
762
  });
@@ -767,34 +771,34 @@ function le(t, e, o, n) {
767
771
  for (let g = 0; g < a; g++) {
768
772
  const h = r[g], w = i[g];
769
773
  w.getAttribute("data-row") !== f && w.setAttribute("data-row", f);
770
- const b = c === n && d === g, S = w.classList.contains("cell-focus");
771
- b !== S && (w.classList.toggle("cell-focus", b), w.setAttribute("aria-selected", String(b)));
774
+ const v = c === n && d === g, S = w.classList.contains("cell-focus");
775
+ v !== S && (w.classList.toggle("cell-focus", v), w.setAttribute("aria-selected", String(v)));
772
776
  const C = h.cellClass;
773
777
  if (C) {
774
778
  const y = w.getAttribute("data-dynamic-classes");
775
- y && y.split(" ").forEach((m) => m && w.classList.remove(m));
779
+ y && y.split(" ").forEach((b) => b && w.classList.remove(b));
776
780
  try {
777
- const m = o[h.field], z = C(m, o, h);
781
+ const b = o[h.field], z = C(b, o, h);
778
782
  if (z && z.length > 0) {
779
783
  const R = z.filter((x) => x && typeof x == "string");
780
784
  R.forEach((x) => w.classList.add(x)), w.setAttribute("data-dynamic-classes", R.join(" "));
781
785
  } else
782
786
  w.removeAttribute("data-dynamic-classes");
783
- } catch (m) {
784
- console.warn(`[tbw-grid] cellClass callback error for column '${h.field}':`, m), w.removeAttribute("data-dynamic-classes");
787
+ } catch (b) {
788
+ console.warn(`[tbw-grid] cellClass callback error for column '${h.field}':`, b), w.removeAttribute("data-dynamic-classes");
785
789
  }
786
790
  }
787
791
  if (w.classList.contains("editing")) continue;
788
792
  const _ = $e(t, h);
789
793
  if (_) {
790
- const y = o[h.field], m = _({
794
+ const y = o[h.field], b = _({
791
795
  row: o,
792
796
  value: y,
793
797
  field: h.field,
794
798
  column: h,
795
799
  cellEl: w
796
800
  });
797
- typeof m == "string" ? w.innerHTML = F(m) : m instanceof Node ? m.parentElement !== w && (w.innerHTML = "", w.appendChild(m)) : m == null && (w.textContent = y == null ? "" : String(y)), u && t._afterCellRender?.({
801
+ typeof b == "string" ? w.innerHTML = F(b) : b instanceof Node ? b.parentElement !== w && (w.innerHTML = "", w.appendChild(b)) : b == null && (w.textContent = y == null ? "" : String(y)), u && t._afterCellRender?.({
798
802
  row: o,
799
803
  rowIndex: n,
800
804
  column: h,
@@ -808,17 +812,17 @@ function le(t, e, o, n) {
808
812
  if (h.__viewTemplate || h.__compiledView || h.externalView)
809
813
  continue;
810
814
  const A = o[h.field];
811
- let v;
815
+ let m;
812
816
  const E = Fe(t, h);
813
817
  if (E) {
814
818
  try {
815
819
  const y = E(A, o);
816
- v = y == null ? "" : String(y);
820
+ m = y == null ? "" : String(y);
817
821
  } catch (y) {
818
- console.warn(`[tbw-grid] Format error in column '${h.field}':`, y), v = A == null ? "" : String(A);
822
+ console.warn(`[tbw-grid] Format error in column '${h.field}':`, y), m = A == null ? "" : String(A);
819
823
  }
820
- w.textContent = v;
821
- } else h.type === "date" ? (v = qe(A), w.textContent = v) : h.type === "boolean" ? w.innerHTML = Ie(!!A) : (v = A == null ? "" : String(A), w.textContent = v);
824
+ w.textContent = m;
825
+ } else h.type === "date" ? (m = qe(A), w.textContent = m) : h.type === "boolean" ? w.innerHTML = Ie(!!A) : (m = A == null ? "" : String(A), w.textContent = m);
822
826
  u && t._afterCellRender?.({
823
827
  row: o,
824
828
  rowIndex: n,
@@ -841,23 +845,23 @@ function G(t, e, o, n) {
841
845
  if (h)
842
846
  try {
843
847
  g = h(g, o);
844
- } catch (v) {
845
- console.warn(`[tbw-grid] Format error in column '${p.field}':`, v);
848
+ } catch (m) {
849
+ console.warn(`[tbw-grid] Format error in column '${p.field}':`, m);
846
850
  }
847
- const w = p.__compiledView, b = p.__viewTemplate, S = $e(t, p), C = p.externalView;
851
+ const w = p.__compiledView, v = p.__viewTemplate, S = $e(t, p), C = p.externalView;
848
852
  let _ = !1;
849
853
  if (S) {
850
- const v = S({ row: o, value: g, field: p.field, column: p, cellEl: f });
851
- typeof v == "string" ? (f.innerHTML = F(v), _ = !0) : v instanceof Node ? v.parentElement !== f && (f.textContent = "", f.appendChild(v)) : v == null && (f.textContent = g == null ? "" : String(g));
854
+ const m = S({ row: o, value: g, field: p.field, column: p, cellEl: f });
855
+ typeof m == "string" ? (f.innerHTML = F(m), _ = !0) : m instanceof Node ? m.parentElement !== f && (f.textContent = "", f.appendChild(m)) : m == null && (f.textContent = g == null ? "" : String(g));
852
856
  } else if (C) {
853
- const v = C, E = document.createElement("div");
857
+ const m = C, E = document.createElement("div");
854
858
  E.setAttribute("data-external-view", ""), E.setAttribute("data-field", p.field), f.appendChild(E);
855
859
  const y = { row: o, value: g, field: p.field, column: p };
856
- if (v.mount)
860
+ if (m.mount)
857
861
  try {
858
- v.mount({ placeholder: E, context: y, spec: v });
859
- } catch (m) {
860
- console.warn(`[tbw-grid] External view mount error for column '${p.field}':`, m);
862
+ m.mount({ placeholder: E, context: y, spec: m });
863
+ } catch (b) {
864
+ console.warn(`[tbw-grid] External view mount error for column '${p.field}':`, b);
861
865
  }
862
866
  else
863
867
  queueMicrotask(() => {
@@ -866,38 +870,38 @@ function G(t, e, o, n) {
866
870
  new CustomEvent("mount-external-view", {
867
871
  bubbles: !0,
868
872
  composed: !0,
869
- detail: { placeholder: E, spec: v, context: y }
873
+ detail: { placeholder: E, spec: m, context: y }
870
874
  })
871
875
  );
872
- } catch (m) {
873
- console.warn(`[tbw-grid] External view event dispatch error for column '${p.field}':`, m);
876
+ } catch (b) {
877
+ console.warn(`[tbw-grid] External view event dispatch error for column '${p.field}':`, b);
874
878
  }
875
879
  });
876
880
  E.setAttribute("data-mounted", "");
877
881
  } else if (w) {
878
- const v = w({ row: o, value: g, field: p.field, column: p }), E = w.__blocked;
879
- f.innerHTML = E ? "" : F(v), _ = !0, E && (f.textContent = "", f.setAttribute("data-blocked-template", ""));
880
- } else if (b) {
881
- const v = b.innerHTML;
882
- /Reflect\.|\bProxy\b|ownKeys\(/.test(v) ? (f.textContent = "", f.setAttribute("data-blocked-template", "")) : (f.innerHTML = F(Ne(v, { row: o, value: g })), _ = !0);
882
+ const m = w({ row: o, value: g, field: p.field, column: p }), E = w.__blocked;
883
+ f.innerHTML = E ? "" : F(m), _ = !0, E && (f.textContent = "", f.setAttribute("data-blocked-template", ""));
884
+ } else if (v) {
885
+ const m = v.innerHTML;
886
+ /Reflect\.|\bProxy\b|ownKeys\(/.test(m) ? (f.textContent = "", f.setAttribute("data-blocked-template", "")) : (f.innerHTML = F(Ne(m, { row: o, value: g })), _ = !0);
883
887
  } else
884
888
  h ? f.textContent = g == null ? "" : String(g) : p.type === "date" ? f.textContent = qe(g) : p.type === "boolean" ? f.innerHTML = Ie(!!g) : f.textContent = g == null ? "" : String(g);
885
889
  if (_) {
886
890
  ft(f);
887
- const v = f.textContent || "";
888
- /Proxy|Reflect\.ownKeys/.test(v) && (f.textContent = v.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(f.textContent || "") && (f.textContent = ""));
891
+ const m = f.textContent || "";
892
+ /Proxy|Reflect\.ownKeys/.test(m) && (f.textContent = m.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(f.textContent || "") && (f.textContent = ""));
889
893
  }
890
894
  f.hasAttribute("data-blocked-template") && (f.textContent || "").trim().length && (f.textContent = ""), p.editable ? f.tabIndex = 0 : p.type === "boolean" && (f.hasAttribute("tabindex") || (f.tabIndex = 0)), s === n && l === u ? (f.classList.add("cell-focus"), f.setAttribute("aria-selected", "true")) : f.setAttribute("aria-selected", "false");
891
895
  const A = p.cellClass;
892
896
  if (A)
893
897
  try {
894
- const v = o[p.field], E = A(v, o, p);
898
+ const m = o[p.field], E = A(m, o, p);
895
899
  if (E && E.length > 0) {
896
- const y = E.filter((m) => m && typeof m == "string");
897
- y.forEach((m) => f.classList.add(m)), f.setAttribute("data-dynamic-classes", y.join(" "));
900
+ const y = E.filter((b) => b && typeof b == "string");
901
+ y.forEach((b) => f.classList.add(b)), f.setAttribute("data-dynamic-classes", y.join(" "));
898
902
  }
899
- } catch (v) {
900
- console.warn(`[tbw-grid] cellClass callback error for column '${p.field}':`, v);
903
+ } catch (m) {
904
+ console.warn(`[tbw-grid] cellClass callback error for column '${p.field}':`, m);
901
905
  }
902
906
  c && t._afterCellRender?.({
903
907
  row: o,
@@ -981,7 +985,7 @@ function yt(t, e) {
981
985
  case "Enter": {
982
986
  const d = t._focusRow, u = t._focusCol, p = t._visibleColumns[u], f = t._rows[d], g = p?.field ?? "", h = g && f ? f[g] : void 0, w = t.querySelector(
983
987
  `[data-row="${d}"][data-col="${u}"]`
984
- ), b = {
988
+ ), v = {
985
989
  rowIndex: d,
986
990
  colIndex: u,
987
991
  field: g,
@@ -992,7 +996,7 @@ function yt(t, e) {
992
996
  originalEvent: e
993
997
  }, S = new CustomEvent("cell-activate", {
994
998
  cancelable: !0,
995
- detail: b
999
+ detail: v
996
1000
  });
997
1001
  t.dispatchEvent(S);
998
1002
  const C = new CustomEvent("activate-cell", {
@@ -1234,7 +1238,7 @@ function ne(t) {
1234
1238
  }), e.children.length > 0 ? (e.setAttribute("role", "row"), e.setAttribute("aria-rowindex", "1")) : (e.removeAttribute("role"), e.removeAttribute("aria-rowindex")));
1235
1239
  }
1236
1240
  const Ge = typeof requestIdleCallback == "function";
1237
- function Dt(t, e) {
1241
+ function Ot(t, e) {
1238
1242
  return Ge ? requestIdleCallback(t, e) : window.setTimeout(() => {
1239
1243
  const o = Date.now();
1240
1244
  t({
@@ -1247,7 +1251,7 @@ function Ae(t) {
1247
1251
  Ge ? cancelIdleCallback(t) : clearTimeout(t);
1248
1252
  }
1249
1253
  var T = ((t) => (t[t.STYLE = 1] = "STYLE", t[t.VIRTUALIZATION = 2] = "VIRTUALIZATION", t[t.HEADER = 3] = "HEADER", t[t.ROWS = 4] = "ROWS", t[t.COLUMNS = 5] = "COLUMNS", t[t.FULL = 6] = "FULL", t))(T || {});
1250
- class Ot {
1254
+ class Dt {
1251
1255
  #l;
1252
1256
  #i = 0;
1253
1257
  #u = 0;
@@ -1259,7 +1263,7 @@ class Ot {
1259
1263
  this.#l = e;
1260
1264
  }
1261
1265
  requestPhase(e, o) {
1262
- e > this.#i && (this.#i = e), this.#u === 0 && (this.#f(), this.#u = requestAnimationFrame(() => this.#g()));
1266
+ e > this.#i && (this.#i = e), this.#u === 0 && (this.#f(), this.#u = requestAnimationFrame(() => this.#p()));
1263
1267
  }
1264
1268
  whenReady() {
1265
1269
  return this.#d ? this.#d : Promise.resolve();
@@ -1281,7 +1285,7 @@ class Ot {
1281
1285
  this.#h = e;
1282
1286
  }));
1283
1287
  }
1284
- #g() {
1288
+ #p() {
1285
1289
  if (this.#u = 0, !this.#l.isConnected()) {
1286
1290
  this.#i = 0, this.#h && (this.#h(), this.#h = null, this.#d = null);
1287
1291
  return;
@@ -1601,8 +1605,8 @@ function W(t, e, o) {
1601
1605
  else {
1602
1606
  const h = r.innerHTML.trim();
1603
1607
  u = (w) => {
1604
- const b = document.createElement("div");
1605
- return b.innerHTML = h, w.appendChild(b), () => b.remove();
1608
+ const v = document.createElement("div");
1609
+ return v.innerHTML = h, w.appendChild(v), () => v.remove();
1606
1610
  };
1607
1611
  }
1608
1612
  const f = e.toolPanels.get(s);
@@ -1652,8 +1656,8 @@ function Bt(t, e, o) {
1652
1656
  const p = (h) => {
1653
1657
  if (!u) return;
1654
1658
  h.preventDefault();
1655
- const w = s === "left" ? h.clientX - a : a - h.clientX, b = Math.min(d, Math.max(l, c + w));
1656
- n.style.width = `${b}px`;
1659
+ const w = s === "left" ? h.clientX - a : a - h.clientX, v = Math.min(d, Math.max(l, c + w));
1660
+ n.style.width = `${v}px`;
1657
1661
  }, f = () => {
1658
1662
  if (!u) return;
1659
1663
  u = !1, i.classList.remove("resizing"), n.style.transition = "", document.body.style.cursor = "", document.body.style.userSelect = "";
@@ -1719,11 +1723,11 @@ function Gt(t, e, o) {
1719
1723
  }
1720
1724
  }
1721
1725
  }
1722
- function De(t, e) {
1726
+ function Oe(t, e) {
1723
1727
  const o = t.querySelector("[data-panel-toggle]");
1724
1728
  o && (o.classList.toggle("active", e.isPanelOpen), o.setAttribute("aria-pressed", String(e.isPanelOpen)));
1725
1729
  }
1726
- function Oe(t, e) {
1730
+ function De(t, e) {
1727
1731
  const o = t.querySelector(".tbw-tool-panel");
1728
1732
  o && (o.classList.toggle("open", e.isPanelOpen), e.isPanelOpen || (o.style.width = ""));
1729
1733
  }
@@ -1773,7 +1777,7 @@ function Yt(t, e) {
1773
1777
  s && t.expandedSections.add(s.id);
1774
1778
  }
1775
1779
  const i = e.getShadow();
1776
- De(i, t), Oe(i, t), Gt(i, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: n.expandedSections });
1780
+ Oe(i, t), De(i, t), Gt(i, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: n.expandedSections });
1777
1781
  },
1778
1782
  closeToolPanel() {
1779
1783
  if (!t.isPanelOpen) return;
@@ -1784,7 +1788,7 @@ function Yt(t, e) {
1784
1788
  r.onClose?.();
1785
1789
  t.isPanelOpen = !1;
1786
1790
  const i = e.getShadow();
1787
- De(i, t), Oe(i, t), e.emit("tool-panel-close", {});
1791
+ Oe(i, t), De(i, t), e.emit("tool-panel-close", {});
1788
1792
  },
1789
1793
  toggleToolPanel() {
1790
1794
  t.isPanelOpen ? n.closeToolPanel() : n.openToolPanel();
@@ -1912,10 +1916,10 @@ function Kt(t, e, o, n) {
1912
1916
  icon: N(C.icon),
1913
1917
  isExpanded: o.expandedSections.has(C.id)
1914
1918
  }))
1915
- }, w = $t(g), b = Ft(h), S = Pe({
1919
+ }, w = $t(g), v = Ft(h), S = Pe({
1916
1920
  hasShell: !0,
1917
1921
  shellHeader: w,
1918
- shellBody: b
1922
+ shellBody: v
1919
1923
  });
1920
1924
  t.appendChild(S);
1921
1925
  } else {
@@ -1962,7 +1966,7 @@ function eo(t, e, o) {
1962
1966
  const { scrollTop: c, scrollHeight: d, clientHeight: u } = o.fauxScrollbar, p = d - u, f = l > 0 && c < p || l < 0 && c > 0;
1963
1967
  let g = !1;
1964
1968
  if (o.scrollArea) {
1965
- const { scrollLeft: h, scrollWidth: w, clientWidth: b } = o.scrollArea, S = w - b;
1969
+ const { scrollLeft: h, scrollWidth: w, clientWidth: v } = o.scrollArea, S = w - v;
1966
1970
  g = a > 0 && h < S || a < 0 && h > 0;
1967
1971
  }
1968
1972
  return f && (o.fauxScrollbar.scrollTop = e.scrollTop + l), g && o.scrollArea && (o.scrollArea.scrollLeft = e.scrollLeft + a), f || g;
@@ -2059,7 +2063,7 @@ const io = [
2059
2063
  columnVirtualization: "import { ColumnVirtualizationPlugin } from '@toolbox-web/grid/plugins/column-virtualization';"
2060
2064
  };
2061
2065
  function ue(t) {
2062
- return so[t] ?? `import { ${O(t)}Plugin } from '@toolbox-web/grid/plugins/${t}';`;
2066
+ return so[t] ?? `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${t}';`;
2063
2067
  }
2064
2068
  function Ze() {
2065
2069
  if (typeof window < "u" && window.location) {
@@ -2069,7 +2073,7 @@ function Ze() {
2069
2073
  }
2070
2074
  return typeof process < "u" && process.env?.NODE_ENV !== "production";
2071
2075
  }
2072
- function O(t) {
2076
+ function D(t) {
2073
2077
  return t.charAt(0).toUpperCase() + t.slice(1);
2074
2078
  }
2075
2079
  function Me(t, e) {
@@ -2134,7 +2138,7 @@ function ao(t) {
2134
2138
  for (const s of r.configRules) {
2135
2139
  const l = n.config;
2136
2140
  if (s.check(l)) {
2137
- const c = `${`[tbw-grid:${O(n.name)}Plugin]`} Configuration warning: ${s.message}`;
2141
+ const c = `${`[tbw-grid:${D(n.name)}Plugin]`} Configuration warning: ${s.message}`;
2138
2142
  s.severity === "error" ? e.push(c) : o.push(c);
2139
2143
  }
2140
2144
  }
@@ -2154,19 +2158,19 @@ function co(t, e) {
2154
2158
  for (const r of i) {
2155
2159
  const s = r.name, l = r.required ?? !0, a = r.reason;
2156
2160
  if (!e.some((d) => d.name === s)) {
2157
- const d = a ?? `${O(o)}Plugin requires ${O(s)}Plugin`, u = ue(s);
2161
+ const d = a ?? `${D(o)}Plugin requires ${D(s)}Plugin`, u = ue(s);
2158
2162
  if (l)
2159
2163
  throw new Error(
2160
2164
  `[tbw-grid] Plugin dependency error:
2161
2165
 
2162
2166
  ${d}.
2163
2167
 
2164
- → Add the plugin to your gridConfig.plugins array BEFORE ${O(o)}Plugin:
2168
+ → Add the plugin to your gridConfig.plugins array BEFORE ${D(o)}Plugin:
2165
2169
  ${u}
2166
- plugins: [new ${O(s)}Plugin(), new ${O(o)}Plugin()]`
2170
+ plugins: [new ${D(s)}Plugin(), new ${D(o)}Plugin()]`
2167
2171
  );
2168
2172
  console.info(
2169
- `[tbw-grid] ${O(o)}Plugin: Optional "${s}" plugin not found. Some features may be unavailable.`
2173
+ `[tbw-grid] ${D(o)}Plugin: Optional "${s}" plugin not found. Some features may be unavailable.`
2170
2174
  );
2171
2175
  }
2172
2176
  }
@@ -2184,7 +2188,7 @@ function ho(t) {
2184
2188
  o.add(l), console.warn(
2185
2189
  `[tbw-grid] Plugin incompatibility warning:
2186
2190
 
2187
- ${O(n.name)}Plugin and ${O(s.name)}Plugin are both loaded, but they are currently incompatible.
2191
+ ${D(n.name)}Plugin and ${D(s.name)}Plugin are both loaded, but they are currently incompatible.
2188
2192
 
2189
2193
  → ${s.reason}
2190
2194
 
@@ -2456,7 +2460,7 @@ class uo {
2456
2460
  }
2457
2461
  class L extends HTMLElement {
2458
2462
  static tagName = "tbw-grid";
2459
- static version = "1.10.0";
2463
+ static version = "1.10.1";
2460
2464
  static #l = 0;
2461
2465
  static adapters = [];
2462
2466
  static registerAdapter(e) {
@@ -2482,24 +2486,24 @@ class L extends HTMLElement {
2482
2486
  return this.#t?.effective ?? {};
2483
2487
  }
2484
2488
  #f = !1;
2485
- #g = !1;
2486
- #m = {
2489
+ #p = !1;
2490
+ #b = {
2487
2491
  rows: !1,
2488
2492
  columns: !1,
2489
2493
  gridConfig: !1,
2490
2494
  fitMode: !1
2491
2495
  };
2492
2496
  #s;
2493
- #v = 0;
2497
+ #m = 0;
2494
2498
  #r = null;
2495
- #w = !1;
2496
- #R;
2497
- #H = Qt();
2498
- #b;
2499
+ #g = !1;
2500
+ #x;
2501
+ #O = Qt();
2502
+ #w;
2499
2503
  #C;
2500
2504
  #y;
2501
- #p;
2502
- #J = {
2505
+ #v;
2506
+ #_ = {
2503
2507
  scrollTop: 0,
2504
2508
  scrollLeft: 0,
2505
2509
  scrollHeight: 0,
@@ -2508,22 +2512,22 @@ class L extends HTMLElement {
2508
2512
  clientWidth: 0
2509
2513
  };
2510
2514
  #o;
2511
- #_;
2512
- #M = !1;
2515
+ #E;
2516
+ #z = !1;
2513
2517
  #D;
2514
- #F;
2515
- #O;
2518
+ #U;
2519
+ #M;
2516
2520
  #t;
2517
2521
  #e = Ut();
2518
2522
  #c;
2519
- #z;
2520
- #k = !1;
2521
- #x = /* @__PURE__ */ new Set();
2522
- #A = /* @__PURE__ */ new Map();
2523
- #N;
2524
- #E = /* @__PURE__ */ new Map();
2523
+ #k;
2524
+ #N = !1;
2525
+ #A = /* @__PURE__ */ new Set();
2526
+ #T = /* @__PURE__ */ new Map();
2527
+ #I;
2528
+ #S = /* @__PURE__ */ new Map();
2525
2529
  _rows = [];
2526
- #U = [];
2530
+ #V = [];
2527
2531
  get _columns() {
2528
2532
  return this.#n.columns ?? [];
2529
2533
  }
@@ -2574,7 +2578,7 @@ class L extends HTMLElement {
2574
2578
  }
2575
2579
  set rows(e) {
2576
2580
  const o = this.#a;
2577
- this.#a = e, o !== e && this.#$("rows");
2581
+ this.#a = e, o !== e && this.#F("rows");
2578
2582
  }
2579
2583
  get sourceRows() {
2580
2584
  return this.#a;
@@ -2584,64 +2588,64 @@ class L extends HTMLElement {
2584
2588
  }
2585
2589
  set columns(e) {
2586
2590
  const o = this.#t?.getColumns();
2587
- this.#t?.setColumns(e), o !== e && this.#$("columns");
2591
+ this.#t?.setColumns(e), o !== e && this.#F("columns");
2588
2592
  }
2589
2593
  get gridConfig() {
2590
2594
  return this.#n;
2591
2595
  }
2592
2596
  set gridConfig(e) {
2593
2597
  const o = this.#t?.getGridConfig();
2594
- this.#t?.setGridConfig(e), o !== e && (this.#t.clearLightDomCache(), this.#$("gridConfig"));
2598
+ this.#t?.setGridConfig(e), o !== e && (this.#t.clearLightDomCache(), this.#F("gridConfig"));
2595
2599
  }
2596
2600
  get fitMode() {
2597
2601
  return this.#n.fitMode ?? "stretch";
2598
2602
  }
2599
2603
  set fitMode(e) {
2600
2604
  const o = this.#t?.getFitMode();
2601
- this.#t?.setFitMode(e), o !== e && this.#$("fitMode");
2605
+ this.#t?.setFitMode(e), o !== e && this.#F("fitMode");
2602
2606
  }
2603
2607
  get loading() {
2604
- return this.#k;
2608
+ return this.#N;
2605
2609
  }
2606
2610
  set loading(e) {
2607
- const o = this.#k;
2608
- this.#k = e, e ? this.setAttribute("loading", "") : this.removeAttribute("loading"), o !== e && this.#Oe();
2611
+ const o = this.#N;
2612
+ this.#N = e, e ? this.setAttribute("loading", "") : this.removeAttribute("loading"), o !== e && this.#De();
2609
2613
  }
2610
2614
  setRowLoading(e, o) {
2611
- const n = this.#x.has(e);
2612
- o ? this.#x.add(e) : this.#x.delete(e), n !== o && this.#fe(e, o);
2615
+ const n = this.#A.has(e);
2616
+ o ? this.#A.add(e) : this.#A.delete(e), n !== o && this.#fe(e, o);
2613
2617
  }
2614
2618
  setCellLoading(e, o, n) {
2615
- let i = this.#A.get(e);
2619
+ let i = this.#T.get(e);
2616
2620
  const r = i?.has(o) ?? !1;
2617
- n ? (i || (i = /* @__PURE__ */ new Set(), this.#A.set(e, i)), i.add(o)) : (i?.delete(o), i?.size === 0 && this.#A.delete(e)), r !== n && this.#pe(e, o, n);
2621
+ n ? (i || (i = /* @__PURE__ */ new Set(), this.#T.set(e, i)), i.add(o)) : (i?.delete(o), i?.size === 0 && this.#T.delete(e)), r !== n && this.#pe(e, o, n);
2618
2622
  }
2619
2623
  isRowLoading(e) {
2620
- return this.#x.has(e);
2624
+ return this.#A.has(e);
2621
2625
  }
2622
2626
  isCellLoading(e, o) {
2623
- return this.#A.get(e)?.has(o) ?? !1;
2627
+ return this.#T.get(e)?.has(o) ?? !1;
2624
2628
  }
2625
2629
  clearAllLoading() {
2626
2630
  this.loading = !1;
2627
- for (const e of this.#x)
2631
+ for (const e of this.#A)
2628
2632
  this.#fe(e, !1);
2629
- this.#x.clear();
2630
- for (const [e, o] of this.#A)
2633
+ this.#A.clear();
2634
+ for (const [e, o] of this.#T)
2631
2635
  for (const n of o)
2632
2636
  this.#pe(e, n, !1);
2633
- this.#A.clear();
2637
+ this.#T.clear();
2634
2638
  }
2635
2639
  get effectiveConfig() {
2636
2640
  return this.#n;
2637
2641
  }
2638
2642
  get disconnectSignal() {
2639
- return this.#b || (this.#b = new AbortController()), this.#b.signal;
2643
+ return this.#w || (this.#w = new AbortController()), this.#w.signal;
2640
2644
  }
2641
2645
  constructor() {
2642
- super(), this.#be(), this.#d = new Promise((e) => this.#h = e), this.#s = new Ot({
2646
+ super(), this.#be(), this.#d = new Promise((e) => this.#h = e), this.#s = new Dt({
2643
2647
  mergeConfig: () => {
2644
- this.#t.parseLightDomColumns(this), this.#t.merge(), this.#oe(), lo(this.#n, this.#o?.getPlugins() ?? []), ao(this.#o?.getPlugins() ?? []), ho(this.#o?.getPlugins() ?? []), this.#Le(), this.#U = [...this._columns];
2648
+ this.#t.parseLightDomColumns(this), this.#t.merge(), this.#oe(), lo(this.#n, this.#o?.getPlugins() ?? []), ao(this.#o?.getPlugins() ?? []), ho(this.#o?.getPlugins() ?? []), this.#Le(), this.#V = [...this._columns];
2645
2649
  },
2646
2650
  processColumns: () => this.#Ae(),
2647
2651
  processRows: () => this.#Te(),
@@ -2649,7 +2653,7 @@ class L extends HTMLElement {
2649
2653
  updateTemplate: () => B(this),
2650
2654
  renderVirtualWindow: () => this.refreshVirtualWindow(!0, !0),
2651
2655
  afterRender: () => {
2652
- this.#o?.afterRender(), this.#n.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, ve(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, $(this)), this._virtualization.enabled && !this.#W && this.#ve();
2656
+ this.#o?.afterRender(), this.#n.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, ve(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, $(this)), this._virtualization.enabled && !this.#$ && this.#ve();
2653
2657
  },
2654
2658
  isConnected: () => this.isConnected && this.#f
2655
2659
  }), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = Yt(this.#e, {
@@ -2659,7 +2663,7 @@ class L extends HTMLElement {
2659
2663
  expand: this.#n?.icons?.expand ?? k.expand,
2660
2664
  collapse: this.#n?.icons?.collapse ?? k.collapse
2661
2665
  }),
2662
- emit: (e, o) => this.#P(e, o),
2666
+ emit: (e, o) => this.#L(e, o),
2663
2667
  refreshShellHeader: () => this.refreshShellHeader()
2664
2668
  }), this.#t = new gt({
2665
2669
  getRows: () => this.#a,
@@ -2670,11 +2674,11 @@ class L extends HTMLElement {
2670
2674
  onConfigChange: () => {
2671
2675
  this.#s.requestPhase(T.FULL, "configChange");
2672
2676
  },
2673
- emit: (e, o) => this.#P(e, o),
2677
+ emit: (e, o) => this.#L(e, o),
2674
2678
  clearRowPool: () => {
2675
2679
  this._rowPool.length = 0, this._bodyEl && (this._bodyEl.innerHTML = ""), this.__rowRenderEpoch++;
2676
2680
  },
2677
- setup: () => this.#L(),
2681
+ setup: () => this.#H(),
2678
2682
  renderHeader: () => ne(this),
2679
2683
  updateTemplate: () => B(this),
2680
2684
  refreshVirtualWindow: () => this.#s.requestPhase(T.VIRTUALIZATION, "configManager"),
@@ -2692,24 +2696,24 @@ class L extends HTMLElement {
2692
2696
  });
2693
2697
  }
2694
2698
  static #ee = "tbw-grid-styles";
2695
- static #I = "";
2696
- static #V = /* @__PURE__ */ new Map();
2699
+ static #q = "";
2700
+ static #B = /* @__PURE__ */ new Map();
2697
2701
  static #we() {
2698
2702
  let e = document.getElementById(this.#ee);
2699
2703
  return e || (e = document.createElement("style"), e.id = this.#ee, e.setAttribute("data-tbw-grid", "true"), document.head.appendChild(e)), e;
2700
2704
  }
2701
- static #B() {
2702
- const e = this.#we(), o = Array.from(this.#V.values()).join(`
2705
+ static #G() {
2706
+ const e = this.#we(), o = Array.from(this.#B.values()).join(`
2703
2707
  `);
2704
- e.textContent = `${this.#I}
2708
+ e.textContent = `${this.#q}
2705
2709
 
2706
2710
  /* Plugin Styles */
2707
2711
  ${o}`;
2708
2712
  }
2709
2713
  async #be() {
2710
- if (!L.#I) {
2714
+ if (!L.#q) {
2711
2715
  if (we.length > 0) {
2712
- L.#I = we, L.#B();
2716
+ L.#q = we, L.#G();
2713
2717
  return;
2714
2718
  }
2715
2719
  await new Promise((e) => setTimeout(e, 50));
@@ -2726,7 +2730,7 @@ ${o}`;
2726
2730
  } catch {
2727
2731
  continue;
2728
2732
  }
2729
- e ? (L.#I = e, L.#B()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
2733
+ e ? (L.#q = e, L.#G()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
2730
2734
  "[tbw-grid] Could not find grid.css in document.styleSheets. Grid styling will not work.",
2731
2735
  "Available stylesheets:",
2732
2736
  Array.from(document.styleSheets).map((o) => o.href || "(inline)")
@@ -2762,18 +2766,18 @@ ${o}`;
2762
2766
  const e = this.#n?.plugins, o = Array.isArray(e) ? e : [];
2763
2767
  this.#o.attachAll(o);
2764
2768
  }
2765
- #q() {
2769
+ #W() {
2766
2770
  const e = this.#o?.getPluginStyles() ?? [];
2767
2771
  let o = !1;
2768
2772
  for (const { name: n, styles: i } of e)
2769
- L.#V.has(n) || (L.#V.set(n, i), o = !0);
2770
- o && L.#B();
2773
+ L.#B.has(n) || (L.#B.set(n, i), o = !0);
2774
+ o && L.#G();
2771
2775
  }
2772
2776
  #oe() {
2773
2777
  const e = this.#n?.plugins, o = Array.isArray(e) ? e : [];
2774
- if (this.#_ !== o) {
2775
- if (this.#_ && this.#_.length === o.length && this.#_.every((n, i) => n === o[i])) {
2776
- this.#_ = o;
2778
+ if (this.#E !== o) {
2779
+ if (this.#E && this.#E.length === o.length && this.#E.every((n, i) => n === o[i])) {
2780
+ this.#E = o;
2777
2781
  return;
2778
2782
  }
2779
2783
  this.#o && this.#o.detachAll();
@@ -2788,7 +2792,7 @@ ${o}`;
2788
2792
  const i = this.#e.headerContentCleanups.get(n);
2789
2793
  i && (i(), this.#e.headerContentCleanups.delete(n)), this.#e.headerContents.delete(n);
2790
2794
  }
2791
- this.#te(), this.#q(), this.#_ = o, this.#ne(), this.#w = this.#o?.getAll().some((n) => n.onScroll) ?? !1;
2795
+ this.#te(), this.#W(), this.#E = o, this.#ne(), this.#g = this.#o?.getAll().some((n) => n.onScroll) ?? !1;
2792
2796
  }
2793
2797
  }
2794
2798
  #me() {
@@ -2803,7 +2807,7 @@ ${o}`;
2803
2807
  for (const { content: n } of o)
2804
2808
  this.#e.headerContents.has(n.id) || this.#e.headerContents.set(n.id, n);
2805
2809
  }
2806
- #T() {
2810
+ #P() {
2807
2811
  const e = L.getAdapters();
2808
2812
  if (e.length === 0 && !this.__frameworkAdapter) return;
2809
2813
  const o = this.__frameworkAdapter;
@@ -2820,9 +2824,9 @@ ${o}`;
2820
2824
  };
2821
2825
  }
2822
2826
  connectedCallback() {
2823
- this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", L.version), this.id || (this.id = `tbw-grid-${++L.#l}`), this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#b && (this.#b.abort(), this.#M = !1), this.#b = new AbortController(), this.#p && (Ae(this.#p), this.#p = void 0), I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T()), this.#t.parseLightDomColumns(this), this.#t.merge(), this.#te();
2827
+ this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", L.version), this.id || (this.id = `tbw-grid-${++L.#l}`), this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#w && (this.#w.abort(), this.#z = !1), this.#w = new AbortController(), this.#v && (Ae(this.#v), this.#v = void 0), I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#P()), this.#t.parseLightDomColumns(this), this.#t.merge(), this.#te();
2824
2828
  const e = this.#n?.plugins;
2825
- this.#_ = Array.isArray(e) ? e : [], this.#ne(), this.#u || (this.#Q(), this.#q(), this.#u = !0), this.#ie(), this.#p = Dt(
2829
+ this.#E = Array.isArray(e) ? e : [], this.#ne(), this.#u || (this.#Z(), this.#W(), this.#u = !0), this.#ie(), this.#v = Ot(
2826
2830
  () => {
2827
2831
  this.#Ne();
2828
2832
  },
@@ -2830,7 +2834,7 @@ ${o}`;
2830
2834
  );
2831
2835
  }
2832
2836
  disconnectedCallback() {
2833
- this.#p && (Ae(this.#p), this.#p = void 0), this.#me(), Xt(this.#e), this.#c.setInitialized(!1), this.#z?.(), this.#z = void 0, Qe(this.#H), this.#b && (this.#b.abort(), this.#b = void 0), this.#D?.abort(), this.#D = void 0, this.#M = !1, this._resizeController && this._resizeController.dispose(), this.#C && (this.#C.disconnect(), this.#C = void 0), this.#y && (this.#y.disconnect(), this.#y = void 0, this.#W = !1), j(this), this.#S.clear(), this.#_ = void 0;
2837
+ this.#v && (Ae(this.#v), this.#v = void 0), this.#me(), Xt(this.#e), this.#c.setInitialized(!1), this.#k?.(), this.#k = void 0, Qe(this.#O), this.#w && (this.#w.abort(), this.#w = void 0), this.#D?.abort(), this.#D = void 0, this.#z = !1, this._resizeController && this._resizeController.dispose(), this.#C && (this.#C.disconnect(), this.#C = void 0), this.#y && (this.#y.disconnect(), this.#y = void 0, this.#$ = !1), j(this), this.#R.clear(), this.#E = void 0;
2834
2838
  for (const e of this._rowPool)
2835
2839
  e.remove();
2836
2840
  this._rowPool.length = 0, this.__rowsBodyEl = null, this.#f = !1;
@@ -2858,9 +2862,9 @@ ${o}`;
2858
2862
  const r = this.#n?.shell?.toolPanel?.defaultOpen;
2859
2863
  r && this.#e.toolPanels.has(r) && (this.openToolPanel(), this.#e.expandedSections.add(r));
2860
2864
  }
2861
- if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Te(this), this.#L(), this.#se(o), this.#M)
2865
+ if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Te(this), this.#H(), this.#se(o), this.#z)
2862
2866
  return;
2863
- this.#M = !0;
2867
+ this.#z = !0;
2864
2868
  const n = this.disconnectSignal;
2865
2869
  At(this, this, this.#i, n);
2866
2870
  const i = this.#n.rowHeight;
@@ -2883,11 +2887,11 @@ ${o}`;
2883
2887
  #se(e) {
2884
2888
  this.#D?.abort(), this.#D = new AbortController();
2885
2889
  const o = this.#D.signal, n = e?.querySelector(".faux-vscroll"), i = e?.querySelector(".rows");
2886
- if (this._virtualization.container = n ?? this, this.#w = this.#o?.getAll().some((r) => r.onScroll) ?? !1, n && i) {
2890
+ if (this._virtualization.container = n ?? this, this.#g = this.#o?.getAll().some((r) => r.onScroll) ?? !1, n && i) {
2887
2891
  n.addEventListener(
2888
2892
  "scroll",
2889
2893
  () => {
2890
- if (!this._virtualization.enabled && !this.#w) return;
2894
+ if (!this._virtualization.enabled && !this.#g) return;
2891
2895
  const a = n.scrollTop, c = this._virtualization.rowHeight;
2892
2896
  if (this._rows.length <= this._virtualization.bypassThreshold)
2893
2897
  i.style.transform = `translateY(${-a}px)`;
@@ -2895,22 +2899,22 @@ ${o}`;
2895
2899
  const d = Math.floor(a / c), u = d - d % 2, p = -(a - u * c);
2896
2900
  i.style.transform = `translateY(${p}px)`;
2897
2901
  }
2898
- this.#r = a, this.#v || (this.#v = requestAnimationFrame(() => {
2899
- this.#v = 0, this.#r !== null && (this.#Me(this.#r), this.#r = null);
2902
+ this.#r = a, this.#m || (this.#m = requestAnimationFrame(() => {
2903
+ this.#m = 0, this.#r !== null && (this.#Me(this.#r), this.#r = null);
2900
2904
  }));
2901
2905
  },
2902
2906
  { passive: !0, signal: o }
2903
2907
  );
2904
2908
  const r = this.#i.querySelector(".tbw-scroll-area");
2905
- this.#F = r, r && this.#w && r.addEventListener(
2909
+ this.#U = r, r && this.#g && r.addEventListener(
2906
2910
  "scroll",
2907
2911
  () => {
2908
- const a = this.#J;
2912
+ const a = this.#_;
2909
2913
  a.scrollTop = n.scrollTop, a.scrollLeft = r.scrollLeft, a.scrollHeight = n.scrollHeight, a.scrollWidth = r.scrollWidth, a.clientHeight = n.clientHeight, a.clientWidth = r.clientWidth, this.#o?.onScroll(a);
2910
2914
  },
2911
2915
  { passive: !0, signal: o }
2912
2916
  );
2913
- const s = this.#i.querySelector(".tbw-grid-content"), l = this.#F;
2917
+ const s = this.#i.querySelector(".tbw-grid-content"), l = this.#U;
2914
2918
  s && (s.addEventListener(
2915
2919
  "wheel",
2916
2920
  (a) => {
@@ -2926,7 +2930,7 @@ ${o}`;
2926
2930
  { passive: !1, signal: o }
2927
2931
  ), no(
2928
2932
  s,
2929
- this.#H,
2933
+ this.#O,
2930
2934
  { fauxScrollbar: n, scrollArea: l },
2931
2935
  o
2932
2936
  ));
@@ -2948,11 +2952,11 @@ ${o}`;
2948
2952
  { signal: o }
2949
2953
  );
2950
2954
  }
2951
- #W = !1;
2955
+ #$ = !1;
2952
2956
  #ve() {
2953
- if (this.#W) return;
2957
+ if (this.#$) return;
2954
2958
  const e = this._bodyEl?.querySelector(".data-grid-row");
2955
- e && (this.#W = !0, this.#y?.disconnect(), this.#y = new ResizeObserver(() => {
2959
+ e && (this.#$ = !0, this.#y?.disconnect(), this.#y = new ResizeObserver(() => {
2956
2960
  this.#re();
2957
2961
  }), this.#y.observe(e));
2958
2962
  }
@@ -2962,7 +2966,7 @@ ${o}`;
2962
2966
  removeEventListener(e, o, n) {
2963
2967
  super.removeEventListener(e, o, n);
2964
2968
  }
2965
- #P(e, o) {
2969
+ #L(e, o) {
2966
2970
  this.dispatchEvent(new CustomEvent(e, { detail: o, bubbles: !0, composed: !0 }));
2967
2971
  }
2968
2972
  #Ce() {
@@ -2973,16 +2977,16 @@ ${o}`;
2973
2977
  });
2974
2978
  });
2975
2979
  }
2976
- #$(e) {
2977
- this.#m[e] = !0, !this.#g && (this.#g = !0, queueMicrotask(() => this.#ye()));
2980
+ #F(e) {
2981
+ this.#b[e] = !0, !this.#p && (this.#p = !0, queueMicrotask(() => this.#ye()));
2978
2982
  }
2979
2983
  #ye() {
2980
- if (!this.#g || !this.#f) {
2981
- this.#g = !1;
2984
+ if (!this.#p || !this.#f) {
2985
+ this.#p = !1;
2982
2986
  return;
2983
2987
  }
2984
- const e = this.#m;
2985
- if (this.#g = !1, this.#m = {
2988
+ const e = this.#b;
2989
+ if (this.#p = !1, this.#b = {
2986
2990
  rows: !1,
2987
2991
  columns: !1,
2988
2992
  gridConfig: !1,
@@ -2994,14 +2998,14 @@ ${o}`;
2994
2998
  e.columns && this.#Ee(), e.rows && this.#le(), e.fitMode && this.#Se();
2995
2999
  }
2996
3000
  #le() {
2997
- this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#G(), this.#s.requestPhase(T.ROWS, "applyRowsUpdate");
3001
+ this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#X(), this.#s.requestPhase(T.ROWS, "applyRowsUpdate");
2998
3002
  }
2999
- #G() {
3000
- this.#E.clear();
3003
+ #X() {
3004
+ this.#S.clear();
3001
3005
  const e = this.#n.getRowId;
3002
3006
  this._rows.forEach((o, n) => {
3003
3007
  const i = this.#ae(o, e);
3004
- i !== void 0 && this.#E.set(i, { row: o, index: n });
3008
+ i !== void 0 && this.#S.set(i, { row: o, index: n });
3005
3009
  });
3006
3010
  }
3007
3011
  #ae(e, o) {
@@ -3020,7 +3024,7 @@ ${o}`;
3020
3024
  return n;
3021
3025
  }
3022
3026
  #Ee() {
3023
- j(this), this.#t.merge(), this.#L();
3027
+ j(this), this.#t.merge(), this.#H();
3024
3028
  }
3025
3029
  #Se() {
3026
3030
  this.#t.merge(), this.#n.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, ve(this)) : (this._columns.forEach((o) => {
@@ -3030,13 +3034,13 @@ ${o}`;
3030
3034
  #Re() {
3031
3035
  I(this, this.#e), q(this, this.#e);
3032
3036
  const e = !!this.#i.querySelector(".has-shell"), o = !!this.#i.querySelector(".tbw-tool-panel"), n = this.#i.querySelectorAll(".tbw-accordion-section").length;
3033
- this.#t.parseLightDomColumns(this), this.#t.merge(), this.#oe(), W(this, this.#e, this.#T()), this.#t.markSourcesChanged(), this.#t.merge();
3037
+ this.#t.parseLightDomColumns(this), this.#t.merge(), this.#oe(), W(this, this.#e, this.#P()), this.#t.markSourcesChanged(), this.#t.merge();
3034
3038
  const i = Ke(this.#n?.shell), r = (this.#n?.shell?.toolPanels?.length ?? 0) > 0, s = (this.#n?.shell?.toolPanels?.length ?? 0) !== n;
3035
3039
  if (e !== i || !e && i || !o && r || o && s) {
3036
- this.#Q(), this.#q(), this.#ie(), this.#G();
3040
+ this.#Z(), this.#W(), this.#ie(), this.#X();
3037
3041
  return;
3038
3042
  }
3039
- e && this.#xe(), this.#G(), this.#s.requestPhase(T.COLUMNS, "applyGridConfigUpdate");
3043
+ e && this.#xe(), this.#X(), this.#s.requestPhase(T.COLUMNS, "applyGridConfigUpdate");
3040
3044
  }
3041
3045
  #xe() {
3042
3046
  const e = this.#i.querySelector(".tbw-shell-header");
@@ -3047,7 +3051,7 @@ ${o}`;
3047
3051
  }
3048
3052
  #Ae() {
3049
3053
  if (this.#o) {
3050
- const e = this.#U.length > 0 ? this.#U : this._columns, o = e.filter((r) => !r.hidden), n = e.filter((r) => r.hidden), i = this.#o.processColumns([...o]);
3054
+ const e = this.#V.length > 0 ? this.#V : this._columns, o = e.filter((r) => !r.hidden), n = e.filter((r) => r.hidden), i = this.#o.processColumns([...o]);
3051
3055
  if (i !== o) {
3052
3056
  new Set(o.map((l) => l.field));
3053
3057
  const r = new Set(i.map((l) => l.field));
@@ -3069,16 +3073,16 @@ ${o}`;
3069
3073
  let i = 1;
3070
3074
  n === !1 || n === "off" ? i = 0 : (n === !0 || n === "on") && (i = 1), this.style.setProperty("--tbw-animation-duration", `${o.duration}ms`), this.style.setProperty("--tbw-animation-easing", o.easing ?? "ease-out"), this.style.setProperty("--tbw-animation-enabled", String(i)), this.dataset.animationMode = typeof n == "boolean" ? n ? "on" : "off" : n;
3071
3075
  }
3072
- #X(e, o, n = this.__rowRenderEpoch) {
3073
- this.#R || (this.#R = (i, r, s) => this.#o?.renderRow(i, r, s) ?? !1), Ct(this, e, o, n, this.#R);
3076
+ #Y(e, o, n = this.__rowRenderEpoch) {
3077
+ this.#x || (this.#x = (i, r, s) => this.#o?.renderRow(i, r, s) ?? !1), Ct(this, e, o, n, this.#x);
3074
3078
  }
3075
- #Y = -1;
3079
+ #j = -1;
3076
3080
  #ce = -1;
3077
3081
  #de(e, o) {
3078
- if (e === this.#Y && o === this.#ce)
3082
+ if (e === this.#j && o === this.#ce)
3079
3083
  return;
3080
- const n = this.#Y;
3081
- this.#Y = e, this.#ce = o, this.__rowsBodyEl && (this.__rowsBodyEl.setAttribute("aria-rowcount", String(e)), this.__rowsBodyEl.setAttribute("aria-colcount", String(o))), e !== n && this._bodyEl && (e > 0 ? this._bodyEl.setAttribute("role", "rowgroup") : this._bodyEl.removeAttribute("role"));
3084
+ const n = this.#j;
3085
+ this.#j = e, this.#ce = o, this.__rowsBodyEl && (this.__rowsBodyEl.setAttribute("aria-rowcount", String(e)), this.__rowsBodyEl.setAttribute("aria-colcount", String(o))), e !== n && this._bodyEl && (e > 0 ? this._bodyEl.setAttribute("role", "rowgroup") : this._bodyEl.removeAttribute("role"));
3082
3086
  }
3083
3087
  #he;
3084
3088
  #ue;
@@ -3093,7 +3097,7 @@ ${o}`;
3093
3097
  const o = document.createElement("div");
3094
3098
  return o.className = `tbw-spinner tbw-spinner--${e}`, o.setAttribute("role", "progressbar"), o.setAttribute("aria-label", "Loading"), o;
3095
3099
  }
3096
- #De(e) {
3100
+ #Oe(e) {
3097
3101
  const o = this.#n?.loadingRenderer;
3098
3102
  if (o) {
3099
3103
  const n = o({ size: e });
@@ -3105,26 +3109,26 @@ ${o}`;
3105
3109
  }
3106
3110
  return this.#He(e);
3107
3111
  }
3108
- #Oe() {
3112
+ #De() {
3109
3113
  const e = this.querySelector(".tbw-grid-root");
3110
3114
  if (e)
3111
- if (this.#k) {
3112
- if (!this.#N) {
3115
+ if (this.#N) {
3116
+ if (!this.#I) {
3113
3117
  const o = document.createElement("div");
3114
- o.className = "tbw-loading-overlay", o.setAttribute("role", "status"), o.setAttribute("aria-live", "polite"), o.appendChild(this.#De("large")), this.#N = o;
3118
+ o.className = "tbw-loading-overlay", o.setAttribute("role", "status"), o.setAttribute("aria-live", "polite"), o.appendChild(this.#Oe("large")), this.#I = o;
3115
3119
  }
3116
- e.appendChild(this.#N);
3120
+ e.appendChild(this.#I);
3117
3121
  } else
3118
- this.#N?.remove();
3122
+ this.#I?.remove();
3119
3123
  }
3120
3124
  #fe(e, o) {
3121
- const n = this.#E.get(e);
3125
+ const n = this.#S.get(e);
3122
3126
  if (!n) return;
3123
3127
  const i = this.findRenderedRowElement?.(n.index);
3124
3128
  i && (o ? (i.classList.add("tbw-row-loading"), i.setAttribute("aria-busy", "true")) : (i.classList.remove("tbw-row-loading"), i.removeAttribute("aria-busy")));
3125
3129
  }
3126
3130
  #pe(e, o, n) {
3127
- const i = this.#E.get(e);
3131
+ const i = this.#S.get(e);
3128
3132
  if (!i) return;
3129
3133
  const r = this.findRenderedRowElement?.(i.index);
3130
3134
  if (!r) return;
@@ -3133,11 +3137,11 @@ ${o}`;
3133
3137
  const l = r.children[s];
3134
3138
  l && (n ? (l.classList.add("tbw-cell-loading"), l.setAttribute("aria-busy", "true")) : (l.classList.remove("tbw-cell-loading"), l.removeAttribute("aria-busy")));
3135
3139
  }
3136
- #L() {
3140
+ #H() {
3137
3141
  if (this.isConnected && !(!this._headerRowEl || !this._bodyEl)) {
3138
- if (this.#t.parseLightDomColumns(this), this.#O) {
3139
- const e = this.#O;
3140
- this.#O = void 0, this.#t.merge();
3142
+ if (this.#t.parseLightDomColumns(this), this.#M) {
3143
+ const e = this.#M;
3144
+ this.#M = void 0, this.#t.merge();
3141
3145
  const o = this.#o?.getAll() ?? [];
3142
3146
  this.#t.applyState(e, o);
3143
3147
  }
@@ -3145,8 +3149,8 @@ ${o}`;
3145
3149
  }
3146
3150
  }
3147
3151
  #Me(e) {
3148
- if (this.refreshVirtualWindow(!1), this.#o?.onScrollRender(), this.#w) {
3149
- const o = this._virtualization.container, n = this.#F, i = this.#J;
3152
+ if (this.refreshVirtualWindow(!1), this.#o?.onScrollRender(), this.#g) {
3153
+ const o = this._virtualization.container, n = this.#U, i = this.#_;
3150
3154
  i.scrollTop = e, i.scrollLeft = n?.scrollLeft ?? 0, i.scrollHeight = o?.scrollHeight ?? 0, i.scrollWidth = n?.scrollWidth ?? 0, i.clientHeight = o?.clientHeight ?? 0, i.clientWidth = n?.clientWidth ?? 0, this.#o?.onScroll(i);
3151
3155
  }
3152
3156
  }
@@ -3188,7 +3192,7 @@ ${o}`;
3188
3192
  cellEl: i,
3189
3193
  originalEvent: e
3190
3194
  }, u = this.#o?.onCellClick(d) ?? !1;
3191
- return this.#P("cell-click", d), u;
3195
+ return this.#L("cell-click", d), u;
3192
3196
  }
3193
3197
  _dispatchRowClick(e, o, n, i) {
3194
3198
  if (!n) return !1;
@@ -3198,7 +3202,7 @@ ${o}`;
3198
3202
  rowEl: i,
3199
3203
  originalEvent: e
3200
3204
  }, s = this.#o?.onRowClick(r) ?? !1;
3201
- return this.#P("row-click", r), s;
3205
+ return this.#L("row-click", r), s;
3202
3206
  }
3203
3207
  _dispatchHeaderClick(e, o, n) {
3204
3208
  const i = this._columns[o];
@@ -3258,10 +3262,10 @@ ${o}`;
3258
3262
  return this.#_e(e, this.#n.getRowId);
3259
3263
  }
3260
3264
  getRow(e) {
3261
- return this.#E.get(e)?.row;
3265
+ return this.#S.get(e)?.row;
3262
3266
  }
3263
3267
  updateRow(e, o, n = "api") {
3264
- const i = this.#E.get(e);
3268
+ const i = this.#S.get(e);
3265
3269
  if (!i)
3266
3270
  throw new Error(
3267
3271
  `[tbw-grid] Row with ID "${e}" not found. Ensure the row exists and getRowId is correctly configured.`
@@ -3272,7 +3276,7 @@ ${o}`;
3272
3276
  d !== c && (l.push({ field: a, oldValue: d, newValue: c }), r[a] = c);
3273
3277
  }
3274
3278
  for (const { field: a, oldValue: c, newValue: d } of l)
3275
- this.#P("cell-change", {
3279
+ this.#L("cell-change", {
3276
3280
  row: r,
3277
3281
  rowId: e,
3278
3282
  rowIndex: s,
@@ -3287,7 +3291,7 @@ ${o}`;
3287
3291
  updateRows(e, o = "api") {
3288
3292
  let n = !1;
3289
3293
  for (const { id: i, changes: r } of e) {
3290
- const s = this.#E.get(i);
3294
+ const s = this.#S.get(i);
3291
3295
  if (!s)
3292
3296
  throw new Error(
3293
3297
  `[tbw-grid] Row with ID "${i}" not found. Ensure the row exists and getRowId is correctly configured.`
@@ -3295,7 +3299,7 @@ ${o}`;
3295
3299
  const { row: l, index: a } = s;
3296
3300
  for (const [c, d] of Object.entries(r)) {
3297
3301
  const u = l[c];
3298
- u !== d && (n = !0, l[c] = d, this.#P("cell-change", {
3302
+ u !== d && (n = !0, l[c] = d, this.#L("cell-change", {
3299
3303
  row: l,
3300
3304
  rowId: i,
3301
3305
  rowIndex: a,
@@ -3346,23 +3350,23 @@ ${o}`;
3346
3350
  return this.#t.collectState(e);
3347
3351
  }
3348
3352
  set columnState(e) {
3349
- e && (this.#O = e, this.#t.initialColumnState = e, this.#u && this.#ze(e));
3353
+ e && (this.#M = e, this.#t.initialColumnState = e, this.#u && this.#ze(e));
3350
3354
  }
3351
3355
  get columnState() {
3352
3356
  return this.getColumnState();
3353
3357
  }
3354
3358
  #ze(e) {
3355
3359
  const o = this.#o?.getAll() ?? [];
3356
- this.#t.applyState(e, o), this.#L();
3360
+ this.#t.applyState(e, o), this.#H();
3357
3361
  }
3358
3362
  requestStateChange() {
3359
3363
  const e = this.#o?.getAll() ?? [];
3360
3364
  this.#t.requestStateChange(e);
3361
3365
  }
3362
3366
  resetColumnState() {
3363
- this.#O = void 0, this.__originalOrder = [];
3367
+ this.#M = void 0, this.__originalOrder = [];
3364
3368
  const e = this.#o?.getAll() ?? [];
3365
- this.#t.resetState(e), this.#t.merge(), this.#L();
3369
+ this.#t.resetState(e), this.#t.merge(), this.#H();
3366
3370
  }
3367
3371
  get isToolPanelOpen() {
3368
3372
  return this.#c.isPanelOpen;
@@ -3409,10 +3413,10 @@ ${o}`;
3409
3413
  unregisterToolbarContent(e) {
3410
3414
  this.#c.unregisterToolbarContent(e);
3411
3415
  }
3412
- #j = !1;
3416
+ #K = !1;
3413
3417
  refreshShellHeader() {
3414
- this.#j || (this.#j = !0, queueMicrotask(() => {
3415
- this.#j = !1, this.isConnected && (I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T()), this.#t.markSourcesChanged(), this.#t.merge(), this.#Q(), this.#q(), this.#ke());
3418
+ this.#K || (this.#K = !0, queueMicrotask(() => {
3419
+ this.#K = !1, this.isConnected && (I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#P()), this.#t.markSourcesChanged(), this.#t.merge(), this.#Z(), this.#W(), this.#ke());
3416
3420
  }));
3417
3421
  }
3418
3422
  #ke() {
@@ -3424,27 +3428,27 @@ ${o}`;
3424
3428
  }
3425
3429
  this._resizeController = Te(this), this.#se(o), this.#s.requestPhase(T.COLUMNS, "shellRefresh");
3426
3430
  }
3427
- #S = /* @__PURE__ */ new Map();
3431
+ #R = /* @__PURE__ */ new Map();
3428
3432
  registerStyles(e, o) {
3429
- let n = this.#S.get(e);
3430
- n || (n = new CSSStyleSheet(), this.#S.set(e, n)), n.replaceSync(o), this.#ge();
3433
+ let n = this.#R.get(e);
3434
+ n || (n = new CSSStyleSheet(), this.#R.set(e, n)), n.replaceSync(o), this.#ge();
3431
3435
  }
3432
3436
  unregisterStyles(e) {
3433
- this.#S.delete(e) && this.#ge();
3437
+ this.#R.delete(e) && this.#ge();
3434
3438
  }
3435
3439
  getRegisteredStyles() {
3436
- return Array.from(this.#S.keys());
3440
+ return Array.from(this.#R.keys());
3437
3441
  }
3438
3442
  #ge() {
3439
- const e = Array.from(this.#S.values()), o = document.adoptedStyleSheets.filter(
3440
- (n) => !Array.from(this.#S.values()).includes(n)
3443
+ const e = Array.from(this.#R.values()), o = document.adoptedStyleSheets.filter(
3444
+ (n) => !Array.from(this.#R.values()).includes(n)
3441
3445
  );
3442
3446
  document.adoptedStyleSheets = [...o, ...e];
3443
3447
  }
3444
3448
  #Ne() {
3445
3449
  const e = () => {
3446
3450
  const n = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
3447
- I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T());
3451
+ I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#P());
3448
3452
  const r = this.#e.lightDomTitle, s = this.#e.hasToolButtonsContainer;
3449
3453
  if (r && !n || s && !i) {
3450
3454
  this.#t.markSourcesChanged(), this.#t.merge();
@@ -3457,18 +3461,18 @@ ${o}`;
3457
3461
  ), c = document.createElement("div");
3458
3462
  c.innerHTML = a;
3459
3463
  const d = c.firstElementChild;
3460
- d && (l.replaceWith(d), this.#Z());
3464
+ d && (l.replaceWith(d), this.#J());
3461
3465
  }
3462
3466
  }
3463
3467
  }, o = () => {
3464
- this.__lightDomColumnsCache = void 0, this.#L();
3468
+ this.__lightDomColumnsCache = void 0, this.#H();
3465
3469
  };
3466
3470
  this.#t.registerLightDomHandler("tbw-grid-header", e), this.#t.registerLightDomHandler("tbw-grid-tool-buttons", e), this.#t.registerLightDomHandler("tbw-grid-tool-panel", e), this.#t.registerLightDomHandler("tbw-grid-column", o), this.#t.registerLightDomHandler("tbw-grid-detail", o), this.#t.observeLightDOM(this);
3467
3471
  }
3468
3472
  refreshColumns() {
3469
3473
  this.__lightDomColumnsCache = void 0, j(this), this.#t.parseLightDomColumns(this);
3470
3474
  const e = this.#e.lightDomTitle, o = this.#e.hasToolButtonsContainer;
3471
- I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T());
3475
+ I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#P());
3472
3476
  const n = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
3473
3477
  if (n && !e || i && !o) {
3474
3478
  this.#t.markSourcesChanged(), this.#t.merge();
@@ -3481,12 +3485,12 @@ ${o}`;
3481
3485
  ), a = document.createElement("div");
3482
3486
  a.innerHTML = l;
3483
3487
  const c = a.firstElementChild;
3484
- c && (s.replaceWith(c), this.#Z());
3488
+ c && (s.replaceWith(c), this.#J());
3485
3489
  }
3486
3490
  }
3487
3491
  this.#s.requestPhase(T.COLUMNS, "refreshColumns");
3488
3492
  }
3489
- #K(e) {
3493
+ #Q(e) {
3490
3494
  const o = this._virtualization.rowHeight, n = this._virtualization.container ?? this, i = this._virtualization.viewportEl ?? n, r = n.clientHeight, s = i.clientHeight, a = this.shadowRoot?.querySelector(".tbw-scroll-area"), c = a ? a.clientHeight : r, u = c - s, p = this.#o?.getExtraHeight() ?? 0, f = Math.max(0, r - c);
3491
3495
  return e * o + u + p + f;
3492
3496
  }
@@ -3494,11 +3498,11 @@ ${o}`;
3494
3498
  if (!this._bodyEl) return;
3495
3499
  const n = this._rows.length;
3496
3500
  if (!this._virtualization.enabled) {
3497
- this.#X(0, n), o || this.#o?.afterRender();
3501
+ this.#Y(0, n), o || this.#o?.afterRender();
3498
3502
  return;
3499
3503
  }
3500
3504
  if (this._rows.length <= this._virtualization.bypassThreshold) {
3501
- this._virtualization.start = 0, this._virtualization.end = n, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#X(0, n, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#K(n)}px`), this.#de(n, this._visibleColumns.length), o || this.#o?.afterRender();
3505
+ this._virtualization.start = 0, this._virtualization.end = n, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#Y(0, n, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#Q(n)}px`), this.#de(n, this._visibleColumns.length), o || this.#o?.afterRender();
3502
3506
  return;
3503
3507
  }
3504
3508
  const i = this._virtualization.container ?? this, r = this._virtualization.viewportEl ?? i, s = r.clientHeight, l = this._virtualization.rowHeight, a = i.scrollTop;
@@ -3518,31 +3522,31 @@ ${o}`;
3518
3522
  this.#s.requestPhase(T.VIRTUALIZATION, "stale-refs-retry");
3519
3523
  return;
3520
3524
  }
3521
- const w = this.#K(n);
3525
+ const w = this.#Q(n);
3522
3526
  this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${w}px`);
3523
- const b = this.#o?.getExtraHeightBefore?.(c) ?? 0, S = -(a - c * l - b);
3524
- this._bodyEl.style.transform = `translateY(${S}px)`, this.#X(c, g, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this.#de(n, this._visibleColumns.length), e && !o && (this.#o?.afterRender(), queueMicrotask(() => {
3527
+ const v = this.#o?.getExtraHeightBefore?.(c) ?? 0, S = -(a - c * l - v);
3528
+ this._bodyEl.style.transform = `translateY(${S}px)`, this.#Y(c, g, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this.#de(n, this._visibleColumns.length), e && !o && (this.#o?.afterRender(), queueMicrotask(() => {
3525
3529
  const C = i.clientHeight, _ = r.clientHeight;
3526
3530
  if (C === 0 && _ > 0) return;
3527
- const A = this.#K(n);
3531
+ const A = this.#Q(n);
3528
3532
  this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${A}px`);
3529
3533
  }));
3530
3534
  }
3531
- #Q() {
3532
- I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T()), this.#t.markSourcesChanged(), this.#t.merge();
3535
+ #Z() {
3536
+ I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#P()), this.#t.markSourcesChanged(), this.#t.merge();
3533
3537
  const e = this.#n?.shell;
3534
3538
  Kt(
3535
3539
  this.#i,
3536
3540
  e,
3537
3541
  { isPanelOpen: this.#e.isPanelOpen, expandedSections: this.#e.expandedSections },
3538
3542
  this.#n?.icons
3539
- ) && (this.#Z(), this.#c.setInitialized(!0));
3543
+ ) && (this.#J(), this.#c.setInitialized(!0));
3540
3544
  }
3541
- #Z() {
3545
+ #J() {
3542
3546
  Vt(this.#i, this.#n?.shell, this.#e, {
3543
3547
  onPanelToggle: () => this.toggleToolPanel(),
3544
3548
  onSectionToggle: (e) => this.toggleToolPanelSection(e)
3545
- }), this.#z?.(), this.#z = Bt(this.#i, this.#n?.shell, (e) => {
3549
+ }), this.#k?.(), this.#k = Bt(this.#i, this.#n?.shell, (e) => {
3546
3550
  this.style.setProperty("--tbw-tool-panel-width", `${e}px`);
3547
3551
  });
3548
3552
  }
@@ -3556,7 +3560,7 @@ const go = {
3556
3560
  class wo {
3557
3561
  static dependencies;
3558
3562
  static manifest;
3559
- version = "1.10.0";
3563
+ version = "1.10.1";
3560
3564
  styles;
3561
3565
  cellRenderers;
3562
3566
  headerRenderers;