st-comp 0.0.126 → 0.0.128
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/Dialog.cjs +1 -1
- package/es/Dialog.js +13 -14
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +74 -74
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +14 -14
- package/es/KlineBasic.cjs +1 -6
- package/es/KlineBasic.js +863 -2449
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +12 -12
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +17 -18
- package/es/Pie.cjs +1 -1
- package/es/Pie.js +1 -1
- package/es/Table.cjs +1 -1
- package/es/Table.js +17 -18
- package/es/User.cjs +1 -1
- package/es/User.js +74 -75
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +34 -34
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +12 -13
- package/es/{base-a8f938bd.js → base-3ecbc734.js} +2 -2
- package/es/{castArray-5c01dae1.js → castArray-7d3fc921.js} +1 -1
- package/es/config-provider-7cdfca4d.cjs +1 -0
- package/es/{config-provider-d3edea8a.js → config-provider-83904b4d.js} +3 -3
- package/es/{debounce-edbff018.js → debounce-7344b088.js} +1 -1
- package/es/{dropdown-7e381525.js → dropdown-7da44c8f.js} +4 -4
- package/es/el-button-196807af.cjs +1 -0
- package/es/{el-button-ce99c64e.js → el-button-24f79286.js} +5 -6
- package/es/{el-empty-ed6c115b.js → el-empty-79c5f7a8.js} +1 -1
- package/es/el-form-item-7d32befa.cjs +12 -0
- package/es/el-form-item-afc3dcf2.js +1324 -0
- package/es/{el-input-21e079e4.js → el-input-ee7db655.js} +5 -5
- package/es/el-input-number-0524d787.cjs +1 -0
- package/es/el-input-number-63c21037.js +282 -0
- package/es/{el-menu-item-9369a2ad.js → el-menu-item-0d92e7dc.js} +7 -7
- package/es/el-message-562e923d.cjs +1 -0
- package/es/{el-message-fd827012.js → el-message-71aa42ca.js} +16 -16
- package/es/{el-overlay-9245ec1e.js → el-overlay-6056c89a.js} +76 -77
- package/es/el-overlay-891dcc40.cjs +1 -0
- package/es/{el-popover-6f48d00b.cjs → el-popover-8735b1fa.cjs} +1 -1
- package/es/{el-popover-6f075cee.js → el-popover-c8b2456c.js} +4 -4
- package/es/{el-popper-8dca8dd4.js → el-popper-d3eef7ed.js} +4 -4
- package/es/{el-scrollbar-906103f8.js → el-scrollbar-66f3bb72.js} +1 -1
- package/es/{el-select-6d6093eb.js → el-select-5fb7d469.js} +10 -10
- package/es/{el-table-column-3f388c44.js → el-table-column-560db3aa.js} +14 -15
- package/es/el-table-column-dd8b62aa.cjs +14 -0
- package/es/{el-tag-cdf0019e.js → el-tag-6a31c968.js} +3 -3
- package/es/index-68ee64fa.js +81 -0
- package/es/{index-f8e448bc.js → index-8542fe24.js} +3924 -3873
- package/es/{use-global-config-ac2dad80.cjs → index-8a0b1c53.cjs} +3 -1
- package/es/{index-53bce290.js → index-a1ecf26c.js} +3 -3
- package/es/{index-d1b7c61e.cjs → index-a96158ae.cjs} +41 -36
- package/es/{index-6ced00c4.js → index-fa07a823.js} +1 -1
- package/es/{raf-b584bce8.js → raf-377cf8f5.js} +1 -1
- package/es/{refs-e1675167.js → refs-46cf8186.js} +1 -1
- package/es/{scroll-25ec9230.js → scroll-1efa8148.js} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-f7d2e83c.js → use-form-common-props-9c0363ac.js} +1 -1
- package/es/{vnode-699e61cb.js → vnode-cfcdab70.js} +1 -1
- package/es/{zh-cn-61ca7f91.js → zh-cn-4a476dc8.js} +2 -2
- package/es/{zh-cn-a20960b5.cjs → zh-cn-ab9a583d.cjs} +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +202 -202
- package/lib/{index-0207fed8.js → index-c2cabc8b.js} +32548 -34091
- package/lib/{python-cac37206.js → python-d3e3fec3.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineBasic/api.js +39 -41
- package/packages/KlineBasic/index.vue +207 -159
- package/packages/KlineBasic/utils.js +173 -72
- package/src/pages/KlineBasic/index.vue +1 -0
- package/es/config-provider-4954003d.cjs +0 -1
- package/es/el-button-c7b375c4.cjs +0 -1
- package/es/el-form-item-b686a8bb.js +0 -1599
- package/es/el-form-item-ff0d8d07.cjs +0 -12
- package/es/el-message-e97bdea1.cjs +0 -1
- package/es/el-overlay-7b90d61c.cjs +0 -1
- package/es/el-table-column-26e7f13f.cjs +0 -14
- package/es/index-669a0983.js +0 -14
- package/es/index-c4649a37.cjs +0 -3
- package/es/use-global-config-8429db7d.js +0 -72
|
@@ -0,0 +1,1324 @@
|
|
|
1
|
+
import { ref as W, computed as E, defineComponent as B, watch as oe, provide as rt, reactive as nt, toRefs as it, openBlock as se, createElementBlock as at, normalizeClass as K, unref as j, renderSlot as J, inject as fe, onMounted as Se, onBeforeUnmount as ot, onUpdated as st, createVNode as le, Fragment as Nt, nextTick as ft, useSlots as Rt, withCtx as re, createBlock as lt, resolveDynamicComponent as ut, normalizeStyle as be, createTextVNode as Mt, toDisplayString as We, createCommentVNode as Ve, createElementVNode as Be, TransitionGroup as Lt, useAttrs as Ct } from "vue";
|
|
2
|
+
import { x as Wt, c as Te, a as Pe, y as $e, z as we } from "./use-form-common-props-9c0363ac.js";
|
|
3
|
+
import { S as De, D as dt, E as Vt, F as Bt, b as de, d as Fe, s as ct, i as xe, c as pt, f as Y, u as ce, _ as Ie, h as gt, t as Dt, e as Ut, G as zt, y as Ue, w as mt, v as Gt, l as ze } from "./base-3ecbc734.js";
|
|
4
|
+
import { c as Ae } from "./castArray-7d3fc921.js";
|
|
5
|
+
import { a as Kt } from "./el-scrollbar-66f3bb72.js";
|
|
6
|
+
import { g as ye } from "./index-68ee64fa.js";
|
|
7
|
+
import { k as vt, g as yt, s as Yt, b as Ht, a as Ne, n as ue, c as ht, d as Jt, S as Zt, e as Qt } from "./el-tag-6a31c968.js";
|
|
8
|
+
import { d as pe, k as Re, g as Xt, e as bt, f as kt, h as er, i as tr, j as rr } from "./el-table-column-560db3aa.js";
|
|
9
|
+
import { e as nr } from "./el-popper-d3eef7ed.js";
|
|
10
|
+
function ir(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 ar(r, e) {
|
|
16
|
+
return r && pe(e, vt(e), r);
|
|
17
|
+
}
|
|
18
|
+
function or(r, e) {
|
|
19
|
+
return r && pe(e, Re(e), r);
|
|
20
|
+
}
|
|
21
|
+
function sr(r, e) {
|
|
22
|
+
return pe(r, yt(r), e);
|
|
23
|
+
}
|
|
24
|
+
var fr = Object.getOwnPropertySymbols, lr = fr ? function(r) {
|
|
25
|
+
for (var e = []; r; )
|
|
26
|
+
nr(e, yt(r)), r = Xt(r);
|
|
27
|
+
return e;
|
|
28
|
+
} : Yt;
|
|
29
|
+
const wt = lr;
|
|
30
|
+
function ur(r, e) {
|
|
31
|
+
return pe(r, wt(r), e);
|
|
32
|
+
}
|
|
33
|
+
function dr(r) {
|
|
34
|
+
return Ht(r, Re, wt);
|
|
35
|
+
}
|
|
36
|
+
var cr = Object.prototype, pr = cr.hasOwnProperty;
|
|
37
|
+
function gr(r) {
|
|
38
|
+
var e = r.length, t = new r.constructor(e);
|
|
39
|
+
return e && typeof r[0] == "string" && pr.call(r, "index") && (t.index = r.index, t.input = r.input), t;
|
|
40
|
+
}
|
|
41
|
+
function mr(r, e) {
|
|
42
|
+
var t = e ? bt(r.buffer) : r.buffer;
|
|
43
|
+
return new r.constructor(t, r.byteOffset, r.byteLength);
|
|
44
|
+
}
|
|
45
|
+
var vr = /\w*$/;
|
|
46
|
+
function yr(r) {
|
|
47
|
+
var e = new r.constructor(r.source, vr.exec(r));
|
|
48
|
+
return e.lastIndex = r.lastIndex, e;
|
|
49
|
+
}
|
|
50
|
+
var Ge = De ? De.prototype : void 0, Ke = Ge ? Ge.valueOf : void 0;
|
|
51
|
+
function hr(r) {
|
|
52
|
+
return Ke ? Object(Ke.call(r)) : {};
|
|
53
|
+
}
|
|
54
|
+
var br = "[object Boolean]", wr = "[object Date]", Fr = "[object Map]", xr = "[object Number]", Ar = "[object RegExp]", Or = "[object Set]", qr = "[object String]", jr = "[object Symbol]", Er = "[object ArrayBuffer]", _r = "[object DataView]", Sr = "[object Float32Array]", Tr = "[object Float64Array]", Pr = "[object Int8Array]", $r = "[object Int16Array]", Ir = "[object Int32Array]", Nr = "[object Uint8Array]", Rr = "[object Uint8ClampedArray]", Mr = "[object Uint16Array]", Lr = "[object Uint32Array]";
|
|
55
|
+
function Cr(r, e, t) {
|
|
56
|
+
var n = r.constructor;
|
|
57
|
+
switch (e) {
|
|
58
|
+
case Er:
|
|
59
|
+
return bt(r);
|
|
60
|
+
case br:
|
|
61
|
+
case wr:
|
|
62
|
+
return new n(+r);
|
|
63
|
+
case _r:
|
|
64
|
+
return mr(r, t);
|
|
65
|
+
case Sr:
|
|
66
|
+
case Tr:
|
|
67
|
+
case Pr:
|
|
68
|
+
case $r:
|
|
69
|
+
case Ir:
|
|
70
|
+
case Nr:
|
|
71
|
+
case Rr:
|
|
72
|
+
case Mr:
|
|
73
|
+
case Lr:
|
|
74
|
+
return kt(r, t);
|
|
75
|
+
case Fr:
|
|
76
|
+
return new n();
|
|
77
|
+
case xr:
|
|
78
|
+
case qr:
|
|
79
|
+
return new n(r);
|
|
80
|
+
case Ar:
|
|
81
|
+
return yr(r);
|
|
82
|
+
case Or:
|
|
83
|
+
return new n();
|
|
84
|
+
case jr:
|
|
85
|
+
return hr(r);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
var Wr = "[object Map]";
|
|
89
|
+
function Vr(r) {
|
|
90
|
+
return dt(r) && Ne(r) == Wr;
|
|
91
|
+
}
|
|
92
|
+
var Ye = ue && ue.isMap, Br = Ye ? ht(Ye) : Vr;
|
|
93
|
+
const Dr = Br;
|
|
94
|
+
var Ur = "[object Set]";
|
|
95
|
+
function zr(r) {
|
|
96
|
+
return dt(r) && Ne(r) == Ur;
|
|
97
|
+
}
|
|
98
|
+
var He = ue && ue.isSet, Gr = He ? ht(He) : zr;
|
|
99
|
+
const Kr = Gr;
|
|
100
|
+
var Yr = 1, Hr = 2, Jr = 4, Ft = "[object Arguments]", Zr = "[object Array]", Qr = "[object Boolean]", Xr = "[object Date]", kr = "[object Error]", xt = "[object Function]", en = "[object GeneratorFunction]", tn = "[object Map]", rn = "[object Number]", At = "[object Object]", nn = "[object RegExp]", an = "[object Set]", on = "[object String]", sn = "[object Symbol]", fn = "[object WeakMap]", ln = "[object ArrayBuffer]", un = "[object DataView]", dn = "[object Float32Array]", cn = "[object Float64Array]", pn = "[object Int8Array]", gn = "[object Int16Array]", mn = "[object Int32Array]", vn = "[object Uint8Array]", yn = "[object Uint8ClampedArray]", hn = "[object Uint16Array]", bn = "[object Uint32Array]", O = {};
|
|
101
|
+
O[Ft] = O[Zr] = O[ln] = O[un] = O[Qr] = O[Xr] = O[dn] = O[cn] = O[pn] = O[gn] = O[mn] = O[tn] = O[rn] = O[At] = O[nn] = O[an] = O[on] = O[sn] = O[vn] = O[yn] = O[hn] = O[bn] = !0;
|
|
102
|
+
O[kr] = O[xt] = O[fn] = !1;
|
|
103
|
+
function ne(r, e, t, n, i, o) {
|
|
104
|
+
var a, s = e & Yr, u = e & Hr, b = e & Jr;
|
|
105
|
+
if (t && (a = i ? t(r, n, i, o) : t(r)), a !== void 0)
|
|
106
|
+
return a;
|
|
107
|
+
if (!Vt(r))
|
|
108
|
+
return r;
|
|
109
|
+
var c = Bt(r);
|
|
110
|
+
if (c) {
|
|
111
|
+
if (a = gr(r), !s)
|
|
112
|
+
return er(r, a);
|
|
113
|
+
} else {
|
|
114
|
+
var v = Ne(r), y = v == xt || v == en;
|
|
115
|
+
if (Jt(r))
|
|
116
|
+
return tr(r, s);
|
|
117
|
+
if (v == At || v == Ft || y && !i) {
|
|
118
|
+
if (a = u || y ? {} : rr(r), !s)
|
|
119
|
+
return u ? ur(r, or(a, r)) : sr(r, ar(a, r));
|
|
120
|
+
} else {
|
|
121
|
+
if (!O[v])
|
|
122
|
+
return i ? r : {};
|
|
123
|
+
a = Cr(r, v, s);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
o || (o = new Zt());
|
|
127
|
+
var x = o.get(r);
|
|
128
|
+
if (x)
|
|
129
|
+
return x;
|
|
130
|
+
o.set(r, a), Kr(r) ? r.forEach(function(m) {
|
|
131
|
+
a.add(ne(m, e, t, m, r, o));
|
|
132
|
+
}) : Dr(r) && r.forEach(function(m, l) {
|
|
133
|
+
a.set(l, ne(m, e, t, l, r, o));
|
|
134
|
+
});
|
|
135
|
+
var q = b ? u ? dr : Qt : u ? Re : vt, d = c ? void 0 : q(r);
|
|
136
|
+
return ir(d || r, function(m, l) {
|
|
137
|
+
d && (l = m, m = r[l]), Wt(a, l, ne(m, e, t, l, r, o));
|
|
138
|
+
}), a;
|
|
139
|
+
}
|
|
140
|
+
var wn = 4;
|
|
141
|
+
function Je(r) {
|
|
142
|
+
return ne(r, wn);
|
|
143
|
+
}
|
|
144
|
+
const Fn = de({
|
|
145
|
+
size: {
|
|
146
|
+
type: String,
|
|
147
|
+
values: Te
|
|
148
|
+
},
|
|
149
|
+
disabled: Boolean
|
|
150
|
+
}), xn = de({
|
|
151
|
+
...Fn,
|
|
152
|
+
model: Object,
|
|
153
|
+
rules: {
|
|
154
|
+
type: Fe(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
|
+
}), An = {
|
|
191
|
+
validate: (r, e, t) => (ct(r) || xe(r)) && pt(e) && xe(t)
|
|
192
|
+
}, On = "ElForm";
|
|
193
|
+
function qn() {
|
|
194
|
+
const r = W([]), 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" && Y(On, `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 ee = (r, e) => {
|
|
222
|
+
const t = Ae(e);
|
|
223
|
+
return t.length > 0 ? r.filter((n) => n.prop && t.includes(n.prop)) : r;
|
|
224
|
+
}, ie = "ElForm", jn = B({
|
|
225
|
+
name: ie
|
|
226
|
+
}), En = /* @__PURE__ */ B({
|
|
227
|
+
...jn,
|
|
228
|
+
props: xn,
|
|
229
|
+
emits: An,
|
|
230
|
+
setup(r, { expose: e, emit: t }) {
|
|
231
|
+
const n = r, i = [], o = Pe(), a = ce("form"), s = E(() => {
|
|
232
|
+
const { labelPosition: f, inline: p } = n;
|
|
233
|
+
return [
|
|
234
|
+
a.b(),
|
|
235
|
+
a.m(o.value || "default"),
|
|
236
|
+
{
|
|
237
|
+
[a.m(`label-${f}`)]: f,
|
|
238
|
+
[a.m("inline")]: p
|
|
239
|
+
}
|
|
240
|
+
];
|
|
241
|
+
}), u = (f) => i.find((p) => p.prop === f), b = (f) => {
|
|
242
|
+
i.push(f);
|
|
243
|
+
}, c = (f) => {
|
|
244
|
+
f.prop && i.splice(i.indexOf(f), 1);
|
|
245
|
+
}, v = (f = []) => {
|
|
246
|
+
if (!n.model) {
|
|
247
|
+
Y(ie, "model is required for resetFields to work.");
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
ee(i, f).forEach((p) => p.resetField());
|
|
251
|
+
}, y = (f = []) => {
|
|
252
|
+
ee(i, f).forEach((p) => p.clearValidate());
|
|
253
|
+
}, x = E(() => {
|
|
254
|
+
const f = !!n.model;
|
|
255
|
+
return f || Y(ie, "model is required for validate to work."), f;
|
|
256
|
+
}), q = (f) => {
|
|
257
|
+
if (i.length === 0)
|
|
258
|
+
return [];
|
|
259
|
+
const p = ee(i, f);
|
|
260
|
+
return p.length ? p : (Y(ie, "please pass correct props!"), []);
|
|
261
|
+
}, d = async (f) => l(void 0, f), m = async (f = []) => {
|
|
262
|
+
if (!x.value)
|
|
263
|
+
return !1;
|
|
264
|
+
const p = q(f);
|
|
265
|
+
if (p.length === 0)
|
|
266
|
+
return !0;
|
|
267
|
+
let A = {};
|
|
268
|
+
for (const w of p)
|
|
269
|
+
try {
|
|
270
|
+
await w.validate(""), w.validateState === "error" && w.resetField();
|
|
271
|
+
} catch (T) {
|
|
272
|
+
A = {
|
|
273
|
+
...A,
|
|
274
|
+
...T
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
return Object.keys(A).length === 0 ? !0 : Promise.reject(A);
|
|
278
|
+
}, l = async (f = [], p) => {
|
|
279
|
+
const A = !gt(p);
|
|
280
|
+
try {
|
|
281
|
+
const w = await m(f);
|
|
282
|
+
return w === !0 && await (p == null ? void 0 : p(w)), w;
|
|
283
|
+
} catch (w) {
|
|
284
|
+
if (w instanceof Error)
|
|
285
|
+
throw w;
|
|
286
|
+
const T = w;
|
|
287
|
+
return n.scrollToError && $(Object.keys(T)[0]), await (p == null ? void 0 : p(!1, T)), A && Promise.reject(T);
|
|
288
|
+
}
|
|
289
|
+
}, $ = (f) => {
|
|
290
|
+
var p;
|
|
291
|
+
const A = ee(i, f)[0];
|
|
292
|
+
A && ((p = A.$el) == null || p.scrollIntoView(n.scrollIntoViewOptions));
|
|
293
|
+
};
|
|
294
|
+
return oe(() => n.rules, () => {
|
|
295
|
+
n.validateOnRuleChange && d().catch((f) => Y(f));
|
|
296
|
+
}, { deep: !0, flush: "post" }), rt($e, nt({
|
|
297
|
+
...it(n),
|
|
298
|
+
emit: t,
|
|
299
|
+
resetFields: v,
|
|
300
|
+
clearValidate: y,
|
|
301
|
+
validateField: l,
|
|
302
|
+
getField: u,
|
|
303
|
+
addField: b,
|
|
304
|
+
removeField: c,
|
|
305
|
+
...qn()
|
|
306
|
+
})), e({
|
|
307
|
+
validate: d,
|
|
308
|
+
validateField: l,
|
|
309
|
+
resetFields: v,
|
|
310
|
+
clearValidate: y,
|
|
311
|
+
scrollToField: $,
|
|
312
|
+
fields: i
|
|
313
|
+
}), (f, p) => (se(), at("form", {
|
|
314
|
+
class: K(j(s))
|
|
315
|
+
}, [
|
|
316
|
+
J(f.$slots, "default")
|
|
317
|
+
], 2));
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
var _n = /* @__PURE__ */ Ie(En, [["__file", "form.vue"]]);
|
|
321
|
+
function V() {
|
|
322
|
+
return V = 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
|
+
}, V.apply(this, arguments);
|
|
330
|
+
}
|
|
331
|
+
function Sn(r, e) {
|
|
332
|
+
r.prototype = Object.create(e.prototype), r.prototype.constructor = r, Q(r, e);
|
|
333
|
+
}
|
|
334
|
+
function Oe(r) {
|
|
335
|
+
return Oe = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
336
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
337
|
+
}, Oe(r);
|
|
338
|
+
}
|
|
339
|
+
function Q(r, e) {
|
|
340
|
+
return Q = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, i) {
|
|
341
|
+
return n.__proto__ = i, n;
|
|
342
|
+
}, Q(r, e);
|
|
343
|
+
}
|
|
344
|
+
function Tn() {
|
|
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 ae(r, e, t) {
|
|
357
|
+
return Tn() ? ae = Reflect.construct.bind() : ae = 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 && Q(b, a.prototype), b;
|
|
362
|
+
}, ae.apply(null, arguments);
|
|
363
|
+
}
|
|
364
|
+
function Pn(r) {
|
|
365
|
+
return Function.toString.call(r).indexOf("[native code]") !== -1;
|
|
366
|
+
}
|
|
367
|
+
function qe(r) {
|
|
368
|
+
var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
369
|
+
return qe = function(n) {
|
|
370
|
+
if (n === null || !Pn(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 ae(n, arguments, Oe(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
|
+
}), Q(i, n);
|
|
390
|
+
}, qe(r);
|
|
391
|
+
}
|
|
392
|
+
var $n = /%[sdj%]/g, Ot = function() {
|
|
393
|
+
};
|
|
394
|
+
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (Ot = 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 je(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 R(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 In(r) {
|
|
441
|
+
return r === "string" || r === "url" || r === "hex" || r === "email" || r === "date" || r === "pattern";
|
|
442
|
+
}
|
|
443
|
+
function _(r, e) {
|
|
444
|
+
return !!(r == null || e === "array" && Array.isArray(r) && !r.length || In(e) && typeof r == "string" && !r);
|
|
445
|
+
}
|
|
446
|
+
function Nn(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 Ze(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 Rn(r) {
|
|
468
|
+
var e = [];
|
|
469
|
+
return Object.keys(r).forEach(function(t) {
|
|
470
|
+
e.push.apply(e, r[t] || []);
|
|
471
|
+
}), e;
|
|
472
|
+
}
|
|
473
|
+
var Qe = /* @__PURE__ */ function(r) {
|
|
474
|
+
Sn(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__ */ qe(Error));
|
|
481
|
+
function Mn(r, e, t, n, i) {
|
|
482
|
+
if (e.first) {
|
|
483
|
+
var o = new Promise(function(y, x) {
|
|
484
|
+
var q = function(l) {
|
|
485
|
+
return n(l), l.length ? x(new Qe(l, je(l))) : y(i);
|
|
486
|
+
}, d = Rn(r);
|
|
487
|
+
Ze(d, t, q);
|
|
488
|
+
});
|
|
489
|
+
return o.catch(function(y) {
|
|
490
|
+
return y;
|
|
491
|
+
}), o;
|
|
492
|
+
}
|
|
493
|
+
var a = e.firstFields === !0 ? Object.keys(r) : e.firstFields || [], s = Object.keys(r), u = s.length, b = 0, c = [], v = new Promise(function(y, x) {
|
|
494
|
+
var q = function(m) {
|
|
495
|
+
if (c.push.apply(c, m), b++, b === u)
|
|
496
|
+
return n(c), c.length ? x(new Qe(c, je(c))) : y(i);
|
|
497
|
+
};
|
|
498
|
+
s.length || (n(c), y(i)), s.forEach(function(d) {
|
|
499
|
+
var m = r[d];
|
|
500
|
+
a.indexOf(d) !== -1 ? Ze(m, t, q) : Nn(m, t, q);
|
|
501
|
+
});
|
|
502
|
+
});
|
|
503
|
+
return v.catch(function(y) {
|
|
504
|
+
return y;
|
|
505
|
+
}), v;
|
|
506
|
+
}
|
|
507
|
+
function Ln(r) {
|
|
508
|
+
return !!(r && r.message !== void 0);
|
|
509
|
+
}
|
|
510
|
+
function Cn(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 Xe(r, e) {
|
|
519
|
+
return function(t) {
|
|
520
|
+
var n;
|
|
521
|
+
return r.fullFields ? n = Cn(e, r.fullFields) : n = e[t.field || r.fullField], Ln(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 ke(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] = V({}, r[t], n) : r[t] = n;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
return r;
|
|
537
|
+
}
|
|
538
|
+
var qt = function(e, t, n, i, o, a) {
|
|
539
|
+
e.required && (!n.hasOwnProperty(e.field) || _(t, a || e.type)) && i.push(R(o.messages.required, e.fullField));
|
|
540
|
+
}, Wn = function(e, t, n, i, o) {
|
|
541
|
+
(/^\s+$/.test(t) || t === "") && i.push(R(o.messages.whitespace, e.fullField));
|
|
542
|
+
}, te, Vn = function() {
|
|
543
|
+
if (te)
|
|
544
|
+
return te;
|
|
545
|
+
var r = "[a-fA-F\\d:]", e = function(p) {
|
|
546
|
+
return p && p.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(p) {
|
|
559
|
+
return p && p.exact ? o : new RegExp("(?:" + e(p) + t + e(p) + ")|(?:" + e(p) + i + e(p) + ")", "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]+:)?//)", c = "(?:\\S+(?::\\S*)?@)?", v = u.v4().source, y = u.v6().source, x = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", q = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", d = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", m = "(?::\\d{2,5})?", l = '(?:[/?#][^\\s"]*)?', $ = "(?:" + b + "|www\\.)" + c + "(?:localhost|" + v + "|" + y + "|" + x + q + d + ")" + m + l;
|
|
567
|
+
return te = new RegExp("(?:^" + $ + "$)", "i"), te;
|
|
568
|
+
}, et = {
|
|
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
|
+
}, H = {
|
|
577
|
+
integer: function(e) {
|
|
578
|
+
return H.number(e) && parseInt(e, 10) === e;
|
|
579
|
+
},
|
|
580
|
+
float: function(e) {
|
|
581
|
+
return H.number(e) && !H.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" && !H.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(et.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(et.hex);
|
|
615
|
+
}
|
|
616
|
+
}, Bn = function(e, t, n, i, o) {
|
|
617
|
+
if (e.required && t === void 0) {
|
|
618
|
+
qt(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 ? H[s](t) || i.push(R(o.messages.types[s], e.fullField, e.type)) : s && typeof t !== e.type && i.push(R(o.messages.types[s], e.fullField, e.type));
|
|
623
|
+
}, Dn = 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, c = t, v = null, y = typeof t == "number", x = typeof t == "string", q = Array.isArray(t);
|
|
625
|
+
if (y ? v = "number" : x ? v = "string" : q && (v = "array"), !v)
|
|
626
|
+
return !1;
|
|
627
|
+
q && (c = t.length), x && (c = t.replace(b, "_").length), a ? c !== e.len && i.push(R(o.messages[v].len, e.fullField, e.len)) : s && !u && c < e.min ? i.push(R(o.messages[v].min, e.fullField, e.min)) : u && !s && c > e.max ? i.push(R(o.messages[v].max, e.fullField, e.max)) : s && u && (c < e.min || c > e.max) && i.push(R(o.messages[v].range, e.fullField, e.min, e.max));
|
|
628
|
+
}, G = "enum", Un = function(e, t, n, i, o) {
|
|
629
|
+
e[G] = Array.isArray(e[G]) ? e[G] : [], e[G].indexOf(t) === -1 && i.push(R(o.messages[G], e.fullField, e[G].join(", ")));
|
|
630
|
+
}, zn = 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(R(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(R(o.messages.pattern.mismatch, e.fullField, t, e.pattern));
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}, h = {
|
|
640
|
+
required: qt,
|
|
641
|
+
whitespace: Wn,
|
|
642
|
+
type: Bn,
|
|
643
|
+
range: Dn,
|
|
644
|
+
enum: Un,
|
|
645
|
+
pattern: zn
|
|
646
|
+
}, Gn = function(e, t, n, i, o) {
|
|
647
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
648
|
+
if (s) {
|
|
649
|
+
if (_(t, "string") && !e.required)
|
|
650
|
+
return n();
|
|
651
|
+
h.required(e, t, i, a, o, "string"), _(t, "string") || (h.type(e, t, i, a, o), h.range(e, t, i, a, o), h.pattern(e, t, i, a, o), e.whitespace === !0 && h.whitespace(e, t, i, a, o));
|
|
652
|
+
}
|
|
653
|
+
n(a);
|
|
654
|
+
}, Kn = function(e, t, n, i, o) {
|
|
655
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
656
|
+
if (s) {
|
|
657
|
+
if (_(t) && !e.required)
|
|
658
|
+
return n();
|
|
659
|
+
h.required(e, t, i, a, o), t !== void 0 && h.type(e, t, i, a, o);
|
|
660
|
+
}
|
|
661
|
+
n(a);
|
|
662
|
+
}, Yn = 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), _(t) && !e.required)
|
|
666
|
+
return n();
|
|
667
|
+
h.required(e, t, i, a, o), t !== void 0 && (h.type(e, t, i, a, o), h.range(e, t, i, a, o));
|
|
668
|
+
}
|
|
669
|
+
n(a);
|
|
670
|
+
}, Hn = function(e, t, n, i, o) {
|
|
671
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
672
|
+
if (s) {
|
|
673
|
+
if (_(t) && !e.required)
|
|
674
|
+
return n();
|
|
675
|
+
h.required(e, t, i, a, o), t !== void 0 && h.type(e, t, i, a, o);
|
|
676
|
+
}
|
|
677
|
+
n(a);
|
|
678
|
+
}, Jn = function(e, t, n, i, o) {
|
|
679
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
680
|
+
if (s) {
|
|
681
|
+
if (_(t) && !e.required)
|
|
682
|
+
return n();
|
|
683
|
+
h.required(e, t, i, a, o), _(t) || h.type(e, t, i, a, o);
|
|
684
|
+
}
|
|
685
|
+
n(a);
|
|
686
|
+
}, Zn = function(e, t, n, i, o) {
|
|
687
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
688
|
+
if (s) {
|
|
689
|
+
if (_(t) && !e.required)
|
|
690
|
+
return n();
|
|
691
|
+
h.required(e, t, i, a, o), t !== void 0 && (h.type(e, t, i, a, o), h.range(e, t, i, a, o));
|
|
692
|
+
}
|
|
693
|
+
n(a);
|
|
694
|
+
}, Qn = function(e, t, n, i, o) {
|
|
695
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
696
|
+
if (s) {
|
|
697
|
+
if (_(t) && !e.required)
|
|
698
|
+
return n();
|
|
699
|
+
h.required(e, t, i, a, o), t !== void 0 && (h.type(e, t, i, a, o), h.range(e, t, i, a, o));
|
|
700
|
+
}
|
|
701
|
+
n(a);
|
|
702
|
+
}, Xn = 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
|
+
h.required(e, t, i, a, o, "array"), t != null && (h.type(e, t, i, a, o), h.range(e, t, i, a, o));
|
|
708
|
+
}
|
|
709
|
+
n(a);
|
|
710
|
+
}, kn = function(e, t, n, i, o) {
|
|
711
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
712
|
+
if (s) {
|
|
713
|
+
if (_(t) && !e.required)
|
|
714
|
+
return n();
|
|
715
|
+
h.required(e, t, i, a, o), t !== void 0 && h.type(e, t, i, a, o);
|
|
716
|
+
}
|
|
717
|
+
n(a);
|
|
718
|
+
}, ei = "enum", ti = function(e, t, n, i, o) {
|
|
719
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
720
|
+
if (s) {
|
|
721
|
+
if (_(t) && !e.required)
|
|
722
|
+
return n();
|
|
723
|
+
h.required(e, t, i, a, o), t !== void 0 && h[ei](e, t, i, a, o);
|
|
724
|
+
}
|
|
725
|
+
n(a);
|
|
726
|
+
}, ri = function(e, t, n, i, o) {
|
|
727
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
728
|
+
if (s) {
|
|
729
|
+
if (_(t, "string") && !e.required)
|
|
730
|
+
return n();
|
|
731
|
+
h.required(e, t, i, a, o), _(t, "string") || h.pattern(e, t, i, a, o);
|
|
732
|
+
}
|
|
733
|
+
n(a);
|
|
734
|
+
}, ni = function(e, t, n, i, o) {
|
|
735
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
736
|
+
if (s) {
|
|
737
|
+
if (_(t, "date") && !e.required)
|
|
738
|
+
return n();
|
|
739
|
+
if (h.required(e, t, i, a, o), !_(t, "date")) {
|
|
740
|
+
var u;
|
|
741
|
+
t instanceof Date ? u = t : u = new Date(t), h.type(e, u, i, a, o), u && h.range(e, u.getTime(), i, a, o);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
n(a);
|
|
745
|
+
}, ii = function(e, t, n, i, o) {
|
|
746
|
+
var a = [], s = Array.isArray(t) ? "array" : typeof t;
|
|
747
|
+
h.required(e, t, i, a, o, s), n(a);
|
|
748
|
+
}, he = 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 (_(t, a) && !e.required)
|
|
752
|
+
return n();
|
|
753
|
+
h.required(e, t, i, s, o, a), _(t, a) || h.type(e, t, i, s, o);
|
|
754
|
+
}
|
|
755
|
+
n(s);
|
|
756
|
+
}, ai = function(e, t, n, i, o) {
|
|
757
|
+
var a = [], s = e.required || !e.required && i.hasOwnProperty(e.field);
|
|
758
|
+
if (s) {
|
|
759
|
+
if (_(t) && !e.required)
|
|
760
|
+
return n();
|
|
761
|
+
h.required(e, t, i, a, o);
|
|
762
|
+
}
|
|
763
|
+
n(a);
|
|
764
|
+
}, Z = {
|
|
765
|
+
string: Gn,
|
|
766
|
+
method: Kn,
|
|
767
|
+
number: Yn,
|
|
768
|
+
boolean: Hn,
|
|
769
|
+
regexp: Jn,
|
|
770
|
+
integer: Zn,
|
|
771
|
+
float: Qn,
|
|
772
|
+
array: Xn,
|
|
773
|
+
object: kn,
|
|
774
|
+
enum: ti,
|
|
775
|
+
pattern: ri,
|
|
776
|
+
date: ni,
|
|
777
|
+
url: he,
|
|
778
|
+
hex: he,
|
|
779
|
+
email: he,
|
|
780
|
+
required: ii,
|
|
781
|
+
any: ai
|
|
782
|
+
};
|
|
783
|
+
function Ee() {
|
|
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 _e = Ee(), X = /* @__PURE__ */ function() {
|
|
837
|
+
function r(t) {
|
|
838
|
+
this.rules = null, this._messages = _e, 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 = ke(Ee(), 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 c(d) {
|
|
861
|
+
var m = [], l = {};
|
|
862
|
+
function $(p) {
|
|
863
|
+
if (Array.isArray(p)) {
|
|
864
|
+
var A;
|
|
865
|
+
m = (A = m).concat.apply(A, p);
|
|
866
|
+
} else
|
|
867
|
+
m.push(p);
|
|
868
|
+
}
|
|
869
|
+
for (var f = 0; f < d.length; f++)
|
|
870
|
+
$(d[f]);
|
|
871
|
+
m.length ? (l = je(m), b(m, l)) : b(null, s);
|
|
872
|
+
}
|
|
873
|
+
if (u.messages) {
|
|
874
|
+
var v = this.messages();
|
|
875
|
+
v === _e && (v = Ee()), ke(v, u.messages), u.messages = v;
|
|
876
|
+
} else
|
|
877
|
+
u.messages = this.messages();
|
|
878
|
+
var y = {}, x = u.keys || Object.keys(this.rules);
|
|
879
|
+
x.forEach(function(d) {
|
|
880
|
+
var m = a.rules[d], l = s[d];
|
|
881
|
+
m.forEach(function($) {
|
|
882
|
+
var f = $;
|
|
883
|
+
typeof f.transform == "function" && (s === n && (s = V({}, s)), l = s[d] = f.transform(l)), typeof f == "function" ? f = {
|
|
884
|
+
validator: f
|
|
885
|
+
} : f = V({}, f), f.validator = a.getValidationMethod(f), f.validator && (f.field = d, f.fullField = f.fullField || d, f.type = a.getType(f), y[d] = y[d] || [], y[d].push({
|
|
886
|
+
rule: f,
|
|
887
|
+
value: l,
|
|
888
|
+
source: s,
|
|
889
|
+
field: d
|
|
890
|
+
}));
|
|
891
|
+
});
|
|
892
|
+
});
|
|
893
|
+
var q = {};
|
|
894
|
+
return Mn(y, u, function(d, m) {
|
|
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, T) {
|
|
898
|
+
return V({}, T, {
|
|
899
|
+
fullField: l.fullField + "." + w,
|
|
900
|
+
fullFields: l.fullFields ? [].concat(l.fullFields, [w]) : [w]
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
function p(w) {
|
|
904
|
+
w === void 0 && (w = []);
|
|
905
|
+
var T = Array.isArray(w) ? w : [w];
|
|
906
|
+
!u.suppressWarning && T.length && r.warning("async-validator:", T), T.length && l.message !== void 0 && (T = [].concat(l.message));
|
|
907
|
+
var I = T.map(Xe(l, s));
|
|
908
|
+
if (u.first && I.length)
|
|
909
|
+
return q[l.field] = 1, m(I);
|
|
910
|
+
if (!$)
|
|
911
|
+
m(I);
|
|
912
|
+
else {
|
|
913
|
+
if (l.required && !d.value)
|
|
914
|
+
return l.message !== void 0 ? I = [].concat(l.message).map(Xe(l, s)) : u.error && (I = [u.error(l, R(u.messages.required, l.field))]), m(I);
|
|
915
|
+
var C = {};
|
|
916
|
+
l.defaultField && Object.keys(d.value).map(function(N) {
|
|
917
|
+
C[N] = l.defaultField;
|
|
918
|
+
}), C = V({}, C, d.rule.fields);
|
|
919
|
+
var k = {};
|
|
920
|
+
Object.keys(C).forEach(function(N) {
|
|
921
|
+
var M = C[N], ge = Array.isArray(M) ? M : [M];
|
|
922
|
+
k[N] = ge.map(f.bind(null, N));
|
|
923
|
+
});
|
|
924
|
+
var D = new r(k);
|
|
925
|
+
D.messages(u.messages), d.rule.options && (d.rule.options.messages = u.messages, d.rule.options.error = u.error), D.validate(d.value, d.rule.options || u, function(N) {
|
|
926
|
+
var M = [];
|
|
927
|
+
I && I.length && M.push.apply(M, I), N && N.length && M.push.apply(M, N), m(M.length ? M : null);
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
var A;
|
|
932
|
+
if (l.asyncValidator)
|
|
933
|
+
A = l.asyncValidator(l, d.value, p, d.source, u);
|
|
934
|
+
else if (l.validator) {
|
|
935
|
+
try {
|
|
936
|
+
A = l.validator(l, d.value, p, d.source, u);
|
|
937
|
+
} catch (w) {
|
|
938
|
+
console.error == null || console.error(w), u.suppressValidatorError || setTimeout(function() {
|
|
939
|
+
throw w;
|
|
940
|
+
}, 0), p(w.message);
|
|
941
|
+
}
|
|
942
|
+
A === !0 ? p() : A === !1 ? p(typeof l.message == "function" ? l.message(l.fullField || l.field) : l.message || (l.fullField || l.field) + " fails") : A instanceof Array ? p(A) : A instanceof Error && p(A.message);
|
|
943
|
+
}
|
|
944
|
+
A && A.then && A.then(function() {
|
|
945
|
+
return p();
|
|
946
|
+
}, function(w) {
|
|
947
|
+
return p(w);
|
|
948
|
+
});
|
|
949
|
+
}, function(d) {
|
|
950
|
+
c(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 && !Z.hasOwnProperty(n.type))
|
|
954
|
+
throw new Error(R("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" ? Z.required : Z[this.getType(n)] || void 0;
|
|
961
|
+
}, r;
|
|
962
|
+
}();
|
|
963
|
+
X.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
|
+
Z[e] = t;
|
|
967
|
+
};
|
|
968
|
+
X.warning = Ot;
|
|
969
|
+
X.messages = _e;
|
|
970
|
+
X.validators = Z;
|
|
971
|
+
const oi = [
|
|
972
|
+
"",
|
|
973
|
+
"error",
|
|
974
|
+
"validating",
|
|
975
|
+
"success"
|
|
976
|
+
], si = de({
|
|
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: Fe([String, Array])
|
|
989
|
+
},
|
|
990
|
+
required: {
|
|
991
|
+
type: Boolean,
|
|
992
|
+
default: void 0
|
|
993
|
+
},
|
|
994
|
+
rules: {
|
|
995
|
+
type: Fe([Object, Array])
|
|
996
|
+
},
|
|
997
|
+
error: String,
|
|
998
|
+
validateStatus: {
|
|
999
|
+
type: String,
|
|
1000
|
+
values: oi
|
|
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: Te
|
|
1014
|
+
}
|
|
1015
|
+
}), tt = "ElLabelWrap";
|
|
1016
|
+
var fi = B({
|
|
1017
|
+
name: tt,
|
|
1018
|
+
props: {
|
|
1019
|
+
isAutoWidth: Boolean,
|
|
1020
|
+
updateAll: Boolean
|
|
1021
|
+
},
|
|
1022
|
+
setup(r, {
|
|
1023
|
+
slots: e
|
|
1024
|
+
}) {
|
|
1025
|
+
const t = fe($e, void 0), n = fe(we);
|
|
1026
|
+
n || Dt(tt, "usage: <el-form-item><label-wrap /></el-form-item>");
|
|
1027
|
+
const i = ce("form"), o = W(), a = W(0), s = () => {
|
|
1028
|
+
var c;
|
|
1029
|
+
if ((c = o.value) != null && c.firstElementChild) {
|
|
1030
|
+
const v = window.getComputedStyle(o.value.firstElementChild).width;
|
|
1031
|
+
return Math.ceil(Number.parseFloat(v));
|
|
1032
|
+
} else
|
|
1033
|
+
return 0;
|
|
1034
|
+
}, u = (c = "update") => {
|
|
1035
|
+
ft(() => {
|
|
1036
|
+
e.default && r.isAutoWidth && (c === "update" ? a.value = s() : c === "remove" && (t == null || t.deregisterLabelWidth(a.value)));
|
|
1037
|
+
});
|
|
1038
|
+
}, b = () => u("update");
|
|
1039
|
+
return Se(() => {
|
|
1040
|
+
b();
|
|
1041
|
+
}), ot(() => {
|
|
1042
|
+
u("remove");
|
|
1043
|
+
}), st(() => b()), oe(a, (c, v) => {
|
|
1044
|
+
r.updateAll && (t == null || t.registerLabelWidth(c, v));
|
|
1045
|
+
}), Kt(E(() => {
|
|
1046
|
+
var c, v;
|
|
1047
|
+
return (v = (c = o.value) == null ? void 0 : c.firstElementChild) != null ? v : null;
|
|
1048
|
+
}), b), () => {
|
|
1049
|
+
var c, v;
|
|
1050
|
+
if (!e)
|
|
1051
|
+
return null;
|
|
1052
|
+
const {
|
|
1053
|
+
isAutoWidth: y
|
|
1054
|
+
} = r;
|
|
1055
|
+
if (y) {
|
|
1056
|
+
const x = t == null ? void 0 : t.autoLabelWidth, q = n == null ? void 0 : n.hasLabel, d = {};
|
|
1057
|
+
if (q && x && x !== "auto") {
|
|
1058
|
+
const m = Math.max(0, Number.parseInt(x, 10) - a.value), $ = (n.labelPosition || t.labelPosition) === "left" ? "marginRight" : "marginLeft";
|
|
1059
|
+
m && (d[$] = `${m}px`);
|
|
1060
|
+
}
|
|
1061
|
+
return le("div", {
|
|
1062
|
+
ref: o,
|
|
1063
|
+
class: [i.be("item", "label-wrap")],
|
|
1064
|
+
style: d
|
|
1065
|
+
}, [(c = e.default) == null ? void 0 : c.call(e)]);
|
|
1066
|
+
} else
|
|
1067
|
+
return le(Nt, {
|
|
1068
|
+
ref: o
|
|
1069
|
+
}, [(v = e.default) == null ? void 0 : v.call(e)]);
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
});
|
|
1073
|
+
const li = B({
|
|
1074
|
+
name: "ElFormItem"
|
|
1075
|
+
}), ui = /* @__PURE__ */ B({
|
|
1076
|
+
...li,
|
|
1077
|
+
props: si,
|
|
1078
|
+
setup(r, { expose: e }) {
|
|
1079
|
+
const t = r, n = Rt(), i = fe($e, void 0), o = fe(we, void 0), a = Pe(void 0, { formItem: !1 }), s = ce("form-item"), u = Ut().value, b = W([]), c = W(""), v = zt(c, 100), y = W(""), x = W();
|
|
1080
|
+
let q, d = !1;
|
|
1081
|
+
const m = E(() => t.labelPosition || (i == null ? void 0 : i.labelPosition)), l = E(() => {
|
|
1082
|
+
if (m.value === "top")
|
|
1083
|
+
return {};
|
|
1084
|
+
const g = Ue(t.labelWidth || (i == null ? void 0 : i.labelWidth) || "");
|
|
1085
|
+
return g ? { width: g } : {};
|
|
1086
|
+
}), $ = E(() => {
|
|
1087
|
+
if (m.value === "top" || i != null && i.inline)
|
|
1088
|
+
return {};
|
|
1089
|
+
if (!t.label && !t.labelWidth && k)
|
|
1090
|
+
return {};
|
|
1091
|
+
const g = Ue(t.labelWidth || (i == null ? void 0 : i.labelWidth) || "");
|
|
1092
|
+
return !t.label && !n.label ? { marginLeft: g } : {};
|
|
1093
|
+
}), f = E(() => [
|
|
1094
|
+
s.b(),
|
|
1095
|
+
s.m(a.value),
|
|
1096
|
+
s.is("error", c.value === "error"),
|
|
1097
|
+
s.is("validating", c.value === "validating"),
|
|
1098
|
+
s.is("success", c.value === "success"),
|
|
1099
|
+
s.is("required", Et.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-${m.value}`)]: m.value
|
|
1105
|
+
}
|
|
1106
|
+
]), p = E(() => pt(t.inlineMessage) ? t.inlineMessage : (i == null ? void 0 : i.inlineMessage) || !1), A = E(() => [
|
|
1107
|
+
s.e("error"),
|
|
1108
|
+
{ [s.em("error", "inline")]: p.value }
|
|
1109
|
+
]), w = E(() => t.prop ? xe(t.prop) ? t.prop : t.prop.join(".") : ""), T = E(() => !!(t.label || n.label)), I = E(() => t.for || (b.value.length === 1 ? b.value[0] : void 0)), C = E(() => !I.value && T.value), k = !!o, D = E(() => {
|
|
1110
|
+
const g = i == null ? void 0 : i.model;
|
|
1111
|
+
if (!(!g || !t.prop))
|
|
1112
|
+
return ye(g, t.prop).value;
|
|
1113
|
+
}), N = E(() => {
|
|
1114
|
+
const { required: g } = t, F = [];
|
|
1115
|
+
t.rules && F.push(...Ae(t.rules));
|
|
1116
|
+
const P = i == null ? void 0 : i.rules;
|
|
1117
|
+
if (P && t.prop) {
|
|
1118
|
+
const S = ye(P, t.prop).value;
|
|
1119
|
+
S && F.push(...Ae(S));
|
|
1120
|
+
}
|
|
1121
|
+
if (g !== void 0) {
|
|
1122
|
+
const S = F.map((L, z) => [L, z]).filter(([L]) => Object.keys(L).includes("required"));
|
|
1123
|
+
if (S.length > 0)
|
|
1124
|
+
for (const [L, z] of S)
|
|
1125
|
+
L.required !== g && (F[z] = { ...L, required: g });
|
|
1126
|
+
else
|
|
1127
|
+
F.push({ required: g });
|
|
1128
|
+
}
|
|
1129
|
+
return F;
|
|
1130
|
+
}), M = E(() => N.value.length > 0), ge = (g) => N.value.filter((P) => !P.trigger || !g ? !0 : ct(P.trigger) ? P.trigger.includes(g) : P.trigger === g).map(({ trigger: P, ...S }) => S), Et = E(() => N.value.some((g) => g.required)), _t = E(() => {
|
|
1131
|
+
var g;
|
|
1132
|
+
return v.value === "error" && t.showMessage && ((g = i == null ? void 0 : i.showMessage) != null ? g : !0);
|
|
1133
|
+
}), Me = E(() => `${t.label || ""}${(i == null ? void 0 : i.labelSuffix) || ""}`), U = (g) => {
|
|
1134
|
+
c.value = g;
|
|
1135
|
+
}, St = (g) => {
|
|
1136
|
+
var F, P;
|
|
1137
|
+
const { errors: S, fields: L } = g;
|
|
1138
|
+
(!S || !L) && console.error(g), U("error"), y.value = S ? (P = (F = S == null ? void 0 : S[0]) == null ? void 0 : F.message) != null ? P : `${t.prop} is required` : "", i == null || i.emit("validate", t.prop, !1, y.value);
|
|
1139
|
+
}, Tt = () => {
|
|
1140
|
+
U("success"), i == null || i.emit("validate", t.prop, !0, "");
|
|
1141
|
+
}, Pt = async (g) => {
|
|
1142
|
+
const F = w.value;
|
|
1143
|
+
return new X({
|
|
1144
|
+
[F]: g
|
|
1145
|
+
}).validate({ [F]: D.value }, { firstFields: !0 }).then(() => (Tt(), !0)).catch((S) => (St(S), Promise.reject(S)));
|
|
1146
|
+
}, Le = async (g, F) => {
|
|
1147
|
+
if (d || !t.prop)
|
|
1148
|
+
return !1;
|
|
1149
|
+
const P = gt(F);
|
|
1150
|
+
if (!M.value)
|
|
1151
|
+
return F == null || F(!1), !1;
|
|
1152
|
+
const S = ge(g);
|
|
1153
|
+
return S.length === 0 ? (F == null || F(!0), !0) : (U("validating"), Pt(S).then(() => (F == null || F(!0), !0)).catch((L) => {
|
|
1154
|
+
const { fields: z } = L;
|
|
1155
|
+
return F == null || F(!1, z), P ? !1 : Promise.reject(z);
|
|
1156
|
+
}));
|
|
1157
|
+
}, me = () => {
|
|
1158
|
+
U(""), y.value = "", d = !1;
|
|
1159
|
+
}, Ce = async () => {
|
|
1160
|
+
const g = i == null ? void 0 : i.model;
|
|
1161
|
+
if (!g || !t.prop)
|
|
1162
|
+
return;
|
|
1163
|
+
const F = ye(g, t.prop);
|
|
1164
|
+
d = !0, F.value = Je(q), await ft(), me(), d = !1;
|
|
1165
|
+
}, $t = (g) => {
|
|
1166
|
+
b.value.includes(g) || b.value.push(g);
|
|
1167
|
+
}, It = (g) => {
|
|
1168
|
+
b.value = b.value.filter((F) => F !== g);
|
|
1169
|
+
};
|
|
1170
|
+
oe(() => t.error, (g) => {
|
|
1171
|
+
y.value = g || "", U(g ? "error" : "");
|
|
1172
|
+
}, { immediate: !0 }), oe(() => t.validateStatus, (g) => U(g || ""));
|
|
1173
|
+
const ve = nt({
|
|
1174
|
+
...it(t),
|
|
1175
|
+
$el: x,
|
|
1176
|
+
size: a,
|
|
1177
|
+
validateState: c,
|
|
1178
|
+
labelId: u,
|
|
1179
|
+
inputIds: b,
|
|
1180
|
+
isGroup: C,
|
|
1181
|
+
hasLabel: T,
|
|
1182
|
+
fieldValue: D,
|
|
1183
|
+
addInputId: $t,
|
|
1184
|
+
removeInputId: It,
|
|
1185
|
+
resetField: Ce,
|
|
1186
|
+
clearValidate: me,
|
|
1187
|
+
validate: Le
|
|
1188
|
+
});
|
|
1189
|
+
return rt(we, ve), Se(() => {
|
|
1190
|
+
t.prop && (i == null || i.addField(ve), q = Je(D.value));
|
|
1191
|
+
}), ot(() => {
|
|
1192
|
+
i == null || i.removeField(ve);
|
|
1193
|
+
}), e({
|
|
1194
|
+
size: a,
|
|
1195
|
+
validateMessage: y,
|
|
1196
|
+
validateState: c,
|
|
1197
|
+
validate: Le,
|
|
1198
|
+
clearValidate: me,
|
|
1199
|
+
resetField: Ce
|
|
1200
|
+
}), (g, F) => {
|
|
1201
|
+
var P;
|
|
1202
|
+
return se(), at("div", {
|
|
1203
|
+
ref_key: "formItemRef",
|
|
1204
|
+
ref: x,
|
|
1205
|
+
class: K(j(f)),
|
|
1206
|
+
role: j(C) ? "group" : void 0,
|
|
1207
|
+
"aria-labelledby": j(C) ? j(u) : void 0
|
|
1208
|
+
}, [
|
|
1209
|
+
le(j(fi), {
|
|
1210
|
+
"is-auto-width": j(l).width === "auto",
|
|
1211
|
+
"update-all": ((P = j(i)) == null ? void 0 : P.labelWidth) === "auto"
|
|
1212
|
+
}, {
|
|
1213
|
+
default: re(() => [
|
|
1214
|
+
j(T) ? (se(), lt(ut(j(I) ? "label" : "div"), {
|
|
1215
|
+
key: 0,
|
|
1216
|
+
id: j(u),
|
|
1217
|
+
for: j(I),
|
|
1218
|
+
class: K(j(s).e("label")),
|
|
1219
|
+
style: be(j(l))
|
|
1220
|
+
}, {
|
|
1221
|
+
default: re(() => [
|
|
1222
|
+
J(g.$slots, "label", { label: j(Me) }, () => [
|
|
1223
|
+
Mt(We(j(Me)), 1)
|
|
1224
|
+
])
|
|
1225
|
+
]),
|
|
1226
|
+
_: 3
|
|
1227
|
+
}, 8, ["id", "for", "class", "style"])) : Ve("v-if", !0)
|
|
1228
|
+
]),
|
|
1229
|
+
_: 3
|
|
1230
|
+
}, 8, ["is-auto-width", "update-all"]),
|
|
1231
|
+
Be("div", {
|
|
1232
|
+
class: K(j(s).e("content")),
|
|
1233
|
+
style: be(j($))
|
|
1234
|
+
}, [
|
|
1235
|
+
J(g.$slots, "default"),
|
|
1236
|
+
le(Lt, {
|
|
1237
|
+
name: `${j(s).namespace.value}-zoom-in-top`
|
|
1238
|
+
}, {
|
|
1239
|
+
default: re(() => [
|
|
1240
|
+
j(_t) ? J(g.$slots, "error", {
|
|
1241
|
+
key: 0,
|
|
1242
|
+
error: y.value
|
|
1243
|
+
}, () => [
|
|
1244
|
+
Be("div", {
|
|
1245
|
+
class: K(j(A))
|
|
1246
|
+
}, We(y.value), 3)
|
|
1247
|
+
]) : Ve("v-if", !0)
|
|
1248
|
+
]),
|
|
1249
|
+
_: 3
|
|
1250
|
+
}, 8, ["name"])
|
|
1251
|
+
], 6)
|
|
1252
|
+
], 10, ["role", "aria-labelledby"]);
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
});
|
|
1256
|
+
var jt = /* @__PURE__ */ Ie(ui, [["__file", "form-item.vue"]]);
|
|
1257
|
+
const Oi = mt(_n, {
|
|
1258
|
+
FormItem: jt
|
|
1259
|
+
}), qi = Gt(jt), di = de({
|
|
1260
|
+
type: {
|
|
1261
|
+
type: String,
|
|
1262
|
+
values: ["primary", "success", "info", "warning", "danger", ""],
|
|
1263
|
+
default: ""
|
|
1264
|
+
},
|
|
1265
|
+
size: {
|
|
1266
|
+
type: String,
|
|
1267
|
+
values: Te,
|
|
1268
|
+
default: ""
|
|
1269
|
+
},
|
|
1270
|
+
truncated: Boolean,
|
|
1271
|
+
lineClamp: {
|
|
1272
|
+
type: [String, Number]
|
|
1273
|
+
},
|
|
1274
|
+
tag: {
|
|
1275
|
+
type: String,
|
|
1276
|
+
default: "span"
|
|
1277
|
+
}
|
|
1278
|
+
}), ci = B({
|
|
1279
|
+
name: "ElText"
|
|
1280
|
+
}), pi = /* @__PURE__ */ B({
|
|
1281
|
+
...ci,
|
|
1282
|
+
props: di,
|
|
1283
|
+
setup(r) {
|
|
1284
|
+
const e = r, t = W(), n = Pe(), i = ce("text"), o = E(() => [
|
|
1285
|
+
i.b(),
|
|
1286
|
+
i.m(e.type),
|
|
1287
|
+
i.m(n.value),
|
|
1288
|
+
i.is("truncated", e.truncated),
|
|
1289
|
+
i.is("line-clamp", !ze(e.lineClamp))
|
|
1290
|
+
]), a = Ct().title, s = () => {
|
|
1291
|
+
var u, b, c, v, y;
|
|
1292
|
+
if (a)
|
|
1293
|
+
return;
|
|
1294
|
+
let x = !1;
|
|
1295
|
+
const q = ((u = t.value) == null ? void 0 : u.textContent) || "";
|
|
1296
|
+
if (e.truncated) {
|
|
1297
|
+
const d = (b = t.value) == null ? void 0 : b.offsetWidth, m = (c = t.value) == null ? void 0 : c.scrollWidth;
|
|
1298
|
+
d && m && m > d && (x = !0);
|
|
1299
|
+
} else if (!ze(e.lineClamp)) {
|
|
1300
|
+
const d = (v = t.value) == null ? void 0 : v.offsetHeight, m = (y = t.value) == null ? void 0 : y.scrollHeight;
|
|
1301
|
+
d && m && m > d && (x = !0);
|
|
1302
|
+
}
|
|
1303
|
+
x ? t.value.setAttribute("title", q) : t.value.removeAttribute("title");
|
|
1304
|
+
};
|
|
1305
|
+
return Se(s), st(s), (u, b) => (se(), lt(ut(u.tag), {
|
|
1306
|
+
ref_key: "textRef",
|
|
1307
|
+
ref: t,
|
|
1308
|
+
class: K(j(o)),
|
|
1309
|
+
style: be({ "-webkit-line-clamp": u.lineClamp })
|
|
1310
|
+
}, {
|
|
1311
|
+
default: re(() => [
|
|
1312
|
+
J(u.$slots, "default")
|
|
1313
|
+
]),
|
|
1314
|
+
_: 3
|
|
1315
|
+
}, 8, ["class", "style"]));
|
|
1316
|
+
}
|
|
1317
|
+
});
|
|
1318
|
+
var gi = /* @__PURE__ */ Ie(pi, [["__file", "text.vue"]]);
|
|
1319
|
+
const ji = mt(gi);
|
|
1320
|
+
export {
|
|
1321
|
+
qi as E,
|
|
1322
|
+
ji as a,
|
|
1323
|
+
Oi as b
|
|
1324
|
+
};
|