@xtctwins/tctwins-bimx-engine 0.1.21 → 0.1.22

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 (36) hide show
  1. package/dist/{AnnotationTool-BvFG1vTX.mjs → AnnotationTool-CgiAUuLM.mjs} +12 -12
  2. package/dist/BIMX_Viewer_Lib.es.js +4 -4
  3. package/dist/BIMX_Viewer_Lib.umd.js +86 -91
  4. package/dist/CommentTool-BeT1ECI-.mjs +338 -0
  5. package/dist/HiddenTool-qqISJ_uV.mjs +58 -0
  6. package/dist/InspectorTool-CLPjV6WW.mjs +609 -0
  7. package/dist/MeasureTool-Be-rmUeb.mjs +1540 -0
  8. package/dist/{NavigateTool-CCIb1X4u.mjs → NavigateTool-C-VsKB0k.mjs} +7 -7
  9. package/dist/{RoamTool-B1w0efz8.mjs → RoamTool-DdHBNeVg.mjs} +20 -20
  10. package/dist/{ScreenShotTool-BviRVFSg.mjs → ScreenShotTool-Da7D2dkW.mjs} +67 -67
  11. package/dist/SectionTool-CHcmUQul.mjs +624 -0
  12. package/dist/SettingTool-CkR1F4x_.mjs +525 -0
  13. package/dist/StructureTree-DBu9xTue.mjs +1438 -0
  14. package/dist/{debounce-Cg3LHv0T.mjs → debounce-DLzt_q3i.mjs} +13 -13
  15. package/dist/{el-checkbox-lp8vWAXQ.mjs → el-checkbox-DsUGOsl_.mjs} +46 -46
  16. package/dist/{el-input-Bwqgf3wZ.mjs → el-input-UdjCNTtW.mjs} +66 -68
  17. package/dist/{el-input-number-0OWyX276.mjs → el-input-number-ySU-dVGM.mjs} +75 -75
  18. package/dist/{index-CQ8depiU.mjs → index-BfLgpvcd.mjs} +3 -3
  19. package/dist/{index-CYEu_kT4.mjs → index-DQKkZiNH.mjs} +1 -1
  20. package/dist/{index-DX-eYsBm.mjs → index-DyFDTMAw.mjs} +1795 -1794
  21. package/dist/{isEqual-Bg-tyY30.mjs → isEqual-BWlMaoTp.mjs} +9 -9
  22. package/dist/panel.vue_vue_type_style_index_0_lang-ZCDiwNFo.mjs +96 -0
  23. package/dist/style.css +1 -1
  24. package/dist/tallPanel-Cz_n6AsB.mjs +49 -0
  25. package/package.json +1 -1
  26. package/types/components/utilsComponents/tallPanel.vue.d.ts +41 -0
  27. package/types/services/fileApi/fileManager.d.ts +5 -5
  28. package/types/store/themeManager.d.ts +1 -1
  29. package/dist/CommentTool-B6ruuuGV.mjs +0 -338
  30. package/dist/HiddenTool-DW-lRdW5.mjs +0 -58
  31. package/dist/InspectorTool-Cc288ySp.mjs +0 -515
  32. package/dist/MeasureTool-DdfM3U_3.mjs +0 -1542
  33. package/dist/SectionTool-jSjWX32j.mjs +0 -630
  34. package/dist/SettingTool-CVMZAx2H.mjs +0 -536
  35. package/dist/StructureTree-4OCdRRPG.mjs +0 -2672
  36. package/dist/panel.vue_vue_type_style_index_0_scope_true_lang-BfE1I0S9.mjs +0 -82
@@ -0,0 +1,1438 @@
1
+ import { u as re, _ as pe, w as Ke, h as ve, i as Ae, a as Be, r as ge, b as Le, d as je, c as $e, e as Me, f as Oe, E as Q, g as Pe, j as He, k as U, l as V, T as be, m as Fe, n as ze } from "./index-DyFDTMAw.mjs";
2
+ import { _ as qe, a as Re } from "./panel.vue_vue_type_style_index_0_lang-ZCDiwNFo.mjs";
3
+ import { _ as Ue } from "./tallPanel-Cz_n6AsB.mjs";
4
+ import { E as Ve, i as We, a as Ye } from "./el-input-UdjCNTtW.mjs";
5
+ import { E as Ge } from "./el-checkbox-DsUGOsl_.mjs";
6
+ import { defineComponent as de, openBlock as _, createBlock as q, Transition as Je, mergeProps as Qe, unref as z, toHandlers as Xe, withCtx as Y, renderSlot as Ce, reactive as Ze, inject as se, h as Ee, provide as le, ref as D, getCurrentInstance as xe, watch as B, nextTick as W, resolveComponent as Z, withDirectives as ce, createElementBlock as S, normalizeClass as L, withModifiers as X, createElementVNode as K, normalizeStyle as et, resolveDynamicComponent as tt, createCommentVNode as G, createVNode as j, Fragment as ne, renderList as ie, vShow as ue, shallowRef as _e, onMounted as we, onUpdated as nt, computed as ot, toDisplayString as fe, pushScopeId as st, popScopeId as rt } from "vue";
7
+ import { S as ye } from "./const-CbUmfuHy.mjs";
8
+ import { s as dt } from "./token-UNVJeAU8.mjs";
9
+ import { Loading as at, CaretRight as it } from "@element-plus/icons-vue";
10
+ import { u as lt } from "./index-BfLgpvcd.mjs";
11
+ const ct = de({
12
+ name: "ElCollapseTransition"
13
+ }), ut = /* @__PURE__ */ de({
14
+ ...ct,
15
+ setup(t) {
16
+ const e = re("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) => (_(), q(Je, Qe({
47
+ name: z(e).b()
48
+ }, Xe(s)), {
49
+ default: Y(() => [
50
+ Ce(n.$slots, "default")
51
+ ]),
52
+ _: 3
53
+ }, 16, ["name"]));
54
+ }
55
+ });
56
+ var ht = /* @__PURE__ */ pe(ut, [["__file", "collapse-transition.vue"]]);
57
+ const ft = Ke(ht), oe = "$treeNodeId", De = function(t, e) {
58
+ !e || e[oe] || Object.defineProperty(e, oe, {
59
+ value: t.id,
60
+ enumerable: !1,
61
+ configurable: !1,
62
+ writable: !1
63
+ });
64
+ }, me = function(t, e) {
65
+ return t ? e[t] : e[oe];
66
+ }, ke = (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
+ }, Ne = (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 } = Ne(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
+ }, he = 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 pt = 0;
97
+ class ee {
98
+ constructor(e) {
99
+ this.id = pt++, 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
+ ve(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 = he(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) || De(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) || De(this, e), this.data = e, this.childNodes = [];
121
+ let o;
122
+ this.level === 0 && Array.isArray(this.data) ? o = this.data : o = he(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 he(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 he(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 ee)) {
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 = Ze(new ee(e)), e instanceof ee && 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: c } = Ne(this.childNodes);
244
+ !this.isLeaf && !a && c && (this.checked = !1, e = !1);
245
+ const g = () => {
246
+ if (o) {
247
+ const N = this.childNodes;
248
+ for (let h = 0, v = N.length; h < v; h++) {
249
+ const k = N[h];
250
+ n = n || e !== !1;
251
+ const m = k.disabled ? k.checked : n;
252
+ k.setChecked(m, o, !0, n);
253
+ }
254
+ const { half: l, all: d } = Ne(N);
255
+ d || (this.checked = d, this.indeterminate = l);
256
+ }
257
+ };
258
+ if (this.shouldLoadData()) {
259
+ this.loadData(() => {
260
+ g(), ae(this);
261
+ }, {
262
+ checked: e !== !1
263
+ });
264
+ return;
265
+ } else
266
+ g();
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 c = r[oe];
285
+ !!c && o.findIndex((N) => N[oe] === c) >= 0 ? s[c] = { index: a, data: r } : n.push({ index: a, data: r });
286
+ }), this.store.lazy || o.forEach((r) => {
287
+ s[r[oe]] || 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
+ ve(e, o) && (this[o] = e[o]);
320
+ this.nodesMap = {};
321
+ }
322
+ initialize() {
323
+ if (this.root = new ee({
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((c) => {
338
+ c.visible = o.call(c, e, c.data, c), n(c);
339
+ }), !r.visible && a.length) {
340
+ let c = !0;
341
+ c = !a.some((g) => g.visible), r.root ? r.root.visible = c === !1 : r.visible = c === !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 ee)
352
+ return e;
353
+ const o = Ae(e) ? me(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 = Be(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((c) => {
397
+ (c.checked || o && c.indeterminate) && (!e || e && c.isLeaf) && s.push(c.data), n(c);
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
+ ve(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 c = o[r];
433
+ this.append(c, s.data);
434
+ }
435
+ }
436
+ _setCheckedKeys(e, o = !1, s) {
437
+ const n = this._getAllNodes().sort((g, N) => g.level - N.level), r = /* @__PURE__ */ Object.create(null), a = Object.keys(s);
438
+ n.forEach((g) => g.setChecked(!1, !1));
439
+ const c = (g) => {
440
+ g.childNodes.forEach((N) => {
441
+ var l;
442
+ r[N.data[e]] = !0, (l = N.childNodes) != null && l.length && c(N);
443
+ });
444
+ };
445
+ for (let g = 0, N = n.length; g < N; g++) {
446
+ const l = n[g], d = l.data[e].toString();
447
+ if (!a.includes(d)) {
448
+ l.checked && !r[d] && l.setChecked(!1, !1);
449
+ continue;
450
+ }
451
+ if (l.childNodes.length && c(l), l.isLeaf || this.checkStrictly) {
452
+ l.setChecked(!0, !1);
453
+ continue;
454
+ }
455
+ if (l.setChecked(!0, !0), o) {
456
+ l.setChecked(!1, !1);
457
+ const v = function(k) {
458
+ k.childNodes.forEach((b) => {
459
+ b.isLeaf || b.setChecked(!1, !1), v(b);
460
+ });
461
+ };
462
+ v(l);
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 yt = de({
510
+ name: "ElTreeNodeContent",
511
+ props: {
512
+ node: {
513
+ type: Object,
514
+ required: !0
515
+ },
516
+ renderContent: Function
517
+ },
518
+ setup(t) {
519
+ const e = re("tree"), o = se("NodeInstance"), s = se("RootTree");
520
+ return () => {
521
+ const n = t.node, { data: r, store: a } = n;
522
+ return t.renderContent ? t.renderContent(Ee, { _self: o, node: n, data: r, store: a }) : Ce(s.ctx.slots, "default", { node: n, data: r }, () => [
523
+ Ee("span", { class: e.be("node", "label") }, [n.label])
524
+ ]);
525
+ };
526
+ }
527
+ });
528
+ var vt = /* @__PURE__ */ pe(yt, [["__file", "tree-node-content.vue"]]);
529
+ function Te(t) {
530
+ const e = se("TreeNodeMap", null), o = {
531
+ treeNodeExpand: (s) => {
532
+ t.node !== s && t.node.collapse();
533
+ },
534
+ children: []
535
+ };
536
+ return e && e.children.push(o), le("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 Se = Symbol("dragEvents");
545
+ function kt({ props: t, ctx: e, el$: o, dropIndicator$: s, store: n }) {
546
+ const r = re("tree"), a = D({
547
+ showDropIndicator: !1,
548
+ draggingNode: null,
549
+ dropNode: null,
550
+ allowDrop: !0,
551
+ dropType: null
552
+ });
553
+ return le(Se, {
554
+ treeNodeDragStart: ({ event: l, treeNode: d }) => {
555
+ if (typeof t.allowDrag == "function" && !t.allowDrag(d.node))
556
+ return l.preventDefault(), !1;
557
+ l.dataTransfer.effectAllowed = "move";
558
+ try {
559
+ l.dataTransfer.setData("text/plain", "");
560
+ } catch {
561
+ }
562
+ a.value.draggingNode = d, e.emit("node-drag-start", d.node, l);
563
+ },
564
+ treeNodeDragOver: ({ event: l, treeNode: d }) => {
565
+ const h = d, v = a.value.dropNode;
566
+ v && v.node.id !== h.node.id && ge(v.$el, r.is("drop-inner"));
567
+ const k = a.value.draggingNode;
568
+ if (!k || !h)
569
+ return;
570
+ let m = !0, b = !0, x = !0, $ = !0;
571
+ typeof t.allowDrop == "function" && (m = t.allowDrop(k.node, h.node, "prev"), $ = b = t.allowDrop(k.node, h.node, "inner"), x = t.allowDrop(k.node, h.node, "next")), l.dataTransfer.dropEffect = b || m || x ? "move" : "none", (m || b || x) && (v == null ? void 0 : v.node.id) !== h.node.id && (v && e.emit("node-drag-leave", k.node, v.node, l), e.emit("node-drag-enter", k.node, h.node, l)), m || b || x ? a.value.dropNode = h : a.value.dropNode = null, h.node.nextSibling === k.node && (x = !1), h.node.previousSibling === k.node && (m = !1), h.node.contains(k.node, !1) && (b = !1), (k.node === h.node || k.node.contains(h.node)) && (m = !1, b = !1, x = !1);
572
+ const I = h.$el.querySelector(`.${r.be("node", "content")}`).getBoundingClientRect(), M = o.value.getBoundingClientRect();
573
+ let w;
574
+ const R = m ? b ? 0.25 : x ? 0.45 : 1 : -1, J = x ? b ? 0.75 : m ? 0.55 : 0 : 1;
575
+ let O = -9999;
576
+ const p = l.clientY - I.top;
577
+ p < I.height * R ? w = "before" : p > I.height * J ? w = "after" : b ? w = "inner" : w = "none";
578
+ const E = h.$el.querySelector(`.${r.be("node", "expand-icon")}`).getBoundingClientRect(), i = s.value;
579
+ w === "before" ? O = E.top - M.top : w === "after" && (O = E.bottom - M.top), i.style.top = `${O}px`, i.style.left = `${E.right - M.left}px`, w === "inner" ? Le(h.$el, r.is("drop-inner")) : ge(h.$el, r.is("drop-inner")), a.value.showDropIndicator = w === "before" || w === "after", a.value.allowDrop = a.value.showDropIndicator || $, a.value.dropType = w, e.emit("node-drag-over", k.node, h.node, l);
580
+ },
581
+ treeNodeDragEnd: (l) => {
582
+ const { draggingNode: d, dropType: h, dropNode: v } = a.value;
583
+ if (l.preventDefault(), l.dataTransfer.dropEffect = "move", d && v) {
584
+ const k = { data: d.node.data };
585
+ h !== "none" && d.node.remove(), h === "before" ? v.node.parent.insertBefore(k, v.node) : h === "after" ? v.node.parent.insertAfter(k, v.node) : h === "inner" && v.node.insertChild(k), h !== "none" && (n.value.registerNode(k), n.value.key && d.node.eachNode((m) => {
586
+ var b;
587
+ (b = n.value.nodesMap[m.data[n.value.key]]) == null || b.setChecked(m.checked, !n.value.checkStrictly);
588
+ })), ge(v.$el, r.is("drop-inner")), e.emit("node-drag-end", d.node, v.node, h, l), h !== "none" && e.emit("node-drop", d.node, v.node, h, l);
589
+ }
590
+ d && !v && e.emit("node-drag-end", d.node, null, h, l), 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 Nt = de({
597
+ name: "ElTreeNode",
598
+ components: {
599
+ ElCollapseTransition: ft,
600
+ ElCheckbox: Ge,
601
+ NodeContent: vt,
602
+ ElIcon: Ve,
603
+ Loading: at
604
+ },
605
+ props: {
606
+ node: {
607
+ type: ee,
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 = re("tree"), { broadcastExpanded: s } = Te(t), n = se("RootTree"), r = D(!1), a = D(!1), c = D(null), g = D(null), N = D(null), l = se(Se), d = xe();
625
+ le("NodeInstance", d), n || je("Tree", "Can not find node's tree."), t.node.expanded && (r.value = !0, a.value = !0);
626
+ const h = n.props.props.children || "children";
627
+ B(() => {
628
+ const p = t.node.data[h];
629
+ return p && [...p];
630
+ }, () => {
631
+ t.node.updateChildren();
632
+ }), B(() => t.node.indeterminate, (p) => {
633
+ m(t.node.checked, p);
634
+ }), B(() => t.node.checked, (p) => {
635
+ m(p, t.node.indeterminate);
636
+ }), B(() => t.node.childNodes.length, () => t.node.reInitChecked()), B(() => t.node.expanded, (p) => {
637
+ W(() => r.value = p), p && (a.value = !0);
638
+ });
639
+ const v = (p) => me(n.props.nodeKey, p.data), k = (p) => {
640
+ const E = t.props.class;
641
+ if (!E)
642
+ return {};
643
+ let i;
644
+ if ($e(E)) {
645
+ const { data: y } = p;
646
+ i = E(y, p);
647
+ } else
648
+ i = E;
649
+ return Me(i) ? { [i]: !0 } : i;
650
+ }, m = (p, E) => {
651
+ (c.value !== p || g.value !== E) && n.ctx.emit("check-change", t.node.data, p, E), c.value = p, g.value = E;
652
+ }, b = (p) => {
653
+ ke(n.store, n.ctx.emit, () => n.store.value.setCurrentNode(t.node)), n.currentNode.value = t.node, n.props.expandOnClickNode && $(), 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, p);
656
+ }, x = (p) => {
657
+ n.instance.vnode.props.onNodeContextmenu && (p.stopPropagation(), p.preventDefault()), n.ctx.emit("node-contextmenu", p, t.node.data, t.node, d);
658
+ }, $ = () => {
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 = (p, E) => {
661
+ t.node.setChecked(E.target.checked, !n.props.checkStrictly), W(() => {
662
+ const i = n.store.value;
663
+ n.ctx.emit("check", t.node.data, {
664
+ checkedNodes: i.getCheckedNodes(),
665
+ checkedKeys: i.getCheckedKeys(),
666
+ halfCheckedNodes: i.getHalfCheckedNodes(),
667
+ halfCheckedKeys: i.getHalfCheckedKeys()
668
+ });
669
+ });
670
+ };
671
+ return {
672
+ ns: o,
673
+ node$: N,
674
+ tree: n,
675
+ expanded: r,
676
+ childNodeRendered: a,
677
+ oldChecked: c,
678
+ oldIndeterminate: g,
679
+ getNodeKey: v,
680
+ getNodeClass: k,
681
+ handleSelectChange: m,
682
+ handleClick: b,
683
+ handleContextMenu: x,
684
+ handleExpandIconClick: $,
685
+ handleCheckChange: I,
686
+ handleChildNodeExpand: (p, E, i) => {
687
+ s(E), n.ctx.emit("node-expand", p, E, i);
688
+ },
689
+ handleDragStart: (p) => {
690
+ n.props.draggable && l.treeNodeDragStart({ event: p, treeNode: t });
691
+ },
692
+ handleDragOver: (p) => {
693
+ p.preventDefault(), n.props.draggable && l.treeNodeDragOver({
694
+ event: p,
695
+ treeNode: { $el: N.value, node: t.node }
696
+ });
697
+ },
698
+ handleDrop: (p) => {
699
+ p.preventDefault();
700
+ },
701
+ handleDragEnd: (p) => {
702
+ n.props.draggable && l.treeNodeDragEnd(p);
703
+ },
704
+ CaretRight: it
705
+ };
706
+ }
707
+ });
708
+ function Ct(t, e, o, s, n, r) {
709
+ const a = Z("el-icon"), c = Z("el-checkbox"), g = Z("loading"), N = Z("node-content"), l = Z("el-tree-node"), d = Z("el-collapse-transition");
710
+ return ce((_(), S("div", {
711
+ ref: "node$",
712
+ class: L([
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: X(t.handleClick, ["stop"]),
729
+ onContextmenu: t.handleContextMenu,
730
+ onDragstart: X(t.handleDragStart, ["stop"]),
731
+ onDragover: X(t.handleDragOver, ["stop"]),
732
+ onDragend: X(t.handleDragEnd, ["stop"]),
733
+ onDrop: X(t.handleDrop, ["stop"])
734
+ }, [
735
+ K("div", {
736
+ class: L(t.ns.be("node", "content")),
737
+ style: et({ paddingLeft: (t.node.level - 1) * t.tree.props.indent + "px" })
738
+ }, [
739
+ t.tree.props.icon || t.CaretRight ? (_(), q(a, {
740
+ key: 0,
741
+ class: L([
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: X(t.handleExpandIconClick, ["stop"])
749
+ }, {
750
+ default: Y(() => [
751
+ (_(), q(tt(t.tree.props.icon || t.CaretRight)))
752
+ ]),
753
+ _: 1
754
+ }, 8, ["class", "onClick"])) : G("v-if", !0),
755
+ t.showCheckbox ? (_(), q(c, {
756
+ key: 1,
757
+ "model-value": t.node.checked,
758
+ indeterminate: t.node.indeterminate,
759
+ disabled: !!t.node.disabled,
760
+ onClick: X(() => {
761
+ }, ["stop"]),
762
+ onChange: t.handleCheckChange
763
+ }, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onChange"])) : G("v-if", !0),
764
+ t.node.loading ? (_(), q(a, {
765
+ key: 2,
766
+ class: L([t.ns.be("node", "loading-icon"), t.ns.is("loading")])
767
+ }, {
768
+ default: Y(() => [
769
+ j(g)
770
+ ]),
771
+ _: 1
772
+ }, 8, ["class"])) : G("v-if", !0),
773
+ j(N, {
774
+ node: t.node,
775
+ "render-content": t.renderContent
776
+ }, null, 8, ["node", "render-content"])
777
+ ], 6),
778
+ j(d, null, {
779
+ default: Y(() => [
780
+ !t.renderAfterExpand || t.childNodeRendered ? ce((_(), S("div", {
781
+ key: 0,
782
+ class: L(t.ns.be("node", "children")),
783
+ role: "group",
784
+ "aria-expanded": t.expanded
785
+ }, [
786
+ (_(!0), S(ne, null, ie(t.node.childNodes, (h) => (_(), q(l, {
787
+ key: t.getNodeKey(h),
788
+ "render-content": t.renderContent,
789
+ "render-after-expand": t.renderAfterExpand,
790
+ "show-checkbox": t.showCheckbox,
791
+ node: h,
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
+ [ue, t.expanded]
798
+ ]) : G("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
+ [ue, t.node.visible]
804
+ ]);
805
+ }
806
+ var mt = /* @__PURE__ */ pe(Nt, [["render", Ct], ["__file", "tree-node.vue"]]);
807
+ function bt({ el$: t }, e) {
808
+ const o = re("tree"), s = _e([]), n = _e([]);
809
+ we(() => {
810
+ a();
811
+ }), nt(() => {
812
+ s.value = Array.from(t.value.querySelectorAll("[role=treeitem]")), n.value = Array.from(t.value.querySelectorAll("input[type=checkbox]"));
813
+ }), B(n, (c) => {
814
+ c.forEach((g) => {
815
+ g.setAttribute("tabindex", "-1");
816
+ });
817
+ }), Oe(t, "keydown", (c) => {
818
+ const g = c.target;
819
+ if (!g.className.includes(o.b("node")))
820
+ return;
821
+ const N = c.code;
822
+ s.value = Array.from(t.value.querySelectorAll(`.${o.is("focusable")}[role=treeitem]`));
823
+ const l = s.value.indexOf(g);
824
+ let d;
825
+ if ([Q.up, Q.down].includes(N)) {
826
+ if (c.preventDefault(), N === Q.up) {
827
+ d = l === -1 ? 0 : l !== 0 ? l - 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 = l === -1 ? 0 : l < s.value.length - 1 ? l + 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
+ [Q.left, Q.right].includes(N) && (c.preventDefault(), g.click());
850
+ const h = g.querySelector('[type="checkbox"]');
851
+ [Q.enter, Q.space].includes(N) && h && (c.preventDefault(), h.click());
852
+ });
853
+ const a = () => {
854
+ var c;
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 g = t.value.querySelectorAll(`.${o.is("checked")}[role=treeitem]`);
857
+ if (g.length) {
858
+ g[0].setAttribute("tabindex", "0");
859
+ return;
860
+ }
861
+ (c = s.value[0]) == null || c.setAttribute("tabindex", "0");
862
+ };
863
+ }
864
+ const Et = de({
865
+ name: "ElTree",
866
+ components: { ElTreeNode: mt },
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: We
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 } = lt(), s = re("tree"), n = se(dt, null), r = D(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 = D(r.value.root), c = D(null), g = D(null), N = D(null), { broadcastExpanded: l } = Te(t), { dragState: d } = kt({
966
+ props: t,
967
+ ctx: e,
968
+ el$: g,
969
+ dropIndicator$: N,
970
+ store: r
971
+ });
972
+ bt({ el$: g }, r);
973
+ const h = ot(() => {
974
+ const { childNodes: u } = a.value, f = n ? n.hasFilteredOptions !== 0 : !1;
975
+ return (!u || u.length === 0 || u.every(({ visible: A }) => !A)) && !f;
976
+ });
977
+ B(() => t.currentNodeKey, (u) => {
978
+ r.value.setCurrentNodeKey(u);
979
+ }), B(() => t.defaultCheckedKeys, (u) => {
980
+ r.value.setDefaultCheckedKey(u);
981
+ }), B(() => t.defaultExpandedKeys, (u) => {
982
+ r.value.setDefaultExpandedKeys(u);
983
+ }), B(() => t.data, (u) => {
984
+ r.value.setData(u);
985
+ }, { deep: !0 }), B(() => t.checkStrictly, (u) => {
986
+ r.value.checkStrictly = u;
987
+ });
988
+ const v = (u) => {
989
+ if (!t.filterNodeMethod)
990
+ throw new Error("[Tree] filterNodeMethod is required when filter");
991
+ r.value.filter(u);
992
+ }, k = (u) => me(t.nodeKey, u.data), m = (u) => {
993
+ if (!t.nodeKey)
994
+ throw new Error("[Tree] nodeKey is required in getNodePath");
995
+ const f = r.value.getNode(u);
996
+ if (!f)
997
+ return [];
998
+ const A = [f.data];
999
+ let te = f.parent;
1000
+ for (; te && te !== a.value; )
1001
+ A.push(te.data), te = te.parent;
1002
+ return A.reverse();
1003
+ }, b = (u, f) => r.value.getCheckedNodes(u, f), x = (u) => r.value.getCheckedKeys(u), $ = () => {
1004
+ const u = r.value.getCurrentNode();
1005
+ return u ? u.data : null;
1006
+ }, I = () => {
1007
+ if (!t.nodeKey)
1008
+ throw new Error("[Tree] nodeKey is required in getCurrentKey");
1009
+ const u = $();
1010
+ return u ? u[t.nodeKey] : null;
1011
+ }, M = (u, f) => {
1012
+ if (!t.nodeKey)
1013
+ throw new Error("[Tree] nodeKey is required in setCheckedNodes");
1014
+ r.value.setCheckedNodes(u, f);
1015
+ }, w = (u, f) => {
1016
+ if (!t.nodeKey)
1017
+ throw new Error("[Tree] nodeKey is required in setCheckedKeys");
1018
+ r.value.setCheckedKeys(u, f);
1019
+ }, R = (u, f, A) => {
1020
+ r.value.setChecked(u, f, A);
1021
+ }, J = () => r.value.getHalfCheckedNodes(), O = () => r.value.getHalfCheckedKeys(), p = (u, f = !0) => {
1022
+ if (!t.nodeKey)
1023
+ throw new Error("[Tree] nodeKey is required in setCurrentNode");
1024
+ ke(r, e.emit, () => {
1025
+ l(u), r.value.setUserCurrentNode(u, f);
1026
+ });
1027
+ }, E = (u, f = !0) => {
1028
+ if (!t.nodeKey)
1029
+ throw new Error("[Tree] nodeKey is required in setCurrentKey");
1030
+ ke(r, e.emit, () => {
1031
+ l(), r.value.setCurrentNodeKey(u, f);
1032
+ });
1033
+ }, i = (u) => r.value.getNode(u), y = (u) => {
1034
+ r.value.remove(u);
1035
+ }, C = (u, f) => {
1036
+ r.value.append(u, f);
1037
+ }, H = (u, f) => {
1038
+ r.value.insertBefore(u, f);
1039
+ }, T = (u, f) => {
1040
+ r.value.insertAfter(u, f);
1041
+ }, F = (u, f, A) => {
1042
+ l(f), e.emit("node-expand", u, f, A);
1043
+ }, P = (u, f) => {
1044
+ if (!t.nodeKey)
1045
+ throw new Error("[Tree] nodeKey is required in updateKeyChild");
1046
+ r.value.updateChildren(u, f);
1047
+ };
1048
+ return le("RootTree", {
1049
+ ctx: e,
1050
+ props: t,
1051
+ store: r,
1052
+ root: a,
1053
+ currentNode: c,
1054
+ instance: xe()
1055
+ }), le(Pe, void 0), {
1056
+ ns: s,
1057
+ store: r,
1058
+ root: a,
1059
+ currentNode: c,
1060
+ dragState: d,
1061
+ el$: g,
1062
+ dropIndicator$: N,
1063
+ isEmpty: h,
1064
+ filter: v,
1065
+ getNodeKey: k,
1066
+ getNodePath: m,
1067
+ getCheckedNodes: b,
1068
+ getCheckedKeys: x,
1069
+ getCurrentNode: $,
1070
+ getCurrentKey: I,
1071
+ setCheckedNodes: M,
1072
+ setCheckedKeys: w,
1073
+ setChecked: R,
1074
+ getHalfCheckedNodes: J,
1075
+ getHalfCheckedKeys: O,
1076
+ setCurrentNode: p,
1077
+ setCurrentKey: E,
1078
+ t: o,
1079
+ getNode: i,
1080
+ remove: y,
1081
+ append: C,
1082
+ insertBefore: H,
1083
+ insertAfter: T,
1084
+ handleNodeExpand: F,
1085
+ updateKeyChildren: P
1086
+ };
1087
+ }
1088
+ });
1089
+ function _t(t, e, o, s, n, r) {
1090
+ const a = Z("el-tree-node");
1091
+ return _(), S("div", {
1092
+ ref: "el$",
1093
+ class: L([
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
+ (_(!0), S(ne, null, ie(t.root.childNodes, (c) => (_(), q(a, {
1103
+ key: t.getNodeKey(c),
1104
+ node: c,
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 ? (_(), S("div", {
1113
+ key: 0,
1114
+ class: L(t.ns.e("empty-block"))
1115
+ }, [
1116
+ Ce(t.$slots, "empty", {}, () => {
1117
+ var c;
1118
+ return [
1119
+ K("span", {
1120
+ class: L(t.ns.e("empty-text"))
1121
+ }, fe((c = t.emptyText) != null ? c : t.t("el.tree.emptyText")), 3)
1122
+ ];
1123
+ })
1124
+ ], 2)) : G("v-if", !0),
1125
+ ce(K("div", {
1126
+ ref: "dropIndicator$",
1127
+ class: L(t.ns.e("drop-indicator"))
1128
+ }, null, 2), [
1129
+ [ue, t.dragState.showDropIndicator]
1130
+ ])
1131
+ ], 2);
1132
+ }
1133
+ var Dt = /* @__PURE__ */ pe(Et, [["render", _t], ["__file", "tree.vue"]]);
1134
+ const Kt = Ke(Dt), Ie = (t) => (st("data-v-5b833785"), t = t(), rt(), t), xt = { class: "panel_content" }, wt = { class: "types" }, Tt = ["onClick"], St = { class: "tree" }, It = { class: "panel_content_null" }, At = /* @__PURE__ */ Ie(() => /* @__PURE__ */ K("span", null, "加载中...", -1)), Bt = [
1135
+ At
1136
+ ], Lt = { class: "pc_tree_type_button" }, jt = ["onClick"], $t = { class: "pc_tree_content" }, Mt = { class: "tree-search-box" }, Ot = {
1137
+ key: 2,
1138
+ class: "operate-tree-box"
1139
+ }, Pt = { class: "operate-tree" }, Ht = { class: "tree-title-box" }, Ft = /* @__PURE__ */ Ie(() => /* @__PURE__ */ K("div", { class: "tree-title" }, "构件树", -1)), zt = { class: "tree-title-icon" }, qt = { class: "tree-category-box" }, Rt = { class: "tree-category-list" }, Ut = ["onClick"], Vt = { class: "tree-search-box" }, Wt = { class: "tree-content" }, Yt = /* @__PURE__ */ de({
1140
+ __name: "StructureTree",
1141
+ props: ["componentId"],
1142
+ emits: ["closePanel", "emitHandler"],
1143
+ setup(t, { emit: e }) {
1144
+ const o = He(), s = t, n = D(), r = D(0), a = D(), c = D(), g = D(), N = D(), l = D();
1145
+ let d;
1146
+ const h = D("");
1147
+ B(h, (i) => {
1148
+ var y;
1149
+ (y = n.value) == null || y.filter(i);
1150
+ });
1151
+ const v = (i, y) => i ? y.title.includes(h.value) : !0, k = D(!1), m = {
1152
+ children: "children",
1153
+ label: "title",
1154
+ value: "nodeId"
1155
+ }, b = e, x = (i) => {
1156
+ b("emitHandler", i);
1157
+ }, $ = D(!1);
1158
+ we(() => {
1159
+ U("userInfo").isInShare && U("userInfo").isShareClient && ($.value = !0), o.setReadyById(s.componentId);
1160
+ }), V.on("BimViewer", () => {
1161
+ d = window.BimViewer;
1162
+ const { eventTrigger: i } = d;
1163
+ d.objectsExplorer, d.classesExplorer, d.storeysExplorer, i.on("treeAllReady", (y) => {
1164
+ c.value = y.objectsData, g.value = y.classesData, N.value = y.storeysData, a.value = c.value, d.SetShowSpaceModeActive(!1), console.log("初始化结构树数据", a.value), W(() => {
1165
+ if (a.value) {
1166
+ if (!a.value[0]) return;
1167
+ a.value[0].title = "全部", U("isMobile") || (l.value = a.value[0].nodeId, n.value.setCurrentKey(a.value[0].nodeId)), w(), k.value = !0;
1168
+ }
1169
+ });
1170
+ }), U("isMobile") || i.on("pickedEntity", (y) => {
1171
+ if (k.value === !1) return;
1172
+ let C;
1173
+ r.value === 0 ? C = d.objectsExplorer.objectList[y.id] ? d.objectsExplorer.objectList[y.id] : null : r.value === 1 ? C = d.classesExplorer.objectList[y.id] ? d.classesExplorer.objectList[y.id] : null : r.value === 2 && (C = d.storeysExplorer.objectList[y.id] ? d.storeysExplorer.objectList[y.id] : null), C && (n.value.getNode(C), W(() => {
1174
+ M(), l.value = C, n.value.setCurrentKey(C, !0);
1175
+ }), x({
1176
+ isTool: !0,
1177
+ event_target: "StructureTree",
1178
+ event_name: "pickedEntity",
1179
+ content: {
1180
+ entityId: y.id,
1181
+ viewer_nodeId: C
1182
+ }
1183
+ }));
1184
+ }), U("isMobile") && (i.on("touchEntity", (y) => {
1185
+ if (k.value === !1) return;
1186
+ let C, H;
1187
+ if (r.value === 0 ? C = d.objectsExplorer.objectList[y.id] ? d.objectsExplorer.objectList[y.id] : null : r.value === 1 ? C = d.classesExplorer.objectList[y.id] ? d.classesExplorer.objectList[y.id] : null : r.value === 2 && (C = d.storeysExplorer.objectList[y.id] ? d.storeysExplorer.objectList[y.id] : null), !!C) {
1188
+ if (H = n.value.getNode(C), !H) {
1189
+ console.log("node!!!");
1190
+ return;
1191
+ }
1192
+ W(() => {
1193
+ M(), l.value = C, n.value.setCurrentKey(C, !0);
1194
+ });
1195
+ }
1196
+ }), i.on("touchNothing", () => {
1197
+ W(() => {
1198
+ l.value = "";
1199
+ }), x({
1200
+ isTool: !0,
1201
+ event_target: "StructureTree",
1202
+ event_name: "touchNothing",
1203
+ content: {
1204
+ msg: "pickedNothing"
1205
+ }
1206
+ });
1207
+ }));
1208
+ });
1209
+ const I = () => {
1210
+ b("closePanel");
1211
+ }, M = () => {
1212
+ for (var i = 0; i < n.value.store._getAllNodes().length; i++)
1213
+ n.value.store._getAllNodes()[i].expanded = !1;
1214
+ }, w = () => {
1215
+ W(() => {
1216
+ const i = a.value.map((y) => y.nodeId);
1217
+ n.value.setCheckedKeys(i);
1218
+ });
1219
+ };
1220
+ V.on("receiveTreeType", (i) => {
1221
+ r.value = i, J();
1222
+ });
1223
+ const R = (i) => {
1224
+ x({
1225
+ isTool: !0,
1226
+ event_target: "StructureTree",
1227
+ event_name: "changeTreeStructure",
1228
+ content: {
1229
+ item: i
1230
+ }
1231
+ }), r.value !== i.id && (r.value = i.id, J());
1232
+ }, J = () => {
1233
+ r.value === 0 ? a.value = c.value : r.value === 1 ? a.value = g.value : r.value === 2 && (a.value = N.value), a.value[0].title = "全部", W(() => {
1234
+ l.value = a.value[0].nodeId, n.value.setCurrentKey(a.value[0].nodeId);
1235
+ }), w();
1236
+ }, O = (i) => {
1237
+ i.checked = !i.checked;
1238
+ const y = d.viewer.scene.objects[i.objectId];
1239
+ y ? (d.setEntityVisible(y, i.checked), H(i, i.checked)) : C(i, i.checked), x({
1240
+ isTool: !0,
1241
+ event_target: "StructureTree",
1242
+ event_name: "clickTreeBox",
1243
+ content: {
1244
+ active_tree: r.value,
1245
+ nodeId: i.nodeId,
1246
+ status: i.checked
1247
+ }
1248
+ });
1249
+ function C(T, F) {
1250
+ if (T.checked = F, T.children.length == 0) {
1251
+ const P = d.viewer.scene.objects[T.objectId];
1252
+ P && d.setEntityVisible(P, T.checked);
1253
+ } else
1254
+ for (let P = 0; P < T.children.length; P++)
1255
+ C(T.children[P], F);
1256
+ }
1257
+ function H(T, F) {
1258
+ T.checked = F, T.parent && H(T.parent, F);
1259
+ }
1260
+ }, p = (i, y) => {
1261
+ const C = d.viewer.scene.objects[i.objectId];
1262
+ C && (d.setAllObjectsSelected(!1), d.setEntitySelected(C), d.viewFitEntity(C)), x({
1263
+ isTool: !0,
1264
+ event_target: "StructureTree",
1265
+ event_name: "clickTreeNode",
1266
+ content: {
1267
+ active_tree: r.value,
1268
+ objectId: i.objectId
1269
+ }
1270
+ });
1271
+ };
1272
+ V.on("getTreeNodeId1", (i) => {
1273
+ n.value.setChecked(i.nodeId, i.status);
1274
+ }), V.on("getTreeNodeId2", (i) => {
1275
+ n.value.setChecked(i.nodeId, i.status);
1276
+ }), V.on("getTreeNodeId3", (i) => {
1277
+ n.value.setChecked(i.nodeId, i.status);
1278
+ }), V.on("structure_tree_title_objects", (i) => {
1279
+ E(i);
1280
+ }), V.on("structure_tree_title_categorys", (i) => {
1281
+ E(i);
1282
+ }), V.on("structure_tree_title_floors", (i) => {
1283
+ E(i);
1284
+ });
1285
+ const E = (i) => {
1286
+ M(), l.value = i.nodeId, n.value.setCurrentKey(i.nodeId, !0);
1287
+ };
1288
+ return (i, y) => {
1289
+ const C = Kt, H = qe, T = Ye, F = Ue, P = Re, u = Fe;
1290
+ return _(), S(ne, null, [
1291
+ !z(U)("isMobile") && z(be).currentTheme == "blue" ? (_(), q(H, {
1292
+ key: 0,
1293
+ class: "structure_container",
1294
+ width: 268,
1295
+ panelTitle: "结构树",
1296
+ "click-handle": I
1297
+ }, {
1298
+ default: Y(() => [
1299
+ ce(K("div", xt, [
1300
+ K("div", wt, [
1301
+ (_(!0), S(ne, null, ie(z(ye), (f) => (_(), S("div", {
1302
+ key: f.id,
1303
+ class: L(["types-item", { "types-item-active": r.value === f.id }]),
1304
+ onClick: (A) => R(f)
1305
+ }, fe(f.name), 11, Tt))), 128))
1306
+ ]),
1307
+ K("div", St, [
1308
+ j(C, {
1309
+ ref_key: "tree",
1310
+ ref: n,
1311
+ height: 700,
1312
+ "node-key": "nodeId",
1313
+ data: a.value,
1314
+ "current-node-key": l.value,
1315
+ "highlight-current": !0,
1316
+ props: m,
1317
+ "show-checkbox": "",
1318
+ onCheck: O,
1319
+ onNodeClick: p
1320
+ }, null, 8, ["data", "current-node-key"])
1321
+ ])
1322
+ ], 512), [
1323
+ [ue, k.value]
1324
+ ]),
1325
+ ce(K("div", It, Bt, 512), [
1326
+ [ue, !k.value]
1327
+ ])
1328
+ ]),
1329
+ _: 1
1330
+ })) : G("", !0),
1331
+ !z(U)("isMobile") && z(be).currentTheme == "light-gray" ? (_(), q(F, {
1332
+ key: 1,
1333
+ class: "pc_structure_container",
1334
+ width: 286,
1335
+ panelTitle: "结构树",
1336
+ "click-handle": I
1337
+ }, {
1338
+ default: Y(() => [
1339
+ K("div", Lt, [
1340
+ (_(!0), S(ne, null, ie(z(ye), (f) => (_(), S("div", {
1341
+ key: f.id,
1342
+ class: L(["type_button", { type_button_active: r.value === f.id }]),
1343
+ onClick: (A) => R(f)
1344
+ }, fe(f.name), 11, jt))), 128))
1345
+ ]),
1346
+ K("div", $t, [
1347
+ K("div", Mt, [
1348
+ j(T, {
1349
+ modelValue: h.value,
1350
+ "onUpdate:modelValue": y[0] || (y[0] = (f) => h.value = f),
1351
+ placeholder: "请输入需搜索的内容",
1352
+ "prefix-icon": "Search",
1353
+ clearable: ""
1354
+ }, null, 8, ["modelValue"])
1355
+ ]),
1356
+ j(C, {
1357
+ ref_key: "tree",
1358
+ ref: n,
1359
+ height: 840,
1360
+ "node-key": "nodeId",
1361
+ data: a.value,
1362
+ "current-node-key": l.value,
1363
+ "highlight-current": !0,
1364
+ props: m,
1365
+ "filter-node-method": v,
1366
+ "show-checkbox": "",
1367
+ onCheck: O,
1368
+ onNodeClick: p
1369
+ }, null, 8, ["data", "current-node-key"])
1370
+ ])
1371
+ ]),
1372
+ _: 1
1373
+ })) : G("", !0),
1374
+ z(U)("isMobile") ? (_(), S("div", Ot, [
1375
+ K("div", Pt, [
1376
+ K("div", Ht, [
1377
+ Ft,
1378
+ K("div", zt, [
1379
+ j(P, {
1380
+ class: "close",
1381
+ "click-handle": I
1382
+ })
1383
+ ])
1384
+ ]),
1385
+ K("div", qt, [
1386
+ j(u, null, {
1387
+ default: Y(() => [
1388
+ K("div", Rt, [
1389
+ (_(!0), S(ne, null, ie(z(ye), (f, A) => (_(), S("div", {
1390
+ key: A,
1391
+ class: L(["tree-category-item", {
1392
+ "tree-category-item-active": f.id === r.value
1393
+ }]),
1394
+ onClick: (te) => R(f)
1395
+ }, fe(f.name), 11, Ut))), 128))
1396
+ ])
1397
+ ]),
1398
+ _: 1
1399
+ })
1400
+ ]),
1401
+ K("div", Vt, [
1402
+ j(T, {
1403
+ modelValue: h.value,
1404
+ "onUpdate:modelValue": y[1] || (y[1] = (f) => h.value = f),
1405
+ placeholder: "请输入需搜索的内容",
1406
+ "prefix-icon": "Search",
1407
+ clearable: ""
1408
+ }, null, 8, ["modelValue"])
1409
+ ]),
1410
+ K("div", Wt, [
1411
+ j(u, null, {
1412
+ default: Y(() => [
1413
+ j(C, {
1414
+ ref_key: "tree",
1415
+ ref: n,
1416
+ "node-key": "nodeId",
1417
+ data: a.value,
1418
+ "current-node-key": l.value,
1419
+ "highlight-current": !0,
1420
+ props: m,
1421
+ "filter-node-method": v,
1422
+ "show-checkbox": "",
1423
+ onCheck: O,
1424
+ onNodeClick: p
1425
+ }, null, 8, ["data", "current-node-key"])
1426
+ ]),
1427
+ _: 1
1428
+ })
1429
+ ])
1430
+ ])
1431
+ ])) : G("", !0)
1432
+ ], 64);
1433
+ };
1434
+ }
1435
+ }), rn = /* @__PURE__ */ ze(Yt, [["__scopeId", "data-v-5b833785"]]);
1436
+ export {
1437
+ rn as default
1438
+ };