st-comp 0.0.93 → 0.0.95
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/components.d.ts +13 -0
- package/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +2 -2
- package/es/Dialog.cjs +1 -5
- package/es/Dialog.js +45 -711
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +463 -1
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +92 -91
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +10 -9
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +106 -104
- package/es/Table.cjs +1 -20
- package/es/Table.js +361 -4253
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +2545 -1
- package/es/VirtualTable.cjs +3 -3
- package/es/VirtualTable.js +249 -254
- package/es/base-6e64c2e6.js +762 -0
- package/es/base-8776b83e.cjs +9 -0
- package/es/castArray-59d5ae43.cjs +1 -0
- package/es/castArray-8ec29ca6.js +10 -0
- package/es/config-provider-76ef1b35.cjs +1 -0
- package/es/config-provider-f4278c8e.js +46 -0
- package/es/{el-button-9476b767.js → el-button-4c7ae9df.js} +52 -52
- package/es/{el-button-ed961332.cjs → el-button-65e4598f.cjs} +1 -1
- package/es/{el-empty-f4c08c01.js → el-empty-05e13b3c.js} +3 -3
- package/es/{el-empty-7adcc7f0.cjs → el-empty-dfe11c21.cjs} +1 -1
- package/es/el-icon-0ea8fbf8.cjs +1 -0
- package/es/el-icon-4ed993c7.js +1 -0
- package/es/el-input-11327619.cjs +9 -0
- package/es/el-input-f4898cfa.js +544 -0
- package/es/el-overlay-9d9c6ba9.cjs +5 -0
- package/es/el-overlay-d7af7dda.js +678 -0
- package/es/el-popover-4a4a4b02.cjs +1 -0
- package/es/el-popover-dc9c7ff7.js +133 -0
- package/es/el-radio-group-a31fb7c0.js +1743 -0
- package/es/el-radio-group-cc2d6c87.cjs +12 -0
- package/es/{el-scrollbar-ffb7b9c1.js → el-scrollbar-a00aca2f.js} +48 -48
- package/es/{el-scrollbar-586be9bd.cjs → el-scrollbar-f197b544.cjs} +1 -1
- package/es/el-select-5dbb0da3.cjs +1 -0
- package/es/el-select-b9cf452e.js +1360 -0
- package/es/el-table-column-1e15361e.cjs +20 -0
- package/es/el-table-column-675f51e6.js +3795 -0
- package/es/el-tag-c9d5baa7.cjs +1 -0
- package/es/{el-tag-7549c103.js → el-tag-f878b1f1.js} +126 -119
- package/es/{focus-trap-5fc152a0.js → focus-trap-2677bd39.js} +35 -34
- package/es/focus-trap-5f42842b.cjs +1 -0
- package/es/raf-32ed81f4.js +6 -0
- package/es/{raf-c4bba516.cjs → raf-7c366b55.cjs} +1 -1
- package/es/{scroll-38e17abc.cjs → scroll-22a00b05.cjs} +1 -1
- package/es/{scroll-c6e51ef8.js → scroll-9b9249e9.js} +5 -5
- package/es/style.css +1 -1
- package/es/use-form-item-67e7ef93.cjs +3 -0
- package/es/use-form-item-bfc7dddf.js +669 -0
- package/es/use-global-config-89daeba3.js +110 -0
- package/es/use-global-config-f9103903.cjs +1 -0
- package/es/{vnode-40f9df3c.cjs → vnode-69f3ca85.cjs} +1 -1
- package/es/{vnode-f4b846cb.js → vnode-aa3448ec.js} +1 -1
- package/es/zh-cn-720e514b.cjs +1 -0
- package/es/{zh-cn-e36dfbf4.js → zh-cn-e662dc89.js} +6 -45
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +174 -174
- package/lib/{index-4635557b.js → index-5fe750ca.js} +27924 -27395
- package/lib/{python-aa056c80.js → python-65fdc0e1.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/VarietySearch/components/CommonIndicator/index.vue +270 -112
- package/packages/VarietySearch/components/FactorScreen/index.vue +44 -5
- package/packages/VarietySearch/config.js +12 -1
- package/packages/VarietySearch/index.vue +8 -0
- package/es/base-8aa55db5.js +0 -725
- package/es/base-b187e78f.cjs +0 -9
- package/es/el-select-a6cf0236.js +0 -1893
- package/es/el-select-eaa79c54.cjs +0 -9
- package/es/el-tag-5a8b728a.cjs +0 -1
- package/es/focus-trap-ea1e7a19.cjs +0 -1
- package/es/raf-3a2b250a.js +0 -6
- package/es/use-form-item-bd4b9eeb.js +0 -531
- package/es/use-form-item-c25c7251.cjs +0 -3
- package/es/use-global-config-2d21cd56.js +0 -110
- package/es/use-global-config-bce8cdd8.cjs +0 -1
- package/es/zh-cn-a61d484e.cjs +0 -1
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
import { computed as p, getCurrentInstance as ze, ref as N, shallowRef as X, watch as G, defineComponent as ke, useAttrs as Ke, useSlots as je, nextTick as F, onMounted as We, toRef as Ue, withDirectives as Ye, openBlock as m, createElementBlock as S, mergeProps as oe, unref as t, createCommentVNode as y, Fragment as ae, normalizeClass as b, renderSlot as W, createElementVNode as V, createBlock as C, withCtx as $, resolveDynamicComponent as U, withModifiers as Xe, createVNode as Ge, toDisplayString as Y, normalizeStyle as Ze, vShow as qe } from "vue";
|
|
2
|
+
import { a as Je, u as Qe } from "./el-scrollbar-a00aca2f.js";
|
|
3
|
+
import { t as et, i as we, v as tt, w as ot, j as at, h as nt, V as st, F as lt, G as rt, E as B, D as it } from "./use-form-item-bfc7dddf.js";
|
|
4
|
+
import { o as Pe, j as Z, M as ut, k as Se, b as ct, d as ne, i as se, u as Ie, N as dt, _ as pt, e as Ce, w as ft } from "./base-6e64c2e6.js";
|
|
5
|
+
import { m as vt } from "./typescript-7ae59c4c.js";
|
|
6
|
+
import { U as le, i as mt } from "./focus-trap-2677bd39.js";
|
|
7
|
+
const yt = () => Pe && /firefox/i.test(window.navigator.userAgent), ht = (a) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(a), bt = ["class", "style"], gt = /^on[A-Z]/, xt = (a = {}) => {
|
|
8
|
+
const { excludeListeners: f = !1, excludeKeys: i } = a, o = p(() => ((i == null ? void 0 : i.value) || []).concat(bt)), r = ze();
|
|
9
|
+
return r ? p(() => {
|
|
10
|
+
var l;
|
|
11
|
+
return ut(Object.entries((l = r.proxy) == null ? void 0 : l.$attrs).filter(([u]) => !o.value.includes(u) && !(f && gt.test(u))));
|
|
12
|
+
}) : (Z("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), p(() => ({})));
|
|
13
|
+
};
|
|
14
|
+
function wt(a) {
|
|
15
|
+
const f = N();
|
|
16
|
+
function i() {
|
|
17
|
+
if (a.value == null)
|
|
18
|
+
return;
|
|
19
|
+
const { selectionStart: r, selectionEnd: l, value: u } = a.value;
|
|
20
|
+
if (r == null || l == null)
|
|
21
|
+
return;
|
|
22
|
+
const x = u.slice(0, Math.max(0, r)), c = u.slice(Math.max(0, l));
|
|
23
|
+
f.value = {
|
|
24
|
+
selectionStart: r,
|
|
25
|
+
selectionEnd: l,
|
|
26
|
+
value: u,
|
|
27
|
+
beforeTxt: x,
|
|
28
|
+
afterTxt: c
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function o() {
|
|
32
|
+
if (a.value == null || f.value == null)
|
|
33
|
+
return;
|
|
34
|
+
const { value: r } = a.value, { beforeTxt: l, afterTxt: u, selectionStart: x } = f.value;
|
|
35
|
+
if (l == null || u == null || x == null)
|
|
36
|
+
return;
|
|
37
|
+
let c = r.length;
|
|
38
|
+
if (r.endsWith(u))
|
|
39
|
+
c = r.length - u.length;
|
|
40
|
+
else if (r.startsWith(l))
|
|
41
|
+
c = l.length;
|
|
42
|
+
else {
|
|
43
|
+
const g = l[x - 1], v = r.indexOf(g, x - 1);
|
|
44
|
+
v !== -1 && (c = v + 1);
|
|
45
|
+
}
|
|
46
|
+
a.value.setSelectionRange(c, c);
|
|
47
|
+
}
|
|
48
|
+
return [i, o];
|
|
49
|
+
}
|
|
50
|
+
function St(a, { afterFocus: f, afterBlur: i } = {}) {
|
|
51
|
+
const o = ze(), { emit: r } = o, l = X(), u = N(!1), x = (v) => {
|
|
52
|
+
u.value || (u.value = !0, r("focus", v), f == null || f());
|
|
53
|
+
}, c = (v) => {
|
|
54
|
+
var d;
|
|
55
|
+
v.relatedTarget && ((d = l.value) != null && d.contains(v.relatedTarget)) || (u.value = !1, r("blur", v), i == null || i());
|
|
56
|
+
}, g = () => {
|
|
57
|
+
var v;
|
|
58
|
+
(v = a.value) == null || v.focus();
|
|
59
|
+
};
|
|
60
|
+
return G(l, (v) => {
|
|
61
|
+
v && v.setAttribute("tabindex", "-1");
|
|
62
|
+
}), Je(l, "click", g), {
|
|
63
|
+
wrapperRef: l,
|
|
64
|
+
isFocused: u,
|
|
65
|
+
handleFocus: x,
|
|
66
|
+
handleBlur: c
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
let w;
|
|
70
|
+
const It = `
|
|
71
|
+
height:0 !important;
|
|
72
|
+
visibility:hidden !important;
|
|
73
|
+
${yt() ? "" : "overflow:hidden !important;"}
|
|
74
|
+
position:absolute !important;
|
|
75
|
+
z-index:-1000 !important;
|
|
76
|
+
top:0 !important;
|
|
77
|
+
right:0 !important;
|
|
78
|
+
`, Ct = [
|
|
79
|
+
"letter-spacing",
|
|
80
|
+
"line-height",
|
|
81
|
+
"padding-top",
|
|
82
|
+
"padding-bottom",
|
|
83
|
+
"font-family",
|
|
84
|
+
"font-weight",
|
|
85
|
+
"font-size",
|
|
86
|
+
"text-rendering",
|
|
87
|
+
"text-transform",
|
|
88
|
+
"width",
|
|
89
|
+
"text-indent",
|
|
90
|
+
"padding-left",
|
|
91
|
+
"padding-right",
|
|
92
|
+
"border-width",
|
|
93
|
+
"box-sizing"
|
|
94
|
+
];
|
|
95
|
+
function Et(a) {
|
|
96
|
+
const f = window.getComputedStyle(a), i = f.getPropertyValue("box-sizing"), o = Number.parseFloat(f.getPropertyValue("padding-bottom")) + Number.parseFloat(f.getPropertyValue("padding-top")), r = Number.parseFloat(f.getPropertyValue("border-bottom-width")) + Number.parseFloat(f.getPropertyValue("border-top-width"));
|
|
97
|
+
return { contextStyle: Ct.map((u) => `${u}:${f.getPropertyValue(u)}`).join(";"), paddingSize: o, borderSize: r, boxSizing: i };
|
|
98
|
+
}
|
|
99
|
+
function Ee(a, f = 1, i) {
|
|
100
|
+
var o;
|
|
101
|
+
w || (w = document.createElement("textarea"), document.body.appendChild(w));
|
|
102
|
+
const { paddingSize: r, borderSize: l, boxSizing: u, contextStyle: x } = Et(a);
|
|
103
|
+
w.setAttribute("style", `${x};${It}`), w.value = a.value || a.placeholder || "";
|
|
104
|
+
let c = w.scrollHeight;
|
|
105
|
+
const g = {};
|
|
106
|
+
u === "border-box" ? c = c + l : u === "content-box" && (c = c - r), w.value = "";
|
|
107
|
+
const v = w.scrollHeight - r;
|
|
108
|
+
if (Se(f)) {
|
|
109
|
+
let d = v * f;
|
|
110
|
+
u === "border-box" && (d = d + r + l), c = Math.max(d, c), g.minHeight = `${d}px`;
|
|
111
|
+
}
|
|
112
|
+
if (Se(i)) {
|
|
113
|
+
let d = v * i;
|
|
114
|
+
u === "border-box" && (d = d + r + l), c = Math.min(d, c);
|
|
115
|
+
}
|
|
116
|
+
return g.height = `${c}px`, (o = w.parentNode) == null || o.removeChild(w), w = void 0, g;
|
|
117
|
+
}
|
|
118
|
+
const zt = ct({
|
|
119
|
+
id: {
|
|
120
|
+
type: String,
|
|
121
|
+
default: void 0
|
|
122
|
+
},
|
|
123
|
+
size: et,
|
|
124
|
+
disabled: Boolean,
|
|
125
|
+
modelValue: {
|
|
126
|
+
type: ne([
|
|
127
|
+
String,
|
|
128
|
+
Number,
|
|
129
|
+
Object
|
|
130
|
+
]),
|
|
131
|
+
default: ""
|
|
132
|
+
},
|
|
133
|
+
type: {
|
|
134
|
+
type: String,
|
|
135
|
+
default: "text"
|
|
136
|
+
},
|
|
137
|
+
resize: {
|
|
138
|
+
type: String,
|
|
139
|
+
values: ["none", "both", "horizontal", "vertical"]
|
|
140
|
+
},
|
|
141
|
+
autosize: {
|
|
142
|
+
type: ne([Boolean, Object]),
|
|
143
|
+
default: !1
|
|
144
|
+
},
|
|
145
|
+
autocomplete: {
|
|
146
|
+
type: String,
|
|
147
|
+
default: "off"
|
|
148
|
+
},
|
|
149
|
+
formatter: {
|
|
150
|
+
type: Function
|
|
151
|
+
},
|
|
152
|
+
parser: {
|
|
153
|
+
type: Function
|
|
154
|
+
},
|
|
155
|
+
placeholder: {
|
|
156
|
+
type: String
|
|
157
|
+
},
|
|
158
|
+
form: {
|
|
159
|
+
type: String
|
|
160
|
+
},
|
|
161
|
+
readonly: {
|
|
162
|
+
type: Boolean,
|
|
163
|
+
default: !1
|
|
164
|
+
},
|
|
165
|
+
clearable: {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
default: !1
|
|
168
|
+
},
|
|
169
|
+
showPassword: {
|
|
170
|
+
type: Boolean,
|
|
171
|
+
default: !1
|
|
172
|
+
},
|
|
173
|
+
showWordLimit: {
|
|
174
|
+
type: Boolean,
|
|
175
|
+
default: !1
|
|
176
|
+
},
|
|
177
|
+
suffixIcon: {
|
|
178
|
+
type: we
|
|
179
|
+
},
|
|
180
|
+
prefixIcon: {
|
|
181
|
+
type: we
|
|
182
|
+
},
|
|
183
|
+
containerRole: {
|
|
184
|
+
type: String,
|
|
185
|
+
default: void 0
|
|
186
|
+
},
|
|
187
|
+
label: {
|
|
188
|
+
type: String,
|
|
189
|
+
default: void 0
|
|
190
|
+
},
|
|
191
|
+
tabindex: {
|
|
192
|
+
type: [String, Number],
|
|
193
|
+
default: 0
|
|
194
|
+
},
|
|
195
|
+
validateEvent: {
|
|
196
|
+
type: Boolean,
|
|
197
|
+
default: !0
|
|
198
|
+
},
|
|
199
|
+
inputStyle: {
|
|
200
|
+
type: ne([Object, Array, String]),
|
|
201
|
+
default: () => vt({})
|
|
202
|
+
},
|
|
203
|
+
autofocus: {
|
|
204
|
+
type: Boolean,
|
|
205
|
+
default: !1
|
|
206
|
+
}
|
|
207
|
+
}), kt = {
|
|
208
|
+
[le]: (a) => se(a),
|
|
209
|
+
input: (a) => se(a),
|
|
210
|
+
change: (a) => se(a),
|
|
211
|
+
focus: (a) => a instanceof FocusEvent,
|
|
212
|
+
blur: (a) => a instanceof FocusEvent,
|
|
213
|
+
clear: () => !0,
|
|
214
|
+
mouseleave: (a) => a instanceof MouseEvent,
|
|
215
|
+
mouseenter: (a) => a instanceof MouseEvent,
|
|
216
|
+
keydown: (a) => a instanceof Event,
|
|
217
|
+
compositionstart: (a) => a instanceof CompositionEvent,
|
|
218
|
+
compositionupdate: (a) => a instanceof CompositionEvent,
|
|
219
|
+
compositionend: (a) => a instanceof CompositionEvent
|
|
220
|
+
}, Pt = ["role"], Ft = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus"], Vt = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus"], Nt = ke({
|
|
221
|
+
name: "ElInput",
|
|
222
|
+
inheritAttrs: !1
|
|
223
|
+
}), Tt = /* @__PURE__ */ ke({
|
|
224
|
+
...Nt,
|
|
225
|
+
props: zt,
|
|
226
|
+
emits: kt,
|
|
227
|
+
setup(a, { expose: f, emit: i }) {
|
|
228
|
+
const o = a, r = Ke(), l = je(), u = p(() => {
|
|
229
|
+
const e = {};
|
|
230
|
+
return o.containerRole === "combobox" && (e["aria-haspopup"] = r["aria-haspopup"], e["aria-owns"] = r["aria-owns"], e["aria-expanded"] = r["aria-expanded"]), e;
|
|
231
|
+
}), x = p(() => [
|
|
232
|
+
o.type === "textarea" ? ie.b() : s.b(),
|
|
233
|
+
s.m(Fe.value),
|
|
234
|
+
s.is("disabled", z.value),
|
|
235
|
+
s.is("exceed", Re.value),
|
|
236
|
+
{
|
|
237
|
+
[s.b("group")]: l.prepend || l.append,
|
|
238
|
+
[s.bm("group", "append")]: l.append,
|
|
239
|
+
[s.bm("group", "prepend")]: l.prepend,
|
|
240
|
+
[s.m("prefix")]: l.prefix || o.prefixIcon,
|
|
241
|
+
[s.m("suffix")]: l.suffix || o.suffixIcon || o.clearable || o.showPassword,
|
|
242
|
+
[s.bm("suffix", "password-clear")]: K.value && Q.value
|
|
243
|
+
},
|
|
244
|
+
r.class
|
|
245
|
+
]), c = p(() => [
|
|
246
|
+
s.e("wrapper"),
|
|
247
|
+
s.is("focus", J.value)
|
|
248
|
+
]), g = xt({
|
|
249
|
+
excludeKeys: p(() => Object.keys(u.value))
|
|
250
|
+
}), { form: v, formItem: d } = tt(), { inputId: re } = ot(o, {
|
|
251
|
+
formItemContext: d
|
|
252
|
+
}), Fe = at(), z = nt(), s = Ie("input"), ie = Ie("textarea"), L = X(), I = X(), q = N(!1), T = N(!1), O = N(!1), ue = N(), D = X(o.inputStyle), k = p(() => L.value || I.value), { wrapperRef: Ve, isFocused: J, handleFocus: H, handleBlur: _ } = St(k, {
|
|
253
|
+
afterBlur() {
|
|
254
|
+
var e;
|
|
255
|
+
o.validateEvent && ((e = d == null ? void 0 : d.validate) == null || e.call(d, "blur").catch((n) => Z(n)));
|
|
256
|
+
}
|
|
257
|
+
}), ce = p(() => {
|
|
258
|
+
var e;
|
|
259
|
+
return (e = v == null ? void 0 : v.statusIcon) != null ? e : !1;
|
|
260
|
+
}), R = p(() => (d == null ? void 0 : d.validateState) || ""), de = p(() => R.value && st[R.value]), Ne = p(() => O.value ? lt : rt), Te = p(() => [
|
|
261
|
+
r.style,
|
|
262
|
+
o.inputStyle
|
|
263
|
+
]), pe = p(() => [
|
|
264
|
+
o.inputStyle,
|
|
265
|
+
D.value,
|
|
266
|
+
{ resize: o.resize }
|
|
267
|
+
]), E = p(() => mt(o.modelValue) ? "" : String(o.modelValue)), K = p(() => o.clearable && !z.value && !o.readonly && !!E.value && (J.value || q.value)), Q = p(() => o.showPassword && !z.value && !o.readonly && !!E.value && (!!E.value || J.value)), P = p(() => o.showWordLimit && !!g.value.maxlength && (o.type === "text" || o.type === "textarea") && !z.value && !o.readonly && !o.showPassword), ee = p(() => E.value.length), Re = p(() => !!P.value && ee.value > Number(g.value.maxlength)), Ae = p(() => !!l.suffix || !!o.suffixIcon || K.value || o.showPassword || P.value || !!R.value && ce.value), [Me, $e] = wt(L);
|
|
268
|
+
Qe(I, (e) => {
|
|
269
|
+
if (Be(), !P.value || o.resize !== "both")
|
|
270
|
+
return;
|
|
271
|
+
const n = e[0], { width: h } = n.contentRect;
|
|
272
|
+
ue.value = {
|
|
273
|
+
right: `calc(100% - ${h + 15 + 6}px)`
|
|
274
|
+
};
|
|
275
|
+
});
|
|
276
|
+
const A = () => {
|
|
277
|
+
const { type: e, autosize: n } = o;
|
|
278
|
+
if (!(!Pe || e !== "textarea" || !I.value))
|
|
279
|
+
if (n) {
|
|
280
|
+
const h = Ce(n) ? n.minRows : void 0, j = Ce(n) ? n.maxRows : void 0, xe = Ee(I.value, h, j);
|
|
281
|
+
D.value = {
|
|
282
|
+
overflowY: "hidden",
|
|
283
|
+
...xe
|
|
284
|
+
}, F(() => {
|
|
285
|
+
I.value.offsetHeight, D.value = xe;
|
|
286
|
+
});
|
|
287
|
+
} else
|
|
288
|
+
D.value = {
|
|
289
|
+
minHeight: Ee(I.value).minHeight
|
|
290
|
+
};
|
|
291
|
+
}, Be = ((e) => {
|
|
292
|
+
let n = !1;
|
|
293
|
+
return () => {
|
|
294
|
+
var h;
|
|
295
|
+
if (n || !o.autosize)
|
|
296
|
+
return;
|
|
297
|
+
((h = I.value) == null ? void 0 : h.offsetParent) === null || (e(), n = !0);
|
|
298
|
+
};
|
|
299
|
+
})(A), M = () => {
|
|
300
|
+
const e = k.value, n = o.formatter ? o.formatter(E.value) : E.value;
|
|
301
|
+
!e || e.value === n || (e.value = n);
|
|
302
|
+
}, te = async (e) => {
|
|
303
|
+
Me();
|
|
304
|
+
let { value: n } = e.target;
|
|
305
|
+
if (o.formatter && (n = o.parser ? o.parser(n) : n), !T.value) {
|
|
306
|
+
if (n === E.value) {
|
|
307
|
+
M();
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
i(le, n), i("input", n), await F(), M(), $e();
|
|
311
|
+
}
|
|
312
|
+
}, fe = (e) => {
|
|
313
|
+
i("change", e.target.value);
|
|
314
|
+
}, ve = (e) => {
|
|
315
|
+
i("compositionstart", e), T.value = !0;
|
|
316
|
+
}, me = (e) => {
|
|
317
|
+
var n;
|
|
318
|
+
i("compositionupdate", e);
|
|
319
|
+
const h = (n = e.target) == null ? void 0 : n.value, j = h[h.length - 1] || "";
|
|
320
|
+
T.value = !ht(j);
|
|
321
|
+
}, ye = (e) => {
|
|
322
|
+
i("compositionend", e), T.value && (T.value = !1, te(e));
|
|
323
|
+
}, Le = () => {
|
|
324
|
+
O.value = !O.value, he();
|
|
325
|
+
}, he = async () => {
|
|
326
|
+
var e;
|
|
327
|
+
await F(), (e = k.value) == null || e.focus();
|
|
328
|
+
}, Oe = () => {
|
|
329
|
+
var e;
|
|
330
|
+
return (e = k.value) == null ? void 0 : e.blur();
|
|
331
|
+
}, De = (e) => {
|
|
332
|
+
q.value = !1, i("mouseleave", e);
|
|
333
|
+
}, He = (e) => {
|
|
334
|
+
q.value = !0, i("mouseenter", e);
|
|
335
|
+
}, be = (e) => {
|
|
336
|
+
i("keydown", e);
|
|
337
|
+
}, _e = () => {
|
|
338
|
+
var e;
|
|
339
|
+
(e = k.value) == null || e.select();
|
|
340
|
+
}, ge = () => {
|
|
341
|
+
i(le, ""), i("change", ""), i("clear"), i("input", "");
|
|
342
|
+
};
|
|
343
|
+
return G(() => o.modelValue, () => {
|
|
344
|
+
var e;
|
|
345
|
+
F(() => A()), o.validateEvent && ((e = d == null ? void 0 : d.validate) == null || e.call(d, "change").catch((n) => Z(n)));
|
|
346
|
+
}), G(E, () => M()), G(() => o.type, async () => {
|
|
347
|
+
await F(), M(), A();
|
|
348
|
+
}), We(() => {
|
|
349
|
+
!o.formatter && o.parser && Z("ElInput", "If you set the parser, you also need to set the formatter."), M(), F(A);
|
|
350
|
+
}), f({
|
|
351
|
+
input: L,
|
|
352
|
+
textarea: I,
|
|
353
|
+
ref: k,
|
|
354
|
+
textareaStyle: pe,
|
|
355
|
+
autosize: Ue(o, "autosize"),
|
|
356
|
+
focus: he,
|
|
357
|
+
blur: Oe,
|
|
358
|
+
select: _e,
|
|
359
|
+
clear: ge,
|
|
360
|
+
resizeTextarea: A
|
|
361
|
+
}), (e, n) => Ye((m(), S("div", oe(t(u), {
|
|
362
|
+
class: t(x),
|
|
363
|
+
style: t(Te),
|
|
364
|
+
role: e.containerRole,
|
|
365
|
+
onMouseenter: He,
|
|
366
|
+
onMouseleave: De
|
|
367
|
+
}), [
|
|
368
|
+
y(" input "),
|
|
369
|
+
e.type !== "textarea" ? (m(), S(ae, { key: 0 }, [
|
|
370
|
+
y(" prepend slot "),
|
|
371
|
+
e.$slots.prepend ? (m(), S("div", {
|
|
372
|
+
key: 0,
|
|
373
|
+
class: b(t(s).be("group", "prepend"))
|
|
374
|
+
}, [
|
|
375
|
+
W(e.$slots, "prepend")
|
|
376
|
+
], 2)) : y("v-if", !0),
|
|
377
|
+
V("div", {
|
|
378
|
+
ref_key: "wrapperRef",
|
|
379
|
+
ref: Ve,
|
|
380
|
+
class: b(t(c))
|
|
381
|
+
}, [
|
|
382
|
+
y(" prefix slot "),
|
|
383
|
+
e.$slots.prefix || e.prefixIcon ? (m(), S("span", {
|
|
384
|
+
key: 0,
|
|
385
|
+
class: b(t(s).e("prefix"))
|
|
386
|
+
}, [
|
|
387
|
+
V("span", {
|
|
388
|
+
class: b(t(s).e("prefix-inner"))
|
|
389
|
+
}, [
|
|
390
|
+
W(e.$slots, "prefix"),
|
|
391
|
+
e.prefixIcon ? (m(), C(t(B), {
|
|
392
|
+
key: 0,
|
|
393
|
+
class: b(t(s).e("icon"))
|
|
394
|
+
}, {
|
|
395
|
+
default: $(() => [
|
|
396
|
+
(m(), C(U(e.prefixIcon)))
|
|
397
|
+
]),
|
|
398
|
+
_: 1
|
|
399
|
+
}, 8, ["class"])) : y("v-if", !0)
|
|
400
|
+
], 2)
|
|
401
|
+
], 2)) : y("v-if", !0),
|
|
402
|
+
V("input", oe({
|
|
403
|
+
id: t(re),
|
|
404
|
+
ref_key: "input",
|
|
405
|
+
ref: L,
|
|
406
|
+
class: t(s).e("inner")
|
|
407
|
+
}, t(g), {
|
|
408
|
+
type: e.showPassword ? O.value ? "text" : "password" : e.type,
|
|
409
|
+
disabled: t(z),
|
|
410
|
+
formatter: e.formatter,
|
|
411
|
+
parser: e.parser,
|
|
412
|
+
readonly: e.readonly,
|
|
413
|
+
autocomplete: e.autocomplete,
|
|
414
|
+
tabindex: e.tabindex,
|
|
415
|
+
"aria-label": e.label,
|
|
416
|
+
placeholder: e.placeholder,
|
|
417
|
+
style: e.inputStyle,
|
|
418
|
+
form: o.form,
|
|
419
|
+
autofocus: o.autofocus,
|
|
420
|
+
onCompositionstart: ve,
|
|
421
|
+
onCompositionupdate: me,
|
|
422
|
+
onCompositionend: ye,
|
|
423
|
+
onInput: te,
|
|
424
|
+
onFocus: n[0] || (n[0] = (...h) => t(H) && t(H)(...h)),
|
|
425
|
+
onBlur: n[1] || (n[1] = (...h) => t(_) && t(_)(...h)),
|
|
426
|
+
onChange: fe,
|
|
427
|
+
onKeydown: be
|
|
428
|
+
}), null, 16, Ft),
|
|
429
|
+
y(" suffix slot "),
|
|
430
|
+
t(Ae) ? (m(), S("span", {
|
|
431
|
+
key: 1,
|
|
432
|
+
class: b(t(s).e("suffix"))
|
|
433
|
+
}, [
|
|
434
|
+
V("span", {
|
|
435
|
+
class: b(t(s).e("suffix-inner"))
|
|
436
|
+
}, [
|
|
437
|
+
!t(K) || !t(Q) || !t(P) ? (m(), S(ae, { key: 0 }, [
|
|
438
|
+
W(e.$slots, "suffix"),
|
|
439
|
+
e.suffixIcon ? (m(), C(t(B), {
|
|
440
|
+
key: 0,
|
|
441
|
+
class: b(t(s).e("icon"))
|
|
442
|
+
}, {
|
|
443
|
+
default: $(() => [
|
|
444
|
+
(m(), C(U(e.suffixIcon)))
|
|
445
|
+
]),
|
|
446
|
+
_: 1
|
|
447
|
+
}, 8, ["class"])) : y("v-if", !0)
|
|
448
|
+
], 64)) : y("v-if", !0),
|
|
449
|
+
t(K) ? (m(), C(t(B), {
|
|
450
|
+
key: 1,
|
|
451
|
+
class: b([t(s).e("icon"), t(s).e("clear")]),
|
|
452
|
+
onMousedown: Xe(t(dt), ["prevent"]),
|
|
453
|
+
onClick: ge
|
|
454
|
+
}, {
|
|
455
|
+
default: $(() => [
|
|
456
|
+
Ge(t(it))
|
|
457
|
+
]),
|
|
458
|
+
_: 1
|
|
459
|
+
}, 8, ["class", "onMousedown"])) : y("v-if", !0),
|
|
460
|
+
t(Q) ? (m(), C(t(B), {
|
|
461
|
+
key: 2,
|
|
462
|
+
class: b([t(s).e("icon"), t(s).e("password")]),
|
|
463
|
+
onClick: Le
|
|
464
|
+
}, {
|
|
465
|
+
default: $(() => [
|
|
466
|
+
(m(), C(U(t(Ne))))
|
|
467
|
+
]),
|
|
468
|
+
_: 1
|
|
469
|
+
}, 8, ["class"])) : y("v-if", !0),
|
|
470
|
+
t(P) ? (m(), S("span", {
|
|
471
|
+
key: 3,
|
|
472
|
+
class: b(t(s).e("count"))
|
|
473
|
+
}, [
|
|
474
|
+
V("span", {
|
|
475
|
+
class: b(t(s).e("count-inner"))
|
|
476
|
+
}, Y(t(ee)) + " / " + Y(t(g).maxlength), 3)
|
|
477
|
+
], 2)) : y("v-if", !0),
|
|
478
|
+
t(R) && t(de) && t(ce) ? (m(), C(t(B), {
|
|
479
|
+
key: 4,
|
|
480
|
+
class: b([
|
|
481
|
+
t(s).e("icon"),
|
|
482
|
+
t(s).e("validateIcon"),
|
|
483
|
+
t(s).is("loading", t(R) === "validating")
|
|
484
|
+
])
|
|
485
|
+
}, {
|
|
486
|
+
default: $(() => [
|
|
487
|
+
(m(), C(U(t(de))))
|
|
488
|
+
]),
|
|
489
|
+
_: 1
|
|
490
|
+
}, 8, ["class"])) : y("v-if", !0)
|
|
491
|
+
], 2)
|
|
492
|
+
], 2)) : y("v-if", !0)
|
|
493
|
+
], 2),
|
|
494
|
+
y(" append slot "),
|
|
495
|
+
e.$slots.append ? (m(), S("div", {
|
|
496
|
+
key: 1,
|
|
497
|
+
class: b(t(s).be("group", "append"))
|
|
498
|
+
}, [
|
|
499
|
+
W(e.$slots, "append")
|
|
500
|
+
], 2)) : y("v-if", !0)
|
|
501
|
+
], 64)) : (m(), S(ae, { key: 1 }, [
|
|
502
|
+
y(" textarea "),
|
|
503
|
+
V("textarea", oe({
|
|
504
|
+
id: t(re),
|
|
505
|
+
ref_key: "textarea",
|
|
506
|
+
ref: I,
|
|
507
|
+
class: t(ie).e("inner")
|
|
508
|
+
}, t(g), {
|
|
509
|
+
tabindex: e.tabindex,
|
|
510
|
+
disabled: t(z),
|
|
511
|
+
readonly: e.readonly,
|
|
512
|
+
autocomplete: e.autocomplete,
|
|
513
|
+
style: t(pe),
|
|
514
|
+
"aria-label": e.label,
|
|
515
|
+
placeholder: e.placeholder,
|
|
516
|
+
form: o.form,
|
|
517
|
+
autofocus: o.autofocus,
|
|
518
|
+
onCompositionstart: ve,
|
|
519
|
+
onCompositionupdate: me,
|
|
520
|
+
onCompositionend: ye,
|
|
521
|
+
onInput: te,
|
|
522
|
+
onFocus: n[2] || (n[2] = (...h) => t(H) && t(H)(...h)),
|
|
523
|
+
onBlur: n[3] || (n[3] = (...h) => t(_) && t(_)(...h)),
|
|
524
|
+
onChange: fe,
|
|
525
|
+
onKeydown: be
|
|
526
|
+
}), null, 16, Vt),
|
|
527
|
+
t(P) ? (m(), S("span", {
|
|
528
|
+
key: 0,
|
|
529
|
+
style: Ze(ue.value),
|
|
530
|
+
class: b(t(s).e("count"))
|
|
531
|
+
}, Y(t(ee)) + " / " + Y(t(g).maxlength), 7)) : y("v-if", !0)
|
|
532
|
+
], 64))
|
|
533
|
+
], 16, Pt)), [
|
|
534
|
+
[qe, e.type !== "hidden"]
|
|
535
|
+
]);
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
var Rt = /* @__PURE__ */ pt(Tt, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/input/src/input.vue"]]);
|
|
539
|
+
const Ht = ft(Rt);
|
|
540
|
+
export {
|
|
541
|
+
Ht as E,
|
|
542
|
+
ht as i,
|
|
543
|
+
xt as u
|
|
544
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),l=require("./base-8776b83e.cjs"),$=require("./vnode-69f3ca85.cjs"),M=require("./use-form-item-67e7ef93.cjs"),V=require("./focus-trap-5f42842b.cjs"),J=require("./use-global-config-f9103903.cjs"),Q=require("./scroll-22a00b05.cjs"),ee=(...t)=>o=>{t.forEach(s=>{l.isFunction(s)?s(o):s.value=o})},te=(t,o,s)=>{let a={offsetX:0,offsetY:0};const n=c=>{const f=c.clientX,v=c.clientY,{offsetX:m,offsetY:y}=a,p=t.value.getBoundingClientRect(),d=p.left,_=p.top,N=p.width,B=p.height,O=document.documentElement.clientWidth,D=document.documentElement.clientHeight,P=-d+m,T=-_+y,b=O-d-N+m,k=D-_-B+y,I=E=>{const u=Math.min(Math.max(m+E.clientX-f,P),b),C=Math.min(Math.max(y+E.clientY-v,T),k);a={offsetX:u,offsetY:C},t.value.style.transform=`translate(${l.addUnit(u)}, ${l.addUnit(C)})`},h=()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",h)};document.addEventListener("mousemove",I),document.addEventListener("mouseup",h)},r=()=>{o.value&&t.value&&o.value.addEventListener("mousedown",n)},i=()=>{o.value&&t.value&&o.value.removeEventListener("mousedown",n)};e.onMounted(()=>{e.watchEffect(()=>{s.value?r():i()})}),e.onBeforeUnmount(()=>{i()})};/**
|
|
2
|
+
* @vue/reactivity v3.4.19
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/function U(t,...o){console.warn(`[Vue warn] ${t}`,...o)}let oe;function ne(t,o=oe){o&&o.active&&o.effects.push(t)}let F;class se{constructor(o,s,a,n){this.fn=o,this.trigger=s,this.scheduler=a,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,ne(this,n)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,ae();for(let o=0;o<this._depsLength;o++){const s=this.deps[o];if(s.computed&&(le(s.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),re()}return this._dirtyLevel>=4}set dirty(o){this._dirtyLevel=o?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let o=L,s=F;try{return L=!0,F=this,this._runnings++,q(this),this.fn()}finally{Y(this),this._runnings--,F=s,L=o}}stop(){var o;this.active&&(q(this),Y(this),(o=this.onStop)==null||o.call(this),this.active=!1)}}function le(t){return t.value}function q(t){t._trackId++,t._depsLength=0}function Y(t){if(t.deps.length>t._depsLength){for(let o=t._depsLength;o<t.deps.length;o++)W(t.deps[o],t);t.deps.length=t._depsLength}}function W(t,o){const s=t.get(o);s!==void 0&&o._trackId!==s&&(t.delete(o),t.size===0&&t.cleanup())}let L=!0,R=0;const j=[];function ae(){j.push(L),L=!1}function re(){const t=j.pop();L=t===void 0?!0:t}function ie(){R++}function ue(){for(R--;!R&&x.length;)x.shift()()}function ce(t,o,s){var a;if(o.get(t)!==t._trackId){o.set(t,t._trackId);const n=t.deps[t._depsLength];n!==o?(n&&W(n,t),t.deps[t._depsLength++]=o):t._depsLength++,process.env.NODE_ENV!=="production"&&((a=t.onTrack)==null||a.call(t,l.extend({effect:t},s)))}}const x=[];function de(t,o,s){var a;ie();for(const n of t.keys()){let r;n._dirtyLevel<o&&(r??(r=t.get(n)===n._trackId))&&(n._shouldSchedule||(n._shouldSchedule=n._dirtyLevel===0),n._dirtyLevel=o),n._shouldSchedule&&(r??(r=t.get(n)===n._trackId))&&(process.env.NODE_ENV!=="production"&&((a=n.onTrigger)==null||a.call(n,l.extend({effect:n},s))),n.trigger(),(!n._runnings||n.allowRecurse)&&n._dirtyLevel!==2&&(n._shouldSchedule=!1,n.scheduler&&x.push(n.scheduler)))}ue()}const fe=(t,o)=>{const s=new Map;return s.cleanup=t,s.computed=o,s};Symbol(process.env.NODE_ENV!=="production"?"iterate":"");Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(l.isSymbol));function A(t){const o=t&&t.__v_raw;return o?A(o):t}const me="Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free";class H{constructor(o,s,a,n){this._setter=s,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new se(()=>o(this._value),()=>z(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=a}get value(){const o=A(this);return(!o._cacheable||o.effect.dirty)&&l.hasChanged(o._value,o._value=o.effect.run())&&z(o,4),ve(o),o.effect._dirtyLevel>=2&&(process.env.NODE_ENV!=="production"&&U(me),z(o,2)),o._value}set value(o){this._setter(o)}get _dirty(){return this.effect.dirty}set _dirty(o){this.effect.dirty=o}}function pe(t,o,s=!1){let a,n;const r=l.isFunction(t);r?(a=t,n=process.env.NODE_ENV!=="production"?()=>{U("Write operation failed: computed value is readonly")}:l.NOOP):(a=t.get,n=t.set);const i=new H(a,n,r||!n,s);return process.env.NODE_ENV!=="production"&&o&&!s&&(i.effect.onTrack=o.onTrack,i.effect.onTrigger=o.onTrigger),i}function ve(t){var o;L&&F&&(t=A(t),ce(F,(o=t.dep)!=null?o:t.dep=fe(()=>t.dep=void 0,t instanceof H?t:void 0),process.env.NODE_ENV!=="production"?{target:t,type:"get",key:"value"}:void 0))}function z(t,o=4,s){t=A(t);const a=t.dep;a&&de(a,o,process.env.NODE_ENV!=="production"?{target:t,type:"set",key:"value",newValue:s}:void 0)}const he=(t,o={})=>{e.isRef(t)||l.throwError("[useLockscreen]","You need to pass a ref param to this function");const s=o.ns||l.useNamespace("popup"),a=pe(()=>s.bm("parent","hidden"));if(!l.isClient||l.hasClass(document.body,a.value))return;let n=0,r=!1,i="0";const c=()=>{setTimeout(()=>{l.removeClass(document==null?void 0:document.body,a.value),r&&document&&(document.body.style.width=i)},200)};e.watch(t,f=>{if(!f){c();return}r=!l.hasClass(document.body,a.value),r&&(i=document.body.style.width),n=Q.getScrollBarWidth(s.namespace.value);const v=document.documentElement.clientHeight<document.body.scrollHeight,m=l.getStyle(document.body,"overflowY");n>0&&(v||m==="scroll")&&r&&(document.body.style.width=`calc(100% - ${n}px)`),l.addClass(document.body,a.value)}),e.onScopeDispose(()=>c())},X=t=>{if(!t)return{onClick:l.NOOP,onMousedown:l.NOOP,onMouseup:l.NOOP};let o=!1,s=!1;return{onClick:i=>{o&&s&&t(i),o=s=!1},onMousedown:i=>{o=i.target===i.currentTarget},onMouseup:i=>{s=i.target===i.currentTarget}}},ge=l.buildProps({mask:{type:Boolean,default:!0},customMaskEvent:{type:Boolean,default:!1},overlayClass:{type:l.definePropType([String,Array,Object])},zIndex:{type:l.definePropType([String,Number])}}),ye={click:t=>t instanceof MouseEvent},Ce="overlay";var _e=e.defineComponent({name:"ElOverlay",props:ge,emits:ye,setup(t,{slots:o,emit:s}){const a=l.useNamespace(Ce),n=f=>{s("click",f)},{onClick:r,onMousedown:i,onMouseup:c}=X(t.customMaskEvent?void 0:n);return()=>t.mask?e.createVNode("div",{class:[a.b(),t.overlayClass],style:{zIndex:t.zIndex},onClick:r,onMousedown:i,onMouseup:c},[e.renderSlot(o,"default")],$.PatchFlags.STYLE|$.PatchFlags.CLASS|$.PatchFlags.PROPS,["onClick","onMouseup","onMousedown"]):e.h("div",{class:t.overlayClass,style:{zIndex:t.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[e.renderSlot(o,"default")])}});const Ee=_e,K=Symbol("dialogInjectionKey"),G=l.buildProps({center:Boolean,alignCenter:Boolean,closeIcon:{type:M.iconPropType},customClass:{type:String,default:""},draggable:Boolean,fullscreen:Boolean,showClose:{type:Boolean,default:!0},title:{type:String,default:""},ariaLevel:{type:String,default:"2"}}),be={close:()=>!0},ke=["aria-level"],we=["aria-label"],Se=["id"],Le=e.defineComponent({name:"ElDialogContent"}),Ne=e.defineComponent({...Le,props:G,emits:be,setup(t){const o=t,{t:s}=l.useLocale(),{Close:a}=M.CloseComponents,{dialogRef:n,headerRef:r,bodyId:i,ns:c,style:f}=e.inject(K),{focusTrapRef:v}=e.inject(V.FOCUS_TRAP_INJECTION_KEY),m=e.computed(()=>[c.b(),c.is("fullscreen",o.fullscreen),c.is("draggable",o.draggable),c.is("align-center",o.alignCenter),{[c.m("center")]:o.center},o.customClass]),y=ee(v,n),p=e.computed(()=>o.draggable);return te(n,r,p),(d,_)=>(e.openBlock(),e.createElementBlock("div",{ref:e.unref(y),class:e.normalizeClass(e.unref(m)),style:e.normalizeStyle(e.unref(f)),tabindex:"-1"},[e.createElementVNode("header",{ref_key:"headerRef",ref:r,class:e.normalizeClass(e.unref(c).e("header"))},[e.renderSlot(d.$slots,"header",{},()=>[e.createElementVNode("span",{role:"heading","aria-level":d.ariaLevel,class:e.normalizeClass(e.unref(c).e("title"))},e.toDisplayString(d.title),11,ke)]),d.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,"aria-label":e.unref(s)("el.dialog.close"),class:e.normalizeClass(e.unref(c).e("headerbtn")),type:"button",onClick:_[0]||(_[0]=N=>d.$emit("close"))},[e.createVNode(e.unref(M.ElIcon),{class:e.normalizeClass(e.unref(c).e("close"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.closeIcon||e.unref(a))))]),_:1},8,["class"])],10,we)):e.createCommentVNode("v-if",!0)],2),e.createElementVNode("div",{id:e.unref(i),class:e.normalizeClass(e.unref(c).e("body"))},[e.renderSlot(d.$slots,"default")],10,Se),d.$slots.footer?(e.openBlock(),e.createElementBlock("footer",{key:0,class:e.normalizeClass(e.unref(c).e("footer"))},[e.renderSlot(d.$slots,"footer")],2)):e.createCommentVNode("v-if",!0)],6))}});var De=l._export_sfc(Ne,[["__file","/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog-content.vue"]]);const Te=l.buildProps({...G,appendToBody:Boolean,beforeClose:{type:l.definePropType(Function)},destroyOnClose:Boolean,closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0},top:{type:String},modelValue:Boolean,modalClass:String,width:{type:[String,Number]},zIndex:{type:Number},trapFocus:{type:Boolean,default:!1},headerAriaLevel:{type:String,default:"2"}}),Ie={open:()=>!0,opened:()=>!0,close:()=>!0,closed:()=>!0,[V.UPDATE_MODEL_EVENT]:t=>l.isBoolean(t),openAutoFocus:()=>!0,closeAutoFocus:()=>!0},Me=(t,o)=>{const a=e.getCurrentInstance().emit,{nextZIndex:n}=M.useZIndex();let r="";const i=l.useId(),c=l.useId(),f=e.ref(!1),v=e.ref(!1),m=e.ref(!1),y=e.ref(t.zIndex||n());let p,d;const _=J.useGlobalConfig("namespace",l.defaultNamespace),N=e.computed(()=>{const g={},S=`--${_.value}-dialog`;return t.fullscreen||(t.top&&(g[`${S}-margin-top`]=t.top),t.width&&(g[`${S}-width`]=l.addUnit(t.width))),g}),B=e.computed(()=>t.alignCenter?{display:"flex"}:{});function O(){a("opened")}function D(){a("closed"),a(V.UPDATE_MODEL_EVENT,!1),t.destroyOnClose&&(m.value=!1)}function P(){a("close")}function T(){d==null||d(),p==null||p(),t.openDelay&&t.openDelay>0?{stop:p}=l.useTimeoutFn(()=>h(),t.openDelay):h()}function b(){p==null||p(),d==null||d(),t.closeDelay&&t.closeDelay>0?{stop:d}=l.useTimeoutFn(()=>E(),t.closeDelay):E()}function k(){function g(S){S||(v.value=!0,f.value=!1)}t.beforeClose?t.beforeClose(g):b()}function I(){t.closeOnClickModal&&k()}function h(){l.isClient&&(f.value=!0)}function E(){f.value=!1}function u(){a("openAutoFocus")}function C(){a("closeAutoFocus")}function w(g){var S;((S=g.detail)==null?void 0:S.focusReason)==="pointer"&&g.preventDefault()}t.lockScroll&&he(f);function Z(){t.closeOnPressEscape&&k()}return e.watch(()=>t.modelValue,g=>{g?(v.value=!1,T(),m.value=!0,y.value=t.zIndex?y.value++:n(),e.nextTick(()=>{a("open"),o.value&&(o.value.scrollTop=0)})):f.value&&b()}),e.watch(()=>t.fullscreen,g=>{o.value&&(g?(r=o.value.style.transform,o.value.style.transform=""):o.value.style.transform=r)}),e.onMounted(()=>{t.modelValue&&(f.value=!0,m.value=!0,T())}),{afterEnter:O,afterLeave:D,beforeLeave:P,handleClose:k,onModalClick:I,close:b,doClose:E,onOpenAutoFocus:u,onCloseAutoFocus:C,onCloseRequested:Z,onFocusoutPrevented:w,titleId:i,bodyId:c,closed:v,style:N,overlayDialogStyle:B,rendered:m,visible:f,zIndex:y}},Be=["aria-label","aria-labelledby","aria-describedby"],Oe=e.defineComponent({name:"ElDialog",inheritAttrs:!1}),Pe=e.defineComponent({...Oe,props:Te,emits:Ie,setup(t,{expose:o}){const s=t,a=e.useSlots();M.useDeprecated({scope:"el-dialog",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/dialog.html#slots"},e.computed(()=>!!a.title)),M.useDeprecated({scope:"el-dialog",from:"custom-class",replacement:"class",version:"2.3.0",ref:"https://element-plus.org/en-US/component/dialog.html#attributes",type:"Attribute"},e.computed(()=>!!s.customClass));const n=l.useNamespace("dialog"),r=e.ref(),i=e.ref(),c=e.ref(),{visible:f,titleId:v,bodyId:m,style:y,overlayDialogStyle:p,rendered:d,zIndex:_,afterEnter:N,afterLeave:B,beforeLeave:O,handleClose:D,onModalClick:P,onOpenAutoFocus:T,onCloseAutoFocus:b,onCloseRequested:k,onFocusoutPrevented:I}=Me(s,r);e.provide(K,{dialogRef:r,headerRef:i,bodyId:m,ns:n,rendered:d,style:y});const h=X(P),E=e.computed(()=>s.draggable&&!s.fullscreen);return o({visible:f,dialogContentRef:c}),(u,C)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:!u.appendToBody},[e.createVNode(e.Transition,{name:"dialog-fade",onAfterEnter:e.unref(N),onAfterLeave:e.unref(B),onBeforeLeave:e.unref(O),persisted:""},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(Ee),{"custom-mask-event":"",mask:u.modal,"overlay-class":u.modalClass,"z-index":e.unref(_)},{default:e.withCtx(()=>[e.createElementVNode("div",{role:"dialog","aria-modal":"true","aria-label":u.title||void 0,"aria-labelledby":u.title?void 0:e.unref(v),"aria-describedby":e.unref(m),class:e.normalizeClass(`${e.unref(n).namespace.value}-overlay-dialog`),style:e.normalizeStyle(e.unref(p)),onClick:C[0]||(C[0]=(...w)=>e.unref(h).onClick&&e.unref(h).onClick(...w)),onMousedown:C[1]||(C[1]=(...w)=>e.unref(h).onMousedown&&e.unref(h).onMousedown(...w)),onMouseup:C[2]||(C[2]=(...w)=>e.unref(h).onMouseup&&e.unref(h).onMouseup(...w))},[e.createVNode(e.unref(V.ElFocusTrap),{loop:"",trapped:e.unref(f),"focus-start-el":"container",onFocusAfterTrapped:e.unref(T),onFocusAfterReleased:e.unref(b),onFocusoutPrevented:e.unref(I),onReleaseRequested:e.unref(k)},{default:e.withCtx(()=>[e.unref(d)?(e.openBlock(),e.createBlock(De,e.mergeProps({key:0,ref_key:"dialogContentRef",ref:c},u.$attrs,{"custom-class":u.customClass,center:u.center,"align-center":u.alignCenter,"close-icon":u.closeIcon,draggable:e.unref(E),fullscreen:u.fullscreen,"show-close":u.showClose,title:u.title,"aria-level":u.headerAriaLevel,onClose:e.unref(D)}),e.createSlots({header:e.withCtx(()=>[u.$slots.title?e.renderSlot(u.$slots,"title",{key:1}):e.renderSlot(u.$slots,"header",{key:0,close:e.unref(D),titleId:e.unref(v),titleClass:e.unref(n).e("title")})]),default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:2},[u.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"footer")])}:void 0]),1040,["custom-class","center","align-center","close-icon","draggable","fullscreen","show-close","title","aria-level","onClose"])):e.createCommentVNode("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,Be)]),_:3},8,["mask","overlay-class","z-index"]),[[e.vShow,e.unref(f)]])]),_:3},8,["onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["disabled"]))}});var Fe=l._export_sfc(Pe,[["__file","/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog.vue"]]);const Ve=l.withInstall(Fe);exports.ElDialog=Ve;
|