jmash-core 0.0.84 → 0.0.86

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