st-comp 0.0.69 → 0.0.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ChartLayout.cjs.js +1 -0
- package/lib/ChartLayout.es.js +72 -0
- package/lib/Dialog.cjs.js +1 -0
- package/lib/Dialog.es.js +90 -0
- package/lib/HeatMap.cjs.js +1 -0
- package/lib/HeatMap.es.js +118 -0
- package/lib/Kline.cjs.js +1 -0
- package/lib/Kline.es.js +2631 -0
- package/lib/KlineNew.cjs.js +1 -0
- package/lib/KlineNew.es.js +614 -0
- package/lib/LinearLegend.cjs.js +1 -0
- package/lib/LinearLegend.es.js +63 -0
- package/lib/Map.cjs.js +1 -0
- package/lib/{bundle.js → Map.es.js} +43 -41503
- package/lib/Pagination.cjs.js +1 -0
- package/lib/Pagination.es.js +625 -0
- package/lib/Pie.cjs.js +2 -0
- package/lib/Pie.es.js +160 -0
- package/lib/Table.cjs.js +20 -0
- package/lib/Table.es.js +4007 -0
- package/lib/TreeMap.cjs.js +2 -0
- package/lib/TreeMap.es.js +163 -0
- package/lib/VarietySearch.cjs.js +12 -0
- package/lib/VarietySearch.es.js +3336 -0
- package/lib/VirtualTable.cjs.js +13 -0
- package/lib/VirtualTable.es.js +2680 -0
- package/lib/_commonjsHelpers-10dfc225.js +8 -0
- package/lib/_commonjsHelpers-87b0abe8.cjs +1 -0
- package/lib/_plugin-vue_export-helper-dad06003.js +9 -0
- package/lib/_plugin-vue_export-helper-f246444f.cjs +1 -0
- package/lib/base-4865d432.cjs +9 -0
- package/lib/base-a240bf62.js +762 -0
- package/lib/bundle.cjs.js +1 -0
- package/lib/bundle.es.js +46 -0
- package/lib/bundle.umd-4967d574.js +16091 -0
- package/lib/bundle.umd-c5698c50.cjs +71 -0
- package/lib/castArray-3341cbb4.cjs +1 -0
- package/lib/castArray-a723a736.js +10 -0
- package/lib/config-provider-3db4dac6.js +148 -0
- package/lib/config-provider-cf4edc1e.cjs +1 -0
- package/lib/el-button-c24606d0.cjs +1 -0
- package/lib/el-button-fa6a5742.js +231 -0
- package/lib/el-empty-282e5e93.js +204 -0
- package/lib/el-empty-608948d9.cjs +1 -0
- package/lib/el-icon-7718f55e.cjs +1 -0
- package/lib/el-icon-d9ef9ccc.js +592 -0
- package/lib/el-overlay-7fceb816.cjs +5 -0
- package/lib/el-overlay-9b7bdd18.js +678 -0
- package/lib/el-scrollbar-7dc53299.js +248 -0
- package/lib/el-scrollbar-bc381e35.cjs +1 -0
- package/lib/el-select-85ed2643.js +1894 -0
- package/lib/el-select-a50741c1.cjs +9 -0
- package/lib/el-tag-308f715a.js +2416 -0
- package/lib/el-tag-87fd3960.cjs +1 -0
- package/lib/el-tooltip-0ea8fbf8.cjs +1 -0
- package/lib/el-tooltip-4ed993c7.js +1 -0
- package/lib/focus-trap-2a734f35.cjs +3 -0
- package/lib/focus-trap-6922b96b.js +376 -0
- package/lib/index-1508a06b.js +556 -0
- package/lib/index-48a9f60d.cjs +1 -0
- package/lib/index-657047bb.js +513 -0
- package/lib/index-eea0bcb3.cjs +1 -0
- package/lib/index.esm-8d9a2abe.js +2432 -0
- package/lib/index.esm-94a95a2a.cjs +3 -0
- package/lib/raf-5e5c53db.cjs +1 -0
- package/lib/raf-fc8a56cf.js +6 -0
- package/lib/scroll-bb8039ba.cjs +1 -0
- package/lib/scroll-cfdae01b.js +35 -0
- package/lib/style.css +1 -1
- package/lib/typescript-7ae59c4c.js +4 -0
- package/lib/typescript-b63f8e83.cjs +1 -0
- package/lib/vnode-a9714179.js +14 -0
- package/lib/vnode-abafec9e.cjs +1 -0
- package/lib/zh-cn-92978806.js +134 -0
- package/lib/zh-cn-d4df7172.cjs +1 -0
- package/package.json +3 -3
- package/packages/Kline/componentsNew/KlineUtils/index.vue +2 -3
- package/lib/bundle.umd.cjs +0 -139
|
@@ -0,0 +1,1894 @@
|
|
|
1
|
+
import { computed as v, getCurrentInstance as sl, ref as K, shallowRef as Re, watch as W, defineComponent as ge, useAttrs as nt, useSlots as ot, nextTick as D, onMounted as ml, toRef as it, withDirectives as He, openBlock as y, createElementBlock as L, mergeProps as El, unref as a, createCommentVNode as I, Fragment as Ae, normalizeClass as S, renderSlot as X, createElementVNode as z, createBlock as V, withCtx as k, resolveDynamicComponent as Ne, withModifiers as ee, createVNode as he, toDisplayString as Y, normalizeStyle as se, vShow as hl, Transition as $l, inject as cl, toRaw as pl, reactive as bl, toRefs as Vl, onBeforeUnmount as at, triggerRef as ol, provide as Ql, resolveComponent as Ee, resolveDirective as st, renderList as Tl, withKeys as x, vModelText as rt, createSlots as ut } from "vue";
|
|
2
|
+
import { t as dt, a as ct, u as zl, d as Fl } from "./el-scrollbar-7dc53299.js";
|
|
3
|
+
import { f as pt, i as Nl, j as ft, E as vt, C as mt, g as ht, t as bt } from "./el-tag-308f715a.js";
|
|
4
|
+
import { v as gt, j as yt, E as Te, k as Ul, n as Rl, a as Ct } from "./index-1508a06b.js";
|
|
5
|
+
import { C as Pl, j as il, Q as St, k as Ml, b as Gl, d as kl, i as al, u as be, N as wt, _ as We, e as fl, w as Al, B as le, g as Dl, H as Pe, E as Ot, R as Ll, T as It, f as Yl } from "./base-a240bf62.js";
|
|
6
|
+
import { p as Et, c as Xl, f as Tt, i as vl, U as te, k as Zl, l as kt, e as Kl, j as Lt, V as Jl, a as $t, u as Mt, E as Hl, C as xl } from "./focus-trap-6922b96b.js";
|
|
7
|
+
import { m as Vt } from "./typescript-7ae59c4c.js";
|
|
8
|
+
import { s as zt } from "./scroll-cfdae01b.js";
|
|
9
|
+
const Pt = () => Pl && /firefox/i.test(window.navigator.userAgent);
|
|
10
|
+
var Wl = 1 / 0, At = 17976931348623157e292;
|
|
11
|
+
function Dt(e) {
|
|
12
|
+
if (!e)
|
|
13
|
+
return e === 0 ? e : 0;
|
|
14
|
+
if (e = dt(e), e === Wl || e === -Wl) {
|
|
15
|
+
var l = e < 0 ? -1 : 1;
|
|
16
|
+
return l * At;
|
|
17
|
+
}
|
|
18
|
+
return e === e ? e : 0;
|
|
19
|
+
}
|
|
20
|
+
function Kt(e) {
|
|
21
|
+
var l = Dt(e), o = l % 1;
|
|
22
|
+
return l === l ? o ? l - o : l : 0;
|
|
23
|
+
}
|
|
24
|
+
function Bt(e, l, o, s) {
|
|
25
|
+
for (var c = e.length, u = o + (s ? 1 : -1); s ? u-- : ++u < c; )
|
|
26
|
+
if (l(e[u], u, e))
|
|
27
|
+
return u;
|
|
28
|
+
return -1;
|
|
29
|
+
}
|
|
30
|
+
var Ft = Math.max, Nt = Math.min;
|
|
31
|
+
function Rt(e, l, o) {
|
|
32
|
+
var s = e == null ? 0 : e.length;
|
|
33
|
+
if (!s)
|
|
34
|
+
return -1;
|
|
35
|
+
var c = s - 1;
|
|
36
|
+
return o !== void 0 && (c = Kt(o), c = o < 0 ? Ft(s + c, 0) : Nt(c, s - 1)), Bt(e, pt(l), c, !0);
|
|
37
|
+
}
|
|
38
|
+
const Ht = (e = "") => e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"), Wt = (e) => Et[e || "default"], qt = (e) => ["", ...Xl].includes(e), _l = (e) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e), jt = ["class", "style"], Qt = /^on[A-Z]/, Ut = (e = {}) => {
|
|
39
|
+
const { excludeListeners: l = !1, excludeKeys: o } = e, s = v(() => ((o == null ? void 0 : o.value) || []).concat(jt)), c = sl();
|
|
40
|
+
return c ? v(() => {
|
|
41
|
+
var u;
|
|
42
|
+
return St(Object.entries((u = c.proxy) == null ? void 0 : u.$attrs).filter(([p]) => !s.value.includes(p) && !(l && Qt.test(p))));
|
|
43
|
+
}) : (il("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), v(() => ({})));
|
|
44
|
+
};
|
|
45
|
+
function Gt(e) {
|
|
46
|
+
const l = K();
|
|
47
|
+
function o() {
|
|
48
|
+
if (e.value == null)
|
|
49
|
+
return;
|
|
50
|
+
const { selectionStart: c, selectionEnd: u, value: p } = e.value;
|
|
51
|
+
if (c == null || u == null)
|
|
52
|
+
return;
|
|
53
|
+
const b = p.slice(0, Math.max(0, c)), f = p.slice(Math.max(0, u));
|
|
54
|
+
l.value = {
|
|
55
|
+
selectionStart: c,
|
|
56
|
+
selectionEnd: u,
|
|
57
|
+
value: p,
|
|
58
|
+
beforeTxt: b,
|
|
59
|
+
afterTxt: f
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function s() {
|
|
63
|
+
if (e.value == null || l.value == null)
|
|
64
|
+
return;
|
|
65
|
+
const { value: c } = e.value, { beforeTxt: u, afterTxt: p, selectionStart: b } = l.value;
|
|
66
|
+
if (u == null || p == null || b == null)
|
|
67
|
+
return;
|
|
68
|
+
let f = c.length;
|
|
69
|
+
if (c.endsWith(p))
|
|
70
|
+
f = c.length - p.length;
|
|
71
|
+
else if (c.startsWith(u))
|
|
72
|
+
f = u.length;
|
|
73
|
+
else {
|
|
74
|
+
const w = u[b - 1], g = c.indexOf(w, b - 1);
|
|
75
|
+
g !== -1 && (f = g + 1);
|
|
76
|
+
}
|
|
77
|
+
e.value.setSelectionRange(f, f);
|
|
78
|
+
}
|
|
79
|
+
return [o, s];
|
|
80
|
+
}
|
|
81
|
+
function Yt(e, { afterFocus: l, afterBlur: o } = {}) {
|
|
82
|
+
const s = sl(), { emit: c } = s, u = Re(), p = K(!1), b = (g) => {
|
|
83
|
+
p.value || (p.value = !0, c("focus", g), l == null || l());
|
|
84
|
+
}, f = (g) => {
|
|
85
|
+
var m;
|
|
86
|
+
g.relatedTarget && ((m = u.value) != null && m.contains(g.relatedTarget)) || (p.value = !1, c("blur", g), o == null || o());
|
|
87
|
+
}, w = () => {
|
|
88
|
+
var g;
|
|
89
|
+
(g = e.value) == null || g.focus();
|
|
90
|
+
};
|
|
91
|
+
return W(u, (g) => {
|
|
92
|
+
g && g.setAttribute("tabindex", "-1");
|
|
93
|
+
}), ct(u, "click", w), {
|
|
94
|
+
wrapperRef: u,
|
|
95
|
+
isFocused: p,
|
|
96
|
+
handleFocus: b,
|
|
97
|
+
handleBlur: f
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
let _;
|
|
101
|
+
const Xt = `
|
|
102
|
+
height:0 !important;
|
|
103
|
+
visibility:hidden !important;
|
|
104
|
+
${Pt() ? "" : "overflow:hidden !important;"}
|
|
105
|
+
position:absolute !important;
|
|
106
|
+
z-index:-1000 !important;
|
|
107
|
+
top:0 !important;
|
|
108
|
+
right:0 !important;
|
|
109
|
+
`, Zt = [
|
|
110
|
+
"letter-spacing",
|
|
111
|
+
"line-height",
|
|
112
|
+
"padding-top",
|
|
113
|
+
"padding-bottom",
|
|
114
|
+
"font-family",
|
|
115
|
+
"font-weight",
|
|
116
|
+
"font-size",
|
|
117
|
+
"text-rendering",
|
|
118
|
+
"text-transform",
|
|
119
|
+
"width",
|
|
120
|
+
"text-indent",
|
|
121
|
+
"padding-left",
|
|
122
|
+
"padding-right",
|
|
123
|
+
"border-width",
|
|
124
|
+
"box-sizing"
|
|
125
|
+
];
|
|
126
|
+
function Jt(e) {
|
|
127
|
+
const l = window.getComputedStyle(e), o = l.getPropertyValue("box-sizing"), s = Number.parseFloat(l.getPropertyValue("padding-bottom")) + Number.parseFloat(l.getPropertyValue("padding-top")), c = Number.parseFloat(l.getPropertyValue("border-bottom-width")) + Number.parseFloat(l.getPropertyValue("border-top-width"));
|
|
128
|
+
return { contextStyle: Zt.map((p) => `${p}:${l.getPropertyValue(p)}`).join(";"), paddingSize: s, borderSize: c, boxSizing: o };
|
|
129
|
+
}
|
|
130
|
+
function ql(e, l = 1, o) {
|
|
131
|
+
var s;
|
|
132
|
+
_ || (_ = document.createElement("textarea"), document.body.appendChild(_));
|
|
133
|
+
const { paddingSize: c, borderSize: u, boxSizing: p, contextStyle: b } = Jt(e);
|
|
134
|
+
_.setAttribute("style", `${b};${Xt}`), _.value = e.value || e.placeholder || "";
|
|
135
|
+
let f = _.scrollHeight;
|
|
136
|
+
const w = {};
|
|
137
|
+
p === "border-box" ? f = f + u : p === "content-box" && (f = f - c), _.value = "";
|
|
138
|
+
const g = _.scrollHeight - c;
|
|
139
|
+
if (Ml(l)) {
|
|
140
|
+
let m = g * l;
|
|
141
|
+
p === "border-box" && (m = m + c + u), f = Math.max(m, f), w.minHeight = `${m}px`;
|
|
142
|
+
}
|
|
143
|
+
if (Ml(o)) {
|
|
144
|
+
let m = g * o;
|
|
145
|
+
p === "border-box" && (m = m + c + u), f = Math.min(m, f);
|
|
146
|
+
}
|
|
147
|
+
return w.height = `${f}px`, (s = _.parentNode) == null || s.removeChild(_), _ = void 0, w;
|
|
148
|
+
}
|
|
149
|
+
const xt = Gl({
|
|
150
|
+
id: {
|
|
151
|
+
type: String,
|
|
152
|
+
default: void 0
|
|
153
|
+
},
|
|
154
|
+
size: Tt,
|
|
155
|
+
disabled: Boolean,
|
|
156
|
+
modelValue: {
|
|
157
|
+
type: kl([
|
|
158
|
+
String,
|
|
159
|
+
Number,
|
|
160
|
+
Object
|
|
161
|
+
]),
|
|
162
|
+
default: ""
|
|
163
|
+
},
|
|
164
|
+
type: {
|
|
165
|
+
type: String,
|
|
166
|
+
default: "text"
|
|
167
|
+
},
|
|
168
|
+
resize: {
|
|
169
|
+
type: String,
|
|
170
|
+
values: ["none", "both", "horizontal", "vertical"]
|
|
171
|
+
},
|
|
172
|
+
autosize: {
|
|
173
|
+
type: kl([Boolean, Object]),
|
|
174
|
+
default: !1
|
|
175
|
+
},
|
|
176
|
+
autocomplete: {
|
|
177
|
+
type: String,
|
|
178
|
+
default: "off"
|
|
179
|
+
},
|
|
180
|
+
formatter: {
|
|
181
|
+
type: Function
|
|
182
|
+
},
|
|
183
|
+
parser: {
|
|
184
|
+
type: Function
|
|
185
|
+
},
|
|
186
|
+
placeholder: {
|
|
187
|
+
type: String
|
|
188
|
+
},
|
|
189
|
+
form: {
|
|
190
|
+
type: String
|
|
191
|
+
},
|
|
192
|
+
readonly: {
|
|
193
|
+
type: Boolean,
|
|
194
|
+
default: !1
|
|
195
|
+
},
|
|
196
|
+
clearable: {
|
|
197
|
+
type: Boolean,
|
|
198
|
+
default: !1
|
|
199
|
+
},
|
|
200
|
+
showPassword: {
|
|
201
|
+
type: Boolean,
|
|
202
|
+
default: !1
|
|
203
|
+
},
|
|
204
|
+
showWordLimit: {
|
|
205
|
+
type: Boolean,
|
|
206
|
+
default: !1
|
|
207
|
+
},
|
|
208
|
+
suffixIcon: {
|
|
209
|
+
type: vl
|
|
210
|
+
},
|
|
211
|
+
prefixIcon: {
|
|
212
|
+
type: vl
|
|
213
|
+
},
|
|
214
|
+
containerRole: {
|
|
215
|
+
type: String,
|
|
216
|
+
default: void 0
|
|
217
|
+
},
|
|
218
|
+
label: {
|
|
219
|
+
type: String,
|
|
220
|
+
default: void 0
|
|
221
|
+
},
|
|
222
|
+
tabindex: {
|
|
223
|
+
type: [String, Number],
|
|
224
|
+
default: 0
|
|
225
|
+
},
|
|
226
|
+
validateEvent: {
|
|
227
|
+
type: Boolean,
|
|
228
|
+
default: !0
|
|
229
|
+
},
|
|
230
|
+
inputStyle: {
|
|
231
|
+
type: kl([Object, Array, String]),
|
|
232
|
+
default: () => Vt({})
|
|
233
|
+
},
|
|
234
|
+
autofocus: {
|
|
235
|
+
type: Boolean,
|
|
236
|
+
default: !1
|
|
237
|
+
}
|
|
238
|
+
}), _t = {
|
|
239
|
+
[te]: (e) => al(e),
|
|
240
|
+
input: (e) => al(e),
|
|
241
|
+
change: (e) => al(e),
|
|
242
|
+
focus: (e) => e instanceof FocusEvent,
|
|
243
|
+
blur: (e) => e instanceof FocusEvent,
|
|
244
|
+
clear: () => !0,
|
|
245
|
+
mouseleave: (e) => e instanceof MouseEvent,
|
|
246
|
+
mouseenter: (e) => e instanceof MouseEvent,
|
|
247
|
+
keydown: (e) => e instanceof Event,
|
|
248
|
+
compositionstart: (e) => e instanceof CompositionEvent,
|
|
249
|
+
compositionupdate: (e) => e instanceof CompositionEvent,
|
|
250
|
+
compositionend: (e) => e instanceof CompositionEvent
|
|
251
|
+
}, en = ["role"], ln = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus"], tn = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus"], nn = ge({
|
|
252
|
+
name: "ElInput",
|
|
253
|
+
inheritAttrs: !1
|
|
254
|
+
}), on = /* @__PURE__ */ ge({
|
|
255
|
+
...nn,
|
|
256
|
+
props: xt,
|
|
257
|
+
emits: _t,
|
|
258
|
+
setup(e, { expose: l, emit: o }) {
|
|
259
|
+
const s = e, c = nt(), u = ot(), p = v(() => {
|
|
260
|
+
const r = {};
|
|
261
|
+
return s.containerRole === "combobox" && (r["aria-haspopup"] = c["aria-haspopup"], r["aria-owns"] = c["aria-owns"], r["aria-expanded"] = c["aria-expanded"]), r;
|
|
262
|
+
}), b = v(() => [
|
|
263
|
+
s.type === "textarea" ? O.b() : n.b(),
|
|
264
|
+
n.m(A.value),
|
|
265
|
+
n.is("disabled", $.value),
|
|
266
|
+
n.is("exceed", Ue.value),
|
|
267
|
+
{
|
|
268
|
+
[n.b("group")]: u.prepend || u.append,
|
|
269
|
+
[n.bm("group", "append")]: u.append,
|
|
270
|
+
[n.bm("group", "prepend")]: u.prepend,
|
|
271
|
+
[n.m("prefix")]: u.prefix || s.prefixIcon,
|
|
272
|
+
[n.m("suffix")]: u.suffix || s.suffixIcon || s.clearable || s.showPassword,
|
|
273
|
+
[n.bm("suffix", "password-clear")]: ue.value && Ce.value
|
|
274
|
+
},
|
|
275
|
+
c.class
|
|
276
|
+
]), f = v(() => [
|
|
277
|
+
n.e("wrapper"),
|
|
278
|
+
n.is("focus", ye.value)
|
|
279
|
+
]), w = Ut({
|
|
280
|
+
excludeKeys: v(() => Object.keys(p.value))
|
|
281
|
+
}), { form: g, formItem: m } = Zl(), { inputId: B } = kt(s, {
|
|
282
|
+
formItemContext: m
|
|
283
|
+
}), A = Kl(), $ = Lt(), n = be("input"), O = be("textarea"), T = Re(), E = Re(), q = K(!1), ne = K(!1), j = K(!1), De = K(), Z = Re(s.inputStyle), oe = v(() => T.value || E.value), { wrapperRef: qe, isFocused: ye, handleFocus: ie, handleBlur: P } = Yt(oe, {
|
|
284
|
+
afterBlur() {
|
|
285
|
+
var r;
|
|
286
|
+
s.validateEvent && ((r = m == null ? void 0 : m.validate) == null || r.call(m, "blur").catch((h) => il(h)));
|
|
287
|
+
}
|
|
288
|
+
}), Ke = v(() => {
|
|
289
|
+
var r;
|
|
290
|
+
return (r = g == null ? void 0 : g.statusIcon) != null ? r : !1;
|
|
291
|
+
}), re = v(() => (m == null ? void 0 : m.validateState) || ""), ae = v(() => re.value && Jl[re.value]), je = v(() => j.value ? gt : yt), Qe = v(() => [
|
|
292
|
+
c.style,
|
|
293
|
+
s.inputStyle
|
|
294
|
+
]), Q = v(() => [
|
|
295
|
+
s.inputStyle,
|
|
296
|
+
Z.value,
|
|
297
|
+
{ resize: s.resize }
|
|
298
|
+
]), F = v(() => $t(s.modelValue) ? "" : String(s.modelValue)), ue = v(() => s.clearable && !$.value && !s.readonly && !!F.value && (ye.value || q.value)), Ce = v(() => s.showPassword && !$.value && !s.readonly && !!F.value && (!!F.value || ye.value)), U = v(() => s.showWordLimit && !!w.value.maxlength && (s.type === "text" || s.type === "textarea") && !$.value && !s.readonly && !s.showPassword), Se = v(() => F.value.length), Ue = v(() => !!U.value && Se.value > Number(w.value.maxlength)), Ge = v(() => !!u.suffix || !!s.suffixIcon || ue.value || s.showPassword || U.value || !!re.value && Ke.value), [Ye, Xe] = Gt(T);
|
|
299
|
+
zl(E, (r) => {
|
|
300
|
+
if (ce(), !U.value || s.resize !== "both")
|
|
301
|
+
return;
|
|
302
|
+
const h = r[0], { width: M } = h.contentRect;
|
|
303
|
+
De.value = {
|
|
304
|
+
right: `calc(100% - ${M + 15 + 6}px)`
|
|
305
|
+
};
|
|
306
|
+
});
|
|
307
|
+
const de = () => {
|
|
308
|
+
const { type: r, autosize: h } = s;
|
|
309
|
+
if (!(!Pl || r !== "textarea" || !E.value))
|
|
310
|
+
if (h) {
|
|
311
|
+
const M = fl(h) ? h.minRows : void 0, fe = fl(h) ? h.maxRows : void 0, Ie = ql(E.value, M, fe);
|
|
312
|
+
Z.value = {
|
|
313
|
+
overflowY: "hidden",
|
|
314
|
+
...Ie
|
|
315
|
+
}, D(() => {
|
|
316
|
+
E.value.offsetHeight, Z.value = Ie;
|
|
317
|
+
});
|
|
318
|
+
} else
|
|
319
|
+
Z.value = {
|
|
320
|
+
minHeight: ql(E.value).minHeight
|
|
321
|
+
};
|
|
322
|
+
}, ce = ((r) => {
|
|
323
|
+
let h = !1;
|
|
324
|
+
return () => {
|
|
325
|
+
var M;
|
|
326
|
+
if (h || !s.autosize)
|
|
327
|
+
return;
|
|
328
|
+
((M = E.value) == null ? void 0 : M.offsetParent) === null || (r(), h = !0);
|
|
329
|
+
};
|
|
330
|
+
})(de), G = () => {
|
|
331
|
+
const r = oe.value, h = s.formatter ? s.formatter(F.value) : F.value;
|
|
332
|
+
!r || r.value === h || (r.value = h);
|
|
333
|
+
}, ke = async (r) => {
|
|
334
|
+
Ye();
|
|
335
|
+
let { value: h } = r.target;
|
|
336
|
+
if (s.formatter && (h = s.parser ? s.parser(h) : h), !ne.value) {
|
|
337
|
+
if (h === F.value) {
|
|
338
|
+
G();
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
o(te, h), o("input", h), await D(), G(), Xe();
|
|
342
|
+
}
|
|
343
|
+
}, Le = (r) => {
|
|
344
|
+
o("change", r.target.value);
|
|
345
|
+
}, we = (r) => {
|
|
346
|
+
o("compositionstart", r), ne.value = !0;
|
|
347
|
+
}, $e = (r) => {
|
|
348
|
+
var h;
|
|
349
|
+
o("compositionupdate", r);
|
|
350
|
+
const M = (h = r.target) == null ? void 0 : h.value, fe = M[M.length - 1] || "";
|
|
351
|
+
ne.value = !_l(fe);
|
|
352
|
+
}, Me = (r) => {
|
|
353
|
+
o("compositionend", r), ne.value && (ne.value = !1, ke(r));
|
|
354
|
+
}, Ve = () => {
|
|
355
|
+
j.value = !j.value, pe();
|
|
356
|
+
}, pe = async () => {
|
|
357
|
+
var r;
|
|
358
|
+
await D(), (r = oe.value) == null || r.focus();
|
|
359
|
+
}, Ze = () => {
|
|
360
|
+
var r;
|
|
361
|
+
return (r = oe.value) == null ? void 0 : r.blur();
|
|
362
|
+
}, Je = (r) => {
|
|
363
|
+
q.value = !1, o("mouseleave", r);
|
|
364
|
+
}, xe = (r) => {
|
|
365
|
+
q.value = !0, o("mouseenter", r);
|
|
366
|
+
}, Oe = (r) => {
|
|
367
|
+
o("keydown", r);
|
|
368
|
+
}, _e = () => {
|
|
369
|
+
var r;
|
|
370
|
+
(r = oe.value) == null || r.select();
|
|
371
|
+
}, Be = () => {
|
|
372
|
+
o(te, ""), o("change", ""), o("clear"), o("input", "");
|
|
373
|
+
};
|
|
374
|
+
return W(() => s.modelValue, () => {
|
|
375
|
+
var r;
|
|
376
|
+
D(() => de()), s.validateEvent && ((r = m == null ? void 0 : m.validate) == null || r.call(m, "change").catch((h) => il(h)));
|
|
377
|
+
}), W(F, () => G()), W(() => s.type, async () => {
|
|
378
|
+
await D(), G(), de();
|
|
379
|
+
}), ml(() => {
|
|
380
|
+
!s.formatter && s.parser && il("ElInput", "If you set the parser, you also need to set the formatter."), G(), D(de);
|
|
381
|
+
}), l({
|
|
382
|
+
input: T,
|
|
383
|
+
textarea: E,
|
|
384
|
+
ref: oe,
|
|
385
|
+
textareaStyle: Q,
|
|
386
|
+
autosize: it(s, "autosize"),
|
|
387
|
+
focus: pe,
|
|
388
|
+
blur: Ze,
|
|
389
|
+
select: _e,
|
|
390
|
+
clear: Be,
|
|
391
|
+
resizeTextarea: de
|
|
392
|
+
}), (r, h) => He((y(), L("div", El(a(p), {
|
|
393
|
+
class: a(b),
|
|
394
|
+
style: a(Qe),
|
|
395
|
+
role: r.containerRole,
|
|
396
|
+
onMouseenter: xe,
|
|
397
|
+
onMouseleave: Je
|
|
398
|
+
}), [
|
|
399
|
+
I(" input "),
|
|
400
|
+
r.type !== "textarea" ? (y(), L(Ae, { key: 0 }, [
|
|
401
|
+
I(" prepend slot "),
|
|
402
|
+
r.$slots.prepend ? (y(), L("div", {
|
|
403
|
+
key: 0,
|
|
404
|
+
class: S(a(n).be("group", "prepend"))
|
|
405
|
+
}, [
|
|
406
|
+
X(r.$slots, "prepend")
|
|
407
|
+
], 2)) : I("v-if", !0),
|
|
408
|
+
z("div", {
|
|
409
|
+
ref_key: "wrapperRef",
|
|
410
|
+
ref: qe,
|
|
411
|
+
class: S(a(f))
|
|
412
|
+
}, [
|
|
413
|
+
I(" prefix slot "),
|
|
414
|
+
r.$slots.prefix || r.prefixIcon ? (y(), L("span", {
|
|
415
|
+
key: 0,
|
|
416
|
+
class: S(a(n).e("prefix"))
|
|
417
|
+
}, [
|
|
418
|
+
z("span", {
|
|
419
|
+
class: S(a(n).e("prefix-inner"))
|
|
420
|
+
}, [
|
|
421
|
+
X(r.$slots, "prefix"),
|
|
422
|
+
r.prefixIcon ? (y(), V(a(Te), {
|
|
423
|
+
key: 0,
|
|
424
|
+
class: S(a(n).e("icon"))
|
|
425
|
+
}, {
|
|
426
|
+
default: k(() => [
|
|
427
|
+
(y(), V(Ne(r.prefixIcon)))
|
|
428
|
+
]),
|
|
429
|
+
_: 1
|
|
430
|
+
}, 8, ["class"])) : I("v-if", !0)
|
|
431
|
+
], 2)
|
|
432
|
+
], 2)) : I("v-if", !0),
|
|
433
|
+
z("input", El({
|
|
434
|
+
id: a(B),
|
|
435
|
+
ref_key: "input",
|
|
436
|
+
ref: T,
|
|
437
|
+
class: a(n).e("inner")
|
|
438
|
+
}, a(w), {
|
|
439
|
+
type: r.showPassword ? j.value ? "text" : "password" : r.type,
|
|
440
|
+
disabled: a($),
|
|
441
|
+
formatter: r.formatter,
|
|
442
|
+
parser: r.parser,
|
|
443
|
+
readonly: r.readonly,
|
|
444
|
+
autocomplete: r.autocomplete,
|
|
445
|
+
tabindex: r.tabindex,
|
|
446
|
+
"aria-label": r.label,
|
|
447
|
+
placeholder: r.placeholder,
|
|
448
|
+
style: r.inputStyle,
|
|
449
|
+
form: s.form,
|
|
450
|
+
autofocus: s.autofocus,
|
|
451
|
+
onCompositionstart: we,
|
|
452
|
+
onCompositionupdate: $e,
|
|
453
|
+
onCompositionend: Me,
|
|
454
|
+
onInput: ke,
|
|
455
|
+
onFocus: h[0] || (h[0] = (...M) => a(ie) && a(ie)(...M)),
|
|
456
|
+
onBlur: h[1] || (h[1] = (...M) => a(P) && a(P)(...M)),
|
|
457
|
+
onChange: Le,
|
|
458
|
+
onKeydown: Oe
|
|
459
|
+
}), null, 16, ln),
|
|
460
|
+
I(" suffix slot "),
|
|
461
|
+
a(Ge) ? (y(), L("span", {
|
|
462
|
+
key: 1,
|
|
463
|
+
class: S(a(n).e("suffix"))
|
|
464
|
+
}, [
|
|
465
|
+
z("span", {
|
|
466
|
+
class: S(a(n).e("suffix-inner"))
|
|
467
|
+
}, [
|
|
468
|
+
!a(ue) || !a(Ce) || !a(U) ? (y(), L(Ae, { key: 0 }, [
|
|
469
|
+
X(r.$slots, "suffix"),
|
|
470
|
+
r.suffixIcon ? (y(), V(a(Te), {
|
|
471
|
+
key: 0,
|
|
472
|
+
class: S(a(n).e("icon"))
|
|
473
|
+
}, {
|
|
474
|
+
default: k(() => [
|
|
475
|
+
(y(), V(Ne(r.suffixIcon)))
|
|
476
|
+
]),
|
|
477
|
+
_: 1
|
|
478
|
+
}, 8, ["class"])) : I("v-if", !0)
|
|
479
|
+
], 64)) : I("v-if", !0),
|
|
480
|
+
a(ue) ? (y(), V(a(Te), {
|
|
481
|
+
key: 1,
|
|
482
|
+
class: S([a(n).e("icon"), a(n).e("clear")]),
|
|
483
|
+
onMousedown: ee(a(wt), ["prevent"]),
|
|
484
|
+
onClick: Be
|
|
485
|
+
}, {
|
|
486
|
+
default: k(() => [
|
|
487
|
+
he(a(Ul))
|
|
488
|
+
]),
|
|
489
|
+
_: 1
|
|
490
|
+
}, 8, ["class", "onMousedown"])) : I("v-if", !0),
|
|
491
|
+
a(Ce) ? (y(), V(a(Te), {
|
|
492
|
+
key: 2,
|
|
493
|
+
class: S([a(n).e("icon"), a(n).e("password")]),
|
|
494
|
+
onClick: Ve
|
|
495
|
+
}, {
|
|
496
|
+
default: k(() => [
|
|
497
|
+
(y(), V(Ne(a(je))))
|
|
498
|
+
]),
|
|
499
|
+
_: 1
|
|
500
|
+
}, 8, ["class"])) : I("v-if", !0),
|
|
501
|
+
a(U) ? (y(), L("span", {
|
|
502
|
+
key: 3,
|
|
503
|
+
class: S(a(n).e("count"))
|
|
504
|
+
}, [
|
|
505
|
+
z("span", {
|
|
506
|
+
class: S(a(n).e("count-inner"))
|
|
507
|
+
}, Y(a(Se)) + " / " + Y(a(w).maxlength), 3)
|
|
508
|
+
], 2)) : I("v-if", !0),
|
|
509
|
+
a(re) && a(ae) && a(Ke) ? (y(), V(a(Te), {
|
|
510
|
+
key: 4,
|
|
511
|
+
class: S([
|
|
512
|
+
a(n).e("icon"),
|
|
513
|
+
a(n).e("validateIcon"),
|
|
514
|
+
a(n).is("loading", a(re) === "validating")
|
|
515
|
+
])
|
|
516
|
+
}, {
|
|
517
|
+
default: k(() => [
|
|
518
|
+
(y(), V(Ne(a(ae))))
|
|
519
|
+
]),
|
|
520
|
+
_: 1
|
|
521
|
+
}, 8, ["class"])) : I("v-if", !0)
|
|
522
|
+
], 2)
|
|
523
|
+
], 2)) : I("v-if", !0)
|
|
524
|
+
], 2),
|
|
525
|
+
I(" append slot "),
|
|
526
|
+
r.$slots.append ? (y(), L("div", {
|
|
527
|
+
key: 1,
|
|
528
|
+
class: S(a(n).be("group", "append"))
|
|
529
|
+
}, [
|
|
530
|
+
X(r.$slots, "append")
|
|
531
|
+
], 2)) : I("v-if", !0)
|
|
532
|
+
], 64)) : (y(), L(Ae, { key: 1 }, [
|
|
533
|
+
I(" textarea "),
|
|
534
|
+
z("textarea", El({
|
|
535
|
+
id: a(B),
|
|
536
|
+
ref_key: "textarea",
|
|
537
|
+
ref: E,
|
|
538
|
+
class: a(O).e("inner")
|
|
539
|
+
}, a(w), {
|
|
540
|
+
tabindex: r.tabindex,
|
|
541
|
+
disabled: a($),
|
|
542
|
+
readonly: r.readonly,
|
|
543
|
+
autocomplete: r.autocomplete,
|
|
544
|
+
style: a(Q),
|
|
545
|
+
"aria-label": r.label,
|
|
546
|
+
placeholder: r.placeholder,
|
|
547
|
+
form: s.form,
|
|
548
|
+
autofocus: s.autofocus,
|
|
549
|
+
onCompositionstart: we,
|
|
550
|
+
onCompositionupdate: $e,
|
|
551
|
+
onCompositionend: Me,
|
|
552
|
+
onInput: ke,
|
|
553
|
+
onFocus: h[2] || (h[2] = (...M) => a(ie) && a(ie)(...M)),
|
|
554
|
+
onBlur: h[3] || (h[3] = (...M) => a(P) && a(P)(...M)),
|
|
555
|
+
onChange: Le,
|
|
556
|
+
onKeydown: Oe
|
|
557
|
+
}), null, 16, tn),
|
|
558
|
+
a(U) ? (y(), L("span", {
|
|
559
|
+
key: 0,
|
|
560
|
+
style: se(De.value),
|
|
561
|
+
class: S(a(n).e("count"))
|
|
562
|
+
}, Y(a(Se)) + " / " + Y(a(w).maxlength), 7)) : I("v-if", !0)
|
|
563
|
+
], 64))
|
|
564
|
+
], 16, en)), [
|
|
565
|
+
[hl, r.type !== "hidden"]
|
|
566
|
+
]);
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
var an = /* @__PURE__ */ We(on, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/input/src/input.vue"]]);
|
|
570
|
+
const sn = Al(an), et = Gl({
|
|
571
|
+
type: {
|
|
572
|
+
type: String,
|
|
573
|
+
values: ["success", "info", "warning", "danger", ""],
|
|
574
|
+
default: ""
|
|
575
|
+
},
|
|
576
|
+
closable: Boolean,
|
|
577
|
+
disableTransitions: Boolean,
|
|
578
|
+
hit: Boolean,
|
|
579
|
+
color: {
|
|
580
|
+
type: String,
|
|
581
|
+
default: ""
|
|
582
|
+
},
|
|
583
|
+
size: {
|
|
584
|
+
type: String,
|
|
585
|
+
values: Xl,
|
|
586
|
+
default: ""
|
|
587
|
+
},
|
|
588
|
+
effect: {
|
|
589
|
+
type: String,
|
|
590
|
+
values: ["dark", "light", "plain"],
|
|
591
|
+
default: "light"
|
|
592
|
+
},
|
|
593
|
+
round: Boolean
|
|
594
|
+
}), rn = {
|
|
595
|
+
close: (e) => e instanceof MouseEvent,
|
|
596
|
+
click: (e) => e instanceof MouseEvent
|
|
597
|
+
}, un = ge({
|
|
598
|
+
name: "ElTag"
|
|
599
|
+
}), dn = /* @__PURE__ */ ge({
|
|
600
|
+
...un,
|
|
601
|
+
props: et,
|
|
602
|
+
emits: rn,
|
|
603
|
+
setup(e, { emit: l }) {
|
|
604
|
+
const o = e, s = Kl(), c = be("tag"), u = v(() => {
|
|
605
|
+
const { type: f, hit: w, effect: g, closable: m, round: B } = o;
|
|
606
|
+
return [
|
|
607
|
+
c.b(),
|
|
608
|
+
c.is("closable", m),
|
|
609
|
+
c.m(f),
|
|
610
|
+
c.m(s.value),
|
|
611
|
+
c.m(g),
|
|
612
|
+
c.is("hit", w),
|
|
613
|
+
c.is("round", B)
|
|
614
|
+
];
|
|
615
|
+
}), p = (f) => {
|
|
616
|
+
l("close", f);
|
|
617
|
+
}, b = (f) => {
|
|
618
|
+
l("click", f);
|
|
619
|
+
};
|
|
620
|
+
return (f, w) => f.disableTransitions ? (y(), L("span", {
|
|
621
|
+
key: 0,
|
|
622
|
+
class: S(a(u)),
|
|
623
|
+
style: se({ backgroundColor: f.color }),
|
|
624
|
+
onClick: b
|
|
625
|
+
}, [
|
|
626
|
+
z("span", {
|
|
627
|
+
class: S(a(c).e("content"))
|
|
628
|
+
}, [
|
|
629
|
+
X(f.$slots, "default")
|
|
630
|
+
], 2),
|
|
631
|
+
f.closable ? (y(), V(a(Te), {
|
|
632
|
+
key: 0,
|
|
633
|
+
class: S(a(c).e("close")),
|
|
634
|
+
onClick: ee(p, ["stop"])
|
|
635
|
+
}, {
|
|
636
|
+
default: k(() => [
|
|
637
|
+
he(a(Rl))
|
|
638
|
+
]),
|
|
639
|
+
_: 1
|
|
640
|
+
}, 8, ["class", "onClick"])) : I("v-if", !0)
|
|
641
|
+
], 6)) : (y(), V($l, {
|
|
642
|
+
key: 1,
|
|
643
|
+
name: `${a(c).namespace.value}-zoom-in-center`,
|
|
644
|
+
appear: ""
|
|
645
|
+
}, {
|
|
646
|
+
default: k(() => [
|
|
647
|
+
z("span", {
|
|
648
|
+
class: S(a(u)),
|
|
649
|
+
style: se({ backgroundColor: f.color }),
|
|
650
|
+
onClick: b
|
|
651
|
+
}, [
|
|
652
|
+
z("span", {
|
|
653
|
+
class: S(a(c).e("content"))
|
|
654
|
+
}, [
|
|
655
|
+
X(f.$slots, "default")
|
|
656
|
+
], 2),
|
|
657
|
+
f.closable ? (y(), V(a(Te), {
|
|
658
|
+
key: 0,
|
|
659
|
+
class: S(a(c).e("close")),
|
|
660
|
+
onClick: ee(p, ["stop"])
|
|
661
|
+
}, {
|
|
662
|
+
default: k(() => [
|
|
663
|
+
he(a(Rl))
|
|
664
|
+
]),
|
|
665
|
+
_: 1
|
|
666
|
+
}, 8, ["class", "onClick"])) : I("v-if", !0)
|
|
667
|
+
], 6)
|
|
668
|
+
]),
|
|
669
|
+
_: 3
|
|
670
|
+
}, 8, ["name"]));
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
var cn = /* @__PURE__ */ We(dn, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tag/src/tag.vue"]]);
|
|
674
|
+
const pn = Al(cn), lt = Symbol("ElSelectGroup"), gl = Symbol("ElSelect");
|
|
675
|
+
function fn(e, l) {
|
|
676
|
+
const o = cl(gl), s = cl(lt, { disabled: !1 }), c = v(() => Object.prototype.toString.call(e.value).toLowerCase() === "[object object]"), u = v(() => o.props.multiple ? m(o.props.modelValue, e.value) : B(e.value, o.props.modelValue)), p = v(() => {
|
|
677
|
+
if (o.props.multiple) {
|
|
678
|
+
const n = o.props.modelValue || [];
|
|
679
|
+
return !u.value && n.length >= o.props.multipleLimit && o.props.multipleLimit > 0;
|
|
680
|
+
} else
|
|
681
|
+
return !1;
|
|
682
|
+
}), b = v(() => e.label || (c.value ? "" : e.value)), f = v(() => e.value || e.label || ""), w = v(() => e.disabled || l.groupDisabled || p.value), g = sl(), m = (n = [], O) => {
|
|
683
|
+
if (c.value) {
|
|
684
|
+
const T = o.props.valueKey;
|
|
685
|
+
return n && n.some((E) => pl(le(E, T)) === le(O, T));
|
|
686
|
+
} else
|
|
687
|
+
return n && n.includes(O);
|
|
688
|
+
}, B = (n, O) => {
|
|
689
|
+
if (c.value) {
|
|
690
|
+
const { valueKey: T } = o.props;
|
|
691
|
+
return le(n, T) === le(O, T);
|
|
692
|
+
} else
|
|
693
|
+
return n === O;
|
|
694
|
+
}, A = () => {
|
|
695
|
+
!e.disabled && !s.disabled && (o.hoverIndex = o.optionsArray.indexOf(g.proxy));
|
|
696
|
+
};
|
|
697
|
+
W(() => b.value, () => {
|
|
698
|
+
!e.created && !o.props.remote && o.setSelected();
|
|
699
|
+
}), W(() => e.value, (n, O) => {
|
|
700
|
+
const { remote: T, valueKey: E } = o.props;
|
|
701
|
+
if (Object.is(n, O) || (o.onOptionDestroy(O, g.proxy), o.onOptionCreate(g.proxy)), !e.created && !T) {
|
|
702
|
+
if (E && typeof n == "object" && typeof O == "object" && n[E] === O[E])
|
|
703
|
+
return;
|
|
704
|
+
o.setSelected();
|
|
705
|
+
}
|
|
706
|
+
}), W(() => s.disabled, () => {
|
|
707
|
+
l.groupDisabled = s.disabled;
|
|
708
|
+
}, { immediate: !0 });
|
|
709
|
+
const { queryChange: $ } = pl(o);
|
|
710
|
+
return W($, (n) => {
|
|
711
|
+
const { query: O } = a(n), T = new RegExp(Ht(O), "i");
|
|
712
|
+
l.visible = T.test(b.value) || e.created, l.visible || o.filteredOptionsCount--;
|
|
713
|
+
}, { immediate: !0 }), {
|
|
714
|
+
select: o,
|
|
715
|
+
currentLabel: b,
|
|
716
|
+
currentValue: f,
|
|
717
|
+
itemSelected: u,
|
|
718
|
+
isDisabled: w,
|
|
719
|
+
hoverItem: A
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
const vn = ge({
|
|
723
|
+
name: "ElOption",
|
|
724
|
+
componentName: "ElOption",
|
|
725
|
+
props: {
|
|
726
|
+
value: {
|
|
727
|
+
required: !0,
|
|
728
|
+
type: [String, Number, Boolean, Object]
|
|
729
|
+
},
|
|
730
|
+
label: [String, Number],
|
|
731
|
+
created: Boolean,
|
|
732
|
+
disabled: Boolean
|
|
733
|
+
},
|
|
734
|
+
setup(e) {
|
|
735
|
+
const l = be("select"), o = v(() => [
|
|
736
|
+
l.be("dropdown", "item"),
|
|
737
|
+
l.is("disabled", a(p)),
|
|
738
|
+
{
|
|
739
|
+
selected: a(u),
|
|
740
|
+
hover: a(g)
|
|
741
|
+
}
|
|
742
|
+
]), s = bl({
|
|
743
|
+
index: -1,
|
|
744
|
+
groupDisabled: !1,
|
|
745
|
+
visible: !0,
|
|
746
|
+
hitState: !1,
|
|
747
|
+
hover: !1
|
|
748
|
+
}), { currentLabel: c, itemSelected: u, isDisabled: p, select: b, hoverItem: f } = fn(e, s), { visible: w, hover: g } = Vl(s), m = sl().proxy;
|
|
749
|
+
b.onOptionCreate(m), at(() => {
|
|
750
|
+
const A = m.value, { selected: $ } = b, O = (b.props.multiple ? $ : [$]).some((T) => T.value === m.value);
|
|
751
|
+
D(() => {
|
|
752
|
+
b.cachedOptions.get(A) === m && !O && b.cachedOptions.delete(A);
|
|
753
|
+
}), b.onOptionDestroy(A, m);
|
|
754
|
+
});
|
|
755
|
+
function B() {
|
|
756
|
+
e.disabled !== !0 && s.groupDisabled !== !0 && b.handleOptionSelect(m);
|
|
757
|
+
}
|
|
758
|
+
return {
|
|
759
|
+
ns: l,
|
|
760
|
+
containerKls: o,
|
|
761
|
+
currentLabel: c,
|
|
762
|
+
itemSelected: u,
|
|
763
|
+
isDisabled: p,
|
|
764
|
+
select: b,
|
|
765
|
+
hoverItem: f,
|
|
766
|
+
visible: w,
|
|
767
|
+
hover: g,
|
|
768
|
+
selectOptionClick: B,
|
|
769
|
+
states: s
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
function mn(e, l, o, s, c, u) {
|
|
774
|
+
return He((y(), L("li", {
|
|
775
|
+
class: S(e.containerKls),
|
|
776
|
+
onMouseenter: l[0] || (l[0] = (...p) => e.hoverItem && e.hoverItem(...p)),
|
|
777
|
+
onClick: l[1] || (l[1] = ee((...p) => e.selectOptionClick && e.selectOptionClick(...p), ["stop"]))
|
|
778
|
+
}, [
|
|
779
|
+
X(e.$slots, "default", {}, () => [
|
|
780
|
+
z("span", null, Y(e.currentLabel), 1)
|
|
781
|
+
])
|
|
782
|
+
], 34)), [
|
|
783
|
+
[hl, e.visible]
|
|
784
|
+
]);
|
|
785
|
+
}
|
|
786
|
+
var Bl = /* @__PURE__ */ We(vn, [["render", mn], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/option.vue"]]);
|
|
787
|
+
const hn = ge({
|
|
788
|
+
name: "ElSelectDropdown",
|
|
789
|
+
componentName: "ElSelectDropdown",
|
|
790
|
+
setup() {
|
|
791
|
+
const e = cl(gl), l = be("select"), o = v(() => e.props.popperClass), s = v(() => e.props.multiple), c = v(() => e.props.fitInputWidth), u = K("");
|
|
792
|
+
function p() {
|
|
793
|
+
var b;
|
|
794
|
+
u.value = `${(b = e.selectWrapper) == null ? void 0 : b.offsetWidth}px`;
|
|
795
|
+
}
|
|
796
|
+
return ml(() => {
|
|
797
|
+
p(), zl(e.selectWrapper, p);
|
|
798
|
+
}), {
|
|
799
|
+
ns: l,
|
|
800
|
+
minWidth: u,
|
|
801
|
+
popperClass: o,
|
|
802
|
+
isMultiple: s,
|
|
803
|
+
isFitInputWidth: c
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
});
|
|
807
|
+
function bn(e, l, o, s, c, u) {
|
|
808
|
+
return y(), L("div", {
|
|
809
|
+
class: S([e.ns.b("dropdown"), e.ns.is("multiple", e.isMultiple), e.popperClass]),
|
|
810
|
+
style: se({ [e.isFitInputWidth ? "width" : "minWidth"]: e.minWidth })
|
|
811
|
+
}, [
|
|
812
|
+
X(e.$slots, "default")
|
|
813
|
+
], 6);
|
|
814
|
+
}
|
|
815
|
+
var gn = /* @__PURE__ */ We(hn, [["render", bn], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/select-dropdown.vue"]]);
|
|
816
|
+
function yn(e) {
|
|
817
|
+
const { t: l } = Dl();
|
|
818
|
+
return bl({
|
|
819
|
+
options: /* @__PURE__ */ new Map(),
|
|
820
|
+
cachedOptions: /* @__PURE__ */ new Map(),
|
|
821
|
+
disabledOptions: /* @__PURE__ */ new Map(),
|
|
822
|
+
createdLabel: null,
|
|
823
|
+
createdSelected: !1,
|
|
824
|
+
selected: e.multiple ? [] : {},
|
|
825
|
+
inputLength: 20,
|
|
826
|
+
inputWidth: 0,
|
|
827
|
+
optionsCount: 0,
|
|
828
|
+
filteredOptionsCount: 0,
|
|
829
|
+
visible: !1,
|
|
830
|
+
selectedLabel: "",
|
|
831
|
+
hoverIndex: -1,
|
|
832
|
+
query: "",
|
|
833
|
+
previousQuery: null,
|
|
834
|
+
inputHovering: !1,
|
|
835
|
+
cachedPlaceHolder: "",
|
|
836
|
+
currentPlaceholder: l("el.select.placeholder"),
|
|
837
|
+
menuVisibleOnFocus: !1,
|
|
838
|
+
isOnComposition: !1,
|
|
839
|
+
prefixWidth: 11,
|
|
840
|
+
mouseEnter: !1,
|
|
841
|
+
focused: !1
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
const Cn = (e, l, o) => {
|
|
845
|
+
const { t: s } = Dl(), c = be("select");
|
|
846
|
+
Mt({
|
|
847
|
+
from: "suffixTransition",
|
|
848
|
+
replacement: "override style scheme",
|
|
849
|
+
version: "2.3.0",
|
|
850
|
+
scope: "props",
|
|
851
|
+
ref: "https://element-plus.org/en-US/component/select.html#select-attributes"
|
|
852
|
+
}, v(() => e.suffixTransition === !1));
|
|
853
|
+
const u = K(null), p = K(null), b = K(null), f = K(null), w = K(null), g = K(null), m = K(null), B = K(null), A = K(-1), $ = Re({ query: "" }), n = Re(""), O = K([]);
|
|
854
|
+
let T = 0;
|
|
855
|
+
const { form: E, formItem: q } = Zl(), ne = v(() => !e.filterable || e.multiple || !l.visible), j = v(() => e.disabled || (E == null ? void 0 : E.disabled)), De = v(() => {
|
|
856
|
+
const t = e.multiple ? Array.isArray(e.modelValue) && e.modelValue.length > 0 : e.modelValue !== void 0 && e.modelValue !== null && e.modelValue !== "";
|
|
857
|
+
return e.clearable && !j.value && l.inputHovering && t;
|
|
858
|
+
}), Z = v(() => e.remote && e.filterable && !e.remoteShowSuffix ? "" : e.suffixIcon), oe = v(() => c.is("reverse", Z.value && l.visible && e.suffixTransition)), qe = v(() => (E == null ? void 0 : E.statusIcon) && (q == null ? void 0 : q.validateState) && Jl[q == null ? void 0 : q.validateState]), ye = v(() => e.remote ? 300 : 0), ie = v(() => e.loading ? e.loadingText || s("el.select.loading") : e.remote && l.query === "" && l.options.size === 0 ? !1 : e.filterable && l.query && l.options.size > 0 && l.filteredOptionsCount === 0 ? e.noMatchText || s("el.select.noMatch") : l.options.size === 0 ? e.noDataText || s("el.select.noData") : null), P = v(() => {
|
|
859
|
+
const t = Array.from(l.options.values()), i = [];
|
|
860
|
+
return O.value.forEach((d) => {
|
|
861
|
+
const C = t.findIndex((N) => N.currentLabel === d);
|
|
862
|
+
C > -1 && i.push(t[C]);
|
|
863
|
+
}), i.length >= t.length ? i : t;
|
|
864
|
+
}), Ke = v(() => Array.from(l.cachedOptions.values())), re = v(() => {
|
|
865
|
+
const t = P.value.filter((i) => !i.created).some((i) => i.currentLabel === l.query);
|
|
866
|
+
return e.filterable && e.allowCreate && l.query !== "" && !t;
|
|
867
|
+
}), ae = Kl(), je = v(() => ["small"].includes(ae.value) ? "small" : "default"), Qe = v({
|
|
868
|
+
get() {
|
|
869
|
+
return l.visible && ie.value !== !1;
|
|
870
|
+
},
|
|
871
|
+
set(t) {
|
|
872
|
+
l.visible = t;
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
W([() => j.value, () => ae.value, () => E == null ? void 0 : E.size], () => {
|
|
876
|
+
D(() => {
|
|
877
|
+
Q();
|
|
878
|
+
});
|
|
879
|
+
}), W(() => e.placeholder, (t) => {
|
|
880
|
+
l.cachedPlaceHolder = l.currentPlaceholder = t, e.multiple && Array.isArray(e.modelValue) && e.modelValue.length > 0 && (l.currentPlaceholder = "");
|
|
881
|
+
}), W(() => e.modelValue, (t, i) => {
|
|
882
|
+
e.multiple && (Q(), t && t.length > 0 || p.value && l.query !== "" ? l.currentPlaceholder = "" : l.currentPlaceholder = l.cachedPlaceHolder, e.filterable && !e.reserveKeyword && (l.query = "", F(l.query))), U(), e.filterable && !e.multiple && (l.inputLength = 20), !Nl(t, i) && e.validateEvent && (q == null || q.validate("change").catch((d) => il(d)));
|
|
883
|
+
}, {
|
|
884
|
+
flush: "post",
|
|
885
|
+
deep: !0
|
|
886
|
+
}), W(() => l.visible, (t) => {
|
|
887
|
+
var i, d, C, N, H;
|
|
888
|
+
t ? ((d = (i = f.value) == null ? void 0 : i.updatePopper) == null || d.call(i), e.filterable && (l.filteredOptionsCount = l.optionsCount, l.query = e.remote ? "" : l.selectedLabel, (N = (C = b.value) == null ? void 0 : C.focus) == null || N.call(C), e.multiple ? (H = p.value) == null || H.focus() : l.selectedLabel && (l.currentPlaceholder = `${l.selectedLabel}`, l.selectedLabel = ""), F(l.query), !e.multiple && !e.remote && ($.value.query = "", ol($), ol(n)))) : (e.filterable && (Pe(e.filterMethod) && e.filterMethod(""), Pe(e.remoteMethod) && e.remoteMethod("")), l.query = "", l.previousQuery = null, l.selectedLabel = "", l.inputLength = 20, l.menuVisibleOnFocus = !1, Ue(), D(() => {
|
|
889
|
+
p.value && p.value.value === "" && l.selected.length === 0 && (l.currentPlaceholder = l.cachedPlaceHolder);
|
|
890
|
+
}), e.multiple || (l.selected && (e.filterable && e.allowCreate && l.createdSelected && l.createdLabel ? l.selectedLabel = l.createdLabel : l.selectedLabel = l.selected.currentLabel, e.filterable && (l.query = l.selectedLabel)), e.filterable && (l.currentPlaceholder = l.cachedPlaceHolder))), o.emit("visible-change", t);
|
|
891
|
+
}), W(() => l.options.entries(), () => {
|
|
892
|
+
var t, i, d;
|
|
893
|
+
if (!Pl)
|
|
894
|
+
return;
|
|
895
|
+
(i = (t = f.value) == null ? void 0 : t.updatePopper) == null || i.call(t), e.multiple && Q();
|
|
896
|
+
const C = ((d = m.value) == null ? void 0 : d.querySelectorAll("input")) || [];
|
|
897
|
+
(!e.filterable && !e.defaultFirstOption && !Ot(e.modelValue) || !Array.from(C).includes(document.activeElement)) && U(), e.defaultFirstOption && (e.filterable || e.remote) && l.filteredOptionsCount && Ce();
|
|
898
|
+
}, {
|
|
899
|
+
flush: "post"
|
|
900
|
+
}), W(() => l.hoverIndex, (t) => {
|
|
901
|
+
Ml(t) && t > -1 ? A.value = P.value[t] || {} : A.value = {}, P.value.forEach((i) => {
|
|
902
|
+
i.hover = A.value === i;
|
|
903
|
+
});
|
|
904
|
+
});
|
|
905
|
+
const Q = () => {
|
|
906
|
+
D(() => {
|
|
907
|
+
var t, i;
|
|
908
|
+
if (!u.value)
|
|
909
|
+
return;
|
|
910
|
+
const d = u.value.$el.querySelector("input");
|
|
911
|
+
T = T || (d.clientHeight > 0 ? d.clientHeight + 2 : 0);
|
|
912
|
+
const C = g.value, N = Wt(ae.value || (E == null ? void 0 : E.size)), H = ae.value || N === T || T <= 0 ? N : T;
|
|
913
|
+
!(d.offsetParent === null) && (d.style.height = `${(l.selected.length === 0 ? H : Math.max(C ? C.clientHeight + (C.clientHeight > H ? 6 : 0) : 0, H)) - 2}px`), l.visible && ie.value !== !1 && ((i = (t = f.value) == null ? void 0 : t.updatePopper) == null || i.call(t));
|
|
914
|
+
});
|
|
915
|
+
}, F = async (t) => {
|
|
916
|
+
if (!(l.previousQuery === t || l.isOnComposition)) {
|
|
917
|
+
if (l.previousQuery === null && (Pe(e.filterMethod) || Pe(e.remoteMethod))) {
|
|
918
|
+
l.previousQuery = t;
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
l.previousQuery = t, D(() => {
|
|
922
|
+
var i, d;
|
|
923
|
+
l.visible && ((d = (i = f.value) == null ? void 0 : i.updatePopper) == null || d.call(i));
|
|
924
|
+
}), l.hoverIndex = -1, e.multiple && e.filterable && D(() => {
|
|
925
|
+
if (!j.value) {
|
|
926
|
+
const i = p.value.value.length * 15 + 20;
|
|
927
|
+
l.inputLength = e.collapseTags ? Math.min(50, i) : i, ue();
|
|
928
|
+
}
|
|
929
|
+
Q();
|
|
930
|
+
}), e.remote && Pe(e.remoteMethod) ? (l.hoverIndex = -1, e.remoteMethod(t)) : Pe(e.filterMethod) ? (e.filterMethod(t), ol(n)) : (l.filteredOptionsCount = l.optionsCount, $.value.query = t, ol($), ol(n)), e.defaultFirstOption && (e.filterable || e.remote) && l.filteredOptionsCount && (await D(), Ce());
|
|
931
|
+
}
|
|
932
|
+
}, ue = () => {
|
|
933
|
+
l.currentPlaceholder !== "" && (l.currentPlaceholder = p.value.value ? "" : l.cachedPlaceHolder);
|
|
934
|
+
}, Ce = () => {
|
|
935
|
+
const t = P.value.filter((C) => C.visible && !C.disabled && !C.states.groupDisabled), i = t.find((C) => C.created), d = t[0];
|
|
936
|
+
l.hoverIndex = Me(P.value, i || d);
|
|
937
|
+
}, U = () => {
|
|
938
|
+
var t;
|
|
939
|
+
if (e.multiple)
|
|
940
|
+
l.selectedLabel = "";
|
|
941
|
+
else {
|
|
942
|
+
const d = Se(e.modelValue);
|
|
943
|
+
(t = d.props) != null && t.created ? (l.createdLabel = d.props.value, l.createdSelected = !0) : l.createdSelected = !1, l.selectedLabel = d.currentLabel, l.selected = d, e.filterable && (l.query = l.selectedLabel);
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
const i = [];
|
|
947
|
+
Array.isArray(e.modelValue) && e.modelValue.forEach((d) => {
|
|
948
|
+
i.push(Se(d));
|
|
949
|
+
}), l.selected = i, D(() => {
|
|
950
|
+
Q();
|
|
951
|
+
});
|
|
952
|
+
}, Se = (t) => {
|
|
953
|
+
let i;
|
|
954
|
+
const d = Ll(t).toLowerCase() === "object", C = Ll(t).toLowerCase() === "null", N = Ll(t).toLowerCase() === "undefined";
|
|
955
|
+
for (let me = l.cachedOptions.size - 1; me >= 0; me--) {
|
|
956
|
+
const J = Ke.value[me];
|
|
957
|
+
if (d ? le(J.value, e.valueKey) === le(t, e.valueKey) : J.value === t) {
|
|
958
|
+
i = {
|
|
959
|
+
value: t,
|
|
960
|
+
currentLabel: J.currentLabel,
|
|
961
|
+
isDisabled: J.isDisabled
|
|
962
|
+
};
|
|
963
|
+
break;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
if (i)
|
|
967
|
+
return i;
|
|
968
|
+
const H = d ? t.label : !C && !N ? t : "", ve = {
|
|
969
|
+
value: t,
|
|
970
|
+
currentLabel: H
|
|
971
|
+
};
|
|
972
|
+
return e.multiple && (ve.hitState = !1), ve;
|
|
973
|
+
}, Ue = () => {
|
|
974
|
+
setTimeout(() => {
|
|
975
|
+
const t = e.valueKey;
|
|
976
|
+
e.multiple ? l.selected.length > 0 ? l.hoverIndex = Math.min.apply(null, l.selected.map((i) => P.value.findIndex((d) => le(d, t) === le(i, t)))) : l.hoverIndex = -1 : l.hoverIndex = P.value.findIndex((i) => ll(i) === ll(l.selected));
|
|
977
|
+
}, 300);
|
|
978
|
+
}, Ge = () => {
|
|
979
|
+
var t, i;
|
|
980
|
+
Ye(), (i = (t = f.value) == null ? void 0 : t.updatePopper) == null || i.call(t), e.multiple && Q();
|
|
981
|
+
}, Ye = () => {
|
|
982
|
+
var t;
|
|
983
|
+
l.inputWidth = (t = u.value) == null ? void 0 : t.$el.offsetWidth;
|
|
984
|
+
}, Xe = () => {
|
|
985
|
+
e.filterable && l.query !== l.selectedLabel && (l.query = l.selectedLabel, F(l.query));
|
|
986
|
+
}, de = Fl(() => {
|
|
987
|
+
Xe();
|
|
988
|
+
}, ye.value), rl = Fl((t) => {
|
|
989
|
+
F(t.target.value);
|
|
990
|
+
}, ye.value), ce = (t) => {
|
|
991
|
+
Nl(e.modelValue, t) || o.emit(xl, t);
|
|
992
|
+
}, G = (t) => Rt(t, (i) => !l.disabledOptions.has(i)), ke = (t) => {
|
|
993
|
+
if (t.code !== Hl.delete) {
|
|
994
|
+
if (t.target.value.length <= 0 && !Oe()) {
|
|
995
|
+
const i = e.modelValue.slice(), d = G(i);
|
|
996
|
+
if (d < 0)
|
|
997
|
+
return;
|
|
998
|
+
i.splice(d, 1), o.emit(te, i), ce(i);
|
|
999
|
+
}
|
|
1000
|
+
t.target.value.length === 1 && e.modelValue.length === 0 && (l.currentPlaceholder = l.cachedPlaceHolder);
|
|
1001
|
+
}
|
|
1002
|
+
}, Le = (t, i) => {
|
|
1003
|
+
const d = l.selected.indexOf(i);
|
|
1004
|
+
if (d > -1 && !j.value) {
|
|
1005
|
+
const C = e.modelValue.slice();
|
|
1006
|
+
C.splice(d, 1), o.emit(te, C), ce(C), o.emit("remove-tag", i.value);
|
|
1007
|
+
}
|
|
1008
|
+
t.stopPropagation(), h();
|
|
1009
|
+
}, we = (t) => {
|
|
1010
|
+
t.stopPropagation();
|
|
1011
|
+
const i = e.multiple ? [] : "";
|
|
1012
|
+
if (!al(i))
|
|
1013
|
+
for (const d of l.selected)
|
|
1014
|
+
d.isDisabled && i.push(d.value);
|
|
1015
|
+
o.emit(te, i), ce(i), l.hoverIndex = -1, l.visible = !1, o.emit("clear"), h();
|
|
1016
|
+
}, $e = (t) => {
|
|
1017
|
+
var i;
|
|
1018
|
+
if (e.multiple) {
|
|
1019
|
+
const d = (e.modelValue || []).slice(), C = Me(d, t.value);
|
|
1020
|
+
C > -1 ? d.splice(C, 1) : (e.multipleLimit <= 0 || d.length < e.multipleLimit) && d.push(t.value), o.emit(te, d), ce(d), t.created && (l.query = "", F(""), l.inputLength = 20), e.filterable && ((i = p.value) == null || i.focus());
|
|
1021
|
+
} else
|
|
1022
|
+
o.emit(te, t.value), ce(t.value), l.visible = !1;
|
|
1023
|
+
Ve(), !l.visible && D(() => {
|
|
1024
|
+
pe(t);
|
|
1025
|
+
});
|
|
1026
|
+
}, Me = (t = [], i) => {
|
|
1027
|
+
if (!fl(i))
|
|
1028
|
+
return t.indexOf(i);
|
|
1029
|
+
const d = e.valueKey;
|
|
1030
|
+
let C = -1;
|
|
1031
|
+
return t.some((N, H) => pl(le(N, d)) === le(i, d) ? (C = H, !0) : !1), C;
|
|
1032
|
+
}, Ve = () => {
|
|
1033
|
+
const t = p.value || u.value;
|
|
1034
|
+
t && (t == null || t.focus());
|
|
1035
|
+
}, pe = (t) => {
|
|
1036
|
+
var i, d, C, N, H;
|
|
1037
|
+
const ve = Array.isArray(t) ? t[0] : t;
|
|
1038
|
+
let me = null;
|
|
1039
|
+
if (ve != null && ve.value) {
|
|
1040
|
+
const J = P.value.filter((R) => R.value === ve.value);
|
|
1041
|
+
J.length > 0 && (me = J[0].$el);
|
|
1042
|
+
}
|
|
1043
|
+
if (f.value && me) {
|
|
1044
|
+
const J = (N = (C = (d = (i = f.value) == null ? void 0 : i.popperRef) == null ? void 0 : d.contentRef) == null ? void 0 : C.querySelector) == null ? void 0 : N.call(C, `.${c.be("dropdown", "wrap")}`);
|
|
1045
|
+
J && zt(J, me);
|
|
1046
|
+
}
|
|
1047
|
+
(H = B.value) == null || H.handleScroll();
|
|
1048
|
+
}, Ze = (t) => {
|
|
1049
|
+
l.optionsCount++, l.filteredOptionsCount++, l.options.set(t.value, t), l.cachedOptions.set(t.value, t), t.disabled && l.disabledOptions.set(t.value, t);
|
|
1050
|
+
}, Je = (t, i) => {
|
|
1051
|
+
l.options.get(t) === i && (l.optionsCount--, l.filteredOptionsCount--, l.options.delete(t));
|
|
1052
|
+
}, xe = (t) => {
|
|
1053
|
+
t.code !== Hl.backspace && Oe(!1), l.inputLength = p.value.value.length * 15 + 20, Q();
|
|
1054
|
+
}, Oe = (t) => {
|
|
1055
|
+
if (!Array.isArray(l.selected))
|
|
1056
|
+
return;
|
|
1057
|
+
const i = G(l.selected.map((C) => C.value)), d = l.selected[i];
|
|
1058
|
+
if (d)
|
|
1059
|
+
return t === !0 || t === !1 ? (d.hitState = t, t) : (d.hitState = !d.hitState, d.hitState);
|
|
1060
|
+
}, _e = (t) => {
|
|
1061
|
+
const i = t.target.value;
|
|
1062
|
+
if (t.type === "compositionend")
|
|
1063
|
+
l.isOnComposition = !1, D(() => F(i));
|
|
1064
|
+
else {
|
|
1065
|
+
const d = i[i.length - 1] || "";
|
|
1066
|
+
l.isOnComposition = !_l(d);
|
|
1067
|
+
}
|
|
1068
|
+
}, Be = () => {
|
|
1069
|
+
D(() => pe(l.selected));
|
|
1070
|
+
}, r = (t) => {
|
|
1071
|
+
l.focused || ((e.automaticDropdown || e.filterable) && (e.filterable && !l.visible && (l.menuVisibleOnFocus = !0), l.visible = !0), l.focused = !0, o.emit("focus", t));
|
|
1072
|
+
}, h = () => {
|
|
1073
|
+
var t, i;
|
|
1074
|
+
l.visible ? (t = p.value || u.value) == null || t.focus() : (i = u.value) == null || i.focus();
|
|
1075
|
+
}, M = () => {
|
|
1076
|
+
var t, i, d;
|
|
1077
|
+
l.visible = !1, (t = u.value) == null || t.blur(), (d = (i = b.value) == null ? void 0 : i.blur) == null || d.call(i);
|
|
1078
|
+
}, fe = (t) => {
|
|
1079
|
+
var i, d, C;
|
|
1080
|
+
(i = f.value) != null && i.isFocusInsideContent(t) || (d = w.value) != null && d.isFocusInsideContent(t) || (C = m.value) != null && C.contains(t.relatedTarget) || (l.visible && ul(), l.focused = !1, o.emit("blur", t));
|
|
1081
|
+
}, Ie = (t) => {
|
|
1082
|
+
we(t);
|
|
1083
|
+
}, ul = () => {
|
|
1084
|
+
l.visible = !1;
|
|
1085
|
+
}, yl = (t) => {
|
|
1086
|
+
l.visible && (t.preventDefault(), t.stopPropagation(), l.visible = !1);
|
|
1087
|
+
}, el = (t) => {
|
|
1088
|
+
t && !l.mouseEnter || j.value || (l.menuVisibleOnFocus ? l.menuVisibleOnFocus = !1 : (!f.value || !f.value.isFocusInsideContent()) && (l.visible = !l.visible), h());
|
|
1089
|
+
}, dl = () => {
|
|
1090
|
+
l.visible ? P.value[l.hoverIndex] && $e(P.value[l.hoverIndex]) : el();
|
|
1091
|
+
}, ll = (t) => fl(t.value) ? le(t.value, e.valueKey) : t.value, tl = v(() => P.value.filter((t) => t.visible).every((t) => t.disabled)), Cl = v(() => e.multiple ? l.selected.slice(0, e.maxCollapseTags) : []), Sl = v(() => e.multiple ? l.selected.slice(e.maxCollapseTags) : []), nl = (t) => {
|
|
1092
|
+
if (!l.visible) {
|
|
1093
|
+
l.visible = !0;
|
|
1094
|
+
return;
|
|
1095
|
+
}
|
|
1096
|
+
if (!(l.options.size === 0 || l.filteredOptionsCount === 0) && !l.isOnComposition && !tl.value) {
|
|
1097
|
+
t === "next" ? (l.hoverIndex++, l.hoverIndex === l.options.size && (l.hoverIndex = 0)) : t === "prev" && (l.hoverIndex--, l.hoverIndex < 0 && (l.hoverIndex = l.options.size - 1));
|
|
1098
|
+
const i = P.value[l.hoverIndex];
|
|
1099
|
+
(i.disabled === !0 || i.states.groupDisabled === !0 || !i.visible) && nl(t), D(() => pe(A.value));
|
|
1100
|
+
}
|
|
1101
|
+
}, wl = () => {
|
|
1102
|
+
l.mouseEnter = !0;
|
|
1103
|
+
}, Ol = () => {
|
|
1104
|
+
l.mouseEnter = !1;
|
|
1105
|
+
}, Fe = (t, i) => {
|
|
1106
|
+
var d, C;
|
|
1107
|
+
Le(t, i), (C = (d = w.value) == null ? void 0 : d.updatePopper) == null || C.call(d);
|
|
1108
|
+
}, Il = v(() => ({
|
|
1109
|
+
maxWidth: `${a(l.inputWidth) - 32 - (qe.value ? 22 : 0)}px`,
|
|
1110
|
+
width: "100%"
|
|
1111
|
+
}));
|
|
1112
|
+
return {
|
|
1113
|
+
optionList: O,
|
|
1114
|
+
optionsArray: P,
|
|
1115
|
+
selectSize: ae,
|
|
1116
|
+
handleResize: Ge,
|
|
1117
|
+
debouncedOnInputChange: de,
|
|
1118
|
+
debouncedQueryChange: rl,
|
|
1119
|
+
deletePrevTag: ke,
|
|
1120
|
+
deleteTag: Le,
|
|
1121
|
+
deleteSelected: we,
|
|
1122
|
+
handleOptionSelect: $e,
|
|
1123
|
+
scrollToOption: pe,
|
|
1124
|
+
readonly: ne,
|
|
1125
|
+
resetInputHeight: Q,
|
|
1126
|
+
showClose: De,
|
|
1127
|
+
iconComponent: Z,
|
|
1128
|
+
iconReverse: oe,
|
|
1129
|
+
showNewOption: re,
|
|
1130
|
+
collapseTagSize: je,
|
|
1131
|
+
setSelected: U,
|
|
1132
|
+
managePlaceholder: ue,
|
|
1133
|
+
selectDisabled: j,
|
|
1134
|
+
emptyText: ie,
|
|
1135
|
+
toggleLastOptionHitState: Oe,
|
|
1136
|
+
resetInputState: xe,
|
|
1137
|
+
handleComposition: _e,
|
|
1138
|
+
onOptionCreate: Ze,
|
|
1139
|
+
onOptionDestroy: Je,
|
|
1140
|
+
handleMenuEnter: Be,
|
|
1141
|
+
handleFocus: r,
|
|
1142
|
+
focus: h,
|
|
1143
|
+
blur: M,
|
|
1144
|
+
handleBlur: fe,
|
|
1145
|
+
handleClearClick: Ie,
|
|
1146
|
+
handleClose: ul,
|
|
1147
|
+
handleKeydownEscape: yl,
|
|
1148
|
+
toggleMenu: el,
|
|
1149
|
+
selectOption: dl,
|
|
1150
|
+
getValueKey: ll,
|
|
1151
|
+
navigateOptions: nl,
|
|
1152
|
+
handleDeleteTooltipTag: Fe,
|
|
1153
|
+
dropMenuVisible: Qe,
|
|
1154
|
+
queryChange: $,
|
|
1155
|
+
groupQueryChange: n,
|
|
1156
|
+
showTagList: Cl,
|
|
1157
|
+
collapseTagList: Sl,
|
|
1158
|
+
selectTagsStyle: Il,
|
|
1159
|
+
reference: u,
|
|
1160
|
+
input: p,
|
|
1161
|
+
iOSInput: b,
|
|
1162
|
+
tooltipRef: f,
|
|
1163
|
+
tagTooltipRef: w,
|
|
1164
|
+
tags: g,
|
|
1165
|
+
selectWrapper: m,
|
|
1166
|
+
scrollbar: B,
|
|
1167
|
+
handleMouseEnter: wl,
|
|
1168
|
+
handleMouseLeave: Ol
|
|
1169
|
+
};
|
|
1170
|
+
};
|
|
1171
|
+
var Sn = ge({
|
|
1172
|
+
name: "ElOptions",
|
|
1173
|
+
emits: ["update-options"],
|
|
1174
|
+
setup(e, { slots: l, emit: o }) {
|
|
1175
|
+
let s = [];
|
|
1176
|
+
function c(u, p) {
|
|
1177
|
+
if (u.length !== p.length)
|
|
1178
|
+
return !1;
|
|
1179
|
+
for (const [b] of u.entries())
|
|
1180
|
+
if (u[b] != p[b])
|
|
1181
|
+
return !1;
|
|
1182
|
+
return !0;
|
|
1183
|
+
}
|
|
1184
|
+
return () => {
|
|
1185
|
+
var u, p;
|
|
1186
|
+
const b = (u = l.default) == null ? void 0 : u.call(l), f = [];
|
|
1187
|
+
function w(g) {
|
|
1188
|
+
Array.isArray(g) && g.forEach((m) => {
|
|
1189
|
+
var B, A, $, n;
|
|
1190
|
+
const O = (B = (m == null ? void 0 : m.type) || {}) == null ? void 0 : B.name;
|
|
1191
|
+
O === "ElOptionGroup" ? w(!al(m.children) && !Array.isArray(m.children) && Pe((A = m.children) == null ? void 0 : A.default) ? ($ = m.children) == null ? void 0 : $.default() : m.children) : O === "ElOption" ? f.push((n = m.props) == null ? void 0 : n.label) : Array.isArray(m.children) && w(m.children);
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1194
|
+
return b.length && w((p = b[0]) == null ? void 0 : p.children), c(f, s) || (s = f, o("update-options", f)), b;
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
});
|
|
1198
|
+
const jl = "ElSelect", wn = ge({
|
|
1199
|
+
name: jl,
|
|
1200
|
+
componentName: jl,
|
|
1201
|
+
components: {
|
|
1202
|
+
ElInput: sn,
|
|
1203
|
+
ElSelectMenu: gn,
|
|
1204
|
+
ElOption: Bl,
|
|
1205
|
+
ElOptions: Sn,
|
|
1206
|
+
ElTag: pn,
|
|
1207
|
+
ElScrollbar: ft,
|
|
1208
|
+
ElTooltip: vt,
|
|
1209
|
+
ElIcon: Te
|
|
1210
|
+
},
|
|
1211
|
+
directives: { ClickOutside: mt },
|
|
1212
|
+
props: {
|
|
1213
|
+
name: String,
|
|
1214
|
+
id: String,
|
|
1215
|
+
modelValue: {
|
|
1216
|
+
type: [Array, String, Number, Boolean, Object],
|
|
1217
|
+
default: void 0
|
|
1218
|
+
},
|
|
1219
|
+
autocomplete: {
|
|
1220
|
+
type: String,
|
|
1221
|
+
default: "off"
|
|
1222
|
+
},
|
|
1223
|
+
automaticDropdown: Boolean,
|
|
1224
|
+
size: {
|
|
1225
|
+
type: String,
|
|
1226
|
+
validator: qt
|
|
1227
|
+
},
|
|
1228
|
+
effect: {
|
|
1229
|
+
type: String,
|
|
1230
|
+
default: "light"
|
|
1231
|
+
},
|
|
1232
|
+
disabled: Boolean,
|
|
1233
|
+
clearable: Boolean,
|
|
1234
|
+
filterable: Boolean,
|
|
1235
|
+
allowCreate: Boolean,
|
|
1236
|
+
loading: Boolean,
|
|
1237
|
+
popperClass: {
|
|
1238
|
+
type: String,
|
|
1239
|
+
default: ""
|
|
1240
|
+
},
|
|
1241
|
+
popperOptions: {
|
|
1242
|
+
type: Object,
|
|
1243
|
+
default: () => ({})
|
|
1244
|
+
},
|
|
1245
|
+
remote: Boolean,
|
|
1246
|
+
loadingText: String,
|
|
1247
|
+
noMatchText: String,
|
|
1248
|
+
noDataText: String,
|
|
1249
|
+
remoteMethod: Function,
|
|
1250
|
+
filterMethod: Function,
|
|
1251
|
+
multiple: Boolean,
|
|
1252
|
+
multipleLimit: {
|
|
1253
|
+
type: Number,
|
|
1254
|
+
default: 0
|
|
1255
|
+
},
|
|
1256
|
+
placeholder: {
|
|
1257
|
+
type: String
|
|
1258
|
+
},
|
|
1259
|
+
defaultFirstOption: Boolean,
|
|
1260
|
+
reserveKeyword: {
|
|
1261
|
+
type: Boolean,
|
|
1262
|
+
default: !0
|
|
1263
|
+
},
|
|
1264
|
+
valueKey: {
|
|
1265
|
+
type: String,
|
|
1266
|
+
default: "value"
|
|
1267
|
+
},
|
|
1268
|
+
collapseTags: Boolean,
|
|
1269
|
+
collapseTagsTooltip: Boolean,
|
|
1270
|
+
maxCollapseTags: {
|
|
1271
|
+
type: Number,
|
|
1272
|
+
default: 1
|
|
1273
|
+
},
|
|
1274
|
+
teleported: ht.teleported,
|
|
1275
|
+
persistent: {
|
|
1276
|
+
type: Boolean,
|
|
1277
|
+
default: !0
|
|
1278
|
+
},
|
|
1279
|
+
clearIcon: {
|
|
1280
|
+
type: vl,
|
|
1281
|
+
default: Ul
|
|
1282
|
+
},
|
|
1283
|
+
fitInputWidth: Boolean,
|
|
1284
|
+
suffixIcon: {
|
|
1285
|
+
type: vl,
|
|
1286
|
+
default: Ct
|
|
1287
|
+
},
|
|
1288
|
+
tagType: { ...et.type, default: "info" },
|
|
1289
|
+
validateEvent: {
|
|
1290
|
+
type: Boolean,
|
|
1291
|
+
default: !0
|
|
1292
|
+
},
|
|
1293
|
+
remoteShowSuffix: Boolean,
|
|
1294
|
+
suffixTransition: {
|
|
1295
|
+
type: Boolean,
|
|
1296
|
+
default: !0
|
|
1297
|
+
},
|
|
1298
|
+
placement: {
|
|
1299
|
+
type: String,
|
|
1300
|
+
values: bt,
|
|
1301
|
+
default: "bottom-start"
|
|
1302
|
+
},
|
|
1303
|
+
ariaLabel: {
|
|
1304
|
+
type: String,
|
|
1305
|
+
default: void 0
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
emits: [
|
|
1309
|
+
te,
|
|
1310
|
+
xl,
|
|
1311
|
+
"remove-tag",
|
|
1312
|
+
"clear",
|
|
1313
|
+
"visible-change",
|
|
1314
|
+
"focus",
|
|
1315
|
+
"blur"
|
|
1316
|
+
],
|
|
1317
|
+
setup(e, l) {
|
|
1318
|
+
const o = be("select"), s = be("input"), { t: c } = Dl(), u = yn(e), {
|
|
1319
|
+
optionList: p,
|
|
1320
|
+
optionsArray: b,
|
|
1321
|
+
selectSize: f,
|
|
1322
|
+
readonly: w,
|
|
1323
|
+
handleResize: g,
|
|
1324
|
+
collapseTagSize: m,
|
|
1325
|
+
debouncedOnInputChange: B,
|
|
1326
|
+
debouncedQueryChange: A,
|
|
1327
|
+
deletePrevTag: $,
|
|
1328
|
+
deleteTag: n,
|
|
1329
|
+
deleteSelected: O,
|
|
1330
|
+
handleOptionSelect: T,
|
|
1331
|
+
scrollToOption: E,
|
|
1332
|
+
setSelected: q,
|
|
1333
|
+
resetInputHeight: ne,
|
|
1334
|
+
managePlaceholder: j,
|
|
1335
|
+
showClose: De,
|
|
1336
|
+
selectDisabled: Z,
|
|
1337
|
+
iconComponent: oe,
|
|
1338
|
+
iconReverse: qe,
|
|
1339
|
+
showNewOption: ye,
|
|
1340
|
+
emptyText: ie,
|
|
1341
|
+
toggleLastOptionHitState: P,
|
|
1342
|
+
resetInputState: Ke,
|
|
1343
|
+
handleComposition: re,
|
|
1344
|
+
onOptionCreate: ae,
|
|
1345
|
+
onOptionDestroy: je,
|
|
1346
|
+
handleMenuEnter: Qe,
|
|
1347
|
+
handleFocus: Q,
|
|
1348
|
+
focus: F,
|
|
1349
|
+
blur: ue,
|
|
1350
|
+
handleBlur: Ce,
|
|
1351
|
+
handleClearClick: U,
|
|
1352
|
+
handleClose: Se,
|
|
1353
|
+
handleKeydownEscape: Ue,
|
|
1354
|
+
toggleMenu: Ge,
|
|
1355
|
+
selectOption: Ye,
|
|
1356
|
+
getValueKey: Xe,
|
|
1357
|
+
navigateOptions: de,
|
|
1358
|
+
handleDeleteTooltipTag: rl,
|
|
1359
|
+
dropMenuVisible: ce,
|
|
1360
|
+
reference: G,
|
|
1361
|
+
input: ke,
|
|
1362
|
+
iOSInput: Le,
|
|
1363
|
+
tooltipRef: we,
|
|
1364
|
+
tagTooltipRef: $e,
|
|
1365
|
+
tags: Me,
|
|
1366
|
+
selectWrapper: Ve,
|
|
1367
|
+
scrollbar: pe,
|
|
1368
|
+
queryChange: Ze,
|
|
1369
|
+
groupQueryChange: Je,
|
|
1370
|
+
handleMouseEnter: xe,
|
|
1371
|
+
handleMouseLeave: Oe,
|
|
1372
|
+
showTagList: _e,
|
|
1373
|
+
collapseTagList: Be,
|
|
1374
|
+
selectTagsStyle: r
|
|
1375
|
+
} = Cn(e, u, l), {
|
|
1376
|
+
inputWidth: h,
|
|
1377
|
+
selected: M,
|
|
1378
|
+
inputLength: fe,
|
|
1379
|
+
filteredOptionsCount: Ie,
|
|
1380
|
+
visible: ul,
|
|
1381
|
+
selectedLabel: yl,
|
|
1382
|
+
hoverIndex: el,
|
|
1383
|
+
query: dl,
|
|
1384
|
+
inputHovering: ll,
|
|
1385
|
+
currentPlaceholder: tl,
|
|
1386
|
+
menuVisibleOnFocus: Cl,
|
|
1387
|
+
isOnComposition: Sl,
|
|
1388
|
+
options: nl,
|
|
1389
|
+
cachedOptions: wl,
|
|
1390
|
+
optionsCount: Ol,
|
|
1391
|
+
prefixWidth: Fe
|
|
1392
|
+
} = Vl(u), Il = v(() => {
|
|
1393
|
+
const R = [o.b()], ze = a(f);
|
|
1394
|
+
return ze && R.push(o.m(ze)), e.disabled && R.push(o.m("disabled")), R;
|
|
1395
|
+
}), t = v(() => [
|
|
1396
|
+
o.e("tags"),
|
|
1397
|
+
o.is("disabled", a(Z))
|
|
1398
|
+
]), i = v(() => [
|
|
1399
|
+
o.b("tags-wrapper"),
|
|
1400
|
+
{ "has-prefix": a(Fe) && a(M).length }
|
|
1401
|
+
]), d = v(() => [
|
|
1402
|
+
o.e("input"),
|
|
1403
|
+
o.is(a(f)),
|
|
1404
|
+
o.is("disabled", a(Z))
|
|
1405
|
+
]), C = v(() => [
|
|
1406
|
+
o.e("input"),
|
|
1407
|
+
o.is(a(f)),
|
|
1408
|
+
o.em("input", "iOS")
|
|
1409
|
+
]), N = v(() => [
|
|
1410
|
+
o.is("empty", !e.allowCreate && !!a(dl) && a(Ie) === 0)
|
|
1411
|
+
]), H = v(() => ({ maxWidth: `${a(h) > 123 ? a(h) - 123 : a(h) - 75}px` })), ve = v(() => ({
|
|
1412
|
+
marginLeft: `${a(Fe)}px`,
|
|
1413
|
+
flexGrow: 1,
|
|
1414
|
+
width: `${a(fe) / (a(h) - 32)}%`,
|
|
1415
|
+
maxWidth: `${a(h) - 42}px`
|
|
1416
|
+
}));
|
|
1417
|
+
Ql(gl, bl({
|
|
1418
|
+
props: e,
|
|
1419
|
+
options: nl,
|
|
1420
|
+
optionsArray: b,
|
|
1421
|
+
cachedOptions: wl,
|
|
1422
|
+
optionsCount: Ol,
|
|
1423
|
+
filteredOptionsCount: Ie,
|
|
1424
|
+
hoverIndex: el,
|
|
1425
|
+
handleOptionSelect: T,
|
|
1426
|
+
onOptionCreate: ae,
|
|
1427
|
+
onOptionDestroy: je,
|
|
1428
|
+
selectWrapper: Ve,
|
|
1429
|
+
selected: M,
|
|
1430
|
+
setSelected: q,
|
|
1431
|
+
queryChange: Ze,
|
|
1432
|
+
groupQueryChange: Je
|
|
1433
|
+
})), ml(() => {
|
|
1434
|
+
u.cachedPlaceHolder = tl.value = e.placeholder || (() => c("el.select.placeholder")), e.multiple && Array.isArray(e.modelValue) && e.modelValue.length > 0 && (tl.value = ""), zl(Ve, g), e.remote && e.multiple && ne(), D(() => {
|
|
1435
|
+
const R = G.value && G.value.$el;
|
|
1436
|
+
if (R && (h.value = R.getBoundingClientRect().width, l.slots.prefix)) {
|
|
1437
|
+
const ze = R.querySelector(`.${s.e("prefix")}`);
|
|
1438
|
+
Fe.value = Math.max(ze.getBoundingClientRect().width + 11, 30);
|
|
1439
|
+
}
|
|
1440
|
+
}), q();
|
|
1441
|
+
}), e.multiple && !Array.isArray(e.modelValue) && l.emit(te, []), !e.multiple && Array.isArray(e.modelValue) && l.emit(te, "");
|
|
1442
|
+
const me = v(() => {
|
|
1443
|
+
var R, ze;
|
|
1444
|
+
return (ze = (R = we.value) == null ? void 0 : R.popperRef) == null ? void 0 : ze.contentRef;
|
|
1445
|
+
});
|
|
1446
|
+
return {
|
|
1447
|
+
isIOS: It,
|
|
1448
|
+
onOptionsRendered: (R) => {
|
|
1449
|
+
p.value = R;
|
|
1450
|
+
},
|
|
1451
|
+
prefixWidth: Fe,
|
|
1452
|
+
selectSize: f,
|
|
1453
|
+
readonly: w,
|
|
1454
|
+
handleResize: g,
|
|
1455
|
+
collapseTagSize: m,
|
|
1456
|
+
debouncedOnInputChange: B,
|
|
1457
|
+
debouncedQueryChange: A,
|
|
1458
|
+
deletePrevTag: $,
|
|
1459
|
+
deleteTag: n,
|
|
1460
|
+
handleDeleteTooltipTag: rl,
|
|
1461
|
+
deleteSelected: O,
|
|
1462
|
+
handleOptionSelect: T,
|
|
1463
|
+
scrollToOption: E,
|
|
1464
|
+
inputWidth: h,
|
|
1465
|
+
selected: M,
|
|
1466
|
+
inputLength: fe,
|
|
1467
|
+
filteredOptionsCount: Ie,
|
|
1468
|
+
visible: ul,
|
|
1469
|
+
selectedLabel: yl,
|
|
1470
|
+
hoverIndex: el,
|
|
1471
|
+
query: dl,
|
|
1472
|
+
inputHovering: ll,
|
|
1473
|
+
currentPlaceholder: tl,
|
|
1474
|
+
menuVisibleOnFocus: Cl,
|
|
1475
|
+
isOnComposition: Sl,
|
|
1476
|
+
options: nl,
|
|
1477
|
+
resetInputHeight: ne,
|
|
1478
|
+
managePlaceholder: j,
|
|
1479
|
+
showClose: De,
|
|
1480
|
+
selectDisabled: Z,
|
|
1481
|
+
iconComponent: oe,
|
|
1482
|
+
iconReverse: qe,
|
|
1483
|
+
showNewOption: ye,
|
|
1484
|
+
emptyText: ie,
|
|
1485
|
+
toggleLastOptionHitState: P,
|
|
1486
|
+
resetInputState: Ke,
|
|
1487
|
+
handleComposition: re,
|
|
1488
|
+
handleMenuEnter: Qe,
|
|
1489
|
+
handleFocus: Q,
|
|
1490
|
+
focus: F,
|
|
1491
|
+
blur: ue,
|
|
1492
|
+
handleBlur: Ce,
|
|
1493
|
+
handleClearClick: U,
|
|
1494
|
+
handleClose: Se,
|
|
1495
|
+
handleKeydownEscape: Ue,
|
|
1496
|
+
toggleMenu: Ge,
|
|
1497
|
+
selectOption: Ye,
|
|
1498
|
+
getValueKey: Xe,
|
|
1499
|
+
navigateOptions: de,
|
|
1500
|
+
dropMenuVisible: ce,
|
|
1501
|
+
reference: G,
|
|
1502
|
+
input: ke,
|
|
1503
|
+
iOSInput: Le,
|
|
1504
|
+
tooltipRef: we,
|
|
1505
|
+
popperPaneRef: me,
|
|
1506
|
+
tags: Me,
|
|
1507
|
+
selectWrapper: Ve,
|
|
1508
|
+
scrollbar: pe,
|
|
1509
|
+
wrapperKls: Il,
|
|
1510
|
+
tagsKls: t,
|
|
1511
|
+
tagWrapperKls: i,
|
|
1512
|
+
inputKls: d,
|
|
1513
|
+
iOSInputKls: C,
|
|
1514
|
+
scrollbarKls: N,
|
|
1515
|
+
selectTagsStyle: r,
|
|
1516
|
+
nsSelect: o,
|
|
1517
|
+
tagTextStyle: H,
|
|
1518
|
+
inputStyle: ve,
|
|
1519
|
+
handleMouseEnter: xe,
|
|
1520
|
+
handleMouseLeave: Oe,
|
|
1521
|
+
showTagList: _e,
|
|
1522
|
+
collapseTagList: Be,
|
|
1523
|
+
tagTooltipRef: $e
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
}), On = ["disabled", "autocomplete", "aria-label"], In = ["disabled"], En = { style: { height: "100%", display: "flex", "justify-content": "center", "align-items": "center" } };
|
|
1527
|
+
function Tn(e, l, o, s, c, u) {
|
|
1528
|
+
const p = Ee("el-tag"), b = Ee("el-tooltip"), f = Ee("el-icon"), w = Ee("el-input"), g = Ee("el-option"), m = Ee("el-options"), B = Ee("el-scrollbar"), A = Ee("el-select-menu"), $ = st("click-outside");
|
|
1529
|
+
return He((y(), L("div", {
|
|
1530
|
+
ref: "selectWrapper",
|
|
1531
|
+
class: S(e.wrapperKls),
|
|
1532
|
+
onMouseenter: l[22] || (l[22] = (...n) => e.handleMouseEnter && e.handleMouseEnter(...n)),
|
|
1533
|
+
onMouseleave: l[23] || (l[23] = (...n) => e.handleMouseLeave && e.handleMouseLeave(...n)),
|
|
1534
|
+
onClick: l[24] || (l[24] = ee((...n) => e.toggleMenu && e.toggleMenu(...n), ["stop"]))
|
|
1535
|
+
}, [
|
|
1536
|
+
he(b, {
|
|
1537
|
+
ref: "tooltipRef",
|
|
1538
|
+
visible: e.dropMenuVisible,
|
|
1539
|
+
placement: e.placement,
|
|
1540
|
+
teleported: e.teleported,
|
|
1541
|
+
"popper-class": [e.nsSelect.e("popper"), e.popperClass],
|
|
1542
|
+
"popper-options": e.popperOptions,
|
|
1543
|
+
"fallback-placements": ["bottom-start", "top-start", "right", "left"],
|
|
1544
|
+
effect: e.effect,
|
|
1545
|
+
pure: "",
|
|
1546
|
+
trigger: "click",
|
|
1547
|
+
transition: `${e.nsSelect.namespace.value}-zoom-in-top`,
|
|
1548
|
+
"stop-popper-mouse-event": !1,
|
|
1549
|
+
"gpu-acceleration": !1,
|
|
1550
|
+
persistent: e.persistent,
|
|
1551
|
+
onShow: e.handleMenuEnter
|
|
1552
|
+
}, {
|
|
1553
|
+
default: k(() => [
|
|
1554
|
+
z("div", {
|
|
1555
|
+
class: "select-trigger",
|
|
1556
|
+
onMouseenter: l[20] || (l[20] = (n) => e.inputHovering = !0),
|
|
1557
|
+
onMouseleave: l[21] || (l[21] = (n) => e.inputHovering = !1)
|
|
1558
|
+
}, [
|
|
1559
|
+
e.multiple ? (y(), L("div", {
|
|
1560
|
+
key: 0,
|
|
1561
|
+
ref: "tags",
|
|
1562
|
+
tabindex: "-1",
|
|
1563
|
+
class: S(e.tagsKls),
|
|
1564
|
+
style: se(e.selectTagsStyle),
|
|
1565
|
+
onClick: l[15] || (l[15] = (...n) => e.focus && e.focus(...n))
|
|
1566
|
+
}, [
|
|
1567
|
+
e.collapseTags && e.selected.length ? (y(), V($l, {
|
|
1568
|
+
key: 0,
|
|
1569
|
+
onAfterLeave: e.resetInputHeight
|
|
1570
|
+
}, {
|
|
1571
|
+
default: k(() => [
|
|
1572
|
+
z("span", {
|
|
1573
|
+
class: S(e.tagWrapperKls)
|
|
1574
|
+
}, [
|
|
1575
|
+
(y(!0), L(Ae, null, Tl(e.showTagList, (n) => (y(), V(p, {
|
|
1576
|
+
key: e.getValueKey(n),
|
|
1577
|
+
closable: !e.selectDisabled && !n.isDisabled,
|
|
1578
|
+
size: e.collapseTagSize,
|
|
1579
|
+
hit: n.hitState,
|
|
1580
|
+
type: e.tagType,
|
|
1581
|
+
"disable-transitions": "",
|
|
1582
|
+
onClose: (O) => e.deleteTag(O, n)
|
|
1583
|
+
}, {
|
|
1584
|
+
default: k(() => [
|
|
1585
|
+
z("span", {
|
|
1586
|
+
class: S(e.nsSelect.e("tags-text")),
|
|
1587
|
+
style: se(e.tagTextStyle)
|
|
1588
|
+
}, Y(n.currentLabel), 7)
|
|
1589
|
+
]),
|
|
1590
|
+
_: 2
|
|
1591
|
+
}, 1032, ["closable", "size", "hit", "type", "onClose"]))), 128)),
|
|
1592
|
+
e.selected.length > e.maxCollapseTags ? (y(), V(p, {
|
|
1593
|
+
key: 0,
|
|
1594
|
+
closable: !1,
|
|
1595
|
+
size: e.collapseTagSize,
|
|
1596
|
+
type: e.tagType,
|
|
1597
|
+
"disable-transitions": ""
|
|
1598
|
+
}, {
|
|
1599
|
+
default: k(() => [
|
|
1600
|
+
e.collapseTagsTooltip ? (y(), V(b, {
|
|
1601
|
+
key: 0,
|
|
1602
|
+
ref: "tagTooltipRef",
|
|
1603
|
+
disabled: e.dropMenuVisible,
|
|
1604
|
+
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
1605
|
+
effect: e.effect,
|
|
1606
|
+
placement: "bottom",
|
|
1607
|
+
teleported: e.teleported
|
|
1608
|
+
}, {
|
|
1609
|
+
default: k(() => [
|
|
1610
|
+
z("span", {
|
|
1611
|
+
class: S(e.nsSelect.e("tags-text"))
|
|
1612
|
+
}, "+ " + Y(e.selected.length - e.maxCollapseTags), 3)
|
|
1613
|
+
]),
|
|
1614
|
+
content: k(() => [
|
|
1615
|
+
z("div", {
|
|
1616
|
+
class: S(e.nsSelect.e("collapse-tags"))
|
|
1617
|
+
}, [
|
|
1618
|
+
(y(!0), L(Ae, null, Tl(e.collapseTagList, (n) => (y(), L("div", {
|
|
1619
|
+
key: e.getValueKey(n),
|
|
1620
|
+
class: S(e.nsSelect.e("collapse-tag"))
|
|
1621
|
+
}, [
|
|
1622
|
+
he(p, {
|
|
1623
|
+
class: "in-tooltip",
|
|
1624
|
+
closable: !e.selectDisabled && !n.isDisabled,
|
|
1625
|
+
size: e.collapseTagSize,
|
|
1626
|
+
hit: n.hitState,
|
|
1627
|
+
type: e.tagType,
|
|
1628
|
+
"disable-transitions": "",
|
|
1629
|
+
style: { margin: "2px" },
|
|
1630
|
+
onClose: (O) => e.handleDeleteTooltipTag(O, n)
|
|
1631
|
+
}, {
|
|
1632
|
+
default: k(() => [
|
|
1633
|
+
z("span", {
|
|
1634
|
+
class: S(e.nsSelect.e("tags-text")),
|
|
1635
|
+
style: se({
|
|
1636
|
+
maxWidth: e.inputWidth - 75 + "px"
|
|
1637
|
+
})
|
|
1638
|
+
}, Y(n.currentLabel), 7)
|
|
1639
|
+
]),
|
|
1640
|
+
_: 2
|
|
1641
|
+
}, 1032, ["closable", "size", "hit", "type", "onClose"])
|
|
1642
|
+
], 2))), 128))
|
|
1643
|
+
], 2)
|
|
1644
|
+
]),
|
|
1645
|
+
_: 1
|
|
1646
|
+
}, 8, ["disabled", "effect", "teleported"])) : (y(), L("span", {
|
|
1647
|
+
key: 1,
|
|
1648
|
+
class: S(e.nsSelect.e("tags-text"))
|
|
1649
|
+
}, "+ " + Y(e.selected.length - e.maxCollapseTags), 3))
|
|
1650
|
+
]),
|
|
1651
|
+
_: 1
|
|
1652
|
+
}, 8, ["size", "type"])) : I("v-if", !0)
|
|
1653
|
+
], 2)
|
|
1654
|
+
]),
|
|
1655
|
+
_: 1
|
|
1656
|
+
}, 8, ["onAfterLeave"])) : I("v-if", !0),
|
|
1657
|
+
e.collapseTags ? I("v-if", !0) : (y(), V($l, {
|
|
1658
|
+
key: 1,
|
|
1659
|
+
onAfterLeave: e.resetInputHeight
|
|
1660
|
+
}, {
|
|
1661
|
+
default: k(() => [
|
|
1662
|
+
z("span", {
|
|
1663
|
+
class: S(e.tagWrapperKls),
|
|
1664
|
+
style: se(e.prefixWidth && e.selected.length ? { marginLeft: `${e.prefixWidth}px` } : "")
|
|
1665
|
+
}, [
|
|
1666
|
+
(y(!0), L(Ae, null, Tl(e.selected, (n) => (y(), V(p, {
|
|
1667
|
+
key: e.getValueKey(n),
|
|
1668
|
+
closable: !e.selectDisabled && !n.isDisabled,
|
|
1669
|
+
size: e.collapseTagSize,
|
|
1670
|
+
hit: n.hitState,
|
|
1671
|
+
type: e.tagType,
|
|
1672
|
+
"disable-transitions": "",
|
|
1673
|
+
onClose: (O) => e.deleteTag(O, n)
|
|
1674
|
+
}, {
|
|
1675
|
+
default: k(() => [
|
|
1676
|
+
z("span", {
|
|
1677
|
+
class: S(e.nsSelect.e("tags-text")),
|
|
1678
|
+
style: se({ maxWidth: e.inputWidth - 75 + "px" })
|
|
1679
|
+
}, Y(n.currentLabel), 7)
|
|
1680
|
+
]),
|
|
1681
|
+
_: 2
|
|
1682
|
+
}, 1032, ["closable", "size", "hit", "type", "onClose"]))), 128))
|
|
1683
|
+
], 6)
|
|
1684
|
+
]),
|
|
1685
|
+
_: 1
|
|
1686
|
+
}, 8, ["onAfterLeave"])),
|
|
1687
|
+
e.filterable && !e.selectDisabled ? He((y(), L("input", {
|
|
1688
|
+
key: 2,
|
|
1689
|
+
ref: "input",
|
|
1690
|
+
"onUpdate:modelValue": l[0] || (l[0] = (n) => e.query = n),
|
|
1691
|
+
type: "text",
|
|
1692
|
+
class: S(e.inputKls),
|
|
1693
|
+
disabled: e.selectDisabled,
|
|
1694
|
+
autocomplete: e.autocomplete,
|
|
1695
|
+
style: se(e.inputStyle),
|
|
1696
|
+
"aria-label": e.ariaLabel,
|
|
1697
|
+
onFocus: l[1] || (l[1] = (...n) => e.handleFocus && e.handleFocus(...n)),
|
|
1698
|
+
onBlur: l[2] || (l[2] = (...n) => e.handleBlur && e.handleBlur(...n)),
|
|
1699
|
+
onKeyup: l[3] || (l[3] = (...n) => e.managePlaceholder && e.managePlaceholder(...n)),
|
|
1700
|
+
onKeydown: [
|
|
1701
|
+
l[4] || (l[4] = (...n) => e.resetInputState && e.resetInputState(...n)),
|
|
1702
|
+
l[5] || (l[5] = x(ee((n) => e.navigateOptions("next"), ["prevent"]), ["down"])),
|
|
1703
|
+
l[6] || (l[6] = x(ee((n) => e.navigateOptions("prev"), ["prevent"]), ["up"])),
|
|
1704
|
+
l[7] || (l[7] = x((...n) => e.handleKeydownEscape && e.handleKeydownEscape(...n), ["esc"])),
|
|
1705
|
+
l[8] || (l[8] = x(ee((...n) => e.selectOption && e.selectOption(...n), ["stop", "prevent"]), ["enter"])),
|
|
1706
|
+
l[9] || (l[9] = x((...n) => e.deletePrevTag && e.deletePrevTag(...n), ["delete"])),
|
|
1707
|
+
l[10] || (l[10] = x((n) => e.visible = !1, ["tab"]))
|
|
1708
|
+
],
|
|
1709
|
+
onCompositionstart: l[11] || (l[11] = (...n) => e.handleComposition && e.handleComposition(...n)),
|
|
1710
|
+
onCompositionupdate: l[12] || (l[12] = (...n) => e.handleComposition && e.handleComposition(...n)),
|
|
1711
|
+
onCompositionend: l[13] || (l[13] = (...n) => e.handleComposition && e.handleComposition(...n)),
|
|
1712
|
+
onInput: l[14] || (l[14] = (...n) => e.debouncedQueryChange && e.debouncedQueryChange(...n))
|
|
1713
|
+
}, null, 46, On)), [
|
|
1714
|
+
[rt, e.query]
|
|
1715
|
+
]) : I("v-if", !0)
|
|
1716
|
+
], 6)) : I("v-if", !0),
|
|
1717
|
+
I(" fix: https://github.com/element-plus/element-plus/issues/11415 "),
|
|
1718
|
+
e.isIOS && !e.multiple && e.filterable && e.readonly ? (y(), L("input", {
|
|
1719
|
+
key: 1,
|
|
1720
|
+
ref: "iOSInput",
|
|
1721
|
+
class: S(e.iOSInputKls),
|
|
1722
|
+
disabled: e.selectDisabled,
|
|
1723
|
+
type: "text"
|
|
1724
|
+
}, null, 10, In)) : I("v-if", !0),
|
|
1725
|
+
he(w, {
|
|
1726
|
+
id: e.id,
|
|
1727
|
+
ref: "reference",
|
|
1728
|
+
modelValue: e.selectedLabel,
|
|
1729
|
+
"onUpdate:modelValue": l[16] || (l[16] = (n) => e.selectedLabel = n),
|
|
1730
|
+
type: "text",
|
|
1731
|
+
placeholder: typeof e.currentPlaceholder == "function" ? e.currentPlaceholder() : e.currentPlaceholder,
|
|
1732
|
+
name: e.name,
|
|
1733
|
+
autocomplete: e.autocomplete,
|
|
1734
|
+
size: e.selectSize,
|
|
1735
|
+
disabled: e.selectDisabled,
|
|
1736
|
+
readonly: e.readonly,
|
|
1737
|
+
"validate-event": !1,
|
|
1738
|
+
class: S([e.nsSelect.is("focus", e.visible)]),
|
|
1739
|
+
tabindex: e.multiple && e.filterable ? -1 : void 0,
|
|
1740
|
+
label: e.ariaLabel,
|
|
1741
|
+
onFocus: e.handleFocus,
|
|
1742
|
+
onBlur: e.handleBlur,
|
|
1743
|
+
onInput: e.debouncedOnInputChange,
|
|
1744
|
+
onPaste: e.debouncedOnInputChange,
|
|
1745
|
+
onCompositionstart: e.handleComposition,
|
|
1746
|
+
onCompositionupdate: e.handleComposition,
|
|
1747
|
+
onCompositionend: e.handleComposition,
|
|
1748
|
+
onKeydown: [
|
|
1749
|
+
l[17] || (l[17] = x(ee((n) => e.navigateOptions("next"), ["stop", "prevent"]), ["down"])),
|
|
1750
|
+
l[18] || (l[18] = x(ee((n) => e.navigateOptions("prev"), ["stop", "prevent"]), ["up"])),
|
|
1751
|
+
x(ee(e.selectOption, ["stop", "prevent"]), ["enter"]),
|
|
1752
|
+
x(e.handleKeydownEscape, ["esc"]),
|
|
1753
|
+
l[19] || (l[19] = x((n) => e.visible = !1, ["tab"]))
|
|
1754
|
+
]
|
|
1755
|
+
}, ut({
|
|
1756
|
+
suffix: k(() => [
|
|
1757
|
+
e.iconComponent && !e.showClose ? (y(), V(f, {
|
|
1758
|
+
key: 0,
|
|
1759
|
+
class: S([e.nsSelect.e("caret"), e.nsSelect.e("icon"), e.iconReverse])
|
|
1760
|
+
}, {
|
|
1761
|
+
default: k(() => [
|
|
1762
|
+
(y(), V(Ne(e.iconComponent)))
|
|
1763
|
+
]),
|
|
1764
|
+
_: 1
|
|
1765
|
+
}, 8, ["class"])) : I("v-if", !0),
|
|
1766
|
+
e.showClose && e.clearIcon ? (y(), V(f, {
|
|
1767
|
+
key: 1,
|
|
1768
|
+
class: S([e.nsSelect.e("caret"), e.nsSelect.e("icon")]),
|
|
1769
|
+
onClick: e.handleClearClick
|
|
1770
|
+
}, {
|
|
1771
|
+
default: k(() => [
|
|
1772
|
+
(y(), V(Ne(e.clearIcon)))
|
|
1773
|
+
]),
|
|
1774
|
+
_: 1
|
|
1775
|
+
}, 8, ["class", "onClick"])) : I("v-if", !0)
|
|
1776
|
+
]),
|
|
1777
|
+
_: 2
|
|
1778
|
+
}, [
|
|
1779
|
+
e.$slots.prefix ? {
|
|
1780
|
+
name: "prefix",
|
|
1781
|
+
fn: k(() => [
|
|
1782
|
+
z("div", En, [
|
|
1783
|
+
X(e.$slots, "prefix")
|
|
1784
|
+
])
|
|
1785
|
+
])
|
|
1786
|
+
} : void 0
|
|
1787
|
+
]), 1032, ["id", "modelValue", "placeholder", "name", "autocomplete", "size", "disabled", "readonly", "class", "tabindex", "label", "onFocus", "onBlur", "onInput", "onPaste", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onKeydown"])
|
|
1788
|
+
], 32)
|
|
1789
|
+
]),
|
|
1790
|
+
content: k(() => [
|
|
1791
|
+
he(A, null, {
|
|
1792
|
+
default: k(() => [
|
|
1793
|
+
He(he(B, {
|
|
1794
|
+
ref: "scrollbar",
|
|
1795
|
+
tag: "ul",
|
|
1796
|
+
"wrap-class": e.nsSelect.be("dropdown", "wrap"),
|
|
1797
|
+
"view-class": e.nsSelect.be("dropdown", "list"),
|
|
1798
|
+
class: S(e.scrollbarKls)
|
|
1799
|
+
}, {
|
|
1800
|
+
default: k(() => [
|
|
1801
|
+
e.showNewOption ? (y(), V(g, {
|
|
1802
|
+
key: 0,
|
|
1803
|
+
value: e.query,
|
|
1804
|
+
created: !0
|
|
1805
|
+
}, null, 8, ["value"])) : I("v-if", !0),
|
|
1806
|
+
he(m, { onUpdateOptions: e.onOptionsRendered }, {
|
|
1807
|
+
default: k(() => [
|
|
1808
|
+
X(e.$slots, "default")
|
|
1809
|
+
]),
|
|
1810
|
+
_: 3
|
|
1811
|
+
}, 8, ["onUpdateOptions"])
|
|
1812
|
+
]),
|
|
1813
|
+
_: 3
|
|
1814
|
+
}, 8, ["wrap-class", "view-class", "class"]), [
|
|
1815
|
+
[hl, e.options.size > 0 && !e.loading]
|
|
1816
|
+
]),
|
|
1817
|
+
e.emptyText && (!e.allowCreate || e.loading || e.allowCreate && e.options.size === 0) ? (y(), L(Ae, { key: 0 }, [
|
|
1818
|
+
e.$slots.empty ? X(e.$slots, "empty", { key: 0 }) : (y(), L("p", {
|
|
1819
|
+
key: 1,
|
|
1820
|
+
class: S(e.nsSelect.be("dropdown", "empty"))
|
|
1821
|
+
}, Y(e.emptyText), 3))
|
|
1822
|
+
], 64)) : I("v-if", !0)
|
|
1823
|
+
]),
|
|
1824
|
+
_: 3
|
|
1825
|
+
})
|
|
1826
|
+
]),
|
|
1827
|
+
_: 3
|
|
1828
|
+
}, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "effect", "transition", "persistent", "onShow"])
|
|
1829
|
+
], 34)), [
|
|
1830
|
+
[$, e.handleClose, e.popperPaneRef]
|
|
1831
|
+
]);
|
|
1832
|
+
}
|
|
1833
|
+
var kn = /* @__PURE__ */ We(wn, [["render", Tn], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/select.vue"]]);
|
|
1834
|
+
const Ln = ge({
|
|
1835
|
+
name: "ElOptionGroup",
|
|
1836
|
+
componentName: "ElOptionGroup",
|
|
1837
|
+
props: {
|
|
1838
|
+
label: String,
|
|
1839
|
+
disabled: Boolean
|
|
1840
|
+
},
|
|
1841
|
+
setup(e) {
|
|
1842
|
+
const l = be("select"), o = K(!0), s = sl(), c = K([]);
|
|
1843
|
+
Ql(lt, bl({
|
|
1844
|
+
...Vl(e)
|
|
1845
|
+
}));
|
|
1846
|
+
const u = cl(gl);
|
|
1847
|
+
ml(() => {
|
|
1848
|
+
c.value = p(s.subTree);
|
|
1849
|
+
});
|
|
1850
|
+
const p = (f) => {
|
|
1851
|
+
const w = [];
|
|
1852
|
+
return Array.isArray(f.children) && f.children.forEach((g) => {
|
|
1853
|
+
var m;
|
|
1854
|
+
g.type && g.type.name === "ElOption" && g.component && g.component.proxy ? w.push(g.component.proxy) : (m = g.children) != null && m.length && w.push(...p(g));
|
|
1855
|
+
}), w;
|
|
1856
|
+
}, { groupQueryChange: b } = pl(u);
|
|
1857
|
+
return W(b, () => {
|
|
1858
|
+
o.value = c.value.some((f) => f.visible === !0);
|
|
1859
|
+
}, { flush: "post" }), {
|
|
1860
|
+
visible: o,
|
|
1861
|
+
ns: l
|
|
1862
|
+
};
|
|
1863
|
+
}
|
|
1864
|
+
});
|
|
1865
|
+
function $n(e, l, o, s, c, u) {
|
|
1866
|
+
return He((y(), L("ul", {
|
|
1867
|
+
class: S(e.ns.be("group", "wrap"))
|
|
1868
|
+
}, [
|
|
1869
|
+
z("li", {
|
|
1870
|
+
class: S(e.ns.be("group", "title"))
|
|
1871
|
+
}, Y(e.label), 3),
|
|
1872
|
+
z("li", null, [
|
|
1873
|
+
z("ul", {
|
|
1874
|
+
class: S(e.ns.b("group"))
|
|
1875
|
+
}, [
|
|
1876
|
+
X(e.$slots, "default")
|
|
1877
|
+
], 2)
|
|
1878
|
+
])
|
|
1879
|
+
], 2)), [
|
|
1880
|
+
[hl, e.visible]
|
|
1881
|
+
]);
|
|
1882
|
+
}
|
|
1883
|
+
var tt = /* @__PURE__ */ We(Ln, [["render", $n], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/option-group.vue"]]);
|
|
1884
|
+
const Fn = Al(kn, {
|
|
1885
|
+
Option: Bl,
|
|
1886
|
+
OptionGroup: tt
|
|
1887
|
+
}), Nn = Yl(Bl);
|
|
1888
|
+
Yl(tt);
|
|
1889
|
+
export {
|
|
1890
|
+
Nn as E,
|
|
1891
|
+
Fn as a,
|
|
1892
|
+
sn as b,
|
|
1893
|
+
pn as c
|
|
1894
|
+
};
|