|
@@ -1,2168 +0,0 @@
|
|
|
-import { aQ as me, aR as tt, aS as Bt, H as nt, G as ge, aT as Gt, aU as rt, aV as Wt, aW as Ht, aX as Ut, aY as Le, aZ as Ve, aC as it, a_ as Ie, a$ as at, b0 as ue, b1 as zt, b2 as ot, b3 as Kt, I as lt, b4 as st, b5 as Xt, d as C, l as we, n as Yt, a6 as Zt, c as ce, W as Jt, b6 as Qt, a7 as kt, _ as N, g as en, m as tn, a5 as nn, b7 as ft, r as ut, X as rn, Y as an, S as on, a1 as ct, P as ae, u as ln, A as sn, af as fn, b8 as un, ag as cn, aK as dt } from "./index2.js";
|
|
|
|
|
-import { cloneVNode as dn, inject as mt, computed as F, provide as gt, createVNode as S, Fragment as de, defineComponent as Pe, ref as mn, watch as Fe, Transition as gn, withDirectives as pn, TransitionGroup as vn, vShow as hn, shallowRef as U, watchEffect as Ae, onBeforeUnmount as yn, reactive as bn, onMounted as xn, toRaw as $n, nextTick as wn } from "vue";
|
|
|
|
|
-import { d as Fn, e as pt, b as vt, f as ht, t as yt, h as An, i as Sn } from "./hasIn.js";
|
|
|
|
|
-import { g as bt } from "./_getPrototype.js";
|
|
|
|
|
-import { C as xt, A as On } from "./Col.js";
|
|
|
|
|
-import { t as Cn } from "./toNumber.js";
|
|
|
|
|
-import { b as En, F as qn } from "./FormItemContext.js";
|
|
|
|
|
-var Tn = 1 / 0, In = 17976931348623157e292;
|
|
|
|
|
-function Pn(e) {
|
|
|
|
|
- if (!e)
|
|
|
|
|
- return e === 0 ? e : 0;
|
|
|
|
|
- if (e = Cn(e), e === Tn || e === -1 / 0) {
|
|
|
|
|
- var t = e < 0 ? -1 : 1;
|
|
|
|
|
- return t * In;
|
|
|
|
|
- }
|
|
|
|
|
- return e === e ? e : 0;
|
|
|
|
|
-}
|
|
|
|
|
-function _n(e) {
|
|
|
|
|
- var t = Pn(e), n = t % 1;
|
|
|
|
|
- return t === t ? n ? t - n : t : 0;
|
|
|
|
|
-}
|
|
|
|
|
-var De = Object.create, jn = /* @__PURE__ */ function() {
|
|
|
|
|
- function e() {
|
|
|
|
|
- }
|
|
|
|
|
- return function(t) {
|
|
|
|
|
- if (!me(t))
|
|
|
|
|
- return {};
|
|
|
|
|
- if (De)
|
|
|
|
|
- return De(t);
|
|
|
|
|
- e.prototype = t;
|
|
|
|
|
- var n = new e();
|
|
|
|
|
- return e.prototype = void 0, n;
|
|
|
|
|
- };
|
|
|
|
|
-}();
|
|
|
|
|
-function Mn(e, t) {
|
|
|
|
|
- var n = -1, r = e.length;
|
|
|
|
|
- for (t || (t = Array(r)); ++n < r; )
|
|
|
|
|
- t[n] = e[n];
|
|
|
|
|
- return t;
|
|
|
|
|
-}
|
|
|
|
|
-function Rn(e, t) {
|
|
|
|
|
- for (var n = -1, r = e == null ? 0 : e.length; ++n < r && t(e[n], n, e) !== !1; )
|
|
|
|
|
- ;
|
|
|
|
|
- return e;
|
|
|
|
|
-}
|
|
|
|
|
-function pe(e, t, n, r) {
|
|
|
|
|
- var i = !n;
|
|
|
|
|
- n || (n = {});
|
|
|
|
|
- for (var o = -1, a = t.length; ++o < a; ) {
|
|
|
|
|
- var l = t[o], s = void 0;
|
|
|
|
|
- s === void 0 && (s = e[l]), i ? Fn(n, l, s) : pt(n, l, s);
|
|
|
|
|
- }
|
|
|
|
|
- return n;
|
|
|
|
|
-}
|
|
|
|
|
-function Nn(e) {
|
|
|
|
|
- var t = [];
|
|
|
|
|
- if (e != null)
|
|
|
|
|
- for (var n in Object(e))
|
|
|
|
|
- t.push(n);
|
|
|
|
|
- return t;
|
|
|
|
|
-}
|
|
|
|
|
-var Ln = Object.prototype, Vn = Ln.hasOwnProperty;
|
|
|
|
|
-function Dn(e) {
|
|
|
|
|
- if (!me(e))
|
|
|
|
|
- return Nn(e);
|
|
|
|
|
- var t = tt(e), n = [];
|
|
|
|
|
- for (var r in e)
|
|
|
|
|
- r == "constructor" && (t || !Vn.call(e, r)) || n.push(r);
|
|
|
|
|
- return n;
|
|
|
|
|
-}
|
|
|
|
|
-function _e(e) {
|
|
|
|
|
- return nt(e) ? Bt(e, !0) : Dn(e);
|
|
|
|
|
-}
|
|
|
|
|
-function Bn(e, t, n) {
|
|
|
|
|
- var r = e == null ? void 0 : vt(e, t);
|
|
|
|
|
- return r === void 0 ? n : r;
|
|
|
|
|
-}
|
|
|
|
|
-function Gn(e, t) {
|
|
|
|
|
- return e && pe(t, ge(t), e);
|
|
|
|
|
-}
|
|
|
|
|
-function Wn(e, t) {
|
|
|
|
|
- return e && pe(t, _e(t), e);
|
|
|
|
|
-}
|
|
|
|
|
-var $t = typeof exports == "object" && exports && !exports.nodeType && exports, Be = $t && typeof module == "object" && module && !module.nodeType && module, Hn = Be && Be.exports === $t, Ge = Hn ? Gt.Buffer : void 0, We = Ge ? Ge.allocUnsafe : void 0;
|
|
|
|
|
-function Un(e, t) {
|
|
|
|
|
- if (t)
|
|
|
|
|
- return e.slice();
|
|
|
|
|
- var n = e.length, r = We ? We(n) : new e.constructor(n);
|
|
|
|
|
- return e.copy(r), r;
|
|
|
|
|
-}
|
|
|
|
|
-function zn(e, t) {
|
|
|
|
|
- return pe(e, rt(e), t);
|
|
|
|
|
-}
|
|
|
|
|
-var Kn = Object.getOwnPropertySymbols, wt = Kn ? function(e) {
|
|
|
|
|
- for (var t = []; e; )
|
|
|
|
|
- Ht(t, rt(e)), e = bt(e);
|
|
|
|
|
- return t;
|
|
|
|
|
-} : Wt;
|
|
|
|
|
-function Xn(e, t) {
|
|
|
|
|
- return pe(e, wt(e), t);
|
|
|
|
|
-}
|
|
|
|
|
-function Yn(e) {
|
|
|
|
|
- return Ut(e, _e, wt);
|
|
|
|
|
-}
|
|
|
|
|
-var Zn = Object.prototype, Jn = Zn.hasOwnProperty;
|
|
|
|
|
-function Qn(e) {
|
|
|
|
|
- var t = e.length, n = new e.constructor(t);
|
|
|
|
|
- return t && typeof e[0] == "string" && Jn.call(e, "index") && (n.index = e.index, n.input = e.input), n;
|
|
|
|
|
-}
|
|
|
|
|
-function je(e) {
|
|
|
|
|
- var t = new e.constructor(e.byteLength);
|
|
|
|
|
- return new Le(t).set(new Le(e)), t;
|
|
|
|
|
-}
|
|
|
|
|
-function kn(e, t) {
|
|
|
|
|
- var n = t ? je(e.buffer) : e.buffer;
|
|
|
|
|
- return new e.constructor(n, e.byteOffset, e.byteLength);
|
|
|
|
|
-}
|
|
|
|
|
-var er = /\w*$/;
|
|
|
|
|
-function tr(e) {
|
|
|
|
|
- var t = new e.constructor(e.source, er.exec(e));
|
|
|
|
|
- return t.lastIndex = e.lastIndex, t;
|
|
|
|
|
-}
|
|
|
|
|
-var He = Ve ? Ve.prototype : void 0, Ue = He ? He.valueOf : void 0;
|
|
|
|
|
-function nr(e) {
|
|
|
|
|
- return Ue ? Object(Ue.call(e)) : {};
|
|
|
|
|
-}
|
|
|
|
|
-function rr(e, t) {
|
|
|
|
|
- var n = t ? je(e.buffer) : e.buffer;
|
|
|
|
|
- return new e.constructor(n, e.byteOffset, e.length);
|
|
|
|
|
-}
|
|
|
|
|
-var ir = "[object Boolean]", ar = "[object Date]", or = "[object Map]", lr = "[object Number]", sr = "[object RegExp]", fr = "[object Set]", ur = "[object String]", cr = "[object Symbol]", dr = "[object ArrayBuffer]", mr = "[object DataView]", gr = "[object Float32Array]", pr = "[object Float64Array]", vr = "[object Int8Array]", hr = "[object Int16Array]", yr = "[object Int32Array]", br = "[object Uint8Array]", xr = "[object Uint8ClampedArray]", $r = "[object Uint16Array]", wr = "[object Uint32Array]";
|
|
|
|
|
-function Fr(e, t, n) {
|
|
|
|
|
- var r = e.constructor;
|
|
|
|
|
- switch (t) {
|
|
|
|
|
- case dr:
|
|
|
|
|
- return je(e);
|
|
|
|
|
- case ir:
|
|
|
|
|
- case ar:
|
|
|
|
|
- return new r(+e);
|
|
|
|
|
- case mr:
|
|
|
|
|
- return kn(e, n);
|
|
|
|
|
- case gr:
|
|
|
|
|
- case pr:
|
|
|
|
|
- case vr:
|
|
|
|
|
- case hr:
|
|
|
|
|
- case yr:
|
|
|
|
|
- case br:
|
|
|
|
|
- case xr:
|
|
|
|
|
- case $r:
|
|
|
|
|
- case wr:
|
|
|
|
|
- return rr(e, n);
|
|
|
|
|
- case or:
|
|
|
|
|
- return new r();
|
|
|
|
|
- case lr:
|
|
|
|
|
- case ur:
|
|
|
|
|
- return new r(e);
|
|
|
|
|
- case sr:
|
|
|
|
|
- return tr(e);
|
|
|
|
|
- case fr:
|
|
|
|
|
- return new r();
|
|
|
|
|
- case cr:
|
|
|
|
|
- return nr(e);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-function Ar(e) {
|
|
|
|
|
- return typeof e.constructor == "function" && !tt(e) ? jn(bt(e)) : {};
|
|
|
|
|
-}
|
|
|
|
|
-var Sr = "[object Map]";
|
|
|
|
|
-function Or(e) {
|
|
|
|
|
- return it(e) && Ie(e) == Sr;
|
|
|
|
|
-}
|
|
|
|
|
-var ze = ue && ue.isMap, Cr = ze ? at(ze) : Or, Er = "[object Set]";
|
|
|
|
|
-function qr(e) {
|
|
|
|
|
- return it(e) && Ie(e) == Er;
|
|
|
|
|
-}
|
|
|
|
|
-var Ke = ue && ue.isSet, Tr = Ke ? at(Ke) : qr, Ir = 1, Pr = 2, _r = 4, Ft = "[object Arguments]", jr = "[object Array]", Mr = "[object Boolean]", Rr = "[object Date]", Nr = "[object Error]", At = "[object Function]", Lr = "[object GeneratorFunction]", Vr = "[object Map]", Dr = "[object Number]", St = "[object Object]", Br = "[object RegExp]", Gr = "[object Set]", Wr = "[object String]", Hr = "[object Symbol]", Ur = "[object WeakMap]", zr = "[object ArrayBuffer]", Kr = "[object DataView]", Xr = "[object Float32Array]", Yr = "[object Float64Array]", Zr = "[object Int8Array]", Jr = "[object Int16Array]", Qr = "[object Int32Array]", kr = "[object Uint8Array]", ei = "[object Uint8ClampedArray]", ti = "[object Uint16Array]", ni = "[object Uint32Array]", O = {};
|
|
|
|
|
-O[Ft] = O[jr] = O[zr] = O[Kr] = O[Mr] = O[Rr] = O[Xr] = O[Yr] = O[Zr] = O[Jr] = O[Qr] = O[Vr] = O[Dr] = O[St] = O[Br] = O[Gr] = O[Wr] = O[Hr] = O[kr] = O[ei] = O[ti] = O[ni] = !0;
|
|
|
|
|
-O[Nr] = O[At] = O[Ur] = !1;
|
|
|
|
|
-function le(e, t, n, r, i, o) {
|
|
|
|
|
- var a, l = t & Ir, s = t & Pr, m = t & _r;
|
|
|
|
|
- if (n && (a = i ? n(e, r, i, o) : n(e)), a !== void 0)
|
|
|
|
|
- return a;
|
|
|
|
|
- if (!me(e))
|
|
|
|
|
- return e;
|
|
|
|
|
- var f = lt(e);
|
|
|
|
|
- if (f) {
|
|
|
|
|
- if (a = Qn(e), !l)
|
|
|
|
|
- return Mn(e, a);
|
|
|
|
|
- } else {
|
|
|
|
|
- var d = Ie(e), g = d == At || d == Lr;
|
|
|
|
|
- if (zt(e))
|
|
|
|
|
- return Un(e, l);
|
|
|
|
|
- if (d == St || d == Ft || g && !i) {
|
|
|
|
|
- if (a = s || g ? {} : Ar(e), !l)
|
|
|
|
|
- return s ? Xn(e, Wn(a, e)) : zn(e, Gn(a, e));
|
|
|
|
|
- } else {
|
|
|
|
|
- if (!O[d])
|
|
|
|
|
- return i ? e : {};
|
|
|
|
|
- a = Fr(e, d, l);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- o || (o = new ot());
|
|
|
|
|
- var y = o.get(e);
|
|
|
|
|
- if (y)
|
|
|
|
|
- return y;
|
|
|
|
|
- o.set(e, a), Tr(e) ? e.forEach(function(v) {
|
|
|
|
|
- a.add(le(v, t, n, v, e, o));
|
|
|
|
|
- }) : Cr(e) && e.forEach(function(v, c) {
|
|
|
|
|
- a.set(c, le(v, t, n, c, e, o));
|
|
|
|
|
- });
|
|
|
|
|
- var x = m ? s ? Yn : Kt : s ? _e : ge, u = f ? void 0 : x(e);
|
|
|
|
|
- return Rn(u || e, function(v, c) {
|
|
|
|
|
- u && (c = v, v = e[c]), pt(a, c, le(v, t, n, c, e, o));
|
|
|
|
|
- }), a;
|
|
|
|
|
-}
|
|
|
|
|
-var ri = 1, ii = 4;
|
|
|
|
|
-function ai(e) {
|
|
|
|
|
- return le(e, ri | ii);
|
|
|
|
|
-}
|
|
|
|
|
-var oi = 1, li = 2;
|
|
|
|
|
-function si(e, t, n, r) {
|
|
|
|
|
- var i = n.length, o = i;
|
|
|
|
|
- if (e == null)
|
|
|
|
|
- return !o;
|
|
|
|
|
- for (e = Object(e); i--; ) {
|
|
|
|
|
- var a = n[i];
|
|
|
|
|
- if (a[2] ? a[1] !== e[a[0]] : !(a[0] in e))
|
|
|
|
|
- return !1;
|
|
|
|
|
- }
|
|
|
|
|
- for (; ++i < o; ) {
|
|
|
|
|
- a = n[i];
|
|
|
|
|
- var l = a[0], s = e[l], m = a[1];
|
|
|
|
|
- if (a[2]) {
|
|
|
|
|
- if (s === void 0 && !(l in e))
|
|
|
|
|
- return !1;
|
|
|
|
|
- } else {
|
|
|
|
|
- var f = new ot(), d;
|
|
|
|
|
- if (!(d === void 0 ? st(m, s, oi | li, r, f) : d))
|
|
|
|
|
- return !1;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return !0;
|
|
|
|
|
-}
|
|
|
|
|
-function Ot(e) {
|
|
|
|
|
- return e === e && !me(e);
|
|
|
|
|
-}
|
|
|
|
|
-function fi(e) {
|
|
|
|
|
- for (var t = ge(e), n = t.length; n--; ) {
|
|
|
|
|
- var r = t[n], i = e[r];
|
|
|
|
|
- t[n] = [r, i, Ot(i)];
|
|
|
|
|
- }
|
|
|
|
|
- return t;
|
|
|
|
|
-}
|
|
|
|
|
-function Ct(e, t) {
|
|
|
|
|
- return function(n) {
|
|
|
|
|
- return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n));
|
|
|
|
|
- };
|
|
|
|
|
-}
|
|
|
|
|
-function ui(e) {
|
|
|
|
|
- var t = fi(e);
|
|
|
|
|
- return t.length == 1 && t[0][2] ? Ct(t[0][0], t[0][1]) : function(n) {
|
|
|
|
|
- return n === e || si(n, e, t);
|
|
|
|
|
- };
|
|
|
|
|
-}
|
|
|
|
|
-var ci = 1, di = 2;
|
|
|
|
|
-function mi(e, t) {
|
|
|
|
|
- return ht(e) && Ot(t) ? Ct(yt(e), t) : function(n) {
|
|
|
|
|
- var r = Bn(n, e);
|
|
|
|
|
- return r === void 0 && r === t ? An(n, e) : st(t, r, ci | di);
|
|
|
|
|
- };
|
|
|
|
|
-}
|
|
|
|
|
-function gi(e) {
|
|
|
|
|
- return function(t) {
|
|
|
|
|
- return t == null ? void 0 : t[e];
|
|
|
|
|
- };
|
|
|
|
|
-}
|
|
|
|
|
-function pi(e) {
|
|
|
|
|
- return function(t) {
|
|
|
|
|
- return vt(t, e);
|
|
|
|
|
- };
|
|
|
|
|
-}
|
|
|
|
|
-function vi(e) {
|
|
|
|
|
- return ht(e) ? gi(yt(e)) : pi(e);
|
|
|
|
|
-}
|
|
|
|
|
-function Et(e) {
|
|
|
|
|
- return typeof e == "function" ? e : e == null ? Sn : typeof e == "object" ? lt(e) ? mi(e[0], e[1]) : ui(e) : vi(e);
|
|
|
|
|
-}
|
|
|
|
|
-function hi(e) {
|
|
|
|
|
- return function(t, n, r) {
|
|
|
|
|
- var i = Object(t);
|
|
|
|
|
- if (!nt(t)) {
|
|
|
|
|
- var o = Et(n);
|
|
|
|
|
- t = ge(t), n = function(l) {
|
|
|
|
|
- return o(i[l], l, i);
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- var a = e(t, n, r);
|
|
|
|
|
- return a > -1 ? i[o ? t[a] : a] : void 0;
|
|
|
|
|
- };
|
|
|
|
|
-}
|
|
|
|
|
-var yi = Math.max;
|
|
|
|
|
-function bi(e, t, n) {
|
|
|
|
|
- var r = e == null ? 0 : e.length;
|
|
|
|
|
- if (!r)
|
|
|
|
|
- return -1;
|
|
|
|
|
- var i = n == null ? 0 : _n(n);
|
|
|
|
|
- return i < 0 && (i = yi(r + i, 0)), Xt(e, Et(t), i);
|
|
|
|
|
-}
|
|
|
|
|
-var xi = hi(bi);
|
|
|
|
|
-function X() {
|
|
|
|
|
- return X = Object.assign ? Object.assign.bind() : function(e) {
|
|
|
|
|
- for (var t = 1; t < arguments.length; t++) {
|
|
|
|
|
- var n = arguments[t];
|
|
|
|
|
- for (var r in n)
|
|
|
|
|
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
|
|
|
- }
|
|
|
|
|
- return e;
|
|
|
|
|
- }, X.apply(this, arguments);
|
|
|
|
|
-}
|
|
|
|
|
-function $i(e, t) {
|
|
|
|
|
- e.prototype = Object.create(t.prototype), e.prototype.constructor = e, re(e, t);
|
|
|
|
|
-}
|
|
|
|
|
-function Se(e) {
|
|
|
|
|
- return Se = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
|
|
|
|
|
- return n.__proto__ || Object.getPrototypeOf(n);
|
|
|
|
|
- }, Se(e);
|
|
|
|
|
-}
|
|
|
|
|
-function re(e, t) {
|
|
|
|
|
- return re = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
|
|
|
|
|
- return r.__proto__ = i, r;
|
|
|
|
|
- }, re(e, t);
|
|
|
|
|
-}
|
|
|
|
|
-function wi() {
|
|
|
|
|
- if (typeof Reflect == "undefined" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
|
|
|
- if (typeof Proxy == "function") return !0;
|
|
|
|
|
- try {
|
|
|
|
|
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
|
|
|
- })), !0;
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- return !1;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-function se(e, t, n) {
|
|
|
|
|
- return wi() ? se = Reflect.construct.bind() : se = function(i, o, a) {
|
|
|
|
|
- var l = [null];
|
|
|
|
|
- l.push.apply(l, o);
|
|
|
|
|
- var s = Function.bind.apply(i, l), m = new s();
|
|
|
|
|
- return a && re(m, a.prototype), m;
|
|
|
|
|
- }, se.apply(null, arguments);
|
|
|
|
|
-}
|
|
|
|
|
-function Fi(e) {
|
|
|
|
|
- return Function.toString.call(e).indexOf("[native code]") !== -1;
|
|
|
|
|
-}
|
|
|
|
|
-function Oe(e) {
|
|
|
|
|
- var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
|
|
|
- return Oe = function(r) {
|
|
|
|
|
- if (r === null || !Fi(r)) return r;
|
|
|
|
|
- if (typeof r != "function")
|
|
|
|
|
- throw new TypeError("Super expression must either be null or a function");
|
|
|
|
|
- if (typeof t != "undefined") {
|
|
|
|
|
- if (t.has(r)) return t.get(r);
|
|
|
|
|
- t.set(r, i);
|
|
|
|
|
- }
|
|
|
|
|
- function i() {
|
|
|
|
|
- return se(r, arguments, Se(this).constructor);
|
|
|
|
|
- }
|
|
|
|
|
- return i.prototype = Object.create(r.prototype, {
|
|
|
|
|
- constructor: {
|
|
|
|
|
- value: i,
|
|
|
|
|
- enumerable: !1,
|
|
|
|
|
- writable: !0,
|
|
|
|
|
- configurable: !0
|
|
|
|
|
- }
|
|
|
|
|
- }), re(i, r);
|
|
|
|
|
- }, Oe(e);
|
|
|
|
|
-}
|
|
|
|
|
-var Ai = /%[sdj%]/g, qt = function() {
|
|
|
|
|
-};
|
|
|
|
|
-typeof process != "undefined" && process.env && process.env.NODE_ENV !== "production" && typeof window != "undefined" && typeof document != "undefined" && (qt = function(t, n) {
|
|
|
|
|
- typeof console != "undefined" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING == "undefined" && n.every(function(r) {
|
|
|
|
|
- return typeof r == "string";
|
|
|
|
|
- }) && console.warn(t, n);
|
|
|
|
|
-});
|
|
|
|
|
-function Ce(e) {
|
|
|
|
|
- if (!e || !e.length) return null;
|
|
|
|
|
- var t = {};
|
|
|
|
|
- return e.forEach(function(n) {
|
|
|
|
|
- var r = n.field;
|
|
|
|
|
- t[r] = t[r] || [], t[r].push(n);
|
|
|
|
|
- }), t;
|
|
|
|
|
-}
|
|
|
|
|
-function V(e) {
|
|
|
|
|
- for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
|
|
|
|
|
- n[r - 1] = arguments[r];
|
|
|
|
|
- var i = 0, o = n.length;
|
|
|
|
|
- if (typeof e == "function")
|
|
|
|
|
- return e.apply(null, n);
|
|
|
|
|
- if (typeof e == "string") {
|
|
|
|
|
- var a = e.replace(Ai, function(l) {
|
|
|
|
|
- if (l === "%%")
|
|
|
|
|
- return "%";
|
|
|
|
|
- if (i >= o)
|
|
|
|
|
- return l;
|
|
|
|
|
- switch (l) {
|
|
|
|
|
- case "%s":
|
|
|
|
|
- return String(n[i++]);
|
|
|
|
|
- case "%d":
|
|
|
|
|
- return Number(n[i++]);
|
|
|
|
|
- case "%j":
|
|
|
|
|
- try {
|
|
|
|
|
- return JSON.stringify(n[i++]);
|
|
|
|
|
- } catch (s) {
|
|
|
|
|
- return "[Circular]";
|
|
|
|
|
- }
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- return l;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- return a;
|
|
|
|
|
- }
|
|
|
|
|
- return e;
|
|
|
|
|
-}
|
|
|
|
|
-function Si(e) {
|
|
|
|
|
- return e === "string" || e === "url" || e === "hex" || e === "email" || e === "date" || e === "pattern";
|
|
|
|
|
-}
|
|
|
|
|
-function P(e, t) {
|
|
|
|
|
- return !!(e == null || t === "array" && Array.isArray(e) && !e.length || Si(t) && typeof e == "string" && !e);
|
|
|
|
|
-}
|
|
|
|
|
-function Oi(e, t, n) {
|
|
|
|
|
- var r = [], i = 0, o = e.length;
|
|
|
|
|
- function a(l) {
|
|
|
|
|
- r.push.apply(r, l || []), i++, i === o && n(r);
|
|
|
|
|
- }
|
|
|
|
|
- e.forEach(function(l) {
|
|
|
|
|
- t(l, a);
|
|
|
|
|
- });
|
|
|
|
|
-}
|
|
|
|
|
-function Xe(e, t, n) {
|
|
|
|
|
- var r = 0, i = e.length;
|
|
|
|
|
- function o(a) {
|
|
|
|
|
- if (a && a.length) {
|
|
|
|
|
- n(a);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- var l = r;
|
|
|
|
|
- r = r + 1, l < i ? t(e[l], o) : n([]);
|
|
|
|
|
- }
|
|
|
|
|
- o([]);
|
|
|
|
|
-}
|
|
|
|
|
-function Ci(e) {
|
|
|
|
|
- var t = [];
|
|
|
|
|
- return Object.keys(e).forEach(function(n) {
|
|
|
|
|
- t.push.apply(t, e[n] || []);
|
|
|
|
|
- }), t;
|
|
|
|
|
-}
|
|
|
|
|
-var Ye = /* @__PURE__ */ function(e) {
|
|
|
|
|
- $i(t, e);
|
|
|
|
|
- function t(n, r) {
|
|
|
|
|
- var i;
|
|
|
|
|
- return i = e.call(this, "Async Validation Error") || this, i.errors = n, i.fields = r, i;
|
|
|
|
|
- }
|
|
|
|
|
- return t;
|
|
|
|
|
-}(/* @__PURE__ */ Oe(Error));
|
|
|
|
|
-function Ei(e, t, n, r, i) {
|
|
|
|
|
- if (t.first) {
|
|
|
|
|
- var o = new Promise(function(g, y) {
|
|
|
|
|
- var x = function(c) {
|
|
|
|
|
- return r(c), c.length ? y(new Ye(c, Ce(c))) : g(i);
|
|
|
|
|
- }, u = Ci(e);
|
|
|
|
|
- Xe(u, n, x);
|
|
|
|
|
- });
|
|
|
|
|
- return o.catch(function(g) {
|
|
|
|
|
- return g;
|
|
|
|
|
- }), o;
|
|
|
|
|
- }
|
|
|
|
|
- var a = t.firstFields === !0 ? Object.keys(e) : t.firstFields || [], l = Object.keys(e), s = l.length, m = 0, f = [], d = new Promise(function(g, y) {
|
|
|
|
|
- var x = function(v) {
|
|
|
|
|
- if (f.push.apply(f, v), m++, m === s)
|
|
|
|
|
- return r(f), f.length ? y(new Ye(f, Ce(f))) : g(i);
|
|
|
|
|
- };
|
|
|
|
|
- l.length || (r(f), g(i)), l.forEach(function(u) {
|
|
|
|
|
- var v = e[u];
|
|
|
|
|
- a.indexOf(u) !== -1 ? Xe(v, n, x) : Oi(v, n, x);
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- return d.catch(function(g) {
|
|
|
|
|
- return g;
|
|
|
|
|
- }), d;
|
|
|
|
|
-}
|
|
|
|
|
-function qi(e) {
|
|
|
|
|
- return !!(e && e.message !== void 0);
|
|
|
|
|
-}
|
|
|
|
|
-function Ti(e, t) {
|
|
|
|
|
- for (var n = e, r = 0; r < t.length; r++) {
|
|
|
|
|
- if (n == null)
|
|
|
|
|
- return n;
|
|
|
|
|
- n = n[t[r]];
|
|
|
|
|
- }
|
|
|
|
|
- return n;
|
|
|
|
|
-}
|
|
|
|
|
-function Ze(e, t) {
|
|
|
|
|
- return function(n) {
|
|
|
|
|
- var r;
|
|
|
|
|
- return e.fullFields ? r = Ti(t, e.fullFields) : r = t[n.field || e.fullField], qi(n) ? (n.field = n.field || e.fullField, n.fieldValue = r, n) : {
|
|
|
|
|
- message: typeof n == "function" ? n() : n,
|
|
|
|
|
- fieldValue: r,
|
|
|
|
|
- field: n.field || e.fullField
|
|
|
|
|
- };
|
|
|
|
|
- };
|
|
|
|
|
-}
|
|
|
|
|
-function Je(e, t) {
|
|
|
|
|
- if (t) {
|
|
|
|
|
- for (var n in t)
|
|
|
|
|
- if (t.hasOwnProperty(n)) {
|
|
|
|
|
- var r = t[n];
|
|
|
|
|
- typeof r == "object" && typeof e[n] == "object" ? e[n] = X({}, e[n], r) : e[n] = r;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return e;
|
|
|
|
|
-}
|
|
|
|
|
-var Tt = function(t, n, r, i, o, a) {
|
|
|
|
|
- t.required && (!r.hasOwnProperty(t.field) || P(n, a || t.type)) && i.push(V(o.messages.required, t.fullField));
|
|
|
|
|
-}, Ii = function(t, n, r, i, o) {
|
|
|
|
|
- (/^\s+$/.test(n) || n === "") && i.push(V(o.messages.whitespace, t.fullField));
|
|
|
|
|
-}, oe, Pi = function() {
|
|
|
|
|
- if (oe)
|
|
|
|
|
- return oe;
|
|
|
|
|
- var e = "[a-fA-F\\d:]", t = function($) {
|
|
|
|
|
- return $ && $.includeBoundaries ? "(?:(?<=\\s|^)(?=" + e + ")|(?<=" + e + ")(?=\\s|$))" : "";
|
|
|
|
|
- }, n = "(?: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}", r = "[a-fA-F\\d]{1,4}", i = (`
|
|
|
|
|
-(?:
|
|
|
|
|
-(?:` + r + ":){7}(?:" + r + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
|
|
|
-(?:` + r + ":){6}(?:" + n + "|:" + r + `|:)| // 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
|
|
|
|
|
-(?:` + r + ":){5}(?::" + n + "|(?::" + r + `){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
|
|
|
|
|
-(?:` + r + ":){4}(?:(?::" + r + "){0,1}:" + n + "|(?::" + r + `){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
|
|
|
|
|
-(?:` + r + ":){3}(?:(?::" + r + "){0,2}:" + n + "|(?::" + r + `){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
|
|
|
|
|
-(?:` + r + ":){2}(?:(?::" + r + "){0,3}:" + n + "|(?::" + r + `){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
|
|
|
|
-(?:` + r + ":){1}(?:(?::" + r + "){0,4}:" + n + "|(?::" + r + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
|
|
|
-(?::(?:(?::` + r + "){0,5}:" + n + "|(?::" + r + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
|
|
|
-)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
|
|
|
-`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), o = new RegExp("(?:^" + n + "$)|(?:^" + i + "$)"), a = new RegExp("^" + n + "$"), l = new RegExp("^" + i + "$"), s = function($) {
|
|
|
|
|
- return $ && $.exact ? o : new RegExp("(?:" + t($) + n + t($) + ")|(?:" + t($) + i + t($) + ")", "g");
|
|
|
|
|
- };
|
|
|
|
|
- s.v4 = function(h) {
|
|
|
|
|
- return h && h.exact ? a : new RegExp("" + t(h) + n + t(h), "g");
|
|
|
|
|
- }, s.v6 = function(h) {
|
|
|
|
|
- return h && h.exact ? l : new RegExp("" + t(h) + i + t(h), "g");
|
|
|
|
|
- };
|
|
|
|
|
- var m = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", d = s.v4().source, g = s.v6().source, y = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", x = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", u = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", v = "(?::\\d{2,5})?", c = '(?:[/?#][^\\s"]*)?', w = "(?:" + m + "|www\\.)" + f + "(?:localhost|" + d + "|" + g + "|" + y + x + u + ")" + v + c;
|
|
|
|
|
- return oe = new RegExp("(?:^" + w + "$)", "i"), oe;
|
|
|
|
|
-}, Qe = {
|
|
|
|
|
- // http://emailregex.com/
|
|
|
|
|
- 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,}))$/,
|
|
|
|
|
- // url: new RegExp(
|
|
|
|
|
- // '^(?!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]*)?$',
|
|
|
|
|
- // 'i',
|
|
|
|
|
- // ),
|
|
|
|
|
- hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
|
|
|
|
|
-}, te = {
|
|
|
|
|
- integer: function(t) {
|
|
|
|
|
- return te.number(t) && parseInt(t, 10) === t;
|
|
|
|
|
- },
|
|
|
|
|
- float: function(t) {
|
|
|
|
|
- return te.number(t) && !te.integer(t);
|
|
|
|
|
- },
|
|
|
|
|
- array: function(t) {
|
|
|
|
|
- return Array.isArray(t);
|
|
|
|
|
- },
|
|
|
|
|
- regexp: function(t) {
|
|
|
|
|
- if (t instanceof RegExp)
|
|
|
|
|
- return !0;
|
|
|
|
|
- try {
|
|
|
|
|
- return !!new RegExp(t);
|
|
|
|
|
- } catch (n) {
|
|
|
|
|
- return !1;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- date: function(t) {
|
|
|
|
|
- return typeof t.getTime == "function" && typeof t.getMonth == "function" && typeof t.getYear == "function" && !isNaN(t.getTime());
|
|
|
|
|
- },
|
|
|
|
|
- number: function(t) {
|
|
|
|
|
- return isNaN(t) ? !1 : typeof t == "number";
|
|
|
|
|
- },
|
|
|
|
|
- object: function(t) {
|
|
|
|
|
- return typeof t == "object" && !te.array(t);
|
|
|
|
|
- },
|
|
|
|
|
- method: function(t) {
|
|
|
|
|
- return typeof t == "function";
|
|
|
|
|
- },
|
|
|
|
|
- email: function(t) {
|
|
|
|
|
- return typeof t == "string" && t.length <= 320 && !!t.match(Qe.email);
|
|
|
|
|
- },
|
|
|
|
|
- url: function(t) {
|
|
|
|
|
- return typeof t == "string" && t.length <= 2048 && !!t.match(Pi());
|
|
|
|
|
- },
|
|
|
|
|
- hex: function(t) {
|
|
|
|
|
- return typeof t == "string" && !!t.match(Qe.hex);
|
|
|
|
|
- }
|
|
|
|
|
-}, _i = function(t, n, r, i, o) {
|
|
|
|
|
- if (t.required && n === void 0) {
|
|
|
|
|
- Tt(t, n, r, i, o);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- var a = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], l = t.type;
|
|
|
|
|
- a.indexOf(l) > -1 ? te[l](n) || i.push(V(o.messages.types[l], t.fullField, t.type)) : l && typeof n !== t.type && i.push(V(o.messages.types[l], t.fullField, t.type));
|
|
|
|
|
-}, ji = function(t, n, r, i, o) {
|
|
|
|
|
- var a = typeof t.len == "number", l = typeof t.min == "number", s = typeof t.max == "number", m = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, f = n, d = null, g = typeof n == "number", y = typeof n == "string", x = Array.isArray(n);
|
|
|
|
|
- if (g ? d = "number" : y ? d = "string" : x && (d = "array"), !d)
|
|
|
|
|
- return !1;
|
|
|
|
|
- x && (f = n.length), y && (f = n.replace(m, "_").length), a ? f !== t.len && i.push(V(o.messages[d].len, t.fullField, t.len)) : l && !s && f < t.min ? i.push(V(o.messages[d].min, t.fullField, t.min)) : s && !l && f > t.max ? i.push(V(o.messages[d].max, t.fullField, t.max)) : l && s && (f < t.min || f > t.max) && i.push(V(o.messages[d].range, t.fullField, t.min, t.max));
|
|
|
|
|
-}, Y = "enum", Mi = function(t, n, r, i, o) {
|
|
|
|
|
- t[Y] = Array.isArray(t[Y]) ? t[Y] : [], t[Y].indexOf(n) === -1 && i.push(V(o.messages[Y], t.fullField, t[Y].join(", ")));
|
|
|
|
|
-}, Ri = function(t, n, r, i, o) {
|
|
|
|
|
- if (t.pattern) {
|
|
|
|
|
- if (t.pattern instanceof RegExp)
|
|
|
|
|
- t.pattern.lastIndex = 0, t.pattern.test(n) || i.push(V(o.messages.pattern.mismatch, t.fullField, n, t.pattern));
|
|
|
|
|
- else if (typeof t.pattern == "string") {
|
|
|
|
|
- var a = new RegExp(t.pattern);
|
|
|
|
|
- a.test(n) || i.push(V(o.messages.pattern.mismatch, t.fullField, n, t.pattern));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}, b = {
|
|
|
|
|
- required: Tt,
|
|
|
|
|
- whitespace: Ii,
|
|
|
|
|
- type: _i,
|
|
|
|
|
- range: ji,
|
|
|
|
|
- enum: Mi,
|
|
|
|
|
- pattern: Ri
|
|
|
|
|
-}, Ni = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (P(n, "string") && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, a, o, "string"), P(n, "string") || (b.type(t, n, i, a, o), b.range(t, n, i, a, o), b.pattern(t, n, i, a, o), t.whitespace === !0 && b.whitespace(t, n, i, a, o));
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, Li = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (P(n) && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, a, o), n !== void 0 && b.type(t, n, i, a, o);
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, Vi = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (n === "" && (n = void 0), P(n) && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, a, o), n !== void 0 && (b.type(t, n, i, a, o), b.range(t, n, i, a, o));
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, Di = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (P(n) && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, a, o), n !== void 0 && b.type(t, n, i, a, o);
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, Bi = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (P(n) && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, a, o), P(n) || b.type(t, n, i, a, o);
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, Gi = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (P(n) && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, a, o), n !== void 0 && (b.type(t, n, i, a, o), b.range(t, n, i, a, o));
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, Wi = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (P(n) && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, a, o), n !== void 0 && (b.type(t, n, i, a, o), b.range(t, n, i, a, o));
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, Hi = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (n == null && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, a, o, "array"), n != null && (b.type(t, n, i, a, o), b.range(t, n, i, a, o));
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, Ui = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (P(n) && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, a, o), n !== void 0 && b.type(t, n, i, a, o);
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, zi = "enum", Ki = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (P(n) && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, a, o), n !== void 0 && b[zi](t, n, i, a, o);
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, Xi = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (P(n, "string") && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, a, o), P(n, "string") || b.pattern(t, n, i, a, o);
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, Yi = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (P(n, "date") && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- if (b.required(t, n, i, a, o), !P(n, "date")) {
|
|
|
|
|
- var s;
|
|
|
|
|
- n instanceof Date ? s = n : s = new Date(n), b.type(t, s, i, a, o), s && b.range(t, s.getTime(), i, a, o);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, Zi = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = Array.isArray(n) ? "array" : typeof n;
|
|
|
|
|
- b.required(t, n, i, a, o, l), r(a);
|
|
|
|
|
-}, xe = function(t, n, r, i, o) {
|
|
|
|
|
- var a = t.type, l = [], s = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (s) {
|
|
|
|
|
- if (P(n, a) && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, l, o, a), P(n, a) || b.type(t, n, i, l, o);
|
|
|
|
|
- }
|
|
|
|
|
- r(l);
|
|
|
|
|
-}, Ji = function(t, n, r, i, o) {
|
|
|
|
|
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
|
|
|
|
|
- if (l) {
|
|
|
|
|
- if (P(n) && !t.required)
|
|
|
|
|
- return r();
|
|
|
|
|
- b.required(t, n, i, a, o);
|
|
|
|
|
- }
|
|
|
|
|
- r(a);
|
|
|
|
|
-}, ne = {
|
|
|
|
|
- string: Ni,
|
|
|
|
|
- method: Li,
|
|
|
|
|
- number: Vi,
|
|
|
|
|
- boolean: Di,
|
|
|
|
|
- regexp: Bi,
|
|
|
|
|
- integer: Gi,
|
|
|
|
|
- float: Wi,
|
|
|
|
|
- array: Hi,
|
|
|
|
|
- object: Ui,
|
|
|
|
|
- enum: Ki,
|
|
|
|
|
- pattern: Xi,
|
|
|
|
|
- date: Yi,
|
|
|
|
|
- url: xe,
|
|
|
|
|
- hex: xe,
|
|
|
|
|
- email: xe,
|
|
|
|
|
- required: Zi,
|
|
|
|
|
- any: Ji
|
|
|
|
|
-};
|
|
|
|
|
-function Ee() {
|
|
|
|
|
- return {
|
|
|
|
|
- default: "Validation error on field %s",
|
|
|
|
|
- required: "%s is required",
|
|
|
|
|
- enum: "%s must be one of %s",
|
|
|
|
|
- whitespace: "%s cannot be empty",
|
|
|
|
|
- date: {
|
|
|
|
|
- format: "%s date %s is invalid for format %s",
|
|
|
|
|
- parse: "%s date could not be parsed, %s is invalid ",
|
|
|
|
|
- invalid: "%s date %s is invalid"
|
|
|
|
|
- },
|
|
|
|
|
- types: {
|
|
|
|
|
- string: "%s is not a %s",
|
|
|
|
|
- method: "%s is not a %s (function)",
|
|
|
|
|
- array: "%s is not an %s",
|
|
|
|
|
- object: "%s is not an %s",
|
|
|
|
|
- number: "%s is not a %s",
|
|
|
|
|
- date: "%s is not a %s",
|
|
|
|
|
- boolean: "%s is not a %s",
|
|
|
|
|
- integer: "%s is not an %s",
|
|
|
|
|
- float: "%s is not a %s",
|
|
|
|
|
- regexp: "%s is not a valid %s",
|
|
|
|
|
- email: "%s is not a valid %s",
|
|
|
|
|
- url: "%s is not a valid %s",
|
|
|
|
|
- hex: "%s is not a valid %s"
|
|
|
|
|
- },
|
|
|
|
|
- string: {
|
|
|
|
|
- len: "%s must be exactly %s characters",
|
|
|
|
|
- min: "%s must be at least %s characters",
|
|
|
|
|
- max: "%s cannot be longer than %s characters",
|
|
|
|
|
- range: "%s must be between %s and %s characters"
|
|
|
|
|
- },
|
|
|
|
|
- number: {
|
|
|
|
|
- len: "%s must equal %s",
|
|
|
|
|
- min: "%s cannot be less than %s",
|
|
|
|
|
- max: "%s cannot be greater than %s",
|
|
|
|
|
- range: "%s must be between %s and %s"
|
|
|
|
|
- },
|
|
|
|
|
- array: {
|
|
|
|
|
- len: "%s must be exactly %s in length",
|
|
|
|
|
- min: "%s cannot be less than %s in length",
|
|
|
|
|
- max: "%s cannot be greater than %s in length",
|
|
|
|
|
- range: "%s must be between %s and %s in length"
|
|
|
|
|
- },
|
|
|
|
|
- pattern: {
|
|
|
|
|
- mismatch: "%s value %s does not match pattern %s"
|
|
|
|
|
- },
|
|
|
|
|
- clone: function() {
|
|
|
|
|
- var t = JSON.parse(JSON.stringify(this));
|
|
|
|
|
- return t.clone = this.clone, t;
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-}
|
|
|
|
|
-var qe = Ee(), ie = /* @__PURE__ */ function() {
|
|
|
|
|
- function e(n) {
|
|
|
|
|
- this.rules = null, this._messages = qe, this.define(n);
|
|
|
|
|
- }
|
|
|
|
|
- var t = e.prototype;
|
|
|
|
|
- return t.define = function(r) {
|
|
|
|
|
- var i = this;
|
|
|
|
|
- if (!r)
|
|
|
|
|
- throw new Error("Cannot configure a schema with no rules");
|
|
|
|
|
- if (typeof r != "object" || Array.isArray(r))
|
|
|
|
|
- throw new Error("Rules must be an object");
|
|
|
|
|
- this.rules = {}, Object.keys(r).forEach(function(o) {
|
|
|
|
|
- var a = r[o];
|
|
|
|
|
- i.rules[o] = Array.isArray(a) ? a : [a];
|
|
|
|
|
- });
|
|
|
|
|
- }, t.messages = function(r) {
|
|
|
|
|
- return r && (this._messages = Je(Ee(), r)), this._messages;
|
|
|
|
|
- }, t.validate = function(r, i, o) {
|
|
|
|
|
- var a = this;
|
|
|
|
|
- i === void 0 && (i = {}), o === void 0 && (o = function() {
|
|
|
|
|
- });
|
|
|
|
|
- var l = r, s = i, m = o;
|
|
|
|
|
- if (typeof s == "function" && (m = s, s = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
|
|
|
- return m && m(null, l), Promise.resolve(l);
|
|
|
|
|
- function f(u) {
|
|
|
|
|
- var v = [], c = {};
|
|
|
|
|
- function w($) {
|
|
|
|
|
- if (Array.isArray($)) {
|
|
|
|
|
- var A;
|
|
|
|
|
- v = (A = v).concat.apply(A, $);
|
|
|
|
|
- } else
|
|
|
|
|
- v.push($);
|
|
|
|
|
- }
|
|
|
|
|
- for (var h = 0; h < u.length; h++)
|
|
|
|
|
- w(u[h]);
|
|
|
|
|
- v.length ? (c = Ce(v), m(v, c)) : m(null, l);
|
|
|
|
|
- }
|
|
|
|
|
- if (s.messages) {
|
|
|
|
|
- var d = this.messages();
|
|
|
|
|
- d === qe && (d = Ee()), Je(d, s.messages), s.messages = d;
|
|
|
|
|
- } else
|
|
|
|
|
- s.messages = this.messages();
|
|
|
|
|
- var g = {}, y = s.keys || Object.keys(this.rules);
|
|
|
|
|
- y.forEach(function(u) {
|
|
|
|
|
- var v = a.rules[u], c = l[u];
|
|
|
|
|
- v.forEach(function(w) {
|
|
|
|
|
- var h = w;
|
|
|
|
|
- typeof h.transform == "function" && (l === r && (l = X({}, l)), c = l[u] = h.transform(c)), typeof h == "function" ? h = {
|
|
|
|
|
- validator: h
|
|
|
|
|
- } : h = X({}, h), h.validator = a.getValidationMethod(h), h.validator && (h.field = u, h.fullField = h.fullField || u, h.type = a.getType(h), g[u] = g[u] || [], g[u].push({
|
|
|
|
|
- rule: h,
|
|
|
|
|
- value: c,
|
|
|
|
|
- source: l,
|
|
|
|
|
- field: u
|
|
|
|
|
- }));
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- var x = {};
|
|
|
|
|
- return Ei(g, s, function(u, v) {
|
|
|
|
|
- var c = u.rule, w = (c.type === "object" || c.type === "array") && (typeof c.fields == "object" || typeof c.defaultField == "object");
|
|
|
|
|
- w = w && (c.required || !c.required && u.value), c.field = u.field;
|
|
|
|
|
- function h(T, I) {
|
|
|
|
|
- return X({}, I, {
|
|
|
|
|
- fullField: c.fullField + "." + T,
|
|
|
|
|
- fullFields: c.fullFields ? [].concat(c.fullFields, [T]) : [T]
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- function $(T) {
|
|
|
|
|
- T === void 0 && (T = []);
|
|
|
|
|
- var I = Array.isArray(T) ? T : [T];
|
|
|
|
|
- !s.suppressWarning && I.length && e.warning("async-validator:", I), I.length && c.message !== void 0 && (I = [].concat(c.message));
|
|
|
|
|
- var R = I.map(Ze(c, l));
|
|
|
|
|
- if (s.first && R.length)
|
|
|
|
|
- return x[c.field] = 1, v(R);
|
|
|
|
|
- if (!w)
|
|
|
|
|
- v(R);
|
|
|
|
|
- else {
|
|
|
|
|
- if (c.required && !u.value)
|
|
|
|
|
- return c.message !== void 0 ? R = [].concat(c.message).map(Ze(c, l)) : s.error && (R = [s.error(c, V(s.messages.required, c.field))]), v(R);
|
|
|
|
|
- var D = {};
|
|
|
|
|
- c.defaultField && Object.keys(u.value).map(function(q) {
|
|
|
|
|
- D[q] = c.defaultField;
|
|
|
|
|
- }), D = X({}, D, u.rule.fields);
|
|
|
|
|
- var H = {};
|
|
|
|
|
- Object.keys(D).forEach(function(q) {
|
|
|
|
|
- var j = D[q], J = Array.isArray(j) ? j : [j];
|
|
|
|
|
- H[q] = J.map(h.bind(null, q));
|
|
|
|
|
- });
|
|
|
|
|
- var z = new e(H);
|
|
|
|
|
- z.messages(s.messages), u.rule.options && (u.rule.options.messages = s.messages, u.rule.options.error = s.error), z.validate(u.value, u.rule.options || s, function(q) {
|
|
|
|
|
- var j = [];
|
|
|
|
|
- R && R.length && j.push.apply(j, R), q && q.length && j.push.apply(j, q), v(j.length ? j : null);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- var A;
|
|
|
|
|
- if (c.asyncValidator)
|
|
|
|
|
- A = c.asyncValidator(c, u.value, $, u.source, s);
|
|
|
|
|
- else if (c.validator) {
|
|
|
|
|
- try {
|
|
|
|
|
- A = c.validator(c, u.value, $, u.source, s);
|
|
|
|
|
- } catch (T) {
|
|
|
|
|
- console.error == null || console.error(T), s.suppressValidatorError || setTimeout(function() {
|
|
|
|
|
- throw T;
|
|
|
|
|
- }, 0), $(T.message);
|
|
|
|
|
- }
|
|
|
|
|
- A === !0 ? $() : A === !1 ? $(typeof c.message == "function" ? c.message(c.fullField || c.field) : c.message || (c.fullField || c.field) + " fails") : A instanceof Array ? $(A) : A instanceof Error && $(A.message);
|
|
|
|
|
- }
|
|
|
|
|
- A && A.then && A.then(function() {
|
|
|
|
|
- return $();
|
|
|
|
|
- }, function(T) {
|
|
|
|
|
- return $(T);
|
|
|
|
|
- });
|
|
|
|
|
- }, function(u) {
|
|
|
|
|
- f(u);
|
|
|
|
|
- }, l);
|
|
|
|
|
- }, t.getType = function(r) {
|
|
|
|
|
- if (r.type === void 0 && r.pattern instanceof RegExp && (r.type = "pattern"), typeof r.validator != "function" && r.type && !ne.hasOwnProperty(r.type))
|
|
|
|
|
- throw new Error(V("Unknown rule type %s", r.type));
|
|
|
|
|
- return r.type || "string";
|
|
|
|
|
- }, t.getValidationMethod = function(r) {
|
|
|
|
|
- if (typeof r.validator == "function")
|
|
|
|
|
- return r.validator;
|
|
|
|
|
- var i = Object.keys(r), o = i.indexOf("message");
|
|
|
|
|
- return o !== -1 && i.splice(o, 1), i.length === 1 && i[0] === "required" ? ne.required : ne[this.getType(r)] || void 0;
|
|
|
|
|
- }, e;
|
|
|
|
|
-}();
|
|
|
|
|
-ie.register = function(t, n) {
|
|
|
|
|
- if (typeof n != "function")
|
|
|
|
|
- throw new Error("Cannot register a validator by type, validator is not a function");
|
|
|
|
|
- ne[t] = n;
|
|
|
|
|
-};
|
|
|
|
|
-ie.warning = qt;
|
|
|
|
|
-ie.messages = qe;
|
|
|
|
|
-ie.validators = ne;
|
|
|
|
|
-function fe(e) {
|
|
|
|
|
- return e == null ? [] : Array.isArray(e) ? e : [e];
|
|
|
|
|
-}
|
|
|
|
|
-function It(e, t) {
|
|
|
|
|
- let n = e;
|
|
|
|
|
- for (let r = 0; r < t.length; r += 1) {
|
|
|
|
|
- if (n == null)
|
|
|
|
|
- return;
|
|
|
|
|
- n = n[t[r]];
|
|
|
|
|
- }
|
|
|
|
|
- return n;
|
|
|
|
|
-}
|
|
|
|
|
-function Pt(e, t, n, r) {
|
|
|
|
|
- if (!t.length)
|
|
|
|
|
- return n;
|
|
|
|
|
- const [i, ...o] = t;
|
|
|
|
|
- let a;
|
|
|
|
|
- return !e && typeof i == "number" ? a = [] : Array.isArray(e) ? a = [...e] : a = C({}, e), r && n === void 0 && o.length === 1 ? delete a[i][o[0]] : a[i] = Pt(a[i], o, n, r), a;
|
|
|
|
|
-}
|
|
|
|
|
-function Qi(e, t, n) {
|
|
|
|
|
- let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
|
|
|
|
|
- return t.length && r && n === void 0 && !It(e, t.slice(0, -1)) ? e : Pt(e, t, n, r);
|
|
|
|
|
-}
|
|
|
|
|
-function ki(e) {
|
|
|
|
|
- return fe(e);
|
|
|
|
|
-}
|
|
|
|
|
-function ea(e, t) {
|
|
|
|
|
- return It(e, t);
|
|
|
|
|
-}
|
|
|
|
|
-function ta(e, t, n) {
|
|
|
|
|
- let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
|
|
|
|
|
- return Qi(e, t, n, r);
|
|
|
|
|
-}
|
|
|
|
|
-function ja(e, t) {
|
|
|
|
|
- return e && e.some((n) => ra(n, t));
|
|
|
|
|
-}
|
|
|
|
|
-function ke(e) {
|
|
|
|
|
- return typeof e == "object" && e !== null && Object.getPrototypeOf(e) === Object.prototype;
|
|
|
|
|
-}
|
|
|
|
|
-function _t(e, t) {
|
|
|
|
|
- const n = Array.isArray(e) ? [...e] : C({}, e);
|
|
|
|
|
- return t && Object.keys(t).forEach((r) => {
|
|
|
|
|
- const i = n[r], o = t[r], a = ke(i) && ke(o);
|
|
|
|
|
- n[r] = a ? _t(i, o || {}) : o;
|
|
|
|
|
- }), n;
|
|
|
|
|
-}
|
|
|
|
|
-function na(e) {
|
|
|
|
|
- for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
|
|
|
|
|
- n[r - 1] = arguments[r];
|
|
|
|
|
- return n.reduce((i, o) => _t(i, o), e);
|
|
|
|
|
-}
|
|
|
|
|
-function Ma(e, t) {
|
|
|
|
|
- let n = {};
|
|
|
|
|
- return t.forEach((r) => {
|
|
|
|
|
- const i = ea(e, r);
|
|
|
|
|
- n = ta(n, r, i);
|
|
|
|
|
- }), n;
|
|
|
|
|
-}
|
|
|
|
|
-function ra(e, t) {
|
|
|
|
|
- return !e || !t || e.length !== t.length ? !1 : e.every((n, r) => t[r] === n);
|
|
|
|
|
-}
|
|
|
|
|
-const L = "'${name}' is not a valid ${type}", jt = {
|
|
|
|
|
- default: "Validation error on field '${name}'",
|
|
|
|
|
- required: "'${name}' is required",
|
|
|
|
|
- enum: "'${name}' must be one of [${enum}]",
|
|
|
|
|
- whitespace: "'${name}' cannot be empty",
|
|
|
|
|
- date: {
|
|
|
|
|
- format: "'${name}' is invalid for format date",
|
|
|
|
|
- parse: "'${name}' could not be parsed as date",
|
|
|
|
|
- invalid: "'${name}' is invalid date"
|
|
|
|
|
- },
|
|
|
|
|
- types: {
|
|
|
|
|
- string: L,
|
|
|
|
|
- method: L,
|
|
|
|
|
- array: L,
|
|
|
|
|
- object: L,
|
|
|
|
|
- number: L,
|
|
|
|
|
- date: L,
|
|
|
|
|
- boolean: L,
|
|
|
|
|
- integer: L,
|
|
|
|
|
- float: L,
|
|
|
|
|
- regexp: L,
|
|
|
|
|
- email: L,
|
|
|
|
|
- url: L,
|
|
|
|
|
- hex: L
|
|
|
|
|
- },
|
|
|
|
|
- string: {
|
|
|
|
|
- len: "'${name}' must be exactly ${len} characters",
|
|
|
|
|
- min: "'${name}' must be at least ${min} characters",
|
|
|
|
|
- max: "'${name}' cannot be longer than ${max} characters",
|
|
|
|
|
- range: "'${name}' must be between ${min} and ${max} characters"
|
|
|
|
|
- },
|
|
|
|
|
- number: {
|
|
|
|
|
- len: "'${name}' must equal ${len}",
|
|
|
|
|
- min: "'${name}' cannot be less than ${min}",
|
|
|
|
|
- max: "'${name}' cannot be greater than ${max}",
|
|
|
|
|
- range: "'${name}' must be between ${min} and ${max}"
|
|
|
|
|
- },
|
|
|
|
|
- array: {
|
|
|
|
|
- len: "'${name}' must be exactly ${len} in length",
|
|
|
|
|
- min: "'${name}' cannot be less than ${min} in length",
|
|
|
|
|
- max: "'${name}' cannot be greater than ${max} in length",
|
|
|
|
|
- range: "'${name}' must be between ${min} and ${max} in length"
|
|
|
|
|
- },
|
|
|
|
|
- pattern: {
|
|
|
|
|
- mismatch: "'${name}' does not match pattern ${pattern}"
|
|
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
-var ve = function(e, t, n, r) {
|
|
|
|
|
- function i(o) {
|
|
|
|
|
- return o instanceof n ? o : new n(function(a) {
|
|
|
|
|
- a(o);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- return new (n || (n = Promise))(function(o, a) {
|
|
|
|
|
- function l(f) {
|
|
|
|
|
- try {
|
|
|
|
|
- m(r.next(f));
|
|
|
|
|
- } catch (d) {
|
|
|
|
|
- a(d);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- function s(f) {
|
|
|
|
|
- try {
|
|
|
|
|
- m(r.throw(f));
|
|
|
|
|
- } catch (d) {
|
|
|
|
|
- a(d);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- function m(f) {
|
|
|
|
|
- f.done ? o(f.value) : i(f.value).then(l, s);
|
|
|
|
|
- }
|
|
|
|
|
- m((r = r.apply(e, t || [])).next());
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-const ia = ie;
|
|
|
|
|
-function aa(e, t) {
|
|
|
|
|
- return e.replace(/\$\{\w+\}/g, (n) => {
|
|
|
|
|
- const r = n.slice(2, -1);
|
|
|
|
|
- return t[r];
|
|
|
|
|
- });
|
|
|
|
|
-}
|
|
|
|
|
-function Te(e, t, n, r, i) {
|
|
|
|
|
- return ve(this, void 0, void 0, function* () {
|
|
|
|
|
- const o = C({}, n);
|
|
|
|
|
- delete o.ruleIndex, delete o.trigger;
|
|
|
|
|
- let a = null;
|
|
|
|
|
- o && o.type === "array" && o.defaultField && (a = o.defaultField, delete o.defaultField);
|
|
|
|
|
- const l = new ia({
|
|
|
|
|
- [e]: [o]
|
|
|
|
|
- }), s = na({}, jt, r.validateMessages);
|
|
|
|
|
- l.messages(s);
|
|
|
|
|
- let m = [];
|
|
|
|
|
- try {
|
|
|
|
|
- yield Promise.resolve(l.validate({
|
|
|
|
|
- [e]: t
|
|
|
|
|
- }, C({}, r)));
|
|
|
|
|
- } catch (g) {
|
|
|
|
|
- g.errors ? m = g.errors.map((y, x) => {
|
|
|
|
|
- let {
|
|
|
|
|
- message: u
|
|
|
|
|
- } = y;
|
|
|
|
|
- return (
|
|
|
|
|
- // Wrap VueNode with `key`
|
|
|
|
|
- Yt(u) ? dn(u, {
|
|
|
|
|
- key: `error_${x}`
|
|
|
|
|
- }) : u
|
|
|
|
|
- );
|
|
|
|
|
- }) : (console.error(g), m = [s.default()]);
|
|
|
|
|
- }
|
|
|
|
|
- if (!m.length && a)
|
|
|
|
|
- return (yield Promise.all(t.map((y, x) => Te(`${e}.${x}`, y, a, r, i)))).reduce((y, x) => [...y, ...x], []);
|
|
|
|
|
- const f = C(C(C({}, n), {
|
|
|
|
|
- name: e,
|
|
|
|
|
- enum: (n.enum || []).join(", ")
|
|
|
|
|
- }), i);
|
|
|
|
|
- return m.map((g) => typeof g == "string" ? aa(g, f) : g);
|
|
|
|
|
- });
|
|
|
|
|
-}
|
|
|
|
|
-function oa(e, t, n, r, i, o) {
|
|
|
|
|
- const a = e.join("."), l = n.map((m, f) => {
|
|
|
|
|
- const d = m.validator, g = C(C({}, m), {
|
|
|
|
|
- ruleIndex: f
|
|
|
|
|
- });
|
|
|
|
|
- return d && (g.validator = (y, x, u) => {
|
|
|
|
|
- let v = !1;
|
|
|
|
|
- const w = d(y, x, function() {
|
|
|
|
|
- for (var h = arguments.length, $ = new Array(h), A = 0; A < h; A++)
|
|
|
|
|
- $[A] = arguments[A];
|
|
|
|
|
- Promise.resolve().then(() => {
|
|
|
|
|
- we(!v, "Your validator function has already return a promise. `callback` will be ignored."), v || u(...$);
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- v = w && typeof w.then == "function" && typeof w.catch == "function", we(v, "`callback` is deprecated. Please return a promise instead."), v && w.then(() => {
|
|
|
|
|
- u();
|
|
|
|
|
- }).catch((h) => {
|
|
|
|
|
- u(h || " ");
|
|
|
|
|
- });
|
|
|
|
|
- }), g;
|
|
|
|
|
- }).sort((m, f) => {
|
|
|
|
|
- let {
|
|
|
|
|
- warningOnly: d,
|
|
|
|
|
- ruleIndex: g
|
|
|
|
|
- } = m, {
|
|
|
|
|
- warningOnly: y,
|
|
|
|
|
- ruleIndex: x
|
|
|
|
|
- } = f;
|
|
|
|
|
- return !!d == !!y ? g - x : d ? 1 : -1;
|
|
|
|
|
- });
|
|
|
|
|
- let s;
|
|
|
|
|
- if (i === !0)
|
|
|
|
|
- s = new Promise((m, f) => ve(this, void 0, void 0, function* () {
|
|
|
|
|
- for (let d = 0; d < l.length; d += 1) {
|
|
|
|
|
- const g = l[d], y = yield Te(a, t, g, r, o);
|
|
|
|
|
- if (y.length) {
|
|
|
|
|
- f([{
|
|
|
|
|
- errors: y,
|
|
|
|
|
- rule: g
|
|
|
|
|
- }]);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- m([]);
|
|
|
|
|
- }));
|
|
|
|
|
- else {
|
|
|
|
|
- const m = l.map((f) => Te(a, t, f, r, o).then((d) => ({
|
|
|
|
|
- errors: d,
|
|
|
|
|
- rule: f
|
|
|
|
|
- })));
|
|
|
|
|
- s = (i ? sa(m) : la(m)).then((f) => Promise.reject(f));
|
|
|
|
|
- }
|
|
|
|
|
- return s.catch((m) => m), s;
|
|
|
|
|
-}
|
|
|
|
|
-function la(e) {
|
|
|
|
|
- return ve(this, void 0, void 0, function* () {
|
|
|
|
|
- return Promise.all(e).then((t) => [].concat(...t));
|
|
|
|
|
- });
|
|
|
|
|
-}
|
|
|
|
|
-function sa(e) {
|
|
|
|
|
- return ve(this, void 0, void 0, function* () {
|
|
|
|
|
- let t = 0;
|
|
|
|
|
- return new Promise((n) => {
|
|
|
|
|
- e.forEach((r) => {
|
|
|
|
|
- r.then((i) => {
|
|
|
|
|
- i.errors.length && n([i]), t += 1, t === e.length && n([]);
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
-}
|
|
|
|
|
-const Mt = Symbol("formContextKey"), fa = (e) => {
|
|
|
|
|
- gt(Mt, e);
|
|
|
|
|
-}, Me = () => mt(Mt, {
|
|
|
|
|
- name: F(() => {
|
|
|
|
|
- }),
|
|
|
|
|
- labelAlign: F(() => "right"),
|
|
|
|
|
- vertical: F(() => !1),
|
|
|
|
|
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
|
|
- addField: (e, t) => {
|
|
|
|
|
- },
|
|
|
|
|
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
|
|
- removeField: (e) => {
|
|
|
|
|
- },
|
|
|
|
|
- model: F(() => {
|
|
|
|
|
- }),
|
|
|
|
|
- rules: F(() => {
|
|
|
|
|
- }),
|
|
|
|
|
- colon: F(() => {
|
|
|
|
|
- }),
|
|
|
|
|
- labelWrap: F(() => {
|
|
|
|
|
- }),
|
|
|
|
|
- labelCol: F(() => {
|
|
|
|
|
- }),
|
|
|
|
|
- requiredMark: F(() => !1),
|
|
|
|
|
- validateTrigger: F(() => {
|
|
|
|
|
- }),
|
|
|
|
|
- onValidate: () => {
|
|
|
|
|
- },
|
|
|
|
|
- validateMessages: F(() => jt)
|
|
|
|
|
-}), Rt = Symbol("formItemPrefixContextKey"), ua = (e) => {
|
|
|
|
|
- gt(Rt, e);
|
|
|
|
|
-}, ca = () => mt(Rt, {
|
|
|
|
|
- prefixCls: F(() => "")
|
|
|
|
|
-}), Re = (e, t) => {
|
|
|
|
|
- let {
|
|
|
|
|
- slots: n,
|
|
|
|
|
- emit: r,
|
|
|
|
|
- attrs: i
|
|
|
|
|
- } = t;
|
|
|
|
|
- var o, a, l, s, m;
|
|
|
|
|
- const {
|
|
|
|
|
- prefixCls: f,
|
|
|
|
|
- htmlFor: d,
|
|
|
|
|
- labelCol: g,
|
|
|
|
|
- labelAlign: y,
|
|
|
|
|
- colon: x,
|
|
|
|
|
- required: u,
|
|
|
|
|
- requiredMark: v
|
|
|
|
|
- } = C(C({}, e), i), [c] = Zt("Form"), w = (o = e.label) !== null && o !== void 0 ? o : (a = n.label) === null || a === void 0 ? void 0 : a.call(n);
|
|
|
|
|
- if (!w) return null;
|
|
|
|
|
- const {
|
|
|
|
|
- vertical: h,
|
|
|
|
|
- labelAlign: $,
|
|
|
|
|
- labelCol: A,
|
|
|
|
|
- labelWrap: T,
|
|
|
|
|
- colon: I
|
|
|
|
|
- } = Me(), R = g || (A == null ? void 0 : A.value) || {}, D = y || ($ == null ? void 0 : $.value), H = `${f}-item-label`, z = ce(H, D === "left" && `${H}-left`, R.class, {
|
|
|
|
|
- [`${H}-wrap`]: !!T.value
|
|
|
|
|
- });
|
|
|
|
|
- let q = w;
|
|
|
|
|
- const j = x === !0 || (I == null ? void 0 : I.value) !== !1 && x !== !1;
|
|
|
|
|
- if (j && !h.value && typeof w == "string" && w.trim() !== "" && (q = w.replace(/[:|:]\s*$/, "")), e.tooltip || n.tooltip) {
|
|
|
|
|
- const K = S("span", {
|
|
|
|
|
- class: `${f}-item-tooltip`
|
|
|
|
|
- }, [S(Jt, {
|
|
|
|
|
- title: e.tooltip
|
|
|
|
|
- }, {
|
|
|
|
|
- default: () => [S(Qt, null, null)]
|
|
|
|
|
- })]);
|
|
|
|
|
- q = S(de, null, [q, n.tooltip ? (l = n.tooltip) === null || l === void 0 ? void 0 : l.call(n, {
|
|
|
|
|
- class: `${f}-item-tooltip`
|
|
|
|
|
- }) : K]);
|
|
|
|
|
- }
|
|
|
|
|
- v === "optional" && !u && (q = S(de, null, [q, S("span", {
|
|
|
|
|
- class: `${f}-item-optional`
|
|
|
|
|
- }, [((s = c.value) === null || s === void 0 ? void 0 : s.optional) || ((m = kt.Form) === null || m === void 0 ? void 0 : m.optional)])]));
|
|
|
|
|
- const he = ce({
|
|
|
|
|
- [`${f}-item-required`]: u,
|
|
|
|
|
- [`${f}-item-required-mark-optional`]: v === "optional",
|
|
|
|
|
- [`${f}-item-no-colon`]: !j
|
|
|
|
|
- });
|
|
|
|
|
- return S(xt, N(N({}, R), {}, {
|
|
|
|
|
- class: z
|
|
|
|
|
- }), {
|
|
|
|
|
- default: () => [S("label", {
|
|
|
|
|
- for: d,
|
|
|
|
|
- class: he,
|
|
|
|
|
- title: typeof w == "string" ? w : "",
|
|
|
|
|
- onClick: (K) => r("click", K)
|
|
|
|
|
- }, [q])]
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-Re.displayName = "FormItemLabel";
|
|
|
|
|
-Re.inheritAttrs = !1;
|
|
|
|
|
-const da = (e) => {
|
|
|
|
|
- const {
|
|
|
|
|
- componentCls: t
|
|
|
|
|
- } = e, n = `${t}-show-help`, r = `${t}-show-help-item`;
|
|
|
|
|
- return {
|
|
|
|
|
- [n]: {
|
|
|
|
|
- // Explain holder
|
|
|
|
|
- transition: `opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`,
|
|
|
|
|
- "&-appear, &-enter": {
|
|
|
|
|
- opacity: 0,
|
|
|
|
|
- "&-active": {
|
|
|
|
|
- opacity: 1
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- "&-leave": {
|
|
|
|
|
- opacity: 1,
|
|
|
|
|
- "&-active": {
|
|
|
|
|
- opacity: 0
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // Explain
|
|
|
|
|
- [r]: {
|
|
|
|
|
- overflow: "hidden",
|
|
|
|
|
- transition: `height ${e.motionDurationSlow} ${e.motionEaseInOut},
|
|
|
|
|
- opacity ${e.motionDurationSlow} ${e.motionEaseInOut},
|
|
|
|
|
- transform ${e.motionDurationSlow} ${e.motionEaseInOut} !important`,
|
|
|
|
|
- [`&${r}-appear, &${r}-enter`]: {
|
|
|
|
|
- transform: "translateY(-5px)",
|
|
|
|
|
- opacity: 0,
|
|
|
|
|
- "&-active": {
|
|
|
|
|
- transform: "translateY(0)",
|
|
|
|
|
- opacity: 1
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- [`&${r}-leave-active`]: {
|
|
|
|
|
- transform: "translateY(-5px)"
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-}, ma = (e) => ({
|
|
|
|
|
- legend: {
|
|
|
|
|
- display: "block",
|
|
|
|
|
- width: "100%",
|
|
|
|
|
- marginBottom: e.marginLG,
|
|
|
|
|
- padding: 0,
|
|
|
|
|
- color: e.colorTextDescription,
|
|
|
|
|
- fontSize: e.fontSizeLG,
|
|
|
|
|
- lineHeight: "inherit",
|
|
|
|
|
- border: 0,
|
|
|
|
|
- borderBottom: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}`
|
|
|
|
|
- },
|
|
|
|
|
- label: {
|
|
|
|
|
- fontSize: e.fontSize
|
|
|
|
|
- },
|
|
|
|
|
- 'input[type="search"]': {
|
|
|
|
|
- boxSizing: "border-box"
|
|
|
|
|
- },
|
|
|
|
|
- // Position radios and checkboxes better
|
|
|
|
|
- 'input[type="radio"], input[type="checkbox"]': {
|
|
|
|
|
- lineHeight: "normal"
|
|
|
|
|
- },
|
|
|
|
|
- 'input[type="file"]': {
|
|
|
|
|
- display: "block"
|
|
|
|
|
- },
|
|
|
|
|
- // Make range inputs behave like textual form controls
|
|
|
|
|
- 'input[type="range"]': {
|
|
|
|
|
- display: "block",
|
|
|
|
|
- width: "100%"
|
|
|
|
|
- },
|
|
|
|
|
- // Make multiple select elements height not fixed
|
|
|
|
|
- "select[multiple], select[size]": {
|
|
|
|
|
- height: "auto"
|
|
|
|
|
- },
|
|
|
|
|
- // Focus for file, radio, and checkbox
|
|
|
|
|
- "input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus": {
|
|
|
|
|
- outline: 0,
|
|
|
|
|
- boxShadow: `0 0 0 ${e.controlOutlineWidth}px ${e.controlOutline}`
|
|
|
|
|
- },
|
|
|
|
|
- // Adjust output element
|
|
|
|
|
- output: {
|
|
|
|
|
- display: "block",
|
|
|
|
|
- paddingTop: 15,
|
|
|
|
|
- color: e.colorText,
|
|
|
|
|
- fontSize: e.fontSize,
|
|
|
|
|
- lineHeight: e.lineHeight
|
|
|
|
|
- }
|
|
|
|
|
-}), et = (e, t) => {
|
|
|
|
|
- const {
|
|
|
|
|
- formItemCls: n
|
|
|
|
|
- } = e;
|
|
|
|
|
- return {
|
|
|
|
|
- [n]: {
|
|
|
|
|
- [`${n}-label > label`]: {
|
|
|
|
|
- height: t
|
|
|
|
|
- },
|
|
|
|
|
- [`${n}-control-input`]: {
|
|
|
|
|
- minHeight: t
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-}, ga = (e) => {
|
|
|
|
|
- const {
|
|
|
|
|
- componentCls: t
|
|
|
|
|
- } = e;
|
|
|
|
|
- return {
|
|
|
|
|
- [e.componentCls]: C(C(C({}, ut(e)), ma(e)), {
|
|
|
|
|
- [`${t}-text`]: {
|
|
|
|
|
- display: "inline-block",
|
|
|
|
|
- paddingInlineEnd: e.paddingSM
|
|
|
|
|
- },
|
|
|
|
|
- // ================================================================
|
|
|
|
|
- // = Size =
|
|
|
|
|
- // ================================================================
|
|
|
|
|
- "&-small": C({}, et(e, e.controlHeightSM)),
|
|
|
|
|
- "&-large": C({}, et(e, e.controlHeightLG))
|
|
|
|
|
- })
|
|
|
|
|
- };
|
|
|
|
|
-}, pa = (e) => {
|
|
|
|
|
- const {
|
|
|
|
|
- formItemCls: t,
|
|
|
|
|
- iconCls: n,
|
|
|
|
|
- componentCls: r,
|
|
|
|
|
- rootPrefixCls: i
|
|
|
|
|
- } = e;
|
|
|
|
|
- return {
|
|
|
|
|
- [t]: C(C({}, ut(e)), {
|
|
|
|
|
- marginBottom: e.marginLG,
|
|
|
|
|
- verticalAlign: "top",
|
|
|
|
|
- "&-with-help": {
|
|
|
|
|
- transition: "none"
|
|
|
|
|
- },
|
|
|
|
|
- [`&-hidden,
|
|
|
|
|
- &-hidden.${i}-row`]: {
|
|
|
|
|
- // https://github.com/ant-design/ant-design/issues/26141
|
|
|
|
|
- display: "none"
|
|
|
|
|
- },
|
|
|
|
|
- "&-has-warning": {
|
|
|
|
|
- [`${t}-split`]: {
|
|
|
|
|
- color: e.colorError
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- "&-has-error": {
|
|
|
|
|
- [`${t}-split`]: {
|
|
|
|
|
- color: e.colorWarning
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // ==============================================================
|
|
|
|
|
- // = Label =
|
|
|
|
|
- // ==============================================================
|
|
|
|
|
- [`${t}-label`]: {
|
|
|
|
|
- display: "inline-block",
|
|
|
|
|
- flexGrow: 0,
|
|
|
|
|
- overflow: "hidden",
|
|
|
|
|
- whiteSpace: "nowrap",
|
|
|
|
|
- textAlign: "end",
|
|
|
|
|
- verticalAlign: "middle",
|
|
|
|
|
- "&-left": {
|
|
|
|
|
- textAlign: "start"
|
|
|
|
|
- },
|
|
|
|
|
- "&-wrap": {
|
|
|
|
|
- overflow: "unset",
|
|
|
|
|
- lineHeight: `${e.lineHeight} - 0.25em`,
|
|
|
|
|
- whiteSpace: "unset"
|
|
|
|
|
- },
|
|
|
|
|
- "> label": {
|
|
|
|
|
- position: "relative",
|
|
|
|
|
- display: "inline-flex",
|
|
|
|
|
- alignItems: "center",
|
|
|
|
|
- maxWidth: "100%",
|
|
|
|
|
- height: e.controlHeight,
|
|
|
|
|
- color: e.colorTextHeading,
|
|
|
|
|
- fontSize: e.fontSize,
|
|
|
|
|
- [`> ${n}`]: {
|
|
|
|
|
- fontSize: e.fontSize,
|
|
|
|
|
- verticalAlign: "top"
|
|
|
|
|
- },
|
|
|
|
|
- // Required mark
|
|
|
|
|
- [`&${t}-required:not(${t}-required-mark-optional)::before`]: {
|
|
|
|
|
- display: "inline-block",
|
|
|
|
|
- marginInlineEnd: e.marginXXS,
|
|
|
|
|
- color: e.colorError,
|
|
|
|
|
- fontSize: e.fontSize,
|
|
|
|
|
- fontFamily: "SimSun, sans-serif",
|
|
|
|
|
- lineHeight: 1,
|
|
|
|
|
- content: '"*"',
|
|
|
|
|
- [`${r}-hide-required-mark &`]: {
|
|
|
|
|
- display: "none"
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // Optional mark
|
|
|
|
|
- [`${t}-optional`]: {
|
|
|
|
|
- display: "inline-block",
|
|
|
|
|
- marginInlineStart: e.marginXXS,
|
|
|
|
|
- color: e.colorTextDescription,
|
|
|
|
|
- [`${r}-hide-required-mark &`]: {
|
|
|
|
|
- display: "none"
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // Optional mark
|
|
|
|
|
- [`${t}-tooltip`]: {
|
|
|
|
|
- color: e.colorTextDescription,
|
|
|
|
|
- cursor: "help",
|
|
|
|
|
- writingMode: "horizontal-tb",
|
|
|
|
|
- marginInlineStart: e.marginXXS
|
|
|
|
|
- },
|
|
|
|
|
- "&::after": {
|
|
|
|
|
- content: '":"',
|
|
|
|
|
- position: "relative",
|
|
|
|
|
- marginBlock: 0,
|
|
|
|
|
- marginInlineStart: e.marginXXS / 2,
|
|
|
|
|
- marginInlineEnd: e.marginXS
|
|
|
|
|
- },
|
|
|
|
|
- [`&${t}-no-colon::after`]: {
|
|
|
|
|
- content: '" "'
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // ==============================================================
|
|
|
|
|
- // = Input =
|
|
|
|
|
- // ==============================================================
|
|
|
|
|
- [`${t}-control`]: {
|
|
|
|
|
- display: "flex",
|
|
|
|
|
- flexDirection: "column",
|
|
|
|
|
- flexGrow: 1,
|
|
|
|
|
- [`&:first-child:not([class^="'${i}-col-'"]):not([class*="' ${i}-col-'"])`]: {
|
|
|
|
|
- width: "100%"
|
|
|
|
|
- },
|
|
|
|
|
- "&-input": {
|
|
|
|
|
- position: "relative",
|
|
|
|
|
- display: "flex",
|
|
|
|
|
- alignItems: "center",
|
|
|
|
|
- minHeight: e.controlHeight,
|
|
|
|
|
- "&-content": {
|
|
|
|
|
- flex: "auto",
|
|
|
|
|
- maxWidth: "100%"
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // ==============================================================
|
|
|
|
|
- // = Explain =
|
|
|
|
|
- // ==============================================================
|
|
|
|
|
- [t]: {
|
|
|
|
|
- "&-explain, &-extra": {
|
|
|
|
|
- clear: "both",
|
|
|
|
|
- color: e.colorTextDescription,
|
|
|
|
|
- fontSize: e.fontSize,
|
|
|
|
|
- lineHeight: e.lineHeight
|
|
|
|
|
- },
|
|
|
|
|
- "&-explain-connected": {
|
|
|
|
|
- width: "100%"
|
|
|
|
|
- },
|
|
|
|
|
- "&-extra": {
|
|
|
|
|
- minHeight: e.controlHeightSM,
|
|
|
|
|
- transition: `color ${e.motionDurationMid} ${e.motionEaseOut}`
|
|
|
|
|
- // sync input color transition
|
|
|
|
|
- },
|
|
|
|
|
- "&-explain": {
|
|
|
|
|
- "&-error": {
|
|
|
|
|
- color: e.colorError
|
|
|
|
|
- },
|
|
|
|
|
- "&-warning": {
|
|
|
|
|
- color: e.colorWarning
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- [`&-with-help ${t}-explain`]: {
|
|
|
|
|
- height: "auto",
|
|
|
|
|
- opacity: 1
|
|
|
|
|
- },
|
|
|
|
|
- // ==============================================================
|
|
|
|
|
- // = Feedback Icon =
|
|
|
|
|
- // ==============================================================
|
|
|
|
|
- [`${t}-feedback-icon`]: {
|
|
|
|
|
- fontSize: e.fontSize,
|
|
|
|
|
- textAlign: "center",
|
|
|
|
|
- visibility: "visible",
|
|
|
|
|
- animationName: ft,
|
|
|
|
|
- animationDuration: e.motionDurationMid,
|
|
|
|
|
- animationTimingFunction: e.motionEaseOutBack,
|
|
|
|
|
- pointerEvents: "none",
|
|
|
|
|
- "&-success": {
|
|
|
|
|
- color: e.colorSuccess
|
|
|
|
|
- },
|
|
|
|
|
- "&-error": {
|
|
|
|
|
- color: e.colorError
|
|
|
|
|
- },
|
|
|
|
|
- "&-warning": {
|
|
|
|
|
- color: e.colorWarning
|
|
|
|
|
- },
|
|
|
|
|
- "&-validating": {
|
|
|
|
|
- color: e.colorPrimary
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- };
|
|
|
|
|
-}, va = (e) => {
|
|
|
|
|
- const {
|
|
|
|
|
- componentCls: t,
|
|
|
|
|
- formItemCls: n,
|
|
|
|
|
- rootPrefixCls: r
|
|
|
|
|
- } = e;
|
|
|
|
|
- return {
|
|
|
|
|
- [`${t}-horizontal`]: {
|
|
|
|
|
- [`${n}-label`]: {
|
|
|
|
|
- flexGrow: 0
|
|
|
|
|
- },
|
|
|
|
|
- [`${n}-control`]: {
|
|
|
|
|
- flex: "1 1 0",
|
|
|
|
|
- // https://github.com/ant-design/ant-design/issues/32777
|
|
|
|
|
- // https://github.com/ant-design/ant-design/issues/33773
|
|
|
|
|
- minWidth: 0
|
|
|
|
|
- },
|
|
|
|
|
- // https://github.com/ant-design/ant-design/issues/32980
|
|
|
|
|
- [`${n}-label.${r}-col-24 + ${n}-control`]: {
|
|
|
|
|
- minWidth: "unset"
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-}, ha = (e) => {
|
|
|
|
|
- const {
|
|
|
|
|
- componentCls: t,
|
|
|
|
|
- formItemCls: n
|
|
|
|
|
- } = e;
|
|
|
|
|
- return {
|
|
|
|
|
- [`${t}-inline`]: {
|
|
|
|
|
- display: "flex",
|
|
|
|
|
- flexWrap: "wrap",
|
|
|
|
|
- [n]: {
|
|
|
|
|
- flex: "none",
|
|
|
|
|
- flexWrap: "nowrap",
|
|
|
|
|
- marginInlineEnd: e.margin,
|
|
|
|
|
- marginBottom: 0,
|
|
|
|
|
- "&-with-help": {
|
|
|
|
|
- marginBottom: e.marginLG
|
|
|
|
|
- },
|
|
|
|
|
- [`> ${n}-label,
|
|
|
|
|
- > ${n}-control`]: {
|
|
|
|
|
- display: "inline-block",
|
|
|
|
|
- verticalAlign: "top"
|
|
|
|
|
- },
|
|
|
|
|
- [`> ${n}-label`]: {
|
|
|
|
|
- flex: "none"
|
|
|
|
|
- },
|
|
|
|
|
- [`${t}-text`]: {
|
|
|
|
|
- display: "inline-block"
|
|
|
|
|
- },
|
|
|
|
|
- [`${n}-has-feedback`]: {
|
|
|
|
|
- display: "inline-block"
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-}, Z = (e) => ({
|
|
|
|
|
- margin: 0,
|
|
|
|
|
- padding: `0 0 ${e.paddingXS}px`,
|
|
|
|
|
- whiteSpace: "initial",
|
|
|
|
|
- textAlign: "start",
|
|
|
|
|
- "> label": {
|
|
|
|
|
- margin: 0,
|
|
|
|
|
- "&::after": {
|
|
|
|
|
- display: "none"
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}), ya = (e) => {
|
|
|
|
|
- const {
|
|
|
|
|
- componentCls: t,
|
|
|
|
|
- formItemCls: n
|
|
|
|
|
- } = e;
|
|
|
|
|
- return {
|
|
|
|
|
- [`${n} ${n}-label`]: Z(e),
|
|
|
|
|
- [t]: {
|
|
|
|
|
- [n]: {
|
|
|
|
|
- flexWrap: "wrap",
|
|
|
|
|
- [`${n}-label,
|
|
|
|
|
- ${n}-control`]: {
|
|
|
|
|
- flex: "0 0 100%",
|
|
|
|
|
- maxWidth: "100%"
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-}, ba = (e) => {
|
|
|
|
|
- const {
|
|
|
|
|
- componentCls: t,
|
|
|
|
|
- formItemCls: n,
|
|
|
|
|
- rootPrefixCls: r
|
|
|
|
|
- } = e;
|
|
|
|
|
- return {
|
|
|
|
|
- [`${t}-vertical`]: {
|
|
|
|
|
- [n]: {
|
|
|
|
|
- "&-row": {
|
|
|
|
|
- flexDirection: "column"
|
|
|
|
|
- },
|
|
|
|
|
- "&-label > label": {
|
|
|
|
|
- height: "auto"
|
|
|
|
|
- },
|
|
|
|
|
- [`${t}-item-control`]: {
|
|
|
|
|
- width: "100%"
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- [`${t}-vertical ${n}-label,
|
|
|
|
|
- .${r}-col-24${n}-label,
|
|
|
|
|
- .${r}-col-xl-24${n}-label`]: Z(e),
|
|
|
|
|
- [`@media (max-width: ${e.screenXSMax}px)`]: [ya(e), {
|
|
|
|
|
- [t]: {
|
|
|
|
|
- [`.${r}-col-xs-24${n}-label`]: Z(e)
|
|
|
|
|
- }
|
|
|
|
|
- }],
|
|
|
|
|
- [`@media (max-width: ${e.screenSMMax}px)`]: {
|
|
|
|
|
- [t]: {
|
|
|
|
|
- [`.${r}-col-sm-24${n}-label`]: Z(e)
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- [`@media (max-width: ${e.screenMDMax}px)`]: {
|
|
|
|
|
- [t]: {
|
|
|
|
|
- [`.${r}-col-md-24${n}-label`]: Z(e)
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- [`@media (max-width: ${e.screenLGMax}px)`]: {
|
|
|
|
|
- [t]: {
|
|
|
|
|
- [`.${r}-col-lg-24${n}-label`]: Z(e)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-}, Nt = en("Form", (e, t) => {
|
|
|
|
|
- let {
|
|
|
|
|
- rootPrefixCls: n
|
|
|
|
|
- } = t;
|
|
|
|
|
- const r = tn(e, {
|
|
|
|
|
- formItemCls: `${e.componentCls}-item`,
|
|
|
|
|
- rootPrefixCls: n
|
|
|
|
|
- });
|
|
|
|
|
- return [ga(r), pa(r), da(r), va(r), ha(r), ba(r), nn(r), ft];
|
|
|
|
|
-}), xa = Pe({
|
|
|
|
|
- compatConfig: {
|
|
|
|
|
- MODE: 3
|
|
|
|
|
- },
|
|
|
|
|
- name: "ErrorList",
|
|
|
|
|
- inheritAttrs: !1,
|
|
|
|
|
- props: ["errors", "help", "onErrorVisibleChanged", "helpStatus", "warnings"],
|
|
|
|
|
- setup(e, t) {
|
|
|
|
|
- let {
|
|
|
|
|
- attrs: n
|
|
|
|
|
- } = t;
|
|
|
|
|
- const {
|
|
|
|
|
- prefixCls: r,
|
|
|
|
|
- status: i
|
|
|
|
|
- } = ca(), o = F(() => `${r.value}-item-explain`), a = F(() => !!(e.errors && e.errors.length)), l = mn(i.value), [, s] = Nt(r);
|
|
|
|
|
- return Fe([a, i], () => {
|
|
|
|
|
- a.value && (l.value = i.value);
|
|
|
|
|
- }), () => {
|
|
|
|
|
- var m, f;
|
|
|
|
|
- const d = rn(`${r.value}-show-help-item`), g = an(`${r.value}-show-help-item`, d);
|
|
|
|
|
- return g.role = "alert", g.class = [s.value, o.value, n.class, `${r.value}-show-help`], S(gn, N(N({}, on(`${r.value}-show-help`)), {}, {
|
|
|
|
|
- onAfterEnter: () => e.onErrorVisibleChanged(!0),
|
|
|
|
|
- onAfterLeave: () => e.onErrorVisibleChanged(!1)
|
|
|
|
|
- }), {
|
|
|
|
|
- default: () => [pn(S(vn, N(N({}, g), {}, {
|
|
|
|
|
- tag: "div"
|
|
|
|
|
- }), {
|
|
|
|
|
- default: () => [(f = e.errors) === null || f === void 0 ? void 0 : f.map((y, x) => S("div", {
|
|
|
|
|
- key: x,
|
|
|
|
|
- class: l.value ? `${o.value}-${l.value}` : ""
|
|
|
|
|
- }, [y]))]
|
|
|
|
|
- }), [[hn, !!(!((m = e.errors) === null || m === void 0) && m.length)]])]
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-}), $a = Pe({
|
|
|
|
|
- compatConfig: {
|
|
|
|
|
- MODE: 3
|
|
|
|
|
- },
|
|
|
|
|
- slots: Object,
|
|
|
|
|
- inheritAttrs: !1,
|
|
|
|
|
- props: ["prefixCls", "errors", "hasFeedback", "onDomErrorVisibleChange", "wrapperCol", "help", "extra", "status", "marginBottom", "onErrorVisibleChanged"],
|
|
|
|
|
- setup(e, t) {
|
|
|
|
|
- let {
|
|
|
|
|
- slots: n
|
|
|
|
|
- } = t;
|
|
|
|
|
- const r = Me(), {
|
|
|
|
|
- wrapperCol: i
|
|
|
|
|
- } = r, o = C({}, r);
|
|
|
|
|
- return delete o.labelCol, delete o.wrapperCol, fa(o), ua({
|
|
|
|
|
- prefixCls: F(() => e.prefixCls),
|
|
|
|
|
- status: F(() => e.status)
|
|
|
|
|
- }), () => {
|
|
|
|
|
- var a, l, s;
|
|
|
|
|
- const {
|
|
|
|
|
- prefixCls: m,
|
|
|
|
|
- wrapperCol: f,
|
|
|
|
|
- marginBottom: d,
|
|
|
|
|
- onErrorVisibleChanged: g,
|
|
|
|
|
- help: y = (a = n.help) === null || a === void 0 ? void 0 : a.call(n),
|
|
|
|
|
- errors: x = ct((l = n.errors) === null || l === void 0 ? void 0 : l.call(n)),
|
|
|
|
|
- // hasFeedback,
|
|
|
|
|
- // status,
|
|
|
|
|
- extra: u = (s = n.extra) === null || s === void 0 ? void 0 : s.call(n)
|
|
|
|
|
- } = e, v = `${m}-item`, c = f || (i == null ? void 0 : i.value) || {}, w = ce(`${v}-control`, c.class);
|
|
|
|
|
- return S(xt, N(N({}, c), {}, {
|
|
|
|
|
- class: w
|
|
|
|
|
- }), {
|
|
|
|
|
- default: () => {
|
|
|
|
|
- var h;
|
|
|
|
|
- return S(de, null, [S("div", {
|
|
|
|
|
- class: `${v}-control-input`
|
|
|
|
|
- }, [S("div", {
|
|
|
|
|
- class: `${v}-control-input-content`
|
|
|
|
|
- }, [(h = n.default) === null || h === void 0 ? void 0 : h.call(n)])]), d !== null || x.length ? S("div", {
|
|
|
|
|
- style: {
|
|
|
|
|
- display: "flex",
|
|
|
|
|
- flexWrap: "nowrap"
|
|
|
|
|
- }
|
|
|
|
|
- }, [S(xa, {
|
|
|
|
|
- errors: x,
|
|
|
|
|
- help: y,
|
|
|
|
|
- class: `${v}-explain-connected`,
|
|
|
|
|
- onErrorVisibleChanged: g
|
|
|
|
|
- }, null), !!d && S("div", {
|
|
|
|
|
- style: {
|
|
|
|
|
- width: 0,
|
|
|
|
|
- height: `${d}px`
|
|
|
|
|
- }
|
|
|
|
|
- }, null)]) : null, u ? S("div", {
|
|
|
|
|
- class: `${v}-extra`
|
|
|
|
|
- }, [u]) : null]);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-});
|
|
|
|
|
-function wa(e) {
|
|
|
|
|
- const t = U(e.value.slice());
|
|
|
|
|
- let n = null;
|
|
|
|
|
- return Ae(() => {
|
|
|
|
|
- clearTimeout(n), n = setTimeout(() => {
|
|
|
|
|
- t.value = e.value;
|
|
|
|
|
- }, e.value.length ? 0 : 10);
|
|
|
|
|
- }), t;
|
|
|
|
|
-}
|
|
|
|
|
-dt("success", "warning", "error", "validating", "");
|
|
|
|
|
-const Fa = {
|
|
|
|
|
- success: cn,
|
|
|
|
|
- warning: un,
|
|
|
|
|
- error: fn,
|
|
|
|
|
- validating: sn
|
|
|
|
|
-};
|
|
|
|
|
-function $e(e, t, n) {
|
|
|
|
|
- let r = e;
|
|
|
|
|
- const i = t;
|
|
|
|
|
- let o = 0;
|
|
|
|
|
- try {
|
|
|
|
|
- for (let a = i.length; o < a - 1 && !(!r && !n); ++o) {
|
|
|
|
|
- const l = i[o];
|
|
|
|
|
- if (l in r)
|
|
|
|
|
- r = r[l];
|
|
|
|
|
- else {
|
|
|
|
|
- if (n)
|
|
|
|
|
- throw Error("please transfer a valid name path to form item!");
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (n && !r)
|
|
|
|
|
- throw Error("please transfer a valid name path to form item!");
|
|
|
|
|
- } catch (a) {
|
|
|
|
|
- console.error("please transfer a valid name path to form item!");
|
|
|
|
|
- }
|
|
|
|
|
- return {
|
|
|
|
|
- o: r,
|
|
|
|
|
- k: i[o],
|
|
|
|
|
- v: r ? r[i[o]] : void 0
|
|
|
|
|
- };
|
|
|
|
|
-}
|
|
|
|
|
-const Aa = () => ({
|
|
|
|
|
- htmlFor: String,
|
|
|
|
|
- prefixCls: String,
|
|
|
|
|
- label: ae.any,
|
|
|
|
|
- help: ae.any,
|
|
|
|
|
- extra: ae.any,
|
|
|
|
|
- labelCol: {
|
|
|
|
|
- type: Object
|
|
|
|
|
- },
|
|
|
|
|
- wrapperCol: {
|
|
|
|
|
- type: Object
|
|
|
|
|
- },
|
|
|
|
|
- hasFeedback: {
|
|
|
|
|
- type: Boolean,
|
|
|
|
|
- default: !1
|
|
|
|
|
- },
|
|
|
|
|
- colon: {
|
|
|
|
|
- type: Boolean,
|
|
|
|
|
- default: void 0
|
|
|
|
|
- },
|
|
|
|
|
- labelAlign: String,
|
|
|
|
|
- prop: {
|
|
|
|
|
- type: [String, Number, Array]
|
|
|
|
|
- },
|
|
|
|
|
- name: {
|
|
|
|
|
- type: [String, Number, Array]
|
|
|
|
|
- },
|
|
|
|
|
- rules: [Array, Object],
|
|
|
|
|
- autoLink: {
|
|
|
|
|
- type: Boolean,
|
|
|
|
|
- default: !0
|
|
|
|
|
- },
|
|
|
|
|
- required: {
|
|
|
|
|
- type: Boolean,
|
|
|
|
|
- default: void 0
|
|
|
|
|
- },
|
|
|
|
|
- validateFirst: {
|
|
|
|
|
- type: Boolean,
|
|
|
|
|
- default: void 0
|
|
|
|
|
- },
|
|
|
|
|
- validateStatus: ae.oneOf(dt("", "success", "warning", "error", "validating")),
|
|
|
|
|
- validateTrigger: {
|
|
|
|
|
- type: [String, Array]
|
|
|
|
|
- },
|
|
|
|
|
- messageVariables: {
|
|
|
|
|
- type: Object
|
|
|
|
|
- },
|
|
|
|
|
- hidden: Boolean,
|
|
|
|
|
- noStyle: Boolean,
|
|
|
|
|
- tooltip: String
|
|
|
|
|
-});
|
|
|
|
|
-let Sa = 0;
|
|
|
|
|
-const Oa = "form_item", Ra = Pe({
|
|
|
|
|
- compatConfig: {
|
|
|
|
|
- MODE: 3
|
|
|
|
|
- },
|
|
|
|
|
- name: "AFormItem",
|
|
|
|
|
- inheritAttrs: !1,
|
|
|
|
|
- __ANT_NEW_FORM_ITEM: !0,
|
|
|
|
|
- props: Aa(),
|
|
|
|
|
- slots: Object,
|
|
|
|
|
- setup(e, t) {
|
|
|
|
|
- let {
|
|
|
|
|
- slots: n,
|
|
|
|
|
- attrs: r,
|
|
|
|
|
- expose: i
|
|
|
|
|
- } = t;
|
|
|
|
|
- we(e.prop === void 0, "`prop` is deprecated. Please use `name` instead.");
|
|
|
|
|
- const o = `form-item-${++Sa}`, {
|
|
|
|
|
- prefixCls: a
|
|
|
|
|
- } = ln("form", e), [l, s] = Nt(a), m = U(), f = Me(), d = F(() => e.name || e.prop), g = U([]), y = U(!1), x = U(), u = F(() => {
|
|
|
|
|
- const p = d.value;
|
|
|
|
|
- return ki(p);
|
|
|
|
|
- }), v = F(() => {
|
|
|
|
|
- if (u.value.length) {
|
|
|
|
|
- const p = f.name.value, E = u.value.join("_");
|
|
|
|
|
- return p ? `${p}_${E}` : `${Oa}_${E}`;
|
|
|
|
|
- } else
|
|
|
|
|
- return;
|
|
|
|
|
- }), c = () => {
|
|
|
|
|
- const p = f.model.value;
|
|
|
|
|
- if (!(!p || !d.value))
|
|
|
|
|
- return $e(p, u.value, !0).v;
|
|
|
|
|
- }, w = F(() => c()), h = U(ai(w.value)), $ = F(() => {
|
|
|
|
|
- let p = e.validateTrigger !== void 0 ? e.validateTrigger : f.validateTrigger.value;
|
|
|
|
|
- return p = p === void 0 ? "change" : p, fe(p);
|
|
|
|
|
- }), A = F(() => {
|
|
|
|
|
- let p = f.rules.value;
|
|
|
|
|
- const E = e.rules, _ = e.required !== void 0 ? {
|
|
|
|
|
- required: !!e.required,
|
|
|
|
|
- trigger: $.value
|
|
|
|
|
- } : [], M = $e(p, u.value);
|
|
|
|
|
- p = p ? M.o[M.k] || M.v : [];
|
|
|
|
|
- const W = [].concat(E || p || []);
|
|
|
|
|
- return xi(W, (B) => B.required) ? W : W.concat(_);
|
|
|
|
|
- }), T = F(() => {
|
|
|
|
|
- const p = A.value;
|
|
|
|
|
- let E = !1;
|
|
|
|
|
- return p && p.length && p.every((_) => _.required ? (E = !0, !1) : !0), E || e.required;
|
|
|
|
|
- }), I = U();
|
|
|
|
|
- Ae(() => {
|
|
|
|
|
- I.value = e.validateStatus;
|
|
|
|
|
- });
|
|
|
|
|
- const R = F(() => {
|
|
|
|
|
- let p = {};
|
|
|
|
|
- return typeof e.label == "string" ? p.label = e.label : e.name && (p.label = String(e.name)), e.messageVariables && (p = C(C({}, p), e.messageVariables)), p;
|
|
|
|
|
- }), D = (p) => {
|
|
|
|
|
- if (u.value.length === 0)
|
|
|
|
|
- return;
|
|
|
|
|
- const {
|
|
|
|
|
- validateFirst: E = !1
|
|
|
|
|
- } = e, {
|
|
|
|
|
- triggerName: _
|
|
|
|
|
- } = p || {};
|
|
|
|
|
- let M = A.value;
|
|
|
|
|
- if (_ && (M = M.filter((B) => {
|
|
|
|
|
- const {
|
|
|
|
|
- trigger: k
|
|
|
|
|
- } = B;
|
|
|
|
|
- return !k && !$.value.length ? !0 : fe(k || $.value).includes(_);
|
|
|
|
|
- })), !M.length)
|
|
|
|
|
- return Promise.resolve();
|
|
|
|
|
- const W = oa(u.value, w.value, M, C({
|
|
|
|
|
- validateMessages: f.validateMessages.value
|
|
|
|
|
- }, p), E, R.value);
|
|
|
|
|
- return I.value = "validating", g.value = [], W.catch((B) => B).then(function() {
|
|
|
|
|
- let B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
|
|
|
- if (I.value === "validating") {
|
|
|
|
|
- const k = B.filter((ee) => ee && ee.errors.length);
|
|
|
|
|
- I.value = k.length ? "error" : "success", g.value = k.map((ee) => ee.errors), f.onValidate(d.value, !g.value.length, g.value.length ? $n(g.value[0]) : null);
|
|
|
|
|
- }
|
|
|
|
|
- }), W;
|
|
|
|
|
- }, H = () => {
|
|
|
|
|
- D({
|
|
|
|
|
- triggerName: "blur"
|
|
|
|
|
- });
|
|
|
|
|
- }, z = () => {
|
|
|
|
|
- if (y.value) {
|
|
|
|
|
- y.value = !1;
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- D({
|
|
|
|
|
- triggerName: "change"
|
|
|
|
|
- });
|
|
|
|
|
- }, q = () => {
|
|
|
|
|
- I.value = e.validateStatus, y.value = !1, g.value = [];
|
|
|
|
|
- }, j = () => {
|
|
|
|
|
- var p;
|
|
|
|
|
- I.value = e.validateStatus, y.value = !0, g.value = [];
|
|
|
|
|
- const E = f.model.value || {}, _ = w.value, M = $e(E, u.value, !0);
|
|
|
|
|
- Array.isArray(_) ? M.o[M.k] = [].concat((p = h.value) !== null && p !== void 0 ? p : []) : M.o[M.k] = h.value, wn(() => {
|
|
|
|
|
- y.value = !1;
|
|
|
|
|
- });
|
|
|
|
|
- }, J = F(() => e.htmlFor === void 0 ? v.value : e.htmlFor), he = () => {
|
|
|
|
|
- const p = J.value;
|
|
|
|
|
- if (!p || !x.value)
|
|
|
|
|
- return;
|
|
|
|
|
- const E = x.value.$el.querySelector(`[id="${p}"]`);
|
|
|
|
|
- E && E.focus && E.focus();
|
|
|
|
|
- };
|
|
|
|
|
- i({
|
|
|
|
|
- onFieldBlur: H,
|
|
|
|
|
- onFieldChange: z,
|
|
|
|
|
- clearValidate: q,
|
|
|
|
|
- resetField: j
|
|
|
|
|
- }), En({
|
|
|
|
|
- id: v,
|
|
|
|
|
- onFieldBlur: () => {
|
|
|
|
|
- e.autoLink && H();
|
|
|
|
|
- },
|
|
|
|
|
- onFieldChange: () => {
|
|
|
|
|
- e.autoLink && z();
|
|
|
|
|
- },
|
|
|
|
|
- clearValidate: q
|
|
|
|
|
- }, F(() => !!(e.autoLink && f.model.value && d.value)));
|
|
|
|
|
- let K = !1;
|
|
|
|
|
- Fe(d, (p) => {
|
|
|
|
|
- p ? K || (K = !0, f.addField(o, {
|
|
|
|
|
- fieldValue: w,
|
|
|
|
|
- fieldId: v,
|
|
|
|
|
- fieldName: d,
|
|
|
|
|
- resetField: j,
|
|
|
|
|
- clearValidate: q,
|
|
|
|
|
- namePath: u,
|
|
|
|
|
- validateRules: D,
|
|
|
|
|
- rules: A
|
|
|
|
|
- })) : (K = !1, f.removeField(o));
|
|
|
|
|
- }, {
|
|
|
|
|
- immediate: !0
|
|
|
|
|
- }), yn(() => {
|
|
|
|
|
- f.removeField(o);
|
|
|
|
|
- });
|
|
|
|
|
- const ye = wa(g), G = F(() => e.validateStatus !== void 0 ? e.validateStatus : ye.value.length ? "error" : I.value), Lt = F(() => ({
|
|
|
|
|
- [`${a.value}-item`]: !0,
|
|
|
|
|
- [s.value]: !0,
|
|
|
|
|
- // Status
|
|
|
|
|
- [`${a.value}-item-has-feedback`]: G.value && e.hasFeedback,
|
|
|
|
|
- [`${a.value}-item-has-success`]: G.value === "success",
|
|
|
|
|
- [`${a.value}-item-has-warning`]: G.value === "warning",
|
|
|
|
|
- [`${a.value}-item-has-error`]: G.value === "error",
|
|
|
|
|
- [`${a.value}-item-is-validating`]: G.value === "validating",
|
|
|
|
|
- [`${a.value}-item-hidden`]: e.hidden
|
|
|
|
|
- })), Ne = bn({});
|
|
|
|
|
- qn.useProvide(Ne), Ae(() => {
|
|
|
|
|
- let p;
|
|
|
|
|
- if (e.hasFeedback) {
|
|
|
|
|
- const E = G.value && Fa[G.value];
|
|
|
|
|
- p = E ? S("span", {
|
|
|
|
|
- class: ce(`${a.value}-item-feedback-icon`, `${a.value}-item-feedback-icon-${G.value}`)
|
|
|
|
|
- }, [S(E, null, null)]) : null;
|
|
|
|
|
- }
|
|
|
|
|
- C(Ne, {
|
|
|
|
|
- status: G.value,
|
|
|
|
|
- hasFeedback: e.hasFeedback,
|
|
|
|
|
- feedbackIcon: p,
|
|
|
|
|
- isFormItemInput: !0
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- const Q = U(null), be = U(!1), Vt = () => {
|
|
|
|
|
- if (m.value) {
|
|
|
|
|
- const p = getComputedStyle(m.value);
|
|
|
|
|
- Q.value = parseInt(p.marginBottom, 10);
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
- xn(() => {
|
|
|
|
|
- Fe(be, () => {
|
|
|
|
|
- be.value && Vt();
|
|
|
|
|
- }, {
|
|
|
|
|
- flush: "post",
|
|
|
|
|
- immediate: !0
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- const Dt = (p) => {
|
|
|
|
|
- p || (Q.value = null);
|
|
|
|
|
- };
|
|
|
|
|
- return () => {
|
|
|
|
|
- var p, E;
|
|
|
|
|
- if (e.noStyle) return (p = n.default) === null || p === void 0 ? void 0 : p.call(n);
|
|
|
|
|
- const _ = (E = e.help) !== null && E !== void 0 ? E : n.help ? ct(n.help()) : null, M = !!(_ != null && Array.isArray(_) && _.length || ye.value.length);
|
|
|
|
|
- return be.value = M, l(S("div", {
|
|
|
|
|
- class: [Lt.value, M ? `${a.value}-item-with-help` : "", r.class],
|
|
|
|
|
- ref: m
|
|
|
|
|
- }, [S(On, N(N({}, r), {}, {
|
|
|
|
|
- class: `${a.value}-item-row`,
|
|
|
|
|
- key: "row"
|
|
|
|
|
- }), {
|
|
|
|
|
- default: () => {
|
|
|
|
|
- var W, B;
|
|
|
|
|
- return S(de, null, [S(Re, N(N({}, e), {}, {
|
|
|
|
|
- htmlFor: J.value,
|
|
|
|
|
- required: T.value,
|
|
|
|
|
- requiredMark: f.requiredMark.value,
|
|
|
|
|
- prefixCls: a.value,
|
|
|
|
|
- onClick: he,
|
|
|
|
|
- label: e.label
|
|
|
|
|
- }), {
|
|
|
|
|
- label: n.label,
|
|
|
|
|
- tooltip: n.tooltip
|
|
|
|
|
- }), S($a, N(N({}, e), {}, {
|
|
|
|
|
- errors: _ != null ? fe(_) : ye.value,
|
|
|
|
|
- marginBottom: Q.value,
|
|
|
|
|
- prefixCls: a.value,
|
|
|
|
|
- status: G.value,
|
|
|
|
|
- ref: x,
|
|
|
|
|
- help: _,
|
|
|
|
|
- extra: (W = e.extra) !== null && W !== void 0 ? W : (B = n.extra) === null || B === void 0 ? void 0 : B.call(n),
|
|
|
|
|
- onErrorVisibleChanged: Dt
|
|
|
|
|
- }), {
|
|
|
|
|
- default: n.default
|
|
|
|
|
- })]);
|
|
|
|
|
- }
|
|
|
|
|
- }), !!Q.value && S("div", {
|
|
|
|
|
- class: `${a.value}-margin-offset`,
|
|
|
|
|
- style: {
|
|
|
|
|
- marginBottom: `-${Q.value}px`
|
|
|
|
|
- }
|
|
|
|
|
- }, null)]));
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-});
|
|
|
|
|
-export {
|
|
|
|
|
- Ra as _,
|
|
|
|
|
- le as a,
|
|
|
|
|
- Et as b,
|
|
|
|
|
- pe as c,
|
|
|
|
|
- ai as d,
|
|
|
|
|
- jt as e,
|
|
|
|
|
- fa as f,
|
|
|
|
|
- Yn as g,
|
|
|
|
|
- Ma as h,
|
|
|
|
|
- ki as i,
|
|
|
|
|
- ja as j,
|
|
|
|
|
- fe as t,
|
|
|
|
|
- Nt as u,
|
|
|
|
|
- oa as v
|
|
|
|
|
-};
|
|
|