bp-aicc-editor 1.2.521 → 1.2.522
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{ScreenPreview-CV95NWOd.js → ScreenPreview-yUHo60be.js} +51 -105
- package/lib/atlas-BMjKIOwk.js +3891 -0
- package/lib/{button-base-DHNVBrQ9.js → button-base-CXl1z-_m.js} +1 -1
- package/lib/{cache-lsjsKZHu.js → cache-DbHSDjJy.js} +1 -1
- package/lib/config-provider-Bui8m4GV.js +62 -0
- package/lib/{container-group-DqAcKEBy.js → container-group-D6Extorz.js} +1 -1
- package/lib/{copy-C5Pi6nJh.js → copy-CsCmPy4J.js} +1 -1
- package/lib/{datav-BER95ty-.js → datav-BTD-HJhV.js} +27 -27
- package/lib/{delete-C2EW4JCs.js → delete-COj0ilHh.js} +1 -1
- package/lib/{divider-BazBGRgV.js → divider-B3K_URZc.js} +1 -1
- package/lib/dropdown-CWvnuJsO.js +105 -0
- package/lib/{edit-B2pfd2q1.js → edit-vdJaEine.js} +1 -1
- package/lib/{el-form-item-BDdxk5F5.js → el-form-item-BbaNohQv.js} +51 -51
- package/lib/{el-link-D2ol9BHQ.js → el-link-Dq721Q7-.js} +12 -12
- package/lib/{el-loading-Cgwgez55.js → el-loading-DOxnN3bm.js} +17 -17
- package/lib/{fullscreen-OChDsSnk.js → fullscreen-DXSogbcG.js} +1 -1
- package/lib/{image-C5ZAY3yt.js → image-Cu7JTK9-.js} +1 -1
- package/lib/{index-Ci8AbyIq.js → index-68soBnbK.js} +8 -8
- package/lib/{index-BatyRVpL.js → index-B-d8WIg1.js} +7 -7
- package/lib/{index-BfIEunKC.js → index-B4zV3cxV.js} +18 -17
- package/lib/{index-CZJriuFt.js → index-B8QqTLfg.js} +4974 -4898
- package/lib/index-BBMItxtW.js +619 -0
- package/lib/{index-CGrR_i0u.js → index-BMm0MRz5.js} +14 -15
- package/lib/index-BMn8EzMD.js +1027 -0
- package/lib/index-BNTW8F-9.js +322 -0
- package/lib/index-BTI518b1.js +69 -0
- package/lib/{index-BWPVi43E.js → index-BZxUAT4z.js} +4 -4
- package/lib/{index-Ck7uFsPE.js → index-BdYTc41r.js} +24 -24
- package/lib/index-BfI55Ioc.js +404 -0
- package/lib/{index-BhP9eBCp.js → index-BmAcetSf.js} +19 -20
- package/lib/index-C35Yp3i8.js +545 -0
- package/lib/{index-B19lEYui.js → index-C6GUNRx9.js} +2 -2
- package/lib/index-CC28_8Jl.js +567 -0
- package/lib/index-CDhmvVt8.js +338 -0
- package/lib/index-CDx0y0fp.js +144 -0
- package/lib/{el-button-DvLKp6Ga.js → index-CJjljoJG.js} +106 -106
- package/lib/index-CNCgXPiO.js +235 -0
- package/lib/{index-CWbZmzNT.js → index-CPa_MnOD.js} +30 -29
- package/lib/index-CW6ljdNf.js +1582 -0
- package/lib/index-C_WopEui.js +513 -0
- package/lib/{index-CX_Ghcb6.js → index-CejowjGd.js} +56 -53
- package/lib/{index-BwCQWH-N.js → index-CfZXOvi-.js} +42 -40
- package/lib/{index-CVsy2qTh.js → index-CgzRTmPh.js} +16 -15
- package/lib/index-CmzuNM9v.js +32 -0
- package/lib/index-CrxcAFt8.js +5343 -0
- package/lib/{index-C7k49L2T.js → index-CuHA7QXu.js} +10 -10
- package/lib/{index-qVyixI57.js → index-CyBGAB7D.js} +21 -20
- package/lib/index-D6J7coU0.js +129 -0
- package/lib/index-DDHxrdAo.js +1773 -0
- package/lib/index-DDL-yqq0.js +1401 -0
- package/lib/{index-BPcvYtHf.js → index-DOxy-bey.js} +6 -6
- package/lib/{index-CVE37oE7.js → index-DOyr0BHr.js} +7 -7
- package/lib/index-DPOanmXI.js +887 -0
- package/lib/{index-3pzVrvby.js → index-DR_husZg.js} +46 -46
- package/lib/{el-tab-pane-DD2eM9rB.js → index-DUzOCQrW.js} +125 -124
- package/lib/{index-CGFEhUh9.js → index-DVYI-g8Q.js} +53 -52
- package/lib/index-DVyjilLy.js +51 -0
- package/lib/{index-CJyYGViv.js → index-DWAJ9GyC.js} +9 -9
- package/lib/index-Dj2qCwPD.js +178 -0
- package/lib/{index-D4X0_jbv.js → index-Dx2Gld1J.js} +32 -32
- package/lib/{index-C2XeCqtq.js → index-E9T-y2Yz.js} +3 -3
- package/lib/{index-Buoc0ISP.js → index-FlmXAW0Z.js} +60 -58
- package/lib/index-NqqOvc6V.js +169 -0
- package/lib/{index-BkdiXCRY.js → index-ObKRNOmJ.js} +6 -7
- package/lib/index-bOWjoplU.js +448 -0
- package/lib/{index-CXQ258ID.js → index-buU8mDzi.js} +15 -16
- package/lib/{index-tbhuYbb0.js → index-mGKAWDJZ.js} +11 -12
- package/lib/index.es.js +4 -4
- package/lib/index.umd.js +46 -40
- package/lib/{layer-setting-panel-VvDSQ-cn.js → layer-setting-panel-BGPj32nP.js} +2 -2
- package/lib/{line-show-Bp4G-LqO.js → line-show-DUn1bu_P.js} +1 -1
- package/lib/{multi-layout-config-drSy7ezf.js → multi-layout-config-BTWxJeuc.js} +7 -8
- package/lib/{multiline-text-D89kYrA2.js → multiline-text-CPJdCWJ7.js} +1 -1
- package/lib/{navigation-YAGxZ0OT.js → navigation-ZLJaBOUj.js} +1 -1
- package/lib/page-config-CHP07Ndf.js +253 -0
- package/lib/{page-tabs-wFeNBY4c.js → page-tabs-CKLhgrip.js} +45 -41
- package/lib/{plus-3mdO6yXY.js → plus-xgpQU22I.js} +1 -1
- package/lib/raf-CJog_tcv.js +6 -0
- package/lib/refs-DZMysoBI.js +8 -0
- package/lib/{requestOld-DRcjsmRQ.js → requestOld-CaGzCXrV.js} +97 -96
- package/lib/{schema-BsnIOGBI.js → schema-BaFWGeFt.js} +1 -1
- package/lib/{schema-_APJMUW3.js → schema-CUR-UK2S.js} +44 -41
- package/lib/{schema-BavJE-SK.js → schema-WUk7XVq7.js} +58 -54
- package/lib/{schema-qKI1F8Bt.js → schema-geZfujv8.js} +1 -1
- package/lib/{schema-BflqDw-a.js → schema-iosjRxCC.js} +1 -1
- package/lib/{schema-Bo30dbBx.js → schema-tuPllxn6.js} +1 -1
- package/lib/scroll-CWfl60Tu.js +58 -0
- package/lib/{setting-panel-BgzN3BUP.js → setting-panel-0qLcwYyT.js} +154 -151
- package/lib/{show-C4AeWlKj.js → show-BCwE3hGY.js} +1 -1
- package/lib/{stepper-D5EFeJWG.js → stepper-Bud1Jppr.js} +1 -1
- package/lib/strings-BvUQWzDM.js +6 -0
- package/lib/{switch-B0dR4LM_.js → switch-VlaUmSpJ.js} +1 -1
- package/lib/{unlock-Cq9PLhBA.js → unlock-B2FVPQlm.js} +1 -1
- package/lib/{use-env-url-BM9dgwx_.js → use-env-url-D1p8ib2L.js} +1 -1
- package/lib/use-global-config-D_yoqf3Q.js +90 -0
- package/lib/validator-BOXH2OMA.js +5 -0
- package/lib/{vnode-B_Dj8zxu.js → vnode-Bxs1g06p.js} +1 -1
- package/package.json +1 -1
- package/lib/atlas-DsmLq2V0.js +0 -38
- package/lib/el-overlay-BK0_UIU6.js +0 -704
- package/lib/index-B1yAU2Cb.js +0 -390
- package/lib/index-BCFXuK7k.js +0 -68
- package/lib/index-BD4Jwo8Z.js +0 -449
- package/lib/index-BMWqf88L.js +0 -356
- package/lib/index-Belsn8kt.js +0 -107
- package/lib/index-CIADz1i0.js +0 -8494
- package/lib/index-DKTrbqcA.js +0 -56
- package/lib/index-Ge_d2xqD.js +0 -127
- package/lib/page-config-Cmsi8Vpr.js +0 -582
- package/lib/strings-_mHAdgA4.js +0 -6
- package/lib/use-global-config-CflpFoxU.js +0 -115
|
@@ -0,0 +1,1773 @@
|
|
|
1
|
+
import { e as He, Z as ot, g as ye, at as dt, h as ne, aU as W, w as Re, bi as Ne, ak as Ce, R as ue, aA as be, az as ve, V as Ve, aB as st, j as at, aV as Le, aH as ke, aJ as lt, aS as it, E as qe, a5 as rt, bj as ct, B as ut, M as ht, N as G, Y as ft, f as he, t as pt, $ as vt, bk as yt, _ as Se, a as Ge, bd as gt, bb as V, u as mt, d as kt } from "./index-B8QqTLfg.js";
|
|
2
|
+
import { E as Nt, a as Ct } from "./el-form-item-BbaNohQv.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { defineComponent as oe, ref as $, computed as J, onMounted as Ye, onUpdated as We, createBlock as M, openBlock as k, resolveDynamicComponent as Je, normalizeStyle as ee, normalizeClass as F, withCtx as I, renderSlot as Ie, useAttrs as bt, reactive as Et, nextTick as Ee, inject as le, h as Ae, onBeforeUnmount as xt, provide as ie, resolveComponent as Y, withDirectives as re, createElementBlock as L, withModifiers as z, createElementVNode as A, createVNode as S, createCommentVNode as H, Fragment as ae, renderList as Xe, vShow as xe, getCurrentInstance as Ze, watch as U, toDisplayString as De, resolveDirective as Dt, unref as q, withKeys as Be, vModelText as Oe, createTextVNode as fe } from "vue";
|
|
6
|
+
import { u as wt } from "./toolbar-Dhf_BVAU.js";
|
|
7
|
+
import { u as Qe } from "./index-CPa_MnOD.js";
|
|
8
|
+
import { I as Kt } from "./delete-COj0ilHh.js";
|
|
9
|
+
import { I as St, b as Me, a as Pe } from "./unlock-B2FVPQlm.js";
|
|
10
|
+
import { a as ze, I as Fe } from "./show-BCwE3hGY.js";
|
|
11
|
+
import { E as It } from "./index-DVyjilLy.js";
|
|
12
|
+
import { E as $t } from "./index-C35Yp3i8.js";
|
|
13
|
+
import { E as Tt } from "./index-C_WopEui.js";
|
|
14
|
+
import { E as Lt } from "./index-CJjljoJG.js";
|
|
15
|
+
import { E as At } from "./index-bOWjoplU.js";
|
|
16
|
+
const Bt = He({
|
|
17
|
+
type: {
|
|
18
|
+
type: String,
|
|
19
|
+
values: ["primary", "success", "info", "warning", "danger", ""],
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
type: String,
|
|
24
|
+
values: ot,
|
|
25
|
+
default: ""
|
|
26
|
+
},
|
|
27
|
+
truncated: Boolean,
|
|
28
|
+
lineClamp: {
|
|
29
|
+
type: [String, Number]
|
|
30
|
+
},
|
|
31
|
+
tag: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "span"
|
|
34
|
+
}
|
|
35
|
+
}), Ot = oe({
|
|
36
|
+
name: "ElText",
|
|
37
|
+
__name: "text",
|
|
38
|
+
props: Bt,
|
|
39
|
+
setup(e) {
|
|
40
|
+
const t = e, n = $(), d = dt(), o = ne("text"), s = J(() => [
|
|
41
|
+
o.b(),
|
|
42
|
+
o.m(t.type),
|
|
43
|
+
o.m(d.value),
|
|
44
|
+
o.is("truncated", t.truncated),
|
|
45
|
+
o.is("line-clamp", !W(t.lineClamp))
|
|
46
|
+
]), a = () => {
|
|
47
|
+
var i, f, h, r, c, u, v;
|
|
48
|
+
if (bt().title)
|
|
49
|
+
return;
|
|
50
|
+
let N = !1;
|
|
51
|
+
const C = ((i = n.value) == null ? void 0 : i.textContent) || "";
|
|
52
|
+
if (t.truncated) {
|
|
53
|
+
const K = (f = n.value) == null ? void 0 : f.offsetWidth, w = (h = n.value) == null ? void 0 : h.scrollWidth;
|
|
54
|
+
K && w && w > K && (N = !0);
|
|
55
|
+
} else if (!W(t.lineClamp)) {
|
|
56
|
+
const K = (r = n.value) == null ? void 0 : r.offsetHeight, w = (c = n.value) == null ? void 0 : c.scrollHeight;
|
|
57
|
+
K && w && w > K && (N = !0);
|
|
58
|
+
}
|
|
59
|
+
N ? (u = n.value) == null || u.setAttribute("title", C) : (v = n.value) == null || v.removeAttribute("title");
|
|
60
|
+
};
|
|
61
|
+
return Ye(a), We(a), (i, f) => (k(), M(Je(i.tag), {
|
|
62
|
+
ref_key: "textRef",
|
|
63
|
+
ref: n,
|
|
64
|
+
class: F(s.value),
|
|
65
|
+
style: ee({ "-webkit-line-clamp": i.lineClamp })
|
|
66
|
+
}, {
|
|
67
|
+
default: I(() => [
|
|
68
|
+
Ie(i.$slots, "default")
|
|
69
|
+
]),
|
|
70
|
+
_: 3
|
|
71
|
+
}, 8, ["class", "style"]));
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
var Mt = /* @__PURE__ */ ye(Ot, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/text/src/text.vue"]]);
|
|
75
|
+
const Pt = Re(Mt), te = "$treeNodeId", je = function(e, t) {
|
|
76
|
+
!t || t[te] || Object.defineProperty(t, te, {
|
|
77
|
+
value: e.id,
|
|
78
|
+
enumerable: !1,
|
|
79
|
+
configurable: !1,
|
|
80
|
+
writable: !1
|
|
81
|
+
});
|
|
82
|
+
}, $e = (e, t) => t?.[e || te], we = (e, t, n) => {
|
|
83
|
+
const d = e.value.currentNode;
|
|
84
|
+
n();
|
|
85
|
+
const o = e.value.currentNode;
|
|
86
|
+
d !== o && t("current-change", o ? o.data : null, o);
|
|
87
|
+
}, _e = (e) => {
|
|
88
|
+
let t = !0, n = !0, d = !0, o = !0;
|
|
89
|
+
for (let s = 0, a = e.length; s < a; s++) {
|
|
90
|
+
const i = e[s];
|
|
91
|
+
(i.checked !== !0 || i.indeterminate) && (t = !1, i.disabled || (d = !1)), (i.checked !== !1 || i.indeterminate) && (n = !1), i.isEffectivelyChecked || (o = !1);
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
all: t,
|
|
95
|
+
none: n,
|
|
96
|
+
allWithoutDisable: d,
|
|
97
|
+
half: !t && !n,
|
|
98
|
+
isEffectivelyChecked: o
|
|
99
|
+
};
|
|
100
|
+
}, se = function(e) {
|
|
101
|
+
if (e.childNodes.length === 0 || e.loading) {
|
|
102
|
+
e.isEffectivelyChecked = e.disabled || e.checked;
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const { all: t, none: n, half: d, isEffectivelyChecked: o } = _e(
|
|
106
|
+
e.childNodes
|
|
107
|
+
);
|
|
108
|
+
e.isEffectivelyChecked = o, t ? (e.checked = !0, e.indeterminate = !1) : d ? (e.checked = !1, e.indeterminate = !0) : n && (e.checked = !1, e.indeterminate = !1);
|
|
109
|
+
const s = e.parent;
|
|
110
|
+
!s || s.level === 0 || e.store.checkStrictly || se(s);
|
|
111
|
+
}, pe = function(e, t) {
|
|
112
|
+
const n = e.store.props, d = e.data || {}, o = n[t];
|
|
113
|
+
if (ve(o))
|
|
114
|
+
return o(d, e);
|
|
115
|
+
if (Ve(o))
|
|
116
|
+
return d[o];
|
|
117
|
+
if (W(o)) {
|
|
118
|
+
const s = d[t];
|
|
119
|
+
return W(s) ? "" : s;
|
|
120
|
+
}
|
|
121
|
+
}, Ke = function(e, t) {
|
|
122
|
+
e.forEach((n) => {
|
|
123
|
+
n.canFocus = t, Ke(n.childNodes, t);
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
let zt = 0;
|
|
127
|
+
class X {
|
|
128
|
+
constructor(t) {
|
|
129
|
+
this.isLeafByUser = void 0, this.isLeaf = void 0, this.isEffectivelyChecked = !1, this.id = zt++, 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;
|
|
130
|
+
for (const n in t)
|
|
131
|
+
Ne(t, n) && (this[n] = t[n]);
|
|
132
|
+
this.level = 0, this.loaded = !1, this.childNodes = [], this.loading = !1, this.parent && (this.level = this.parent.level + 1);
|
|
133
|
+
}
|
|
134
|
+
initialize() {
|
|
135
|
+
var t;
|
|
136
|
+
const n = this.store;
|
|
137
|
+
if (!n)
|
|
138
|
+
throw new Error("[Node]store is required!");
|
|
139
|
+
n.registerNode(this);
|
|
140
|
+
const d = n.props;
|
|
141
|
+
if (d && typeof d.isLeaf < "u") {
|
|
142
|
+
const a = pe(this, "isLeaf");
|
|
143
|
+
Ce(a) && (this.isLeafByUser = a);
|
|
144
|
+
}
|
|
145
|
+
if (n.lazy !== !0 && this.data ? (this.setData(this.data), n.defaultExpandAll && (this.expanded = !0, this.canFocus = !0)) : this.level > 0 && n.lazy && n.defaultExpandAll && !this.isLeafByUser && this.expand(), ue(this.data) || je(this, this.data), !this.data)
|
|
146
|
+
return;
|
|
147
|
+
const o = n.defaultExpandedKeys, s = n.key;
|
|
148
|
+
s && !be(this.key) && o && o.includes(this.key) && this.expand(null, n.autoExpandParent), s && n.currentNodeKey !== void 0 && this.key === n.currentNodeKey && (n.currentNode && (n.currentNode.isCurrent = !1), n.currentNode = this, n.currentNode.isCurrent = !0), n.lazy && n._initDefaultCheckedNode(this), this.updateLeafState(), (this.level === 1 || ((t = this.parent) == null ? void 0 : t.expanded) === !0) && (this.canFocus = !0);
|
|
149
|
+
}
|
|
150
|
+
setData(t) {
|
|
151
|
+
ue(t) || je(this, t), this.data = t, this.childNodes = [];
|
|
152
|
+
let n;
|
|
153
|
+
this.level === 0 && ue(this.data) ? n = this.data : n = pe(this, "children") || [];
|
|
154
|
+
for (let d = 0, o = n.length; d < o; d++)
|
|
155
|
+
this.insertChild({ data: n[d] });
|
|
156
|
+
}
|
|
157
|
+
get label() {
|
|
158
|
+
return pe(this, "label");
|
|
159
|
+
}
|
|
160
|
+
get key() {
|
|
161
|
+
const t = this.store.key;
|
|
162
|
+
return this.data ? this.data[t] : null;
|
|
163
|
+
}
|
|
164
|
+
get disabled() {
|
|
165
|
+
return pe(this, "disabled");
|
|
166
|
+
}
|
|
167
|
+
get nextSibling() {
|
|
168
|
+
const t = this.parent;
|
|
169
|
+
if (t) {
|
|
170
|
+
const n = t.childNodes.indexOf(this);
|
|
171
|
+
if (n > -1)
|
|
172
|
+
return t.childNodes[n + 1];
|
|
173
|
+
}
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
get previousSibling() {
|
|
177
|
+
const t = this.parent;
|
|
178
|
+
if (t) {
|
|
179
|
+
const n = t.childNodes.indexOf(this);
|
|
180
|
+
if (n > -1)
|
|
181
|
+
return n > 0 ? t.childNodes[n - 1] : null;
|
|
182
|
+
}
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
contains(t, n = !0) {
|
|
186
|
+
return (this.childNodes || []).some(
|
|
187
|
+
(d) => d === t || n && d.contains(t)
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
remove() {
|
|
191
|
+
const t = this.parent;
|
|
192
|
+
t && t.removeChild(this);
|
|
193
|
+
}
|
|
194
|
+
insertChild(t, n, d) {
|
|
195
|
+
if (!t)
|
|
196
|
+
throw new Error("InsertChild error: child is required.");
|
|
197
|
+
if (!(t instanceof X)) {
|
|
198
|
+
if (!d) {
|
|
199
|
+
const o = this.getChildren(!0);
|
|
200
|
+
o?.includes(t.data) || (W(n) || n < 0 ? o?.push(t.data) : o?.splice(n, 0, t.data));
|
|
201
|
+
}
|
|
202
|
+
Object.assign(t, {
|
|
203
|
+
parent: this,
|
|
204
|
+
store: this.store
|
|
205
|
+
}), t = Et(new X(t)), t instanceof X && t.initialize();
|
|
206
|
+
}
|
|
207
|
+
t.level = this.level + 1, W(n) || n < 0 ? this.childNodes.push(t) : this.childNodes.splice(n, 0, t), this.updateLeafState();
|
|
208
|
+
}
|
|
209
|
+
insertBefore(t, n) {
|
|
210
|
+
let d;
|
|
211
|
+
n && (d = this.childNodes.indexOf(n)), this.insertChild(t, d);
|
|
212
|
+
}
|
|
213
|
+
insertAfter(t, n) {
|
|
214
|
+
let d;
|
|
215
|
+
n && (d = this.childNodes.indexOf(n), d !== -1 && (d += 1)), this.insertChild(t, d);
|
|
216
|
+
}
|
|
217
|
+
removeChild(t) {
|
|
218
|
+
const n = this.getChildren() || [], d = n.indexOf(t.data);
|
|
219
|
+
d > -1 && n.splice(d, 1);
|
|
220
|
+
const o = this.childNodes.indexOf(t);
|
|
221
|
+
o > -1 && (this.store && this.store.deregisterNode(t), t.parent = null, this.childNodes.splice(o, 1)), this.updateLeafState();
|
|
222
|
+
}
|
|
223
|
+
removeChildByData(t) {
|
|
224
|
+
const n = this.childNodes.find((d) => d.data === t);
|
|
225
|
+
n && this.removeChild(n);
|
|
226
|
+
}
|
|
227
|
+
expand(t, n) {
|
|
228
|
+
const d = () => {
|
|
229
|
+
if (n) {
|
|
230
|
+
let o = this.parent;
|
|
231
|
+
for (; o && o.level > 0; )
|
|
232
|
+
o.expanded = !0, o = o.parent;
|
|
233
|
+
}
|
|
234
|
+
this.expanded = !0, t && t(), Ke(this.childNodes, !0);
|
|
235
|
+
};
|
|
236
|
+
this.shouldLoadData() ? this.loadData((o) => {
|
|
237
|
+
ue(o) && (this.checked ? this.setChecked(!0, !0) : this.store.checkStrictly || se(this), d());
|
|
238
|
+
}) : d();
|
|
239
|
+
}
|
|
240
|
+
doCreateChildren(t, n = {}) {
|
|
241
|
+
t.forEach((d) => {
|
|
242
|
+
this.insertChild(
|
|
243
|
+
Object.assign({ data: d }, n),
|
|
244
|
+
void 0,
|
|
245
|
+
!0
|
|
246
|
+
);
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
collapse() {
|
|
250
|
+
this.expanded = !1, Ke(this.childNodes, !1);
|
|
251
|
+
}
|
|
252
|
+
shouldLoadData() {
|
|
253
|
+
return !!(this.store.lazy === !0 && this.store.load && !this.loaded);
|
|
254
|
+
}
|
|
255
|
+
updateLeafState() {
|
|
256
|
+
if (this.store.lazy === !0 && this.loaded !== !0 && typeof this.isLeafByUser < "u") {
|
|
257
|
+
this.isLeaf = this.isLeafByUser, this.isEffectivelyChecked = this.isLeaf && this.disabled;
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const t = this.childNodes;
|
|
261
|
+
if (!this.store.lazy || this.store.lazy === !0 && this.loaded === !0) {
|
|
262
|
+
this.isLeaf = !t || t.length === 0, this.isEffectivelyChecked = this.isLeaf && this.disabled;
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
this.isLeaf = !1;
|
|
266
|
+
}
|
|
267
|
+
setChecked(t, n, d, o) {
|
|
268
|
+
if (this.indeterminate = t === "half", this.checked = t === !0, this.isEffectivelyChecked = !this.childNodes.length && (this.disabled || this.checked), this.store.checkStrictly)
|
|
269
|
+
return;
|
|
270
|
+
if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
|
|
271
|
+
const a = () => {
|
|
272
|
+
if (n) {
|
|
273
|
+
const i = this.childNodes;
|
|
274
|
+
for (let c = 0, u = i.length; c < u; c++) {
|
|
275
|
+
const v = i[c];
|
|
276
|
+
o = o || t !== !1;
|
|
277
|
+
const g = v.disabled && v.isLeaf ? v.checked : o;
|
|
278
|
+
v.setChecked(g, n, !0, o);
|
|
279
|
+
}
|
|
280
|
+
const { half: f, all: h, isEffectivelyChecked: r } = _e(i);
|
|
281
|
+
h || (this.checked = h, this.indeterminate = f), this.isEffectivelyChecked = this.childNodes.length ? r : this.disabled || this.checked;
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
if (this.shouldLoadData()) {
|
|
285
|
+
this.loadData(
|
|
286
|
+
() => {
|
|
287
|
+
a(), se(this);
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
checked: t !== !1
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
return;
|
|
294
|
+
} else
|
|
295
|
+
a();
|
|
296
|
+
}
|
|
297
|
+
const s = this.parent;
|
|
298
|
+
!s || s.level === 0 || d || se(s);
|
|
299
|
+
}
|
|
300
|
+
getChildren(t = !1) {
|
|
301
|
+
if (this.level === 0)
|
|
302
|
+
return this.data;
|
|
303
|
+
const n = this.data;
|
|
304
|
+
if (!n)
|
|
305
|
+
return null;
|
|
306
|
+
const d = this.store.props;
|
|
307
|
+
let o = "children";
|
|
308
|
+
return d && (o = d.children || "children"), W(n[o]) && (n[o] = null), t && !n[o] && (n[o] = []), n[o];
|
|
309
|
+
}
|
|
310
|
+
updateChildren() {
|
|
311
|
+
const t = this.getChildren() || [], n = this.childNodes.map((s) => s.data), d = {}, o = [];
|
|
312
|
+
t.forEach((s, a) => {
|
|
313
|
+
const i = s[te];
|
|
314
|
+
!!i && n.some((h) => h?.[te] === i) ? d[i] = { index: a, data: s } : o.push({ index: a, data: s });
|
|
315
|
+
}), this.store.lazy || n.forEach((s) => {
|
|
316
|
+
d[s?.[te]] || this.removeChildByData(s);
|
|
317
|
+
}), o.forEach(({ index: s, data: a }) => {
|
|
318
|
+
this.insertChild({ data: a }, s);
|
|
319
|
+
}), this.updateLeafState();
|
|
320
|
+
}
|
|
321
|
+
loadData(t, n = {}) {
|
|
322
|
+
if (this.store.lazy === !0 && this.store.load && !this.loaded && (!this.loading || Object.keys(n).length)) {
|
|
323
|
+
this.loading = !0;
|
|
324
|
+
const d = (s) => {
|
|
325
|
+
this.childNodes = [], this.doCreateChildren(s, n), this.loaded = !0, this.loading = !1, this.updateLeafState(), t && t.call(this, s);
|
|
326
|
+
}, o = () => {
|
|
327
|
+
this.loading = !1;
|
|
328
|
+
};
|
|
329
|
+
this.store.load(this, d, o);
|
|
330
|
+
} else
|
|
331
|
+
t && t.call(this);
|
|
332
|
+
}
|
|
333
|
+
eachNode(t) {
|
|
334
|
+
const n = [this];
|
|
335
|
+
for (; n.length; ) {
|
|
336
|
+
const d = n.shift();
|
|
337
|
+
n.unshift(...d.childNodes), t(d);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
reInitChecked() {
|
|
341
|
+
this.store.checkStrictly || se(this);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
class Ft {
|
|
345
|
+
constructor(t) {
|
|
346
|
+
this.lazy = !1, this.checkStrictly = !1, this.autoExpandParent = !1, this.defaultExpandAll = !1, this.checkDescendants = !1, this.currentNode = null, this.currentNodeKey = null;
|
|
347
|
+
for (const n in t)
|
|
348
|
+
Ne(t, n) && (this[n] = t[n]);
|
|
349
|
+
this.nodesMap = {};
|
|
350
|
+
}
|
|
351
|
+
initialize() {
|
|
352
|
+
if (this.root = new X({
|
|
353
|
+
data: this.data,
|
|
354
|
+
store: this
|
|
355
|
+
}), this.root.initialize(), this.lazy && this.load) {
|
|
356
|
+
const t = this.load;
|
|
357
|
+
t(
|
|
358
|
+
this.root,
|
|
359
|
+
(n) => {
|
|
360
|
+
this.root.doCreateChildren(n), this._initDefaultCheckedNodes();
|
|
361
|
+
},
|
|
362
|
+
st
|
|
363
|
+
);
|
|
364
|
+
} else
|
|
365
|
+
this._initDefaultCheckedNodes();
|
|
366
|
+
}
|
|
367
|
+
filter(t) {
|
|
368
|
+
const n = this.filterNodeMethod, d = this.lazy, o = async function(s) {
|
|
369
|
+
const a = s.root ? s.root.childNodes : s.childNodes;
|
|
370
|
+
for (const [i, f] of a.entries())
|
|
371
|
+
f.visible = !!n?.call(
|
|
372
|
+
f,
|
|
373
|
+
t,
|
|
374
|
+
f.data,
|
|
375
|
+
f
|
|
376
|
+
), i % 80 === 0 && i > 0 && await Ee(), await o(f);
|
|
377
|
+
if (!s.visible && a.length) {
|
|
378
|
+
let i = !0;
|
|
379
|
+
i = !a.some((f) => f.visible), s.root ? s.root.visible = i === !1 : s.visible = i === !1;
|
|
380
|
+
}
|
|
381
|
+
t && s.visible && !s.isLeaf && (!d || s.loaded) && s.expand();
|
|
382
|
+
};
|
|
383
|
+
o(this);
|
|
384
|
+
}
|
|
385
|
+
setData(t) {
|
|
386
|
+
t !== this.root.data ? (this.nodesMap = {}, this.root.setData(t), this._initDefaultCheckedNodes(), this.setCurrentNodeKey(this.currentNodeKey)) : this.root.updateChildren();
|
|
387
|
+
}
|
|
388
|
+
getNode(t) {
|
|
389
|
+
if (t instanceof X)
|
|
390
|
+
return t;
|
|
391
|
+
const n = at(t) ? $e(this.key, t) : t;
|
|
392
|
+
return this.nodesMap[n] || null;
|
|
393
|
+
}
|
|
394
|
+
insertBefore(t, n) {
|
|
395
|
+
var d;
|
|
396
|
+
const o = this.getNode(n);
|
|
397
|
+
(d = o.parent) == null || d.insertBefore({ data: t }, o);
|
|
398
|
+
}
|
|
399
|
+
insertAfter(t, n) {
|
|
400
|
+
var d;
|
|
401
|
+
const o = this.getNode(n);
|
|
402
|
+
(d = o.parent) == null || d.insertAfter({ data: t }, o);
|
|
403
|
+
}
|
|
404
|
+
remove(t) {
|
|
405
|
+
const n = this.getNode(t);
|
|
406
|
+
n && n.parent && (n === this.currentNode && (this.currentNode = null), n.parent.removeChild(n));
|
|
407
|
+
}
|
|
408
|
+
append(t, n) {
|
|
409
|
+
const d = Le(n) ? this.root : this.getNode(n);
|
|
410
|
+
d && d.insertChild({ data: t });
|
|
411
|
+
}
|
|
412
|
+
_initDefaultCheckedNodes() {
|
|
413
|
+
const t = this.defaultCheckedKeys || [], n = this.nodesMap;
|
|
414
|
+
t.forEach((d) => {
|
|
415
|
+
const o = n[d];
|
|
416
|
+
o && o.setChecked(!0, !this.checkStrictly);
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
_initDefaultCheckedNode(t) {
|
|
420
|
+
const n = this.defaultCheckedKeys || [];
|
|
421
|
+
!be(t.key) && n.includes(t.key) && t.setChecked(!0, !this.checkStrictly);
|
|
422
|
+
}
|
|
423
|
+
setDefaultCheckedKey(t) {
|
|
424
|
+
t !== this.defaultCheckedKeys && (this.defaultCheckedKeys = t, this._initDefaultCheckedNodes());
|
|
425
|
+
}
|
|
426
|
+
registerNode(t) {
|
|
427
|
+
const n = this.key;
|
|
428
|
+
if (!(!t || !t.data))
|
|
429
|
+
if (!n)
|
|
430
|
+
this.nodesMap[t.id] = t;
|
|
431
|
+
else {
|
|
432
|
+
const d = t.key;
|
|
433
|
+
be(d) || (this.nodesMap[d] = t);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
deregisterNode(t) {
|
|
437
|
+
!this.key || !t || !t.data || (t.childNodes.forEach((d) => {
|
|
438
|
+
this.deregisterNode(d);
|
|
439
|
+
}), delete this.nodesMap[t.key]);
|
|
440
|
+
}
|
|
441
|
+
getCheckedNodes(t = !1, n = !1) {
|
|
442
|
+
const d = [], o = function(s) {
|
|
443
|
+
(s.root ? s.root.childNodes : s.childNodes).forEach((i) => {
|
|
444
|
+
(i.checked || n && i.indeterminate) && (!t || t && i.isLeaf) && d.push(i.data), o(i);
|
|
445
|
+
});
|
|
446
|
+
};
|
|
447
|
+
return o(this), d;
|
|
448
|
+
}
|
|
449
|
+
getCheckedKeys(t = !1) {
|
|
450
|
+
return this.getCheckedNodes(t).map((n) => (n || {})[this.key]);
|
|
451
|
+
}
|
|
452
|
+
getHalfCheckedNodes() {
|
|
453
|
+
const t = [], n = function(d) {
|
|
454
|
+
(d.root ? d.root.childNodes : d.childNodes).forEach((s) => {
|
|
455
|
+
s.indeterminate && t.push(s.data), n(s);
|
|
456
|
+
});
|
|
457
|
+
};
|
|
458
|
+
return n(this), t;
|
|
459
|
+
}
|
|
460
|
+
getHalfCheckedKeys() {
|
|
461
|
+
return this.getHalfCheckedNodes().map((t) => (t || {})[this.key]);
|
|
462
|
+
}
|
|
463
|
+
_getAllNodes() {
|
|
464
|
+
const t = [], n = this.nodesMap;
|
|
465
|
+
for (const d in n)
|
|
466
|
+
Ne(n, d) && t.push(n[d]);
|
|
467
|
+
return t;
|
|
468
|
+
}
|
|
469
|
+
updateChildren(t, n) {
|
|
470
|
+
const d = this.nodesMap[t];
|
|
471
|
+
if (!d)
|
|
472
|
+
return;
|
|
473
|
+
const o = d.childNodes;
|
|
474
|
+
for (let s = o.length - 1; s >= 0; s--) {
|
|
475
|
+
const a = o[s];
|
|
476
|
+
this.remove(a.data);
|
|
477
|
+
}
|
|
478
|
+
for (let s = 0, a = n.length; s < a; s++) {
|
|
479
|
+
const i = n[s];
|
|
480
|
+
this.append(i, d.data);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
_setCheckedKeys(t, n = !1, d) {
|
|
484
|
+
const o = this._getAllNodes().sort((f, h) => f.level - h.level), s = /* @__PURE__ */ Object.create(null), a = Object.keys(d);
|
|
485
|
+
o.forEach((f) => f.setChecked(!1, !1));
|
|
486
|
+
const i = (f) => {
|
|
487
|
+
f.childNodes.forEach((h) => {
|
|
488
|
+
var r;
|
|
489
|
+
s[h.data[t]] = !0, (r = h.childNodes) != null && r.length && i(h);
|
|
490
|
+
});
|
|
491
|
+
};
|
|
492
|
+
for (let f = 0, h = o.length; f < h; f++) {
|
|
493
|
+
const r = o[f], c = r.data[t].toString();
|
|
494
|
+
if (!a.includes(c)) {
|
|
495
|
+
r.checked && !s[c] && r.setChecked(!1, !1);
|
|
496
|
+
continue;
|
|
497
|
+
}
|
|
498
|
+
if (r.childNodes.length && i(r), r.isLeaf || this.checkStrictly) {
|
|
499
|
+
r.setChecked(!0, !1);
|
|
500
|
+
continue;
|
|
501
|
+
}
|
|
502
|
+
if (r.setChecked(!0, !0), n) {
|
|
503
|
+
r.setChecked(!1, !1);
|
|
504
|
+
const v = function(g) {
|
|
505
|
+
g.childNodes.forEach((C) => {
|
|
506
|
+
C.isLeaf || C.setChecked(!1, !1), v(C);
|
|
507
|
+
});
|
|
508
|
+
};
|
|
509
|
+
v(r);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
setCheckedNodes(t, n = !1) {
|
|
514
|
+
const d = this.key, o = {};
|
|
515
|
+
t.forEach((s) => {
|
|
516
|
+
o[(s || {})[d]] = !0;
|
|
517
|
+
}), this._setCheckedKeys(d, n, o);
|
|
518
|
+
}
|
|
519
|
+
setCheckedKeys(t, n = !1) {
|
|
520
|
+
this.defaultCheckedKeys = t;
|
|
521
|
+
const d = this.key, o = {};
|
|
522
|
+
t.forEach((s) => {
|
|
523
|
+
o[s] = !0;
|
|
524
|
+
}), this._setCheckedKeys(d, n, o);
|
|
525
|
+
}
|
|
526
|
+
setDefaultExpandedKeys(t) {
|
|
527
|
+
t = t || [], this.defaultExpandedKeys = t, t.forEach((n) => {
|
|
528
|
+
const d = this.getNode(n);
|
|
529
|
+
d && d.expand(null, this.autoExpandParent);
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
setChecked(t, n, d) {
|
|
533
|
+
const o = this.getNode(t);
|
|
534
|
+
o && o.setChecked(!!n, d);
|
|
535
|
+
}
|
|
536
|
+
getCurrentNode() {
|
|
537
|
+
return this.currentNode;
|
|
538
|
+
}
|
|
539
|
+
setCurrentNode(t) {
|
|
540
|
+
const n = this.currentNode;
|
|
541
|
+
n && (n.isCurrent = !1), this.currentNode = t, this.currentNode.isCurrent = !0;
|
|
542
|
+
}
|
|
543
|
+
setUserCurrentNode(t, n = !0) {
|
|
544
|
+
var d;
|
|
545
|
+
const o = t[this.key], s = this.nodesMap[o];
|
|
546
|
+
this.setCurrentNode(s), n && this.currentNode && this.currentNode.level > 1 && ((d = this.currentNode.parent) == null || d.expand(null, !0));
|
|
547
|
+
}
|
|
548
|
+
setCurrentNodeKey(t, n = !0) {
|
|
549
|
+
var d;
|
|
550
|
+
if (this.currentNodeKey = t, Le(t)) {
|
|
551
|
+
this.currentNode && (this.currentNode.isCurrent = !1), this.currentNode = null;
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
const o = this.getNode(t);
|
|
555
|
+
o && (this.setCurrentNode(o), n && this.currentNode && this.currentNode.level > 1 && ((d = this.currentNode.parent) == null || d.expand(null, !0)));
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
const Te = "RootTree", et = "NodeInstance", Ue = "TreeNodeMap", jt = oe({
|
|
559
|
+
name: "ElTreeNodeContent",
|
|
560
|
+
props: {
|
|
561
|
+
node: {
|
|
562
|
+
type: Object,
|
|
563
|
+
required: !0
|
|
564
|
+
},
|
|
565
|
+
renderContent: Function
|
|
566
|
+
},
|
|
567
|
+
setup(e) {
|
|
568
|
+
const t = ne("tree"), n = le(
|
|
569
|
+
et
|
|
570
|
+
), d = le(Te);
|
|
571
|
+
return () => {
|
|
572
|
+
const o = e.node, { data: s, store: a } = o;
|
|
573
|
+
return e.renderContent ? e.renderContent(Ae, { _self: n, node: o, data: s, store: a }) : Ie(d.ctx.slots, "default", { node: o, data: s }, () => [
|
|
574
|
+
Ae(
|
|
575
|
+
Pt,
|
|
576
|
+
{ tag: "span", truncated: !0, class: t.be("node", "label") },
|
|
577
|
+
() => [o.label]
|
|
578
|
+
)
|
|
579
|
+
]);
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
var Ut = /* @__PURE__ */ ye(jt, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node-content.vue"]]);
|
|
584
|
+
function tt(e) {
|
|
585
|
+
const t = le(
|
|
586
|
+
Ue,
|
|
587
|
+
null
|
|
588
|
+
);
|
|
589
|
+
let n = {
|
|
590
|
+
treeNodeExpand: (d) => {
|
|
591
|
+
var o;
|
|
592
|
+
e.node !== d && ((o = e.node) == null || o.collapse());
|
|
593
|
+
},
|
|
594
|
+
children: /* @__PURE__ */ new Set()
|
|
595
|
+
};
|
|
596
|
+
return t && t.children.add(n), xt(() => {
|
|
597
|
+
t && t.children.delete(n), n = null;
|
|
598
|
+
}), ie(Ue, n), {
|
|
599
|
+
broadcastExpanded: (d) => {
|
|
600
|
+
if (e.accordion)
|
|
601
|
+
for (const o of n.children)
|
|
602
|
+
o.treeNodeExpand(d);
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
const nt = Symbol("dragEvents");
|
|
607
|
+
function Ht({
|
|
608
|
+
props: e,
|
|
609
|
+
ctx: t,
|
|
610
|
+
el$: n,
|
|
611
|
+
dropIndicator$: d,
|
|
612
|
+
store: o
|
|
613
|
+
}) {
|
|
614
|
+
const s = ne("tree"), a = $({
|
|
615
|
+
showDropIndicator: !1,
|
|
616
|
+
draggingNode: null,
|
|
617
|
+
dropNode: null,
|
|
618
|
+
allowDrop: !0,
|
|
619
|
+
dropType: null
|
|
620
|
+
});
|
|
621
|
+
return ie(nt, {
|
|
622
|
+
treeNodeDragStart: ({ event: r, treeNode: c }) => {
|
|
623
|
+
if (r.dataTransfer) {
|
|
624
|
+
if (ve(e.allowDrag) && !e.allowDrag(c.node))
|
|
625
|
+
return r.preventDefault(), !1;
|
|
626
|
+
r.dataTransfer.effectAllowed = "move";
|
|
627
|
+
try {
|
|
628
|
+
r.dataTransfer.setData("text/plain", "");
|
|
629
|
+
} catch {
|
|
630
|
+
}
|
|
631
|
+
a.value.draggingNode = c, t.emit("node-drag-start", c.node, r);
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
treeNodeDragOver: ({ event: r, treeNode: c }) => {
|
|
635
|
+
if (!r.dataTransfer)
|
|
636
|
+
return;
|
|
637
|
+
const u = c, v = a.value.dropNode;
|
|
638
|
+
v && v.node.id !== u.node.id && ke(v.$el, s.is("drop-inner"));
|
|
639
|
+
const g = a.value.draggingNode;
|
|
640
|
+
if (!g || !u)
|
|
641
|
+
return;
|
|
642
|
+
let N = !0, C = !0, K = !0, w = !0;
|
|
643
|
+
ve(e.allowDrop) && (N = e.allowDrop(g.node, u.node, "prev"), w = C = e.allowDrop(
|
|
644
|
+
g.node,
|
|
645
|
+
u.node,
|
|
646
|
+
"inner"
|
|
647
|
+
), K = e.allowDrop(g.node, u.node, "next")), r.dataTransfer.dropEffect = C || N || K ? "move" : "none", (N || C || K) && v?.node.id !== u.node.id && (v && t.emit("node-drag-leave", g.node, v.node, r), t.emit("node-drag-enter", g.node, u.node, r)), N || C || K ? a.value.dropNode = u : a.value.dropNode = null, u.node.nextSibling === g.node && (K = !1), u.node.previousSibling === g.node && (N = !1), u.node.contains(g.node, !1) && (C = !1), (g.node === u.node || g.node.contains(u.node)) && (N = !1, C = !1, K = !1);
|
|
648
|
+
const y = u.$el, O = y.querySelector(`.${s.be("node", "content")}`).getBoundingClientRect(), j = n.value.getBoundingClientRect(), P = n.value.scrollTop;
|
|
649
|
+
let b;
|
|
650
|
+
const R = N ? C ? 0.25 : K ? 0.45 : 1 : Number.NEGATIVE_INFINITY, p = K ? C ? 0.75 : N ? 0.55 : 0 : Number.POSITIVE_INFINITY;
|
|
651
|
+
let x = -9999;
|
|
652
|
+
const T = r.clientY - O.top;
|
|
653
|
+
T < O.height * R ? b = "before" : T > O.height * p ? b = "after" : C ? b = "inner" : b = "none";
|
|
654
|
+
const B = y.querySelector(`.${s.be("node", "expand-icon")}`).getBoundingClientRect(), E = d.value;
|
|
655
|
+
b === "before" ? x = B.top - j.top + P : b === "after" && (x = B.bottom - j.top + P), E.style.top = `${x}px`, E.style.left = `${B.right - j.left}px`, b === "inner" ? lt(y, s.is("drop-inner")) : ke(y, s.is("drop-inner")), a.value.showDropIndicator = b === "before" || b === "after", a.value.allowDrop = a.value.showDropIndicator || w, a.value.dropType = b, t.emit("node-drag-over", g.node, u.node, r);
|
|
656
|
+
},
|
|
657
|
+
treeNodeDragEnd: (r) => {
|
|
658
|
+
var c, u;
|
|
659
|
+
const { draggingNode: v, dropType: g, dropNode: N } = a.value;
|
|
660
|
+
if (r.preventDefault(), r.dataTransfer && (r.dataTransfer.dropEffect = "move"), v?.node.data && N) {
|
|
661
|
+
const C = { data: v.node.data };
|
|
662
|
+
g !== "none" && v.node.remove(), g === "before" ? (c = N.node.parent) == null || c.insertBefore(C, N.node) : g === "after" ? (u = N.node.parent) == null || u.insertAfter(C, N.node) : g === "inner" && N.node.insertChild(C), g !== "none" && (o.value.registerNode(C), o.value.key && v.node.eachNode((K) => {
|
|
663
|
+
var w;
|
|
664
|
+
(w = o.value.nodesMap[K.data[o.value.key]]) == null || w.setChecked(
|
|
665
|
+
K.checked,
|
|
666
|
+
!o.value.checkStrictly
|
|
667
|
+
);
|
|
668
|
+
})), ke(N.$el, s.is("drop-inner")), t.emit(
|
|
669
|
+
"node-drag-end",
|
|
670
|
+
v.node,
|
|
671
|
+
N.node,
|
|
672
|
+
g,
|
|
673
|
+
r
|
|
674
|
+
), g !== "none" && t.emit(
|
|
675
|
+
"node-drop",
|
|
676
|
+
v.node,
|
|
677
|
+
N.node,
|
|
678
|
+
g,
|
|
679
|
+
r
|
|
680
|
+
);
|
|
681
|
+
}
|
|
682
|
+
v && !N && t.emit("node-drag-end", v.node, null, g, r), a.value.showDropIndicator = !1, a.value.draggingNode = null, a.value.dropNode = null, a.value.allowDrop = !0;
|
|
683
|
+
}
|
|
684
|
+
}), {
|
|
685
|
+
dragState: a
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
const Rt = oe({
|
|
689
|
+
name: "ElTreeNode",
|
|
690
|
+
components: {
|
|
691
|
+
ElCollapseTransition: It,
|
|
692
|
+
ElCheckbox: $t,
|
|
693
|
+
NodeContent: Ut,
|
|
694
|
+
ElIcon: qe,
|
|
695
|
+
Loading: it
|
|
696
|
+
},
|
|
697
|
+
props: {
|
|
698
|
+
node: {
|
|
699
|
+
type: X,
|
|
700
|
+
default: () => ({})
|
|
701
|
+
},
|
|
702
|
+
props: {
|
|
703
|
+
type: Object,
|
|
704
|
+
default: () => ({})
|
|
705
|
+
},
|
|
706
|
+
accordion: Boolean,
|
|
707
|
+
renderContent: Function,
|
|
708
|
+
renderAfterExpand: Boolean,
|
|
709
|
+
showCheckbox: Boolean
|
|
710
|
+
},
|
|
711
|
+
emits: ["node-expand"],
|
|
712
|
+
setup(e, t) {
|
|
713
|
+
const n = ne("tree"), { broadcastExpanded: d } = tt(e), o = le(Te), s = $(!1), a = $(!1), i = $(), f = $(), h = $(), r = le(nt), c = Ze();
|
|
714
|
+
ie(et, c), o || rt("Tree", "Can not find node's tree."), e.node.expanded && (s.value = !0, a.value = !0);
|
|
715
|
+
const u = o.props.props.children || "children";
|
|
716
|
+
U(
|
|
717
|
+
() => {
|
|
718
|
+
var p;
|
|
719
|
+
const x = (p = e.node.data) == null ? void 0 : p[u];
|
|
720
|
+
return x && [...x];
|
|
721
|
+
},
|
|
722
|
+
() => {
|
|
723
|
+
e.node.updateChildren();
|
|
724
|
+
}
|
|
725
|
+
), U(
|
|
726
|
+
() => e.node.indeterminate,
|
|
727
|
+
(p) => {
|
|
728
|
+
N(e.node.checked, p);
|
|
729
|
+
}
|
|
730
|
+
), U(
|
|
731
|
+
() => e.node.checked,
|
|
732
|
+
(p) => {
|
|
733
|
+
N(p, e.node.indeterminate);
|
|
734
|
+
}
|
|
735
|
+
), U(
|
|
736
|
+
() => e.node.childNodes.length,
|
|
737
|
+
() => e.node.reInitChecked()
|
|
738
|
+
), U(
|
|
739
|
+
() => e.node.expanded,
|
|
740
|
+
(p) => {
|
|
741
|
+
Ee(() => s.value = p), p && (a.value = !0);
|
|
742
|
+
}
|
|
743
|
+
);
|
|
744
|
+
const v = (p) => $e(o.props.nodeKey, p.data), g = (p) => {
|
|
745
|
+
const x = e.props.class;
|
|
746
|
+
if (!x)
|
|
747
|
+
return {};
|
|
748
|
+
let T;
|
|
749
|
+
if (ve(x)) {
|
|
750
|
+
const { data: B } = p;
|
|
751
|
+
T = x(B, p);
|
|
752
|
+
} else
|
|
753
|
+
T = x;
|
|
754
|
+
return Ve(T) ? { [T]: !0 } : T;
|
|
755
|
+
}, N = (p, x) => {
|
|
756
|
+
(i.value !== p || f.value !== x) && o.ctx.emit("check-change", e.node.data, p, x), i.value = p, f.value = x;
|
|
757
|
+
}, C = (p) => {
|
|
758
|
+
we(o.store, o.ctx.emit, () => {
|
|
759
|
+
var x;
|
|
760
|
+
if ((x = o?.props) == null ? void 0 : x.nodeKey) {
|
|
761
|
+
const B = v(e.node);
|
|
762
|
+
o.store.value.setCurrentNodeKey(B);
|
|
763
|
+
} else
|
|
764
|
+
o.store.value.setCurrentNode(e.node);
|
|
765
|
+
}), o.currentNode.value = e.node, o.props.expandOnClickNode && w(), (o.props.checkOnClickNode || e.node.isLeaf && o.props.checkOnClickLeaf && e.showCheckbox) && !e.node.disabled && y(!e.node.checked), o.ctx.emit("node-click", e.node.data, e.node, c, p);
|
|
766
|
+
}, K = (p) => {
|
|
767
|
+
var x;
|
|
768
|
+
(x = o.instance.vnode.props) != null && x.onNodeContextmenu && (p.stopPropagation(), p.preventDefault()), o.ctx.emit(
|
|
769
|
+
"node-contextmenu",
|
|
770
|
+
p,
|
|
771
|
+
e.node.data,
|
|
772
|
+
e.node,
|
|
773
|
+
c
|
|
774
|
+
);
|
|
775
|
+
}, w = () => {
|
|
776
|
+
e.node.isLeaf || (s.value ? (o.ctx.emit("node-collapse", e.node.data, e.node, c), e.node.collapse()) : e.node.expand(() => {
|
|
777
|
+
t.emit("node-expand", e.node.data, e.node, c);
|
|
778
|
+
}));
|
|
779
|
+
}, y = (p) => {
|
|
780
|
+
const x = o?.props.checkStrictly, T = e.node.childNodes;
|
|
781
|
+
!x && T.length && (p = T.some((B) => !B.isEffectivelyChecked)), e.node.setChecked(p, !x), Ee(() => {
|
|
782
|
+
const B = o.store.value;
|
|
783
|
+
o.ctx.emit("check", e.node.data, {
|
|
784
|
+
checkedNodes: B.getCheckedNodes(),
|
|
785
|
+
checkedKeys: B.getCheckedKeys(),
|
|
786
|
+
halfCheckedNodes: B.getHalfCheckedNodes(),
|
|
787
|
+
halfCheckedKeys: B.getHalfCheckedKeys()
|
|
788
|
+
});
|
|
789
|
+
});
|
|
790
|
+
};
|
|
791
|
+
return {
|
|
792
|
+
ns: n,
|
|
793
|
+
node$: h,
|
|
794
|
+
tree: o,
|
|
795
|
+
expanded: s,
|
|
796
|
+
childNodeRendered: a,
|
|
797
|
+
oldChecked: i,
|
|
798
|
+
oldIndeterminate: f,
|
|
799
|
+
getNodeKey: v,
|
|
800
|
+
getNodeClass: g,
|
|
801
|
+
handleSelectChange: N,
|
|
802
|
+
handleClick: C,
|
|
803
|
+
handleContextMenu: K,
|
|
804
|
+
handleExpandIconClick: w,
|
|
805
|
+
handleCheckChange: y,
|
|
806
|
+
handleChildNodeExpand: (p, x, T) => {
|
|
807
|
+
d(x), o.ctx.emit("node-expand", p, x, T);
|
|
808
|
+
},
|
|
809
|
+
handleDragStart: (p) => {
|
|
810
|
+
o.props.draggable && r.treeNodeDragStart({ event: p, treeNode: e });
|
|
811
|
+
},
|
|
812
|
+
handleDragOver: (p) => {
|
|
813
|
+
p.preventDefault(), o.props.draggable && r.treeNodeDragOver({
|
|
814
|
+
event: p,
|
|
815
|
+
treeNode: { $el: h.value, node: e.node }
|
|
816
|
+
});
|
|
817
|
+
},
|
|
818
|
+
handleDrop: (p) => {
|
|
819
|
+
p.preventDefault();
|
|
820
|
+
},
|
|
821
|
+
handleDragEnd: (p) => {
|
|
822
|
+
o.props.draggable && r.treeNodeDragEnd(p);
|
|
823
|
+
},
|
|
824
|
+
CaretRight: ct
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
}), Vt = ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key"], qt = ["aria-expanded"];
|
|
828
|
+
function Gt(e, t, n, d, o, s) {
|
|
829
|
+
const a = Y("el-icon"), i = Y("el-checkbox"), f = Y("loading"), h = Y("node-content"), r = Y("el-tree-node"), c = Y("el-collapse-transition");
|
|
830
|
+
return re((k(), L("div", {
|
|
831
|
+
ref: "node$",
|
|
832
|
+
class: F([
|
|
833
|
+
e.ns.b("node"),
|
|
834
|
+
e.ns.is("expanded", e.expanded),
|
|
835
|
+
e.ns.is("current", e.node.isCurrent),
|
|
836
|
+
e.ns.is("hidden", !e.node.visible),
|
|
837
|
+
e.ns.is("focusable", !e.node.disabled),
|
|
838
|
+
e.ns.is("checked", !e.node.disabled && e.node.checked),
|
|
839
|
+
e.getNodeClass(e.node)
|
|
840
|
+
]),
|
|
841
|
+
role: "treeitem",
|
|
842
|
+
tabindex: "-1",
|
|
843
|
+
"aria-expanded": e.expanded,
|
|
844
|
+
"aria-disabled": e.node.disabled,
|
|
845
|
+
"aria-checked": e.node.checked,
|
|
846
|
+
draggable: e.tree.props.draggable,
|
|
847
|
+
"data-key": e.getNodeKey(e.node),
|
|
848
|
+
onClick: t[2] || (t[2] = z((...u) => e.handleClick && e.handleClick(...u), ["stop"])),
|
|
849
|
+
onContextmenu: t[3] || (t[3] = (...u) => e.handleContextMenu && e.handleContextMenu(...u)),
|
|
850
|
+
onDragstart: t[4] || (t[4] = z((...u) => e.handleDragStart && e.handleDragStart(...u), ["stop"])),
|
|
851
|
+
onDragover: t[5] || (t[5] = z((...u) => e.handleDragOver && e.handleDragOver(...u), ["stop"])),
|
|
852
|
+
onDragend: t[6] || (t[6] = z((...u) => e.handleDragEnd && e.handleDragEnd(...u), ["stop"])),
|
|
853
|
+
onDrop: t[7] || (t[7] = z((...u) => e.handleDrop && e.handleDrop(...u), ["stop"]))
|
|
854
|
+
}, [
|
|
855
|
+
A(
|
|
856
|
+
"div",
|
|
857
|
+
{
|
|
858
|
+
class: F(e.ns.be("node", "content")),
|
|
859
|
+
style: ee({ paddingLeft: (e.node.level - 1) * e.tree.props.indent + "px" })
|
|
860
|
+
},
|
|
861
|
+
[
|
|
862
|
+
e.tree.props.icon || e.CaretRight ? (k(), M(a, {
|
|
863
|
+
key: 0,
|
|
864
|
+
class: F([
|
|
865
|
+
e.ns.be("node", "expand-icon"),
|
|
866
|
+
e.ns.is("leaf", e.node.isLeaf),
|
|
867
|
+
{
|
|
868
|
+
expanded: !e.node.isLeaf && e.expanded
|
|
869
|
+
}
|
|
870
|
+
]),
|
|
871
|
+
onClick: z(e.handleExpandIconClick, ["stop"])
|
|
872
|
+
}, {
|
|
873
|
+
default: I(() => [
|
|
874
|
+
(k(), M(Je(e.tree.props.icon || e.CaretRight)))
|
|
875
|
+
]),
|
|
876
|
+
_: 1
|
|
877
|
+
}, 8, ["class", "onClick"])) : H("v-if", !0),
|
|
878
|
+
e.showCheckbox ? (k(), M(i, {
|
|
879
|
+
key: 1,
|
|
880
|
+
"model-value": e.node.checked,
|
|
881
|
+
indeterminate: e.node.indeterminate,
|
|
882
|
+
disabled: !!e.node.disabled,
|
|
883
|
+
onClick: t[0] || (t[0] = z(() => {
|
|
884
|
+
}, ["stop"])),
|
|
885
|
+
onChange: e.handleCheckChange
|
|
886
|
+
}, null, 8, ["model-value", "indeterminate", "disabled", "onChange"])) : H("v-if", !0),
|
|
887
|
+
e.node.loading ? (k(), M(a, {
|
|
888
|
+
key: 2,
|
|
889
|
+
class: F([e.ns.be("node", "loading-icon"), e.ns.is("loading")])
|
|
890
|
+
}, {
|
|
891
|
+
default: I(() => [
|
|
892
|
+
S(f)
|
|
893
|
+
]),
|
|
894
|
+
_: 1
|
|
895
|
+
}, 8, ["class"])) : H("v-if", !0),
|
|
896
|
+
S(h, {
|
|
897
|
+
node: e.node,
|
|
898
|
+
"render-content": e.renderContent
|
|
899
|
+
}, null, 8, ["node", "render-content"])
|
|
900
|
+
],
|
|
901
|
+
6
|
|
902
|
+
),
|
|
903
|
+
S(c, null, {
|
|
904
|
+
default: I(() => [
|
|
905
|
+
!e.renderAfterExpand || e.childNodeRendered ? re((k(), L("div", {
|
|
906
|
+
key: 0,
|
|
907
|
+
class: F(e.ns.be("node", "children")),
|
|
908
|
+
role: "group",
|
|
909
|
+
"aria-expanded": e.expanded,
|
|
910
|
+
onClick: t[1] || (t[1] = z(() => {
|
|
911
|
+
}, ["stop"]))
|
|
912
|
+
}, [
|
|
913
|
+
(k(!0), L(
|
|
914
|
+
ae,
|
|
915
|
+
null,
|
|
916
|
+
Xe(e.node.childNodes, (u) => (k(), M(r, {
|
|
917
|
+
key: e.getNodeKey(u),
|
|
918
|
+
"render-content": e.renderContent,
|
|
919
|
+
"render-after-expand": e.renderAfterExpand,
|
|
920
|
+
"show-checkbox": e.showCheckbox,
|
|
921
|
+
node: u,
|
|
922
|
+
accordion: e.accordion,
|
|
923
|
+
props: e.props,
|
|
924
|
+
onNodeExpand: e.handleChildNodeExpand
|
|
925
|
+
}, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]))),
|
|
926
|
+
128
|
|
927
|
+
))
|
|
928
|
+
], 10, qt)), [
|
|
929
|
+
[xe, e.expanded]
|
|
930
|
+
]) : H("v-if", !0)
|
|
931
|
+
]),
|
|
932
|
+
_: 1
|
|
933
|
+
})
|
|
934
|
+
], 42, Vt)), [
|
|
935
|
+
[xe, e.node.visible]
|
|
936
|
+
]);
|
|
937
|
+
}
|
|
938
|
+
var Yt = /* @__PURE__ */ ye(Rt, [["render", Gt], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node.vue"]]);
|
|
939
|
+
function Wt({ el$: e }, t) {
|
|
940
|
+
const n = ne("tree");
|
|
941
|
+
Ye(() => {
|
|
942
|
+
s();
|
|
943
|
+
}), We(() => {
|
|
944
|
+
var a;
|
|
945
|
+
(a = e.value) == null || a.querySelectorAll("input[type=checkbox]").forEach((i) => {
|
|
946
|
+
i.setAttribute("tabindex", "-1");
|
|
947
|
+
});
|
|
948
|
+
});
|
|
949
|
+
function d(a, i) {
|
|
950
|
+
var f, h;
|
|
951
|
+
const r = t.value.getNode(a[i].dataset.key);
|
|
952
|
+
return r.canFocus && r.visible && (((f = r.parent) == null ? void 0 : f.expanded) || ((h = r.parent) == null ? void 0 : h.level) === 0);
|
|
953
|
+
}
|
|
954
|
+
ut(e, "keydown", (a) => {
|
|
955
|
+
const i = a.target;
|
|
956
|
+
if (!i.className.includes(n.b("node")))
|
|
957
|
+
return;
|
|
958
|
+
const f = ht(a), h = Array.from(
|
|
959
|
+
e.value.querySelectorAll(`.${n.is("focusable")}[role=treeitem]`)
|
|
960
|
+
), r = h.indexOf(i);
|
|
961
|
+
let c;
|
|
962
|
+
if ([G.up, G.down].includes(f)) {
|
|
963
|
+
if (a.preventDefault(), f === G.up) {
|
|
964
|
+
c = r === -1 ? 0 : r !== 0 ? r - 1 : h.length - 1;
|
|
965
|
+
const v = c;
|
|
966
|
+
for (; !d(h, c); ) {
|
|
967
|
+
if (c--, c === v) {
|
|
968
|
+
c = -1;
|
|
969
|
+
break;
|
|
970
|
+
}
|
|
971
|
+
c < 0 && (c = h.length - 1);
|
|
972
|
+
}
|
|
973
|
+
} else {
|
|
974
|
+
c = r === -1 ? 0 : r < h.length - 1 ? r + 1 : 0;
|
|
975
|
+
const v = c;
|
|
976
|
+
for (; !d(h, c); ) {
|
|
977
|
+
if (c++, c === v) {
|
|
978
|
+
c = -1;
|
|
979
|
+
break;
|
|
980
|
+
}
|
|
981
|
+
c >= h.length && (c = 0);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
c !== -1 && h[c].focus();
|
|
985
|
+
}
|
|
986
|
+
[G.left, G.right].includes(f) && (a.preventDefault(), i.click());
|
|
987
|
+
const u = i.querySelector(
|
|
988
|
+
'[type="checkbox"]'
|
|
989
|
+
);
|
|
990
|
+
[G.enter, G.numpadEnter, G.space].includes(
|
|
991
|
+
f
|
|
992
|
+
) && u && (a.preventDefault(), u.click());
|
|
993
|
+
});
|
|
994
|
+
const s = () => {
|
|
995
|
+
var a;
|
|
996
|
+
if (!e.value)
|
|
997
|
+
return;
|
|
998
|
+
const i = Array.from(
|
|
999
|
+
e.value.querySelectorAll(`.${n.is("focusable")}[role=treeitem]`)
|
|
1000
|
+
);
|
|
1001
|
+
Array.from(
|
|
1002
|
+
e.value.querySelectorAll("input[type=checkbox]")
|
|
1003
|
+
).forEach((r) => {
|
|
1004
|
+
r.setAttribute("tabindex", "-1");
|
|
1005
|
+
});
|
|
1006
|
+
const h = e.value.querySelectorAll(
|
|
1007
|
+
`.${n.is("checked")}[role=treeitem]`
|
|
1008
|
+
);
|
|
1009
|
+
if (h.length) {
|
|
1010
|
+
h[0].setAttribute("tabindex", "0");
|
|
1011
|
+
return;
|
|
1012
|
+
}
|
|
1013
|
+
(a = i[0]) == null || a.setAttribute("tabindex", "0");
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
const Jt = He({
|
|
1017
|
+
data: {
|
|
1018
|
+
type: he(Array),
|
|
1019
|
+
default: () => []
|
|
1020
|
+
},
|
|
1021
|
+
emptyText: {
|
|
1022
|
+
type: String
|
|
1023
|
+
},
|
|
1024
|
+
renderAfterExpand: {
|
|
1025
|
+
type: Boolean,
|
|
1026
|
+
default: !0
|
|
1027
|
+
},
|
|
1028
|
+
nodeKey: String,
|
|
1029
|
+
checkStrictly: Boolean,
|
|
1030
|
+
defaultExpandAll: Boolean,
|
|
1031
|
+
expandOnClickNode: {
|
|
1032
|
+
type: Boolean,
|
|
1033
|
+
default: !0
|
|
1034
|
+
},
|
|
1035
|
+
checkOnClickNode: Boolean,
|
|
1036
|
+
checkOnClickLeaf: {
|
|
1037
|
+
type: Boolean,
|
|
1038
|
+
default: !0
|
|
1039
|
+
},
|
|
1040
|
+
checkDescendants: Boolean,
|
|
1041
|
+
autoExpandParent: {
|
|
1042
|
+
type: Boolean,
|
|
1043
|
+
default: !0
|
|
1044
|
+
},
|
|
1045
|
+
defaultCheckedKeys: {
|
|
1046
|
+
type: Array
|
|
1047
|
+
},
|
|
1048
|
+
defaultExpandedKeys: {
|
|
1049
|
+
type: Array
|
|
1050
|
+
},
|
|
1051
|
+
currentNodeKey: {
|
|
1052
|
+
type: [String, Number]
|
|
1053
|
+
},
|
|
1054
|
+
renderContent: {
|
|
1055
|
+
type: he(Function)
|
|
1056
|
+
},
|
|
1057
|
+
showCheckbox: Boolean,
|
|
1058
|
+
draggable: Boolean,
|
|
1059
|
+
allowDrag: {
|
|
1060
|
+
type: he(Function)
|
|
1061
|
+
},
|
|
1062
|
+
allowDrop: {
|
|
1063
|
+
type: he(Function)
|
|
1064
|
+
},
|
|
1065
|
+
props: {
|
|
1066
|
+
type: Object,
|
|
1067
|
+
default: () => ({
|
|
1068
|
+
children: "children",
|
|
1069
|
+
label: "label",
|
|
1070
|
+
disabled: "disabled"
|
|
1071
|
+
})
|
|
1072
|
+
},
|
|
1073
|
+
lazy: Boolean,
|
|
1074
|
+
highlightCurrent: Boolean,
|
|
1075
|
+
load: {
|
|
1076
|
+
type: Function
|
|
1077
|
+
},
|
|
1078
|
+
filterNodeMethod: {
|
|
1079
|
+
type: Function
|
|
1080
|
+
},
|
|
1081
|
+
accordion: Boolean,
|
|
1082
|
+
indent: {
|
|
1083
|
+
type: Number,
|
|
1084
|
+
default: 18
|
|
1085
|
+
},
|
|
1086
|
+
icon: {
|
|
1087
|
+
type: ft
|
|
1088
|
+
}
|
|
1089
|
+
}), Xt = {
|
|
1090
|
+
"check-change": (e, t, n) => e && Ce(t) && Ce(n),
|
|
1091
|
+
"current-change": (e, t) => !0,
|
|
1092
|
+
"node-click": (e, t, n, d) => e && t && d instanceof Event,
|
|
1093
|
+
"node-contextmenu": (e, t, n, d) => e instanceof Event && t && n,
|
|
1094
|
+
"node-collapse": (e, t, n) => e && t,
|
|
1095
|
+
"node-expand": (e, t, n) => e && t,
|
|
1096
|
+
check: (e, t) => e && t,
|
|
1097
|
+
"node-drag-start": (e, t) => e && t,
|
|
1098
|
+
"node-drag-end": (e, t, n, d) => e && d,
|
|
1099
|
+
"node-drop": (e, t, n, d) => e && t && d,
|
|
1100
|
+
"node-drag-leave": (e, t, n) => e && t && n,
|
|
1101
|
+
"node-drag-enter": (e, t, n) => e && t && n,
|
|
1102
|
+
"node-drag-over": (e, t, n) => e && t && n
|
|
1103
|
+
}, Zt = oe({
|
|
1104
|
+
name: "ElTree",
|
|
1105
|
+
components: { ElTreeNode: Yt },
|
|
1106
|
+
props: Jt,
|
|
1107
|
+
emits: Xt,
|
|
1108
|
+
setup(e, t) {
|
|
1109
|
+
const { t: n } = pt(), d = ne("tree"), o = $(
|
|
1110
|
+
new Ft({
|
|
1111
|
+
key: e.nodeKey,
|
|
1112
|
+
data: e.data,
|
|
1113
|
+
lazy: e.lazy,
|
|
1114
|
+
props: e.props,
|
|
1115
|
+
load: e.load,
|
|
1116
|
+
currentNodeKey: e.currentNodeKey,
|
|
1117
|
+
checkStrictly: e.checkStrictly,
|
|
1118
|
+
checkDescendants: e.checkDescendants,
|
|
1119
|
+
defaultCheckedKeys: e.defaultCheckedKeys,
|
|
1120
|
+
defaultExpandedKeys: e.defaultExpandedKeys,
|
|
1121
|
+
autoExpandParent: e.autoExpandParent,
|
|
1122
|
+
defaultExpandAll: e.defaultExpandAll,
|
|
1123
|
+
filterNodeMethod: e.filterNodeMethod
|
|
1124
|
+
})
|
|
1125
|
+
);
|
|
1126
|
+
o.value.initialize();
|
|
1127
|
+
const s = $(o.value.root), a = $(null), i = $(null), f = $(null), { broadcastExpanded: h } = tt(e), { dragState: r } = Ht({
|
|
1128
|
+
props: e,
|
|
1129
|
+
ctx: t,
|
|
1130
|
+
el$: i,
|
|
1131
|
+
dropIndicator$: f,
|
|
1132
|
+
store: o
|
|
1133
|
+
});
|
|
1134
|
+
Wt({ el$: i }, o);
|
|
1135
|
+
const c = Ze(), u = J(() => {
|
|
1136
|
+
let l = c?.parent;
|
|
1137
|
+
for (; l; ) {
|
|
1138
|
+
if (l.type.name === "ElTreeSelect")
|
|
1139
|
+
return !0;
|
|
1140
|
+
l = l.parent;
|
|
1141
|
+
}
|
|
1142
|
+
return !1;
|
|
1143
|
+
}), v = J(() => {
|
|
1144
|
+
const { childNodes: l } = s.value;
|
|
1145
|
+
return (!l || l.length === 0 || l.every(({ visible: D }) => !D)) && !u.value;
|
|
1146
|
+
});
|
|
1147
|
+
U(
|
|
1148
|
+
() => e.currentNodeKey,
|
|
1149
|
+
(l) => {
|
|
1150
|
+
o.value.setCurrentNodeKey(l ?? null);
|
|
1151
|
+
}
|
|
1152
|
+
), U(
|
|
1153
|
+
() => e.defaultCheckedKeys,
|
|
1154
|
+
(l, D) => {
|
|
1155
|
+
vt(l, D) || o.value.setDefaultCheckedKey(l ?? []);
|
|
1156
|
+
}
|
|
1157
|
+
), U(
|
|
1158
|
+
() => e.defaultExpandedKeys,
|
|
1159
|
+
(l) => {
|
|
1160
|
+
o.value.setDefaultExpandedKeys(l ?? []);
|
|
1161
|
+
}
|
|
1162
|
+
), U(
|
|
1163
|
+
() => e.data,
|
|
1164
|
+
(l) => {
|
|
1165
|
+
o.value.setData(l);
|
|
1166
|
+
},
|
|
1167
|
+
{ deep: !0 }
|
|
1168
|
+
), U(
|
|
1169
|
+
() => e.checkStrictly,
|
|
1170
|
+
(l) => {
|
|
1171
|
+
o.value.checkStrictly = l;
|
|
1172
|
+
}
|
|
1173
|
+
);
|
|
1174
|
+
const g = (l) => {
|
|
1175
|
+
if (!e.filterNodeMethod)
|
|
1176
|
+
throw new Error("[Tree] filterNodeMethod is required when filter");
|
|
1177
|
+
o.value.filter(l);
|
|
1178
|
+
}, N = (l) => $e(e.nodeKey, l.data), C = (l) => {
|
|
1179
|
+
if (!e.nodeKey)
|
|
1180
|
+
throw new Error(`[Tree] nodeKey is required in ${l}`);
|
|
1181
|
+
}, K = (l) => {
|
|
1182
|
+
C("getNodePath");
|
|
1183
|
+
const D = o.value.getNode(l);
|
|
1184
|
+
if (!D)
|
|
1185
|
+
return [];
|
|
1186
|
+
const _ = [D.data];
|
|
1187
|
+
let de = D.parent;
|
|
1188
|
+
for (; de && de !== s.value; )
|
|
1189
|
+
_.push(de.data), de = de.parent;
|
|
1190
|
+
return _.reverse();
|
|
1191
|
+
}, w = (l, D) => o.value.getCheckedNodes(l, D), y = (l) => o.value.getCheckedKeys(l), O = () => {
|
|
1192
|
+
const l = o.value.getCurrentNode();
|
|
1193
|
+
return l ? l.data : null;
|
|
1194
|
+
}, j = () => {
|
|
1195
|
+
C("getCurrentKey");
|
|
1196
|
+
const l = O();
|
|
1197
|
+
return l ? l[e.nodeKey] : null;
|
|
1198
|
+
}, P = (l, D) => {
|
|
1199
|
+
C("setCheckedNodes"), o.value.setCheckedNodes(l, D);
|
|
1200
|
+
}, b = (l, D) => {
|
|
1201
|
+
C("setCheckedKeys"), o.value.setCheckedKeys(l, D);
|
|
1202
|
+
}, R = (l, D, _) => {
|
|
1203
|
+
o.value.setChecked(l, D, _);
|
|
1204
|
+
}, p = () => o.value.getHalfCheckedNodes(), x = () => o.value.getHalfCheckedKeys(), T = (l, D = !0) => {
|
|
1205
|
+
C("setCurrentNode"), we(o, t.emit, () => {
|
|
1206
|
+
h(l), o.value.setUserCurrentNode(l, D);
|
|
1207
|
+
});
|
|
1208
|
+
}, B = (l = null, D = !0) => {
|
|
1209
|
+
C("setCurrentKey"), we(o, t.emit, () => {
|
|
1210
|
+
h(), o.value.setCurrentNodeKey(l, D);
|
|
1211
|
+
});
|
|
1212
|
+
}, E = (l) => o.value.getNode(l), m = (l) => {
|
|
1213
|
+
o.value.remove(l);
|
|
1214
|
+
}, Z = (l, D) => {
|
|
1215
|
+
o.value.append(l, D);
|
|
1216
|
+
}, Q = (l, D) => {
|
|
1217
|
+
o.value.insertBefore(l, D);
|
|
1218
|
+
}, ce = (l, D) => {
|
|
1219
|
+
o.value.insertAfter(l, D);
|
|
1220
|
+
}, ge = (l, D, _) => {
|
|
1221
|
+
h(D), t.emit("node-expand", l, D, _);
|
|
1222
|
+
}, me = (l, D) => {
|
|
1223
|
+
C("updateKeyChild"), o.value.updateChildren(l, D);
|
|
1224
|
+
};
|
|
1225
|
+
return ie(Te, {
|
|
1226
|
+
ctx: t,
|
|
1227
|
+
props: e,
|
|
1228
|
+
store: o,
|
|
1229
|
+
root: s,
|
|
1230
|
+
currentNode: a,
|
|
1231
|
+
instance: c
|
|
1232
|
+
}), ie(yt, void 0), {
|
|
1233
|
+
ns: d,
|
|
1234
|
+
store: o,
|
|
1235
|
+
root: s,
|
|
1236
|
+
currentNode: a,
|
|
1237
|
+
dragState: r,
|
|
1238
|
+
el$: i,
|
|
1239
|
+
dropIndicator$: f,
|
|
1240
|
+
isEmpty: v,
|
|
1241
|
+
filter: g,
|
|
1242
|
+
getNodeKey: N,
|
|
1243
|
+
getNodePath: K,
|
|
1244
|
+
getCheckedNodes: w,
|
|
1245
|
+
getCheckedKeys: y,
|
|
1246
|
+
getCurrentNode: O,
|
|
1247
|
+
getCurrentKey: j,
|
|
1248
|
+
setCheckedNodes: P,
|
|
1249
|
+
setCheckedKeys: b,
|
|
1250
|
+
setChecked: R,
|
|
1251
|
+
getHalfCheckedNodes: p,
|
|
1252
|
+
getHalfCheckedKeys: x,
|
|
1253
|
+
setCurrentNode: T,
|
|
1254
|
+
setCurrentKey: B,
|
|
1255
|
+
t: n,
|
|
1256
|
+
getNode: E,
|
|
1257
|
+
remove: m,
|
|
1258
|
+
append: Z,
|
|
1259
|
+
insertBefore: Q,
|
|
1260
|
+
insertAfter: ce,
|
|
1261
|
+
handleNodeExpand: ge,
|
|
1262
|
+
updateKeyChildren: me
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
});
|
|
1266
|
+
function Qt(e, t, n, d, o, s) {
|
|
1267
|
+
const a = Y("el-tree-node");
|
|
1268
|
+
return k(), L(
|
|
1269
|
+
"div",
|
|
1270
|
+
{
|
|
1271
|
+
ref: "el$",
|
|
1272
|
+
class: F([
|
|
1273
|
+
e.ns.b(),
|
|
1274
|
+
e.ns.is("dragging", !!e.dragState.draggingNode),
|
|
1275
|
+
e.ns.is("drop-not-allow", !e.dragState.allowDrop),
|
|
1276
|
+
e.ns.is("drop-inner", e.dragState.dropType === "inner"),
|
|
1277
|
+
{ [e.ns.m("highlight-current")]: e.highlightCurrent }
|
|
1278
|
+
]),
|
|
1279
|
+
role: "tree"
|
|
1280
|
+
},
|
|
1281
|
+
[
|
|
1282
|
+
(k(!0), L(
|
|
1283
|
+
ae,
|
|
1284
|
+
null,
|
|
1285
|
+
Xe(e.root.childNodes, (i) => (k(), M(a, {
|
|
1286
|
+
key: e.getNodeKey(i),
|
|
1287
|
+
node: i,
|
|
1288
|
+
props: e.props,
|
|
1289
|
+
accordion: e.accordion,
|
|
1290
|
+
"render-after-expand": e.renderAfterExpand,
|
|
1291
|
+
"show-checkbox": e.showCheckbox,
|
|
1292
|
+
"render-content": e.renderContent,
|
|
1293
|
+
onNodeExpand: e.handleNodeExpand
|
|
1294
|
+
}, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]))),
|
|
1295
|
+
128
|
|
1296
|
+
)),
|
|
1297
|
+
e.isEmpty ? (k(), L(
|
|
1298
|
+
"div",
|
|
1299
|
+
{
|
|
1300
|
+
key: 0,
|
|
1301
|
+
class: F(e.ns.e("empty-block"))
|
|
1302
|
+
},
|
|
1303
|
+
[
|
|
1304
|
+
Ie(e.$slots, "empty", {}, () => {
|
|
1305
|
+
var i;
|
|
1306
|
+
return [
|
|
1307
|
+
A(
|
|
1308
|
+
"span",
|
|
1309
|
+
{
|
|
1310
|
+
class: F(e.ns.e("empty-text"))
|
|
1311
|
+
},
|
|
1312
|
+
De((i = e.emptyText) != null ? i : e.t("el.tree.emptyText")),
|
|
1313
|
+
3
|
|
1314
|
+
)
|
|
1315
|
+
];
|
|
1316
|
+
})
|
|
1317
|
+
],
|
|
1318
|
+
2
|
|
1319
|
+
)) : H("v-if", !0),
|
|
1320
|
+
re(A(
|
|
1321
|
+
"div",
|
|
1322
|
+
{
|
|
1323
|
+
ref: "dropIndicator$",
|
|
1324
|
+
class: F(e.ns.e("drop-indicator"))
|
|
1325
|
+
},
|
|
1326
|
+
null,
|
|
1327
|
+
2
|
|
1328
|
+
), [
|
|
1329
|
+
[xe, e.dragState.showDropIndicator]
|
|
1330
|
+
])
|
|
1331
|
+
],
|
|
1332
|
+
2
|
|
1333
|
+
);
|
|
1334
|
+
}
|
|
1335
|
+
var _t = /* @__PURE__ */ ye(Zt, [["render", Qt], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree.vue"]]);
|
|
1336
|
+
const en = Re(_t), tn = {}, nn = {
|
|
1337
|
+
t: "1639132000791",
|
|
1338
|
+
class: "icon",
|
|
1339
|
+
viewBox: "0 0 1024 1024",
|
|
1340
|
+
version: "1.1",
|
|
1341
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1342
|
+
"p-id": "5015",
|
|
1343
|
+
width: "64",
|
|
1344
|
+
height: "64"
|
|
1345
|
+
};
|
|
1346
|
+
function on(e, t) {
|
|
1347
|
+
return k(), L("svg", nn, [...t[0] || (t[0] = [
|
|
1348
|
+
A("path", {
|
|
1349
|
+
d: "M309.952512 148.95240533a50.331648 50.331648 0 0 1 61.16693332 4.390912L701.94517333 448.49561599a84.91281067 84.91281067 0 0 1 0 126.98692268L371.14129067 870.67852801a50.331648 50.331648 0 0 1-62.76164267 3.27679999c-16.318464-12.058624-19.68264533-34.95253333-7.51479467-51.11808l204.95291734-272.52053333a63.635456 63.635456 0 0 0 0-76.58973867l-204.95291734-272.52053333-1.13595733-1.572864a36.32878933 36.32878933 0 0 1 10.223616-50.659328z",
|
|
1350
|
+
"p-id": "5016"
|
|
1351
|
+
}, null, -1)
|
|
1352
|
+
])]);
|
|
1353
|
+
}
|
|
1354
|
+
const dn = /* @__PURE__ */ Se(tn, [["render", on]]), sn = ["title"], an = {
|
|
1355
|
+
key: 2,
|
|
1356
|
+
class: "layer-item-span"
|
|
1357
|
+
}, ln = { class: "layer-item-actions" }, rn = { class: "layer-manager-thumbail" }, cn = { class: "layer-item-actions" }, un = /* @__PURE__ */ oe({
|
|
1358
|
+
__name: "layer-manager-item",
|
|
1359
|
+
props: {
|
|
1360
|
+
com: {},
|
|
1361
|
+
level: {},
|
|
1362
|
+
showText: { type: Boolean }
|
|
1363
|
+
},
|
|
1364
|
+
emits: ["dragGroup"],
|
|
1365
|
+
setup(e, { emit: t }) {
|
|
1366
|
+
const n = e, d = t, { showMenu: o } = Qe(), s = Ge(), a = $(!1), i = window.ikBasicsUrl, f = J(() => gt(n.com));
|
|
1367
|
+
function h(w) {
|
|
1368
|
+
n.com.renameing = w === 1;
|
|
1369
|
+
}
|
|
1370
|
+
function r(w) {
|
|
1371
|
+
n.com.hovered = n.com.selected ? !1 : w === 1;
|
|
1372
|
+
}
|
|
1373
|
+
function c(w) {
|
|
1374
|
+
n.com.hided = w === 1;
|
|
1375
|
+
}
|
|
1376
|
+
function u(w) {
|
|
1377
|
+
n.com.locked = w === 1;
|
|
1378
|
+
}
|
|
1379
|
+
function v() {
|
|
1380
|
+
s.delete(n.com);
|
|
1381
|
+
}
|
|
1382
|
+
function g() {
|
|
1383
|
+
n.com.fold = !n.com.fold;
|
|
1384
|
+
}
|
|
1385
|
+
function N() {
|
|
1386
|
+
n.com.type === V.layer && (a.value = !0, d("dragGroup", { key: "enter" }));
|
|
1387
|
+
}
|
|
1388
|
+
function C() {
|
|
1389
|
+
n.com.type === V.layer && (a.value = !1, d("dragGroup", { key: "leave" }));
|
|
1390
|
+
}
|
|
1391
|
+
function K() {
|
|
1392
|
+
n.com.type === V.layer && (a.value = !1, d("dragGroup", {
|
|
1393
|
+
key: "drop",
|
|
1394
|
+
level: n.level + 1,
|
|
1395
|
+
com: n.com.children?.[0]
|
|
1396
|
+
}));
|
|
1397
|
+
}
|
|
1398
|
+
return (w, y) => {
|
|
1399
|
+
const O = qe, j = Y("g-com-icon"), P = Dt("focus");
|
|
1400
|
+
return k(), L("div", {
|
|
1401
|
+
title: e.com.alias,
|
|
1402
|
+
class: F(["layer-manager-item", {
|
|
1403
|
+
"layer-manager-com": e.com.type === q(V).com,
|
|
1404
|
+
"layer-manager-group": e.com.type === q(V).layer,
|
|
1405
|
+
"layer-manager-thumbail-wrap": !e.showText,
|
|
1406
|
+
"--child-hovered": f.value.hovered || a.value,
|
|
1407
|
+
"--child-selected": f.value.selected,
|
|
1408
|
+
hided: e.com.hided,
|
|
1409
|
+
locked: e.com.locked,
|
|
1410
|
+
hovered: e.com.hovered
|
|
1411
|
+
}]),
|
|
1412
|
+
style: ee({
|
|
1413
|
+
paddingLeft: `${6 + e.level * 10}px`
|
|
1414
|
+
}),
|
|
1415
|
+
draggable: "true",
|
|
1416
|
+
onMouseenter: y[12] || (y[12] = (b) => r(1)),
|
|
1417
|
+
onMouseleave: y[13] || (y[13] = (b) => r(0)),
|
|
1418
|
+
onContextmenu: y[14] || (y[14] = (b) => q(o)(b, e.com))
|
|
1419
|
+
}, [
|
|
1420
|
+
e.com.type === q(V).layer ? (k(), L(ae, { key: 0 }, [
|
|
1421
|
+
S(O, {
|
|
1422
|
+
class: F(["fold-toggle-btn", { "icon-fold": e.com.fold }])
|
|
1423
|
+
}, {
|
|
1424
|
+
default: I(() => [
|
|
1425
|
+
S(dn)
|
|
1426
|
+
]),
|
|
1427
|
+
_: 1
|
|
1428
|
+
}, 8, ["class"]),
|
|
1429
|
+
S(O, { class: "layer-item-icon" }, {
|
|
1430
|
+
default: I(() => [
|
|
1431
|
+
S(St)
|
|
1432
|
+
]),
|
|
1433
|
+
_: 1
|
|
1434
|
+
})
|
|
1435
|
+
], 64)) : H("", !0),
|
|
1436
|
+
e.showText ? (k(), L(ae, { key: 1 }, [
|
|
1437
|
+
e.com.type === q(V).com ? (k(), M(j, {
|
|
1438
|
+
key: 0,
|
|
1439
|
+
icon: e.com.icon
|
|
1440
|
+
}, null, 8, ["icon"])) : H("", !0),
|
|
1441
|
+
e.com.renameing ? re((k(), L("input", {
|
|
1442
|
+
key: 1,
|
|
1443
|
+
"onUpdate:modelValue": y[0] || (y[0] = (b) => e.com.alias = b),
|
|
1444
|
+
class: "layer-item-input",
|
|
1445
|
+
onBlur: y[1] || (y[1] = (b) => h(0)),
|
|
1446
|
+
onKeydown: y[2] || (y[2] = Be((b) => h(0), ["enter"]))
|
|
1447
|
+
}, null, 544)), [
|
|
1448
|
+
[
|
|
1449
|
+
Oe,
|
|
1450
|
+
e.com.alias,
|
|
1451
|
+
void 0,
|
|
1452
|
+
{ trim: !0 }
|
|
1453
|
+
],
|
|
1454
|
+
[P]
|
|
1455
|
+
]) : (k(), L("span", an, [
|
|
1456
|
+
A("span", {
|
|
1457
|
+
class: "layer-item-text",
|
|
1458
|
+
onDblclick: y[3] || (y[3] = (b) => h(1))
|
|
1459
|
+
}, De(e.com.alias), 33)
|
|
1460
|
+
])),
|
|
1461
|
+
A("div", ln, [
|
|
1462
|
+
S(O, {
|
|
1463
|
+
class: "action-icon",
|
|
1464
|
+
onClick: y[4] || (y[4] = z((b) => c(e.com.hided ? 0 : 1), ["stop"]))
|
|
1465
|
+
}, {
|
|
1466
|
+
default: I(() => [
|
|
1467
|
+
e.com.hided ? (k(), M(ze, { key: 0 })) : (k(), M(Fe, { key: 1 }))
|
|
1468
|
+
]),
|
|
1469
|
+
_: 1
|
|
1470
|
+
}),
|
|
1471
|
+
S(O, {
|
|
1472
|
+
class: "action-icon",
|
|
1473
|
+
onClick: y[5] || (y[5] = z((b) => u(e.com.locked ? 0 : 1), ["stop"]))
|
|
1474
|
+
}, {
|
|
1475
|
+
default: I(() => [
|
|
1476
|
+
e.com.locked ? (k(), M(Me, { key: 0 })) : (k(), M(Pe, { key: 1 }))
|
|
1477
|
+
]),
|
|
1478
|
+
_: 1
|
|
1479
|
+
}),
|
|
1480
|
+
S(O, {
|
|
1481
|
+
class: "action-icon delete-icon",
|
|
1482
|
+
onClick: z(v, ["stop"])
|
|
1483
|
+
}, {
|
|
1484
|
+
default: I(() => [
|
|
1485
|
+
S(Kt)
|
|
1486
|
+
]),
|
|
1487
|
+
_: 1
|
|
1488
|
+
})
|
|
1489
|
+
])
|
|
1490
|
+
], 64)) : (k(), L(ae, { key: 2 }, [
|
|
1491
|
+
e.com.type === q(V).com ? (k(), L("div", {
|
|
1492
|
+
key: 0,
|
|
1493
|
+
class: "layer-item-thumbail",
|
|
1494
|
+
style: ee(`background-image: url(${q(i)}${e.com.img})`)
|
|
1495
|
+
}, null, 4)) : H("", !0),
|
|
1496
|
+
A("div", rn, [
|
|
1497
|
+
e.com.renameing ? re((k(), L("input", {
|
|
1498
|
+
key: 0,
|
|
1499
|
+
"onUpdate:modelValue": y[6] || (y[6] = (b) => e.com.alias = b),
|
|
1500
|
+
class: "layer-item-input",
|
|
1501
|
+
onBlur: y[7] || (y[7] = (b) => h(0)),
|
|
1502
|
+
onKeydown: y[8] || (y[8] = Be((b) => h(0), ["enter"]))
|
|
1503
|
+
}, null, 544)), [
|
|
1504
|
+
[
|
|
1505
|
+
Oe,
|
|
1506
|
+
e.com.alias,
|
|
1507
|
+
void 0,
|
|
1508
|
+
{ trim: !0 }
|
|
1509
|
+
],
|
|
1510
|
+
[P]
|
|
1511
|
+
]) : (k(), L("span", {
|
|
1512
|
+
key: 1,
|
|
1513
|
+
class: "layer-item-span",
|
|
1514
|
+
onDragenter: N,
|
|
1515
|
+
onDragleave: C,
|
|
1516
|
+
onDrop: K
|
|
1517
|
+
}, [
|
|
1518
|
+
A("span", {
|
|
1519
|
+
class: "layer-item-text",
|
|
1520
|
+
onDblclick: y[9] || (y[9] = (b) => h(1))
|
|
1521
|
+
}, De(e.com.alias), 33)
|
|
1522
|
+
], 32))
|
|
1523
|
+
]),
|
|
1524
|
+
A("div", cn, [
|
|
1525
|
+
S(O, {
|
|
1526
|
+
class: "action-icon",
|
|
1527
|
+
onClick: y[10] || (y[10] = z((b) => c(e.com.hided ? 0 : 1), ["stop"]))
|
|
1528
|
+
}, {
|
|
1529
|
+
default: I(() => [
|
|
1530
|
+
e.com.hided ? (k(), M(ze, { key: 0 })) : (k(), M(Fe, { key: 1 }))
|
|
1531
|
+
]),
|
|
1532
|
+
_: 1
|
|
1533
|
+
}),
|
|
1534
|
+
S(O, {
|
|
1535
|
+
class: "action-icon",
|
|
1536
|
+
onClick: y[11] || (y[11] = z((b) => u(e.com.locked ? 0 : 1), ["stop"]))
|
|
1537
|
+
}, {
|
|
1538
|
+
default: I(() => [
|
|
1539
|
+
e.com.locked ? (k(), M(Me, { key: 0 })) : (k(), M(Pe, { key: 1 }))
|
|
1540
|
+
]),
|
|
1541
|
+
_: 1
|
|
1542
|
+
})
|
|
1543
|
+
])
|
|
1544
|
+
], 64)),
|
|
1545
|
+
e.com.type === q(V).layer ? (k(), L("div", {
|
|
1546
|
+
key: 3,
|
|
1547
|
+
class: "group-fold-controller",
|
|
1548
|
+
style: ee({
|
|
1549
|
+
width: `${e.level > 0 ? 50 : 40}px`,
|
|
1550
|
+
transform: `translateX(-${6 + e.level * 10}px)`
|
|
1551
|
+
}),
|
|
1552
|
+
onMouseup: z(g, ["stop"])
|
|
1553
|
+
}, null, 36)) : H("", !0)
|
|
1554
|
+
], 46, sn);
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1557
|
+
}), hn = /* @__PURE__ */ Se(un, [["__scopeId", "data-v-3e4dd165"]]), fn = { class: "layer-manager" }, pn = { class: "layer-manager-wrap" }, vn = { style: { display: "flex", "align-items": "center" } }, yn = { class: "dialog-footer" }, gn = { class: "dialog-footer" }, mn = /* @__PURE__ */ oe({
|
|
1558
|
+
__name: "index",
|
|
1559
|
+
setup(e) {
|
|
1560
|
+
const t = wt(), n = mt(), d = Ge(), { showMenu: o } = Qe(), s = J(() => t.layer.show), a = $({
|
|
1561
|
+
visible: !1,
|
|
1562
|
+
x: 0,
|
|
1563
|
+
y: 0,
|
|
1564
|
+
toLevel: 0,
|
|
1565
|
+
toIndex: 0,
|
|
1566
|
+
toCom: null,
|
|
1567
|
+
drop: !1
|
|
1568
|
+
}), i = J(() => d.coms);
|
|
1569
|
+
function f() {
|
|
1570
|
+
d.select("");
|
|
1571
|
+
}
|
|
1572
|
+
function h(E, m, Z) {
|
|
1573
|
+
}
|
|
1574
|
+
function r(E, m, Z) {
|
|
1575
|
+
}
|
|
1576
|
+
function c(E) {
|
|
1577
|
+
a.value.drop = E.key === "drop", E.key === "enter" && (a.value.visible = !0, a.value.y = E.y, a.value.x = E.level * 10, a.value.toLevel = E.level, a.value.toIndex = E.idx, a.value.toCom = E.com);
|
|
1578
|
+
}
|
|
1579
|
+
function u(E, m) {
|
|
1580
|
+
d.select(m.id), o(E, m);
|
|
1581
|
+
}
|
|
1582
|
+
const v = $(/* @__PURE__ */ new Set()), g = J(() => Array.from(v.value));
|
|
1583
|
+
function N(E) {
|
|
1584
|
+
d.select(E.id);
|
|
1585
|
+
}
|
|
1586
|
+
function C(E) {
|
|
1587
|
+
N(E);
|
|
1588
|
+
}
|
|
1589
|
+
function K(E) {
|
|
1590
|
+
v.value.delete(E.id);
|
|
1591
|
+
}
|
|
1592
|
+
function w(E) {
|
|
1593
|
+
v.value.add(E.id);
|
|
1594
|
+
}
|
|
1595
|
+
const y = $(""), O = $("");
|
|
1596
|
+
U(
|
|
1597
|
+
() => n.allPages[0]?.id,
|
|
1598
|
+
(E) => {
|
|
1599
|
+
y.value = E ?? "", O.value = E ?? "";
|
|
1600
|
+
},
|
|
1601
|
+
{ immediate: !0 }
|
|
1602
|
+
);
|
|
1603
|
+
const j = $(!1), P = $("");
|
|
1604
|
+
function b(E) {
|
|
1605
|
+
if (E === 2) {
|
|
1606
|
+
if (!P.value)
|
|
1607
|
+
return At({
|
|
1608
|
+
message: "新页面名称不能为空",
|
|
1609
|
+
type: "warning"
|
|
1610
|
+
});
|
|
1611
|
+
n.addPages(P.value);
|
|
1612
|
+
}
|
|
1613
|
+
P.value = "", j.value = !1;
|
|
1614
|
+
}
|
|
1615
|
+
const R = $(!1), p = $({}), x = {
|
|
1616
|
+
name: [{ required: !0, message: "请输入名称", trigger: "blur" }]
|
|
1617
|
+
}, T = $();
|
|
1618
|
+
function B() {
|
|
1619
|
+
T.value?.validate((E) => {
|
|
1620
|
+
E && (n.editNamePage(p.value), R.value = !1);
|
|
1621
|
+
});
|
|
1622
|
+
}
|
|
1623
|
+
return (E, m) => {
|
|
1624
|
+
const Z = kt, Q = Lt, ce = Tt, ge = Ct, me = Nt;
|
|
1625
|
+
return k(), L("div", {
|
|
1626
|
+
class: F(["g-aside layer-panel-wp", [{ "--hide": !s.value }]])
|
|
1627
|
+
}, [
|
|
1628
|
+
A("div", fn, [
|
|
1629
|
+
m[8] || (m[8] = A("div", { class: "layer-manager-top" }, [
|
|
1630
|
+
A("div", { class: "layer-num" }, " 图层 ")
|
|
1631
|
+
], -1)),
|
|
1632
|
+
A("div", pn, [
|
|
1633
|
+
S(q(en), {
|
|
1634
|
+
"node-key": "id",
|
|
1635
|
+
data: i.value,
|
|
1636
|
+
"expand-on-click-node": !1,
|
|
1637
|
+
"default-expanded-keys": g.value,
|
|
1638
|
+
"empty-text": "暂无图层",
|
|
1639
|
+
onNodeClick: C,
|
|
1640
|
+
onNodeContextmenu: u,
|
|
1641
|
+
onNodeDragOver: r,
|
|
1642
|
+
onNodeDragEnter: h,
|
|
1643
|
+
onNodeCollapse: K,
|
|
1644
|
+
onNodeExpand: w
|
|
1645
|
+
}, {
|
|
1646
|
+
default: I(({ data: l }) => [
|
|
1647
|
+
S(hn, {
|
|
1648
|
+
com: l,
|
|
1649
|
+
level: 1,
|
|
1650
|
+
"show-text": !0,
|
|
1651
|
+
onDragGroup: c
|
|
1652
|
+
}, null, 8, ["com"])
|
|
1653
|
+
]),
|
|
1654
|
+
_: 1
|
|
1655
|
+
}, 8, ["data", "default-expanded-keys"]),
|
|
1656
|
+
A("div", {
|
|
1657
|
+
class: "last-flex-item",
|
|
1658
|
+
onClick: f
|
|
1659
|
+
}),
|
|
1660
|
+
a.value.visible ? (k(), L("div", {
|
|
1661
|
+
key: 0,
|
|
1662
|
+
class: "layer-move-to-line",
|
|
1663
|
+
style: ee({
|
|
1664
|
+
width: `calc(100% - ${a.value.x}px)`,
|
|
1665
|
+
transform: `translate(${a.value.x}px, ${a.value.y}px)`
|
|
1666
|
+
})
|
|
1667
|
+
}, null, 4)) : H("", !0),
|
|
1668
|
+
m[7] || (m[7] = A("div", { class: "draging-wrap" }, null, -1))
|
|
1669
|
+
])
|
|
1670
|
+
]),
|
|
1671
|
+
S(ce, {
|
|
1672
|
+
modelValue: j.value,
|
|
1673
|
+
"onUpdate:modelValue": m[3] || (m[3] = (l) => j.value = l),
|
|
1674
|
+
title: "添加新页面",
|
|
1675
|
+
width: "500",
|
|
1676
|
+
"append-to": ".screen-editor-root"
|
|
1677
|
+
}, {
|
|
1678
|
+
footer: I(() => [
|
|
1679
|
+
A("div", yn, [
|
|
1680
|
+
S(Q, {
|
|
1681
|
+
onClick: m[1] || (m[1] = (l) => b(1))
|
|
1682
|
+
}, {
|
|
1683
|
+
default: I(() => [...m[10] || (m[10] = [
|
|
1684
|
+
fe(" 取消 ", -1)
|
|
1685
|
+
])]),
|
|
1686
|
+
_: 1
|
|
1687
|
+
}),
|
|
1688
|
+
S(Q, {
|
|
1689
|
+
type: "primary",
|
|
1690
|
+
onClick: m[2] || (m[2] = (l) => b(2))
|
|
1691
|
+
}, {
|
|
1692
|
+
default: I(() => [...m[11] || (m[11] = [
|
|
1693
|
+
fe(" 确定 ", -1)
|
|
1694
|
+
])]),
|
|
1695
|
+
_: 1
|
|
1696
|
+
})
|
|
1697
|
+
])
|
|
1698
|
+
]),
|
|
1699
|
+
default: I(() => [
|
|
1700
|
+
A("div", vn, [
|
|
1701
|
+
m[9] || (m[9] = A("p", { style: { width: "58px" } }, " 名称 ", -1)),
|
|
1702
|
+
S(Z, {
|
|
1703
|
+
modelValue: P.value,
|
|
1704
|
+
"onUpdate:modelValue": m[0] || (m[0] = (l) => P.value = l)
|
|
1705
|
+
}, null, 8, ["modelValue"])
|
|
1706
|
+
])
|
|
1707
|
+
]),
|
|
1708
|
+
_: 1
|
|
1709
|
+
}, 8, ["modelValue"]),
|
|
1710
|
+
S(ce, {
|
|
1711
|
+
modelValue: R.value,
|
|
1712
|
+
"onUpdate:modelValue": m[6] || (m[6] = (l) => R.value = l),
|
|
1713
|
+
title: "修改页面名称",
|
|
1714
|
+
width: "500px",
|
|
1715
|
+
"append-to": ".screen-editor-root"
|
|
1716
|
+
}, {
|
|
1717
|
+
footer: I(() => [
|
|
1718
|
+
A("div", gn, [
|
|
1719
|
+
S(Q, {
|
|
1720
|
+
onClick: m[5] || (m[5] = (l) => R.value = !1)
|
|
1721
|
+
}, {
|
|
1722
|
+
default: I(() => [...m[12] || (m[12] = [
|
|
1723
|
+
fe(" 取消 ", -1)
|
|
1724
|
+
])]),
|
|
1725
|
+
_: 1
|
|
1726
|
+
}),
|
|
1727
|
+
S(Q, {
|
|
1728
|
+
type: "primary",
|
|
1729
|
+
onClick: B
|
|
1730
|
+
}, {
|
|
1731
|
+
default: I(() => [...m[13] || (m[13] = [
|
|
1732
|
+
fe(" 确定 ", -1)
|
|
1733
|
+
])]),
|
|
1734
|
+
_: 1
|
|
1735
|
+
})
|
|
1736
|
+
])
|
|
1737
|
+
]),
|
|
1738
|
+
default: I(() => [
|
|
1739
|
+
S(me, {
|
|
1740
|
+
ref_key: "ruleFormRef",
|
|
1741
|
+
ref: T,
|
|
1742
|
+
model: p.value,
|
|
1743
|
+
rules: x,
|
|
1744
|
+
"label-width": "auto",
|
|
1745
|
+
class: "demo-ruleForm",
|
|
1746
|
+
"status-icon": ""
|
|
1747
|
+
}, {
|
|
1748
|
+
default: I(() => [
|
|
1749
|
+
S(ge, {
|
|
1750
|
+
label: "名称",
|
|
1751
|
+
prop: "name"
|
|
1752
|
+
}, {
|
|
1753
|
+
default: I(() => [
|
|
1754
|
+
S(Z, {
|
|
1755
|
+
modelValue: p.value.name,
|
|
1756
|
+
"onUpdate:modelValue": m[4] || (m[4] = (l) => p.value.name = l)
|
|
1757
|
+
}, null, 8, ["modelValue"])
|
|
1758
|
+
]),
|
|
1759
|
+
_: 1
|
|
1760
|
+
})
|
|
1761
|
+
]),
|
|
1762
|
+
_: 1
|
|
1763
|
+
}, 8, ["model"])
|
|
1764
|
+
]),
|
|
1765
|
+
_: 1
|
|
1766
|
+
}, 8, ["modelValue"])
|
|
1767
|
+
], 2);
|
|
1768
|
+
};
|
|
1769
|
+
}
|
|
1770
|
+
}), Bn = /* @__PURE__ */ Se(mn, [["__scopeId", "data-v-1a745476"]]);
|
|
1771
|
+
export {
|
|
1772
|
+
Bn as default
|
|
1773
|
+
};
|