st-comp 0.0.178 → 0.0.180
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/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +3 -3
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +29 -33
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +14 -18
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +25 -30
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +457 -419
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +13 -16
- package/es/KlinePlus.cjs +3 -3
- package/es/KlinePlus.js +140 -142
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +274 -276
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +3 -3
- package/es/Table.cjs +1 -1
- package/es/Table.js +21 -23
- package/es/User.cjs +1 -1
- package/es/User.js +472 -482
- package/es/VarSelectDialog.cjs +3 -3
- package/es/VarSelectDialog.js +440 -2878
- package/es/VarietySearch.cjs +12 -12
- package/es/VarietySearch.js +1199 -1176
- package/es/VirtualTable.cjs +1 -13
- package/es/VirtualTable.js +1547 -1567
- package/es/{_initCloneObject-da90eef0.js → _initCloneObject-346b7ee2.js} +25 -26
- package/es/_initCloneObject-e2f0deb9.cjs +1 -0
- package/es/base-62a70f61.js +288 -0
- package/es/base-ef747d02.cjs +5 -0
- package/es/config-provider-178bb43c.cjs +1 -0
- package/es/config-provider-2e733cae.js +58 -0
- package/es/dayjs.min-2c20abe6.cjs +1 -0
- package/es/{dayjs.min-54a4e095.js → dayjs.min-8313b006.js} +96 -93
- package/es/{debounce-9e323221.cjs → debounce-0b77a317.cjs} +1 -1
- package/es/{debounce-3cec4646.js → debounce-5f2ec4be.js} +19 -19
- package/es/{dropdown-82b80e8b.js → dropdown-d06edf54.js} +49 -39
- package/es/dropdown-f2fec683.cjs +1 -0
- package/es/el-button-5b08c08a.js +272 -0
- package/es/el-button-fc46a173.cjs +1 -0
- package/es/el-dialog-0b7166c9.cjs +1 -0
- package/es/el-dialog-d8d0da7a.js +276 -0
- package/es/{el-divider-fd2b4e2e.js → el-divider-2f300113.js} +1 -1
- package/es/{el-divider-40c50ce7.cjs → el-divider-4713d74c.cjs} +1 -1
- package/es/{el-empty-412fc297.js → el-empty-87a86f30.js} +57 -80
- package/es/el-empty-bb2b0235.cjs +1 -0
- package/es/el-form-item-caffd133.cjs +12 -0
- package/es/el-form-item-ff9c7d98.js +1267 -0
- package/es/el-input-6db30c8c.js +531 -0
- package/es/el-input-9c912678.cjs +1 -0
- package/es/el-input-number-05f150e5.js +311 -0
- package/es/el-input-number-6fe73563.cjs +1 -0
- package/es/el-loading-8514feaa.cjs +1 -0
- package/es/el-loading-93842445.js +203 -0
- package/es/el-menu-item-7a57c1be.cjs +1 -0
- package/es/el-menu-item-a886fbdd.js +768 -0
- package/es/el-message-8aa674f2.js +406 -0
- package/es/el-message-aad5b42b.cjs +1 -0
- package/es/el-message-box-2b6b2b68.js +550 -0
- package/es/el-message-box-53f355d7.cjs +1 -0
- package/es/el-overlay-540b2a02.js +324 -0
- package/es/el-overlay-96630a2e.cjs +1 -0
- package/es/el-popconfirm-2afdf6fb.cjs +1 -0
- package/es/el-popconfirm-c18d8035.js +162 -0
- package/es/el-popper-544fd77e.js +2412 -0
- package/es/el-popper-73466d7a.cjs +1 -0
- package/es/el-scrollbar-691cfc11.cjs +1 -0
- package/es/el-scrollbar-fae984e3.js +763 -0
- package/es/el-segmented-a7493831.js +142 -0
- package/es/el-segmented-b6bd3c0e.cjs +1 -0
- package/es/el-select-5959e837.cjs +1 -0
- package/es/el-select-ea8feecf.js +1251 -0
- package/es/el-table-column-9ef52443.js +3878 -0
- package/es/el-table-column-b824ac5c.cjs +14 -0
- package/es/el-tag-2fc9b9eb.js +116 -0
- package/es/el-tag-ecad6d02.cjs +1 -0
- package/es/index-2e331d74.js +10 -0
- package/es/{index-a8e9ec0f.js → index-34592e82.js} +176 -182
- package/es/index-3a74eae4.cjs +1 -0
- package/es/{index-1c41bd56.js → index-5d4e5c51.js} +3 -3
- package/es/{index-e348d5e8.cjs → index-694bb944.cjs} +1 -1
- package/es/{index-ee1cebbc.js → index-74fb90c7.js} +5 -5
- package/es/{index-d577b81b.js → index-8d7ae5dc.js} +2 -2
- package/es/index-a9095b4a.js +163 -0
- package/es/index-a93dd9c4.cjs +1 -0
- package/es/index-ebd2fd7e.cjs +1 -0
- package/es/index-f1c702f6.cjs +1 -0
- package/es/{index-19fa1fcf.cjs → index-f6afafaa.cjs} +1 -1
- package/es/{raf-bfbf42e4.js → raf-41aed4d4.js} +1 -1
- package/es/{raf-07cb6953.cjs → raf-8249652f.cjs} +1 -1
- package/es/{scroll-e3cb691f.js → scroll-7d352c1f.js} +2 -2
- package/es/{scroll-4769a65d.cjs → scroll-b108dabd.cjs} +1 -1
- package/es/style.css +1 -1
- package/es/use-global-config-03735617.cjs +1 -0
- package/es/use-global-config-4b185eb5.js +71 -0
- package/es/validator-0e688e4e.cjs +1 -0
- package/es/validator-d12a8f8c.js +5 -0
- package/es/vnode-4db20540.cjs +1 -0
- package/es/vnode-a0795a4b.js +70 -0
- package/es/{zh-cn-d883afa8.js → zh-cn-0ff32188.js} +5 -4
- package/es/{zh-cn-b24a7dc9.cjs → zh-cn-adf19c4b.cjs} +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +226 -245
- package/lib/{index-0f16f8b0.js → index-9341884f.js} +44358 -46367
- package/lib/{python-e9c32bc9.js → python-5c9b3e4e.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +2 -2
- package/packages/KlinePlus/index.vue +2 -1
- package/packages/VarSelectDialog/index.vue +43 -67
- package/packages/VarietySearch/components/FactorScreen/FactorDescription.vue +4 -2
- package/packages/VarietySearch/components/FactorScreen/index.vue +6 -4
- package/packages/index.ts +0 -2
- package/src/pages/VarSelectDialog/index.vue +1 -1
- package/src/router/routes.ts +0 -5
- package/es/Dialog.cjs +0 -1
- package/es/Dialog.js +0 -95
- package/es/_commonjsHelpers-10dfc225.js +0 -8
- package/es/_commonjsHelpers-87b0abe8.cjs +0 -1
- package/es/_initCloneObject-9ccbb113.cjs +0 -1
- package/es/base-bdc10baa.cjs +0 -5
- package/es/base-d9284bf0.js +0 -304
- package/es/castArray-37eb9980.cjs +0 -1
- package/es/castArray-b0ab0165.js +0 -10
- package/es/config-provider-ec6b09df.cjs +0 -1
- package/es/config-provider-f0151e9f.js +0 -47
- package/es/dayjs.min-19fb125f.cjs +0 -1
- package/es/dropdown-b2dab5bb.cjs +0 -1
- package/es/el-button-34665425.js +0 -237
- package/es/el-button-960edd49.cjs +0 -1
- package/es/el-dialog-a412484e.js +0 -267
- package/es/el-dialog-cd484c1f.cjs +0 -1
- package/es/el-empty-627ec09e.cjs +0 -1
- package/es/el-form-item-668ba024.js +0 -1263
- package/es/el-form-item-e1c3104b.cjs +0 -12
- package/es/el-input-22e66e37.js +0 -523
- package/es/el-input-5163bda3.cjs +0 -1
- package/es/el-input-number-481e21c5.js +0 -284
- package/es/el-input-number-eb54cde4.cjs +0 -1
- package/es/el-loading-15a5501c.cjs +0 -1
- package/es/el-loading-d4e403ab.js +0 -187
- package/es/el-menu-item-404c10e5.js +0 -772
- package/es/el-menu-item-ac89e804.cjs +0 -1
- package/es/el-message-ad87b9dd.cjs +0 -1
- package/es/el-message-box-41f39f6d.js +0 -558
- package/es/el-message-box-6694f827.cjs +0 -1
- package/es/el-message-ef506caa.js +0 -375
- package/es/el-overlay-4a9fa4e1.js +0 -269
- package/es/el-overlay-e5d318c3.cjs +0 -1
- package/es/el-popconfirm-7b9183aa.js +0 -140
- package/es/el-popconfirm-a497b279.cjs +0 -1
- package/es/el-popper-14a9d493.cjs +0 -1
- package/es/el-popper-e73466eb.js +0 -2263
- package/es/el-scrollbar-45318df0.js +0 -201
- package/es/el-scrollbar-8bf765f2.cjs +0 -1
- package/es/el-segmented-3ba6d664.cjs +0 -1
- package/es/el-segmented-41820018.js +0 -135
- package/es/el-select-1d2309a1.cjs +0 -1
- package/es/el-select-d7a00294.js +0 -1130
- package/es/el-table-column-a2d0c635.js +0 -3805
- package/es/el-table-column-be9a76bb.cjs +0 -14
- package/es/el-tag-7f391090.js +0 -280
- package/es/el-tag-8d49d4d2.cjs +0 -1
- package/es/index-02ca0096.cjs +0 -5
- package/es/index-3120be08.js +0 -14
- package/es/index-5b81f4da.cjs +0 -1
- package/es/index-85a32a00.js +0 -59
- package/es/index-8d3c5e96.cjs +0 -3
- package/es/index-94f38460.js +0 -306
- package/es/index-a99a5307.cjs +0 -1
- package/es/index-b90c746b.cjs +0 -1
- package/es/index-d94bae37.cjs +0 -1
- package/es/index-d99fdc6d.js +0 -159
- package/es/use-form-common-props-592797e2.cjs +0 -2
- package/es/use-form-common-props-cc347a83.js +0 -171
- package/es/use-global-config-584b62f1.cjs +0 -1
- package/es/use-global-config-c7f0a7e3.js +0 -73
- package/es/validator-10fa54fe.js +0 -5
- package/es/validator-af488a9a.cjs +0 -1
- package/es/vnode-1b827c99.cjs +0 -1
- package/es/vnode-6be33bb1.js +0 -14
- package/packages/Dialog/index.ts +0 -8
- package/packages/Dialog/index.vue +0 -54
- package/src/pages/Dialog/index.vue +0 -16
|
@@ -0,0 +1,1267 @@
|
|
|
1
|
+
import { ref as B, computed as E, defineComponent as H, reactive as ve, watch as ne, provide as Qe, toRefs as Xe, openBlock as ye, createElementBlock as ke, normalizeClass as K, unref as q, renderSlot as ee, inject as ie, onMounted as et, onBeforeUnmount as tt, onUpdated as Et, createVNode as ae, Fragment as St, nextTick as rt, useSlots as Tt, withCtx as pe, createBlock as _t, resolveDynamicComponent as Pt, normalizeStyle as Ie, createTextVNode as $t, toDisplayString as Me, createCommentVNode as Ne, createElementVNode as Re, TransitionGroup as It } from "vue";
|
|
2
|
+
import { r as nt, x as it, y as Mt, z as Nt, A as Rt, B as qe, C as oe, D as at, t as Lt, S as Vt, E as Bt, F as Wt, k as ot, n as he, e as st, G as je, H as be, u as Ct } from "./el-scrollbar-fae984e3.js";
|
|
3
|
+
import { b as Ee, e as se, j as fe, c as Le, o as ft, u as Se, _ as lt, x as ut, B as Dt, n as Ve, w as Ut, l as zt } from "./base-62a70f61.js";
|
|
4
|
+
import { d as Gt, b as Kt } from "./el-popper-544fd77e.js";
|
|
5
|
+
import { S as Be, b as dt, i as Yt, d as Jt, a as Zt } from "./index-34592e82.js";
|
|
6
|
+
import { g as ge } from "./use-global-config-4b185eb5.js";
|
|
7
|
+
import { c as le, k as Te, g as Ht, e as ct, d as Qt, a as Xt, b as kt, i as er } from "./_initCloneObject-346b7ee2.js";
|
|
8
|
+
function tr(r, e) {
|
|
9
|
+
for (var t = -1, n = r == null ? 0 : r.length; ++t < n && e(r[t], t, r) !== !1; )
|
|
10
|
+
;
|
|
11
|
+
return r;
|
|
12
|
+
}
|
|
13
|
+
function rr(r, e) {
|
|
14
|
+
return r && le(e, nt(e), r);
|
|
15
|
+
}
|
|
16
|
+
function nr(r, e) {
|
|
17
|
+
return r && le(e, Te(e), r);
|
|
18
|
+
}
|
|
19
|
+
function ir(r, e) {
|
|
20
|
+
return le(r, it(r), e);
|
|
21
|
+
}
|
|
22
|
+
var ar = Object.getOwnPropertySymbols, or = ar ? function(r) {
|
|
23
|
+
for (var e = []; r; )
|
|
24
|
+
Nt(e, it(r)), r = Ht(r);
|
|
25
|
+
return e;
|
|
26
|
+
} : Mt;
|
|
27
|
+
const pt = or;
|
|
28
|
+
function sr(r, e) {
|
|
29
|
+
return le(r, pt(r), e);
|
|
30
|
+
}
|
|
31
|
+
function fr(r) {
|
|
32
|
+
return Rt(r, Te, pt);
|
|
33
|
+
}
|
|
34
|
+
var lr = Object.prototype, ur = lr.hasOwnProperty;
|
|
35
|
+
function dr(r) {
|
|
36
|
+
var e = r.length, t = new r.constructor(e);
|
|
37
|
+
return e && typeof r[0] == "string" && ur.call(r, "index") && (t.index = r.index, t.input = r.input), t;
|
|
38
|
+
}
|
|
39
|
+
function cr(r, e) {
|
|
40
|
+
var t = e ? ct(r.buffer) : r.buffer;
|
|
41
|
+
return new r.constructor(t, r.byteOffset, r.byteLength);
|
|
42
|
+
}
|
|
43
|
+
var pr = /\w*$/;
|
|
44
|
+
function gr(r) {
|
|
45
|
+
var e = new r.constructor(r.source, pr.exec(r));
|
|
46
|
+
return e.lastIndex = r.lastIndex, e;
|
|
47
|
+
}
|
|
48
|
+
var We = Be ? Be.prototype : void 0, Ce = We ? We.valueOf : void 0;
|
|
49
|
+
function mr(r) {
|
|
50
|
+
return Ce ? Object(Ce.call(r)) : {};
|
|
51
|
+
}
|
|
52
|
+
var vr = "[object Boolean]", yr = "[object Date]", hr = "[object Map]", br = "[object Number]", wr = "[object RegExp]", Fr = "[object Set]", xr = "[object String]", Ar = "[object Symbol]", Or = "[object ArrayBuffer]", qr = "[object DataView]", jr = "[object Float32Array]", Er = "[object Float64Array]", Sr = "[object Int8Array]", Tr = "[object Int16Array]", _r = "[object Int32Array]", Pr = "[object Uint8Array]", $r = "[object Uint8ClampedArray]", Ir = "[object Uint16Array]", Mr = "[object Uint32Array]";
|
|
53
|
+
function Nr(r, e, t) {
|
|
54
|
+
var n = r.constructor;
|
|
55
|
+
switch (e) {
|
|
56
|
+
case Or:
|
|
57
|
+
return ct(r);
|
|
58
|
+
case vr:
|
|
59
|
+
case yr:
|
|
60
|
+
return new n(+r);
|
|
61
|
+
case qr:
|
|
62
|
+
return cr(r, t);
|
|
63
|
+
case jr:
|
|
64
|
+
case Er:
|
|
65
|
+
case Sr:
|
|
66
|
+
case Tr:
|
|
67
|
+
case _r:
|
|
68
|
+
case Pr:
|
|
69
|
+
case $r:
|
|
70
|
+
case Ir:
|
|
71
|
+
case Mr:
|
|
72
|
+
return Qt(r, t);
|
|
73
|
+
case hr:
|
|
74
|
+
return new n();
|
|
75
|
+
case br:
|
|
76
|
+
case xr:
|
|
77
|
+
return new n(r);
|
|
78
|
+
case wr:
|
|
79
|
+
return gr(r);
|
|
80
|
+
case Fr:
|
|
81
|
+
return new n();
|
|
82
|
+
case Ar:
|
|
83
|
+
return mr(r);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
var Rr = "[object Map]";
|
|
87
|
+
function Lr(r) {
|
|
88
|
+
return dt(r) && qe(r) == Rr;
|
|
89
|
+
}
|
|
90
|
+
var De = oe && oe.isMap, Vr = De ? at(De) : Lr;
|
|
91
|
+
const Br = Vr;
|
|
92
|
+
var Wr = "[object Set]";
|
|
93
|
+
function Cr(r) {
|
|
94
|
+
return dt(r) && qe(r) == Wr;
|
|
95
|
+
}
|
|
96
|
+
var Ue = oe && oe.isSet, Dr = Ue ? at(Ue) : Cr;
|
|
97
|
+
const Ur = Dr;
|
|
98
|
+
var zr = 1, Gr = 2, Kr = 4, gt = "[object Arguments]", Yr = "[object Array]", Jr = "[object Boolean]", Zr = "[object Date]", Hr = "[object Error]", mt = "[object Function]", Qr = "[object GeneratorFunction]", Xr = "[object Map]", kr = "[object Number]", vt = "[object Object]", en = "[object RegExp]", tn = "[object Set]", rn = "[object String]", nn = "[object Symbol]", an = "[object WeakMap]", on = "[object ArrayBuffer]", sn = "[object DataView]", fn = "[object Float32Array]", ln = "[object Float64Array]", un = "[object Int8Array]", dn = "[object Int16Array]", cn = "[object Int32Array]", pn = "[object Uint8Array]", gn = "[object Uint8ClampedArray]", mn = "[object Uint16Array]", vn = "[object Uint32Array]", A = {};
|
|
99
|
+
A[gt] = A[Yr] = A[on] = A[sn] = A[Jr] = A[Zr] = A[fn] = A[ln] = A[un] = A[dn] = A[cn] = A[Xr] = A[kr] = A[vt] = A[en] = A[tn] = A[rn] = A[nn] = A[pn] = A[gn] = A[mn] = A[vn] = !0;
|
|
100
|
+
A[Hr] = A[mt] = A[an] = !1;
|
|
101
|
+
function te(r, e, t, n, i, a) {
|
|
102
|
+
var o, s = e & zr, l = e & Gr, w = e & Kr;
|
|
103
|
+
if (t && (o = i ? t(r, n, i, a) : t(r)), o !== void 0)
|
|
104
|
+
return o;
|
|
105
|
+
if (!Yt(r))
|
|
106
|
+
return r;
|
|
107
|
+
var p = Jt(r);
|
|
108
|
+
if (p) {
|
|
109
|
+
if (o = dr(r), !s)
|
|
110
|
+
return Xt(r, o);
|
|
111
|
+
} else {
|
|
112
|
+
var m = qe(r), b = m == mt || m == Qr;
|
|
113
|
+
if (Lt(r))
|
|
114
|
+
return kt(r, s);
|
|
115
|
+
if (m == vt || m == gt || b && !i) {
|
|
116
|
+
if (o = l || b ? {} : er(r), !s)
|
|
117
|
+
return l ? sr(r, nr(o, r)) : ir(r, rr(o, r));
|
|
118
|
+
} else {
|
|
119
|
+
if (!A[m])
|
|
120
|
+
return i ? r : {};
|
|
121
|
+
o = Nr(r, m, s);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
a || (a = new Vt());
|
|
125
|
+
var O = a.get(r);
|
|
126
|
+
if (O)
|
|
127
|
+
return O;
|
|
128
|
+
a.set(r, o), Ur(r) ? r.forEach(function(g) {
|
|
129
|
+
o.add(te(g, e, t, g, r, a));
|
|
130
|
+
}) : Br(r) && r.forEach(function(g, f) {
|
|
131
|
+
o.set(f, te(g, e, t, f, r, a));
|
|
132
|
+
});
|
|
133
|
+
var j = w ? l ? fr : Bt : l ? Te : nt, d = p ? void 0 : j(r);
|
|
134
|
+
return tr(d || r, function(g, f) {
|
|
135
|
+
d && (f = g, g = r[f]), Wt(o, f, te(g, e, t, f, r, a));
|
|
136
|
+
}), o;
|
|
137
|
+
}
|
|
138
|
+
var yn = 4;
|
|
139
|
+
function ze(r) {
|
|
140
|
+
return te(r, yn);
|
|
141
|
+
}
|
|
142
|
+
const hn = Ee({
|
|
143
|
+
size: {
|
|
144
|
+
type: String,
|
|
145
|
+
values: ot
|
|
146
|
+
},
|
|
147
|
+
disabled: Boolean
|
|
148
|
+
}), bn = Ee({
|
|
149
|
+
...hn,
|
|
150
|
+
model: Object,
|
|
151
|
+
rules: {
|
|
152
|
+
type: se(Object)
|
|
153
|
+
},
|
|
154
|
+
labelPosition: {
|
|
155
|
+
type: String,
|
|
156
|
+
values: ["left", "right", "top"],
|
|
157
|
+
default: "right"
|
|
158
|
+
},
|
|
159
|
+
requireAsteriskPosition: {
|
|
160
|
+
type: String,
|
|
161
|
+
values: ["left", "right"],
|
|
162
|
+
default: "left"
|
|
163
|
+
},
|
|
164
|
+
labelWidth: {
|
|
165
|
+
type: [String, Number],
|
|
166
|
+
default: ""
|
|
167
|
+
},
|
|
168
|
+
labelSuffix: {
|
|
169
|
+
type: String,
|
|
170
|
+
default: ""
|
|
171
|
+
},
|
|
172
|
+
inline: Boolean,
|
|
173
|
+
inlineMessage: Boolean,
|
|
174
|
+
statusIcon: Boolean,
|
|
175
|
+
showMessage: {
|
|
176
|
+
type: Boolean,
|
|
177
|
+
default: !0
|
|
178
|
+
},
|
|
179
|
+
validateOnRuleChange: {
|
|
180
|
+
type: Boolean,
|
|
181
|
+
default: !0
|
|
182
|
+
},
|
|
183
|
+
hideRequiredAsterisk: Boolean,
|
|
184
|
+
scrollToError: Boolean,
|
|
185
|
+
scrollIntoViewOptions: {
|
|
186
|
+
type: se([Object, Boolean]),
|
|
187
|
+
default: !0
|
|
188
|
+
}
|
|
189
|
+
}), wn = {
|
|
190
|
+
validate: (r, e, t) => (fe(r) || Le(r)) && ft(e) && Le(t)
|
|
191
|
+
};
|
|
192
|
+
function Fn() {
|
|
193
|
+
const r = B([]), e = E(() => {
|
|
194
|
+
if (!r.value.length)
|
|
195
|
+
return "0";
|
|
196
|
+
const a = Math.max(...r.value);
|
|
197
|
+
return a ? `${a}px` : "";
|
|
198
|
+
});
|
|
199
|
+
function t(a) {
|
|
200
|
+
const o = r.value.indexOf(a);
|
|
201
|
+
return o === -1 && e.value, o;
|
|
202
|
+
}
|
|
203
|
+
function n(a, o) {
|
|
204
|
+
if (a && o) {
|
|
205
|
+
const s = t(o);
|
|
206
|
+
r.value.splice(s, 1, a);
|
|
207
|
+
} else
|
|
208
|
+
a && r.value.push(a);
|
|
209
|
+
}
|
|
210
|
+
function i(a) {
|
|
211
|
+
const o = t(a);
|
|
212
|
+
o > -1 && r.value.splice(o, 1);
|
|
213
|
+
}
|
|
214
|
+
return {
|
|
215
|
+
autoLabelWidth: e,
|
|
216
|
+
registerLabelWidth: n,
|
|
217
|
+
deregisterLabelWidth: i
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
const X = (r, e) => {
|
|
221
|
+
const t = he(e).map((n) => fe(n) ? n.join(".") : n);
|
|
222
|
+
return t.length > 0 ? r.filter((n) => n.propString && t.includes(n.propString)) : r;
|
|
223
|
+
}, xn = "ElForm", An = H({
|
|
224
|
+
name: xn
|
|
225
|
+
}), On = /* @__PURE__ */ H({
|
|
226
|
+
...An,
|
|
227
|
+
props: bn,
|
|
228
|
+
emits: wn,
|
|
229
|
+
setup(r, { expose: e, emit: t }) {
|
|
230
|
+
const n = r, i = B(), a = ve([]), o = st(), s = Se("form"), l = E(() => {
|
|
231
|
+
const { labelPosition: u, inline: y } = n;
|
|
232
|
+
return [
|
|
233
|
+
s.b(),
|
|
234
|
+
s.m(o.value || "default"),
|
|
235
|
+
{
|
|
236
|
+
[s.m(`label-${u}`)]: u,
|
|
237
|
+
[s.m("inline")]: y
|
|
238
|
+
}
|
|
239
|
+
];
|
|
240
|
+
}), w = (u) => X(a, [u])[0], p = (u) => {
|
|
241
|
+
a.push(u);
|
|
242
|
+
}, m = (u) => {
|
|
243
|
+
u.prop && a.splice(a.indexOf(u), 1);
|
|
244
|
+
}, b = (u = []) => {
|
|
245
|
+
n.model && X(a, u).forEach((y) => y.resetField());
|
|
246
|
+
}, O = (u = []) => {
|
|
247
|
+
X(a, u).forEach((y) => y.clearValidate());
|
|
248
|
+
}, j = E(() => !!n.model), d = (u) => {
|
|
249
|
+
if (a.length === 0)
|
|
250
|
+
return [];
|
|
251
|
+
const y = X(a, u);
|
|
252
|
+
return y.length ? y : [];
|
|
253
|
+
}, g = async (u) => $(void 0, u), f = async (u = []) => {
|
|
254
|
+
if (!j.value)
|
|
255
|
+
return !1;
|
|
256
|
+
const y = d(u);
|
|
257
|
+
if (y.length === 0)
|
|
258
|
+
return !0;
|
|
259
|
+
let F = {};
|
|
260
|
+
for (const _ of y)
|
|
261
|
+
try {
|
|
262
|
+
await _.validate(""), _.validateState === "error" && !_.error && _.resetField();
|
|
263
|
+
} catch (S) {
|
|
264
|
+
F = {
|
|
265
|
+
...F,
|
|
266
|
+
...S
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
return Object.keys(F).length === 0 ? !0 : Promise.reject(F);
|
|
270
|
+
}, $ = async (u = [], y) => {
|
|
271
|
+
let F = !1;
|
|
272
|
+
const _ = !ut(y);
|
|
273
|
+
try {
|
|
274
|
+
return F = await f(u), F === !0 && await (y == null ? void 0 : y(F)), F;
|
|
275
|
+
} catch (S) {
|
|
276
|
+
if (S instanceof Error)
|
|
277
|
+
throw S;
|
|
278
|
+
const R = S;
|
|
279
|
+
if (n.scrollToError && i.value) {
|
|
280
|
+
const W = i.value.querySelector(`.${s.b()}-item.is-error`);
|
|
281
|
+
W == null || W.scrollIntoView(n.scrollIntoViewOptions);
|
|
282
|
+
}
|
|
283
|
+
return !F && await (y == null ? void 0 : y(!1, R)), _ && Promise.reject(R);
|
|
284
|
+
}
|
|
285
|
+
}, v = (u) => {
|
|
286
|
+
var y;
|
|
287
|
+
const F = w(u);
|
|
288
|
+
F && ((y = F.$el) == null || y.scrollIntoView(n.scrollIntoViewOptions));
|
|
289
|
+
};
|
|
290
|
+
return ne(() => n.rules, () => {
|
|
291
|
+
n.validateOnRuleChange && g().catch((u) => Gt());
|
|
292
|
+
}, { deep: !0, flush: "post" }), Qe(je, ve({
|
|
293
|
+
...Xe(n),
|
|
294
|
+
emit: t,
|
|
295
|
+
resetFields: b,
|
|
296
|
+
clearValidate: O,
|
|
297
|
+
validateField: $,
|
|
298
|
+
getField: w,
|
|
299
|
+
addField: p,
|
|
300
|
+
removeField: m,
|
|
301
|
+
...Fn()
|
|
302
|
+
})), e({
|
|
303
|
+
validate: g,
|
|
304
|
+
validateField: $,
|
|
305
|
+
resetFields: b,
|
|
306
|
+
clearValidate: O,
|
|
307
|
+
scrollToField: v,
|
|
308
|
+
getField: w,
|
|
309
|
+
fields: a
|
|
310
|
+
}), (u, y) => (ye(), ke("form", {
|
|
311
|
+
ref_key: "formRef",
|
|
312
|
+
ref: i,
|
|
313
|
+
class: K(q(l))
|
|
314
|
+
}, [
|
|
315
|
+
ee(u.$slots, "default")
|
|
316
|
+
], 2));
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
var qn = /* @__PURE__ */ lt(On, [["__file", "form.vue"]]);
|
|
320
|
+
function C() {
|
|
321
|
+
return C = Object.assign ? Object.assign.bind() : function(r) {
|
|
322
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
323
|
+
var t = arguments[e];
|
|
324
|
+
for (var n in t)
|
|
325
|
+
Object.prototype.hasOwnProperty.call(t, n) && (r[n] = t[n]);
|
|
326
|
+
}
|
|
327
|
+
return r;
|
|
328
|
+
}, C.apply(this, arguments);
|
|
329
|
+
}
|
|
330
|
+
function jn(r, e) {
|
|
331
|
+
r.prototype = Object.create(e.prototype), r.prototype.constructor = r, Z(r, e);
|
|
332
|
+
}
|
|
333
|
+
function we(r) {
|
|
334
|
+
return we = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
335
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
336
|
+
}, we(r);
|
|
337
|
+
}
|
|
338
|
+
function Z(r, e) {
|
|
339
|
+
return Z = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, i) {
|
|
340
|
+
return n.__proto__ = i, n;
|
|
341
|
+
}, Z(r, e);
|
|
342
|
+
}
|
|
343
|
+
function En() {
|
|
344
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
345
|
+
return !1;
|
|
346
|
+
if (typeof Proxy == "function")
|
|
347
|
+
return !0;
|
|
348
|
+
try {
|
|
349
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
350
|
+
})), !0;
|
|
351
|
+
} catch {
|
|
352
|
+
return !1;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function re(r, e, t) {
|
|
356
|
+
return En() ? re = Reflect.construct.bind() : re = function(i, a, o) {
|
|
357
|
+
var s = [null];
|
|
358
|
+
s.push.apply(s, a);
|
|
359
|
+
var l = Function.bind.apply(i, s), w = new l();
|
|
360
|
+
return o && Z(w, o.prototype), w;
|
|
361
|
+
}, re.apply(null, arguments);
|
|
362
|
+
}
|
|
363
|
+
function Sn(r) {
|
|
364
|
+
return Function.toString.call(r).indexOf("[native code]") !== -1;
|
|
365
|
+
}
|
|
366
|
+
function Fe(r) {
|
|
367
|
+
var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
368
|
+
return Fe = function(n) {
|
|
369
|
+
if (n === null || !Sn(n))
|
|
370
|
+
return n;
|
|
371
|
+
if (typeof n != "function")
|
|
372
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
373
|
+
if (typeof e < "u") {
|
|
374
|
+
if (e.has(n))
|
|
375
|
+
return e.get(n);
|
|
376
|
+
e.set(n, i);
|
|
377
|
+
}
|
|
378
|
+
function i() {
|
|
379
|
+
return re(n, arguments, we(this).constructor);
|
|
380
|
+
}
|
|
381
|
+
return i.prototype = Object.create(n.prototype, {
|
|
382
|
+
constructor: {
|
|
383
|
+
value: i,
|
|
384
|
+
enumerable: !1,
|
|
385
|
+
writable: !0,
|
|
386
|
+
configurable: !0
|
|
387
|
+
}
|
|
388
|
+
}), Z(i, n);
|
|
389
|
+
}, Fe(r);
|
|
390
|
+
}
|
|
391
|
+
var Tn = /%[sdj%]/g, yt = function() {
|
|
392
|
+
};
|
|
393
|
+
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (yt = function(e, t) {
|
|
394
|
+
typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && t.every(function(n) {
|
|
395
|
+
return typeof n == "string";
|
|
396
|
+
}) && console.warn(e, t);
|
|
397
|
+
});
|
|
398
|
+
function xe(r) {
|
|
399
|
+
if (!r || !r.length)
|
|
400
|
+
return null;
|
|
401
|
+
var e = {};
|
|
402
|
+
return r.forEach(function(t) {
|
|
403
|
+
var n = t.field;
|
|
404
|
+
e[n] = e[n] || [], e[n].push(t);
|
|
405
|
+
}), e;
|
|
406
|
+
}
|
|
407
|
+
function N(r) {
|
|
408
|
+
for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), n = 1; n < e; n++)
|
|
409
|
+
t[n - 1] = arguments[n];
|
|
410
|
+
var i = 0, a = t.length;
|
|
411
|
+
if (typeof r == "function")
|
|
412
|
+
return r.apply(null, t);
|
|
413
|
+
if (typeof r == "string") {
|
|
414
|
+
var o = r.replace(Tn, function(s) {
|
|
415
|
+
if (s === "%%")
|
|
416
|
+
return "%";
|
|
417
|
+
if (i >= a)
|
|
418
|
+
return s;
|
|
419
|
+
switch (s) {
|
|
420
|
+
case "%s":
|
|
421
|
+
return String(t[i++]);
|
|
422
|
+
case "%d":
|
|
423
|
+
return Number(t[i++]);
|
|
424
|
+
case "%j":
|
|
425
|
+
try {
|
|
426
|
+
return JSON.stringify(t[i++]);
|
|
427
|
+
} catch {
|
|
428
|
+
return "[Circular]";
|
|
429
|
+
}
|
|
430
|
+
break;
|
|
431
|
+
default:
|
|
432
|
+
return s;
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
return o;
|
|
436
|
+
}
|
|
437
|
+
return r;
|
|
438
|
+
}
|
|
439
|
+
function _n(r) {
|
|
440
|
+
return r === "string" || r === "url" || r === "hex" || r === "email" || r === "date" || r === "pattern";
|
|
441
|
+
}
|
|
442
|
+
function T(r, e) {
|
|
443
|
+
return !!(r == null || e === "array" && Array.isArray(r) && !r.length || _n(e) && typeof r == "string" && !r);
|
|
444
|
+
}
|
|
445
|
+
function Pn(r, e, t) {
|
|
446
|
+
var n = [], i = 0, a = r.length;
|
|
447
|
+
function o(s) {
|
|
448
|
+
n.push.apply(n, s || []), i++, i === a && t(n);
|
|
449
|
+
}
|
|
450
|
+
r.forEach(function(s) {
|
|
451
|
+
e(s, o);
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
function Ge(r, e, t) {
|
|
455
|
+
var n = 0, i = r.length;
|
|
456
|
+
function a(o) {
|
|
457
|
+
if (o && o.length) {
|
|
458
|
+
t(o);
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
var s = n;
|
|
462
|
+
n = n + 1, s < i ? e(r[s], a) : t([]);
|
|
463
|
+
}
|
|
464
|
+
a([]);
|
|
465
|
+
}
|
|
466
|
+
function $n(r) {
|
|
467
|
+
var e = [];
|
|
468
|
+
return Object.keys(r).forEach(function(t) {
|
|
469
|
+
e.push.apply(e, r[t] || []);
|
|
470
|
+
}), e;
|
|
471
|
+
}
|
|
472
|
+
var Ke = /* @__PURE__ */ function(r) {
|
|
473
|
+
jn(e, r);
|
|
474
|
+
function e(t, n) {
|
|
475
|
+
var i;
|
|
476
|
+
return i = r.call(this, "Async Validation Error") || this, i.errors = t, i.fields = n, i;
|
|
477
|
+
}
|
|
478
|
+
return e;
|
|
479
|
+
}(/* @__PURE__ */ Fe(Error));
|
|
480
|
+
function In(r, e, t, n, i) {
|
|
481
|
+
if (e.first) {
|
|
482
|
+
var a = new Promise(function(b, O) {
|
|
483
|
+
var j = function(f) {
|
|
484
|
+
return n(f), f.length ? O(new Ke(f, xe(f))) : b(i);
|
|
485
|
+
}, d = $n(r);
|
|
486
|
+
Ge(d, t, j);
|
|
487
|
+
});
|
|
488
|
+
return a.catch(function(b) {
|
|
489
|
+
return b;
|
|
490
|
+
}), a;
|
|
491
|
+
}
|
|
492
|
+
var o = e.firstFields === !0 ? Object.keys(r) : e.firstFields || [], s = Object.keys(r), l = s.length, w = 0, p = [], m = new Promise(function(b, O) {
|
|
493
|
+
var j = function(g) {
|
|
494
|
+
if (p.push.apply(p, g), w++, w === l)
|
|
495
|
+
return n(p), p.length ? O(new Ke(p, xe(p))) : b(i);
|
|
496
|
+
};
|
|
497
|
+
s.length || (n(p), b(i)), s.forEach(function(d) {
|
|
498
|
+
var g = r[d];
|
|
499
|
+
o.indexOf(d) !== -1 ? Ge(g, t, j) : Pn(g, t, j);
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
return m.catch(function(b) {
|
|
503
|
+
return b;
|
|
504
|
+
}), m;
|
|
505
|
+
}
|
|
506
|
+
function Mn(r) {
|
|
507
|
+
return !!(r && r.message !== void 0);
|
|
508
|
+
}
|
|
509
|
+
function Nn(r, e) {
|
|
510
|
+
for (var t = r, n = 0; n < e.length; n++) {
|
|
511
|
+
if (t == null)
|
|
512
|
+
return t;
|
|
513
|
+
t = t[e[n]];
|
|
514
|
+
}
|
|
515
|
+
return t;
|
|
516
|
+
}
|
|
517
|
+
function Ye(r, e) {
|
|
518
|
+
return function(t) {
|
|
519
|
+
var n;
|
|
520
|
+
return r.fullFields ? n = Nn(e, r.fullFields) : n = e[t.field || r.fullField], Mn(t) ? (t.field = t.field || r.fullField, t.fieldValue = n, t) : {
|
|
521
|
+
message: typeof t == "function" ? t() : t,
|
|
522
|
+
fieldValue: n,
|
|
523
|
+
field: t.field || r.fullField
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
function Je(r, e) {
|
|
528
|
+
if (e) {
|
|
529
|
+
for (var t in e)
|
|
530
|
+
if (e.hasOwnProperty(t)) {
|
|
531
|
+
var n = e[t];
|
|
532
|
+
typeof n == "object" && typeof r[t] == "object" ? r[t] = C({}, r[t], n) : r[t] = n;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
return r;
|
|
536
|
+
}
|
|
537
|
+
var ht = function(e, t, n, i, a, o) {
|
|
538
|
+
e.required && (!n.hasOwnProperty(e.field) || T(t, o || e.type)) && i.push(N(a.messages.required, e.fullField));
|
|
539
|
+
}, Rn = function(e, t, n, i, a) {
|
|
540
|
+
(/^\s+$/.test(t) || t === "") && i.push(N(a.messages.whitespace, e.fullField));
|
|
541
|
+
}, k, Ln = function() {
|
|
542
|
+
if (k)
|
|
543
|
+
return k;
|
|
544
|
+
var r = "[a-fA-F\\d:]", e = function(u) {
|
|
545
|
+
return u && u.includeBoundaries ? "(?:(?<=\\s|^)(?=" + r + ")|(?<=" + r + ")(?=\\s|$))" : "";
|
|
546
|
+
}, 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 = (`
|
|
547
|
+
(?:
|
|
548
|
+
(?:` + n + ":){7}(?:" + n + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
549
|
+
(?:` + 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
|
|
550
|
+
(?:` + 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
|
|
551
|
+
(?:` + 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
|
|
552
|
+
(?:` + 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
|
|
553
|
+
(?:` + 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
|
|
554
|
+
(?:` + 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
|
|
555
|
+
(?::(?:(?::` + 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
|
|
556
|
+
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
557
|
+
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), a = new RegExp("(?:^" + t + "$)|(?:^" + i + "$)"), o = new RegExp("^" + t + "$"), s = new RegExp("^" + i + "$"), l = function(u) {
|
|
558
|
+
return u && u.exact ? a : new RegExp("(?:" + e(u) + t + e(u) + ")|(?:" + e(u) + i + e(u) + ")", "g");
|
|
559
|
+
};
|
|
560
|
+
l.v4 = function(v) {
|
|
561
|
+
return v && v.exact ? o : new RegExp("" + e(v) + t + e(v), "g");
|
|
562
|
+
}, l.v6 = function(v) {
|
|
563
|
+
return v && v.exact ? s : new RegExp("" + e(v) + i + e(v), "g");
|
|
564
|
+
};
|
|
565
|
+
var w = "(?:(?:[a-z]+:)?//)", p = "(?:\\S+(?::\\S*)?@)?", m = l.v4().source, b = l.v6().source, O = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", j = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", d = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", g = "(?::\\d{2,5})?", f = '(?:[/?#][^\\s"]*)?', $ = "(?:" + w + "|www\\.)" + p + "(?:localhost|" + m + "|" + b + "|" + O + j + d + ")" + g + f;
|
|
566
|
+
return k = new RegExp("(?:^" + $ + "$)", "i"), k;
|
|
567
|
+
}, Ze = {
|
|
568
|
+
// http://emailregex.com/
|
|
569
|
+
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,}))$/,
|
|
570
|
+
// url: new RegExp(
|
|
571
|
+
// '^(?!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]*)?$',
|
|
572
|
+
// 'i',
|
|
573
|
+
// ),
|
|
574
|
+
hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
|
|
575
|
+
}, Y = {
|
|
576
|
+
integer: function(e) {
|
|
577
|
+
return Y.number(e) && parseInt(e, 10) === e;
|
|
578
|
+
},
|
|
579
|
+
float: function(e) {
|
|
580
|
+
return Y.number(e) && !Y.integer(e);
|
|
581
|
+
},
|
|
582
|
+
array: function(e) {
|
|
583
|
+
return Array.isArray(e);
|
|
584
|
+
},
|
|
585
|
+
regexp: function(e) {
|
|
586
|
+
if (e instanceof RegExp)
|
|
587
|
+
return !0;
|
|
588
|
+
try {
|
|
589
|
+
return !!new RegExp(e);
|
|
590
|
+
} catch {
|
|
591
|
+
return !1;
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
date: function(e) {
|
|
595
|
+
return typeof e.getTime == "function" && typeof e.getMonth == "function" && typeof e.getYear == "function" && !isNaN(e.getTime());
|
|
596
|
+
},
|
|
597
|
+
number: function(e) {
|
|
598
|
+
return isNaN(e) ? !1 : typeof e == "number";
|
|
599
|
+
},
|
|
600
|
+
object: function(e) {
|
|
601
|
+
return typeof e == "object" && !Y.array(e);
|
|
602
|
+
},
|
|
603
|
+
method: function(e) {
|
|
604
|
+
return typeof e == "function";
|
|
605
|
+
},
|
|
606
|
+
email: function(e) {
|
|
607
|
+
return typeof e == "string" && e.length <= 320 && !!e.match(Ze.email);
|
|
608
|
+
},
|
|
609
|
+
url: function(e) {
|
|
610
|
+
return typeof e == "string" && e.length <= 2048 && !!e.match(Ln());
|
|
611
|
+
},
|
|
612
|
+
hex: function(e) {
|
|
613
|
+
return typeof e == "string" && !!e.match(Ze.hex);
|
|
614
|
+
}
|
|
615
|
+
}, Vn = function(e, t, n, i, a) {
|
|
616
|
+
if (e.required && t === void 0) {
|
|
617
|
+
ht(e, t, n, i, a);
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], s = e.type;
|
|
621
|
+
o.indexOf(s) > -1 ? Y[s](t) || i.push(N(a.messages.types[s], e.fullField, e.type)) : s && typeof t !== e.type && i.push(N(a.messages.types[s], e.fullField, e.type));
|
|
622
|
+
}, Bn = function(e, t, n, i, a) {
|
|
623
|
+
var o = typeof e.len == "number", s = typeof e.min == "number", l = typeof e.max == "number", w = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, p = t, m = null, b = typeof t == "number", O = typeof t == "string", j = Array.isArray(t);
|
|
624
|
+
if (b ? m = "number" : O ? m = "string" : j && (m = "array"), !m)
|
|
625
|
+
return !1;
|
|
626
|
+
j && (p = t.length), O && (p = t.replace(w, "_").length), o ? p !== e.len && i.push(N(a.messages[m].len, e.fullField, e.len)) : s && !l && p < e.min ? i.push(N(a.messages[m].min, e.fullField, e.min)) : l && !s && p > e.max ? i.push(N(a.messages[m].max, e.fullField, e.max)) : s && l && (p < e.min || p > e.max) && i.push(N(a.messages[m].range, e.fullField, e.min, e.max));
|
|
627
|
+
}, G = "enum", Wn = function(e, t, n, i, a) {
|
|
628
|
+
e[G] = Array.isArray(e[G]) ? e[G] : [], e[G].indexOf(t) === -1 && i.push(N(a.messages[G], e.fullField, e[G].join(", ")));
|
|
629
|
+
}, Cn = function(e, t, n, i, a) {
|
|
630
|
+
if (e.pattern) {
|
|
631
|
+
if (e.pattern instanceof RegExp)
|
|
632
|
+
e.pattern.lastIndex = 0, e.pattern.test(t) || i.push(N(a.messages.pattern.mismatch, e.fullField, t, e.pattern));
|
|
633
|
+
else if (typeof e.pattern == "string") {
|
|
634
|
+
var o = new RegExp(e.pattern);
|
|
635
|
+
o.test(t) || i.push(N(a.messages.pattern.mismatch, e.fullField, t, e.pattern));
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}, h = {
|
|
639
|
+
required: ht,
|
|
640
|
+
whitespace: Rn,
|
|
641
|
+
type: Vn,
|
|
642
|
+
range: Bn,
|
|
643
|
+
enum: Wn,
|
|
644
|
+
pattern: Cn
|
|
645
|
+
}, Dn = function(e, t, n, i, a) {
|
|
646
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
647
|
+
if (s) {
|
|
648
|
+
if (T(t, "string") && !e.required)
|
|
649
|
+
return n();
|
|
650
|
+
h.required(e, t, i, o, a, "string"), T(t, "string") || (h.type(e, t, i, o, a), h.range(e, t, i, o, a), h.pattern(e, t, i, o, a), e.whitespace === !0 && h.whitespace(e, t, i, o, a));
|
|
651
|
+
}
|
|
652
|
+
n(o);
|
|
653
|
+
}, Un = function(e, t, n, i, a) {
|
|
654
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
655
|
+
if (s) {
|
|
656
|
+
if (T(t) && !e.required)
|
|
657
|
+
return n();
|
|
658
|
+
h.required(e, t, i, o, a), t !== void 0 && h.type(e, t, i, o, a);
|
|
659
|
+
}
|
|
660
|
+
n(o);
|
|
661
|
+
}, zn = function(e, t, n, i, a) {
|
|
662
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
663
|
+
if (s) {
|
|
664
|
+
if (t === "" && (t = void 0), T(t) && !e.required)
|
|
665
|
+
return n();
|
|
666
|
+
h.required(e, t, i, o, a), t !== void 0 && (h.type(e, t, i, o, a), h.range(e, t, i, o, a));
|
|
667
|
+
}
|
|
668
|
+
n(o);
|
|
669
|
+
}, Gn = function(e, t, n, i, a) {
|
|
670
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
671
|
+
if (s) {
|
|
672
|
+
if (T(t) && !e.required)
|
|
673
|
+
return n();
|
|
674
|
+
h.required(e, t, i, o, a), t !== void 0 && h.type(e, t, i, o, a);
|
|
675
|
+
}
|
|
676
|
+
n(o);
|
|
677
|
+
}, Kn = function(e, t, n, i, a) {
|
|
678
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
679
|
+
if (s) {
|
|
680
|
+
if (T(t) && !e.required)
|
|
681
|
+
return n();
|
|
682
|
+
h.required(e, t, i, o, a), T(t) || h.type(e, t, i, o, a);
|
|
683
|
+
}
|
|
684
|
+
n(o);
|
|
685
|
+
}, Yn = function(e, t, n, i, a) {
|
|
686
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
687
|
+
if (s) {
|
|
688
|
+
if (T(t) && !e.required)
|
|
689
|
+
return n();
|
|
690
|
+
h.required(e, t, i, o, a), t !== void 0 && (h.type(e, t, i, o, a), h.range(e, t, i, o, a));
|
|
691
|
+
}
|
|
692
|
+
n(o);
|
|
693
|
+
}, Jn = function(e, t, n, i, a) {
|
|
694
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
695
|
+
if (s) {
|
|
696
|
+
if (T(t) && !e.required)
|
|
697
|
+
return n();
|
|
698
|
+
h.required(e, t, i, o, a), t !== void 0 && (h.type(e, t, i, o, a), h.range(e, t, i, o, a));
|
|
699
|
+
}
|
|
700
|
+
n(o);
|
|
701
|
+
}, Zn = function(e, t, n, i, a) {
|
|
702
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
703
|
+
if (s) {
|
|
704
|
+
if (t == null && !e.required)
|
|
705
|
+
return n();
|
|
706
|
+
h.required(e, t, i, o, a, "array"), t != null && (h.type(e, t, i, o, a), h.range(e, t, i, o, a));
|
|
707
|
+
}
|
|
708
|
+
n(o);
|
|
709
|
+
}, Hn = function(e, t, n, i, a) {
|
|
710
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
711
|
+
if (s) {
|
|
712
|
+
if (T(t) && !e.required)
|
|
713
|
+
return n();
|
|
714
|
+
h.required(e, t, i, o, a), t !== void 0 && h.type(e, t, i, o, a);
|
|
715
|
+
}
|
|
716
|
+
n(o);
|
|
717
|
+
}, Qn = "enum", Xn = function(e, t, n, i, a) {
|
|
718
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
719
|
+
if (s) {
|
|
720
|
+
if (T(t) && !e.required)
|
|
721
|
+
return n();
|
|
722
|
+
h.required(e, t, i, o, a), t !== void 0 && h[Qn](e, t, i, o, a);
|
|
723
|
+
}
|
|
724
|
+
n(o);
|
|
725
|
+
}, kn = function(e, t, n, i, a) {
|
|
726
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
727
|
+
if (s) {
|
|
728
|
+
if (T(t, "string") && !e.required)
|
|
729
|
+
return n();
|
|
730
|
+
h.required(e, t, i, o, a), T(t, "string") || h.pattern(e, t, i, o, a);
|
|
731
|
+
}
|
|
732
|
+
n(o);
|
|
733
|
+
}, ei = function(e, t, n, i, a) {
|
|
734
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
735
|
+
if (s) {
|
|
736
|
+
if (T(t, "date") && !e.required)
|
|
737
|
+
return n();
|
|
738
|
+
if (h.required(e, t, i, o, a), !T(t, "date")) {
|
|
739
|
+
var l;
|
|
740
|
+
t instanceof Date ? l = t : l = new Date(t), h.type(e, l, i, o, a), l && h.range(e, l.getTime(), i, o, a);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
n(o);
|
|
744
|
+
}, ti = function(e, t, n, i, a) {
|
|
745
|
+
var o = [], s = Array.isArray(t) ? "array" : typeof t;
|
|
746
|
+
h.required(e, t, i, o, a, s), n(o);
|
|
747
|
+
}, me = function(e, t, n, i, a) {
|
|
748
|
+
var o = e.type, s = [], l = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
749
|
+
if (l) {
|
|
750
|
+
if (T(t, o) && !e.required)
|
|
751
|
+
return n();
|
|
752
|
+
h.required(e, t, i, s, a, o), T(t, o) || h.type(e, t, i, s, a);
|
|
753
|
+
}
|
|
754
|
+
n(s);
|
|
755
|
+
}, ri = function(e, t, n, i, a) {
|
|
756
|
+
var o = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
757
|
+
if (s) {
|
|
758
|
+
if (T(t) && !e.required)
|
|
759
|
+
return n();
|
|
760
|
+
h.required(e, t, i, o, a);
|
|
761
|
+
}
|
|
762
|
+
n(o);
|
|
763
|
+
}, J = {
|
|
764
|
+
string: Dn,
|
|
765
|
+
method: Un,
|
|
766
|
+
number: zn,
|
|
767
|
+
boolean: Gn,
|
|
768
|
+
regexp: Kn,
|
|
769
|
+
integer: Yn,
|
|
770
|
+
float: Jn,
|
|
771
|
+
array: Zn,
|
|
772
|
+
object: Hn,
|
|
773
|
+
enum: Xn,
|
|
774
|
+
pattern: kn,
|
|
775
|
+
date: ei,
|
|
776
|
+
url: me,
|
|
777
|
+
hex: me,
|
|
778
|
+
email: me,
|
|
779
|
+
required: ti,
|
|
780
|
+
any: ri
|
|
781
|
+
};
|
|
782
|
+
function Ae() {
|
|
783
|
+
return {
|
|
784
|
+
default: "Validation error on field %s",
|
|
785
|
+
required: "%s is required",
|
|
786
|
+
enum: "%s must be one of %s",
|
|
787
|
+
whitespace: "%s cannot be empty",
|
|
788
|
+
date: {
|
|
789
|
+
format: "%s date %s is invalid for format %s",
|
|
790
|
+
parse: "%s date could not be parsed, %s is invalid ",
|
|
791
|
+
invalid: "%s date %s is invalid"
|
|
792
|
+
},
|
|
793
|
+
types: {
|
|
794
|
+
string: "%s is not a %s",
|
|
795
|
+
method: "%s is not a %s (function)",
|
|
796
|
+
array: "%s is not an %s",
|
|
797
|
+
object: "%s is not an %s",
|
|
798
|
+
number: "%s is not a %s",
|
|
799
|
+
date: "%s is not a %s",
|
|
800
|
+
boolean: "%s is not a %s",
|
|
801
|
+
integer: "%s is not an %s",
|
|
802
|
+
float: "%s is not a %s",
|
|
803
|
+
regexp: "%s is not a valid %s",
|
|
804
|
+
email: "%s is not a valid %s",
|
|
805
|
+
url: "%s is not a valid %s",
|
|
806
|
+
hex: "%s is not a valid %s"
|
|
807
|
+
},
|
|
808
|
+
string: {
|
|
809
|
+
len: "%s must be exactly %s characters",
|
|
810
|
+
min: "%s must be at least %s characters",
|
|
811
|
+
max: "%s cannot be longer than %s characters",
|
|
812
|
+
range: "%s must be between %s and %s characters"
|
|
813
|
+
},
|
|
814
|
+
number: {
|
|
815
|
+
len: "%s must equal %s",
|
|
816
|
+
min: "%s cannot be less than %s",
|
|
817
|
+
max: "%s cannot be greater than %s",
|
|
818
|
+
range: "%s must be between %s and %s"
|
|
819
|
+
},
|
|
820
|
+
array: {
|
|
821
|
+
len: "%s must be exactly %s in length",
|
|
822
|
+
min: "%s cannot be less than %s in length",
|
|
823
|
+
max: "%s cannot be greater than %s in length",
|
|
824
|
+
range: "%s must be between %s and %s in length"
|
|
825
|
+
},
|
|
826
|
+
pattern: {
|
|
827
|
+
mismatch: "%s value %s does not match pattern %s"
|
|
828
|
+
},
|
|
829
|
+
clone: function() {
|
|
830
|
+
var e = JSON.parse(JSON.stringify(this));
|
|
831
|
+
return e.clone = this.clone, e;
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
var Oe = Ae(), Q = /* @__PURE__ */ function() {
|
|
836
|
+
function r(t) {
|
|
837
|
+
this.rules = null, this._messages = Oe, this.define(t);
|
|
838
|
+
}
|
|
839
|
+
var e = r.prototype;
|
|
840
|
+
return e.define = function(n) {
|
|
841
|
+
var i = this;
|
|
842
|
+
if (!n)
|
|
843
|
+
throw new Error("Cannot configure a schema with no rules");
|
|
844
|
+
if (typeof n != "object" || Array.isArray(n))
|
|
845
|
+
throw new Error("Rules must be an object");
|
|
846
|
+
this.rules = {}, Object.keys(n).forEach(function(a) {
|
|
847
|
+
var o = n[a];
|
|
848
|
+
i.rules[a] = Array.isArray(o) ? o : [o];
|
|
849
|
+
});
|
|
850
|
+
}, e.messages = function(n) {
|
|
851
|
+
return n && (this._messages = Je(Ae(), n)), this._messages;
|
|
852
|
+
}, e.validate = function(n, i, a) {
|
|
853
|
+
var o = this;
|
|
854
|
+
i === void 0 && (i = {}), a === void 0 && (a = function() {
|
|
855
|
+
});
|
|
856
|
+
var s = n, l = i, w = a;
|
|
857
|
+
if (typeof l == "function" && (w = l, l = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
858
|
+
return w && w(null, s), Promise.resolve(s);
|
|
859
|
+
function p(d) {
|
|
860
|
+
var g = [], f = {};
|
|
861
|
+
function $(u) {
|
|
862
|
+
if (Array.isArray(u)) {
|
|
863
|
+
var y;
|
|
864
|
+
g = (y = g).concat.apply(y, u);
|
|
865
|
+
} else
|
|
866
|
+
g.push(u);
|
|
867
|
+
}
|
|
868
|
+
for (var v = 0; v < d.length; v++)
|
|
869
|
+
$(d[v]);
|
|
870
|
+
g.length ? (f = xe(g), w(g, f)) : w(null, s);
|
|
871
|
+
}
|
|
872
|
+
if (l.messages) {
|
|
873
|
+
var m = this.messages();
|
|
874
|
+
m === Oe && (m = Ae()), Je(m, l.messages), l.messages = m;
|
|
875
|
+
} else
|
|
876
|
+
l.messages = this.messages();
|
|
877
|
+
var b = {}, O = l.keys || Object.keys(this.rules);
|
|
878
|
+
O.forEach(function(d) {
|
|
879
|
+
var g = o.rules[d], f = s[d];
|
|
880
|
+
g.forEach(function($) {
|
|
881
|
+
var v = $;
|
|
882
|
+
typeof v.transform == "function" && (s === n && (s = C({}, s)), f = s[d] = v.transform(f)), typeof v == "function" ? v = {
|
|
883
|
+
validator: v
|
|
884
|
+
} : v = C({}, v), v.validator = o.getValidationMethod(v), v.validator && (v.field = d, v.fullField = v.fullField || d, v.type = o.getType(v), b[d] = b[d] || [], b[d].push({
|
|
885
|
+
rule: v,
|
|
886
|
+
value: f,
|
|
887
|
+
source: s,
|
|
888
|
+
field: d
|
|
889
|
+
}));
|
|
890
|
+
});
|
|
891
|
+
});
|
|
892
|
+
var j = {};
|
|
893
|
+
return In(b, l, function(d, g) {
|
|
894
|
+
var f = d.rule, $ = (f.type === "object" || f.type === "array") && (typeof f.fields == "object" || typeof f.defaultField == "object");
|
|
895
|
+
$ = $ && (f.required || !f.required && d.value), f.field = d.field;
|
|
896
|
+
function v(F, _) {
|
|
897
|
+
return C({}, _, {
|
|
898
|
+
fullField: f.fullField + "." + F,
|
|
899
|
+
fullFields: f.fullFields ? [].concat(f.fullFields, [F]) : [F]
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
function u(F) {
|
|
903
|
+
F === void 0 && (F = []);
|
|
904
|
+
var _ = Array.isArray(F) ? F : [F];
|
|
905
|
+
!l.suppressWarning && _.length && r.warning("async-validator:", _), _.length && f.message !== void 0 && (_ = [].concat(f.message));
|
|
906
|
+
var S = _.map(Ye(f, s));
|
|
907
|
+
if (l.first && S.length)
|
|
908
|
+
return j[f.field] = 1, g(S);
|
|
909
|
+
if (!$)
|
|
910
|
+
g(S);
|
|
911
|
+
else {
|
|
912
|
+
if (f.required && !d.value)
|
|
913
|
+
return f.message !== void 0 ? S = [].concat(f.message).map(Ye(f, s)) : l.error && (S = [l.error(f, N(l.messages.required, f.field))]), g(S);
|
|
914
|
+
var R = {};
|
|
915
|
+
f.defaultField && Object.keys(d.value).map(function(M) {
|
|
916
|
+
R[M] = f.defaultField;
|
|
917
|
+
}), R = C({}, R, d.rule.fields);
|
|
918
|
+
var W = {};
|
|
919
|
+
Object.keys(R).forEach(function(M) {
|
|
920
|
+
var L = R[M], ue = Array.isArray(L) ? L : [L];
|
|
921
|
+
W[M] = ue.map(v.bind(null, M));
|
|
922
|
+
});
|
|
923
|
+
var D = new r(W);
|
|
924
|
+
D.messages(l.messages), d.rule.options && (d.rule.options.messages = l.messages, d.rule.options.error = l.error), D.validate(d.value, d.rule.options || l, function(M) {
|
|
925
|
+
var L = [];
|
|
926
|
+
S && S.length && L.push.apply(L, S), M && M.length && L.push.apply(L, M), g(L.length ? L : null);
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
var y;
|
|
931
|
+
if (f.asyncValidator)
|
|
932
|
+
y = f.asyncValidator(f, d.value, u, d.source, l);
|
|
933
|
+
else if (f.validator) {
|
|
934
|
+
try {
|
|
935
|
+
y = f.validator(f, d.value, u, d.source, l);
|
|
936
|
+
} catch (F) {
|
|
937
|
+
console.error == null || console.error(F), l.suppressValidatorError || setTimeout(function() {
|
|
938
|
+
throw F;
|
|
939
|
+
}, 0), u(F.message);
|
|
940
|
+
}
|
|
941
|
+
y === !0 ? u() : y === !1 ? u(typeof f.message == "function" ? f.message(f.fullField || f.field) : f.message || (f.fullField || f.field) + " fails") : y instanceof Array ? u(y) : y instanceof Error && u(y.message);
|
|
942
|
+
}
|
|
943
|
+
y && y.then && y.then(function() {
|
|
944
|
+
return u();
|
|
945
|
+
}, function(F) {
|
|
946
|
+
return u(F);
|
|
947
|
+
});
|
|
948
|
+
}, function(d) {
|
|
949
|
+
p(d);
|
|
950
|
+
}, s);
|
|
951
|
+
}, e.getType = function(n) {
|
|
952
|
+
if (n.type === void 0 && n.pattern instanceof RegExp && (n.type = "pattern"), typeof n.validator != "function" && n.type && !J.hasOwnProperty(n.type))
|
|
953
|
+
throw new Error(N("Unknown rule type %s", n.type));
|
|
954
|
+
return n.type || "string";
|
|
955
|
+
}, e.getValidationMethod = function(n) {
|
|
956
|
+
if (typeof n.validator == "function")
|
|
957
|
+
return n.validator;
|
|
958
|
+
var i = Object.keys(n), a = i.indexOf("message");
|
|
959
|
+
return a !== -1 && i.splice(a, 1), i.length === 1 && i[0] === "required" ? J.required : J[this.getType(n)] || void 0;
|
|
960
|
+
}, r;
|
|
961
|
+
}();
|
|
962
|
+
Q.register = function(e, t) {
|
|
963
|
+
if (typeof t != "function")
|
|
964
|
+
throw new Error("Cannot register a validator by type, validator is not a function");
|
|
965
|
+
J[e] = t;
|
|
966
|
+
};
|
|
967
|
+
Q.warning = yt;
|
|
968
|
+
Q.messages = Oe;
|
|
969
|
+
Q.validators = J;
|
|
970
|
+
const ni = [
|
|
971
|
+
"",
|
|
972
|
+
"error",
|
|
973
|
+
"validating",
|
|
974
|
+
"success"
|
|
975
|
+
], ii = Ee({
|
|
976
|
+
label: String,
|
|
977
|
+
labelWidth: {
|
|
978
|
+
type: [String, Number],
|
|
979
|
+
default: ""
|
|
980
|
+
},
|
|
981
|
+
labelPosition: {
|
|
982
|
+
type: String,
|
|
983
|
+
values: ["left", "right", "top", ""],
|
|
984
|
+
default: ""
|
|
985
|
+
},
|
|
986
|
+
prop: {
|
|
987
|
+
type: se([String, Array])
|
|
988
|
+
},
|
|
989
|
+
required: {
|
|
990
|
+
type: Boolean,
|
|
991
|
+
default: void 0
|
|
992
|
+
},
|
|
993
|
+
rules: {
|
|
994
|
+
type: se([Object, Array])
|
|
995
|
+
},
|
|
996
|
+
error: String,
|
|
997
|
+
validateStatus: {
|
|
998
|
+
type: String,
|
|
999
|
+
values: ni
|
|
1000
|
+
},
|
|
1001
|
+
for: String,
|
|
1002
|
+
inlineMessage: {
|
|
1003
|
+
type: Boolean,
|
|
1004
|
+
default: void 0
|
|
1005
|
+
},
|
|
1006
|
+
showMessage: {
|
|
1007
|
+
type: Boolean,
|
|
1008
|
+
default: !0
|
|
1009
|
+
},
|
|
1010
|
+
size: {
|
|
1011
|
+
type: String,
|
|
1012
|
+
values: ot
|
|
1013
|
+
}
|
|
1014
|
+
}), He = "ElLabelWrap";
|
|
1015
|
+
var ai = H({
|
|
1016
|
+
name: He,
|
|
1017
|
+
props: {
|
|
1018
|
+
isAutoWidth: Boolean,
|
|
1019
|
+
updateAll: Boolean
|
|
1020
|
+
},
|
|
1021
|
+
setup(r, {
|
|
1022
|
+
slots: e
|
|
1023
|
+
}) {
|
|
1024
|
+
const t = ie(je, void 0), n = ie(be);
|
|
1025
|
+
n || Kt(He, "usage: <el-form-item><label-wrap /></el-form-item>");
|
|
1026
|
+
const i = Se("form"), a = B(), o = B(0), s = () => {
|
|
1027
|
+
var p;
|
|
1028
|
+
if ((p = a.value) != null && p.firstElementChild) {
|
|
1029
|
+
const m = window.getComputedStyle(a.value.firstElementChild).width;
|
|
1030
|
+
return Math.ceil(Number.parseFloat(m));
|
|
1031
|
+
} else
|
|
1032
|
+
return 0;
|
|
1033
|
+
}, l = (p = "update") => {
|
|
1034
|
+
rt(() => {
|
|
1035
|
+
e.default && r.isAutoWidth && (p === "update" ? o.value = s() : p === "remove" && (t == null || t.deregisterLabelWidth(o.value)));
|
|
1036
|
+
});
|
|
1037
|
+
}, w = () => l("update");
|
|
1038
|
+
return et(() => {
|
|
1039
|
+
w();
|
|
1040
|
+
}), tt(() => {
|
|
1041
|
+
l("remove");
|
|
1042
|
+
}), Et(() => w()), ne(o, (p, m) => {
|
|
1043
|
+
r.updateAll && (t == null || t.registerLabelWidth(p, m));
|
|
1044
|
+
}), Ct(E(() => {
|
|
1045
|
+
var p, m;
|
|
1046
|
+
return (m = (p = a.value) == null ? void 0 : p.firstElementChild) != null ? m : null;
|
|
1047
|
+
}), w), () => {
|
|
1048
|
+
var p, m;
|
|
1049
|
+
if (!e)
|
|
1050
|
+
return null;
|
|
1051
|
+
const {
|
|
1052
|
+
isAutoWidth: b
|
|
1053
|
+
} = r;
|
|
1054
|
+
if (b) {
|
|
1055
|
+
const O = t == null ? void 0 : t.autoLabelWidth, j = n == null ? void 0 : n.hasLabel, d = {};
|
|
1056
|
+
if (j && O && O !== "auto") {
|
|
1057
|
+
const g = Math.max(0, Number.parseInt(O, 10) - o.value), $ = (n.labelPosition || t.labelPosition) === "left" ? "marginRight" : "marginLeft";
|
|
1058
|
+
g && (d[$] = `${g}px`);
|
|
1059
|
+
}
|
|
1060
|
+
return ae("div", {
|
|
1061
|
+
ref: a,
|
|
1062
|
+
class: [i.be("item", "label-wrap")],
|
|
1063
|
+
style: d
|
|
1064
|
+
}, [(p = e.default) == null ? void 0 : p.call(e)]);
|
|
1065
|
+
} else
|
|
1066
|
+
return ae(St, {
|
|
1067
|
+
ref: a
|
|
1068
|
+
}, [(m = e.default) == null ? void 0 : m.call(e)]);
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
const oi = H({
|
|
1073
|
+
name: "ElFormItem"
|
|
1074
|
+
}), si = /* @__PURE__ */ H({
|
|
1075
|
+
...oi,
|
|
1076
|
+
props: ii,
|
|
1077
|
+
setup(r, { expose: e }) {
|
|
1078
|
+
const t = r, n = Tt(), i = ie(je, void 0), a = ie(be, void 0), o = st(void 0, { formItem: !1 }), s = Se("form-item"), l = Zt().value, w = B([]), p = B(""), m = Dt(p, 100), b = B(""), O = B();
|
|
1079
|
+
let j, d = !1;
|
|
1080
|
+
const g = E(() => t.labelPosition || (i == null ? void 0 : i.labelPosition)), f = E(() => {
|
|
1081
|
+
if (g.value === "top")
|
|
1082
|
+
return {};
|
|
1083
|
+
const c = Ve(t.labelWidth || (i == null ? void 0 : i.labelWidth) || "");
|
|
1084
|
+
return c ? { width: c } : {};
|
|
1085
|
+
}), $ = E(() => {
|
|
1086
|
+
if (g.value === "top" || i != null && i.inline)
|
|
1087
|
+
return {};
|
|
1088
|
+
if (!t.label && !t.labelWidth && W)
|
|
1089
|
+
return {};
|
|
1090
|
+
const c = Ve(t.labelWidth || (i == null ? void 0 : i.labelWidth) || "");
|
|
1091
|
+
return !t.label && !n.label ? { marginLeft: c } : {};
|
|
1092
|
+
}), v = E(() => [
|
|
1093
|
+
s.b(),
|
|
1094
|
+
s.m(o.value),
|
|
1095
|
+
s.is("error", p.value === "error"),
|
|
1096
|
+
s.is("validating", p.value === "validating"),
|
|
1097
|
+
s.is("success", p.value === "success"),
|
|
1098
|
+
s.is("required", wt.value || t.required),
|
|
1099
|
+
s.is("no-asterisk", i == null ? void 0 : i.hideRequiredAsterisk),
|
|
1100
|
+
(i == null ? void 0 : i.requireAsteriskPosition) === "right" ? "asterisk-right" : "asterisk-left",
|
|
1101
|
+
{
|
|
1102
|
+
[s.m("feedback")]: i == null ? void 0 : i.statusIcon,
|
|
1103
|
+
[s.m(`label-${g.value}`)]: g.value
|
|
1104
|
+
}
|
|
1105
|
+
]), u = E(() => ft(t.inlineMessage) ? t.inlineMessage : (i == null ? void 0 : i.inlineMessage) || !1), y = E(() => [
|
|
1106
|
+
s.e("error"),
|
|
1107
|
+
{ [s.em("error", "inline")]: u.value }
|
|
1108
|
+
]), F = E(() => t.prop ? fe(t.prop) ? t.prop.join(".") : t.prop : ""), _ = E(() => !!(t.label || n.label)), S = E(() => {
|
|
1109
|
+
var c;
|
|
1110
|
+
return (c = t.for) != null ? c : w.value.length === 1 ? w.value[0] : void 0;
|
|
1111
|
+
}), R = E(() => !S.value && _.value), W = !!a, D = E(() => {
|
|
1112
|
+
const c = i == null ? void 0 : i.model;
|
|
1113
|
+
if (!(!c || !t.prop))
|
|
1114
|
+
return ge(c, t.prop).value;
|
|
1115
|
+
}), M = E(() => {
|
|
1116
|
+
const { required: c } = t, x = [];
|
|
1117
|
+
t.rules && x.push(...he(t.rules));
|
|
1118
|
+
const I = i == null ? void 0 : i.rules;
|
|
1119
|
+
if (I && t.prop) {
|
|
1120
|
+
const P = ge(I, t.prop).value;
|
|
1121
|
+
P && x.push(...he(P));
|
|
1122
|
+
}
|
|
1123
|
+
if (c !== void 0) {
|
|
1124
|
+
const P = x.map((V, z) => [V, z]).filter(([V]) => "required" in V);
|
|
1125
|
+
if (P.length > 0)
|
|
1126
|
+
for (const [V, z] of P)
|
|
1127
|
+
V.required !== c && (x[z] = { ...V, required: c });
|
|
1128
|
+
else
|
|
1129
|
+
x.push({ required: c });
|
|
1130
|
+
}
|
|
1131
|
+
return x;
|
|
1132
|
+
}), L = E(() => M.value.length > 0), ue = (c) => M.value.filter((I) => !I.trigger || !c ? !0 : fe(I.trigger) ? I.trigger.includes(c) : I.trigger === c).map(({ trigger: I, ...P }) => P), wt = E(() => M.value.some((c) => c.required)), Ft = E(() => {
|
|
1133
|
+
var c;
|
|
1134
|
+
return m.value === "error" && t.showMessage && ((c = i == null ? void 0 : i.showMessage) != null ? c : !0);
|
|
1135
|
+
}), _e = E(() => `${t.label || ""}${(i == null ? void 0 : i.labelSuffix) || ""}`), U = (c) => {
|
|
1136
|
+
p.value = c;
|
|
1137
|
+
}, xt = (c) => {
|
|
1138
|
+
var x, I;
|
|
1139
|
+
const { errors: P, fields: V } = c;
|
|
1140
|
+
(!P || !V) && console.error(c), U("error"), b.value = P ? (I = (x = P == null ? void 0 : P[0]) == null ? void 0 : x.message) != null ? I : `${t.prop} is required` : "", i == null || i.emit("validate", t.prop, !1, b.value);
|
|
1141
|
+
}, At = () => {
|
|
1142
|
+
U("success"), i == null || i.emit("validate", t.prop, !0, "");
|
|
1143
|
+
}, Ot = async (c) => {
|
|
1144
|
+
const x = F.value;
|
|
1145
|
+
return new Q({
|
|
1146
|
+
[x]: c
|
|
1147
|
+
}).validate({ [x]: D.value }, { firstFields: !0 }).then(() => (At(), !0)).catch((P) => (xt(P), Promise.reject(P)));
|
|
1148
|
+
}, Pe = async (c, x) => {
|
|
1149
|
+
if (d || !t.prop)
|
|
1150
|
+
return !1;
|
|
1151
|
+
const I = ut(x);
|
|
1152
|
+
if (!L.value)
|
|
1153
|
+
return x == null || x(!1), !1;
|
|
1154
|
+
const P = ue(c);
|
|
1155
|
+
return P.length === 0 ? (x == null || x(!0), !0) : (U("validating"), Ot(P).then(() => (x == null || x(!0), !0)).catch((V) => {
|
|
1156
|
+
const { fields: z } = V;
|
|
1157
|
+
return x == null || x(!1, z), I ? !1 : Promise.reject(z);
|
|
1158
|
+
}));
|
|
1159
|
+
}, de = () => {
|
|
1160
|
+
U(""), b.value = "", d = !1;
|
|
1161
|
+
}, $e = async () => {
|
|
1162
|
+
const c = i == null ? void 0 : i.model;
|
|
1163
|
+
if (!c || !t.prop)
|
|
1164
|
+
return;
|
|
1165
|
+
const x = ge(c, t.prop);
|
|
1166
|
+
d = !0, x.value = ze(j), await rt(), de(), d = !1;
|
|
1167
|
+
}, qt = (c) => {
|
|
1168
|
+
w.value.includes(c) || w.value.push(c);
|
|
1169
|
+
}, jt = (c) => {
|
|
1170
|
+
w.value = w.value.filter((x) => x !== c);
|
|
1171
|
+
};
|
|
1172
|
+
ne(() => t.error, (c) => {
|
|
1173
|
+
b.value = c || "", U(c ? "error" : "");
|
|
1174
|
+
}, { immediate: !0 }), ne(() => t.validateStatus, (c) => U(c || ""));
|
|
1175
|
+
const ce = ve({
|
|
1176
|
+
...Xe(t),
|
|
1177
|
+
$el: O,
|
|
1178
|
+
size: o,
|
|
1179
|
+
validateMessage: b,
|
|
1180
|
+
validateState: p,
|
|
1181
|
+
labelId: l,
|
|
1182
|
+
inputIds: w,
|
|
1183
|
+
isGroup: R,
|
|
1184
|
+
hasLabel: _,
|
|
1185
|
+
fieldValue: D,
|
|
1186
|
+
addInputId: qt,
|
|
1187
|
+
removeInputId: jt,
|
|
1188
|
+
resetField: $e,
|
|
1189
|
+
clearValidate: de,
|
|
1190
|
+
validate: Pe,
|
|
1191
|
+
propString: F
|
|
1192
|
+
});
|
|
1193
|
+
return Qe(be, ce), et(() => {
|
|
1194
|
+
t.prop && (i == null || i.addField(ce), j = ze(D.value));
|
|
1195
|
+
}), tt(() => {
|
|
1196
|
+
i == null || i.removeField(ce);
|
|
1197
|
+
}), e({
|
|
1198
|
+
size: o,
|
|
1199
|
+
validateMessage: b,
|
|
1200
|
+
validateState: p,
|
|
1201
|
+
validate: Pe,
|
|
1202
|
+
clearValidate: de,
|
|
1203
|
+
resetField: $e
|
|
1204
|
+
}), (c, x) => {
|
|
1205
|
+
var I;
|
|
1206
|
+
return ye(), ke("div", {
|
|
1207
|
+
ref_key: "formItemRef",
|
|
1208
|
+
ref: O,
|
|
1209
|
+
class: K(q(v)),
|
|
1210
|
+
role: q(R) ? "group" : void 0,
|
|
1211
|
+
"aria-labelledby": q(R) ? q(l) : void 0
|
|
1212
|
+
}, [
|
|
1213
|
+
ae(q(ai), {
|
|
1214
|
+
"is-auto-width": q(f).width === "auto",
|
|
1215
|
+
"update-all": ((I = q(i)) == null ? void 0 : I.labelWidth) === "auto"
|
|
1216
|
+
}, {
|
|
1217
|
+
default: pe(() => [
|
|
1218
|
+
q(_) ? (ye(), _t(Pt(q(S) ? "label" : "div"), {
|
|
1219
|
+
key: 0,
|
|
1220
|
+
id: q(l),
|
|
1221
|
+
for: q(S),
|
|
1222
|
+
class: K(q(s).e("label")),
|
|
1223
|
+
style: Ie(q(f))
|
|
1224
|
+
}, {
|
|
1225
|
+
default: pe(() => [
|
|
1226
|
+
ee(c.$slots, "label", { label: q(_e) }, () => [
|
|
1227
|
+
$t(Me(q(_e)), 1)
|
|
1228
|
+
])
|
|
1229
|
+
]),
|
|
1230
|
+
_: 3
|
|
1231
|
+
}, 8, ["id", "for", "class", "style"])) : Ne("v-if", !0)
|
|
1232
|
+
]),
|
|
1233
|
+
_: 3
|
|
1234
|
+
}, 8, ["is-auto-width", "update-all"]),
|
|
1235
|
+
Re("div", {
|
|
1236
|
+
class: K(q(s).e("content")),
|
|
1237
|
+
style: Ie(q($))
|
|
1238
|
+
}, [
|
|
1239
|
+
ee(c.$slots, "default"),
|
|
1240
|
+
ae(It, {
|
|
1241
|
+
name: `${q(s).namespace.value}-zoom-in-top`
|
|
1242
|
+
}, {
|
|
1243
|
+
default: pe(() => [
|
|
1244
|
+
q(Ft) ? ee(c.$slots, "error", {
|
|
1245
|
+
key: 0,
|
|
1246
|
+
error: b.value
|
|
1247
|
+
}, () => [
|
|
1248
|
+
Re("div", {
|
|
1249
|
+
class: K(q(y))
|
|
1250
|
+
}, Me(b.value), 3)
|
|
1251
|
+
]) : Ne("v-if", !0)
|
|
1252
|
+
]),
|
|
1253
|
+
_: 3
|
|
1254
|
+
}, 8, ["name"])
|
|
1255
|
+
], 6)
|
|
1256
|
+
], 10, ["role", "aria-labelledby"]);
|
|
1257
|
+
};
|
|
1258
|
+
}
|
|
1259
|
+
});
|
|
1260
|
+
var bt = /* @__PURE__ */ lt(si, [["__file", "form-item.vue"]]);
|
|
1261
|
+
const mi = Ut(qn, {
|
|
1262
|
+
FormItem: bt
|
|
1263
|
+
}), vi = zt(bt);
|
|
1264
|
+
export {
|
|
1265
|
+
vi as E,
|
|
1266
|
+
mi as a
|
|
1267
|
+
};
|