@xtctwins/tctwins-bimx-engine 0.1.21 → 0.1.23

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 (38) hide show
  1. package/dist/{AnnotationTool-BvFG1vTX.mjs → AnnotationTool-DojqlWub.mjs} +12 -12
  2. package/dist/BIMX_Viewer_Lib.es.js +4 -4
  3. package/dist/BIMX_Viewer_Lib.umd.js +89 -94
  4. package/dist/CommentTool-CR9lVrzW.mjs +338 -0
  5. package/dist/HiddenTool-Wi-kOd2H.mjs +58 -0
  6. package/dist/InspectorTool-DIayiHOO.mjs +625 -0
  7. package/dist/MeasureTool-CHZ67WhG.mjs +1540 -0
  8. package/dist/{NavigateTool-CCIb1X4u.mjs → NavigateTool-CQoj_On8.mjs} +7 -7
  9. package/dist/{RoamTool-B1w0efz8.mjs → RoamTool-C3CV1E9g.mjs} +20 -20
  10. package/dist/{ScreenShotTool-BviRVFSg.mjs → ScreenShotTool-BIIBp4eQ.mjs} +67 -67
  11. package/dist/SectionTool-CihpG2Fy.mjs +624 -0
  12. package/dist/SettingTool-nEoxPwEr.mjs +525 -0
  13. package/dist/StructureTree-CJH8jkPI.mjs +1427 -0
  14. package/dist/{debounce-Cg3LHv0T.mjs → debounce-BjnjVRfm.mjs} +13 -13
  15. package/dist/{el-checkbox-lp8vWAXQ.mjs → el-checkbox-CSuEX00S.mjs} +46 -46
  16. package/dist/{el-input-Bwqgf3wZ.mjs → el-input-Bm753NUP.mjs} +66 -68
  17. package/dist/{el-input-number-0OWyX276.mjs → el-input-number-BvvuoubO.mjs} +75 -75
  18. package/dist/{index-DX-eYsBm.mjs → index-BlDGbvS0.mjs} +2885 -2877
  19. package/dist/{index-CQ8depiU.mjs → index-BognDb0Q.mjs} +3 -3
  20. package/dist/{index-CYEu_kT4.mjs → index-CtoOocrY.mjs} +1 -1
  21. package/dist/{isEqual-Bg-tyY30.mjs → isEqual-BULlB8Co.mjs} +9 -9
  22. package/dist/panel.vue_vue_type_style_index_0_lang-tTB1oDNs.mjs +97 -0
  23. package/dist/style.css +1 -1
  24. package/dist/tallPanel-CmlMVBG1.mjs +49 -0
  25. package/package.json +2 -2
  26. package/types/components/utilsComponents/tallPanel.vue.d.ts +41 -0
  27. package/types/pages/BIMXViewer.vue.d.ts +2 -0
  28. package/types/services/fileApi/fileManager.d.ts +5 -5
  29. package/types/store/initConfigs.d.ts +1 -1
  30. package/types/store/themeManager.d.ts +2 -1
  31. package/dist/CommentTool-B6ruuuGV.mjs +0 -338
  32. package/dist/HiddenTool-DW-lRdW5.mjs +0 -58
  33. package/dist/InspectorTool-Cc288ySp.mjs +0 -515
  34. package/dist/MeasureTool-DdfM3U_3.mjs +0 -1542
  35. package/dist/SectionTool-jSjWX32j.mjs +0 -630
  36. package/dist/SettingTool-CVMZAx2H.mjs +0 -536
  37. package/dist/StructureTree-4OCdRRPG.mjs +0 -2672
  38. package/dist/panel.vue_vue_type_style_index_0_scope_true_lang-BfE1I0S9.mjs +0 -82
@@ -0,0 +1,1427 @@
1
+ import { _ as Be, a as Le } from "./panel.vue_vue_type_style_index_0_lang-tTB1oDNs.mjs";
2
+ import { _ as $e } from "./tallPanel-CmlMVBG1.mjs";
3
+ import { u as se, _ as fe, w as we, h as ke, i as je, a as Me, r as ye, b as Oe, d as Pe, c as He, e as Fe, f as ze, E as Y, g as qe, j as Re, k as U, l as ge, T as Ee, m as Ue, n as Ve } from "./index-BlDGbvS0.mjs";
4
+ import { E as We, i as Ye, a as Ge } from "./el-input-Bm753NUP.mjs";
5
+ import { E as Je } from "./el-checkbox-CSuEX00S.mjs";
6
+ import { defineComponent as re, openBlock as D, createBlock as z, Transition as Qe, mergeProps as Xe, unref as F, toHandlers as Ze, withCtx as q, renderSlot as me, reactive as et, inject as oe, h as De, provide as ie, ref as E, getCurrentInstance as xe, watch as L, nextTick as ee, resolveComponent as J, withDirectives as le, createElementBlock as A, normalizeClass as j, withModifiers as G, createElementVNode as w, normalizeStyle as tt, resolveDynamicComponent as nt, createCommentVNode as V, createVNode as $, Fragment as te, renderList as de, vShow as ce, shallowRef as _e, onMounted as Te, onUpdated as ot, computed as st, toDisplayString as he, pushScopeId as rt, popScopeId as at } from "vue";
7
+ import { S as ve } from "./const-CbUmfuHy.mjs";
8
+ import { s as dt } from "./token-UNVJeAU8.mjs";
9
+ import { Loading as it, CaretRight as lt } from "@element-plus/icons-vue";
10
+ import { u as ct } from "./index-BognDb0Q.mjs";
11
+ const ut = re({
12
+ name: "ElCollapseTransition"
13
+ }), ht = /* @__PURE__ */ re({
14
+ ...ut,
15
+ setup(t) {
16
+ const e = se("collapse-transition"), o = (n) => {
17
+ n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom;
18
+ }, s = {
19
+ beforeEnter(n) {
20
+ n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.style.height && (n.dataset.elExistsHeight = n.style.height), n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0;
21
+ },
22
+ enter(n) {
23
+ requestAnimationFrame(() => {
24
+ n.dataset.oldOverflow = n.style.overflow, n.dataset.elExistsHeight ? n.style.maxHeight = n.dataset.elExistsHeight : n.scrollHeight !== 0 ? n.style.maxHeight = `${n.scrollHeight}px` : n.style.maxHeight = 0, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom, n.style.overflow = "hidden";
25
+ });
26
+ },
27
+ afterEnter(n) {
28
+ n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow;
29
+ },
30
+ enterCancelled(n) {
31
+ o(n);
32
+ },
33
+ beforeLeave(n) {
34
+ n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.dataset.oldOverflow = n.style.overflow, n.style.maxHeight = `${n.scrollHeight}px`, n.style.overflow = "hidden";
35
+ },
36
+ leave(n) {
37
+ n.scrollHeight !== 0 && (n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0);
38
+ },
39
+ afterLeave(n) {
40
+ o(n);
41
+ },
42
+ leaveCancelled(n) {
43
+ o(n);
44
+ }
45
+ };
46
+ return (n, r) => (D(), z(Qe, Xe({
47
+ name: F(e).b()
48
+ }, Ze(s)), {
49
+ default: q(() => [
50
+ me(n.$slots, "default")
51
+ ]),
52
+ _: 3
53
+ }, 16, ["name"]));
54
+ }
55
+ });
56
+ var ft = /* @__PURE__ */ fe(ht, [["__file", "collapse-transition.vue"]]);
57
+ const pt = we(ft), ne = "$treeNodeId", Ke = function(t, e) {
58
+ !e || e[ne] || Object.defineProperty(e, ne, {
59
+ value: t.id,
60
+ enumerable: !1,
61
+ configurable: !1,
62
+ writable: !1
63
+ });
64
+ }, be = function(t, e) {
65
+ return t ? e[t] : e[ne];
66
+ }, Ne = (t, e, o) => {
67
+ const s = t.value.currentNode;
68
+ o();
69
+ const n = t.value.currentNode;
70
+ s !== n && e("current-change", n ? n.data : null, n);
71
+ }, Ce = (t) => {
72
+ let e = !0, o = !0, s = !0;
73
+ for (let n = 0, r = t.length; n < r; n++) {
74
+ const a = t[n];
75
+ (a.checked !== !0 || a.indeterminate) && (e = !1, a.disabled || (s = !1)), (a.checked !== !1 || a.indeterminate) && (o = !1);
76
+ }
77
+ return { all: e, none: o, allWithoutDisable: s, half: !e && !o };
78
+ }, ae = function(t) {
79
+ if (t.childNodes.length === 0 || t.loading)
80
+ return;
81
+ const { all: e, none: o, half: s } = Ce(t.childNodes);
82
+ e ? (t.checked = !0, t.indeterminate = !1) : s ? (t.checked = !1, t.indeterminate = !0) : o && (t.checked = !1, t.indeterminate = !1);
83
+ const n = t.parent;
84
+ !n || n.level === 0 || t.store.checkStrictly || ae(n);
85
+ }, ue = function(t, e) {
86
+ const o = t.store.props, s = t.data || {}, n = o[e];
87
+ if (typeof n == "function")
88
+ return n(s, t);
89
+ if (typeof n == "string")
90
+ return s[n];
91
+ if (typeof n > "u") {
92
+ const r = s[e];
93
+ return r === void 0 ? "" : r;
94
+ }
95
+ };
96
+ let yt = 0;
97
+ class Q {
98
+ constructor(e) {
99
+ this.id = yt++, this.text = null, this.checked = !1, this.indeterminate = !1, this.data = null, this.expanded = !1, this.parent = null, this.visible = !0, this.isCurrent = !1, this.canFocus = !1;
100
+ for (const o in e)
101
+ ke(e, o) && (this[o] = e[o]);
102
+ this.level = 0, this.loaded = !1, this.childNodes = [], this.loading = !1, this.parent && (this.level = this.parent.level + 1);
103
+ }
104
+ initialize() {
105
+ const e = this.store;
106
+ if (!e)
107
+ throw new Error("[Node]store is required!");
108
+ e.registerNode(this);
109
+ const o = e.props;
110
+ if (o && typeof o.isLeaf < "u") {
111
+ const r = ue(this, "isLeaf");
112
+ typeof r == "boolean" && (this.isLeafByUser = r);
113
+ }
114
+ if (e.lazy !== !0 && this.data ? (this.setData(this.data), e.defaultExpandAll && (this.expanded = !0, this.canFocus = !0)) : this.level > 0 && e.lazy && e.defaultExpandAll && !this.isLeafByUser && this.expand(), Array.isArray(this.data) || Ke(this, this.data), !this.data)
115
+ return;
116
+ const s = e.defaultExpandedKeys, n = e.key;
117
+ n && s && s.includes(this.key) && this.expand(null, e.autoExpandParent), n && e.currentNodeKey !== void 0 && this.key === e.currentNodeKey && (e.currentNode = this, e.currentNode.isCurrent = !0), e.lazy && e._initDefaultCheckedNode(this), this.updateLeafState(), this.parent && (this.level === 1 || this.parent.expanded === !0) && (this.canFocus = !0);
118
+ }
119
+ setData(e) {
120
+ Array.isArray(e) || Ke(this, e), this.data = e, this.childNodes = [];
121
+ let o;
122
+ this.level === 0 && Array.isArray(this.data) ? o = this.data : o = ue(this, "children") || [];
123
+ for (let s = 0, n = o.length; s < n; s++)
124
+ this.insertChild({ data: o[s] });
125
+ }
126
+ get label() {
127
+ return ue(this, "label");
128
+ }
129
+ get key() {
130
+ const e = this.store.key;
131
+ return this.data ? this.data[e] : null;
132
+ }
133
+ get disabled() {
134
+ return ue(this, "disabled");
135
+ }
136
+ get nextSibling() {
137
+ const e = this.parent;
138
+ if (e) {
139
+ const o = e.childNodes.indexOf(this);
140
+ if (o > -1)
141
+ return e.childNodes[o + 1];
142
+ }
143
+ return null;
144
+ }
145
+ get previousSibling() {
146
+ const e = this.parent;
147
+ if (e) {
148
+ const o = e.childNodes.indexOf(this);
149
+ if (o > -1)
150
+ return o > 0 ? e.childNodes[o - 1] : null;
151
+ }
152
+ return null;
153
+ }
154
+ contains(e, o = !0) {
155
+ return (this.childNodes || []).some((s) => s === e || o && s.contains(e));
156
+ }
157
+ remove() {
158
+ const e = this.parent;
159
+ e && e.removeChild(this);
160
+ }
161
+ insertChild(e, o, s) {
162
+ if (!e)
163
+ throw new Error("InsertChild error: child is required.");
164
+ if (!(e instanceof Q)) {
165
+ if (!s) {
166
+ const n = this.getChildren(!0);
167
+ n.includes(e.data) || (typeof o > "u" || o < 0 ? n.push(e.data) : n.splice(o, 0, e.data));
168
+ }
169
+ Object.assign(e, {
170
+ parent: this,
171
+ store: this.store
172
+ }), e = et(new Q(e)), e instanceof Q && e.initialize();
173
+ }
174
+ e.level = this.level + 1, typeof o > "u" || o < 0 ? this.childNodes.push(e) : this.childNodes.splice(o, 0, e), this.updateLeafState();
175
+ }
176
+ insertBefore(e, o) {
177
+ let s;
178
+ o && (s = this.childNodes.indexOf(o)), this.insertChild(e, s);
179
+ }
180
+ insertAfter(e, o) {
181
+ let s;
182
+ o && (s = this.childNodes.indexOf(o), s !== -1 && (s += 1)), this.insertChild(e, s);
183
+ }
184
+ removeChild(e) {
185
+ const o = this.getChildren() || [], s = o.indexOf(e.data);
186
+ s > -1 && o.splice(s, 1);
187
+ const n = this.childNodes.indexOf(e);
188
+ n > -1 && (this.store && this.store.deregisterNode(e), e.parent = null, this.childNodes.splice(n, 1)), this.updateLeafState();
189
+ }
190
+ removeChildByData(e) {
191
+ let o = null;
192
+ for (let s = 0; s < this.childNodes.length; s++)
193
+ if (this.childNodes[s].data === e) {
194
+ o = this.childNodes[s];
195
+ break;
196
+ }
197
+ o && this.removeChild(o);
198
+ }
199
+ expand(e, o) {
200
+ const s = () => {
201
+ if (o) {
202
+ let n = this.parent;
203
+ for (; n.level > 0; )
204
+ n.expanded = !0, n = n.parent;
205
+ }
206
+ this.expanded = !0, e && e(), this.childNodes.forEach((n) => {
207
+ n.canFocus = !0;
208
+ });
209
+ };
210
+ this.shouldLoadData() ? this.loadData((n) => {
211
+ Array.isArray(n) && (this.checked ? this.setChecked(!0, !0) : this.store.checkStrictly || ae(this), s());
212
+ }) : s();
213
+ }
214
+ doCreateChildren(e, o = {}) {
215
+ e.forEach((s) => {
216
+ this.insertChild(Object.assign({ data: s }, o), void 0, !0);
217
+ });
218
+ }
219
+ collapse() {
220
+ this.expanded = !1, this.childNodes.forEach((e) => {
221
+ e.canFocus = !1;
222
+ });
223
+ }
224
+ shouldLoadData() {
225
+ return this.store.lazy === !0 && this.store.load && !this.loaded;
226
+ }
227
+ updateLeafState() {
228
+ if (this.store.lazy === !0 && this.loaded !== !0 && typeof this.isLeafByUser < "u") {
229
+ this.isLeaf = this.isLeafByUser;
230
+ return;
231
+ }
232
+ const e = this.childNodes;
233
+ if (!this.store.lazy || this.store.lazy === !0 && this.loaded === !0) {
234
+ this.isLeaf = !e || e.length === 0;
235
+ return;
236
+ }
237
+ this.isLeaf = !1;
238
+ }
239
+ setChecked(e, o, s, n) {
240
+ if (this.indeterminate = e === "half", this.checked = e === !0, this.store.checkStrictly)
241
+ return;
242
+ if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
243
+ const { all: a, allWithoutDisable: l } = Ce(this.childNodes);
244
+ !this.isLeaf && !a && l && (this.checked = !1, e = !1);
245
+ const p = () => {
246
+ if (o) {
247
+ const N = this.childNodes;
248
+ for (let u = 0, v = N.length; u < v; u++) {
249
+ const k = N[u];
250
+ n = n || e !== !1;
251
+ const C = k.disabled ? k.checked : n;
252
+ k.setChecked(C, o, !0, n);
253
+ }
254
+ const { half: c, all: d } = Ce(N);
255
+ d || (this.checked = d, this.indeterminate = c);
256
+ }
257
+ };
258
+ if (this.shouldLoadData()) {
259
+ this.loadData(() => {
260
+ p(), ae(this);
261
+ }, {
262
+ checked: e !== !1
263
+ });
264
+ return;
265
+ } else
266
+ p();
267
+ }
268
+ const r = this.parent;
269
+ !r || r.level === 0 || s || ae(r);
270
+ }
271
+ getChildren(e = !1) {
272
+ if (this.level === 0)
273
+ return this.data;
274
+ const o = this.data;
275
+ if (!o)
276
+ return null;
277
+ const s = this.store.props;
278
+ let n = "children";
279
+ return s && (n = s.children || "children"), o[n] === void 0 && (o[n] = null), e && !o[n] && (o[n] = []), o[n];
280
+ }
281
+ updateChildren() {
282
+ const e = this.getChildren() || [], o = this.childNodes.map((r) => r.data), s = {}, n = [];
283
+ e.forEach((r, a) => {
284
+ const l = r[ne];
285
+ !!l && o.findIndex((N) => N[ne] === l) >= 0 ? s[l] = { index: a, data: r } : n.push({ index: a, data: r });
286
+ }), this.store.lazy || o.forEach((r) => {
287
+ s[r[ne]] || this.removeChildByData(r);
288
+ }), n.forEach(({ index: r, data: a }) => {
289
+ this.insertChild({ data: a }, r);
290
+ }), this.updateLeafState();
291
+ }
292
+ loadData(e, o = {}) {
293
+ if (this.store.lazy === !0 && this.store.load && !this.loaded && (!this.loading || Object.keys(o).length)) {
294
+ this.loading = !0;
295
+ const s = (r) => {
296
+ this.childNodes = [], this.doCreateChildren(r, o), this.loaded = !0, this.loading = !1, this.updateLeafState(), e && e.call(this, r);
297
+ }, n = () => {
298
+ this.loading = !1;
299
+ };
300
+ this.store.load(this, s, n);
301
+ } else
302
+ e && e.call(this);
303
+ }
304
+ eachNode(e) {
305
+ const o = [this];
306
+ for (; o.length; ) {
307
+ const s = o.shift();
308
+ o.unshift(...s.childNodes), e(s);
309
+ }
310
+ }
311
+ reInitChecked() {
312
+ this.store.checkStrictly || ae(this);
313
+ }
314
+ }
315
+ class gt {
316
+ constructor(e) {
317
+ this.currentNode = null, this.currentNodeKey = null;
318
+ for (const o in e)
319
+ ke(e, o) && (this[o] = e[o]);
320
+ this.nodesMap = {};
321
+ }
322
+ initialize() {
323
+ if (this.root = new Q({
324
+ data: this.data,
325
+ store: this
326
+ }), this.root.initialize(), this.lazy && this.load) {
327
+ const e = this.load;
328
+ e(this.root, (o) => {
329
+ this.root.doCreateChildren(o), this._initDefaultCheckedNodes();
330
+ });
331
+ } else
332
+ this._initDefaultCheckedNodes();
333
+ }
334
+ filter(e) {
335
+ const o = this.filterNodeMethod, s = this.lazy, n = function(r) {
336
+ const a = r.root ? r.root.childNodes : r.childNodes;
337
+ if (a.forEach((l) => {
338
+ l.visible = o.call(l, e, l.data, l), n(l);
339
+ }), !r.visible && a.length) {
340
+ let l = !0;
341
+ l = !a.some((p) => p.visible), r.root ? r.root.visible = l === !1 : r.visible = l === !1;
342
+ }
343
+ e && r.visible && !r.isLeaf && (!s || r.loaded) && r.expand();
344
+ };
345
+ n(this);
346
+ }
347
+ setData(e) {
348
+ e !== this.root.data ? (this.root.setData(e), this._initDefaultCheckedNodes()) : this.root.updateChildren();
349
+ }
350
+ getNode(e) {
351
+ if (e instanceof Q)
352
+ return e;
353
+ const o = je(e) ? be(this.key, e) : e;
354
+ return this.nodesMap[o] || null;
355
+ }
356
+ insertBefore(e, o) {
357
+ const s = this.getNode(o);
358
+ s.parent.insertBefore({ data: e }, s);
359
+ }
360
+ insertAfter(e, o) {
361
+ const s = this.getNode(o);
362
+ s.parent.insertAfter({ data: e }, s);
363
+ }
364
+ remove(e) {
365
+ const o = this.getNode(e);
366
+ o && o.parent && (o === this.currentNode && (this.currentNode = null), o.parent.removeChild(o));
367
+ }
368
+ append(e, o) {
369
+ const s = Me(o) ? this.root : this.getNode(o);
370
+ s && s.insertChild({ data: e });
371
+ }
372
+ _initDefaultCheckedNodes() {
373
+ const e = this.defaultCheckedKeys || [], o = this.nodesMap;
374
+ e.forEach((s) => {
375
+ const n = o[s];
376
+ n && n.setChecked(!0, !this.checkStrictly);
377
+ });
378
+ }
379
+ _initDefaultCheckedNode(e) {
380
+ (this.defaultCheckedKeys || []).includes(e.key) && e.setChecked(!0, !this.checkStrictly);
381
+ }
382
+ setDefaultCheckedKey(e) {
383
+ e !== this.defaultCheckedKeys && (this.defaultCheckedKeys = e, this._initDefaultCheckedNodes());
384
+ }
385
+ registerNode(e) {
386
+ const o = this.key;
387
+ !e || !e.data || (o ? e.key !== void 0 && (this.nodesMap[e.key] = e) : this.nodesMap[e.id] = e);
388
+ }
389
+ deregisterNode(e) {
390
+ !this.key || !e || !e.data || (e.childNodes.forEach((s) => {
391
+ this.deregisterNode(s);
392
+ }), delete this.nodesMap[e.key]);
393
+ }
394
+ getCheckedNodes(e = !1, o = !1) {
395
+ const s = [], n = function(r) {
396
+ (r.root ? r.root.childNodes : r.childNodes).forEach((l) => {
397
+ (l.checked || o && l.indeterminate) && (!e || e && l.isLeaf) && s.push(l.data), n(l);
398
+ });
399
+ };
400
+ return n(this), s;
401
+ }
402
+ getCheckedKeys(e = !1) {
403
+ return this.getCheckedNodes(e).map((o) => (o || {})[this.key]);
404
+ }
405
+ getHalfCheckedNodes() {
406
+ const e = [], o = function(s) {
407
+ (s.root ? s.root.childNodes : s.childNodes).forEach((r) => {
408
+ r.indeterminate && e.push(r.data), o(r);
409
+ });
410
+ };
411
+ return o(this), e;
412
+ }
413
+ getHalfCheckedKeys() {
414
+ return this.getHalfCheckedNodes().map((e) => (e || {})[this.key]);
415
+ }
416
+ _getAllNodes() {
417
+ const e = [], o = this.nodesMap;
418
+ for (const s in o)
419
+ ke(o, s) && e.push(o[s]);
420
+ return e;
421
+ }
422
+ updateChildren(e, o) {
423
+ const s = this.nodesMap[e];
424
+ if (!s)
425
+ return;
426
+ const n = s.childNodes;
427
+ for (let r = n.length - 1; r >= 0; r--) {
428
+ const a = n[r];
429
+ this.remove(a.data);
430
+ }
431
+ for (let r = 0, a = o.length; r < a; r++) {
432
+ const l = o[r];
433
+ this.append(l, s.data);
434
+ }
435
+ }
436
+ _setCheckedKeys(e, o = !1, s) {
437
+ const n = this._getAllNodes().sort((p, N) => p.level - N.level), r = /* @__PURE__ */ Object.create(null), a = Object.keys(s);
438
+ n.forEach((p) => p.setChecked(!1, !1));
439
+ const l = (p) => {
440
+ p.childNodes.forEach((N) => {
441
+ var c;
442
+ r[N.data[e]] = !0, (c = N.childNodes) != null && c.length && l(N);
443
+ });
444
+ };
445
+ for (let p = 0, N = n.length; p < N; p++) {
446
+ const c = n[p], d = c.data[e].toString();
447
+ if (!a.includes(d)) {
448
+ c.checked && !r[d] && c.setChecked(!1, !1);
449
+ continue;
450
+ }
451
+ if (c.childNodes.length && l(c), c.isLeaf || this.checkStrictly) {
452
+ c.setChecked(!0, !1);
453
+ continue;
454
+ }
455
+ if (c.setChecked(!0, !0), o) {
456
+ c.setChecked(!1, !1);
457
+ const v = function(k) {
458
+ k.childNodes.forEach((m) => {
459
+ m.isLeaf || m.setChecked(!1, !1), v(m);
460
+ });
461
+ };
462
+ v(c);
463
+ }
464
+ }
465
+ }
466
+ setCheckedNodes(e, o = !1) {
467
+ const s = this.key, n = {};
468
+ e.forEach((r) => {
469
+ n[(r || {})[s]] = !0;
470
+ }), this._setCheckedKeys(s, o, n);
471
+ }
472
+ setCheckedKeys(e, o = !1) {
473
+ this.defaultCheckedKeys = e;
474
+ const s = this.key, n = {};
475
+ e.forEach((r) => {
476
+ n[r] = !0;
477
+ }), this._setCheckedKeys(s, o, n);
478
+ }
479
+ setDefaultExpandedKeys(e) {
480
+ e = e || [], this.defaultExpandedKeys = e, e.forEach((o) => {
481
+ const s = this.getNode(o);
482
+ s && s.expand(null, this.autoExpandParent);
483
+ });
484
+ }
485
+ setChecked(e, o, s) {
486
+ const n = this.getNode(e);
487
+ n && n.setChecked(!!o, s);
488
+ }
489
+ getCurrentNode() {
490
+ return this.currentNode;
491
+ }
492
+ setCurrentNode(e) {
493
+ const o = this.currentNode;
494
+ o && (o.isCurrent = !1), this.currentNode = e, this.currentNode.isCurrent = !0;
495
+ }
496
+ setUserCurrentNode(e, o = !0) {
497
+ const s = e[this.key], n = this.nodesMap[s];
498
+ this.setCurrentNode(n), o && this.currentNode.level > 1 && this.currentNode.parent.expand(null, !0);
499
+ }
500
+ setCurrentNodeKey(e, o = !0) {
501
+ if (e == null) {
502
+ this.currentNode && (this.currentNode.isCurrent = !1), this.currentNode = null;
503
+ return;
504
+ }
505
+ const s = this.getNode(e);
506
+ s && (this.setCurrentNode(s), o && this.currentNode.level > 1 && this.currentNode.parent.expand(null, !0));
507
+ }
508
+ }
509
+ const vt = re({
510
+ name: "ElTreeNodeContent",
511
+ props: {
512
+ node: {
513
+ type: Object,
514
+ required: !0
515
+ },
516
+ renderContent: Function
517
+ },
518
+ setup(t) {
519
+ const e = se("tree"), o = oe("NodeInstance"), s = oe("RootTree");
520
+ return () => {
521
+ const n = t.node, { data: r, store: a } = n;
522
+ return t.renderContent ? t.renderContent(De, { _self: o, node: n, data: r, store: a }) : me(s.ctx.slots, "default", { node: n, data: r }, () => [
523
+ De("span", { class: e.be("node", "label") }, [n.label])
524
+ ]);
525
+ };
526
+ }
527
+ });
528
+ var kt = /* @__PURE__ */ fe(vt, [["__file", "tree-node-content.vue"]]);
529
+ function Se(t) {
530
+ const e = oe("TreeNodeMap", null), o = {
531
+ treeNodeExpand: (s) => {
532
+ t.node !== s && t.node.collapse();
533
+ },
534
+ children: []
535
+ };
536
+ return e && e.children.push(o), ie("TreeNodeMap", o), {
537
+ broadcastExpanded: (s) => {
538
+ if (t.accordion)
539
+ for (const n of o.children)
540
+ n.treeNodeExpand(s);
541
+ }
542
+ };
543
+ }
544
+ const Ie = Symbol("dragEvents");
545
+ function Nt({ props: t, ctx: e, el$: o, dropIndicator$: s, store: n }) {
546
+ const r = se("tree"), a = E({
547
+ showDropIndicator: !1,
548
+ draggingNode: null,
549
+ dropNode: null,
550
+ allowDrop: !0,
551
+ dropType: null
552
+ });
553
+ return ie(Ie, {
554
+ treeNodeDragStart: ({ event: c, treeNode: d }) => {
555
+ if (typeof t.allowDrag == "function" && !t.allowDrag(d.node))
556
+ return c.preventDefault(), !1;
557
+ c.dataTransfer.effectAllowed = "move";
558
+ try {
559
+ c.dataTransfer.setData("text/plain", "");
560
+ } catch {
561
+ }
562
+ a.value.draggingNode = d, e.emit("node-drag-start", d.node, c);
563
+ },
564
+ treeNodeDragOver: ({ event: c, treeNode: d }) => {
565
+ const u = d, v = a.value.dropNode;
566
+ v && v.node.id !== u.node.id && ye(v.$el, r.is("drop-inner"));
567
+ const k = a.value.draggingNode;
568
+ if (!k || !u)
569
+ return;
570
+ let C = !0, m = !0, x = !0, M = !0;
571
+ typeof t.allowDrop == "function" && (C = t.allowDrop(k.node, u.node, "prev"), M = m = t.allowDrop(k.node, u.node, "inner"), x = t.allowDrop(k.node, u.node, "next")), c.dataTransfer.dropEffect = m || C || x ? "move" : "none", (C || m || x) && (v == null ? void 0 : v.node.id) !== u.node.id && (v && e.emit("node-drag-leave", k.node, v.node, c), e.emit("node-drag-enter", k.node, u.node, c)), C || m || x ? a.value.dropNode = u : a.value.dropNode = null, u.node.nextSibling === k.node && (x = !1), u.node.previousSibling === k.node && (C = !1), u.node.contains(k.node, !1) && (m = !1), (k.node === u.node || k.node.contains(u.node)) && (C = !1, m = !1, x = !1);
572
+ const I = u.$el.querySelector(`.${r.be("node", "content")}`).getBoundingClientRect(), P = o.value.getBoundingClientRect();
573
+ let T;
574
+ const R = C ? m ? 0.25 : x ? 0.45 : 1 : -1, X = x ? m ? 0.75 : C ? 0.55 : 0 : 1;
575
+ let H = -9999;
576
+ const f = c.clientY - I.top;
577
+ f < I.height * R ? T = "before" : f > I.height * X ? T = "after" : m ? T = "inner" : T = "none";
578
+ const _ = u.$el.querySelector(`.${r.be("node", "expand-icon")}`).getBoundingClientRect(), K = s.value;
579
+ T === "before" ? H = _.top - P.top : T === "after" && (H = _.bottom - P.top), K.style.top = `${H}px`, K.style.left = `${_.right - P.left}px`, T === "inner" ? Oe(u.$el, r.is("drop-inner")) : ye(u.$el, r.is("drop-inner")), a.value.showDropIndicator = T === "before" || T === "after", a.value.allowDrop = a.value.showDropIndicator || M, a.value.dropType = T, e.emit("node-drag-over", k.node, u.node, c);
580
+ },
581
+ treeNodeDragEnd: (c) => {
582
+ const { draggingNode: d, dropType: u, dropNode: v } = a.value;
583
+ if (c.preventDefault(), c.dataTransfer.dropEffect = "move", d && v) {
584
+ const k = { data: d.node.data };
585
+ u !== "none" && d.node.remove(), u === "before" ? v.node.parent.insertBefore(k, v.node) : u === "after" ? v.node.parent.insertAfter(k, v.node) : u === "inner" && v.node.insertChild(k), u !== "none" && (n.value.registerNode(k), n.value.key && d.node.eachNode((C) => {
586
+ var m;
587
+ (m = n.value.nodesMap[C.data[n.value.key]]) == null || m.setChecked(C.checked, !n.value.checkStrictly);
588
+ })), ye(v.$el, r.is("drop-inner")), e.emit("node-drag-end", d.node, v.node, u, c), u !== "none" && e.emit("node-drop", d.node, v.node, u, c);
589
+ }
590
+ d && !v && e.emit("node-drag-end", d.node, null, u, c), a.value.showDropIndicator = !1, a.value.draggingNode = null, a.value.dropNode = null, a.value.allowDrop = !0;
591
+ }
592
+ }), {
593
+ dragState: a
594
+ };
595
+ }
596
+ const Ct = re({
597
+ name: "ElTreeNode",
598
+ components: {
599
+ ElCollapseTransition: pt,
600
+ ElCheckbox: Je,
601
+ NodeContent: kt,
602
+ ElIcon: We,
603
+ Loading: it
604
+ },
605
+ props: {
606
+ node: {
607
+ type: Q,
608
+ default: () => ({})
609
+ },
610
+ props: {
611
+ type: Object,
612
+ default: () => ({})
613
+ },
614
+ accordion: Boolean,
615
+ renderContent: Function,
616
+ renderAfterExpand: Boolean,
617
+ showCheckbox: {
618
+ type: Boolean,
619
+ default: !1
620
+ }
621
+ },
622
+ emits: ["node-expand"],
623
+ setup(t, e) {
624
+ const o = se("tree"), { broadcastExpanded: s } = Se(t), n = oe("RootTree"), r = E(!1), a = E(!1), l = E(null), p = E(null), N = E(null), c = oe(Ie), d = xe();
625
+ ie("NodeInstance", d), n || Pe("Tree", "Can not find node's tree."), t.node.expanded && (r.value = !0, a.value = !0);
626
+ const u = n.props.props.children || "children";
627
+ L(() => {
628
+ const f = t.node.data[u];
629
+ return f && [...f];
630
+ }, () => {
631
+ t.node.updateChildren();
632
+ }), L(() => t.node.indeterminate, (f) => {
633
+ C(t.node.checked, f);
634
+ }), L(() => t.node.checked, (f) => {
635
+ C(f, t.node.indeterminate);
636
+ }), L(() => t.node.childNodes.length, () => t.node.reInitChecked()), L(() => t.node.expanded, (f) => {
637
+ ee(() => r.value = f), f && (a.value = !0);
638
+ });
639
+ const v = (f) => be(n.props.nodeKey, f.data), k = (f) => {
640
+ const _ = t.props.class;
641
+ if (!_)
642
+ return {};
643
+ let K;
644
+ if (He(_)) {
645
+ const { data: W } = f;
646
+ K = _(W, f);
647
+ } else
648
+ K = _;
649
+ return Fe(K) ? { [K]: !0 } : K;
650
+ }, C = (f, _) => {
651
+ (l.value !== f || p.value !== _) && n.ctx.emit("check-change", t.node.data, f, _), l.value = f, p.value = _;
652
+ }, m = (f) => {
653
+ Ne(n.store, n.ctx.emit, () => n.store.value.setCurrentNode(t.node)), n.currentNode.value = t.node, n.props.expandOnClickNode && M(), n.props.checkOnClickNode && !t.node.disabled && I(null, {
654
+ target: { checked: !t.node.checked }
655
+ }), n.ctx.emit("node-click", t.node.data, t.node, d, f);
656
+ }, x = (f) => {
657
+ n.instance.vnode.props.onNodeContextmenu && (f.stopPropagation(), f.preventDefault()), n.ctx.emit("node-contextmenu", f, t.node.data, t.node, d);
658
+ }, M = () => {
659
+ t.node.isLeaf || (r.value ? (n.ctx.emit("node-collapse", t.node.data, t.node, d), t.node.collapse()) : (t.node.expand(), e.emit("node-expand", t.node.data, t.node, d)));
660
+ }, I = (f, _) => {
661
+ t.node.setChecked(_.target.checked, !n.props.checkStrictly), ee(() => {
662
+ const K = n.store.value;
663
+ n.ctx.emit("check", t.node.data, {
664
+ checkedNodes: K.getCheckedNodes(),
665
+ checkedKeys: K.getCheckedKeys(),
666
+ halfCheckedNodes: K.getHalfCheckedNodes(),
667
+ halfCheckedKeys: K.getHalfCheckedKeys()
668
+ });
669
+ });
670
+ };
671
+ return {
672
+ ns: o,
673
+ node$: N,
674
+ tree: n,
675
+ expanded: r,
676
+ childNodeRendered: a,
677
+ oldChecked: l,
678
+ oldIndeterminate: p,
679
+ getNodeKey: v,
680
+ getNodeClass: k,
681
+ handleSelectChange: C,
682
+ handleClick: m,
683
+ handleContextMenu: x,
684
+ handleExpandIconClick: M,
685
+ handleCheckChange: I,
686
+ handleChildNodeExpand: (f, _, K) => {
687
+ s(_), n.ctx.emit("node-expand", f, _, K);
688
+ },
689
+ handleDragStart: (f) => {
690
+ n.props.draggable && c.treeNodeDragStart({ event: f, treeNode: t });
691
+ },
692
+ handleDragOver: (f) => {
693
+ f.preventDefault(), n.props.draggable && c.treeNodeDragOver({
694
+ event: f,
695
+ treeNode: { $el: N.value, node: t.node }
696
+ });
697
+ },
698
+ handleDrop: (f) => {
699
+ f.preventDefault();
700
+ },
701
+ handleDragEnd: (f) => {
702
+ n.props.draggable && c.treeNodeDragEnd(f);
703
+ },
704
+ CaretRight: lt
705
+ };
706
+ }
707
+ });
708
+ function mt(t, e, o, s, n, r) {
709
+ const a = J("el-icon"), l = J("el-checkbox"), p = J("loading"), N = J("node-content"), c = J("el-tree-node"), d = J("el-collapse-transition");
710
+ return le((D(), A("div", {
711
+ ref: "node$",
712
+ class: j([
713
+ t.ns.b("node"),
714
+ t.ns.is("expanded", t.expanded),
715
+ t.ns.is("current", t.node.isCurrent),
716
+ t.ns.is("hidden", !t.node.visible),
717
+ t.ns.is("focusable", !t.node.disabled),
718
+ t.ns.is("checked", !t.node.disabled && t.node.checked),
719
+ t.getNodeClass(t.node)
720
+ ]),
721
+ role: "treeitem",
722
+ tabindex: "-1",
723
+ "aria-expanded": t.expanded,
724
+ "aria-disabled": t.node.disabled,
725
+ "aria-checked": t.node.checked,
726
+ draggable: t.tree.props.draggable,
727
+ "data-key": t.getNodeKey(t.node),
728
+ onClick: G(t.handleClick, ["stop"]),
729
+ onContextmenu: t.handleContextMenu,
730
+ onDragstart: G(t.handleDragStart, ["stop"]),
731
+ onDragover: G(t.handleDragOver, ["stop"]),
732
+ onDragend: G(t.handleDragEnd, ["stop"]),
733
+ onDrop: G(t.handleDrop, ["stop"])
734
+ }, [
735
+ w("div", {
736
+ class: j(t.ns.be("node", "content")),
737
+ style: tt({ paddingLeft: (t.node.level - 1) * t.tree.props.indent + "px" })
738
+ }, [
739
+ t.tree.props.icon || t.CaretRight ? (D(), z(a, {
740
+ key: 0,
741
+ class: j([
742
+ t.ns.be("node", "expand-icon"),
743
+ t.ns.is("leaf", t.node.isLeaf),
744
+ {
745
+ expanded: !t.node.isLeaf && t.expanded
746
+ }
747
+ ]),
748
+ onClick: G(t.handleExpandIconClick, ["stop"])
749
+ }, {
750
+ default: q(() => [
751
+ (D(), z(nt(t.tree.props.icon || t.CaretRight)))
752
+ ]),
753
+ _: 1
754
+ }, 8, ["class", "onClick"])) : V("v-if", !0),
755
+ t.showCheckbox ? (D(), z(l, {
756
+ key: 1,
757
+ "model-value": t.node.checked,
758
+ indeterminate: t.node.indeterminate,
759
+ disabled: !!t.node.disabled,
760
+ onClick: G(() => {
761
+ }, ["stop"]),
762
+ onChange: t.handleCheckChange
763
+ }, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onChange"])) : V("v-if", !0),
764
+ t.node.loading ? (D(), z(a, {
765
+ key: 2,
766
+ class: j([t.ns.be("node", "loading-icon"), t.ns.is("loading")])
767
+ }, {
768
+ default: q(() => [
769
+ $(p)
770
+ ]),
771
+ _: 1
772
+ }, 8, ["class"])) : V("v-if", !0),
773
+ $(N, {
774
+ node: t.node,
775
+ "render-content": t.renderContent
776
+ }, null, 8, ["node", "render-content"])
777
+ ], 6),
778
+ $(d, null, {
779
+ default: q(() => [
780
+ !t.renderAfterExpand || t.childNodeRendered ? le((D(), A("div", {
781
+ key: 0,
782
+ class: j(t.ns.be("node", "children")),
783
+ role: "group",
784
+ "aria-expanded": t.expanded
785
+ }, [
786
+ (D(!0), A(te, null, de(t.node.childNodes, (u) => (D(), z(c, {
787
+ key: t.getNodeKey(u),
788
+ "render-content": t.renderContent,
789
+ "render-after-expand": t.renderAfterExpand,
790
+ "show-checkbox": t.showCheckbox,
791
+ node: u,
792
+ accordion: t.accordion,
793
+ props: t.props,
794
+ onNodeExpand: t.handleChildNodeExpand
795
+ }, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]))), 128))
796
+ ], 10, ["aria-expanded"])), [
797
+ [ce, t.expanded]
798
+ ]) : V("v-if", !0)
799
+ ]),
800
+ _: 1
801
+ })
802
+ ], 42, ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key", "onClick", "onContextmenu", "onDragstart", "onDragover", "onDragend", "onDrop"])), [
803
+ [ce, t.node.visible]
804
+ ]);
805
+ }
806
+ var bt = /* @__PURE__ */ fe(Ct, [["render", mt], ["__file", "tree-node.vue"]]);
807
+ function Et({ el$: t }, e) {
808
+ const o = se("tree"), s = _e([]), n = _e([]);
809
+ Te(() => {
810
+ a();
811
+ }), ot(() => {
812
+ s.value = Array.from(t.value.querySelectorAll("[role=treeitem]")), n.value = Array.from(t.value.querySelectorAll("input[type=checkbox]"));
813
+ }), L(n, (l) => {
814
+ l.forEach((p) => {
815
+ p.setAttribute("tabindex", "-1");
816
+ });
817
+ }), ze(t, "keydown", (l) => {
818
+ const p = l.target;
819
+ if (!p.className.includes(o.b("node")))
820
+ return;
821
+ const N = l.code;
822
+ s.value = Array.from(t.value.querySelectorAll(`.${o.is("focusable")}[role=treeitem]`));
823
+ const c = s.value.indexOf(p);
824
+ let d;
825
+ if ([Y.up, Y.down].includes(N)) {
826
+ if (l.preventDefault(), N === Y.up) {
827
+ d = c === -1 ? 0 : c !== 0 ? c - 1 : s.value.length - 1;
828
+ const v = d;
829
+ for (; !e.value.getNode(s.value[d].dataset.key).canFocus; ) {
830
+ if (d--, d === v) {
831
+ d = -1;
832
+ break;
833
+ }
834
+ d < 0 && (d = s.value.length - 1);
835
+ }
836
+ } else {
837
+ d = c === -1 ? 0 : c < s.value.length - 1 ? c + 1 : 0;
838
+ const v = d;
839
+ for (; !e.value.getNode(s.value[d].dataset.key).canFocus; ) {
840
+ if (d++, d === v) {
841
+ d = -1;
842
+ break;
843
+ }
844
+ d >= s.value.length && (d = 0);
845
+ }
846
+ }
847
+ d !== -1 && s.value[d].focus();
848
+ }
849
+ [Y.left, Y.right].includes(N) && (l.preventDefault(), p.click());
850
+ const u = p.querySelector('[type="checkbox"]');
851
+ [Y.enter, Y.space].includes(N) && u && (l.preventDefault(), u.click());
852
+ });
853
+ const a = () => {
854
+ var l;
855
+ s.value = Array.from(t.value.querySelectorAll(`.${o.is("focusable")}[role=treeitem]`)), n.value = Array.from(t.value.querySelectorAll("input[type=checkbox]"));
856
+ const p = t.value.querySelectorAll(`.${o.is("checked")}[role=treeitem]`);
857
+ if (p.length) {
858
+ p[0].setAttribute("tabindex", "0");
859
+ return;
860
+ }
861
+ (l = s.value[0]) == null || l.setAttribute("tabindex", "0");
862
+ };
863
+ }
864
+ const Dt = re({
865
+ name: "ElTree",
866
+ components: { ElTreeNode: bt },
867
+ props: {
868
+ data: {
869
+ type: Array,
870
+ default: () => []
871
+ },
872
+ emptyText: {
873
+ type: String
874
+ },
875
+ renderAfterExpand: {
876
+ type: Boolean,
877
+ default: !0
878
+ },
879
+ nodeKey: String,
880
+ checkStrictly: Boolean,
881
+ defaultExpandAll: Boolean,
882
+ expandOnClickNode: {
883
+ type: Boolean,
884
+ default: !0
885
+ },
886
+ checkOnClickNode: Boolean,
887
+ checkDescendants: {
888
+ type: Boolean,
889
+ default: !1
890
+ },
891
+ autoExpandParent: {
892
+ type: Boolean,
893
+ default: !0
894
+ },
895
+ defaultCheckedKeys: Array,
896
+ defaultExpandedKeys: Array,
897
+ currentNodeKey: [String, Number],
898
+ renderContent: Function,
899
+ showCheckbox: {
900
+ type: Boolean,
901
+ default: !1
902
+ },
903
+ draggable: {
904
+ type: Boolean,
905
+ default: !1
906
+ },
907
+ allowDrag: Function,
908
+ allowDrop: Function,
909
+ props: {
910
+ type: Object,
911
+ default: () => ({
912
+ children: "children",
913
+ label: "label",
914
+ disabled: "disabled"
915
+ })
916
+ },
917
+ lazy: {
918
+ type: Boolean,
919
+ default: !1
920
+ },
921
+ highlightCurrent: Boolean,
922
+ load: Function,
923
+ filterNodeMethod: Function,
924
+ accordion: Boolean,
925
+ indent: {
926
+ type: Number,
927
+ default: 18
928
+ },
929
+ icon: {
930
+ type: Ye
931
+ }
932
+ },
933
+ emits: [
934
+ "check-change",
935
+ "current-change",
936
+ "node-click",
937
+ "node-contextmenu",
938
+ "node-collapse",
939
+ "node-expand",
940
+ "check",
941
+ "node-drag-start",
942
+ "node-drag-end",
943
+ "node-drop",
944
+ "node-drag-leave",
945
+ "node-drag-enter",
946
+ "node-drag-over"
947
+ ],
948
+ setup(t, e) {
949
+ const { t: o } = ct(), s = se("tree"), n = oe(dt, null), r = E(new gt({
950
+ key: t.nodeKey,
951
+ data: t.data,
952
+ lazy: t.lazy,
953
+ props: t.props,
954
+ load: t.load,
955
+ currentNodeKey: t.currentNodeKey,
956
+ checkStrictly: t.checkStrictly,
957
+ checkDescendants: t.checkDescendants,
958
+ defaultCheckedKeys: t.defaultCheckedKeys,
959
+ defaultExpandedKeys: t.defaultExpandedKeys,
960
+ autoExpandParent: t.autoExpandParent,
961
+ defaultExpandAll: t.defaultExpandAll,
962
+ filterNodeMethod: t.filterNodeMethod
963
+ }));
964
+ r.value.initialize();
965
+ const a = E(r.value.root), l = E(null), p = E(null), N = E(null), { broadcastExpanded: c } = Se(t), { dragState: d } = Nt({
966
+ props: t,
967
+ ctx: e,
968
+ el$: p,
969
+ dropIndicator$: N,
970
+ store: r
971
+ });
972
+ Et({ el$: p }, r);
973
+ const u = st(() => {
974
+ const { childNodes: i } = a.value, y = n ? n.hasFilteredOptions !== 0 : !1;
975
+ return (!i || i.length === 0 || i.every(({ visible: O }) => !O)) && !y;
976
+ });
977
+ L(() => t.currentNodeKey, (i) => {
978
+ r.value.setCurrentNodeKey(i);
979
+ }), L(() => t.defaultCheckedKeys, (i) => {
980
+ r.value.setDefaultCheckedKey(i);
981
+ }), L(() => t.defaultExpandedKeys, (i) => {
982
+ r.value.setDefaultExpandedKeys(i);
983
+ }), L(() => t.data, (i) => {
984
+ r.value.setData(i);
985
+ }, { deep: !0 }), L(() => t.checkStrictly, (i) => {
986
+ r.value.checkStrictly = i;
987
+ });
988
+ const v = (i) => {
989
+ if (!t.filterNodeMethod)
990
+ throw new Error("[Tree] filterNodeMethod is required when filter");
991
+ r.value.filter(i);
992
+ }, k = (i) => be(t.nodeKey, i.data), C = (i) => {
993
+ if (!t.nodeKey)
994
+ throw new Error("[Tree] nodeKey is required in getNodePath");
995
+ const y = r.value.getNode(i);
996
+ if (!y)
997
+ return [];
998
+ const O = [y.data];
999
+ let b = y.parent;
1000
+ for (; b && b !== a.value; )
1001
+ O.push(b.data), b = b.parent;
1002
+ return O.reverse();
1003
+ }, m = (i, y) => r.value.getCheckedNodes(i, y), x = (i) => r.value.getCheckedKeys(i), M = () => {
1004
+ const i = r.value.getCurrentNode();
1005
+ return i ? i.data : null;
1006
+ }, I = () => {
1007
+ if (!t.nodeKey)
1008
+ throw new Error("[Tree] nodeKey is required in getCurrentKey");
1009
+ const i = M();
1010
+ return i ? i[t.nodeKey] : null;
1011
+ }, P = (i, y) => {
1012
+ if (!t.nodeKey)
1013
+ throw new Error("[Tree] nodeKey is required in setCheckedNodes");
1014
+ r.value.setCheckedNodes(i, y);
1015
+ }, T = (i, y) => {
1016
+ if (!t.nodeKey)
1017
+ throw new Error("[Tree] nodeKey is required in setCheckedKeys");
1018
+ r.value.setCheckedKeys(i, y);
1019
+ }, R = (i, y, O) => {
1020
+ r.value.setChecked(i, y, O);
1021
+ }, X = () => r.value.getHalfCheckedNodes(), H = () => r.value.getHalfCheckedKeys(), f = (i, y = !0) => {
1022
+ if (!t.nodeKey)
1023
+ throw new Error("[Tree] nodeKey is required in setCurrentNode");
1024
+ Ne(r, e.emit, () => {
1025
+ c(i), r.value.setUserCurrentNode(i, y);
1026
+ });
1027
+ }, _ = (i, y = !0) => {
1028
+ if (!t.nodeKey)
1029
+ throw new Error("[Tree] nodeKey is required in setCurrentKey");
1030
+ Ne(r, e.emit, () => {
1031
+ c(), r.value.setCurrentNodeKey(i, y);
1032
+ });
1033
+ }, K = (i) => r.value.getNode(i), W = (i) => {
1034
+ r.value.remove(i);
1035
+ }, h = (i, y) => {
1036
+ r.value.append(i, y);
1037
+ }, g = (i, y) => {
1038
+ r.value.insertBefore(i, y);
1039
+ }, B = (i, y) => {
1040
+ r.value.insertAfter(i, y);
1041
+ }, Z = (i, y, O) => {
1042
+ c(y), e.emit("node-expand", i, y, O);
1043
+ }, S = (i, y) => {
1044
+ if (!t.nodeKey)
1045
+ throw new Error("[Tree] nodeKey is required in updateKeyChild");
1046
+ r.value.updateChildren(i, y);
1047
+ };
1048
+ return ie("RootTree", {
1049
+ ctx: e,
1050
+ props: t,
1051
+ store: r,
1052
+ root: a,
1053
+ currentNode: l,
1054
+ instance: xe()
1055
+ }), ie(qe, void 0), {
1056
+ ns: s,
1057
+ store: r,
1058
+ root: a,
1059
+ currentNode: l,
1060
+ dragState: d,
1061
+ el$: p,
1062
+ dropIndicator$: N,
1063
+ isEmpty: u,
1064
+ filter: v,
1065
+ getNodeKey: k,
1066
+ getNodePath: C,
1067
+ getCheckedNodes: m,
1068
+ getCheckedKeys: x,
1069
+ getCurrentNode: M,
1070
+ getCurrentKey: I,
1071
+ setCheckedNodes: P,
1072
+ setCheckedKeys: T,
1073
+ setChecked: R,
1074
+ getHalfCheckedNodes: X,
1075
+ getHalfCheckedKeys: H,
1076
+ setCurrentNode: f,
1077
+ setCurrentKey: _,
1078
+ t: o,
1079
+ getNode: K,
1080
+ remove: W,
1081
+ append: h,
1082
+ insertBefore: g,
1083
+ insertAfter: B,
1084
+ handleNodeExpand: Z,
1085
+ updateKeyChildren: S
1086
+ };
1087
+ }
1088
+ });
1089
+ function _t(t, e, o, s, n, r) {
1090
+ const a = J("el-tree-node");
1091
+ return D(), A("div", {
1092
+ ref: "el$",
1093
+ class: j([
1094
+ t.ns.b(),
1095
+ t.ns.is("dragging", !!t.dragState.draggingNode),
1096
+ t.ns.is("drop-not-allow", !t.dragState.allowDrop),
1097
+ t.ns.is("drop-inner", t.dragState.dropType === "inner"),
1098
+ { [t.ns.m("highlight-current")]: t.highlightCurrent }
1099
+ ]),
1100
+ role: "tree"
1101
+ }, [
1102
+ (D(!0), A(te, null, de(t.root.childNodes, (l) => (D(), z(a, {
1103
+ key: t.getNodeKey(l),
1104
+ node: l,
1105
+ props: t.props,
1106
+ accordion: t.accordion,
1107
+ "render-after-expand": t.renderAfterExpand,
1108
+ "show-checkbox": t.showCheckbox,
1109
+ "render-content": t.renderContent,
1110
+ onNodeExpand: t.handleNodeExpand
1111
+ }, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]))), 128)),
1112
+ t.isEmpty ? (D(), A("div", {
1113
+ key: 0,
1114
+ class: j(t.ns.e("empty-block"))
1115
+ }, [
1116
+ me(t.$slots, "empty", {}, () => {
1117
+ var l;
1118
+ return [
1119
+ w("span", {
1120
+ class: j(t.ns.e("empty-text"))
1121
+ }, he((l = t.emptyText) != null ? l : t.t("el.tree.emptyText")), 3)
1122
+ ];
1123
+ })
1124
+ ], 2)) : V("v-if", !0),
1125
+ le(w("div", {
1126
+ ref: "dropIndicator$",
1127
+ class: j(t.ns.e("drop-indicator"))
1128
+ }, null, 2), [
1129
+ [ce, t.dragState.showDropIndicator]
1130
+ ])
1131
+ ], 2);
1132
+ }
1133
+ var Kt = /* @__PURE__ */ fe(Dt, [["render", _t], ["__file", "tree.vue"]]);
1134
+ const wt = we(Kt), Ae = (t) => (rt("data-v-7fd9a5b7"), t = t(), at(), t), xt = { class: "panel_content" }, Tt = { class: "types" }, St = ["onClick"], It = { class: "tree" }, At = { class: "panel_content_null" }, Bt = /* @__PURE__ */ Ae(() => /* @__PURE__ */ w("span", null, "加载中...", -1)), Lt = [
1135
+ Bt
1136
+ ], $t = { class: "pc_tree_type_button" }, jt = ["onClick"], Mt = { class: "pc_tree_content" }, Ot = { class: "tree-search-box" }, Pt = {
1137
+ key: 2,
1138
+ class: "operate-tree-box"
1139
+ }, Ht = { class: "operate-tree" }, Ft = { class: "tree-title-box" }, zt = /* @__PURE__ */ Ae(() => /* @__PURE__ */ w("div", { class: "tree-title" }, "构件树", -1)), qt = { class: "tree-title-icon" }, Rt = { class: "tree-category-box" }, Ut = { class: "tree-category-list" }, Vt = ["onClick"], Wt = { class: "tree-search-box" }, Yt = { class: "tree-content" }, Gt = /* @__PURE__ */ re({
1140
+ __name: "StructureTree",
1141
+ props: ["componentId"],
1142
+ emits: ["closePanel", "emitHandler"],
1143
+ setup(t, { emit: e }) {
1144
+ const o = Re(), s = t, n = E(), r = E(0), a = E(), l = E(), p = E(), N = E(), c = E();
1145
+ let d;
1146
+ const u = E("");
1147
+ L(u, (h) => {
1148
+ var g;
1149
+ (g = n.value) == null || g.filter(h);
1150
+ });
1151
+ const v = (h, g) => h ? g.title.includes(u.value) : !0, k = E(!1), C = {
1152
+ children: "children",
1153
+ label: "title",
1154
+ value: "nodeId"
1155
+ }, m = e, x = (h) => {
1156
+ m("emitHandler", h);
1157
+ }, M = E(!1);
1158
+ Te(() => {
1159
+ U("userInfo").isInShare && U("userInfo").isShareClient && (M.value = !0), o.setReadyById(s.componentId);
1160
+ }), L(
1161
+ () => o.isToolActive(s.componentId),
1162
+ (h) => {
1163
+ if (h) {
1164
+ if (I.value == P.value || I.value == "")
1165
+ return;
1166
+ T(I.value);
1167
+ }
1168
+ }
1169
+ );
1170
+ const I = E(""), P = E("");
1171
+ ge.on("BimViewer", () => {
1172
+ d = window.BimViewer;
1173
+ const { eventTrigger: h } = d;
1174
+ d.objectsExplorer, d.classesExplorer, d.storeysExplorer, h.on("treeAllReady", (g) => {
1175
+ if (l.value = g.objectsData, p.value = g.classesData, N.value = g.storeysData, a.value = l.value, d.SetShowSpaceModeActive(!1), console.log("初始化结构树数据", a.value), a.value) {
1176
+ if (!a.value[0]) return;
1177
+ a.value[0].title = "全部", U("isMobile") || (c.value = a.value[0].nodeId, n.value.setCurrentKey(a.value[0].nodeId)), H(), k.value = !0;
1178
+ }
1179
+ }), U("isMobile") || h.on("pickedEntity", (g) => {
1180
+ k.value !== !1 && (I.value = g.id, o.isToolActive(s.componentId) && T(g.id));
1181
+ }), U("isMobile") && (h.on("touchEntity", (g) => {
1182
+ k.value !== !1 && (I.value = g.id, o.isToolActive(s.componentId) && T(g.id));
1183
+ }), h.on("touchNothing", () => {
1184
+ ee(() => {
1185
+ c.value = "";
1186
+ }), x({
1187
+ isTool: !0,
1188
+ event_target: "StructureTree",
1189
+ event_name: "touchNothing",
1190
+ content: {
1191
+ msg: "pickedNothing"
1192
+ }
1193
+ });
1194
+ }));
1195
+ });
1196
+ const T = (h) => {
1197
+ let g;
1198
+ r.value === 0 ? g = d.objectsExplorer.objectList[h] ? d.objectsExplorer.objectList[h] : null : r.value === 1 ? g = d.classesExplorer.objectList[h] ? d.classesExplorer.objectList[h] : null : r.value === 2 && (g = d.storeysExplorer.objectList[h] ? d.storeysExplorer.objectList[h] : null), g && (ee(() => {
1199
+ X(), c.value = g, n.value.setCurrentKey(g, !0), P.value = h;
1200
+ }), x({
1201
+ isTool: !0,
1202
+ event_target: "StructureTree",
1203
+ event_name: "pickedEntity",
1204
+ content: {
1205
+ entityId: h,
1206
+ viewer_nodeId: g
1207
+ }
1208
+ }));
1209
+ }, R = () => {
1210
+ m("closePanel");
1211
+ }, X = () => {
1212
+ for (var h = 0; h < n.value.store._getAllNodes().length; h++)
1213
+ n.value.store._getAllNodes()[h].expanded = !1;
1214
+ }, H = () => {
1215
+ ee(() => {
1216
+ const h = a.value.map((g) => g.nodeId);
1217
+ n.value.setCheckedKeys(h);
1218
+ });
1219
+ };
1220
+ ge.on("receiveTreeType", (h) => {
1221
+ r.value = h, _();
1222
+ });
1223
+ const f = (h) => {
1224
+ x({
1225
+ isTool: !0,
1226
+ event_target: "StructureTree",
1227
+ event_name: "changeTreeStructure",
1228
+ content: {
1229
+ item: h
1230
+ }
1231
+ }), r.value !== h.id && (r.value = h.id, _());
1232
+ }, _ = () => {
1233
+ r.value === 0 ? a.value = l.value : r.value === 1 ? a.value = p.value : r.value === 2 && (a.value = N.value), a.value[0].title = "全部", ee(() => {
1234
+ c.value = a.value[0].nodeId, n.value.setCurrentKey(a.value[0].nodeId);
1235
+ }), H();
1236
+ }, K = (h) => {
1237
+ h.checked = !h.checked;
1238
+ const g = d.viewer.scene.objects[h.objectId];
1239
+ g ? (d.setEntityVisible(g, h.checked), Z(h, h.checked)) : B(h, h.checked), x({
1240
+ isTool: !0,
1241
+ event_target: "StructureTree",
1242
+ event_name: "clickTreeBox",
1243
+ content: {
1244
+ active_tree: r.value,
1245
+ nodeId: h.nodeId,
1246
+ status: h.checked
1247
+ }
1248
+ });
1249
+ function B(S, i) {
1250
+ if (S.checked = i, S.children.length == 0) {
1251
+ const y = d.viewer.scene.objects[S.objectId];
1252
+ y && d.setEntityVisible(y, S.checked);
1253
+ } else
1254
+ for (let y = 0; y < S.children.length; y++)
1255
+ B(S.children[y], i);
1256
+ }
1257
+ function Z(S, i) {
1258
+ S.checked = i, S.parent && Z(S.parent, i);
1259
+ }
1260
+ }, W = (h, g) => {
1261
+ const B = d.viewer.scene.objects[h.objectId];
1262
+ B && (d.setAllObjectsSelected(!1), d.setEntitySelected(B), d.viewFitEntity(B)), ge.emit("tree_clickNode", B), x({
1263
+ isTool: !0,
1264
+ event_target: "StructureTree",
1265
+ event_name: "clickTreeNode",
1266
+ content: {
1267
+ active_tree: r.value,
1268
+ objectId: h.objectId
1269
+ }
1270
+ });
1271
+ };
1272
+ return (h, g) => {
1273
+ const B = wt, Z = Be, S = Ge, i = Ue, y = $e, O = Le;
1274
+ return D(), A(te, null, [
1275
+ !F(U)("isMobile") && F(Ee).currentTheme == "blue" ? (D(), z(Z, {
1276
+ key: 0,
1277
+ class: "web_tree_container",
1278
+ width: 268,
1279
+ panelTitle: "结构树",
1280
+ "click-handle": R
1281
+ }, {
1282
+ default: q(() => [
1283
+ le(w("div", xt, [
1284
+ w("div", Tt, [
1285
+ (D(!0), A(te, null, de(F(ve), (b) => (D(), A("div", {
1286
+ key: b.id,
1287
+ class: j(["types-item", { "types-item-active": r.value === b.id }]),
1288
+ onClick: (pe) => f(b)
1289
+ }, he(b.name), 11, St))), 128))
1290
+ ]),
1291
+ w("div", It, [
1292
+ $(B, {
1293
+ ref_key: "tree",
1294
+ ref: n,
1295
+ height: 700,
1296
+ "node-key": "nodeId",
1297
+ data: a.value,
1298
+ "current-node-key": c.value,
1299
+ "highlight-current": !0,
1300
+ props: C,
1301
+ "show-checkbox": "",
1302
+ onCheck: K,
1303
+ onNodeClick: W
1304
+ }, null, 8, ["data", "current-node-key"])
1305
+ ])
1306
+ ], 512), [
1307
+ [ce, k.value]
1308
+ ]),
1309
+ le(w("div", At, Lt, 512), [
1310
+ [ce, !k.value]
1311
+ ])
1312
+ ]),
1313
+ _: 1
1314
+ })) : V("", !0),
1315
+ !F(U)("isMobile") && F(Ee).currentTheme == "light-gray" ? (D(), z(y, {
1316
+ key: 1,
1317
+ class: "pc_structure_container",
1318
+ width: 286,
1319
+ panelTitle: "结构树",
1320
+ "click-handle": R
1321
+ }, {
1322
+ default: q(() => [
1323
+ w("div", $t, [
1324
+ (D(!0), A(te, null, de(F(ve), (b) => (D(), A("div", {
1325
+ key: b.id,
1326
+ class: j(["type_button", { type_button_active: r.value === b.id }]),
1327
+ onClick: (pe) => f(b)
1328
+ }, he(b.name), 11, jt))), 128))
1329
+ ]),
1330
+ w("div", Mt, [
1331
+ w("div", Ot, [
1332
+ $(S, {
1333
+ modelValue: u.value,
1334
+ "onUpdate:modelValue": g[0] || (g[0] = (b) => u.value = b),
1335
+ placeholder: "请输入需搜索的内容",
1336
+ "prefix-icon": "Search",
1337
+ clearable: ""
1338
+ }, null, 8, ["modelValue"])
1339
+ ]),
1340
+ $(i, null, {
1341
+ default: q(() => [
1342
+ $(B, {
1343
+ ref_key: "tree",
1344
+ ref: n,
1345
+ height: 840,
1346
+ "node-key": "nodeId",
1347
+ data: a.value,
1348
+ "current-node-key": c.value,
1349
+ "highlight-current": !0,
1350
+ props: C,
1351
+ "filter-node-method": v,
1352
+ "show-checkbox": "",
1353
+ onCheck: K,
1354
+ onNodeClick: W
1355
+ }, null, 8, ["data", "current-node-key"])
1356
+ ]),
1357
+ _: 1
1358
+ })
1359
+ ])
1360
+ ]),
1361
+ _: 1
1362
+ })) : V("", !0),
1363
+ F(U)("isMobile") ? (D(), A("div", Pt, [
1364
+ w("div", Ht, [
1365
+ w("div", Ft, [
1366
+ zt,
1367
+ w("div", qt, [
1368
+ $(O, {
1369
+ class: "close",
1370
+ "click-handle": R
1371
+ })
1372
+ ])
1373
+ ]),
1374
+ w("div", Rt, [
1375
+ $(i, null, {
1376
+ default: q(() => [
1377
+ w("div", Ut, [
1378
+ (D(!0), A(te, null, de(F(ve), (b, pe) => (D(), A("div", {
1379
+ key: pe,
1380
+ class: j(["tree-category-item", {
1381
+ "tree-category-item-active": b.id === r.value
1382
+ }]),
1383
+ onClick: (Jt) => f(b)
1384
+ }, he(b.name), 11, Vt))), 128))
1385
+ ])
1386
+ ]),
1387
+ _: 1
1388
+ })
1389
+ ]),
1390
+ w("div", Wt, [
1391
+ $(S, {
1392
+ modelValue: u.value,
1393
+ "onUpdate:modelValue": g[1] || (g[1] = (b) => u.value = b),
1394
+ placeholder: "请输入需搜索的内容",
1395
+ "prefix-icon": "Search",
1396
+ clearable: ""
1397
+ }, null, 8, ["modelValue"])
1398
+ ]),
1399
+ w("div", Yt, [
1400
+ $(i, null, {
1401
+ default: q(() => [
1402
+ $(B, {
1403
+ ref_key: "tree",
1404
+ ref: n,
1405
+ "node-key": "nodeId",
1406
+ data: a.value,
1407
+ "current-node-key": c.value,
1408
+ "highlight-current": !0,
1409
+ props: C,
1410
+ "filter-node-method": v,
1411
+ "show-checkbox": "",
1412
+ onCheck: K,
1413
+ onNodeClick: W
1414
+ }, null, 8, ["data", "current-node-key"])
1415
+ ]),
1416
+ _: 1
1417
+ })
1418
+ ])
1419
+ ])
1420
+ ])) : V("", !0)
1421
+ ], 64);
1422
+ };
1423
+ }
1424
+ }), dn = /* @__PURE__ */ Ve(Gt, [["__scopeId", "data-v-7fd9a5b7"]]);
1425
+ export {
1426
+ dn as default
1427
+ };