@toolbox-web/grid 0.2.6 → 0.2.7

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 (52) hide show
  1. package/all.d.ts +434 -61
  2. package/all.js +844 -541
  3. package/all.js.map +1 -1
  4. package/index-DG2CZ_Zo.js +3229 -0
  5. package/index-DG2CZ_Zo.js.map +1 -0
  6. package/index.d.ts +210 -6
  7. package/index.js +25 -3194
  8. package/index.js.map +1 -1
  9. package/lib/plugins/clipboard/index.js.map +1 -1
  10. package/lib/plugins/column-virtualization/index.js.map +1 -1
  11. package/lib/plugins/context-menu/index.js.map +1 -1
  12. package/lib/plugins/export/index.js.map +1 -1
  13. package/lib/plugins/filtering/index.js +183 -148
  14. package/lib/plugins/filtering/index.js.map +1 -1
  15. package/lib/plugins/grouping-columns/index.js.map +1 -1
  16. package/lib/plugins/grouping-rows/index.js +116 -82
  17. package/lib/plugins/grouping-rows/index.js.map +1 -1
  18. package/lib/plugins/master-detail/index.js +139 -81
  19. package/lib/plugins/master-detail/index.js.map +1 -1
  20. package/lib/plugins/multi-sort/index.js +17 -17
  21. package/lib/plugins/multi-sort/index.js.map +1 -1
  22. package/lib/plugins/pinned-columns/index.js.map +1 -1
  23. package/lib/plugins/pinned-rows/index.js.map +1 -1
  24. package/lib/plugins/pivot/index.js +369 -337
  25. package/lib/plugins/pivot/index.js.map +1 -1
  26. package/lib/plugins/reorder/index.js +264 -91
  27. package/lib/plugins/reorder/index.js.map +1 -1
  28. package/lib/plugins/selection/index.js.map +1 -1
  29. package/lib/plugins/server-side/index.js.map +1 -1
  30. package/lib/plugins/tree/index.js +180 -169
  31. package/lib/plugins/tree/index.js.map +1 -1
  32. package/lib/plugins/undo-redo/index.js.map +1 -1
  33. package/lib/plugins/visibility/index.js.map +1 -1
  34. package/package.json +1 -1
  35. package/umd/grid.all.umd.js +21 -21
  36. package/umd/grid.all.umd.js.map +1 -1
  37. package/umd/grid.umd.js +12 -12
  38. package/umd/grid.umd.js.map +1 -1
  39. package/umd/plugins/filtering.umd.js +1 -1
  40. package/umd/plugins/filtering.umd.js.map +1 -1
  41. package/umd/plugins/grouping-rows.umd.js +1 -1
  42. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  43. package/umd/plugins/master-detail.umd.js +1 -1
  44. package/umd/plugins/master-detail.umd.js.map +1 -1
  45. package/umd/plugins/multi-sort.umd.js +1 -1
  46. package/umd/plugins/multi-sort.umd.js.map +1 -1
  47. package/umd/plugins/pivot.umd.js +1 -1
  48. package/umd/plugins/pivot.umd.js.map +1 -1
  49. package/umd/plugins/reorder.umd.js +1 -1
  50. package/umd/plugins/reorder.umd.js.map +1 -1
  51. package/umd/plugins/tree.umd.js +1 -1
  52. package/umd/plugins/tree.umd.js.map +1 -1
@@ -1,4 +1,4 @@
1
- const v = {
1
+ const S = {
2
2
  expand: "▶",
3
3
  collapse: "▼",
4
4
  sortAsc: "▲",
@@ -8,7 +8,7 @@ const v = {
8
8
  dragHandle: "⋮⋮",
9
9
  toolPanel: "☰"
10
10
  };
11
- class b {
11
+ class K {
12
12
  /** Plugin version - override in subclass if needed */
13
13
  version = "1.0.0";
14
14
  /** CSS styles to inject into the grid's shadow DOM */
@@ -133,7 +133,7 @@ class b {
133
133
  */
134
134
  get gridIcons() {
135
135
  const e = this.grid?.gridConfig?.icons ?? {};
136
- return { ...v, ...e };
136
+ return { ...S, ...e };
137
137
  }
138
138
  /**
139
139
  * Resolve an icon value to string or HTMLElement.
@@ -164,80 +164,62 @@ class b {
164
164
  }
165
165
  // #endregion
166
166
  }
167
- function w(r, e, t) {
168
- return r.id !== void 0 ? String(r.id) : t ? `${t}-${e}` : String(e);
167
+ function x(o, e, t) {
168
+ return o.id !== void 0 ? String(o.id) : t ? `${t}-${e}` : String(e);
169
169
  }
170
- function E(r, e, t, n = null, s = 0) {
171
- const o = e.childrenField ?? "children", i = [];
172
- for (let c = 0; c < r.length; c++) {
173
- const a = r[c], d = w(a, c, n), h = a[o], f = Array.isArray(h) && h.length > 0, g = t.has(d);
174
- if (i.push({
175
- key: d,
176
- data: a,
177
- depth: s,
178
- hasChildren: f,
179
- isExpanded: g,
180
- parentKey: n
181
- }), f && g) {
182
- const y = E(h, e, t, d, s + 1);
183
- i.push(...y);
184
- }
185
- }
186
- return i;
187
- }
188
- function C(r, e) {
189
- const t = new Set(r);
170
+ function w(o, e) {
171
+ const t = new Set(o);
190
172
  return t.has(e) ? t.delete(e) : t.add(e), t;
191
173
  }
192
- function x(r, e, t = null, n = 0) {
193
- const s = e.childrenField ?? "children", o = /* @__PURE__ */ new Set();
194
- for (let i = 0; i < r.length; i++) {
195
- const c = r[i], a = w(c, i, t), d = c[s];
174
+ function p(o, e, t = null, n = 0) {
175
+ const r = e.childrenField ?? "children", i = /* @__PURE__ */ new Set();
176
+ for (let s = 0; s < o.length; s++) {
177
+ const a = o[s], l = x(a, s, t), d = a[r];
196
178
  if (Array.isArray(d) && d.length > 0) {
197
- o.add(a);
198
- const h = x(d, e, a, n + 1);
199
- for (const f of h) o.add(f);
179
+ i.add(l);
180
+ const h = p(d, e, l, n + 1);
181
+ for (const u of h) i.add(u);
200
182
  }
201
183
  }
202
- return o;
184
+ return i;
203
185
  }
204
- function S() {
186
+ function R() {
205
187
  return /* @__PURE__ */ new Set();
206
188
  }
207
- function m(r, e, t, n = null, s = 0) {
208
- const o = t.childrenField ?? "children";
209
- for (let i = 0; i < r.length; i++) {
210
- const c = r[i], a = w(c, i, n);
211
- if (a === e)
212
- return [a];
213
- const d = c[o];
189
+ function b(o, e, t, n = null, r = 0) {
190
+ const i = t.childrenField ?? "children";
191
+ for (let s = 0; s < o.length; s++) {
192
+ const a = o[s], l = x(a, s, n);
193
+ if (l === e)
194
+ return [l];
195
+ const d = a[i];
214
196
  if (Array.isArray(d) && d.length > 0) {
215
- const h = m(d, e, t, a, s + 1);
197
+ const h = b(d, e, t, l, r + 1);
216
198
  if (h)
217
- return [a, ...h];
199
+ return [l, ...h];
218
200
  }
219
201
  }
220
202
  return null;
221
203
  }
222
- function I(r, e, t, n) {
223
- const s = m(r, e, t);
224
- if (!s) return n;
225
- const o = new Set(n);
226
- for (let i = 0; i < s.length - 1; i++)
227
- o.add(s[i]);
228
- return o;
204
+ function C(o, e, t, n) {
205
+ const r = b(o, e, t);
206
+ if (!r) return n;
207
+ const i = new Set(n);
208
+ for (let s = 0; s < r.length - 1; s++)
209
+ i.add(r[s]);
210
+ return i;
229
211
  }
230
- function K(r, e = "children") {
231
- if (!Array.isArray(r) || r.length === 0) return !1;
232
- for (const t of r)
212
+ function m(o, e = "children") {
213
+ if (!Array.isArray(o) || o.length === 0) return !1;
214
+ for (const t of o)
233
215
  if (t && Array.isArray(t[e]) && t[e].length > 0)
234
216
  return !0;
235
217
  return !1;
236
218
  }
237
- function D(r) {
238
- if (!Array.isArray(r) || r.length === 0) return null;
219
+ function _(o) {
220
+ if (!Array.isArray(o) || o.length === 0) return null;
239
221
  const e = ["children", "items", "nodes", "subRows", "nested"];
240
- for (const t of r)
222
+ for (const t of o)
241
223
  if (!(!t || typeof t != "object")) {
242
224
  for (const n of e)
243
225
  if (Array.isArray(t[n]) && t[n].length > 0)
@@ -245,200 +227,229 @@ function D(r) {
245
227
  }
246
228
  return null;
247
229
  }
248
- function F(r, e = "children", t = 0) {
249
- if (!Array.isArray(r) || r.length === 0) return t;
230
+ function v(o, e = "children", t = 0) {
231
+ if (!Array.isArray(o) || o.length === 0) return t;
250
232
  let n = t;
251
- for (const s of r) {
252
- if (!s) continue;
253
- const o = s[e];
254
- if (Array.isArray(o) && o.length > 0) {
255
- const i = F(o, e, t + 1);
256
- i > n && (n = i);
233
+ for (const r of o) {
234
+ if (!r) continue;
235
+ const i = r[e];
236
+ if (Array.isArray(i) && i.length > 0) {
237
+ const s = v(i, e, t + 1);
238
+ s > n && (n = s);
257
239
  }
258
240
  }
259
241
  return n;
260
242
  }
261
- function M(r, e = "children") {
262
- if (!Array.isArray(r)) return 0;
243
+ function E(o, e = "children") {
244
+ if (!Array.isArray(o)) return 0;
263
245
  let t = 0;
264
- for (const n of r) {
246
+ for (const n of o) {
265
247
  if (!n) continue;
266
248
  t++;
267
- const s = n[e];
268
- Array.isArray(s) && (t += M(s, e));
249
+ const r = n[e];
250
+ Array.isArray(r) && (t += E(r, e));
269
251
  }
270
252
  return t;
271
253
  }
272
- const k = ".tree-toggle{cursor:pointer;-webkit-user-select:none;user-select:none;transition:transform .2s}.tree-toggle:hover{color:var(--tbw-tree-accent, var(--tbw-color-accent))}";
273
- class q extends b {
254
+ const k = ".tree-cell{display:flex;align-items:center;padding-left:calc(var(--tree-depth, 0) * var(--tbw-tree-indent, 20px))}.tree-toggle{cursor:pointer;-webkit-user-select:none;user-select:none;display:inline-flex;align-items:center;justify-content:center;margin-right:4px}.tree-toggle:hover{color:var(--tbw-tree-accent, var(--tbw-color-accent))}.tree-spacer{width:14px;display:inline-block}.data-grid-row.tbw-tree-slide-in{animation:tbw-tree-slide-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-tree-slide-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}.data-grid-row.tbw-tree-fade-in{animation:tbw-tree-fade-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-tree-fade-in{0%{opacity:0}to{opacity:1}}";
255
+ class T extends K {
274
256
  name = "tree";
275
257
  version = "1.0.0";
258
+ styles = k;
276
259
  get defaultConfig() {
277
260
  return {
278
261
  childrenField: "children",
279
262
  autoDetect: !0,
280
263
  defaultExpanded: !1,
281
264
  indentWidth: 20,
282
- showExpandIcons: !0
265
+ showExpandIcons: !0,
266
+ animation: "slide"
283
267
  };
284
268
  }
285
- // #region Internal State
286
- /** Set of expanded row keys */
269
+ // #region State
287
270
  expandedKeys = /* @__PURE__ */ new Set();
288
- /** Whether initial expansion (based on defaultExpanded config) has been applied */
289
271
  initialExpansionDone = !1;
290
- /** Flattened tree rows for rendering */
291
272
  flattenedRows = [];
292
- /** Map from key to flattened row for quick lookup */
293
273
  rowKeyMap = /* @__PURE__ */ new Map();
294
- // #endregion
295
- // #region Lifecycle
274
+ previousVisibleKeys = /* @__PURE__ */ new Set();
275
+ keysToAnimate = /* @__PURE__ */ new Set();
276
+ sortState = null;
296
277
  detach() {
297
- this.expandedKeys.clear(), this.initialExpansionDone = !1, this.flattenedRows = [], this.rowKeyMap.clear();
278
+ this.expandedKeys.clear(), this.initialExpansionDone = !1, this.flattenedRows = [], this.rowKeyMap.clear(), this.previousVisibleKeys.clear(), this.keysToAnimate.clear(), this.sortState = null;
279
+ }
280
+ // #endregion
281
+ // #region Animation
282
+ get animationStyle() {
283
+ const t = this.grid.effectiveConfig?.animation?.mode ?? "reduced-motion";
284
+ if (t === !1 || t === "off") return !1;
285
+ if (t !== !0 && t !== "on") {
286
+ const n = this.shadowRoot?.host;
287
+ if (n && getComputedStyle(n).getPropertyValue("--tbw-animation-enabled").trim() === "0")
288
+ return !1;
289
+ }
290
+ return this.config.animation ?? "slide";
298
291
  }
299
292
  // #endregion
300
293
  // #region Auto-Detection
301
- /**
302
- * Detects if tree functionality should be enabled based on data structure.
303
- * Called by the grid during plugin initialization.
304
- */
305
294
  detect(e) {
306
295
  if (!this.config.autoDetect) return !1;
307
- const t = this.config.childrenField ?? D(e) ?? "children";
308
- return K(e, t);
296
+ const t = this.config.childrenField ?? _(e) ?? "children";
297
+ return m(e, t);
309
298
  }
310
299
  // #endregion
311
300
  // #region Data Processing
312
301
  processRows(e) {
313
302
  const t = this.config.childrenField ?? "children";
314
- if (!K(e, t))
315
- return this.flattenedRows = [], this.rowKeyMap.clear(), [...e];
316
- this.config.defaultExpanded && !this.initialExpansionDone && (this.expandedKeys = x(e, this.config), this.initialExpansionDone = !0), this.flattenedRows = E(e, this.config, this.expandedKeys), this.rowKeyMap.clear();
317
- for (const n of this.flattenedRows)
318
- this.rowKeyMap.set(n.key, n);
319
- return this.flattenedRows.map((n) => ({
320
- ...n.data,
321
- __treeKey: n.key,
322
- __treeDepth: n.depth,
323
- __treeHasChildren: n.hasChildren,
324
- __treeExpanded: n.isExpanded
303
+ if (!m(e, t))
304
+ return this.flattenedRows = [], this.rowKeyMap.clear(), this.previousVisibleKeys.clear(), [...e];
305
+ let n = this.withStableKeys(e);
306
+ this.sortState && (n = this.sortTree(n, this.sortState.field, this.sortState.direction)), this.config.defaultExpanded && !this.initialExpansionDone && (this.expandedKeys = p(n, this.config), this.initialExpansionDone = !0), this.flattenedRows = this.flattenTree(n, this.expandedKeys), this.rowKeyMap.clear(), this.keysToAnimate.clear();
307
+ const r = /* @__PURE__ */ new Set();
308
+ for (const i of this.flattenedRows)
309
+ this.rowKeyMap.set(i.key, i), r.add(i.key), !this.previousVisibleKeys.has(i.key) && i.depth > 0 && this.keysToAnimate.add(i.key);
310
+ return this.previousVisibleKeys = r, this.flattenedRows.map((i) => ({
311
+ ...i.data,
312
+ __treeKey: i.key,
313
+ __treeDepth: i.depth,
314
+ __treeHasChildren: i.hasChildren,
315
+ __treeExpanded: i.isExpanded
325
316
  }));
326
317
  }
318
+ /** Assign stable keys to rows (preserves key across sort operations) */
319
+ withStableKeys(e, t = null) {
320
+ const n = this.config.childrenField ?? "children";
321
+ return e.map((r, i) => {
322
+ const s = r.id !== void 0 ? String(r.id) : r.__stableKey ?? (t ? `${t}-${i}` : String(i)), a = r[n], l = Array.isArray(a) && a.length > 0;
323
+ return {
324
+ ...r,
325
+ __stableKey: s,
326
+ ...l ? { [n]: this.withStableKeys(a, s) } : {}
327
+ };
328
+ });
329
+ }
330
+ /** Flatten tree using stable keys */
331
+ flattenTree(e, t, n = 0) {
332
+ const r = this.config.childrenField ?? "children", i = [];
333
+ for (const s of e) {
334
+ const a = s.__stableKey ?? s.id ?? "?", l = s[r], d = Array.isArray(l) && l.length > 0, h = t.has(a);
335
+ i.push({
336
+ key: a,
337
+ data: s,
338
+ depth: n,
339
+ hasChildren: d,
340
+ isExpanded: h,
341
+ parentKey: n > 0 && a.substring(0, a.lastIndexOf("-")) || null
342
+ }), d && h && i.push(...this.flattenTree(l, t, n + 1));
343
+ }
344
+ return i;
345
+ }
346
+ /** Sort tree recursively, keeping children with parents */
347
+ sortTree(e, t, n) {
348
+ const r = this.config.childrenField ?? "children";
349
+ return [...e].sort((s, a) => {
350
+ const l = s[t], d = a[t];
351
+ return l == null && d == null ? 0 : l == null ? -1 : d == null ? 1 : l > d ? n : l < d ? -n : 0;
352
+ }).map((s) => {
353
+ const a = s[r];
354
+ return Array.isArray(a) && a.length > 0 ? { ...s, [r]: this.sortTree(a, t, n) } : s;
355
+ });
356
+ }
327
357
  processColumns(e) {
328
358
  if (this.flattenedRows.length === 0) return [...e];
329
359
  const t = [...e];
330
- if (t.length > 0) {
331
- const n = { ...t[0] }, s = n.viewRenderer;
332
- if (s?.__treeWrapped)
333
- return t;
334
- const o = () => this.config, i = (c) => {
335
- const { value: a, row: d, column: h } = c, f = d.__treeDepth ?? 0, g = d.__treeHasChildren ?? !1, y = d.__treeExpanded ?? !1, R = o(), _ = R.indentWidth ?? 20, A = R.showExpandIcons ?? !0, u = document.createElement("span");
336
- if (u.style.display = "flex", u.style.alignItems = "center", u.style.paddingLeft = `${f * _}px`, g && A) {
337
- const l = document.createElement("span");
338
- l.className = "tree-toggle", this.setIcon(l, this.resolveIcon(y ? "collapse" : "expand")), l.style.cursor = "pointer", l.style.marginRight = "4px", l.style.fontSize = "10px", l.setAttribute("data-tree-key", d.__treeKey), u.appendChild(l);
339
- } else if (A) {
340
- const l = document.createElement("span");
341
- l.style.width = "14px", l.style.display = "inline-block", u.appendChild(l);
342
- }
343
- const p = document.createElement("span");
344
- if (s) {
345
- const l = s(c);
346
- l instanceof Node ? p.appendChild(l) : p.textContent = String(l ?? a ?? "");
347
- } else
348
- p.textContent = String(a ?? "");
349
- return u.appendChild(p), u;
350
- };
351
- i.__treeWrapped = !0, n.viewRenderer = i, t[0] = n;
352
- }
353
- return t;
360
+ if (t.length === 0) return t;
361
+ const n = { ...t[0] }, r = n.viewRenderer;
362
+ if (r?.__treeWrapped) return t;
363
+ const i = () => this.config, s = this.setIcon.bind(this), a = this.resolveIcon.bind(this), l = (d) => {
364
+ const { value: h, row: u } = d, { indentWidth: A = 20, showExpandIcons: y = !0 } = i(), f = document.createElement("span");
365
+ if (f.className = "tree-cell", f.style.setProperty("--tree-depth", String(u.__treeDepth ?? 0)), f.style.setProperty("--tbw-tree-indent", `${A}px`), u.__treeHasChildren && y) {
366
+ const c = document.createElement("span");
367
+ c.className = `tree-toggle${u.__treeExpanded ? " expanded" : ""}`, s(c, a(u.__treeExpanded ? "collapse" : "expand")), c.setAttribute("data-tree-key", u.__treeKey), f.appendChild(c);
368
+ } else if (y) {
369
+ const c = document.createElement("span");
370
+ c.className = "tree-spacer", f.appendChild(c);
371
+ }
372
+ const g = document.createElement("span");
373
+ if (r) {
374
+ const c = r(d);
375
+ c instanceof Node ? g.appendChild(c) : g.textContent = String(c ?? h ?? "");
376
+ } else
377
+ g.textContent = String(h ?? "");
378
+ return f.appendChild(g), f;
379
+ };
380
+ return l.__treeWrapped = !0, n.viewRenderer = l, t[0] = n, t;
354
381
  }
355
382
  // #endregion
356
383
  // #region Event Handlers
357
384
  onCellClick(e) {
358
385
  const t = e.originalEvent?.target;
359
386
  if (!t?.classList.contains("tree-toggle")) return !1;
360
- const n = t.getAttribute("data-tree-key");
361
- if (!n) return !1;
362
- const s = this.rowKeyMap.get(n);
363
- return s ? (this.expandedKeys = C(this.expandedKeys, n), this.emit("tree-expand", {
387
+ const n = t.getAttribute("data-tree-key"), r = n ? this.rowKeyMap.get(n) : null;
388
+ return r ? (this.expandedKeys = w(this.expandedKeys, n), this.emit("tree-expand", {
364
389
  key: n,
365
- row: s.data,
390
+ row: r.data,
366
391
  expanded: this.expandedKeys.has(n),
367
- depth: s.depth
392
+ depth: r.depth
368
393
  }), this.requestRender(), !0) : !1;
369
394
  }
395
+ onHeaderClick(e) {
396
+ if (this.flattenedRows.length === 0 || !e.column.sortable) return !1;
397
+ const { field: t } = e.column;
398
+ !this.sortState || this.sortState.field !== t ? this.sortState = { field: t, direction: 1 } : this.sortState.direction === 1 ? this.sortState = { field: t, direction: -1 } : this.sortState = null;
399
+ const n = this.grid;
400
+ return n._sortState !== void 0 && (n._sortState = this.sortState ? { ...this.sortState } : null), this.emit("sort-change", { field: t, direction: this.sortState?.direction ?? 0 }), this.requestRender(), !0;
401
+ }
402
+ afterRender() {
403
+ const e = this.animationStyle;
404
+ if (e === !1 || this.keysToAnimate.size === 0) return;
405
+ const t = this.shadowRoot?.querySelector(".rows");
406
+ if (!t) return;
407
+ const n = e === "fade" ? "tbw-tree-fade-in" : "tbw-tree-slide-in";
408
+ for (const r of t.querySelectorAll(".data-grid-row")) {
409
+ const i = r.querySelector(".cell[data-row]"), s = i ? parseInt(i.getAttribute("data-row") ?? "-1", 10) : -1, a = this.flattenedRows[s]?.key;
410
+ a && this.keysToAnimate.has(a) && (r.classList.add(n), r.addEventListener("animationend", () => r.classList.remove(n), { once: !0 }));
411
+ }
412
+ this.keysToAnimate.clear();
413
+ }
370
414
  // #endregion
371
415
  // #region Public API
372
- /**
373
- * Expand a specific node by key.
374
- */
375
416
  expand(e) {
376
417
  this.expandedKeys.add(e), this.requestRender();
377
418
  }
378
- /**
379
- * Collapse a specific node by key.
380
- */
381
419
  collapse(e) {
382
420
  this.expandedKeys.delete(e), this.requestRender();
383
421
  }
384
- /**
385
- * Toggle the expansion state of a node.
386
- */
387
422
  toggle(e) {
388
- this.expandedKeys = C(this.expandedKeys, e), this.requestRender();
423
+ this.expandedKeys = w(this.expandedKeys, e), this.requestRender();
389
424
  }
390
- /**
391
- * Expand all nodes in the tree.
392
- */
393
425
  expandAll() {
394
- this.expandedKeys = x(this.rows, this.config), this.requestRender();
426
+ this.expandedKeys = p(this.rows, this.config), this.requestRender();
395
427
  }
396
- /**
397
- * Collapse all nodes in the tree.
398
- */
399
428
  collapseAll() {
400
- this.expandedKeys = S(), this.requestRender();
429
+ this.expandedKeys = R(), this.requestRender();
401
430
  }
402
- /**
403
- * Check if a node is currently expanded.
404
- */
405
431
  isExpanded(e) {
406
432
  return this.expandedKeys.has(e);
407
433
  }
408
- /**
409
- * Get all currently expanded keys.
410
- */
411
434
  getExpandedKeys() {
412
435
  return [...this.expandedKeys];
413
436
  }
414
- /**
415
- * Get the flattened tree rows with metadata.
416
- */
417
437
  getFlattenedRows() {
418
438
  return [...this.flattenedRows];
419
439
  }
420
- /**
421
- * Get a row's original data by its key.
422
- */
423
440
  getRowByKey(e) {
424
441
  return this.rowKeyMap.get(e)?.data;
425
442
  }
426
- /**
427
- * Expand all ancestors of a node to make it visible.
428
- */
429
443
  expandToKey(e) {
430
- this.expandedKeys = I(this.rows, e, this.config, this.expandedKeys), this.requestRender();
444
+ this.expandedKeys = C(this.rows, e, this.config, this.expandedKeys), this.requestRender();
431
445
  }
432
446
  // #endregion
433
- // #region Styles
434
- styles = k;
435
- // #endregion
436
447
  }
437
448
  export {
438
- q as TreePlugin,
439
- M as countNodes,
440
- K as detectTreeStructure,
441
- F as getMaxDepth,
442
- D as inferChildrenField
449
+ T as TreePlugin,
450
+ E as countNodes,
451
+ m as detectTreeStructure,
452
+ v as getMaxDepth,
453
+ _ as inferChildrenField
443
454
  };
444
455
  //# sourceMappingURL=index.js.map