ss-component-new 1.1.113 → 1.1.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{array-DyxKeexo.js → array-B1nKYchL.js} +269 -266
- package/dist/array-Bv_j-DQ6.cjs +7 -0
- package/dist/cloneDeep-BkHxCZQ6.cjs +1 -0
- package/dist/{cloneDeep-BfzU0pBe.js → cloneDeep-DDG2sYfV.js} +2 -8
- package/dist/{index-BTt24r3U.cjs → index-B2YxsOFS.cjs} +1 -1
- package/dist/{index-CVBCwf2F.cjs → index-B9CeiT-K.cjs} +1 -1
- package/dist/{index-COPrDtid.js → index-BDQh7_bN.js} +1 -1
- package/dist/index-BKH3emIo.js +400 -0
- package/dist/{index-CbphQpiC.cjs → index-BOMVVmWM.cjs} +1 -1
- package/dist/index-BZEbgud2.cjs +6 -0
- package/dist/index-BeUperzd.cjs +1 -0
- package/dist/index-BgZXex98.js +199 -0
- package/dist/{index-BH3F6_ql.js → index-BrXeR-w4.js} +1025 -1121
- package/dist/{index-DWiZqfBA.js → index-Bx4Vzo3K.js} +3 -3
- package/dist/{index-5dGTUAu_.cjs → index-ByH4hihL.cjs} +1 -1
- package/dist/{index-CyQkKXnK.js → index-C1474J4s.js} +2 -2
- package/dist/{index-DVEWSdUo.cjs → index-CfR4fhRH.cjs} +1 -1
- package/dist/index-CosMCnZD.js +456 -0
- package/dist/{index-CBHJLZo4.cjs → index-DGEVn6kJ.cjs} +1 -1
- package/dist/index-DHZKgJQ-.cjs +1 -0
- package/dist/{index-b_11tfuG.js → index-DbEFJXIu.js} +4 -4
- package/dist/{index-CdEEK8I0.js → index-DcJXJfJq.js} +68 -69
- package/dist/{index-B3iQoZwc.js → index-DmZPczSP.js} +3 -3
- package/dist/{index-QWm4yJ7u.js → index-FuXHUCO7.js} +2 -2
- package/dist/index-PctLLbfg.cjs +1 -0
- package/dist/{index-DxyREQkR.js → index-RTJn4TlV.js} +5 -5
- package/dist/{index-BpJeYb4X.js → index-RUWVqYLT.js} +1 -1
- package/dist/{index-ChXKNVG8.cjs → index-fstYT4Ji.cjs} +1 -1
- package/dist/{index-EQOXj03f.cjs → index-pKfoDOT3.cjs} +1 -1
- package/dist/{index-CqJa9o1o.cjs → index-tXx4uqsB.cjs} +1 -1
- package/dist/{index-B4WYIlOz.cjs → index-xFolZMqB.cjs} +1 -1
- package/dist/{index-DLartnmY.js → index-x_myaReY.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-CqiRIG3B.js → index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-Bwb6U8rC.js} +22 -22
- package/dist/{index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-CgrtbAG0.cjs → index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-CF3B2HoM.cjs} +1 -1
- package/dist/{main-DS-YP1Wn.cjs → main-BhZ-c5nF.cjs} +1 -1
- package/dist/{main-DAPxADXM.js → main-CaHX_enG.js} +4 -4
- package/dist/{request-BrHEv9dn.cjs → request-CNnOyEMG.cjs} +1 -1
- package/dist/{request-BK6KCyS9.js → request-_jH8DsLJ.js} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +6 -6
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +1 -1
- package/package.json +1 -1
- package/dist/array-BYRvPg11.cjs +0 -7
- package/dist/cloneDeep-WwDap0fL.cjs +0 -1
- package/dist/index-BIRKKGuW.cjs +0 -1
- package/dist/index-BUxzwz5l.cjs +0 -1
- package/dist/index-CumtOgAw.cjs +0 -7
- package/dist/index-DmoecEm1.js +0 -205
- package/dist/index-EIbm0jBZ.js +0 -2707
- package/dist/index-smYHb1Ta.js +0 -456
- package/dist/index-uMboxmjq.cjs +0 -6
package/dist/index-EIbm0jBZ.js
DELETED
|
@@ -1,2707 +0,0 @@
|
|
|
1
|
-
import { computed as b, getCurrentInstance as ot, inject as he, unref as d, ref as S, onMounted as te, watch as K, toRef as Qe, onUnmounted as to, shallowRef as je, nextTick as D, defineComponent as Q, useAttrs as no, useSlots as Sn, createElementBlock as L, openBlock as m, normalizeStyle as Ze, normalizeClass as E, createCommentVNode as I, Fragment as xe, createElementVNode as R, renderSlot as Y, createBlock as x, withCtx as A, resolveDynamicComponent as W, mergeProps as gt, withModifiers as Me, createVNode as $, toDisplayString as J, onBeforeUnmount as Oe, provide as kn, Text as oo, reactive as De, h as ao, watchEffect as so, isRef as ro, onScopeDispose as io, resolveComponent as re, Transition as lo, withDirectives as ut, withKeys as $e, createTextVNode as Ae, vShow as ct, markRaw as mt, toRefs as uo, isVNode as Tn, render as In } from "vue";
|
|
2
|
-
import { s as co } from "./index-B3iQoZwc.js";
|
|
3
|
-
import { s as fo } from "./index-smYHb1Ta.js";
|
|
4
|
-
import { s as bt, u as Mn } from "./menu-BIINB-0Y.js";
|
|
5
|
-
import { g as vo, c as po, u as ho, d as go } from "./index-COPrDtid.js";
|
|
6
|
-
import { d as Gt, i as xn, a as mo, b as bo, e as An, f as yo, c as et } from "./cloneDeep-BfzU0pBe.js";
|
|
7
|
-
import { m as Eo, E as ze } from "./index-CdEEK8I0.js";
|
|
8
|
-
import { S as qt, i as Bn, c as It, t as Rn, a as jt, b as wo, d as ue, e as Xt, f as at, g as ve, h as Ce, j as tt, k as Nn, m as pe, n as Co, o as So, p as ko, q as To, s as Ie, v as Re, w as Ne, _ as Pe, x as ge, V as Io, y as Mo, z as xo, A as Ao, B as ie, N as Xe, C as Bo, D as nt, F as Ln, G as Mt, H as Ro, I as yt, J as No, K as Jt, L as Lo, M as Qt, O as Fo, P as Oo, Q as Do, R as Po, T as _o, U as Ho, W as Zt, X as en, Y as $o } from "./index-BH3F6_ql.js";
|
|
9
|
-
import { u as zo } from "./modelComp-CHWFvhCq.js";
|
|
10
|
-
import { useRoute as Vo } from "vue-router";
|
|
11
|
-
import "./request-BK6KCyS9.js";
|
|
12
|
-
import { _ as Ko } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
|
-
function Uo(e) {
|
|
14
|
-
return e;
|
|
15
|
-
}
|
|
16
|
-
function Wo(e, t, n) {
|
|
17
|
-
switch (n.length) {
|
|
18
|
-
case 0:
|
|
19
|
-
return e.call(t);
|
|
20
|
-
case 1:
|
|
21
|
-
return e.call(t, n[0]);
|
|
22
|
-
case 2:
|
|
23
|
-
return e.call(t, n[0], n[1]);
|
|
24
|
-
case 3:
|
|
25
|
-
return e.call(t, n[0], n[1], n[2]);
|
|
26
|
-
}
|
|
27
|
-
return e.apply(t, n);
|
|
28
|
-
}
|
|
29
|
-
var Yo = 800, Go = 16, qo = Date.now;
|
|
30
|
-
function jo(e) {
|
|
31
|
-
var t = 0, n = 0;
|
|
32
|
-
return function() {
|
|
33
|
-
var o = qo(), a = Go - (o - n);
|
|
34
|
-
if (n = o, a > 0) {
|
|
35
|
-
if (++t >= Yo)
|
|
36
|
-
return arguments[0];
|
|
37
|
-
} else
|
|
38
|
-
t = 0;
|
|
39
|
-
return e.apply(void 0, arguments);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function Xo(e) {
|
|
43
|
-
return function() {
|
|
44
|
-
return e;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
var Jo = Gt ? function(e, t) {
|
|
48
|
-
return Gt(e, "toString", {
|
|
49
|
-
configurable: !0,
|
|
50
|
-
enumerable: !1,
|
|
51
|
-
value: Xo(t),
|
|
52
|
-
writable: !0
|
|
53
|
-
});
|
|
54
|
-
} : Uo, Qo = jo(Jo), tn = Math.max;
|
|
55
|
-
function Zo(e, t, n) {
|
|
56
|
-
return t = tn(t === void 0 ? e.length - 1 : t, 0), function() {
|
|
57
|
-
for (var o = arguments, a = -1, s = tn(o.length - t, 0), r = Array(s); ++a < s; )
|
|
58
|
-
r[a] = o[t + a];
|
|
59
|
-
a = -1;
|
|
60
|
-
for (var i = Array(t + 1); ++a < t; )
|
|
61
|
-
i[a] = o[a];
|
|
62
|
-
return i[t] = n(r), Wo(e, this, i);
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
var nn = qt ? qt.isConcatSpreadable : void 0;
|
|
66
|
-
function ea(e) {
|
|
67
|
-
return Bn(e) || xn(e) || !!(nn && e && e[nn]);
|
|
68
|
-
}
|
|
69
|
-
function ta(e, t, n, o, a) {
|
|
70
|
-
var s = -1, r = e.length;
|
|
71
|
-
for (n || (n = ea), a || (a = []); ++s < r; ) {
|
|
72
|
-
var i = e[s];
|
|
73
|
-
n(i) ? mo(a, i) : a[a.length] = i;
|
|
74
|
-
}
|
|
75
|
-
return a;
|
|
76
|
-
}
|
|
77
|
-
function na(e) {
|
|
78
|
-
var t = e == null ? 0 : e.length;
|
|
79
|
-
return t ? ta(e) : [];
|
|
80
|
-
}
|
|
81
|
-
function oa(e) {
|
|
82
|
-
return Qo(Zo(e, void 0, na), e + "");
|
|
83
|
-
}
|
|
84
|
-
function aa(e, t) {
|
|
85
|
-
return e != null && t in Object(e);
|
|
86
|
-
}
|
|
87
|
-
function sa(e, t, n) {
|
|
88
|
-
t = It(t, e);
|
|
89
|
-
for (var o = -1, a = t.length, s = !1; ++o < a; ) {
|
|
90
|
-
var r = Rn(t[o]);
|
|
91
|
-
if (!(s = e != null && n(e, r)))
|
|
92
|
-
break;
|
|
93
|
-
e = e[r];
|
|
94
|
-
}
|
|
95
|
-
return s || ++o != a ? s : (a = e == null ? 0 : e.length, !!a && bo(a) && An(r, a) && (Bn(e) || xn(e)));
|
|
96
|
-
}
|
|
97
|
-
function ra(e, t) {
|
|
98
|
-
return e != null && sa(e, t, aa);
|
|
99
|
-
}
|
|
100
|
-
function Fn(e) {
|
|
101
|
-
return e == null;
|
|
102
|
-
}
|
|
103
|
-
function ia(e, t, n, o) {
|
|
104
|
-
if (!jt(e))
|
|
105
|
-
return e;
|
|
106
|
-
t = It(t, e);
|
|
107
|
-
for (var a = -1, s = t.length, r = s - 1, i = e; i != null && ++a < s; ) {
|
|
108
|
-
var c = Rn(t[a]), u = n;
|
|
109
|
-
if (c === "__proto__" || c === "constructor" || c === "prototype")
|
|
110
|
-
return e;
|
|
111
|
-
if (a != r) {
|
|
112
|
-
var v = i[c];
|
|
113
|
-
u = void 0, u === void 0 && (u = jt(v) ? v : An(t[a + 1]) ? [] : {});
|
|
114
|
-
}
|
|
115
|
-
yo(i, c, u), i = i[c];
|
|
116
|
-
}
|
|
117
|
-
return e;
|
|
118
|
-
}
|
|
119
|
-
function la(e, t, n) {
|
|
120
|
-
for (var o = -1, a = t.length, s = {}; ++o < a; ) {
|
|
121
|
-
var r = t[o], i = wo(e, r);
|
|
122
|
-
n(i, r) && ia(s, It(r, e), i);
|
|
123
|
-
}
|
|
124
|
-
return s;
|
|
125
|
-
}
|
|
126
|
-
function ua(e, t) {
|
|
127
|
-
return la(e, t, function(n, o) {
|
|
128
|
-
return ra(e, o);
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
var ca = oa(function(e, t) {
|
|
132
|
-
return e == null ? {} : ua(e, t);
|
|
133
|
-
});
|
|
134
|
-
const Et = "update:modelValue", on = "change", an = "input";
|
|
135
|
-
let Ve;
|
|
136
|
-
const da = (e) => {
|
|
137
|
-
var t;
|
|
138
|
-
if (!ue)
|
|
139
|
-
return 0;
|
|
140
|
-
if (Ve !== void 0)
|
|
141
|
-
return Ve;
|
|
142
|
-
const n = document.createElement("div");
|
|
143
|
-
n.className = `${e}-scrollbar__wrap`, n.style.visibility = "hidden", n.style.width = "100px", n.style.position = "absolute", n.style.top = "-9999px", document.body.appendChild(n);
|
|
144
|
-
const o = n.offsetWidth;
|
|
145
|
-
n.style.overflow = "scroll";
|
|
146
|
-
const a = document.createElement("div");
|
|
147
|
-
a.style.width = "100%", n.appendChild(a);
|
|
148
|
-
const s = a.offsetWidth;
|
|
149
|
-
return (t = n.parentNode) == null || t.removeChild(n), Ve = o - s, Ve;
|
|
150
|
-
}, fa = () => ue && /firefox/i.test(window.navigator.userAgent);
|
|
151
|
-
let H;
|
|
152
|
-
const va = {
|
|
153
|
-
height: "0",
|
|
154
|
-
visibility: "hidden",
|
|
155
|
-
overflow: fa() ? "" : "hidden",
|
|
156
|
-
position: "absolute",
|
|
157
|
-
"z-index": "-1000",
|
|
158
|
-
top: "0",
|
|
159
|
-
right: "0"
|
|
160
|
-
}, pa = [
|
|
161
|
-
"letter-spacing",
|
|
162
|
-
"line-height",
|
|
163
|
-
"padding-top",
|
|
164
|
-
"padding-bottom",
|
|
165
|
-
"font-family",
|
|
166
|
-
"font-weight",
|
|
167
|
-
"font-size",
|
|
168
|
-
"text-rendering",
|
|
169
|
-
"text-transform",
|
|
170
|
-
"width",
|
|
171
|
-
"text-indent",
|
|
172
|
-
"padding-left",
|
|
173
|
-
"padding-right",
|
|
174
|
-
"border-width",
|
|
175
|
-
"box-sizing"
|
|
176
|
-
];
|
|
177
|
-
function ha(e) {
|
|
178
|
-
const t = window.getComputedStyle(e), n = t.getPropertyValue("box-sizing"), o = Number.parseFloat(t.getPropertyValue("padding-bottom")) + Number.parseFloat(t.getPropertyValue("padding-top")), a = Number.parseFloat(t.getPropertyValue("border-bottom-width")) + Number.parseFloat(t.getPropertyValue("border-top-width"));
|
|
179
|
-
return { contextStyle: pa.map((r) => [
|
|
180
|
-
r,
|
|
181
|
-
t.getPropertyValue(r)
|
|
182
|
-
]), paddingSize: o, borderSize: a, boxSizing: n };
|
|
183
|
-
}
|
|
184
|
-
function sn(e, t = 1, n) {
|
|
185
|
-
var o;
|
|
186
|
-
H || (H = document.createElement("textarea"), document.body.appendChild(H));
|
|
187
|
-
const { paddingSize: a, borderSize: s, boxSizing: r, contextStyle: i } = ha(e);
|
|
188
|
-
i.forEach(([p, C]) => H == null ? void 0 : H.style.setProperty(p, C)), Object.entries(va).forEach(([p, C]) => H == null ? void 0 : H.style.setProperty(p, C, "important")), H.value = e.value || e.placeholder || "";
|
|
189
|
-
let c = H.scrollHeight;
|
|
190
|
-
const u = {};
|
|
191
|
-
r === "border-box" ? c = c + s : r === "content-box" && (c = c - a), H.value = "";
|
|
192
|
-
const v = H.scrollHeight - a;
|
|
193
|
-
if (Xt(t)) {
|
|
194
|
-
let p = v * t;
|
|
195
|
-
r === "border-box" && (p = p + a + s), c = Math.max(p, c), u.minHeight = `${p}px`;
|
|
196
|
-
}
|
|
197
|
-
if (Xt(n)) {
|
|
198
|
-
let p = v * n;
|
|
199
|
-
r === "border-box" && (p = p + a + s), c = Math.min(p, c);
|
|
200
|
-
}
|
|
201
|
-
return u.height = `${c}px`, (o = H.parentNode) == null || o.removeChild(H), H = void 0, u;
|
|
202
|
-
}
|
|
203
|
-
const ga = at({
|
|
204
|
-
ariaLabel: String,
|
|
205
|
-
ariaOrientation: {
|
|
206
|
-
type: String,
|
|
207
|
-
values: ["horizontal", "vertical", "undefined"]
|
|
208
|
-
},
|
|
209
|
-
ariaControls: String
|
|
210
|
-
}), ma = (e) => ca(ga, e), ba = at({
|
|
211
|
-
id: {
|
|
212
|
-
type: String,
|
|
213
|
-
default: void 0
|
|
214
|
-
},
|
|
215
|
-
size: Nn,
|
|
216
|
-
disabled: Boolean,
|
|
217
|
-
modelValue: {
|
|
218
|
-
type: Ce([
|
|
219
|
-
String,
|
|
220
|
-
Number,
|
|
221
|
-
Object
|
|
222
|
-
]),
|
|
223
|
-
default: ""
|
|
224
|
-
},
|
|
225
|
-
maxlength: {
|
|
226
|
-
type: [String, Number]
|
|
227
|
-
},
|
|
228
|
-
minlength: {
|
|
229
|
-
type: [String, Number]
|
|
230
|
-
},
|
|
231
|
-
type: {
|
|
232
|
-
type: String,
|
|
233
|
-
default: "text"
|
|
234
|
-
},
|
|
235
|
-
resize: {
|
|
236
|
-
type: String,
|
|
237
|
-
values: ["none", "both", "horizontal", "vertical"]
|
|
238
|
-
},
|
|
239
|
-
autosize: {
|
|
240
|
-
type: Ce([Boolean, Object]),
|
|
241
|
-
default: !1
|
|
242
|
-
},
|
|
243
|
-
autocomplete: {
|
|
244
|
-
type: String,
|
|
245
|
-
default: "off"
|
|
246
|
-
},
|
|
247
|
-
formatter: {
|
|
248
|
-
type: Function
|
|
249
|
-
},
|
|
250
|
-
parser: {
|
|
251
|
-
type: Function
|
|
252
|
-
},
|
|
253
|
-
placeholder: {
|
|
254
|
-
type: String
|
|
255
|
-
},
|
|
256
|
-
form: {
|
|
257
|
-
type: String
|
|
258
|
-
},
|
|
259
|
-
readonly: Boolean,
|
|
260
|
-
clearable: Boolean,
|
|
261
|
-
showPassword: Boolean,
|
|
262
|
-
showWordLimit: Boolean,
|
|
263
|
-
suffixIcon: {
|
|
264
|
-
type: tt
|
|
265
|
-
},
|
|
266
|
-
prefixIcon: {
|
|
267
|
-
type: tt
|
|
268
|
-
},
|
|
269
|
-
containerRole: {
|
|
270
|
-
type: String,
|
|
271
|
-
default: void 0
|
|
272
|
-
},
|
|
273
|
-
tabindex: {
|
|
274
|
-
type: [String, Number],
|
|
275
|
-
default: 0
|
|
276
|
-
},
|
|
277
|
-
validateEvent: {
|
|
278
|
-
type: Boolean,
|
|
279
|
-
default: !0
|
|
280
|
-
},
|
|
281
|
-
inputStyle: {
|
|
282
|
-
type: Ce([Object, Array, String]),
|
|
283
|
-
default: () => Eo({})
|
|
284
|
-
},
|
|
285
|
-
autofocus: Boolean,
|
|
286
|
-
rows: {
|
|
287
|
-
type: Number,
|
|
288
|
-
default: 2
|
|
289
|
-
},
|
|
290
|
-
...ma(["ariaLabel"])
|
|
291
|
-
}), ya = {
|
|
292
|
-
[Et]: (e) => ve(e),
|
|
293
|
-
input: (e) => ve(e),
|
|
294
|
-
change: (e) => ve(e),
|
|
295
|
-
focus: (e) => e instanceof FocusEvent,
|
|
296
|
-
blur: (e) => e instanceof FocusEvent,
|
|
297
|
-
clear: () => !0,
|
|
298
|
-
mouseleave: (e) => e instanceof MouseEvent,
|
|
299
|
-
mouseenter: (e) => e instanceof MouseEvent,
|
|
300
|
-
keydown: (e) => e instanceof Event,
|
|
301
|
-
compositionstart: (e) => e instanceof CompositionEvent,
|
|
302
|
-
compositionupdate: (e) => e instanceof CompositionEvent,
|
|
303
|
-
compositionend: (e) => e instanceof CompositionEvent
|
|
304
|
-
}, Ea = ["class", "style"], wa = /^on[A-Z]/, Ca = (e = {}) => {
|
|
305
|
-
const { excludeListeners: t = !1, excludeKeys: n } = e, o = b(() => ((n == null ? void 0 : n.value) || []).concat(Ea)), a = ot();
|
|
306
|
-
return a ? b(() => {
|
|
307
|
-
var s;
|
|
308
|
-
return Co(Object.entries((s = a.proxy) == null ? void 0 : s.$attrs).filter(([r]) => !o.value.includes(r) && !(t && wa.test(r))));
|
|
309
|
-
}) : (pe("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), b(() => ({})));
|
|
310
|
-
}, xt = Symbol("formContextKey"), On = Symbol("formItemContextKey"), wt = {
|
|
311
|
-
prefix: Math.floor(Math.random() * 1e4),
|
|
312
|
-
current: 0
|
|
313
|
-
}, Sa = Symbol("elIdInjection"), ka = () => ot() ? he(Sa, wt) : wt, Ct = (e) => {
|
|
314
|
-
const t = ka();
|
|
315
|
-
!ue && t === wt && pe("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
|
|
316
|
-
usage: app.provide(ID_INJECTION_KEY, {
|
|
317
|
-
prefix: number,
|
|
318
|
-
current: number,
|
|
319
|
-
})`);
|
|
320
|
-
const n = So();
|
|
321
|
-
return ko(() => d(e) || `${n.value}-id-${t.prefix}-${t.current++}`);
|
|
322
|
-
}, Dn = () => {
|
|
323
|
-
const e = he(xt, void 0), t = he(On, void 0);
|
|
324
|
-
return {
|
|
325
|
-
form: e,
|
|
326
|
-
formItem: t
|
|
327
|
-
};
|
|
328
|
-
}, Ta = (e, {
|
|
329
|
-
formItemContext: t,
|
|
330
|
-
disableIdGeneration: n,
|
|
331
|
-
disableIdManagement: o
|
|
332
|
-
}) => {
|
|
333
|
-
n || (n = S(!1)), o || (o = S(!1));
|
|
334
|
-
const a = S();
|
|
335
|
-
let s;
|
|
336
|
-
const r = b(() => {
|
|
337
|
-
var i;
|
|
338
|
-
return !!(!(e.label || e.ariaLabel) && t && t.inputIds && ((i = t.inputIds) == null ? void 0 : i.length) <= 1);
|
|
339
|
-
});
|
|
340
|
-
return te(() => {
|
|
341
|
-
s = K([Qe(e, "id"), n], ([i, c]) => {
|
|
342
|
-
const u = i ?? (c ? void 0 : Ct().value);
|
|
343
|
-
u !== a.value && (t != null && t.removeInputId && (a.value && t.removeInputId(a.value), !(o != null && o.value) && !c && u && t.addInputId(u)), a.value = u);
|
|
344
|
-
}, { immediate: !0 });
|
|
345
|
-
}), to(() => {
|
|
346
|
-
s && s(), t != null && t.removeInputId && a.value && t.removeInputId(a.value);
|
|
347
|
-
}), {
|
|
348
|
-
isLabeledByFormItem: r,
|
|
349
|
-
inputId: a
|
|
350
|
-
};
|
|
351
|
-
}, At = (e) => {
|
|
352
|
-
const t = ot();
|
|
353
|
-
return b(() => {
|
|
354
|
-
var n, o;
|
|
355
|
-
return (o = (n = t == null ? void 0 : t.proxy) == null ? void 0 : n.$props) == null ? void 0 : o[e];
|
|
356
|
-
});
|
|
357
|
-
}, Pn = (e, t = {}) => {
|
|
358
|
-
const n = S(void 0), o = t.prop ? n : At("size"), a = t.global ? n : To(), s = t.form ? { size: void 0 } : he(xt, void 0), r = t.formItem ? { size: void 0 } : he(On, void 0);
|
|
359
|
-
return b(() => o.value || d(e) || (r == null ? void 0 : r.size) || (s == null ? void 0 : s.size) || a.value || "");
|
|
360
|
-
}, Bt = (e) => {
|
|
361
|
-
const t = At("disabled"), n = he(xt, void 0);
|
|
362
|
-
return b(() => t.value || d(e) || (n == null ? void 0 : n.disabled) || !1);
|
|
363
|
-
};
|
|
364
|
-
function Ia(e, {
|
|
365
|
-
beforeFocus: t,
|
|
366
|
-
afterFocus: n,
|
|
367
|
-
beforeBlur: o,
|
|
368
|
-
afterBlur: a
|
|
369
|
-
} = {}) {
|
|
370
|
-
const s = ot(), { emit: r } = s, i = je(), c = At("disabled"), u = S(!1), v = (g) => {
|
|
371
|
-
Ne(t) && t(g) || u.value || (u.value = !0, r("focus", g), n == null || n());
|
|
372
|
-
}, p = (g) => {
|
|
373
|
-
var l;
|
|
374
|
-
Ne(o) && o(g) || g.relatedTarget && ((l = i.value) != null && l.contains(g.relatedTarget)) || (u.value = !1, r("blur", g), a == null || a());
|
|
375
|
-
}, C = () => {
|
|
376
|
-
var g, l;
|
|
377
|
-
(g = i.value) != null && g.contains(document.activeElement) && i.value !== document.activeElement || c.value || (l = e.value) == null || l.focus();
|
|
378
|
-
};
|
|
379
|
-
return K([i, c], ([g, l]) => {
|
|
380
|
-
g && (l ? g.removeAttribute("tabindex") : g.setAttribute("tabindex", "-1"));
|
|
381
|
-
}), Ie(i, "focus", v, !0), Ie(i, "blur", p, !0), Ie(i, "click", C, !0), process.env.NODE_ENV === "test" && te(() => {
|
|
382
|
-
const g = Re(e.value) ? e.value : document.querySelector("input,textarea");
|
|
383
|
-
g && (Ie(g, "focus", v, !0), Ie(g, "blur", p, !0));
|
|
384
|
-
}), {
|
|
385
|
-
isFocused: u,
|
|
386
|
-
wrapperRef: i,
|
|
387
|
-
handleFocus: v,
|
|
388
|
-
handleBlur: p
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
const Ma = (e) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e);
|
|
392
|
-
function xa({
|
|
393
|
-
afterComposition: e,
|
|
394
|
-
emit: t
|
|
395
|
-
}) {
|
|
396
|
-
const n = S(!1), o = (i) => {
|
|
397
|
-
t == null || t("compositionstart", i), n.value = !0;
|
|
398
|
-
}, a = (i) => {
|
|
399
|
-
var c;
|
|
400
|
-
t == null || t("compositionupdate", i);
|
|
401
|
-
const u = (c = i.target) == null ? void 0 : c.value, v = u[u.length - 1] || "";
|
|
402
|
-
n.value = !Ma(v);
|
|
403
|
-
}, s = (i) => {
|
|
404
|
-
t == null || t("compositionend", i), n.value && (n.value = !1, D(() => e(i)));
|
|
405
|
-
};
|
|
406
|
-
return {
|
|
407
|
-
isComposing: n,
|
|
408
|
-
handleComposition: (i) => {
|
|
409
|
-
i.type === "compositionend" ? s(i) : a(i);
|
|
410
|
-
},
|
|
411
|
-
handleCompositionStart: o,
|
|
412
|
-
handleCompositionUpdate: a,
|
|
413
|
-
handleCompositionEnd: s
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
function Aa(e) {
|
|
417
|
-
let t;
|
|
418
|
-
function n() {
|
|
419
|
-
if (e.value == null)
|
|
420
|
-
return;
|
|
421
|
-
const { selectionStart: a, selectionEnd: s, value: r } = e.value;
|
|
422
|
-
if (a == null || s == null)
|
|
423
|
-
return;
|
|
424
|
-
const i = r.slice(0, Math.max(0, a)), c = r.slice(Math.max(0, s));
|
|
425
|
-
t = {
|
|
426
|
-
selectionStart: a,
|
|
427
|
-
selectionEnd: s,
|
|
428
|
-
value: r,
|
|
429
|
-
beforeTxt: i,
|
|
430
|
-
afterTxt: c
|
|
431
|
-
};
|
|
432
|
-
}
|
|
433
|
-
function o() {
|
|
434
|
-
if (e.value == null || t == null)
|
|
435
|
-
return;
|
|
436
|
-
const { value: a } = e.value, { beforeTxt: s, afterTxt: r, selectionStart: i } = t;
|
|
437
|
-
if (s == null || r == null || i == null)
|
|
438
|
-
return;
|
|
439
|
-
let c = a.length;
|
|
440
|
-
if (a.endsWith(r))
|
|
441
|
-
c = a.length - r.length;
|
|
442
|
-
else if (a.startsWith(s))
|
|
443
|
-
c = s.length;
|
|
444
|
-
else {
|
|
445
|
-
const u = s[i - 1], v = a.indexOf(u, i - 1);
|
|
446
|
-
v !== -1 && (c = v + 1);
|
|
447
|
-
}
|
|
448
|
-
e.value.setSelectionRange(c, c);
|
|
449
|
-
}
|
|
450
|
-
return [n, o];
|
|
451
|
-
}
|
|
452
|
-
const _n = "ElInput", Ba = Q({
|
|
453
|
-
name: _n,
|
|
454
|
-
inheritAttrs: !1
|
|
455
|
-
}), Ra = /* @__PURE__ */ Q({
|
|
456
|
-
...Ba,
|
|
457
|
-
props: ba,
|
|
458
|
-
emits: ya,
|
|
459
|
-
setup(e, { expose: t, emit: n }) {
|
|
460
|
-
const o = e, a = no(), s = Ca(), r = Sn(), i = b(() => [
|
|
461
|
-
o.type === "textarea" ? h.b() : l.b(),
|
|
462
|
-
l.m(C.value),
|
|
463
|
-
l.is("disabled", g.value),
|
|
464
|
-
l.is("exceed", Yn.value),
|
|
465
|
-
{
|
|
466
|
-
[l.b("group")]: r.prepend || r.append,
|
|
467
|
-
[l.m("prefix")]: r.prefix || o.prefixIcon,
|
|
468
|
-
[l.m("suffix")]: r.suffix || o.suffixIcon || o.clearable || o.showPassword,
|
|
469
|
-
[l.bm("suffix", "password-clear")]: O.value && me.value,
|
|
470
|
-
[l.b("hidden")]: o.type === "hidden"
|
|
471
|
-
},
|
|
472
|
-
a.class
|
|
473
|
-
]), c = b(() => [
|
|
474
|
-
l.e("wrapper"),
|
|
475
|
-
l.is("focus", z.value)
|
|
476
|
-
]), { form: u, formItem: v } = Dn(), { inputId: p } = Ta(o, {
|
|
477
|
-
formItemContext: v
|
|
478
|
-
}), C = Pn(), g = Bt(), l = ge("input"), h = ge("textarea"), w = je(), y = je(), M = S(!1), P = S(!1), G = S(), q = je(o.inputStyle), U = b(() => w.value || y.value), { wrapperRef: _, isFocused: z, handleFocus: Z, handleBlur: ce } = Ia(U, {
|
|
479
|
-
beforeFocus() {
|
|
480
|
-
return g.value;
|
|
481
|
-
},
|
|
482
|
-
afterBlur() {
|
|
483
|
-
var f;
|
|
484
|
-
o.validateEvent && ((f = v == null ? void 0 : v.validate) == null || f.call(v, "blur").catch((k) => pe(k)));
|
|
485
|
-
}
|
|
486
|
-
}), ne = b(() => {
|
|
487
|
-
var f;
|
|
488
|
-
return (f = u == null ? void 0 : u.statusIcon) != null ? f : !1;
|
|
489
|
-
}), N = b(() => (v == null ? void 0 : v.validateState) || ""), _e = b(() => N.value && Io[N.value]), He = b(() => P.value ? Mo : xo), rt = b(() => [
|
|
490
|
-
a.style
|
|
491
|
-
]), T = b(() => [
|
|
492
|
-
o.inputStyle,
|
|
493
|
-
q.value,
|
|
494
|
-
{ resize: o.resize }
|
|
495
|
-
]), B = b(() => Fn(o.modelValue) ? "" : String(o.modelValue)), O = b(() => o.clearable && !g.value && !o.readonly && !!B.value && (z.value || M.value)), me = b(() => o.showPassword && !g.value && !!B.value && (!!B.value || z.value)), be = b(() => o.showWordLimit && !!o.maxlength && (o.type === "text" || o.type === "textarea") && !g.value && !o.readonly && !o.showPassword), it = b(() => B.value.length), Yn = b(() => !!be.value && it.value > Number(o.maxlength)), Gn = b(() => !!r.suffix || !!o.suffixIcon || O.value || o.showPassword || be.value || !!N.value && ne.value), [Dt, Pt] = Aa(w);
|
|
496
|
-
Ao(y, (f) => {
|
|
497
|
-
if (qn(), !be.value || o.resize !== "both")
|
|
498
|
-
return;
|
|
499
|
-
const k = f[0], { width: ye } = k.contentRect;
|
|
500
|
-
G.value = {
|
|
501
|
-
right: `calc(100% - ${ye + 15 + 6}px)`
|
|
502
|
-
};
|
|
503
|
-
});
|
|
504
|
-
const ke = () => {
|
|
505
|
-
const { type: f, autosize: k } = o;
|
|
506
|
-
if (!(!ue || f !== "textarea" || !y.value))
|
|
507
|
-
if (k) {
|
|
508
|
-
const ye = nt(k) ? k.minRows : void 0, Wt = nt(k) ? k.maxRows : void 0, Yt = sn(y.value, ye, Wt);
|
|
509
|
-
q.value = {
|
|
510
|
-
overflowY: "hidden",
|
|
511
|
-
...Yt
|
|
512
|
-
}, D(() => {
|
|
513
|
-
y.value.offsetHeight, q.value = Yt;
|
|
514
|
-
});
|
|
515
|
-
} else
|
|
516
|
-
q.value = {
|
|
517
|
-
minHeight: sn(y.value).minHeight
|
|
518
|
-
};
|
|
519
|
-
}, qn = ((f) => {
|
|
520
|
-
let k = !1;
|
|
521
|
-
return () => {
|
|
522
|
-
var ye;
|
|
523
|
-
if (k || !o.autosize)
|
|
524
|
-
return;
|
|
525
|
-
((ye = y.value) == null ? void 0 : ye.offsetParent) === null || (f(), k = !0);
|
|
526
|
-
};
|
|
527
|
-
})(ke), Te = () => {
|
|
528
|
-
const f = U.value, k = o.formatter ? o.formatter(B.value) : B.value;
|
|
529
|
-
!f || f.value === k || (f.value = k);
|
|
530
|
-
}, lt = async (f) => {
|
|
531
|
-
Dt();
|
|
532
|
-
let { value: k } = f.target;
|
|
533
|
-
if (o.formatter && o.parser && (k = o.parser(k)), !Ht.value) {
|
|
534
|
-
if (k === B.value) {
|
|
535
|
-
Te();
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
n(Et, k), n(an, k), await D(), Te(), Pt();
|
|
539
|
-
}
|
|
540
|
-
}, _t = (f) => {
|
|
541
|
-
let { value: k } = f.target;
|
|
542
|
-
o.formatter && o.parser && (k = o.parser(k)), n(on, k);
|
|
543
|
-
}, {
|
|
544
|
-
isComposing: Ht,
|
|
545
|
-
handleCompositionStart: $t,
|
|
546
|
-
handleCompositionUpdate: zt,
|
|
547
|
-
handleCompositionEnd: Vt
|
|
548
|
-
} = xa({ emit: n, afterComposition: lt }), jn = () => {
|
|
549
|
-
Dt(), P.value = !P.value, setTimeout(Pt);
|
|
550
|
-
}, Xn = () => {
|
|
551
|
-
var f;
|
|
552
|
-
return (f = U.value) == null ? void 0 : f.focus();
|
|
553
|
-
}, Jn = () => {
|
|
554
|
-
var f;
|
|
555
|
-
return (f = U.value) == null ? void 0 : f.blur();
|
|
556
|
-
}, Qn = (f) => {
|
|
557
|
-
M.value = !1, n("mouseleave", f);
|
|
558
|
-
}, Zn = (f) => {
|
|
559
|
-
M.value = !0, n("mouseenter", f);
|
|
560
|
-
}, Kt = (f) => {
|
|
561
|
-
n("keydown", f);
|
|
562
|
-
}, eo = () => {
|
|
563
|
-
var f;
|
|
564
|
-
(f = U.value) == null || f.select();
|
|
565
|
-
}, Ut = () => {
|
|
566
|
-
n(Et, ""), n(on, ""), n("clear"), n(an, "");
|
|
567
|
-
};
|
|
568
|
-
return K(() => o.modelValue, () => {
|
|
569
|
-
var f;
|
|
570
|
-
D(() => ke()), o.validateEvent && ((f = v == null ? void 0 : v.validate) == null || f.call(v, "change").catch((k) => pe(k)));
|
|
571
|
-
}), K(B, () => Te()), K(() => o.type, async () => {
|
|
572
|
-
await D(), Te(), ke();
|
|
573
|
-
}), te(() => {
|
|
574
|
-
!o.formatter && o.parser && pe(_n, "If you set the parser, you also need to set the formatter."), Te(), D(ke);
|
|
575
|
-
}), t({
|
|
576
|
-
input: w,
|
|
577
|
-
textarea: y,
|
|
578
|
-
ref: U,
|
|
579
|
-
textareaStyle: T,
|
|
580
|
-
autosize: Qe(o, "autosize"),
|
|
581
|
-
isComposing: Ht,
|
|
582
|
-
focus: Xn,
|
|
583
|
-
blur: Jn,
|
|
584
|
-
select: eo,
|
|
585
|
-
clear: Ut,
|
|
586
|
-
resizeTextarea: ke
|
|
587
|
-
}), (f, k) => (m(), L("div", {
|
|
588
|
-
class: E([
|
|
589
|
-
d(i),
|
|
590
|
-
{
|
|
591
|
-
[d(l).bm("group", "append")]: f.$slots.append,
|
|
592
|
-
[d(l).bm("group", "prepend")]: f.$slots.prepend
|
|
593
|
-
}
|
|
594
|
-
]),
|
|
595
|
-
style: Ze(d(rt)),
|
|
596
|
-
onMouseenter: Zn,
|
|
597
|
-
onMouseleave: Qn
|
|
598
|
-
}, [
|
|
599
|
-
I(" input "),
|
|
600
|
-
f.type !== "textarea" ? (m(), L(xe, { key: 0 }, [
|
|
601
|
-
I(" prepend slot "),
|
|
602
|
-
f.$slots.prepend ? (m(), L("div", {
|
|
603
|
-
key: 0,
|
|
604
|
-
class: E(d(l).be("group", "prepend"))
|
|
605
|
-
}, [
|
|
606
|
-
Y(f.$slots, "prepend")
|
|
607
|
-
], 2)) : I("v-if", !0),
|
|
608
|
-
R("div", {
|
|
609
|
-
ref_key: "wrapperRef",
|
|
610
|
-
ref: _,
|
|
611
|
-
class: E(d(c))
|
|
612
|
-
}, [
|
|
613
|
-
I(" prefix slot "),
|
|
614
|
-
f.$slots.prefix || f.prefixIcon ? (m(), L("span", {
|
|
615
|
-
key: 0,
|
|
616
|
-
class: E(d(l).e("prefix"))
|
|
617
|
-
}, [
|
|
618
|
-
R("span", {
|
|
619
|
-
class: E(d(l).e("prefix-inner"))
|
|
620
|
-
}, [
|
|
621
|
-
Y(f.$slots, "prefix"),
|
|
622
|
-
f.prefixIcon ? (m(), x(d(ie), {
|
|
623
|
-
key: 0,
|
|
624
|
-
class: E(d(l).e("icon"))
|
|
625
|
-
}, {
|
|
626
|
-
default: A(() => [
|
|
627
|
-
(m(), x(W(f.prefixIcon)))
|
|
628
|
-
]),
|
|
629
|
-
_: 1
|
|
630
|
-
}, 8, ["class"])) : I("v-if", !0)
|
|
631
|
-
], 2)
|
|
632
|
-
], 2)) : I("v-if", !0),
|
|
633
|
-
R("input", gt({
|
|
634
|
-
id: d(p),
|
|
635
|
-
ref_key: "input",
|
|
636
|
-
ref: w,
|
|
637
|
-
class: d(l).e("inner")
|
|
638
|
-
}, d(s), {
|
|
639
|
-
minlength: f.minlength,
|
|
640
|
-
maxlength: f.maxlength,
|
|
641
|
-
type: f.showPassword ? P.value ? "text" : "password" : f.type,
|
|
642
|
-
disabled: d(g),
|
|
643
|
-
readonly: f.readonly,
|
|
644
|
-
autocomplete: f.autocomplete,
|
|
645
|
-
tabindex: f.tabindex,
|
|
646
|
-
"aria-label": f.ariaLabel,
|
|
647
|
-
placeholder: f.placeholder,
|
|
648
|
-
style: f.inputStyle,
|
|
649
|
-
form: f.form,
|
|
650
|
-
autofocus: f.autofocus,
|
|
651
|
-
role: f.containerRole,
|
|
652
|
-
onCompositionstart: d($t),
|
|
653
|
-
onCompositionupdate: d(zt),
|
|
654
|
-
onCompositionend: d(Vt),
|
|
655
|
-
onInput: lt,
|
|
656
|
-
onChange: _t,
|
|
657
|
-
onKeydown: Kt
|
|
658
|
-
}), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "role", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
|
|
659
|
-
I(" suffix slot "),
|
|
660
|
-
d(Gn) ? (m(), L("span", {
|
|
661
|
-
key: 1,
|
|
662
|
-
class: E(d(l).e("suffix"))
|
|
663
|
-
}, [
|
|
664
|
-
R("span", {
|
|
665
|
-
class: E(d(l).e("suffix-inner"))
|
|
666
|
-
}, [
|
|
667
|
-
!d(O) || !d(me) || !d(be) ? (m(), L(xe, { key: 0 }, [
|
|
668
|
-
Y(f.$slots, "suffix"),
|
|
669
|
-
f.suffixIcon ? (m(), x(d(ie), {
|
|
670
|
-
key: 0,
|
|
671
|
-
class: E(d(l).e("icon"))
|
|
672
|
-
}, {
|
|
673
|
-
default: A(() => [
|
|
674
|
-
(m(), x(W(f.suffixIcon)))
|
|
675
|
-
]),
|
|
676
|
-
_: 1
|
|
677
|
-
}, 8, ["class"])) : I("v-if", !0)
|
|
678
|
-
], 64)) : I("v-if", !0),
|
|
679
|
-
d(O) ? (m(), x(d(ie), {
|
|
680
|
-
key: 1,
|
|
681
|
-
class: E([d(l).e("icon"), d(l).e("clear")]),
|
|
682
|
-
onMousedown: Me(d(Xe), ["prevent"]),
|
|
683
|
-
onClick: Ut
|
|
684
|
-
}, {
|
|
685
|
-
default: A(() => [
|
|
686
|
-
$(d(Bo))
|
|
687
|
-
]),
|
|
688
|
-
_: 1
|
|
689
|
-
}, 8, ["class", "onMousedown"])) : I("v-if", !0),
|
|
690
|
-
d(me) ? (m(), x(d(ie), {
|
|
691
|
-
key: 2,
|
|
692
|
-
class: E([d(l).e("icon"), d(l).e("password")]),
|
|
693
|
-
onClick: jn
|
|
694
|
-
}, {
|
|
695
|
-
default: A(() => [
|
|
696
|
-
(m(), x(W(d(He))))
|
|
697
|
-
]),
|
|
698
|
-
_: 1
|
|
699
|
-
}, 8, ["class"])) : I("v-if", !0),
|
|
700
|
-
d(be) ? (m(), L("span", {
|
|
701
|
-
key: 3,
|
|
702
|
-
class: E(d(l).e("count"))
|
|
703
|
-
}, [
|
|
704
|
-
R("span", {
|
|
705
|
-
class: E(d(l).e("count-inner"))
|
|
706
|
-
}, J(d(it)) + " / " + J(f.maxlength), 3)
|
|
707
|
-
], 2)) : I("v-if", !0),
|
|
708
|
-
d(N) && d(_e) && d(ne) ? (m(), x(d(ie), {
|
|
709
|
-
key: 4,
|
|
710
|
-
class: E([
|
|
711
|
-
d(l).e("icon"),
|
|
712
|
-
d(l).e("validateIcon"),
|
|
713
|
-
d(l).is("loading", d(N) === "validating")
|
|
714
|
-
])
|
|
715
|
-
}, {
|
|
716
|
-
default: A(() => [
|
|
717
|
-
(m(), x(W(d(_e))))
|
|
718
|
-
]),
|
|
719
|
-
_: 1
|
|
720
|
-
}, 8, ["class"])) : I("v-if", !0)
|
|
721
|
-
], 2)
|
|
722
|
-
], 2)) : I("v-if", !0)
|
|
723
|
-
], 2),
|
|
724
|
-
I(" append slot "),
|
|
725
|
-
f.$slots.append ? (m(), L("div", {
|
|
726
|
-
key: 1,
|
|
727
|
-
class: E(d(l).be("group", "append"))
|
|
728
|
-
}, [
|
|
729
|
-
Y(f.$slots, "append")
|
|
730
|
-
], 2)) : I("v-if", !0)
|
|
731
|
-
], 64)) : (m(), L(xe, { key: 1 }, [
|
|
732
|
-
I(" textarea "),
|
|
733
|
-
R("textarea", gt({
|
|
734
|
-
id: d(p),
|
|
735
|
-
ref_key: "textarea",
|
|
736
|
-
ref: y,
|
|
737
|
-
class: [d(h).e("inner"), d(l).is("focus", d(z))]
|
|
738
|
-
}, d(s), {
|
|
739
|
-
minlength: f.minlength,
|
|
740
|
-
maxlength: f.maxlength,
|
|
741
|
-
tabindex: f.tabindex,
|
|
742
|
-
disabled: d(g),
|
|
743
|
-
readonly: f.readonly,
|
|
744
|
-
autocomplete: f.autocomplete,
|
|
745
|
-
style: d(T),
|
|
746
|
-
"aria-label": f.ariaLabel,
|
|
747
|
-
placeholder: f.placeholder,
|
|
748
|
-
form: f.form,
|
|
749
|
-
autofocus: f.autofocus,
|
|
750
|
-
rows: f.rows,
|
|
751
|
-
role: f.containerRole,
|
|
752
|
-
onCompositionstart: d($t),
|
|
753
|
-
onCompositionupdate: d(zt),
|
|
754
|
-
onCompositionend: d(Vt),
|
|
755
|
-
onInput: lt,
|
|
756
|
-
onFocus: d(Z),
|
|
757
|
-
onBlur: d(ce),
|
|
758
|
-
onChange: _t,
|
|
759
|
-
onKeydown: Kt
|
|
760
|
-
}), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "role", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]),
|
|
761
|
-
d(be) ? (m(), L("span", {
|
|
762
|
-
key: 0,
|
|
763
|
-
style: Ze(G.value),
|
|
764
|
-
class: E(d(l).e("count"))
|
|
765
|
-
}, J(d(it)) + " / " + J(f.maxlength), 7)) : I("v-if", !0)
|
|
766
|
-
], 64))
|
|
767
|
-
], 38));
|
|
768
|
-
}
|
|
769
|
-
});
|
|
770
|
-
var Na = /* @__PURE__ */ Pe(Ra, [["__file", "input.vue"]]);
|
|
771
|
-
const La = Ln(Na), Fa = 'a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])', Oa = (e) => process.env.NODE_ENV === "test" ? !0 : getComputedStyle(e).position === "fixed" ? !1 : e.offsetParent !== null, rn = (e) => Array.from(e.querySelectorAll(Fa)).filter((t) => Hn(t) && Oa(t)), Hn = (e) => {
|
|
772
|
-
if (e.tabIndex > 0 || e.tabIndex === 0 && e.getAttribute("tabIndex") !== null)
|
|
773
|
-
return !0;
|
|
774
|
-
if (e.tabIndex < 0 || e.hasAttribute("disabled") || e.getAttribute("aria-disabled") === "true")
|
|
775
|
-
return !1;
|
|
776
|
-
switch (e.nodeName) {
|
|
777
|
-
case "A":
|
|
778
|
-
return !!e.href && e.rel !== "ignore";
|
|
779
|
-
case "INPUT":
|
|
780
|
-
return !(e.type === "hidden" || e.type === "file");
|
|
781
|
-
case "BUTTON":
|
|
782
|
-
case "SELECT":
|
|
783
|
-
case "TEXTAREA":
|
|
784
|
-
return !0;
|
|
785
|
-
default:
|
|
786
|
-
return !1;
|
|
787
|
-
}
|
|
788
|
-
}, dt = "focus-trap.focus-after-trapped", ft = "focus-trap.focus-after-released", Da = "focus-trap.focusout-prevented", ln = {
|
|
789
|
-
cancelable: !0,
|
|
790
|
-
bubbles: !1
|
|
791
|
-
}, Pa = {
|
|
792
|
-
cancelable: !0,
|
|
793
|
-
bubbles: !1
|
|
794
|
-
}, un = "focusAfterTrapped", cn = "focusAfterReleased", _a = Symbol("elFocusTrap"), Rt = S(), st = S(0), Nt = S(0);
|
|
795
|
-
let Ke = 0;
|
|
796
|
-
const $n = (e) => {
|
|
797
|
-
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
798
|
-
acceptNode: (o) => {
|
|
799
|
-
const a = o.tagName === "INPUT" && o.type === "hidden";
|
|
800
|
-
return o.disabled || o.hidden || a ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 || o === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
801
|
-
}
|
|
802
|
-
});
|
|
803
|
-
for (; n.nextNode(); )
|
|
804
|
-
t.push(n.currentNode);
|
|
805
|
-
return t;
|
|
806
|
-
}, dn = (e, t) => {
|
|
807
|
-
for (const n of e)
|
|
808
|
-
if (!Ha(n, t))
|
|
809
|
-
return n;
|
|
810
|
-
}, Ha = (e, t) => {
|
|
811
|
-
if (process.env.NODE_ENV === "test")
|
|
812
|
-
return !1;
|
|
813
|
-
if (getComputedStyle(e).visibility === "hidden")
|
|
814
|
-
return !0;
|
|
815
|
-
for (; e; ) {
|
|
816
|
-
if (t && e === t)
|
|
817
|
-
return !1;
|
|
818
|
-
if (getComputedStyle(e).display === "none")
|
|
819
|
-
return !0;
|
|
820
|
-
e = e.parentElement;
|
|
821
|
-
}
|
|
822
|
-
return !1;
|
|
823
|
-
}, $a = (e) => {
|
|
824
|
-
const t = $n(e), n = dn(t, e), o = dn(t.reverse(), e);
|
|
825
|
-
return [n, o];
|
|
826
|
-
}, za = (e) => e instanceof HTMLInputElement && "select" in e, ae = (e, t) => {
|
|
827
|
-
if (e && e.focus) {
|
|
828
|
-
const n = document.activeElement;
|
|
829
|
-
let o = !1;
|
|
830
|
-
Re(e) && !Hn(e) && !e.getAttribute("tabindex") && (e.setAttribute("tabindex", "-1"), o = !0), e.focus({ preventScroll: !0 }), Nt.value = window.performance.now(), e !== n && za(e) && t && e.select(), Re(e) && o && e.removeAttribute("tabindex");
|
|
831
|
-
}
|
|
832
|
-
};
|
|
833
|
-
function fn(e, t) {
|
|
834
|
-
const n = [...e], o = e.indexOf(t);
|
|
835
|
-
return o !== -1 && n.splice(o, 1), n;
|
|
836
|
-
}
|
|
837
|
-
const Va = () => {
|
|
838
|
-
let e = [];
|
|
839
|
-
return {
|
|
840
|
-
push: (o) => {
|
|
841
|
-
const a = e[0];
|
|
842
|
-
a && o !== a && a.pause(), e = fn(e, o), e.unshift(o);
|
|
843
|
-
},
|
|
844
|
-
remove: (o) => {
|
|
845
|
-
var a, s;
|
|
846
|
-
e = fn(e, o), (s = (a = e[0]) == null ? void 0 : a.resume) == null || s.call(a);
|
|
847
|
-
}
|
|
848
|
-
};
|
|
849
|
-
}, Ka = (e, t = !1) => {
|
|
850
|
-
const n = document.activeElement;
|
|
851
|
-
for (const o of e)
|
|
852
|
-
if (ae(o, t), document.activeElement !== n)
|
|
853
|
-
return;
|
|
854
|
-
}, vn = Va(), Ua = () => st.value > Nt.value, Ue = () => {
|
|
855
|
-
Rt.value = "pointer", st.value = window.performance.now();
|
|
856
|
-
}, pn = () => {
|
|
857
|
-
Rt.value = "keyboard", st.value = window.performance.now();
|
|
858
|
-
}, Wa = () => (te(() => {
|
|
859
|
-
Ke === 0 && (document.addEventListener("mousedown", Ue), document.addEventListener("touchstart", Ue), document.addEventListener("keydown", pn)), Ke++;
|
|
860
|
-
}), Oe(() => {
|
|
861
|
-
Ke--, Ke <= 0 && (document.removeEventListener("mousedown", Ue), document.removeEventListener("touchstart", Ue), document.removeEventListener("keydown", pn));
|
|
862
|
-
}), {
|
|
863
|
-
focusReason: Rt,
|
|
864
|
-
lastUserFocusTimestamp: st,
|
|
865
|
-
lastAutomatedFocusTimestamp: Nt
|
|
866
|
-
}), We = (e) => new CustomEvent(Da, {
|
|
867
|
-
...Pa,
|
|
868
|
-
detail: e
|
|
869
|
-
});
|
|
870
|
-
let Ee = [];
|
|
871
|
-
const hn = (e) => {
|
|
872
|
-
e.code === Mt.esc && Ee.forEach((t) => t(e));
|
|
873
|
-
}, Ya = (e) => {
|
|
874
|
-
te(() => {
|
|
875
|
-
Ee.length === 0 && document.addEventListener("keydown", hn), ue && Ee.push(e);
|
|
876
|
-
}), Oe(() => {
|
|
877
|
-
Ee = Ee.filter((t) => t !== e), Ee.length === 0 && ue && document.removeEventListener("keydown", hn);
|
|
878
|
-
});
|
|
879
|
-
}, Ga = Q({
|
|
880
|
-
name: "ElFocusTrap",
|
|
881
|
-
inheritAttrs: !1,
|
|
882
|
-
props: {
|
|
883
|
-
loop: Boolean,
|
|
884
|
-
trapped: Boolean,
|
|
885
|
-
focusTrapEl: Object,
|
|
886
|
-
focusStartEl: {
|
|
887
|
-
type: [Object, String],
|
|
888
|
-
default: "first"
|
|
889
|
-
}
|
|
890
|
-
},
|
|
891
|
-
emits: [
|
|
892
|
-
un,
|
|
893
|
-
cn,
|
|
894
|
-
"focusin",
|
|
895
|
-
"focusout",
|
|
896
|
-
"focusout-prevented",
|
|
897
|
-
"release-requested"
|
|
898
|
-
],
|
|
899
|
-
setup(e, { emit: t }) {
|
|
900
|
-
const n = S();
|
|
901
|
-
let o, a;
|
|
902
|
-
const { focusReason: s } = Wa();
|
|
903
|
-
Ya((l) => {
|
|
904
|
-
e.trapped && !r.paused && t("release-requested", l);
|
|
905
|
-
});
|
|
906
|
-
const r = {
|
|
907
|
-
paused: !1,
|
|
908
|
-
pause() {
|
|
909
|
-
this.paused = !0;
|
|
910
|
-
},
|
|
911
|
-
resume() {
|
|
912
|
-
this.paused = !1;
|
|
913
|
-
}
|
|
914
|
-
}, i = (l) => {
|
|
915
|
-
if (!e.loop && !e.trapped || r.paused)
|
|
916
|
-
return;
|
|
917
|
-
const { code: h, altKey: w, ctrlKey: y, metaKey: M, currentTarget: P, shiftKey: G } = l, { loop: q } = e, U = h === Mt.tab && !w && !y && !M, _ = document.activeElement;
|
|
918
|
-
if (U && _) {
|
|
919
|
-
const z = P, [Z, ce] = $a(z);
|
|
920
|
-
if (Z && ce) {
|
|
921
|
-
if (!G && _ === ce) {
|
|
922
|
-
const N = We({
|
|
923
|
-
focusReason: s.value
|
|
924
|
-
});
|
|
925
|
-
t("focusout-prevented", N), N.defaultPrevented || (l.preventDefault(), q && ae(Z, !0));
|
|
926
|
-
} else if (G && [Z, z].includes(_)) {
|
|
927
|
-
const N = We({
|
|
928
|
-
focusReason: s.value
|
|
929
|
-
});
|
|
930
|
-
t("focusout-prevented", N), N.defaultPrevented || (l.preventDefault(), q && ae(ce, !0));
|
|
931
|
-
}
|
|
932
|
-
} else if (_ === z) {
|
|
933
|
-
const N = We({
|
|
934
|
-
focusReason: s.value
|
|
935
|
-
});
|
|
936
|
-
t("focusout-prevented", N), N.defaultPrevented || l.preventDefault();
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
kn(_a, {
|
|
941
|
-
focusTrapRef: n,
|
|
942
|
-
onKeydown: i
|
|
943
|
-
}), K(() => e.focusTrapEl, (l) => {
|
|
944
|
-
l && (n.value = l);
|
|
945
|
-
}, { immediate: !0 }), K([n], ([l], [h]) => {
|
|
946
|
-
l && (l.addEventListener("keydown", i), l.addEventListener("focusin", v), l.addEventListener("focusout", p)), h && (h.removeEventListener("keydown", i), h.removeEventListener("focusin", v), h.removeEventListener("focusout", p));
|
|
947
|
-
});
|
|
948
|
-
const c = (l) => {
|
|
949
|
-
t(un, l);
|
|
950
|
-
}, u = (l) => t(cn, l), v = (l) => {
|
|
951
|
-
const h = d(n);
|
|
952
|
-
if (!h)
|
|
953
|
-
return;
|
|
954
|
-
const w = l.target, y = l.relatedTarget, M = w && h.contains(w);
|
|
955
|
-
e.trapped || y && h.contains(y) || (o = y), M && t("focusin", l), !r.paused && e.trapped && (M ? a = w : ae(a, !0));
|
|
956
|
-
}, p = (l) => {
|
|
957
|
-
const h = d(n);
|
|
958
|
-
if (!(r.paused || !h))
|
|
959
|
-
if (e.trapped) {
|
|
960
|
-
const w = l.relatedTarget;
|
|
961
|
-
!Fn(w) && !h.contains(w) && setTimeout(() => {
|
|
962
|
-
if (!r.paused && e.trapped) {
|
|
963
|
-
const y = We({
|
|
964
|
-
focusReason: s.value
|
|
965
|
-
});
|
|
966
|
-
t("focusout-prevented", y), y.defaultPrevented || ae(a, !0);
|
|
967
|
-
}
|
|
968
|
-
}, 0);
|
|
969
|
-
} else {
|
|
970
|
-
const w = l.target;
|
|
971
|
-
w && h.contains(w) || t("focusout", l);
|
|
972
|
-
}
|
|
973
|
-
};
|
|
974
|
-
async function C() {
|
|
975
|
-
await D();
|
|
976
|
-
const l = d(n);
|
|
977
|
-
if (l) {
|
|
978
|
-
vn.push(r);
|
|
979
|
-
const h = l.contains(document.activeElement) ? o : document.activeElement;
|
|
980
|
-
if (o = h, !l.contains(h)) {
|
|
981
|
-
const y = new Event(dt, ln);
|
|
982
|
-
l.addEventListener(dt, c), l.dispatchEvent(y), y.defaultPrevented || D(() => {
|
|
983
|
-
let M = e.focusStartEl;
|
|
984
|
-
ve(M) || (ae(M), document.activeElement !== M && (M = "first")), M === "first" && Ka($n(l), !0), (document.activeElement === h || M === "container") && ae(l);
|
|
985
|
-
});
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
function g() {
|
|
990
|
-
const l = d(n);
|
|
991
|
-
if (l) {
|
|
992
|
-
l.removeEventListener(dt, c);
|
|
993
|
-
const h = new CustomEvent(ft, {
|
|
994
|
-
...ln,
|
|
995
|
-
detail: {
|
|
996
|
-
focusReason: s.value
|
|
997
|
-
}
|
|
998
|
-
});
|
|
999
|
-
l.addEventListener(ft, u), l.dispatchEvent(h), !h.defaultPrevented && (s.value == "keyboard" || !Ua() || l.contains(document.activeElement)) && ae(o ?? document.body), l.removeEventListener(ft, u), vn.remove(r);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
return te(() => {
|
|
1003
|
-
e.trapped && C(), K(() => e.trapped, (l) => {
|
|
1004
|
-
l ? C() : g();
|
|
1005
|
-
});
|
|
1006
|
-
}), Oe(() => {
|
|
1007
|
-
e.trapped && g(), n.value && (n.value.removeEventListener("keydown", i), n.value.removeEventListener("focusin", v), n.value.removeEventListener("focusout", p), n.value = void 0);
|
|
1008
|
-
}), {
|
|
1009
|
-
onKeydown: i
|
|
1010
|
-
};
|
|
1011
|
-
}
|
|
1012
|
-
});
|
|
1013
|
-
function qa(e, t, n, o, a, s) {
|
|
1014
|
-
return Y(e.$slots, "default", { handleKeydown: e.onKeydown });
|
|
1015
|
-
}
|
|
1016
|
-
var ja = /* @__PURE__ */ Pe(Ga, [["render", qa], ["__file", "focus-trap.vue"]]);
|
|
1017
|
-
const zn = Symbol("buttonGroupContextKey"), Xa = ({ from: e, replacement: t, scope: n, version: o, ref: a, type: s = "API" }, r) => {
|
|
1018
|
-
K(() => d(r), (i) => {
|
|
1019
|
-
i && pe(n, `[${s}] ${e} is about to be deprecated in version ${o}, please use ${t} instead.
|
|
1020
|
-
For more detail, please visit: ${a}
|
|
1021
|
-
`);
|
|
1022
|
-
}, {
|
|
1023
|
-
immediate: !0
|
|
1024
|
-
});
|
|
1025
|
-
}, Ja = (e, t) => {
|
|
1026
|
-
Xa({
|
|
1027
|
-
from: "type.text",
|
|
1028
|
-
replacement: "link",
|
|
1029
|
-
version: "3.0.0",
|
|
1030
|
-
scope: "props",
|
|
1031
|
-
ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
|
|
1032
|
-
}, b(() => e.type === "text"));
|
|
1033
|
-
const n = he(zn, void 0), o = Ro("button"), { form: a } = Dn(), s = Pn(b(() => n == null ? void 0 : n.size)), r = Bt(), i = S(), c = Sn(), u = b(() => e.type || (n == null ? void 0 : n.type) || ""), v = b(() => {
|
|
1034
|
-
var l, h, w;
|
|
1035
|
-
return (w = (h = e.autoInsertSpace) != null ? h : (l = o.value) == null ? void 0 : l.autoInsertSpace) != null ? w : !1;
|
|
1036
|
-
}), p = b(() => e.tag === "button" ? {
|
|
1037
|
-
ariaDisabled: r.value || e.loading,
|
|
1038
|
-
disabled: r.value || e.loading,
|
|
1039
|
-
autofocus: e.autofocus,
|
|
1040
|
-
type: e.nativeType
|
|
1041
|
-
} : {}), C = b(() => {
|
|
1042
|
-
var l;
|
|
1043
|
-
const h = (l = c.default) == null ? void 0 : l.call(c);
|
|
1044
|
-
if (v.value && (h == null ? void 0 : h.length) === 1) {
|
|
1045
|
-
const w = h[0];
|
|
1046
|
-
if ((w == null ? void 0 : w.type) === oo) {
|
|
1047
|
-
const y = w.children;
|
|
1048
|
-
return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(y.trim());
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
return !1;
|
|
1052
|
-
});
|
|
1053
|
-
return {
|
|
1054
|
-
_disabled: r,
|
|
1055
|
-
_size: s,
|
|
1056
|
-
_type: u,
|
|
1057
|
-
_ref: i,
|
|
1058
|
-
_props: p,
|
|
1059
|
-
shouldAddSpace: C,
|
|
1060
|
-
handleClick: (l) => {
|
|
1061
|
-
if (r.value || e.loading) {
|
|
1062
|
-
l.stopPropagation();
|
|
1063
|
-
return;
|
|
1064
|
-
}
|
|
1065
|
-
e.nativeType === "reset" && (a == null || a.resetFields()), t("click", l);
|
|
1066
|
-
}
|
|
1067
|
-
};
|
|
1068
|
-
}, Qa = [
|
|
1069
|
-
"default",
|
|
1070
|
-
"primary",
|
|
1071
|
-
"success",
|
|
1072
|
-
"warning",
|
|
1073
|
-
"info",
|
|
1074
|
-
"danger",
|
|
1075
|
-
"text",
|
|
1076
|
-
""
|
|
1077
|
-
], Za = ["button", "submit", "reset"], St = at({
|
|
1078
|
-
size: Nn,
|
|
1079
|
-
disabled: Boolean,
|
|
1080
|
-
type: {
|
|
1081
|
-
type: String,
|
|
1082
|
-
values: Qa,
|
|
1083
|
-
default: ""
|
|
1084
|
-
},
|
|
1085
|
-
icon: {
|
|
1086
|
-
type: tt
|
|
1087
|
-
},
|
|
1088
|
-
nativeType: {
|
|
1089
|
-
type: String,
|
|
1090
|
-
values: Za,
|
|
1091
|
-
default: "button"
|
|
1092
|
-
},
|
|
1093
|
-
loading: Boolean,
|
|
1094
|
-
loadingIcon: {
|
|
1095
|
-
type: tt,
|
|
1096
|
-
default: () => yt
|
|
1097
|
-
},
|
|
1098
|
-
plain: Boolean,
|
|
1099
|
-
text: Boolean,
|
|
1100
|
-
link: Boolean,
|
|
1101
|
-
bg: Boolean,
|
|
1102
|
-
autofocus: Boolean,
|
|
1103
|
-
round: Boolean,
|
|
1104
|
-
circle: Boolean,
|
|
1105
|
-
color: String,
|
|
1106
|
-
dark: Boolean,
|
|
1107
|
-
autoInsertSpace: {
|
|
1108
|
-
type: Boolean,
|
|
1109
|
-
default: void 0
|
|
1110
|
-
},
|
|
1111
|
-
tag: {
|
|
1112
|
-
type: Ce([String, Object]),
|
|
1113
|
-
default: "button"
|
|
1114
|
-
}
|
|
1115
|
-
}), es = {
|
|
1116
|
-
click: (e) => e instanceof MouseEvent
|
|
1117
|
-
};
|
|
1118
|
-
function F(e, t) {
|
|
1119
|
-
ts(e) && (e = "100%");
|
|
1120
|
-
var n = ns(e);
|
|
1121
|
-
return e = t === 360 ? e : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (t === 360 ? e = (e < 0 ? e % t + t : e % t) / parseFloat(String(t)) : e = e % t / parseFloat(String(t)), e);
|
|
1122
|
-
}
|
|
1123
|
-
function Ye(e) {
|
|
1124
|
-
return Math.min(1, Math.max(0, e));
|
|
1125
|
-
}
|
|
1126
|
-
function ts(e) {
|
|
1127
|
-
return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
|
|
1128
|
-
}
|
|
1129
|
-
function ns(e) {
|
|
1130
|
-
return typeof e == "string" && e.indexOf("%") !== -1;
|
|
1131
|
-
}
|
|
1132
|
-
function Vn(e) {
|
|
1133
|
-
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
1134
|
-
}
|
|
1135
|
-
function Ge(e) {
|
|
1136
|
-
return e <= 1 ? "".concat(Number(e) * 100, "%") : e;
|
|
1137
|
-
}
|
|
1138
|
-
function de(e) {
|
|
1139
|
-
return e.length === 1 ? "0" + e : String(e);
|
|
1140
|
-
}
|
|
1141
|
-
function os(e, t, n) {
|
|
1142
|
-
return {
|
|
1143
|
-
r: F(e, 255) * 255,
|
|
1144
|
-
g: F(t, 255) * 255,
|
|
1145
|
-
b: F(n, 255) * 255
|
|
1146
|
-
};
|
|
1147
|
-
}
|
|
1148
|
-
function gn(e, t, n) {
|
|
1149
|
-
e = F(e, 255), t = F(t, 255), n = F(n, 255);
|
|
1150
|
-
var o = Math.max(e, t, n), a = Math.min(e, t, n), s = 0, r = 0, i = (o + a) / 2;
|
|
1151
|
-
if (o === a)
|
|
1152
|
-
r = 0, s = 0;
|
|
1153
|
-
else {
|
|
1154
|
-
var c = o - a;
|
|
1155
|
-
switch (r = i > 0.5 ? c / (2 - o - a) : c / (o + a), o) {
|
|
1156
|
-
case e:
|
|
1157
|
-
s = (t - n) / c + (t < n ? 6 : 0);
|
|
1158
|
-
break;
|
|
1159
|
-
case t:
|
|
1160
|
-
s = (n - e) / c + 2;
|
|
1161
|
-
break;
|
|
1162
|
-
case n:
|
|
1163
|
-
s = (e - t) / c + 4;
|
|
1164
|
-
break;
|
|
1165
|
-
}
|
|
1166
|
-
s /= 6;
|
|
1167
|
-
}
|
|
1168
|
-
return { h: s, s: r, l: i };
|
|
1169
|
-
}
|
|
1170
|
-
function vt(e, t, n) {
|
|
1171
|
-
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
1172
|
-
}
|
|
1173
|
-
function as(e, t, n) {
|
|
1174
|
-
var o, a, s;
|
|
1175
|
-
if (e = F(e, 360), t = F(t, 100), n = F(n, 100), t === 0)
|
|
1176
|
-
a = n, s = n, o = n;
|
|
1177
|
-
else {
|
|
1178
|
-
var r = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - r;
|
|
1179
|
-
o = vt(i, r, e + 1 / 3), a = vt(i, r, e), s = vt(i, r, e - 1 / 3);
|
|
1180
|
-
}
|
|
1181
|
-
return { r: o * 255, g: a * 255, b: s * 255 };
|
|
1182
|
-
}
|
|
1183
|
-
function mn(e, t, n) {
|
|
1184
|
-
e = F(e, 255), t = F(t, 255), n = F(n, 255);
|
|
1185
|
-
var o = Math.max(e, t, n), a = Math.min(e, t, n), s = 0, r = o, i = o - a, c = o === 0 ? 0 : i / o;
|
|
1186
|
-
if (o === a)
|
|
1187
|
-
s = 0;
|
|
1188
|
-
else {
|
|
1189
|
-
switch (o) {
|
|
1190
|
-
case e:
|
|
1191
|
-
s = (t - n) / i + (t < n ? 6 : 0);
|
|
1192
|
-
break;
|
|
1193
|
-
case t:
|
|
1194
|
-
s = (n - e) / i + 2;
|
|
1195
|
-
break;
|
|
1196
|
-
case n:
|
|
1197
|
-
s = (e - t) / i + 4;
|
|
1198
|
-
break;
|
|
1199
|
-
}
|
|
1200
|
-
s /= 6;
|
|
1201
|
-
}
|
|
1202
|
-
return { h: s, s: c, v: r };
|
|
1203
|
-
}
|
|
1204
|
-
function ss(e, t, n) {
|
|
1205
|
-
e = F(e, 360) * 6, t = F(t, 100), n = F(n, 100);
|
|
1206
|
-
var o = Math.floor(e), a = e - o, s = n * (1 - t), r = n * (1 - a * t), i = n * (1 - (1 - a) * t), c = o % 6, u = [n, r, s, s, i, n][c], v = [i, n, n, r, s, s][c], p = [s, s, i, n, n, r][c];
|
|
1207
|
-
return { r: u * 255, g: v * 255, b: p * 255 };
|
|
1208
|
-
}
|
|
1209
|
-
function bn(e, t, n, o) {
|
|
1210
|
-
var a = [
|
|
1211
|
-
de(Math.round(e).toString(16)),
|
|
1212
|
-
de(Math.round(t).toString(16)),
|
|
1213
|
-
de(Math.round(n).toString(16))
|
|
1214
|
-
];
|
|
1215
|
-
return o && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) : a.join("");
|
|
1216
|
-
}
|
|
1217
|
-
function rs(e, t, n, o, a) {
|
|
1218
|
-
var s = [
|
|
1219
|
-
de(Math.round(e).toString(16)),
|
|
1220
|
-
de(Math.round(t).toString(16)),
|
|
1221
|
-
de(Math.round(n).toString(16)),
|
|
1222
|
-
de(is(o))
|
|
1223
|
-
];
|
|
1224
|
-
return a && s[0].startsWith(s[0].charAt(1)) && s[1].startsWith(s[1].charAt(1)) && s[2].startsWith(s[2].charAt(1)) && s[3].startsWith(s[3].charAt(1)) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) + s[3].charAt(0) : s.join("");
|
|
1225
|
-
}
|
|
1226
|
-
function is(e) {
|
|
1227
|
-
return Math.round(parseFloat(e) * 255).toString(16);
|
|
1228
|
-
}
|
|
1229
|
-
function yn(e) {
|
|
1230
|
-
return V(e) / 255;
|
|
1231
|
-
}
|
|
1232
|
-
function V(e) {
|
|
1233
|
-
return parseInt(e, 16);
|
|
1234
|
-
}
|
|
1235
|
-
function ls(e) {
|
|
1236
|
-
return {
|
|
1237
|
-
r: e >> 16,
|
|
1238
|
-
g: (e & 65280) >> 8,
|
|
1239
|
-
b: e & 255
|
|
1240
|
-
};
|
|
1241
|
-
}
|
|
1242
|
-
var kt = {
|
|
1243
|
-
aliceblue: "#f0f8ff",
|
|
1244
|
-
antiquewhite: "#faebd7",
|
|
1245
|
-
aqua: "#00ffff",
|
|
1246
|
-
aquamarine: "#7fffd4",
|
|
1247
|
-
azure: "#f0ffff",
|
|
1248
|
-
beige: "#f5f5dc",
|
|
1249
|
-
bisque: "#ffe4c4",
|
|
1250
|
-
black: "#000000",
|
|
1251
|
-
blanchedalmond: "#ffebcd",
|
|
1252
|
-
blue: "#0000ff",
|
|
1253
|
-
blueviolet: "#8a2be2",
|
|
1254
|
-
brown: "#a52a2a",
|
|
1255
|
-
burlywood: "#deb887",
|
|
1256
|
-
cadetblue: "#5f9ea0",
|
|
1257
|
-
chartreuse: "#7fff00",
|
|
1258
|
-
chocolate: "#d2691e",
|
|
1259
|
-
coral: "#ff7f50",
|
|
1260
|
-
cornflowerblue: "#6495ed",
|
|
1261
|
-
cornsilk: "#fff8dc",
|
|
1262
|
-
crimson: "#dc143c",
|
|
1263
|
-
cyan: "#00ffff",
|
|
1264
|
-
darkblue: "#00008b",
|
|
1265
|
-
darkcyan: "#008b8b",
|
|
1266
|
-
darkgoldenrod: "#b8860b",
|
|
1267
|
-
darkgray: "#a9a9a9",
|
|
1268
|
-
darkgreen: "#006400",
|
|
1269
|
-
darkgrey: "#a9a9a9",
|
|
1270
|
-
darkkhaki: "#bdb76b",
|
|
1271
|
-
darkmagenta: "#8b008b",
|
|
1272
|
-
darkolivegreen: "#556b2f",
|
|
1273
|
-
darkorange: "#ff8c00",
|
|
1274
|
-
darkorchid: "#9932cc",
|
|
1275
|
-
darkred: "#8b0000",
|
|
1276
|
-
darksalmon: "#e9967a",
|
|
1277
|
-
darkseagreen: "#8fbc8f",
|
|
1278
|
-
darkslateblue: "#483d8b",
|
|
1279
|
-
darkslategray: "#2f4f4f",
|
|
1280
|
-
darkslategrey: "#2f4f4f",
|
|
1281
|
-
darkturquoise: "#00ced1",
|
|
1282
|
-
darkviolet: "#9400d3",
|
|
1283
|
-
deeppink: "#ff1493",
|
|
1284
|
-
deepskyblue: "#00bfff",
|
|
1285
|
-
dimgray: "#696969",
|
|
1286
|
-
dimgrey: "#696969",
|
|
1287
|
-
dodgerblue: "#1e90ff",
|
|
1288
|
-
firebrick: "#b22222",
|
|
1289
|
-
floralwhite: "#fffaf0",
|
|
1290
|
-
forestgreen: "#228b22",
|
|
1291
|
-
fuchsia: "#ff00ff",
|
|
1292
|
-
gainsboro: "#dcdcdc",
|
|
1293
|
-
ghostwhite: "#f8f8ff",
|
|
1294
|
-
goldenrod: "#daa520",
|
|
1295
|
-
gold: "#ffd700",
|
|
1296
|
-
gray: "#808080",
|
|
1297
|
-
green: "#008000",
|
|
1298
|
-
greenyellow: "#adff2f",
|
|
1299
|
-
grey: "#808080",
|
|
1300
|
-
honeydew: "#f0fff0",
|
|
1301
|
-
hotpink: "#ff69b4",
|
|
1302
|
-
indianred: "#cd5c5c",
|
|
1303
|
-
indigo: "#4b0082",
|
|
1304
|
-
ivory: "#fffff0",
|
|
1305
|
-
khaki: "#f0e68c",
|
|
1306
|
-
lavenderblush: "#fff0f5",
|
|
1307
|
-
lavender: "#e6e6fa",
|
|
1308
|
-
lawngreen: "#7cfc00",
|
|
1309
|
-
lemonchiffon: "#fffacd",
|
|
1310
|
-
lightblue: "#add8e6",
|
|
1311
|
-
lightcoral: "#f08080",
|
|
1312
|
-
lightcyan: "#e0ffff",
|
|
1313
|
-
lightgoldenrodyellow: "#fafad2",
|
|
1314
|
-
lightgray: "#d3d3d3",
|
|
1315
|
-
lightgreen: "#90ee90",
|
|
1316
|
-
lightgrey: "#d3d3d3",
|
|
1317
|
-
lightpink: "#ffb6c1",
|
|
1318
|
-
lightsalmon: "#ffa07a",
|
|
1319
|
-
lightseagreen: "#20b2aa",
|
|
1320
|
-
lightskyblue: "#87cefa",
|
|
1321
|
-
lightslategray: "#778899",
|
|
1322
|
-
lightslategrey: "#778899",
|
|
1323
|
-
lightsteelblue: "#b0c4de",
|
|
1324
|
-
lightyellow: "#ffffe0",
|
|
1325
|
-
lime: "#00ff00",
|
|
1326
|
-
limegreen: "#32cd32",
|
|
1327
|
-
linen: "#faf0e6",
|
|
1328
|
-
magenta: "#ff00ff",
|
|
1329
|
-
maroon: "#800000",
|
|
1330
|
-
mediumaquamarine: "#66cdaa",
|
|
1331
|
-
mediumblue: "#0000cd",
|
|
1332
|
-
mediumorchid: "#ba55d3",
|
|
1333
|
-
mediumpurple: "#9370db",
|
|
1334
|
-
mediumseagreen: "#3cb371",
|
|
1335
|
-
mediumslateblue: "#7b68ee",
|
|
1336
|
-
mediumspringgreen: "#00fa9a",
|
|
1337
|
-
mediumturquoise: "#48d1cc",
|
|
1338
|
-
mediumvioletred: "#c71585",
|
|
1339
|
-
midnightblue: "#191970",
|
|
1340
|
-
mintcream: "#f5fffa",
|
|
1341
|
-
mistyrose: "#ffe4e1",
|
|
1342
|
-
moccasin: "#ffe4b5",
|
|
1343
|
-
navajowhite: "#ffdead",
|
|
1344
|
-
navy: "#000080",
|
|
1345
|
-
oldlace: "#fdf5e6",
|
|
1346
|
-
olive: "#808000",
|
|
1347
|
-
olivedrab: "#6b8e23",
|
|
1348
|
-
orange: "#ffa500",
|
|
1349
|
-
orangered: "#ff4500",
|
|
1350
|
-
orchid: "#da70d6",
|
|
1351
|
-
palegoldenrod: "#eee8aa",
|
|
1352
|
-
palegreen: "#98fb98",
|
|
1353
|
-
paleturquoise: "#afeeee",
|
|
1354
|
-
palevioletred: "#db7093",
|
|
1355
|
-
papayawhip: "#ffefd5",
|
|
1356
|
-
peachpuff: "#ffdab9",
|
|
1357
|
-
peru: "#cd853f",
|
|
1358
|
-
pink: "#ffc0cb",
|
|
1359
|
-
plum: "#dda0dd",
|
|
1360
|
-
powderblue: "#b0e0e6",
|
|
1361
|
-
purple: "#800080",
|
|
1362
|
-
rebeccapurple: "#663399",
|
|
1363
|
-
red: "#ff0000",
|
|
1364
|
-
rosybrown: "#bc8f8f",
|
|
1365
|
-
royalblue: "#4169e1",
|
|
1366
|
-
saddlebrown: "#8b4513",
|
|
1367
|
-
salmon: "#fa8072",
|
|
1368
|
-
sandybrown: "#f4a460",
|
|
1369
|
-
seagreen: "#2e8b57",
|
|
1370
|
-
seashell: "#fff5ee",
|
|
1371
|
-
sienna: "#a0522d",
|
|
1372
|
-
silver: "#c0c0c0",
|
|
1373
|
-
skyblue: "#87ceeb",
|
|
1374
|
-
slateblue: "#6a5acd",
|
|
1375
|
-
slategray: "#708090",
|
|
1376
|
-
slategrey: "#708090",
|
|
1377
|
-
snow: "#fffafa",
|
|
1378
|
-
springgreen: "#00ff7f",
|
|
1379
|
-
steelblue: "#4682b4",
|
|
1380
|
-
tan: "#d2b48c",
|
|
1381
|
-
teal: "#008080",
|
|
1382
|
-
thistle: "#d8bfd8",
|
|
1383
|
-
tomato: "#ff6347",
|
|
1384
|
-
turquoise: "#40e0d0",
|
|
1385
|
-
violet: "#ee82ee",
|
|
1386
|
-
wheat: "#f5deb3",
|
|
1387
|
-
white: "#ffffff",
|
|
1388
|
-
whitesmoke: "#f5f5f5",
|
|
1389
|
-
yellow: "#ffff00",
|
|
1390
|
-
yellowgreen: "#9acd32"
|
|
1391
|
-
};
|
|
1392
|
-
function us(e) {
|
|
1393
|
-
var t = { r: 0, g: 0, b: 0 }, n = 1, o = null, a = null, s = null, r = !1, i = !1;
|
|
1394
|
-
return typeof e == "string" && (e = fs(e)), typeof e == "object" && (ee(e.r) && ee(e.g) && ee(e.b) ? (t = os(e.r, e.g, e.b), r = !0, i = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : ee(e.h) && ee(e.s) && ee(e.v) ? (o = Ge(e.s), a = Ge(e.v), t = ss(e.h, o, a), r = !0, i = "hsv") : ee(e.h) && ee(e.s) && ee(e.l) && (o = Ge(e.s), s = Ge(e.l), t = as(e.h, o, s), r = !0, i = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Vn(n), {
|
|
1395
|
-
ok: r,
|
|
1396
|
-
format: e.format || i,
|
|
1397
|
-
r: Math.min(255, Math.max(t.r, 0)),
|
|
1398
|
-
g: Math.min(255, Math.max(t.g, 0)),
|
|
1399
|
-
b: Math.min(255, Math.max(t.b, 0)),
|
|
1400
|
-
a: n
|
|
1401
|
-
};
|
|
1402
|
-
}
|
|
1403
|
-
var cs = "[-\\+]?\\d+%?", ds = "[-\\+]?\\d*\\.\\d+%?", le = "(?:".concat(ds, ")|(?:").concat(cs, ")"), pt = "[\\s|\\(]+(".concat(le, ")[,|\\s]+(").concat(le, ")[,|\\s]+(").concat(le, ")\\s*\\)?"), ht = "[\\s|\\(]+(".concat(le, ")[,|\\s]+(").concat(le, ")[,|\\s]+(").concat(le, ")[,|\\s]+(").concat(le, ")\\s*\\)?"), j = {
|
|
1404
|
-
CSS_UNIT: new RegExp(le),
|
|
1405
|
-
rgb: new RegExp("rgb" + pt),
|
|
1406
|
-
rgba: new RegExp("rgba" + ht),
|
|
1407
|
-
hsl: new RegExp("hsl" + pt),
|
|
1408
|
-
hsla: new RegExp("hsla" + ht),
|
|
1409
|
-
hsv: new RegExp("hsv" + pt),
|
|
1410
|
-
hsva: new RegExp("hsva" + ht),
|
|
1411
|
-
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
1412
|
-
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
1413
|
-
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
1414
|
-
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
1415
|
-
};
|
|
1416
|
-
function fs(e) {
|
|
1417
|
-
if (e = e.trim().toLowerCase(), e.length === 0)
|
|
1418
|
-
return !1;
|
|
1419
|
-
var t = !1;
|
|
1420
|
-
if (kt[e])
|
|
1421
|
-
e = kt[e], t = !0;
|
|
1422
|
-
else if (e === "transparent")
|
|
1423
|
-
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
|
1424
|
-
var n = j.rgb.exec(e);
|
|
1425
|
-
return n ? { r: n[1], g: n[2], b: n[3] } : (n = j.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = j.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = j.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = j.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = j.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = j.hex8.exec(e), n ? {
|
|
1426
|
-
r: V(n[1]),
|
|
1427
|
-
g: V(n[2]),
|
|
1428
|
-
b: V(n[3]),
|
|
1429
|
-
a: yn(n[4]),
|
|
1430
|
-
format: t ? "name" : "hex8"
|
|
1431
|
-
} : (n = j.hex6.exec(e), n ? {
|
|
1432
|
-
r: V(n[1]),
|
|
1433
|
-
g: V(n[2]),
|
|
1434
|
-
b: V(n[3]),
|
|
1435
|
-
format: t ? "name" : "hex"
|
|
1436
|
-
} : (n = j.hex4.exec(e), n ? {
|
|
1437
|
-
r: V(n[1] + n[1]),
|
|
1438
|
-
g: V(n[2] + n[2]),
|
|
1439
|
-
b: V(n[3] + n[3]),
|
|
1440
|
-
a: yn(n[4] + n[4]),
|
|
1441
|
-
format: t ? "name" : "hex8"
|
|
1442
|
-
} : (n = j.hex3.exec(e), n ? {
|
|
1443
|
-
r: V(n[1] + n[1]),
|
|
1444
|
-
g: V(n[2] + n[2]),
|
|
1445
|
-
b: V(n[3] + n[3]),
|
|
1446
|
-
format: t ? "name" : "hex"
|
|
1447
|
-
} : !1)))))))));
|
|
1448
|
-
}
|
|
1449
|
-
function ee(e) {
|
|
1450
|
-
return !!j.CSS_UNIT.exec(String(e));
|
|
1451
|
-
}
|
|
1452
|
-
var vs = (
|
|
1453
|
-
/** @class */
|
|
1454
|
-
function() {
|
|
1455
|
-
function e(t, n) {
|
|
1456
|
-
t === void 0 && (t = ""), n === void 0 && (n = {});
|
|
1457
|
-
var o;
|
|
1458
|
-
if (t instanceof e)
|
|
1459
|
-
return t;
|
|
1460
|
-
typeof t == "number" && (t = ls(t)), this.originalInput = t;
|
|
1461
|
-
var a = us(t);
|
|
1462
|
-
this.originalInput = t, this.r = a.r, this.g = a.g, this.b = a.b, this.a = a.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (o = n.format) !== null && o !== void 0 ? o : a.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = a.ok;
|
|
1463
|
-
}
|
|
1464
|
-
return e.prototype.isDark = function() {
|
|
1465
|
-
return this.getBrightness() < 128;
|
|
1466
|
-
}, e.prototype.isLight = function() {
|
|
1467
|
-
return !this.isDark();
|
|
1468
|
-
}, e.prototype.getBrightness = function() {
|
|
1469
|
-
var t = this.toRgb();
|
|
1470
|
-
return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3;
|
|
1471
|
-
}, e.prototype.getLuminance = function() {
|
|
1472
|
-
var t = this.toRgb(), n, o, a, s = t.r / 255, r = t.g / 255, i = t.b / 255;
|
|
1473
|
-
return s <= 0.03928 ? n = s / 12.92 : n = Math.pow((s + 0.055) / 1.055, 2.4), r <= 0.03928 ? o = r / 12.92 : o = Math.pow((r + 0.055) / 1.055, 2.4), i <= 0.03928 ? a = i / 12.92 : a = Math.pow((i + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * o + 0.0722 * a;
|
|
1474
|
-
}, e.prototype.getAlpha = function() {
|
|
1475
|
-
return this.a;
|
|
1476
|
-
}, e.prototype.setAlpha = function(t) {
|
|
1477
|
-
return this.a = Vn(t), this.roundA = Math.round(100 * this.a) / 100, this;
|
|
1478
|
-
}, e.prototype.isMonochrome = function() {
|
|
1479
|
-
var t = this.toHsl().s;
|
|
1480
|
-
return t === 0;
|
|
1481
|
-
}, e.prototype.toHsv = function() {
|
|
1482
|
-
var t = mn(this.r, this.g, this.b);
|
|
1483
|
-
return { h: t.h * 360, s: t.s, v: t.v, a: this.a };
|
|
1484
|
-
}, e.prototype.toHsvString = function() {
|
|
1485
|
-
var t = mn(this.r, this.g, this.b), n = Math.round(t.h * 360), o = Math.round(t.s * 100), a = Math.round(t.v * 100);
|
|
1486
|
-
return this.a === 1 ? "hsv(".concat(n, ", ").concat(o, "%, ").concat(a, "%)") : "hsva(".concat(n, ", ").concat(o, "%, ").concat(a, "%, ").concat(this.roundA, ")");
|
|
1487
|
-
}, e.prototype.toHsl = function() {
|
|
1488
|
-
var t = gn(this.r, this.g, this.b);
|
|
1489
|
-
return { h: t.h * 360, s: t.s, l: t.l, a: this.a };
|
|
1490
|
-
}, e.prototype.toHslString = function() {
|
|
1491
|
-
var t = gn(this.r, this.g, this.b), n = Math.round(t.h * 360), o = Math.round(t.s * 100), a = Math.round(t.l * 100);
|
|
1492
|
-
return this.a === 1 ? "hsl(".concat(n, ", ").concat(o, "%, ").concat(a, "%)") : "hsla(".concat(n, ", ").concat(o, "%, ").concat(a, "%, ").concat(this.roundA, ")");
|
|
1493
|
-
}, e.prototype.toHex = function(t) {
|
|
1494
|
-
return t === void 0 && (t = !1), bn(this.r, this.g, this.b, t);
|
|
1495
|
-
}, e.prototype.toHexString = function(t) {
|
|
1496
|
-
return t === void 0 && (t = !1), "#" + this.toHex(t);
|
|
1497
|
-
}, e.prototype.toHex8 = function(t) {
|
|
1498
|
-
return t === void 0 && (t = !1), rs(this.r, this.g, this.b, this.a, t);
|
|
1499
|
-
}, e.prototype.toHex8String = function(t) {
|
|
1500
|
-
return t === void 0 && (t = !1), "#" + this.toHex8(t);
|
|
1501
|
-
}, e.prototype.toHexShortString = function(t) {
|
|
1502
|
-
return t === void 0 && (t = !1), this.a === 1 ? this.toHexString(t) : this.toHex8String(t);
|
|
1503
|
-
}, e.prototype.toRgb = function() {
|
|
1504
|
-
return {
|
|
1505
|
-
r: Math.round(this.r),
|
|
1506
|
-
g: Math.round(this.g),
|
|
1507
|
-
b: Math.round(this.b),
|
|
1508
|
-
a: this.a
|
|
1509
|
-
};
|
|
1510
|
-
}, e.prototype.toRgbString = function() {
|
|
1511
|
-
var t = Math.round(this.r), n = Math.round(this.g), o = Math.round(this.b);
|
|
1512
|
-
return this.a === 1 ? "rgb(".concat(t, ", ").concat(n, ", ").concat(o, ")") : "rgba(".concat(t, ", ").concat(n, ", ").concat(o, ", ").concat(this.roundA, ")");
|
|
1513
|
-
}, e.prototype.toPercentageRgb = function() {
|
|
1514
|
-
var t = function(n) {
|
|
1515
|
-
return "".concat(Math.round(F(n, 255) * 100), "%");
|
|
1516
|
-
};
|
|
1517
|
-
return {
|
|
1518
|
-
r: t(this.r),
|
|
1519
|
-
g: t(this.g),
|
|
1520
|
-
b: t(this.b),
|
|
1521
|
-
a: this.a
|
|
1522
|
-
};
|
|
1523
|
-
}, e.prototype.toPercentageRgbString = function() {
|
|
1524
|
-
var t = function(n) {
|
|
1525
|
-
return Math.round(F(n, 255) * 100);
|
|
1526
|
-
};
|
|
1527
|
-
return this.a === 1 ? "rgb(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%)") : "rgba(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%, ").concat(this.roundA, ")");
|
|
1528
|
-
}, e.prototype.toName = function() {
|
|
1529
|
-
if (this.a === 0)
|
|
1530
|
-
return "transparent";
|
|
1531
|
-
if (this.a < 1)
|
|
1532
|
-
return !1;
|
|
1533
|
-
for (var t = "#" + bn(this.r, this.g, this.b, !1), n = 0, o = Object.entries(kt); n < o.length; n++) {
|
|
1534
|
-
var a = o[n], s = a[0], r = a[1];
|
|
1535
|
-
if (t === r)
|
|
1536
|
-
return s;
|
|
1537
|
-
}
|
|
1538
|
-
return !1;
|
|
1539
|
-
}, e.prototype.toString = function(t) {
|
|
1540
|
-
var n = !!t;
|
|
1541
|
-
t = t ?? this.format;
|
|
1542
|
-
var o = !1, a = this.a < 1 && this.a >= 0, s = !n && a && (t.startsWith("hex") || t === "name");
|
|
1543
|
-
return s ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (o = this.toRgbString()), t === "prgb" && (o = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (o = this.toHexString()), t === "hex3" && (o = this.toHexString(!0)), t === "hex4" && (o = this.toHex8String(!0)), t === "hex8" && (o = this.toHex8String()), t === "name" && (o = this.toName()), t === "hsl" && (o = this.toHslString()), t === "hsv" && (o = this.toHsvString()), o || this.toHexString());
|
|
1544
|
-
}, e.prototype.toNumber = function() {
|
|
1545
|
-
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
|
|
1546
|
-
}, e.prototype.clone = function() {
|
|
1547
|
-
return new e(this.toString());
|
|
1548
|
-
}, e.prototype.lighten = function(t) {
|
|
1549
|
-
t === void 0 && (t = 10);
|
|
1550
|
-
var n = this.toHsl();
|
|
1551
|
-
return n.l += t / 100, n.l = Ye(n.l), new e(n);
|
|
1552
|
-
}, e.prototype.brighten = function(t) {
|
|
1553
|
-
t === void 0 && (t = 10);
|
|
1554
|
-
var n = this.toRgb();
|
|
1555
|
-
return n.r = Math.max(0, Math.min(255, n.r - Math.round(255 * -(t / 100)))), n.g = Math.max(0, Math.min(255, n.g - Math.round(255 * -(t / 100)))), n.b = Math.max(0, Math.min(255, n.b - Math.round(255 * -(t / 100)))), new e(n);
|
|
1556
|
-
}, e.prototype.darken = function(t) {
|
|
1557
|
-
t === void 0 && (t = 10);
|
|
1558
|
-
var n = this.toHsl();
|
|
1559
|
-
return n.l -= t / 100, n.l = Ye(n.l), new e(n);
|
|
1560
|
-
}, e.prototype.tint = function(t) {
|
|
1561
|
-
return t === void 0 && (t = 10), this.mix("white", t);
|
|
1562
|
-
}, e.prototype.shade = function(t) {
|
|
1563
|
-
return t === void 0 && (t = 10), this.mix("black", t);
|
|
1564
|
-
}, e.prototype.desaturate = function(t) {
|
|
1565
|
-
t === void 0 && (t = 10);
|
|
1566
|
-
var n = this.toHsl();
|
|
1567
|
-
return n.s -= t / 100, n.s = Ye(n.s), new e(n);
|
|
1568
|
-
}, e.prototype.saturate = function(t) {
|
|
1569
|
-
t === void 0 && (t = 10);
|
|
1570
|
-
var n = this.toHsl();
|
|
1571
|
-
return n.s += t / 100, n.s = Ye(n.s), new e(n);
|
|
1572
|
-
}, e.prototype.greyscale = function() {
|
|
1573
|
-
return this.desaturate(100);
|
|
1574
|
-
}, e.prototype.spin = function(t) {
|
|
1575
|
-
var n = this.toHsl(), o = (n.h + t) % 360;
|
|
1576
|
-
return n.h = o < 0 ? 360 + o : o, new e(n);
|
|
1577
|
-
}, e.prototype.mix = function(t, n) {
|
|
1578
|
-
n === void 0 && (n = 50);
|
|
1579
|
-
var o = this.toRgb(), a = new e(t).toRgb(), s = n / 100, r = {
|
|
1580
|
-
r: (a.r - o.r) * s + o.r,
|
|
1581
|
-
g: (a.g - o.g) * s + o.g,
|
|
1582
|
-
b: (a.b - o.b) * s + o.b,
|
|
1583
|
-
a: (a.a - o.a) * s + o.a
|
|
1584
|
-
};
|
|
1585
|
-
return new e(r);
|
|
1586
|
-
}, e.prototype.analogous = function(t, n) {
|
|
1587
|
-
t === void 0 && (t = 6), n === void 0 && (n = 30);
|
|
1588
|
-
var o = this.toHsl(), a = 360 / n, s = [this];
|
|
1589
|
-
for (o.h = (o.h - (a * t >> 1) + 720) % 360; --t; )
|
|
1590
|
-
o.h = (o.h + a) % 360, s.push(new e(o));
|
|
1591
|
-
return s;
|
|
1592
|
-
}, e.prototype.complement = function() {
|
|
1593
|
-
var t = this.toHsl();
|
|
1594
|
-
return t.h = (t.h + 180) % 360, new e(t);
|
|
1595
|
-
}, e.prototype.monochromatic = function(t) {
|
|
1596
|
-
t === void 0 && (t = 6);
|
|
1597
|
-
for (var n = this.toHsv(), o = n.h, a = n.s, s = n.v, r = [], i = 1 / t; t--; )
|
|
1598
|
-
r.push(new e({ h: o, s: a, v: s })), s = (s + i) % 1;
|
|
1599
|
-
return r;
|
|
1600
|
-
}, e.prototype.splitcomplement = function() {
|
|
1601
|
-
var t = this.toHsl(), n = t.h;
|
|
1602
|
-
return [
|
|
1603
|
-
this,
|
|
1604
|
-
new e({ h: (n + 72) % 360, s: t.s, l: t.l }),
|
|
1605
|
-
new e({ h: (n + 216) % 360, s: t.s, l: t.l })
|
|
1606
|
-
];
|
|
1607
|
-
}, e.prototype.onBackground = function(t) {
|
|
1608
|
-
var n = this.toRgb(), o = new e(t).toRgb(), a = n.a + o.a * (1 - n.a);
|
|
1609
|
-
return new e({
|
|
1610
|
-
r: (n.r * n.a + o.r * o.a * (1 - n.a)) / a,
|
|
1611
|
-
g: (n.g * n.a + o.g * o.a * (1 - n.a)) / a,
|
|
1612
|
-
b: (n.b * n.a + o.b * o.a * (1 - n.a)) / a,
|
|
1613
|
-
a
|
|
1614
|
-
});
|
|
1615
|
-
}, e.prototype.triad = function() {
|
|
1616
|
-
return this.polyad(3);
|
|
1617
|
-
}, e.prototype.tetrad = function() {
|
|
1618
|
-
return this.polyad(4);
|
|
1619
|
-
}, e.prototype.polyad = function(t) {
|
|
1620
|
-
for (var n = this.toHsl(), o = n.h, a = [this], s = 360 / t, r = 1; r < t; r++)
|
|
1621
|
-
a.push(new e({ h: (o + r * s) % 360, s: n.s, l: n.l }));
|
|
1622
|
-
return a;
|
|
1623
|
-
}, e.prototype.equals = function(t) {
|
|
1624
|
-
return this.toRgbString() === new e(t).toRgbString();
|
|
1625
|
-
}, e;
|
|
1626
|
-
}()
|
|
1627
|
-
);
|
|
1628
|
-
function oe(e, t = 20) {
|
|
1629
|
-
return e.mix("#141414", t).toString();
|
|
1630
|
-
}
|
|
1631
|
-
function ps(e) {
|
|
1632
|
-
const t = Bt(), n = ge("button");
|
|
1633
|
-
return b(() => {
|
|
1634
|
-
let o = {}, a = e.color;
|
|
1635
|
-
if (a) {
|
|
1636
|
-
const s = a.match(/var\((.*?)\)/);
|
|
1637
|
-
s && (a = window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));
|
|
1638
|
-
const r = new vs(a), i = e.dark ? r.tint(20).toString() : oe(r, 20);
|
|
1639
|
-
if (e.plain)
|
|
1640
|
-
o = n.cssVarBlock({
|
|
1641
|
-
"bg-color": e.dark ? oe(r, 90) : r.tint(90).toString(),
|
|
1642
|
-
"text-color": a,
|
|
1643
|
-
"border-color": e.dark ? oe(r, 50) : r.tint(50).toString(),
|
|
1644
|
-
"hover-text-color": `var(${n.cssVarName("color-white")})`,
|
|
1645
|
-
"hover-bg-color": a,
|
|
1646
|
-
"hover-border-color": a,
|
|
1647
|
-
"active-bg-color": i,
|
|
1648
|
-
"active-text-color": `var(${n.cssVarName("color-white")})`,
|
|
1649
|
-
"active-border-color": i
|
|
1650
|
-
}), t.value && (o[n.cssVarBlockName("disabled-bg-color")] = e.dark ? oe(r, 90) : r.tint(90).toString(), o[n.cssVarBlockName("disabled-text-color")] = e.dark ? oe(r, 50) : r.tint(50).toString(), o[n.cssVarBlockName("disabled-border-color")] = e.dark ? oe(r, 80) : r.tint(80).toString());
|
|
1651
|
-
else {
|
|
1652
|
-
const c = e.dark ? oe(r, 30) : r.tint(30).toString(), u = r.isDark() ? `var(${n.cssVarName("color-white")})` : `var(${n.cssVarName("color-black")})`;
|
|
1653
|
-
if (o = n.cssVarBlock({
|
|
1654
|
-
"bg-color": a,
|
|
1655
|
-
"text-color": u,
|
|
1656
|
-
"border-color": a,
|
|
1657
|
-
"hover-bg-color": c,
|
|
1658
|
-
"hover-text-color": u,
|
|
1659
|
-
"hover-border-color": c,
|
|
1660
|
-
"active-bg-color": i,
|
|
1661
|
-
"active-border-color": i
|
|
1662
|
-
}), t.value) {
|
|
1663
|
-
const v = e.dark ? oe(r, 50) : r.tint(50).toString();
|
|
1664
|
-
o[n.cssVarBlockName("disabled-bg-color")] = v, o[n.cssVarBlockName("disabled-text-color")] = e.dark ? "rgba(255, 255, 255, 0.5)" : `var(${n.cssVarName("color-white")})`, o[n.cssVarBlockName("disabled-border-color")] = v;
|
|
1665
|
-
}
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
|
-
return o;
|
|
1669
|
-
});
|
|
1670
|
-
}
|
|
1671
|
-
const hs = Q({
|
|
1672
|
-
name: "ElButton"
|
|
1673
|
-
}), gs = /* @__PURE__ */ Q({
|
|
1674
|
-
...hs,
|
|
1675
|
-
props: St,
|
|
1676
|
-
emits: es,
|
|
1677
|
-
setup(e, { expose: t, emit: n }) {
|
|
1678
|
-
const o = e, a = ps(o), s = ge("button"), { _ref: r, _size: i, _type: c, _disabled: u, _props: v, shouldAddSpace: p, handleClick: C } = Ja(o, n), g = b(() => [
|
|
1679
|
-
s.b(),
|
|
1680
|
-
s.m(c.value),
|
|
1681
|
-
s.m(i.value),
|
|
1682
|
-
s.is("disabled", u.value),
|
|
1683
|
-
s.is("loading", o.loading),
|
|
1684
|
-
s.is("plain", o.plain),
|
|
1685
|
-
s.is("round", o.round),
|
|
1686
|
-
s.is("circle", o.circle),
|
|
1687
|
-
s.is("text", o.text),
|
|
1688
|
-
s.is("link", o.link),
|
|
1689
|
-
s.is("has-bg", o.bg)
|
|
1690
|
-
]);
|
|
1691
|
-
return t({
|
|
1692
|
-
ref: r,
|
|
1693
|
-
size: i,
|
|
1694
|
-
type: c,
|
|
1695
|
-
disabled: u,
|
|
1696
|
-
shouldAddSpace: p
|
|
1697
|
-
}), (l, h) => (m(), x(W(l.tag), gt({
|
|
1698
|
-
ref_key: "_ref",
|
|
1699
|
-
ref: r
|
|
1700
|
-
}, d(v), {
|
|
1701
|
-
class: d(g),
|
|
1702
|
-
style: d(a),
|
|
1703
|
-
onClick: d(C)
|
|
1704
|
-
}), {
|
|
1705
|
-
default: A(() => [
|
|
1706
|
-
l.loading ? (m(), L(xe, { key: 0 }, [
|
|
1707
|
-
l.$slots.loading ? Y(l.$slots, "loading", { key: 0 }) : (m(), x(d(ie), {
|
|
1708
|
-
key: 1,
|
|
1709
|
-
class: E(d(s).is("loading"))
|
|
1710
|
-
}, {
|
|
1711
|
-
default: A(() => [
|
|
1712
|
-
(m(), x(W(l.loadingIcon)))
|
|
1713
|
-
]),
|
|
1714
|
-
_: 1
|
|
1715
|
-
}, 8, ["class"]))
|
|
1716
|
-
], 64)) : l.icon || l.$slots.icon ? (m(), x(d(ie), { key: 1 }, {
|
|
1717
|
-
default: A(() => [
|
|
1718
|
-
l.icon ? (m(), x(W(l.icon), { key: 0 })) : Y(l.$slots, "icon", { key: 1 })
|
|
1719
|
-
]),
|
|
1720
|
-
_: 3
|
|
1721
|
-
})) : I("v-if", !0),
|
|
1722
|
-
l.$slots.default ? (m(), L("span", {
|
|
1723
|
-
key: 2,
|
|
1724
|
-
class: E({ [d(s).em("text", "expand")]: d(p) })
|
|
1725
|
-
}, [
|
|
1726
|
-
Y(l.$slots, "default")
|
|
1727
|
-
], 2)) : I("v-if", !0)
|
|
1728
|
-
]),
|
|
1729
|
-
_: 3
|
|
1730
|
-
}, 16, ["class", "style", "onClick"]));
|
|
1731
|
-
}
|
|
1732
|
-
});
|
|
1733
|
-
var ms = /* @__PURE__ */ Pe(gs, [["__file", "button.vue"]]);
|
|
1734
|
-
const bs = {
|
|
1735
|
-
size: St.size,
|
|
1736
|
-
type: St.type
|
|
1737
|
-
}, ys = Q({
|
|
1738
|
-
name: "ElButtonGroup"
|
|
1739
|
-
}), Es = /* @__PURE__ */ Q({
|
|
1740
|
-
...ys,
|
|
1741
|
-
props: bs,
|
|
1742
|
-
setup(e) {
|
|
1743
|
-
const t = e;
|
|
1744
|
-
kn(zn, De({
|
|
1745
|
-
size: Qe(t, "size"),
|
|
1746
|
-
type: Qe(t, "type")
|
|
1747
|
-
}));
|
|
1748
|
-
const n = ge("button");
|
|
1749
|
-
return (o, a) => (m(), L("div", {
|
|
1750
|
-
class: E(d(n).b("group"))
|
|
1751
|
-
}, [
|
|
1752
|
-
Y(o.$slots, "default")
|
|
1753
|
-
], 2));
|
|
1754
|
-
}
|
|
1755
|
-
});
|
|
1756
|
-
var Kn = /* @__PURE__ */ Pe(Es, [["__file", "button-group.vue"]]);
|
|
1757
|
-
const ws = Ln(ms, {
|
|
1758
|
-
ButtonGroup: Kn
|
|
1759
|
-
});
|
|
1760
|
-
No(Kn);
|
|
1761
|
-
var Je = /* @__PURE__ */ ((e) => (e[e.TEXT = 1] = "TEXT", e[e.CLASS = 2] = "CLASS", e[e.STYLE = 4] = "STYLE", e[e.PROPS = 8] = "PROPS", e[e.FULL_PROPS = 16] = "FULL_PROPS", e[e.HYDRATE_EVENTS = 32] = "HYDRATE_EVENTS", e[e.STABLE_FRAGMENT = 64] = "STABLE_FRAGMENT", e[e.KEYED_FRAGMENT = 128] = "KEYED_FRAGMENT", e[e.UNKEYED_FRAGMENT = 256] = "UNKEYED_FRAGMENT", e[e.NEED_PATCH = 512] = "NEED_PATCH", e[e.DYNAMIC_SLOTS = 1024] = "DYNAMIC_SLOTS", e[e.HOISTED = -1] = "HOISTED", e[e.BAIL = -2] = "BAIL", e))(Je || {});
|
|
1762
|
-
const Un = (e) => {
|
|
1763
|
-
if (!e)
|
|
1764
|
-
return { onClick: Xe, onMousedown: Xe, onMouseup: Xe };
|
|
1765
|
-
let t = !1, n = !1;
|
|
1766
|
-
return { onClick: (r) => {
|
|
1767
|
-
t && n && e(r), t = n = !1;
|
|
1768
|
-
}, onMousedown: (r) => {
|
|
1769
|
-
t = r.target === r.currentTarget;
|
|
1770
|
-
}, onMouseup: (r) => {
|
|
1771
|
-
n = r.target === r.currentTarget;
|
|
1772
|
-
} };
|
|
1773
|
-
}, Cs = at({
|
|
1774
|
-
mask: {
|
|
1775
|
-
type: Boolean,
|
|
1776
|
-
default: !0
|
|
1777
|
-
},
|
|
1778
|
-
customMaskEvent: Boolean,
|
|
1779
|
-
overlayClass: {
|
|
1780
|
-
type: Ce([
|
|
1781
|
-
String,
|
|
1782
|
-
Array,
|
|
1783
|
-
Object
|
|
1784
|
-
])
|
|
1785
|
-
},
|
|
1786
|
-
zIndex: {
|
|
1787
|
-
type: Ce([String, Number])
|
|
1788
|
-
}
|
|
1789
|
-
}), Ss = {
|
|
1790
|
-
click: (e) => e instanceof MouseEvent
|
|
1791
|
-
}, ks = "overlay";
|
|
1792
|
-
var Ts = Q({
|
|
1793
|
-
name: "ElOverlay",
|
|
1794
|
-
props: Cs,
|
|
1795
|
-
emits: Ss,
|
|
1796
|
-
setup(e, { slots: t, emit: n }) {
|
|
1797
|
-
const o = ge(ks), a = (c) => {
|
|
1798
|
-
n("click", c);
|
|
1799
|
-
}, { onClick: s, onMousedown: r, onMouseup: i } = Un(e.customMaskEvent ? void 0 : a);
|
|
1800
|
-
return () => e.mask ? $("div", {
|
|
1801
|
-
class: [o.b(), e.overlayClass],
|
|
1802
|
-
style: {
|
|
1803
|
-
zIndex: e.zIndex
|
|
1804
|
-
},
|
|
1805
|
-
onClick: s,
|
|
1806
|
-
onMousedown: r,
|
|
1807
|
-
onMouseup: i
|
|
1808
|
-
}, [Y(t, "default")], Je.STYLE | Je.CLASS | Je.PROPS, ["onClick", "onMouseup", "onMousedown"]) : ao("div", {
|
|
1809
|
-
class: e.overlayClass,
|
|
1810
|
-
style: {
|
|
1811
|
-
zIndex: e.zIndex,
|
|
1812
|
-
position: "fixed",
|
|
1813
|
-
top: "0px",
|
|
1814
|
-
right: "0px",
|
|
1815
|
-
bottom: "0px",
|
|
1816
|
-
left: "0px"
|
|
1817
|
-
}
|
|
1818
|
-
}, [Y(t, "default")]);
|
|
1819
|
-
}
|
|
1820
|
-
});
|
|
1821
|
-
const Is = Ts, Ms = (e, t, n, o) => {
|
|
1822
|
-
const a = {
|
|
1823
|
-
offsetX: 0,
|
|
1824
|
-
offsetY: 0
|
|
1825
|
-
}, s = (p, C) => {
|
|
1826
|
-
if (e.value) {
|
|
1827
|
-
const { offsetX: g, offsetY: l } = a, h = e.value.getBoundingClientRect(), w = h.left, y = h.top, M = h.width, P = h.height, G = document.documentElement.clientWidth, q = document.documentElement.clientHeight, U = -w + g, _ = -y + l, z = G - w - M + g, Z = q - y - P + l;
|
|
1828
|
-
o != null && o.value || (p = Math.min(Math.max(p, U), z), C = Math.min(Math.max(C, _), Z)), a.offsetX = p, a.offsetY = C, e.value.style.transform = `translate(${Jt(p)}, ${Jt(C)})`;
|
|
1829
|
-
}
|
|
1830
|
-
}, r = (p) => {
|
|
1831
|
-
const C = p.clientX, g = p.clientY, { offsetX: l, offsetY: h } = a, w = (M) => {
|
|
1832
|
-
const P = l + M.clientX - C, G = h + M.clientY - g;
|
|
1833
|
-
s(P, G);
|
|
1834
|
-
}, y = () => {
|
|
1835
|
-
document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", y);
|
|
1836
|
-
};
|
|
1837
|
-
document.addEventListener("mousemove", w), document.addEventListener("mouseup", y);
|
|
1838
|
-
}, i = () => {
|
|
1839
|
-
t.value && e.value && (t.value.addEventListener("mousedown", r), window.addEventListener("resize", v));
|
|
1840
|
-
}, c = () => {
|
|
1841
|
-
t.value && e.value && (t.value.removeEventListener("mousedown", r), window.removeEventListener("resize", v));
|
|
1842
|
-
}, u = () => {
|
|
1843
|
-
a.offsetX = 0, a.offsetY = 0, e.value && (e.value.style.transform = "");
|
|
1844
|
-
}, v = () => {
|
|
1845
|
-
const { offsetX: p, offsetY: C } = a;
|
|
1846
|
-
s(p, C);
|
|
1847
|
-
};
|
|
1848
|
-
return te(() => {
|
|
1849
|
-
so(() => {
|
|
1850
|
-
n.value ? i() : c();
|
|
1851
|
-
});
|
|
1852
|
-
}), Oe(() => {
|
|
1853
|
-
c();
|
|
1854
|
-
}), {
|
|
1855
|
-
resetPosition: u,
|
|
1856
|
-
updatePosition: v
|
|
1857
|
-
};
|
|
1858
|
-
}, xs = (e, t = {}) => {
|
|
1859
|
-
ro(e) || Lo("[useLockscreen]", "You need to pass a ref param to this function");
|
|
1860
|
-
const n = t.ns || ge("popup"), o = b(() => n.bm("parent", "hidden"));
|
|
1861
|
-
if (!ue || Qt(document.body, o.value))
|
|
1862
|
-
return;
|
|
1863
|
-
let a = 0, s = !1, r = "0";
|
|
1864
|
-
const i = () => {
|
|
1865
|
-
setTimeout(() => {
|
|
1866
|
-
typeof document > "u" || s && document && (document.body.style.width = r, Do(document.body, o.value));
|
|
1867
|
-
}, 200);
|
|
1868
|
-
};
|
|
1869
|
-
K(e, (c) => {
|
|
1870
|
-
if (!c) {
|
|
1871
|
-
i();
|
|
1872
|
-
return;
|
|
1873
|
-
}
|
|
1874
|
-
s = !Qt(document.body, o.value), s && (r = document.body.style.width, Fo(document.body, o.value)), a = da(n.namespace.value);
|
|
1875
|
-
const u = document.documentElement.clientHeight < document.body.scrollHeight, v = Oo(document.body, "overflowY");
|
|
1876
|
-
a > 0 && (u || v === "scroll") && s && (document.body.style.width = `calc(100% - ${a}px)`);
|
|
1877
|
-
}), io(() => i());
|
|
1878
|
-
}, As = (e) => ["", ...Po].includes(e), Tt = "_trap-focus-children", fe = [], En = (e) => {
|
|
1879
|
-
var t;
|
|
1880
|
-
if (fe.length === 0)
|
|
1881
|
-
return;
|
|
1882
|
-
const n = fe[fe.length - 1][Tt];
|
|
1883
|
-
if (n.length > 0 && e.code === Mt.tab) {
|
|
1884
|
-
if (n.length === 1) {
|
|
1885
|
-
e.preventDefault(), document.activeElement !== n[0] && n[0].focus();
|
|
1886
|
-
return;
|
|
1887
|
-
}
|
|
1888
|
-
const o = e.shiftKey, a = e.target === n[0], s = e.target === n[n.length - 1];
|
|
1889
|
-
if (a && o && (e.preventDefault(), n[n.length - 1].focus()), s && !o && (e.preventDefault(), n[0].focus()), process.env.NODE_ENV === "test") {
|
|
1890
|
-
const r = n.indexOf(e.target);
|
|
1891
|
-
r !== -1 && ((t = n[o ? r - 1 : r + 1]) == null || t.focus());
|
|
1892
|
-
}
|
|
1893
|
-
}
|
|
1894
|
-
}, Bs = {
|
|
1895
|
-
beforeMount(e) {
|
|
1896
|
-
e[Tt] = rn(e), fe.push(e), fe.length <= 1 && document.addEventListener("keydown", En);
|
|
1897
|
-
},
|
|
1898
|
-
updated(e) {
|
|
1899
|
-
D(() => {
|
|
1900
|
-
e[Tt] = rn(e);
|
|
1901
|
-
});
|
|
1902
|
-
},
|
|
1903
|
-
unmounted() {
|
|
1904
|
-
fe.shift(), fe.length === 0 && document.removeEventListener("keydown", En);
|
|
1905
|
-
}
|
|
1906
|
-
}, Rs = Q({
|
|
1907
|
-
name: "ElMessageBox",
|
|
1908
|
-
directives: {
|
|
1909
|
-
TrapFocus: Bs
|
|
1910
|
-
},
|
|
1911
|
-
components: {
|
|
1912
|
-
ElButton: ws,
|
|
1913
|
-
ElFocusTrap: ja,
|
|
1914
|
-
ElInput: La,
|
|
1915
|
-
ElOverlay: Is,
|
|
1916
|
-
ElIcon: ie,
|
|
1917
|
-
..._o
|
|
1918
|
-
},
|
|
1919
|
-
inheritAttrs: !1,
|
|
1920
|
-
props: {
|
|
1921
|
-
buttonSize: {
|
|
1922
|
-
type: String,
|
|
1923
|
-
validator: As
|
|
1924
|
-
},
|
|
1925
|
-
modal: {
|
|
1926
|
-
type: Boolean,
|
|
1927
|
-
default: !0
|
|
1928
|
-
},
|
|
1929
|
-
lockScroll: {
|
|
1930
|
-
type: Boolean,
|
|
1931
|
-
default: !0
|
|
1932
|
-
},
|
|
1933
|
-
showClose: {
|
|
1934
|
-
type: Boolean,
|
|
1935
|
-
default: !0
|
|
1936
|
-
},
|
|
1937
|
-
closeOnClickModal: {
|
|
1938
|
-
type: Boolean,
|
|
1939
|
-
default: !0
|
|
1940
|
-
},
|
|
1941
|
-
closeOnPressEscape: {
|
|
1942
|
-
type: Boolean,
|
|
1943
|
-
default: !0
|
|
1944
|
-
},
|
|
1945
|
-
closeOnHashChange: {
|
|
1946
|
-
type: Boolean,
|
|
1947
|
-
default: !0
|
|
1948
|
-
},
|
|
1949
|
-
center: Boolean,
|
|
1950
|
-
draggable: Boolean,
|
|
1951
|
-
overflow: Boolean,
|
|
1952
|
-
roundButton: {
|
|
1953
|
-
default: !1,
|
|
1954
|
-
type: Boolean
|
|
1955
|
-
},
|
|
1956
|
-
container: {
|
|
1957
|
-
type: String,
|
|
1958
|
-
default: "body"
|
|
1959
|
-
},
|
|
1960
|
-
boxType: {
|
|
1961
|
-
type: String,
|
|
1962
|
-
default: ""
|
|
1963
|
-
}
|
|
1964
|
-
},
|
|
1965
|
-
emits: ["vanish", "action"],
|
|
1966
|
-
setup(e, { emit: t }) {
|
|
1967
|
-
const {
|
|
1968
|
-
locale: n,
|
|
1969
|
-
zIndex: o,
|
|
1970
|
-
ns: a,
|
|
1971
|
-
size: s
|
|
1972
|
-
} = Ho("message-box", b(() => e.buttonSize)), { t: r } = n, { nextZIndex: i } = o, c = S(!1), u = De({
|
|
1973
|
-
autofocus: !0,
|
|
1974
|
-
beforeClose: null,
|
|
1975
|
-
callback: null,
|
|
1976
|
-
cancelButtonText: "",
|
|
1977
|
-
cancelButtonClass: "",
|
|
1978
|
-
confirmButtonText: "",
|
|
1979
|
-
confirmButtonClass: "",
|
|
1980
|
-
customClass: "",
|
|
1981
|
-
customStyle: {},
|
|
1982
|
-
dangerouslyUseHTMLString: !1,
|
|
1983
|
-
distinguishCancelAndClose: !1,
|
|
1984
|
-
icon: "",
|
|
1985
|
-
closeIcon: "",
|
|
1986
|
-
inputPattern: null,
|
|
1987
|
-
inputPlaceholder: "",
|
|
1988
|
-
inputType: "text",
|
|
1989
|
-
inputValue: "",
|
|
1990
|
-
inputValidator: void 0,
|
|
1991
|
-
inputErrorMessage: "",
|
|
1992
|
-
message: "",
|
|
1993
|
-
modalFade: !0,
|
|
1994
|
-
modalClass: "",
|
|
1995
|
-
showCancelButton: !1,
|
|
1996
|
-
showConfirmButton: !0,
|
|
1997
|
-
type: "",
|
|
1998
|
-
title: void 0,
|
|
1999
|
-
showInput: !1,
|
|
2000
|
-
action: "",
|
|
2001
|
-
confirmButtonLoading: !1,
|
|
2002
|
-
cancelButtonLoading: !1,
|
|
2003
|
-
confirmButtonLoadingIcon: mt(yt),
|
|
2004
|
-
cancelButtonLoadingIcon: mt(yt),
|
|
2005
|
-
confirmButtonDisabled: !1,
|
|
2006
|
-
editorErrorMessage: "",
|
|
2007
|
-
validateError: !1,
|
|
2008
|
-
zIndex: i()
|
|
2009
|
-
}), v = b(() => {
|
|
2010
|
-
const T = u.type;
|
|
2011
|
-
return { [a.bm("icon", T)]: T && Zt[T] };
|
|
2012
|
-
}), p = Ct(), C = Ct(), g = b(() => {
|
|
2013
|
-
const T = u.type;
|
|
2014
|
-
return u.icon || T && Zt[T] || "";
|
|
2015
|
-
}), l = b(() => !!u.message), h = S(), w = S(), y = S(), M = S(), P = S(), G = b(() => u.confirmButtonClass);
|
|
2016
|
-
K(() => u.inputValue, async (T) => {
|
|
2017
|
-
await D(), e.boxType === "prompt" && T && N();
|
|
2018
|
-
}, { immediate: !0 }), K(() => c.value, (T) => {
|
|
2019
|
-
var B, O;
|
|
2020
|
-
T && (e.boxType !== "prompt" && (u.autofocus ? y.value = (O = (B = P.value) == null ? void 0 : B.$el) != null ? O : h.value : y.value = h.value), u.zIndex = i()), e.boxType === "prompt" && (T ? D().then(() => {
|
|
2021
|
-
var me;
|
|
2022
|
-
M.value && M.value.$el && (u.autofocus ? y.value = (me = _e()) != null ? me : h.value : y.value = h.value);
|
|
2023
|
-
}) : (u.editorErrorMessage = "", u.validateError = !1));
|
|
2024
|
-
});
|
|
2025
|
-
const q = b(() => e.draggable), U = b(() => e.overflow);
|
|
2026
|
-
Ms(h, w, q, U), te(async () => {
|
|
2027
|
-
await D(), e.closeOnHashChange && window.addEventListener("hashchange", _);
|
|
2028
|
-
}), Oe(() => {
|
|
2029
|
-
e.closeOnHashChange && window.removeEventListener("hashchange", _);
|
|
2030
|
-
});
|
|
2031
|
-
function _() {
|
|
2032
|
-
c.value && (c.value = !1, D(() => {
|
|
2033
|
-
u.action && t("action", u.action);
|
|
2034
|
-
}));
|
|
2035
|
-
}
|
|
2036
|
-
const z = () => {
|
|
2037
|
-
e.closeOnClickModal && ne(u.distinguishCancelAndClose ? "close" : "cancel");
|
|
2038
|
-
}, Z = Un(z), ce = (T) => {
|
|
2039
|
-
if (u.inputType !== "textarea")
|
|
2040
|
-
return T.preventDefault(), ne("confirm");
|
|
2041
|
-
}, ne = (T) => {
|
|
2042
|
-
var B;
|
|
2043
|
-
e.boxType === "prompt" && T === "confirm" && !N() || (u.action = T, u.beforeClose ? (B = u.beforeClose) == null || B.call(u, T, u, _) : _());
|
|
2044
|
-
}, N = () => {
|
|
2045
|
-
if (e.boxType === "prompt") {
|
|
2046
|
-
const T = u.inputPattern;
|
|
2047
|
-
if (T && !T.test(u.inputValue || ""))
|
|
2048
|
-
return u.editorErrorMessage = u.inputErrorMessage || r("el.messagebox.error"), u.validateError = !0, !1;
|
|
2049
|
-
const B = u.inputValidator;
|
|
2050
|
-
if (Ne(B)) {
|
|
2051
|
-
const O = B(u.inputValue);
|
|
2052
|
-
if (O === !1)
|
|
2053
|
-
return u.editorErrorMessage = u.inputErrorMessage || r("el.messagebox.error"), u.validateError = !0, !1;
|
|
2054
|
-
if (ve(O))
|
|
2055
|
-
return u.editorErrorMessage = O, u.validateError = !0, !1;
|
|
2056
|
-
}
|
|
2057
|
-
}
|
|
2058
|
-
return u.editorErrorMessage = "", u.validateError = !1, !0;
|
|
2059
|
-
}, _e = () => {
|
|
2060
|
-
var T, B;
|
|
2061
|
-
const O = (T = M.value) == null ? void 0 : T.$refs;
|
|
2062
|
-
return (B = O == null ? void 0 : O.input) != null ? B : O == null ? void 0 : O.textarea;
|
|
2063
|
-
}, He = () => {
|
|
2064
|
-
ne("close");
|
|
2065
|
-
}, rt = () => {
|
|
2066
|
-
e.closeOnPressEscape && He();
|
|
2067
|
-
};
|
|
2068
|
-
return e.lockScroll && xs(c), {
|
|
2069
|
-
...uo(u),
|
|
2070
|
-
ns: a,
|
|
2071
|
-
overlayEvent: Z,
|
|
2072
|
-
visible: c,
|
|
2073
|
-
hasMessage: l,
|
|
2074
|
-
typeClass: v,
|
|
2075
|
-
contentId: p,
|
|
2076
|
-
inputId: C,
|
|
2077
|
-
btnSize: s,
|
|
2078
|
-
iconComponent: g,
|
|
2079
|
-
confirmButtonClasses: G,
|
|
2080
|
-
rootRef: h,
|
|
2081
|
-
focusStartRef: y,
|
|
2082
|
-
headerRef: w,
|
|
2083
|
-
inputRef: M,
|
|
2084
|
-
confirmRef: P,
|
|
2085
|
-
doClose: _,
|
|
2086
|
-
handleClose: He,
|
|
2087
|
-
onCloseRequested: rt,
|
|
2088
|
-
handleWrapperClick: z,
|
|
2089
|
-
handleInputEnter: ce,
|
|
2090
|
-
handleAction: ne,
|
|
2091
|
-
t: r
|
|
2092
|
-
};
|
|
2093
|
-
}
|
|
2094
|
-
});
|
|
2095
|
-
function Ns(e, t, n, o, a, s) {
|
|
2096
|
-
const r = re("el-icon"), i = re("el-input"), c = re("el-button"), u = re("el-focus-trap"), v = re("el-overlay");
|
|
2097
|
-
return m(), x(lo, {
|
|
2098
|
-
name: "fade-in-linear",
|
|
2099
|
-
onAfterLeave: (p) => e.$emit("vanish"),
|
|
2100
|
-
persisted: ""
|
|
2101
|
-
}, {
|
|
2102
|
-
default: A(() => [
|
|
2103
|
-
ut($(v, {
|
|
2104
|
-
"z-index": e.zIndex,
|
|
2105
|
-
"overlay-class": [e.ns.is("message-box"), e.modalClass],
|
|
2106
|
-
mask: e.modal
|
|
2107
|
-
}, {
|
|
2108
|
-
default: A(() => [
|
|
2109
|
-
R("div", {
|
|
2110
|
-
role: "dialog",
|
|
2111
|
-
"aria-label": e.title,
|
|
2112
|
-
"aria-modal": "true",
|
|
2113
|
-
"aria-describedby": e.showInput ? void 0 : e.contentId,
|
|
2114
|
-
class: E(`${e.ns.namespace.value}-overlay-message-box`),
|
|
2115
|
-
onClick: e.overlayEvent.onClick,
|
|
2116
|
-
onMousedown: e.overlayEvent.onMousedown,
|
|
2117
|
-
onMouseup: e.overlayEvent.onMouseup
|
|
2118
|
-
}, [
|
|
2119
|
-
$(u, {
|
|
2120
|
-
loop: "",
|
|
2121
|
-
trapped: e.visible,
|
|
2122
|
-
"focus-trap-el": e.rootRef,
|
|
2123
|
-
"focus-start-el": e.focusStartRef,
|
|
2124
|
-
onReleaseRequested: e.onCloseRequested
|
|
2125
|
-
}, {
|
|
2126
|
-
default: A(() => [
|
|
2127
|
-
R("div", {
|
|
2128
|
-
ref: "rootRef",
|
|
2129
|
-
class: E([
|
|
2130
|
-
e.ns.b(),
|
|
2131
|
-
e.customClass,
|
|
2132
|
-
e.ns.is("draggable", e.draggable),
|
|
2133
|
-
{ [e.ns.m("center")]: e.center }
|
|
2134
|
-
]),
|
|
2135
|
-
style: Ze(e.customStyle),
|
|
2136
|
-
tabindex: "-1",
|
|
2137
|
-
onClick: Me(() => {
|
|
2138
|
-
}, ["stop"])
|
|
2139
|
-
}, [
|
|
2140
|
-
e.title !== null && e.title !== void 0 ? (m(), L("div", {
|
|
2141
|
-
key: 0,
|
|
2142
|
-
ref: "headerRef",
|
|
2143
|
-
class: E([e.ns.e("header"), { "show-close": e.showClose }])
|
|
2144
|
-
}, [
|
|
2145
|
-
R("div", {
|
|
2146
|
-
class: E(e.ns.e("title"))
|
|
2147
|
-
}, [
|
|
2148
|
-
e.iconComponent && e.center ? (m(), x(r, {
|
|
2149
|
-
key: 0,
|
|
2150
|
-
class: E([e.ns.e("status"), e.typeClass])
|
|
2151
|
-
}, {
|
|
2152
|
-
default: A(() => [
|
|
2153
|
-
(m(), x(W(e.iconComponent)))
|
|
2154
|
-
]),
|
|
2155
|
-
_: 1
|
|
2156
|
-
}, 8, ["class"])) : I("v-if", !0),
|
|
2157
|
-
R("span", null, J(e.title), 1)
|
|
2158
|
-
], 2),
|
|
2159
|
-
e.showClose ? (m(), L("button", {
|
|
2160
|
-
key: 0,
|
|
2161
|
-
type: "button",
|
|
2162
|
-
class: E(e.ns.e("headerbtn")),
|
|
2163
|
-
"aria-label": e.t("el.messagebox.close"),
|
|
2164
|
-
onClick: (p) => e.handleAction(e.distinguishCancelAndClose ? "close" : "cancel"),
|
|
2165
|
-
onKeydown: $e(Me((p) => e.handleAction(e.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"])
|
|
2166
|
-
}, [
|
|
2167
|
-
$(r, {
|
|
2168
|
-
class: E(e.ns.e("close"))
|
|
2169
|
-
}, {
|
|
2170
|
-
default: A(() => [
|
|
2171
|
-
(m(), x(W(e.closeIcon || "close")))
|
|
2172
|
-
]),
|
|
2173
|
-
_: 1
|
|
2174
|
-
}, 8, ["class"])
|
|
2175
|
-
], 42, ["aria-label", "onClick", "onKeydown"])) : I("v-if", !0)
|
|
2176
|
-
], 2)) : I("v-if", !0),
|
|
2177
|
-
R("div", {
|
|
2178
|
-
id: e.contentId,
|
|
2179
|
-
class: E(e.ns.e("content"))
|
|
2180
|
-
}, [
|
|
2181
|
-
R("div", {
|
|
2182
|
-
class: E(e.ns.e("container"))
|
|
2183
|
-
}, [
|
|
2184
|
-
e.iconComponent && !e.center && e.hasMessage ? (m(), x(r, {
|
|
2185
|
-
key: 0,
|
|
2186
|
-
class: E([e.ns.e("status"), e.typeClass])
|
|
2187
|
-
}, {
|
|
2188
|
-
default: A(() => [
|
|
2189
|
-
(m(), x(W(e.iconComponent)))
|
|
2190
|
-
]),
|
|
2191
|
-
_: 1
|
|
2192
|
-
}, 8, ["class"])) : I("v-if", !0),
|
|
2193
|
-
e.hasMessage ? (m(), L("div", {
|
|
2194
|
-
key: 1,
|
|
2195
|
-
class: E(e.ns.e("message"))
|
|
2196
|
-
}, [
|
|
2197
|
-
Y(e.$slots, "default", {}, () => [
|
|
2198
|
-
e.dangerouslyUseHTMLString ? (m(), x(W(e.showInput ? "label" : "p"), {
|
|
2199
|
-
key: 1,
|
|
2200
|
-
for: e.showInput ? e.inputId : void 0,
|
|
2201
|
-
innerHTML: e.message
|
|
2202
|
-
}, null, 8, ["for", "innerHTML"])) : (m(), x(W(e.showInput ? "label" : "p"), {
|
|
2203
|
-
key: 0,
|
|
2204
|
-
for: e.showInput ? e.inputId : void 0
|
|
2205
|
-
}, {
|
|
2206
|
-
default: A(() => [
|
|
2207
|
-
Ae(J(e.dangerouslyUseHTMLString ? "" : e.message), 1)
|
|
2208
|
-
]),
|
|
2209
|
-
_: 1
|
|
2210
|
-
}, 8, ["for"]))
|
|
2211
|
-
])
|
|
2212
|
-
], 2)) : I("v-if", !0)
|
|
2213
|
-
], 2),
|
|
2214
|
-
ut(R("div", {
|
|
2215
|
-
class: E(e.ns.e("input"))
|
|
2216
|
-
}, [
|
|
2217
|
-
$(i, {
|
|
2218
|
-
id: e.inputId,
|
|
2219
|
-
ref: "inputRef",
|
|
2220
|
-
modelValue: e.inputValue,
|
|
2221
|
-
"onUpdate:modelValue": (p) => e.inputValue = p,
|
|
2222
|
-
type: e.inputType,
|
|
2223
|
-
placeholder: e.inputPlaceholder,
|
|
2224
|
-
"aria-invalid": e.validateError,
|
|
2225
|
-
class: E({ invalid: e.validateError }),
|
|
2226
|
-
onKeydown: $e(e.handleInputEnter, ["enter"])
|
|
2227
|
-
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "type", "placeholder", "aria-invalid", "class", "onKeydown"]),
|
|
2228
|
-
R("div", {
|
|
2229
|
-
class: E(e.ns.e("errormsg")),
|
|
2230
|
-
style: Ze({
|
|
2231
|
-
visibility: e.editorErrorMessage ? "visible" : "hidden"
|
|
2232
|
-
})
|
|
2233
|
-
}, J(e.editorErrorMessage), 7)
|
|
2234
|
-
], 2), [
|
|
2235
|
-
[ct, e.showInput]
|
|
2236
|
-
])
|
|
2237
|
-
], 10, ["id"]),
|
|
2238
|
-
R("div", {
|
|
2239
|
-
class: E(e.ns.e("btns"))
|
|
2240
|
-
}, [
|
|
2241
|
-
e.showCancelButton ? (m(), x(c, {
|
|
2242
|
-
key: 0,
|
|
2243
|
-
loading: e.cancelButtonLoading,
|
|
2244
|
-
"loading-icon": e.cancelButtonLoadingIcon,
|
|
2245
|
-
class: E([e.cancelButtonClass]),
|
|
2246
|
-
round: e.roundButton,
|
|
2247
|
-
size: e.btnSize,
|
|
2248
|
-
onClick: (p) => e.handleAction("cancel"),
|
|
2249
|
-
onKeydown: $e(Me((p) => e.handleAction("cancel"), ["prevent"]), ["enter"])
|
|
2250
|
-
}, {
|
|
2251
|
-
default: A(() => [
|
|
2252
|
-
Ae(J(e.cancelButtonText || e.t("el.messagebox.cancel")), 1)
|
|
2253
|
-
]),
|
|
2254
|
-
_: 1
|
|
2255
|
-
}, 8, ["loading", "loading-icon", "class", "round", "size", "onClick", "onKeydown"])) : I("v-if", !0),
|
|
2256
|
-
ut($(c, {
|
|
2257
|
-
ref: "confirmRef",
|
|
2258
|
-
type: "primary",
|
|
2259
|
-
loading: e.confirmButtonLoading,
|
|
2260
|
-
"loading-icon": e.confirmButtonLoadingIcon,
|
|
2261
|
-
class: E([e.confirmButtonClasses]),
|
|
2262
|
-
round: e.roundButton,
|
|
2263
|
-
disabled: e.confirmButtonDisabled,
|
|
2264
|
-
size: e.btnSize,
|
|
2265
|
-
onClick: (p) => e.handleAction("confirm"),
|
|
2266
|
-
onKeydown: $e(Me((p) => e.handleAction("confirm"), ["prevent"]), ["enter"])
|
|
2267
|
-
}, {
|
|
2268
|
-
default: A(() => [
|
|
2269
|
-
Ae(J(e.confirmButtonText || e.t("el.messagebox.confirm")), 1)
|
|
2270
|
-
]),
|
|
2271
|
-
_: 1
|
|
2272
|
-
}, 8, ["loading", "loading-icon", "class", "round", "disabled", "size", "onClick", "onKeydown"]), [
|
|
2273
|
-
[ct, e.showConfirmButton]
|
|
2274
|
-
])
|
|
2275
|
-
], 2)
|
|
2276
|
-
], 14, ["onClick"])
|
|
2277
|
-
]),
|
|
2278
|
-
_: 3
|
|
2279
|
-
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onReleaseRequested"])
|
|
2280
|
-
], 42, ["aria-label", "aria-describedby", "onClick", "onMousedown", "onMouseup"])
|
|
2281
|
-
]),
|
|
2282
|
-
_: 3
|
|
2283
|
-
}, 8, ["z-index", "overlay-class", "mask"]), [
|
|
2284
|
-
[ct, e.visible]
|
|
2285
|
-
])
|
|
2286
|
-
]),
|
|
2287
|
-
_: 3
|
|
2288
|
-
}, 8, ["onAfterLeave"]);
|
|
2289
|
-
}
|
|
2290
|
-
var Ls = /* @__PURE__ */ Pe(Rs, [["render", Ns], ["__file", "index.vue"]]);
|
|
2291
|
-
const Le = /* @__PURE__ */ new Map(), Fs = (e) => {
|
|
2292
|
-
let t = document.body;
|
|
2293
|
-
return e.appendTo && (ve(e.appendTo) && (t = document.querySelector(e.appendTo)), Re(e.appendTo) && (t = e.appendTo), Re(t) || (pe("ElMessageBox", "the appendTo option is not an HTMLElement. Falling back to document.body."), t = document.body)), t;
|
|
2294
|
-
}, Os = (e, t, n = null) => {
|
|
2295
|
-
const o = $(Ls, e, Ne(e.message) || Tn(e.message) ? {
|
|
2296
|
-
default: Ne(e.message) ? e.message : () => e.message
|
|
2297
|
-
} : null);
|
|
2298
|
-
return o.appContext = n, In(o, t), Fs(e).appendChild(t.firstElementChild), o.component;
|
|
2299
|
-
}, Ds = () => document.createElement("div"), Ps = (e, t) => {
|
|
2300
|
-
const n = Ds();
|
|
2301
|
-
e.onVanish = () => {
|
|
2302
|
-
In(null, n), Le.delete(a);
|
|
2303
|
-
}, e.onAction = (s) => {
|
|
2304
|
-
const r = Le.get(a);
|
|
2305
|
-
let i;
|
|
2306
|
-
e.showInput ? i = { value: a.inputValue, action: s } : i = s, e.callback ? e.callback(i, o.proxy) : s === "cancel" || s === "close" ? e.distinguishCancelAndClose && s !== "cancel" ? r.reject("close") : r.reject("cancel") : r.resolve(i);
|
|
2307
|
-
};
|
|
2308
|
-
const o = Os(e, n, t), a = o.proxy;
|
|
2309
|
-
for (const s in e)
|
|
2310
|
-
en(e, s) && !en(a.$props, s) && (s === "closeIcon" && nt(e[s]) ? a[s] = mt(e[s]) : a[s] = e[s]);
|
|
2311
|
-
return a.visible = !0, a;
|
|
2312
|
-
};
|
|
2313
|
-
function Se(e, t = null) {
|
|
2314
|
-
if (!ue)
|
|
2315
|
-
return Promise.reject();
|
|
2316
|
-
let n;
|
|
2317
|
-
return ve(e) || Tn(e) ? e = {
|
|
2318
|
-
message: e
|
|
2319
|
-
} : n = e.callback, new Promise((o, a) => {
|
|
2320
|
-
const s = Ps(e, t ?? Se._context);
|
|
2321
|
-
Le.set(s, {
|
|
2322
|
-
options: e,
|
|
2323
|
-
callback: n,
|
|
2324
|
-
resolve: o,
|
|
2325
|
-
reject: a
|
|
2326
|
-
});
|
|
2327
|
-
});
|
|
2328
|
-
}
|
|
2329
|
-
const _s = ["alert", "confirm", "prompt"], Hs = {
|
|
2330
|
-
alert: { closeOnPressEscape: !1, closeOnClickModal: !1 },
|
|
2331
|
-
confirm: { showCancelButton: !0 },
|
|
2332
|
-
prompt: { showCancelButton: !0, showInput: !0 }
|
|
2333
|
-
};
|
|
2334
|
-
_s.forEach((e) => {
|
|
2335
|
-
Se[e] = $s(e);
|
|
2336
|
-
});
|
|
2337
|
-
function $s(e) {
|
|
2338
|
-
return (t, n, o, a) => {
|
|
2339
|
-
let s = "";
|
|
2340
|
-
return nt(n) ? (o = n, s = "") : $o(n) ? s = "" : s = n, Se(Object.assign({
|
|
2341
|
-
title: s,
|
|
2342
|
-
message: t,
|
|
2343
|
-
type: "",
|
|
2344
|
-
...Hs[e]
|
|
2345
|
-
}, o, {
|
|
2346
|
-
boxType: e
|
|
2347
|
-
}), a);
|
|
2348
|
-
};
|
|
2349
|
-
}
|
|
2350
|
-
Se.close = () => {
|
|
2351
|
-
Le.forEach((e, t) => {
|
|
2352
|
-
t.doClose();
|
|
2353
|
-
}), Le.clear();
|
|
2354
|
-
};
|
|
2355
|
-
Se._context = null;
|
|
2356
|
-
const se = Se;
|
|
2357
|
-
se.install = (e) => {
|
|
2358
|
-
se._context = e._context, e.config.globalProperties.$msgbox = se, e.config.globalProperties.$messageBox = se, e.config.globalProperties.$alert = se.alert, e.config.globalProperties.$confirm = se.confirm, e.config.globalProperties.$prompt = se.prompt;
|
|
2359
|
-
};
|
|
2360
|
-
const zs = se, Vs = Mn(), { activeMenuPath: qe } = bt(Vs), Ks = S([
|
|
2361
|
-
{
|
|
2362
|
-
label: "角色名称",
|
|
2363
|
-
value: "",
|
|
2364
|
-
name: "a0"
|
|
2365
|
-
}
|
|
2366
|
-
]), Us = S([
|
|
2367
|
-
{
|
|
2368
|
-
label: "查询"
|
|
2369
|
-
},
|
|
2370
|
-
{
|
|
2371
|
-
label: "重置"
|
|
2372
|
-
}
|
|
2373
|
-
]), wn = De({
|
|
2374
|
-
isFilter: !1,
|
|
2375
|
-
filterForm: {}
|
|
2376
|
-
}), Ws = S(!1), Ys = (e) => {
|
|
2377
|
-
console.log("handleQueryChange", e), wn.isFilter = !0, wn.filterForm = e;
|
|
2378
|
-
}, X = S([
|
|
2379
|
-
{
|
|
2380
|
-
key: "extraButton",
|
|
2381
|
-
contents: [
|
|
2382
|
-
{
|
|
2383
|
-
label: "新增"
|
|
2384
|
-
}
|
|
2385
|
-
]
|
|
2386
|
-
},
|
|
2387
|
-
{
|
|
2388
|
-
key: "rowButton",
|
|
2389
|
-
contents: [
|
|
2390
|
-
{
|
|
2391
|
-
label: "授权",
|
|
2392
|
-
textColor: "blue"
|
|
2393
|
-
},
|
|
2394
|
-
{
|
|
2395
|
-
label: "编辑"
|
|
2396
|
-
},
|
|
2397
|
-
{
|
|
2398
|
-
label: "删除",
|
|
2399
|
-
textColor: "red"
|
|
2400
|
-
}
|
|
2401
|
-
]
|
|
2402
|
-
},
|
|
2403
|
-
{
|
|
2404
|
-
key: "tableIndex",
|
|
2405
|
-
contents: []
|
|
2406
|
-
},
|
|
2407
|
-
{
|
|
2408
|
-
key: "header",
|
|
2409
|
-
contents: [
|
|
2410
|
-
{
|
|
2411
|
-
label: "角色名称"
|
|
2412
|
-
},
|
|
2413
|
-
{
|
|
2414
|
-
label: "角色状态"
|
|
2415
|
-
},
|
|
2416
|
-
{
|
|
2417
|
-
label: "角色排序"
|
|
2418
|
-
},
|
|
2419
|
-
{
|
|
2420
|
-
label: "权限",
|
|
2421
|
-
isHidden: !0
|
|
2422
|
-
},
|
|
2423
|
-
{
|
|
2424
|
-
label: "操作"
|
|
2425
|
-
}
|
|
2426
|
-
]
|
|
2427
|
-
},
|
|
2428
|
-
{
|
|
2429
|
-
key: "tableContents"
|
|
2430
|
-
// contents: [
|
|
2431
|
-
// [
|
|
2432
|
-
// "超级管理员",
|
|
2433
|
-
// "启动",
|
|
2434
|
-
// 1,
|
|
2435
|
-
// []
|
|
2436
|
-
// // ['元元模型/系统/查询', '元元模型/系统/新增', '元元模型/系统/编辑']
|
|
2437
|
-
// ], [
|
|
2438
|
-
// "普通管理员",
|
|
2439
|
-
// "启动",
|
|
2440
|
-
// 2,
|
|
2441
|
-
// []
|
|
2442
|
-
// // ['元元模型/系统/查询', '元元模型/系统/新增', '元元模型/系统/编辑']
|
|
2443
|
-
// ],
|
|
2444
|
-
// ]
|
|
2445
|
-
// contents:undefined
|
|
2446
|
-
}
|
|
2447
|
-
]), Gs = b(() => X.value), qs = (e) => {
|
|
2448
|
-
var t;
|
|
2449
|
-
X.value = (t = X.value) == null ? void 0 : t.map((n) => n.key === "tableContents" ? {
|
|
2450
|
-
...n,
|
|
2451
|
-
contents: e.content
|
|
2452
|
-
} : n), console.log("handleItemDataChange", e), Ft(e.singleContent, e.buttonName);
|
|
2453
|
-
}, js = (e) => {
|
|
2454
|
-
var o, a, s;
|
|
2455
|
-
console.log("handleContentChange", e);
|
|
2456
|
-
const t = et(e);
|
|
2457
|
-
let n = (a = (o = t == null ? void 0 : t.contents) == null ? void 0 : o.find((r) => r.key === "tableContents")) == null ? void 0 : a.contents;
|
|
2458
|
-
X.value = (s = X.value) == null ? void 0 : s.map((r) => r.key === "tableContents" ? {
|
|
2459
|
-
...r,
|
|
2460
|
-
contents: n == null ? void 0 : n.map((i) => Object.keys(i).filter((c) => c.startsWith("a")).map((c) => i[c]))
|
|
2461
|
-
} : r), console.log("rawData", X.value);
|
|
2462
|
-
}, Lt = S({}), we = S(), Be = async (e, t) => {
|
|
2463
|
-
var o, a;
|
|
2464
|
-
const n = await e(t);
|
|
2465
|
-
if (((o = n == null ? void 0 : n.data) == null ? void 0 : o.code) === 200)
|
|
2466
|
-
return n.data.result || ((a = n == null ? void 0 : n.data) == null ? void 0 : a.code) === 200;
|
|
2467
|
-
}, Xs = async (e, t) => {
|
|
2468
|
-
var n, o, a, s, r, i;
|
|
2469
|
-
switch (console.log("clickRowButton", e, t), Lt.value = et(t), e) {
|
|
2470
|
-
case "授权":
|
|
2471
|
-
Ot.show = !0, await D();
|
|
2472
|
-
const c = (n = we.value) == null ? void 0 : n.getCheckedKeys();
|
|
2473
|
-
(c == null ? void 0 : c.length) > 0 && ((o = we.value) == null || o.setCheckedKeys([]));
|
|
2474
|
-
const u = (r = (s = (a = X.value) == null ? void 0 : a.find((p) => p.key === "header")) == null ? void 0 : s.contents) == null ? void 0 : r.findIndex((p) => p.label === "权限"), v = t["a" + u];
|
|
2475
|
-
(v == null ? void 0 : v.length) > 0 && ((i = we.value) == null || i.setCheckedKeys(v)), console.log("clickRowButton-authorityIndex", X.value, v, we.value);
|
|
2476
|
-
break;
|
|
2477
|
-
}
|
|
2478
|
-
}, Js = () => {
|
|
2479
|
-
Ot.show = !1;
|
|
2480
|
-
}, Fe = S(), Qs = async (e) => {
|
|
2481
|
-
const t = await Be(vo, {
|
|
2482
|
-
key: {
|
|
2483
|
-
compKey: e
|
|
2484
|
-
}
|
|
2485
|
-
}), n = t == null ? void 0 : t.map((o) => {
|
|
2486
|
-
var a;
|
|
2487
|
-
return {
|
|
2488
|
-
id: o.id,
|
|
2489
|
-
rowData: (a = o == null ? void 0 : o.value) == null ? void 0 : a.rowData
|
|
2490
|
-
};
|
|
2491
|
-
});
|
|
2492
|
-
return console.log("tempRes", n), n == null ? void 0 : n.map((o) => {
|
|
2493
|
-
var a;
|
|
2494
|
-
if (Array.isArray(o == null ? void 0 : o.rowData)) {
|
|
2495
|
-
let s = { id: o.id };
|
|
2496
|
-
return (a = o == null ? void 0 : o.rowData) == null || a.forEach((r, i) => {
|
|
2497
|
-
s[`a${i}`] = r;
|
|
2498
|
-
}), s;
|
|
2499
|
-
} else
|
|
2500
|
-
return {
|
|
2501
|
-
...o.rowData,
|
|
2502
|
-
id: o.id
|
|
2503
|
-
};
|
|
2504
|
-
});
|
|
2505
|
-
}, Ft = (e, t) => {
|
|
2506
|
-
t === "新增" ? Be(po, {
|
|
2507
|
-
key: {
|
|
2508
|
-
compKey: qe.value,
|
|
2509
|
-
rowKey: `${qe.value}/${e.id}`
|
|
2510
|
-
},
|
|
2511
|
-
value: {
|
|
2512
|
-
rowData: e
|
|
2513
|
-
}
|
|
2514
|
-
}).then((n) => {
|
|
2515
|
-
Fe.value = {
|
|
2516
|
-
...e,
|
|
2517
|
-
newId: n
|
|
2518
|
-
}, console.log(444, Fe.value), t && n && ze.success(t + "成功");
|
|
2519
|
-
}) : t === "编辑" ? Be(ho, {
|
|
2520
|
-
key: {
|
|
2521
|
-
compKey: qe.value,
|
|
2522
|
-
rowKey: `${qe.value}/${e.id}`
|
|
2523
|
-
},
|
|
2524
|
-
value: {
|
|
2525
|
-
rowData: e
|
|
2526
|
-
}
|
|
2527
|
-
}).then((n) => {
|
|
2528
|
-
t && n && ze.success(t + "成功");
|
|
2529
|
-
}) : t === "删除" && (console.log(222, e), zs.confirm(
|
|
2530
|
-
"该操作将会永久性删除该数据,确认删除?",
|
|
2531
|
-
"警告",
|
|
2532
|
-
{
|
|
2533
|
-
confirmButtonText: "确认",
|
|
2534
|
-
cancelButtonText: "取消",
|
|
2535
|
-
type: "warning"
|
|
2536
|
-
}
|
|
2537
|
-
).then(() => {
|
|
2538
|
-
Be(go, {
|
|
2539
|
-
id: e.id
|
|
2540
|
-
}).then((n) => {
|
|
2541
|
-
t && n && ze.success(t + "成功");
|
|
2542
|
-
});
|
|
2543
|
-
}).catch(() => {
|
|
2544
|
-
ze.info("取消删除");
|
|
2545
|
-
}));
|
|
2546
|
-
}, Zs = () => {
|
|
2547
|
-
var n, o, a, s;
|
|
2548
|
-
const e = (n = we.value) == null ? void 0 : n.getCheckedKeys(), t = (s = (a = (o = X.value) == null ? void 0 : o.find((r) => r.key === "header")) == null ? void 0 : a.contents) == null ? void 0 : s.findIndex((r) => r.label === "权限");
|
|
2549
|
-
Fe.value = {
|
|
2550
|
-
...Lt.value,
|
|
2551
|
-
["a" + t]: e
|
|
2552
|
-
}, D(() => {
|
|
2553
|
-
var i, c;
|
|
2554
|
-
const r = (c = (i = X.value) == null ? void 0 : i.find((u) => u.key === "tableContents")) == null ? void 0 : c.contents;
|
|
2555
|
-
console.log("clickSubmitAuthority", Fe.value, r), Ft(r, "授权");
|
|
2556
|
-
});
|
|
2557
|
-
}, Ot = De({
|
|
2558
|
-
show: !1,
|
|
2559
|
-
title: "角色授权",
|
|
2560
|
-
width: 500,
|
|
2561
|
-
draggable: !0
|
|
2562
|
-
}), er = ({ isPenultimate: e }) => e ? "is-penultimate" : "", tr = S([]), nr = S([
|
|
2563
|
-
{
|
|
2564
|
-
path: "资源管理/人员",
|
|
2565
|
-
buttons: ["查询", "新增", "编辑", "删除"]
|
|
2566
|
-
}
|
|
2567
|
-
]), Wn = (e, t) => (t.forEach((n) => {
|
|
2568
|
-
var o;
|
|
2569
|
-
for (let a of e) {
|
|
2570
|
-
if (a.path === n.path) {
|
|
2571
|
-
a.children || (a.children = []);
|
|
2572
|
-
const s = (o = n.buttons) == null ? void 0 : o.map((r) => ({
|
|
2573
|
-
title: r,
|
|
2574
|
-
path: n.path + "/" + r
|
|
2575
|
-
}));
|
|
2576
|
-
a.children.push(...s);
|
|
2577
|
-
break;
|
|
2578
|
-
}
|
|
2579
|
-
a.children && Wn(a.children, [n]);
|
|
2580
|
-
}
|
|
2581
|
-
}), e), Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2582
|
-
__proto__: null,
|
|
2583
|
-
addButtonsToTree: Wn,
|
|
2584
|
-
authorizeDialog: Ot,
|
|
2585
|
-
buttonValue: Us,
|
|
2586
|
-
changedRow: Fe,
|
|
2587
|
-
clickRow: Lt,
|
|
2588
|
-
clickRowButton: Xs,
|
|
2589
|
-
clickSubmitAuthority: Zs,
|
|
2590
|
-
closeAuthorizeDialog: Js,
|
|
2591
|
-
compData: X,
|
|
2592
|
-
compDataFiltered: Gs,
|
|
2593
|
-
customNodeClass: er,
|
|
2594
|
-
getPageDataAsync: Qs,
|
|
2595
|
-
handleContentChange: js,
|
|
2596
|
-
handleItemDataChange: qs,
|
|
2597
|
-
handleQueryChange: Ys,
|
|
2598
|
-
handleSubmitAsync: Be,
|
|
2599
|
-
isPageDataExist: Ws,
|
|
2600
|
-
menuData: tr,
|
|
2601
|
-
menusButtons: nr,
|
|
2602
|
-
queryFormData: Ks,
|
|
2603
|
-
submitTableAsyncByVerify: Ft,
|
|
2604
|
-
treeRef: we
|
|
2605
|
-
}, Symbol.toStringTag, { value: "Module" })), or = { class: "role-wrapper" }, ar = { class: "role-dialog-header" }, sr = { class: "dialog-footer" }, rr = /* @__PURE__ */ Q({
|
|
2606
|
-
__name: "index",
|
|
2607
|
-
setup(e) {
|
|
2608
|
-
const t = Mn(), { menus: n, activeMenuPath: o } = bt(t), a = De({ ...Cn }), { treeRef: s } = Cn, r = zo(), { itemData: i } = bt(r), c = Vo();
|
|
2609
|
-
return te(() => {
|
|
2610
|
-
console.log("state", a);
|
|
2611
|
-
const u = et(i.value), v = {
|
|
2612
|
-
comp: "Group",
|
|
2613
|
-
name: c.path,
|
|
2614
|
-
compData: a.compData
|
|
2615
|
-
};
|
|
2616
|
-
console.log(123, [...u, v]), r.setItemData([...u, v]), o.value && a.getPageDataAsync(o.value).then((p) => {
|
|
2617
|
-
var C;
|
|
2618
|
-
a.compData = (C = a.compData) == null ? void 0 : C.map((g) => g.key === "tableContents" ? {
|
|
2619
|
-
...g,
|
|
2620
|
-
contents: p
|
|
2621
|
-
} : g), console.log(111, a.compData);
|
|
2622
|
-
});
|
|
2623
|
-
}), K(() => n.value, (u) => {
|
|
2624
|
-
a.menuData = et(u);
|
|
2625
|
-
const v = a.addButtonsToTree(a.menuData, a.menusButtons);
|
|
2626
|
-
console.log("menus123", v);
|
|
2627
|
-
}, {
|
|
2628
|
-
immediate: !0,
|
|
2629
|
-
deep: !0
|
|
2630
|
-
}), (u, v) => {
|
|
2631
|
-
const p = re("el-tree"), C = re("el-button"), g = re("el-dialog");
|
|
2632
|
-
return m(), L(xe, null, [
|
|
2633
|
-
R("div", or, [
|
|
2634
|
-
$(co, {
|
|
2635
|
-
class: "role-header",
|
|
2636
|
-
rowContents: a.queryFormData,
|
|
2637
|
-
isEnableWrap: !0,
|
|
2638
|
-
isEdit: !0,
|
|
2639
|
-
onChange: a.handleQueryChange
|
|
2640
|
-
}, null, 8, ["rowContents", "onChange"]),
|
|
2641
|
-
$(fo, {
|
|
2642
|
-
class: "role-body",
|
|
2643
|
-
itemData: a.compDataFiltered,
|
|
2644
|
-
changedContent: a.changedRow,
|
|
2645
|
-
onChange: a.handleItemDataChange,
|
|
2646
|
-
onContentChange: a.handleContentChange,
|
|
2647
|
-
onOnButtonClick: a.clickRowButton
|
|
2648
|
-
}, null, 8, ["itemData", "changedContent", "onChange", "onContentChange", "onOnButtonClick"])
|
|
2649
|
-
]),
|
|
2650
|
-
$(g, {
|
|
2651
|
-
modelValue: a.authorizeDialog.show,
|
|
2652
|
-
"onUpdate:modelValue": v[0] || (v[0] = (l) => a.authorizeDialog.show = l),
|
|
2653
|
-
width: a.authorizeDialog.width,
|
|
2654
|
-
draggable: a.authorizeDialog.draggable,
|
|
2655
|
-
"before-close": a.closeAuthorizeDialog,
|
|
2656
|
-
class: "role-dialog"
|
|
2657
|
-
}, {
|
|
2658
|
-
header: A(() => [
|
|
2659
|
-
R("div", ar, J(a.authorizeDialog.title), 1)
|
|
2660
|
-
]),
|
|
2661
|
-
footer: A(() => [
|
|
2662
|
-
R("div", sr, [
|
|
2663
|
-
$(C, {
|
|
2664
|
-
onClick: a.closeAuthorizeDialog
|
|
2665
|
-
}, {
|
|
2666
|
-
default: A(() => v[1] || (v[1] = [
|
|
2667
|
-
Ae("取消")
|
|
2668
|
-
])),
|
|
2669
|
-
_: 1,
|
|
2670
|
-
__: [1]
|
|
2671
|
-
}, 8, ["onClick"]),
|
|
2672
|
-
$(C, {
|
|
2673
|
-
type: "primary",
|
|
2674
|
-
onClick: a.clickSubmitAuthority
|
|
2675
|
-
}, {
|
|
2676
|
-
default: A(() => v[2] || (v[2] = [
|
|
2677
|
-
Ae(" 确认 ")
|
|
2678
|
-
])),
|
|
2679
|
-
_: 1,
|
|
2680
|
-
__: [2]
|
|
2681
|
-
}, 8, ["onClick"])
|
|
2682
|
-
])
|
|
2683
|
-
]),
|
|
2684
|
-
default: A(() => [
|
|
2685
|
-
$(p, {
|
|
2686
|
-
class: "role-tree",
|
|
2687
|
-
ref_key: "treeRef",
|
|
2688
|
-
ref: s,
|
|
2689
|
-
data: a.menuData,
|
|
2690
|
-
"node-key": "path",
|
|
2691
|
-
"show-checkbox": "",
|
|
2692
|
-
props: { children: "children", label: "title", path: "path", class: a.customNodeClass },
|
|
2693
|
-
icon: "ele-Menu",
|
|
2694
|
-
"highlight-current": "",
|
|
2695
|
-
"default-expand-all": "",
|
|
2696
|
-
style: { height: "500px", "overflow-y": "auto" }
|
|
2697
|
-
}, null, 8, ["data", "props"])
|
|
2698
|
-
]),
|
|
2699
|
-
_: 1
|
|
2700
|
-
}, 8, ["modelValue", "width", "draggable", "before-close"])
|
|
2701
|
-
], 64);
|
|
2702
|
-
};
|
|
2703
|
-
}
|
|
2704
|
-
}), Er = /* @__PURE__ */ Ko(rr, [["__scopeId", "data-v-39892523"]]);
|
|
2705
|
-
export {
|
|
2706
|
-
Er as default
|
|
2707
|
-
};
|