@xtctwins/tctwins-bimx-engine 0.1.0

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 (56) hide show
  1. package/README.md +1 -0
  2. package/dist/AnnotationTool-j9uTpTri.mjs +181 -0
  3. package/dist/BIMX_Viewer_Lib.es.js +8 -0
  4. package/dist/BIMX_Viewer_Lib.umd.js +90165 -0
  5. package/dist/CommentTool-BLrsulc_.mjs +186 -0
  6. package/dist/InspectorTool-BouA94us.mjs +166 -0
  7. package/dist/MeasureTool-CbYIFTPr.mjs +1468 -0
  8. package/dist/RoamTool-CXZPca_M.mjs +43 -0
  9. package/dist/ScreenShotTool-BiNcu9RZ.mjs +368 -0
  10. package/dist/SectionTool-DogiOv1d.mjs +466 -0
  11. package/dist/SettingTool-ClISeAhW.mjs +1261 -0
  12. package/dist/StructureTree-CmsIBbBk.mjs +1415 -0
  13. package/dist/closeButton.vue_vue_type_style_index_0_scope_true_lang-CBPVV86B.mjs +52 -0
  14. package/dist/const-DeAig7Pj.mjs +202 -0
  15. package/dist/debounce-B430Iy_D.mjs +80 -0
  16. package/dist/el-checkbox-id3wFY0e.mjs +479 -0
  17. package/dist/el-input-BW5rElpS.mjs +559 -0
  18. package/dist/el-scrollbar-La242VUu.mjs +34 -0
  19. package/dist/favicon.ico +0 -0
  20. package/dist/icon-DZm1Csdm.mjs +193 -0
  21. package/dist/index-3StVDuUH.mjs +115680 -0
  22. package/dist/index-BgjjA9sB.mjs +502 -0
  23. package/dist/index-L-tY1Gou.mjs +286 -0
  24. package/dist/index.html +17 -0
  25. package/dist/style.css +1 -0
  26. package/dist/use-form-item-DkYURTpK.mjs +105 -0
  27. package/package.json +67 -0
  28. package/types/BIMX_Viewer_Initial/viewerInitial.d.ts +16 -0
  29. package/types/components/BimViewerComponents/AnnotationTool.vue.d.ts +10 -0
  30. package/types/components/BimViewerComponents/CommentTool.vue.d.ts +14 -0
  31. package/types/components/BimViewerComponents/InspectorTool.vue.d.ts +14 -0
  32. package/types/components/BimViewerComponents/MeasureTool.vue.d.ts +12 -0
  33. package/types/components/BimViewerComponents/RoamTool.vue.d.ts +8 -0
  34. package/types/components/BimViewerComponents/ScreenShotTool.vue.d.ts +12 -0
  35. package/types/components/BimViewerComponents/SectionTool.vue.d.ts +6 -0
  36. package/types/components/BimViewerComponents/SettingTool.vue.d.ts +6 -0
  37. package/types/components/BimViewerComponents/StructureTree.vue.d.ts +6 -0
  38. package/types/components/BimViewerComponents/Toolbar.vue.d.ts +12 -0
  39. package/types/components/BimViewerComponents/emptyPage.vue.d.ts +8 -0
  40. package/types/components/BimX_Viewer.vue.d.ts +7 -0
  41. package/types/components/index.d.ts +4 -0
  42. package/types/components/types.d.ts +1 -0
  43. package/types/components/utilsComponents/closeButton.vue.d.ts +41 -0
  44. package/types/index.d.ts +9 -0
  45. package/types/main.d.ts +1 -0
  46. package/types/pages/mainView.vue.d.ts +7 -0
  47. package/types/router/index.d.ts +2 -0
  48. package/types/services/request/config.d.ts +13 -0
  49. package/types/store/components.d.ts +6 -0
  50. package/types/store/const.d.ts +200 -0
  51. package/types/store/ifcPropertyReflect.d.ts +1 -0
  52. package/types/store/toolbars.d.ts +96 -0
  53. package/types/utils/OSSHelper.d.ts +5 -0
  54. package/types/utils/eventBus.d.ts +2 -0
  55. package/types/utils/roles.d.ts +1 -0
  56. package/types/utils/splitType.d.ts +3 -0
@@ -0,0 +1,1415 @@
1
+ import { i as Pe, m as xt, b as de, d as U, a as ue, u as me, c as Se, e as Me, h as wt, t as Tt, f as It, g as Mt, _ as nt, j as Kt, w as Ot, k as V, l as Lt } from "./index-3StVDuUH.mjs";
2
+ import { E as Rt } from "./el-checkbox-id3wFY0e.mjs";
3
+ import { B as Dt } from "./el-scrollbar-La242VUu.mjs";
4
+ import { _ as zt } from "./closeButton.vue_vue_type_style_index_0_scope_true_lang-CBPVV86B.mjs";
5
+ import { getCurrentInstance as we, computed as M, defineComponent as ce, ref as z, reactive as At, unref as i, watch as _e, onBeforeUnmount as Bt, h as re, withModifiers as Ee, onMounted as Ht, onUpdated as Ft, resolveDynamicComponent as Ke, nextTick as Q, shallowRef as $t, inject as ot, openBlock as ee, createElementBlock as ye, normalizeClass as ie, createElementVNode as se, normalizeStyle as lt, createBlock as Ce, withCtx as st, createCommentVNode as We, createVNode as Oe, useSlots as Pt, provide as Ue, toDisplayString as at, withDirectives as Ye, Fragment as jt, renderList as Vt, vShow as Xe, pushScopeId as Gt, popScopeId as qt } from "vue";
6
+ import { S as Wt } from "./const-DeAig7Pj.mjs";
7
+ import { i as Ut, m as ve, E as Yt } from "./use-form-item-DkYURTpK.mjs";
8
+ import { i as Xt, c as Zt } from "./icon-DZm1Csdm.mjs";
9
+ import { u as Jt } from "./index-BgjjA9sB.mjs";
10
+ const ct = (e) => Pe ? window.requestAnimationFrame(e) : setTimeout(e, 16), rt = (e) => Pe ? window.cancelAnimationFrame(e) : clearTimeout(e);
11
+ var Ze = Number.isNaN || function(t) {
12
+ return typeof t == "number" && t !== t;
13
+ };
14
+ function Qt(e, t) {
15
+ return !!(e === t || Ze(e) && Ze(t));
16
+ }
17
+ function en(e, t) {
18
+ if (e.length !== t.length)
19
+ return !1;
20
+ for (var o = 0; o < e.length; o++)
21
+ if (!Qt(e[o], t[o]))
22
+ return !1;
23
+ return !0;
24
+ }
25
+ function tn(e, t) {
26
+ t === void 0 && (t = en);
27
+ var o = null;
28
+ function a() {
29
+ for (var s = [], y = 0; y < arguments.length; y++)
30
+ s[y] = arguments[y];
31
+ if (o && o.lastThis === this && t(s, o.lastArgs))
32
+ return o.lastResult;
33
+ var p = e.apply(this, s);
34
+ return o = {
35
+ lastResult: p,
36
+ lastArgs: s,
37
+ lastThis: this
38
+ }, p;
39
+ }
40
+ return a.clear = function() {
41
+ o = null;
42
+ }, a;
43
+ }
44
+ const nn = () => {
45
+ const t = we().proxy.$props;
46
+ return M(() => {
47
+ const o = (a, s, y) => ({});
48
+ return t.perfMode ? xt(o) : tn(o);
49
+ });
50
+ }, Je = "itemRendered", Qe = "scroll", it = "forward", dt = "backward", Le = "auto", on = "smart", ln = "start", et = "center", sn = "end", ge = "horizontal", je = "vertical", an = "ltr", Ne = "rtl", Re = "negative", ut = "positive-ascending", ft = "positive-descending", cn = {
51
+ [ge]: "left",
52
+ [je]: "top"
53
+ }, rn = 20, dn = {
54
+ [ge]: "deltaX",
55
+ [je]: "deltaY"
56
+ }, un = ({ atEndEdge: e, atStartEdge: t, layout: o }, a) => {
57
+ let s, y = 0;
58
+ const p = (v) => v < 0 && t.value || v > 0 && e.value;
59
+ return {
60
+ hasReachedEdge: p,
61
+ onWheel: (v) => {
62
+ rt(s);
63
+ const g = v[dn[o.value]];
64
+ p(y) && p(y + g) || (y += g, Ut() || v.preventDefault(), s = ct(() => {
65
+ a(y), y = 0;
66
+ }));
67
+ }
68
+ };
69
+ }, De = de({
70
+ type: U([Number, Function]),
71
+ required: !0
72
+ }), ze = de({
73
+ type: Number
74
+ }), Ae = de({
75
+ type: Number,
76
+ default: 2
77
+ }), fn = de({
78
+ type: String,
79
+ values: ["ltr", "rtl"],
80
+ default: "ltr"
81
+ }), Be = de({
82
+ type: Number,
83
+ default: 0
84
+ }), xe = de({
85
+ type: Number,
86
+ required: !0
87
+ }), ht = de({
88
+ type: String,
89
+ values: ["horizontal", "vertical"],
90
+ default: je
91
+ }), vt = ue({
92
+ className: {
93
+ type: String,
94
+ default: ""
95
+ },
96
+ containerElement: {
97
+ type: U([String, Object]),
98
+ default: "div"
99
+ },
100
+ data: {
101
+ type: U(Array),
102
+ default: () => ve([])
103
+ },
104
+ direction: fn,
105
+ height: {
106
+ type: [String, Number],
107
+ required: !0
108
+ },
109
+ innerElement: {
110
+ type: [String, Object],
111
+ default: "div"
112
+ },
113
+ style: {
114
+ type: U([Object, String, Array])
115
+ },
116
+ useIsScrolling: {
117
+ type: Boolean,
118
+ default: !1
119
+ },
120
+ width: {
121
+ type: [Number, String],
122
+ required: !1
123
+ },
124
+ perfMode: {
125
+ type: Boolean,
126
+ default: !0
127
+ },
128
+ scrollbarAlwaysOn: {
129
+ type: Boolean,
130
+ default: !1
131
+ }
132
+ }), hn = ue({
133
+ cache: Ae,
134
+ estimatedItemSize: ze,
135
+ layout: ht,
136
+ initScrollOffset: Be,
137
+ total: xe,
138
+ itemSize: De,
139
+ ...vt
140
+ }), He = {
141
+ type: Number,
142
+ default: 6
143
+ }, yt = { type: Number, default: 0 }, mt = { type: Number, default: 2 };
144
+ ue({
145
+ columnCache: Ae,
146
+ columnWidth: De,
147
+ estimatedColumnWidth: ze,
148
+ estimatedRowHeight: ze,
149
+ initScrollLeft: Be,
150
+ initScrollTop: Be,
151
+ itemKey: {
152
+ type: U(Function),
153
+ default: ({
154
+ columnIndex: e,
155
+ rowIndex: t
156
+ }) => `${t}:${e}`
157
+ },
158
+ rowCache: Ae,
159
+ rowHeight: De,
160
+ totalColumn: xe,
161
+ totalRow: xe,
162
+ hScrollbarSize: He,
163
+ vScrollbarSize: He,
164
+ scrollbarStartGap: yt,
165
+ scrollbarEndGap: mt,
166
+ role: String,
167
+ ...vt
168
+ });
169
+ const vn = ue({
170
+ alwaysOn: Boolean,
171
+ class: String,
172
+ layout: ht,
173
+ total: xe,
174
+ ratio: {
175
+ type: Number,
176
+ required: !0
177
+ },
178
+ clientSize: {
179
+ type: Number,
180
+ required: !0
181
+ },
182
+ scrollFrom: {
183
+ type: Number,
184
+ required: !0
185
+ },
186
+ scrollbarSize: He,
187
+ startGap: yt,
188
+ endGap: mt,
189
+ visible: Boolean
190
+ }), Ie = (e, t) => e < t ? it : dt, Fe = (e) => e === an || e === Ne || e === ge;
191
+ let he = null;
192
+ function tt(e = !1) {
193
+ if (he === null || e) {
194
+ const t = document.createElement("div"), o = t.style;
195
+ o.width = "50px", o.height = "50px", o.overflow = "scroll", o.direction = "rtl";
196
+ const a = document.createElement("div"), s = a.style;
197
+ return s.width = "100px", s.height = "100px", t.appendChild(a), document.body.appendChild(t), t.scrollLeft > 0 ? he = ft : (t.scrollLeft = 1, t.scrollLeft === 0 ? he = Re : he = ut), document.body.removeChild(t), he;
198
+ }
199
+ return he;
200
+ }
201
+ function yn({ move: e, size: t, bar: o }, a) {
202
+ const s = {}, y = `translate${o.axis}(${e}px)`;
203
+ return s[o.size] = t, s.transform = y, s.msTransform = y, s.webkitTransform = y, a === "horizontal" ? s.height = "100%" : s.width = "100%", s;
204
+ }
205
+ const mn = ce({
206
+ name: "ElVirtualScrollBar",
207
+ props: vn,
208
+ emits: ["scroll", "start-move", "stop-move"],
209
+ setup(e, { emit: t }) {
210
+ const o = M(() => e.startGap + e.endGap), a = me("virtual-scrollbar"), s = me("scrollbar"), y = z(), p = z();
211
+ let b = null, v = null;
212
+ const g = At({
213
+ isDragging: !1,
214
+ traveled: 0
215
+ }), l = M(() => Dt[e.layout]), r = M(() => e.clientSize - i(o)), _ = M(() => ({
216
+ position: "absolute",
217
+ width: `${ge === e.layout ? r.value : e.scrollbarSize}px`,
218
+ height: `${ge === e.layout ? e.scrollbarSize : r.value}px`,
219
+ [cn[e.layout]]: "2px",
220
+ right: "2px",
221
+ bottom: "2px",
222
+ borderRadius: "4px"
223
+ })), O = M(() => {
224
+ const d = e.ratio, k = e.clientSize;
225
+ if (d >= 100)
226
+ return Number.POSITIVE_INFINITY;
227
+ if (d >= 50)
228
+ return d * k / 100;
229
+ const T = k / 3;
230
+ return Math.floor(Math.min(Math.max(d * k, rn), T));
231
+ }), w = M(() => {
232
+ if (!Number.isFinite(O.value))
233
+ return {
234
+ display: "none"
235
+ };
236
+ const d = `${O.value}px`;
237
+ return yn({
238
+ bar: l.value,
239
+ size: d,
240
+ move: g.traveled
241
+ }, e.layout);
242
+ }), S = M(() => Math.floor(e.clientSize - O.value - i(o))), $ = () => {
243
+ window.addEventListener("mousemove", f), window.addEventListener("mouseup", h);
244
+ const d = i(p);
245
+ d && (v = document.onselectstart, document.onselectstart = () => !1, d.addEventListener("touchmove", f), d.addEventListener("touchend", h));
246
+ }, x = () => {
247
+ window.removeEventListener("mousemove", f), window.removeEventListener("mouseup", h), document.onselectstart = v, v = null;
248
+ const d = i(p);
249
+ d && (d.removeEventListener("touchmove", f), d.removeEventListener("touchend", h));
250
+ }, A = (d) => {
251
+ d.stopImmediatePropagation(), !(d.ctrlKey || [1, 2].includes(d.button)) && (g.isDragging = !0, g[l.value.axis] = d.currentTarget[l.value.offset] - (d[l.value.client] - d.currentTarget.getBoundingClientRect()[l.value.direction]), t("start-move"), $());
252
+ }, h = () => {
253
+ g.isDragging = !1, g[l.value.axis] = 0, t("stop-move"), x();
254
+ }, f = (d) => {
255
+ const { isDragging: k } = g;
256
+ if (!k || !p.value || !y.value)
257
+ return;
258
+ const T = g[l.value.axis];
259
+ if (!T)
260
+ return;
261
+ rt(b);
262
+ const L = (y.value.getBoundingClientRect()[l.value.direction] - d[l.value.client]) * -1, R = p.value[l.value.offset] - T, B = L - R;
263
+ b = ct(() => {
264
+ g.traveled = Math.max(e.startGap, Math.min(B, S.value)), t("scroll", B, S.value);
265
+ });
266
+ }, E = (d) => {
267
+ const k = Math.abs(d.target.getBoundingClientRect()[l.value.direction] - d[l.value.client]), T = p.value[l.value.offset] / 2, L = k - T;
268
+ g.traveled = Math.max(0, Math.min(L, S.value)), t("scroll", L, S.value);
269
+ };
270
+ return _e(() => e.scrollFrom, (d) => {
271
+ g.isDragging || (g.traveled = Math.ceil(d * S.value));
272
+ }), Bt(() => {
273
+ x();
274
+ }), () => re("div", {
275
+ role: "presentation",
276
+ ref: y,
277
+ class: [
278
+ a.b(),
279
+ e.class,
280
+ (e.alwaysOn || g.isDragging) && "always-on"
281
+ ],
282
+ style: _.value,
283
+ onMousedown: Ee(E, ["stop", "prevent"]),
284
+ onTouchstartPrevent: A
285
+ }, re("div", {
286
+ ref: p,
287
+ class: s.e("thumb"),
288
+ style: w.value,
289
+ onMousedown: A
290
+ }, []));
291
+ }
292
+ }), gn = ({
293
+ name: e,
294
+ getOffset: t,
295
+ getItemSize: o,
296
+ getItemOffset: a,
297
+ getEstimatedTotalSize: s,
298
+ getStartIndexForOffset: y,
299
+ getStopIndexForStartIndex: p,
300
+ initCache: b,
301
+ clearCache: v,
302
+ validateProps: g
303
+ }) => ce({
304
+ name: e ?? "ElVirtualList",
305
+ props: hn,
306
+ emits: [Je, Qe],
307
+ setup(l, { emit: r, expose: _ }) {
308
+ g(l);
309
+ const O = we(), w = me("vl"), S = z(b(l, O)), $ = nn(), x = z(), A = z(), h = z(), f = z({
310
+ isScrolling: !1,
311
+ scrollDir: "forward",
312
+ scrollOffset: Se(l.initScrollOffset) ? l.initScrollOffset : 0,
313
+ updateRequested: !1,
314
+ isScrollbarDragging: !1,
315
+ scrollbarAlwaysOn: l.scrollbarAlwaysOn
316
+ }), E = M(() => {
317
+ const { total: u, cache: N } = l, { isScrolling: I, scrollDir: P, scrollOffset: K } = i(f);
318
+ if (u === 0)
319
+ return [0, 0, 0, 0];
320
+ const n = y(l, K, i(S)), m = p(l, n, K, i(S)), F = !I || P === dt ? Math.max(1, N) : 1, j = !I || P === it ? Math.max(1, N) : 1;
321
+ return [
322
+ Math.max(0, n - F),
323
+ Math.max(0, Math.min(u - 1, m + j)),
324
+ n,
325
+ m
326
+ ];
327
+ }), d = M(() => s(l, i(S))), k = M(() => Fe(l.layout)), T = M(() => [
328
+ {
329
+ position: "relative",
330
+ [`overflow-${k.value ? "x" : "y"}`]: "scroll",
331
+ WebkitOverflowScrolling: "touch",
332
+ willChange: "transform"
333
+ },
334
+ {
335
+ direction: l.direction,
336
+ height: Se(l.height) ? `${l.height}px` : l.height,
337
+ width: Se(l.width) ? `${l.width}px` : l.width
338
+ },
339
+ l.style
340
+ ]), L = M(() => {
341
+ const u = i(d), N = i(k);
342
+ return {
343
+ height: N ? "100%" : `${u}px`,
344
+ pointerEvents: i(f).isScrolling ? "none" : void 0,
345
+ width: N ? `${u}px` : "100%"
346
+ };
347
+ }), R = M(() => k.value ? l.width : l.height), { onWheel: B } = un({
348
+ atStartEdge: M(() => f.value.scrollOffset <= 0),
349
+ atEndEdge: M(() => f.value.scrollOffset >= d.value),
350
+ layout: M(() => l.layout)
351
+ }, (u) => {
352
+ var N, I;
353
+ (I = (N = h.value).onMouseUp) == null || I.call(N), q(Math.min(f.value.scrollOffset + u, d.value - R.value));
354
+ }), c = () => {
355
+ const { total: u } = l;
356
+ if (u > 0) {
357
+ const [K, n, m, F] = i(E);
358
+ r(Je, K, n, m, F);
359
+ }
360
+ const { scrollDir: N, scrollOffset: I, updateRequested: P } = i(f);
361
+ r(Qe, N, I, P);
362
+ }, C = (u) => {
363
+ const { clientHeight: N, scrollHeight: I, scrollTop: P } = u.currentTarget, K = i(f);
364
+ if (K.scrollOffset === P)
365
+ return;
366
+ const n = Math.max(0, Math.min(P, I - N));
367
+ f.value = {
368
+ ...K,
369
+ isScrolling: !0,
370
+ scrollDir: Ie(K.scrollOffset, n),
371
+ scrollOffset: n,
372
+ updateRequested: !1
373
+ }, Q(ae);
374
+ }, D = (u) => {
375
+ const { clientWidth: N, scrollLeft: I, scrollWidth: P } = u.currentTarget, K = i(f);
376
+ if (K.scrollOffset === I)
377
+ return;
378
+ const { direction: n } = l;
379
+ let m = I;
380
+ if (n === Ne)
381
+ switch (tt()) {
382
+ case Re: {
383
+ m = -I;
384
+ break;
385
+ }
386
+ case ft: {
387
+ m = P - N - I;
388
+ break;
389
+ }
390
+ }
391
+ m = Math.max(0, Math.min(m, P - N)), f.value = {
392
+ ...K,
393
+ isScrolling: !0,
394
+ scrollDir: Ie(K.scrollOffset, m),
395
+ scrollOffset: m,
396
+ updateRequested: !1
397
+ }, Q(ae);
398
+ }, Y = (u) => {
399
+ i(k) ? D(u) : C(u), c();
400
+ }, G = (u, N) => {
401
+ const I = (d.value - R.value) / N * u;
402
+ q(Math.min(d.value - R.value, I));
403
+ }, q = (u) => {
404
+ u = Math.max(u, 0), u !== i(f).scrollOffset && (f.value = {
405
+ ...i(f),
406
+ scrollOffset: u,
407
+ scrollDir: Ie(i(f).scrollOffset, u),
408
+ updateRequested: !0
409
+ }, Q(ae));
410
+ }, X = (u, N = Le) => {
411
+ const { scrollOffset: I } = i(f);
412
+ u = Math.max(0, Math.min(u, l.total - 1)), q(t(l, u, N, I, i(S)));
413
+ }, W = (u) => {
414
+ const { direction: N, itemSize: I, layout: P } = l, K = $.value(v && I, v && P, v && N);
415
+ let n;
416
+ if (wt(K, String(u)))
417
+ n = K[u];
418
+ else {
419
+ const m = a(l, u, i(S)), F = o(l, u, i(S)), j = i(k), te = N === Ne, oe = j ? m : 0;
420
+ K[u] = n = {
421
+ position: "absolute",
422
+ left: te ? void 0 : `${oe}px`,
423
+ right: te ? `${oe}px` : void 0,
424
+ top: j ? 0 : `${m}px`,
425
+ height: j ? "100%" : `${F}px`,
426
+ width: j ? `${F}px` : "100%"
427
+ };
428
+ }
429
+ return n;
430
+ }, ae = () => {
431
+ f.value.isScrolling = !1, Q(() => {
432
+ $.value(-1, null, null);
433
+ });
434
+ }, ne = () => {
435
+ const u = x.value;
436
+ u && (u.scrollTop = 0);
437
+ };
438
+ Ht(() => {
439
+ if (!Pe)
440
+ return;
441
+ const { initScrollOffset: u } = l, N = i(x);
442
+ Se(u) && N && (i(k) ? N.scrollLeft = u : N.scrollTop = u), c();
443
+ }), Ft(() => {
444
+ const { direction: u, layout: N } = l, { scrollOffset: I, updateRequested: P } = i(f), K = i(x);
445
+ if (P && K)
446
+ if (N === ge)
447
+ if (u === Ne)
448
+ switch (tt()) {
449
+ case Re: {
450
+ K.scrollLeft = -I;
451
+ break;
452
+ }
453
+ case ut: {
454
+ K.scrollLeft = I;
455
+ break;
456
+ }
457
+ default: {
458
+ const { clientWidth: n, scrollWidth: m } = K;
459
+ K.scrollLeft = m - n - I;
460
+ break;
461
+ }
462
+ }
463
+ else
464
+ K.scrollLeft = I;
465
+ else
466
+ K.scrollTop = I;
467
+ });
468
+ const H = {
469
+ ns: w,
470
+ clientSize: R,
471
+ estimatedTotalSize: d,
472
+ windowStyle: T,
473
+ windowRef: x,
474
+ innerRef: A,
475
+ innerStyle: L,
476
+ itemsToRender: E,
477
+ scrollbarRef: h,
478
+ states: f,
479
+ getItemStyle: W,
480
+ onScroll: Y,
481
+ onScrollbarScroll: G,
482
+ onWheel: B,
483
+ scrollTo: q,
484
+ scrollToItem: X,
485
+ resetScrollTop: ne
486
+ };
487
+ return _({
488
+ windowRef: x,
489
+ innerRef: A,
490
+ getItemStyleCache: $,
491
+ scrollTo: q,
492
+ scrollToItem: X,
493
+ resetScrollTop: ne,
494
+ states: f
495
+ }), H;
496
+ },
497
+ render(l) {
498
+ var r;
499
+ const {
500
+ $slots: _,
501
+ className: O,
502
+ clientSize: w,
503
+ containerElement: S,
504
+ data: $,
505
+ getItemStyle: x,
506
+ innerElement: A,
507
+ itemsToRender: h,
508
+ innerStyle: f,
509
+ layout: E,
510
+ total: d,
511
+ onScroll: k,
512
+ onScrollbarScroll: T,
513
+ onWheel: L,
514
+ states: R,
515
+ useIsScrolling: B,
516
+ windowStyle: c,
517
+ ns: C
518
+ } = l, [D, Y] = h, G = Ke(S), q = Ke(A), X = [];
519
+ if (d > 0)
520
+ for (let H = D; H <= Y; H++)
521
+ X.push((r = _.default) == null ? void 0 : r.call(_, {
522
+ data: $,
523
+ key: H,
524
+ index: H,
525
+ isScrolling: B ? R.isScrolling : void 0,
526
+ style: x(H)
527
+ }));
528
+ const W = [
529
+ re(q, {
530
+ style: f,
531
+ ref: "innerRef"
532
+ }, Me(q) ? X : {
533
+ default: () => X
534
+ })
535
+ ], ae = re(mn, {
536
+ ref: "scrollbarRef",
537
+ clientSize: w,
538
+ layout: E,
539
+ onScroll: T,
540
+ ratio: w * 100 / this.estimatedTotalSize,
541
+ scrollFrom: R.scrollOffset / (this.estimatedTotalSize - w),
542
+ total: d
543
+ }), ne = re(G, {
544
+ class: [C.e("window"), O],
545
+ style: c,
546
+ onScroll: k,
547
+ onWheel: L,
548
+ ref: "windowRef",
549
+ key: 0
550
+ }, Me(G) ? [W] : { default: () => [W] });
551
+ return re("div", {
552
+ key: 0,
553
+ class: [C.e("wrapper"), R.scrollbarAlwaysOn ? "always-on" : ""]
554
+ }, [ne, ae]);
555
+ }
556
+ }), pn = gn({
557
+ name: "ElFixedSizeList",
558
+ getItemOffset: ({ itemSize: e }, t) => t * e,
559
+ getItemSize: ({ itemSize: e }) => e,
560
+ getEstimatedTotalSize: ({ total: e, itemSize: t }) => t * e,
561
+ getOffset: ({ height: e, total: t, itemSize: o, layout: a, width: s }, y, p, b) => {
562
+ const v = Fe(a) ? s : e;
563
+ process.env.NODE_ENV !== "production" && Me(v) && Tt("[ElVirtualList]", `
564
+ You should set
565
+ width/height
566
+ to number when your layout is
567
+ horizontal/vertical
568
+ `);
569
+ const g = Math.max(0, t * o - v), l = Math.min(g, y * o), r = Math.max(0, (y + 1) * o - v);
570
+ switch (p === on && (b >= r - v && b <= l + v ? p = Le : p = et), p) {
571
+ case ln:
572
+ return l;
573
+ case sn:
574
+ return r;
575
+ case et: {
576
+ const _ = Math.round(r + (l - r) / 2);
577
+ return _ < Math.ceil(v / 2) ? 0 : _ > g + Math.floor(v / 2) ? g : _;
578
+ }
579
+ case Le:
580
+ default:
581
+ return b >= r && b <= l ? b : b < r ? r : l;
582
+ }
583
+ },
584
+ getStartIndexForOffset: ({ total: e, itemSize: t }, o) => Math.max(0, Math.min(e - 1, Math.floor(o / t))),
585
+ getStopIndexForStartIndex: ({ height: e, total: t, itemSize: o, layout: a, width: s }, y, p) => {
586
+ const b = y * o, v = Fe(a) ? s : e, g = Math.ceil((v + p - b) / o);
587
+ return Math.max(0, Math.min(t - 1, y + g - 1));
588
+ },
589
+ initCache() {
590
+ },
591
+ clearCache: !0,
592
+ validateProps() {
593
+ }
594
+ }), Ve = Symbol(), kn = {
595
+ key: -1,
596
+ level: -1,
597
+ data: {}
598
+ };
599
+ var be = /* @__PURE__ */ ((e) => (e.KEY = "id", e.LABEL = "label", e.CHILDREN = "children", e.DISABLED = "disabled", e))(be || {}), $e = /* @__PURE__ */ ((e) => (e.ADD = "add", e.DELETE = "delete", e))($e || {});
600
+ const gt = {
601
+ type: Number,
602
+ default: 26
603
+ }, bn = ue({
604
+ data: {
605
+ type: U(Array),
606
+ default: () => ve([])
607
+ },
608
+ emptyText: {
609
+ type: String
610
+ },
611
+ height: {
612
+ type: Number,
613
+ default: 200
614
+ },
615
+ props: {
616
+ type: U(Object),
617
+ default: () => ve({
618
+ children: "children",
619
+ label: "label",
620
+ disabled: "disabled",
621
+ value: "id"
622
+ /* KEY */
623
+ })
624
+ },
625
+ highlightCurrent: {
626
+ type: Boolean,
627
+ default: !1
628
+ },
629
+ showCheckbox: {
630
+ type: Boolean,
631
+ default: !1
632
+ },
633
+ defaultCheckedKeys: {
634
+ type: U(Array),
635
+ default: () => ve([])
636
+ },
637
+ checkStrictly: {
638
+ type: Boolean,
639
+ default: !1
640
+ },
641
+ defaultExpandedKeys: {
642
+ type: U(Array),
643
+ default: () => ve([])
644
+ },
645
+ indent: {
646
+ type: Number,
647
+ default: 16
648
+ },
649
+ itemSize: gt,
650
+ icon: {
651
+ type: Xt
652
+ },
653
+ expandOnClickNode: {
654
+ type: Boolean,
655
+ default: !0
656
+ },
657
+ checkOnClickNode: {
658
+ type: Boolean,
659
+ default: !1
660
+ },
661
+ currentNodeKey: {
662
+ type: U([String, Number])
663
+ },
664
+ accordion: {
665
+ type: Boolean,
666
+ default: !1
667
+ },
668
+ filterMethod: {
669
+ type: U(Function)
670
+ },
671
+ perfMode: {
672
+ type: Boolean,
673
+ default: !0
674
+ }
675
+ }), Cn = ue({
676
+ node: {
677
+ type: U(Object),
678
+ default: () => ve(kn)
679
+ },
680
+ expanded: {
681
+ type: Boolean,
682
+ default: !1
683
+ },
684
+ checked: {
685
+ type: Boolean,
686
+ default: !1
687
+ },
688
+ indeterminate: {
689
+ type: Boolean,
690
+ default: !1
691
+ },
692
+ showCheckbox: {
693
+ type: Boolean,
694
+ default: !1
695
+ },
696
+ disabled: {
697
+ type: Boolean,
698
+ default: !1
699
+ },
700
+ current: {
701
+ type: Boolean,
702
+ default: !1
703
+ },
704
+ hiddenExpandIcon: {
705
+ type: Boolean,
706
+ default: !1
707
+ },
708
+ itemSize: gt
709
+ }), Sn = ue({
710
+ node: {
711
+ type: U(Object),
712
+ required: !0
713
+ }
714
+ }), pt = "node-click", kt = "node-expand", bt = "node-collapse", Ct = "current-change", St = "check", Et = "check-change", Nt = "node-contextmenu", En = {
715
+ [pt]: (e, t, o) => e && t && o,
716
+ [kt]: (e, t) => e && t,
717
+ [bt]: (e, t) => e && t,
718
+ [Ct]: (e, t) => e && t,
719
+ [St]: (e, t) => e && t,
720
+ [Et]: (e, t) => e && typeof t == "boolean",
721
+ [Nt]: (e, t, o) => e && t && o
722
+ }, Nn = {
723
+ click: (e, t) => !!(e && t),
724
+ toggle: (e) => !!e,
725
+ check: (e, t) => e && typeof t == "boolean"
726
+ };
727
+ function _n(e, t) {
728
+ const o = z(/* @__PURE__ */ new Set()), a = z(/* @__PURE__ */ new Set()), { emit: s } = we();
729
+ _e([() => t.value, () => e.defaultCheckedKeys], () => Q(() => {
730
+ A(e.defaultCheckedKeys);
731
+ }), {
732
+ immediate: !0
733
+ });
734
+ const y = () => {
735
+ if (!t.value || !e.showCheckbox || e.checkStrictly)
736
+ return;
737
+ const { levelTreeNodeMap: h, maxLevel: f } = t.value, E = o.value, d = /* @__PURE__ */ new Set();
738
+ for (let k = f - 1; k >= 1; --k) {
739
+ const T = h.get(k);
740
+ T && T.forEach((L) => {
741
+ const R = L.children;
742
+ if (R) {
743
+ let B = !0, c = !1;
744
+ for (const C of R) {
745
+ const D = C.key;
746
+ if (E.has(D))
747
+ c = !0;
748
+ else if (d.has(D)) {
749
+ B = !1, c = !0;
750
+ break;
751
+ } else
752
+ B = !1;
753
+ }
754
+ B ? E.add(L.key) : c ? (d.add(L.key), E.delete(L.key)) : (E.delete(L.key), d.delete(L.key));
755
+ }
756
+ });
757
+ }
758
+ a.value = d;
759
+ }, p = (h) => o.value.has(h.key), b = (h) => a.value.has(h.key), v = (h, f, E = !0) => {
760
+ const d = o.value, k = (T, L) => {
761
+ d[L ? $e.ADD : $e.DELETE](T.key);
762
+ const R = T.children;
763
+ !e.checkStrictly && R && R.forEach((B) => {
764
+ B.disabled || k(B, L);
765
+ });
766
+ };
767
+ k(h, f), y(), E && g(h, f);
768
+ }, g = (h, f) => {
769
+ const { checkedNodes: E, checkedKeys: d } = w(), { halfCheckedNodes: k, halfCheckedKeys: T } = S();
770
+ s(St, h.data, {
771
+ checkedKeys: d,
772
+ checkedNodes: E,
773
+ halfCheckedKeys: T,
774
+ halfCheckedNodes: k
775
+ }), s(Et, h.data, f);
776
+ };
777
+ function l(h = !1) {
778
+ return w(h).checkedKeys;
779
+ }
780
+ function r(h = !1) {
781
+ return w(h).checkedNodes;
782
+ }
783
+ function _() {
784
+ return S().halfCheckedKeys;
785
+ }
786
+ function O() {
787
+ return S().halfCheckedNodes;
788
+ }
789
+ function w(h = !1) {
790
+ const f = [], E = [];
791
+ if (t != null && t.value && e.showCheckbox) {
792
+ const { treeNodeMap: d } = t.value;
793
+ o.value.forEach((k) => {
794
+ const T = d.get(k);
795
+ T && (!h || h && T.isLeaf) && (E.push(k), f.push(T.data));
796
+ });
797
+ }
798
+ return {
799
+ checkedKeys: E,
800
+ checkedNodes: f
801
+ };
802
+ }
803
+ function S() {
804
+ const h = [], f = [];
805
+ if (t != null && t.value && e.showCheckbox) {
806
+ const { treeNodeMap: E } = t.value;
807
+ a.value.forEach((d) => {
808
+ const k = E.get(d);
809
+ k && (f.push(d), h.push(k.data));
810
+ });
811
+ }
812
+ return {
813
+ halfCheckedNodes: h,
814
+ halfCheckedKeys: f
815
+ };
816
+ }
817
+ function $(h) {
818
+ o.value.clear(), a.value.clear(), Q(() => {
819
+ A(h);
820
+ });
821
+ }
822
+ function x(h, f) {
823
+ if (t != null && t.value && e.showCheckbox) {
824
+ const E = t.value.treeNodeMap.get(h);
825
+ E && v(E, f, !1);
826
+ }
827
+ }
828
+ function A(h) {
829
+ if (t != null && t.value) {
830
+ const { treeNodeMap: f } = t.value;
831
+ if (e.showCheckbox && f && h)
832
+ for (const E of h) {
833
+ const d = f.get(E);
834
+ d && !p(d) && v(d, !0, !1);
835
+ }
836
+ }
837
+ }
838
+ return {
839
+ updateCheckedKeys: y,
840
+ toggleCheckbox: v,
841
+ isChecked: p,
842
+ isIndeterminate: b,
843
+ getCheckedKeys: l,
844
+ getCheckedNodes: r,
845
+ getHalfCheckedKeys: _,
846
+ getHalfCheckedNodes: O,
847
+ setChecked: x,
848
+ setCheckedKeys: $
849
+ };
850
+ }
851
+ function xn(e, t) {
852
+ const o = z(/* @__PURE__ */ new Set([])), a = z(/* @__PURE__ */ new Set([])), s = M(() => It(e.filterMethod));
853
+ function y(b) {
854
+ var v;
855
+ if (!s.value)
856
+ return;
857
+ const g = /* @__PURE__ */ new Set(), l = a.value, r = o.value, _ = [], O = ((v = t.value) == null ? void 0 : v.treeNodes) || [], w = e.filterMethod;
858
+ r.clear();
859
+ function S($) {
860
+ $.forEach((x) => {
861
+ _.push(x), w != null && w(b, x.data) ? _.forEach((h) => {
862
+ g.add(h.key);
863
+ }) : x.isLeaf && r.add(x.key);
864
+ const A = x.children;
865
+ if (A && S(A), !x.isLeaf) {
866
+ if (!g.has(x.key))
867
+ r.add(x.key);
868
+ else if (A) {
869
+ let h = !0;
870
+ for (const f of A)
871
+ if (!r.has(f.key)) {
872
+ h = !1;
873
+ break;
874
+ }
875
+ h ? l.add(x.key) : l.delete(x.key);
876
+ }
877
+ }
878
+ _.pop();
879
+ });
880
+ }
881
+ return S(O), g;
882
+ }
883
+ function p(b) {
884
+ return a.value.has(b.key);
885
+ }
886
+ return {
887
+ hiddenExpandIconKeySet: a,
888
+ hiddenNodeKeySet: o,
889
+ doFilter: y,
890
+ isForceHiddenExpandIcon: p
891
+ };
892
+ }
893
+ function wn(e, t) {
894
+ const o = z(new Set(e.defaultExpandedKeys)), a = z(), s = $t();
895
+ _e(() => e.currentNodeKey, (n) => {
896
+ a.value = n;
897
+ }, {
898
+ immediate: !0
899
+ }), _e(() => e.data, (n) => {
900
+ P(n);
901
+ }, {
902
+ immediate: !0
903
+ });
904
+ const {
905
+ isIndeterminate: y,
906
+ isChecked: p,
907
+ toggleCheckbox: b,
908
+ getCheckedKeys: v,
909
+ getCheckedNodes: g,
910
+ getHalfCheckedKeys: l,
911
+ getHalfCheckedNodes: r,
912
+ setChecked: _,
913
+ setCheckedKeys: O
914
+ } = _n(e, s), { doFilter: w, hiddenNodeKeySet: S, isForceHiddenExpandIcon: $ } = xn(e, s), x = M(() => {
915
+ var n;
916
+ return ((n = e.props) == null ? void 0 : n.value) || be.KEY;
917
+ }), A = M(() => {
918
+ var n;
919
+ return ((n = e.props) == null ? void 0 : n.children) || be.CHILDREN;
920
+ }), h = M(() => {
921
+ var n;
922
+ return ((n = e.props) == null ? void 0 : n.disabled) || be.DISABLED;
923
+ }), f = M(() => {
924
+ var n;
925
+ return ((n = e.props) == null ? void 0 : n.label) || be.LABEL;
926
+ }), E = M(() => {
927
+ const n = o.value, m = S.value, F = [], j = s.value && s.value.treeNodes || [];
928
+ function te() {
929
+ const oe = [];
930
+ for (let Z = j.length - 1; Z >= 0; --Z)
931
+ oe.push(j[Z]);
932
+ for (; oe.length; ) {
933
+ const Z = oe.pop();
934
+ if (Z && (m.has(Z.key) || F.push(Z), n.has(Z.key))) {
935
+ const J = Z.children;
936
+ if (J) {
937
+ const Te = J.length;
938
+ for (let fe = Te - 1; fe >= 0; --fe)
939
+ oe.push(J[fe]);
940
+ }
941
+ }
942
+ }
943
+ }
944
+ return te(), F;
945
+ }), d = M(() => E.value.length > 0);
946
+ function k(n) {
947
+ const m = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
948
+ let j = 1;
949
+ function te(Z, J = 1, Te = void 0) {
950
+ var fe;
951
+ const Ge = [];
952
+ for (const pe of Z) {
953
+ const qe = R(pe), le = {
954
+ level: J,
955
+ key: qe,
956
+ data: pe
957
+ };
958
+ le.label = c(pe), le.parent = Te;
959
+ const ke = L(pe);
960
+ le.disabled = B(pe), le.isLeaf = !ke || ke.length === 0, ke && ke.length && (le.children = te(ke, J + 1, le)), Ge.push(le), m.set(qe, le), F.has(J) || F.set(J, []), (fe = F.get(J)) == null || fe.push(le);
961
+ }
962
+ return J > j && (j = J), Ge;
963
+ }
964
+ const oe = te(n);
965
+ return {
966
+ treeNodeMap: m,
967
+ levelTreeNodeMap: F,
968
+ maxLevel: j,
969
+ treeNodes: oe
970
+ };
971
+ }
972
+ function T(n) {
973
+ const m = w(n);
974
+ m && (o.value = m);
975
+ }
976
+ function L(n) {
977
+ return n[A.value];
978
+ }
979
+ function R(n) {
980
+ return n ? n[x.value] : "";
981
+ }
982
+ function B(n) {
983
+ return n[h.value];
984
+ }
985
+ function c(n) {
986
+ return n[f.value];
987
+ }
988
+ function C(n) {
989
+ o.value.has(n.key) ? W(n) : X(n);
990
+ }
991
+ function D(n) {
992
+ o.value = new Set(n);
993
+ }
994
+ function Y(n, m) {
995
+ t(pt, n.data, n, m), G(n), e.expandOnClickNode && C(n), e.showCheckbox && e.checkOnClickNode && !n.disabled && b(n, !p(n), !0);
996
+ }
997
+ function G(n) {
998
+ H(n) || (a.value = n.key, t(Ct, n.data, n));
999
+ }
1000
+ function q(n, m) {
1001
+ b(n, m);
1002
+ }
1003
+ function X(n) {
1004
+ const m = o.value;
1005
+ if (s.value && e.accordion) {
1006
+ const { treeNodeMap: F } = s.value;
1007
+ m.forEach((j) => {
1008
+ const te = F.get(j);
1009
+ n && n.level === (te == null ? void 0 : te.level) && m.delete(j);
1010
+ });
1011
+ }
1012
+ m.add(n.key), t(kt, n.data, n);
1013
+ }
1014
+ function W(n) {
1015
+ o.value.delete(n.key), t(bt, n.data, n);
1016
+ }
1017
+ function ae(n) {
1018
+ return o.value.has(n.key);
1019
+ }
1020
+ function ne(n) {
1021
+ return !!n.disabled;
1022
+ }
1023
+ function H(n) {
1024
+ const m = a.value;
1025
+ return m !== void 0 && m === n.key;
1026
+ }
1027
+ function u() {
1028
+ var n, m;
1029
+ if (a.value)
1030
+ return (m = (n = s.value) == null ? void 0 : n.treeNodeMap.get(a.value)) == null ? void 0 : m.data;
1031
+ }
1032
+ function N() {
1033
+ return a.value;
1034
+ }
1035
+ function I(n) {
1036
+ a.value = n;
1037
+ }
1038
+ function P(n) {
1039
+ Q(() => s.value = k(n));
1040
+ }
1041
+ function K(n) {
1042
+ var m;
1043
+ const F = Mt(n) ? R(n) : n;
1044
+ return (m = s.value) == null ? void 0 : m.treeNodeMap.get(F);
1045
+ }
1046
+ return {
1047
+ tree: s,
1048
+ flattenTree: E,
1049
+ isNotEmpty: d,
1050
+ getKey: R,
1051
+ getChildren: L,
1052
+ toggleExpand: C,
1053
+ toggleCheckbox: b,
1054
+ isExpanded: ae,
1055
+ isChecked: p,
1056
+ isIndeterminate: y,
1057
+ isDisabled: ne,
1058
+ isCurrent: H,
1059
+ isForceHiddenExpandIcon: $,
1060
+ handleNodeClick: Y,
1061
+ handleNodeCheck: q,
1062
+ getCurrentNode: u,
1063
+ getCurrentKey: N,
1064
+ setCurrentKey: I,
1065
+ getCheckedKeys: v,
1066
+ getCheckedNodes: g,
1067
+ getHalfCheckedKeys: l,
1068
+ getHalfCheckedNodes: r,
1069
+ setChecked: _,
1070
+ setCheckedKeys: O,
1071
+ filter: T,
1072
+ setData: P,
1073
+ getNode: K,
1074
+ expandNode: X,
1075
+ collapseNode: W,
1076
+ setExpandedKeys: D
1077
+ };
1078
+ }
1079
+ var Tn = ce({
1080
+ name: "ElTreeNodeContent",
1081
+ props: Sn,
1082
+ setup(e) {
1083
+ const t = ot(Ve), o = me("tree");
1084
+ return () => {
1085
+ const a = e.node, { data: s } = a;
1086
+ return t != null && t.ctx.slots.default ? t.ctx.slots.default({ node: a, data: s }) : re("span", { class: o.be("node", "label") }, [a == null ? void 0 : a.label]);
1087
+ };
1088
+ }
1089
+ });
1090
+ const In = ["aria-expanded", "aria-disabled", "aria-checked", "data-key", "onClick"], Mn = ce({
1091
+ name: "ElTreeNode"
1092
+ }), Kn = /* @__PURE__ */ ce({
1093
+ ...Mn,
1094
+ props: Cn,
1095
+ emits: Nn,
1096
+ setup(e, { emit: t }) {
1097
+ const o = e, a = ot(Ve), s = me("tree"), y = M(() => {
1098
+ var r;
1099
+ return (r = a == null ? void 0 : a.props.indent) != null ? r : 16;
1100
+ }), p = M(() => {
1101
+ var r;
1102
+ return (r = a == null ? void 0 : a.props.icon) != null ? r : Zt;
1103
+ }), b = (r) => {
1104
+ t("click", o.node, r);
1105
+ }, v = () => {
1106
+ t("toggle", o.node);
1107
+ }, g = (r) => {
1108
+ t("check", o.node, r);
1109
+ }, l = (r) => {
1110
+ var _, O, w, S;
1111
+ (w = (O = (_ = a == null ? void 0 : a.instance) == null ? void 0 : _.vnode) == null ? void 0 : O.props) != null && w.onNodeContextmenu && (r.stopPropagation(), r.preventDefault()), a == null || a.ctx.emit(Nt, r, (S = o.node) == null ? void 0 : S.data, o.node);
1112
+ };
1113
+ return (r, _) => {
1114
+ var O, w, S;
1115
+ return ee(), ye("div", {
1116
+ ref: "node$",
1117
+ class: ie([
1118
+ i(s).b("node"),
1119
+ i(s).is("expanded", r.expanded),
1120
+ i(s).is("current", r.current),
1121
+ i(s).is("focusable", !r.disabled),
1122
+ i(s).is("checked", !r.disabled && r.checked)
1123
+ ]),
1124
+ role: "treeitem",
1125
+ tabindex: "-1",
1126
+ "aria-expanded": r.expanded,
1127
+ "aria-disabled": r.disabled,
1128
+ "aria-checked": r.checked,
1129
+ "data-key": (O = r.node) == null ? void 0 : O.key,
1130
+ onClick: Ee(b, ["stop"]),
1131
+ onContextmenu: l
1132
+ }, [
1133
+ se("div", {
1134
+ class: ie(i(s).be("node", "content")),
1135
+ style: lt({
1136
+ paddingLeft: `${(r.node.level - 1) * i(y)}px`,
1137
+ height: r.itemSize + "px"
1138
+ })
1139
+ }, [
1140
+ i(p) ? (ee(), Ce(i(Yt), {
1141
+ key: 0,
1142
+ class: ie([
1143
+ i(s).is("leaf", !!((w = r.node) != null && w.isLeaf)),
1144
+ i(s).is("hidden", r.hiddenExpandIcon),
1145
+ {
1146
+ expanded: !((S = r.node) != null && S.isLeaf) && r.expanded
1147
+ },
1148
+ i(s).be("node", "expand-icon")
1149
+ ]),
1150
+ onClick: Ee(v, ["stop"])
1151
+ }, {
1152
+ default: st(() => [
1153
+ (ee(), Ce(Ke(i(p))))
1154
+ ]),
1155
+ _: 1
1156
+ }, 8, ["class", "onClick"])) : We("v-if", !0),
1157
+ r.showCheckbox ? (ee(), Ce(i(Rt), {
1158
+ key: 1,
1159
+ "model-value": r.checked,
1160
+ indeterminate: r.indeterminate,
1161
+ disabled: r.disabled,
1162
+ onChange: g,
1163
+ onClick: _[0] || (_[0] = Ee(() => {
1164
+ }, ["stop"]))
1165
+ }, null, 8, ["model-value", "indeterminate", "disabled"])) : We("v-if", !0),
1166
+ Oe(i(Tn), { node: r.node }, null, 8, ["node"])
1167
+ ], 6)
1168
+ ], 42, In);
1169
+ };
1170
+ }
1171
+ });
1172
+ var On = /* @__PURE__ */ nt(Kn, [["__file", "tree-node.vue"]]);
1173
+ const Ln = ce({
1174
+ name: "ElTreeV2"
1175
+ }), Rn = /* @__PURE__ */ ce({
1176
+ ...Ln,
1177
+ props: bn,
1178
+ emits: En,
1179
+ setup(e, { expose: t, emit: o }) {
1180
+ const a = e, s = Pt(), y = M(() => a.itemSize);
1181
+ Ue(Ve, {
1182
+ ctx: {
1183
+ emit: o,
1184
+ slots: s
1185
+ },
1186
+ props: a,
1187
+ instance: we()
1188
+ }), Ue(Kt, void 0);
1189
+ const { t: p } = Jt(), b = me("tree"), {
1190
+ flattenTree: v,
1191
+ isNotEmpty: g,
1192
+ toggleExpand: l,
1193
+ isExpanded: r,
1194
+ isIndeterminate: _,
1195
+ isChecked: O,
1196
+ isDisabled: w,
1197
+ isCurrent: S,
1198
+ isForceHiddenExpandIcon: $,
1199
+ handleNodeClick: x,
1200
+ handleNodeCheck: A,
1201
+ toggleCheckbox: h,
1202
+ getCurrentNode: f,
1203
+ getCurrentKey: E,
1204
+ setCurrentKey: d,
1205
+ getCheckedKeys: k,
1206
+ getCheckedNodes: T,
1207
+ getHalfCheckedKeys: L,
1208
+ getHalfCheckedNodes: R,
1209
+ setChecked: B,
1210
+ setCheckedKeys: c,
1211
+ filter: C,
1212
+ setData: D,
1213
+ getNode: Y,
1214
+ expandNode: G,
1215
+ collapseNode: q,
1216
+ setExpandedKeys: X
1217
+ } = wn(a, o);
1218
+ return t({
1219
+ toggleCheckbox: h,
1220
+ getCurrentNode: f,
1221
+ getCurrentKey: E,
1222
+ setCurrentKey: d,
1223
+ getCheckedKeys: k,
1224
+ getCheckedNodes: T,
1225
+ getHalfCheckedKeys: L,
1226
+ getHalfCheckedNodes: R,
1227
+ setChecked: B,
1228
+ setCheckedKeys: c,
1229
+ filter: C,
1230
+ setData: D,
1231
+ getNode: Y,
1232
+ expandNode: G,
1233
+ collapseNode: q,
1234
+ setExpandedKeys: X
1235
+ }), (W, ae) => {
1236
+ var ne;
1237
+ return ee(), ye("div", {
1238
+ class: ie([i(b).b(), { [i(b).m("highlight-current")]: W.highlightCurrent }]),
1239
+ role: "tree"
1240
+ }, [
1241
+ i(g) ? (ee(), Ce(i(pn), {
1242
+ key: 0,
1243
+ "class-name": i(b).b("virtual-list"),
1244
+ data: i(v),
1245
+ total: i(v).length,
1246
+ height: W.height,
1247
+ "item-size": i(y),
1248
+ "perf-mode": W.perfMode
1249
+ }, {
1250
+ default: st(({ data: H, index: u, style: N }) => [
1251
+ (ee(), Ce(On, {
1252
+ key: H[u].key,
1253
+ style: lt(N),
1254
+ node: H[u],
1255
+ expanded: i(r)(H[u]),
1256
+ "show-checkbox": W.showCheckbox,
1257
+ checked: i(O)(H[u]),
1258
+ indeterminate: i(_)(H[u]),
1259
+ "item-size": i(y),
1260
+ disabled: i(w)(H[u]),
1261
+ current: i(S)(H[u]),
1262
+ "hidden-expand-icon": i($)(H[u]),
1263
+ onClick: i(x),
1264
+ onToggle: i(l),
1265
+ onCheck: i(A)
1266
+ }, null, 8, ["style", "node", "expanded", "show-checkbox", "checked", "indeterminate", "item-size", "disabled", "current", "hidden-expand-icon", "onClick", "onToggle", "onCheck"]))
1267
+ ]),
1268
+ _: 1
1269
+ }, 8, ["class-name", "data", "total", "height", "item-size", "perf-mode"])) : (ee(), ye("div", {
1270
+ key: 1,
1271
+ class: ie(i(b).e("empty-block"))
1272
+ }, [
1273
+ se("span", {
1274
+ class: ie(i(b).e("empty-text"))
1275
+ }, at((ne = W.emptyText) != null ? ne : i(p)("el.tree.emptyText")), 3)
1276
+ ], 2))
1277
+ ], 2);
1278
+ };
1279
+ }
1280
+ });
1281
+ var Dn = /* @__PURE__ */ nt(Rn, [["__file", "tree.vue"]]);
1282
+ const zn = Ot(Dn), _t = (e) => (Gt("data-v-1aaf48fb"), e = e(), qt(), e), An = { class: "structure_container" }, Bn = { class: "top" }, Hn = /* @__PURE__ */ _t(() => /* @__PURE__ */ se("span", null, "结构树", -1)), Fn = { class: "panel_content" }, $n = { class: "types" }, Pn = ["onClick"], jn = { class: "tree" }, Vn = { class: "panel_content_null" }, Gn = /* @__PURE__ */ _t(() => /* @__PURE__ */ se("span", null, "加载中...", -1)), qn = [
1283
+ Gn
1284
+ ], Wn = /* @__PURE__ */ ce({
1285
+ __name: "StructureTree",
1286
+ emits: ["closePanel"],
1287
+ setup(e, { emit: t }) {
1288
+ const o = z(), a = z(0), s = z(), y = z(), p = z(), b = z(), v = z([]), g = z();
1289
+ let l, r, _, O;
1290
+ const w = z(!1), S = t, $ = {
1291
+ children: "children",
1292
+ label: "title",
1293
+ value: "nodeId"
1294
+ };
1295
+ V.on("BimViewer", () => {
1296
+ l = window.BimViewer;
1297
+ const { eventTrigger: c } = l;
1298
+ r = l.objectsExplorer, _ = l.classesExplorer, O = l.storeysExplorer, c.on("treeAllReady", (C) => {
1299
+ console.log("treeAllReady", C), y.value = C.objectsData, p.value = C.classesData, b.value = C.storeysData, s.value = y.value, console.log("初始化结构树数据", s.value), Q(() => {
1300
+ if (s.value) {
1301
+ if (s.value[0] == null) return;
1302
+ s.value[0].title = "全部", g.value = s.value[0].nodeId, o.value.setCurrentKey(s.value[0].nodeId), h(), w.value = !0;
1303
+ }
1304
+ });
1305
+ }), c.on("pickedEntity", (C) => {
1306
+ if (w.value === !1) return;
1307
+ let D, Y;
1308
+ a.value === 0 ? D = l.objectsExplorer.getNodeIdByObjectId(C.id) : a.value === 1 ? D = l.classesExplorer.getNodeIdByObjectId(C.id) : a.value === 2 && (D = l.storeysExplorer.getNodeIdByObjectId(C.id)), D && (Y = o.value.getNode(D), Q(() => {
1309
+ g.value = D, o.value.setCurrentKey(D, !0), v.value = [], x(Y), o.value.setExpandedKeys(v.value);
1310
+ }));
1311
+ }), c.on("pickedNothing", () => {
1312
+ });
1313
+ });
1314
+ const x = (c) => {
1315
+ c.parent && x(c.parent), v.value = [...v.value, c.key];
1316
+ }, A = () => {
1317
+ S("closePanel");
1318
+ }, h = () => {
1319
+ Q(() => {
1320
+ const c = s.value.map((C) => C.nodeId);
1321
+ o.value.setCheckedKeys(c);
1322
+ });
1323
+ };
1324
+ V.on("getTreeNodeId1", (c) => {
1325
+ r.checkboxChangeHandler(c.nodeId, c.status), o.value.setChecked(c.nodeId, c.status);
1326
+ }), V.on("getTreeNodeId2", (c) => {
1327
+ _.checkboxChangeHandler(c.nodeId, !c.checked), o.value.setChecked(c.nodeId, c.status);
1328
+ }), V.on("getTreeNodeId3", (c) => {
1329
+ O.checkboxChangeHandler(c.nodeId, !c.checked), o.value.setChecked(c.nodeId, c.status);
1330
+ }), V.on("receiveTreeType", (c) => {
1331
+ a.value = c, E();
1332
+ });
1333
+ const f = (c) => {
1334
+ console.log("选择结构树类型data", c), a.value !== c.id && (a.value = c.id, E());
1335
+ }, E = () => {
1336
+ a.value === 0 ? s.value = y.value : a.value === 1 ? s.value = p.value : a.value === 2 && (s.value = b.value), s.value[0].title = "全部", Q(() => {
1337
+ g.value = s.value[0].nodeId, o.value.setCurrentKey(s.value[0].nodeId);
1338
+ }), h(), V.emit("treeTypeActiveId", a.value);
1339
+ }, d = (c) => {
1340
+ const C = {
1341
+ nodeId: c.nodeId,
1342
+ status: !c.checked
1343
+ };
1344
+ a.value === 0 ? (r.checkboxChangeHandler(c.nodeId, !c.checked), V.emit("checkedObjects", C)) : a.value === 1 ? (_.checkboxChangeHandler(c.nodeId, !c.checked), V.emit("checkedClasses", C)) : a.value === 2 && (O.checkboxChangeHandler(c.nodeId, !c.checked), V.emit("checkedStoreys", C));
1345
+ }, k = (c, C) => {
1346
+ const D = l.viewer.scene.objects[c.objectId];
1347
+ D && (l.setAllObjectsSelected(!1), l.setEntitySelected(D), l.viewFitEntity(D));
1348
+ }, T = (c, C) => {
1349
+ R(C);
1350
+ }, L = (c, C) => {
1351
+ R(C);
1352
+ }, R = (c) => {
1353
+ a.value === 0 ? V.emit("nodeObjects", c) : a.value === 1 ? V.emit("nodeClasses", c) : a.value === 2 && V.emit("nodeStoreys", c);
1354
+ };
1355
+ V.on("structure_tree_title_objects", (c) => {
1356
+ B(c);
1357
+ }), V.on("structure_tree_title_categorys", (c) => {
1358
+ B(c);
1359
+ }), V.on("structure_tree_title_floors", (c) => {
1360
+ B(c);
1361
+ });
1362
+ const B = (c) => {
1363
+ v.value.includes(c.nodeId) ? v.value = v.value.filter((C) => C !== c.nodeId) : v.value = [...v.value, c.nodeId], o.value.setExpandedKeys(v.value);
1364
+ };
1365
+ return (c, C) => {
1366
+ const D = zt, Y = zn;
1367
+ return ee(), ye("div", An, [
1368
+ se("div", Bn, [
1369
+ Hn,
1370
+ Oe(D, {
1371
+ class: "close",
1372
+ width: 18,
1373
+ "click-handle": A,
1374
+ light: ""
1375
+ })
1376
+ ]),
1377
+ Ye(se("div", Fn, [
1378
+ se("div", $n, [
1379
+ (ee(!0), ye(jt, null, Vt(i(Wt), (G) => (ee(), ye("div", {
1380
+ class: ie(["types-item", { "types-item-active": a.value === G.id }]),
1381
+ key: G.id,
1382
+ onClick: (q) => f(G)
1383
+ }, at(G.name), 11, Pn))), 128))
1384
+ ]),
1385
+ se("div", jn, [
1386
+ Oe(Y, {
1387
+ ref_key: "tree",
1388
+ ref: o,
1389
+ height: 800,
1390
+ "node-key": "nodeId",
1391
+ data: s.value,
1392
+ "default-expanded-keys": v.value,
1393
+ "current-node-key": g.value,
1394
+ "highlight-current": !0,
1395
+ props: $,
1396
+ onCheck: d,
1397
+ onNodeClick: k,
1398
+ onNodeExpand: T,
1399
+ onNodeCollapse: L,
1400
+ "show-checkbox": ""
1401
+ }, null, 8, ["data", "default-expanded-keys", "current-node-key"])
1402
+ ])
1403
+ ], 512), [
1404
+ [Xe, w.value]
1405
+ ]),
1406
+ Ye(se("div", Vn, qn, 512), [
1407
+ [Xe, !w.value]
1408
+ ])
1409
+ ]);
1410
+ };
1411
+ }
1412
+ }), oo = /* @__PURE__ */ Lt(Wn, [["__scopeId", "data-v-1aaf48fb"]]);
1413
+ export {
1414
+ oo as default
1415
+ };