@toolbox-web/grid 0.4.1 → 0.5.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.
- package/README.md +9 -13
- package/all.js +1678 -1588
- package/all.js.map +1 -1
- package/index.js +762 -568
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +21 -0
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/config-manager.d.ts +1 -0
- package/lib/core/internal/config-manager.d.ts.map +1 -1
- package/lib/core/internal/dom-builder.d.ts +2 -0
- package/lib/core/internal/dom-builder.d.ts.map +1 -1
- package/lib/core/internal/header.d.ts.map +1 -1
- package/lib/core/internal/keyboard.d.ts.map +1 -1
- package/lib/core/internal/resize.d.ts.map +1 -1
- package/lib/core/internal/rows.d.ts.map +1 -1
- package/lib/core/internal/shell.d.ts +19 -13
- package/lib/core/internal/shell.d.ts.map +1 -1
- package/lib/core/internal/utils.d.ts +1 -0
- package/lib/core/internal/utils.d.ts.map +1 -1
- package/lib/core/plugin/base-plugin.d.ts +70 -3
- package/lib/core/plugin/base-plugin.d.ts.map +1 -1
- package/lib/core/plugin/expander-column.d.ts +51 -0
- package/lib/core/plugin/expander-column.d.ts.map +1 -0
- package/lib/core/plugin/plugin-manager.d.ts +6 -2
- package/lib/core/plugin/plugin-manager.d.ts.map +1 -1
- package/lib/core/plugin/types.d.ts +117 -1
- package/lib/core/plugin/types.d.ts.map +1 -1
- package/lib/core/types.d.ts +10 -5
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts +5 -4
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.d.ts +1 -1
- package/lib/plugins/clipboard/index.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +295 -190
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/clipboard/types.d.ts +72 -2
- package/lib/plugins/clipboard/types.d.ts.map +1 -1
- package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts +0 -1
- package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts.map +1 -1
- package/lib/plugins/column-virtualization/index.js +143 -56
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/ContextMenuPlugin.d.ts +0 -1
- package/lib/plugins/context-menu/ContextMenuPlugin.d.ts.map +1 -1
- package/lib/plugins/context-menu/index.js +189 -102
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts +2 -7
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +227 -150
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/ExportPlugin.d.ts +0 -1
- package/lib/plugins/export/ExportPlugin.d.ts.map +1 -1
- package/lib/plugins/export/index.js +184 -97
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts +14 -3
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js +296 -176
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +2 -2
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/grouping-columns.d.ts +1 -1
- package/lib/plugins/grouping-columns/grouping-columns.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/index.js +169 -61
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +14 -2
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/index.js +243 -140
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +13 -11
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
- package/lib/plugins/master-detail/index.js +278 -196
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/master-detail/types.d.ts +0 -10
- package/lib/plugins/master-detail/types.d.ts.map +1 -1
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +1 -2
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
- package/lib/plugins/multi-sort/index.js +125 -40
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +0 -1
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -1
- package/lib/plugins/pinned-columns/index.js +156 -75
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-columns/pinned-columns.d.ts +2 -2
- package/lib/plugins/pinned-columns/pinned-columns.d.ts.map +1 -1
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +1 -2
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
- package/lib/plugins/pinned-rows/index.js +202 -117
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/PivotPlugin.d.ts +26 -4
- package/lib/plugins/pivot/PivotPlugin.d.ts.map +1 -1
- package/lib/plugins/pivot/index.js +413 -314
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/pivot/pivot-rows.d.ts +2 -1
- package/lib/plugins/pivot/pivot-rows.d.ts.map +1 -1
- package/lib/plugins/reorder/ReorderPlugin.d.ts +13 -10
- package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
- package/lib/plugins/reorder/index.d.ts +1 -1
- package/lib/plugins/reorder/index.d.ts.map +1 -1
- package/lib/plugins/reorder/index.js +296 -223
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts +21 -3
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.d.ts +2 -2
- package/lib/plugins/selection/index.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +282 -141
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +24 -0
- package/lib/plugins/selection/types.d.ts.map +1 -1
- package/lib/plugins/server-side/ServerSidePlugin.d.ts +0 -1
- package/lib/plugins/server-side/ServerSidePlugin.d.ts.map +1 -1
- package/lib/plugins/server-side/index.js +96 -9
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/TreePlugin.d.ts +5 -1
- package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
- package/lib/plugins/tree/index.js +209 -113
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/tree/types.d.ts +0 -10
- package/lib/plugins/tree/types.d.ts.map +1 -1
- package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts +0 -1
- package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts.map +1 -1
- package/lib/plugins/undo-redo/index.js +98 -11
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/VisibilityPlugin.d.ts +7 -4
- package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +1 -1
- package/lib/plugins/visibility/index.js +155 -64
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/themes/dg-theme-bootstrap.css +55 -53
- package/themes/dg-theme-contrast.css +42 -40
- package/themes/dg-theme-large.css +38 -37
- package/themes/dg-theme-material.css +54 -52
- package/themes/dg-theme-standard.css +19 -17
- package/themes/dg-theme-vibrant.css +16 -14
- package/umd/grid.all.umd.js +23 -24
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +12 -11
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js +5 -7
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/column-virtualization.umd.js +1 -1
- package/umd/plugins/column-virtualization.umd.js.map +1 -1
- package/umd/plugins/context-menu.umd.js +1 -1
- package/umd/plugins/context-menu.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.umd.js.map +1 -1
- package/umd/plugins/export.umd.js +1 -1
- package/umd/plugins/export.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/grouping-columns.umd.js +1 -1
- package/umd/plugins/grouping-columns.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js +1 -1
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js +1 -1
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/multi-sort.umd.js +1 -1
- package/umd/plugins/multi-sort.umd.js.map +1 -1
- package/umd/plugins/pinned-columns.umd.js +1 -1
- package/umd/plugins/pinned-columns.umd.js.map +1 -1
- package/umd/plugins/pinned-rows.umd.js +1 -1
- package/umd/plugins/pinned-rows.umd.js.map +1 -1
- package/umd/plugins/pivot.umd.js +1 -1
- package/umd/plugins/pivot.umd.js.map +1 -1
- package/umd/plugins/reorder.umd.js +1 -1
- package/umd/plugins/reorder.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +1 -1
- package/umd/plugins/selection.umd.js.map +1 -1
- package/umd/plugins/server-side.umd.js +1 -1
- package/umd/plugins/server-side.umd.js.map +1 -1
- package/umd/plugins/tree.umd.js +1 -1
- package/umd/plugins/tree.umd.js.map +1 -1
- package/umd/plugins/undo-redo.umd.js +1 -1
- package/umd/plugins/undo-redo.umd.js.map +1 -1
- package/umd/plugins/visibility.umd.js +1 -1
- package/umd/plugins/visibility.umd.js.map +1 -1
- package/lib/core/internal/editing.d.ts +0 -76
- package/lib/core/internal/editing.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
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,76 +23,76 @@ const m = /{{\s*([^}]+)\s*}}/g, f = "__DG_EMPTY__", R = /^[\w$. '?+\-*/%:()!<>=,
|
|
|
23
23
|
"plaintext",
|
|
24
24
|
"xmp",
|
|
25
25
|
"listing"
|
|
26
|
-
]),
|
|
27
|
-
function
|
|
28
|
-
if (!
|
|
29
|
-
if (
|
|
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
|
+
function _(n) {
|
|
28
|
+
if (!n || typeof n != "string") return "";
|
|
29
|
+
if (n.indexOf("<") === -1) return n;
|
|
30
30
|
const e = document.createElement("template");
|
|
31
|
-
return e.innerHTML =
|
|
31
|
+
return e.innerHTML = n, A(e.content), e.innerHTML;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const e = [], t =
|
|
35
|
-
for (const
|
|
36
|
-
const s =
|
|
37
|
-
if (
|
|
38
|
-
e.push(
|
|
33
|
+
function A(n) {
|
|
34
|
+
const e = [], t = n.querySelectorAll("*");
|
|
35
|
+
for (const i of t) {
|
|
36
|
+
const s = i.tagName.toLowerCase();
|
|
37
|
+
if (v.has(s)) {
|
|
38
|
+
e.push(i);
|
|
39
39
|
continue;
|
|
40
40
|
}
|
|
41
|
-
if ((s === "svg" ||
|
|
42
|
-
(
|
|
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
|
-
e.push(
|
|
44
|
+
e.push(i);
|
|
45
45
|
continue;
|
|
46
46
|
}
|
|
47
|
-
const
|
|
48
|
-
for (const
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
|
|
47
|
+
const l = [];
|
|
48
|
+
for (const o of i.attributes) {
|
|
49
|
+
const r = o.name.toLowerCase();
|
|
50
|
+
if (g.test(r)) {
|
|
51
|
+
l.push(o.name);
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
55
|
-
|
|
54
|
+
if (y.has(r) && C.test(o.value)) {
|
|
55
|
+
l.push(o.name);
|
|
56
56
|
continue;
|
|
57
57
|
}
|
|
58
|
-
if (
|
|
59
|
-
|
|
58
|
+
if (r === "style" && /expression\s*\(|javascript:|behavior\s*:/i.test(o.value)) {
|
|
59
|
+
l.push(o.name);
|
|
60
60
|
continue;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
l.forEach((o) => i.removeAttribute(o));
|
|
64
64
|
}
|
|
65
|
-
e.forEach((
|
|
65
|
+
e.forEach((i) => i.remove());
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
if (!
|
|
69
|
-
const t = [],
|
|
70
|
-
const d =
|
|
71
|
-
return t.push({ expr:
|
|
72
|
-
}), s =
|
|
73
|
-
return /Reflect\.|\bProxy\b|ownKeys\(/.test(
|
|
67
|
+
function D(n, e) {
|
|
68
|
+
if (!n || n.indexOf("{{") === -1) return n;
|
|
69
|
+
const t = [], i = n.replace(x, (r, a) => {
|
|
70
|
+
const d = S(a, e);
|
|
71
|
+
return t.push({ expr: a.trim(), result: d }), d;
|
|
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
|
-
function
|
|
76
|
-
if (
|
|
77
|
-
if (
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
return s == null ?
|
|
81
|
-
}
|
|
82
|
-
if (
|
|
83
|
-
const t =
|
|
84
|
-
if (t && t.length > 1) return
|
|
75
|
+
function S(n, e) {
|
|
76
|
+
if (n = (n || "").trim(), !n || /\b(Reflect|Proxy|ownKeys)\b/.test(n)) return u;
|
|
77
|
+
if (n === "value") return e.value == null ? u : String(e.value);
|
|
78
|
+
if (n.startsWith("row.") && !/[()?]/.test(n) && !n.includes(":")) {
|
|
79
|
+
const i = n.slice(4), s = e.row ? e.row[i] : void 0;
|
|
80
|
+
return s == null ? u : String(s);
|
|
81
|
+
}
|
|
82
|
+
if (n.length > 80 || !R.test(n) || E.test(n)) return u;
|
|
83
|
+
const t = n.match(/\./g);
|
|
84
|
+
if (t && t.length > 1) return u;
|
|
85
85
|
try {
|
|
86
|
-
const s = new Function("value", "row", `return (${
|
|
87
|
-
return /Reflect|Proxy|ownKeys/.test(
|
|
86
|
+
const s = new Function("value", "row", `return (${n});`)(e.value, e.row), l = s == null ? "" : String(s);
|
|
87
|
+
return /Reflect|Proxy|ownKeys/.test(l) ? u : l || u;
|
|
88
88
|
} catch {
|
|
89
|
-
return
|
|
89
|
+
return u;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
92
|
+
function L(n) {
|
|
93
|
+
return n && n.replace(new RegExp(u, "g"), "").replace(/Reflect\.[^<>{}\s]+/g, "").replace(/\bProxy\b/g, "").replace(/ownKeys\([^)]*\)/g, "");
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const I = {
|
|
96
96
|
expand: "▶",
|
|
97
97
|
collapse: "▼",
|
|
98
98
|
sortAsc: "▲",
|
|
@@ -102,7 +102,7 @@ const H = {
|
|
|
102
102
|
dragHandle: "⋮⋮",
|
|
103
103
|
toolPanel: "☰"
|
|
104
104
|
};
|
|
105
|
-
class
|
|
105
|
+
class T {
|
|
106
106
|
/**
|
|
107
107
|
* Plugin dependencies - declare other plugins this one requires.
|
|
108
108
|
*
|
|
@@ -119,8 +119,11 @@ class _ {
|
|
|
119
119
|
* ```
|
|
120
120
|
*/
|
|
121
121
|
static dependencies;
|
|
122
|
-
/**
|
|
123
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Plugin version - defaults to grid version for built-in plugins.
|
|
124
|
+
* Third-party plugins can override with their own semver.
|
|
125
|
+
*/
|
|
126
|
+
version = typeof __GRID_VERSION__ < "u" ? __GRID_VERSION__ : "dev";
|
|
124
127
|
/** CSS styles to inject into the grid's shadow DOM */
|
|
125
128
|
styles;
|
|
126
129
|
/** Custom cell renderers keyed by type name */
|
|
@@ -207,12 +210,28 @@ class _ {
|
|
|
207
210
|
emit(e, t) {
|
|
208
211
|
this.grid?.dispatchEvent?.(new CustomEvent(e, { detail: t, bubbles: !0 }));
|
|
209
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* Emit a cancelable custom event from the grid.
|
|
215
|
+
* @returns `true` if the event was cancelled (preventDefault called), `false` otherwise
|
|
216
|
+
*/
|
|
217
|
+
emitCancelable(e, t) {
|
|
218
|
+
const i = new CustomEvent(e, { detail: t, bubbles: !0, cancelable: !0 });
|
|
219
|
+
return this.grid?.dispatchEvent?.(i), i.defaultPrevented;
|
|
220
|
+
}
|
|
210
221
|
/**
|
|
211
222
|
* Request a re-render of the grid.
|
|
212
223
|
*/
|
|
213
224
|
requestRender() {
|
|
214
225
|
this.grid?.requestRender?.();
|
|
215
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* Request a re-render and restore focus styling afterward.
|
|
229
|
+
* Use this when a plugin action (like expand/collapse) triggers a render
|
|
230
|
+
* but needs to maintain keyboard navigation focus.
|
|
231
|
+
*/
|
|
232
|
+
requestRenderWithFocus() {
|
|
233
|
+
this.grid?.requestRenderWithFocus?.();
|
|
234
|
+
}
|
|
216
235
|
/**
|
|
217
236
|
* Request a lightweight style update without rebuilding DOM.
|
|
218
237
|
* Use this instead of requestRender() when only CSS classes need updating.
|
|
@@ -247,10 +266,34 @@ class _ {
|
|
|
247
266
|
return this.grid?._visibleColumns ?? [];
|
|
248
267
|
}
|
|
249
268
|
/**
|
|
250
|
-
* Get the
|
|
269
|
+
* Get the grid as an HTMLElement for direct DOM operations.
|
|
270
|
+
* Use sparingly - prefer the typed GridElementRef API when possible.
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* ```ts
|
|
274
|
+
* const width = this.gridElement.clientWidth;
|
|
275
|
+
* this.gridElement.classList.add('my-plugin-active');
|
|
276
|
+
* ```
|
|
277
|
+
*/
|
|
278
|
+
get gridElement() {
|
|
279
|
+
return this.grid;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
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');
|
|
251
294
|
*/
|
|
252
295
|
get shadowRoot() {
|
|
253
|
-
return this.
|
|
296
|
+
return this.gridElement;
|
|
254
297
|
}
|
|
255
298
|
/**
|
|
256
299
|
* Get the disconnect signal for event listener cleanup.
|
|
@@ -278,8 +321,53 @@ class _ {
|
|
|
278
321
|
*/
|
|
279
322
|
get gridIcons() {
|
|
280
323
|
const e = this.grid?.gridConfig?.icons ?? {};
|
|
281
|
-
return { ...
|
|
324
|
+
return { ...I, ...e };
|
|
282
325
|
}
|
|
326
|
+
// #region Animation Helpers
|
|
327
|
+
/**
|
|
328
|
+
* Check if animations are enabled at the grid level.
|
|
329
|
+
* Respects gridConfig.animation.mode and the CSS variable set by the grid.
|
|
330
|
+
*
|
|
331
|
+
* Plugins should use this to skip animations when:
|
|
332
|
+
* - Animation mode is 'off' or `false`
|
|
333
|
+
* - User prefers reduced motion and mode is 'reduced-motion' (default)
|
|
334
|
+
*
|
|
335
|
+
* @example
|
|
336
|
+
* ```ts
|
|
337
|
+
* private get animationStyle(): 'slide' | 'fade' | false {
|
|
338
|
+
* if (!this.isAnimationEnabled) return false;
|
|
339
|
+
* return this.config.animation ?? 'slide';
|
|
340
|
+
* }
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
get isAnimationEnabled() {
|
|
344
|
+
const e = this.grid?.effectiveConfig?.animation?.mode ?? "reduced-motion";
|
|
345
|
+
if (e === !1 || e === "off") return !1;
|
|
346
|
+
if (e === !0 || e === "on") return !0;
|
|
347
|
+
const t = this.gridElement;
|
|
348
|
+
return t ? getComputedStyle(t).getPropertyValue("--tbw-animation-enabled").trim() !== "0" : !0;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Get the animation duration in milliseconds from CSS variable.
|
|
352
|
+
* Falls back to 200ms if not set.
|
|
353
|
+
*
|
|
354
|
+
* Plugins can use this for their animation timing to stay consistent
|
|
355
|
+
* with the grid-level animation.duration setting.
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```ts
|
|
359
|
+
* element.animate(keyframes, { duration: this.animationDuration });
|
|
360
|
+
* ```
|
|
361
|
+
*/
|
|
362
|
+
get animationDuration() {
|
|
363
|
+
const e = this.gridElement;
|
|
364
|
+
if (e) {
|
|
365
|
+
const t = getComputedStyle(e).getPropertyValue("--tbw-animation-duration").trim(), i = parseInt(t, 10);
|
|
366
|
+
if (!isNaN(i)) return i;
|
|
367
|
+
}
|
|
368
|
+
return 200;
|
|
369
|
+
}
|
|
370
|
+
// #endregion
|
|
283
371
|
/**
|
|
284
372
|
* Resolve an icon value to string or HTMLElement.
|
|
285
373
|
* Checks plugin config first, then grid-level icons, then defaults.
|
|
@@ -309,33 +397,60 @@ class _ {
|
|
|
309
397
|
}
|
|
310
398
|
// #endregion
|
|
311
399
|
}
|
|
312
|
-
|
|
313
|
-
|
|
400
|
+
const p = "__tbw_expander", H = 32;
|
|
401
|
+
function m(n) {
|
|
402
|
+
return n.field === p;
|
|
403
|
+
}
|
|
404
|
+
function k(n) {
|
|
405
|
+
return n.find(m);
|
|
406
|
+
}
|
|
407
|
+
function O(n) {
|
|
408
|
+
return {
|
|
409
|
+
field: p,
|
|
410
|
+
header: "",
|
|
411
|
+
// No header text - visually merges with next column
|
|
412
|
+
width: H,
|
|
413
|
+
resizable: !1,
|
|
414
|
+
sortable: !1,
|
|
415
|
+
filterable: !1,
|
|
416
|
+
// No filter button for expander column
|
|
417
|
+
meta: {
|
|
418
|
+
lockPosition: !0,
|
|
419
|
+
suppressMovable: !0,
|
|
420
|
+
expanderColumn: !0,
|
|
421
|
+
expanderPlugin: n,
|
|
422
|
+
utility: !0
|
|
423
|
+
// Marks this as a utility column (excluded from selection, clipboard, etc.)
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
function h(n, e) {
|
|
428
|
+
const t = new Set(n);
|
|
314
429
|
return t.has(e) ? t.delete(e) : t.add(e), t;
|
|
315
430
|
}
|
|
316
|
-
function
|
|
317
|
-
const t = new Set(
|
|
431
|
+
function N(n, e) {
|
|
432
|
+
const t = new Set(n);
|
|
318
433
|
return t.add(e), t;
|
|
319
434
|
}
|
|
320
|
-
function
|
|
321
|
-
const t = new Set(
|
|
435
|
+
function q(n, e) {
|
|
436
|
+
const t = new Set(n);
|
|
322
437
|
return t.delete(e), t;
|
|
323
438
|
}
|
|
324
|
-
function
|
|
325
|
-
return
|
|
439
|
+
function P(n, e) {
|
|
440
|
+
return n.has(e);
|
|
326
441
|
}
|
|
327
|
-
function
|
|
442
|
+
function M(n, e, t, i) {
|
|
328
443
|
const s = document.createElement("div");
|
|
329
444
|
s.className = "master-detail-row", s.setAttribute("data-detail-for", String(e)), s.setAttribute("role", "row");
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
const
|
|
333
|
-
return typeof
|
|
445
|
+
const l = document.createElement("div");
|
|
446
|
+
l.className = "master-detail-cell", l.setAttribute("role", "cell"), l.style.gridColumn = `1 / ${i + 1}`;
|
|
447
|
+
const o = t(n, e);
|
|
448
|
+
return typeof o == "string" ? l.innerHTML = o : o instanceof HTMLElement && l.appendChild(o), s.appendChild(l), s;
|
|
334
449
|
}
|
|
335
|
-
const
|
|
336
|
-
class
|
|
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}}}";
|
|
451
|
+
class w extends T {
|
|
337
452
|
name = "masterDetail";
|
|
338
|
-
|
|
453
|
+
styles = F;
|
|
339
454
|
get defaultConfig() {
|
|
340
455
|
return {
|
|
341
456
|
detailHeight: "auto",
|
|
@@ -381,52 +496,31 @@ class q extends _ {
|
|
|
381
496
|
if (!e || typeof e.querySelector != "function") return;
|
|
382
497
|
const t = e.querySelector("tbw-grid-detail");
|
|
383
498
|
if (!t) return;
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
386
|
-
const
|
|
387
|
-
if (
|
|
388
|
-
this.config = { ...this.config, detailRenderer:
|
|
499
|
+
const i = e;
|
|
500
|
+
if (i.__frameworkAdapter?.parseDetailElement) {
|
|
501
|
+
const f = i.__frameworkAdapter.parseDetailElement(t);
|
|
502
|
+
if (f) {
|
|
503
|
+
this.config = { ...this.config, detailRenderer: f };
|
|
389
504
|
return;
|
|
390
505
|
}
|
|
391
506
|
}
|
|
392
|
-
const s = t.getAttribute("animation"),
|
|
393
|
-
s !== null && (d.animation = s === "false" ? !1 : s),
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
return
|
|
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));
|
|
509
|
+
const c = t.innerHTML.trim();
|
|
510
|
+
c && !this.config.detailRenderer && (d.detailRenderer = (f, G) => {
|
|
511
|
+
const b = D(c, { value: f, row: f });
|
|
512
|
+
return _(b);
|
|
398
513
|
}), Object.keys(d).length > 0 && (this.config = { ...this.config, ...d });
|
|
399
514
|
}
|
|
400
515
|
// #endregion
|
|
401
516
|
// #region Animation Helpers
|
|
402
|
-
/**
|
|
403
|
-
* Check if animations are enabled at the grid level.
|
|
404
|
-
* Respects gridConfig.animation.mode and CSS variable.
|
|
405
|
-
*/
|
|
406
|
-
get isAnimationEnabled() {
|
|
407
|
-
const t = this.grid.effectiveConfig?.animation?.mode ?? "reduced-motion";
|
|
408
|
-
if (t === !1 || t === "off") return !1;
|
|
409
|
-
if (t === !0 || t === "on") return !0;
|
|
410
|
-
const n = this.shadowRoot?.host;
|
|
411
|
-
return n ? getComputedStyle(n).getPropertyValue("--tbw-animation-enabled").trim() !== "0" : !0;
|
|
412
|
-
}
|
|
413
517
|
/**
|
|
414
518
|
* Get expand/collapse animation style from plugin config.
|
|
519
|
+
* Uses base class isAnimationEnabled to respect grid-level settings.
|
|
415
520
|
*/
|
|
416
521
|
get animationStyle() {
|
|
417
522
|
return this.isAnimationEnabled ? this.config.animation ?? "slide" : !1;
|
|
418
523
|
}
|
|
419
|
-
/**
|
|
420
|
-
* Get animation duration from CSS variable (set by grid).
|
|
421
|
-
*/
|
|
422
|
-
get animationDuration() {
|
|
423
|
-
const e = this.shadowRoot?.host;
|
|
424
|
-
if (e) {
|
|
425
|
-
const t = getComputedStyle(e).getPropertyValue("--tbw-animation-duration").trim(), n = parseInt(t, 10);
|
|
426
|
-
if (!isNaN(n)) return n;
|
|
427
|
-
}
|
|
428
|
-
return 200;
|
|
429
|
-
}
|
|
430
524
|
/**
|
|
431
525
|
* Apply expand animation to a detail element.
|
|
432
526
|
*/
|
|
@@ -448,15 +542,34 @@ class q extends _ {
|
|
|
448
542
|
return;
|
|
449
543
|
}
|
|
450
544
|
e.classList.add("tbw-collapsing");
|
|
451
|
-
const
|
|
545
|
+
const i = () => {
|
|
452
546
|
e.classList.remove("tbw-collapsing"), t();
|
|
453
547
|
};
|
|
454
|
-
e.addEventListener("animationend",
|
|
548
|
+
e.addEventListener("animationend", i, { once: !0 }), setTimeout(i, this.animationDuration + 50);
|
|
455
549
|
}
|
|
456
550
|
// #endregion
|
|
457
551
|
// #region Internal State
|
|
458
552
|
expandedRows = /* @__PURE__ */ new Set();
|
|
459
553
|
detailElements = /* @__PURE__ */ new Map();
|
|
554
|
+
/** Default height for detail rows when not configured */
|
|
555
|
+
static DEFAULT_DETAIL_HEIGHT = 150;
|
|
556
|
+
/**
|
|
557
|
+
* Get the estimated height for a detail row.
|
|
558
|
+
*/
|
|
559
|
+
getDetailHeight(e) {
|
|
560
|
+
const t = this.detailElements.get(e);
|
|
561
|
+
return t ? t.offsetHeight : typeof this.config?.detailHeight == "number" ? this.config.detailHeight : w.DEFAULT_DETAIL_HEIGHT;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Toggle a row's detail and emit event.
|
|
565
|
+
*/
|
|
566
|
+
toggleAndEmit(e, t) {
|
|
567
|
+
this.expandedRows = h(this.expandedRows, e), this.emit("detail-expand", {
|
|
568
|
+
rowIndex: t,
|
|
569
|
+
row: e,
|
|
570
|
+
expanded: this.expandedRows.has(e)
|
|
571
|
+
}), this.requestRender();
|
|
572
|
+
}
|
|
460
573
|
// #endregion
|
|
461
574
|
// #region Lifecycle
|
|
462
575
|
detach() {
|
|
@@ -465,49 +578,36 @@ class q extends _ {
|
|
|
465
578
|
// #endregion
|
|
466
579
|
// #region Hooks
|
|
467
580
|
processColumns(e) {
|
|
468
|
-
if (!this.config.detailRenderer)
|
|
581
|
+
if (!this.config.detailRenderer || this.config.showExpandColumn === !1)
|
|
469
582
|
return [...e];
|
|
470
583
|
const t = [...e];
|
|
471
|
-
if (t
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
const h = document.createElement("span");
|
|
481
|
-
if (s) {
|
|
482
|
-
const g = s(r);
|
|
483
|
-
g instanceof Node ? h.appendChild(g) : h.textContent = String(g ?? o ?? "");
|
|
484
|
-
} else
|
|
485
|
-
h.textContent = String(o ?? "");
|
|
486
|
-
return u.appendChild(h), u;
|
|
487
|
-
};
|
|
488
|
-
a.__masterDetailWrapped = !0, n.viewRenderer = a, t[0] = n;
|
|
489
|
-
}
|
|
490
|
-
return t;
|
|
584
|
+
if (k(t))
|
|
585
|
+
return t;
|
|
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");
|
|
589
|
+
a.className = "master-detail-expander expander-cell";
|
|
590
|
+
const d = document.createElement("span");
|
|
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];
|
|
491
593
|
}
|
|
492
594
|
onRowClick(e) {
|
|
493
595
|
if (!(!this.config.expandOnRowClick || !this.config.detailRenderer))
|
|
494
|
-
return this.
|
|
495
|
-
rowIndex: e.rowIndex,
|
|
496
|
-
row: e.row,
|
|
497
|
-
expanded: this.expandedRows.has(e.row)
|
|
498
|
-
}), this.requestRender(), !1;
|
|
596
|
+
return this.toggleAndEmit(e.row, e.rowIndex), !1;
|
|
499
597
|
}
|
|
500
598
|
onCellClick(e) {
|
|
501
|
-
if (e.originalEvent?.target?.classList.contains("master-detail-toggle"))
|
|
502
|
-
|
|
503
|
-
return this.expandedRows = p(this.expandedRows, n), this.emit("detail-expand", {
|
|
504
|
-
rowIndex: s,
|
|
505
|
-
row: n,
|
|
506
|
-
expanded: this.expandedRows.has(n)
|
|
507
|
-
}), this.requestRender(), !0;
|
|
508
|
-
}
|
|
599
|
+
if (e.originalEvent?.target?.classList.contains("master-detail-toggle"))
|
|
600
|
+
return this.toggleAndEmit(e.row, e.rowIndex), !0;
|
|
509
601
|
this.expandedRows.size > 0 && queueMicrotask(() => this.#e());
|
|
510
602
|
}
|
|
603
|
+
onKeyDown(e) {
|
|
604
|
+
if (e.key !== " ") return;
|
|
605
|
+
const t = this.grid._focusCol, i = this.grid._focusRow, s = this.columns[t];
|
|
606
|
+
if (!s || !m(s)) return;
|
|
607
|
+
const l = this.rows[i];
|
|
608
|
+
if (l)
|
|
609
|
+
return e.preventDefault(), this.toggleAndEmit(l, i), this.requestRenderWithFocus(), !0;
|
|
610
|
+
}
|
|
511
611
|
afterRender() {
|
|
512
612
|
this.#e();
|
|
513
613
|
}
|
|
@@ -524,28 +624,28 @@ class q extends _ {
|
|
|
524
624
|
*/
|
|
525
625
|
#e() {
|
|
526
626
|
if (!this.config.detailRenderer) return;
|
|
527
|
-
const e = this.
|
|
627
|
+
const e = this.gridElement?.querySelector(".rows");
|
|
528
628
|
if (!e) return;
|
|
529
|
-
const t = /* @__PURE__ */ new Map(),
|
|
530
|
-
for (const
|
|
531
|
-
const
|
|
532
|
-
|
|
629
|
+
const t = /* @__PURE__ */ new Map(), i = e.querySelectorAll(".data-grid-row"), s = this.columns.length;
|
|
630
|
+
for (const o of i) {
|
|
631
|
+
const r = o.querySelector(".cell[data-row]"), a = r ? parseInt(r.getAttribute("data-row") ?? "-1", 10) : -1;
|
|
632
|
+
a >= 0 && t.set(a, o);
|
|
533
633
|
}
|
|
534
|
-
const
|
|
535
|
-
for (const
|
|
536
|
-
const
|
|
537
|
-
(!d || !
|
|
634
|
+
const l = e.querySelectorAll(".master-detail-row");
|
|
635
|
+
for (const o of l) {
|
|
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);
|
|
637
|
+
(!d || !c) && (o.remove(), a && this.detailElements.delete(a));
|
|
538
638
|
}
|
|
539
|
-
for (const [
|
|
540
|
-
const
|
|
541
|
-
if (!
|
|
542
|
-
const d = this.detailElements.get(
|
|
639
|
+
for (const [o, r] of t) {
|
|
640
|
+
const a = this.rows[o];
|
|
641
|
+
if (!a || !this.expandedRows.has(a)) continue;
|
|
642
|
+
const d = this.detailElements.get(a);
|
|
543
643
|
if (d) {
|
|
544
|
-
d.previousElementSibling !==
|
|
644
|
+
d.previousElementSibling !== r && r.after(d);
|
|
545
645
|
continue;
|
|
546
646
|
}
|
|
547
|
-
const
|
|
548
|
-
typeof this.config.detailHeight == "number" && (
|
|
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);
|
|
549
649
|
}
|
|
550
650
|
}
|
|
551
651
|
/**
|
|
@@ -554,15 +654,8 @@ class q extends _ {
|
|
|
554
654
|
*/
|
|
555
655
|
getExtraHeight() {
|
|
556
656
|
let e = 0;
|
|
557
|
-
for (const t of this.expandedRows)
|
|
558
|
-
|
|
559
|
-
if (n)
|
|
560
|
-
e += n.offsetHeight;
|
|
561
|
-
else {
|
|
562
|
-
const s = this.config?.detailHeight;
|
|
563
|
-
e += typeof s == "number" ? s : 150;
|
|
564
|
-
}
|
|
565
|
-
}
|
|
657
|
+
for (const t of this.expandedRows)
|
|
658
|
+
e += this.getDetailHeight(t);
|
|
566
659
|
return e;
|
|
567
660
|
}
|
|
568
661
|
/**
|
|
@@ -571,17 +664,9 @@ class q extends _ {
|
|
|
571
664
|
*/
|
|
572
665
|
getExtraHeightBefore(e) {
|
|
573
666
|
let t = 0;
|
|
574
|
-
for (const
|
|
575
|
-
const s = this.rows.indexOf(
|
|
576
|
-
|
|
577
|
-
const a = this.detailElements.get(n);
|
|
578
|
-
if (a)
|
|
579
|
-
t += a.offsetHeight;
|
|
580
|
-
else {
|
|
581
|
-
const r = this.config?.detailHeight;
|
|
582
|
-
t += typeof r == "number" ? r : 150;
|
|
583
|
-
}
|
|
584
|
-
}
|
|
667
|
+
for (const i of this.expandedRows) {
|
|
668
|
+
const s = this.rows.indexOf(i);
|
|
669
|
+
s >= 0 && s < e && (t += this.getDetailHeight(i));
|
|
585
670
|
}
|
|
586
671
|
return t;
|
|
587
672
|
}
|
|
@@ -589,20 +674,20 @@ class q extends _ {
|
|
|
589
674
|
* Adjust the virtualization start index to keep expanded row visible while its detail is visible.
|
|
590
675
|
* This ensures the detail scrolls smoothly out of view instead of disappearing abruptly.
|
|
591
676
|
*/
|
|
592
|
-
adjustVirtualStart(e, t,
|
|
677
|
+
adjustVirtualStart(e, t, i) {
|
|
593
678
|
if (this.expandedRows.size === 0) return e;
|
|
594
679
|
const s = [];
|
|
595
|
-
for (const
|
|
596
|
-
const
|
|
597
|
-
|
|
680
|
+
for (const r of this.expandedRows) {
|
|
681
|
+
const a = this.rows.indexOf(r);
|
|
682
|
+
a >= 0 && s.push({ index: a, row: r });
|
|
598
683
|
}
|
|
599
|
-
s.sort((
|
|
600
|
-
let
|
|
601
|
-
for (const { index:
|
|
602
|
-
const d =
|
|
603
|
-
|
|
684
|
+
s.sort((r, a) => r.index - a.index);
|
|
685
|
+
let l = e, o = 0;
|
|
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);
|
|
604
689
|
}
|
|
605
|
-
return
|
|
690
|
+
return l;
|
|
606
691
|
}
|
|
607
692
|
// #endregion
|
|
608
693
|
// #region Public API
|
|
@@ -612,7 +697,7 @@ class q extends _ {
|
|
|
612
697
|
*/
|
|
613
698
|
expand(e) {
|
|
614
699
|
const t = this.rows[e];
|
|
615
|
-
t && (this.expandedRows =
|
|
700
|
+
t && (this.expandedRows = N(this.expandedRows, t), this.requestRender());
|
|
616
701
|
}
|
|
617
702
|
/**
|
|
618
703
|
* Collapse the detail row at the given index.
|
|
@@ -620,7 +705,7 @@ class q extends _ {
|
|
|
620
705
|
*/
|
|
621
706
|
collapse(e) {
|
|
622
707
|
const t = this.rows[e];
|
|
623
|
-
t && (this.expandedRows =
|
|
708
|
+
t && (this.expandedRows = q(this.expandedRows, t), this.requestRender());
|
|
624
709
|
}
|
|
625
710
|
/**
|
|
626
711
|
* Toggle the detail row at the given index.
|
|
@@ -628,7 +713,7 @@ class q extends _ {
|
|
|
628
713
|
*/
|
|
629
714
|
toggle(e) {
|
|
630
715
|
const t = this.rows[e];
|
|
631
|
-
t && (this.expandedRows =
|
|
716
|
+
t && (this.expandedRows = h(this.expandedRows, t), this.requestRender());
|
|
632
717
|
}
|
|
633
718
|
/**
|
|
634
719
|
* Check if the detail row at the given index is expanded.
|
|
@@ -637,7 +722,7 @@ class q extends _ {
|
|
|
637
722
|
*/
|
|
638
723
|
isExpanded(e) {
|
|
639
724
|
const t = this.rows[e];
|
|
640
|
-
return t ?
|
|
725
|
+
return t ? P(this.expandedRows, t) : !1;
|
|
641
726
|
}
|
|
642
727
|
/**
|
|
643
728
|
* Expand all detail rows.
|
|
@@ -660,8 +745,8 @@ class q extends _ {
|
|
|
660
745
|
getExpandedRows() {
|
|
661
746
|
const e = [];
|
|
662
747
|
for (const t of this.expandedRows) {
|
|
663
|
-
const
|
|
664
|
-
|
|
748
|
+
const i = this.rows.indexOf(t);
|
|
749
|
+
i >= 0 && e.push(i);
|
|
665
750
|
}
|
|
666
751
|
return e;
|
|
667
752
|
}
|
|
@@ -689,11 +774,8 @@ class q extends _ {
|
|
|
689
774
|
}
|
|
690
775
|
}
|
|
691
776
|
// #endregion
|
|
692
|
-
// #region Styles
|
|
693
|
-
styles = O;
|
|
694
|
-
// #endregion
|
|
695
777
|
}
|
|
696
778
|
export {
|
|
697
|
-
|
|
779
|
+
w as MasterDetailPlugin
|
|
698
780
|
};
|
|
699
781
|
//# sourceMappingURL=index.js.map
|