@toolbox-web/grid 1.19.0 → 1.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all.js +97 -86
- package/all.js.map +1 -1
- package/index.js +367 -341
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/rows.d.ts.map +1 -1
- package/lib/core/internal/utils.d.ts +2 -2
- package/lib/core/internal/utils.d.ts.map +1 -1
- package/lib/core/plugin/types.d.ts +0 -2
- package/lib/core/plugin/types.d.ts.map +1 -1
- package/lib/core/types.d.ts +11 -0
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
- package/lib/plugins/master-detail/index.js +62 -55
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/index.js.map +1 -1
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts +3 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +179 -175
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +26 -0
- package/lib/plugins/selection/types.d.ts.map +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/umd/grid.all.umd.js +24 -24
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +11 -11
- package/umd/grid.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/selection.umd.js +2 -2
- package/umd/plugins/selection.umd.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MasterDetailPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/master-detail/MasterDetailPlugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE3G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AASrD,OAAO,KAAK,EAA+C,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AACH,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,kBAAkB,CAAC;;IACxE,gBAAgB;IAChB,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,gBAAgB;IAChB,SAAkB,MAAM,SAAU;IAElC,gBAAgB;IAChB,cAAuB,aAAa,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAUlE;IAID;;;;OAIG;IACM,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAKxC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,mBAAmB;IAqE3B;;;OAGG;IACH,OAAO,KAAK,cAAc,GAGzB;IAED;;;;;OAKG;IACH,OAAO,CAAC,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OAKG;IACM,cAAc,IAAI,MAAM;IAQjC;;;;;OAKG;IACM,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM;IAY7D;;;;;;;;OAQG;IACM,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAiBvE;;;OAGG;IACM,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IA0DxF;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAS9B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAQhC;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAW9B;;;;OAIG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAKrC;;OAEG;IACH,SAAS,IAAI,IAAI;IAQjB;;OAEG;IACH,WAAW,IAAI,IAAI;IAKnB;;;OAGG;IACH,eAAe,IAAI,MAAM,EAAE;IAS3B;;;;OAIG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAK3D;;;;;;OAMG;IACH,qBAAqB,IAAI,IAAI;CA0B9B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const y = /{{\s*([^}]+)\s*}}/g, g = "__DG_EMPTY__", D = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, S = /__(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/, H = /* @__PURE__ */ new Set([
|
|
2
2
|
"script",
|
|
3
3
|
"iframe",
|
|
4
4
|
"object",
|
|
@@ -23,23 +23,23 @@ const C = /{{\s*([^}]+)\s*}}/g, g = "__DG_EMPTY__", _ = /^[\w$. '?+\-*/%:()!<>=,
|
|
|
23
23
|
"plaintext",
|
|
24
24
|
"xmp",
|
|
25
25
|
"listing"
|
|
26
|
-
]),
|
|
27
|
-
function
|
|
26
|
+
]), x = /^on\w+$/i, T = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), L = /^\s*(javascript|vbscript|data|blob):/i;
|
|
27
|
+
function I(n) {
|
|
28
28
|
if (!n || typeof n != "string") return "";
|
|
29
29
|
if (n.indexOf("<") === -1) return n;
|
|
30
30
|
const e = document.createElement("template");
|
|
31
|
-
return e.innerHTML = n,
|
|
31
|
+
return e.innerHTML = n, k(e.content), e.innerHTML;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function k(n) {
|
|
34
34
|
const e = [], t = n.querySelectorAll("*");
|
|
35
35
|
for (const i of t) {
|
|
36
36
|
const s = i.tagName.toLowerCase();
|
|
37
|
-
if (
|
|
37
|
+
if (H.has(s)) {
|
|
38
38
|
e.push(i);
|
|
39
39
|
continue;
|
|
40
40
|
}
|
|
41
41
|
if ((s === "svg" || i.namespaceURI === "http://www.w3.org/2000/svg") && Array.from(i.attributes).some(
|
|
42
|
-
(o) =>
|
|
42
|
+
(o) => x.test(o.name) || o.name === "href" || o.name === "xlink:href"
|
|
43
43
|
)) {
|
|
44
44
|
e.push(i);
|
|
45
45
|
continue;
|
|
@@ -47,11 +47,11 @@ function L(n) {
|
|
|
47
47
|
const r = [];
|
|
48
48
|
for (const a of i.attributes) {
|
|
49
49
|
const o = a.name.toLowerCase();
|
|
50
|
-
if (
|
|
50
|
+
if (x.test(o)) {
|
|
51
51
|
r.push(a.name);
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
54
|
+
if (T.has(o) && L.test(a.value)) {
|
|
55
55
|
r.push(a.name);
|
|
56
56
|
continue;
|
|
57
57
|
}
|
|
@@ -64,36 +64,36 @@ function L(n) {
|
|
|
64
64
|
}
|
|
65
65
|
e.forEach((i) => i.remove());
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function O(n, e) {
|
|
68
68
|
if (!n || n.indexOf("{{") === -1) return n;
|
|
69
|
-
const t = [], i = n.replace(
|
|
70
|
-
const d =
|
|
69
|
+
const t = [], i = n.replace(y, (o, c) => {
|
|
70
|
+
const d = N(c, e);
|
|
71
71
|
return t.push({ expr: c.trim(), result: d }), d;
|
|
72
|
-
}), s =
|
|
73
|
-
return
|
|
72
|
+
}), s = q(i), r = t.length && t.every((o) => o.result === "" || o.result === g);
|
|
73
|
+
return w.test(n) || r ? "" : s;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
if (n = (n || "").trim(), !n ||
|
|
75
|
+
function N(n, e) {
|
|
76
|
+
if (n = (n || "").trim(), !n || w.test(n)) return g;
|
|
77
77
|
if (n === "value") return e.value == null ? g : String(e.value);
|
|
78
78
|
if (n.startsWith("row.") && !/[()?]/.test(n) && !n.includes(":")) {
|
|
79
79
|
const i = n.slice(4), s = e.row ? e.row[i] : void 0;
|
|
80
80
|
return s == null ? g : String(s);
|
|
81
81
|
}
|
|
82
|
-
if (n.length > 80 || !
|
|
82
|
+
if (n.length > 80 || !D.test(n) || S.test(n)) return g;
|
|
83
83
|
const t = n.match(/\./g);
|
|
84
84
|
if (t && t.length > 1) return g;
|
|
85
85
|
try {
|
|
86
86
|
const s = new Function("value", "row", `return (${n});`)(e.value, e.row), r = s == null ? "" : String(s);
|
|
87
|
-
return
|
|
87
|
+
return w.test(r) ? g : r || g;
|
|
88
88
|
} catch {
|
|
89
89
|
return g;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
const
|
|
93
|
-
function
|
|
92
|
+
const w = /Reflect|Proxy|ownKeys/;
|
|
93
|
+
function q(n) {
|
|
94
94
|
return n && n.replace(new RegExp(g, "g"), "").replace(/Reflect\.[^<>{}\s]+|\bProxy\b|ownKeys\([^)]*\)/g, "");
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const R = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', M = {
|
|
97
97
|
expand: "▶",
|
|
98
98
|
collapse: "▼",
|
|
99
99
|
sortAsc: "▲",
|
|
@@ -102,11 +102,11 @@ const x = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentCo
|
|
|
102
102
|
submenuArrow: "▶",
|
|
103
103
|
dragHandle: "⋮⋮",
|
|
104
104
|
toolPanel: "☰",
|
|
105
|
-
filter:
|
|
106
|
-
filterActive:
|
|
105
|
+
filter: R,
|
|
106
|
+
filterActive: R,
|
|
107
107
|
print: "🖨️"
|
|
108
108
|
};
|
|
109
|
-
class
|
|
109
|
+
class P {
|
|
110
110
|
/**
|
|
111
111
|
* Plugin dependencies - declare other plugins this one requires.
|
|
112
112
|
*
|
|
@@ -396,7 +396,7 @@ class M {
|
|
|
396
396
|
*/
|
|
397
397
|
get gridIcons() {
|
|
398
398
|
const e = this.grid?.gridConfig?.icons ?? {};
|
|
399
|
-
return { ...
|
|
399
|
+
return { ...M, ...e };
|
|
400
400
|
}
|
|
401
401
|
// #region Animation Helpers
|
|
402
402
|
/**
|
|
@@ -472,19 +472,19 @@ class M {
|
|
|
472
472
|
}
|
|
473
473
|
// #endregion
|
|
474
474
|
}
|
|
475
|
-
const
|
|
476
|
-
function
|
|
477
|
-
return n.field ===
|
|
475
|
+
const v = "__tbw_expander", F = 32;
|
|
476
|
+
function C(n) {
|
|
477
|
+
return n.field === v;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
480
|
-
return n.find(
|
|
479
|
+
function U(n) {
|
|
480
|
+
return n.find(C);
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function z(n) {
|
|
483
483
|
return {
|
|
484
|
-
field:
|
|
484
|
+
field: v,
|
|
485
485
|
header: "",
|
|
486
486
|
// No header text - visually merges with next column
|
|
487
|
-
width:
|
|
487
|
+
width: F,
|
|
488
488
|
resizable: !1,
|
|
489
489
|
sortable: !1,
|
|
490
490
|
filterable: !1,
|
|
@@ -499,22 +499,22 @@ function F(n) {
|
|
|
499
499
|
}
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function E(n, e) {
|
|
503
503
|
const t = new Set(n);
|
|
504
504
|
return t.has(e) ? t.delete(e) : t.add(e), t;
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function G(n, e) {
|
|
507
507
|
const t = new Set(n);
|
|
508
508
|
return t.add(e), t;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function W(n, e) {
|
|
511
511
|
const t = new Set(n);
|
|
512
512
|
return t.delete(e), t;
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function $(n, e) {
|
|
515
515
|
return n.has(e);
|
|
516
516
|
}
|
|
517
|
-
function
|
|
517
|
+
function j(n, e, t, i) {
|
|
518
518
|
const s = document.createElement("div");
|
|
519
519
|
s.className = "master-detail-row", s.setAttribute("data-detail-for", String(e)), s.setAttribute("role", "row");
|
|
520
520
|
const r = document.createElement("div");
|
|
@@ -522,12 +522,12 @@ function W(n, e, t, i) {
|
|
|
522
522
|
const a = t(n, e);
|
|
523
523
|
return typeof a == "string" ? r.innerHTML = a : a instanceof HTMLElement && r.appendChild(a), s.appendChild(r), s;
|
|
524
524
|
}
|
|
525
|
-
const
|
|
526
|
-
class A extends
|
|
525
|
+
const B = "@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}}}";
|
|
526
|
+
class A extends P {
|
|
527
527
|
/** @internal */
|
|
528
528
|
name = "masterDetail";
|
|
529
529
|
/** @internal */
|
|
530
|
-
styles =
|
|
530
|
+
styles = B;
|
|
531
531
|
/** @internal */
|
|
532
532
|
get defaultConfig() {
|
|
533
533
|
return {
|
|
@@ -589,8 +589,8 @@ class A extends M {
|
|
|
589
589
|
s !== null && (d.animation = s === "false" ? !1 : s), r !== null && (d.showExpandColumn = r !== "false"), a !== null && (d.expandOnRowClick = a === "true"), o !== null && (d.collapseOnClickOutside = o === "true"), c !== null && (d.detailHeight = c === "auto" ? "auto" : parseInt(c, 10));
|
|
590
590
|
const l = t.innerHTML.trim();
|
|
591
591
|
l && !this.config.detailRenderer && (d.detailRenderer = (u, h) => {
|
|
592
|
-
const f =
|
|
593
|
-
return
|
|
592
|
+
const f = O(l, { value: u, row: u });
|
|
593
|
+
return I(f);
|
|
594
594
|
}), Object.keys(d).length > 0 && (this.config = { ...this.config, ...d });
|
|
595
595
|
}
|
|
596
596
|
// #endregion
|
|
@@ -673,7 +673,7 @@ class A extends M {
|
|
|
673
673
|
* Toggle a row's detail and emit event.
|
|
674
674
|
*/
|
|
675
675
|
toggleAndEmit(e, t) {
|
|
676
|
-
this.expandedRows =
|
|
676
|
+
this.expandedRows = E(this.expandedRows, e);
|
|
677
677
|
const i = this.expandedRows.has(e);
|
|
678
678
|
i && this.rowsToAnimate.add(e), this.emit("detail-expand", {
|
|
679
679
|
rowIndex: t,
|
|
@@ -694,9 +694,9 @@ class A extends M {
|
|
|
694
694
|
if (!(this.config.showExpandColumn === !0 || this.config.showExpandColumn !== !1 && !!this.config.detailRenderer))
|
|
695
695
|
return [...e];
|
|
696
696
|
const i = [...e];
|
|
697
|
-
if (
|
|
697
|
+
if (U(i))
|
|
698
698
|
return i;
|
|
699
|
-
const r =
|
|
699
|
+
const r = z(this.name);
|
|
700
700
|
return r.viewRenderer = (a) => {
|
|
701
701
|
const { row: o } = a, c = this.expandedRows.has(o), d = document.createElement("span");
|
|
702
702
|
d.className = "master-detail-expander expander-cell";
|
|
@@ -719,7 +719,7 @@ class A extends M {
|
|
|
719
719
|
onKeyDown(e) {
|
|
720
720
|
if (e.key !== " ") return;
|
|
721
721
|
const t = this.grid._focusCol, i = this.grid._focusRow, s = this.columns[t];
|
|
722
|
-
if (!s || !
|
|
722
|
+
if (!s || !C(s)) return;
|
|
723
723
|
const r = this.rows[i];
|
|
724
724
|
if (r)
|
|
725
725
|
return e.preventDefault(), this.toggleAndEmit(r, i), this.requestRenderWithFocus(), !0;
|
|
@@ -764,7 +764,14 @@ class A extends M {
|
|
|
764
764
|
}
|
|
765
765
|
for (const [l, u] of this.detailElements) {
|
|
766
766
|
const h = this.rows.indexOf(l), f = this.expandedRows.has(l), m = h >= 0 && d.has(h);
|
|
767
|
-
(!f || !m)
|
|
767
|
+
if (!f || !m) {
|
|
768
|
+
const p = this.grid.__frameworkAdapter;
|
|
769
|
+
if (p?.unmount) {
|
|
770
|
+
const b = u.querySelector(".master-detail-cell")?.firstElementChild;
|
|
771
|
+
b && p.unmount(b);
|
|
772
|
+
}
|
|
773
|
+
u.parentNode && u.remove(), this.detailElements.delete(l);
|
|
774
|
+
}
|
|
768
775
|
}
|
|
769
776
|
for (const [l, u] of d) {
|
|
770
777
|
const h = this.rows[l];
|
|
@@ -774,10 +781,10 @@ class A extends M {
|
|
|
774
781
|
f.previousElementSibling !== u && u.after(f);
|
|
775
782
|
continue;
|
|
776
783
|
}
|
|
777
|
-
const m =
|
|
784
|
+
const m = j(h, l, this.config.detailRenderer, a);
|
|
778
785
|
typeof this.config.detailHeight == "number" && (m.style.height = `${this.config.detailHeight}px`), u.after(m), this.detailElements.set(h, m);
|
|
779
|
-
const
|
|
780
|
-
|
|
786
|
+
const p = this.rowsToAnimate.has(h);
|
|
787
|
+
p && this.rowsToAnimate.delete(h), p && this.animateExpand(m, h, l) || requestAnimationFrame(() => {
|
|
781
788
|
this.#e(m, h, l);
|
|
782
789
|
});
|
|
783
790
|
}
|
|
@@ -860,7 +867,7 @@ class A extends M {
|
|
|
860
867
|
*/
|
|
861
868
|
expand(e) {
|
|
862
869
|
const t = this.rows[e];
|
|
863
|
-
t && (this.rowsToAnimate.add(t), this.expandedRows =
|
|
870
|
+
t && (this.rowsToAnimate.add(t), this.expandedRows = G(this.expandedRows, t), this.requestRender());
|
|
864
871
|
}
|
|
865
872
|
/**
|
|
866
873
|
* Collapse the detail row at the given index.
|
|
@@ -868,7 +875,7 @@ class A extends M {
|
|
|
868
875
|
*/
|
|
869
876
|
collapse(e) {
|
|
870
877
|
const t = this.rows[e];
|
|
871
|
-
t && (this.expandedRows =
|
|
878
|
+
t && (this.expandedRows = W(this.expandedRows, t), this.requestRender());
|
|
872
879
|
}
|
|
873
880
|
/**
|
|
874
881
|
* Toggle the detail row at the given index.
|
|
@@ -876,7 +883,7 @@ class A extends M {
|
|
|
876
883
|
*/
|
|
877
884
|
toggle(e) {
|
|
878
885
|
const t = this.rows[e];
|
|
879
|
-
t && (this.expandedRows =
|
|
886
|
+
t && (this.expandedRows = E(this.expandedRows, t), this.expandedRows.has(t) && this.rowsToAnimate.add(t), this.requestRender());
|
|
880
887
|
}
|
|
881
888
|
/**
|
|
882
889
|
* Check if the detail row at the given index is expanded.
|
|
@@ -885,7 +892,7 @@ class A extends M {
|
|
|
885
892
|
*/
|
|
886
893
|
isExpanded(e) {
|
|
887
894
|
const t = this.rows[e];
|
|
888
|
-
return t ?
|
|
895
|
+
return t ? $(this.expandedRows, t) : !1;
|
|
889
896
|
}
|
|
890
897
|
/**
|
|
891
898
|
* Expand all detail rows.
|