st-comp 0.0.143 → 0.0.144
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.js +2 -2
- package/es/ConfigProvider.cjs +1 -1
- package/es/ConfigProvider.js +28 -11
- package/es/Dialog.cjs +1 -1
- package/es/Dialog.js +22 -24
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +28 -27
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +14 -14
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +24 -25
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +12 -12
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +16 -16
- package/es/Table.cjs +1 -1
- package/es/Table.js +16 -16
- package/es/User.cjs +1 -1
- package/es/User.js +510 -382
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +37 -36
- package/es/VirtualTable.js +10 -10
- package/es/_initCloneObject-14b53c6f.js +81 -0
- package/es/_initCloneObject-441db749.cjs +1 -0
- package/es/{base-3ecbc734.js → base-437d17f3.js} +25 -25
- package/es/{castArray-7d3fc921.js → castArray-4251bbe4.js} +1 -1
- package/es/{config-provider-83904b4d.js → config-provider-55482a43.js} +3 -3
- package/es/{debounce-7344b088.js → debounce-ac30be50.js} +14 -14
- package/es/{dropdown-7da44c8f.js → dropdown-634b5e27.js} +4 -4
- package/es/{dropdown-9a974876.cjs → dropdown-d7c59a21.cjs} +1 -1
- package/es/{el-button-24f79286.js → el-button-e1665717.js} +3 -3
- package/es/el-checkbox-group-492b95cc.cjs +1 -0
- package/es/el-checkbox-group-e8fece80.js +67 -0
- package/es/{el-empty-79c5f7a8.js → el-empty-bacc6613.js} +1 -1
- package/es/el-form-item-5bdffd07.cjs +12 -0
- package/es/el-form-item-af1855f0.js +1262 -0
- package/es/{el-input-6c6f5bda.cjs → el-input-23e2bac3.cjs} +1 -1
- package/es/{el-input-ee7db655.js → el-input-4961b99f.js} +71 -71
- package/es/{el-input-number-0524d787.cjs → el-input-number-40a81eb5.cjs} +1 -1
- package/es/{el-input-number-63c21037.js → el-input-number-610fc8ba.js} +24 -24
- package/es/{el-menu-item-dc904a35.cjs → el-menu-item-78b858f2.cjs} +1 -1
- package/es/{el-menu-item-0d92e7dc.js → el-menu-item-7d04c11a.js} +7 -7
- package/es/{el-message-71aa42ca.js → el-message-c3b3ac96.js} +16 -16
- package/es/{el-message-562e923d.cjs → el-message-d4df8136.cjs} +1 -1
- package/es/{el-overlay-6056c89a.js → el-overlay-12dd9b35.js} +140 -137
- package/es/el-overlay-bc0790a2.cjs +1 -0
- package/es/{el-popover-c8b2456c.js → el-popover-0aa071f2.js} +4 -4
- package/es/{el-popover-8735b1fa.cjs → el-popover-8a77e015.cjs} +1 -1
- package/es/el-popper-50100766.js +2262 -0
- package/es/el-popper-746070ba.cjs +1 -0
- package/es/{el-scrollbar-66f3bb72.js → el-scrollbar-562d0595.js} +11 -11
- package/es/{el-select-5fb7d469.js → el-select-9381b156.js} +55 -55
- package/es/el-select-b162dffc.cjs +1 -0
- package/es/{el-table-column-560db3aa.js → el-table-column-55bffba5.js} +1049 -1124
- package/es/el-table-column-6d761fce.cjs +14 -0
- package/es/el-tag-985d9aff.js +279 -0
- package/es/el-tag-c51a6490.cjs +1 -0
- package/es/{index-68ee64fa.js → index-09e01b1d.js} +7 -7
- package/es/{index-fa07a823.js → index-0cb48e01.js} +81 -78
- package/es/index-39ec9741.js +112 -0
- package/es/index-3bf8d597.cjs +1 -0
- package/es/index-a387515d.cjs +1 -0
- package/es/index-a902a0d9.js +59 -0
- package/es/index-deb8de52.cjs +1 -0
- package/es/{raf-377cf8f5.js → raf-b128c7b7.js} +1 -1
- package/es/{scroll-1efa8148.js → scroll-387fcfdb.js} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-9c0363ac.js → use-form-common-props-f377e500.js} +30 -30
- package/es/{vnode-cfcdab70.js → vnode-7dfd4ed5.js} +1 -1
- package/es/{zh-cn-4a476dc8.js → zh-cn-eb9c2820.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +141 -141
- package/lib/{index-a992391a.js → index-e7a32fed.js} +12131 -11996
- package/lib/{python-58a62aaf.js → python-ae8d98bd.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/ConfigProvider/index.vue +28 -0
- package/packages/User/index.vue +87 -1
- package/es/el-form-item-7d32befa.cjs +0 -12
- package/es/el-form-item-afc3dcf2.js +0 -1324
- package/es/el-overlay-891dcc40.cjs +0 -1
- package/es/el-popper-d3eef7ed.js +0 -2093
- package/es/el-popper-f62316cd.cjs +0 -1
- package/es/el-select-928f8c19.cjs +0 -1
- package/es/el-table-column-dd8b62aa.cjs +0 -14
- package/es/el-tag-3b03d13e.cjs +0 -1
- package/es/el-tag-6a31c968.js +0 -450
- package/es/event-09e37cc8.js +0 -6
- package/es/event-61f49698.cjs +0 -1
- package/es/index-80a2b137.cjs +0 -1
- package/es/index-a1ecf26c.js +0 -167
- package/es/index-e1e83173.cjs +0 -1
- package/es/refs-46cf8186.js +0 -9
- package/es/refs-d00b710b.cjs +0 -1
|
@@ -0,0 +1,1262 @@
|
|
|
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 z, 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 { G as Rt, c as it, a as at, H as je, I as ye } from "./use-form-common-props-f377e500.js";
|
|
3
|
+
import { S as Ve, I as ot, G as Lt, K as Vt, b as Ee, d as he, s as st, i as be, c as ft, f as K, u as Se, _ as lt, h as ut, t as Bt, e as Wt, R as Ct, y as Be, w as Dt, v as Ut } from "./base-437d17f3.js";
|
|
4
|
+
import { c as we } from "./castArray-4251bbe4.js";
|
|
5
|
+
import { a as Gt } from "./el-scrollbar-562d0595.js";
|
|
6
|
+
import { g as ge } from "./index-09e01b1d.js";
|
|
7
|
+
import { k as dt, r as ct, t as zt, v as Kt, x as Yt, n as Te, y as fe, z as pt, g as Jt, S as Zt, m as Ht } from "./el-popper-50100766.js";
|
|
8
|
+
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-14b53c6f.js";
|
|
9
|
+
function rr(r, e) {
|
|
10
|
+
for (var t = -1, n = r == null ? 0 : r.length; ++t < n && e(r[t], t, r) !== !1; )
|
|
11
|
+
;
|
|
12
|
+
return r;
|
|
13
|
+
}
|
|
14
|
+
function nr(r, e) {
|
|
15
|
+
return r && le(e, dt(e), r);
|
|
16
|
+
}
|
|
17
|
+
function ir(r, e) {
|
|
18
|
+
return r && le(e, _e(e), r);
|
|
19
|
+
}
|
|
20
|
+
function ar(r, e) {
|
|
21
|
+
return le(r, ct(r), e);
|
|
22
|
+
}
|
|
23
|
+
var or = Object.getOwnPropertySymbols, sr = or ? function(r) {
|
|
24
|
+
for (var e = []; r; )
|
|
25
|
+
Kt(e, ct(r)), r = Qt(r);
|
|
26
|
+
return e;
|
|
27
|
+
} : zt;
|
|
28
|
+
const mt = sr;
|
|
29
|
+
function fr(r, e) {
|
|
30
|
+
return le(r, mt(r), e);
|
|
31
|
+
}
|
|
32
|
+
function lr(r) {
|
|
33
|
+
return Yt(r, _e, mt);
|
|
34
|
+
}
|
|
35
|
+
var ur = Object.prototype, dr = ur.hasOwnProperty;
|
|
36
|
+
function cr(r) {
|
|
37
|
+
var e = r.length, t = new r.constructor(e);
|
|
38
|
+
return e && typeof r[0] == "string" && dr.call(r, "index") && (t.index = r.index, t.input = r.input), t;
|
|
39
|
+
}
|
|
40
|
+
function pr(r, e) {
|
|
41
|
+
var t = e ? gt(r.buffer) : r.buffer;
|
|
42
|
+
return new r.constructor(t, r.byteOffset, r.byteLength);
|
|
43
|
+
}
|
|
44
|
+
var gr = /\w*$/;
|
|
45
|
+
function mr(r) {
|
|
46
|
+
var e = new r.constructor(r.source, gr.exec(r));
|
|
47
|
+
return e.lastIndex = r.lastIndex, e;
|
|
48
|
+
}
|
|
49
|
+
var We = Ve ? Ve.prototype : void 0, Ce = We ? We.valueOf : void 0;
|
|
50
|
+
function vr(r) {
|
|
51
|
+
return Ce ? Object(Ce.call(r)) : {};
|
|
52
|
+
}
|
|
53
|
+
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]";
|
|
54
|
+
function Rr(r, e, t) {
|
|
55
|
+
var n = r.constructor;
|
|
56
|
+
switch (e) {
|
|
57
|
+
case qr:
|
|
58
|
+
return gt(r);
|
|
59
|
+
case yr:
|
|
60
|
+
case hr:
|
|
61
|
+
return new n(+r);
|
|
62
|
+
case jr:
|
|
63
|
+
return pr(r, t);
|
|
64
|
+
case Er:
|
|
65
|
+
case Sr:
|
|
66
|
+
case Tr:
|
|
67
|
+
case _r:
|
|
68
|
+
case Pr:
|
|
69
|
+
case $r:
|
|
70
|
+
case Ir:
|
|
71
|
+
case Nr:
|
|
72
|
+
case Mr:
|
|
73
|
+
return Xt(r, t);
|
|
74
|
+
case br:
|
|
75
|
+
return new n();
|
|
76
|
+
case wr:
|
|
77
|
+
case Or:
|
|
78
|
+
return new n(r);
|
|
79
|
+
case Fr:
|
|
80
|
+
return mr(r);
|
|
81
|
+
case xr:
|
|
82
|
+
return new n();
|
|
83
|
+
case Ar:
|
|
84
|
+
return vr(r);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
var Lr = "[object Map]";
|
|
88
|
+
function Vr(r) {
|
|
89
|
+
return ot(r) && Te(r) == Lr;
|
|
90
|
+
}
|
|
91
|
+
var De = fe && fe.isMap, Br = De ? pt(De) : Vr;
|
|
92
|
+
const Wr = Br;
|
|
93
|
+
var Cr = "[object Set]";
|
|
94
|
+
function Dr(r) {
|
|
95
|
+
return ot(r) && Te(r) == Cr;
|
|
96
|
+
}
|
|
97
|
+
var Ue = fe && fe.isSet, Ur = Ue ? pt(Ue) : Dr;
|
|
98
|
+
const Gr = Ur;
|
|
99
|
+
var zr = 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 = {};
|
|
100
|
+
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;
|
|
101
|
+
O[Qr] = O[yt] = O[on] = !1;
|
|
102
|
+
function re(r, e, t, n, i, o) {
|
|
103
|
+
var a, s = e & zr, u = e & Kr, b = e & Yr;
|
|
104
|
+
if (t && (a = i ? t(r, n, i, o) : t(r)), a !== void 0)
|
|
105
|
+
return a;
|
|
106
|
+
if (!Lt(r))
|
|
107
|
+
return r;
|
|
108
|
+
var g = Vt(r);
|
|
109
|
+
if (g) {
|
|
110
|
+
if (a = cr(r), !s)
|
|
111
|
+
return kt(r, a);
|
|
112
|
+
} else {
|
|
113
|
+
var m = Te(r), h = m == yt || m == Xr;
|
|
114
|
+
if (Jt(r))
|
|
115
|
+
return er(r, s);
|
|
116
|
+
if (m == ht || m == vt || h && !i) {
|
|
117
|
+
if (a = u || h ? {} : tr(r), !s)
|
|
118
|
+
return u ? fr(r, ir(a, r)) : ar(r, nr(a, r));
|
|
119
|
+
} else {
|
|
120
|
+
if (!O[m])
|
|
121
|
+
return i ? r : {};
|
|
122
|
+
a = Rr(r, m, s);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
o || (o = new Zt());
|
|
126
|
+
var A = o.get(r);
|
|
127
|
+
if (A)
|
|
128
|
+
return A;
|
|
129
|
+
o.set(r, a), Gr(r) ? r.forEach(function(v) {
|
|
130
|
+
a.add(re(v, e, t, v, r, o));
|
|
131
|
+
}) : Wr(r) && r.forEach(function(v, l) {
|
|
132
|
+
a.set(l, re(v, e, t, l, r, o));
|
|
133
|
+
});
|
|
134
|
+
var j = b ? u ? lr : Ht : u ? _e : dt, d = g ? void 0 : j(r);
|
|
135
|
+
return rr(d || r, function(v, l) {
|
|
136
|
+
d && (l = v, v = r[l]), Rt(a, l, re(v, e, t, l, r, o));
|
|
137
|
+
}), a;
|
|
138
|
+
}
|
|
139
|
+
var hn = 4;
|
|
140
|
+
function Ge(r) {
|
|
141
|
+
return re(r, hn);
|
|
142
|
+
}
|
|
143
|
+
const bn = Ee({
|
|
144
|
+
size: {
|
|
145
|
+
type: String,
|
|
146
|
+
values: it
|
|
147
|
+
},
|
|
148
|
+
disabled: Boolean
|
|
149
|
+
}), wn = Ee({
|
|
150
|
+
...bn,
|
|
151
|
+
model: Object,
|
|
152
|
+
rules: {
|
|
153
|
+
type: he(Object)
|
|
154
|
+
},
|
|
155
|
+
labelPosition: {
|
|
156
|
+
type: String,
|
|
157
|
+
values: ["left", "right", "top"],
|
|
158
|
+
default: "right"
|
|
159
|
+
},
|
|
160
|
+
requireAsteriskPosition: {
|
|
161
|
+
type: String,
|
|
162
|
+
values: ["left", "right"],
|
|
163
|
+
default: "left"
|
|
164
|
+
},
|
|
165
|
+
labelWidth: {
|
|
166
|
+
type: [String, Number],
|
|
167
|
+
default: ""
|
|
168
|
+
},
|
|
169
|
+
labelSuffix: {
|
|
170
|
+
type: String,
|
|
171
|
+
default: ""
|
|
172
|
+
},
|
|
173
|
+
inline: Boolean,
|
|
174
|
+
inlineMessage: Boolean,
|
|
175
|
+
statusIcon: Boolean,
|
|
176
|
+
showMessage: {
|
|
177
|
+
type: Boolean,
|
|
178
|
+
default: !0
|
|
179
|
+
},
|
|
180
|
+
validateOnRuleChange: {
|
|
181
|
+
type: Boolean,
|
|
182
|
+
default: !0
|
|
183
|
+
},
|
|
184
|
+
hideRequiredAsterisk: Boolean,
|
|
185
|
+
scrollToError: Boolean,
|
|
186
|
+
scrollIntoViewOptions: {
|
|
187
|
+
type: [Object, Boolean]
|
|
188
|
+
}
|
|
189
|
+
}), Fn = {
|
|
190
|
+
validate: (r, e, t) => (st(r) || be(r)) && ft(e) && be(t)
|
|
191
|
+
}, xn = "ElForm";
|
|
192
|
+
function On() {
|
|
193
|
+
const r = B([]), e = E(() => {
|
|
194
|
+
if (!r.value.length)
|
|
195
|
+
return "0";
|
|
196
|
+
const o = Math.max(...r.value);
|
|
197
|
+
return o ? `${o}px` : "";
|
|
198
|
+
});
|
|
199
|
+
function t(o) {
|
|
200
|
+
const a = r.value.indexOf(o);
|
|
201
|
+
return a === -1 && e.value === "0" && K(xn, `unexpected width ${o}`), a;
|
|
202
|
+
}
|
|
203
|
+
function n(o, a) {
|
|
204
|
+
if (o && a) {
|
|
205
|
+
const s = t(a);
|
|
206
|
+
r.value.splice(s, 1, o);
|
|
207
|
+
} else
|
|
208
|
+
o && r.value.push(o);
|
|
209
|
+
}
|
|
210
|
+
function i(o) {
|
|
211
|
+
const a = t(o);
|
|
212
|
+
a > -1 && r.value.splice(a, 1);
|
|
213
|
+
}
|
|
214
|
+
return {
|
|
215
|
+
autoLabelWidth: e,
|
|
216
|
+
registerLabelWidth: n,
|
|
217
|
+
deregisterLabelWidth: i
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
const k = (r, e) => {
|
|
221
|
+
const t = we(e);
|
|
222
|
+
return t.length > 0 ? r.filter((n) => n.prop && t.includes(n.prop)) : r;
|
|
223
|
+
}, ne = "ElForm", An = H({
|
|
224
|
+
name: ne
|
|
225
|
+
}), qn = /* @__PURE__ */ H({
|
|
226
|
+
...An,
|
|
227
|
+
props: wn,
|
|
228
|
+
emits: Fn,
|
|
229
|
+
setup(r, { expose: e, emit: t }) {
|
|
230
|
+
const n = r, i = [], o = at(), a = Se("form"), s = E(() => {
|
|
231
|
+
const { labelPosition: f, inline: c } = n;
|
|
232
|
+
return [
|
|
233
|
+
a.b(),
|
|
234
|
+
a.m(o.value || "default"),
|
|
235
|
+
{
|
|
236
|
+
[a.m(`label-${f}`)]: f,
|
|
237
|
+
[a.m("inline")]: c
|
|
238
|
+
}
|
|
239
|
+
];
|
|
240
|
+
}), u = (f) => i.find((c) => c.prop === f), b = (f) => {
|
|
241
|
+
i.push(f);
|
|
242
|
+
}, g = (f) => {
|
|
243
|
+
f.prop && i.splice(i.indexOf(f), 1);
|
|
244
|
+
}, m = (f = []) => {
|
|
245
|
+
if (!n.model) {
|
|
246
|
+
K(ne, "model is required for resetFields to work.");
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
k(i, f).forEach((c) => c.resetField());
|
|
250
|
+
}, h = (f = []) => {
|
|
251
|
+
k(i, f).forEach((c) => c.clearValidate());
|
|
252
|
+
}, A = E(() => {
|
|
253
|
+
const f = !!n.model;
|
|
254
|
+
return f || K(ne, "model is required for validate to work."), f;
|
|
255
|
+
}), j = (f) => {
|
|
256
|
+
if (i.length === 0)
|
|
257
|
+
return [];
|
|
258
|
+
const c = k(i, f);
|
|
259
|
+
return c.length ? c : (K(ne, "please pass correct props!"), []);
|
|
260
|
+
}, d = async (f) => l(void 0, f), v = async (f = []) => {
|
|
261
|
+
if (!A.value)
|
|
262
|
+
return !1;
|
|
263
|
+
const c = j(f);
|
|
264
|
+
if (c.length === 0)
|
|
265
|
+
return !0;
|
|
266
|
+
let x = {};
|
|
267
|
+
for (const w of c)
|
|
268
|
+
try {
|
|
269
|
+
await w.validate(""), w.validateState === "error" && w.resetField();
|
|
270
|
+
} catch (_) {
|
|
271
|
+
x = {
|
|
272
|
+
...x,
|
|
273
|
+
..._
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
return Object.keys(x).length === 0 ? !0 : Promise.reject(x);
|
|
277
|
+
}, l = async (f = [], c) => {
|
|
278
|
+
const x = !ut(c);
|
|
279
|
+
try {
|
|
280
|
+
const w = await v(f);
|
|
281
|
+
return w === !0 && await (c == null ? void 0 : c(w)), w;
|
|
282
|
+
} catch (w) {
|
|
283
|
+
if (w instanceof Error)
|
|
284
|
+
throw w;
|
|
285
|
+
const _ = w;
|
|
286
|
+
return n.scrollToError && $(Object.keys(_)[0]), await (c == null ? void 0 : c(!1, _)), x && Promise.reject(_);
|
|
287
|
+
}
|
|
288
|
+
}, $ = (f) => {
|
|
289
|
+
var c;
|
|
290
|
+
const x = k(i, f)[0];
|
|
291
|
+
x && ((c = x.$el) == null || c.scrollIntoView(n.scrollIntoViewOptions));
|
|
292
|
+
};
|
|
293
|
+
return ae(() => n.rules, () => {
|
|
294
|
+
n.validateOnRuleChange && d().catch((f) => K(f));
|
|
295
|
+
}, { deep: !0, flush: "post" }), Qe(je, Xe({
|
|
296
|
+
...ke(n),
|
|
297
|
+
emit: t,
|
|
298
|
+
resetFields: m,
|
|
299
|
+
clearValidate: h,
|
|
300
|
+
validateField: l,
|
|
301
|
+
getField: u,
|
|
302
|
+
addField: b,
|
|
303
|
+
removeField: g,
|
|
304
|
+
...On()
|
|
305
|
+
})), e({
|
|
306
|
+
validate: d,
|
|
307
|
+
validateField: l,
|
|
308
|
+
resetFields: m,
|
|
309
|
+
clearValidate: h,
|
|
310
|
+
scrollToField: $,
|
|
311
|
+
fields: i
|
|
312
|
+
}), (f, c) => (ve(), et("form", {
|
|
313
|
+
class: z(q(s))
|
|
314
|
+
}, [
|
|
315
|
+
te(f.$slots, "default")
|
|
316
|
+
], 2));
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
var jn = /* @__PURE__ */ lt(qn, [["__file", "form.vue"]]);
|
|
320
|
+
function W() {
|
|
321
|
+
return W = 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
|
+
}, W.apply(this, arguments);
|
|
329
|
+
}
|
|
330
|
+
function En(r, e) {
|
|
331
|
+
r.prototype = Object.create(e.prototype), r.prototype.constructor = r, Z(r, e);
|
|
332
|
+
}
|
|
333
|
+
function Fe(r) {
|
|
334
|
+
return Fe = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
335
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
336
|
+
}, Fe(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 Sn() {
|
|
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 ie(r, e, t) {
|
|
356
|
+
return Sn() ? ie = Reflect.construct.bind() : ie = function(i, o, a) {
|
|
357
|
+
var s = [null];
|
|
358
|
+
s.push.apply(s, o);
|
|
359
|
+
var u = Function.bind.apply(i, s), b = new u();
|
|
360
|
+
return a && Z(b, a.prototype), b;
|
|
361
|
+
}, ie.apply(null, arguments);
|
|
362
|
+
}
|
|
363
|
+
function Tn(r) {
|
|
364
|
+
return Function.toString.call(r).indexOf("[native code]") !== -1;
|
|
365
|
+
}
|
|
366
|
+
function xe(r) {
|
|
367
|
+
var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
368
|
+
return xe = function(n) {
|
|
369
|
+
if (n === null || !Tn(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 ie(n, arguments, Fe(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
|
+
}, xe(r);
|
|
390
|
+
}
|
|
391
|
+
var _n = /%[sdj%]/g, bt = function() {
|
|
392
|
+
};
|
|
393
|
+
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (bt = 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 Oe(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 M(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, o = t.length;
|
|
411
|
+
if (typeof r == "function")
|
|
412
|
+
return r.apply(null, t);
|
|
413
|
+
if (typeof r == "string") {
|
|
414
|
+
var a = r.replace(_n, function(s) {
|
|
415
|
+
if (s === "%%")
|
|
416
|
+
return "%";
|
|
417
|
+
if (i >= o)
|
|
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 a;
|
|
436
|
+
}
|
|
437
|
+
return r;
|
|
438
|
+
}
|
|
439
|
+
function Pn(r) {
|
|
440
|
+
return r === "string" || r === "url" || r === "hex" || r === "email" || r === "date" || r === "pattern";
|
|
441
|
+
}
|
|
442
|
+
function S(r, e) {
|
|
443
|
+
return !!(r == null || e === "array" && Array.isArray(r) && !r.length || Pn(e) && typeof r == "string" && !r);
|
|
444
|
+
}
|
|
445
|
+
function $n(r, e, t) {
|
|
446
|
+
var n = [], i = 0, o = r.length;
|
|
447
|
+
function a(s) {
|
|
448
|
+
n.push.apply(n, s || []), i++, i === o && t(n);
|
|
449
|
+
}
|
|
450
|
+
r.forEach(function(s) {
|
|
451
|
+
e(s, a);
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
function ze(r, e, t) {
|
|
455
|
+
var n = 0, i = r.length;
|
|
456
|
+
function o(a) {
|
|
457
|
+
if (a && a.length) {
|
|
458
|
+
t(a);
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
var s = n;
|
|
462
|
+
n = n + 1, s < i ? e(r[s], o) : t([]);
|
|
463
|
+
}
|
|
464
|
+
o([]);
|
|
465
|
+
}
|
|
466
|
+
function In(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
|
+
En(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__ */ xe(Error));
|
|
480
|
+
function Nn(r, e, t, n, i) {
|
|
481
|
+
if (e.first) {
|
|
482
|
+
var o = new Promise(function(h, A) {
|
|
483
|
+
var j = function(l) {
|
|
484
|
+
return n(l), l.length ? A(new Ke(l, Oe(l))) : h(i);
|
|
485
|
+
}, d = In(r);
|
|
486
|
+
ze(d, t, j);
|
|
487
|
+
});
|
|
488
|
+
return o.catch(function(h) {
|
|
489
|
+
return h;
|
|
490
|
+
}), o;
|
|
491
|
+
}
|
|
492
|
+
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) {
|
|
493
|
+
var j = function(v) {
|
|
494
|
+
if (g.push.apply(g, v), b++, b === u)
|
|
495
|
+
return n(g), g.length ? A(new Ke(g, Oe(g))) : h(i);
|
|
496
|
+
};
|
|
497
|
+
s.length || (n(g), h(i)), s.forEach(function(d) {
|
|
498
|
+
var v = r[d];
|
|
499
|
+
a.indexOf(d) !== -1 ? ze(v, t, j) : $n(v, t, j);
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
return m.catch(function(h) {
|
|
503
|
+
return h;
|
|
504
|
+
}), m;
|
|
505
|
+
}
|
|
506
|
+
function Mn(r) {
|
|
507
|
+
return !!(r && r.message !== void 0);
|
|
508
|
+
}
|
|
509
|
+
function Rn(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 = Rn(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] = W({}, r[t], n) : r[t] = n;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
return r;
|
|
536
|
+
}
|
|
537
|
+
var wt = function(e, t, n, i, o, a) {
|
|
538
|
+
e.required && (!n.hasOwnProperty(e.field) || S(t, a || e.type)) && i.push(M(o.messages.required, e.fullField));
|
|
539
|
+
}, Ln = function(e, t, n, i, o) {
|
|
540
|
+
(/^\s+$/.test(t) || t === "") && i.push(M(o.messages.whitespace, e.fullField));
|
|
541
|
+
}, ee, Vn = function() {
|
|
542
|
+
if (ee)
|
|
543
|
+
return ee;
|
|
544
|
+
var r = "[a-fA-F\\d:]", e = function(c) {
|
|
545
|
+
return c && c.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(), o = new RegExp("(?:^" + t + "$)|(?:^" + i + "$)"), a = new RegExp("^" + t + "$"), s = new RegExp("^" + i + "$"), u = function(c) {
|
|
558
|
+
return c && c.exact ? o : new RegExp("(?:" + e(c) + t + e(c) + ")|(?:" + e(c) + i + e(c) + ")", "g");
|
|
559
|
+
};
|
|
560
|
+
u.v4 = function(f) {
|
|
561
|
+
return f && f.exact ? a : new RegExp("" + e(f) + t + e(f), "g");
|
|
562
|
+
}, u.v6 = function(f) {
|
|
563
|
+
return f && f.exact ? s : new RegExp("" + e(f) + i + e(f), "g");
|
|
564
|
+
};
|
|
565
|
+
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;
|
|
566
|
+
return ee = new RegExp("(?:^" + $ + "$)", "i"), ee;
|
|
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(Vn());
|
|
611
|
+
},
|
|
612
|
+
hex: function(e) {
|
|
613
|
+
return typeof e == "string" && !!e.match(Ze.hex);
|
|
614
|
+
}
|
|
615
|
+
}, Bn = function(e, t, n, i, o) {
|
|
616
|
+
if (e.required && t === void 0) {
|
|
617
|
+
wt(e, t, n, i, o);
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
var a = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], s = e.type;
|
|
621
|
+
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));
|
|
622
|
+
}, Wn = function(e, t, n, i, o) {
|
|
623
|
+
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);
|
|
624
|
+
if (h ? m = "number" : A ? m = "string" : j && (m = "array"), !m)
|
|
625
|
+
return !1;
|
|
626
|
+
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));
|
|
627
|
+
}, G = "enum", Cn = function(e, t, n, i, o) {
|
|
628
|
+
e[G] = Array.isArray(e[G]) ? e[G] : [], e[G].indexOf(t) === -1 && i.push(M(o.messages[G], e.fullField, e[G].join(", ")));
|
|
629
|
+
}, Dn = function(e, t, n, i, o) {
|
|
630
|
+
if (e.pattern) {
|
|
631
|
+
if (e.pattern instanceof RegExp)
|
|
632
|
+
e.pattern.lastIndex = 0, e.pattern.test(t) || i.push(M(o.messages.pattern.mismatch, e.fullField, t, e.pattern));
|
|
633
|
+
else if (typeof e.pattern == "string") {
|
|
634
|
+
var a = new RegExp(e.pattern);
|
|
635
|
+
a.test(t) || i.push(M(o.messages.pattern.mismatch, e.fullField, t, e.pattern));
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}, y = {
|
|
639
|
+
required: wt,
|
|
640
|
+
whitespace: Ln,
|
|
641
|
+
type: Bn,
|
|
642
|
+
range: Wn,
|
|
643
|
+
enum: Cn,
|
|
644
|
+
pattern: Dn
|
|
645
|
+
}, Un = function(e, t, n, i, o) {
|
|
646
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
647
|
+
if (s) {
|
|
648
|
+
if (S(t, "string") && !e.required)
|
|
649
|
+
return n();
|
|
650
|
+
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));
|
|
651
|
+
}
|
|
652
|
+
n(a);
|
|
653
|
+
}, Gn = function(e, t, n, i, o) {
|
|
654
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
655
|
+
if (s) {
|
|
656
|
+
if (S(t) && !e.required)
|
|
657
|
+
return n();
|
|
658
|
+
y.required(e, t, i, a, o), t !== void 0 && y.type(e, t, i, a, o);
|
|
659
|
+
}
|
|
660
|
+
n(a);
|
|
661
|
+
}, zn = function(e, t, n, i, o) {
|
|
662
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
663
|
+
if (s) {
|
|
664
|
+
if (t === "" && (t = void 0), S(t) && !e.required)
|
|
665
|
+
return n();
|
|
666
|
+
y.required(e, t, i, a, o), t !== void 0 && (y.type(e, t, i, a, o), y.range(e, t, i, a, o));
|
|
667
|
+
}
|
|
668
|
+
n(a);
|
|
669
|
+
}, Kn = function(e, t, n, i, o) {
|
|
670
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
671
|
+
if (s) {
|
|
672
|
+
if (S(t) && !e.required)
|
|
673
|
+
return n();
|
|
674
|
+
y.required(e, t, i, a, o), t !== void 0 && y.type(e, t, i, a, o);
|
|
675
|
+
}
|
|
676
|
+
n(a);
|
|
677
|
+
}, Yn = function(e, t, n, i, o) {
|
|
678
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
679
|
+
if (s) {
|
|
680
|
+
if (S(t) && !e.required)
|
|
681
|
+
return n();
|
|
682
|
+
y.required(e, t, i, a, o), S(t) || y.type(e, t, i, a, o);
|
|
683
|
+
}
|
|
684
|
+
n(a);
|
|
685
|
+
}, Jn = function(e, t, n, i, o) {
|
|
686
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
687
|
+
if (s) {
|
|
688
|
+
if (S(t) && !e.required)
|
|
689
|
+
return n();
|
|
690
|
+
y.required(e, t, i, a, o), t !== void 0 && (y.type(e, t, i, a, o), y.range(e, t, i, a, o));
|
|
691
|
+
}
|
|
692
|
+
n(a);
|
|
693
|
+
}, Zn = function(e, t, n, i, o) {
|
|
694
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
695
|
+
if (s) {
|
|
696
|
+
if (S(t) && !e.required)
|
|
697
|
+
return n();
|
|
698
|
+
y.required(e, t, i, a, o), t !== void 0 && (y.type(e, t, i, a, o), y.range(e, t, i, a, o));
|
|
699
|
+
}
|
|
700
|
+
n(a);
|
|
701
|
+
}, Hn = function(e, t, n, i, o) {
|
|
702
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
703
|
+
if (s) {
|
|
704
|
+
if (t == null && !e.required)
|
|
705
|
+
return n();
|
|
706
|
+
y.required(e, t, i, a, o, "array"), t != null && (y.type(e, t, i, a, o), y.range(e, t, i, a, o));
|
|
707
|
+
}
|
|
708
|
+
n(a);
|
|
709
|
+
}, Qn = function(e, t, n, i, o) {
|
|
710
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
711
|
+
if (s) {
|
|
712
|
+
if (S(t) && !e.required)
|
|
713
|
+
return n();
|
|
714
|
+
y.required(e, t, i, a, o), t !== void 0 && y.type(e, t, i, a, o);
|
|
715
|
+
}
|
|
716
|
+
n(a);
|
|
717
|
+
}, Xn = "enum", kn = function(e, t, n, i, o) {
|
|
718
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
719
|
+
if (s) {
|
|
720
|
+
if (S(t) && !e.required)
|
|
721
|
+
return n();
|
|
722
|
+
y.required(e, t, i, a, o), t !== void 0 && y[Xn](e, t, i, a, o);
|
|
723
|
+
}
|
|
724
|
+
n(a);
|
|
725
|
+
}, ei = function(e, t, n, i, o) {
|
|
726
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
727
|
+
if (s) {
|
|
728
|
+
if (S(t, "string") && !e.required)
|
|
729
|
+
return n();
|
|
730
|
+
y.required(e, t, i, a, o), S(t, "string") || y.pattern(e, t, i, a, o);
|
|
731
|
+
}
|
|
732
|
+
n(a);
|
|
733
|
+
}, ti = function(e, t, n, i, o) {
|
|
734
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
735
|
+
if (s) {
|
|
736
|
+
if (S(t, "date") && !e.required)
|
|
737
|
+
return n();
|
|
738
|
+
if (y.required(e, t, i, a, o), !S(t, "date")) {
|
|
739
|
+
var u;
|
|
740
|
+
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);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
n(a);
|
|
744
|
+
}, ri = function(e, t, n, i, o) {
|
|
745
|
+
var a = [], s = Array.isArray(t) ? "array" : typeof t;
|
|
746
|
+
y.required(e, t, i, a, o, s), n(a);
|
|
747
|
+
}, me = function(e, t, n, i, o) {
|
|
748
|
+
var a = e.type, s = [], u = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
749
|
+
if (u) {
|
|
750
|
+
if (S(t, a) && !e.required)
|
|
751
|
+
return n();
|
|
752
|
+
y.required(e, t, i, s, o, a), S(t, a) || y.type(e, t, i, s, o);
|
|
753
|
+
}
|
|
754
|
+
n(s);
|
|
755
|
+
}, ni = function(e, t, n, i, o) {
|
|
756
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
757
|
+
if (s) {
|
|
758
|
+
if (S(t) && !e.required)
|
|
759
|
+
return n();
|
|
760
|
+
y.required(e, t, i, a, o);
|
|
761
|
+
}
|
|
762
|
+
n(a);
|
|
763
|
+
}, J = {
|
|
764
|
+
string: Un,
|
|
765
|
+
method: Gn,
|
|
766
|
+
number: zn,
|
|
767
|
+
boolean: Kn,
|
|
768
|
+
regexp: Yn,
|
|
769
|
+
integer: Jn,
|
|
770
|
+
float: Zn,
|
|
771
|
+
array: Hn,
|
|
772
|
+
object: Qn,
|
|
773
|
+
enum: kn,
|
|
774
|
+
pattern: ei,
|
|
775
|
+
date: ti,
|
|
776
|
+
url: me,
|
|
777
|
+
hex: me,
|
|
778
|
+
email: me,
|
|
779
|
+
required: ri,
|
|
780
|
+
any: ni
|
|
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 qe = Ae(), Q = /* @__PURE__ */ function() {
|
|
836
|
+
function r(t) {
|
|
837
|
+
this.rules = null, this._messages = qe, 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(o) {
|
|
847
|
+
var a = n[o];
|
|
848
|
+
i.rules[o] = Array.isArray(a) ? a : [a];
|
|
849
|
+
});
|
|
850
|
+
}, e.messages = function(n) {
|
|
851
|
+
return n && (this._messages = Je(Ae(), n)), this._messages;
|
|
852
|
+
}, e.validate = function(n, i, o) {
|
|
853
|
+
var a = this;
|
|
854
|
+
i === void 0 && (i = {}), o === void 0 && (o = function() {
|
|
855
|
+
});
|
|
856
|
+
var s = n, u = i, b = o;
|
|
857
|
+
if (typeof u == "function" && (b = u, u = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
858
|
+
return b && b(null, s), Promise.resolve(s);
|
|
859
|
+
function g(d) {
|
|
860
|
+
var v = [], l = {};
|
|
861
|
+
function $(c) {
|
|
862
|
+
if (Array.isArray(c)) {
|
|
863
|
+
var x;
|
|
864
|
+
v = (x = v).concat.apply(x, c);
|
|
865
|
+
} else
|
|
866
|
+
v.push(c);
|
|
867
|
+
}
|
|
868
|
+
for (var f = 0; f < d.length; f++)
|
|
869
|
+
$(d[f]);
|
|
870
|
+
v.length ? (l = Oe(v), b(v, l)) : b(null, s);
|
|
871
|
+
}
|
|
872
|
+
if (u.messages) {
|
|
873
|
+
var m = this.messages();
|
|
874
|
+
m === qe && (m = Ae()), Je(m, u.messages), u.messages = m;
|
|
875
|
+
} else
|
|
876
|
+
u.messages = this.messages();
|
|
877
|
+
var h = {}, A = u.keys || Object.keys(this.rules);
|
|
878
|
+
A.forEach(function(d) {
|
|
879
|
+
var v = a.rules[d], l = s[d];
|
|
880
|
+
v.forEach(function($) {
|
|
881
|
+
var f = $;
|
|
882
|
+
typeof f.transform == "function" && (s === n && (s = W({}, s)), l = s[d] = f.transform(l)), typeof f == "function" ? f = {
|
|
883
|
+
validator: f
|
|
884
|
+
} : 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({
|
|
885
|
+
rule: f,
|
|
886
|
+
value: l,
|
|
887
|
+
source: s,
|
|
888
|
+
field: d
|
|
889
|
+
}));
|
|
890
|
+
});
|
|
891
|
+
});
|
|
892
|
+
var j = {};
|
|
893
|
+
return Nn(h, u, function(d, v) {
|
|
894
|
+
var l = d.rule, $ = (l.type === "object" || l.type === "array") && (typeof l.fields == "object" || typeof l.defaultField == "object");
|
|
895
|
+
$ = $ && (l.required || !l.required && d.value), l.field = d.field;
|
|
896
|
+
function f(w, _) {
|
|
897
|
+
return W({}, _, {
|
|
898
|
+
fullField: l.fullField + "." + w,
|
|
899
|
+
fullFields: l.fullFields ? [].concat(l.fullFields, [w]) : [w]
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
function c(w) {
|
|
903
|
+
w === void 0 && (w = []);
|
|
904
|
+
var _ = Array.isArray(w) ? w : [w];
|
|
905
|
+
!u.suppressWarning && _.length && r.warning("async-validator:", _), _.length && l.message !== void 0 && (_ = [].concat(l.message));
|
|
906
|
+
var I = _.map(Ye(l, s));
|
|
907
|
+
if (u.first && I.length)
|
|
908
|
+
return j[l.field] = 1, v(I);
|
|
909
|
+
if (!$)
|
|
910
|
+
v(I);
|
|
911
|
+
else {
|
|
912
|
+
if (l.required && !d.value)
|
|
913
|
+
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);
|
|
914
|
+
var V = {};
|
|
915
|
+
l.defaultField && Object.keys(d.value).map(function(N) {
|
|
916
|
+
V[N] = l.defaultField;
|
|
917
|
+
}), V = W({}, V, d.rule.fields);
|
|
918
|
+
var X = {};
|
|
919
|
+
Object.keys(V).forEach(function(N) {
|
|
920
|
+
var R = V[N], ue = Array.isArray(R) ? R : [R];
|
|
921
|
+
X[N] = ue.map(f.bind(null, N));
|
|
922
|
+
});
|
|
923
|
+
var C = new r(X);
|
|
924
|
+
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) {
|
|
925
|
+
var R = [];
|
|
926
|
+
I && I.length && R.push.apply(R, I), N && N.length && R.push.apply(R, N), v(R.length ? R : null);
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
var x;
|
|
931
|
+
if (l.asyncValidator)
|
|
932
|
+
x = l.asyncValidator(l, d.value, c, d.source, u);
|
|
933
|
+
else if (l.validator) {
|
|
934
|
+
try {
|
|
935
|
+
x = l.validator(l, d.value, c, d.source, u);
|
|
936
|
+
} catch (w) {
|
|
937
|
+
console.error == null || console.error(w), u.suppressValidatorError || setTimeout(function() {
|
|
938
|
+
throw w;
|
|
939
|
+
}, 0), c(w.message);
|
|
940
|
+
}
|
|
941
|
+
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);
|
|
942
|
+
}
|
|
943
|
+
x && x.then && x.then(function() {
|
|
944
|
+
return c();
|
|
945
|
+
}, function(w) {
|
|
946
|
+
return c(w);
|
|
947
|
+
});
|
|
948
|
+
}, function(d) {
|
|
949
|
+
g(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(M("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), o = i.indexOf("message");
|
|
959
|
+
return o !== -1 && i.splice(o, 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 = bt;
|
|
968
|
+
Q.messages = qe;
|
|
969
|
+
Q.validators = J;
|
|
970
|
+
const ii = [
|
|
971
|
+
"",
|
|
972
|
+
"error",
|
|
973
|
+
"validating",
|
|
974
|
+
"success"
|
|
975
|
+
], ai = 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: he([String, Array])
|
|
988
|
+
},
|
|
989
|
+
required: {
|
|
990
|
+
type: Boolean,
|
|
991
|
+
default: void 0
|
|
992
|
+
},
|
|
993
|
+
rules: {
|
|
994
|
+
type: he([Object, Array])
|
|
995
|
+
},
|
|
996
|
+
error: String,
|
|
997
|
+
validateStatus: {
|
|
998
|
+
type: String,
|
|
999
|
+
values: ii
|
|
1000
|
+
},
|
|
1001
|
+
for: String,
|
|
1002
|
+
inlineMessage: {
|
|
1003
|
+
type: [String, Boolean],
|
|
1004
|
+
default: ""
|
|
1005
|
+
},
|
|
1006
|
+
showMessage: {
|
|
1007
|
+
type: Boolean,
|
|
1008
|
+
default: !0
|
|
1009
|
+
},
|
|
1010
|
+
size: {
|
|
1011
|
+
type: String,
|
|
1012
|
+
values: it
|
|
1013
|
+
}
|
|
1014
|
+
}), He = "ElLabelWrap";
|
|
1015
|
+
var oi = H({
|
|
1016
|
+
name: He,
|
|
1017
|
+
props: {
|
|
1018
|
+
isAutoWidth: Boolean,
|
|
1019
|
+
updateAll: Boolean
|
|
1020
|
+
},
|
|
1021
|
+
setup(r, {
|
|
1022
|
+
slots: e
|
|
1023
|
+
}) {
|
|
1024
|
+
const t = oe(je, void 0), n = oe(ye);
|
|
1025
|
+
n || Bt(He, "usage: <el-form-item><label-wrap /></el-form-item>");
|
|
1026
|
+
const i = Se("form"), o = B(), a = B(0), s = () => {
|
|
1027
|
+
var g;
|
|
1028
|
+
if ((g = o.value) != null && g.firstElementChild) {
|
|
1029
|
+
const m = window.getComputedStyle(o.value.firstElementChild).width;
|
|
1030
|
+
return Math.ceil(Number.parseFloat(m));
|
|
1031
|
+
} else
|
|
1032
|
+
return 0;
|
|
1033
|
+
}, u = (g = "update") => {
|
|
1034
|
+
nt(() => {
|
|
1035
|
+
e.default && r.isAutoWidth && (g === "update" ? a.value = s() : g === "remove" && (t == null || t.deregisterLabelWidth(a.value)));
|
|
1036
|
+
});
|
|
1037
|
+
}, b = () => u("update");
|
|
1038
|
+
return tt(() => {
|
|
1039
|
+
b();
|
|
1040
|
+
}), rt(() => {
|
|
1041
|
+
u("remove");
|
|
1042
|
+
}), Tt(() => b()), ae(a, (g, m) => {
|
|
1043
|
+
r.updateAll && (t == null || t.registerLabelWidth(g, m));
|
|
1044
|
+
}), Gt(E(() => {
|
|
1045
|
+
var g, m;
|
|
1046
|
+
return (m = (g = o.value) == null ? void 0 : g.firstElementChild) != null ? m : null;
|
|
1047
|
+
}), b), () => {
|
|
1048
|
+
var g, m;
|
|
1049
|
+
if (!e)
|
|
1050
|
+
return null;
|
|
1051
|
+
const {
|
|
1052
|
+
isAutoWidth: h
|
|
1053
|
+
} = r;
|
|
1054
|
+
if (h) {
|
|
1055
|
+
const A = t == null ? void 0 : t.autoLabelWidth, j = n == null ? void 0 : n.hasLabel, d = {};
|
|
1056
|
+
if (j && A && A !== "auto") {
|
|
1057
|
+
const v = Math.max(0, Number.parseInt(A, 10) - a.value), $ = (n.labelPosition || t.labelPosition) === "left" ? "marginRight" : "marginLeft";
|
|
1058
|
+
v && (d[$] = `${v}px`);
|
|
1059
|
+
}
|
|
1060
|
+
return se("div", {
|
|
1061
|
+
ref: o,
|
|
1062
|
+
class: [i.be("item", "label-wrap")],
|
|
1063
|
+
style: d
|
|
1064
|
+
}, [(g = e.default) == null ? void 0 : g.call(e)]);
|
|
1065
|
+
} else
|
|
1066
|
+
return se(_t, {
|
|
1067
|
+
ref: o
|
|
1068
|
+
}, [(m = e.default) == null ? void 0 : m.call(e)]);
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
const si = H({
|
|
1073
|
+
name: "ElFormItem"
|
|
1074
|
+
}), fi = /* @__PURE__ */ H({
|
|
1075
|
+
...si,
|
|
1076
|
+
props: ai,
|
|
1077
|
+
setup(r, { expose: e }) {
|
|
1078
|
+
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 = Wt().value, b = B([]), g = B(""), m = Ct(g, 100), h = B(""), A = B();
|
|
1079
|
+
let j, d = !1;
|
|
1080
|
+
const v = E(() => t.labelPosition || (i == null ? void 0 : i.labelPosition)), l = E(() => {
|
|
1081
|
+
if (v.value === "top")
|
|
1082
|
+
return {};
|
|
1083
|
+
const p = Be(t.labelWidth || (i == null ? void 0 : i.labelWidth) || "");
|
|
1084
|
+
return p ? { width: p } : {};
|
|
1085
|
+
}), $ = E(() => {
|
|
1086
|
+
if (v.value === "top" || i != null && i.inline)
|
|
1087
|
+
return {};
|
|
1088
|
+
if (!t.label && !t.labelWidth && X)
|
|
1089
|
+
return {};
|
|
1090
|
+
const p = Be(t.labelWidth || (i == null ? void 0 : i.labelWidth) || "");
|
|
1091
|
+
return !t.label && !n.label ? { marginLeft: p } : {};
|
|
1092
|
+
}), f = E(() => [
|
|
1093
|
+
s.b(),
|
|
1094
|
+
s.m(a.value),
|
|
1095
|
+
s.is("error", g.value === "error"),
|
|
1096
|
+
s.is("validating", g.value === "validating"),
|
|
1097
|
+
s.is("success", g.value === "success"),
|
|
1098
|
+
s.is("required", xt.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-${v.value}`)]: v.value
|
|
1104
|
+
}
|
|
1105
|
+
]), c = E(() => ft(t.inlineMessage) ? t.inlineMessage : (i == null ? void 0 : i.inlineMessage) || !1), x = E(() => [
|
|
1106
|
+
s.e("error"),
|
|
1107
|
+
{ [s.em("error", "inline")]: c.value }
|
|
1108
|
+
]), 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(() => {
|
|
1109
|
+
const p = i == null ? void 0 : i.model;
|
|
1110
|
+
if (!(!p || !t.prop))
|
|
1111
|
+
return ge(p, t.prop).value;
|
|
1112
|
+
}), N = E(() => {
|
|
1113
|
+
const { required: p } = t, F = [];
|
|
1114
|
+
t.rules && F.push(...we(t.rules));
|
|
1115
|
+
const P = i == null ? void 0 : i.rules;
|
|
1116
|
+
if (P && t.prop) {
|
|
1117
|
+
const T = ge(P, t.prop).value;
|
|
1118
|
+
T && F.push(...we(T));
|
|
1119
|
+
}
|
|
1120
|
+
if (p !== void 0) {
|
|
1121
|
+
const T = F.map((L, U) => [L, U]).filter(([L]) => Object.keys(L).includes("required"));
|
|
1122
|
+
if (T.length > 0)
|
|
1123
|
+
for (const [L, U] of T)
|
|
1124
|
+
L.required !== p && (F[U] = { ...L, required: p });
|
|
1125
|
+
else
|
|
1126
|
+
F.push({ required: p });
|
|
1127
|
+
}
|
|
1128
|
+
return F;
|
|
1129
|
+
}), R = E(() => N.value.length > 0), ue = (p) => N.value.filter((P) => !P.trigger || !p ? !0 : st(P.trigger) ? P.trigger.includes(p) : P.trigger === p).map(({ trigger: P, ...T }) => T), xt = E(() => N.value.some((p) => p.required)), Ot = E(() => {
|
|
1130
|
+
var p;
|
|
1131
|
+
return m.value === "error" && t.showMessage && ((p = i == null ? void 0 : i.showMessage) != null ? p : !0);
|
|
1132
|
+
}), Pe = E(() => `${t.label || ""}${(i == null ? void 0 : i.labelSuffix) || ""}`), D = (p) => {
|
|
1133
|
+
g.value = p;
|
|
1134
|
+
}, At = (p) => {
|
|
1135
|
+
var F, P;
|
|
1136
|
+
const { errors: T, fields: L } = p;
|
|
1137
|
+
(!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);
|
|
1138
|
+
}, qt = () => {
|
|
1139
|
+
D("success"), i == null || i.emit("validate", t.prop, !0, "");
|
|
1140
|
+
}, jt = async (p) => {
|
|
1141
|
+
const F = w.value;
|
|
1142
|
+
return new Q({
|
|
1143
|
+
[F]: p
|
|
1144
|
+
}).validate({ [F]: C.value }, { firstFields: !0 }).then(() => (qt(), !0)).catch((T) => (At(T), Promise.reject(T)));
|
|
1145
|
+
}, $e = async (p, F) => {
|
|
1146
|
+
if (d || !t.prop)
|
|
1147
|
+
return !1;
|
|
1148
|
+
const P = ut(F);
|
|
1149
|
+
if (!R.value)
|
|
1150
|
+
return F == null || F(!1), !1;
|
|
1151
|
+
const T = ue(p);
|
|
1152
|
+
return T.length === 0 ? (F == null || F(!0), !0) : (D("validating"), jt(T).then(() => (F == null || F(!0), !0)).catch((L) => {
|
|
1153
|
+
const { fields: U } = L;
|
|
1154
|
+
return F == null || F(!1, U), P ? !1 : Promise.reject(U);
|
|
1155
|
+
}));
|
|
1156
|
+
}, de = () => {
|
|
1157
|
+
D(""), h.value = "", d = !1;
|
|
1158
|
+
}, Ie = async () => {
|
|
1159
|
+
const p = i == null ? void 0 : i.model;
|
|
1160
|
+
if (!p || !t.prop)
|
|
1161
|
+
return;
|
|
1162
|
+
const F = ge(p, t.prop);
|
|
1163
|
+
d = !0, F.value = Ge(j), await nt(), de(), d = !1;
|
|
1164
|
+
}, Et = (p) => {
|
|
1165
|
+
b.value.includes(p) || b.value.push(p);
|
|
1166
|
+
}, St = (p) => {
|
|
1167
|
+
b.value = b.value.filter((F) => F !== p);
|
|
1168
|
+
};
|
|
1169
|
+
ae(() => t.error, (p) => {
|
|
1170
|
+
h.value = p || "", D(p ? "error" : "");
|
|
1171
|
+
}, { immediate: !0 }), ae(() => t.validateStatus, (p) => D(p || ""));
|
|
1172
|
+
const ce = Xe({
|
|
1173
|
+
...ke(t),
|
|
1174
|
+
$el: A,
|
|
1175
|
+
size: a,
|
|
1176
|
+
validateState: g,
|
|
1177
|
+
labelId: u,
|
|
1178
|
+
inputIds: b,
|
|
1179
|
+
isGroup: V,
|
|
1180
|
+
hasLabel: _,
|
|
1181
|
+
fieldValue: C,
|
|
1182
|
+
addInputId: Et,
|
|
1183
|
+
removeInputId: St,
|
|
1184
|
+
resetField: Ie,
|
|
1185
|
+
clearValidate: de,
|
|
1186
|
+
validate: $e
|
|
1187
|
+
});
|
|
1188
|
+
return Qe(ye, ce), tt(() => {
|
|
1189
|
+
t.prop && (i == null || i.addField(ce), j = Ge(C.value));
|
|
1190
|
+
}), rt(() => {
|
|
1191
|
+
i == null || i.removeField(ce);
|
|
1192
|
+
}), e({
|
|
1193
|
+
size: a,
|
|
1194
|
+
validateMessage: h,
|
|
1195
|
+
validateState: g,
|
|
1196
|
+
validate: $e,
|
|
1197
|
+
clearValidate: de,
|
|
1198
|
+
resetField: Ie
|
|
1199
|
+
}), (p, F) => {
|
|
1200
|
+
var P;
|
|
1201
|
+
return ve(), et("div", {
|
|
1202
|
+
ref_key: "formItemRef",
|
|
1203
|
+
ref: A,
|
|
1204
|
+
class: z(q(f)),
|
|
1205
|
+
role: q(V) ? "group" : void 0,
|
|
1206
|
+
"aria-labelledby": q(V) ? q(u) : void 0
|
|
1207
|
+
}, [
|
|
1208
|
+
se(q(oi), {
|
|
1209
|
+
"is-auto-width": q(l).width === "auto",
|
|
1210
|
+
"update-all": ((P = q(i)) == null ? void 0 : P.labelWidth) === "auto"
|
|
1211
|
+
}, {
|
|
1212
|
+
default: pe(() => [
|
|
1213
|
+
q(_) ? (ve(), $t(It(q(I) ? "label" : "div"), {
|
|
1214
|
+
key: 0,
|
|
1215
|
+
id: q(u),
|
|
1216
|
+
for: q(I),
|
|
1217
|
+
class: z(q(s).e("label")),
|
|
1218
|
+
style: Ne(q(l))
|
|
1219
|
+
}, {
|
|
1220
|
+
default: pe(() => [
|
|
1221
|
+
te(p.$slots, "label", { label: q(Pe) }, () => [
|
|
1222
|
+
Nt(Me(q(Pe)), 1)
|
|
1223
|
+
])
|
|
1224
|
+
]),
|
|
1225
|
+
_: 3
|
|
1226
|
+
}, 8, ["id", "for", "class", "style"])) : Re("v-if", !0)
|
|
1227
|
+
]),
|
|
1228
|
+
_: 3
|
|
1229
|
+
}, 8, ["is-auto-width", "update-all"]),
|
|
1230
|
+
Le("div", {
|
|
1231
|
+
class: z(q(s).e("content")),
|
|
1232
|
+
style: Ne(q($))
|
|
1233
|
+
}, [
|
|
1234
|
+
te(p.$slots, "default"),
|
|
1235
|
+
se(Mt, {
|
|
1236
|
+
name: `${q(s).namespace.value}-zoom-in-top`
|
|
1237
|
+
}, {
|
|
1238
|
+
default: pe(() => [
|
|
1239
|
+
q(Ot) ? te(p.$slots, "error", {
|
|
1240
|
+
key: 0,
|
|
1241
|
+
error: h.value
|
|
1242
|
+
}, () => [
|
|
1243
|
+
Le("div", {
|
|
1244
|
+
class: z(q(x))
|
|
1245
|
+
}, Me(h.value), 3)
|
|
1246
|
+
]) : Re("v-if", !0)
|
|
1247
|
+
]),
|
|
1248
|
+
_: 3
|
|
1249
|
+
}, 8, ["name"])
|
|
1250
|
+
], 6)
|
|
1251
|
+
], 10, ["role", "aria-labelledby"]);
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
1255
|
+
var Ft = /* @__PURE__ */ lt(fi, [["__file", "form-item.vue"]]);
|
|
1256
|
+
const yi = Dt(jn, {
|
|
1257
|
+
FormItem: Ft
|
|
1258
|
+
}), hi = Ut(Ft);
|
|
1259
|
+
export {
|
|
1260
|
+
hi as E,
|
|
1261
|
+
yi as a
|
|
1262
|
+
};
|