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