st-comp 0.0.115 → 0.0.116
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/auto-imports.d.ts +1 -0
- package/components.d.ts +1 -0
- package/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +2 -2
- package/es/Dialog.cjs +1 -1
- package/es/Dialog.js +11 -11
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +1070 -272
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +13 -13
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +12 -12
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +30 -30
- package/es/Pie.cjs +1 -1
- package/es/Pie.js +1 -1
- package/es/Table.cjs +1 -1
- package/es/Table.js +31 -31
- package/es/User.cjs +1 -1
- package/es/User.js +84 -84
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +1116 -936
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +56 -56
- package/es/base-ec05f348.cjs +9 -0
- package/es/{base-a3fcf99a.js → base-f7877059.js} +345 -328
- package/es/{castArray-0e8e51f9.js → castArray-18f43497.js} +1 -1
- package/es/{castArray-e6cd255c.cjs → castArray-a45823fe.cjs} +1 -1
- package/es/{config-provider-e4ebacca.js → config-provider-6479d795.js} +6 -6
- package/es/{config-provider-957c280a.cjs → config-provider-7cdfca4d.cjs} +1 -1
- package/es/{debounce-7f3a3471.js → debounce-2336e546.js} +14 -14
- package/es/{debounce-3ad03224.cjs → debounce-b2ff12bd.cjs} +1 -1
- package/es/{dropdown-c505d260.js → dropdown-46daf582.js} +4 -4
- package/es/{dropdown-e73864c0.cjs → dropdown-9a974876.cjs} +1 -1
- package/es/{el-button-e389429d.cjs → el-button-196807af.cjs} +1 -1
- package/es/{el-button-fe99fee6.js → el-button-802f579a.js} +6 -6
- package/es/{el-empty-848e4e08.cjs → el-empty-19ea04f4.cjs} +1 -1
- package/es/{el-empty-a338aa98.js → el-empty-3c5ec277.js} +5 -5
- package/es/el-form-item-84099d46.js +1599 -0
- package/es/el-form-item-c39f717e.cjs +12 -0
- package/es/{el-input-65ed0dba.cjs → el-input-6c6f5bda.cjs} +1 -1
- package/es/{el-input-35c8ebc3.js → el-input-fac5b401.js} +39 -39
- package/es/{el-overlay-851ea246.js → el-overlay-69e9ae49.js} +105 -101
- package/es/el-overlay-891dcc40.cjs +1 -0
- package/es/{el-popover-246eb710.js → el-popover-694ded47.js} +22 -22
- package/es/{el-popover-b0deb095.cjs → el-popover-8735b1fa.cjs} +1 -1
- package/es/{el-popper-e052fb84.js → el-popper-6126b1f6.js} +91 -91
- package/es/{el-popper-4da22fdc.cjs → el-popper-f62316cd.cjs} +1 -1
- package/es/el-scrollbar-d1c3e7f7.cjs +1 -0
- package/es/el-scrollbar-e0493906.js +201 -0
- package/es/el-select-513126a5.js +1128 -0
- package/es/el-select-928f8c19.cjs +1 -0
- package/es/{el-table-column-661deade.js → el-table-column-3c920bdd.js} +69 -69
- package/es/{el-table-column-d636a7d6.cjs → el-table-column-dd8b62aa.cjs} +1 -1
- package/es/{el-tag-a45bdd1e.cjs → el-tag-3b03d13e.cjs} +1 -1
- package/es/{el-tag-7601f7e6.js → el-tag-5becabc9.js} +74 -74
- package/es/index-048dca7e.js +303 -0
- package/es/{index-28cd5fde.js → index-35117549.js} +25 -25
- package/es/{index-fc652f21.js → index-57f8f7b9.js} +15 -1
- package/es/index-7e40be25.js +167 -0
- package/es/index-80a2b137.cjs +1 -0
- package/es/{index-35665af5.cjs → index-8a0b1c53.cjs} +1 -1
- package/es/{index-25aca205.cjs → index-dc273ea2.cjs} +1 -1
- package/es/index-e1e83173.cjs +1 -0
- package/es/{raf-a97e05a3.js → raf-07da7cdf.js} +1 -1
- package/es/{raf-da075499.cjs → raf-8fc301fd.cjs} +1 -1
- package/es/{refs-f0ee592c.js → refs-1b1fe6ca.js} +1 -1
- package/es/{refs-34a69f8c.cjs → refs-d00b710b.cjs} +1 -1
- package/es/{scroll-1e0c8fab.js → scroll-3b521d81.js} +1 -1
- package/es/{scroll-c7ef9180.cjs → scroll-41224831.cjs} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-96d2ea48.cjs → use-form-common-props-1b84d8f4.cjs} +1 -1
- package/es/{use-form-common-props-d0739feb.js → use-form-common-props-f3a520d0.js} +53 -53
- package/es/{vnode-8f40662d.js → vnode-25d7c2f5.js} +1 -1
- package/es/{vnode-562e063c.cjs → vnode-7fbc61e1.cjs} +1 -1
- package/es/{zh-cn-0ab4aa73.js → zh-cn-74781bbd.js} +2 -2
- package/es/{zh-cn-bf58db71.cjs → zh-cn-ab9a583d.cjs} +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +192 -192
- package/lib/{index-a981dd97.js → index-c6ba3bcd.js} +30058 -29227
- package/lib/{python-72fd599d.js → python-49e22e65.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/FactorWarning/index.vue +296 -97
- package/packages/FactorWarning/tools.js +10 -0
- package/src/pages/FactorWarning/index.vue +69 -25
- package/es/base-adc4e34e.cjs +0 -9
- package/es/el-overlay-84e3cb6c.cjs +0 -1
- package/es/el-radio-button-12b07ac2.js +0 -1782
- package/es/el-radio-button-5259a46b.cjs +0 -12
- package/es/el-scrollbar-8cb3663b.cjs +0 -1
- package/es/el-scrollbar-c23060d5.js +0 -193
- package/es/el-select-4987a187.cjs +0 -1
- package/es/el-select-d1a33fbe.js +0 -1233
- package/es/index-4090cb2c.cjs +0 -1
- package/es/index-af687c16.js +0 -302
- package/es/index-b4bbc58d.js +0 -59
- package/es/index-f14354e6.cjs +0 -1
|
@@ -0,0 +1,1599 @@
|
|
|
1
|
+
import { ref as k, computed as I, defineComponent as Z, watch as ge, provide as Et, reactive as Je, toRefs as xt, openBlock as G, createElementBlock as pe, normalizeClass as H, unref as v, renderSlot as J, inject as Se, onMounted as Pe, onBeforeUnmount as At, onUpdated as Ze, createVNode as ne, Fragment as Gt, nextTick as _t, useSlots as Kt, withCtx as X, createBlock as ue, resolveDynamicComponent as Nt, normalizeStyle as We, createTextVNode as Yt, toDisplayString as it, createCommentVNode as Te, createElementVNode as at, TransitionGroup as kt, withModifiers as Re, withDirectives as st, withKeys as Fe, createSlots as Ht, useAttrs as Jt } from "vue";
|
|
2
|
+
import { x as Zt, c as Qe, a as Ve, y as Xe, z as De, u as Qt, d as Xt, b as er, E as ot, g as tr, A as rr, B as nr, v as ir } from "./use-form-common-props-f3a520d0.js";
|
|
3
|
+
import { S as lt, E as Ot, F as ar, G as sr, h as qe, b as he, d as Ue, s as St, i as Ie, c as Tt, f as ee, u as be, _ as $e, t as qt, e as or, H as lr, y as ut, w as et, v as ur, a as Y, q as me, x as fr, l as fe } from "./base-f7877059.js";
|
|
4
|
+
import { c as ze } from "./castArray-18f43497.js";
|
|
5
|
+
import { a as dr } from "./el-scrollbar-e0493906.js";
|
|
6
|
+
import { g as Ce } from "./index-35117549.js";
|
|
7
|
+
import { k as It, g as jt, s as cr, b as pr, a as tt, n as je, c as Pt, d as mr, S as vr, e as gr } from "./el-tag-5becabc9.js";
|
|
8
|
+
import { d as Me, k as rt, g as yr, e as Vt, f as hr, h as br, i as wr, j as Fr } from "./el-table-column-3c920bdd.js";
|
|
9
|
+
import { e as Er, u as xr } from "./el-popper-6126b1f6.js";
|
|
10
|
+
import { E as Ar, i as _r } from "./el-input-fac5b401.js";
|
|
11
|
+
import { C as $t, I as Ae, U as le } from "./event-09e37cc8.js";
|
|
12
|
+
function Nr(r, e) {
|
|
13
|
+
for (var t = -1, n = r == null ? 0 : r.length; ++t < n && e(r[t], t, r) !== !1; )
|
|
14
|
+
;
|
|
15
|
+
return r;
|
|
16
|
+
}
|
|
17
|
+
function Or(r, e) {
|
|
18
|
+
return r && Me(e, It(e), r);
|
|
19
|
+
}
|
|
20
|
+
function Sr(r, e) {
|
|
21
|
+
return r && Me(e, rt(e), r);
|
|
22
|
+
}
|
|
23
|
+
function Tr(r, e) {
|
|
24
|
+
return Me(r, jt(r), e);
|
|
25
|
+
}
|
|
26
|
+
var qr = Object.getOwnPropertySymbols, Ir = qr ? function(r) {
|
|
27
|
+
for (var e = []; r; )
|
|
28
|
+
Er(e, jt(r)), r = yr(r);
|
|
29
|
+
return e;
|
|
30
|
+
} : cr;
|
|
31
|
+
const Mt = Ir;
|
|
32
|
+
function jr(r, e) {
|
|
33
|
+
return Me(r, Mt(r), e);
|
|
34
|
+
}
|
|
35
|
+
function Pr(r) {
|
|
36
|
+
return pr(r, rt, Mt);
|
|
37
|
+
}
|
|
38
|
+
var Vr = Object.prototype, $r = Vr.hasOwnProperty;
|
|
39
|
+
function Mr(r) {
|
|
40
|
+
var e = r.length, t = new r.constructor(e);
|
|
41
|
+
return e && typeof r[0] == "string" && $r.call(r, "index") && (t.index = r.index, t.input = r.input), t;
|
|
42
|
+
}
|
|
43
|
+
function Lr(r, e) {
|
|
44
|
+
var t = e ? Vt(r.buffer) : r.buffer;
|
|
45
|
+
return new r.constructor(t, r.byteOffset, r.byteLength);
|
|
46
|
+
}
|
|
47
|
+
var Rr = /\w*$/;
|
|
48
|
+
function Cr(r) {
|
|
49
|
+
var e = new r.constructor(r.source, Rr.exec(r));
|
|
50
|
+
return e.lastIndex = r.lastIndex, e;
|
|
51
|
+
}
|
|
52
|
+
var ft = lt ? lt.prototype : void 0, dt = ft ? ft.valueOf : void 0;
|
|
53
|
+
function Br(r) {
|
|
54
|
+
return dt ? Object(dt.call(r)) : {};
|
|
55
|
+
}
|
|
56
|
+
var Wr = "[object Boolean]", Dr = "[object Date]", Ur = "[object Map]", zr = "[object Number]", Gr = "[object RegExp]", Kr = "[object Set]", Yr = "[object String]", kr = "[object Symbol]", Hr = "[object ArrayBuffer]", Jr = "[object DataView]", Zr = "[object Float32Array]", Qr = "[object Float64Array]", Xr = "[object Int8Array]", en = "[object Int16Array]", tn = "[object Int32Array]", rn = "[object Uint8Array]", nn = "[object Uint8ClampedArray]", an = "[object Uint16Array]", sn = "[object Uint32Array]";
|
|
57
|
+
function on(r, e, t) {
|
|
58
|
+
var n = r.constructor;
|
|
59
|
+
switch (e) {
|
|
60
|
+
case Hr:
|
|
61
|
+
return Vt(r);
|
|
62
|
+
case Wr:
|
|
63
|
+
case Dr:
|
|
64
|
+
return new n(+r);
|
|
65
|
+
case Jr:
|
|
66
|
+
return Lr(r, t);
|
|
67
|
+
case Zr:
|
|
68
|
+
case Qr:
|
|
69
|
+
case Xr:
|
|
70
|
+
case en:
|
|
71
|
+
case tn:
|
|
72
|
+
case rn:
|
|
73
|
+
case nn:
|
|
74
|
+
case an:
|
|
75
|
+
case sn:
|
|
76
|
+
return hr(r, t);
|
|
77
|
+
case Ur:
|
|
78
|
+
return new n();
|
|
79
|
+
case zr:
|
|
80
|
+
case Yr:
|
|
81
|
+
return new n(r);
|
|
82
|
+
case Gr:
|
|
83
|
+
return Cr(r);
|
|
84
|
+
case Kr:
|
|
85
|
+
return new n();
|
|
86
|
+
case kr:
|
|
87
|
+
return Br(r);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
var ln = "[object Map]";
|
|
91
|
+
function un(r) {
|
|
92
|
+
return Ot(r) && tt(r) == ln;
|
|
93
|
+
}
|
|
94
|
+
var ct = je && je.isMap, fn = ct ? Pt(ct) : un;
|
|
95
|
+
const dn = fn;
|
|
96
|
+
var cn = "[object Set]";
|
|
97
|
+
function pn(r) {
|
|
98
|
+
return Ot(r) && tt(r) == cn;
|
|
99
|
+
}
|
|
100
|
+
var pt = je && je.isSet, mn = pt ? Pt(pt) : pn;
|
|
101
|
+
const vn = mn;
|
|
102
|
+
var gn = 1, yn = 2, hn = 4, Lt = "[object Arguments]", bn = "[object Array]", wn = "[object Boolean]", Fn = "[object Date]", En = "[object Error]", Rt = "[object Function]", xn = "[object GeneratorFunction]", An = "[object Map]", _n = "[object Number]", Ct = "[object Object]", Nn = "[object RegExp]", On = "[object Set]", Sn = "[object String]", Tn = "[object Symbol]", qn = "[object WeakMap]", In = "[object ArrayBuffer]", jn = "[object DataView]", Pn = "[object Float32Array]", Vn = "[object Float64Array]", $n = "[object Int8Array]", Mn = "[object Int16Array]", Ln = "[object Int32Array]", Rn = "[object Uint8Array]", Cn = "[object Uint8ClampedArray]", Bn = "[object Uint16Array]", Wn = "[object Uint32Array]", q = {};
|
|
103
|
+
q[Lt] = q[bn] = q[In] = q[jn] = q[wn] = q[Fn] = q[Pn] = q[Vn] = q[$n] = q[Mn] = q[Ln] = q[An] = q[_n] = q[Ct] = q[Nn] = q[On] = q[Sn] = q[Tn] = q[Rn] = q[Cn] = q[Bn] = q[Wn] = !0;
|
|
104
|
+
q[En] = q[Rt] = q[qn] = !1;
|
|
105
|
+
function _e(r, e, t, n, i, s) {
|
|
106
|
+
var a, o = e & gn, u = e & yn, w = e & hn;
|
|
107
|
+
if (t && (a = i ? t(r, n, i, s) : t(r)), a !== void 0)
|
|
108
|
+
return a;
|
|
109
|
+
if (!ar(r))
|
|
110
|
+
return r;
|
|
111
|
+
var m = sr(r);
|
|
112
|
+
if (m) {
|
|
113
|
+
if (a = Mr(r), !o)
|
|
114
|
+
return br(r, a);
|
|
115
|
+
} else {
|
|
116
|
+
var b = tt(r), F = b == Rt || b == xn;
|
|
117
|
+
if (mr(r))
|
|
118
|
+
return wr(r, o);
|
|
119
|
+
if (b == Ct || b == Lt || F && !i) {
|
|
120
|
+
if (a = u || F ? {} : Fr(r), !o)
|
|
121
|
+
return u ? jr(r, Sr(a, r)) : Tr(r, Or(a, r));
|
|
122
|
+
} else {
|
|
123
|
+
if (!q[b])
|
|
124
|
+
return i ? r : {};
|
|
125
|
+
a = on(r, b, o);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
s || (s = new vr());
|
|
129
|
+
var _ = s.get(r);
|
|
130
|
+
if (_)
|
|
131
|
+
return _;
|
|
132
|
+
s.set(r, a), vn(r) ? r.forEach(function(g) {
|
|
133
|
+
a.add(_e(g, e, t, g, r, s));
|
|
134
|
+
}) : dn(r) && r.forEach(function(g, d) {
|
|
135
|
+
a.set(d, _e(g, e, t, d, r, s));
|
|
136
|
+
});
|
|
137
|
+
var O = w ? u ? Pr : gr : u ? rt : It, c = m ? void 0 : O(r);
|
|
138
|
+
return Nr(c || r, function(g, d) {
|
|
139
|
+
c && (d = g, g = r[d]), Zt(a, d, _e(g, e, t, d, r, s));
|
|
140
|
+
}), a;
|
|
141
|
+
}
|
|
142
|
+
var Dn = 4;
|
|
143
|
+
function mt(r) {
|
|
144
|
+
return _e(r, Dn);
|
|
145
|
+
}
|
|
146
|
+
const Un = 100, zn = 600, vt = {
|
|
147
|
+
beforeMount(r, e) {
|
|
148
|
+
const t = e.value, { interval: n = Un, delay: i = zn } = qe(t) ? {} : t;
|
|
149
|
+
let s, a;
|
|
150
|
+
const o = () => qe(t) ? t() : t.handler(), u = () => {
|
|
151
|
+
a && (clearTimeout(a), a = void 0), s && (clearInterval(s), s = void 0);
|
|
152
|
+
};
|
|
153
|
+
r.addEventListener("mousedown", (w) => {
|
|
154
|
+
w.button === 0 && (u(), o(), document.addEventListener("mouseup", () => u(), {
|
|
155
|
+
once: !0
|
|
156
|
+
}), a = setTimeout(() => {
|
|
157
|
+
s = setInterval(() => {
|
|
158
|
+
o();
|
|
159
|
+
}, n);
|
|
160
|
+
}, i));
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}, Gn = he({
|
|
164
|
+
size: {
|
|
165
|
+
type: String,
|
|
166
|
+
values: Qe
|
|
167
|
+
},
|
|
168
|
+
disabled: Boolean
|
|
169
|
+
}), Kn = he({
|
|
170
|
+
...Gn,
|
|
171
|
+
model: Object,
|
|
172
|
+
rules: {
|
|
173
|
+
type: Ue(Object)
|
|
174
|
+
},
|
|
175
|
+
labelPosition: {
|
|
176
|
+
type: String,
|
|
177
|
+
values: ["left", "right", "top"],
|
|
178
|
+
default: "right"
|
|
179
|
+
},
|
|
180
|
+
requireAsteriskPosition: {
|
|
181
|
+
type: String,
|
|
182
|
+
values: ["left", "right"],
|
|
183
|
+
default: "left"
|
|
184
|
+
},
|
|
185
|
+
labelWidth: {
|
|
186
|
+
type: [String, Number],
|
|
187
|
+
default: ""
|
|
188
|
+
},
|
|
189
|
+
labelSuffix: {
|
|
190
|
+
type: String,
|
|
191
|
+
default: ""
|
|
192
|
+
},
|
|
193
|
+
inline: Boolean,
|
|
194
|
+
inlineMessage: Boolean,
|
|
195
|
+
statusIcon: Boolean,
|
|
196
|
+
showMessage: {
|
|
197
|
+
type: Boolean,
|
|
198
|
+
default: !0
|
|
199
|
+
},
|
|
200
|
+
validateOnRuleChange: {
|
|
201
|
+
type: Boolean,
|
|
202
|
+
default: !0
|
|
203
|
+
},
|
|
204
|
+
hideRequiredAsterisk: Boolean,
|
|
205
|
+
scrollToError: Boolean,
|
|
206
|
+
scrollIntoViewOptions: {
|
|
207
|
+
type: [Object, Boolean]
|
|
208
|
+
}
|
|
209
|
+
}), Yn = {
|
|
210
|
+
validate: (r, e, t) => (St(r) || Ie(r)) && Tt(e) && Ie(t)
|
|
211
|
+
}, kn = "ElForm";
|
|
212
|
+
function Hn() {
|
|
213
|
+
const r = k([]), e = I(() => {
|
|
214
|
+
if (!r.value.length)
|
|
215
|
+
return "0";
|
|
216
|
+
const s = Math.max(...r.value);
|
|
217
|
+
return s ? `${s}px` : "";
|
|
218
|
+
});
|
|
219
|
+
function t(s) {
|
|
220
|
+
const a = r.value.indexOf(s);
|
|
221
|
+
return a === -1 && e.value === "0" && ee(kn, `unexpected width ${s}`), a;
|
|
222
|
+
}
|
|
223
|
+
function n(s, a) {
|
|
224
|
+
if (s && a) {
|
|
225
|
+
const o = t(a);
|
|
226
|
+
r.value.splice(o, 1, s);
|
|
227
|
+
} else
|
|
228
|
+
s && r.value.push(s);
|
|
229
|
+
}
|
|
230
|
+
function i(s) {
|
|
231
|
+
const a = t(s);
|
|
232
|
+
a > -1 && r.value.splice(a, 1);
|
|
233
|
+
}
|
|
234
|
+
return {
|
|
235
|
+
autoLabelWidth: e,
|
|
236
|
+
registerLabelWidth: n,
|
|
237
|
+
deregisterLabelWidth: i
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
const Ee = (r, e) => {
|
|
241
|
+
const t = ze(e);
|
|
242
|
+
return t.length > 0 ? r.filter((n) => n.prop && t.includes(n.prop)) : r;
|
|
243
|
+
}, Ne = "ElForm", Jn = Z({
|
|
244
|
+
name: Ne
|
|
245
|
+
}), Zn = /* @__PURE__ */ Z({
|
|
246
|
+
...Jn,
|
|
247
|
+
props: Kn,
|
|
248
|
+
emits: Yn,
|
|
249
|
+
setup(r, { expose: e, emit: t }) {
|
|
250
|
+
const n = r, i = [], s = Ve(), a = be("form"), o = I(() => {
|
|
251
|
+
const { labelPosition: f, inline: p } = n;
|
|
252
|
+
return [
|
|
253
|
+
a.b(),
|
|
254
|
+
a.m(s.value || "default"),
|
|
255
|
+
{
|
|
256
|
+
[a.m(`label-${f}`)]: f,
|
|
257
|
+
[a.m("inline")]: p
|
|
258
|
+
}
|
|
259
|
+
];
|
|
260
|
+
}), u = (f) => i.find((p) => p.prop === f), w = (f) => {
|
|
261
|
+
i.push(f);
|
|
262
|
+
}, m = (f) => {
|
|
263
|
+
f.prop && i.splice(i.indexOf(f), 1);
|
|
264
|
+
}, b = (f = []) => {
|
|
265
|
+
if (!n.model) {
|
|
266
|
+
ee(Ne, "model is required for resetFields to work.");
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
Ee(i, f).forEach((p) => p.resetField());
|
|
270
|
+
}, F = (f = []) => {
|
|
271
|
+
Ee(i, f).forEach((p) => p.clearValidate());
|
|
272
|
+
}, _ = I(() => {
|
|
273
|
+
const f = !!n.model;
|
|
274
|
+
return f || ee(Ne, "model is required for validate to work."), f;
|
|
275
|
+
}), O = (f) => {
|
|
276
|
+
if (i.length === 0)
|
|
277
|
+
return [];
|
|
278
|
+
const p = Ee(i, f);
|
|
279
|
+
return p.length ? p : (ee(Ne, "please pass correct props!"), []);
|
|
280
|
+
}, c = async (f) => d(void 0, f), g = async (f = []) => {
|
|
281
|
+
if (!_.value)
|
|
282
|
+
return !1;
|
|
283
|
+
const p = O(f);
|
|
284
|
+
if (p.length === 0)
|
|
285
|
+
return !0;
|
|
286
|
+
let N = {};
|
|
287
|
+
for (const x of p)
|
|
288
|
+
try {
|
|
289
|
+
await x.validate(""), x.validateState === "error" && x.resetField();
|
|
290
|
+
} catch (V) {
|
|
291
|
+
N = {
|
|
292
|
+
...N,
|
|
293
|
+
...V
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
return Object.keys(N).length === 0 ? !0 : Promise.reject(N);
|
|
297
|
+
}, d = async (f = [], p) => {
|
|
298
|
+
const N = !qe(p);
|
|
299
|
+
try {
|
|
300
|
+
const x = await g(f);
|
|
301
|
+
return x === !0 && await (p == null ? void 0 : p(x)), x;
|
|
302
|
+
} catch (x) {
|
|
303
|
+
if (x instanceof Error)
|
|
304
|
+
throw x;
|
|
305
|
+
const V = x;
|
|
306
|
+
return n.scrollToError && P(Object.keys(V)[0]), await (p == null ? void 0 : p(!1, V)), N && Promise.reject(V);
|
|
307
|
+
}
|
|
308
|
+
}, P = (f) => {
|
|
309
|
+
var p;
|
|
310
|
+
const N = Ee(i, f)[0];
|
|
311
|
+
N && ((p = N.$el) == null || p.scrollIntoView(n.scrollIntoViewOptions));
|
|
312
|
+
};
|
|
313
|
+
return ge(() => n.rules, () => {
|
|
314
|
+
n.validateOnRuleChange && c().catch((f) => ee(f));
|
|
315
|
+
}, { deep: !0, flush: "post" }), Et(Xe, Je({
|
|
316
|
+
...xt(n),
|
|
317
|
+
emit: t,
|
|
318
|
+
resetFields: b,
|
|
319
|
+
clearValidate: F,
|
|
320
|
+
validateField: d,
|
|
321
|
+
getField: u,
|
|
322
|
+
addField: w,
|
|
323
|
+
removeField: m,
|
|
324
|
+
...Hn()
|
|
325
|
+
})), e({
|
|
326
|
+
validate: c,
|
|
327
|
+
validateField: d,
|
|
328
|
+
resetFields: b,
|
|
329
|
+
clearValidate: F,
|
|
330
|
+
scrollToField: P,
|
|
331
|
+
fields: i
|
|
332
|
+
}), (f, p) => (G(), pe("form", {
|
|
333
|
+
class: H(v(o))
|
|
334
|
+
}, [
|
|
335
|
+
J(f.$slots, "default")
|
|
336
|
+
], 2));
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
var Qn = /* @__PURE__ */ $e(Zn, [["__file", "form.vue"]]);
|
|
340
|
+
function re() {
|
|
341
|
+
return re = Object.assign ? Object.assign.bind() : function(r) {
|
|
342
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
343
|
+
var t = arguments[e];
|
|
344
|
+
for (var n in t)
|
|
345
|
+
Object.prototype.hasOwnProperty.call(t, n) && (r[n] = t[n]);
|
|
346
|
+
}
|
|
347
|
+
return r;
|
|
348
|
+
}, re.apply(this, arguments);
|
|
349
|
+
}
|
|
350
|
+
function Xn(r, e) {
|
|
351
|
+
r.prototype = Object.create(e.prototype), r.prototype.constructor = r, ye(r, e);
|
|
352
|
+
}
|
|
353
|
+
function Ge(r) {
|
|
354
|
+
return Ge = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
355
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
356
|
+
}, Ge(r);
|
|
357
|
+
}
|
|
358
|
+
function ye(r, e) {
|
|
359
|
+
return ye = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, i) {
|
|
360
|
+
return n.__proto__ = i, n;
|
|
361
|
+
}, ye(r, e);
|
|
362
|
+
}
|
|
363
|
+
function ei() {
|
|
364
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
365
|
+
return !1;
|
|
366
|
+
if (typeof Proxy == "function")
|
|
367
|
+
return !0;
|
|
368
|
+
try {
|
|
369
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
370
|
+
})), !0;
|
|
371
|
+
} catch {
|
|
372
|
+
return !1;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function Oe(r, e, t) {
|
|
376
|
+
return ei() ? Oe = Reflect.construct.bind() : Oe = function(i, s, a) {
|
|
377
|
+
var o = [null];
|
|
378
|
+
o.push.apply(o, s);
|
|
379
|
+
var u = Function.bind.apply(i, o), w = new u();
|
|
380
|
+
return a && ye(w, a.prototype), w;
|
|
381
|
+
}, Oe.apply(null, arguments);
|
|
382
|
+
}
|
|
383
|
+
function ti(r) {
|
|
384
|
+
return Function.toString.call(r).indexOf("[native code]") !== -1;
|
|
385
|
+
}
|
|
386
|
+
function Ke(r) {
|
|
387
|
+
var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
388
|
+
return Ke = function(n) {
|
|
389
|
+
if (n === null || !ti(n))
|
|
390
|
+
return n;
|
|
391
|
+
if (typeof n != "function")
|
|
392
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
393
|
+
if (typeof e < "u") {
|
|
394
|
+
if (e.has(n))
|
|
395
|
+
return e.get(n);
|
|
396
|
+
e.set(n, i);
|
|
397
|
+
}
|
|
398
|
+
function i() {
|
|
399
|
+
return Oe(n, arguments, Ge(this).constructor);
|
|
400
|
+
}
|
|
401
|
+
return i.prototype = Object.create(n.prototype, {
|
|
402
|
+
constructor: {
|
|
403
|
+
value: i,
|
|
404
|
+
enumerable: !1,
|
|
405
|
+
writable: !0,
|
|
406
|
+
configurable: !0
|
|
407
|
+
}
|
|
408
|
+
}), ye(i, n);
|
|
409
|
+
}, Ke(r);
|
|
410
|
+
}
|
|
411
|
+
var ri = /%[sdj%]/g, Bt = function() {
|
|
412
|
+
};
|
|
413
|
+
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (Bt = function(e, t) {
|
|
414
|
+
typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && t.every(function(n) {
|
|
415
|
+
return typeof n == "string";
|
|
416
|
+
}) && console.warn(e, t);
|
|
417
|
+
});
|
|
418
|
+
function Ye(r) {
|
|
419
|
+
if (!r || !r.length)
|
|
420
|
+
return null;
|
|
421
|
+
var e = {};
|
|
422
|
+
return r.forEach(function(t) {
|
|
423
|
+
var n = t.field;
|
|
424
|
+
e[n] = e[n] || [], e[n].push(t);
|
|
425
|
+
}), e;
|
|
426
|
+
}
|
|
427
|
+
function D(r) {
|
|
428
|
+
for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), n = 1; n < e; n++)
|
|
429
|
+
t[n - 1] = arguments[n];
|
|
430
|
+
var i = 0, s = t.length;
|
|
431
|
+
if (typeof r == "function")
|
|
432
|
+
return r.apply(null, t);
|
|
433
|
+
if (typeof r == "string") {
|
|
434
|
+
var a = r.replace(ri, function(o) {
|
|
435
|
+
if (o === "%%")
|
|
436
|
+
return "%";
|
|
437
|
+
if (i >= s)
|
|
438
|
+
return o;
|
|
439
|
+
switch (o) {
|
|
440
|
+
case "%s":
|
|
441
|
+
return String(t[i++]);
|
|
442
|
+
case "%d":
|
|
443
|
+
return Number(t[i++]);
|
|
444
|
+
case "%j":
|
|
445
|
+
try {
|
|
446
|
+
return JSON.stringify(t[i++]);
|
|
447
|
+
} catch {
|
|
448
|
+
return "[Circular]";
|
|
449
|
+
}
|
|
450
|
+
break;
|
|
451
|
+
default:
|
|
452
|
+
return o;
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
return a;
|
|
456
|
+
}
|
|
457
|
+
return r;
|
|
458
|
+
}
|
|
459
|
+
function ni(r) {
|
|
460
|
+
return r === "string" || r === "url" || r === "hex" || r === "email" || r === "date" || r === "pattern";
|
|
461
|
+
}
|
|
462
|
+
function $(r, e) {
|
|
463
|
+
return !!(r == null || e === "array" && Array.isArray(r) && !r.length || ni(e) && typeof r == "string" && !r);
|
|
464
|
+
}
|
|
465
|
+
function ii(r, e, t) {
|
|
466
|
+
var n = [], i = 0, s = r.length;
|
|
467
|
+
function a(o) {
|
|
468
|
+
n.push.apply(n, o || []), i++, i === s && t(n);
|
|
469
|
+
}
|
|
470
|
+
r.forEach(function(o) {
|
|
471
|
+
e(o, a);
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
function gt(r, e, t) {
|
|
475
|
+
var n = 0, i = r.length;
|
|
476
|
+
function s(a) {
|
|
477
|
+
if (a && a.length) {
|
|
478
|
+
t(a);
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
var o = n;
|
|
482
|
+
n = n + 1, o < i ? e(r[o], s) : t([]);
|
|
483
|
+
}
|
|
484
|
+
s([]);
|
|
485
|
+
}
|
|
486
|
+
function ai(r) {
|
|
487
|
+
var e = [];
|
|
488
|
+
return Object.keys(r).forEach(function(t) {
|
|
489
|
+
e.push.apply(e, r[t] || []);
|
|
490
|
+
}), e;
|
|
491
|
+
}
|
|
492
|
+
var yt = /* @__PURE__ */ function(r) {
|
|
493
|
+
Xn(e, r);
|
|
494
|
+
function e(t, n) {
|
|
495
|
+
var i;
|
|
496
|
+
return i = r.call(this, "Async Validation Error") || this, i.errors = t, i.fields = n, i;
|
|
497
|
+
}
|
|
498
|
+
return e;
|
|
499
|
+
}(/* @__PURE__ */ Ke(Error));
|
|
500
|
+
function si(r, e, t, n, i) {
|
|
501
|
+
if (e.first) {
|
|
502
|
+
var s = new Promise(function(F, _) {
|
|
503
|
+
var O = function(d) {
|
|
504
|
+
return n(d), d.length ? _(new yt(d, Ye(d))) : F(i);
|
|
505
|
+
}, c = ai(r);
|
|
506
|
+
gt(c, t, O);
|
|
507
|
+
});
|
|
508
|
+
return s.catch(function(F) {
|
|
509
|
+
return F;
|
|
510
|
+
}), s;
|
|
511
|
+
}
|
|
512
|
+
var a = e.firstFields === !0 ? Object.keys(r) : e.firstFields || [], o = Object.keys(r), u = o.length, w = 0, m = [], b = new Promise(function(F, _) {
|
|
513
|
+
var O = function(g) {
|
|
514
|
+
if (m.push.apply(m, g), w++, w === u)
|
|
515
|
+
return n(m), m.length ? _(new yt(m, Ye(m))) : F(i);
|
|
516
|
+
};
|
|
517
|
+
o.length || (n(m), F(i)), o.forEach(function(c) {
|
|
518
|
+
var g = r[c];
|
|
519
|
+
a.indexOf(c) !== -1 ? gt(g, t, O) : ii(g, t, O);
|
|
520
|
+
});
|
|
521
|
+
});
|
|
522
|
+
return b.catch(function(F) {
|
|
523
|
+
return F;
|
|
524
|
+
}), b;
|
|
525
|
+
}
|
|
526
|
+
function oi(r) {
|
|
527
|
+
return !!(r && r.message !== void 0);
|
|
528
|
+
}
|
|
529
|
+
function li(r, e) {
|
|
530
|
+
for (var t = r, n = 0; n < e.length; n++) {
|
|
531
|
+
if (t == null)
|
|
532
|
+
return t;
|
|
533
|
+
t = t[e[n]];
|
|
534
|
+
}
|
|
535
|
+
return t;
|
|
536
|
+
}
|
|
537
|
+
function ht(r, e) {
|
|
538
|
+
return function(t) {
|
|
539
|
+
var n;
|
|
540
|
+
return r.fullFields ? n = li(e, r.fullFields) : n = e[t.field || r.fullField], oi(t) ? (t.field = t.field || r.fullField, t.fieldValue = n, t) : {
|
|
541
|
+
message: typeof t == "function" ? t() : t,
|
|
542
|
+
fieldValue: n,
|
|
543
|
+
field: t.field || r.fullField
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
function bt(r, e) {
|
|
548
|
+
if (e) {
|
|
549
|
+
for (var t in e)
|
|
550
|
+
if (e.hasOwnProperty(t)) {
|
|
551
|
+
var n = e[t];
|
|
552
|
+
typeof n == "object" && typeof r[t] == "object" ? r[t] = re({}, r[t], n) : r[t] = n;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return r;
|
|
556
|
+
}
|
|
557
|
+
var Wt = function(e, t, n, i, s, a) {
|
|
558
|
+
e.required && (!n.hasOwnProperty(e.field) || $(t, a || e.type)) && i.push(D(s.messages.required, e.fullField));
|
|
559
|
+
}, ui = function(e, t, n, i, s) {
|
|
560
|
+
(/^\s+$/.test(t) || t === "") && i.push(D(s.messages.whitespace, e.fullField));
|
|
561
|
+
}, xe, fi = function() {
|
|
562
|
+
if (xe)
|
|
563
|
+
return xe;
|
|
564
|
+
var r = "[a-fA-F\\d:]", e = function(p) {
|
|
565
|
+
return p && p.includeBoundaries ? "(?:(?<=\\s|^)(?=" + r + ")|(?<=" + r + ")(?=\\s|$))" : "";
|
|
566
|
+
}, t = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", n = "[a-fA-F\\d]{1,4}", i = (`
|
|
567
|
+
(?:
|
|
568
|
+
(?:` + n + ":){7}(?:" + n + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
569
|
+
(?:` + n + ":){6}(?:" + t + "|:" + n + `|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|
570
|
+
(?:` + n + ":){5}(?::" + t + "|(?::" + n + `){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
|
|
571
|
+
(?:` + n + ":){4}(?:(?::" + n + "){0,1}:" + t + "|(?::" + n + `){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
|
|
572
|
+
(?:` + n + ":){3}(?:(?::" + n + "){0,2}:" + t + "|(?::" + n + `){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
|
|
573
|
+
(?:` + n + ":){2}(?:(?::" + n + "){0,3}:" + t + "|(?::" + n + `){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
|
574
|
+
(?:` + n + ":){1}(?:(?::" + n + "){0,4}:" + t + "|(?::" + n + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
575
|
+
(?::(?:(?::` + n + "){0,5}:" + t + "|(?::" + n + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
576
|
+
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
577
|
+
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), s = new RegExp("(?:^" + t + "$)|(?:^" + i + "$)"), a = new RegExp("^" + t + "$"), o = new RegExp("^" + i + "$"), u = function(p) {
|
|
578
|
+
return p && p.exact ? s : new RegExp("(?:" + e(p) + t + e(p) + ")|(?:" + e(p) + i + e(p) + ")", "g");
|
|
579
|
+
};
|
|
580
|
+
u.v4 = function(f) {
|
|
581
|
+
return f && f.exact ? a : new RegExp("" + e(f) + t + e(f), "g");
|
|
582
|
+
}, u.v6 = function(f) {
|
|
583
|
+
return f && f.exact ? o : new RegExp("" + e(f) + i + e(f), "g");
|
|
584
|
+
};
|
|
585
|
+
var w = "(?:(?:[a-z]+:)?//)", m = "(?:\\S+(?::\\S*)?@)?", b = u.v4().source, F = u.v6().source, _ = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", O = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", c = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", g = "(?::\\d{2,5})?", d = '(?:[/?#][^\\s"]*)?', P = "(?:" + w + "|www\\.)" + m + "(?:localhost|" + b + "|" + F + "|" + _ + O + c + ")" + g + d;
|
|
586
|
+
return xe = new RegExp("(?:^" + P + "$)", "i"), xe;
|
|
587
|
+
}, wt = {
|
|
588
|
+
// http://emailregex.com/
|
|
589
|
+
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
|
|
590
|
+
// url: new RegExp(
|
|
591
|
+
// '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
|
|
592
|
+
// 'i',
|
|
593
|
+
// ),
|
|
594
|
+
hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
|
|
595
|
+
}, ce = {
|
|
596
|
+
integer: function(e) {
|
|
597
|
+
return ce.number(e) && parseInt(e, 10) === e;
|
|
598
|
+
},
|
|
599
|
+
float: function(e) {
|
|
600
|
+
return ce.number(e) && !ce.integer(e);
|
|
601
|
+
},
|
|
602
|
+
array: function(e) {
|
|
603
|
+
return Array.isArray(e);
|
|
604
|
+
},
|
|
605
|
+
regexp: function(e) {
|
|
606
|
+
if (e instanceof RegExp)
|
|
607
|
+
return !0;
|
|
608
|
+
try {
|
|
609
|
+
return !!new RegExp(e);
|
|
610
|
+
} catch {
|
|
611
|
+
return !1;
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
date: function(e) {
|
|
615
|
+
return typeof e.getTime == "function" && typeof e.getMonth == "function" && typeof e.getYear == "function" && !isNaN(e.getTime());
|
|
616
|
+
},
|
|
617
|
+
number: function(e) {
|
|
618
|
+
return isNaN(e) ? !1 : typeof e == "number";
|
|
619
|
+
},
|
|
620
|
+
object: function(e) {
|
|
621
|
+
return typeof e == "object" && !ce.array(e);
|
|
622
|
+
},
|
|
623
|
+
method: function(e) {
|
|
624
|
+
return typeof e == "function";
|
|
625
|
+
},
|
|
626
|
+
email: function(e) {
|
|
627
|
+
return typeof e == "string" && e.length <= 320 && !!e.match(wt.email);
|
|
628
|
+
},
|
|
629
|
+
url: function(e) {
|
|
630
|
+
return typeof e == "string" && e.length <= 2048 && !!e.match(fi());
|
|
631
|
+
},
|
|
632
|
+
hex: function(e) {
|
|
633
|
+
return typeof e == "string" && !!e.match(wt.hex);
|
|
634
|
+
}
|
|
635
|
+
}, di = function(e, t, n, i, s) {
|
|
636
|
+
if (e.required && t === void 0) {
|
|
637
|
+
Wt(e, t, n, i, s);
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
var a = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], o = e.type;
|
|
641
|
+
a.indexOf(o) > -1 ? ce[o](t) || i.push(D(s.messages.types[o], e.fullField, e.type)) : o && typeof t !== e.type && i.push(D(s.messages.types[o], e.fullField, e.type));
|
|
642
|
+
}, ci = function(e, t, n, i, s) {
|
|
643
|
+
var a = typeof e.len == "number", o = typeof e.min == "number", u = typeof e.max == "number", w = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, m = t, b = null, F = typeof t == "number", _ = typeof t == "string", O = Array.isArray(t);
|
|
644
|
+
if (F ? b = "number" : _ ? b = "string" : O && (b = "array"), !b)
|
|
645
|
+
return !1;
|
|
646
|
+
O && (m = t.length), _ && (m = t.replace(w, "_").length), a ? m !== e.len && i.push(D(s.messages[b].len, e.fullField, e.len)) : o && !u && m < e.min ? i.push(D(s.messages[b].min, e.fullField, e.min)) : u && !o && m > e.max ? i.push(D(s.messages[b].max, e.fullField, e.max)) : o && u && (m < e.min || m > e.max) && i.push(D(s.messages[b].range, e.fullField, e.min, e.max));
|
|
647
|
+
}, oe = "enum", pi = function(e, t, n, i, s) {
|
|
648
|
+
e[oe] = Array.isArray(e[oe]) ? e[oe] : [], e[oe].indexOf(t) === -1 && i.push(D(s.messages[oe], e.fullField, e[oe].join(", ")));
|
|
649
|
+
}, mi = function(e, t, n, i, s) {
|
|
650
|
+
if (e.pattern) {
|
|
651
|
+
if (e.pattern instanceof RegExp)
|
|
652
|
+
e.pattern.lastIndex = 0, e.pattern.test(t) || i.push(D(s.messages.pattern.mismatch, e.fullField, t, e.pattern));
|
|
653
|
+
else if (typeof e.pattern == "string") {
|
|
654
|
+
var a = new RegExp(e.pattern);
|
|
655
|
+
a.test(t) || i.push(D(s.messages.pattern.mismatch, e.fullField, t, e.pattern));
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}, E = {
|
|
659
|
+
required: Wt,
|
|
660
|
+
whitespace: ui,
|
|
661
|
+
type: di,
|
|
662
|
+
range: ci,
|
|
663
|
+
enum: pi,
|
|
664
|
+
pattern: mi
|
|
665
|
+
}, vi = function(e, t, n, i, s) {
|
|
666
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
667
|
+
if (o) {
|
|
668
|
+
if ($(t, "string") && !e.required)
|
|
669
|
+
return n();
|
|
670
|
+
E.required(e, t, i, a, s, "string"), $(t, "string") || (E.type(e, t, i, a, s), E.range(e, t, i, a, s), E.pattern(e, t, i, a, s), e.whitespace === !0 && E.whitespace(e, t, i, a, s));
|
|
671
|
+
}
|
|
672
|
+
n(a);
|
|
673
|
+
}, gi = function(e, t, n, i, s) {
|
|
674
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
675
|
+
if (o) {
|
|
676
|
+
if ($(t) && !e.required)
|
|
677
|
+
return n();
|
|
678
|
+
E.required(e, t, i, a, s), t !== void 0 && E.type(e, t, i, a, s);
|
|
679
|
+
}
|
|
680
|
+
n(a);
|
|
681
|
+
}, yi = function(e, t, n, i, s) {
|
|
682
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
683
|
+
if (o) {
|
|
684
|
+
if (t === "" && (t = void 0), $(t) && !e.required)
|
|
685
|
+
return n();
|
|
686
|
+
E.required(e, t, i, a, s), t !== void 0 && (E.type(e, t, i, a, s), E.range(e, t, i, a, s));
|
|
687
|
+
}
|
|
688
|
+
n(a);
|
|
689
|
+
}, hi = function(e, t, n, i, s) {
|
|
690
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
691
|
+
if (o) {
|
|
692
|
+
if ($(t) && !e.required)
|
|
693
|
+
return n();
|
|
694
|
+
E.required(e, t, i, a, s), t !== void 0 && E.type(e, t, i, a, s);
|
|
695
|
+
}
|
|
696
|
+
n(a);
|
|
697
|
+
}, bi = function(e, t, n, i, s) {
|
|
698
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
699
|
+
if (o) {
|
|
700
|
+
if ($(t) && !e.required)
|
|
701
|
+
return n();
|
|
702
|
+
E.required(e, t, i, a, s), $(t) || E.type(e, t, i, a, s);
|
|
703
|
+
}
|
|
704
|
+
n(a);
|
|
705
|
+
}, wi = function(e, t, n, i, s) {
|
|
706
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
707
|
+
if (o) {
|
|
708
|
+
if ($(t) && !e.required)
|
|
709
|
+
return n();
|
|
710
|
+
E.required(e, t, i, a, s), t !== void 0 && (E.type(e, t, i, a, s), E.range(e, t, i, a, s));
|
|
711
|
+
}
|
|
712
|
+
n(a);
|
|
713
|
+
}, Fi = function(e, t, n, i, s) {
|
|
714
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
715
|
+
if (o) {
|
|
716
|
+
if ($(t) && !e.required)
|
|
717
|
+
return n();
|
|
718
|
+
E.required(e, t, i, a, s), t !== void 0 && (E.type(e, t, i, a, s), E.range(e, t, i, a, s));
|
|
719
|
+
}
|
|
720
|
+
n(a);
|
|
721
|
+
}, Ei = function(e, t, n, i, s) {
|
|
722
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
723
|
+
if (o) {
|
|
724
|
+
if (t == null && !e.required)
|
|
725
|
+
return n();
|
|
726
|
+
E.required(e, t, i, a, s, "array"), t != null && (E.type(e, t, i, a, s), E.range(e, t, i, a, s));
|
|
727
|
+
}
|
|
728
|
+
n(a);
|
|
729
|
+
}, xi = function(e, t, n, i, s) {
|
|
730
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
731
|
+
if (o) {
|
|
732
|
+
if ($(t) && !e.required)
|
|
733
|
+
return n();
|
|
734
|
+
E.required(e, t, i, a, s), t !== void 0 && E.type(e, t, i, a, s);
|
|
735
|
+
}
|
|
736
|
+
n(a);
|
|
737
|
+
}, Ai = "enum", _i = function(e, t, n, i, s) {
|
|
738
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
739
|
+
if (o) {
|
|
740
|
+
if ($(t) && !e.required)
|
|
741
|
+
return n();
|
|
742
|
+
E.required(e, t, i, a, s), t !== void 0 && E[Ai](e, t, i, a, s);
|
|
743
|
+
}
|
|
744
|
+
n(a);
|
|
745
|
+
}, Ni = function(e, t, n, i, s) {
|
|
746
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
747
|
+
if (o) {
|
|
748
|
+
if ($(t, "string") && !e.required)
|
|
749
|
+
return n();
|
|
750
|
+
E.required(e, t, i, a, s), $(t, "string") || E.pattern(e, t, i, a, s);
|
|
751
|
+
}
|
|
752
|
+
n(a);
|
|
753
|
+
}, Oi = function(e, t, n, i, s) {
|
|
754
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
755
|
+
if (o) {
|
|
756
|
+
if ($(t, "date") && !e.required)
|
|
757
|
+
return n();
|
|
758
|
+
if (E.required(e, t, i, a, s), !$(t, "date")) {
|
|
759
|
+
var u;
|
|
760
|
+
t instanceof Date ? u = t : u = new Date(t), E.type(e, u, i, a, s), u && E.range(e, u.getTime(), i, a, s);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
n(a);
|
|
764
|
+
}, Si = function(e, t, n, i, s) {
|
|
765
|
+
var a = [], o = Array.isArray(t) ? "array" : typeof t;
|
|
766
|
+
E.required(e, t, i, a, s, o), n(a);
|
|
767
|
+
}, Be = function(e, t, n, i, s) {
|
|
768
|
+
var a = e.type, o = [], u = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
769
|
+
if (u) {
|
|
770
|
+
if ($(t, a) && !e.required)
|
|
771
|
+
return n();
|
|
772
|
+
E.required(e, t, i, o, s, a), $(t, a) || E.type(e, t, i, o, s);
|
|
773
|
+
}
|
|
774
|
+
n(o);
|
|
775
|
+
}, Ti = function(e, t, n, i, s) {
|
|
776
|
+
var a = [], o = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
777
|
+
if (o) {
|
|
778
|
+
if ($(t) && !e.required)
|
|
779
|
+
return n();
|
|
780
|
+
E.required(e, t, i, a, s);
|
|
781
|
+
}
|
|
782
|
+
n(a);
|
|
783
|
+
}, ve = {
|
|
784
|
+
string: vi,
|
|
785
|
+
method: gi,
|
|
786
|
+
number: yi,
|
|
787
|
+
boolean: hi,
|
|
788
|
+
regexp: bi,
|
|
789
|
+
integer: wi,
|
|
790
|
+
float: Fi,
|
|
791
|
+
array: Ei,
|
|
792
|
+
object: xi,
|
|
793
|
+
enum: _i,
|
|
794
|
+
pattern: Ni,
|
|
795
|
+
date: Oi,
|
|
796
|
+
url: Be,
|
|
797
|
+
hex: Be,
|
|
798
|
+
email: Be,
|
|
799
|
+
required: Si,
|
|
800
|
+
any: Ti
|
|
801
|
+
};
|
|
802
|
+
function ke() {
|
|
803
|
+
return {
|
|
804
|
+
default: "Validation error on field %s",
|
|
805
|
+
required: "%s is required",
|
|
806
|
+
enum: "%s must be one of %s",
|
|
807
|
+
whitespace: "%s cannot be empty",
|
|
808
|
+
date: {
|
|
809
|
+
format: "%s date %s is invalid for format %s",
|
|
810
|
+
parse: "%s date could not be parsed, %s is invalid ",
|
|
811
|
+
invalid: "%s date %s is invalid"
|
|
812
|
+
},
|
|
813
|
+
types: {
|
|
814
|
+
string: "%s is not a %s",
|
|
815
|
+
method: "%s is not a %s (function)",
|
|
816
|
+
array: "%s is not an %s",
|
|
817
|
+
object: "%s is not an %s",
|
|
818
|
+
number: "%s is not a %s",
|
|
819
|
+
date: "%s is not a %s",
|
|
820
|
+
boolean: "%s is not a %s",
|
|
821
|
+
integer: "%s is not an %s",
|
|
822
|
+
float: "%s is not a %s",
|
|
823
|
+
regexp: "%s is not a valid %s",
|
|
824
|
+
email: "%s is not a valid %s",
|
|
825
|
+
url: "%s is not a valid %s",
|
|
826
|
+
hex: "%s is not a valid %s"
|
|
827
|
+
},
|
|
828
|
+
string: {
|
|
829
|
+
len: "%s must be exactly %s characters",
|
|
830
|
+
min: "%s must be at least %s characters",
|
|
831
|
+
max: "%s cannot be longer than %s characters",
|
|
832
|
+
range: "%s must be between %s and %s characters"
|
|
833
|
+
},
|
|
834
|
+
number: {
|
|
835
|
+
len: "%s must equal %s",
|
|
836
|
+
min: "%s cannot be less than %s",
|
|
837
|
+
max: "%s cannot be greater than %s",
|
|
838
|
+
range: "%s must be between %s and %s"
|
|
839
|
+
},
|
|
840
|
+
array: {
|
|
841
|
+
len: "%s must be exactly %s in length",
|
|
842
|
+
min: "%s cannot be less than %s in length",
|
|
843
|
+
max: "%s cannot be greater than %s in length",
|
|
844
|
+
range: "%s must be between %s and %s in length"
|
|
845
|
+
},
|
|
846
|
+
pattern: {
|
|
847
|
+
mismatch: "%s value %s does not match pattern %s"
|
|
848
|
+
},
|
|
849
|
+
clone: function() {
|
|
850
|
+
var e = JSON.parse(JSON.stringify(this));
|
|
851
|
+
return e.clone = this.clone, e;
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
var He = ke(), we = /* @__PURE__ */ function() {
|
|
856
|
+
function r(t) {
|
|
857
|
+
this.rules = null, this._messages = He, this.define(t);
|
|
858
|
+
}
|
|
859
|
+
var e = r.prototype;
|
|
860
|
+
return e.define = function(n) {
|
|
861
|
+
var i = this;
|
|
862
|
+
if (!n)
|
|
863
|
+
throw new Error("Cannot configure a schema with no rules");
|
|
864
|
+
if (typeof n != "object" || Array.isArray(n))
|
|
865
|
+
throw new Error("Rules must be an object");
|
|
866
|
+
this.rules = {}, Object.keys(n).forEach(function(s) {
|
|
867
|
+
var a = n[s];
|
|
868
|
+
i.rules[s] = Array.isArray(a) ? a : [a];
|
|
869
|
+
});
|
|
870
|
+
}, e.messages = function(n) {
|
|
871
|
+
return n && (this._messages = bt(ke(), n)), this._messages;
|
|
872
|
+
}, e.validate = function(n, i, s) {
|
|
873
|
+
var a = this;
|
|
874
|
+
i === void 0 && (i = {}), s === void 0 && (s = function() {
|
|
875
|
+
});
|
|
876
|
+
var o = n, u = i, w = s;
|
|
877
|
+
if (typeof u == "function" && (w = u, u = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
878
|
+
return w && w(null, o), Promise.resolve(o);
|
|
879
|
+
function m(c) {
|
|
880
|
+
var g = [], d = {};
|
|
881
|
+
function P(p) {
|
|
882
|
+
if (Array.isArray(p)) {
|
|
883
|
+
var N;
|
|
884
|
+
g = (N = g).concat.apply(N, p);
|
|
885
|
+
} else
|
|
886
|
+
g.push(p);
|
|
887
|
+
}
|
|
888
|
+
for (var f = 0; f < c.length; f++)
|
|
889
|
+
P(c[f]);
|
|
890
|
+
g.length ? (d = Ye(g), w(g, d)) : w(null, o);
|
|
891
|
+
}
|
|
892
|
+
if (u.messages) {
|
|
893
|
+
var b = this.messages();
|
|
894
|
+
b === He && (b = ke()), bt(b, u.messages), u.messages = b;
|
|
895
|
+
} else
|
|
896
|
+
u.messages = this.messages();
|
|
897
|
+
var F = {}, _ = u.keys || Object.keys(this.rules);
|
|
898
|
+
_.forEach(function(c) {
|
|
899
|
+
var g = a.rules[c], d = o[c];
|
|
900
|
+
g.forEach(function(P) {
|
|
901
|
+
var f = P;
|
|
902
|
+
typeof f.transform == "function" && (o === n && (o = re({}, o)), d = o[c] = f.transform(d)), typeof f == "function" ? f = {
|
|
903
|
+
validator: f
|
|
904
|
+
} : f = re({}, f), f.validator = a.getValidationMethod(f), f.validator && (f.field = c, f.fullField = f.fullField || c, f.type = a.getType(f), F[c] = F[c] || [], F[c].push({
|
|
905
|
+
rule: f,
|
|
906
|
+
value: d,
|
|
907
|
+
source: o,
|
|
908
|
+
field: c
|
|
909
|
+
}));
|
|
910
|
+
});
|
|
911
|
+
});
|
|
912
|
+
var O = {};
|
|
913
|
+
return si(F, u, function(c, g) {
|
|
914
|
+
var d = c.rule, P = (d.type === "object" || d.type === "array") && (typeof d.fields == "object" || typeof d.defaultField == "object");
|
|
915
|
+
P = P && (d.required || !d.required && c.value), d.field = c.field;
|
|
916
|
+
function f(x, V) {
|
|
917
|
+
return re({}, V, {
|
|
918
|
+
fullField: d.fullField + "." + x,
|
|
919
|
+
fullFields: d.fullFields ? [].concat(d.fullFields, [x]) : [x]
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
function p(x) {
|
|
923
|
+
x === void 0 && (x = []);
|
|
924
|
+
var V = Array.isArray(x) ? x : [x];
|
|
925
|
+
!u.suppressWarning && V.length && r.warning("async-validator:", V), V.length && d.message !== void 0 && (V = [].concat(d.message));
|
|
926
|
+
var B = V.map(ht(d, o));
|
|
927
|
+
if (u.first && B.length)
|
|
928
|
+
return O[d.field] = 1, g(B);
|
|
929
|
+
if (!P)
|
|
930
|
+
g(B);
|
|
931
|
+
else {
|
|
932
|
+
if (d.required && !c.value)
|
|
933
|
+
return d.message !== void 0 ? B = [].concat(d.message).map(ht(d, o)) : u.error && (B = [u.error(d, D(u.messages.required, d.field))]), g(B);
|
|
934
|
+
var z = {};
|
|
935
|
+
d.defaultField && Object.keys(c.value).map(function(W) {
|
|
936
|
+
z[W] = d.defaultField;
|
|
937
|
+
}), z = re({}, z, c.rule.fields);
|
|
938
|
+
var ie = {};
|
|
939
|
+
Object.keys(z).forEach(function(W) {
|
|
940
|
+
var C = z[W], de = Array.isArray(C) ? C : [C];
|
|
941
|
+
ie[W] = de.map(f.bind(null, W));
|
|
942
|
+
});
|
|
943
|
+
var Q = new r(ie);
|
|
944
|
+
Q.messages(u.messages), c.rule.options && (c.rule.options.messages = u.messages, c.rule.options.error = u.error), Q.validate(c.value, c.rule.options || u, function(W) {
|
|
945
|
+
var C = [];
|
|
946
|
+
B && B.length && C.push.apply(C, B), W && W.length && C.push.apply(C, W), g(C.length ? C : null);
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
var N;
|
|
951
|
+
if (d.asyncValidator)
|
|
952
|
+
N = d.asyncValidator(d, c.value, p, c.source, u);
|
|
953
|
+
else if (d.validator) {
|
|
954
|
+
try {
|
|
955
|
+
N = d.validator(d, c.value, p, c.source, u);
|
|
956
|
+
} catch (x) {
|
|
957
|
+
console.error == null || console.error(x), u.suppressValidatorError || setTimeout(function() {
|
|
958
|
+
throw x;
|
|
959
|
+
}, 0), p(x.message);
|
|
960
|
+
}
|
|
961
|
+
N === !0 ? p() : N === !1 ? p(typeof d.message == "function" ? d.message(d.fullField || d.field) : d.message || (d.fullField || d.field) + " fails") : N instanceof Array ? p(N) : N instanceof Error && p(N.message);
|
|
962
|
+
}
|
|
963
|
+
N && N.then && N.then(function() {
|
|
964
|
+
return p();
|
|
965
|
+
}, function(x) {
|
|
966
|
+
return p(x);
|
|
967
|
+
});
|
|
968
|
+
}, function(c) {
|
|
969
|
+
m(c);
|
|
970
|
+
}, o);
|
|
971
|
+
}, e.getType = function(n) {
|
|
972
|
+
if (n.type === void 0 && n.pattern instanceof RegExp && (n.type = "pattern"), typeof n.validator != "function" && n.type && !ve.hasOwnProperty(n.type))
|
|
973
|
+
throw new Error(D("Unknown rule type %s", n.type));
|
|
974
|
+
return n.type || "string";
|
|
975
|
+
}, e.getValidationMethod = function(n) {
|
|
976
|
+
if (typeof n.validator == "function")
|
|
977
|
+
return n.validator;
|
|
978
|
+
var i = Object.keys(n), s = i.indexOf("message");
|
|
979
|
+
return s !== -1 && i.splice(s, 1), i.length === 1 && i[0] === "required" ? ve.required : ve[this.getType(n)] || void 0;
|
|
980
|
+
}, r;
|
|
981
|
+
}();
|
|
982
|
+
we.register = function(e, t) {
|
|
983
|
+
if (typeof t != "function")
|
|
984
|
+
throw new Error("Cannot register a validator by type, validator is not a function");
|
|
985
|
+
ve[e] = t;
|
|
986
|
+
};
|
|
987
|
+
we.warning = Bt;
|
|
988
|
+
we.messages = He;
|
|
989
|
+
we.validators = ve;
|
|
990
|
+
const qi = [
|
|
991
|
+
"",
|
|
992
|
+
"error",
|
|
993
|
+
"validating",
|
|
994
|
+
"success"
|
|
995
|
+
], Ii = he({
|
|
996
|
+
label: String,
|
|
997
|
+
labelWidth: {
|
|
998
|
+
type: [String, Number],
|
|
999
|
+
default: ""
|
|
1000
|
+
},
|
|
1001
|
+
labelPosition: {
|
|
1002
|
+
type: String,
|
|
1003
|
+
values: ["left", "right", "top", ""],
|
|
1004
|
+
default: ""
|
|
1005
|
+
},
|
|
1006
|
+
prop: {
|
|
1007
|
+
type: Ue([String, Array])
|
|
1008
|
+
},
|
|
1009
|
+
required: {
|
|
1010
|
+
type: Boolean,
|
|
1011
|
+
default: void 0
|
|
1012
|
+
},
|
|
1013
|
+
rules: {
|
|
1014
|
+
type: Ue([Object, Array])
|
|
1015
|
+
},
|
|
1016
|
+
error: String,
|
|
1017
|
+
validateStatus: {
|
|
1018
|
+
type: String,
|
|
1019
|
+
values: qi
|
|
1020
|
+
},
|
|
1021
|
+
for: String,
|
|
1022
|
+
inlineMessage: {
|
|
1023
|
+
type: [String, Boolean],
|
|
1024
|
+
default: ""
|
|
1025
|
+
},
|
|
1026
|
+
showMessage: {
|
|
1027
|
+
type: Boolean,
|
|
1028
|
+
default: !0
|
|
1029
|
+
},
|
|
1030
|
+
size: {
|
|
1031
|
+
type: String,
|
|
1032
|
+
values: Qe
|
|
1033
|
+
}
|
|
1034
|
+
}), Ft = "ElLabelWrap";
|
|
1035
|
+
var ji = Z({
|
|
1036
|
+
name: Ft,
|
|
1037
|
+
props: {
|
|
1038
|
+
isAutoWidth: Boolean,
|
|
1039
|
+
updateAll: Boolean
|
|
1040
|
+
},
|
|
1041
|
+
setup(r, {
|
|
1042
|
+
slots: e
|
|
1043
|
+
}) {
|
|
1044
|
+
const t = Se(Xe, void 0), n = Se(De);
|
|
1045
|
+
n || qt(Ft, "usage: <el-form-item><label-wrap /></el-form-item>");
|
|
1046
|
+
const i = be("form"), s = k(), a = k(0), o = () => {
|
|
1047
|
+
var m;
|
|
1048
|
+
if ((m = s.value) != null && m.firstElementChild) {
|
|
1049
|
+
const b = window.getComputedStyle(s.value.firstElementChild).width;
|
|
1050
|
+
return Math.ceil(Number.parseFloat(b));
|
|
1051
|
+
} else
|
|
1052
|
+
return 0;
|
|
1053
|
+
}, u = (m = "update") => {
|
|
1054
|
+
_t(() => {
|
|
1055
|
+
e.default && r.isAutoWidth && (m === "update" ? a.value = o() : m === "remove" && (t == null || t.deregisterLabelWidth(a.value)));
|
|
1056
|
+
});
|
|
1057
|
+
}, w = () => u("update");
|
|
1058
|
+
return Pe(() => {
|
|
1059
|
+
w();
|
|
1060
|
+
}), At(() => {
|
|
1061
|
+
u("remove");
|
|
1062
|
+
}), Ze(() => w()), ge(a, (m, b) => {
|
|
1063
|
+
r.updateAll && (t == null || t.registerLabelWidth(m, b));
|
|
1064
|
+
}), dr(I(() => {
|
|
1065
|
+
var m, b;
|
|
1066
|
+
return (b = (m = s.value) == null ? void 0 : m.firstElementChild) != null ? b : null;
|
|
1067
|
+
}), w), () => {
|
|
1068
|
+
var m, b;
|
|
1069
|
+
if (!e)
|
|
1070
|
+
return null;
|
|
1071
|
+
const {
|
|
1072
|
+
isAutoWidth: F
|
|
1073
|
+
} = r;
|
|
1074
|
+
if (F) {
|
|
1075
|
+
const _ = t == null ? void 0 : t.autoLabelWidth, O = n == null ? void 0 : n.hasLabel, c = {};
|
|
1076
|
+
if (O && _ && _ !== "auto") {
|
|
1077
|
+
const g = Math.max(0, Number.parseInt(_, 10) - a.value), P = (n.labelPosition || t.labelPosition) === "left" ? "marginRight" : "marginLeft";
|
|
1078
|
+
g && (c[P] = `${g}px`);
|
|
1079
|
+
}
|
|
1080
|
+
return ne("div", {
|
|
1081
|
+
ref: s,
|
|
1082
|
+
class: [i.be("item", "label-wrap")],
|
|
1083
|
+
style: c
|
|
1084
|
+
}, [(m = e.default) == null ? void 0 : m.call(e)]);
|
|
1085
|
+
} else
|
|
1086
|
+
return ne(Gt, {
|
|
1087
|
+
ref: s
|
|
1088
|
+
}, [(b = e.default) == null ? void 0 : b.call(e)]);
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
});
|
|
1092
|
+
const Pi = Z({
|
|
1093
|
+
name: "ElFormItem"
|
|
1094
|
+
}), Vi = /* @__PURE__ */ Z({
|
|
1095
|
+
...Pi,
|
|
1096
|
+
props: Ii,
|
|
1097
|
+
setup(r, { expose: e }) {
|
|
1098
|
+
const t = r, n = Kt(), i = Se(Xe, void 0), s = Se(De, void 0), a = Ve(void 0, { formItem: !1 }), o = be("form-item"), u = or().value, w = k([]), m = k(""), b = lr(m, 100), F = k(""), _ = k();
|
|
1099
|
+
let O, c = !1;
|
|
1100
|
+
const g = I(() => t.labelPosition || (i == null ? void 0 : i.labelPosition)), d = I(() => {
|
|
1101
|
+
if (g.value === "top")
|
|
1102
|
+
return {};
|
|
1103
|
+
const y = ut(t.labelWidth || (i == null ? void 0 : i.labelWidth) || "");
|
|
1104
|
+
return y ? { width: y } : {};
|
|
1105
|
+
}), P = I(() => {
|
|
1106
|
+
if (g.value === "top" || i != null && i.inline)
|
|
1107
|
+
return {};
|
|
1108
|
+
if (!t.label && !t.labelWidth && ie)
|
|
1109
|
+
return {};
|
|
1110
|
+
const y = ut(t.labelWidth || (i == null ? void 0 : i.labelWidth) || "");
|
|
1111
|
+
return !t.label && !n.label ? { marginLeft: y } : {};
|
|
1112
|
+
}), f = I(() => [
|
|
1113
|
+
o.b(),
|
|
1114
|
+
o.m(a.value),
|
|
1115
|
+
o.is("error", m.value === "error"),
|
|
1116
|
+
o.is("validating", m.value === "validating"),
|
|
1117
|
+
o.is("success", m.value === "success"),
|
|
1118
|
+
o.is("required", l.value || t.required),
|
|
1119
|
+
o.is("no-asterisk", i == null ? void 0 : i.hideRequiredAsterisk),
|
|
1120
|
+
(i == null ? void 0 : i.requireAsteriskPosition) === "right" ? "asterisk-right" : "asterisk-left",
|
|
1121
|
+
{
|
|
1122
|
+
[o.m("feedback")]: i == null ? void 0 : i.statusIcon,
|
|
1123
|
+
[o.m(`label-${g.value}`)]: g.value
|
|
1124
|
+
}
|
|
1125
|
+
]), p = I(() => Tt(t.inlineMessage) ? t.inlineMessage : (i == null ? void 0 : i.inlineMessage) || !1), N = I(() => [
|
|
1126
|
+
o.e("error"),
|
|
1127
|
+
{ [o.em("error", "inline")]: p.value }
|
|
1128
|
+
]), x = I(() => t.prop ? Ie(t.prop) ? t.prop : t.prop.join(".") : ""), V = I(() => !!(t.label || n.label)), B = I(() => t.for || (w.value.length === 1 ? w.value[0] : void 0)), z = I(() => !B.value && V.value), ie = !!s, Q = I(() => {
|
|
1129
|
+
const y = i == null ? void 0 : i.model;
|
|
1130
|
+
if (!(!y || !t.prop))
|
|
1131
|
+
return Ce(y, t.prop).value;
|
|
1132
|
+
}), W = I(() => {
|
|
1133
|
+
const { required: y } = t, S = [];
|
|
1134
|
+
t.rules && S.push(...ze(t.rules));
|
|
1135
|
+
const R = i == null ? void 0 : i.rules;
|
|
1136
|
+
if (R && t.prop) {
|
|
1137
|
+
const L = Ce(R, t.prop).value;
|
|
1138
|
+
L && S.push(...ze(L));
|
|
1139
|
+
}
|
|
1140
|
+
if (y !== void 0) {
|
|
1141
|
+
const L = S.map((K, se) => [K, se]).filter(([K]) => Object.keys(K).includes("required"));
|
|
1142
|
+
if (L.length > 0)
|
|
1143
|
+
for (const [K, se] of L)
|
|
1144
|
+
K.required !== y && (S[se] = { ...K, required: y });
|
|
1145
|
+
else
|
|
1146
|
+
S.push({ required: y });
|
|
1147
|
+
}
|
|
1148
|
+
return S;
|
|
1149
|
+
}), C = I(() => W.value.length > 0), de = (y) => W.value.filter((R) => !R.trigger || !y ? !0 : St(R.trigger) ? R.trigger.includes(y) : R.trigger === y).map(({ trigger: R, ...L }) => L), l = I(() => W.value.some((y) => y.required)), h = I(() => {
|
|
1150
|
+
var y;
|
|
1151
|
+
return b.value === "error" && t.showMessage && ((y = i == null ? void 0 : i.showMessage) != null ? y : !0);
|
|
1152
|
+
}), A = I(() => `${t.label || ""}${(i == null ? void 0 : i.labelSuffix) || ""}`), T = (y) => {
|
|
1153
|
+
m.value = y;
|
|
1154
|
+
}, j = (y) => {
|
|
1155
|
+
var S, R;
|
|
1156
|
+
const { errors: L, fields: K } = y;
|
|
1157
|
+
(!L || !K) && console.error(y), T("error"), F.value = L ? (R = (S = L == null ? void 0 : L[0]) == null ? void 0 : S.message) != null ? R : `${t.prop} is required` : "", i == null || i.emit("validate", t.prop, !1, F.value);
|
|
1158
|
+
}, U = () => {
|
|
1159
|
+
T("success"), i == null || i.emit("validate", t.prop, !0, "");
|
|
1160
|
+
}, ae = async (y) => {
|
|
1161
|
+
const S = x.value;
|
|
1162
|
+
return new we({
|
|
1163
|
+
[S]: y
|
|
1164
|
+
}).validate({ [S]: Q.value }, { firstFields: !0 }).then(() => (U(), !0)).catch((L) => (j(L), Promise.reject(L)));
|
|
1165
|
+
}, te = async (y, S) => {
|
|
1166
|
+
if (c || !t.prop)
|
|
1167
|
+
return !1;
|
|
1168
|
+
const R = qe(S);
|
|
1169
|
+
if (!C.value)
|
|
1170
|
+
return S == null || S(!1), !1;
|
|
1171
|
+
const L = de(y);
|
|
1172
|
+
return L.length === 0 ? (S == null || S(!0), !0) : (T("validating"), ae(L).then(() => (S == null || S(!0), !0)).catch((K) => {
|
|
1173
|
+
const { fields: se } = K;
|
|
1174
|
+
return S == null || S(!1, se), R ? !1 : Promise.reject(se);
|
|
1175
|
+
}));
|
|
1176
|
+
}, M = () => {
|
|
1177
|
+
T(""), F.value = "", c = !1;
|
|
1178
|
+
}, nt = async () => {
|
|
1179
|
+
const y = i == null ? void 0 : i.model;
|
|
1180
|
+
if (!y || !t.prop)
|
|
1181
|
+
return;
|
|
1182
|
+
const S = Ce(y, t.prop);
|
|
1183
|
+
c = !0, S.value = mt(O), await _t(), M(), c = !1;
|
|
1184
|
+
}, Ut = (y) => {
|
|
1185
|
+
w.value.includes(y) || w.value.push(y);
|
|
1186
|
+
}, zt = (y) => {
|
|
1187
|
+
w.value = w.value.filter((S) => S !== y);
|
|
1188
|
+
};
|
|
1189
|
+
ge(() => t.error, (y) => {
|
|
1190
|
+
F.value = y || "", T(y ? "error" : "");
|
|
1191
|
+
}, { immediate: !0 }), ge(() => t.validateStatus, (y) => T(y || ""));
|
|
1192
|
+
const Le = Je({
|
|
1193
|
+
...xt(t),
|
|
1194
|
+
$el: _,
|
|
1195
|
+
size: a,
|
|
1196
|
+
validateState: m,
|
|
1197
|
+
labelId: u,
|
|
1198
|
+
inputIds: w,
|
|
1199
|
+
isGroup: z,
|
|
1200
|
+
hasLabel: V,
|
|
1201
|
+
fieldValue: Q,
|
|
1202
|
+
addInputId: Ut,
|
|
1203
|
+
removeInputId: zt,
|
|
1204
|
+
resetField: nt,
|
|
1205
|
+
clearValidate: M,
|
|
1206
|
+
validate: te
|
|
1207
|
+
});
|
|
1208
|
+
return Et(De, Le), Pe(() => {
|
|
1209
|
+
t.prop && (i == null || i.addField(Le), O = mt(Q.value));
|
|
1210
|
+
}), At(() => {
|
|
1211
|
+
i == null || i.removeField(Le);
|
|
1212
|
+
}), e({
|
|
1213
|
+
size: a,
|
|
1214
|
+
validateMessage: F,
|
|
1215
|
+
validateState: m,
|
|
1216
|
+
validate: te,
|
|
1217
|
+
clearValidate: M,
|
|
1218
|
+
resetField: nt
|
|
1219
|
+
}), (y, S) => {
|
|
1220
|
+
var R;
|
|
1221
|
+
return G(), pe("div", {
|
|
1222
|
+
ref_key: "formItemRef",
|
|
1223
|
+
ref: _,
|
|
1224
|
+
class: H(v(f)),
|
|
1225
|
+
role: v(z) ? "group" : void 0,
|
|
1226
|
+
"aria-labelledby": v(z) ? v(u) : void 0
|
|
1227
|
+
}, [
|
|
1228
|
+
ne(v(ji), {
|
|
1229
|
+
"is-auto-width": v(d).width === "auto",
|
|
1230
|
+
"update-all": ((R = v(i)) == null ? void 0 : R.labelWidth) === "auto"
|
|
1231
|
+
}, {
|
|
1232
|
+
default: X(() => [
|
|
1233
|
+
v(V) ? (G(), ue(Nt(v(B) ? "label" : "div"), {
|
|
1234
|
+
key: 0,
|
|
1235
|
+
id: v(u),
|
|
1236
|
+
for: v(B),
|
|
1237
|
+
class: H(v(o).e("label")),
|
|
1238
|
+
style: We(v(d))
|
|
1239
|
+
}, {
|
|
1240
|
+
default: X(() => [
|
|
1241
|
+
J(y.$slots, "label", { label: v(A) }, () => [
|
|
1242
|
+
Yt(it(v(A)), 1)
|
|
1243
|
+
])
|
|
1244
|
+
]),
|
|
1245
|
+
_: 3
|
|
1246
|
+
}, 8, ["id", "for", "class", "style"])) : Te("v-if", !0)
|
|
1247
|
+
]),
|
|
1248
|
+
_: 3
|
|
1249
|
+
}, 8, ["is-auto-width", "update-all"]),
|
|
1250
|
+
at("div", {
|
|
1251
|
+
class: H(v(o).e("content")),
|
|
1252
|
+
style: We(v(P))
|
|
1253
|
+
}, [
|
|
1254
|
+
J(y.$slots, "default"),
|
|
1255
|
+
ne(kt, {
|
|
1256
|
+
name: `${v(o).namespace.value}-zoom-in-top`
|
|
1257
|
+
}, {
|
|
1258
|
+
default: X(() => [
|
|
1259
|
+
v(h) ? J(y.$slots, "error", {
|
|
1260
|
+
key: 0,
|
|
1261
|
+
error: F.value
|
|
1262
|
+
}, () => [
|
|
1263
|
+
at("div", {
|
|
1264
|
+
class: H(v(N))
|
|
1265
|
+
}, it(F.value), 3)
|
|
1266
|
+
]) : Te("v-if", !0)
|
|
1267
|
+
]),
|
|
1268
|
+
_: 3
|
|
1269
|
+
}, 8, ["name"])
|
|
1270
|
+
], 6)
|
|
1271
|
+
], 10, ["role", "aria-labelledby"]);
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
});
|
|
1275
|
+
var Dt = /* @__PURE__ */ $e(Vi, [["__file", "form-item.vue"]]);
|
|
1276
|
+
const ta = et(Qn, {
|
|
1277
|
+
FormItem: Dt
|
|
1278
|
+
}), ra = ur(Dt), $i = he({
|
|
1279
|
+
id: {
|
|
1280
|
+
type: String,
|
|
1281
|
+
default: void 0
|
|
1282
|
+
},
|
|
1283
|
+
step: {
|
|
1284
|
+
type: Number,
|
|
1285
|
+
default: 1
|
|
1286
|
+
},
|
|
1287
|
+
stepStrictly: Boolean,
|
|
1288
|
+
max: {
|
|
1289
|
+
type: Number,
|
|
1290
|
+
default: Number.POSITIVE_INFINITY
|
|
1291
|
+
},
|
|
1292
|
+
min: {
|
|
1293
|
+
type: Number,
|
|
1294
|
+
default: Number.NEGATIVE_INFINITY
|
|
1295
|
+
},
|
|
1296
|
+
modelValue: Number,
|
|
1297
|
+
readonly: Boolean,
|
|
1298
|
+
disabled: Boolean,
|
|
1299
|
+
size: Qt,
|
|
1300
|
+
controls: {
|
|
1301
|
+
type: Boolean,
|
|
1302
|
+
default: !0
|
|
1303
|
+
},
|
|
1304
|
+
controlsPosition: {
|
|
1305
|
+
type: String,
|
|
1306
|
+
default: "",
|
|
1307
|
+
values: ["", "right"]
|
|
1308
|
+
},
|
|
1309
|
+
valueOnClear: {
|
|
1310
|
+
type: [String, Number, null],
|
|
1311
|
+
validator: (r) => r === null || Y(r) || ["min", "max"].includes(r),
|
|
1312
|
+
default: null
|
|
1313
|
+
},
|
|
1314
|
+
name: String,
|
|
1315
|
+
placeholder: String,
|
|
1316
|
+
precision: {
|
|
1317
|
+
type: Number,
|
|
1318
|
+
validator: (r) => r >= 0 && r === Number.parseInt(`${r}`, 10)
|
|
1319
|
+
},
|
|
1320
|
+
validateEvent: {
|
|
1321
|
+
type: Boolean,
|
|
1322
|
+
default: !0
|
|
1323
|
+
},
|
|
1324
|
+
...xr(["ariaLabel"])
|
|
1325
|
+
}), Mi = {
|
|
1326
|
+
[$t]: (r, e) => e !== r,
|
|
1327
|
+
blur: (r) => r instanceof FocusEvent,
|
|
1328
|
+
focus: (r) => r instanceof FocusEvent,
|
|
1329
|
+
[Ae]: (r) => Y(r) || me(r),
|
|
1330
|
+
[le]: (r) => Y(r) || me(r)
|
|
1331
|
+
}, Li = Z({
|
|
1332
|
+
name: "ElInputNumber"
|
|
1333
|
+
}), Ri = /* @__PURE__ */ Z({
|
|
1334
|
+
...Li,
|
|
1335
|
+
props: $i,
|
|
1336
|
+
emits: Mi,
|
|
1337
|
+
setup(r, { expose: e, emit: t }) {
|
|
1338
|
+
const n = r, { t: i } = fr(), s = be("input-number"), a = k(), o = Je({
|
|
1339
|
+
currentValue: n.modelValue,
|
|
1340
|
+
userInput: null
|
|
1341
|
+
}), { formItem: u } = Xt(), w = I(() => Y(n.modelValue) && n.modelValue <= n.min), m = I(() => Y(n.modelValue) && n.modelValue >= n.max), b = I(() => {
|
|
1342
|
+
const l = d(n.step);
|
|
1343
|
+
return fe(n.precision) ? Math.max(d(n.modelValue), l) : (l > n.precision && ee("InputNumber", "precision should not be less than the decimal places of step"), n.precision);
|
|
1344
|
+
}), F = I(() => n.controls && n.controlsPosition === "right"), _ = Ve(), O = er(), c = I(() => {
|
|
1345
|
+
if (o.userInput !== null)
|
|
1346
|
+
return o.userInput;
|
|
1347
|
+
let l = o.currentValue;
|
|
1348
|
+
if (me(l))
|
|
1349
|
+
return "";
|
|
1350
|
+
if (Y(l)) {
|
|
1351
|
+
if (Number.isNaN(l))
|
|
1352
|
+
return "";
|
|
1353
|
+
fe(n.precision) || (l = l.toFixed(n.precision));
|
|
1354
|
+
}
|
|
1355
|
+
return l;
|
|
1356
|
+
}), g = (l, h) => {
|
|
1357
|
+
if (fe(h) && (h = b.value), h === 0)
|
|
1358
|
+
return Math.round(l);
|
|
1359
|
+
let A = String(l);
|
|
1360
|
+
const T = A.indexOf(".");
|
|
1361
|
+
if (T === -1 || !A.replace(".", "").split("")[T + h])
|
|
1362
|
+
return l;
|
|
1363
|
+
const ae = A.length;
|
|
1364
|
+
return A.charAt(ae - 1) === "5" && (A = `${A.slice(0, Math.max(0, ae - 1))}6`), Number.parseFloat(Number(A).toFixed(h));
|
|
1365
|
+
}, d = (l) => {
|
|
1366
|
+
if (me(l))
|
|
1367
|
+
return 0;
|
|
1368
|
+
const h = l.toString(), A = h.indexOf(".");
|
|
1369
|
+
let T = 0;
|
|
1370
|
+
return A !== -1 && (T = h.length - A - 1), T;
|
|
1371
|
+
}, P = (l, h = 1) => Y(l) ? g(l + n.step * h) : o.currentValue, f = () => {
|
|
1372
|
+
if (n.readonly || O.value || m.value)
|
|
1373
|
+
return;
|
|
1374
|
+
const l = Number(c.value) || 0, h = P(l);
|
|
1375
|
+
x(h), t(Ae, o.currentValue), C();
|
|
1376
|
+
}, p = () => {
|
|
1377
|
+
if (n.readonly || O.value || w.value)
|
|
1378
|
+
return;
|
|
1379
|
+
const l = Number(c.value) || 0, h = P(l, -1);
|
|
1380
|
+
x(h), t(Ae, o.currentValue), C();
|
|
1381
|
+
}, N = (l, h) => {
|
|
1382
|
+
const { max: A, min: T, step: j, precision: U, stepStrictly: ae, valueOnClear: te } = n;
|
|
1383
|
+
A < T && qt("InputNumber", "min should not be greater than max.");
|
|
1384
|
+
let M = Number(l);
|
|
1385
|
+
if (me(l) || Number.isNaN(M))
|
|
1386
|
+
return null;
|
|
1387
|
+
if (l === "") {
|
|
1388
|
+
if (te === null)
|
|
1389
|
+
return null;
|
|
1390
|
+
M = Ie(te) ? { min: T, max: A }[te] : te;
|
|
1391
|
+
}
|
|
1392
|
+
return ae && (M = g(Math.round(M / j) * j, U), M !== l && h && t(le, M)), fe(U) || (M = g(M, U)), (M > A || M < T) && (M = M > A ? A : T, h && t(le, M)), M;
|
|
1393
|
+
}, x = (l, h = !0) => {
|
|
1394
|
+
var A;
|
|
1395
|
+
const T = o.currentValue, j = N(l);
|
|
1396
|
+
if (!h) {
|
|
1397
|
+
t(le, j);
|
|
1398
|
+
return;
|
|
1399
|
+
}
|
|
1400
|
+
T === j && l || (o.userInput = null, t(le, j), T !== j && t($t, j, T), n.validateEvent && ((A = u == null ? void 0 : u.validate) == null || A.call(u, "change").catch((U) => ee(U))), o.currentValue = j);
|
|
1401
|
+
}, V = (l) => {
|
|
1402
|
+
o.userInput = l;
|
|
1403
|
+
const h = l === "" ? null : Number(l);
|
|
1404
|
+
t(Ae, h), x(h, !1);
|
|
1405
|
+
}, B = (l) => {
|
|
1406
|
+
const h = l !== "" ? Number(l) : "";
|
|
1407
|
+
(Y(h) && !Number.isNaN(h) || l === "") && x(h), C(), o.userInput = null;
|
|
1408
|
+
}, z = () => {
|
|
1409
|
+
var l, h;
|
|
1410
|
+
(h = (l = a.value) == null ? void 0 : l.focus) == null || h.call(l);
|
|
1411
|
+
}, ie = () => {
|
|
1412
|
+
var l, h;
|
|
1413
|
+
(h = (l = a.value) == null ? void 0 : l.blur) == null || h.call(l);
|
|
1414
|
+
}, Q = (l) => {
|
|
1415
|
+
t("focus", l);
|
|
1416
|
+
}, W = (l) => {
|
|
1417
|
+
var h, A;
|
|
1418
|
+
o.userInput = null, _r() && o.currentValue === null && ((h = a.value) != null && h.input) && (a.value.input.value = ""), t("blur", l), n.validateEvent && ((A = u == null ? void 0 : u.validate) == null || A.call(u, "blur").catch((T) => ee(T)));
|
|
1419
|
+
}, C = () => {
|
|
1420
|
+
o.currentValue !== n.modelValue && (o.currentValue = n.modelValue);
|
|
1421
|
+
}, de = (l) => {
|
|
1422
|
+
document.activeElement === l.target && l.preventDefault();
|
|
1423
|
+
};
|
|
1424
|
+
return ge(() => n.modelValue, (l, h) => {
|
|
1425
|
+
const A = N(l, !0);
|
|
1426
|
+
o.userInput === null && A !== h && (o.currentValue = A);
|
|
1427
|
+
}, { immediate: !0 }), Pe(() => {
|
|
1428
|
+
var l;
|
|
1429
|
+
const { min: h, max: A, modelValue: T } = n, j = (l = a.value) == null ? void 0 : l.input;
|
|
1430
|
+
if (j.setAttribute("role", "spinbutton"), Number.isFinite(A) ? j.setAttribute("aria-valuemax", String(A)) : j.removeAttribute("aria-valuemax"), Number.isFinite(h) ? j.setAttribute("aria-valuemin", String(h)) : j.removeAttribute("aria-valuemin"), j.setAttribute("aria-valuenow", o.currentValue || o.currentValue === 0 ? String(o.currentValue) : ""), j.setAttribute("aria-disabled", String(O.value)), !Y(T) && T != null) {
|
|
1431
|
+
let U = Number(T);
|
|
1432
|
+
Number.isNaN(U) && (U = null), t(le, U);
|
|
1433
|
+
}
|
|
1434
|
+
j.addEventListener("wheel", de, { passive: !1 });
|
|
1435
|
+
}), Ze(() => {
|
|
1436
|
+
var l, h;
|
|
1437
|
+
const A = (l = a.value) == null ? void 0 : l.input;
|
|
1438
|
+
A == null || A.setAttribute("aria-valuenow", `${(h = o.currentValue) != null ? h : ""}`);
|
|
1439
|
+
}), e({
|
|
1440
|
+
focus: z,
|
|
1441
|
+
blur: ie
|
|
1442
|
+
}), (l, h) => (G(), pe("div", {
|
|
1443
|
+
class: H([
|
|
1444
|
+
v(s).b(),
|
|
1445
|
+
v(s).m(v(_)),
|
|
1446
|
+
v(s).is("disabled", v(O)),
|
|
1447
|
+
v(s).is("without-controls", !l.controls),
|
|
1448
|
+
v(s).is("controls-right", v(F))
|
|
1449
|
+
]),
|
|
1450
|
+
onDragstart: Re(() => {
|
|
1451
|
+
}, ["prevent"])
|
|
1452
|
+
}, [
|
|
1453
|
+
l.controls ? st((G(), pe("span", {
|
|
1454
|
+
key: 0,
|
|
1455
|
+
role: "button",
|
|
1456
|
+
"aria-label": v(i)("el.inputNumber.decrease"),
|
|
1457
|
+
class: H([v(s).e("decrease"), v(s).is("disabled", v(w))]),
|
|
1458
|
+
onKeydown: Fe(p, ["enter"])
|
|
1459
|
+
}, [
|
|
1460
|
+
J(l.$slots, "decrease-icon", {}, () => [
|
|
1461
|
+
ne(v(ot), null, {
|
|
1462
|
+
default: X(() => [
|
|
1463
|
+
v(F) ? (G(), ue(v(tr), { key: 0 })) : (G(), ue(v(rr), { key: 1 }))
|
|
1464
|
+
]),
|
|
1465
|
+
_: 1
|
|
1466
|
+
})
|
|
1467
|
+
])
|
|
1468
|
+
], 42, ["aria-label", "onKeydown"])), [
|
|
1469
|
+
[v(vt), p]
|
|
1470
|
+
]) : Te("v-if", !0),
|
|
1471
|
+
l.controls ? st((G(), pe("span", {
|
|
1472
|
+
key: 1,
|
|
1473
|
+
role: "button",
|
|
1474
|
+
"aria-label": v(i)("el.inputNumber.increase"),
|
|
1475
|
+
class: H([v(s).e("increase"), v(s).is("disabled", v(m))]),
|
|
1476
|
+
onKeydown: Fe(f, ["enter"])
|
|
1477
|
+
}, [
|
|
1478
|
+
J(l.$slots, "increase-icon", {}, () => [
|
|
1479
|
+
ne(v(ot), null, {
|
|
1480
|
+
default: X(() => [
|
|
1481
|
+
v(F) ? (G(), ue(v(nr), { key: 0 })) : (G(), ue(v(ir), { key: 1 }))
|
|
1482
|
+
]),
|
|
1483
|
+
_: 1
|
|
1484
|
+
})
|
|
1485
|
+
])
|
|
1486
|
+
], 42, ["aria-label", "onKeydown"])), [
|
|
1487
|
+
[v(vt), f]
|
|
1488
|
+
]) : Te("v-if", !0),
|
|
1489
|
+
ne(v(Ar), {
|
|
1490
|
+
id: l.id,
|
|
1491
|
+
ref_key: "input",
|
|
1492
|
+
ref: a,
|
|
1493
|
+
type: "number",
|
|
1494
|
+
step: l.step,
|
|
1495
|
+
"model-value": v(c),
|
|
1496
|
+
placeholder: l.placeholder,
|
|
1497
|
+
readonly: l.readonly,
|
|
1498
|
+
disabled: v(O),
|
|
1499
|
+
size: v(_),
|
|
1500
|
+
max: l.max,
|
|
1501
|
+
min: l.min,
|
|
1502
|
+
name: l.name,
|
|
1503
|
+
"aria-label": l.ariaLabel,
|
|
1504
|
+
"validate-event": !1,
|
|
1505
|
+
onKeydown: [
|
|
1506
|
+
Fe(Re(f, ["prevent"]), ["up"]),
|
|
1507
|
+
Fe(Re(p, ["prevent"]), ["down"])
|
|
1508
|
+
],
|
|
1509
|
+
onBlur: W,
|
|
1510
|
+
onFocus: Q,
|
|
1511
|
+
onInput: V,
|
|
1512
|
+
onChange: B
|
|
1513
|
+
}, Ht({
|
|
1514
|
+
_: 2
|
|
1515
|
+
}, [
|
|
1516
|
+
l.$slots.prefix ? {
|
|
1517
|
+
name: "prefix",
|
|
1518
|
+
fn: X(() => [
|
|
1519
|
+
J(l.$slots, "prefix")
|
|
1520
|
+
])
|
|
1521
|
+
} : void 0,
|
|
1522
|
+
l.$slots.suffix ? {
|
|
1523
|
+
name: "suffix",
|
|
1524
|
+
fn: X(() => [
|
|
1525
|
+
J(l.$slots, "suffix")
|
|
1526
|
+
])
|
|
1527
|
+
} : void 0
|
|
1528
|
+
]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"])
|
|
1529
|
+
], 42, ["onDragstart"]));
|
|
1530
|
+
}
|
|
1531
|
+
});
|
|
1532
|
+
var Ci = /* @__PURE__ */ $e(Ri, [["__file", "input-number.vue"]]);
|
|
1533
|
+
const na = et(Ci), Bi = he({
|
|
1534
|
+
type: {
|
|
1535
|
+
type: String,
|
|
1536
|
+
values: ["primary", "success", "info", "warning", "danger", ""],
|
|
1537
|
+
default: ""
|
|
1538
|
+
},
|
|
1539
|
+
size: {
|
|
1540
|
+
type: String,
|
|
1541
|
+
values: Qe,
|
|
1542
|
+
default: ""
|
|
1543
|
+
},
|
|
1544
|
+
truncated: Boolean,
|
|
1545
|
+
lineClamp: {
|
|
1546
|
+
type: [String, Number]
|
|
1547
|
+
},
|
|
1548
|
+
tag: {
|
|
1549
|
+
type: String,
|
|
1550
|
+
default: "span"
|
|
1551
|
+
}
|
|
1552
|
+
}), Wi = Z({
|
|
1553
|
+
name: "ElText"
|
|
1554
|
+
}), Di = /* @__PURE__ */ Z({
|
|
1555
|
+
...Wi,
|
|
1556
|
+
props: Bi,
|
|
1557
|
+
setup(r) {
|
|
1558
|
+
const e = r, t = k(), n = Ve(), i = be("text"), s = I(() => [
|
|
1559
|
+
i.b(),
|
|
1560
|
+
i.m(e.type),
|
|
1561
|
+
i.m(n.value),
|
|
1562
|
+
i.is("truncated", e.truncated),
|
|
1563
|
+
i.is("line-clamp", !fe(e.lineClamp))
|
|
1564
|
+
]), a = Jt().title, o = () => {
|
|
1565
|
+
var u, w, m, b, F;
|
|
1566
|
+
if (a)
|
|
1567
|
+
return;
|
|
1568
|
+
let _ = !1;
|
|
1569
|
+
const O = ((u = t.value) == null ? void 0 : u.textContent) || "";
|
|
1570
|
+
if (e.truncated) {
|
|
1571
|
+
const c = (w = t.value) == null ? void 0 : w.offsetWidth, g = (m = t.value) == null ? void 0 : m.scrollWidth;
|
|
1572
|
+
c && g && g > c && (_ = !0);
|
|
1573
|
+
} else if (!fe(e.lineClamp)) {
|
|
1574
|
+
const c = (b = t.value) == null ? void 0 : b.offsetHeight, g = (F = t.value) == null ? void 0 : F.scrollHeight;
|
|
1575
|
+
c && g && g > c && (_ = !0);
|
|
1576
|
+
}
|
|
1577
|
+
_ ? t.value.setAttribute("title", O) : t.value.removeAttribute("title");
|
|
1578
|
+
};
|
|
1579
|
+
return Pe(o), Ze(o), (u, w) => (G(), ue(Nt(u.tag), {
|
|
1580
|
+
ref_key: "textRef",
|
|
1581
|
+
ref: t,
|
|
1582
|
+
class: H(v(s)),
|
|
1583
|
+
style: We({ "-webkit-line-clamp": u.lineClamp })
|
|
1584
|
+
}, {
|
|
1585
|
+
default: X(() => [
|
|
1586
|
+
J(u.$slots, "default")
|
|
1587
|
+
]),
|
|
1588
|
+
_: 3
|
|
1589
|
+
}, 8, ["class", "style"]));
|
|
1590
|
+
}
|
|
1591
|
+
});
|
|
1592
|
+
var Ui = /* @__PURE__ */ $e(Di, [["__file", "text.vue"]]);
|
|
1593
|
+
const ia = et(Ui);
|
|
1594
|
+
export {
|
|
1595
|
+
ra as E,
|
|
1596
|
+
na as a,
|
|
1597
|
+
ia as b,
|
|
1598
|
+
ta as c
|
|
1599
|
+
};
|