wyfe-ivue 2.19.0 → 2.19.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/dist/Cascader-De3uqL3-.js +1121 -0
- package/dist/{DatePicker-DD4zKCPD.js → DatePicker-DaP1E7a9.js} +1 -1
- package/dist/{Input-BXdbjYzG.js → Input-DTEVzMZA.js} +1 -1
- package/dist/InputNumber-_Aa3QbaM.js +324 -0
- package/dist/{InputRange-mMn3FVrC.js → InputRange-QDIJ51OI.js} +3 -3
- package/dist/Radio-CWCqPqLp.js +73 -0
- package/dist/Select-Docj4pi0.js +94 -0
- package/dist/{Switch-DqjnHZrl.js → Switch-BUR-lMXb.js} +1 -1
- package/dist/TimePicker-DxUQs9V2.js +311 -0
- package/dist/{TimeSelect-C1tJCmCv.js → TimeSelect-CpZOfRRu.js} +74 -71
- package/dist/{TreeSelect-DlimRS27.js → TreeSelect-u8xEo6qQ.js} +438 -436
- package/dist/{UseElDatePicker-DegS4HTj.js → UseElDatePicker-DKcagjH-.js} +1159 -1156
- package/dist/{UseElInput-iay6-AIo.js → UseElInput-CLbTqLbW.js} +7 -7
- package/dist/{UseElSelect-BN1OHM4g.js → UseElSelect-BPA5PX-3.js} +615 -614
- package/dist/{click-outside-ClCgizAw.js → click-outside-Dk875U1u.js} +1 -1
- package/dist/{cloneDeep-DB_eY5qs.js → cloneDeep-Cb5CTLhl.js} +1 -1
- package/dist/{collapse-transition-DIjnwQfq.js → collapse-transition-B7HV9jYb.js} +1 -1
- package/dist/{css-BBke53f4.js → css-BaGTfWV6.js} +336 -345
- package/dist/css-Crw3tNnP.js +153 -0
- package/dist/{css-CkxDJNT4.js → css-D1Vxa6Sv.js} +3 -3
- package/dist/css-D_udYZ1U.js +1365 -0
- package/dist/{css-DqAY2QPD.js → css-DductTH5.js} +550 -550
- package/dist/{css-BYB-BCGt.js → css-HR0lxXHj.js} +3 -3
- package/dist/customParseFormat-3K1euVvb.js +169 -0
- package/dist/icon-C0_AuzqV.js +128 -0
- package/dist/index.es.js +2904 -3344
- package/dist/index.umd.cjs +18 -18
- package/dist/{input-uamGsjJl.js → input-VDXZFIJy.js} +87 -86
- package/dist/{isArrayLikeObject-CSEXb5SE.js → isArrayLikeObject-C21RH0Ux.js} +2 -2
- package/dist/{isEqual-DlejxoSx.js → isEqual-Btx737-P.js} +1 -1
- package/dist/panel-time-pick-DiQtkYX0.js +1056 -0
- package/dist/{repeat-click-BcdMj1cu.js → repeat-click-CdLhvwtI.js} +1 -1
- package/dist/{toNumber-DUck94Zb.js → toNumber-BXq-nIDt.js} +1 -1
- package/dist/types/UseCrudTable/index.vue.d.ts +6 -2
- package/dist/types/UseCrudTable/types.d.ts +3 -0
- package/dist/types/UseElConfigProvider/index.vue.d.ts +0 -9
- package/dist/types/UseElConfigProvider/props.d.ts +0 -4
- package/dist/types/UseElDatePicker/index.vue.d.ts +1 -1
- package/dist/types/UseElForm/components/InlineForm.vue.d.ts +15 -7
- package/dist/types/UseElForm/components/RowForm.vue.d.ts +15 -7
- package/dist/types/UseElForm/components/controls/Cascader.vue.d.ts +3 -3
- package/dist/types/UseElForm/components/controls/DatePicker.vue.d.ts +3 -3
- package/dist/types/UseElForm/components/controls/Input.vue.d.ts +3 -3
- package/dist/types/UseElForm/components/controls/InputNumber.vue.d.ts +3 -3
- package/dist/types/UseElForm/components/controls/InputRange.vue.d.ts +3 -3
- package/dist/types/UseElForm/components/controls/Radio.vue.d.ts +3 -3
- package/dist/types/UseElForm/components/controls/Select.vue.d.ts +19 -13
- package/dist/types/UseElForm/components/controls/TimePicker.vue.d.ts +3 -3
- package/dist/types/UseElForm/components/controls/TimeSelect.vue.d.ts +3 -3
- package/dist/types/UseElForm/components/controls/TreeSelect.vue.d.ts +3 -3
- package/dist/types/UseElForm/index.vue.d.ts +87 -30
- package/dist/types/UseElForm/props.d.ts +6 -1
- package/dist/types/UseElForm/types.d.ts +2 -4
- package/dist/types/UseElForm/useFormHook.d.ts +4 -1
- package/dist/types/UseElInput/index.vue.d.ts +4 -4
- package/dist/types/UseElInput/props.d.ts +1 -1
- package/dist/types/UseElSelect/index.vue.d.ts +1 -1
- package/dist/types/UseElTable/components/RecTableColumn.vue.d.ts +1 -1
- package/dist/types/UseElTable/hooks/useTableHook.d.ts +13 -11
- package/dist/types/UseElTable/types.d.ts +1 -1
- package/dist/types/UseElTable/utils.d.ts +1 -1
- package/dist/{use-deprecated-Dvts2M4Q.js → use-deprecated-C_WRApBA.js} +2 -2
- package/dist/{use-locale-GUv3JBF0.js → use-locale-CmOc_a7M.js} +1 -1
- package/dist/utils-DPuuL5wm.js +28 -0
- package/dist/wyfe-ivue.css +1 -1
- package/package.json +4 -13
- package/src/components/UseCrudTable/types.ts +7 -0
- package/src/components/UseElConfigProvider/props.ts +0 -7
- package/src/components/UseElForm/props.ts +10 -2
- package/src/components/UseElForm/types.ts +7 -4
- package/src/components/UseElInput/props.ts +1 -1
- package/src/components/UseElTable/props.ts +1 -1
- package/src/components/UseElTable/types.ts +6 -2
- package/src/types/dict.ts +11 -7
- package/src/types/index.ts +3 -3
- package/dist/Cascader-CCRS8Kyz.js +0 -1116
- package/dist/InputNumber-B-S2_0PK.js +0 -323
- package/dist/Radio-cLUGGSkE.js +0 -72
- package/dist/Select-DNsX_eNI.js +0 -80
- package/dist/TimePicker-LvIgMwBM.js +0 -309
- package/dist/css-BWZjRRQp.js +0 -1364
- package/dist/css-CmOvJ8zm.js +0 -152
- package/dist/icon-D7AElRSo.js +0 -497
- package/dist/panel-time-pick-DAIe-bqD.js +0 -1055
- package/dist/types/UseElConfigProvider/defaultConfig.d.ts +0 -15
- /package/dist/{UseRender-BxTiEIkV.js → UseRender-wyS1Ilio.js} +0 -0
- /package/dist/{_baseFindIndex-DqVicKsf.js → _baseFindIndex-DkWs4peK.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-ok8pgSl5.js → _plugin-vue_export-helper-CBpAGQk-.js} +0 -0
- /package/dist/{typescript-BtQFnmmg.js → typescript-BiVZ6C7A.js} +0 -0
- /package/dist/{useLog-Da3tUars.js → useLog-iDbeX-pi.js} +0 -0
|
@@ -0,0 +1,1121 @@
|
|
|
1
|
+
import { a as e, n as t, s as n } from "./use-locale-CmOc_a7M.js";
|
|
2
|
+
import { $t as r, A as i, At as a, Bt as o, Dt as s, E as c, Gt as l, H as u, It as d, M as f, O as p, S as m, Tt as h, Yt as g, _ as ee, f as _, i as v, p as y, r as b, s as x, t as te, tn as S, v as ne, x as C, xt as re } from "./css-BaGTfWV6.js";
|
|
3
|
+
import { t as w } from "./isEqual-Btx737-P.js";
|
|
4
|
+
import { t as ie } from "./cloneDeep-Cb5CTLhl.js";
|
|
5
|
+
import { a as ae, b as oe, f as T, g as se, h as ce, o as E, t as le, u as D } from "./css-DductTH5.js";
|
|
6
|
+
import { t as ue } from "./click-outside-Dk875U1u.js";
|
|
7
|
+
import { _ as O, a as de, h as fe, i as pe, m as me, o as he, t as k } from "./icon-C0_AuzqV.js";
|
|
8
|
+
import { t as ge } from "./input-VDXZFIJy.js";
|
|
9
|
+
import { a as A, n as _e, t as ve } from "./css-Crw3tNnP.js";
|
|
10
|
+
import { t as j } from "./css-HR0lxXHj.js";
|
|
11
|
+
import { t as ye } from "./css-D1Vxa6Sv.js";
|
|
12
|
+
import { r as M } from "./utils-DPuuL5wm.js";
|
|
13
|
+
import { t as be } from "./UseRender-wyS1Ilio.js";
|
|
14
|
+
import "./index.es.js";
|
|
15
|
+
import { Comment as N, Fragment as P, computed as F, createBlock as I, createCommentVNode as L, createElementBlock as R, createElementVNode as z, createSlots as xe, createTextVNode as Se, createVNode as B, defineComponent as V, getCurrentInstance as H, inject as Ce, nextTick as we, normalizeClass as U, normalizeStyle as Te, onBeforeUpdate as Ee, onMounted as De, openBlock as W, provide as Oe, reactive as ke, ref as G, renderList as Ae, renderSlot as K, resolveDynamicComponent as je, toDisplayString as q, unref as J, useAttrs as Me, useSlots as Ne, vModelText as Pe, vShow as Fe, watch as Y, withCtx as X, withDirectives as Ie, withKeys as Le, withModifiers as Z } from "vue";
|
|
16
|
+
import { ArrowDown as Re, ArrowRight as ze, Check as Be, CircleClose as Ve, Loading as He } from "@element-plus/icons-vue";
|
|
17
|
+
//#region node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/flattenDeep.js
|
|
18
|
+
var Ue = Infinity;
|
|
19
|
+
function Q(e) {
|
|
20
|
+
return e != null && e.length ? u(e, Ue) : [];
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region node_modules/.pnpm/element-plus@2.13.7_typescr_ec03ac4af1881a498740109f524cb771/node_modules/element-plus/es/components/cascader-panel/src/config.mjs
|
|
24
|
+
var We = C({
|
|
25
|
+
modelValue: { type: m([
|
|
26
|
+
Number,
|
|
27
|
+
String,
|
|
28
|
+
Array,
|
|
29
|
+
Object
|
|
30
|
+
]) },
|
|
31
|
+
options: {
|
|
32
|
+
type: m(Array),
|
|
33
|
+
default: () => []
|
|
34
|
+
},
|
|
35
|
+
props: {
|
|
36
|
+
type: m(Object),
|
|
37
|
+
default: () => ({})
|
|
38
|
+
}
|
|
39
|
+
}), Ge = {
|
|
40
|
+
expandTrigger: "click",
|
|
41
|
+
multiple: !1,
|
|
42
|
+
checkStrictly: !1,
|
|
43
|
+
emitPath: !0,
|
|
44
|
+
lazy: !1,
|
|
45
|
+
lazyLoad: re,
|
|
46
|
+
value: "value",
|
|
47
|
+
label: "label",
|
|
48
|
+
children: "children",
|
|
49
|
+
leaf: "leaf",
|
|
50
|
+
disabled: "disabled",
|
|
51
|
+
hoverThreshold: 500,
|
|
52
|
+
checkOnClickNode: !1,
|
|
53
|
+
checkOnClickLeaf: !0,
|
|
54
|
+
showPrefix: !0
|
|
55
|
+
}, Ke = C({
|
|
56
|
+
...We,
|
|
57
|
+
border: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: !0
|
|
60
|
+
},
|
|
61
|
+
renderLabel: { type: Function }
|
|
62
|
+
}), qe = (e) => !0, Je = {
|
|
63
|
+
[S]: qe,
|
|
64
|
+
[r]: qe,
|
|
65
|
+
close: () => !0,
|
|
66
|
+
"expand-change": (e) => e
|
|
67
|
+
}, Ye = (e) => F(() => ({
|
|
68
|
+
...Ge,
|
|
69
|
+
...e.props
|
|
70
|
+
})), Xe = Symbol();
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region node_modules/.pnpm/element-plus@2.13.7_typescr_ec03ac4af1881a498740109f524cb771/node_modules/element-plus/es/components/cascader-panel/src/node-content.mjs
|
|
73
|
+
function Ze(e) {
|
|
74
|
+
return !!(h(e) ? e.every(({ type: e }) => e === N) : e?.type === N);
|
|
75
|
+
}
|
|
76
|
+
var Qe = /* @__PURE__ */ V({
|
|
77
|
+
name: "NodeContent",
|
|
78
|
+
props: { node: {
|
|
79
|
+
type: Object,
|
|
80
|
+
required: !0
|
|
81
|
+
} },
|
|
82
|
+
setup(e) {
|
|
83
|
+
let t = ee("cascader-node"), { renderLabelFn: n } = Ce(Xe), { node: r } = e, { data: i, label: a } = r, o = () => {
|
|
84
|
+
let e = n?.({
|
|
85
|
+
node: r,
|
|
86
|
+
data: i
|
|
87
|
+
});
|
|
88
|
+
return Ze(e) ? a : e ?? a;
|
|
89
|
+
};
|
|
90
|
+
return () => B("span", { class: t.e("label") }, [o()]);
|
|
91
|
+
}
|
|
92
|
+
}), $e = [
|
|
93
|
+
"id",
|
|
94
|
+
"aria-haspopup",
|
|
95
|
+
"aria-owns",
|
|
96
|
+
"aria-expanded",
|
|
97
|
+
"tabindex"
|
|
98
|
+
], et = /* @__PURE__ */ V({
|
|
99
|
+
name: "ElCascaderNode",
|
|
100
|
+
__name: "node",
|
|
101
|
+
props: {
|
|
102
|
+
node: {
|
|
103
|
+
type: Object,
|
|
104
|
+
required: !0
|
|
105
|
+
},
|
|
106
|
+
menuId: String
|
|
107
|
+
},
|
|
108
|
+
emits: ["expand"],
|
|
109
|
+
setup(e, { emit: t }) {
|
|
110
|
+
let n = e, r = t, i = Ce(Xe), a = ee("cascader-node"), o = F(() => i.isHoverMenu), s = F(() => i.config.multiple), c = F(() => i.config.checkStrictly), l = F(() => i.config.showPrefix), u = F(() => i.checkedNodes[0]?.uid), d = F(() => n.node.isDisabled), f = F(() => n.node.isLeaf), p = F(() => c.value && !f.value || !d.value), m = F(() => g(i.expandingNode)), h = F(() => c.value && i.checkedNodes.some(g)), g = (e) => {
|
|
111
|
+
let { level: t, uid: r } = n.node;
|
|
112
|
+
return e?.pathNodes[t - 1]?.uid === r;
|
|
113
|
+
}, _ = () => {
|
|
114
|
+
m.value || i.expandNode(n.node);
|
|
115
|
+
}, v = (e) => {
|
|
116
|
+
let { node: t } = n;
|
|
117
|
+
e !== t.checked && i.handleCheckChange(t, e);
|
|
118
|
+
}, y = () => {
|
|
119
|
+
i.lazyLoad(n.node, () => {
|
|
120
|
+
f.value || _();
|
|
121
|
+
});
|
|
122
|
+
}, b = (e) => {
|
|
123
|
+
o.value && (x(), !f.value && r("expand", e));
|
|
124
|
+
}, x = () => {
|
|
125
|
+
let { node: e } = n;
|
|
126
|
+
!p.value || e.loading || (e.loaded ? _() : y());
|
|
127
|
+
}, te = () => {
|
|
128
|
+
f.value && !d.value && !c.value && !s.value ? ne(!0) : (i.config.checkOnClickNode && (s.value || c.value) || f.value && i.config.checkOnClickLeaf) && !d.value ? S(!n.node.checked) : o.value || x();
|
|
129
|
+
}, S = (e) => {
|
|
130
|
+
c.value ? (v(e), n.node.loaded && _()) : ne(e);
|
|
131
|
+
}, ne = (e) => {
|
|
132
|
+
n.node.loaded ? (v(e), !c.value && _()) : y();
|
|
133
|
+
};
|
|
134
|
+
return (t, n) => (W(), R("li", {
|
|
135
|
+
id: `${e.menuId}-${e.node.uid}`,
|
|
136
|
+
role: "menuitem",
|
|
137
|
+
"aria-haspopup": !f.value,
|
|
138
|
+
"aria-owns": f.value ? void 0 : e.menuId,
|
|
139
|
+
"aria-expanded": m.value,
|
|
140
|
+
tabindex: p.value ? -1 : void 0,
|
|
141
|
+
class: U([
|
|
142
|
+
J(a).b(),
|
|
143
|
+
J(a).is("selectable", c.value),
|
|
144
|
+
J(a).is("active", e.node.checked),
|
|
145
|
+
J(a).is("disabled", !p.value),
|
|
146
|
+
m.value && "in-active-path",
|
|
147
|
+
h.value && "in-checked-path"
|
|
148
|
+
]),
|
|
149
|
+
onMouseenter: b,
|
|
150
|
+
onFocus: b,
|
|
151
|
+
onClick: te
|
|
152
|
+
}, [
|
|
153
|
+
L(" prefix "),
|
|
154
|
+
s.value && l.value ? (W(), I(J(j), {
|
|
155
|
+
key: 0,
|
|
156
|
+
"model-value": e.node.checked,
|
|
157
|
+
indeterminate: e.node.indeterminate,
|
|
158
|
+
disabled: d.value,
|
|
159
|
+
onClick: n[0] ||= Z(() => {}, ["stop"]),
|
|
160
|
+
"onUpdate:modelValue": S
|
|
161
|
+
}, null, 8, [
|
|
162
|
+
"model-value",
|
|
163
|
+
"indeterminate",
|
|
164
|
+
"disabled"
|
|
165
|
+
])) : c.value && l.value ? (W(), I(J(ye), {
|
|
166
|
+
key: 1,
|
|
167
|
+
"model-value": u.value,
|
|
168
|
+
label: e.node.uid,
|
|
169
|
+
disabled: d.value,
|
|
170
|
+
"onUpdate:modelValue": S,
|
|
171
|
+
onClick: n[1] ||= Z(() => {}, ["stop"])
|
|
172
|
+
}, {
|
|
173
|
+
default: X(() => [L("\n Add an empty element to avoid render label,\n do not use empty fragment here for https://github.com/vuejs/vue-next/pull/2485\n "), n[2] ||= z("span", null, null, -1)]),
|
|
174
|
+
_: 1
|
|
175
|
+
}, 8, [
|
|
176
|
+
"model-value",
|
|
177
|
+
"label",
|
|
178
|
+
"disabled"
|
|
179
|
+
])) : f.value && e.node.checked ? (W(), I(J(k), {
|
|
180
|
+
key: 2,
|
|
181
|
+
class: U(J(a).e("prefix"))
|
|
182
|
+
}, {
|
|
183
|
+
default: X(() => [B(J(Be))]),
|
|
184
|
+
_: 1
|
|
185
|
+
}, 8, ["class"])) : L("v-if", !0),
|
|
186
|
+
L(" content "),
|
|
187
|
+
B(J(Qe), { node: e.node }, null, 8, ["node"]),
|
|
188
|
+
L(" postfix "),
|
|
189
|
+
f.value ? L("v-if", !0) : (W(), R(P, { key: 3 }, [e.node.loading ? (W(), I(J(k), {
|
|
190
|
+
key: 0,
|
|
191
|
+
class: U([J(a).is("loading"), J(a).e("postfix")])
|
|
192
|
+
}, {
|
|
193
|
+
default: X(() => [B(J(He))]),
|
|
194
|
+
_: 1
|
|
195
|
+
}, 8, ["class"])) : (W(), I(J(k), {
|
|
196
|
+
key: 1,
|
|
197
|
+
class: U(["arrow-right", J(a).e("postfix")])
|
|
198
|
+
}, {
|
|
199
|
+
default: X(() => [B(J(ze))]),
|
|
200
|
+
_: 1
|
|
201
|
+
}, 8, ["class"]))], 64))
|
|
202
|
+
], 42, $e));
|
|
203
|
+
}
|
|
204
|
+
}), tt = /* @__PURE__ */ V({
|
|
205
|
+
name: "ElCascaderMenu",
|
|
206
|
+
__name: "menu",
|
|
207
|
+
props: {
|
|
208
|
+
nodes: {
|
|
209
|
+
type: Array,
|
|
210
|
+
required: !0
|
|
211
|
+
},
|
|
212
|
+
index: {
|
|
213
|
+
type: Number,
|
|
214
|
+
required: !0
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
setup(e) {
|
|
218
|
+
let n = e, r = H(), i = ee("cascader-menu"), { t: a } = t(), o = y(), s, c, l = Ce(Xe), u = G(), d = F(() => !n.nodes.length), f = F(() => !l.initialLoaded), p = F(() => `${o.value}-${n.index}`), m = (e) => {
|
|
219
|
+
s = e.target;
|
|
220
|
+
}, h = (e) => {
|
|
221
|
+
if (!(!l.isHoverMenu || !s || !u.value)) if (s.contains(e.target)) {
|
|
222
|
+
g();
|
|
223
|
+
let t = r.vnode.el, { left: n } = t.getBoundingClientRect(), { offsetWidth: a, offsetHeight: o } = t, c = e.clientX - n, l = s.offsetTop, d = l + s.offsetHeight, f = t.querySelector(`.${i.e("wrap")}`)?.scrollTop || 0;
|
|
224
|
+
u.value.innerHTML = `
|
|
225
|
+
<path style="pointer-events: auto;" fill="transparent" d="M${c} ${l} L${a} ${f} V${l} Z" />
|
|
226
|
+
<path style="pointer-events: auto;" fill="transparent" d="M${c} ${d} L${a} ${o + f} V${d} Z" />
|
|
227
|
+
`;
|
|
228
|
+
} else c ||= window.setTimeout(_, l.config.hoverThreshold);
|
|
229
|
+
}, g = () => {
|
|
230
|
+
c &&= (clearTimeout(c), void 0);
|
|
231
|
+
}, _ = () => {
|
|
232
|
+
u.value && (u.value.innerHTML = "", g());
|
|
233
|
+
};
|
|
234
|
+
return (t, n) => (W(), I(J(le), {
|
|
235
|
+
key: p.value,
|
|
236
|
+
tag: "ul",
|
|
237
|
+
role: "menu",
|
|
238
|
+
class: U(J(i).b()),
|
|
239
|
+
"wrap-class": J(i).e("wrap"),
|
|
240
|
+
"view-class": [J(i).e("list"), J(i).is("empty", d.value)],
|
|
241
|
+
onMousemove: h,
|
|
242
|
+
onMouseleave: _
|
|
243
|
+
}, {
|
|
244
|
+
default: X(() => [
|
|
245
|
+
(W(!0), R(P, null, Ae(e.nodes, (e) => (W(), I(et, {
|
|
246
|
+
key: e.uid,
|
|
247
|
+
node: e,
|
|
248
|
+
"menu-id": p.value,
|
|
249
|
+
onExpand: m
|
|
250
|
+
}, null, 8, ["node", "menu-id"]))), 128)),
|
|
251
|
+
f.value ? (W(), R("div", {
|
|
252
|
+
key: 0,
|
|
253
|
+
class: U(J(i).e("empty-text"))
|
|
254
|
+
}, [B(J(k), {
|
|
255
|
+
size: "14",
|
|
256
|
+
class: U(J(i).is("loading"))
|
|
257
|
+
}, {
|
|
258
|
+
default: X(() => [B(J(He))]),
|
|
259
|
+
_: 1
|
|
260
|
+
}, 8, ["class"]), Se(" " + q(J(a)("el.cascader.loading")), 1)], 2)) : d.value ? (W(), R("div", {
|
|
261
|
+
key: 1,
|
|
262
|
+
class: U(J(i).e("empty-text"))
|
|
263
|
+
}, [K(t.$slots, "empty", {}, () => [Se(q(J(a)("el.cascader.noData")), 1)])], 2)) : J(l)?.isHoverMenu ? (W(), R(P, { key: 2 }, [L(" eslint-disable vue/html-self-closing "), (W(), R("svg", {
|
|
264
|
+
ref_key: "hoverZone",
|
|
265
|
+
ref: u,
|
|
266
|
+
class: U(J(i).e("hover-zone"))
|
|
267
|
+
}, null, 2))], 2112)) : L("v-if", !0),
|
|
268
|
+
L(" eslint-enable vue/html-self-closing ")
|
|
269
|
+
]),
|
|
270
|
+
_: 3
|
|
271
|
+
}, 8, [
|
|
272
|
+
"class",
|
|
273
|
+
"wrap-class",
|
|
274
|
+
"view-class"
|
|
275
|
+
]));
|
|
276
|
+
}
|
|
277
|
+
}), nt = 0, rt = (e) => {
|
|
278
|
+
let t = [e], { parent: n } = e;
|
|
279
|
+
for (; n;) t.unshift(n), n = n.parent;
|
|
280
|
+
return t;
|
|
281
|
+
}, it = class e {
|
|
282
|
+
constructor(t, n, r, i = !1) {
|
|
283
|
+
this.data = t, this.config = n, this.parent = r, this.root = i, this.uid = nt++, this.checked = !1, this.indeterminate = !1, this.loading = !1;
|
|
284
|
+
let { value: a, label: o, children: s } = n, c = t[s], l = rt(this);
|
|
285
|
+
this.level = i ? 0 : r ? r.level + 1 : 1, this.value = t[a], this.label = t[o], this.pathNodes = l, this.pathValues = l.map((e) => e.value), this.pathLabels = l.map((e) => e.label), this.childrenData = c, this.children = (c || []).map((t) => new e(t, n, this)), this.loaded = !n.lazy || this.isLeaf || !p(c), this.text = "";
|
|
286
|
+
}
|
|
287
|
+
get isDisabled() {
|
|
288
|
+
let { data: e, parent: t, config: n } = this, { disabled: r, checkStrictly: i } = n;
|
|
289
|
+
return (s(r) ? r(e, this) : !!e[r]) || !i && !!t?.isDisabled;
|
|
290
|
+
}
|
|
291
|
+
get isLeaf() {
|
|
292
|
+
let { data: e, config: t, childrenData: n, loaded: r } = this, { lazy: i, leaf: a } = t, o = s(a) ? a(e, this) : e[a];
|
|
293
|
+
return f(o) ? i && !r ? !1 : !(h(n) && n.length) : !!o;
|
|
294
|
+
}
|
|
295
|
+
get valueByOption() {
|
|
296
|
+
return this.config.emitPath ? this.pathValues : this.value;
|
|
297
|
+
}
|
|
298
|
+
appendChild(t) {
|
|
299
|
+
let { childrenData: n, children: r } = this, i = new e(t, this.config, this);
|
|
300
|
+
return h(n) ? n.push(t) : this.childrenData = [t], r.push(i), i;
|
|
301
|
+
}
|
|
302
|
+
calcText(e, t) {
|
|
303
|
+
let n = e ? this.pathLabels.join(t) : this.label;
|
|
304
|
+
return this.text = n, n;
|
|
305
|
+
}
|
|
306
|
+
broadcast(e) {
|
|
307
|
+
this.children.forEach((t) => {
|
|
308
|
+
t && (t.broadcast(e), t.onParentCheck?.(e));
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
emit() {
|
|
312
|
+
let { parent: e } = this;
|
|
313
|
+
e && (e.onChildCheck?.(), e.emit());
|
|
314
|
+
}
|
|
315
|
+
onParentCheck(e) {
|
|
316
|
+
this.isDisabled || this.setCheckState(e);
|
|
317
|
+
}
|
|
318
|
+
onChildCheck() {
|
|
319
|
+
let { children: e } = this, t = e.filter((e) => !e.isDisabled), n = t.length ? t.every((e) => e.checked) : !1;
|
|
320
|
+
this.setCheckState(n);
|
|
321
|
+
}
|
|
322
|
+
setCheckState(e) {
|
|
323
|
+
let t = this.children.length, n = this.children.reduce((e, t) => e + (t.checked ? 1 : t.indeterminate ? .5 : 0), 0);
|
|
324
|
+
this.checked = this.loaded && this.children.filter((e) => !e.isDisabled).every((e) => e.loaded && e.checked) && e, this.indeterminate = this.loaded && n !== t && n > 0;
|
|
325
|
+
}
|
|
326
|
+
doCheck(e) {
|
|
327
|
+
if (this.checked === e) return;
|
|
328
|
+
let { checkStrictly: t, multiple: n } = this.config;
|
|
329
|
+
t || !n ? this.checked = e : (this.broadcast(e), this.setCheckState(e), this.emit());
|
|
330
|
+
}
|
|
331
|
+
}, $ = (e, t) => e.reduce((e, n) => (n.isLeaf ? e.push(n) : (!t && e.push(n), e = e.concat($(n.children, t))), e), []), at = class {
|
|
332
|
+
constructor(e, t) {
|
|
333
|
+
this.config = t;
|
|
334
|
+
let n = (e || []).map((e) => new it(e, this.config));
|
|
335
|
+
this.nodes = n, this.allNodes = $(n, !1), this.leafNodes = $(n, !0);
|
|
336
|
+
}
|
|
337
|
+
getNodes() {
|
|
338
|
+
return this.nodes;
|
|
339
|
+
}
|
|
340
|
+
getFlattedNodes(e) {
|
|
341
|
+
return e ? this.leafNodes : this.allNodes;
|
|
342
|
+
}
|
|
343
|
+
appendNode(e, t) {
|
|
344
|
+
let n = t ? t.appendChild(e) : new it(e, this.config);
|
|
345
|
+
t || this.nodes.push(n), this.appendAllNodesAndLeafNodes(n);
|
|
346
|
+
}
|
|
347
|
+
appendNodes(e, t) {
|
|
348
|
+
e.length > 0 ? e.forEach((e) => this.appendNode(e, t)) : t && t.isLeaf && this.leafNodes.push(t);
|
|
349
|
+
}
|
|
350
|
+
appendAllNodesAndLeafNodes(e) {
|
|
351
|
+
this.allNodes.push(e), e.isLeaf && this.leafNodes.push(e), e.children && e.children.forEach((e) => {
|
|
352
|
+
this.appendAllNodesAndLeafNodes(e);
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
getNodeByValue(e, t = !1) {
|
|
356
|
+
return i(e) ? null : this.getFlattedNodes(t).find((t) => w(t.value, e) || w(t.pathValues, e)) || null;
|
|
357
|
+
}
|
|
358
|
+
getSameNode(e) {
|
|
359
|
+
return e && this.getFlattedNodes(!1).find(({ value: t, level: n }) => w(e.value, t) && e.level === n) || null;
|
|
360
|
+
}
|
|
361
|
+
}, ot = (e) => {
|
|
362
|
+
if (!e) return 0;
|
|
363
|
+
let t = e.id.split("-");
|
|
364
|
+
return Number(t[t.length - 2]);
|
|
365
|
+
}, st = (e) => {
|
|
366
|
+
if (!e) return;
|
|
367
|
+
let t = e.querySelector("input");
|
|
368
|
+
t ? t.click() : O(e) && e.click();
|
|
369
|
+
}, ct = (e, t) => {
|
|
370
|
+
let n = t.slice(0), r = n.map((e) => e.uid), i = e.reduce((e, t) => {
|
|
371
|
+
let i = r.indexOf(t.uid);
|
|
372
|
+
return i > -1 && (e.push(t), n.splice(i, 1), r.splice(i, 1)), e;
|
|
373
|
+
}, []);
|
|
374
|
+
return i.push(...n), i;
|
|
375
|
+
}, lt = x(/* @__PURE__ */ V({
|
|
376
|
+
name: "ElCascaderPanel",
|
|
377
|
+
__name: "index",
|
|
378
|
+
props: Ke,
|
|
379
|
+
emits: Je,
|
|
380
|
+
setup(t, { expose: i, emit: a }) {
|
|
381
|
+
let o = t, s = a, c = !1, u = ee("cascader"), d = Ye(o), f = Ne(), m, h = G(!0), g = G(!1), _ = G([]), v = G(), y = G([]), b = G(), x = G([]), te = F(() => d.value.expandTrigger === "hover"), ne = F(() => o.renderLabel || f.default), C = () => {
|
|
382
|
+
let { options: e } = o, t = d.value;
|
|
383
|
+
c = !1, m = new at(e, t), y.value = [m.getNodes()], t.lazy && p(o.options) ? (h.value = !1, re(void 0, (e) => {
|
|
384
|
+
e && (m = new at(e, t), y.value = [m.getNodes()]), h.value = !0, O(!1, !0);
|
|
385
|
+
})) : O(!1, !0);
|
|
386
|
+
}, re = (e, t) => {
|
|
387
|
+
let n = d.value;
|
|
388
|
+
e ||= new it({}, n, void 0, !0), e.loading = !0, n.lazyLoad(e, (n) => {
|
|
389
|
+
let r = e, i = r.root ? null : r;
|
|
390
|
+
r.loading = !1, r.loaded = !0, r.childrenData = r.childrenData || [], n && m?.appendNodes(n, i), n && t?.(n), e.level === 0 && (g.value = !0);
|
|
391
|
+
}, () => {
|
|
392
|
+
e.loading = !1, e.loaded = !1, e.level === 0 && (h.value = !0);
|
|
393
|
+
});
|
|
394
|
+
}, ae = (e, t) => {
|
|
395
|
+
let { level: n } = e, r = y.value.slice(0, n), i;
|
|
396
|
+
e.isLeaf ? i = e.pathNodes[n - 2] : (i = e, r.push(e.children)), b.value?.uid !== i?.uid && (b.value = e, y.value = r, !t && s("expand-change", e?.pathValues || []));
|
|
397
|
+
}, oe = (e, t, n = !0) => {
|
|
398
|
+
let { checkStrictly: r, multiple: i } = d.value, a = x.value[0];
|
|
399
|
+
c = !0, !i && a?.doCheck(!1), e.doCheck(t), ue(), n && !i && !r && s("close"), !n && !i && se(e);
|
|
400
|
+
}, se = (e) => {
|
|
401
|
+
e && (e = e.parent, se(e), e && ae(e));
|
|
402
|
+
}, ce = (e) => m?.getFlattedNodes(e), E = (e) => ce(e)?.filter(({ checked: e }) => e !== !1), le = () => {
|
|
403
|
+
x.value.forEach((e) => e.doCheck(!1)), ue(), y.value = y.value.slice(0, 1), b.value = void 0, s("expand-change", []);
|
|
404
|
+
}, ue = () => {
|
|
405
|
+
let { checkStrictly: e, multiple: t } = d.value, n = x.value, r = ct(n, E(!e)), i = r.map((e) => e.valueByOption);
|
|
406
|
+
x.value = r, v.value = t ? i : i[0] ?? null;
|
|
407
|
+
}, O = (e = !1, t = !1) => {
|
|
408
|
+
let { modelValue: n } = o, { lazy: r, multiple: i, checkStrictly: a } = d.value, s = !a;
|
|
409
|
+
if (!(!h.value || c || !t && w(n, v.value))) if (r && !e) {
|
|
410
|
+
let e = T(Q(D(n))).map((e) => m?.getNodeByValue(e)).filter((e) => !!e && !e.loaded && !e.loading);
|
|
411
|
+
e.length ? e.forEach((e) => {
|
|
412
|
+
re(e, () => O(!1, t));
|
|
413
|
+
}) : O(!0, t);
|
|
414
|
+
} else de(T((i ? D(n) : [n]).map((e) => m?.getNodeByValue(e, s))), t), v.value = ie(n ?? void 0);
|
|
415
|
+
}, de = (e, t = !0) => {
|
|
416
|
+
let { checkStrictly: n } = d.value, r = x.value, i = e.filter((e) => !!e && (n || e.isLeaf)), a = m?.getSameNode(b.value), o = t && a || i[0];
|
|
417
|
+
o ? o.pathNodes.forEach((e) => ae(e, !0)) : b.value = void 0, r.forEach((e) => e.doCheck(!1)), ke(i).forEach((e) => e.doCheck(!0)), x.value = i, we(pe);
|
|
418
|
+
}, pe = () => {
|
|
419
|
+
l && _.value.forEach((e) => {
|
|
420
|
+
let t = e?.$el;
|
|
421
|
+
if (t) {
|
|
422
|
+
let e = t.querySelector(`.${u.namespace.value}-scrollbar__wrap`), n = t.querySelector(`.${u.b("node")}.in-active-path`);
|
|
423
|
+
if (!n) {
|
|
424
|
+
let e = t.querySelectorAll(`.${u.b("node")}.${u.is("active")}`);
|
|
425
|
+
n = e[e.length - 1];
|
|
426
|
+
}
|
|
427
|
+
A(e, n);
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
}, he = (t) => {
|
|
431
|
+
let r = t.target, i = e(t);
|
|
432
|
+
switch (i) {
|
|
433
|
+
case n.up:
|
|
434
|
+
case n.down:
|
|
435
|
+
t.preventDefault(), me(fe(r, i === n.up ? -1 : 1, `.${u.b("node")}[tabindex="-1"]`));
|
|
436
|
+
break;
|
|
437
|
+
case n.left: {
|
|
438
|
+
t.preventDefault();
|
|
439
|
+
let e = _.value[ot(r) - 1]?.$el.querySelector(`.${u.b("node")}[aria-expanded="true"]`);
|
|
440
|
+
me(e);
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
case n.right: {
|
|
444
|
+
t.preventDefault();
|
|
445
|
+
let e = _.value[ot(r) + 1]?.$el.querySelector(`.${u.b("node")}[tabindex="-1"]`);
|
|
446
|
+
me(e);
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
case n.enter:
|
|
450
|
+
case n.numpadEnter:
|
|
451
|
+
st(r);
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
return Oe(Xe, ke({
|
|
456
|
+
config: d,
|
|
457
|
+
expandingNode: b,
|
|
458
|
+
checkedNodes: x,
|
|
459
|
+
isHoverMenu: te,
|
|
460
|
+
initialLoaded: h,
|
|
461
|
+
renderLabelFn: ne,
|
|
462
|
+
lazyLoad: re,
|
|
463
|
+
expandNode: ae,
|
|
464
|
+
handleCheckChange: oe
|
|
465
|
+
})), Y(d, (e, t) => {
|
|
466
|
+
w(e, t) || C();
|
|
467
|
+
}, { immediate: !0 }), Y(() => o.options, C, { deep: !0 }), Y(() => o.modelValue, () => {
|
|
468
|
+
c = !1, O();
|
|
469
|
+
}, { deep: !0 }), Y(() => v.value, (e) => {
|
|
470
|
+
w(e, o.modelValue) || (s(S, e), s(r, e));
|
|
471
|
+
}), Ee(() => _.value = []), De(() => !p(o.modelValue) && O()), i({
|
|
472
|
+
menuList: _,
|
|
473
|
+
menus: y,
|
|
474
|
+
checkedNodes: x,
|
|
475
|
+
handleKeyDown: he,
|
|
476
|
+
handleCheckChange: oe,
|
|
477
|
+
getFlattedNodes: ce,
|
|
478
|
+
getCheckedNodes: E,
|
|
479
|
+
clearCheckedNodes: le,
|
|
480
|
+
calculateCheckedValue: ue,
|
|
481
|
+
scrollToExpandingNode: pe,
|
|
482
|
+
loadLazyRootNodes: () => {
|
|
483
|
+
g.value || C();
|
|
484
|
+
}
|
|
485
|
+
}), (e, n) => (W(), R("div", {
|
|
486
|
+
class: U([J(u).b("panel"), J(u).is("bordered", t.border)]),
|
|
487
|
+
onKeydown: he
|
|
488
|
+
}, [(W(!0), R(P, null, Ae(y.value, (t, n) => (W(), I(tt, {
|
|
489
|
+
key: n,
|
|
490
|
+
ref_for: !0,
|
|
491
|
+
ref: (e) => _.value[n] = e,
|
|
492
|
+
index: n,
|
|
493
|
+
nodes: [...t]
|
|
494
|
+
}, {
|
|
495
|
+
empty: X(() => [K(e.$slots, "empty")]),
|
|
496
|
+
_: 3
|
|
497
|
+
}, 8, ["index", "nodes"]))), 128))], 34));
|
|
498
|
+
}
|
|
499
|
+
})), ut = C({
|
|
500
|
+
...We,
|
|
501
|
+
size: _,
|
|
502
|
+
placeholder: String,
|
|
503
|
+
disabled: {
|
|
504
|
+
type: Boolean,
|
|
505
|
+
default: void 0
|
|
506
|
+
},
|
|
507
|
+
clearable: Boolean,
|
|
508
|
+
clearIcon: {
|
|
509
|
+
type: pe,
|
|
510
|
+
default: Ve
|
|
511
|
+
},
|
|
512
|
+
filterable: Boolean,
|
|
513
|
+
filterMethod: {
|
|
514
|
+
type: m(Function),
|
|
515
|
+
default: (e, t) => e.text.includes(t)
|
|
516
|
+
},
|
|
517
|
+
separator: {
|
|
518
|
+
type: String,
|
|
519
|
+
default: " / "
|
|
520
|
+
},
|
|
521
|
+
showAllLevels: {
|
|
522
|
+
type: Boolean,
|
|
523
|
+
default: !0
|
|
524
|
+
},
|
|
525
|
+
collapseTags: Boolean,
|
|
526
|
+
maxCollapseTags: {
|
|
527
|
+
type: Number,
|
|
528
|
+
default: 1
|
|
529
|
+
},
|
|
530
|
+
collapseTagsTooltip: Boolean,
|
|
531
|
+
maxCollapseTagsTooltipHeight: { type: [String, Number] },
|
|
532
|
+
debounce: {
|
|
533
|
+
type: Number,
|
|
534
|
+
default: 300
|
|
535
|
+
},
|
|
536
|
+
beforeFilter: {
|
|
537
|
+
type: m(Function),
|
|
538
|
+
default: () => !0
|
|
539
|
+
},
|
|
540
|
+
placement: {
|
|
541
|
+
type: m(String),
|
|
542
|
+
values: oe,
|
|
543
|
+
default: "bottom-start"
|
|
544
|
+
},
|
|
545
|
+
fallbackPlacements: {
|
|
546
|
+
type: m(Array),
|
|
547
|
+
default: [
|
|
548
|
+
"bottom-start",
|
|
549
|
+
"bottom",
|
|
550
|
+
"top-start",
|
|
551
|
+
"top",
|
|
552
|
+
"right",
|
|
553
|
+
"left"
|
|
554
|
+
]
|
|
555
|
+
},
|
|
556
|
+
popperClass: E.popperClass,
|
|
557
|
+
popperStyle: E.popperStyle,
|
|
558
|
+
teleported: E.teleported,
|
|
559
|
+
effect: {
|
|
560
|
+
type: m(String),
|
|
561
|
+
default: "light"
|
|
562
|
+
},
|
|
563
|
+
tagType: {
|
|
564
|
+
..._e.type,
|
|
565
|
+
default: "info"
|
|
566
|
+
},
|
|
567
|
+
tagEffect: {
|
|
568
|
+
..._e.effect,
|
|
569
|
+
default: "light"
|
|
570
|
+
},
|
|
571
|
+
validateEvent: {
|
|
572
|
+
type: Boolean,
|
|
573
|
+
default: !0
|
|
574
|
+
},
|
|
575
|
+
persistent: {
|
|
576
|
+
type: Boolean,
|
|
577
|
+
default: !0
|
|
578
|
+
},
|
|
579
|
+
showCheckedStrategy: {
|
|
580
|
+
type: String,
|
|
581
|
+
values: ["parent", "child"],
|
|
582
|
+
default: "child"
|
|
583
|
+
},
|
|
584
|
+
checkOnClickNode: Boolean,
|
|
585
|
+
showPrefix: {
|
|
586
|
+
type: Boolean,
|
|
587
|
+
default: !0
|
|
588
|
+
},
|
|
589
|
+
...se
|
|
590
|
+
}), dt = (e) => !0, ft = {
|
|
591
|
+
[S]: dt,
|
|
592
|
+
[r]: dt,
|
|
593
|
+
focus: (e) => e instanceof FocusEvent,
|
|
594
|
+
blur: (e) => e instanceof FocusEvent,
|
|
595
|
+
clear: () => !0,
|
|
596
|
+
visibleChange: (e) => c(e),
|
|
597
|
+
expandChange: (e) => !!e,
|
|
598
|
+
removeTag: (e) => !!e
|
|
599
|
+
}, pt = ["placeholder"], mt = ["onClick"], ht = x(/* @__PURE__ */ V({
|
|
600
|
+
name: "ElCascader",
|
|
601
|
+
__name: "cascader",
|
|
602
|
+
props: ut,
|
|
603
|
+
emits: ft,
|
|
604
|
+
setup(i, { expose: s, emit: c }) {
|
|
605
|
+
let u = { modifiers: [{
|
|
606
|
+
name: "arrowPosition",
|
|
607
|
+
enabled: !0,
|
|
608
|
+
phase: "main",
|
|
609
|
+
fn: ({ state: e }) => {
|
|
610
|
+
let { modifiersData: t, placement: n } = e;
|
|
611
|
+
[
|
|
612
|
+
"right",
|
|
613
|
+
"left",
|
|
614
|
+
"bottom",
|
|
615
|
+
"top"
|
|
616
|
+
].includes(n) || t.arrow && (t.arrow.x = 35);
|
|
617
|
+
},
|
|
618
|
+
requires: ["arrow"]
|
|
619
|
+
}] }, f = i, p = c, m = Me(), h = Ne(), _ = 0, y = 0, x = ee("cascader"), C = ee("input"), re = {
|
|
620
|
+
small: 7,
|
|
621
|
+
default: 11,
|
|
622
|
+
large: 15
|
|
623
|
+
}, { t: w } = t(), { formItem: oe } = te(), T = b(), { valueOnClear: se } = ce(f), { isComposing: E, handleComposition: D } = de({ afterComposition(e) {
|
|
624
|
+
let t = e.target?.value;
|
|
625
|
+
Et(t);
|
|
626
|
+
} }), O = G(), pe = G(), A = G(), _e = G(), j = G(), ye = G(), M = G(!1), be = G(!1), N = G(!1), Se = G(""), V = G(""), H = G([]), Ce = G([]), Ee = F(() => f.props.multiple ? f.collapseTags ? H.value.slice(0, f.maxCollapseTags) : H.value : []), Oe = F(() => f.props.multiple && f.collapseTags ? H.value.slice(f.maxCollapseTags) : []), ke = F(() => m.style), ze = F(() => f.placeholder ?? w("el.cascader.placeholder")), Ve = F(() => V.value || H.value.length > 0 || E.value ? "" : ze.value), He = v(), Ue = F(() => He.value === "small" ? "small" : "default"), Q = F(() => !!f.props.multiple), We = F(() => !f.filterable || Q.value), Ge = F(() => Q.value ? V.value : Se.value), Ke = F(() => j.value?.checkedNodes || []), { wrapperRef: qe, isFocused: Je, handleBlur: Ye } = he(A, {
|
|
627
|
+
disabled: T,
|
|
628
|
+
beforeBlur(e) {
|
|
629
|
+
return O.value?.isFocusInsideContent(e) || pe.value?.isFocusInsideContent(e);
|
|
630
|
+
},
|
|
631
|
+
afterBlur() {
|
|
632
|
+
f.validateEvent && oe?.validate?.("blur").catch((e) => ne(e));
|
|
633
|
+
}
|
|
634
|
+
}), Xe = F(() => !f.clearable || T.value || N.value || !be.value && !Je.value ? !1 : !!Ke.value.length), Ze = F(() => {
|
|
635
|
+
let { showAllLevels: e, separator: t } = f, n = Ke.value;
|
|
636
|
+
return n.length ? Q.value ? "" : n[0].calcText(e, t) : "";
|
|
637
|
+
}), Qe = F(() => oe?.validateState || ""), $e = F({
|
|
638
|
+
get() {
|
|
639
|
+
return ie(f.modelValue);
|
|
640
|
+
},
|
|
641
|
+
set(e) {
|
|
642
|
+
let t = e ?? se.value;
|
|
643
|
+
p(S, t), p(r, t), f.validateEvent && oe?.validate("change").catch((e) => ne(e));
|
|
644
|
+
}
|
|
645
|
+
}), et = F(() => [
|
|
646
|
+
x.b(),
|
|
647
|
+
x.m(He.value),
|
|
648
|
+
x.is("disabled", T.value),
|
|
649
|
+
m.class
|
|
650
|
+
]), tt = F(() => [
|
|
651
|
+
C.e("icon"),
|
|
652
|
+
"icon-arrow-down",
|
|
653
|
+
x.is("reverse", M.value)
|
|
654
|
+
]), nt = F(() => x.is("focus", Je.value)), rt = F(() => O.value?.popperRef?.contentRef), it = (e) => {
|
|
655
|
+
Je.value && Ye(new FocusEvent("blur", e)), $(!1);
|
|
656
|
+
}, $ = (e) => {
|
|
657
|
+
T.value || (e ??= !M.value, e !== M.value && (M.value = e, A.value?.input?.setAttribute("aria-expanded", `${e}`), e ? (at(), j.value && we(j.value.scrollToExpandingNode)) : f.filterable && xt(), p("visibleChange", e)));
|
|
658
|
+
}, at = () => {
|
|
659
|
+
we(() => {
|
|
660
|
+
O.value?.updatePopper();
|
|
661
|
+
});
|
|
662
|
+
}, ot = () => {
|
|
663
|
+
N.value = !1;
|
|
664
|
+
}, st = (e) => {
|
|
665
|
+
let { showAllLevels: t, separator: n } = f;
|
|
666
|
+
return {
|
|
667
|
+
node: e,
|
|
668
|
+
key: e.uid,
|
|
669
|
+
text: e.calcText(t, n),
|
|
670
|
+
hitState: !1,
|
|
671
|
+
closable: !T.value && !e.isDisabled
|
|
672
|
+
};
|
|
673
|
+
}, ct = (e) => {
|
|
674
|
+
let t = e.node;
|
|
675
|
+
t.doCheck(!1), j.value?.calculateCheckedValue(), p("removeTag", t.valueByOption);
|
|
676
|
+
}, ut = () => {
|
|
677
|
+
switch (f.showCheckedStrategy) {
|
|
678
|
+
case "child": return Ke.value;
|
|
679
|
+
case "parent": {
|
|
680
|
+
let e = _t(!1), t = e.map((e) => e.value);
|
|
681
|
+
return e.filter((e) => !e.parent || !t.includes(e.parent.value));
|
|
682
|
+
}
|
|
683
|
+
default: return [];
|
|
684
|
+
}
|
|
685
|
+
}, dt = () => {
|
|
686
|
+
if (!Q.value) return;
|
|
687
|
+
let e = ut(), t = [];
|
|
688
|
+
e.forEach((e) => t.push(st(e))), H.value = t;
|
|
689
|
+
}, ft = () => {
|
|
690
|
+
let { filterMethod: e, showAllLevels: t, separator: n } = f, r = j.value?.getFlattedNodes(!f.props.checkStrictly)?.filter((r) => r.isDisabled ? !1 : (r.calcText(t, n), e(r, Ge.value)));
|
|
691
|
+
Q.value && H.value.forEach((e) => {
|
|
692
|
+
e.hitState = !1;
|
|
693
|
+
}), N.value = !0, Ce.value = r, at();
|
|
694
|
+
}, ht = () => {
|
|
695
|
+
let e;
|
|
696
|
+
e = N.value && ye.value ? ye.value.$el.querySelector(`.${x.e("suggestion-item")}`) : j.value?.$el.querySelector(`.${x.b("node")}[tabindex="-1"]`), e && (e.focus(), !N.value && e.getAttribute("aria-haspopup") === "true" && e.click());
|
|
697
|
+
}, gt = () => {
|
|
698
|
+
let e = A.value?.input, t = _e.value, n = ye.value?.$el;
|
|
699
|
+
if (!(!l || !e)) {
|
|
700
|
+
if (n) {
|
|
701
|
+
let t = n.querySelector(`.${x.e("suggestion-list")}`);
|
|
702
|
+
t.style.minWidth = `${e.offsetWidth}px`;
|
|
703
|
+
}
|
|
704
|
+
if (t) {
|
|
705
|
+
let { offsetHeight: n } = t, r = H.value.length > 0 ? `${Math.max(n, _) - 2}px` : `${_}px`;
|
|
706
|
+
if (e.style.height = r, h.prefix) {
|
|
707
|
+
let e = A.value?.$el.querySelector(`.${C.e("prefix")}`), n = 0;
|
|
708
|
+
e && (n = e.offsetWidth, n > 0 && (n += re[He.value || "default"])), t.style.left = `${n}px`;
|
|
709
|
+
} else t.style.left = "0";
|
|
710
|
+
at();
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}, _t = (e) => j.value?.getCheckedNodes(e), vt = (e) => {
|
|
714
|
+
at(), p("expandChange", e);
|
|
715
|
+
}, yt = (t) => {
|
|
716
|
+
if (!E.value) switch (e(t)) {
|
|
717
|
+
case n.enter:
|
|
718
|
+
case n.numpadEnter:
|
|
719
|
+
$();
|
|
720
|
+
break;
|
|
721
|
+
case n.down:
|
|
722
|
+
$(!0), we(ht), t.preventDefault();
|
|
723
|
+
break;
|
|
724
|
+
case n.esc:
|
|
725
|
+
M.value === !0 && (t.preventDefault(), t.stopPropagation(), $(!1));
|
|
726
|
+
break;
|
|
727
|
+
case n.tab:
|
|
728
|
+
$(!1);
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
}, bt = () => {
|
|
732
|
+
j.value?.clearCheckedNodes(), !M.value && f.filterable && xt(), $(!1), p("clear");
|
|
733
|
+
}, xt = () => {
|
|
734
|
+
let { value: e } = Ze;
|
|
735
|
+
Se.value = e, V.value = e;
|
|
736
|
+
}, St = (e) => {
|
|
737
|
+
let { checked: t } = e;
|
|
738
|
+
Q.value ? j.value?.handleCheckChange(e, !t, !1) : (!t && j.value?.handleCheckChange(e, !0, !1), $(!1));
|
|
739
|
+
}, Ct = (t) => {
|
|
740
|
+
let r = t.target, i = e(t);
|
|
741
|
+
switch (i) {
|
|
742
|
+
case n.up:
|
|
743
|
+
case n.down:
|
|
744
|
+
t.preventDefault(), me(fe(r, i === n.up ? -1 : 1, `.${x.e("suggestion-item")}[tabindex="-1"]`));
|
|
745
|
+
break;
|
|
746
|
+
case n.enter:
|
|
747
|
+
case n.numpadEnter:
|
|
748
|
+
r.click();
|
|
749
|
+
break;
|
|
750
|
+
}
|
|
751
|
+
}, wt = () => {
|
|
752
|
+
let e = H.value[H.value.length - 1];
|
|
753
|
+
y = V.value ? 0 : y + 1, !(!e || !y || f.collapseTags && H.value.length > 1) && (e.hitState ? ct(e) : e.hitState = !0);
|
|
754
|
+
}, Tt = g(() => {
|
|
755
|
+
let { value: e } = Ge;
|
|
756
|
+
if (!e) return;
|
|
757
|
+
let t = f.beforeFilter(e);
|
|
758
|
+
a(t) ? t.then(ft).catch(() => {}) : t === !1 ? ot() : ft();
|
|
759
|
+
}, F(() => f.debounce)), Et = (e, t) => {
|
|
760
|
+
if (!M.value && $(!0), !t?.isComposing) if (e) Tt();
|
|
761
|
+
else {
|
|
762
|
+
let e = f.beforeFilter("");
|
|
763
|
+
a(e) && e.catch(() => {}), ot();
|
|
764
|
+
}
|
|
765
|
+
}, Dt = (e) => Number.parseFloat(d(C.cssVarName("input-height"), e).value) - 2;
|
|
766
|
+
return Y(N, at), Y([
|
|
767
|
+
Ke,
|
|
768
|
+
T,
|
|
769
|
+
() => f.collapseTags,
|
|
770
|
+
() => f.maxCollapseTags
|
|
771
|
+
], dt), Y(H, () => {
|
|
772
|
+
we(() => gt());
|
|
773
|
+
}), Y(He, async () => {
|
|
774
|
+
await we();
|
|
775
|
+
let e = A.value.input;
|
|
776
|
+
_ = Dt(e) || _, gt();
|
|
777
|
+
}), Y(Ze, xt, { immediate: !0 }), Y(() => M.value, (e) => {
|
|
778
|
+
e && f.props.lazy && f.props.lazyLoad && j.value?.loadLazyRootNodes();
|
|
779
|
+
}), De(() => {
|
|
780
|
+
let e = A.value.input, t = Dt(e);
|
|
781
|
+
_ = e.offsetHeight || t, o(e, gt);
|
|
782
|
+
}), s({
|
|
783
|
+
getCheckedNodes: _t,
|
|
784
|
+
cascaderPanelRef: j,
|
|
785
|
+
togglePopperVisible: $,
|
|
786
|
+
contentRef: rt,
|
|
787
|
+
presentText: Ze,
|
|
788
|
+
focus: () => {
|
|
789
|
+
A.value?.focus();
|
|
790
|
+
},
|
|
791
|
+
blur: () => {
|
|
792
|
+
A.value?.blur();
|
|
793
|
+
}
|
|
794
|
+
}), (e, t) => (W(), I(J(ae), {
|
|
795
|
+
ref_key: "tooltipRef",
|
|
796
|
+
ref: O,
|
|
797
|
+
visible: M.value,
|
|
798
|
+
teleported: i.teleported,
|
|
799
|
+
"popper-class": [J(x).e("dropdown"), i.popperClass],
|
|
800
|
+
"popper-style": i.popperStyle,
|
|
801
|
+
"popper-options": u,
|
|
802
|
+
"fallback-placements": i.fallbackPlacements,
|
|
803
|
+
"stop-popper-mouse-event": !1,
|
|
804
|
+
"gpu-acceleration": !1,
|
|
805
|
+
placement: i.placement,
|
|
806
|
+
transition: `${J(x).namespace.value}-zoom-in-top`,
|
|
807
|
+
effect: i.effect,
|
|
808
|
+
pure: "",
|
|
809
|
+
persistent: i.persistent,
|
|
810
|
+
onHide: ot
|
|
811
|
+
}, {
|
|
812
|
+
default: X(() => [Ie((W(), R("div", {
|
|
813
|
+
ref_key: "wrapperRef",
|
|
814
|
+
ref: qe,
|
|
815
|
+
class: U(et.value),
|
|
816
|
+
style: Te(ke.value),
|
|
817
|
+
onClick: t[8] ||= () => $(We.value ? void 0 : !0),
|
|
818
|
+
onKeydown: yt,
|
|
819
|
+
onMouseenter: t[9] ||= (e) => be.value = !0,
|
|
820
|
+
onMouseleave: t[10] ||= (e) => be.value = !1
|
|
821
|
+
}, [B(J(ge), {
|
|
822
|
+
ref_key: "inputRef",
|
|
823
|
+
ref: A,
|
|
824
|
+
modelValue: Se.value,
|
|
825
|
+
"onUpdate:modelValue": t[1] ||= (e) => Se.value = e,
|
|
826
|
+
placeholder: Ve.value,
|
|
827
|
+
readonly: We.value,
|
|
828
|
+
disabled: J(T),
|
|
829
|
+
"validate-event": !1,
|
|
830
|
+
size: J(He),
|
|
831
|
+
class: U(nt.value),
|
|
832
|
+
tabindex: Q.value && i.filterable && !J(T) ? -1 : void 0,
|
|
833
|
+
onCompositionstart: J(D),
|
|
834
|
+
onCompositionupdate: J(D),
|
|
835
|
+
onCompositionend: J(D),
|
|
836
|
+
onInput: Et
|
|
837
|
+
}, xe({
|
|
838
|
+
suffix: X(() => [Xe.value ? (W(), I(J(k), {
|
|
839
|
+
key: "clear",
|
|
840
|
+
class: U([J(C).e("icon"), "icon-circle-close"]),
|
|
841
|
+
onClick: Z(bt, ["stop"])
|
|
842
|
+
}, {
|
|
843
|
+
default: X(() => [(W(), I(je(i.clearIcon)))]),
|
|
844
|
+
_: 1
|
|
845
|
+
}, 8, ["class"])) : (W(), I(J(k), {
|
|
846
|
+
key: "arrow-down",
|
|
847
|
+
class: U(tt.value),
|
|
848
|
+
onClick: t[0] ||= Z((e) => $(), ["stop"])
|
|
849
|
+
}, {
|
|
850
|
+
default: X(() => [B(J(Re))]),
|
|
851
|
+
_: 1
|
|
852
|
+
}, 8, ["class"]))]),
|
|
853
|
+
_: 2
|
|
854
|
+
}, [e.$slots.prefix ? {
|
|
855
|
+
name: "prefix",
|
|
856
|
+
fn: X(() => [K(e.$slots, "prefix")]),
|
|
857
|
+
key: "0"
|
|
858
|
+
} : void 0]), 1032, [
|
|
859
|
+
"modelValue",
|
|
860
|
+
"placeholder",
|
|
861
|
+
"readonly",
|
|
862
|
+
"disabled",
|
|
863
|
+
"size",
|
|
864
|
+
"class",
|
|
865
|
+
"tabindex",
|
|
866
|
+
"onCompositionstart",
|
|
867
|
+
"onCompositionupdate",
|
|
868
|
+
"onCompositionend"
|
|
869
|
+
]), Q.value ? (W(), R("div", {
|
|
870
|
+
key: 0,
|
|
871
|
+
ref_key: "tagWrapper",
|
|
872
|
+
ref: _e,
|
|
873
|
+
class: U([J(x).e("tags"), J(x).is("validate", !!Qe.value)])
|
|
874
|
+
}, [
|
|
875
|
+
K(e.$slots, "tag", {
|
|
876
|
+
data: H.value,
|
|
877
|
+
deleteTag: ct
|
|
878
|
+
}, () => [(W(!0), R(P, null, Ae(Ee.value, (e) => (W(), I(J(ve), {
|
|
879
|
+
key: e.key,
|
|
880
|
+
type: i.tagType,
|
|
881
|
+
size: Ue.value,
|
|
882
|
+
effect: i.tagEffect,
|
|
883
|
+
hit: e.hitState,
|
|
884
|
+
closable: e.closable,
|
|
885
|
+
"disable-transitions": "",
|
|
886
|
+
onClose: (t) => ct(e)
|
|
887
|
+
}, {
|
|
888
|
+
default: X(() => [z("span", null, q(e.text), 1)]),
|
|
889
|
+
_: 2
|
|
890
|
+
}, 1032, [
|
|
891
|
+
"type",
|
|
892
|
+
"size",
|
|
893
|
+
"effect",
|
|
894
|
+
"hit",
|
|
895
|
+
"closable",
|
|
896
|
+
"onClose"
|
|
897
|
+
]))), 128))]),
|
|
898
|
+
i.collapseTags && H.value.length > i.maxCollapseTags ? (W(), I(J(ae), {
|
|
899
|
+
key: 0,
|
|
900
|
+
ref_key: "tagTooltipRef",
|
|
901
|
+
ref: pe,
|
|
902
|
+
disabled: M.value || !i.collapseTagsTooltip,
|
|
903
|
+
"fallback-placements": [
|
|
904
|
+
"bottom",
|
|
905
|
+
"top",
|
|
906
|
+
"right",
|
|
907
|
+
"left"
|
|
908
|
+
],
|
|
909
|
+
placement: "bottom",
|
|
910
|
+
"popper-class": i.popperClass,
|
|
911
|
+
"popper-style": i.popperStyle,
|
|
912
|
+
effect: i.effect,
|
|
913
|
+
persistent: i.persistent
|
|
914
|
+
}, {
|
|
915
|
+
default: X(() => [B(J(ve), {
|
|
916
|
+
closable: !1,
|
|
917
|
+
size: Ue.value,
|
|
918
|
+
type: i.tagType,
|
|
919
|
+
effect: i.tagEffect,
|
|
920
|
+
"disable-transitions": ""
|
|
921
|
+
}, {
|
|
922
|
+
default: X(() => [z("span", { class: U(J(x).e("tags-text")) }, " + " + q(H.value.length - i.maxCollapseTags), 3)]),
|
|
923
|
+
_: 1
|
|
924
|
+
}, 8, [
|
|
925
|
+
"size",
|
|
926
|
+
"type",
|
|
927
|
+
"effect"
|
|
928
|
+
])]),
|
|
929
|
+
content: X(() => [B(J(le), { "max-height": i.maxCollapseTagsTooltipHeight }, {
|
|
930
|
+
default: X(() => [z("div", { class: U(J(x).e("collapse-tags")) }, [(W(!0), R(P, null, Ae(Oe.value, (e, t) => (W(), R("div", {
|
|
931
|
+
key: t,
|
|
932
|
+
class: U(J(x).e("collapse-tag"))
|
|
933
|
+
}, [(W(), I(J(ve), {
|
|
934
|
+
key: e.key,
|
|
935
|
+
class: "in-tooltip",
|
|
936
|
+
type: i.tagType,
|
|
937
|
+
size: Ue.value,
|
|
938
|
+
effect: i.tagEffect,
|
|
939
|
+
hit: e.hitState,
|
|
940
|
+
closable: e.closable,
|
|
941
|
+
"disable-transitions": "",
|
|
942
|
+
onClose: (t) => ct(e)
|
|
943
|
+
}, {
|
|
944
|
+
default: X(() => [z("span", null, q(e.text), 1)]),
|
|
945
|
+
_: 2
|
|
946
|
+
}, 1032, [
|
|
947
|
+
"type",
|
|
948
|
+
"size",
|
|
949
|
+
"effect",
|
|
950
|
+
"hit",
|
|
951
|
+
"closable",
|
|
952
|
+
"onClose"
|
|
953
|
+
]))], 2))), 128))], 2)]),
|
|
954
|
+
_: 1
|
|
955
|
+
}, 8, ["max-height"])]),
|
|
956
|
+
_: 1
|
|
957
|
+
}, 8, [
|
|
958
|
+
"disabled",
|
|
959
|
+
"popper-class",
|
|
960
|
+
"popper-style",
|
|
961
|
+
"effect",
|
|
962
|
+
"persistent"
|
|
963
|
+
])) : L("v-if", !0),
|
|
964
|
+
i.filterable && !J(T) ? Ie((W(), R("input", {
|
|
965
|
+
key: 1,
|
|
966
|
+
"onUpdate:modelValue": t[2] ||= (e) => V.value = e,
|
|
967
|
+
type: "text",
|
|
968
|
+
class: U(J(x).e("search-input")),
|
|
969
|
+
placeholder: Ze.value ? "" : ze.value,
|
|
970
|
+
onInput: t[3] ||= (e) => Et(V.value, e),
|
|
971
|
+
onClick: t[4] ||= Z((e) => $(!0), ["stop"]),
|
|
972
|
+
onKeydown: Le(wt, ["delete"]),
|
|
973
|
+
onCompositionstart: t[5] ||= (...e) => J(D) && J(D)(...e),
|
|
974
|
+
onCompositionupdate: t[6] ||= (...e) => J(D) && J(D)(...e),
|
|
975
|
+
onCompositionend: t[7] ||= (...e) => J(D) && J(D)(...e)
|
|
976
|
+
}, null, 42, pt)), [[Pe, V.value]]) : L("v-if", !0)
|
|
977
|
+
], 2)) : L("v-if", !0)], 38)), [[
|
|
978
|
+
J(ue),
|
|
979
|
+
it,
|
|
980
|
+
rt.value
|
|
981
|
+
]])]),
|
|
982
|
+
content: X(() => [
|
|
983
|
+
e.$slots.header ? (W(), R("div", {
|
|
984
|
+
key: 0,
|
|
985
|
+
class: U(J(x).e("header")),
|
|
986
|
+
onClick: t[11] ||= Z(() => {}, ["stop"])
|
|
987
|
+
}, [K(e.$slots, "header")], 2)) : L("v-if", !0),
|
|
988
|
+
Ie(B(J(lt), {
|
|
989
|
+
ref_key: "cascaderPanelRef",
|
|
990
|
+
ref: j,
|
|
991
|
+
modelValue: $e.value,
|
|
992
|
+
"onUpdate:modelValue": t[12] ||= (e) => $e.value = e,
|
|
993
|
+
options: i.options,
|
|
994
|
+
props: f.props,
|
|
995
|
+
border: !1,
|
|
996
|
+
"render-label": e.$slots.default,
|
|
997
|
+
onExpandChange: vt,
|
|
998
|
+
onClose: t[13] ||= (t) => e.$nextTick(() => $(!1))
|
|
999
|
+
}, {
|
|
1000
|
+
empty: X(() => [K(e.$slots, "empty")]),
|
|
1001
|
+
_: 3
|
|
1002
|
+
}, 8, [
|
|
1003
|
+
"modelValue",
|
|
1004
|
+
"options",
|
|
1005
|
+
"props",
|
|
1006
|
+
"render-label"
|
|
1007
|
+
]), [[Fe, !N.value]]),
|
|
1008
|
+
i.filterable ? Ie((W(), I(J(le), {
|
|
1009
|
+
key: 1,
|
|
1010
|
+
ref_key: "suggestionPanel",
|
|
1011
|
+
ref: ye,
|
|
1012
|
+
tag: "ul",
|
|
1013
|
+
class: U(J(x).e("suggestion-panel")),
|
|
1014
|
+
"view-class": J(x).e("suggestion-list"),
|
|
1015
|
+
onKeydown: Ct
|
|
1016
|
+
}, {
|
|
1017
|
+
default: X(() => [Ce.value.length ? (W(!0), R(P, { key: 0 }, Ae(Ce.value, (t) => (W(), R("li", {
|
|
1018
|
+
key: t.uid,
|
|
1019
|
+
class: U([J(x).e("suggestion-item"), J(x).is("checked", t.checked)]),
|
|
1020
|
+
tabindex: -1,
|
|
1021
|
+
onClick: (e) => St(t)
|
|
1022
|
+
}, [K(e.$slots, "suggestion-item", { item: t }, () => [z("span", null, q(t.text), 1), t.checked ? (W(), I(J(k), { key: 0 }, {
|
|
1023
|
+
default: X(() => [B(J(Be))]),
|
|
1024
|
+
_: 1
|
|
1025
|
+
})) : L("v-if", !0)])], 10, mt))), 128)) : K(e.$slots, "empty", { key: 1 }, () => [z("li", { class: U(J(x).e("empty-text")) }, q(J(w)("el.cascader.noMatch")), 3)])]),
|
|
1026
|
+
_: 3
|
|
1027
|
+
}, 8, ["class", "view-class"])), [[Fe, N.value]]) : L("v-if", !0),
|
|
1028
|
+
e.$slots.footer ? (W(), R("div", {
|
|
1029
|
+
key: 2,
|
|
1030
|
+
class: U(J(x).e("footer")),
|
|
1031
|
+
onClick: t[14] ||= Z(() => {}, ["stop"])
|
|
1032
|
+
}, [K(e.$slots, "footer")], 2)) : L("v-if", !0)
|
|
1033
|
+
]),
|
|
1034
|
+
_: 3
|
|
1035
|
+
}, 8, [
|
|
1036
|
+
"visible",
|
|
1037
|
+
"teleported",
|
|
1038
|
+
"popper-class",
|
|
1039
|
+
"popper-style",
|
|
1040
|
+
"fallback-placements",
|
|
1041
|
+
"placement",
|
|
1042
|
+
"transition",
|
|
1043
|
+
"effect",
|
|
1044
|
+
"persistent"
|
|
1045
|
+
]));
|
|
1046
|
+
}
|
|
1047
|
+
})), gt = /* @__PURE__ */ V({
|
|
1048
|
+
__name: "Cascader",
|
|
1049
|
+
props: {
|
|
1050
|
+
item: {
|
|
1051
|
+
type: Object,
|
|
1052
|
+
required: !0
|
|
1053
|
+
},
|
|
1054
|
+
formModel: {
|
|
1055
|
+
type: Object,
|
|
1056
|
+
required: !0
|
|
1057
|
+
},
|
|
1058
|
+
globalConfig: {
|
|
1059
|
+
type: Object,
|
|
1060
|
+
required: !0
|
|
1061
|
+
},
|
|
1062
|
+
dictMap: {
|
|
1063
|
+
type: Object,
|
|
1064
|
+
required: !0
|
|
1065
|
+
},
|
|
1066
|
+
formItemWidth: {
|
|
1067
|
+
type: String,
|
|
1068
|
+
required: !0
|
|
1069
|
+
}
|
|
1070
|
+
},
|
|
1071
|
+
setup(e, { expose: t }) {
|
|
1072
|
+
let n = e, r = F(() => n.item.cascaderConfig), i = F(() => {
|
|
1073
|
+
let e = M(n.item.dict, n.item.label);
|
|
1074
|
+
return r.value?.options || e && n.dictMap[e] || void 0;
|
|
1075
|
+
}), a = F(() => r.value?.props || n.globalConfig.finalDictProps), o = (e) => {
|
|
1076
|
+
if (Object.hasOwn(r.value, "onChange") && typeof r.value?.onChange == "function") {
|
|
1077
|
+
let t = i.value?.find((t) => t[r.value?.props?.value || n.globalConfig.finalDictProps.value] === e);
|
|
1078
|
+
r.value.onChange({
|
|
1079
|
+
value: e,
|
|
1080
|
+
item: n.item,
|
|
1081
|
+
option: t,
|
|
1082
|
+
cascaderRef: s
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
}, s = G(null);
|
|
1086
|
+
return t({ cascaderRef: s }), (t, n) => {
|
|
1087
|
+
let c = be, l = ht;
|
|
1088
|
+
return r.value.useRender ? (W(), I(c, {
|
|
1089
|
+
key: 0,
|
|
1090
|
+
content: e.formModel[e.item.prop],
|
|
1091
|
+
class: U(typeof r.value.useRender == "object" && r.value.useRender.class),
|
|
1092
|
+
style: Te(typeof r.value.useRender == "object" && r.value.useRender.style)
|
|
1093
|
+
}, null, 8, [
|
|
1094
|
+
"content",
|
|
1095
|
+
"class",
|
|
1096
|
+
"style"
|
|
1097
|
+
])) : (W(), I(l, {
|
|
1098
|
+
key: 1,
|
|
1099
|
+
ref_key: "cascaderRef",
|
|
1100
|
+
ref: s,
|
|
1101
|
+
modelValue: e.formModel[e.item.prop],
|
|
1102
|
+
"onUpdate:modelValue": n[0] ||= (t) => e.formModel[e.item.prop] = t,
|
|
1103
|
+
options: i.value,
|
|
1104
|
+
props: a.value,
|
|
1105
|
+
clearable: r.value.clearable ?? !0,
|
|
1106
|
+
disabled: r.value.disabled || !1,
|
|
1107
|
+
style: Te({ width: r.value.width ?? e.formItemWidth }),
|
|
1108
|
+
onChange: o
|
|
1109
|
+
}, null, 8, [
|
|
1110
|
+
"modelValue",
|
|
1111
|
+
"options",
|
|
1112
|
+
"props",
|
|
1113
|
+
"clearable",
|
|
1114
|
+
"disabled",
|
|
1115
|
+
"style"
|
|
1116
|
+
]));
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
});
|
|
1120
|
+
//#endregion
|
|
1121
|
+
export { gt as default };
|