@toolbox-web/grid 0.4.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +2 -3
  2. package/all.js +1063 -1024
  3. package/all.js.map +1 -1
  4. package/index.js +1078 -912
  5. package/index.js.map +1 -1
  6. package/lib/core/grid.d.ts +28 -0
  7. package/lib/core/grid.d.ts.map +1 -1
  8. package/lib/core/internal/dom-builder.d.ts +2 -0
  9. package/lib/core/internal/dom-builder.d.ts.map +1 -1
  10. package/lib/core/internal/event-delegation.d.ts +21 -0
  11. package/lib/core/internal/event-delegation.d.ts.map +1 -1
  12. package/lib/core/internal/header.d.ts.map +1 -1
  13. package/lib/core/internal/resize.d.ts.map +1 -1
  14. package/lib/core/internal/rows.d.ts +1 -1
  15. package/lib/core/internal/rows.d.ts.map +1 -1
  16. package/lib/core/internal/shell.d.ts +19 -13
  17. package/lib/core/internal/shell.d.ts.map +1 -1
  18. package/lib/core/plugin/base-plugin.d.ts +13 -2
  19. package/lib/core/plugin/base-plugin.d.ts.map +1 -1
  20. package/lib/core/plugin/expander-column.d.ts.map +1 -1
  21. package/lib/core/plugin/plugin-manager.d.ts +6 -2
  22. package/lib/core/plugin/plugin-manager.d.ts.map +1 -1
  23. package/lib/core/types.d.ts +41 -3
  24. package/lib/core/types.d.ts.map +1 -1
  25. package/lib/plugins/clipboard/index.js +22 -11
  26. package/lib/plugins/clipboard/index.js.map +1 -1
  27. package/lib/plugins/column-virtualization/index.js +59 -48
  28. package/lib/plugins/column-virtualization/index.js.map +1 -1
  29. package/lib/plugins/context-menu/index.js +71 -60
  30. package/lib/plugins/context-menu/index.js.map +1 -1
  31. package/lib/plugins/editing/EditingPlugin.d.ts +1 -0
  32. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  33. package/lib/plugins/editing/index.js +93 -80
  34. package/lib/plugins/editing/index.js.map +1 -1
  35. package/lib/plugins/export/index.js +29 -18
  36. package/lib/plugins/export/index.js.map +1 -1
  37. package/lib/plugins/filtering/FilteringPlugin.d.ts +9 -1
  38. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  39. package/lib/plugins/filtering/index.js +199 -165
  40. package/lib/plugins/filtering/index.js.map +1 -1
  41. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +1 -0
  42. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -1
  43. package/lib/plugins/grouping-columns/index.js +79 -49
  44. package/lib/plugins/grouping-columns/index.js.map +1 -1
  45. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
  46. package/lib/plugins/grouping-rows/index.js +98 -87
  47. package/lib/plugins/grouping-rows/index.js.map +1 -1
  48. package/lib/plugins/master-detail/index.js +70 -57
  49. package/lib/plugins/master-detail/index.js.map +1 -1
  50. package/lib/plugins/multi-sort/index.js +48 -37
  51. package/lib/plugins/multi-sort/index.js.map +1 -1
  52. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -1
  53. package/lib/plugins/pinned-columns/index.js +71 -66
  54. package/lib/plugins/pinned-columns/index.js.map +1 -1
  55. package/lib/plugins/pinned-columns/pinned-columns.d.ts +2 -2
  56. package/lib/plugins/pinned-columns/pinned-columns.d.ts.map +1 -1
  57. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
  58. package/lib/plugins/pinned-rows/index.js +63 -52
  59. package/lib/plugins/pinned-rows/index.js.map +1 -1
  60. package/lib/plugins/pivot/PivotPlugin.d.ts.map +1 -1
  61. package/lib/plugins/pivot/index.js +310 -299
  62. package/lib/plugins/pivot/index.js.map +1 -1
  63. package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
  64. package/lib/plugins/reorder/index.d.ts +1 -1
  65. package/lib/plugins/reorder/index.d.ts.map +1 -1
  66. package/lib/plugins/reorder/index.js +79 -68
  67. package/lib/plugins/reorder/index.js.map +1 -1
  68. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  69. package/lib/plugins/selection/index.js +115 -105
  70. package/lib/plugins/selection/index.js.map +1 -1
  71. package/lib/plugins/server-side/index.js +15 -4
  72. package/lib/plugins/server-side/index.js.map +1 -1
  73. package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
  74. package/lib/plugins/tree/index.js +41 -30
  75. package/lib/plugins/tree/index.js.map +1 -1
  76. package/lib/plugins/undo-redo/index.js +29 -18
  77. package/lib/plugins/undo-redo/index.js.map +1 -1
  78. package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +1 -1
  79. package/lib/plugins/visibility/index.js +59 -47
  80. package/lib/plugins/visibility/index.js.map +1 -1
  81. package/package.json +6 -6
  82. package/public.d.ts +42 -0
  83. package/public.d.ts.map +1 -1
  84. package/themes/dg-theme-bootstrap.css +55 -53
  85. package/themes/dg-theme-contrast.css +42 -40
  86. package/themes/dg-theme-large.css +38 -37
  87. package/themes/dg-theme-material.css +54 -52
  88. package/themes/dg-theme-standard.css +19 -17
  89. package/themes/dg-theme-vibrant.css +16 -14
  90. package/umd/grid.all.umd.js +23 -22
  91. package/umd/grid.all.umd.js.map +1 -1
  92. package/umd/grid.umd.js +15 -14
  93. package/umd/grid.umd.js.map +1 -1
  94. package/umd/plugins/column-virtualization.umd.js +1 -1
  95. package/umd/plugins/column-virtualization.umd.js.map +1 -1
  96. package/umd/plugins/context-menu.umd.js +1 -1
  97. package/umd/plugins/context-menu.umd.js.map +1 -1
  98. package/umd/plugins/editing.umd.js +1 -1
  99. package/umd/plugins/editing.umd.js.map +1 -1
  100. package/umd/plugins/filtering.umd.js +1 -1
  101. package/umd/plugins/filtering.umd.js.map +1 -1
  102. package/umd/plugins/grouping-columns.umd.js +1 -1
  103. package/umd/plugins/grouping-columns.umd.js.map +1 -1
  104. package/umd/plugins/grouping-rows.umd.js +1 -1
  105. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  106. package/umd/plugins/master-detail.umd.js +1 -1
  107. package/umd/plugins/master-detail.umd.js.map +1 -1
  108. package/umd/plugins/multi-sort.umd.js +1 -1
  109. package/umd/plugins/multi-sort.umd.js.map +1 -1
  110. package/umd/plugins/pinned-columns.umd.js +1 -1
  111. package/umd/plugins/pinned-columns.umd.js.map +1 -1
  112. package/umd/plugins/pinned-rows.umd.js +1 -1
  113. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  114. package/umd/plugins/pivot.umd.js +1 -1
  115. package/umd/plugins/pivot.umd.js.map +1 -1
  116. package/umd/plugins/reorder.umd.js +1 -1
  117. package/umd/plugins/reorder.umd.js.map +1 -1
  118. package/umd/plugins/selection.umd.js +1 -1
  119. package/umd/plugins/selection.umd.js.map +1 -1
  120. package/umd/plugins/tree.umd.js +1 -1
  121. package/umd/plugins/tree.umd.js.map +1 -1
  122. package/umd/plugins/visibility.umd.js +1 -1
  123. package/umd/plugins/visibility.umd.js.map +1 -1
@@ -1,4 +1,4 @@
1
- const R = /{{\s*([^}]+)\s*}}/g, u = "__DG_EMPTY__", b = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, E = /__(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/, v = /* @__PURE__ */ new Set([
1
+ const x = /{{\s*([^}]+)\s*}}/g, u = "__DG_EMPTY__", R = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, E = /__(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/, v = /* @__PURE__ */ new Set([
2
2
  "script",
3
3
  "iframe",
4
4
  "object",
@@ -23,7 +23,7 @@ const R = /{{\s*([^}]+)\s*}}/g, u = "__DG_EMPTY__", b = /^[\w$. '?+\-*/%:()!<>=,
23
23
  "plaintext",
24
24
  "xmp",
25
25
  "listing"
26
- ]), h = /^on\w+$/i, y = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), C = /^\s*(javascript|vbscript|data|blob):/i;
26
+ ]), g = /^on\w+$/i, y = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), C = /^\s*(javascript|vbscript|data|blob):/i;
27
27
  function _(n) {
28
28
  if (!n || typeof n != "string") return "";
29
29
  if (n.indexOf("<") === -1) return n;
@@ -33,29 +33,29 @@ function _(n) {
33
33
  function A(n) {
34
34
  const e = [], t = n.querySelectorAll("*");
35
35
  for (const i of t) {
36
- const r = i.tagName.toLowerCase();
37
- if (v.has(r)) {
36
+ const s = i.tagName.toLowerCase();
37
+ if (v.has(s)) {
38
38
  e.push(i);
39
39
  continue;
40
40
  }
41
- if ((r === "svg" || i.namespaceURI === "http://www.w3.org/2000/svg") && Array.from(i.attributes).some(
42
- (s) => h.test(s.name) || s.name === "href" || s.name === "xlink:href"
41
+ if ((s === "svg" || i.namespaceURI === "http://www.w3.org/2000/svg") && Array.from(i.attributes).some(
42
+ (r) => g.test(r.name) || r.name === "href" || r.name === "xlink:href"
43
43
  )) {
44
44
  e.push(i);
45
45
  continue;
46
46
  }
47
47
  const l = [];
48
48
  for (const o of i.attributes) {
49
- const s = o.name.toLowerCase();
50
- if (h.test(s)) {
49
+ const r = o.name.toLowerCase();
50
+ if (g.test(r)) {
51
51
  l.push(o.name);
52
52
  continue;
53
53
  }
54
- if (y.has(s) && C.test(o.value)) {
54
+ if (y.has(r) && C.test(o.value)) {
55
55
  l.push(o.name);
56
56
  continue;
57
57
  }
58
- if (s === "style" && /expression\s*\(|javascript:|behavior\s*:/i.test(o.value)) {
58
+ if (r === "style" && /expression\s*\(|javascript:|behavior\s*:/i.test(o.value)) {
59
59
  l.push(o.name);
60
60
  continue;
61
61
  }
@@ -66,24 +66,24 @@ function A(n) {
66
66
  }
67
67
  function D(n, e) {
68
68
  if (!n || n.indexOf("{{") === -1) return n;
69
- const t = [], i = n.replace(R, (s, a) => {
69
+ const t = [], i = n.replace(x, (r, a) => {
70
70
  const d = S(a, e);
71
71
  return t.push({ expr: a.trim(), result: d }), d;
72
- }), r = L(i), l = t.length && t.every((s) => s.result === "" || s.result === u);
73
- return /Reflect\.|\bProxy\b|ownKeys\(/.test(n) || l ? "" : r;
72
+ }), s = L(i), l = t.length && t.every((r) => r.result === "" || r.result === u);
73
+ return /Reflect\.|\bProxy\b|ownKeys\(/.test(n) || l ? "" : s;
74
74
  }
75
75
  function S(n, e) {
76
76
  if (n = (n || "").trim(), !n || /\b(Reflect|Proxy|ownKeys)\b/.test(n)) return u;
77
77
  if (n === "value") return e.value == null ? u : String(e.value);
78
78
  if (n.startsWith("row.") && !/[()?]/.test(n) && !n.includes(":")) {
79
- const i = n.slice(4), r = e.row ? e.row[i] : void 0;
80
- return r == null ? u : String(r);
79
+ const i = n.slice(4), s = e.row ? e.row[i] : void 0;
80
+ return s == null ? u : String(s);
81
81
  }
82
- if (n.length > 80 || !b.test(n) || E.test(n)) return u;
82
+ if (n.length > 80 || !R.test(n) || E.test(n)) return u;
83
83
  const t = n.match(/\./g);
84
84
  if (t && t.length > 1) return u;
85
85
  try {
86
- const r = new Function("value", "row", `return (${n});`)(e.value, e.row), l = r == null ? "" : String(r);
86
+ const s = new Function("value", "row", `return (${n});`)(e.value, e.row), l = s == null ? "" : String(s);
87
87
  return /Reflect|Proxy|ownKeys/.test(l) ? u : l || u;
88
88
  } catch {
89
89
  return u;
@@ -279,10 +279,21 @@ class T {
279
279
  return this.grid;
280
280
  }
281
281
  /**
282
- * Get the shadow root of the grid.
282
+ * Get the render root of the grid for DOM queries.
283
+ * @deprecated Use `gridElement` instead. This getter exists only for backward compatibility.
284
+ *
285
+ * With Shadow DOM removed, the grid element itself is the render root.
286
+ * All new code should use `this.gridElement` for DOM queries.
287
+ *
288
+ * @example
289
+ * // OLD (deprecated)
290
+ * const rows = this.shadowRoot?.querySelector('.rows');
291
+ *
292
+ * // NEW (preferred)
293
+ * const rows = this.gridElement.querySelector('.rows');
283
294
  */
284
295
  get shadowRoot() {
285
- return this.grid?.shadowRoot ?? null;
296
+ return this.gridElement;
286
297
  }
287
298
  /**
288
299
  * Get the disconnect signal for event listener cleanup.
@@ -333,7 +344,7 @@ class T {
333
344
  const e = this.grid?.effectiveConfig?.animation?.mode ?? "reduced-motion";
334
345
  if (e === !1 || e === "off") return !1;
335
346
  if (e === !0 || e === "on") return !0;
336
- const t = this.shadowRoot?.host;
347
+ const t = this.gridElement;
337
348
  return t ? getComputedStyle(t).getPropertyValue("--tbw-animation-enabled").trim() !== "0" : !0;
338
349
  }
339
350
  /**
@@ -349,7 +360,7 @@ class T {
349
360
  * ```
350
361
  */
351
362
  get animationDuration() {
352
- const e = this.shadowRoot?.host;
363
+ const e = this.gridElement;
353
364
  if (e) {
354
365
  const t = getComputedStyle(e).getPropertyValue("--tbw-animation-duration").trim(), i = parseInt(t, 10);
355
366
  if (!isNaN(i)) return i;
@@ -401,6 +412,8 @@ function O(n) {
401
412
  width: H,
402
413
  resizable: !1,
403
414
  sortable: !1,
415
+ filterable: !1,
416
+ // No filter button for expander column
404
417
  meta: {
405
418
  lockPosition: !0,
406
419
  suppressMovable: !0,
@@ -411,7 +424,7 @@ function O(n) {
411
424
  }
412
425
  };
413
426
  }
414
- function g(n, e) {
427
+ function h(n, e) {
415
428
  const t = new Set(n);
416
429
  return t.has(e) ? t.delete(e) : t.add(e), t;
417
430
  }
@@ -427,14 +440,14 @@ function P(n, e) {
427
440
  return n.has(e);
428
441
  }
429
442
  function M(n, e, t, i) {
430
- const r = document.createElement("div");
431
- r.className = "master-detail-row", r.setAttribute("data-detail-for", String(e)), r.setAttribute("role", "row");
443
+ const s = document.createElement("div");
444
+ s.className = "master-detail-row", s.setAttribute("data-detail-for", String(e)), s.setAttribute("role", "row");
432
445
  const l = document.createElement("div");
433
446
  l.className = "master-detail-cell", l.setAttribute("role", "cell"), l.style.gridColumn = `1 / ${i + 1}`;
434
447
  const o = t(n, e);
435
- return typeof o == "string" ? l.innerHTML = o : o instanceof HTMLElement && l.appendChild(o), r.appendChild(l), r;
448
+ return typeof o == "string" ? l.innerHTML = o : o instanceof HTMLElement && l.appendChild(o), s.appendChild(l), s;
436
449
  }
437
- const F = ".cell[data-field=__tbw_expander]{border-right:none!important;padding:0;display:flex;align-items:center;justify-content:center}.header-row .cell[data-field=__tbw_expander]{visibility:hidden;border:none!important;padding:0;overflow:hidden}.header-row .cell[data-field=__tbw_expander]+.cell{margin-left:-32px;padding-left:calc(var(--tbw-cell-padding, 8px) + 32px)}.master-detail-expander{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.master-detail-toggle{cursor:pointer;opacity:.7;-webkit-user-select:none;user-select:none;display:inline-flex;align-items:center;justify-content:center}.master-detail-toggle:hover{opacity:1}.master-detail-row{grid-column:1 / -1;display:grid;background:var(--tbw-master-detail-bg, var(--tbw-color-row-alt));border-bottom:1px solid var(--tbw-master-detail-border, var(--tbw-color-border));overflow:hidden}.master-detail-cell{padding:16px;overflow:auto}.master-detail-row.tbw-expanding{animation:tbw-detail-expand var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}.master-detail-row.tbw-collapsing{animation:tbw-detail-collapse var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-detail-expand{0%{opacity:0;max-height:0;padding-top:0;padding-bottom:0}to{opacity:1;max-height:500px;padding-top:16px;padding-bottom:16px}}@keyframes tbw-detail-collapse{0%{opacity:1;max-height:500px}to{opacity:0;max-height:0}}";
450
+ const F = "@layer tbw-plugins{tbw-grid .cell[data-field=__tbw_expander]{border-right:none!important;padding:0;display:flex;align-items:center;justify-content:center}tbw-grid .header-row .cell[data-field=__tbw_expander]{display:none}tbw-grid .header-row .cell[data-field=__tbw_expander]+.cell{grid-column:1 / 3}tbw-grid .master-detail-expander{display:flex;align-items:center;justify-content:center;width:100%;height:100%}tbw-grid .master-detail-toggle{cursor:pointer;opacity:.7;-webkit-user-select:none;user-select:none;display:inline-flex;align-items:center;justify-content:center}tbw-grid .master-detail-toggle:hover{opacity:1}tbw-grid .master-detail-row{grid-column:1 / -1;display:grid;background:var(--tbw-master-detail-bg, var(--tbw-color-row-alt));border-bottom:1px solid var(--tbw-master-detail-border, var(--tbw-color-border));overflow:hidden}tbw-grid .master-detail-cell{padding:var(--tbw-detail-padding, var(--tbw-spacing-xl, 1rem));overflow:auto}tbw-grid .master-detail-row.tbw-expanding{animation:tbw-detail-expand var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}tbw-grid .master-detail-row.tbw-collapsing{animation:tbw-detail-collapse var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-detail-expand{0%{opacity:0;max-height:0;padding-top:0;padding-bottom:0}to{opacity:1;max-height:var(--tbw-detail-max-height, 31.25rem);padding-top:var(--tbw-detail-padding, var(--tbw-spacing-xl, 1rem));padding-bottom:var(--tbw-detail-padding, var(--tbw-spacing-xl, 1rem))}}@keyframes tbw-detail-collapse{0%{opacity:1;max-height:var(--tbw-detail-max-height, 31.25rem)}to{opacity:0;max-height:0}}}";
438
451
  class w extends T {
439
452
  name = "masterDetail";
440
453
  styles = F;
@@ -491,12 +504,12 @@ class w extends T {
491
504
  return;
492
505
  }
493
506
  }
494
- const r = t.getAttribute("animation"), l = t.getAttribute("show-expand-column"), o = t.getAttribute("expand-on-row-click"), s = t.getAttribute("collapse-on-click-outside"), a = t.getAttribute("height"), d = {};
495
- r !== null && (d.animation = r === "false" ? !1 : r), l !== null && (d.showExpandColumn = l !== "false"), o !== null && (d.expandOnRowClick = o === "true"), s !== null && (d.collapseOnClickOutside = s === "true"), a !== null && (d.detailHeight = a === "auto" ? "auto" : parseInt(a, 10));
507
+ const s = t.getAttribute("animation"), l = t.getAttribute("show-expand-column"), o = t.getAttribute("expand-on-row-click"), r = t.getAttribute("collapse-on-click-outside"), a = t.getAttribute("height"), d = {};
508
+ s !== null && (d.animation = s === "false" ? !1 : s), l !== null && (d.showExpandColumn = l !== "false"), o !== null && (d.expandOnRowClick = o === "true"), r !== null && (d.collapseOnClickOutside = r === "true"), a !== null && (d.detailHeight = a === "auto" ? "auto" : parseInt(a, 10));
496
509
  const c = t.innerHTML.trim();
497
510
  c && !this.config.detailRenderer && (d.detailRenderer = (f, G) => {
498
- const x = D(c, { value: f, row: f });
499
- return _(x);
511
+ const b = D(c, { value: f, row: f });
512
+ return _(b);
500
513
  }), Object.keys(d).length > 0 && (this.config = { ...this.config, ...d });
501
514
  }
502
515
  // #endregion
@@ -551,7 +564,7 @@ class w extends T {
551
564
  * Toggle a row's detail and emit event.
552
565
  */
553
566
  toggleAndEmit(e, t) {
554
- this.expandedRows = g(this.expandedRows, e), this.emit("detail-expand", {
567
+ this.expandedRows = h(this.expandedRows, e), this.emit("detail-expand", {
555
568
  rowIndex: t,
556
569
  row: e,
557
570
  expanded: this.expandedRows.has(e)
@@ -570,13 +583,13 @@ class w extends T {
570
583
  const t = [...e];
571
584
  if (k(t))
572
585
  return t;
573
- const r = O(this.name);
574
- return r.viewRenderer = (l) => {
575
- const { row: o } = l, s = this.expandedRows.has(o), a = document.createElement("span");
586
+ const s = O(this.name);
587
+ return s.viewRenderer = (l) => {
588
+ const { row: o } = l, r = this.expandedRows.has(o), a = document.createElement("span");
576
589
  a.className = "master-detail-expander expander-cell";
577
590
  const d = document.createElement("span");
578
- return d.className = `master-detail-toggle${s ? " expanded" : ""}`, this.setIcon(d, this.resolveIcon(s ? "collapse" : "expand")), d.setAttribute("role", "button"), d.setAttribute("tabindex", "0"), d.setAttribute("aria-expanded", String(s)), d.setAttribute("aria-label", s ? "Collapse details" : "Expand details"), a.appendChild(d), a;
579
- }, [r, ...t];
591
+ return d.className = `master-detail-toggle${r ? " expanded" : ""}`, this.setIcon(d, this.resolveIcon(r ? "collapse" : "expand")), d.setAttribute("role", "button"), d.setAttribute("tabindex", "0"), d.setAttribute("aria-expanded", String(r)), d.setAttribute("aria-label", r ? "Collapse details" : "Expand details"), a.appendChild(d), a;
592
+ }, [s, ...t];
580
593
  }
581
594
  onRowClick(e) {
582
595
  if (!(!this.config.expandOnRowClick || !this.config.detailRenderer))
@@ -589,8 +602,8 @@ class w extends T {
589
602
  }
590
603
  onKeyDown(e) {
591
604
  if (e.key !== " ") return;
592
- const t = this.grid._focusCol, i = this.grid._focusRow, r = this.columns[t];
593
- if (!r || !m(r)) return;
605
+ const t = this.grid._focusCol, i = this.grid._focusRow, s = this.columns[t];
606
+ if (!s || !m(s)) return;
594
607
  const l = this.rows[i];
595
608
  if (l)
596
609
  return e.preventDefault(), this.toggleAndEmit(l, i), this.requestRenderWithFocus(), !0;
@@ -611,28 +624,28 @@ class w extends T {
611
624
  */
612
625
  #e() {
613
626
  if (!this.config.detailRenderer) return;
614
- const e = this.shadowRoot?.querySelector(".rows");
627
+ const e = this.gridElement?.querySelector(".rows");
615
628
  if (!e) return;
616
- const t = /* @__PURE__ */ new Map(), i = e.querySelectorAll(".data-grid-row"), r = this.columns.length;
629
+ const t = /* @__PURE__ */ new Map(), i = e.querySelectorAll(".data-grid-row"), s = this.columns.length;
617
630
  for (const o of i) {
618
- const s = o.querySelector(".cell[data-row]"), a = s ? parseInt(s.getAttribute("data-row") ?? "-1", 10) : -1;
631
+ const r = o.querySelector(".cell[data-row]"), a = r ? parseInt(r.getAttribute("data-row") ?? "-1", 10) : -1;
619
632
  a >= 0 && t.set(a, o);
620
633
  }
621
634
  const l = e.querySelectorAll(".master-detail-row");
622
635
  for (const o of l) {
623
- const s = parseInt(o.getAttribute("data-detail-for") ?? "-1", 10), a = s >= 0 ? this.rows[s] : void 0, d = a && this.expandedRows.has(a), c = t.has(s);
636
+ const r = parseInt(o.getAttribute("data-detail-for") ?? "-1", 10), a = r >= 0 ? this.rows[r] : void 0, d = a && this.expandedRows.has(a), c = t.has(r);
624
637
  (!d || !c) && (o.remove(), a && this.detailElements.delete(a));
625
638
  }
626
- for (const [o, s] of t) {
639
+ for (const [o, r] of t) {
627
640
  const a = this.rows[o];
628
641
  if (!a || !this.expandedRows.has(a)) continue;
629
642
  const d = this.detailElements.get(a);
630
643
  if (d) {
631
- d.previousElementSibling !== s && s.after(d);
644
+ d.previousElementSibling !== r && r.after(d);
632
645
  continue;
633
646
  }
634
- const c = M(a, o, this.config.detailRenderer, r);
635
- typeof this.config.detailHeight == "number" && (c.style.height = `${this.config.detailHeight}px`), s.after(c), this.detailElements.set(a, c), this.animateExpand(c);
647
+ const c = M(a, o, this.config.detailRenderer, s);
648
+ typeof this.config.detailHeight == "number" && (c.style.height = `${this.config.detailHeight}px`), r.after(c), this.detailElements.set(a, c), this.animateExpand(c);
636
649
  }
637
650
  }
638
651
  /**
@@ -652,8 +665,8 @@ class w extends T {
652
665
  getExtraHeightBefore(e) {
653
666
  let t = 0;
654
667
  for (const i of this.expandedRows) {
655
- const r = this.rows.indexOf(i);
656
- r >= 0 && r < e && (t += this.getDetailHeight(i));
668
+ const s = this.rows.indexOf(i);
669
+ s >= 0 && s < e && (t += this.getDetailHeight(i));
657
670
  }
658
671
  return t;
659
672
  }
@@ -663,16 +676,16 @@ class w extends T {
663
676
  */
664
677
  adjustVirtualStart(e, t, i) {
665
678
  if (this.expandedRows.size === 0) return e;
666
- const r = [];
667
- for (const s of this.expandedRows) {
668
- const a = this.rows.indexOf(s);
669
- a >= 0 && r.push({ index: a, row: s });
679
+ const s = [];
680
+ for (const r of this.expandedRows) {
681
+ const a = this.rows.indexOf(r);
682
+ a >= 0 && s.push({ index: a, row: r });
670
683
  }
671
- r.sort((s, a) => s.index - a.index);
684
+ s.sort((r, a) => r.index - a.index);
672
685
  let l = e, o = 0;
673
- for (const { index: s, row: a } of r) {
674
- const d = s * i + o, c = this.getDetailHeight(a), f = d + i + c;
675
- o += c, !(s >= e) && f > t && s < l && (l = s);
686
+ for (const { index: r, row: a } of s) {
687
+ const d = r * i + o, c = this.getDetailHeight(a), f = d + i + c;
688
+ o += c, !(r >= e) && f > t && r < l && (l = r);
676
689
  }
677
690
  return l;
678
691
  }
@@ -700,7 +713,7 @@ class w extends T {
700
713
  */
701
714
  toggle(e) {
702
715
  const t = this.rows[e];
703
- t && (this.expandedRows = g(this.expandedRows, t), this.requestRender());
716
+ t && (this.expandedRows = h(this.expandedRows, t), this.requestRender());
704
717
  }
705
718
  /**
706
719
  * Check if the detail row at the given index is expanded.