web-mojo 2.1.1108 → 2.1.1110
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/dist/admin.cjs.js +1 -1
- package/dist/admin.cjs.js.map +1 -1
- package/dist/admin.es.js +18 -16
- package/dist/admin.es.js.map +1 -1
- package/dist/auth.cjs.js +1 -1
- package/dist/auth.es.js +1 -1
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.css +118 -0
- package/dist/charts.es.js +4 -4
- package/dist/chat.css +3 -18
- package/dist/chunks/{ChatView-CTe1wlQP.js → ChatView-BsANcDiL.js} +31 -8
- package/dist/chunks/ChatView-BsANcDiL.js.map +1 -0
- package/dist/chunks/{ChatView-BL4kPmQd.js → ChatView-DSEEMnNt.js} +2 -2
- package/dist/chunks/ChatView-DSEEMnNt.js.map +1 -0
- package/dist/chunks/{Collection-Ds4EOzap.js → Collection-CqLcHgQG.js} +2 -2
- package/dist/chunks/{Collection-Ds4EOzap.js.map → Collection-CqLcHgQG.js.map} +1 -1
- package/dist/chunks/{Collection-bgdNt0wV.js → Collection-vtImpCcS.js} +2 -2
- package/dist/chunks/{Collection-bgdNt0wV.js.map → Collection-vtImpCcS.js.map} +1 -1
- package/dist/chunks/{ContextMenu-DwvxeWLt.js → ContextMenu-BY3BgxM5.js} +2 -2
- package/dist/chunks/{ContextMenu-DwvxeWLt.js.map → ContextMenu-BY3BgxM5.js.map} +1 -1
- package/dist/chunks/{ContextMenu-KHTc-Ubo.js → ContextMenu-DfrWFc5y.js} +3 -3
- package/dist/chunks/{ContextMenu-KHTc-Ubo.js.map → ContextMenu-DfrWFc5y.js.map} +1 -1
- package/dist/chunks/{DataView-DbexZltc.js → DataView-CHvoEI4M.js} +2 -2
- package/dist/chunks/{DataView-DbexZltc.js.map → DataView-CHvoEI4M.js.map} +1 -1
- package/dist/chunks/{DataView-DAGqpR7b.js → DataView-CsYXM9vF.js} +2 -2
- package/dist/chunks/{DataView-DAGqpR7b.js.map → DataView-CsYXM9vF.js.map} +1 -1
- package/dist/chunks/{Dialog-DE-21f_8.js → Dialog-BKPwBCDC.js} +2 -2
- package/dist/chunks/Dialog-BKPwBCDC.js.map +1 -0
- package/dist/chunks/{Dialog-CXOsYNLf.js → Dialog-D4DsB-N1.js} +6 -6
- package/dist/chunks/Dialog-D4DsB-N1.js.map +1 -0
- package/dist/chunks/{FormView-Dya3nBrn.js → FormView-B9nIO_AX.js} +2 -2
- package/dist/chunks/{FormView-Dya3nBrn.js.map → FormView-B9nIO_AX.js.map} +1 -1
- package/dist/chunks/{FormView-DbPZwhZ6.js → FormView-DYX_yeho.js} +2 -2
- package/dist/chunks/{FormView-DbPZwhZ6.js.map → FormView-DYX_yeho.js.map} +1 -1
- package/dist/chunks/{ListView-DFP4ie99.js → ListView-BtZ7fylv.js} +3 -3
- package/dist/chunks/{ListView-DFP4ie99.js.map → ListView-BtZ7fylv.js.map} +1 -1
- package/dist/chunks/{ListView-BQgv3OvQ.js → ListView-D2vt0koT.js} +2 -2
- package/dist/chunks/{ListView-BQgv3OvQ.js.map → ListView-D2vt0koT.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-DOcsPk5u.js → MetricsMiniChartWidget-BJJY9R-s.js} +2 -2
- package/dist/chunks/MetricsMiniChartWidget-BJJY9R-s.js.map +1 -0
- package/dist/chunks/{MetricsMiniChartWidget-Dan8l57G.js → MetricsMiniChartWidget-bmnV82d1.js} +340 -9
- package/dist/chunks/{MetricsMiniChartWidget-Dan8l57G.js.map → MetricsMiniChartWidget-bmnV82d1.js.map} +1 -1
- package/dist/chunks/{PDFViewer-B1g6Q6ae.js → PDFViewer-Bzifr-dn.js} +3 -3
- package/dist/chunks/{PDFViewer-B1g6Q6ae.js.map → PDFViewer-Bzifr-dn.js.map} +1 -1
- package/dist/chunks/{PDFViewer-DDb7xLGo.js → PDFViewer-Cgr3T15i.js} +2 -2
- package/dist/chunks/{PDFViewer-DDb7xLGo.js.map → PDFViewer-Cgr3T15i.js.map} +1 -1
- package/dist/chunks/{Rest-C3KvOEeY.js → Rest-C3fPzCIA.js} +2 -2
- package/dist/chunks/Rest-C3fPzCIA.js.map +1 -0
- package/dist/chunks/{Rest-BIyXKaFn.js → Rest-DYPLEzNy.js} +2 -2
- package/dist/chunks/Rest-DYPLEzNy.js.map +1 -0
- package/dist/chunks/{TokenManager-DUmZuAKG.js → TokenManager-CKkIWgzy.js} +6 -6
- package/dist/chunks/TokenManager-CKkIWgzy.js.map +1 -0
- package/dist/chunks/TokenManager-DSyRWlvc.js +2 -0
- package/dist/chunks/TokenManager-DSyRWlvc.js.map +1 -0
- package/dist/chunks/{WebSocketClient-CGQLSIgP.js → WebSocketClient-CkAL55qy.js} +2 -2
- package/dist/chunks/{WebSocketClient-CGQLSIgP.js.map → WebSocketClient-CkAL55qy.js.map} +1 -1
- package/dist/chunks/{WebSocketClient-sEN2DmCF.js → WebSocketClient-Dzwprd15.js} +2 -2
- package/dist/chunks/{WebSocketClient-sEN2DmCF.js.map → WebSocketClient-Dzwprd15.js.map} +1 -1
- package/dist/chunks/{version-DIk6UpNb.js → version-C5lFa1F0.js} +2 -2
- package/dist/chunks/{version-DIk6UpNb.js.map → version-C5lFa1F0.js.map} +1 -1
- package/dist/chunks/{version-CrckCqr_.js → version-FRgkiWti.js} +4 -4
- package/dist/chunks/{version-CrckCqr_.js.map → version-FRgkiWti.js.map} +1 -1
- package/dist/core.css +58 -52
- package/dist/css/web-mojo.css +1 -1
- package/dist/docit.cjs.js +1 -1
- package/dist/docit.es.js +6 -6
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +71 -132
- package/dist/index.es.js.map +1 -1
- package/dist/lightbox.cjs.js +1 -1
- package/dist/lightbox.es.js +5 -5
- package/dist/map.cjs.js +1 -1
- package/dist/map.es.js +2 -2
- package/dist/timeline.cjs.js +1 -1
- package/dist/timeline.es.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/ChatView-BL4kPmQd.js.map +0 -1
- package/dist/chunks/ChatView-CTe1wlQP.js.map +0 -1
- package/dist/chunks/Dialog-CXOsYNLf.js.map +0 -1
- package/dist/chunks/Dialog-DE-21f_8.js.map +0 -1
- package/dist/chunks/MetricsMiniChartWidget-DOcsPk5u.js.map +0 -1
- package/dist/chunks/Rest-BIyXKaFn.js.map +0 -1
- package/dist/chunks/Rest-C3KvOEeY.js.map +0 -1
- package/dist/chunks/TokenManager-B0Z_dd7k.js +0 -2
- package/dist/chunks/TokenManager-B0Z_dd7k.js.map +0 -1
- package/dist/chunks/TokenManager-DUmZuAKG.js.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { B, a, V, b, c, d } from "./chunks/version-
|
|
2
|
-
import { V as View, d as dataFormatter, a as Mustache } from "./chunks/Rest-
|
|
3
|
-
import { D, b as b2, M, r } from "./chunks/Rest-
|
|
4
|
-
import { G as GroupList, a as Group, P as Page, T as ToastService, U as User } from "./chunks/ContextMenu-
|
|
5
|
-
import { C, b as b3, e, f, g, h, i, d as d2, c as c2 } from "./chunks/ContextMenu-
|
|
6
|
-
import { D as Dialog, W as WebApp } from "./chunks/Dialog-
|
|
7
|
-
import { E, R } from "./chunks/Dialog-
|
|
8
|
-
import { C as C2, M as M2 } from "./chunks/Collection-
|
|
9
|
-
import { M as Member } from "./chunks/ChatView-
|
|
10
|
-
import { Z, e as e2, d as d3, C as C3, a1, $, E as E2, j, i as i2, q, s, r as r2, w, y, x, t, v, u, F, f as f2, au, av, B as B2, I, A, z, G, N, O, D as D2, K, L, H, J, Y, a2, a7, a8, a4, a3, a5, a6, aa, ac, ab, a9, ad, ae, k, m, l, _, ag, af, aj, ah, ai, P, ao, as, ap, aq, ar, ak, al, am, at, an, V as V2, X, W, R as R2, U, Q, S, h as h2, g as g2, n, p, o, c as c3, b as b4, a as a10, T, aw, aB, aA, ax, ay, az, a0 } from "./chunks/ChatView-
|
|
11
|
-
import { S as SimpleSearchView, T as TokenManager, a as TopNav } from "./chunks/TokenManager-
|
|
12
|
-
import { a as a11, L as L2 } from "./chunks/ListView-
|
|
13
|
-
import { default as default2 } from "./chunks/DataView-
|
|
14
|
-
import { F as F2, a as a12 } from "./chunks/FormView-
|
|
15
|
-
import { W as W2 } from "./chunks/WebSocketClient-
|
|
1
|
+
import { B, a, V, b, c, d } from "./chunks/version-FRgkiWti.js";
|
|
2
|
+
import { V as View, d as dataFormatter, a as Mustache } from "./chunks/Rest-C3fPzCIA.js";
|
|
3
|
+
import { D, b as b2, M, r } from "./chunks/Rest-C3fPzCIA.js";
|
|
4
|
+
import { G as GroupList, a as Group, P as Page, T as ToastService, U as User } from "./chunks/ContextMenu-DfrWFc5y.js";
|
|
5
|
+
import { C, b as b3, e, f, g, h, i, d as d2, c as c2 } from "./chunks/ContextMenu-DfrWFc5y.js";
|
|
6
|
+
import { D as Dialog, W as WebApp } from "./chunks/Dialog-D4DsB-N1.js";
|
|
7
|
+
import { E, R } from "./chunks/Dialog-D4DsB-N1.js";
|
|
8
|
+
import { C as C2, M as M2 } from "./chunks/Collection-vtImpCcS.js";
|
|
9
|
+
import { M as Member } from "./chunks/ChatView-BsANcDiL.js";
|
|
10
|
+
import { Z, e as e2, d as d3, C as C3, a1, $, E as E2, j, i as i2, q, s, r as r2, w, y, x, t, v, u, F, f as f2, au, av, B as B2, I, A, z, G, N, O, D as D2, K, L, H, J, Y, a2, a7, a8, a4, a3, a5, a6, aa, ac, ab, a9, ad, ae, k, m, l, _, ag, af, aj, ah, ai, P, ao, as, ap, aq, ar, ak, al, am, at, an, V as V2, X, W, R as R2, U, Q, S, h as h2, g as g2, n, p, o, c as c3, b as b4, a as a10, T, aw, aB, aA, ax, ay, az, a0 } from "./chunks/ChatView-BsANcDiL.js";
|
|
11
|
+
import { S as SimpleSearchView, T as TokenManager, a as TopNav } from "./chunks/TokenManager-CKkIWgzy.js";
|
|
12
|
+
import { a as a11, L as L2 } from "./chunks/ListView-BtZ7fylv.js";
|
|
13
|
+
import { default as default2 } from "./chunks/DataView-CHvoEI4M.js";
|
|
14
|
+
import { F as F2, a as a12 } from "./chunks/FormView-DYX_yeho.js";
|
|
15
|
+
import { W as W2 } from "./chunks/WebSocketClient-CkAL55qy.js";
|
|
16
16
|
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
|
|
17
17
|
const LEVELS = Object.freeze({
|
|
18
18
|
silent: 0,
|
|
@@ -261,12 +261,8 @@ class GroupSearchView extends SimpleSearchView {
|
|
|
261
261
|
this.showKind = options.showKind !== void 0 ? options.showKind : true;
|
|
262
262
|
this.parentField = options.parentField || "parent";
|
|
263
263
|
this.kindField = options.kindField || "kind";
|
|
264
|
-
this.expandedNodes = /* @__PURE__ */ new Set();
|
|
265
264
|
this.treeData = [];
|
|
266
265
|
this.flattenedItems = [];
|
|
267
|
-
this.autoExpandRoot = options.autoExpandRoot !== void 0 ? options.autoExpandRoot : true;
|
|
268
|
-
this.autoExpandAll = options.autoExpandAll || false;
|
|
269
|
-
this.indentSize = options.indentSize || 20;
|
|
270
266
|
this.showLines = options.showLines !== void 0 ? options.showLines : true;
|
|
271
267
|
}
|
|
272
268
|
/**
|
|
@@ -283,8 +279,7 @@ class GroupSearchView extends SimpleSearchView {
|
|
|
283
279
|
...item,
|
|
284
280
|
children: [],
|
|
285
281
|
level: 0,
|
|
286
|
-
hasChildren: false
|
|
287
|
-
isExpanded: false
|
|
282
|
+
hasChildren: false
|
|
288
283
|
});
|
|
289
284
|
}
|
|
290
285
|
const parentObj = item[this.parentField];
|
|
@@ -293,8 +288,7 @@ class GroupSearchView extends SimpleSearchView {
|
|
|
293
288
|
...parentObj,
|
|
294
289
|
children: [],
|
|
295
290
|
level: 0,
|
|
296
|
-
hasChildren: false
|
|
297
|
-
isExpanded: false
|
|
291
|
+
hasChildren: false
|
|
298
292
|
});
|
|
299
293
|
}
|
|
300
294
|
});
|
|
@@ -306,22 +300,13 @@ class GroupSearchView extends SimpleSearchView {
|
|
|
306
300
|
const parent = itemsById.get(parentId);
|
|
307
301
|
parent.children.push(treeItem);
|
|
308
302
|
parent.hasChildren = true;
|
|
309
|
-
if (this.autoExpandAll || this.autoExpandRoot && parent.level === 0) {
|
|
310
|
-
this.expandedNodes.add(parent.id);
|
|
311
|
-
parent.isExpanded = true;
|
|
312
|
-
}
|
|
313
303
|
} else {
|
|
314
304
|
rootItems.push(treeItem);
|
|
315
|
-
if (this.autoExpandRoot) {
|
|
316
|
-
this.expandedNodes.add(treeItem.id);
|
|
317
|
-
treeItem.isExpanded = true;
|
|
318
|
-
}
|
|
319
305
|
}
|
|
320
306
|
});
|
|
321
307
|
const calculateLevels = (nodes, level = 0) => {
|
|
322
308
|
nodes.forEach((node) => {
|
|
323
309
|
node.level = level;
|
|
324
|
-
node.isExpanded = this.expandedNodes.has(node.id);
|
|
325
310
|
if (node.children.length > 0) {
|
|
326
311
|
node.children.sort((a13, b5) => (a13.name || "").localeCompare(b5.name || ""));
|
|
327
312
|
calculateLevels(node.children, level + 1);
|
|
@@ -334,17 +319,47 @@ class GroupSearchView extends SimpleSearchView {
|
|
|
334
319
|
}
|
|
335
320
|
/**
|
|
336
321
|
* Flatten tree structure for rendering
|
|
322
|
+
* Tracks ancestor "last child" flags for proper line rendering
|
|
337
323
|
*/
|
|
338
|
-
flattenTree(nodes, result = []) {
|
|
324
|
+
flattenTree(nodes, result = [], ancestorLastFlags = []) {
|
|
339
325
|
nodes.forEach((node, index2) => {
|
|
340
326
|
node._isLastChild = index2 === nodes.length - 1;
|
|
327
|
+
node._ancestorLastFlags = [...ancestorLastFlags];
|
|
328
|
+
const allAncestorsLast = ancestorLastFlags.every((flag) => flag);
|
|
329
|
+
node._isLastDescendant = allAncestorsLast && node._isLastChild && (!node.children || node.children.length === 0);
|
|
341
330
|
result.push(node);
|
|
342
|
-
if (node.
|
|
343
|
-
|
|
331
|
+
if (node.children && node.children.length > 0) {
|
|
332
|
+
const newFlags = [...ancestorLastFlags, node._isLastChild];
|
|
333
|
+
this.flattenTree(node.children, result, newFlags);
|
|
344
334
|
}
|
|
345
335
|
});
|
|
346
336
|
return result;
|
|
347
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Second pass: compute which vertical lines should continue for each item
|
|
340
|
+
*
|
|
341
|
+
* Vertical line at segment s shows if there are more siblings coming at level s+1
|
|
342
|
+
* We need to look ahead until we find an item at level s+1 or shallower
|
|
343
|
+
*/
|
|
344
|
+
computeVerticalLines(flatList) {
|
|
345
|
+
for (let i3 = 0; i3 < flatList.length; i3++) {
|
|
346
|
+
const item = flatList[i3];
|
|
347
|
+
item._continueVertical = [];
|
|
348
|
+
for (let s2 = 0; s2 < item.level; s2++) {
|
|
349
|
+
let foundSibling = false;
|
|
350
|
+
for (let j2 = i3 + 1; j2 < flatList.length; j2++) {
|
|
351
|
+
const futureItem = flatList[j2];
|
|
352
|
+
if (futureItem.level === s2 + 1) {
|
|
353
|
+
foundSibling = true;
|
|
354
|
+
break;
|
|
355
|
+
} else if (futureItem.level <= s2) {
|
|
356
|
+
break;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
item._continueVertical[s2] = foundSibling;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
348
363
|
/**
|
|
349
364
|
* Update filtered items with tree structure
|
|
350
365
|
*/
|
|
@@ -358,31 +373,10 @@ class GroupSearchView extends SimpleSearchView {
|
|
|
358
373
|
const items = this.collection.toJSON();
|
|
359
374
|
this.treeData = this.buildTreeHierarchy(items);
|
|
360
375
|
this.flattenedItems = this.flattenTree(this.treeData);
|
|
376
|
+
this.computeVerticalLines(this.flattenedItems);
|
|
361
377
|
this.filteredItems = this.flattenedItems;
|
|
362
378
|
this.updateResultsView();
|
|
363
379
|
}
|
|
364
|
-
/**
|
|
365
|
-
* Toggle node expansion
|
|
366
|
-
*/
|
|
367
|
-
toggleNode(itemId) {
|
|
368
|
-
if (this.expandedNodes.has(itemId)) {
|
|
369
|
-
this.expandedNodes.delete(itemId);
|
|
370
|
-
} else {
|
|
371
|
-
this.expandedNodes.add(itemId);
|
|
372
|
-
}
|
|
373
|
-
this.updateFilteredItems();
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
|
-
* Handle expand/collapse button clicks
|
|
377
|
-
*/
|
|
378
|
-
async handleActionToggleNode(event, element) {
|
|
379
|
-
event.preventDefault();
|
|
380
|
-
event.stopPropagation();
|
|
381
|
-
const itemId = parseInt(element.getAttribute("data-item-id"));
|
|
382
|
-
if (!isNaN(itemId)) {
|
|
383
|
-
this.toggleNode(itemId);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
380
|
/**
|
|
387
381
|
* Get tree-specific item template
|
|
388
382
|
*/
|
|
@@ -400,24 +394,6 @@ class GroupSearchView extends SimpleSearchView {
|
|
|
400
394
|
* Process item template with tree structure
|
|
401
395
|
*/
|
|
402
396
|
processItemTemplate(item) {
|
|
403
|
-
const indent = item.level * this.indentSize;
|
|
404
|
-
const hasChildren = item.hasChildren;
|
|
405
|
-
const isExpanded = item.isExpanded;
|
|
406
|
-
let expandIcon = "";
|
|
407
|
-
if (hasChildren) {
|
|
408
|
-
const iconClass = isExpanded ? "bi-chevron-down" : "bi-chevron-right";
|
|
409
|
-
expandIcon = `
|
|
410
|
-
<button class="tree-expand-btn"
|
|
411
|
-
type="button"
|
|
412
|
-
data-action="toggle-node"
|
|
413
|
-
data-item-id="${item.id}"
|
|
414
|
-
aria-label="${isExpanded ? "Collapse" : "Expand"}">
|
|
415
|
-
<i class="bi ${iconClass}"></i>
|
|
416
|
-
</button>
|
|
417
|
-
`;
|
|
418
|
-
} else {
|
|
419
|
-
expandIcon = '<span class="tree-expand-spacer"></span>';
|
|
420
|
-
}
|
|
421
397
|
let content = this.itemTemplate;
|
|
422
398
|
content = content.replace(/\{\{(\w+)\}\}/g, (match, prop) => {
|
|
423
399
|
if (prop === "showKind") {
|
|
@@ -430,19 +406,29 @@ class GroupSearchView extends SimpleSearchView {
|
|
|
430
406
|
} else {
|
|
431
407
|
content = content.replace(/\{\{#showKind\}\}.*?\{\{\/showKind\}\}/gs, "");
|
|
432
408
|
}
|
|
433
|
-
let
|
|
409
|
+
let lineSegments = "";
|
|
434
410
|
if (this.showLines && item.level > 0) {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
411
|
+
for (let i3 = 0; i3 < item.level; i3++) {
|
|
412
|
+
const isLastSegment = i3 === item.level - 1;
|
|
413
|
+
if (isLastSegment) {
|
|
414
|
+
const segClass = item._isLastChild ? "tree-seg tree-seg-last" : "tree-seg tree-seg-mid";
|
|
415
|
+
lineSegments += `<span class="${segClass}"></span>`;
|
|
416
|
+
} else {
|
|
417
|
+
const continueVertical = item._continueVertical && item._continueVertical[i3];
|
|
418
|
+
if (continueVertical) {
|
|
419
|
+
lineSegments += `<span class="tree-seg tree-seg-vert"></span>`;
|
|
420
|
+
} else {
|
|
421
|
+
lineSegments += `<span class="tree-seg"></span>`;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
438
425
|
}
|
|
426
|
+
const hasChildren = item.hasChildren ? " has-children" : "";
|
|
427
|
+
const isLastChild = item._isLastChild ? " is-last-child" : "";
|
|
439
428
|
return `
|
|
440
|
-
<div class="tree-item-wrapper" data-tree-level="${item.level}">
|
|
441
|
-
<div class="tree-
|
|
442
|
-
${
|
|
443
|
-
</div>
|
|
444
|
-
<div class="tree-item-expand">
|
|
445
|
-
${expandIcon}
|
|
429
|
+
<div class="tree-item-wrapper${hasChildren}${isLastChild}" data-tree-level="${item.level}">
|
|
430
|
+
<div class="tree-lines">
|
|
431
|
+
${lineSegments}
|
|
446
432
|
</div>
|
|
447
433
|
<div class="tree-item-body flex-grow-1">
|
|
448
434
|
${content}
|
|
@@ -450,53 +436,6 @@ class GroupSearchView extends SimpleSearchView {
|
|
|
450
436
|
</div>
|
|
451
437
|
`;
|
|
452
438
|
}
|
|
453
|
-
/**
|
|
454
|
-
* Expand all nodes
|
|
455
|
-
*/
|
|
456
|
-
expandAll() {
|
|
457
|
-
const expandRecursive = (nodes) => {
|
|
458
|
-
nodes.forEach((node) => {
|
|
459
|
-
if (node.hasChildren) {
|
|
460
|
-
this.expandedNodes.add(node.id);
|
|
461
|
-
expandRecursive(node.children);
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
};
|
|
465
|
-
expandRecursive(this.treeData);
|
|
466
|
-
this.updateFilteredItems();
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* Collapse all nodes
|
|
470
|
-
*/
|
|
471
|
-
collapseAll() {
|
|
472
|
-
this.expandedNodes.clear();
|
|
473
|
-
this.updateFilteredItems();
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* Expand to specific node (and all parents)
|
|
477
|
-
*/
|
|
478
|
-
expandToNode(nodeId) {
|
|
479
|
-
const findAndExpandParents = (nodes, targetId, parents = []) => {
|
|
480
|
-
for (const node of nodes) {
|
|
481
|
-
if (node.id === targetId) {
|
|
482
|
-
parents.forEach((parent) => {
|
|
483
|
-
this.expandedNodes.add(parent.id);
|
|
484
|
-
});
|
|
485
|
-
this.expandedNodes.add(node.id);
|
|
486
|
-
return true;
|
|
487
|
-
}
|
|
488
|
-
if (node.children.length > 0) {
|
|
489
|
-
if (findAndExpandParents(node.children, targetId, [...parents, node])) {
|
|
490
|
-
return true;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
return false;
|
|
495
|
-
};
|
|
496
|
-
if (findAndExpandParents(this.treeData, nodeId)) {
|
|
497
|
-
this.updateFilteredItems();
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
439
|
/**
|
|
501
440
|
* Get all root items
|
|
502
441
|
*/
|