jmash-core 0.0.2 → 0.0.4

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 (91) hide show
  1. package/dist/401-DoLCxv3l.mjs +103 -0
  2. package/dist/404-D1KiG-19.mjs +37 -0
  3. package/dist/BarChart-C1VgkGMN.mjs +203 -0
  4. package/dist/FileSaver.min-CbZYb_R2.mjs +77 -0
  5. package/dist/FunnelChart-Czy2TVI1.mjs +106 -0
  6. package/dist/PieChart-D4hXD0SH.mjs +4 -0
  7. package/dist/PieChart.vue_vue_type_script_setup_true_lang-BzbbPmOh.mjs +90 -0
  8. package/dist/RadarChart-BIL7VT1H.mjs +4 -0
  9. package/dist/RadarChart.vue_vue_type_script_setup_true_lang-DcuctIiI.mjs +109 -0
  10. package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  11. package/dist/caret-bottom-Cm1qBSrY.mjs +59 -0
  12. package/dist/common-DuVBTwAv.mjs +36 -0
  13. package/dist/debounce-C0G0JMal.mjs +81 -0
  14. package/dist/dropdown2-BiRFTrOq.mjs +160 -0
  15. package/dist/edit-Bpt21Eir.mjs +833 -0
  16. package/dist/edit-CYWeo3RE.mjs +4 -0
  17. package/dist/edit-Cde8RIRN.mjs +4 -0
  18. package/dist/edit-D3-EslTs.mjs +4 -0
  19. package/dist/edit-DLx0iRHQ.mjs +469 -0
  20. package/dist/edit-NICINRFG.mjs +4 -0
  21. package/dist/edit-Vk23bJyE.mjs +4 -0
  22. package/dist/edit-sqzPOfBX.mjs +4 -0
  23. package/dist/edit.vue_vue_type_script_setup_true_lang-BYoUZaYJ.mjs +157 -0
  24. package/dist/edit.vue_vue_type_script_setup_true_lang-CFHGaytm.mjs +137 -0
  25. package/dist/edit.vue_vue_type_script_setup_true_lang-C_NNjRjK.mjs +622 -0
  26. package/dist/edit.vue_vue_type_script_setup_true_lang-DBxZMZyS.mjs +222 -0
  27. package/dist/edit.vue_vue_type_script_setup_true_lang-_tHqd9tg.mjs +226 -0
  28. package/dist/edit.vue_vue_type_script_setup_true_lang-mM66jf9N.mjs +288 -0
  29. package/dist/el-card-BIRVdEQY.mjs +61 -0
  30. package/dist/el-checkbox-group-l0sNRNKZ.mjs +1 -0
  31. package/dist/el-checkbox-miY6QbQ8.mjs +548 -0
  32. package/dist/el-col-BOgRUJYE.mjs +135 -0
  33. package/dist/el-date-picker-D9yvdcj2.mjs +3349 -0
  34. package/dist/el-dialog-BSTwker5.mjs +378 -0
  35. package/dist/el-dropdown-item-YDb2-w9y.mjs +675 -0
  36. package/dist/el-form-item-BzKoZc6I.mjs +1489 -0
  37. package/dist/el-icon-l0sNRNKZ.mjs +1 -0
  38. package/dist/el-popover-DuRdut0P.mjs +159 -0
  39. package/dist/el-popper-AjIjI4wK.mjs +1656 -0
  40. package/dist/el-progress-BPv5gfee.mjs +898 -0
  41. package/dist/el-radio-NC-gfUsx.mjs +251 -0
  42. package/dist/el-scrollbar-p0O6uID0.mjs +607 -0
  43. package/dist/el-select-DAMII7lv.mjs +1040 -0
  44. package/dist/el-switch-C2AFgHGW.mjs +254 -0
  45. package/dist/el-table-IQFrP3zv.mjs +3168 -0
  46. package/dist/el-tag-l0sNRNKZ.mjs +1 -0
  47. package/dist/el-tooltip-l0sNRNKZ.mjs +1 -0
  48. package/dist/el-tree-select-CyDKS6nF.mjs +1316 -0
  49. package/dist/importUpload.vue_vue_type_script_setup_true_lang-DWWbxFGH.mjs +117 -0
  50. package/dist/index-A3UILhe-.mjs +279 -0
  51. package/dist/index-Ax_8ZsXK.mjs +3163 -0
  52. package/dist/index-B46NFfoE.mjs +487 -0
  53. package/dist/index-BWx4KWAY.mjs +282 -0
  54. package/dist/index-BWyb1bu2.mjs +505 -0
  55. package/dist/index-BjqMDjBg.mjs +43994 -0
  56. package/dist/index-BnbEfNmI.mjs +134 -0
  57. package/dist/index-BpAihYhN.mjs +280 -0
  58. package/dist/index-Bs3AcT6R.mjs +107 -0
  59. package/dist/index-BvixCbHl.mjs +329 -0
  60. package/dist/index-C0UgbyoZ.mjs +452 -0
  61. package/dist/index-C0vV2_4K.mjs +63 -0
  62. package/dist/index-CBB_r4G5.mjs +965 -0
  63. package/dist/index-CCFtIl_h.mjs +516 -0
  64. package/dist/index-Cd3TOW5i.mjs +93 -0
  65. package/dist/index-CgNPGcHv.mjs +292 -0
  66. package/dist/index-CoOFKDgw.mjs +74 -0
  67. package/dist/index-CrNYgyNm.mjs +8800 -0
  68. package/dist/index-CurzO9C6.mjs +248 -0
  69. package/dist/index-DJ08yxAP.mjs +11 -0
  70. package/dist/index-DjkMA-Wh.mjs +40 -0
  71. package/dist/index-Url6hMpl.mjs +483 -0
  72. package/dist/index-eT2JltVa.mjs +55 -0
  73. package/dist/index-mkT_dTWL.mjs +13 -0
  74. package/dist/index-uykKwY2Z.mjs +12 -0
  75. package/dist/index-xtDIXRPY.mjs +633 -0
  76. package/dist/index.mjs +19 -273
  77. package/dist/index.vue_vue_type_script_setup_true_lang-BoxqootF.mjs +58 -0
  78. package/dist/index.vue_vue_type_script_setup_true_lang-C6yk_vUt.mjs +286 -0
  79. package/dist/isUndefined-CUQZk6oB.mjs +6 -0
  80. package/dist/moment-CMYwqyVT.mjs +2579 -0
  81. package/dist/picture-kPnmHaoS.mjs +599 -0
  82. package/dist/profile-RVQuIwXg.mjs +319 -0
  83. package/dist/refs-S3PYDmaW.mjs +9 -0
  84. package/dist/style.css +1 -1
  85. package/dist/types-CCG3Dvqs.mjs +205 -0
  86. package/dist/updatePwd-2UsTmJa5.mjs +4 -0
  87. package/dist/updatePwd.vue_vue_type_script_setup_true_lang-_Uadc2g3.mjs +151 -0
  88. package/dist/useColumnToggleTable-D_QF8Uy9.mjs +272 -0
  89. package/dist/vue-i18n-CE6tUbcO.mjs +3808 -0
  90. package/dts/tsconfig.tsbuildinfo +1 -1
  91. package/package.json +31 -2
@@ -0,0 +1,1316 @@
1
+ import { reactive as _, defineComponent as R, inject as V, h as G, renderSlot as Se, provide as J, ref as w, getCurrentInstance as me, watch as S, nextTick as H, resolveComponent as M, withDirectives as he, openBlock as A, createElementBlock as j, normalizeClass as T, withModifiers as I, createElementVNode as ue, normalizeStyle as Pe, createBlock as P, withCtx as ie, resolveDynamicComponent as je, createCommentVNode as X, createVNode as le, Fragment as xe, renderList as Ae, vShow as fe, shallowRef as Ee, onMounted as Oe, onUpdated as Fe, computed as B, toDisplayString as Ve, toRefs as Te } from "vue";
2
+ import { a as ye, E as De, e as He, s as Re } from "./el-select-DAMII7lv.mjs";
3
+ import { c0 as pe, a9 as Ue, w as U, _ as se, a0 as ce, $ as We, y as Ye, bI as Xe, aS as Ge, c1 as Je, U as Ie, N as Qe, H as Ze, I as L, X as _e, t as et, b4 as tt, aI as ee } from "./index-CrNYgyNm.mjs";
4
+ import { _ as nt } from "./index-eT2JltVa.mjs";
5
+ import { E as ot, p as re } from "./el-checkbox-miY6QbQ8.mjs";
6
+ import { i as dt } from "./el-scrollbar-p0O6uID0.mjs";
7
+ const F = "$treeNodeId", we = function(e, t) {
8
+ !t || t[F] || Object.defineProperty(t, F, {
9
+ value: e.id,
10
+ enumerable: !1,
11
+ configurable: !1,
12
+ writable: !1
13
+ });
14
+ }, be = function(e, t) {
15
+ return e ? t[e] : t[F];
16
+ }, ge = (e, t, o) => {
17
+ const d = e.value.currentNode;
18
+ o();
19
+ const n = e.value.currentNode;
20
+ d !== n && t("current-change", n ? n.data : null, n);
21
+ }, Ne = (e) => {
22
+ let t = !0, o = !0, d = !0;
23
+ for (let n = 0, r = e.length; n < r; n++) {
24
+ const l = e[n];
25
+ (l.checked !== !0 || l.indeterminate) && (t = !1, l.disabled || (d = !1)), (l.checked !== !1 || l.indeterminate) && (o = !1);
26
+ }
27
+ return { all: t, none: o, allWithoutDisable: d, half: !t && !o };
28
+ }, te = function(e) {
29
+ if (e.childNodes.length === 0 || e.loading)
30
+ return;
31
+ const { all: t, none: o, half: d } = Ne(e.childNodes);
32
+ t ? (e.checked = !0, e.indeterminate = !1) : d ? (e.checked = !1, e.indeterminate = !0) : o && (e.checked = !1, e.indeterminate = !1);
33
+ const n = e.parent;
34
+ !n || n.level === 0 || e.store.checkStrictly || te(n);
35
+ }, Z = function(e, t) {
36
+ const o = e.store.props, d = e.data || {}, n = o[t];
37
+ if (typeof n == "function")
38
+ return n(d, e);
39
+ if (typeof n == "string")
40
+ return d[n];
41
+ if (typeof n > "u") {
42
+ const r = d[t];
43
+ return r === void 0 ? "" : r;
44
+ }
45
+ };
46
+ let rt = 0;
47
+ class $ {
48
+ constructor(t) {
49
+ this.id = rt++, 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;
50
+ for (const o in t)
51
+ pe(t, o) && (this[o] = t[o]);
52
+ this.level = 0, this.loaded = !1, this.childNodes = [], this.loading = !1, this.parent && (this.level = this.parent.level + 1);
53
+ }
54
+ initialize() {
55
+ const t = this.store;
56
+ if (!t)
57
+ throw new Error("[Node]store is required!");
58
+ t.registerNode(this);
59
+ const o = t.props;
60
+ if (o && typeof o.isLeaf < "u") {
61
+ const r = Z(this, "isLeaf");
62
+ typeof r == "boolean" && (this.isLeafByUser = r);
63
+ }
64
+ if (t.lazy !== !0 && this.data ? (this.setData(this.data), t.defaultExpandAll && (this.expanded = !0, this.canFocus = !0)) : this.level > 0 && t.lazy && t.defaultExpandAll && this.expand(), Array.isArray(this.data) || we(this, this.data), !this.data)
65
+ return;
66
+ const d = t.defaultExpandedKeys, n = t.key;
67
+ n && d && d.includes(this.key) && this.expand(null, t.autoExpandParent), n && t.currentNodeKey !== void 0 && this.key === t.currentNodeKey && (t.currentNode = this, t.currentNode.isCurrent = !0), t.lazy && t._initDefaultCheckedNode(this), this.updateLeafState(), this.parent && (this.level === 1 || this.parent.expanded === !0) && (this.canFocus = !0);
68
+ }
69
+ setData(t) {
70
+ Array.isArray(t) || we(this, t), this.data = t, this.childNodes = [];
71
+ let o;
72
+ this.level === 0 && Array.isArray(this.data) ? o = this.data : o = Z(this, "children") || [];
73
+ for (let d = 0, n = o.length; d < n; d++)
74
+ this.insertChild({ data: o[d] });
75
+ }
76
+ get label() {
77
+ return Z(this, "label");
78
+ }
79
+ get key() {
80
+ const t = this.store.key;
81
+ return this.data ? this.data[t] : null;
82
+ }
83
+ get disabled() {
84
+ return Z(this, "disabled");
85
+ }
86
+ get nextSibling() {
87
+ const t = this.parent;
88
+ if (t) {
89
+ const o = t.childNodes.indexOf(this);
90
+ if (o > -1)
91
+ return t.childNodes[o + 1];
92
+ }
93
+ return null;
94
+ }
95
+ get previousSibling() {
96
+ const t = this.parent;
97
+ if (t) {
98
+ const o = t.childNodes.indexOf(this);
99
+ if (o > -1)
100
+ return o > 0 ? t.childNodes[o - 1] : null;
101
+ }
102
+ return null;
103
+ }
104
+ contains(t, o = !0) {
105
+ return (this.childNodes || []).some((d) => d === t || o && d.contains(t));
106
+ }
107
+ remove() {
108
+ const t = this.parent;
109
+ t && t.removeChild(this);
110
+ }
111
+ insertChild(t, o, d) {
112
+ if (!t)
113
+ throw new Error("InsertChild error: child is required.");
114
+ if (!(t instanceof $)) {
115
+ if (!d) {
116
+ const n = this.getChildren(!0);
117
+ n.includes(t.data) || (typeof o > "u" || o < 0 ? n.push(t.data) : n.splice(o, 0, t.data));
118
+ }
119
+ Object.assign(t, {
120
+ parent: this,
121
+ store: this.store
122
+ }), t = _(new $(t)), t instanceof $ && t.initialize();
123
+ }
124
+ t.level = this.level + 1, typeof o > "u" || o < 0 ? this.childNodes.push(t) : this.childNodes.splice(o, 0, t), this.updateLeafState();
125
+ }
126
+ insertBefore(t, o) {
127
+ let d;
128
+ o && (d = this.childNodes.indexOf(o)), this.insertChild(t, d);
129
+ }
130
+ insertAfter(t, o) {
131
+ let d;
132
+ o && (d = this.childNodes.indexOf(o), d !== -1 && (d += 1)), this.insertChild(t, d);
133
+ }
134
+ removeChild(t) {
135
+ const o = this.getChildren() || [], d = o.indexOf(t.data);
136
+ d > -1 && o.splice(d, 1);
137
+ const n = this.childNodes.indexOf(t);
138
+ n > -1 && (this.store && this.store.deregisterNode(t), t.parent = null, this.childNodes.splice(n, 1)), this.updateLeafState();
139
+ }
140
+ removeChildByData(t) {
141
+ let o = null;
142
+ for (let d = 0; d < this.childNodes.length; d++)
143
+ if (this.childNodes[d].data === t) {
144
+ o = this.childNodes[d];
145
+ break;
146
+ }
147
+ o && this.removeChild(o);
148
+ }
149
+ expand(t, o) {
150
+ const d = () => {
151
+ if (o) {
152
+ let n = this.parent;
153
+ for (; n.level > 0; )
154
+ n.expanded = !0, n = n.parent;
155
+ }
156
+ this.expanded = !0, t && t(), this.childNodes.forEach((n) => {
157
+ n.canFocus = !0;
158
+ });
159
+ };
160
+ this.shouldLoadData() ? this.loadData((n) => {
161
+ Array.isArray(n) && (this.checked ? this.setChecked(!0, !0) : this.store.checkStrictly || te(this), d());
162
+ }) : d();
163
+ }
164
+ doCreateChildren(t, o = {}) {
165
+ t.forEach((d) => {
166
+ this.insertChild(Object.assign({ data: d }, o), void 0, !0);
167
+ });
168
+ }
169
+ collapse() {
170
+ this.expanded = !1, this.childNodes.forEach((t) => {
171
+ t.canFocus = !1;
172
+ });
173
+ }
174
+ shouldLoadData() {
175
+ return this.store.lazy === !0 && this.store.load && !this.loaded;
176
+ }
177
+ updateLeafState() {
178
+ if (this.store.lazy === !0 && this.loaded !== !0 && typeof this.isLeafByUser < "u") {
179
+ this.isLeaf = this.isLeafByUser;
180
+ return;
181
+ }
182
+ const t = this.childNodes;
183
+ if (!this.store.lazy || this.store.lazy === !0 && this.loaded === !0) {
184
+ this.isLeaf = !t || t.length === 0;
185
+ return;
186
+ }
187
+ this.isLeaf = !1;
188
+ }
189
+ setChecked(t, o, d, n) {
190
+ if (this.indeterminate = t === "half", this.checked = t === !0, this.store.checkStrictly)
191
+ return;
192
+ if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
193
+ const { all: l, allWithoutDisable: c } = Ne(this.childNodes);
194
+ !this.isLeaf && !l && c && (this.checked = !1, t = !1);
195
+ const i = () => {
196
+ if (o) {
197
+ const g = this.childNodes;
198
+ for (let s = 0, f = g.length; s < f; s++) {
199
+ const y = g[s];
200
+ n = n || t !== !1;
201
+ const C = y.disabled ? y.checked : n;
202
+ y.setChecked(C, o, !0, n);
203
+ }
204
+ const { half: u, all: a } = Ne(g);
205
+ a || (this.checked = a, this.indeterminate = u);
206
+ }
207
+ };
208
+ if (this.shouldLoadData()) {
209
+ this.loadData(() => {
210
+ i(), te(this);
211
+ }, {
212
+ checked: t !== !1
213
+ });
214
+ return;
215
+ } else
216
+ i();
217
+ }
218
+ const r = this.parent;
219
+ !r || r.level === 0 || d || te(r);
220
+ }
221
+ getChildren(t = !1) {
222
+ if (this.level === 0)
223
+ return this.data;
224
+ const o = this.data;
225
+ if (!o)
226
+ return null;
227
+ const d = this.store.props;
228
+ let n = "children";
229
+ return d && (n = d.children || "children"), o[n] === void 0 && (o[n] = null), t && !o[n] && (o[n] = []), o[n];
230
+ }
231
+ updateChildren() {
232
+ const t = this.getChildren() || [], o = this.childNodes.map((r) => r.data), d = {}, n = [];
233
+ t.forEach((r, l) => {
234
+ const c = r[F];
235
+ !!c && o.findIndex((g) => g[F] === c) >= 0 ? d[c] = { index: l, data: r } : n.push({ index: l, data: r });
236
+ }), this.store.lazy || o.forEach((r) => {
237
+ d[r[F]] || this.removeChildByData(r);
238
+ }), n.forEach(({ index: r, data: l }) => {
239
+ this.insertChild({ data: l }, r);
240
+ }), this.updateLeafState();
241
+ }
242
+ loadData(t, o = {}) {
243
+ if (this.store.lazy === !0 && this.store.load && !this.loaded && (!this.loading || Object.keys(o).length)) {
244
+ this.loading = !0;
245
+ const d = (n) => {
246
+ this.childNodes = [], this.doCreateChildren(n, o), this.loaded = !0, this.loading = !1, this.updateLeafState(), t && t.call(this, n);
247
+ };
248
+ this.store.load(this, d);
249
+ } else
250
+ t && t.call(this);
251
+ }
252
+ }
253
+ class st {
254
+ constructor(t) {
255
+ this.currentNode = null, this.currentNodeKey = null;
256
+ for (const o in t)
257
+ pe(t, o) && (this[o] = t[o]);
258
+ this.nodesMap = {};
259
+ }
260
+ initialize() {
261
+ if (this.root = new $({
262
+ data: this.data,
263
+ store: this
264
+ }), this.root.initialize(), this.lazy && this.load) {
265
+ const t = this.load;
266
+ t(this.root, (o) => {
267
+ this.root.doCreateChildren(o), this._initDefaultCheckedNodes();
268
+ });
269
+ } else
270
+ this._initDefaultCheckedNodes();
271
+ }
272
+ filter(t) {
273
+ const o = this.filterNodeMethod, d = this.lazy, n = function(r) {
274
+ const l = r.root ? r.root.childNodes : r.childNodes;
275
+ if (l.forEach((c) => {
276
+ c.visible = o.call(c, t, c.data, c), n(c);
277
+ }), !r.visible && l.length) {
278
+ let c = !0;
279
+ c = !l.some((i) => i.visible), r.root ? r.root.visible = c === !1 : r.visible = c === !1;
280
+ }
281
+ t && r.visible && !r.isLeaf && (!d || r.loaded) && r.expand();
282
+ };
283
+ n(this);
284
+ }
285
+ setData(t) {
286
+ t !== this.root.data ? (this.root.setData(t), this._initDefaultCheckedNodes()) : this.root.updateChildren();
287
+ }
288
+ getNode(t) {
289
+ if (t instanceof $)
290
+ return t;
291
+ const o = Ue(t) ? be(this.key, t) : t;
292
+ return this.nodesMap[o] || null;
293
+ }
294
+ insertBefore(t, o) {
295
+ const d = this.getNode(o);
296
+ d.parent.insertBefore({ data: t }, d);
297
+ }
298
+ insertAfter(t, o) {
299
+ const d = this.getNode(o);
300
+ d.parent.insertAfter({ data: t }, d);
301
+ }
302
+ remove(t) {
303
+ const o = this.getNode(t);
304
+ o && o.parent && (o === this.currentNode && (this.currentNode = null), o.parent.removeChild(o));
305
+ }
306
+ append(t, o) {
307
+ const d = o ? this.getNode(o) : this.root;
308
+ d && d.insertChild({ data: t });
309
+ }
310
+ _initDefaultCheckedNodes() {
311
+ const t = this.defaultCheckedKeys || [], o = this.nodesMap;
312
+ t.forEach((d) => {
313
+ const n = o[d];
314
+ n && n.setChecked(!0, !this.checkStrictly);
315
+ });
316
+ }
317
+ _initDefaultCheckedNode(t) {
318
+ (this.defaultCheckedKeys || []).includes(t.key) && t.setChecked(!0, !this.checkStrictly);
319
+ }
320
+ setDefaultCheckedKey(t) {
321
+ t !== this.defaultCheckedKeys && (this.defaultCheckedKeys = t, this._initDefaultCheckedNodes());
322
+ }
323
+ registerNode(t) {
324
+ const o = this.key;
325
+ !t || !t.data || (o ? t.key !== void 0 && (this.nodesMap[t.key] = t) : this.nodesMap[t.id] = t);
326
+ }
327
+ deregisterNode(t) {
328
+ !this.key || !t || !t.data || (t.childNodes.forEach((d) => {
329
+ this.deregisterNode(d);
330
+ }), delete this.nodesMap[t.key]);
331
+ }
332
+ getCheckedNodes(t = !1, o = !1) {
333
+ const d = [], n = function(r) {
334
+ (r.root ? r.root.childNodes : r.childNodes).forEach((c) => {
335
+ (c.checked || o && c.indeterminate) && (!t || t && c.isLeaf) && d.push(c.data), n(c);
336
+ });
337
+ };
338
+ return n(this), d;
339
+ }
340
+ getCheckedKeys(t = !1) {
341
+ return this.getCheckedNodes(t).map((o) => (o || {})[this.key]);
342
+ }
343
+ getHalfCheckedNodes() {
344
+ const t = [], o = function(d) {
345
+ (d.root ? d.root.childNodes : d.childNodes).forEach((r) => {
346
+ r.indeterminate && t.push(r.data), o(r);
347
+ });
348
+ };
349
+ return o(this), t;
350
+ }
351
+ getHalfCheckedKeys() {
352
+ return this.getHalfCheckedNodes().map((t) => (t || {})[this.key]);
353
+ }
354
+ _getAllNodes() {
355
+ const t = [], o = this.nodesMap;
356
+ for (const d in o)
357
+ pe(o, d) && t.push(o[d]);
358
+ return t;
359
+ }
360
+ updateChildren(t, o) {
361
+ const d = this.nodesMap[t];
362
+ if (!d)
363
+ return;
364
+ const n = d.childNodes;
365
+ for (let r = n.length - 1; r >= 0; r--) {
366
+ const l = n[r];
367
+ this.remove(l.data);
368
+ }
369
+ for (let r = 0, l = o.length; r < l; r++) {
370
+ const c = o[r];
371
+ this.append(c, d.data);
372
+ }
373
+ }
374
+ _setCheckedKeys(t, o = !1, d) {
375
+ const n = this._getAllNodes().sort((i, g) => i.level - g.level), r = /* @__PURE__ */ Object.create(null), l = Object.keys(d);
376
+ n.forEach((i) => i.setChecked(!1, !1));
377
+ const c = (i) => {
378
+ i.childNodes.forEach((g) => {
379
+ var u;
380
+ r[g.data[t]] = !0, (u = g.childNodes) != null && u.length && c(g);
381
+ });
382
+ };
383
+ for (let i = 0, g = n.length; i < g; i++) {
384
+ const u = n[i], a = u.data[t].toString();
385
+ if (!l.includes(a)) {
386
+ u.checked && !r[a] && u.setChecked(!1, !1);
387
+ continue;
388
+ }
389
+ if (u.childNodes.length && c(u), u.isLeaf || this.checkStrictly) {
390
+ u.setChecked(!0, !1);
391
+ continue;
392
+ }
393
+ if (u.setChecked(!0, !0), o) {
394
+ u.setChecked(!1, !1);
395
+ const f = function(y) {
396
+ y.childNodes.forEach((k) => {
397
+ k.isLeaf || k.setChecked(!1, !1), f(k);
398
+ });
399
+ };
400
+ f(u);
401
+ }
402
+ }
403
+ }
404
+ setCheckedNodes(t, o = !1) {
405
+ const d = this.key, n = {};
406
+ t.forEach((r) => {
407
+ n[(r || {})[d]] = !0;
408
+ }), this._setCheckedKeys(d, o, n);
409
+ }
410
+ setCheckedKeys(t, o = !1) {
411
+ this.defaultCheckedKeys = t;
412
+ const d = this.key, n = {};
413
+ t.forEach((r) => {
414
+ n[r] = !0;
415
+ }), this._setCheckedKeys(d, o, n);
416
+ }
417
+ setDefaultExpandedKeys(t) {
418
+ t = t || [], this.defaultExpandedKeys = t, t.forEach((o) => {
419
+ const d = this.getNode(o);
420
+ d && d.expand(null, this.autoExpandParent);
421
+ });
422
+ }
423
+ setChecked(t, o, d) {
424
+ const n = this.getNode(t);
425
+ n && n.setChecked(!!o, d);
426
+ }
427
+ getCurrentNode() {
428
+ return this.currentNode;
429
+ }
430
+ setCurrentNode(t) {
431
+ const o = this.currentNode;
432
+ o && (o.isCurrent = !1), this.currentNode = t, this.currentNode.isCurrent = !0;
433
+ }
434
+ setUserCurrentNode(t, o = !0) {
435
+ const d = t[this.key], n = this.nodesMap[d];
436
+ this.setCurrentNode(n), o && this.currentNode.level > 1 && this.currentNode.parent.expand(null, !0);
437
+ }
438
+ setCurrentNodeKey(t, o = !0) {
439
+ if (t == null) {
440
+ this.currentNode && (this.currentNode.isCurrent = !1), this.currentNode = null;
441
+ return;
442
+ }
443
+ const d = this.getNode(t);
444
+ d && (this.setCurrentNode(d), o && this.currentNode.level > 1 && this.currentNode.parent.expand(null, !0));
445
+ }
446
+ }
447
+ const at = R({
448
+ name: "ElTreeNodeContent",
449
+ props: {
450
+ node: {
451
+ type: Object,
452
+ required: !0
453
+ },
454
+ renderContent: Function
455
+ },
456
+ setup(e) {
457
+ const t = U("tree"), o = V("NodeInstance"), d = V("RootTree");
458
+ return () => {
459
+ const n = e.node, { data: r, store: l } = n;
460
+ return e.renderContent ? e.renderContent(G, { _self: o, node: n, data: r, store: l }) : Se(d.ctx.slots, "default", { node: n, data: r }, () => [
461
+ G("span", { class: t.be("node", "label") }, [n.label])
462
+ ]);
463
+ };
464
+ }
465
+ });
466
+ var it = /* @__PURE__ */ se(at, [["__file", "tree-node-content.vue"]]);
467
+ function Le(e) {
468
+ const t = V("TreeNodeMap", null), o = {
469
+ treeNodeExpand: (d) => {
470
+ e.node !== d && e.node.collapse();
471
+ },
472
+ children: []
473
+ };
474
+ return t && t.children.push(o), J("TreeNodeMap", o), {
475
+ broadcastExpanded: (d) => {
476
+ if (e.accordion)
477
+ for (const n of o.children)
478
+ n.treeNodeExpand(d);
479
+ }
480
+ };
481
+ }
482
+ const Me = Symbol("dragEvents");
483
+ function lt({ props: e, ctx: t, el$: o, dropIndicator$: d, store: n }) {
484
+ const r = U("tree"), l = w({
485
+ showDropIndicator: !1,
486
+ draggingNode: null,
487
+ dropNode: null,
488
+ allowDrop: !0,
489
+ dropType: null
490
+ });
491
+ return J(Me, {
492
+ treeNodeDragStart: ({ event: u, treeNode: a }) => {
493
+ if (typeof e.allowDrag == "function" && !e.allowDrag(a.node))
494
+ return u.preventDefault(), !1;
495
+ u.dataTransfer.effectAllowed = "move";
496
+ try {
497
+ u.dataTransfer.setData("text/plain", "");
498
+ } catch {
499
+ }
500
+ l.value.draggingNode = a, t.emit("node-drag-start", a.node, u);
501
+ },
502
+ treeNodeDragOver: ({ event: u, treeNode: a }) => {
503
+ const s = a, f = l.value.dropNode;
504
+ f && f.node.id !== s.node.id && ce(f.$el, r.is("drop-inner"));
505
+ const y = l.value.draggingNode;
506
+ if (!y || !s)
507
+ return;
508
+ let C = !0, k = !0, m = !0, x = !0;
509
+ typeof e.allowDrop == "function" && (C = e.allowDrop(y.node, s.node, "prev"), x = k = e.allowDrop(y.node, s.node, "inner"), m = e.allowDrop(y.node, s.node, "next")), u.dataTransfer.dropEffect = k || C || m ? "move" : "none", (C || k || m) && (f == null ? void 0 : f.node.id) !== s.node.id && (f && t.emit("node-drag-leave", y.node, f.node, u), t.emit("node-drag-enter", y.node, s.node, u)), C || k || m ? l.value.dropNode = s : l.value.dropNode = null, s.node.nextSibling === y.node && (m = !1), s.node.previousSibling === y.node && (C = !1), s.node.contains(y.node, !1) && (k = !1), (y.node === s.node || y.node.contains(s.node)) && (C = !1, k = !1, m = !1);
510
+ const v = s.$el.querySelector(`.${r.be("node", "content")}`).getBoundingClientRect(), O = o.value.getBoundingClientRect();
511
+ let E;
512
+ const D = C ? k ? 0.25 : m ? 0.45 : 1 : -1, Q = m ? k ? 0.75 : C ? 0.55 : 0 : 1;
513
+ let z = -9999;
514
+ const p = u.clientY - v.top;
515
+ p < v.height * D ? E = "before" : p > v.height * Q ? E = "after" : k ? E = "inner" : E = "none";
516
+ const b = s.$el.querySelector(`.${r.be("node", "expand-icon")}`).getBoundingClientRect(), K = d.value;
517
+ E === "before" ? z = b.top - O.top : E === "after" && (z = b.bottom - O.top), K.style.top = `${z}px`, K.style.left = `${b.right - O.left}px`, E === "inner" ? We(s.$el, r.is("drop-inner")) : ce(s.$el, r.is("drop-inner")), l.value.showDropIndicator = E === "before" || E === "after", l.value.allowDrop = l.value.showDropIndicator || x, l.value.dropType = E, t.emit("node-drag-over", y.node, s.node, u);
518
+ },
519
+ treeNodeDragEnd: (u) => {
520
+ const { draggingNode: a, dropType: s, dropNode: f } = l.value;
521
+ if (u.preventDefault(), u.dataTransfer.dropEffect = "move", a && f) {
522
+ const y = { data: a.node.data };
523
+ s !== "none" && a.node.remove(), s === "before" ? f.node.parent.insertBefore(y, f.node) : s === "after" ? f.node.parent.insertAfter(y, f.node) : s === "inner" && f.node.insertChild(y), s !== "none" && n.value.registerNode(y), ce(f.$el, r.is("drop-inner")), t.emit("node-drag-end", a.node, f.node, s, u), s !== "none" && t.emit("node-drop", a.node, f.node, s, u);
524
+ }
525
+ a && !f && t.emit("node-drag-end", a.node, null, s, u), l.value.showDropIndicator = !1, l.value.draggingNode = null, l.value.dropNode = null, l.value.allowDrop = !0;
526
+ }
527
+ }), {
528
+ dragState: l
529
+ };
530
+ }
531
+ const ct = R({
532
+ name: "ElTreeNode",
533
+ components: {
534
+ ElCollapseTransition: nt,
535
+ ElCheckbox: ot,
536
+ NodeContent: it,
537
+ ElIcon: Ye,
538
+ Loading: Xe
539
+ },
540
+ props: {
541
+ node: {
542
+ type: $,
543
+ default: () => ({})
544
+ },
545
+ props: {
546
+ type: Object,
547
+ default: () => ({})
548
+ },
549
+ accordion: Boolean,
550
+ renderContent: Function,
551
+ renderAfterExpand: Boolean,
552
+ showCheckbox: {
553
+ type: Boolean,
554
+ default: !1
555
+ }
556
+ },
557
+ emits: ["node-expand"],
558
+ setup(e, t) {
559
+ const o = U("tree"), { broadcastExpanded: d } = Le(e), n = V("RootTree"), r = w(!1), l = w(!1), c = w(null), i = w(null), g = w(null), u = V(Me), a = me();
560
+ J("NodeInstance", a), n || Ge("Tree", "Can not find node's tree."), e.node.expanded && (r.value = !0, l.value = !0);
561
+ const s = n.props.props.children || "children";
562
+ S(() => {
563
+ const p = e.node.data[s];
564
+ return p && [...p];
565
+ }, () => {
566
+ e.node.updateChildren();
567
+ }), S(() => e.node.indeterminate, (p) => {
568
+ C(e.node.checked, p);
569
+ }), S(() => e.node.checked, (p) => {
570
+ C(p, e.node.indeterminate);
571
+ }), S(() => e.node.expanded, (p) => {
572
+ H(() => r.value = p), p && (l.value = !0);
573
+ });
574
+ const f = (p) => be(n.props.nodeKey, p.data), y = (p) => {
575
+ const b = e.props.class;
576
+ if (!b)
577
+ return {};
578
+ let K;
579
+ if (Ie(b)) {
580
+ const { data: ae } = p;
581
+ K = b(ae, p);
582
+ } else
583
+ K = b;
584
+ return Qe(K) ? { [K]: !0 } : K;
585
+ }, C = (p, b) => {
586
+ (c.value !== p || i.value !== b) && n.ctx.emit("check-change", e.node.data, p, b), c.value = p, i.value = b;
587
+ }, k = (p) => {
588
+ ge(n.store, n.ctx.emit, () => n.store.value.setCurrentNode(e.node)), n.currentNode.value = e.node, n.props.expandOnClickNode && x(), n.props.checkOnClickNode && !e.node.disabled && v(null, {
589
+ target: { checked: !e.node.checked }
590
+ }), n.ctx.emit("node-click", e.node.data, e.node, a, p);
591
+ }, m = (p) => {
592
+ n.instance.vnode.props.onNodeContextmenu && (p.stopPropagation(), p.preventDefault()), n.ctx.emit("node-contextmenu", p, e.node.data, e.node, a);
593
+ }, x = () => {
594
+ e.node.isLeaf || (r.value ? (n.ctx.emit("node-collapse", e.node.data, e.node, a), e.node.collapse()) : (e.node.expand(), t.emit("node-expand", e.node.data, e.node, a)));
595
+ }, v = (p, b) => {
596
+ e.node.setChecked(b.target.checked, !n.props.checkStrictly), H(() => {
597
+ const K = n.store.value;
598
+ n.ctx.emit("check", e.node.data, {
599
+ checkedNodes: K.getCheckedNodes(),
600
+ checkedKeys: K.getCheckedKeys(),
601
+ halfCheckedNodes: K.getHalfCheckedNodes(),
602
+ halfCheckedKeys: K.getHalfCheckedKeys()
603
+ });
604
+ });
605
+ };
606
+ return {
607
+ ns: o,
608
+ node$: g,
609
+ tree: n,
610
+ expanded: r,
611
+ childNodeRendered: l,
612
+ oldChecked: c,
613
+ oldIndeterminate: i,
614
+ getNodeKey: f,
615
+ getNodeClass: y,
616
+ handleSelectChange: C,
617
+ handleClick: k,
618
+ handleContextMenu: m,
619
+ handleExpandIconClick: x,
620
+ handleCheckChange: v,
621
+ handleChildNodeExpand: (p, b, K) => {
622
+ d(b), n.ctx.emit("node-expand", p, b, K);
623
+ },
624
+ handleDragStart: (p) => {
625
+ n.props.draggable && u.treeNodeDragStart({ event: p, treeNode: e });
626
+ },
627
+ handleDragOver: (p) => {
628
+ p.preventDefault(), n.props.draggable && u.treeNodeDragOver({
629
+ event: p,
630
+ treeNode: { $el: g.value, node: e.node }
631
+ });
632
+ },
633
+ handleDrop: (p) => {
634
+ p.preventDefault();
635
+ },
636
+ handleDragEnd: (p) => {
637
+ n.props.draggable && u.treeNodeDragEnd(p);
638
+ },
639
+ CaretRight: Je
640
+ };
641
+ }
642
+ }), ht = ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key"], ut = ["aria-expanded"];
643
+ function ft(e, t, o, d, n, r) {
644
+ const l = M("el-icon"), c = M("el-checkbox"), i = M("loading"), g = M("node-content"), u = M("el-tree-node"), a = M("el-collapse-transition");
645
+ return he((A(), j("div", {
646
+ ref: "node$",
647
+ class: T([
648
+ e.ns.b("node"),
649
+ e.ns.is("expanded", e.expanded),
650
+ e.ns.is("current", e.node.isCurrent),
651
+ e.ns.is("hidden", !e.node.visible),
652
+ e.ns.is("focusable", !e.node.disabled),
653
+ e.ns.is("checked", !e.node.disabled && e.node.checked),
654
+ e.getNodeClass(e.node)
655
+ ]),
656
+ role: "treeitem",
657
+ tabindex: "-1",
658
+ "aria-expanded": e.expanded,
659
+ "aria-disabled": e.node.disabled,
660
+ "aria-checked": e.node.checked,
661
+ draggable: e.tree.props.draggable,
662
+ "data-key": e.getNodeKey(e.node),
663
+ onClick: t[1] || (t[1] = I((...s) => e.handleClick && e.handleClick(...s), ["stop"])),
664
+ onContextmenu: t[2] || (t[2] = (...s) => e.handleContextMenu && e.handleContextMenu(...s)),
665
+ onDragstart: t[3] || (t[3] = I((...s) => e.handleDragStart && e.handleDragStart(...s), ["stop"])),
666
+ onDragover: t[4] || (t[4] = I((...s) => e.handleDragOver && e.handleDragOver(...s), ["stop"])),
667
+ onDragend: t[5] || (t[5] = I((...s) => e.handleDragEnd && e.handleDragEnd(...s), ["stop"])),
668
+ onDrop: t[6] || (t[6] = I((...s) => e.handleDrop && e.handleDrop(...s), ["stop"]))
669
+ }, [
670
+ ue("div", {
671
+ class: T(e.ns.be("node", "content")),
672
+ style: Pe({ paddingLeft: (e.node.level - 1) * e.tree.props.indent + "px" })
673
+ }, [
674
+ e.tree.props.icon || e.CaretRight ? (A(), P(l, {
675
+ key: 0,
676
+ class: T([
677
+ e.ns.be("node", "expand-icon"),
678
+ e.ns.is("leaf", e.node.isLeaf),
679
+ {
680
+ expanded: !e.node.isLeaf && e.expanded
681
+ }
682
+ ]),
683
+ onClick: I(e.handleExpandIconClick, ["stop"])
684
+ }, {
685
+ default: ie(() => [
686
+ (A(), P(je(e.tree.props.icon || e.CaretRight)))
687
+ ]),
688
+ _: 1
689
+ }, 8, ["class", "onClick"])) : X("v-if", !0),
690
+ e.showCheckbox ? (A(), P(c, {
691
+ key: 1,
692
+ "model-value": e.node.checked,
693
+ indeterminate: e.node.indeterminate,
694
+ disabled: !!e.node.disabled,
695
+ onClick: t[0] || (t[0] = I(() => {
696
+ }, ["stop"])),
697
+ onChange: e.handleCheckChange
698
+ }, null, 8, ["model-value", "indeterminate", "disabled", "onChange"])) : X("v-if", !0),
699
+ e.node.loading ? (A(), P(l, {
700
+ key: 2,
701
+ class: T([e.ns.be("node", "loading-icon"), e.ns.is("loading")])
702
+ }, {
703
+ default: ie(() => [
704
+ le(i)
705
+ ]),
706
+ _: 1
707
+ }, 8, ["class"])) : X("v-if", !0),
708
+ le(g, {
709
+ node: e.node,
710
+ "render-content": e.renderContent
711
+ }, null, 8, ["node", "render-content"])
712
+ ], 6),
713
+ le(a, null, {
714
+ default: ie(() => [
715
+ !e.renderAfterExpand || e.childNodeRendered ? he((A(), j("div", {
716
+ key: 0,
717
+ class: T(e.ns.be("node", "children")),
718
+ role: "group",
719
+ "aria-expanded": e.expanded
720
+ }, [
721
+ (A(!0), j(xe, null, Ae(e.node.childNodes, (s) => (A(), P(u, {
722
+ key: e.getNodeKey(s),
723
+ "render-content": e.renderContent,
724
+ "render-after-expand": e.renderAfterExpand,
725
+ "show-checkbox": e.showCheckbox,
726
+ node: s,
727
+ accordion: e.accordion,
728
+ props: e.props,
729
+ onNodeExpand: e.handleChildNodeExpand
730
+ }, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]))), 128))
731
+ ], 10, ut)), [
732
+ [fe, e.expanded]
733
+ ]) : X("v-if", !0)
734
+ ]),
735
+ _: 1
736
+ })
737
+ ], 42, ht)), [
738
+ [fe, e.node.visible]
739
+ ]);
740
+ }
741
+ var yt = /* @__PURE__ */ se(ct, [["render", ft], ["__file", "tree-node.vue"]]);
742
+ function pt({ el$: e }, t) {
743
+ const o = U("tree"), d = Ee([]), n = Ee([]);
744
+ Oe(() => {
745
+ l();
746
+ }), Fe(() => {
747
+ d.value = Array.from(e.value.querySelectorAll("[role=treeitem]")), n.value = Array.from(e.value.querySelectorAll("input[type=checkbox]"));
748
+ }), S(n, (c) => {
749
+ c.forEach((i) => {
750
+ i.setAttribute("tabindex", "-1");
751
+ });
752
+ }), Ze(e, "keydown", (c) => {
753
+ const i = c.target;
754
+ if (!i.className.includes(o.b("node")))
755
+ return;
756
+ const g = c.code;
757
+ d.value = Array.from(e.value.querySelectorAll(`.${o.is("focusable")}[role=treeitem]`));
758
+ const u = d.value.indexOf(i);
759
+ let a;
760
+ if ([L.up, L.down].includes(g)) {
761
+ if (c.preventDefault(), g === L.up) {
762
+ a = u === -1 ? 0 : u !== 0 ? u - 1 : d.value.length - 1;
763
+ const f = a;
764
+ for (; !t.value.getNode(d.value[a].dataset.key).canFocus; ) {
765
+ if (a--, a === f) {
766
+ a = -1;
767
+ break;
768
+ }
769
+ a < 0 && (a = d.value.length - 1);
770
+ }
771
+ } else {
772
+ a = u === -1 ? 0 : u < d.value.length - 1 ? u + 1 : 0;
773
+ const f = a;
774
+ for (; !t.value.getNode(d.value[a].dataset.key).canFocus; ) {
775
+ if (a++, a === f) {
776
+ a = -1;
777
+ break;
778
+ }
779
+ a >= d.value.length && (a = 0);
780
+ }
781
+ }
782
+ a !== -1 && d.value[a].focus();
783
+ }
784
+ [L.left, L.right].includes(g) && (c.preventDefault(), i.click());
785
+ const s = i.querySelector('[type="checkbox"]');
786
+ [L.enter, L.space].includes(g) && s && (c.preventDefault(), s.click());
787
+ });
788
+ const l = () => {
789
+ var c;
790
+ d.value = Array.from(e.value.querySelectorAll(`.${o.is("focusable")}[role=treeitem]`)), n.value = Array.from(e.value.querySelectorAll("input[type=checkbox]"));
791
+ const i = e.value.querySelectorAll(`.${o.is("checked")}[role=treeitem]`);
792
+ if (i.length) {
793
+ i[0].setAttribute("tabindex", "0");
794
+ return;
795
+ }
796
+ (c = d.value[0]) == null || c.setAttribute("tabindex", "0");
797
+ };
798
+ }
799
+ const gt = R({
800
+ name: "ElTree",
801
+ components: { ElTreeNode: yt },
802
+ props: {
803
+ data: {
804
+ type: Array,
805
+ default: () => []
806
+ },
807
+ emptyText: {
808
+ type: String
809
+ },
810
+ renderAfterExpand: {
811
+ type: Boolean,
812
+ default: !0
813
+ },
814
+ nodeKey: String,
815
+ checkStrictly: Boolean,
816
+ defaultExpandAll: Boolean,
817
+ expandOnClickNode: {
818
+ type: Boolean,
819
+ default: !0
820
+ },
821
+ checkOnClickNode: Boolean,
822
+ checkDescendants: {
823
+ type: Boolean,
824
+ default: !1
825
+ },
826
+ autoExpandParent: {
827
+ type: Boolean,
828
+ default: !0
829
+ },
830
+ defaultCheckedKeys: Array,
831
+ defaultExpandedKeys: Array,
832
+ currentNodeKey: [String, Number],
833
+ renderContent: Function,
834
+ showCheckbox: {
835
+ type: Boolean,
836
+ default: !1
837
+ },
838
+ draggable: {
839
+ type: Boolean,
840
+ default: !1
841
+ },
842
+ allowDrag: Function,
843
+ allowDrop: Function,
844
+ props: {
845
+ type: Object,
846
+ default: () => ({
847
+ children: "children",
848
+ label: "label",
849
+ disabled: "disabled"
850
+ })
851
+ },
852
+ lazy: {
853
+ type: Boolean,
854
+ default: !1
855
+ },
856
+ highlightCurrent: Boolean,
857
+ load: Function,
858
+ filterNodeMethod: Function,
859
+ accordion: Boolean,
860
+ indent: {
861
+ type: Number,
862
+ default: 18
863
+ },
864
+ icon: {
865
+ type: _e
866
+ }
867
+ },
868
+ emits: [
869
+ "check-change",
870
+ "current-change",
871
+ "node-click",
872
+ "node-contextmenu",
873
+ "node-collapse",
874
+ "node-expand",
875
+ "check",
876
+ "node-drag-start",
877
+ "node-drag-end",
878
+ "node-drop",
879
+ "node-drag-leave",
880
+ "node-drag-enter",
881
+ "node-drag-over"
882
+ ],
883
+ setup(e, t) {
884
+ const { t: o } = et(), d = U("tree"), n = w(new st({
885
+ key: e.nodeKey,
886
+ data: e.data,
887
+ lazy: e.lazy,
888
+ props: e.props,
889
+ load: e.load,
890
+ currentNodeKey: e.currentNodeKey,
891
+ checkStrictly: e.checkStrictly,
892
+ checkDescendants: e.checkDescendants,
893
+ defaultCheckedKeys: e.defaultCheckedKeys,
894
+ defaultExpandedKeys: e.defaultExpandedKeys,
895
+ autoExpandParent: e.autoExpandParent,
896
+ defaultExpandAll: e.defaultExpandAll,
897
+ filterNodeMethod: e.filterNodeMethod
898
+ }));
899
+ n.value.initialize();
900
+ const r = w(n.value.root), l = w(null), c = w(null), i = w(null), { broadcastExpanded: g } = Le(e), { dragState: u } = lt({
901
+ props: e,
902
+ ctx: t,
903
+ el$: c,
904
+ dropIndicator$: i,
905
+ store: n
906
+ });
907
+ pt({ el$: c }, n);
908
+ const a = B(() => {
909
+ const { childNodes: h } = r.value;
910
+ return !h || h.length === 0 || h.every(({ visible: N }) => !N);
911
+ });
912
+ S(() => e.currentNodeKey, (h) => {
913
+ n.value.setCurrentNodeKey(h);
914
+ }), S(() => e.defaultCheckedKeys, (h) => {
915
+ n.value.setDefaultCheckedKey(h);
916
+ }), S(() => e.defaultExpandedKeys, (h) => {
917
+ n.value.setDefaultExpandedKeys(h);
918
+ }), S(() => e.data, (h) => {
919
+ n.value.setData(h);
920
+ }, { deep: !0 }), S(() => e.checkStrictly, (h) => {
921
+ n.value.checkStrictly = h;
922
+ });
923
+ const s = (h) => {
924
+ if (!e.filterNodeMethod)
925
+ throw new Error("[Tree] filterNodeMethod is required when filter");
926
+ n.value.filter(h);
927
+ }, f = (h) => be(e.nodeKey, h.data), y = (h) => {
928
+ if (!e.nodeKey)
929
+ throw new Error("[Tree] nodeKey is required in getNodePath");
930
+ const N = n.value.getNode(h);
931
+ if (!N)
932
+ return [];
933
+ const q = [N.data];
934
+ let W = N.parent;
935
+ for (; W && W !== r.value; )
936
+ q.push(W.data), W = W.parent;
937
+ return q.reverse();
938
+ }, C = (h, N) => n.value.getCheckedNodes(h, N), k = (h) => n.value.getCheckedKeys(h), m = () => {
939
+ const h = n.value.getCurrentNode();
940
+ return h ? h.data : null;
941
+ }, x = () => {
942
+ if (!e.nodeKey)
943
+ throw new Error("[Tree] nodeKey is required in getCurrentKey");
944
+ const h = m();
945
+ return h ? h[e.nodeKey] : null;
946
+ }, v = (h, N) => {
947
+ if (!e.nodeKey)
948
+ throw new Error("[Tree] nodeKey is required in setCheckedNodes");
949
+ n.value.setCheckedNodes(h, N);
950
+ }, O = (h, N) => {
951
+ if (!e.nodeKey)
952
+ throw new Error("[Tree] nodeKey is required in setCheckedKeys");
953
+ n.value.setCheckedKeys(h, N);
954
+ }, E = (h, N, q) => {
955
+ n.value.setChecked(h, N, q);
956
+ }, D = () => n.value.getHalfCheckedNodes(), Q = () => n.value.getHalfCheckedKeys(), z = (h, N = !0) => {
957
+ if (!e.nodeKey)
958
+ throw new Error("[Tree] nodeKey is required in setCurrentNode");
959
+ ge(n, t.emit, () => n.value.setUserCurrentNode(h, N));
960
+ }, p = (h, N = !0) => {
961
+ if (!e.nodeKey)
962
+ throw new Error("[Tree] nodeKey is required in setCurrentKey");
963
+ ge(n, t.emit, () => n.value.setCurrentNodeKey(h, N));
964
+ }, b = (h) => n.value.getNode(h), K = (h) => {
965
+ n.value.remove(h);
966
+ }, ae = (h, N) => {
967
+ n.value.append(h, N);
968
+ }, Be = (h, N) => {
969
+ n.value.insertBefore(h, N);
970
+ }, $e = (h, N) => {
971
+ n.value.insertAfter(h, N);
972
+ }, ze = (h, N, q) => {
973
+ g(N), t.emit("node-expand", h, N, q);
974
+ }, qe = (h, N) => {
975
+ if (!e.nodeKey)
976
+ throw new Error("[Tree] nodeKey is required in updateKeyChild");
977
+ n.value.updateChildren(h, N);
978
+ };
979
+ return J("RootTree", {
980
+ ctx: t,
981
+ props: e,
982
+ store: n,
983
+ root: r,
984
+ currentNode: l,
985
+ instance: me()
986
+ }), J(tt, void 0), {
987
+ ns: d,
988
+ store: n,
989
+ root: r,
990
+ currentNode: l,
991
+ dragState: u,
992
+ el$: c,
993
+ dropIndicator$: i,
994
+ isEmpty: a,
995
+ filter: s,
996
+ getNodeKey: f,
997
+ getNodePath: y,
998
+ getCheckedNodes: C,
999
+ getCheckedKeys: k,
1000
+ getCurrentNode: m,
1001
+ getCurrentKey: x,
1002
+ setCheckedNodes: v,
1003
+ setCheckedKeys: O,
1004
+ setChecked: E,
1005
+ getHalfCheckedNodes: D,
1006
+ getHalfCheckedKeys: Q,
1007
+ setCurrentNode: z,
1008
+ setCurrentKey: p,
1009
+ t: o,
1010
+ getNode: b,
1011
+ remove: K,
1012
+ append: ae,
1013
+ insertBefore: Be,
1014
+ insertAfter: $e,
1015
+ handleNodeExpand: ze,
1016
+ updateKeyChildren: qe
1017
+ };
1018
+ }
1019
+ });
1020
+ function Nt(e, t, o, d, n, r) {
1021
+ const l = M("el-tree-node");
1022
+ return A(), j("div", {
1023
+ ref: "el$",
1024
+ class: T([
1025
+ e.ns.b(),
1026
+ e.ns.is("dragging", !!e.dragState.draggingNode),
1027
+ e.ns.is("drop-not-allow", !e.dragState.allowDrop),
1028
+ e.ns.is("drop-inner", e.dragState.dropType === "inner"),
1029
+ { [e.ns.m("highlight-current")]: e.highlightCurrent }
1030
+ ]),
1031
+ role: "tree"
1032
+ }, [
1033
+ (A(!0), j(xe, null, Ae(e.root.childNodes, (c) => (A(), P(l, {
1034
+ key: e.getNodeKey(c),
1035
+ node: c,
1036
+ props: e.props,
1037
+ accordion: e.accordion,
1038
+ "render-after-expand": e.renderAfterExpand,
1039
+ "show-checkbox": e.showCheckbox,
1040
+ "render-content": e.renderContent,
1041
+ onNodeExpand: e.handleNodeExpand
1042
+ }, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]))), 128)),
1043
+ e.isEmpty ? (A(), j("div", {
1044
+ key: 0,
1045
+ class: T(e.ns.e("empty-block"))
1046
+ }, [
1047
+ Se(e.$slots, "empty", {}, () => {
1048
+ var c;
1049
+ return [
1050
+ ue("span", {
1051
+ class: T(e.ns.e("empty-text"))
1052
+ }, Ve((c = e.emptyText) != null ? c : e.t("el.tree.emptyText")), 3)
1053
+ ];
1054
+ })
1055
+ ], 2)) : X("v-if", !0),
1056
+ he(ue("div", {
1057
+ ref: "dropIndicator$",
1058
+ class: T(e.ns.e("drop-indicator"))
1059
+ }, null, 2), [
1060
+ [fe, e.dragState.showDropIndicator]
1061
+ ])
1062
+ ], 2);
1063
+ }
1064
+ var ne = /* @__PURE__ */ se(gt, [["render", Nt], ["__file", "tree.vue"]]);
1065
+ ne.install = (e) => {
1066
+ e.component(ne.name, ne);
1067
+ };
1068
+ const Ce = ne, Ct = (e, { attrs: t, emit: o }, {
1069
+ select: d,
1070
+ tree: n,
1071
+ key: r
1072
+ }) => {
1073
+ const l = U("tree-select");
1074
+ return S(() => e.data, () => {
1075
+ e.filterable && H(() => {
1076
+ var i, g;
1077
+ (g = n.value) == null || g.filter((i = d.value) == null ? void 0 : i.states.inputValue);
1078
+ });
1079
+ }, { flush: "post" }), {
1080
+ ...re(Te(e), Object.keys(ye.props)),
1081
+ ...t,
1082
+ "onUpdate:modelValue": (i) => o(ee, i),
1083
+ valueKey: r,
1084
+ popperClass: B(() => {
1085
+ const i = [l.e("popper")];
1086
+ return e.popperClass && i.push(e.popperClass), i.join(" ");
1087
+ }),
1088
+ filterMethod: (i = "") => {
1089
+ var g;
1090
+ e.filterMethod ? e.filterMethod(i) : e.remoteMethod ? e.remoteMethod(i) : (g = n.value) == null || g.filter(i);
1091
+ }
1092
+ };
1093
+ }, kt = R({
1094
+ extends: De,
1095
+ setup(e, t) {
1096
+ const o = De.setup(e, t);
1097
+ delete o.selectOptionClick;
1098
+ const d = me().proxy;
1099
+ return H(() => {
1100
+ o.select.states.cachedOptions.get(d.value) || o.select.onOptionCreate(d);
1101
+ }), o;
1102
+ },
1103
+ methods: {
1104
+ selectOptionClick() {
1105
+ this.$el.parentElement.click();
1106
+ }
1107
+ }
1108
+ });
1109
+ function ke(e) {
1110
+ return e || e === 0;
1111
+ }
1112
+ function Ke(e) {
1113
+ return Array.isArray(e) && e.length;
1114
+ }
1115
+ function Y(e) {
1116
+ return Array.isArray(e) ? e : ke(e) ? [e] : [];
1117
+ }
1118
+ function oe(e, t, o, d, n) {
1119
+ for (let r = 0; r < e.length; r++) {
1120
+ const l = e[r];
1121
+ if (t(l, r, e, n))
1122
+ return d ? d(l, r, e, n) : l;
1123
+ {
1124
+ const c = o(l);
1125
+ if (Ke(c)) {
1126
+ const i = oe(c, t, o, d, l);
1127
+ if (i)
1128
+ return i;
1129
+ }
1130
+ }
1131
+ }
1132
+ }
1133
+ function ve(e, t, o, d) {
1134
+ for (let n = 0; n < e.length; n++) {
1135
+ const r = e[n];
1136
+ t(r, n, e, d);
1137
+ const l = o(r);
1138
+ Ke(l) && ve(l, t, o, r);
1139
+ }
1140
+ }
1141
+ const vt = (e, { attrs: t, slots: o, emit: d }, {
1142
+ select: n,
1143
+ tree: r,
1144
+ key: l
1145
+ }) => {
1146
+ S(() => e.modelValue, () => {
1147
+ e.showCheckbox && H(() => {
1148
+ const a = r.value;
1149
+ a && !dt(a.getCheckedKeys(), Y(e.modelValue)) && a.setCheckedKeys(Y(e.modelValue));
1150
+ });
1151
+ }, {
1152
+ immediate: !0,
1153
+ deep: !0
1154
+ });
1155
+ const c = B(() => ({
1156
+ value: l.value,
1157
+ label: "label",
1158
+ children: "children",
1159
+ disabled: "disabled",
1160
+ isLeaf: "isLeaf",
1161
+ ...e.props
1162
+ })), i = (a, s) => {
1163
+ var f;
1164
+ const y = c.value[a];
1165
+ return Ie(y) ? y(s, (f = r.value) == null ? void 0 : f.getNode(i("value", s))) : s[y];
1166
+ }, g = Y(e.modelValue).map((a) => oe(e.data || [], (s) => i("value", s) === a, (s) => i("children", s), (s, f, y, C) => C && i("value", C))).filter((a) => ke(a)), u = B(() => {
1167
+ if (!e.renderAfterExpand && !e.lazy)
1168
+ return [];
1169
+ const a = [];
1170
+ return ve(e.data.concat(e.cacheData), (s) => {
1171
+ const f = i("value", s);
1172
+ a.push({
1173
+ value: f,
1174
+ currentLabel: i("label", s),
1175
+ isDisabled: i("disabled", s)
1176
+ });
1177
+ }, (s) => i("children", s)), a;
1178
+ });
1179
+ return {
1180
+ ...re(Te(e), Object.keys(Ce.props)),
1181
+ ...t,
1182
+ nodeKey: l,
1183
+ expandOnClickNode: B(() => !e.checkStrictly && e.expandOnClickNode),
1184
+ defaultExpandedKeys: B(() => e.defaultExpandedKeys ? e.defaultExpandedKeys.concat(g) : g),
1185
+ renderContent: (a, { node: s, data: f, store: y }) => a(kt, {
1186
+ value: i("value", f),
1187
+ label: i("label", f),
1188
+ disabled: i("disabled", f)
1189
+ }, e.renderContent ? () => e.renderContent(a, { node: s, data: f, store: y }) : o.default ? () => o.default({ node: s, data: f, store: y }) : void 0),
1190
+ filterNodeMethod: (a, s, f) => e.filterNodeMethod ? e.filterNodeMethod(a, s, f) : a ? new RegExp(He(a), "i").test(i("label", s) || "") : !0,
1191
+ onNodeClick: (a, s, f) => {
1192
+ var y, C, k, m;
1193
+ if ((y = t.onNodeClick) == null || y.call(t, a, s, f), !(e.showCheckbox && e.checkOnClickNode)) {
1194
+ if (!e.showCheckbox && (e.checkStrictly || s.isLeaf)) {
1195
+ if (!i("disabled", a)) {
1196
+ const x = (C = n.value) == null ? void 0 : C.states.options.get(i("value", a));
1197
+ (k = n.value) == null || k.handleOptionSelect(x);
1198
+ }
1199
+ } else
1200
+ e.expandOnClickNode && f.proxy.handleExpandIconClick();
1201
+ (m = n.value) == null || m.focus();
1202
+ }
1203
+ },
1204
+ onCheck: (a, s) => {
1205
+ var f;
1206
+ if (!e.showCheckbox)
1207
+ return;
1208
+ const y = i("value", a), C = {};
1209
+ ve([r.value.store.root], (v) => C[v.key] = v, (v) => v.childNodes);
1210
+ const k = s.checkedKeys, m = e.multiple ? Y(e.modelValue).filter((v) => !(v in C) && !k.includes(v)) : [], x = m.concat(k);
1211
+ if (e.checkStrictly)
1212
+ d(ee, e.multiple ? x : x.includes(y) ? y : void 0);
1213
+ else if (e.multiple)
1214
+ d(ee, m.concat(r.value.getCheckedKeys(!0)));
1215
+ else {
1216
+ const v = oe([a], (D) => !Ke(i("children", D)) && !i("disabled", D), (D) => i("children", D)), O = v ? i("value", v) : void 0, E = ke(e.modelValue) && !!oe([a], (D) => i("value", D) === e.modelValue, (D) => i("children", D));
1217
+ d(ee, O === e.modelValue || E ? void 0 : O);
1218
+ }
1219
+ H(() => {
1220
+ var v;
1221
+ const O = Y(e.modelValue);
1222
+ r.value.setCheckedKeys(O), (v = t.onCheck) == null || v.call(t, a, {
1223
+ checkedKeys: r.value.getCheckedKeys(),
1224
+ checkedNodes: r.value.getCheckedNodes(),
1225
+ halfCheckedKeys: r.value.getHalfCheckedKeys(),
1226
+ halfCheckedNodes: r.value.getHalfCheckedNodes()
1227
+ });
1228
+ }), (f = n.value) == null || f.focus();
1229
+ },
1230
+ cacheOptions: u
1231
+ };
1232
+ };
1233
+ var mt = R({
1234
+ props: {
1235
+ data: {
1236
+ type: Array,
1237
+ default: () => []
1238
+ }
1239
+ },
1240
+ setup(e) {
1241
+ const t = V(Re);
1242
+ return S(() => e.data, () => {
1243
+ var o;
1244
+ e.data.forEach((n) => {
1245
+ t.states.cachedOptions.has(n.value) || t.states.cachedOptions.set(n.value, n);
1246
+ });
1247
+ const d = ((o = t.selectRef) == null ? void 0 : o.querySelectorAll("input")) || [];
1248
+ Array.from(d).includes(document.activeElement) || t.setSelected();
1249
+ }, { flush: "post", immediate: !0 }), () => {
1250
+ };
1251
+ }
1252
+ });
1253
+ const bt = R({
1254
+ name: "ElTreeSelect",
1255
+ inheritAttrs: !1,
1256
+ props: {
1257
+ ...ye.props,
1258
+ ...Ce.props,
1259
+ cacheData: {
1260
+ type: Array,
1261
+ default: () => []
1262
+ }
1263
+ },
1264
+ setup(e, t) {
1265
+ const { slots: o, expose: d } = t, n = w(), r = w(), l = B(() => e.nodeKey || e.valueKey || "value"), c = Ct(e, t, { select: n, tree: r, key: l }), { cacheOptions: i, ...g } = vt(e, t, {
1266
+ select: n,
1267
+ tree: r,
1268
+ key: l
1269
+ }), u = _({});
1270
+ return d(u), Oe(() => {
1271
+ Object.assign(u, {
1272
+ ...re(r.value, [
1273
+ "filter",
1274
+ "updateKeyChildren",
1275
+ "getCheckedNodes",
1276
+ "setCheckedNodes",
1277
+ "getCheckedKeys",
1278
+ "setCheckedKeys",
1279
+ "setChecked",
1280
+ "getHalfCheckedNodes",
1281
+ "getHalfCheckedKeys",
1282
+ "getCurrentKey",
1283
+ "getCurrentNode",
1284
+ "setCurrentKey",
1285
+ "setCurrentNode",
1286
+ "getNode",
1287
+ "remove",
1288
+ "append",
1289
+ "insertBefore",
1290
+ "insertAfter"
1291
+ ]),
1292
+ ...re(n.value, ["focus", "blur"])
1293
+ });
1294
+ }), () => G(ye, _({
1295
+ ...c,
1296
+ ref: (a) => n.value = a
1297
+ }), {
1298
+ ...o,
1299
+ default: () => [
1300
+ G(mt, { data: i.value }),
1301
+ G(Ce, _({
1302
+ ...g,
1303
+ ref: (a) => r.value = a
1304
+ }))
1305
+ ]
1306
+ });
1307
+ }
1308
+ });
1309
+ var de = /* @__PURE__ */ se(bt, [["__file", "tree-select.vue"]]);
1310
+ de.install = (e) => {
1311
+ e.component(de.name, de);
1312
+ };
1313
+ const Kt = de, Ot = Kt;
1314
+ export {
1315
+ Ot as E
1316
+ };