fangguo-component 1.1.0 → 1.1.2
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/CHANGELOG.md +36 -1
- package/README.md +13 -11
- package/dist/{CustomInputV2-DYEcbu5_.js → CustomInputV2-uARhbFc8.js} +12 -12
- package/dist/CustomInputV2.css +1 -1
- package/dist/DragResizable.css +1 -1
- package/dist/DragResizable.vue_vue_type_style_index_0_lang-CHv0gJmo.js +179 -0
- package/dist/FgCascader.css +1 -1
- package/dist/FgCascader.vue_vue_type_style_index_0_lang-BUZDDcVn.js +1656 -0
- package/dist/{HSelect-Bqz2yTMf.js → HSelect-Drf6YBwO.js} +69 -69
- package/dist/{HSelectAll.vue_vue_type_script_setup_true_lang-C8i6LF_k.js → HSelectAll.vue_vue_type_script_setup_true_lang-Blq9xpfa.js} +1 -1
- package/dist/{HSelectSJ-BieRp2gG.js → HSelectSJ-D3GrXmvj.js} +104 -104
- package/dist/SelectTree-Dm5259kY.js +911 -0
- package/dist/SelectTree.css +1 -1
- package/dist/TextCopy-hOj-Wj2H.js +41 -0
- package/dist/TextCopy.css +1 -0
- package/dist/VirtualTable-BWugJiQ5.js +349 -0
- package/dist/VirtualTable.css +1 -1
- package/dist/components/VirtualTable/VirtualTable.vue.d.ts +3 -3
- package/dist/components/VirtualTable/index.d.ts +1 -0
- package/dist/components/VirtualTable/index.js +1 -1
- package/dist/components/cascader/cascader/ElCascader.vue.d.ts +3 -0
- package/dist/components/cascader/cascader/FgCascader.vue.d.ts +16 -4
- package/dist/components/cascader/cascader/cascader.d.ts +1 -0
- package/dist/components/cascader/index.js +1 -1
- package/dist/components/citySelect/demos/mockAddressTree.d.ts +8 -0
- package/dist/components/customInputV2/CustomInputV2.vue.d.ts +1 -1
- package/dist/components/customInputV2/index.js +1 -1
- package/dist/components/dragResizable/DragResizable.vue.d.ts +2 -0
- package/dist/components/dragResizable/index.js +1 -1
- package/dist/components/hSelect/demos/mockApi.d.ts +12 -0
- package/dist/components/hSelect/index.js +1 -1
- package/dist/components/hSelectAll/demos/mockApi.d.ts +10 -0
- package/dist/components/hSelectAll/index.js +1 -1
- package/dist/components/hSelectSJ/demos/mockApi.d.ts +11 -0
- package/dist/components/hSelectSJ/index.js +1 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.js +42 -46
- package/dist/components/selectAddress/demos/mockAddressTree.d.ts +7 -0
- package/dist/components/selectTimePicker/SelectTimePicker.vue.d.ts +1 -1
- package/dist/components/selectTree/demos/treeData.d.ts +9 -0
- package/dist/components/selectTree/index.js +1 -1
- package/dist/components/textCopy/index.js +1 -1
- package/dist/index-BRcBDlVs.js +68 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +145 -149
- package/dist/vue-virtual-scroller.esm-CH-jx4ri.js +1051 -0
- package/package.json +8 -8
- package/dist/DragResizable.vue_vue_type_style_index_0_lang-DYL6TUPE.js +0 -167
- package/dist/FgCascader.vue_vue_type_style_index_0_lang-OnqaEAao.js +0 -1807
- package/dist/SelectTree-C7lBZnZH.js +0 -306
- package/dist/SortTransfer.css +0 -1
- package/dist/SortTransfer.vue_vue_type_style_index_0_lang-C5OmBF3s.js +0 -153
- package/dist/TextCopy.vue_vue_type_script_setup_true_lang-DbhZGH_z.js +0 -29
- package/dist/TipInput-CIskitOV.js +0 -117
- package/dist/TipInput.css +0 -1
- package/dist/VirtualTable-BYTfwDC1.js +0 -353
- package/dist/components/sortTransfer/SortTransfer.vue.d.ts +0 -97
- package/dist/components/sortTransfer/index.d.ts +0 -1
- package/dist/components/sortTransfer/index.js +0 -4
- package/dist/components/tipInput/TipInput.vue.d.ts +0 -56
- package/dist/components/tipInput/index.d.ts +0 -1
- package/dist/components/tipInput/index.js +0 -4
- package/dist/debounce-BLrZUqsA.js +0 -84
- package/dist/index-BKzmtfeu.js +0 -72
- package/dist/isEqual-qYQTJBU6.js +0 -506
- package/dist/isObject-CO569sPG.js +0 -35
|
@@ -0,0 +1,1656 @@
|
|
|
1
|
+
import './FgCascader.css';var Xt = Object.defineProperty, Yt = Object.defineProperties;
|
|
2
|
+
var Qt = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var Me = Object.getOwnPropertySymbols;
|
|
4
|
+
var ut = Object.prototype.hasOwnProperty, dt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Ze = (e, t, n) => t in e ? Xt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, de = (e, t) => {
|
|
6
|
+
for (var n in t || (t = {}))
|
|
7
|
+
ut.call(t, n) && Ze(e, n, t[n]);
|
|
8
|
+
if (Me)
|
|
9
|
+
for (var n of Me(t))
|
|
10
|
+
dt.call(t, n) && Ze(e, n, t[n]);
|
|
11
|
+
return e;
|
|
12
|
+
}, xe = (e, t) => Yt(e, Qt(t));
|
|
13
|
+
var _e = (e, t) => {
|
|
14
|
+
var n = {};
|
|
15
|
+
for (var l in e)
|
|
16
|
+
ut.call(e, l) && t.indexOf(l) < 0 && (n[l] = e[l]);
|
|
17
|
+
if (e != null && Me)
|
|
18
|
+
for (var l of Me(e))
|
|
19
|
+
t.indexOf(l) < 0 && dt.call(e, l) && (n[l] = e[l]);
|
|
20
|
+
return n;
|
|
21
|
+
};
|
|
22
|
+
var V = (e, t, n) => Ze(e, typeof t != "symbol" ? t + "" : t, n);
|
|
23
|
+
var pt = (e, t, n) => new Promise((l, a) => {
|
|
24
|
+
var d = (m) => {
|
|
25
|
+
try {
|
|
26
|
+
y(n.next(m));
|
|
27
|
+
} catch (u) {
|
|
28
|
+
a(u);
|
|
29
|
+
}
|
|
30
|
+
}, r = (m) => {
|
|
31
|
+
try {
|
|
32
|
+
y(n.throw(m));
|
|
33
|
+
} catch (u) {
|
|
34
|
+
a(u);
|
|
35
|
+
}
|
|
36
|
+
}, y = (m) => m.done ? l(m.value) : Promise.resolve(m.value).then(d, r);
|
|
37
|
+
y((n = n.apply(e, t)).next());
|
|
38
|
+
});
|
|
39
|
+
import { getCurrentScope as en, onScopeDispose as tn, watch as Q, computed as S, toValue as ve, shallowRef as Et, getCurrentInstance as wt, onMounted as Re, warn as nn, defineComponent as Ce, h as Ge, inject as $t, resolveComponent as le, openBlock as $, createElementBlock as K, normalizeClass as F, createBlock as Z, withModifiers as $e, withCtx as H, createElementVNode as pe, createVNode as ne, createCommentVNode as he, Fragment as Ae, ref as P, normalizeStyle as Ie, createTextVNode as ln, toDisplayString as fe, provide as sn, reactive as an, onBeforeUpdate as on, nextTick as re, renderList as Oe, useAttrs as rn, unref as L, withDirectives as De, vShow as ft, renderSlot as At, withKeys as cn, vModelText as un, useSlots as dn, useModel as pn, onBeforeUnmount as fn, mergeProps as hn, mergeModels as ht, render as vt } from "vue";
|
|
40
|
+
import { p as Qe } from "./index-DIX8TpoT.js";
|
|
41
|
+
import { fromPairs as vn, isEqual as Le, flattenDeep as mn, cloneDeep as Lt, debounce as gn } from "lodash-unified";
|
|
42
|
+
import { ArrowRight as yn, Loading as Pt, Check as Tt, CircleClose as bn, ArrowDown as Nn } from "@element-plus/icons-vue";
|
|
43
|
+
import { useNamespace as be, ElIcon as Pe, ElRadio as Cn, ElCheckbox as kn, ElScrollbar as Vt, useLocale as Mt, UPDATE_MODEL_EVENT as ze, CHANGE_EVENT as Be, EVENT_CODE as Y, tagProps as Sn, useTooltipContentProps as En, CommonProps as wn, useSizeProp as $n, useFormItem as An, useFormSize as Ln, ElConfigProvider as Pn, ElTooltip as mt, ElInput as Tn, ElTag as gt, ClickOutside as Vn } from "element-plus";
|
|
44
|
+
import { b as Mn } from "./vue-virtual-scroller.esm-CH-jx4ri.js";
|
|
45
|
+
import { _ as et } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
46
|
+
Qe.env.NODE_ENV !== "production" && Object.freeze({});
|
|
47
|
+
Qe.env.NODE_ENV !== "production" && Object.freeze([]);
|
|
48
|
+
const xn = () => {
|
|
49
|
+
}, Dn = Object.prototype.hasOwnProperty, yt = (e, t) => Dn.call(e, t), On = Array.isArray, Te = (e) => typeof e == "function", tt = (e) => typeof e == "string", We = (e) => e !== null && typeof e == "object", Fn = (e) => (We(e) || Te(e)) && Te(e.then) && Te(e.catch), In = (e) => {
|
|
50
|
+
const t = /* @__PURE__ */ Object.create(null);
|
|
51
|
+
return ((n) => t[n] || (t[n] = e(n)));
|
|
52
|
+
}, zn = In((e) => e.charAt(0).toUpperCase() + e.slice(1));
|
|
53
|
+
function xt(e, t) {
|
|
54
|
+
return en() ? (tn(e, t), !0) : !1;
|
|
55
|
+
}
|
|
56
|
+
const nt = typeof window != "undefined" && typeof document != "undefined";
|
|
57
|
+
typeof WorkerGlobalScope != "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
58
|
+
const Bn = (e) => e != null;
|
|
59
|
+
function Hn(e) {
|
|
60
|
+
return Array.isArray(e) ? e : [e];
|
|
61
|
+
}
|
|
62
|
+
const lt = nt ? window : void 0;
|
|
63
|
+
function He(e) {
|
|
64
|
+
var t;
|
|
65
|
+
const n = ve(e);
|
|
66
|
+
return (t = n == null ? void 0 : n.$el) !== null && t !== void 0 ? t : n;
|
|
67
|
+
}
|
|
68
|
+
// @__NO_SIDE_EFFECTS__
|
|
69
|
+
function Rn() {
|
|
70
|
+
const e = Et(!1), t = wt();
|
|
71
|
+
return t && Re(() => {
|
|
72
|
+
e.value = !0;
|
|
73
|
+
}, t), e;
|
|
74
|
+
}
|
|
75
|
+
// @__NO_SIDE_EFFECTS__
|
|
76
|
+
function Dt(e) {
|
|
77
|
+
const t = /* @__PURE__ */ Rn();
|
|
78
|
+
return S(() => (t.value, !!e()));
|
|
79
|
+
}
|
|
80
|
+
function Wn(e, t, n = {}) {
|
|
81
|
+
const g = n, { window: l = lt } = g, a = _e(g, ["window"]);
|
|
82
|
+
let d;
|
|
83
|
+
const r = /* @__PURE__ */ Dt(() => l && "MutationObserver" in l), y = () => {
|
|
84
|
+
d && (d.disconnect(), d = void 0);
|
|
85
|
+
}, m = Q(S(() => {
|
|
86
|
+
const C = Hn(ve(e)).map(He).filter(Bn);
|
|
87
|
+
return new Set(C);
|
|
88
|
+
}), (C) => {
|
|
89
|
+
y(), r.value && C.size && (d = new MutationObserver(t), C.forEach((E) => d.observe(E, a)));
|
|
90
|
+
}, {
|
|
91
|
+
immediate: !0,
|
|
92
|
+
flush: "post"
|
|
93
|
+
}), u = () => d == null ? void 0 : d.takeRecords(), f = () => {
|
|
94
|
+
m(), y();
|
|
95
|
+
};
|
|
96
|
+
return xt(f), {
|
|
97
|
+
isSupported: r,
|
|
98
|
+
stop: f,
|
|
99
|
+
takeRecords: u
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function qn(e, t, n = {}) {
|
|
103
|
+
const { window: l = lt, initialValue: a, observe: d = !1 } = n, r = Et(a), y = S(() => {
|
|
104
|
+
var u;
|
|
105
|
+
return He(t) || (l == null || (u = l.document) === null || u === void 0 ? void 0 : u.documentElement);
|
|
106
|
+
});
|
|
107
|
+
function m() {
|
|
108
|
+
const u = ve(e), f = ve(y);
|
|
109
|
+
if (f && l && u) {
|
|
110
|
+
var g;
|
|
111
|
+
r.value = ((g = l.getComputedStyle(f).getPropertyValue(u)) === null || g === void 0 ? void 0 : g.trim()) || r.value || a;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return d && Wn(y, m, {
|
|
115
|
+
attributeFilter: ["style", "class"],
|
|
116
|
+
window: l
|
|
117
|
+
}), Q([y, () => ve(e)], (u, f) => {
|
|
118
|
+
f[0] && f[1] && f[0].style.removeProperty(f[1]), m();
|
|
119
|
+
}, { immediate: !0 }), Q([r, y], ([u, f]) => {
|
|
120
|
+
const g = ve(e);
|
|
121
|
+
f != null && f.style && g && (u == null ? f.style.removeProperty(g) : f.style.setProperty(g, u));
|
|
122
|
+
}, { immediate: !0 }), r;
|
|
123
|
+
}
|
|
124
|
+
function Kn(e, t, n = {}) {
|
|
125
|
+
const f = n, { window: l = lt } = f, a = _e(f, ["window"]);
|
|
126
|
+
let d;
|
|
127
|
+
const r = /* @__PURE__ */ Dt(() => l && "ResizeObserver" in l), y = () => {
|
|
128
|
+
d && (d.disconnect(), d = void 0);
|
|
129
|
+
}, m = Q(S(() => {
|
|
130
|
+
const g = ve(e);
|
|
131
|
+
return Array.isArray(g) ? g.map((C) => He(C)) : [He(g)];
|
|
132
|
+
}), (g) => {
|
|
133
|
+
if (y(), r.value && l) {
|
|
134
|
+
d = new ResizeObserver(t);
|
|
135
|
+
for (const C of g) C && d.observe(C, a);
|
|
136
|
+
}
|
|
137
|
+
}, {
|
|
138
|
+
immediate: !0,
|
|
139
|
+
flush: "post"
|
|
140
|
+
}), u = () => {
|
|
141
|
+
y(), m();
|
|
142
|
+
};
|
|
143
|
+
return xt(u), {
|
|
144
|
+
isSupported: r,
|
|
145
|
+
stop: u
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const Ot = (e) => !e.getAttribute("aria-owns"), Ft = (e, t, n) => {
|
|
149
|
+
const { parentNode: l } = e;
|
|
150
|
+
if (!l) return null;
|
|
151
|
+
const a = l.querySelectorAll(n), d = Array.prototype.indexOf.call(a, e);
|
|
152
|
+
return a[d + t] || null;
|
|
153
|
+
}, Fe = (e) => {
|
|
154
|
+
e && (e.focus(), !Ot(e) && e.click());
|
|
155
|
+
}, jn = (e) => e === void 0, Un = (e) => typeof e == "boolean", Jn = (e) => typeof e == "number", Xe = (e) => !e && e !== 0 || On(e) && e.length === 0 || We(e) && !Object.keys(e).length, Zn = (e) => tt(e) ? !Number.isNaN(Number(e)) : !1, bt = (e) => zn(e);
|
|
156
|
+
class _n extends Error {
|
|
157
|
+
constructor(t) {
|
|
158
|
+
super(t), this.name = "ElementPlusError";
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function It(e, t) {
|
|
162
|
+
if (Qe.env.NODE_ENV !== "production") {
|
|
163
|
+
const n = tt(e) ? new _n(`[${e}] ${t}`) : e;
|
|
164
|
+
console.warn(n);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const Gn = "utils/dom/style";
|
|
168
|
+
function Xn(e, t = "px") {
|
|
169
|
+
if (!e) return "";
|
|
170
|
+
if (Jn(e) || Zn(e))
|
|
171
|
+
return `${e}${t}`;
|
|
172
|
+
if (tt(e))
|
|
173
|
+
return e;
|
|
174
|
+
It(Gn, "binding value must be a string or number");
|
|
175
|
+
}
|
|
176
|
+
const zt = "__epPropKey", ye = (e) => e, Yn = (e) => We(e) && !!e[zt], Qn = (e, t) => {
|
|
177
|
+
if (!We(e) || Yn(e)) return e;
|
|
178
|
+
const { values: n, required: l, default: a, type: d, validator: r } = e, m = {
|
|
179
|
+
type: d,
|
|
180
|
+
required: !!l,
|
|
181
|
+
validator: n || r ? (u) => {
|
|
182
|
+
let f = !1, g = [];
|
|
183
|
+
if (n && (g = Array.from(n), yt(e, "default") && g.push(a), f || (f = g.includes(u))), r && (f || (f = r(u))), !f && g.length > 0) {
|
|
184
|
+
const C = [...new Set(g)].map((E) => JSON.stringify(E)).join(", ");
|
|
185
|
+
nn(
|
|
186
|
+
`Invalid prop: validation failed${t ? ` for prop "${t}"` : ""}. Expected one of [${C}], got value ${JSON.stringify(
|
|
187
|
+
u
|
|
188
|
+
)}.`
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
return f;
|
|
192
|
+
} : void 0,
|
|
193
|
+
[zt]: !0
|
|
194
|
+
};
|
|
195
|
+
return yt(e, "default") && (m.default = a), m;
|
|
196
|
+
}, Bt = (e) => vn(
|
|
197
|
+
Object.entries(e).map(([t, n]) => [
|
|
198
|
+
t,
|
|
199
|
+
Qn(n, t)
|
|
200
|
+
])
|
|
201
|
+
), Nt = (e) => [...new Set(e)], Ct = (e) => !e && e !== 0 ? [] : Array.isArray(e) ? e : [e], el = (e) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e), tl = () => Math.floor(Math.random() * 1e4), nl = Ce({
|
|
202
|
+
name: "NodeContent",
|
|
203
|
+
setup() {
|
|
204
|
+
return {
|
|
205
|
+
ns: be("cascader-node")
|
|
206
|
+
};
|
|
207
|
+
},
|
|
208
|
+
render() {
|
|
209
|
+
const { ns: e } = this, { node: t, panel: n } = this.$parent, { data: l, label: a } = t, { renderLabelFn: d } = n;
|
|
210
|
+
return Ge(
|
|
211
|
+
"span",
|
|
212
|
+
{ class: e.e("label") },
|
|
213
|
+
d ? d({ node: t, data: l }) : a
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
}), st = /* @__PURE__ */ Symbol(), ll = Ce({
|
|
217
|
+
name: "ElCascaderNode",
|
|
218
|
+
components: {
|
|
219
|
+
ElCheckbox: kn,
|
|
220
|
+
ElRadio: Cn,
|
|
221
|
+
NodeContent: nl,
|
|
222
|
+
ElIcon: Pe,
|
|
223
|
+
Check: Tt,
|
|
224
|
+
Loading: Pt,
|
|
225
|
+
ArrowRight: yn
|
|
226
|
+
},
|
|
227
|
+
props: {
|
|
228
|
+
node: {
|
|
229
|
+
type: Object,
|
|
230
|
+
required: !0
|
|
231
|
+
},
|
|
232
|
+
menuId: String
|
|
233
|
+
},
|
|
234
|
+
emits: ["expand"],
|
|
235
|
+
setup(e, { emit: t }) {
|
|
236
|
+
const n = $t(st), l = be("cascader-node"), a = S(() => n.isHoverMenu), d = S(() => n.config.multiple), r = S(() => n.config.checkStrictly), y = S(() => {
|
|
237
|
+
var A;
|
|
238
|
+
return (A = n.checkedNodes[0]) == null ? void 0 : A.uid;
|
|
239
|
+
}), m = S(() => e.node.isDisabled), u = S(() => e.node.isLeaf), f = S(
|
|
240
|
+
() => r.value && !u.value || !m.value
|
|
241
|
+
), g = S(() => E(n.expandingNode)), C = S(
|
|
242
|
+
() => r.value && n.checkedNodes.some(E)
|
|
243
|
+
), E = (A) => {
|
|
244
|
+
var z;
|
|
245
|
+
const { level: I, uid: x } = e.node;
|
|
246
|
+
return ((z = A == null ? void 0 : A.pathNodes[I - 1]) == null ? void 0 : z.uid) === x;
|
|
247
|
+
}, _ = () => {
|
|
248
|
+
g.value || n.expandNode(e.node);
|
|
249
|
+
}, W = (A) => {
|
|
250
|
+
const { node: I } = e;
|
|
251
|
+
A !== I.checked && n.handleCheckChange(I, A);
|
|
252
|
+
}, ee = () => {
|
|
253
|
+
n.lazyLoad(e.node, () => {
|
|
254
|
+
u.value || _();
|
|
255
|
+
});
|
|
256
|
+
}, T = (A) => {
|
|
257
|
+
a.value && (B(), !u.value && t("expand", A));
|
|
258
|
+
}, B = () => {
|
|
259
|
+
const { node: A } = e;
|
|
260
|
+
!f.value || A.loading || (A.loaded ? _() : ee());
|
|
261
|
+
}, D = () => {
|
|
262
|
+
a.value && !u.value || (u.value && !m.value && !r.value && !d.value ? O(!0) : B());
|
|
263
|
+
}, j = (A) => {
|
|
264
|
+
r.value ? (W(A), e.node.loaded && _()) : O(A);
|
|
265
|
+
}, O = (A) => {
|
|
266
|
+
e.node.loaded ? (W(A), !r.value && _()) : ee();
|
|
267
|
+
};
|
|
268
|
+
return {
|
|
269
|
+
panel: n,
|
|
270
|
+
isHoverMenu: a,
|
|
271
|
+
multiple: d,
|
|
272
|
+
checkStrictly: r,
|
|
273
|
+
checkedNodeId: y,
|
|
274
|
+
isDisabled: m,
|
|
275
|
+
isLeaf: u,
|
|
276
|
+
expandable: f,
|
|
277
|
+
inExpandingPath: g,
|
|
278
|
+
inCheckedPath: C,
|
|
279
|
+
ns: l,
|
|
280
|
+
handleHoverExpand: T,
|
|
281
|
+
handleExpand: B,
|
|
282
|
+
handleClick: D,
|
|
283
|
+
handleCheck: O,
|
|
284
|
+
handleSelectCheck: j
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
}), sl = ["id", "aria-haspopup", "aria-owns", "aria-expanded", "tabindex"];
|
|
288
|
+
function al(e, t, n, l, a, d) {
|
|
289
|
+
const r = le("el-checkbox"), y = le("el-radio"), m = le("check"), u = le("el-icon"), f = le("node-content"), g = le("loading"), C = le("arrow-right");
|
|
290
|
+
return $(), K("li", {
|
|
291
|
+
id: `${e.menuId}-${e.node.uid}`,
|
|
292
|
+
role: "menuitem",
|
|
293
|
+
"aria-haspopup": !e.isLeaf,
|
|
294
|
+
"aria-owns": e.isLeaf ? null : e.menuId,
|
|
295
|
+
"aria-expanded": e.inExpandingPath,
|
|
296
|
+
tabindex: e.expandable ? -1 : void 0,
|
|
297
|
+
class: F([
|
|
298
|
+
e.ns.b(),
|
|
299
|
+
e.ns.is("selectable", e.checkStrictly),
|
|
300
|
+
e.ns.is("active", e.node.checked),
|
|
301
|
+
e.ns.is("disabled", !e.expandable),
|
|
302
|
+
e.inExpandingPath && "in-active-path",
|
|
303
|
+
e.inCheckedPath && "in-checked-path"
|
|
304
|
+
]),
|
|
305
|
+
onMouseenter: t[2] || (t[2] = (...E) => e.handleHoverExpand && e.handleHoverExpand(...E)),
|
|
306
|
+
onFocus: t[3] || (t[3] = (...E) => e.handleHoverExpand && e.handleHoverExpand(...E)),
|
|
307
|
+
onClick: t[4] || (t[4] = (...E) => e.handleClick && e.handleClick(...E))
|
|
308
|
+
}, [
|
|
309
|
+
e.multiple ? ($(), Z(r, {
|
|
310
|
+
key: 0,
|
|
311
|
+
"model-value": e.node.checked,
|
|
312
|
+
indeterminate: e.node.indeterminate,
|
|
313
|
+
disabled: e.isDisabled,
|
|
314
|
+
onClick: t[0] || (t[0] = $e(() => {
|
|
315
|
+
}, ["stop"])),
|
|
316
|
+
"onUpdate:modelValue": e.handleSelectCheck
|
|
317
|
+
}, null, 8, ["model-value", "indeterminate", "disabled", "onUpdate:modelValue"])) : e.checkStrictly ? ($(), Z(y, {
|
|
318
|
+
key: 1,
|
|
319
|
+
"model-value": e.checkedNodeId,
|
|
320
|
+
label: e.node.uid,
|
|
321
|
+
disabled: e.isDisabled,
|
|
322
|
+
"onUpdate:modelValue": e.handleSelectCheck,
|
|
323
|
+
onClick: t[1] || (t[1] = $e(() => {
|
|
324
|
+
}, ["stop"]))
|
|
325
|
+
}, {
|
|
326
|
+
default: H(() => [...t[5] || (t[5] = [
|
|
327
|
+
pe("span", null, null, -1)
|
|
328
|
+
])]),
|
|
329
|
+
_: 1
|
|
330
|
+
}, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : e.isLeaf && e.node.checked ? ($(), Z(u, {
|
|
331
|
+
key: 2,
|
|
332
|
+
class: F(e.ns.e("prefix"))
|
|
333
|
+
}, {
|
|
334
|
+
default: H(() => [
|
|
335
|
+
ne(m)
|
|
336
|
+
]),
|
|
337
|
+
_: 1
|
|
338
|
+
}, 8, ["class"])) : he("", !0),
|
|
339
|
+
ne(f),
|
|
340
|
+
e.isLeaf ? he("", !0) : ($(), K(Ae, { key: 3 }, [
|
|
341
|
+
e.node.loading ? ($(), Z(u, {
|
|
342
|
+
key: 0,
|
|
343
|
+
class: F([e.ns.is("loading"), e.ns.e("postfix")])
|
|
344
|
+
}, {
|
|
345
|
+
default: H(() => [
|
|
346
|
+
ne(g)
|
|
347
|
+
]),
|
|
348
|
+
_: 1
|
|
349
|
+
}, 8, ["class"])) : ($(), Z(u, {
|
|
350
|
+
key: 1,
|
|
351
|
+
class: F(["arrow-right", e.ns.e("postfix")])
|
|
352
|
+
}, {
|
|
353
|
+
default: H(() => [
|
|
354
|
+
ne(C)
|
|
355
|
+
]),
|
|
356
|
+
_: 1
|
|
357
|
+
}, 8, ["class"]))
|
|
358
|
+
], 64))
|
|
359
|
+
], 42, sl);
|
|
360
|
+
}
|
|
361
|
+
const ol = /* @__PURE__ */ et(ll, [["render", al]]), rl = (e, t = "14px sans-serif") => {
|
|
362
|
+
const l = document.createElement("canvas").getContext("2d");
|
|
363
|
+
return l ? (l.font = t, l.measureText(e).width) : 0;
|
|
364
|
+
}, il = Ce({
|
|
365
|
+
name: "CustomCascaderMenu",
|
|
366
|
+
components: {
|
|
367
|
+
Loading: Pt,
|
|
368
|
+
ElIcon: Pe,
|
|
369
|
+
ElScrollbar: Vt,
|
|
370
|
+
RecycleScroller: Mn,
|
|
371
|
+
CustomCascaderNode: ol
|
|
372
|
+
},
|
|
373
|
+
props: {
|
|
374
|
+
nodes: {
|
|
375
|
+
type: Array,
|
|
376
|
+
required: !0
|
|
377
|
+
},
|
|
378
|
+
index: {
|
|
379
|
+
type: Number,
|
|
380
|
+
required: !0
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
setup(e) {
|
|
384
|
+
const t = wt(), n = be("cascader-menu"), { t: l } = Mt(), a = tl();
|
|
385
|
+
let d = null, r = null;
|
|
386
|
+
const y = $t(st), m = P(null), u = S(() => !e.nodes.length), f = S(() => !y.initialLoaded), g = S(() => `cascader-menu-${a}-${e.index}`), C = S(() => {
|
|
387
|
+
if (!e.nodes.length) return 180;
|
|
388
|
+
const T = 110;
|
|
389
|
+
let B = 0;
|
|
390
|
+
for (const D of e.nodes) {
|
|
391
|
+
const j = D.label || "", O = rl(String(j));
|
|
392
|
+
O > B && (B = O);
|
|
393
|
+
}
|
|
394
|
+
return Math.max(180, Math.ceil(B + T));
|
|
395
|
+
}), E = (T) => {
|
|
396
|
+
d = T.target;
|
|
397
|
+
}, _ = (T) => {
|
|
398
|
+
if (!(!y.isHoverMenu || !d || !m.value))
|
|
399
|
+
if (d.contains(T.target)) {
|
|
400
|
+
W();
|
|
401
|
+
const B = t.vnode.el, { left: D } = B.getBoundingClientRect(), { offsetWidth: j, offsetHeight: O } = B, A = T.clientX - D, I = d.offsetTop, x = I + d.offsetHeight;
|
|
402
|
+
m.value.innerHTML = `
|
|
403
|
+
<path style="pointer-events: auto;" fill="transparent" d="M${A} ${I} L${j} 0 V${I} Z" />
|
|
404
|
+
<path style="pointer-events: auto;" fill="transparent" d="M${A} ${x} L${j} ${O} V${x} Z" />
|
|
405
|
+
`;
|
|
406
|
+
} else r || (r = window.setTimeout(ee, y.config.hoverThreshold));
|
|
407
|
+
}, W = () => {
|
|
408
|
+
r && (clearTimeout(r), r = null);
|
|
409
|
+
}, ee = () => {
|
|
410
|
+
m.value && (m.value.innerHTML = "", W());
|
|
411
|
+
};
|
|
412
|
+
return {
|
|
413
|
+
ns: n,
|
|
414
|
+
panel: y,
|
|
415
|
+
hoverZone: m,
|
|
416
|
+
isEmpty: u,
|
|
417
|
+
isLoading: f,
|
|
418
|
+
menuId: g,
|
|
419
|
+
menuWidth: C,
|
|
420
|
+
t: l,
|
|
421
|
+
handleExpand: E,
|
|
422
|
+
handleMouseMove: _,
|
|
423
|
+
clearHoverZone: ee
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
function cl(e, t, n, l, a, d) {
|
|
428
|
+
const r = le("custom-cascader-node"), y = le("loading"), m = le("el-icon"), u = le("RecycleScroller");
|
|
429
|
+
return e.nodes.length ? ($(), Z(u, {
|
|
430
|
+
key: e.menuId,
|
|
431
|
+
tag: "ul",
|
|
432
|
+
role: "menu",
|
|
433
|
+
class: F([e.ns.b(), "cascader-virtual-list"]),
|
|
434
|
+
"wrap-class": e.ns.e("wrap"),
|
|
435
|
+
"view-class": [e.ns.e("list"), e.ns.is("empty", e.isEmpty)],
|
|
436
|
+
style: Ie({ minWidth: e.menuWidth + "px" }),
|
|
437
|
+
items: e.nodes,
|
|
438
|
+
"item-size": 34,
|
|
439
|
+
"key-field": "uid",
|
|
440
|
+
onMousemove: e.handleMouseMove,
|
|
441
|
+
onMouseleave: e.clearHoverZone
|
|
442
|
+
}, {
|
|
443
|
+
default: H(({ item: f }) => {
|
|
444
|
+
var g;
|
|
445
|
+
return [
|
|
446
|
+
ne(r, {
|
|
447
|
+
node: f,
|
|
448
|
+
"menu-id": e.menuId,
|
|
449
|
+
onExpand: e.handleExpand
|
|
450
|
+
}, null, 8, ["node", "menu-id", "onExpand"]),
|
|
451
|
+
e.isLoading ? ($(), K("div", {
|
|
452
|
+
key: 0,
|
|
453
|
+
class: F(e.ns.e("empty-text"))
|
|
454
|
+
}, [
|
|
455
|
+
ne(m, {
|
|
456
|
+
size: "14",
|
|
457
|
+
class: F(e.ns.is("loading"))
|
|
458
|
+
}, {
|
|
459
|
+
default: H(() => [
|
|
460
|
+
ne(y)
|
|
461
|
+
]),
|
|
462
|
+
_: 1
|
|
463
|
+
}, 8, ["class"]),
|
|
464
|
+
ln(" " + fe(e.t("el.cascader.loading")), 1)
|
|
465
|
+
], 2)) : e.isEmpty ? ($(), K("div", {
|
|
466
|
+
key: 1,
|
|
467
|
+
class: F(e.ns.e("empty-text"))
|
|
468
|
+
}, fe(e.t("el.cascader.noData")), 3)) : (g = e.panel) != null && g.isHoverMenu ? ($(), K("svg", {
|
|
469
|
+
key: 2,
|
|
470
|
+
ref: "hoverZone",
|
|
471
|
+
class: F(e.ns.e("hover-zone"))
|
|
472
|
+
}, null, 2)) : he("", !0)
|
|
473
|
+
];
|
|
474
|
+
}),
|
|
475
|
+
_: 1
|
|
476
|
+
}, 8, ["class", "wrap-class", "view-class", "style", "items", "onMousemove", "onMouseleave"])) : he("", !0);
|
|
477
|
+
}
|
|
478
|
+
const ul = /* @__PURE__ */ et(il, [["render", cl], ["__scopeId", "data-v-a251fab9"]]);
|
|
479
|
+
let dl = 0;
|
|
480
|
+
const pl = (e) => {
|
|
481
|
+
const t = [e];
|
|
482
|
+
let { parent: n } = e;
|
|
483
|
+
for (; n; )
|
|
484
|
+
t.unshift(n), n = n.parent;
|
|
485
|
+
return t;
|
|
486
|
+
};
|
|
487
|
+
class Ne {
|
|
488
|
+
constructor(t, n, l, a = !1) {
|
|
489
|
+
V(this, "data");
|
|
490
|
+
V(this, "config");
|
|
491
|
+
V(this, "parent");
|
|
492
|
+
V(this, "root");
|
|
493
|
+
V(this, "uid", dl++);
|
|
494
|
+
V(this, "level");
|
|
495
|
+
V(this, "value");
|
|
496
|
+
V(this, "label");
|
|
497
|
+
V(this, "pathNodes");
|
|
498
|
+
V(this, "pathValues");
|
|
499
|
+
V(this, "pathLabels");
|
|
500
|
+
V(this, "childrenData");
|
|
501
|
+
V(this, "children");
|
|
502
|
+
V(this, "text");
|
|
503
|
+
V(this, "loaded");
|
|
504
|
+
/**
|
|
505
|
+
* Is it checked
|
|
506
|
+
*
|
|
507
|
+
* @default false
|
|
508
|
+
*/
|
|
509
|
+
V(this, "checked", !1);
|
|
510
|
+
/**
|
|
511
|
+
* Used to indicate the intermediate state of unchecked and fully checked child nodes
|
|
512
|
+
*
|
|
513
|
+
* @default false
|
|
514
|
+
*/
|
|
515
|
+
V(this, "indeterminate", !1);
|
|
516
|
+
/**
|
|
517
|
+
* Loading Status
|
|
518
|
+
*
|
|
519
|
+
* @default false
|
|
520
|
+
*/
|
|
521
|
+
V(this, "loading", !1);
|
|
522
|
+
this.data = t, this.config = n, this.parent = l, this.root = a;
|
|
523
|
+
const { value: d, label: r, children: y } = n, m = t[y], u = pl(this);
|
|
524
|
+
this.level = a ? 0 : l ? l.level + 1 : 1, this.value = t[d], this.label = t[r], this.pathNodes = u, this.pathValues = u.map((f) => f.value), this.pathLabels = u.map((f) => f.label), this.childrenData = m, this.children = (m || []).map(
|
|
525
|
+
(f) => new Ne(f, n, this)
|
|
526
|
+
), this.loaded = !n.lazy || this.isLeaf || !Xe(m);
|
|
527
|
+
}
|
|
528
|
+
get isDisabled() {
|
|
529
|
+
const { data: t, parent: n, config: l } = this, { disabled: a, checkStrictly: d } = l;
|
|
530
|
+
return (Te(a) ? a(t, this) : !!t[a]) || !d && (n == null ? void 0 : n.isDisabled);
|
|
531
|
+
}
|
|
532
|
+
get isLeaf() {
|
|
533
|
+
const { data: t, config: n, childrenData: l, loaded: a } = this, { lazy: d, leaf: r } = n, y = Te(r) ? r(t, this) : t[r];
|
|
534
|
+
return jn(y) ? d && !a ? !1 : !(Array.isArray(l) && l.length) : !!y;
|
|
535
|
+
}
|
|
536
|
+
get valueByOption() {
|
|
537
|
+
return this.config.emitPath ? this.pathValues : this.value;
|
|
538
|
+
}
|
|
539
|
+
appendChild(t) {
|
|
540
|
+
const { childrenData: n, children: l } = this, a = new Ne(t, this.config, this);
|
|
541
|
+
return Array.isArray(n) ? n.push(t) : this.childrenData = [t], l.push(a), a;
|
|
542
|
+
}
|
|
543
|
+
calcText(t, n) {
|
|
544
|
+
const l = t ? this.pathLabels.join(n) : this.label;
|
|
545
|
+
return this.text = l, l;
|
|
546
|
+
}
|
|
547
|
+
broadcast(t, ...n) {
|
|
548
|
+
const l = `onParent${bt(t)}`;
|
|
549
|
+
this.children.forEach((a) => {
|
|
550
|
+
a && (a.broadcast(t, ...n), a[l] && a[l](...n));
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
emit(t, ...n) {
|
|
554
|
+
const { parent: l } = this, a = `onChild${bt(t)}`;
|
|
555
|
+
l && (l[a] && l[a](...n), l.emit(t, ...n));
|
|
556
|
+
}
|
|
557
|
+
onParentCheck(t) {
|
|
558
|
+
this.isDisabled || this.setCheckState(t);
|
|
559
|
+
}
|
|
560
|
+
onChildCheck() {
|
|
561
|
+
const { children: t } = this, n = t.filter((a) => !a.isDisabled), l = n.length ? n.every((a) => a.checked) : !1;
|
|
562
|
+
this.setCheckState(l);
|
|
563
|
+
}
|
|
564
|
+
setCheckState(t) {
|
|
565
|
+
const n = this.children.length, l = this.children.reduce((a, d) => {
|
|
566
|
+
const r = d.checked ? 1 : d.indeterminate ? 0.5 : 0;
|
|
567
|
+
return a + r;
|
|
568
|
+
}, 0);
|
|
569
|
+
this.checked = this.loaded && this.children.filter((a) => !a.isDisabled).every((a) => a.loaded && a.checked) && t, this.indeterminate = this.loaded && l !== n && l > 0;
|
|
570
|
+
}
|
|
571
|
+
doCheck(t) {
|
|
572
|
+
if (this.checked === t) return;
|
|
573
|
+
const { checkStrictly: n, multiple: l } = this.config;
|
|
574
|
+
n || !l ? this.checked = t : (this.broadcast("check", t), this.setCheckState(t), this.emit("check"));
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
const Ye = (e, t) => e.reduce((n, l) => (l.isLeaf ? n.push(l) : (!t && n.push(l), n = n.concat(Ye(l.children, t))), n), []);
|
|
578
|
+
class kt {
|
|
579
|
+
constructor(t, n) {
|
|
580
|
+
V(this, "config");
|
|
581
|
+
V(this, "nodes");
|
|
582
|
+
V(this, "allNodes");
|
|
583
|
+
V(this, "leafNodes");
|
|
584
|
+
V(this, "valueNodeMap");
|
|
585
|
+
V(this, "pathNodeMap");
|
|
586
|
+
this.config = n;
|
|
587
|
+
const l = (t || []).map((a) => new Ne(a, this.config));
|
|
588
|
+
this.nodes = l, this.allNodes = Ye(l, !1), this.leafNodes = Ye(l, !0), this.valueNodeMap = /* @__PURE__ */ new Map(), this.pathNodeMap = /* @__PURE__ */ new Map(), this.allNodes.forEach((a) => this.cacheNode(a));
|
|
589
|
+
}
|
|
590
|
+
cacheNode(t) {
|
|
591
|
+
this.valueNodeMap.has(t.value) || this.valueNodeMap.set(t.value, t), this.pathNodeMap.set(JSON.stringify(t.pathValues), t);
|
|
592
|
+
}
|
|
593
|
+
getNodes() {
|
|
594
|
+
return this.nodes;
|
|
595
|
+
}
|
|
596
|
+
getFlattedNodes(t) {
|
|
597
|
+
return t ? this.leafNodes : this.allNodes;
|
|
598
|
+
}
|
|
599
|
+
appendNode(t, n) {
|
|
600
|
+
const l = n ? n.appendChild(t) : new Ne(t, this.config);
|
|
601
|
+
n || this.nodes.push(l), this.allNodes.push(l), l.isLeaf && this.leafNodes.push(l), this.cacheNode(l);
|
|
602
|
+
}
|
|
603
|
+
appendNodes(t, n) {
|
|
604
|
+
t.forEach((l) => this.appendNode(l, n));
|
|
605
|
+
}
|
|
606
|
+
// when checkStrictly, leaf node first
|
|
607
|
+
getNodeByValue(t, n = !1) {
|
|
608
|
+
if (!t && t !== 0) return null;
|
|
609
|
+
if (Array.isArray(t)) {
|
|
610
|
+
const a = this.pathNodeMap.get(JSON.stringify(t));
|
|
611
|
+
if (a) return a;
|
|
612
|
+
} else {
|
|
613
|
+
const a = this.valueNodeMap.get(t);
|
|
614
|
+
if (a) return a;
|
|
615
|
+
}
|
|
616
|
+
return this.getFlattedNodes(n).find(
|
|
617
|
+
(a) => Le(a.value, t) || Le(a.pathValues, t)
|
|
618
|
+
) || null;
|
|
619
|
+
}
|
|
620
|
+
getSameNode(t) {
|
|
621
|
+
return t && this.getFlattedNodes(!1).find(
|
|
622
|
+
({ value: l, level: a }) => Le(t.value, l) && t.level === a
|
|
623
|
+
) || null;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
const fl = Bt({
|
|
627
|
+
/**
|
|
628
|
+
* @description specify which key of node object is used as the node's value
|
|
629
|
+
*/
|
|
630
|
+
modelValue: {
|
|
631
|
+
type: ye([Number, String, Array])
|
|
632
|
+
},
|
|
633
|
+
/**
|
|
634
|
+
* @description data of the options, the key of `value` and `label` can be customize by `CascaderProps`.
|
|
635
|
+
*/
|
|
636
|
+
options: {
|
|
637
|
+
type: ye(Array),
|
|
638
|
+
default: () => []
|
|
639
|
+
},
|
|
640
|
+
/**
|
|
641
|
+
* @description configuration options, see the following `CascaderProps` table.
|
|
642
|
+
*/
|
|
643
|
+
props: {
|
|
644
|
+
type: ye(Object),
|
|
645
|
+
default: () => ({})
|
|
646
|
+
}
|
|
647
|
+
}), hl = {
|
|
648
|
+
/**
|
|
649
|
+
* @description trigger mode of expanding options
|
|
650
|
+
*/
|
|
651
|
+
expandTrigger: "click",
|
|
652
|
+
/**
|
|
653
|
+
* @description whether multiple selection is enabled
|
|
654
|
+
*/
|
|
655
|
+
multiple: !1,
|
|
656
|
+
/**
|
|
657
|
+
* @description whether checked state of a node not affects its parent and child nodes
|
|
658
|
+
*/
|
|
659
|
+
checkStrictly: !1,
|
|
660
|
+
// whether all nodes can be selected
|
|
661
|
+
/**
|
|
662
|
+
* @description when checked nodes change, whether to emit an array of node's path, if false, only emit the value of node.
|
|
663
|
+
*/
|
|
664
|
+
emitPath: !0,
|
|
665
|
+
// wether to emit an array of all levels value in which node is located
|
|
666
|
+
/**
|
|
667
|
+
* @description whether to dynamic load child nodes, use with `lazyload` attribute
|
|
668
|
+
*/
|
|
669
|
+
lazy: !1,
|
|
670
|
+
/**
|
|
671
|
+
* @description method for loading child nodes data, only works when `lazy` is true
|
|
672
|
+
*/
|
|
673
|
+
lazyLoad: xn,
|
|
674
|
+
/**
|
|
675
|
+
* @description specify which key of node object is used as the node's value
|
|
676
|
+
*/
|
|
677
|
+
value: "value",
|
|
678
|
+
/**
|
|
679
|
+
* @description specify which key of node object is used as the node's label
|
|
680
|
+
*/
|
|
681
|
+
label: "label",
|
|
682
|
+
/**
|
|
683
|
+
* @description specify which key of node object is used as the node's children
|
|
684
|
+
*/
|
|
685
|
+
children: "children",
|
|
686
|
+
/**
|
|
687
|
+
* @description specify which key of node object is used as the node's leaf
|
|
688
|
+
*/
|
|
689
|
+
leaf: "leaf",
|
|
690
|
+
/**
|
|
691
|
+
* @description specify which key of node object is used as the node's disabled
|
|
692
|
+
*/
|
|
693
|
+
disabled: "disabled",
|
|
694
|
+
/**
|
|
695
|
+
* @description hover threshold of expanding options
|
|
696
|
+
*/
|
|
697
|
+
hoverThreshold: 500
|
|
698
|
+
}, vl = (e) => S(() => de(de({}, hl), e.props)), St = (e) => {
|
|
699
|
+
if (!e) return 0;
|
|
700
|
+
const t = e.id.split("-");
|
|
701
|
+
return Number(t[t.length - 2]);
|
|
702
|
+
}, ml = (e) => {
|
|
703
|
+
if (!e) return;
|
|
704
|
+
const t = e.querySelector("input");
|
|
705
|
+
t ? t.click() : Ot(e) && e.click();
|
|
706
|
+
}, gl = (e, t) => {
|
|
707
|
+
const n = t.slice(0), l = n.map((d) => d.uid), a = e.reduce((d, r) => {
|
|
708
|
+
const y = l.indexOf(r.uid);
|
|
709
|
+
return y > -1 && (d.push(r), n.splice(y, 1), l.splice(y, 1)), d;
|
|
710
|
+
}, []);
|
|
711
|
+
return a.push(...n), a;
|
|
712
|
+
}, yl = Ce({
|
|
713
|
+
name: "ElCascaderPanel",
|
|
714
|
+
components: {
|
|
715
|
+
CustomCascaderMenu: ul
|
|
716
|
+
},
|
|
717
|
+
props: xe(de({}, fl), {
|
|
718
|
+
border: {
|
|
719
|
+
type: Boolean,
|
|
720
|
+
default: !0
|
|
721
|
+
},
|
|
722
|
+
inputWidth: {
|
|
723
|
+
type: Number,
|
|
724
|
+
default: 0
|
|
725
|
+
},
|
|
726
|
+
renderLabel: Function
|
|
727
|
+
}),
|
|
728
|
+
emits: [ze, Be, "close", "expand-change"],
|
|
729
|
+
setup(e, { emit: t, slots: n }) {
|
|
730
|
+
let l = !1;
|
|
731
|
+
const a = be("cascader"), d = vl(e);
|
|
732
|
+
let r = null;
|
|
733
|
+
const y = P(!0), m = P([]), u = P(0), f = P(null), g = P([]), C = P(null), E = P([]), _ = S(() => d.value.expandTrigger === "hover"), W = S(() => e.renderLabel || n.default), ee = (o) => {
|
|
734
|
+
var p, b;
|
|
735
|
+
const i = o == null ? void 0 : o.$el;
|
|
736
|
+
return (p = i == null ? void 0 : i.classList) != null && p.contains("vue-recycle-scroller") ? i : ((b = i == null ? void 0 : i.querySelector) == null ? void 0 : b.call(i, ".vue-recycle-scroller")) || i;
|
|
737
|
+
}, T = (o = !0) => {
|
|
738
|
+
const i = o ? m.value.map((b) => {
|
|
739
|
+
var N;
|
|
740
|
+
return ((N = ee(b)) == null ? void 0 : N.scrollTop) || 0;
|
|
741
|
+
}) : [];
|
|
742
|
+
if (u.value++, !o) return;
|
|
743
|
+
const p = () => {
|
|
744
|
+
m.value.forEach((b, N) => {
|
|
745
|
+
const k = ee(b);
|
|
746
|
+
k && (k.scrollTop = i[N] || 0);
|
|
747
|
+
});
|
|
748
|
+
};
|
|
749
|
+
re(() => {
|
|
750
|
+
p(), nt && requestAnimationFrame(p);
|
|
751
|
+
});
|
|
752
|
+
}, B = () => {
|
|
753
|
+
const { options: o } = e, i = d.value;
|
|
754
|
+
l = !1, r = new kt(o, i), g.value = [r.getNodes()], i.lazy && Xe(e.options) ? (y.value = !1, D(void 0, (p) => {
|
|
755
|
+
p && (r = new kt(p, i), g.value = [r.getNodes()]), y.value = !0, te(!1, !0);
|
|
756
|
+
})) : te(!1, !0);
|
|
757
|
+
}, D = (o, i) => {
|
|
758
|
+
const p = d.value;
|
|
759
|
+
o = o || new Ne({}, p, void 0, !0), o.loading = !0;
|
|
760
|
+
const b = (N) => {
|
|
761
|
+
const k = o, R = k.root ? null : k;
|
|
762
|
+
N && (r == null || r.appendNodes(N, R)), k.loading = !1, k.loaded = !0, k.childrenData = k.childrenData || [], i && i(N);
|
|
763
|
+
};
|
|
764
|
+
p.lazyLoad(o, b);
|
|
765
|
+
}, j = (o, i) => {
|
|
766
|
+
var k;
|
|
767
|
+
const { level: p } = o, b = g.value.slice(0, p);
|
|
768
|
+
let N;
|
|
769
|
+
o.isLeaf ? N = o.pathNodes[p - 2] : (N = o, b.push(o.children)), ((k = C.value) == null ? void 0 : k.uid) !== (N == null ? void 0 : N.uid) && (C.value = o, g.value = b, !i && t("expand-change", (o == null ? void 0 : o.pathValues) || []));
|
|
770
|
+
}, O = (o, i, p = !0) => {
|
|
771
|
+
const { checkStrictly: b, multiple: N } = d.value, k = E.value[0];
|
|
772
|
+
l = !0, !N && (k == null || k.doCheck(!1)), o.doCheck(i), ce(), p && !N && !b && t("close"), !p && !N && !b && A(o);
|
|
773
|
+
}, A = (o) => {
|
|
774
|
+
o && (o = o.parent, A(o), o && j(o));
|
|
775
|
+
}, I = (o) => r == null ? void 0 : r.getFlattedNodes(o), x = (o) => {
|
|
776
|
+
var i;
|
|
777
|
+
return (i = I(o)) == null ? void 0 : i.filter((p) => p.checked !== !1);
|
|
778
|
+
}, z = (o) => {
|
|
779
|
+
const i = (r == null ? void 0 : r.getNodes()) || [];
|
|
780
|
+
if (!o) {
|
|
781
|
+
C.value = null, g.value = i.length ? [i] : [], T();
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
const p = o.isLeaf ? o.parent : o;
|
|
785
|
+
if (!p) {
|
|
786
|
+
C.value = null, g.value = i.length ? [i] : [], T();
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
const b = [i];
|
|
790
|
+
p.pathNodes.forEach((N) => {
|
|
791
|
+
N.isLeaf || b.push(N.children);
|
|
792
|
+
}), C.value = p, g.value = b, T();
|
|
793
|
+
}, ie = () => {
|
|
794
|
+
var o;
|
|
795
|
+
(o = I(!1)) == null || o.forEach((i) => {
|
|
796
|
+
i.checked = !1, i.indeterminate = !1;
|
|
797
|
+
}), E.value = [], f.value = d.value.multiple ? [] : null, g.value = r ? [r.getNodes()] : [], C.value = null, T(!1), t("expand-change", []);
|
|
798
|
+
}, ce = () => {
|
|
799
|
+
var R;
|
|
800
|
+
const { checkStrictly: o, multiple: i } = d.value, p = E.value, b = x(!o), N = gl(p, b), k = N.map((q) => q.valueByOption);
|
|
801
|
+
E.value = N, f.value = i ? k : (R = k[0]) != null ? R : null;
|
|
802
|
+
}, te = (o = !1, i = !1) => {
|
|
803
|
+
const { modelValue: p } = e, { lazy: b, multiple: N, checkStrictly: k } = d.value, R = !k;
|
|
804
|
+
if (!(!y.value || l || !i && Le(p, f.value)))
|
|
805
|
+
if (b && !o) {
|
|
806
|
+
const U = Nt(mn(Ct(p))).map((G) => r == null ? void 0 : r.getNodeByValue(G)).filter((G) => !!G && !G.loaded && !G.loading);
|
|
807
|
+
U.length ? U.forEach((G) => {
|
|
808
|
+
D(G, () => te(!1, i));
|
|
809
|
+
}) : te(!0, i);
|
|
810
|
+
} else {
|
|
811
|
+
const q = N ? Ct(p) : [p], U = Nt(q.map((G) => r == null ? void 0 : r.getNodeByValue(G, R)));
|
|
812
|
+
ue(U, i), f.value = Lt(p);
|
|
813
|
+
}
|
|
814
|
+
}, ue = (o, i = !0) => {
|
|
815
|
+
var J;
|
|
816
|
+
const { checkStrictly: p, multiple: b } = d.value, N = I(!1) || [], k = new Map(N.map((w) => [w.uid, w])), R = (w) => w ? k.get(w.uid) || (r == null ? void 0 : r.getSameNode(w)) || w : null, q = E.value.map((w) => R(w)).filter((w) => !!w), U = o.map((w) => R(w)).filter((w) => !!w && (p || w.isLeaf)), G = (J = C.value) != null && J.isLeaf ? C.value.parent : C.value, me = G ? r == null ? void 0 : r.getSameNode(G) : null, Ve = new Set(U.map((w) => w.uid)), qe = new Set(q.map((w) => w.uid)), ke = U.filter((w) => !qe.has(w.uid)), Se = q.filter((w) => !Ve.has(w.uid));
|
|
817
|
+
if (!ke.length && !Se.length) {
|
|
818
|
+
z(i && me || null), E.value = U;
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
if (b && !p && ke.length + Se.length > 80) {
|
|
822
|
+
const w = new Set(U);
|
|
823
|
+
N.forEach((X) => {
|
|
824
|
+
X.checked = X.isLeaf ? w.has(X) : !1, X.indeterminate = !1;
|
|
825
|
+
}), N.filter((X) => !X.isLeaf).sort((X, we) => we.level - X.level).forEach((X) => X.onChildCheck()), T();
|
|
826
|
+
} else
|
|
827
|
+
Se.forEach((w) => w.doCheck(!1)), ke.forEach((w) => w.doCheck(!0));
|
|
828
|
+
const Ee = i && me || U[0];
|
|
829
|
+
z(Ee || null), E.value = U;
|
|
830
|
+
}, h = (o) => {
|
|
831
|
+
const i = o.target, { code: p } = o;
|
|
832
|
+
switch (p) {
|
|
833
|
+
case Y.up:
|
|
834
|
+
case Y.down: {
|
|
835
|
+
o.preventDefault();
|
|
836
|
+
const b = p === Y.up ? -1 : 1;
|
|
837
|
+
Fe(Ft(i, b, `.${a.b("node")}[tabindex="-1"]`));
|
|
838
|
+
break;
|
|
839
|
+
}
|
|
840
|
+
case Y.left: {
|
|
841
|
+
o.preventDefault();
|
|
842
|
+
const b = m.value[St(i) - 1], N = b == null ? void 0 : b.$el.querySelector(`.${a.b("node")}[aria-expanded="true"]`);
|
|
843
|
+
Fe(N);
|
|
844
|
+
break;
|
|
845
|
+
}
|
|
846
|
+
case Y.right: {
|
|
847
|
+
o.preventDefault();
|
|
848
|
+
const b = m.value[St(i) + 1], N = b == null ? void 0 : b.$el.querySelector(`.${a.b("node")}[tabindex="-1"]`);
|
|
849
|
+
Fe(N);
|
|
850
|
+
break;
|
|
851
|
+
}
|
|
852
|
+
case Y.enter:
|
|
853
|
+
ml(i);
|
|
854
|
+
break;
|
|
855
|
+
}
|
|
856
|
+
};
|
|
857
|
+
return sn(
|
|
858
|
+
st,
|
|
859
|
+
an({
|
|
860
|
+
config: d,
|
|
861
|
+
expandingNode: C,
|
|
862
|
+
checkedNodes: E,
|
|
863
|
+
isHoverMenu: _,
|
|
864
|
+
initialLoaded: y,
|
|
865
|
+
renderLabelFn: W,
|
|
866
|
+
lazyLoad: D,
|
|
867
|
+
expandNode: j,
|
|
868
|
+
handleCheckChange: O
|
|
869
|
+
})
|
|
870
|
+
), Q([d, () => e.options], B, {
|
|
871
|
+
deep: !0,
|
|
872
|
+
immediate: !0
|
|
873
|
+
}), Q(
|
|
874
|
+
() => e.modelValue,
|
|
875
|
+
() => {
|
|
876
|
+
l = !1, te();
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
deep: !0
|
|
880
|
+
}
|
|
881
|
+
), Q(
|
|
882
|
+
() => f.value,
|
|
883
|
+
(o) => {
|
|
884
|
+
Le(o, e.modelValue) || (t(ze, o), t(Be, o));
|
|
885
|
+
}
|
|
886
|
+
), on(() => m.value = []), Re(() => !Xe(e.modelValue) && te()), {
|
|
887
|
+
ns: a,
|
|
888
|
+
menuList: m,
|
|
889
|
+
menuRenderKey: u,
|
|
890
|
+
menus: g,
|
|
891
|
+
checkedNodes: E,
|
|
892
|
+
handleKeyDown: h,
|
|
893
|
+
handleCheckChange: O,
|
|
894
|
+
getFlattedNodes: I,
|
|
895
|
+
/**
|
|
896
|
+
* @description get an array of currently selected node,(leafOnly) whether only return the leaf checked nodes, default is `false`
|
|
897
|
+
*/
|
|
898
|
+
getCheckedNodes: x,
|
|
899
|
+
/**
|
|
900
|
+
* @description clear checked nodes
|
|
901
|
+
*/
|
|
902
|
+
clearCheckedNodes: ie,
|
|
903
|
+
calculateCheckedValue: ce
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
function bl(e, t, n, l, a, d) {
|
|
908
|
+
var y;
|
|
909
|
+
const r = le("custom-cascader-menu");
|
|
910
|
+
return $(), K("div", {
|
|
911
|
+
class: F([e.ns.b("panel"), e.ns.is("bordered", e.border)]),
|
|
912
|
+
onKeydown: t[0] || (t[0] = (...m) => e.handleKeyDown && e.handleKeyDown(...m))
|
|
913
|
+
}, [
|
|
914
|
+
(y = e.options) != null && y.length ? ($(!0), K(Ae, { key: 0 }, Oe(e.menus, (m, u) => ($(), Z(r, {
|
|
915
|
+
key: `${u}-${e.menuRenderKey}`,
|
|
916
|
+
ref_for: !0,
|
|
917
|
+
ref: (f) => e.menuList[u] = f,
|
|
918
|
+
index: u,
|
|
919
|
+
nodes: [...m]
|
|
920
|
+
}, null, 8, ["index", "nodes"]))), 128)) : ($(), K("div", {
|
|
921
|
+
key: 1,
|
|
922
|
+
class: "empty-panel",
|
|
923
|
+
style: Ie(e.inputWidth ? { width: e.inputWidth + "px" } : {})
|
|
924
|
+
}, [...t[1] || (t[1] = [
|
|
925
|
+
pe("p", null, "暂无数据", -1)
|
|
926
|
+
])], 4))
|
|
927
|
+
], 34);
|
|
928
|
+
}
|
|
929
|
+
const Nl = /* @__PURE__ */ et(yl, [["render", bl]]), Cl = Bt(xe(de({}, wn), {
|
|
930
|
+
/**
|
|
931
|
+
* @description size of input
|
|
932
|
+
*/
|
|
933
|
+
size: $n,
|
|
934
|
+
/**
|
|
935
|
+
* @description placeholder of input
|
|
936
|
+
*/
|
|
937
|
+
placeholder: String,
|
|
938
|
+
/**
|
|
939
|
+
* @description whether Cascader is disabled
|
|
940
|
+
*/
|
|
941
|
+
disabled: Boolean,
|
|
942
|
+
/**
|
|
943
|
+
* @description whether selected value can be cleared
|
|
944
|
+
*/
|
|
945
|
+
clearable: Boolean,
|
|
946
|
+
/**
|
|
947
|
+
* @description whether the options can be searched
|
|
948
|
+
*/
|
|
949
|
+
filterable: Boolean,
|
|
950
|
+
/**
|
|
951
|
+
* @description customize search logic, the first parameter is `node`, the second is `keyword`, and need return a boolean value indicating whether it hits.
|
|
952
|
+
*/
|
|
953
|
+
filterMethod: {
|
|
954
|
+
type: ye(Function),
|
|
955
|
+
default: (e, t) => e.text.includes(t)
|
|
956
|
+
},
|
|
957
|
+
/**
|
|
958
|
+
* @description option label separator
|
|
959
|
+
*/
|
|
960
|
+
separator: {
|
|
961
|
+
type: String,
|
|
962
|
+
default: " / "
|
|
963
|
+
},
|
|
964
|
+
/**
|
|
965
|
+
* @description whether to display all levels of the selected value in the input
|
|
966
|
+
*/
|
|
967
|
+
showAllLevels: {
|
|
968
|
+
type: Boolean,
|
|
969
|
+
default: !0
|
|
970
|
+
},
|
|
971
|
+
/**
|
|
972
|
+
* @description whether to collapse tags in multiple selection mode
|
|
973
|
+
*/
|
|
974
|
+
collapseTags: Boolean,
|
|
975
|
+
/**
|
|
976
|
+
* @description The max tags number to be shown. To use this, collapse-tags must be true
|
|
977
|
+
*/
|
|
978
|
+
maxCollapseTags: {
|
|
979
|
+
type: Number,
|
|
980
|
+
default: 1
|
|
981
|
+
},
|
|
982
|
+
/**
|
|
983
|
+
* @description native input id
|
|
984
|
+
*/
|
|
985
|
+
collapseTagsTooltip: {
|
|
986
|
+
type: Boolean,
|
|
987
|
+
default: !1
|
|
988
|
+
},
|
|
989
|
+
/**
|
|
990
|
+
* @description max height of collapsed tags tooltip
|
|
991
|
+
*/
|
|
992
|
+
maxCollapseTagsTooltipHeight: {
|
|
993
|
+
type: ye([String, Number]),
|
|
994
|
+
default: 260
|
|
995
|
+
},
|
|
996
|
+
/**
|
|
997
|
+
* @description debounce delay when typing filter keyword, in milliseconds
|
|
998
|
+
*/
|
|
999
|
+
debounce: {
|
|
1000
|
+
type: Number,
|
|
1001
|
+
default: 300
|
|
1002
|
+
},
|
|
1003
|
+
/**
|
|
1004
|
+
* @description hook function before filtering with the value to be filtered as its parameter. If `false` is returned or a `Promise` is returned and then is rejected, filtering will be aborted
|
|
1005
|
+
*/
|
|
1006
|
+
beforeFilter: {
|
|
1007
|
+
type: ye(Function),
|
|
1008
|
+
default: () => !0
|
|
1009
|
+
},
|
|
1010
|
+
/**
|
|
1011
|
+
* @description custom class name for Cascader's dropdown
|
|
1012
|
+
*/
|
|
1013
|
+
popperClass: {
|
|
1014
|
+
type: String,
|
|
1015
|
+
default: ""
|
|
1016
|
+
},
|
|
1017
|
+
/**
|
|
1018
|
+
* @description whether cascader popup is teleported
|
|
1019
|
+
*/
|
|
1020
|
+
teleported: En.teleported,
|
|
1021
|
+
/**
|
|
1022
|
+
* @description tag type
|
|
1023
|
+
*/
|
|
1024
|
+
tagType: xe(de({}, Sn.type), { default: "info" }),
|
|
1025
|
+
/**
|
|
1026
|
+
* @description whether to trigger form validation
|
|
1027
|
+
*/
|
|
1028
|
+
validateEvent: {
|
|
1029
|
+
type: Boolean,
|
|
1030
|
+
default: !0
|
|
1031
|
+
}
|
|
1032
|
+
})), kl = {
|
|
1033
|
+
[ze]: (e) => !!e || e === null,
|
|
1034
|
+
[Be]: (e) => !!e || e === null,
|
|
1035
|
+
focus: (e) => e instanceof FocusEvent,
|
|
1036
|
+
blur: (e) => e instanceof FocusEvent,
|
|
1037
|
+
visibleChange: (e) => Un(e),
|
|
1038
|
+
expandChange: (e) => !!e,
|
|
1039
|
+
removeTag: (e) => !!e
|
|
1040
|
+
}, Sl = { key: 0 }, El = ["placeholder"], wl = ["onClick"], $l = "ElCascader", Al = /* @__PURE__ */ Ce({
|
|
1041
|
+
name: $l,
|
|
1042
|
+
__name: "ElCascader",
|
|
1043
|
+
props: Cl,
|
|
1044
|
+
emits: kl,
|
|
1045
|
+
setup(e, { expose: t, emit: n }) {
|
|
1046
|
+
const l = {
|
|
1047
|
+
modifiers: [
|
|
1048
|
+
{
|
|
1049
|
+
name: "arrowPosition",
|
|
1050
|
+
enabled: !0,
|
|
1051
|
+
phase: "main",
|
|
1052
|
+
fn: ({ state: s }) => {
|
|
1053
|
+
const { modifiersData: c, placement: v } = s;
|
|
1054
|
+
["right", "left", "bottom", "top"].includes(v) || (c.arrow.x = 35);
|
|
1055
|
+
},
|
|
1056
|
+
requires: ["arrow"]
|
|
1057
|
+
}
|
|
1058
|
+
]
|
|
1059
|
+
}, a = e, d = n, r = rn();
|
|
1060
|
+
let y = 0, m = 0;
|
|
1061
|
+
const u = be("cascader"), f = be("input"), { t: g } = Mt(), { form: C, formItem: E } = An(), _ = P(null), W = P(null), ee = P(null), T = P(null), B = P(null), D = P(!1), j = P(!1), O = P(!1), A = P(!1), I = P(""), x = P(""), z = P([]), ie = P([]), ce = P([]), te = P(!1), ue = P(), h = S(() => r.style), o = S(() => a.disabled || (C == null ? void 0 : C.disabled)), i = S(() => a.placeholder || g("el.cascader.placeholder")), p = S(() => x.value || z.value.length > 0 || te.value ? "" : i.value), b = Ln(), N = S(() => ["small"].includes(b.value) ? "small" : "default"), k = S(() => !!a.props.multiple), R = S(() => !a.filterable || k.value), q = S(() => k.value ? x.value : I.value), U = S(() => {
|
|
1062
|
+
var s;
|
|
1063
|
+
return ((s = T.value) == null ? void 0 : s.checkedNodes) || [];
|
|
1064
|
+
}), G = S(() => !a.clearable || o.value || O.value || !j.value ? !1 : !!U.value.length), me = S(() => {
|
|
1065
|
+
const { showAllLevels: s, separator: c } = a, v = U.value;
|
|
1066
|
+
return v.length ? k.value ? "" : v[0].calcText(s, c) : "";
|
|
1067
|
+
}), Ve = S({
|
|
1068
|
+
get() {
|
|
1069
|
+
return Lt(a.modelValue);
|
|
1070
|
+
},
|
|
1071
|
+
set(s) {
|
|
1072
|
+
d(ze, s), d(Be, s), a.validateEvent && (E == null || E.validate("change").catch((c) => It(c)));
|
|
1073
|
+
}
|
|
1074
|
+
}), qe = S(() => [u.b(), u.m(b.value), u.is("disabled", o.value), r.class]), ke = S(() => [f.e("icon"), "icon-arrow-down", u.is("reverse", D.value)]), Se = S(() => u.is("focus", D.value || A.value)), at = S(() => {
|
|
1075
|
+
const s = a.maxCollapseTagsTooltipHeight;
|
|
1076
|
+
if (s)
|
|
1077
|
+
return {
|
|
1078
|
+
maxHeight: Xn(s),
|
|
1079
|
+
overflowY: "auto",
|
|
1080
|
+
overflowX: "hidden"
|
|
1081
|
+
};
|
|
1082
|
+
}), Ee = S(() => {
|
|
1083
|
+
var s, c;
|
|
1084
|
+
return (c = (s = _.value) == null ? void 0 : s.popperRef) == null ? void 0 : c.contentRef;
|
|
1085
|
+
}), J = (s) => {
|
|
1086
|
+
var c, v;
|
|
1087
|
+
o.value || (s = s != null ? s : !D.value, s !== D.value && (D.value = s, (v = (c = W.value) == null ? void 0 : c.input) == null || v.setAttribute("aria-expanded", `${s}`), s ? w() : a.filterable && Ue(), d("visibleChange", s)));
|
|
1088
|
+
}, w = () => {
|
|
1089
|
+
re(() => {
|
|
1090
|
+
var s;
|
|
1091
|
+
(s = _.value) == null || s.updatePopper();
|
|
1092
|
+
});
|
|
1093
|
+
}, X = () => {
|
|
1094
|
+
O.value = !1;
|
|
1095
|
+
}, we = (s) => {
|
|
1096
|
+
const { showAllLevels: c, separator: v } = a;
|
|
1097
|
+
return {
|
|
1098
|
+
node: s,
|
|
1099
|
+
key: s.uid,
|
|
1100
|
+
text: s.calcText(c, v),
|
|
1101
|
+
hitState: !1,
|
|
1102
|
+
closable: !o.value && !s.isDisabled,
|
|
1103
|
+
isCollapseTag: !1
|
|
1104
|
+
};
|
|
1105
|
+
}, Ke = (s) => {
|
|
1106
|
+
var v;
|
|
1107
|
+
const c = s.node;
|
|
1108
|
+
c.doCheck(!1), (v = T.value) == null || v.calculateCheckedValue(), d("removeTag", c.valueByOption);
|
|
1109
|
+
}, Ht = () => {
|
|
1110
|
+
if (!k.value) return;
|
|
1111
|
+
const s = U.value, c = [], v = [];
|
|
1112
|
+
if (s.forEach((M) => v.push(we(M))), ie.value = v, s.length) {
|
|
1113
|
+
s.slice(0, a.maxCollapseTags).forEach((se) => c.push(we(se)));
|
|
1114
|
+
const M = s.slice(a.maxCollapseTags), ae = M.length;
|
|
1115
|
+
ae && (a.collapseTags ? c.push({
|
|
1116
|
+
key: -1,
|
|
1117
|
+
text: `+ ${ae}`,
|
|
1118
|
+
closable: !1,
|
|
1119
|
+
isCollapseTag: !0
|
|
1120
|
+
}) : M.forEach((se) => c.push(we(se))));
|
|
1121
|
+
}
|
|
1122
|
+
z.value = c;
|
|
1123
|
+
}, ot = () => {
|
|
1124
|
+
var ae, se;
|
|
1125
|
+
const { filterMethod: s, showAllLevels: c, separator: v } = a, M = (se = (ae = T.value) == null ? void 0 : ae.getFlattedNodes(!a.props.checkStrictly)) == null ? void 0 : se.filter((oe) => oe.isDisabled ? !1 : (oe.calcText(c, v), s(oe, q.value)));
|
|
1126
|
+
k.value && (z.value.forEach((oe) => {
|
|
1127
|
+
oe.hitState = !1;
|
|
1128
|
+
}), ie.value.forEach((oe) => {
|
|
1129
|
+
oe.hitState = !1;
|
|
1130
|
+
})), O.value = !0, ce.value = M, w();
|
|
1131
|
+
}, Rt = () => {
|
|
1132
|
+
var c;
|
|
1133
|
+
let s;
|
|
1134
|
+
O.value && B.value ? s = B.value.$el.querySelector(`.${u.e("suggestion-item")}`) : s = (c = T.value) == null ? void 0 : c.$el.querySelector(`.${u.b("node")}[tabindex="-1"]`), s && (s.focus(), !O.value && s.click());
|
|
1135
|
+
}, je = () => {
|
|
1136
|
+
var M, ae;
|
|
1137
|
+
const s = (M = W.value) == null ? void 0 : M.input, c = ee.value, v = (ae = B.value) == null ? void 0 : ae.$el;
|
|
1138
|
+
if (!(!nt || !s)) {
|
|
1139
|
+
if (v) {
|
|
1140
|
+
const se = v.querySelector(`.${u.e("suggestion-list")}`);
|
|
1141
|
+
se.style.minWidth = `${s.offsetWidth}px`, ue.value = s.offsetWidth;
|
|
1142
|
+
}
|
|
1143
|
+
if (c) {
|
|
1144
|
+
const { offsetHeight: se } = c, oe = z.value.length > 0 ? `${Math.max(se + 6, y)}px` : `${y}px`;
|
|
1145
|
+
s.style.height = oe, w();
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
}, Wt = (s) => {
|
|
1149
|
+
var c;
|
|
1150
|
+
return (c = T.value) == null ? void 0 : c.getCheckedNodes(s);
|
|
1151
|
+
}, qt = (s) => {
|
|
1152
|
+
w(), d("expandChange", s);
|
|
1153
|
+
}, ge = (s) => {
|
|
1154
|
+
var v;
|
|
1155
|
+
const c = (v = s.target) == null ? void 0 : v.value;
|
|
1156
|
+
if (s.type === "compositionend")
|
|
1157
|
+
te.value = !1, re(() => Je(c));
|
|
1158
|
+
else {
|
|
1159
|
+
const M = c[c.length - 1] || "";
|
|
1160
|
+
te.value = !el(M);
|
|
1161
|
+
}
|
|
1162
|
+
}, Kt = (s) => {
|
|
1163
|
+
if (!te.value)
|
|
1164
|
+
switch (s.code) {
|
|
1165
|
+
case Y.enter:
|
|
1166
|
+
J();
|
|
1167
|
+
break;
|
|
1168
|
+
case Y.down:
|
|
1169
|
+
J(!0), re(Rt), s.preventDefault();
|
|
1170
|
+
break;
|
|
1171
|
+
case Y.esc:
|
|
1172
|
+
D.value === !0 && (s.preventDefault(), s.stopPropagation(), J(!1));
|
|
1173
|
+
break;
|
|
1174
|
+
case Y.tab:
|
|
1175
|
+
J(!1);
|
|
1176
|
+
break;
|
|
1177
|
+
}
|
|
1178
|
+
}, jt = () => {
|
|
1179
|
+
var s;
|
|
1180
|
+
(s = T.value) == null || s.clearCheckedNodes(), !D.value && a.filterable && Ue(), J(!1);
|
|
1181
|
+
}, Ue = () => {
|
|
1182
|
+
const { value: s } = me;
|
|
1183
|
+
I.value = s, x.value = s;
|
|
1184
|
+
}, Ut = (s) => {
|
|
1185
|
+
var v, M;
|
|
1186
|
+
const { checked: c } = s;
|
|
1187
|
+
k.value ? (v = T.value) == null || v.handleCheckChange(s, !c, !1) : (!c && ((M = T.value) == null || M.handleCheckChange(s, !0, !1)), J(!1));
|
|
1188
|
+
}, Jt = (s) => {
|
|
1189
|
+
const c = s.target, { code: v } = s;
|
|
1190
|
+
switch (v) {
|
|
1191
|
+
case Y.up:
|
|
1192
|
+
case Y.down: {
|
|
1193
|
+
const M = v === Y.up ? -1 : 1;
|
|
1194
|
+
Fe(Ft(c, M, `.${u.e("suggestion-item")}[tabindex="-1"]`));
|
|
1195
|
+
break;
|
|
1196
|
+
}
|
|
1197
|
+
case Y.enter:
|
|
1198
|
+
c.click();
|
|
1199
|
+
break;
|
|
1200
|
+
}
|
|
1201
|
+
}, Zt = () => {
|
|
1202
|
+
const s = z.value, c = s[s.length - 1];
|
|
1203
|
+
m = x.value ? 0 : m + 1, !(!c || !m || a.collapseTags && s.length > 1) && (c.hitState ? Ke(c) : c.hitState = !0);
|
|
1204
|
+
}, rt = (s) => {
|
|
1205
|
+
const c = s.target, v = u.e("search-input");
|
|
1206
|
+
c.className === v && (A.value = !0), d("focus", s);
|
|
1207
|
+
}, it = (s) => {
|
|
1208
|
+
A.value = !1, d("blur", s);
|
|
1209
|
+
}, _t = gn(() => {
|
|
1210
|
+
const { value: s } = q;
|
|
1211
|
+
if (!s) return;
|
|
1212
|
+
const c = a.beforeFilter(s);
|
|
1213
|
+
Fn(c) ? c.then(ot).catch(() => {
|
|
1214
|
+
}) : c !== !1 ? ot() : X();
|
|
1215
|
+
}, a.debounce), Je = (s, c) => {
|
|
1216
|
+
!D.value && J(!0), !(c != null && c.isComposing) && (s = s.trim(), s ? _t() : X());
|
|
1217
|
+
}, Gt = () => {
|
|
1218
|
+
var c;
|
|
1219
|
+
const s = (c = W.value) == null ? void 0 : c.input;
|
|
1220
|
+
s && (ue.value = parseFloat(s.offsetWidth), console.log(ue.value));
|
|
1221
|
+
}, ct = (s) => Number.parseFloat(qn(f.cssVarName("input-height"), s).value) - 2;
|
|
1222
|
+
return Q(O, w), Q([U, o], Ht), Q(z, () => {
|
|
1223
|
+
re(() => je());
|
|
1224
|
+
}), Q(b, () => pt(null, null, function* () {
|
|
1225
|
+
yield re();
|
|
1226
|
+
const s = W.value.input;
|
|
1227
|
+
y = ct(s) || y, je();
|
|
1228
|
+
})), Q(me, Ue, { immediate: !0 }), Re(() => {
|
|
1229
|
+
const s = W.value.input, c = ct(s);
|
|
1230
|
+
y = s.offsetHeight || c, Kn(s, je), Gt();
|
|
1231
|
+
}), t({
|
|
1232
|
+
/**
|
|
1233
|
+
* @description get an array of currently selected node,(leafOnly) whether only return the leaf checked nodes, default is `false`
|
|
1234
|
+
*/
|
|
1235
|
+
getCheckedNodes: Wt,
|
|
1236
|
+
/**
|
|
1237
|
+
* @description cascader panel ref
|
|
1238
|
+
*/
|
|
1239
|
+
cascaderPanelRef: T,
|
|
1240
|
+
/**
|
|
1241
|
+
* @description toggle the visible of popper
|
|
1242
|
+
*/
|
|
1243
|
+
togglePopperVisible: J,
|
|
1244
|
+
/**
|
|
1245
|
+
* @description cascader content ref
|
|
1246
|
+
*/
|
|
1247
|
+
contentRef: Ee
|
|
1248
|
+
}), (s, c) => ($(), Z(L(Pn), { "z-index": 3e3 }, {
|
|
1249
|
+
default: H(() => [
|
|
1250
|
+
ne(L(mt), {
|
|
1251
|
+
ref_key: "tooltipRef",
|
|
1252
|
+
ref: _,
|
|
1253
|
+
visible: D.value,
|
|
1254
|
+
teleported: s.teleported,
|
|
1255
|
+
"popper-class": [L(u).e("dropdown"), s.popperClass],
|
|
1256
|
+
"popper-options": l,
|
|
1257
|
+
"fallback-placements": ["bottom-start", "bottom", "top-start", "top", "right", "left"],
|
|
1258
|
+
"stop-popper-mouse-event": !1,
|
|
1259
|
+
"gpu-acceleration": !1,
|
|
1260
|
+
placement: "bottom-start",
|
|
1261
|
+
transition: `${L(u).namespace.value}-zoom-in-top`,
|
|
1262
|
+
effect: "light",
|
|
1263
|
+
pure: "",
|
|
1264
|
+
persistent: "",
|
|
1265
|
+
onHide: X
|
|
1266
|
+
}, {
|
|
1267
|
+
default: H(() => [
|
|
1268
|
+
De(($(), K("div", {
|
|
1269
|
+
class: F(qe.value),
|
|
1270
|
+
style: Ie(h.value),
|
|
1271
|
+
onClick: c[5] || (c[5] = () => J(R.value ? void 0 : !0)),
|
|
1272
|
+
onKeydown: Kt,
|
|
1273
|
+
onMouseenter: c[6] || (c[6] = (v) => j.value = !0),
|
|
1274
|
+
onMouseleave: c[7] || (c[7] = (v) => j.value = !1)
|
|
1275
|
+
}, [
|
|
1276
|
+
ne(L(Tn), {
|
|
1277
|
+
ref_key: "input",
|
|
1278
|
+
ref: W,
|
|
1279
|
+
modelValue: I.value,
|
|
1280
|
+
"onUpdate:modelValue": c[1] || (c[1] = (v) => I.value = v),
|
|
1281
|
+
placeholder: p.value,
|
|
1282
|
+
readonly: R.value,
|
|
1283
|
+
disabled: o.value,
|
|
1284
|
+
"validate-event": !1,
|
|
1285
|
+
size: L(b),
|
|
1286
|
+
class: F(Se.value),
|
|
1287
|
+
tabindex: k.value && s.filterable && !o.value ? -1 : void 0,
|
|
1288
|
+
onCompositionstart: ge,
|
|
1289
|
+
onCompositionupdate: ge,
|
|
1290
|
+
onCompositionend: ge,
|
|
1291
|
+
onFocus: rt,
|
|
1292
|
+
onBlur: it,
|
|
1293
|
+
onInput: Je
|
|
1294
|
+
}, {
|
|
1295
|
+
suffix: H(() => [
|
|
1296
|
+
G.value ? ($(), Z(L(Pe), {
|
|
1297
|
+
key: "clear",
|
|
1298
|
+
class: F([L(f).e("icon"), "icon-circle-close"]),
|
|
1299
|
+
onClick: $e(jt, ["stop"])
|
|
1300
|
+
}, {
|
|
1301
|
+
default: H(() => [
|
|
1302
|
+
ne(L(bn))
|
|
1303
|
+
]),
|
|
1304
|
+
_: 1
|
|
1305
|
+
}, 8, ["class"])) : ($(), Z(L(Pe), {
|
|
1306
|
+
key: "arrow-down",
|
|
1307
|
+
class: F(ke.value),
|
|
1308
|
+
onClick: c[0] || (c[0] = $e((v) => J(), ["stop"]))
|
|
1309
|
+
}, {
|
|
1310
|
+
default: H(() => [
|
|
1311
|
+
ne(L(Nn))
|
|
1312
|
+
]),
|
|
1313
|
+
_: 1
|
|
1314
|
+
}, 8, ["class"]))
|
|
1315
|
+
]),
|
|
1316
|
+
_: 1
|
|
1317
|
+
}, 8, ["modelValue", "placeholder", "readonly", "disabled", "size", "class", "tabindex"]),
|
|
1318
|
+
k.value ? ($(), K("div", {
|
|
1319
|
+
key: 0,
|
|
1320
|
+
ref_key: "tagWrapper",
|
|
1321
|
+
ref: ee,
|
|
1322
|
+
class: F(L(u).e("tags"))
|
|
1323
|
+
}, [
|
|
1324
|
+
($(!0), K(Ae, null, Oe(z.value, (v) => ($(), Z(L(gt), {
|
|
1325
|
+
key: v.key,
|
|
1326
|
+
type: s.tagType,
|
|
1327
|
+
size: N.value,
|
|
1328
|
+
hit: v.hitState,
|
|
1329
|
+
closable: v.closable,
|
|
1330
|
+
"disable-transitions": "",
|
|
1331
|
+
onClose: (M) => Ke(v)
|
|
1332
|
+
}, {
|
|
1333
|
+
default: H(() => [
|
|
1334
|
+
v.isCollapseTag === !1 ? ($(), K("span", Sl, fe(v.text), 1)) : ($(), Z(L(mt), {
|
|
1335
|
+
key: 1,
|
|
1336
|
+
disabled: D.value || !s.collapseTagsTooltip,
|
|
1337
|
+
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
1338
|
+
placement: "bottom",
|
|
1339
|
+
effect: "light"
|
|
1340
|
+
}, {
|
|
1341
|
+
default: H(() => [
|
|
1342
|
+
pe("span", null, fe(v.text), 1)
|
|
1343
|
+
]),
|
|
1344
|
+
content: H(() => [
|
|
1345
|
+
pe("div", {
|
|
1346
|
+
class: F(L(u).e("collapse-tags")),
|
|
1347
|
+
style: Ie(at.value)
|
|
1348
|
+
}, [
|
|
1349
|
+
($(!0), K(Ae, null, Oe(ie.value.slice(s.maxCollapseTags), (M, ae) => ($(), K("div", {
|
|
1350
|
+
key: ae,
|
|
1351
|
+
class: F(L(u).e("collapse-tag"))
|
|
1352
|
+
}, [
|
|
1353
|
+
($(), Z(L(gt), {
|
|
1354
|
+
key: M.key,
|
|
1355
|
+
class: "in-tooltip",
|
|
1356
|
+
type: s.tagType,
|
|
1357
|
+
size: N.value,
|
|
1358
|
+
hit: M.hitState,
|
|
1359
|
+
closable: M.closable,
|
|
1360
|
+
"disable-transitions": "",
|
|
1361
|
+
onClose: (se) => Ke(M)
|
|
1362
|
+
}, {
|
|
1363
|
+
default: H(() => [
|
|
1364
|
+
pe("span", null, fe(M.text), 1)
|
|
1365
|
+
]),
|
|
1366
|
+
_: 2
|
|
1367
|
+
}, 1032, ["type", "size", "hit", "closable", "onClose"]))
|
|
1368
|
+
], 2))), 128))
|
|
1369
|
+
], 6)
|
|
1370
|
+
]),
|
|
1371
|
+
_: 2
|
|
1372
|
+
}, 1032, ["disabled"]))
|
|
1373
|
+
]),
|
|
1374
|
+
_: 2
|
|
1375
|
+
}, 1032, ["type", "size", "hit", "closable", "onClose"]))), 128)),
|
|
1376
|
+
s.filterable && !o.value ? De(($(), K("input", {
|
|
1377
|
+
key: 0,
|
|
1378
|
+
"onUpdate:modelValue": c[2] || (c[2] = (v) => x.value = v),
|
|
1379
|
+
type: "text",
|
|
1380
|
+
class: F(L(u).e("search-input")),
|
|
1381
|
+
placeholder: me.value ? "" : i.value,
|
|
1382
|
+
onInput: c[3] || (c[3] = (v) => Je(x.value, v)),
|
|
1383
|
+
onClick: c[4] || (c[4] = $e((v) => J(!0), ["stop"])),
|
|
1384
|
+
onKeydown: cn(Zt, ["delete"]),
|
|
1385
|
+
onCompositionstart: ge,
|
|
1386
|
+
onCompositionupdate: ge,
|
|
1387
|
+
onCompositionend: ge,
|
|
1388
|
+
onFocus: rt,
|
|
1389
|
+
onBlur: it
|
|
1390
|
+
}, null, 42, El)), [
|
|
1391
|
+
[un, x.value]
|
|
1392
|
+
]) : he("", !0)
|
|
1393
|
+
], 2)) : he("", !0)
|
|
1394
|
+
], 38)), [
|
|
1395
|
+
[L(Vn), () => J(!1), Ee.value]
|
|
1396
|
+
])
|
|
1397
|
+
]),
|
|
1398
|
+
content: H(() => [
|
|
1399
|
+
De(ne(Nl, {
|
|
1400
|
+
ref_key: "cascaderPanelRef",
|
|
1401
|
+
ref: T,
|
|
1402
|
+
inputWidth: ue.value,
|
|
1403
|
+
modelValue: Ve.value,
|
|
1404
|
+
"onUpdate:modelValue": c[8] || (c[8] = (v) => Ve.value = v),
|
|
1405
|
+
options: s.options,
|
|
1406
|
+
props: a.props,
|
|
1407
|
+
border: !1,
|
|
1408
|
+
"render-label": s.$slots.default,
|
|
1409
|
+
onExpandChange: qt,
|
|
1410
|
+
onClose: c[9] || (c[9] = (v) => s.$nextTick(() => J(!1)))
|
|
1411
|
+
}, null, 8, ["inputWidth", "modelValue", "options", "props", "render-label"]), [
|
|
1412
|
+
[ft, !O.value]
|
|
1413
|
+
]),
|
|
1414
|
+
s.filterable ? De(($(), Z(L(Vt), {
|
|
1415
|
+
key: 0,
|
|
1416
|
+
ref_key: "suggestionPanel",
|
|
1417
|
+
ref: B,
|
|
1418
|
+
tag: "ul",
|
|
1419
|
+
class: F(L(u).e("suggestion-panel")),
|
|
1420
|
+
"view-class": L(u).e("suggestion-list"),
|
|
1421
|
+
onKeydown: Jt
|
|
1422
|
+
}, {
|
|
1423
|
+
default: H(() => [
|
|
1424
|
+
ce.value.length ? ($(!0), K(Ae, { key: 0 }, Oe(ce.value, (v) => ($(), K("li", {
|
|
1425
|
+
key: v.uid,
|
|
1426
|
+
class: F([L(u).e("suggestion-item"), L(u).is("checked", v.checked)]),
|
|
1427
|
+
tabindex: -1,
|
|
1428
|
+
onClick: (M) => Ut(v)
|
|
1429
|
+
}, [
|
|
1430
|
+
pe("span", null, fe(v.text), 1),
|
|
1431
|
+
v.checked ? ($(), Z(L(Pe), { key: 0 }, {
|
|
1432
|
+
default: H(() => [
|
|
1433
|
+
ne(L(Tt))
|
|
1434
|
+
]),
|
|
1435
|
+
_: 1
|
|
1436
|
+
})) : he("", !0)
|
|
1437
|
+
], 10, wl))), 128)) : At(s.$slots, "empty", { key: 1 }, () => [
|
|
1438
|
+
pe("li", {
|
|
1439
|
+
class: F(L(u).e("empty-text"))
|
|
1440
|
+
}, fe(L(g)("el.cascader.noMatch")), 3)
|
|
1441
|
+
])
|
|
1442
|
+
]),
|
|
1443
|
+
_: 3
|
|
1444
|
+
}, 8, ["class", "view-class"])), [
|
|
1445
|
+
[ft, O.value]
|
|
1446
|
+
]) : he("", !0)
|
|
1447
|
+
]),
|
|
1448
|
+
_: 3
|
|
1449
|
+
}, 8, ["visible", "teleported", "popper-class", "transition"])
|
|
1450
|
+
]),
|
|
1451
|
+
_: 3
|
|
1452
|
+
}));
|
|
1453
|
+
}
|
|
1454
|
+
}), Fl = /* @__PURE__ */ Ce({
|
|
1455
|
+
__name: "FgCascader",
|
|
1456
|
+
props: /* @__PURE__ */ ht({
|
|
1457
|
+
props: {
|
|
1458
|
+
type: Object,
|
|
1459
|
+
default: () => ({})
|
|
1460
|
+
},
|
|
1461
|
+
/** 级联展示时候是否有全选 */
|
|
1462
|
+
selectAll: {
|
|
1463
|
+
type: Boolean,
|
|
1464
|
+
default: () => !1
|
|
1465
|
+
},
|
|
1466
|
+
options: {
|
|
1467
|
+
type: Array,
|
|
1468
|
+
default: () => []
|
|
1469
|
+
},
|
|
1470
|
+
filterMethod: {
|
|
1471
|
+
type: Function,
|
|
1472
|
+
default: null
|
|
1473
|
+
},
|
|
1474
|
+
/** 筛选后是否有全选 */
|
|
1475
|
+
filterSelectAll: {
|
|
1476
|
+
type: Boolean,
|
|
1477
|
+
default: () => !1
|
|
1478
|
+
},
|
|
1479
|
+
poperClass: {
|
|
1480
|
+
type: String,
|
|
1481
|
+
default: () => ""
|
|
1482
|
+
},
|
|
1483
|
+
// 用于搜索后在匹配标签
|
|
1484
|
+
labelIds: {
|
|
1485
|
+
type: Array,
|
|
1486
|
+
default: () => []
|
|
1487
|
+
},
|
|
1488
|
+
// 用于搜索后在标签后显示内容
|
|
1489
|
+
labelName: {
|
|
1490
|
+
type: String,
|
|
1491
|
+
default: () => ""
|
|
1492
|
+
},
|
|
1493
|
+
// 用于搜索后在标签前还是标签后插入,默认标签后
|
|
1494
|
+
labelInsertHeader: {
|
|
1495
|
+
type: Boolean,
|
|
1496
|
+
default: () => !1
|
|
1497
|
+
},
|
|
1498
|
+
// 用于搜索后在标签前插入的icon
|
|
1499
|
+
labelIcon: {
|
|
1500
|
+
type: String,
|
|
1501
|
+
default: () => ""
|
|
1502
|
+
},
|
|
1503
|
+
teleported: {
|
|
1504
|
+
type: Boolean,
|
|
1505
|
+
default: () => !1
|
|
1506
|
+
}
|
|
1507
|
+
}, {
|
|
1508
|
+
modelValue: {},
|
|
1509
|
+
modelModifiers: {}
|
|
1510
|
+
}),
|
|
1511
|
+
emits: /* @__PURE__ */ ht(["change"], ["update:modelValue"]),
|
|
1512
|
+
setup(e, { emit: t }) {
|
|
1513
|
+
const n = dn(), l = e, a = pn(e, "modelValue"), d = P(0), r = de({ expandTrigger: "hover", emitPath: !1 }, l.props), y = t, m = P(), u = P(!1);
|
|
1514
|
+
let f = null, g, C, E = [];
|
|
1515
|
+
const _ = S(() => l.selectAll && l.options.length > 0 ? [{ [r.label || "label"]: "全选", [r.value || "value"]: "ALL" }, ...l.options] : l.options), W = (h, o) => {
|
|
1516
|
+
if (o === "add") {
|
|
1517
|
+
const i = a.value ? JSON.parse(JSON.stringify(a.value)) : [];
|
|
1518
|
+
h.forEach((p) => {
|
|
1519
|
+
i.find((b) => String(b) === String(p)) || i.push(p);
|
|
1520
|
+
}), a.value = i;
|
|
1521
|
+
} else
|
|
1522
|
+
a.value = a.value.filter((i) => !h.find((p) => String(p) === String(i)));
|
|
1523
|
+
re(() => {
|
|
1524
|
+
y("change", [...a.value]);
|
|
1525
|
+
});
|
|
1526
|
+
}, ee = () => {
|
|
1527
|
+
u.value = !u.value, C.textContent = u.value ? "取消全选" : "全选", Object.prototype.hasOwnProperty.call(l.props, "emitPath") ? W(l.props.emitPath ? E.map((h) => h.pathValues) : E.map((h) => h.pathValues[h.pathValues.length - 1]), u.value ? "add" : "remove") : W(
|
|
1528
|
+
E.map((h) => h.pathValues[h.pathValues.length - 1]),
|
|
1529
|
+
u.value ? "add" : "remove"
|
|
1530
|
+
);
|
|
1531
|
+
}, T = () => {
|
|
1532
|
+
l.filterSelectAll && (u.value = !1, C.textContent = "全选");
|
|
1533
|
+
}, B = () => {
|
|
1534
|
+
var i, p;
|
|
1535
|
+
const h = (p = (i = m.value) == null ? void 0 : i.cascaderPanelRef) == null ? void 0 : p.$el.parentNode;
|
|
1536
|
+
if (!h || !n.footer || f && h.contains(f)) return;
|
|
1537
|
+
f = document.createElement("div"), f.className = "cascader-footer-slot", h.appendChild(f), vt(Ge(() => Ge("div", { class: "cascader-footer-wrapper" }, n.footer())), f);
|
|
1538
|
+
}, D = () => {
|
|
1539
|
+
f && (vt(null, f), f.parentNode && f.parentNode.removeChild(f), f = null);
|
|
1540
|
+
}, j = () => {
|
|
1541
|
+
var b, N, k;
|
|
1542
|
+
const h = (k = (N = (b = m.value) == null ? void 0 : b.cascaderPanelRef) == null ? void 0 : N.$el) == null ? void 0 : k.parentNode, o = h == null ? void 0 : h.querySelector(".el-cascader__suggestion-panel"), i = o == null ? void 0 : o.querySelector(".el-cascader__suggestion-list");
|
|
1543
|
+
!i || i.querySelector(".select-all") || (g = document.createElement("li"), g.className = "el-cascader__suggestion-item select-all", g.style.display = "none", C = document.createElement("span"), C.textContent = "全选", g.appendChild(C), i.prepend(g), g.onclick = () => {
|
|
1544
|
+
ee();
|
|
1545
|
+
});
|
|
1546
|
+
}, O = (h) => {
|
|
1547
|
+
var b, N, k;
|
|
1548
|
+
const o = (k = (N = (b = m.value) == null ? void 0 : b.cascaderPanelRef) == null ? void 0 : N.$el) == null ? void 0 : k.parentNode, i = o == null ? void 0 : o.querySelector(".el-cascader__suggestion-panel"), p = i == null ? void 0 : i.querySelector(".el-cascader__suggestion-list");
|
|
1549
|
+
p && re(() => {
|
|
1550
|
+
setTimeout(() => {
|
|
1551
|
+
const R = Array.from(p.querySelectorAll(".el-cascader__suggestion-item")).find((q) => q.querySelector("span").textContent === h.text);
|
|
1552
|
+
if (R && l.labelIds.includes(h.value)) {
|
|
1553
|
+
if (R.querySelector("i")) return;
|
|
1554
|
+
const q = document.createElement("i");
|
|
1555
|
+
q.className = `el-cascader__suggestion-item-label text-[#aaa] text-[12px] ${l.labelIcon}`, q.textContent = l.labelName, l.labelInsertHeader ? R.insertBefore(q, R.firstChild) : R.appendChild(q);
|
|
1556
|
+
}
|
|
1557
|
+
});
|
|
1558
|
+
});
|
|
1559
|
+
}, A = (h, o) => {
|
|
1560
|
+
if (o = o.trim(), l.filterSelectAll && (j(), h.keyword = o, E = E.filter((p) => p.keyword === o)), h.value === "ALL")
|
|
1561
|
+
return !1;
|
|
1562
|
+
const i = l.filterMethod ? l.filterMethod(h, o) : I(h, o);
|
|
1563
|
+
return i && l.filterSelectAll && !E.find((p) => p.uid === h.uid) && E.push(de({}, h)), l.filterSelectAll && g && (g.style.display = E.length ? "flex" : "none"), l.labelIds.length && i && O(h), i;
|
|
1564
|
+
};
|
|
1565
|
+
function I(h, o) {
|
|
1566
|
+
const i = o.toLowerCase(), p = (b, N) => b.toLowerCase().includes(N);
|
|
1567
|
+
return p(h.label, i) || p(h.text, i);
|
|
1568
|
+
}
|
|
1569
|
+
const x = P(!1), z = (h) => {
|
|
1570
|
+
a.value = h, y("change", h);
|
|
1571
|
+
}, ie = (h, o = []) => {
|
|
1572
|
+
const i = [];
|
|
1573
|
+
return h.forEach((p) => {
|
|
1574
|
+
const b = p[r.value || "value"], N = [...o, b];
|
|
1575
|
+
p.children && p.children.length > 0 ? i.push(...ie(p.children, N)) : i.push(r.emitPath ? N : b);
|
|
1576
|
+
}), i;
|
|
1577
|
+
}, ce = (h) => !h || h.length === 0 ? !1 : r.emitPath ? h.some((o) => Array.isArray(o) && o.includes("ALL")) : h.includes("ALL"), te = (h) => !h || h.length === 0 ? [] : r.emitPath ? h.filter((o) => !Array.isArray(o) || !o.includes("ALL")) : h.filter((o) => o !== "ALL"), ue = (h) => {
|
|
1578
|
+
if (l.selectAll)
|
|
1579
|
+
if (ce(h)) {
|
|
1580
|
+
if (x.value) {
|
|
1581
|
+
x.value = !1, z(te(h));
|
|
1582
|
+
return;
|
|
1583
|
+
}
|
|
1584
|
+
const o = ie(
|
|
1585
|
+
// 排除全选选项
|
|
1586
|
+
_.value.filter((p) => p[r.value || "value"] !== "ALL")
|
|
1587
|
+
), i = r.emitPath ? [["ALL"]] : ["ALL"];
|
|
1588
|
+
z([...i, ...o]), x.value = !0;
|
|
1589
|
+
} else {
|
|
1590
|
+
if (x.value) {
|
|
1591
|
+
x.value = !1, z([]);
|
|
1592
|
+
return;
|
|
1593
|
+
}
|
|
1594
|
+
x.value = !1, z(h);
|
|
1595
|
+
}
|
|
1596
|
+
else
|
|
1597
|
+
z(h);
|
|
1598
|
+
};
|
|
1599
|
+
return Q(
|
|
1600
|
+
[() => a.value, () => l.options],
|
|
1601
|
+
() => {
|
|
1602
|
+
if (!l.selectAll) {
|
|
1603
|
+
x.value = !1;
|
|
1604
|
+
return;
|
|
1605
|
+
}
|
|
1606
|
+
},
|
|
1607
|
+
{
|
|
1608
|
+
deep: !0,
|
|
1609
|
+
immediate: !0
|
|
1610
|
+
}
|
|
1611
|
+
), Q(
|
|
1612
|
+
() => l.options,
|
|
1613
|
+
() => {
|
|
1614
|
+
var h;
|
|
1615
|
+
(h = a.value) != null && h.length && re(() => {
|
|
1616
|
+
d.value++;
|
|
1617
|
+
});
|
|
1618
|
+
},
|
|
1619
|
+
{
|
|
1620
|
+
deep: !0
|
|
1621
|
+
}
|
|
1622
|
+
), Re(() => {
|
|
1623
|
+
l.filterSelectAll && j(), n.footer && B();
|
|
1624
|
+
}), fn(() => {
|
|
1625
|
+
D();
|
|
1626
|
+
}), (h, o) => ($(), Z(Al, hn({
|
|
1627
|
+
ref_key: "cascaderRef",
|
|
1628
|
+
ref: m,
|
|
1629
|
+
key: d.value,
|
|
1630
|
+
modelValue: a.value,
|
|
1631
|
+
"onUpdate:modelValue": o[0] || (o[0] = (i) => a.value = i),
|
|
1632
|
+
"popper-class": `cascader-popper-deep ${e.poperClass}`,
|
|
1633
|
+
teleported: e.teleported
|
|
1634
|
+
}, h.$attrs, {
|
|
1635
|
+
props: r,
|
|
1636
|
+
options: _.value,
|
|
1637
|
+
"collapse-tags": "",
|
|
1638
|
+
"collapse-tags-tooltip": "",
|
|
1639
|
+
clearable: "",
|
|
1640
|
+
filterable: "",
|
|
1641
|
+
"filter-method": A,
|
|
1642
|
+
onChange: ue,
|
|
1643
|
+
onFocus: T
|
|
1644
|
+
}), {
|
|
1645
|
+
default: H(({ data: i }) => [
|
|
1646
|
+
At(h.$slots, "customer", { data: i }, () => [
|
|
1647
|
+
pe("span", null, fe(i[r.label || "label"]), 1)
|
|
1648
|
+
])
|
|
1649
|
+
]),
|
|
1650
|
+
_: 3
|
|
1651
|
+
}, 16, ["modelValue", "popper-class", "teleported", "options"]));
|
|
1652
|
+
}
|
|
1653
|
+
});
|
|
1654
|
+
export {
|
|
1655
|
+
Fl as _
|
|
1656
|
+
};
|