| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643 |
- import { aC as Pe, aD as Tt, H as Ye, aE as bn, G as qe, aF as wn, aG as It, aH as xn, aI as $n, aJ as Fn, aK as lt, aL as st, aM as Je, aN as Ze, aO as _t, aP as Se, aQ as An, aR as jt, I as Mt, aS as On, aT as Lt, aU as Sn, aV as Cn, aW as ut, aX as En, d as P, l as Ne, n as Pn, a6 as qn, c as pe, W as Tn, aY as In, a7 as _n, _ as W, g as jn, m as Mn, aZ as Rt, a5 as Ln, r as Nt, X as Rn, Y as Nn, S as Vn, a1 as Vt, u as Dt, A as Dn, af as Bn, a_ as Gn, ag as Wn, P as de, a$ as Qe, b0 as Bt, b1 as zn, b2 as Hn, b3 as Un, i as Kn, M as ue, O as me, Q as ft, N as ct, f as Xn, e as $e, b4 as je } from "./index2.js";
- import { cloneVNode as Yn, inject as Gt, computed as F, provide as Wt, createVNode as _, Fragment as Ce, defineComponent as Te, ref as ke, watch as se, Transition as Jn, withDirectives as Zn, TransitionGroup as Qn, vShow as kn, shallowRef as ee, watchEffect as Ve, onBeforeUnmount as er, reactive as zt, onMounted as tr, toRaw as De, nextTick as Ht, unref as ae } from "vue";
- import { a as Ut, s as nr, o as rr, i as Kt, b as et, c as Xt, t as Ee, h as ir, d as Yt, e as Jt, f as ar } from "./hasIn.js";
- import { b as or } from "./_baseAssignValue.js";
- import { g as Zt, i as lr } from "./isPlainObject.js";
- import { C as Qt, A as sr } from "./Col.js";
- import { t as ur, d as fr } from "./debounce.js";
- import { a as cr, F as dr, u as mr, b as Be } from "./FormItemContext.js";
- import { s as gr } from "./index3.js";
- var dt = 1 / 0, vr = 17976931348623157e292;
- function hr(e) {
- if (!e)
- return e === 0 ? e : 0;
- if (e = ur(e), e === dt || e === -dt) {
- var t = e < 0 ? -1 : 1;
- return t * vr;
- }
- return e === e ? e : 0;
- }
- function pr(e) {
- var t = hr(e), n = t % 1;
- return t === t ? n ? t - n : t : 0;
- }
- var mt = Object.create, yr = /* @__PURE__ */ function() {
- function e() {
- }
- return function(t) {
- if (!Pe(t))
- return {};
- if (mt)
- return mt(t);
- e.prototype = t;
- var n = new e();
- return e.prototype = void 0, n;
- };
- }();
- function br(e, t) {
- var n = -1, r = e.length;
- for (t || (t = Array(r)); ++n < r; )
- t[n] = e[n];
- return t;
- }
- function wr(e, t) {
- for (var n = -1, r = e == null ? 0 : e.length; ++n < r && t(e[n], n, e) !== !1; )
- ;
- return e;
- }
- function be(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 ? or(n, l, s) : Ut(n, l, s);
- }
- return n;
- }
- function xr(e, t) {
- return nr(rr(e, t, Kt), e + "");
- }
- function $r(e) {
- var t = [];
- if (e != null)
- for (var n in Object(e))
- t.push(n);
- return t;
- }
- var Fr = Object.prototype, Ar = Fr.hasOwnProperty;
- function Or(e) {
- if (!Pe(e))
- return $r(e);
- var t = Tt(e), n = [];
- for (var r in e)
- r == "constructor" && (t || !Ar.call(e, r)) || n.push(r);
- return n;
- }
- function tt(e) {
- return Ye(e) ? bn(e, !0) : Or(e);
- }
- function Sr(e, t, n) {
- var r = e == null ? void 0 : et(e, t);
- return r === void 0 ? n : r;
- }
- function Cr(e, t, n) {
- var r = -1, i = e.length;
- t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0;
- for (var o = Array(i); ++r < i; )
- o[r] = e[r + t];
- return o;
- }
- function Er(e, t) {
- return e && be(t, qe(t), e);
- }
- function Pr(e, t) {
- return e && be(t, tt(t), e);
- }
- var kt = typeof exports == "object" && exports && !exports.nodeType && exports, gt = kt && typeof module == "object" && module && !module.nodeType && module, qr = gt && gt.exports === kt, vt = qr ? wn.Buffer : void 0, ht = vt ? vt.allocUnsafe : void 0;
- function Tr(e, t) {
- if (t)
- return e.slice();
- var n = e.length, r = ht ? ht(n) : new e.constructor(n);
- return e.copy(r), r;
- }
- function Ir(e, t) {
- return be(e, It(e), t);
- }
- var _r = Object.getOwnPropertySymbols, en = _r ? function(e) {
- for (var t = []; e; )
- $n(t, It(e)), e = Zt(e);
- return t;
- } : xn;
- function jr(e, t) {
- return be(e, en(e), t);
- }
- function tn(e) {
- return Fn(e, tt, en);
- }
- var Mr = Object.prototype, Lr = Mr.hasOwnProperty;
- function Rr(e) {
- var t = e.length, n = new e.constructor(t);
- return t && typeof e[0] == "string" && Lr.call(e, "index") && (n.index = e.index, n.input = e.input), n;
- }
- function nt(e) {
- var t = new e.constructor(e.byteLength);
- return new lt(t).set(new lt(e)), t;
- }
- function Nr(e, t) {
- var n = t ? nt(e.buffer) : e.buffer;
- return new e.constructor(n, e.byteOffset, e.byteLength);
- }
- var Vr = /\w*$/;
- function Dr(e) {
- var t = new e.constructor(e.source, Vr.exec(e));
- return t.lastIndex = e.lastIndex, t;
- }
- var pt = st ? st.prototype : void 0, yt = pt ? pt.valueOf : void 0;
- function Br(e) {
- return yt ? Object(yt.call(e)) : {};
- }
- function Gr(e, t) {
- var n = t ? nt(e.buffer) : e.buffer;
- return new e.constructor(n, e.byteOffset, e.length);
- }
- var Wr = "[object Boolean]", zr = "[object Date]", Hr = "[object Map]", Ur = "[object Number]", Kr = "[object RegExp]", Xr = "[object Set]", Yr = "[object String]", Jr = "[object Symbol]", Zr = "[object ArrayBuffer]", Qr = "[object DataView]", kr = "[object Float32Array]", ei = "[object Float64Array]", ti = "[object Int8Array]", ni = "[object Int16Array]", ri = "[object Int32Array]", ii = "[object Uint8Array]", ai = "[object Uint8ClampedArray]", oi = "[object Uint16Array]", li = "[object Uint32Array]";
- function si(e, t, n) {
- var r = e.constructor;
- switch (t) {
- case Zr:
- return nt(e);
- case Wr:
- case zr:
- return new r(+e);
- case Qr:
- return Nr(e, n);
- case kr:
- case ei:
- case ti:
- case ni:
- case ri:
- case ii:
- case ai:
- case oi:
- case li:
- return Gr(e, n);
- case Hr:
- return new r();
- case Ur:
- case Yr:
- return new r(e);
- case Kr:
- return Dr(e);
- case Xr:
- return new r();
- case Jr:
- return Br(e);
- }
- }
- function ui(e) {
- return typeof e.constructor == "function" && !Tt(e) ? yr(Zt(e)) : {};
- }
- var fi = "[object Map]";
- function ci(e) {
- return Je(e) && Ze(e) == fi;
- }
- var bt = Se && Se.isMap, di = bt ? _t(bt) : ci, mi = "[object Set]";
- function gi(e) {
- return Je(e) && Ze(e) == mi;
- }
- var wt = Se && Se.isSet, vi = wt ? _t(wt) : gi, hi = 1, pi = 2, yi = 4, nn = "[object Arguments]", bi = "[object Array]", wi = "[object Boolean]", xi = "[object Date]", $i = "[object Error]", rn = "[object Function]", Fi = "[object GeneratorFunction]", Ai = "[object Map]", Oi = "[object Number]", an = "[object Object]", Si = "[object RegExp]", Ci = "[object Set]", Ei = "[object String]", Pi = "[object Symbol]", qi = "[object WeakMap]", Ti = "[object ArrayBuffer]", Ii = "[object DataView]", _i = "[object Float32Array]", ji = "[object Float64Array]", Mi = "[object Int8Array]", Li = "[object Int16Array]", Ri = "[object Int32Array]", Ni = "[object Uint8Array]", Vi = "[object Uint8ClampedArray]", Di = "[object Uint16Array]", Bi = "[object Uint32Array]", j = {};
- j[nn] = j[bi] = j[Ti] = j[Ii] = j[wi] = j[xi] = j[_i] = j[ji] = j[Mi] = j[Li] = j[Ri] = j[Ai] = j[Oi] = j[an] = j[Si] = j[Ci] = j[Ei] = j[Pi] = j[Ni] = j[Vi] = j[Di] = j[Bi] = !0;
- j[$i] = j[rn] = j[qi] = !1;
- function ve(e, t, n, r, i, o) {
- var a, l = t & hi, s = t & pi, v = t & yi;
- if (n && (a = i ? n(e, r, i, o) : n(e)), a !== void 0)
- return a;
- if (!Pe(e))
- return e;
- var f = Mt(e);
- if (f) {
- if (a = Rr(e), !l)
- return br(e, a);
- } else {
- var g = Ze(e), h = g == rn || g == Fi;
- if (An(e))
- return Tr(e, l);
- if (g == an || g == nn || h && !i) {
- if (a = s || h ? {} : ui(e), !l)
- return s ? jr(e, Pr(a, e)) : Ir(e, Er(a, e));
- } else {
- if (!j[g])
- return i ? e : {};
- a = si(e, g, l);
- }
- }
- o || (o = new jt());
- var w = o.get(e);
- if (w)
- return w;
- o.set(e, a), vi(e) ? e.forEach(function(y) {
- a.add(ve(y, t, n, y, e, o));
- }) : di(e) && e.forEach(function(y, m) {
- a.set(m, ve(y, t, n, m, e, o));
- });
- var $ = v ? s ? tn : On : s ? tt : qe, d = f ? void 0 : $(e);
- return wr(d || e, function(y, m) {
- d && (m = y, y = e[m]), Ut(a, m, ve(y, t, n, m, e, o));
- }), a;
- }
- var Gi = 1, Wi = 4;
- function Ae(e) {
- return ve(e, Gi | Wi);
- }
- var zi = 1, Hi = 2;
- function Ui(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], v = a[1];
- if (a[2]) {
- if (s === void 0 && !(l in e))
- return !1;
- } else {
- var f = new jt(), g;
- if (!(g === void 0 ? Lt(v, s, zi | Hi, r, f) : g))
- return !1;
- }
- }
- return !0;
- }
- function on(e) {
- return e === e && !Pe(e);
- }
- function Ki(e) {
- for (var t = qe(e), n = t.length; n--; ) {
- var r = t[n], i = e[r];
- t[n] = [r, i, on(i)];
- }
- return t;
- }
- function ln(e, t) {
- return function(n) {
- return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n));
- };
- }
- function Xi(e) {
- var t = Ki(e);
- return t.length == 1 && t[0][2] ? ln(t[0][0], t[0][1]) : function(n) {
- return n === e || Ui(n, e, t);
- };
- }
- var Yi = 1, Ji = 2;
- function Zi(e, t) {
- return Xt(e) && on(t) ? ln(Ee(e), t) : function(n) {
- var r = Sr(n, e);
- return r === void 0 && r === t ? ir(n, e) : Lt(t, r, Yi | Ji);
- };
- }
- function Qi(e) {
- return function(t) {
- return t == null ? void 0 : t[e];
- };
- }
- function ki(e) {
- return function(t) {
- return et(t, e);
- };
- }
- function ea(e) {
- return Xt(e) ? Qi(Ee(e)) : ki(e);
- }
- function sn(e) {
- return typeof e == "function" ? e : e == null ? Kt : typeof e == "object" ? Mt(e) ? Zi(e[0], e[1]) : Xi(e) : ea(e);
- }
- function ta(e) {
- return Je(e) && Ye(e);
- }
- function na(e) {
- var t = e == null ? 0 : e.length;
- return t ? e[t - 1] : void 0;
- }
- function ra(e) {
- return function(t, n, r) {
- var i = Object(t);
- if (!Ye(t)) {
- var o = sn(n);
- t = qe(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 ia = Math.max;
- function aa(e, t, n) {
- var r = e == null ? 0 : e.length;
- if (!r)
- return -1;
- var i = n == null ? 0 : pr(n);
- return i < 0 && (i = ia(r + i, 0)), Sn(e, sn(t), i);
- }
- var oa = ra(aa), la = Math.min;
- function sa(e, t, n) {
- for (var r = En, i = e[0].length, o = e.length, a = o, l = Array(o), s = 1 / 0, v = []; a--; ) {
- var f = e[a];
- s = la(f.length, s), l[a] = i >= 120 && f.length >= 120 ? new Cn(a && f) : void 0;
- }
- f = e[0];
- var g = -1, h = l[0];
- e:
- for (; ++g < i && v.length < s; ) {
- var w = f[g], $ = w;
- if (w = w !== 0 ? w : 0, !(h ? ut(h, $) : r(v, $))) {
- for (a = o; --a; ) {
- var d = l[a];
- if (!(d ? ut(d, $) : r(e[a], $)))
- continue e;
- }
- h && h.push($), v.push(w);
- }
- }
- return v;
- }
- function ua(e) {
- return ta(e) ? e : [];
- }
- var fa = xr(function(e) {
- var t = Yt(e, ua);
- return t.length && t[0] === e[0] ? sa(t) : [];
- });
- function ca(e, t) {
- return t.length < 2 ? e : et(e, Cr(t, 0, -1));
- }
- var da = Object.prototype, ma = da.hasOwnProperty;
- function ga(e, t) {
- t = Jt(t, e);
- var n = -1, r = t.length;
- if (!r)
- return !0;
- for (; ++n < r; ) {
- var i = Ee(t[n]);
- if (i === "__proto__" && !ma.call(e, "__proto__") || (i === "constructor" || i === "prototype") && n < r - 1)
- return !1;
- }
- var o = ca(e, t);
- return o == null || delete o[Ee(na(t))];
- }
- function va(e) {
- return lr(e) ? void 0 : e;
- }
- var ha = 1, pa = 2, ya = 4, ba = ar(function(e, t) {
- var n = {};
- if (e == null)
- return n;
- var r = !1;
- t = Yt(t, function(o) {
- return o = Jt(o, e), r || (r = o.length > 1), o;
- }), be(e, tn(e), n), r && (n = ve(n, ha | pa | ya, va));
- for (var i = t.length; i--; )
- ga(n, t[i]);
- return n;
- });
- function le() {
- return le = 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;
- }, le.apply(this, arguments);
- }
- function wa(e, t) {
- e.prototype = Object.create(t.prototype), e.prototype.constructor = e, ye(e, t);
- }
- function Ge(e) {
- return Ge = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
- return n.__proto__ || Object.getPrototypeOf(n);
- }, Ge(e);
- }
- function ye(e, t) {
- return ye = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
- return r.__proto__ = i, r;
- }, ye(e, t);
- }
- function xa() {
- 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 Oe(e, t, n) {
- return xa() ? Oe = Reflect.construct.bind() : Oe = function(i, o, a) {
- var l = [null];
- l.push.apply(l, o);
- var s = Function.bind.apply(i, l), v = new s();
- return a && ye(v, a.prototype), v;
- }, Oe.apply(null, arguments);
- }
- function $a(e) {
- return Function.toString.call(e).indexOf("[native code]") !== -1;
- }
- function We(e) {
- var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
- return We = function(r) {
- if (r === null || !$a(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 Oe(r, arguments, Ge(this).constructor);
- }
- return i.prototype = Object.create(r.prototype, {
- constructor: {
- value: i,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- }), ye(i, r);
- }, We(e);
- }
- var Fa = /%[sdj%]/g, un = function() {
- };
- typeof process != "undefined" && process.env && process.env.NODE_ENV !== "production" && typeof window != "undefined" && typeof document != "undefined" && (un = 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 ze(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 J(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(Fa, 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 Aa(e) {
- return e === "string" || e === "url" || e === "hex" || e === "email" || e === "date" || e === "pattern";
- }
- function B(e, t) {
- return !!(e == null || t === "array" && Array.isArray(e) && !e.length || Aa(t) && typeof e == "string" && !e);
- }
- function Oa(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 xt(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 Sa(e) {
- var t = [];
- return Object.keys(e).forEach(function(n) {
- t.push.apply(t, e[n] || []);
- }), t;
- }
- var $t = /* @__PURE__ */ function(e) {
- wa(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__ */ We(Error));
- function Ca(e, t, n, r, i) {
- if (t.first) {
- var o = new Promise(function(h, w) {
- var $ = function(m) {
- return r(m), m.length ? w(new $t(m, ze(m))) : h(i);
- }, d = Sa(e);
- xt(d, n, $);
- });
- return o.catch(function(h) {
- return h;
- }), o;
- }
- var a = t.firstFields === !0 ? Object.keys(e) : t.firstFields || [], l = Object.keys(e), s = l.length, v = 0, f = [], g = new Promise(function(h, w) {
- var $ = function(y) {
- if (f.push.apply(f, y), v++, v === s)
- return r(f), f.length ? w(new $t(f, ze(f))) : h(i);
- };
- l.length || (r(f), h(i)), l.forEach(function(d) {
- var y = e[d];
- a.indexOf(d) !== -1 ? xt(y, n, $) : Oa(y, n, $);
- });
- });
- return g.catch(function(h) {
- return h;
- }), g;
- }
- function Ea(e) {
- return !!(e && e.message !== void 0);
- }
- function Pa(e, t) {
- for (var n = e, r = 0; r < t.length; r++) {
- if (n == null)
- return n;
- n = n[t[r]];
- }
- return n;
- }
- function Ft(e, t) {
- return function(n) {
- var r;
- return e.fullFields ? r = Pa(t, e.fullFields) : r = t[n.field || e.fullField], Ea(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 At(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] = le({}, e[n], r) : e[n] = r;
- }
- }
- return e;
- }
- var fn = function(t, n, r, i, o, a) {
- t.required && (!r.hasOwnProperty(t.field) || B(n, a || t.type)) && i.push(J(o.messages.required, t.fullField));
- }, qa = function(t, n, r, i, o) {
- (/^\s+$/.test(n) || n === "") && i.push(J(o.messages.whitespace, t.fullField));
- }, Fe, Ta = function() {
- if (Fe)
- return Fe;
- var e = "[a-fA-F\\d:]", t = function(c) {
- return c && c.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(c) {
- return c && c.exact ? o : new RegExp("(?:" + t(c) + n + t(c) + ")|(?:" + t(c) + i + t(c) + ")", "g");
- };
- s.v4 = function(u) {
- return u && u.exact ? a : new RegExp("" + t(u) + n + t(u), "g");
- }, s.v6 = function(u) {
- return u && u.exact ? l : new RegExp("" + t(u) + i + t(u), "g");
- };
- var v = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", g = s.v4().source, h = s.v6().source, w = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", $ = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", d = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", y = "(?::\\d{2,5})?", m = '(?:[/?#][^\\s"]*)?', q = "(?:" + v + "|www\\.)" + f + "(?:localhost|" + g + "|" + h + "|" + w + $ + d + ")" + y + m;
- return Fe = new RegExp("(?:^" + q + "$)", "i"), Fe;
- }, Ot = {
- // 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
- }, ge = {
- integer: function(t) {
- return ge.number(t) && parseInt(t, 10) === t;
- },
- float: function(t) {
- return ge.number(t) && !ge.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" && !ge.array(t);
- },
- method: function(t) {
- return typeof t == "function";
- },
- email: function(t) {
- return typeof t == "string" && t.length <= 320 && !!t.match(Ot.email);
- },
- url: function(t) {
- return typeof t == "string" && t.length <= 2048 && !!t.match(Ta());
- },
- hex: function(t) {
- return typeof t == "string" && !!t.match(Ot.hex);
- }
- }, Ia = function(t, n, r, i, o) {
- if (t.required && n === void 0) {
- fn(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 ? ge[l](n) || i.push(J(o.messages.types[l], t.fullField, t.type)) : l && typeof n !== t.type && i.push(J(o.messages.types[l], t.fullField, t.type));
- }, _a = function(t, n, r, i, o) {
- var a = typeof t.len == "number", l = typeof t.min == "number", s = typeof t.max == "number", v = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, f = n, g = null, h = typeof n == "number", w = typeof n == "string", $ = Array.isArray(n);
- if (h ? g = "number" : w ? g = "string" : $ && (g = "array"), !g)
- return !1;
- $ && (f = n.length), w && (f = n.replace(v, "_").length), a ? f !== t.len && i.push(J(o.messages[g].len, t.fullField, t.len)) : l && !s && f < t.min ? i.push(J(o.messages[g].min, t.fullField, t.min)) : s && !l && f > t.max ? i.push(J(o.messages[g].max, t.fullField, t.max)) : l && s && (f < t.min || f > t.max) && i.push(J(o.messages[g].range, t.fullField, t.min, t.max));
- }, fe = "enum", ja = function(t, n, r, i, o) {
- t[fe] = Array.isArray(t[fe]) ? t[fe] : [], t[fe].indexOf(n) === -1 && i.push(J(o.messages[fe], t.fullField, t[fe].join(", ")));
- }, Ma = function(t, n, r, i, o) {
- if (t.pattern) {
- if (t.pattern instanceof RegExp)
- t.pattern.lastIndex = 0, t.pattern.test(n) || i.push(J(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(J(o.messages.pattern.mismatch, t.fullField, n, t.pattern));
- }
- }
- }, E = {
- required: fn,
- whitespace: qa,
- type: Ia,
- range: _a,
- enum: ja,
- pattern: Ma
- }, La = function(t, n, r, i, o) {
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
- if (l) {
- if (B(n, "string") && !t.required)
- return r();
- E.required(t, n, i, a, o, "string"), B(n, "string") || (E.type(t, n, i, a, o), E.range(t, n, i, a, o), E.pattern(t, n, i, a, o), t.whitespace === !0 && E.whitespace(t, n, i, a, o));
- }
- r(a);
- }, Ra = function(t, n, r, i, o) {
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
- if (l) {
- if (B(n) && !t.required)
- return r();
- E.required(t, n, i, a, o), n !== void 0 && E.type(t, n, i, a, o);
- }
- r(a);
- }, Na = function(t, n, r, i, o) {
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
- if (l) {
- if (n === "" && (n = void 0), B(n) && !t.required)
- return r();
- E.required(t, n, i, a, o), n !== void 0 && (E.type(t, n, i, a, o), E.range(t, n, i, a, o));
- }
- r(a);
- }, Va = function(t, n, r, i, o) {
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
- if (l) {
- if (B(n) && !t.required)
- return r();
- E.required(t, n, i, a, o), n !== void 0 && E.type(t, n, i, a, o);
- }
- r(a);
- }, Da = function(t, n, r, i, o) {
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
- if (l) {
- if (B(n) && !t.required)
- return r();
- E.required(t, n, i, a, o), B(n) || E.type(t, n, i, a, o);
- }
- r(a);
- }, Ba = function(t, n, r, i, o) {
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
- if (l) {
- if (B(n) && !t.required)
- return r();
- E.required(t, n, i, a, o), n !== void 0 && (E.type(t, n, i, a, o), E.range(t, n, i, a, o));
- }
- r(a);
- }, Ga = function(t, n, r, i, o) {
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
- if (l) {
- if (B(n) && !t.required)
- return r();
- E.required(t, n, i, a, o), n !== void 0 && (E.type(t, n, i, a, o), E.range(t, n, i, a, o));
- }
- r(a);
- }, Wa = 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();
- E.required(t, n, i, a, o, "array"), n != null && (E.type(t, n, i, a, o), E.range(t, n, i, a, o));
- }
- r(a);
- }, za = function(t, n, r, i, o) {
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
- if (l) {
- if (B(n) && !t.required)
- return r();
- E.required(t, n, i, a, o), n !== void 0 && E.type(t, n, i, a, o);
- }
- r(a);
- }, Ha = "enum", Ua = function(t, n, r, i, o) {
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
- if (l) {
- if (B(n) && !t.required)
- return r();
- E.required(t, n, i, a, o), n !== void 0 && E[Ha](t, n, i, a, o);
- }
- r(a);
- }, Ka = function(t, n, r, i, o) {
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
- if (l) {
- if (B(n, "string") && !t.required)
- return r();
- E.required(t, n, i, a, o), B(n, "string") || E.pattern(t, n, i, a, o);
- }
- r(a);
- }, Xa = function(t, n, r, i, o) {
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
- if (l) {
- if (B(n, "date") && !t.required)
- return r();
- if (E.required(t, n, i, a, o), !B(n, "date")) {
- var s;
- n instanceof Date ? s = n : s = new Date(n), E.type(t, s, i, a, o), s && E.range(t, s.getTime(), i, a, o);
- }
- }
- r(a);
- }, Ya = function(t, n, r, i, o) {
- var a = [], l = Array.isArray(n) ? "array" : typeof n;
- E.required(t, n, i, a, o, l), r(a);
- }, Me = function(t, n, r, i, o) {
- var a = t.type, l = [], s = t.required || !t.required && i.hasOwnProperty(t.field);
- if (s) {
- if (B(n, a) && !t.required)
- return r();
- E.required(t, n, i, l, o, a), B(n, a) || E.type(t, n, i, l, o);
- }
- r(l);
- }, Ja = function(t, n, r, i, o) {
- var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field);
- if (l) {
- if (B(n) && !t.required)
- return r();
- E.required(t, n, i, a, o);
- }
- r(a);
- }, he = {
- string: La,
- method: Ra,
- number: Na,
- boolean: Va,
- regexp: Da,
- integer: Ba,
- float: Ga,
- array: Wa,
- object: za,
- enum: Ua,
- pattern: Ka,
- date: Xa,
- url: Me,
- hex: Me,
- email: Me,
- required: Ya,
- any: Ja
- };
- function He() {
- 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 Ue = He(), we = /* @__PURE__ */ function() {
- function e(n) {
- this.rules = null, this._messages = Ue, 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 = At(He(), 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, v = o;
- if (typeof s == "function" && (v = s, s = {}), !this.rules || Object.keys(this.rules).length === 0)
- return v && v(null, l), Promise.resolve(l);
- function f(d) {
- var y = [], m = {};
- function q(c) {
- if (Array.isArray(c)) {
- var b;
- y = (b = y).concat.apply(b, c);
- } else
- y.push(c);
- }
- for (var u = 0; u < d.length; u++)
- q(d[u]);
- y.length ? (m = ze(y), v(y, m)) : v(null, l);
- }
- if (s.messages) {
- var g = this.messages();
- g === Ue && (g = He()), At(g, s.messages), s.messages = g;
- } else
- s.messages = this.messages();
- var h = {}, w = s.keys || Object.keys(this.rules);
- w.forEach(function(d) {
- var y = a.rules[d], m = l[d];
- y.forEach(function(q) {
- var u = q;
- typeof u.transform == "function" && (l === r && (l = le({}, l)), m = l[d] = u.transform(m)), typeof u == "function" ? u = {
- validator: u
- } : u = le({}, u), u.validator = a.getValidationMethod(u), u.validator && (u.field = d, u.fullField = u.fullField || d, u.type = a.getType(u), h[d] = h[d] || [], h[d].push({
- rule: u,
- value: m,
- source: l,
- field: d
- }));
- });
- });
- var $ = {};
- return Ca(h, s, function(d, y) {
- var m = d.rule, q = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object");
- q = q && (m.required || !m.required && d.value), m.field = d.field;
- function u(C, A) {
- return le({}, A, {
- fullField: m.fullField + "." + C,
- fullFields: m.fullFields ? [].concat(m.fullFields, [C]) : [C]
- });
- }
- function c(C) {
- C === void 0 && (C = []);
- var A = Array.isArray(C) ? C : [C];
- !s.suppressWarning && A.length && e.warning("async-validator:", A), A.length && m.message !== void 0 && (A = [].concat(m.message));
- var O = A.map(Ft(m, l));
- if (s.first && O.length)
- return $[m.field] = 1, y(O);
- if (!q)
- y(O);
- else {
- if (m.required && !d.value)
- return m.message !== void 0 ? O = [].concat(m.message).map(Ft(m, l)) : s.error && (O = [s.error(m, J(s.messages.required, m.field))]), y(O);
- var V = {};
- m.defaultField && Object.keys(d.value).map(function(T) {
- V[T] = m.defaultField;
- }), V = le({}, V, d.rule.fields);
- var M = {};
- Object.keys(V).forEach(function(T) {
- var N = V[T], Z = Array.isArray(N) ? N : [N];
- M[T] = Z.map(u.bind(null, T));
- });
- var L = new e(M);
- L.messages(s.messages), d.rule.options && (d.rule.options.messages = s.messages, d.rule.options.error = s.error), L.validate(d.value, d.rule.options || s, function(T) {
- var N = [];
- O && O.length && N.push.apply(N, O), T && T.length && N.push.apply(N, T), y(N.length ? N : null);
- });
- }
- }
- var b;
- if (m.asyncValidator)
- b = m.asyncValidator(m, d.value, c, d.source, s);
- else if (m.validator) {
- try {
- b = m.validator(m, d.value, c, d.source, s);
- } catch (C) {
- console.error == null || console.error(C), s.suppressValidatorError || setTimeout(function() {
- throw C;
- }, 0), c(C.message);
- }
- b === !0 ? c() : b === !1 ? c(typeof m.message == "function" ? m.message(m.fullField || m.field) : m.message || (m.fullField || m.field) + " fails") : b instanceof Array ? c(b) : b instanceof Error && c(b.message);
- }
- b && b.then && b.then(function() {
- return c();
- }, function(C) {
- return c(C);
- });
- }, function(d) {
- f(d);
- }, l);
- }, t.getType = function(r) {
- if (r.type === void 0 && r.pattern instanceof RegExp && (r.type = "pattern"), typeof r.validator != "function" && r.type && !he.hasOwnProperty(r.type))
- throw new Error(J("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" ? he.required : he[this.getType(r)] || void 0;
- }, e;
- }();
- we.register = function(t, n) {
- if (typeof n != "function")
- throw new Error("Cannot register a validator by type, validator is not a function");
- he[t] = n;
- };
- we.warning = un;
- we.messages = Ue;
- we.validators = he;
- function ne(e) {
- return e == null ? [] : Array.isArray(e) ? e : [e];
- }
- function cn(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 dn(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 = P({}, e), r && n === void 0 && o.length === 1 ? delete a[i][o[0]] : a[i] = dn(a[i], o, n, r), a;
- }
- function Za(e, t, n) {
- let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
- return t.length && r && n === void 0 && !cn(e, t.slice(0, -1)) ? e : dn(e, t, n, r);
- }
- function Ke(e) {
- return ne(e);
- }
- function Qa(e, t) {
- return cn(e, t);
- }
- function ka(e, t, n) {
- let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
- return Za(e, t, n, r);
- }
- function eo(e, t) {
- return e && e.some((n) => no(n, t));
- }
- function St(e) {
- return typeof e == "object" && e !== null && Object.getPrototypeOf(e) === Object.prototype;
- }
- function mn(e, t) {
- const n = Array.isArray(e) ? [...e] : P({}, e);
- return t && Object.keys(t).forEach((r) => {
- const i = n[r], o = t[r], a = St(i) && St(o);
- n[r] = a ? mn(i, o || {}) : o;
- }), n;
- }
- function to(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) => mn(i, o), e);
- }
- function Ct(e, t) {
- let n = {};
- return t.forEach((r) => {
- const i = Qa(e, r);
- n = ka(n, r, i);
- }), n;
- }
- function no(e, t) {
- return !e || !t || e.length !== t.length ? !1 : e.every((n, r) => t[r] === n);
- }
- const Y = "'${name}' is not a valid ${type}", Ie = {
- 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: Y,
- method: Y,
- array: Y,
- object: Y,
- number: Y,
- date: Y,
- boolean: Y,
- integer: Y,
- float: Y,
- regexp: Y,
- email: Y,
- url: Y,
- hex: Y
- },
- 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 _e = 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 {
- v(r.next(f));
- } catch (g) {
- a(g);
- }
- }
- function s(f) {
- try {
- v(r.throw(f));
- } catch (g) {
- a(g);
- }
- }
- function v(f) {
- f.done ? o(f.value) : i(f.value).then(l, s);
- }
- v((r = r.apply(e, t || [])).next());
- });
- };
- const ro = we;
- function io(e, t) {
- return e.replace(/\$\{\w+\}/g, (n) => {
- const r = n.slice(2, -1);
- return t[r];
- });
- }
- function Xe(e, t, n, r, i) {
- return _e(this, void 0, void 0, function* () {
- const o = P({}, 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 ro({
- [e]: [o]
- }), s = to({}, Ie, r.validateMessages);
- l.messages(s);
- let v = [];
- try {
- yield Promise.resolve(l.validate({
- [e]: t
- }, P({}, r)));
- } catch (h) {
- h.errors ? v = h.errors.map((w, $) => {
- let {
- message: d
- } = w;
- return (
- // Wrap VueNode with `key`
- Pn(d) ? Yn(d, {
- key: `error_${$}`
- }) : d
- );
- }) : (console.error(h), v = [s.default()]);
- }
- if (!v.length && a)
- return (yield Promise.all(t.map((w, $) => Xe(`${e}.${$}`, w, a, r, i)))).reduce((w, $) => [...w, ...$], []);
- const f = P(P(P({}, n), {
- name: e,
- enum: (n.enum || []).join(", ")
- }), i);
- return v.map((h) => typeof h == "string" ? io(h, f) : h);
- });
- }
- function gn(e, t, n, r, i, o) {
- const a = e.join("."), l = n.map((v, f) => {
- const g = v.validator, h = P(P({}, v), {
- ruleIndex: f
- });
- return g && (h.validator = (w, $, d) => {
- let y = !1;
- const q = g(w, $, function() {
- for (var u = arguments.length, c = new Array(u), b = 0; b < u; b++)
- c[b] = arguments[b];
- Promise.resolve().then(() => {
- Ne(!y, "Your validator function has already return a promise. `callback` will be ignored."), y || d(...c);
- });
- });
- y = q && typeof q.then == "function" && typeof q.catch == "function", Ne(y, "`callback` is deprecated. Please return a promise instead."), y && q.then(() => {
- d();
- }).catch((u) => {
- d(u || " ");
- });
- }), h;
- }).sort((v, f) => {
- let {
- warningOnly: g,
- ruleIndex: h
- } = v, {
- warningOnly: w,
- ruleIndex: $
- } = f;
- return !!g == !!w ? h - $ : g ? 1 : -1;
- });
- let s;
- if (i === !0)
- s = new Promise((v, f) => _e(this, void 0, void 0, function* () {
- for (let g = 0; g < l.length; g += 1) {
- const h = l[g], w = yield Xe(a, t, h, r, o);
- if (w.length) {
- f([{
- errors: w,
- rule: h
- }]);
- return;
- }
- }
- v([]);
- }));
- else {
- const v = l.map((f) => Xe(a, t, f, r, o).then((g) => ({
- errors: g,
- rule: f
- })));
- s = (i ? oo(v) : ao(v)).then((f) => Promise.reject(f));
- }
- return s.catch((v) => v), s;
- }
- function ao(e) {
- return _e(this, void 0, void 0, function* () {
- return Promise.all(e).then((t) => [].concat(...t));
- });
- }
- function oo(e) {
- return _e(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 vn = Symbol("formContextKey"), hn = (e) => {
- Wt(vn, e);
- }, rt = () => Gt(vn, {
- 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(() => Ie)
- }), pn = Symbol("formItemPrefixContextKey"), lo = (e) => {
- Wt(pn, e);
- }, so = () => Gt(pn, {
- prefixCls: F(() => "")
- }), it = (e, t) => {
- let {
- slots: n,
- emit: r,
- attrs: i
- } = t;
- var o, a, l, s, v;
- const {
- prefixCls: f,
- htmlFor: g,
- labelCol: h,
- labelAlign: w,
- colon: $,
- required: d,
- requiredMark: y
- } = P(P({}, e), i), [m] = qn("Form"), q = (o = e.label) !== null && o !== void 0 ? o : (a = n.label) === null || a === void 0 ? void 0 : a.call(n);
- if (!q) return null;
- const {
- vertical: u,
- labelAlign: c,
- labelCol: b,
- labelWrap: C,
- colon: A
- } = rt(), O = h || (b == null ? void 0 : b.value) || {}, V = w || (c == null ? void 0 : c.value), M = `${f}-item-label`, L = pe(M, V === "left" && `${M}-left`, O.class, {
- [`${M}-wrap`]: !!C.value
- });
- let T = q;
- const N = $ === !0 || (A == null ? void 0 : A.value) !== !1 && $ !== !1;
- if (N && !u.value && typeof q == "string" && q.trim() !== "" && (T = q.replace(/[:|:]\s*$/, "")), e.tooltip || n.tooltip) {
- const K = _("span", {
- class: `${f}-item-tooltip`
- }, [_(Tn, {
- title: e.tooltip
- }, {
- default: () => [_(In, null, null)]
- })]);
- T = _(Ce, null, [T, n.tooltip ? (l = n.tooltip) === null || l === void 0 ? void 0 : l.call(n, {
- class: `${f}-item-tooltip`
- }) : K]);
- }
- y === "optional" && !d && (T = _(Ce, null, [T, _("span", {
- class: `${f}-item-optional`
- }, [((s = m.value) === null || s === void 0 ? void 0 : s.optional) || ((v = _n.Form) === null || v === void 0 ? void 0 : v.optional)])]));
- const Q = pe({
- [`${f}-item-required`]: d,
- [`${f}-item-required-mark-optional`]: y === "optional",
- [`${f}-item-no-colon`]: !N
- });
- return _(Qt, W(W({}, O), {}, {
- class: L
- }), {
- default: () => [_("label", {
- for: g,
- class: Q,
- title: typeof q == "string" ? q : "",
- onClick: (K) => r("click", K)
- }, [T])]
- });
- };
- it.displayName = "FormItemLabel";
- it.inheritAttrs = !1;
- const uo = (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)"
- }
- }
- }
- };
- }, fo = (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
- }
- }
- };
- }, co = (e) => {
- const {
- componentCls: t
- } = e;
- return {
- [e.componentCls]: P(P(P({}, Nt(e)), fo(e)), {
- [`${t}-text`]: {
- display: "inline-block",
- paddingInlineEnd: e.paddingSM
- },
- // ================================================================
- // = Size =
- // ================================================================
- "&-small": P({}, Et(e, e.controlHeightSM)),
- "&-large": P({}, Et(e, e.controlHeightLG))
- })
- };
- }, mo = (e) => {
- const {
- formItemCls: t,
- iconCls: n,
- componentCls: r,
- rootPrefixCls: i
- } = e;
- return {
- [t]: P(P({}, Nt(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: Rt,
- animationDuration: e.motionDurationMid,
- animationTimingFunction: e.motionEaseOutBack,
- pointerEvents: "none",
- "&-success": {
- color: e.colorSuccess
- },
- "&-error": {
- color: e.colorError
- },
- "&-warning": {
- color: e.colorWarning
- },
- "&-validating": {
- color: e.colorPrimary
- }
- }
- })
- };
- }, go = (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"
- }
- }
- };
- }, vo = (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"
- }
- }
- }
- };
- }, ce = (e) => ({
- margin: 0,
- padding: `0 0 ${e.paddingXS}px`,
- whiteSpace: "initial",
- textAlign: "start",
- "> label": {
- margin: 0,
- "&::after": {
- display: "none"
- }
- }
- }), ho = (e) => {
- const {
- componentCls: t,
- formItemCls: n
- } = e;
- return {
- [`${n} ${n}-label`]: ce(e),
- [t]: {
- [n]: {
- flexWrap: "wrap",
- [`${n}-label,
- ${n}-control`]: {
- flex: "0 0 100%",
- maxWidth: "100%"
- }
- }
- }
- };
- }, po = (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`]: ce(e),
- [`@media (max-width: ${e.screenXSMax}px)`]: [ho(e), {
- [t]: {
- [`.${r}-col-xs-24${n}-label`]: ce(e)
- }
- }],
- [`@media (max-width: ${e.screenSMMax}px)`]: {
- [t]: {
- [`.${r}-col-sm-24${n}-label`]: ce(e)
- }
- },
- [`@media (max-width: ${e.screenMDMax}px)`]: {
- [t]: {
- [`.${r}-col-md-24${n}-label`]: ce(e)
- }
- },
- [`@media (max-width: ${e.screenLGMax}px)`]: {
- [t]: {
- [`.${r}-col-lg-24${n}-label`]: ce(e)
- }
- }
- };
- }, at = jn("Form", (e, t) => {
- let {
- rootPrefixCls: n
- } = t;
- const r = Mn(e, {
- formItemCls: `${e.componentCls}-item`,
- rootPrefixCls: n
- });
- return [co(r), mo(r), uo(r), go(r), vo(r), po(r), Ln(r), Rt];
- }), yo = Te({
- 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
- } = so(), o = F(() => `${r.value}-item-explain`), a = F(() => !!(e.errors && e.errors.length)), l = ke(i.value), [, s] = at(r);
- return se([a, i], () => {
- a.value && (l.value = i.value);
- }), () => {
- var v, f;
- const g = Rn(`${r.value}-show-help-item`), h = Nn(`${r.value}-show-help-item`, g);
- return h.role = "alert", h.class = [s.value, o.value, n.class, `${r.value}-show-help`], _(Jn, W(W({}, Vn(`${r.value}-show-help`)), {}, {
- onAfterEnter: () => e.onErrorVisibleChanged(!0),
- onAfterLeave: () => e.onErrorVisibleChanged(!1)
- }), {
- default: () => [Zn(_(Qn, W(W({}, h), {}, {
- tag: "div"
- }), {
- default: () => [(f = e.errors) === null || f === void 0 ? void 0 : f.map((w, $) => _("div", {
- key: $,
- class: l.value ? `${o.value}-${l.value}` : ""
- }, [w]))]
- }), [[kn, !!(!((v = e.errors) === null || v === void 0) && v.length)]])]
- });
- };
- }
- }), bo = Te({
- 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 = rt(), {
- wrapperCol: i
- } = r, o = P({}, r);
- return delete o.labelCol, delete o.wrapperCol, hn(o), lo({
- prefixCls: F(() => e.prefixCls),
- status: F(() => e.status)
- }), () => {
- var a, l, s;
- const {
- prefixCls: v,
- wrapperCol: f,
- marginBottom: g,
- onErrorVisibleChanged: h,
- help: w = (a = n.help) === null || a === void 0 ? void 0 : a.call(n),
- errors: $ = Vt((l = n.errors) === null || l === void 0 ? void 0 : l.call(n)),
- // hasFeedback,
- // status,
- extra: d = (s = n.extra) === null || s === void 0 ? void 0 : s.call(n)
- } = e, y = `${v}-item`, m = f || (i == null ? void 0 : i.value) || {}, q = pe(`${y}-control`, m.class);
- return _(Qt, W(W({}, m), {}, {
- class: q
- }), {
- default: () => {
- var u;
- return _(Ce, null, [_("div", {
- class: `${y}-control-input`
- }, [_("div", {
- class: `${y}-control-input-content`
- }, [(u = n.default) === null || u === void 0 ? void 0 : u.call(n)])]), g !== null || $.length ? _("div", {
- style: {
- display: "flex",
- flexWrap: "nowrap"
- }
- }, [_(yo, {
- errors: $,
- help: w,
- class: `${y}-explain-connected`,
- onErrorVisibleChanged: h
- }, null), !!g && _("div", {
- style: {
- width: 0,
- height: `${g}px`
- }
- }, null)]) : null, d ? _("div", {
- class: `${y}-extra`
- }, [d]) : null]);
- }
- });
- };
- }
- });
- function wo(e) {
- const t = ee(e.value.slice());
- let n = null;
- return Ve(() => {
- clearTimeout(n), n = setTimeout(() => {
- t.value = e.value;
- }, e.value.length ? 0 : 10);
- }), t;
- }
- Qe("success", "warning", "error", "validating", "");
- const xo = {
- success: Wn,
- warning: Gn,
- error: Bn,
- validating: Dn
- };
- function Le(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 $o = () => ({
- htmlFor: String,
- prefixCls: String,
- label: de.any,
- help: de.any,
- extra: de.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: de.oneOf(Qe("", "success", "warning", "error", "validating")),
- validateTrigger: {
- type: [String, Array]
- },
- messageVariables: {
- type: Object
- },
- hidden: Boolean,
- noStyle: Boolean,
- tooltip: String
- });
- let Fo = 0;
- const Ao = "form_item", Oo = Te({
- compatConfig: {
- MODE: 3
- },
- name: "AFormItem",
- inheritAttrs: !1,
- __ANT_NEW_FORM_ITEM: !0,
- props: $o(),
- slots: Object,
- setup(e, t) {
- let {
- slots: n,
- attrs: r,
- expose: i
- } = t;
- Ne(e.prop === void 0, "`prop` is deprecated. Please use `name` instead.");
- const o = `form-item-${++Fo}`, {
- prefixCls: a
- } = Dt("form", e), [l, s] = at(a), v = ee(), f = rt(), g = F(() => e.name || e.prop), h = ee([]), w = ee(!1), $ = ee(), d = F(() => {
- const p = g.value;
- return Ke(p);
- }), y = F(() => {
- if (d.value.length) {
- const p = f.name.value, I = d.value.join("_");
- return p ? `${p}_${I}` : `${Ao}_${I}`;
- } else
- return;
- }), m = () => {
- const p = f.model.value;
- if (!(!p || !g.value))
- return Le(p, d.value, !0).v;
- }, q = F(() => m()), u = ee(Ae(q.value)), c = F(() => {
- let p = e.validateTrigger !== void 0 ? e.validateTrigger : f.validateTrigger.value;
- return p = p === void 0 ? "change" : p, ne(p);
- }), b = F(() => {
- let p = f.rules.value;
- const I = e.rules, D = e.required !== void 0 ? {
- required: !!e.required,
- trigger: c.value
- } : [], G = Le(p, d.value);
- p = p ? G.o[G.k] || G.v : [];
- const z = [].concat(I || p || []);
- return oa(z, (H) => H.required) ? z : z.concat(D);
- }), C = F(() => {
- const p = b.value;
- let I = !1;
- return p && p.length && p.every((D) => D.required ? (I = !0, !1) : !0), I || e.required;
- }), A = ee();
- Ve(() => {
- A.value = e.validateStatus;
- });
- const O = F(() => {
- let p = {};
- return typeof e.label == "string" ? p.label = e.label : e.name && (p.label = String(e.name)), e.messageVariables && (p = P(P({}, p), e.messageVariables)), p;
- }), V = (p) => {
- if (d.value.length === 0)
- return;
- const {
- validateFirst: I = !1
- } = e, {
- triggerName: D
- } = p || {};
- let G = b.value;
- if (D && (G = G.filter((H) => {
- const {
- trigger: re
- } = H;
- return !re && !c.value.length ? !0 : ne(re || c.value).includes(D);
- })), !G.length)
- return Promise.resolve();
- const z = gn(d.value, q.value, G, P({
- validateMessages: f.validateMessages.value
- }, p), I, O.value);
- return A.value = "validating", h.value = [], z.catch((H) => H).then(function() {
- let H = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
- if (A.value === "validating") {
- const re = H.filter((ie) => ie && ie.errors.length);
- A.value = re.length ? "error" : "success", h.value = re.map((ie) => ie.errors), f.onValidate(g.value, !h.value.length, h.value.length ? De(h.value[0]) : null);
- }
- }), z;
- }, M = () => {
- V({
- triggerName: "blur"
- });
- }, L = () => {
- if (w.value) {
- w.value = !1;
- return;
- }
- V({
- triggerName: "change"
- });
- }, T = () => {
- A.value = e.validateStatus, w.value = !1, h.value = [];
- }, N = () => {
- var p;
- A.value = e.validateStatus, w.value = !0, h.value = [];
- const I = f.model.value || {}, D = q.value, G = Le(I, d.value, !0);
- Array.isArray(D) ? G.o[G.k] = [].concat((p = u.value) !== null && p !== void 0 ? p : []) : G.o[G.k] = u.value, Ht(() => {
- w.value = !1;
- });
- }, Z = F(() => e.htmlFor === void 0 ? y.value : e.htmlFor), Q = () => {
- const p = Z.value;
- if (!p || !$.value)
- return;
- const I = $.value.$el.querySelector(`[id="${p}"]`);
- I && I.focus && I.focus();
- };
- i({
- onFieldBlur: M,
- onFieldChange: L,
- clearValidate: T,
- resetField: N
- }), cr({
- id: y,
- onFieldBlur: () => {
- e.autoLink && M();
- },
- onFieldChange: () => {
- e.autoLink && L();
- },
- clearValidate: T
- }, F(() => !!(e.autoLink && f.model.value && g.value)));
- let K = !1;
- se(g, (p) => {
- p ? K || (K = !0, f.addField(o, {
- fieldValue: q,
- fieldId: y,
- fieldName: g,
- resetField: N,
- clearValidate: T,
- namePath: d,
- validateRules: V,
- rules: b
- })) : (K = !1, f.removeField(o));
- }, {
- immediate: !0
- }), er(() => {
- f.removeField(o);
- });
- const x = wo(h), S = F(() => e.validateStatus !== void 0 ? e.validateStatus : x.value.length ? "error" : A.value), R = F(() => ({
- [`${a.value}-item`]: !0,
- [s.value]: !0,
- // Status
- [`${a.value}-item-has-feedback`]: S.value && e.hasFeedback,
- [`${a.value}-item-has-success`]: S.value === "success",
- [`${a.value}-item-has-warning`]: S.value === "warning",
- [`${a.value}-item-has-error`]: S.value === "error",
- [`${a.value}-item-is-validating`]: S.value === "validating",
- [`${a.value}-item-hidden`]: e.hidden
- })), U = zt({});
- dr.useProvide(U), Ve(() => {
- let p;
- if (e.hasFeedback) {
- const I = S.value && xo[S.value];
- p = I ? _("span", {
- class: pe(`${a.value}-item-feedback-icon`, `${a.value}-item-feedback-icon-${S.value}`)
- }, [_(I, null, null)]) : null;
- }
- P(U, {
- status: S.value,
- hasFeedback: e.hasFeedback,
- feedbackIcon: p,
- isFormItemInput: !0
- });
- });
- const X = ee(null), te = ee(!1), xe = () => {
- if (v.value) {
- const p = getComputedStyle(v.value);
- X.value = parseInt(p.marginBottom, 10);
- }
- };
- tr(() => {
- se(te, () => {
- te.value && xe();
- }, {
- flush: "post",
- immediate: !0
- });
- });
- const k = (p) => {
- p || (X.value = null);
- };
- return () => {
- var p, I;
- if (e.noStyle) return (p = n.default) === null || p === void 0 ? void 0 : p.call(n);
- const D = (I = e.help) !== null && I !== void 0 ? I : n.help ? Vt(n.help()) : null, G = !!(D != null && Array.isArray(D) && D.length || x.value.length);
- return te.value = G, l(_("div", {
- class: [R.value, G ? `${a.value}-item-with-help` : "", r.class],
- ref: v
- }, [_(sr, W(W({}, r), {}, {
- class: `${a.value}-item-row`,
- key: "row"
- }), {
- default: () => {
- var z, H;
- return _(Ce, null, [_(it, W(W({}, e), {}, {
- htmlFor: Z.value,
- required: C.value,
- requiredMark: f.requiredMark.value,
- prefixCls: a.value,
- onClick: Q,
- label: e.label
- }), {
- label: n.label,
- tooltip: n.tooltip
- }), _(bo, W(W({}, e), {}, {
- errors: D != null ? ne(D) : x.value,
- marginBottom: X.value,
- prefixCls: a.value,
- status: S.value,
- ref: $,
- help: D,
- extra: (z = e.extra) !== null && z !== void 0 ? z : (H = n.extra) === null || H === void 0 ? void 0 : H.call(n),
- onErrorVisibleChanged: k
- }), {
- default: n.default
- })]);
- }
- }), !!X.value && _("div", {
- class: `${a.value}-margin-offset`,
- style: {
- marginBottom: `-${X.value}px`
- }
- }, null)]));
- };
- }
- });
- function yn(e) {
- let t = !1, n = e.length;
- const r = [];
- return e.length ? new Promise((i, o) => {
- e.forEach((a, l) => {
- a.catch((s) => (t = !0, s)).then((s) => {
- n -= 1, r[l] = s, !(n > 0) && (t && o(r), i(r));
- });
- });
- }) : Promise.resolve([]);
- }
- function Pt(e) {
- let t = !1;
- return e && e.length && e.every((n) => n.required ? (t = !0, !1) : !0), t;
- }
- function qt(e) {
- return e == null ? [] : Array.isArray(e) ? e : [e];
- }
- function Re(e, t, n) {
- let r = e;
- t = t.replace(/\[(\w+)\]/g, ".$1"), t = t.replace(/^\./, "");
- const i = t.split(".");
- let o = 0;
- 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 new Error("please transfer a valid name path to validate!");
- break;
- }
- }
- return {
- o: r,
- k: i[o],
- v: r ? r[i[o]] : null,
- isValid: r && i[o] in r
- };
- }
- function So(e) {
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ke({}), n = arguments.length > 2 ? arguments[2] : void 0;
- const r = Ae(ae(e)), i = zt({}), o = ee([]), a = (u) => {
- P(ae(e), P(P({}, Ae(r)), u)), Ht(() => {
- Object.keys(i).forEach((c) => {
- i[c] = {
- autoLink: !1,
- required: Pt(ae(t)[c])
- };
- });
- });
- }, l = function() {
- let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], c = arguments.length > 1 ? arguments[1] : void 0;
- return c.length ? u.filter((b) => {
- const C = qt(b.trigger || "change");
- return fa(C, c).length;
- }) : u;
- };
- let s = null;
- const v = function(u) {
- let c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, b = arguments.length > 2 ? arguments[2] : void 0;
- const C = [], A = {};
- for (let M = 0; M < u.length; M++) {
- const L = u[M], T = Re(ae(e), L, b);
- if (!T.isValid) continue;
- A[L] = T.v;
- const N = l(ae(t)[L], qt(c && c.trigger));
- N.length && C.push(f(L, T.v, N, c || {}).then(() => ({
- name: L,
- errors: [],
- warnings: []
- })).catch((Z) => {
- const Q = [], K = [];
- return Z.forEach((x) => {
- let {
- rule: {
- warningOnly: S
- },
- errors: R
- } = x;
- S ? K.push(...R) : Q.push(...R);
- }), Q.length ? Promise.reject({
- name: L,
- errors: Q,
- warnings: K
- }) : {
- name: L,
- errors: Q,
- warnings: K
- };
- }));
- }
- const O = yn(C);
- s = O;
- const V = O.then(() => s === O ? Promise.resolve(A) : Promise.reject([])).catch((M) => {
- const L = M.filter((T) => T && T.errors.length);
- return L.length ? Promise.reject({
- values: A,
- errorFields: L,
- outOfDate: s !== O
- }) : Promise.resolve(A);
- });
- return V.catch((M) => M), V;
- }, f = function(u, c, b) {
- let C = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
- const A = gn([u], c, b, P({
- validateMessages: Ie
- }, C), !!C.validateFirst);
- return i[u] ? (i[u].validateStatus = "validating", A.catch((O) => O).then(function() {
- let O = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
- var V;
- if (i[u].validateStatus === "validating") {
- const M = O.filter((L) => L && L.errors.length);
- i[u].validateStatus = M.length ? "error" : "success", i[u].help = M.length ? M.map((L) => L.errors) : null, (V = n == null ? void 0 : n.onValidate) === null || V === void 0 || V.call(n, u, !M.length, M.length ? De(i[u].help[0]) : null);
- }
- }), A) : A.catch((O) => O);
- }, g = (u, c) => {
- let b = [], C = !0;
- u ? Array.isArray(u) ? b = u : b = [u] : (C = !1, b = o.value);
- const A = v(b, c || {}, C);
- return A.catch((O) => O), A;
- }, h = (u) => {
- let c = [];
- u ? Array.isArray(u) ? c = u : c = [u] : c = o.value, c.forEach((b) => {
- i[b] && P(i[b], {
- validateStatus: "",
- help: null
- });
- });
- }, w = (u) => {
- const c = {
- autoLink: !1
- }, b = [], C = Array.isArray(u) ? u : [u];
- for (let A = 0; A < C.length; A++) {
- const O = C[A];
- (O == null ? void 0 : O.validateStatus) === "error" && (c.validateStatus = "error", O.help && b.push(O.help)), c.required = c.required || (O == null ? void 0 : O.required);
- }
- return c.help = b, c;
- };
- let $ = r, d = !0;
- const y = (u) => {
- const c = [];
- o.value.forEach((b) => {
- const C = Re(u, b, !1), A = Re($, b, !1);
- (d && (n == null ? void 0 : n.immediate) && C.isValid || !Bt(C.v, A.v)) && c.push(b);
- }), g(c, {
- trigger: "change"
- }), d = !1, $ = Ae(De(u));
- }, m = n == null ? void 0 : n.debounce;
- let q = !0;
- return se(t, () => {
- o.value = t ? Object.keys(ae(t)) : [], !q && n && n.validateOnRuleChange && g(), q = !1;
- }, {
- deep: !0,
- immediate: !0
- }), se(o, () => {
- const u = {};
- o.value.forEach((c) => {
- u[c] = P({}, i[c], {
- autoLink: !1,
- required: Pt(ae(t)[c])
- }), delete i[c];
- });
- for (const c in i)
- Object.prototype.hasOwnProperty.call(i, c) && delete i[c];
- P(i, u);
- }, {
- immediate: !0
- }), se(e, m && m.wait ? fr(y, m.wait, ba(m, ["wait"])) : y, {
- immediate: n && !!n.immediate,
- deep: !0
- }), {
- modelRef: e,
- rulesRef: t,
- initialModel: r,
- validateInfos: i,
- resetFields: a,
- validate: g,
- validateField: f,
- mergeValidateInfo: w,
- clearValidate: h
- };
- }
- const Co = () => ({
- layout: de.oneOf(Qe("horizontal", "inline", "vertical")),
- labelCol: $e(),
- wrapperCol: $e(),
- colon: me(),
- labelAlign: ft(),
- labelWrap: me(),
- prefixCls: String,
- requiredMark: ct([String, Boolean]),
- /** @deprecated Will warning in future branch. Pls use `requiredMark` instead. */
- hideRequiredMark: me(),
- model: de.object,
- rules: $e(),
- validateMessages: $e(),
- validateOnRuleChange: me(),
- // 提交失败自动滚动到第一个错误字段
- scrollToFirstError: Xn(),
- onSubmit: ue(),
- name: String,
- validateTrigger: ct([String, Array]),
- size: ft(),
- disabled: me(),
- onValuesChange: ue(),
- onFieldsChange: ue(),
- onFinish: ue(),
- onFinishFailed: ue(),
- onValidate: ue()
- });
- function Eo(e, t) {
- return Bt(ne(e), ne(t));
- }
- const oe = Te({
- compatConfig: {
- MODE: 3
- },
- name: "AForm",
- inheritAttrs: !1,
- props: Kn(Co(), {
- layout: "horizontal",
- hideRequiredMark: !1,
- colon: !0
- }),
- Item: Oo,
- useForm: So,
- // emits: ['finishFailed', 'submit', 'finish', 'validate'],
- setup(e, t) {
- let {
- emit: n,
- slots: r,
- expose: i,
- attrs: o
- } = t;
- const {
- prefixCls: a,
- direction: l,
- form: s,
- size: v,
- disabled: f
- } = Dt("form", e), g = F(() => e.requiredMark === "" || e.requiredMark), h = F(() => {
- var x;
- return g.value !== void 0 ? g.value : s && ((x = s.value) === null || x === void 0 ? void 0 : x.requiredMark) !== void 0 ? s.value.requiredMark : !e.hideRequiredMark;
- });
- zn(v), Hn(f);
- const w = F(() => {
- var x, S;
- return (x = e.colon) !== null && x !== void 0 ? x : (S = s.value) === null || S === void 0 ? void 0 : S.colon;
- }), {
- validateMessages: $
- } = Un(), d = F(() => P(P(P({}, Ie), $.value), e.validateMessages)), [y, m] = at(a), q = F(() => pe(a.value, {
- [`${a.value}-${e.layout}`]: !0,
- [`${a.value}-hide-required-mark`]: h.value === !1,
- [`${a.value}-rtl`]: l.value === "rtl",
- [`${a.value}-${v.value}`]: v.value
- }, m.value)), u = ke(), c = {}, b = (x, S) => {
- c[x] = S;
- }, C = (x) => {
- delete c[x];
- }, A = (x) => {
- const S = !!x, R = S ? ne(x).map(Ke) : [];
- return S ? Object.values(c).filter((U) => R.findIndex((X) => Eo(X, U.fieldName.value)) > -1) : Object.values(c);
- }, O = (x) => {
- if (!e.model) {
- je(!1, "Form", "model is required for resetFields to work.");
- return;
- }
- A(x).forEach((S) => {
- S.resetField();
- });
- }, V = (x) => {
- A(x).forEach((S) => {
- S.clearValidate();
- });
- }, M = (x) => {
- const {
- scrollToFirstError: S
- } = e;
- if (n("finishFailed", x), S && x.errorFields.length) {
- let R = {};
- typeof S == "object" && (R = S), T(x.errorFields[0].name, R);
- }
- }, L = function() {
- return Q(...arguments);
- }, T = function(x) {
- let S = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- const R = A(x ? [x] : void 0);
- if (R.length) {
- const U = R[0].fieldId.value, X = U ? document.getElementById(U) : null;
- X && gr(X, P({
- scrollMode: "if-needed",
- block: "nearest"
- }, S));
- }
- }, N = function() {
- let x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0;
- if (x === !0) {
- const S = [];
- return Object.values(c).forEach((R) => {
- let {
- namePath: U
- } = R;
- S.push(U.value);
- }), Ct(e.model, S);
- } else
- return Ct(e.model, x);
- }, Z = (x, S) => {
- if (je(!(x instanceof Function), "Form", "validateFields/validateField/validate not support callback, please use promise instead"), !e.model)
- return je(!1, "Form", "model is required for validateFields to work."), Promise.reject("Form `model` is required for validateFields to work.");
- const R = !!x, U = R ? ne(x).map(Ke) : [], X = [];
- Object.values(c).forEach((k) => {
- var p;
- if (R || U.push(k.namePath.value), !(!((p = k.rules) === null || p === void 0) && p.value.length))
- return;
- const I = k.namePath.value;
- if (!R || eo(U, I)) {
- const D = k.validateRules(P({
- validateMessages: d.value
- }, S));
- X.push(D.then(() => ({
- name: I,
- errors: [],
- warnings: []
- })).catch((G) => {
- const z = [], H = [];
- return G.forEach((re) => {
- let {
- rule: {
- warningOnly: ie
- },
- errors: ot
- } = re;
- ie ? H.push(...ot) : z.push(...ot);
- }), z.length ? Promise.reject({
- name: I,
- errors: z,
- warnings: H
- }) : {
- name: I,
- errors: z,
- warnings: H
- };
- }));
- }
- });
- const te = yn(X);
- u.value = te;
- const xe = te.then(() => u.value === te ? Promise.resolve(N(U)) : Promise.reject([])).catch((k) => {
- const p = k.filter((I) => I && I.errors.length);
- return Promise.reject({
- values: N(U),
- errorFields: p,
- outOfDate: u.value !== te
- });
- });
- return xe.catch((k) => k), xe;
- }, Q = function() {
- return Z(...arguments);
- }, K = (x) => {
- x.preventDefault(), x.stopPropagation(), n("submit", x), e.model && Z().then((R) => {
- n("finish", R);
- }).catch((R) => {
- M(R);
- });
- };
- return i({
- resetFields: O,
- clearValidate: V,
- validateFields: Z,
- getFieldsValue: N,
- validate: L,
- scrollToField: T
- }), hn({
- model: F(() => e.model),
- name: F(() => e.name),
- labelAlign: F(() => e.labelAlign),
- labelCol: F(() => e.labelCol),
- labelWrap: F(() => e.labelWrap),
- wrapperCol: F(() => e.wrapperCol),
- vertical: F(() => e.layout === "vertical"),
- colon: w,
- requiredMark: h,
- validateTrigger: F(() => e.validateTrigger),
- rules: F(() => e.rules),
- addField: b,
- removeField: C,
- onValidate: (x, S, R) => {
- n("validate", x, S, R);
- },
- validateMessages: d
- }), se(() => e.rules, () => {
- e.validateOnRuleChange && Z();
- }), () => {
- var x;
- return y(_("form", W(W({}, o), {}, {
- onSubmit: K,
- class: [q.value, o.class]
- }), [(x = r.default) === null || x === void 0 ? void 0 : x.call(r)]));
- };
- }
- });
- oe.useInjectFormItemContext = mr;
- oe.ItemRest = Be;
- oe.install = function(e) {
- return e.component(oe.name, oe), e.component(oe.Item.name, oe.Item), e.component(Be.name, Be), e;
- };
- export {
- oe as F,
- Oo as _,
- sn as b
- };
|