@pubinfo-pr/core 0.222.2 → 0.222.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AppSetting-Adv5Y3SE.js → AppSetting-BWVulLPM.js} +38 -38
- package/dist/{HCheckList-WAAl9RiK.js → HCheckList-Bb4GvZ2_.js} +1 -1
- package/dist/HSlideover-DoCRa4dK.js +152 -0
- package/dist/{HToggle-YLmL7R0b.js → HToggle-Bnr5k93p.js} +1 -1
- package/dist/{HeaderFullMenu-ByedDsvz.js → HeaderFullMenu--AOcAS-6.js} +72 -72
- package/dist/{HeaderThinMenu-2q2iBtTH.js → HeaderThinMenu-CRPVfGgM.js} +132 -132
- package/dist/PreferencesContent-DW9HAzpr.js +486 -0
- package/dist/{SettingBreadcrumb-C1VwfnxX.js → SettingBreadcrumb-DKCK6V-n.js} +6 -7
- package/dist/{SettingCopyright-C--oGV21.js → SettingCopyright-C5Pc0I1w.js} +4 -4
- package/dist/{SettingEnableTransition-DW2gfisN.js → SettingEnableTransition-D2FDj0oR.js} +5 -5
- package/dist/{SettingHome-VUAS3uEg.js → SettingHome-1Y1rYeQb.js} +6 -6
- package/dist/{SettingMenu-BH7XU7eF.js → SettingMenu-DWtNX8Ti.js} +8 -9
- package/dist/{SettingMode-BIyHzTKH.js → SettingMode-CZV84QeW.js} +4 -4
- package/dist/{SettingNavSearch-PfSA-_ro.js → SettingNavSearch-CrMpbXFg.js} +5 -5
- package/dist/{SettingOther-DdqNapQX.js → SettingOther-D6gGuQJw.js} +6 -6
- package/dist/{SettingPage-DS-G9-X5.js → SettingPage-DuN13bXO.js} +3 -3
- package/dist/{SettingTabbar-2yfw2vsm.js → SettingTabbar-BhJxcU35.js} +10 -11
- package/dist/{SettingThemes-Bkcywy7v.js → SettingThemes-BjkWfY1C.js} +9 -10
- package/dist/{SettingToolbar-DP7-_nPK.js → SettingToolbar-BYOxXAXL.js} +5 -5
- package/dist/{SettingTopbar-C0Ia4-If.js → SettingTopbar-CxKsnIRK.js} +8 -9
- package/dist/{SettingWidthMode-DgSWsHFq.js → SettingWidthMode-dM88qSol.js} +5 -5
- package/dist/auth-DILNNEQ8.js +1230 -0
- package/dist/{change-organization-BfnI2yEl.js → change-organization-BXl4ZC7j.js} +24 -24
- package/dist/{change-password-Bj_GWzmn.js → change-password-P4SGdvdU.js} +64 -73
- package/dist/components-C9kcavB4.js +2768 -0
- package/dist/core-CKIhF3Vi.js +270 -0
- package/dist/{core-4H5JBsa5.js → core-D2ocBD0r.js} +57 -51
- package/dist/index.js +2249 -7757
- package/dist/{not-found-DbHOY5cU.js → not-found-C-1699o2.js} +4 -5
- package/dist/{not-permission-DwERxb_u.js → not-permission-CZGJzlSF.js} +4 -5
- package/dist/profile-B3Q7hRgl.js +123 -0
- package/dist/{question-line-D7ecIumZ.js → question-line-B4oDBb2H.js} +2 -2
- package/dist/{right-DYiPS7dU.js → right-BTHgfOSp.js} +4 -4
- package/dist/style.css +1 -1
- package/package.json +7 -7
- package/dist/HSlideover-CXBJxuQo.js +0 -1695
- package/dist/PreferencesContent-CiPweszy.js +0 -701
- package/dist/auth-B65CJEOe.js +0 -4242
- package/dist/chunk-CD4vhpVs.js +0 -18
- package/dist/components-BfkDsfck.js +0 -5238
- package/dist/dist-7OjQvlya.js +0 -468
- package/dist/form-C3VHofnN.js +0 -2768
- package/dist/modal-Bl5xHbxa.js +0 -43824
- package/dist/overlayscrollbars-vue-mGyICRMi.js +0 -1460
- package/dist/profile-Dq66-Gsl.js +0 -19269
- package/dist/tree-select-B8cTcGLa.js +0 -12497
- package/dist/watchDiff-CPZFtaOC.js +0 -655
- /package/dist/{HButton-Dt6qGhhR.js → HButton-BPbXqVbA.js} +0 -0
- /package/dist/{HDivider-Ds5MMqtm.js → HDivider-BSENlYnI.js} +0 -0
- /package/dist/{HInput-BrsX9848.js → HInput-DbvnkEO7.js} +0 -0
- /package/dist/{HTooltip-DjAU-Evn.js → HTooltip-tCnNrJUE.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-sUTDUeGO.js → _plugin-vue_export-helper-BBf_fmJ_.js} +0 -0
- /package/dist/{engine-oniguruma-uxNZ2DGJ.js → engine-oniguruma-Bl7ZtyDI.js} +0 -0
- /package/dist/{json-CC4oV-bd.js → json-BuUwnwNo.js} +0 -0
- /package/dist/{reload-CbuQgTlC.js → reload-DWTXo9r2.js} +0 -0
- /package/dist/{useContext-DLtu9F7E.js → useContext-mDF2-tXy.js} +0 -0
- /package/dist/{vitesse-dark-CxkWMfh6.js → vitesse-dark-j0hKJETh.js} +0 -0
- /package/dist/{vitesse-light-DY25e6F3.js → vitesse-light-BfgKNo3X.js} +0 -0
- /package/dist/{wasm-DAU6f5s5.js → wasm-tXaxAgz9.js} +0 -0
package/dist/form-C3VHofnN.js
DELETED
|
@@ -1,2768 +0,0 @@
|
|
|
1
|
-
import { $n as ExclamationCircleFilled, A as isArrayLike, At as warning$1, B as isObjectLike, Bt as useInjectGlobalForm, Cn as _extends$1, D as getTransitionProps, Dt as warning_default, F as nodeUtil, Fn as QuestionCircleOutlined, Ft as localeValues, G as isObject$1, Gt as booleanType, I as baseUnary, J as root, Jt as objectType, K as baseGetTag, L as isLength, N as isPrototype, O as _getTag_default, Pt as useLocaleReceiver, R as isBuffer, T as getTransitionGroupProps, U as getNative, Ut as anyType, V as isArray, Xt as stringType, Yt as someType, Zt as tuple, _n as initDefaultProps, cr as CloseCircleFilled, ct as useToken, et as PropTypes, fr as CheckCircleFilled, it as useProviderSize, lt as merge, mn as isValidElement, mt as resetComponent, q as Symbol$1, qt as functionType, r as detectFlexGapSupported, rt as useConfigInject_default, tn as filterEmpty, u as zoomIn, ut as genComponentStyleHook, wn as _objectSpread2, yn as classNames, z as isArguments, zn as LoadingOutlined, zt as useProviderDisabled } from "./modal-Bl5xHbxa.js";
|
|
2
|
-
import { At as arrayLikeKeys, Bt as Stack, Dt as baseIsEqual, Et as isEqual, Ft as arrayPush, Ht as eq, I as collapseMotion, Lt as Uint8Array, Mt as getSymbols, Nt as stubArray, Ot as getAllKeys, Pt as baseGetAllKeys, Q as genCollapseMotion, Rt as cacheHas, Vt as MapCache, at as isPlainObject, dt as useInjectFormItemContext, ft as useProvideFormItemContext, jt as isIndex, kt as keys, lt as FormItemContext_default, ot as getPrototype, ut as FormItemInputContext, z as tooltip_default, zt as SetCache } from "./tree-select-B8cTcGLa.js";
|
|
3
|
-
import { Fragment, Transition, TransitionGroup, cloneVNode, computed, createVNode, defineComponent, inject, nextTick, onBeforeUnmount, onMounted, provide, reactive, ref, resolveDirective, shallowRef, toRaw, unref, vShow, watch, watchEffect, withDirectives } from "vue";
|
|
4
|
-
function t(a) {
|
|
5
|
-
return typeof a == "object" && !!a && a.nodeType === 1;
|
|
6
|
-
}
|
|
7
|
-
function e(a, o) {
|
|
8
|
-
return (!o || a !== "hidden") && a !== "visible" && a !== "clip";
|
|
9
|
-
}
|
|
10
|
-
function n(a, o) {
|
|
11
|
-
if (a.clientHeight < a.scrollHeight || a.clientWidth < a.scrollWidth) {
|
|
12
|
-
var s = getComputedStyle(a, null);
|
|
13
|
-
return e(s.overflowY, o) || e(s.overflowX, o) || function(a) {
|
|
14
|
-
var o = function(a) {
|
|
15
|
-
if (!a.ownerDocument || !a.ownerDocument.defaultView) return null;
|
|
16
|
-
try {
|
|
17
|
-
return a.ownerDocument.defaultView.frameElement;
|
|
18
|
-
} catch {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
}(a);
|
|
22
|
-
return !!o && (o.clientHeight < a.scrollHeight || o.clientWidth < a.scrollWidth);
|
|
23
|
-
}(a);
|
|
24
|
-
}
|
|
25
|
-
return !1;
|
|
26
|
-
}
|
|
27
|
-
function r(a, o, s, c, l, u, d, f) {
|
|
28
|
-
return u < a && d > o || u > a && d < o ? 0 : u <= a && f <= s || d >= o && f >= s ? u - a - c : d > o && f < s || u < a && f > s ? d - o + l : 0;
|
|
29
|
-
}
|
|
30
|
-
var i = function(a, o) {
|
|
31
|
-
var s = window, c = o.scrollMode, l = o.block, u = o.inline, d = o.boundary, f = o.skipOverflowHiddenElements, p = typeof d == "function" ? d : function(a) {
|
|
32
|
-
return a !== d;
|
|
33
|
-
};
|
|
34
|
-
if (!t(a)) throw TypeError("Invalid target");
|
|
35
|
-
for (var m, h = document.scrollingElement || document.documentElement, g = [], _ = a; t(_) && p(_);) {
|
|
36
|
-
if ((_ = (m = _).parentElement ?? (m.getRootNode().host || null)) === h) {
|
|
37
|
-
g.push(_);
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
_ != null && _ === document.body && n(_) && !n(document.documentElement) || _ != null && n(_, f) && g.push(_);
|
|
41
|
-
}
|
|
42
|
-
for (var v = s.visualViewport ? s.visualViewport.width : innerWidth, y = s.visualViewport ? s.visualViewport.height : innerHeight, b = window.scrollX || pageXOffset, x = window.scrollY || pageYOffset, S = a.getBoundingClientRect(), C = S.height, w = S.width, T = S.top, E = S.right, D = S.bottom, O = S.left, k = l === "start" || l === "nearest" ? T : l === "end" ? D : T + C / 2, A = u === "center" ? O + w / 2 : u === "end" ? E : O, j = [], M = 0; M < g.length; M++) {
|
|
43
|
-
var N = g[M], P = N.getBoundingClientRect(), F = P.height, I = P.width, L = P.top, R = P.right, z = P.bottom, B = P.left;
|
|
44
|
-
if (c === "if-needed" && T >= 0 && O >= 0 && D <= y && E <= v && T >= L && D <= z && O >= B && E <= R) return j;
|
|
45
|
-
var V = getComputedStyle(N), H = parseInt(V.borderLeftWidth, 10), U = parseInt(V.borderTopWidth, 10), W = parseInt(V.borderRightWidth, 10), G = parseInt(V.borderBottomWidth, 10), K = 0, q = 0, J = "offsetWidth" in N ? N.offsetWidth - N.clientWidth - H - W : 0, Y = "offsetHeight" in N ? N.offsetHeight - N.clientHeight - U - G : 0, X = "offsetWidth" in N ? N.offsetWidth === 0 ? 0 : I / N.offsetWidth : 0, Z = "offsetHeight" in N ? N.offsetHeight === 0 ? 0 : F / N.offsetHeight : 0;
|
|
46
|
-
if (h === N) K = l === "start" ? k : l === "end" ? k - y : l === "nearest" ? r(x, x + y, y, U, G, x + k, x + k + C, C) : k - y / 2, q = u === "start" ? A : u === "center" ? A - v / 2 : u === "end" ? A - v : r(b, b + v, v, H, W, b + A, b + A + w, w), K = Math.max(0, K + x), q = Math.max(0, q + b);
|
|
47
|
-
else {
|
|
48
|
-
K = l === "start" ? k - L - U : l === "end" ? k - z + G + Y : l === "nearest" ? r(L, z, F, U, G + Y, k, k + C, C) : k - (L + F / 2) + Y / 2, q = u === "start" ? A - B - H : u === "center" ? A - (B + I / 2) + J / 2 : u === "end" ? A - R + W + J : r(B, R, I, H, W + J, A, A + w, w);
|
|
49
|
-
var Q = N.scrollLeft, $ = N.scrollTop;
|
|
50
|
-
k += $ - (K = Math.max(0, Math.min($ + K / Z, N.scrollHeight - F / Z + Y))), A += Q - (q = Math.max(0, Math.min(Q + q / X, N.scrollWidth - I / X + J)));
|
|
51
|
-
}
|
|
52
|
-
j.push({
|
|
53
|
-
el: N,
|
|
54
|
-
top: K,
|
|
55
|
-
left: q
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
return j;
|
|
59
|
-
};
|
|
60
|
-
function isOptionsObject(a) {
|
|
61
|
-
return a === Object(a) && Object.keys(a).length !== 0;
|
|
62
|
-
}
|
|
63
|
-
function defaultBehavior(a, o) {
|
|
64
|
-
o === void 0 && (o = "auto");
|
|
65
|
-
var s = "scrollBehavior" in document.body.style;
|
|
66
|
-
a.forEach(function(a) {
|
|
67
|
-
var c = a.el, l = a.top, u = a.left;
|
|
68
|
-
c.scroll && s ? c.scroll({
|
|
69
|
-
top: l,
|
|
70
|
-
left: u,
|
|
71
|
-
behavior: o
|
|
72
|
-
}) : (c.scrollTop = l, c.scrollLeft = u);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function getOptions(a) {
|
|
76
|
-
return a === !1 ? {
|
|
77
|
-
block: "end",
|
|
78
|
-
inline: "nearest"
|
|
79
|
-
} : isOptionsObject(a) ? a : {
|
|
80
|
-
block: "start",
|
|
81
|
-
inline: "nearest"
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
function scrollIntoView(a, o) {
|
|
85
|
-
var s = a.isConnected || a.ownerDocument.documentElement.contains(a);
|
|
86
|
-
if (isOptionsObject(o) && typeof o.behavior == "function") return o.behavior(s ? i(a, o) : []);
|
|
87
|
-
if (s) {
|
|
88
|
-
var c = getOptions(o);
|
|
89
|
-
return defaultBehavior(i(a, c), c.behavior);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
var symbolTag$2 = "[object Symbol]";
|
|
93
|
-
function isSymbol(a) {
|
|
94
|
-
return typeof a == "symbol" || isObjectLike(a) && baseGetTag(a) == symbolTag$2;
|
|
95
|
-
}
|
|
96
|
-
function arrayMap(a, o) {
|
|
97
|
-
for (var s = -1, c = a == null ? 0 : a.length, l = Array(c); ++s < c;) l[s] = o(a[s], s, a);
|
|
98
|
-
return l;
|
|
99
|
-
}
|
|
100
|
-
var INFINITY$2 = Infinity, symbolProto$1 = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0;
|
|
101
|
-
function baseToString(a) {
|
|
102
|
-
if (typeof a == "string") return a;
|
|
103
|
-
if (isArray(a)) return arrayMap(a, baseToString) + "";
|
|
104
|
-
if (isSymbol(a)) return symbolToString ? symbolToString.call(a) : "";
|
|
105
|
-
var o = a + "";
|
|
106
|
-
return o == "0" && 1 / a == -INFINITY$2 ? "-0" : o;
|
|
107
|
-
}
|
|
108
|
-
var reWhitespace = /\s/;
|
|
109
|
-
function trimmedEndIndex(a) {
|
|
110
|
-
for (var o = a.length; o-- && reWhitespace.test(a.charAt(o)););
|
|
111
|
-
return o;
|
|
112
|
-
}
|
|
113
|
-
var reTrimStart = /^\s+/;
|
|
114
|
-
function baseTrim(a) {
|
|
115
|
-
return a && a.slice(0, trimmedEndIndex(a) + 1).replace(reTrimStart, "");
|
|
116
|
-
}
|
|
117
|
-
var NAN = NaN, reIsBadHex = /^[-+]0x[0-9a-f]+$/i, reIsBinary = /^0b[01]+$/i, reIsOctal = /^0o[0-7]+$/i, freeParseInt = parseInt;
|
|
118
|
-
function toNumber(a) {
|
|
119
|
-
if (typeof a == "number") return a;
|
|
120
|
-
if (isSymbol(a)) return NAN;
|
|
121
|
-
if (isObject$1(a)) {
|
|
122
|
-
var o = typeof a.valueOf == "function" ? a.valueOf() : a;
|
|
123
|
-
a = isObject$1(o) ? o + "" : o;
|
|
124
|
-
}
|
|
125
|
-
if (typeof a != "string") return a === 0 ? a : +a;
|
|
126
|
-
a = baseTrim(a);
|
|
127
|
-
var s = reIsBinary.test(a);
|
|
128
|
-
return s || reIsOctal.test(a) ? freeParseInt(a.slice(2), s ? 2 : 8) : reIsBadHex.test(a) ? NAN : +a;
|
|
129
|
-
}
|
|
130
|
-
var INFINITY$1 = Infinity, MAX_INTEGER = 17976931348623157e292;
|
|
131
|
-
function toFinite(a) {
|
|
132
|
-
return a ? (a = toNumber(a), a === INFINITY$1 || a === -INFINITY$1 ? (a < 0 ? -1 : 1) * MAX_INTEGER : a === a ? a : 0) : a === 0 ? a : 0;
|
|
133
|
-
}
|
|
134
|
-
function toInteger(a) {
|
|
135
|
-
var o = toFinite(a), s = o % 1;
|
|
136
|
-
return o === o ? s ? o - s : o : 0;
|
|
137
|
-
}
|
|
138
|
-
function identity(a) {
|
|
139
|
-
return a;
|
|
140
|
-
}
|
|
141
|
-
var objectCreate = Object.create, baseCreate = function() {
|
|
142
|
-
function a() {}
|
|
143
|
-
return function(o) {
|
|
144
|
-
if (!isObject$1(o)) return {};
|
|
145
|
-
if (objectCreate) return objectCreate(o);
|
|
146
|
-
a.prototype = o;
|
|
147
|
-
var s = new a();
|
|
148
|
-
return a.prototype = void 0, s;
|
|
149
|
-
};
|
|
150
|
-
}();
|
|
151
|
-
function apply(a, o, s) {
|
|
152
|
-
switch (s.length) {
|
|
153
|
-
case 0: return a.call(o);
|
|
154
|
-
case 1: return a.call(o, s[0]);
|
|
155
|
-
case 2: return a.call(o, s[0], s[1]);
|
|
156
|
-
case 3: return a.call(o, s[0], s[1], s[2]);
|
|
157
|
-
}
|
|
158
|
-
return a.apply(o, s);
|
|
159
|
-
}
|
|
160
|
-
function copyArray(a, o) {
|
|
161
|
-
var s = -1, c = a.length;
|
|
162
|
-
for (o ||= Array(c); ++s < c;) o[s] = a[s];
|
|
163
|
-
return o;
|
|
164
|
-
}
|
|
165
|
-
var HOT_COUNT = 800, HOT_SPAN = 16, nativeNow = Date.now;
|
|
166
|
-
function shortOut(a) {
|
|
167
|
-
var o = 0, s = 0;
|
|
168
|
-
return function() {
|
|
169
|
-
var c = nativeNow(), l = HOT_SPAN - (c - s);
|
|
170
|
-
if (s = c, l > 0) {
|
|
171
|
-
if (++o >= HOT_COUNT) return arguments[0];
|
|
172
|
-
} else o = 0;
|
|
173
|
-
return a.apply(void 0, arguments);
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function constant(a) {
|
|
177
|
-
return function() {
|
|
178
|
-
return a;
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
var defineProperty = function() {
|
|
182
|
-
try {
|
|
183
|
-
var a = getNative(Object, "defineProperty");
|
|
184
|
-
return a({}, "", {}), a;
|
|
185
|
-
} catch {}
|
|
186
|
-
}(), setToString = shortOut(defineProperty ? function(a, o) {
|
|
187
|
-
return defineProperty(a, "toString", {
|
|
188
|
-
configurable: !0,
|
|
189
|
-
enumerable: !1,
|
|
190
|
-
value: constant(o),
|
|
191
|
-
writable: !0
|
|
192
|
-
});
|
|
193
|
-
} : identity);
|
|
194
|
-
function arrayEach(a, o) {
|
|
195
|
-
for (var s = -1, c = a == null ? 0 : a.length; ++s < c && o(a[s], s, a) !== !1;);
|
|
196
|
-
return a;
|
|
197
|
-
}
|
|
198
|
-
function baseFindIndex(a, o, s, c) {
|
|
199
|
-
for (var l = a.length, u = s + (c ? 1 : -1); c ? u-- : ++u < l;) if (o(a[u], u, a)) return u;
|
|
200
|
-
return -1;
|
|
201
|
-
}
|
|
202
|
-
function baseIsNaN(a) {
|
|
203
|
-
return a !== a;
|
|
204
|
-
}
|
|
205
|
-
function strictIndexOf(a, o, s) {
|
|
206
|
-
for (var c = s - 1, l = a.length; ++c < l;) if (a[c] === o) return c;
|
|
207
|
-
return -1;
|
|
208
|
-
}
|
|
209
|
-
function baseIndexOf(a, o, s) {
|
|
210
|
-
return o === o ? strictIndexOf(a, o, s) : baseFindIndex(a, baseIsNaN, s);
|
|
211
|
-
}
|
|
212
|
-
function arrayIncludes(a, o) {
|
|
213
|
-
return !!(a != null && a.length) && baseIndexOf(a, o, 0) > -1;
|
|
214
|
-
}
|
|
215
|
-
function baseAssignValue(a, o, s) {
|
|
216
|
-
o == "__proto__" && defineProperty ? defineProperty(a, o, {
|
|
217
|
-
configurable: !0,
|
|
218
|
-
enumerable: !0,
|
|
219
|
-
value: s,
|
|
220
|
-
writable: !0
|
|
221
|
-
}) : a[o] = s;
|
|
222
|
-
}
|
|
223
|
-
var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
224
|
-
function assignValue(a, o, s) {
|
|
225
|
-
var c = a[o];
|
|
226
|
-
(!(hasOwnProperty$2.call(a, o) && eq(c, s)) || s === void 0 && !(o in a)) && baseAssignValue(a, o, s);
|
|
227
|
-
}
|
|
228
|
-
function copyObject(a, o, s, c) {
|
|
229
|
-
var l = !s;
|
|
230
|
-
s ||= {};
|
|
231
|
-
for (var u = -1, d = o.length; ++u < d;) {
|
|
232
|
-
var f = o[u], p = c ? c(s[f], a[f], f, s, a) : void 0;
|
|
233
|
-
p === void 0 && (p = a[f]), l ? baseAssignValue(s, f, p) : assignValue(s, f, p);
|
|
234
|
-
}
|
|
235
|
-
return s;
|
|
236
|
-
}
|
|
237
|
-
var nativeMax$2 = Math.max;
|
|
238
|
-
function overRest(a, o, s) {
|
|
239
|
-
return o = nativeMax$2(o === void 0 ? a.length - 1 : o, 0), function() {
|
|
240
|
-
for (var c = arguments, l = -1, u = nativeMax$2(c.length - o, 0), d = Array(u); ++l < u;) d[l] = c[o + l];
|
|
241
|
-
l = -1;
|
|
242
|
-
for (var f = Array(o + 1); ++l < o;) f[l] = c[l];
|
|
243
|
-
return f[o] = s(d), apply(a, this, f);
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
function baseRest(a, o) {
|
|
247
|
-
return setToString(overRest(a, o, identity), a + "");
|
|
248
|
-
}
|
|
249
|
-
function nativeKeysIn(a) {
|
|
250
|
-
var o = [];
|
|
251
|
-
if (a != null) for (var s in Object(a)) o.push(s);
|
|
252
|
-
return o;
|
|
253
|
-
}
|
|
254
|
-
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
255
|
-
function baseKeysIn(a) {
|
|
256
|
-
if (!isObject$1(a)) return nativeKeysIn(a);
|
|
257
|
-
var o = isPrototype(a), s = [];
|
|
258
|
-
for (var c in a) c == "constructor" && (o || !hasOwnProperty$1.call(a, c)) || s.push(c);
|
|
259
|
-
return s;
|
|
260
|
-
}
|
|
261
|
-
function keysIn(a) {
|
|
262
|
-
return isArrayLike(a) ? arrayLikeKeys(a, !0) : baseKeysIn(a);
|
|
263
|
-
}
|
|
264
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
|
|
265
|
-
function isKey(a, o) {
|
|
266
|
-
if (isArray(a)) return !1;
|
|
267
|
-
var s = typeof a;
|
|
268
|
-
return s == "number" || s == "symbol" || s == "boolean" || a == null || isSymbol(a) ? !0 : reIsPlainProp.test(a) || !reIsDeepProp.test(a) || o != null && a in Object(o);
|
|
269
|
-
}
|
|
270
|
-
var FUNC_ERROR_TEXT$1 = "Expected a function";
|
|
271
|
-
function memoize(a, o) {
|
|
272
|
-
if (typeof a != "function" || o != null && typeof o != "function") throw TypeError(FUNC_ERROR_TEXT$1);
|
|
273
|
-
var s = function() {
|
|
274
|
-
var c = arguments, l = o ? o.apply(this, c) : c[0], u = s.cache;
|
|
275
|
-
if (u.has(l)) return u.get(l);
|
|
276
|
-
var d = a.apply(this, c);
|
|
277
|
-
return s.cache = u.set(l, d) || u, d;
|
|
278
|
-
};
|
|
279
|
-
return s.cache = new (memoize.Cache || MapCache)(), s;
|
|
280
|
-
}
|
|
281
|
-
memoize.Cache = MapCache;
|
|
282
|
-
var MAX_MEMOIZE_SIZE = 500;
|
|
283
|
-
function memoizeCapped(a) {
|
|
284
|
-
var o = memoize(a, function(a) {
|
|
285
|
-
return s.size === MAX_MEMOIZE_SIZE && s.clear(), a;
|
|
286
|
-
}), s = o.cache;
|
|
287
|
-
return o;
|
|
288
|
-
}
|
|
289
|
-
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, reEscapeChar = /\\(\\)?/g, stringToPath = memoizeCapped(function(a) {
|
|
290
|
-
var o = [];
|
|
291
|
-
return a.charCodeAt(0) === 46 && o.push(""), a.replace(rePropName, function(a, s, c, l) {
|
|
292
|
-
o.push(c ? l.replace(reEscapeChar, "$1") : s || a);
|
|
293
|
-
}), o;
|
|
294
|
-
});
|
|
295
|
-
function toString(a) {
|
|
296
|
-
return a == null ? "" : baseToString(a);
|
|
297
|
-
}
|
|
298
|
-
function castPath(a, o) {
|
|
299
|
-
return isArray(a) ? a : isKey(a, o) ? [a] : stringToPath(toString(a));
|
|
300
|
-
}
|
|
301
|
-
var INFINITY = Infinity;
|
|
302
|
-
function toKey(a) {
|
|
303
|
-
if (typeof a == "string" || isSymbol(a)) return a;
|
|
304
|
-
var o = a + "";
|
|
305
|
-
return o == "0" && 1 / a == -INFINITY ? "-0" : o;
|
|
306
|
-
}
|
|
307
|
-
function baseGet(a, o) {
|
|
308
|
-
o = castPath(o, a);
|
|
309
|
-
for (var s = 0, c = o.length; a != null && s < c;) a = a[toKey(o[s++])];
|
|
310
|
-
return s && s == c ? a : void 0;
|
|
311
|
-
}
|
|
312
|
-
function get$1(a, o, s) {
|
|
313
|
-
var c = a == null ? void 0 : baseGet(a, o);
|
|
314
|
-
return c === void 0 ? s : c;
|
|
315
|
-
}
|
|
316
|
-
var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : void 0;
|
|
317
|
-
function isFlattenable(a) {
|
|
318
|
-
return isArray(a) || isArguments(a) || !!(spreadableSymbol && a && a[spreadableSymbol]);
|
|
319
|
-
}
|
|
320
|
-
function baseFlatten(a, o, s, c, l) {
|
|
321
|
-
var u = -1, d = a.length;
|
|
322
|
-
for (s ||= isFlattenable, l ||= []; ++u < d;) {
|
|
323
|
-
var f = a[u];
|
|
324
|
-
o > 0 && s(f) ? o > 1 ? baseFlatten(f, o - 1, s, c, l) : arrayPush(l, f) : c || (l[l.length] = f);
|
|
325
|
-
}
|
|
326
|
-
return l;
|
|
327
|
-
}
|
|
328
|
-
function flatten(a) {
|
|
329
|
-
return a != null && a.length ? baseFlatten(a, 1) : [];
|
|
330
|
-
}
|
|
331
|
-
function flatRest(a) {
|
|
332
|
-
return setToString(overRest(a, void 0, flatten), a + "");
|
|
333
|
-
}
|
|
334
|
-
function baseSlice(a, o, s) {
|
|
335
|
-
var c = -1, l = a.length;
|
|
336
|
-
o < 0 && (o = -o > l ? 0 : l + o), s = s > l ? l : s, s < 0 && (s += l), l = o > s ? 0 : s - o >>> 0, o >>>= 0;
|
|
337
|
-
for (var u = Array(l); ++c < l;) u[c] = a[c + o];
|
|
338
|
-
return u;
|
|
339
|
-
}
|
|
340
|
-
function baseAssign(a, o) {
|
|
341
|
-
return a && copyObject(o, keys(o), a);
|
|
342
|
-
}
|
|
343
|
-
function baseAssignIn(a, o) {
|
|
344
|
-
return a && copyObject(o, keysIn(o), a);
|
|
345
|
-
}
|
|
346
|
-
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports, freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module, Buffer = freeModule && freeModule.exports === freeExports ? root.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
|
|
347
|
-
function cloneBuffer(a, o) {
|
|
348
|
-
if (o) return a.slice();
|
|
349
|
-
var s = a.length, c = allocUnsafe ? allocUnsafe(s) : new a.constructor(s);
|
|
350
|
-
return a.copy(c), c;
|
|
351
|
-
}
|
|
352
|
-
function copySymbols(a, o) {
|
|
353
|
-
return copyObject(a, getSymbols(a), o);
|
|
354
|
-
}
|
|
355
|
-
var getSymbolsIn = Object.getOwnPropertySymbols ? function(a) {
|
|
356
|
-
for (var o = []; a;) arrayPush(o, getSymbols(a)), a = getPrototype(a);
|
|
357
|
-
return o;
|
|
358
|
-
} : stubArray;
|
|
359
|
-
function copySymbolsIn(a, o) {
|
|
360
|
-
return copyObject(a, getSymbolsIn(a), o);
|
|
361
|
-
}
|
|
362
|
-
function getAllKeysIn(a) {
|
|
363
|
-
return baseGetAllKeys(a, keysIn, getSymbolsIn);
|
|
364
|
-
}
|
|
365
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
366
|
-
function initCloneArray(a) {
|
|
367
|
-
var o = a.length, s = new a.constructor(o);
|
|
368
|
-
return o && typeof a[0] == "string" && hasOwnProperty.call(a, "index") && (s.index = a.index, s.input = a.input), s;
|
|
369
|
-
}
|
|
370
|
-
function cloneArrayBuffer(a) {
|
|
371
|
-
var o = new a.constructor(a.byteLength);
|
|
372
|
-
return new Uint8Array(o).set(new Uint8Array(a)), o;
|
|
373
|
-
}
|
|
374
|
-
function cloneDataView(a, o) {
|
|
375
|
-
var s = o ? cloneArrayBuffer(a.buffer) : a.buffer;
|
|
376
|
-
return new a.constructor(s, a.byteOffset, a.byteLength);
|
|
377
|
-
}
|
|
378
|
-
var reFlags = /\w*$/;
|
|
379
|
-
function cloneRegExp(a) {
|
|
380
|
-
var o = new a.constructor(a.source, reFlags.exec(a));
|
|
381
|
-
return o.lastIndex = a.lastIndex, o;
|
|
382
|
-
}
|
|
383
|
-
var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
384
|
-
function cloneSymbol(a) {
|
|
385
|
-
return symbolValueOf ? Object(symbolValueOf.call(a)) : {};
|
|
386
|
-
}
|
|
387
|
-
function cloneTypedArray(a, o) {
|
|
388
|
-
var s = o ? cloneArrayBuffer(a.buffer) : a.buffer;
|
|
389
|
-
return new a.constructor(s, a.byteOffset, a.length);
|
|
390
|
-
}
|
|
391
|
-
var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]", arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
|
|
392
|
-
function initCloneByTag(a, o, s) {
|
|
393
|
-
var c = a.constructor;
|
|
394
|
-
switch (o) {
|
|
395
|
-
case arrayBufferTag$1: return cloneArrayBuffer(a);
|
|
396
|
-
case boolTag$1:
|
|
397
|
-
case dateTag$1: return new c(+a);
|
|
398
|
-
case dataViewTag$1: return cloneDataView(a, s);
|
|
399
|
-
case float32Tag$1:
|
|
400
|
-
case float64Tag$1:
|
|
401
|
-
case int8Tag$1:
|
|
402
|
-
case int16Tag$1:
|
|
403
|
-
case int32Tag$1:
|
|
404
|
-
case uint8Tag$1:
|
|
405
|
-
case uint8ClampedTag$1:
|
|
406
|
-
case uint16Tag$1:
|
|
407
|
-
case uint32Tag$1: return cloneTypedArray(a, s);
|
|
408
|
-
case mapTag$2: return new c();
|
|
409
|
-
case numberTag$1:
|
|
410
|
-
case stringTag$1: return new c(a);
|
|
411
|
-
case regexpTag$1: return cloneRegExp(a);
|
|
412
|
-
case setTag$2: return new c();
|
|
413
|
-
case symbolTag$1: return cloneSymbol(a);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
function initCloneObject(a) {
|
|
417
|
-
return typeof a.constructor == "function" && !isPrototype(a) ? baseCreate(getPrototype(a)) : {};
|
|
418
|
-
}
|
|
419
|
-
var mapTag$1 = "[object Map]";
|
|
420
|
-
function baseIsMap(a) {
|
|
421
|
-
return isObjectLike(a) && _getTag_default(a) == mapTag$1;
|
|
422
|
-
}
|
|
423
|
-
var nodeIsMap = nodeUtil && nodeUtil.isMap, isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap, setTag$1 = "[object Set]";
|
|
424
|
-
function baseIsSet(a) {
|
|
425
|
-
return isObjectLike(a) && _getTag_default(a) == setTag$1;
|
|
426
|
-
}
|
|
427
|
-
var nodeIsSet = nodeUtil && nodeUtil.isSet, isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet, CLONE_DEEP_FLAG$2 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$2 = 4, argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]", arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]", cloneableTags = {};
|
|
428
|
-
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = !0, cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = !1;
|
|
429
|
-
function baseClone(a, o, s, c, l, u) {
|
|
430
|
-
var d, f = o & CLONE_DEEP_FLAG$2, p = o & CLONE_FLAT_FLAG$1, m = o & CLONE_SYMBOLS_FLAG$2;
|
|
431
|
-
if (s && (d = l ? s(a, c, l, u) : s(a)), d !== void 0) return d;
|
|
432
|
-
if (!isObject$1(a)) return a;
|
|
433
|
-
var h = isArray(a);
|
|
434
|
-
if (h) {
|
|
435
|
-
if (d = initCloneArray(a), !f) return copyArray(a, d);
|
|
436
|
-
} else {
|
|
437
|
-
var _ = _getTag_default(a), v = _ == funcTag || _ == genTag;
|
|
438
|
-
if (isBuffer(a)) return cloneBuffer(a, f);
|
|
439
|
-
if (_ == objectTag || _ == argsTag || v && !l) {
|
|
440
|
-
if (d = p || v ? {} : initCloneObject(a), !f) return p ? copySymbolsIn(a, baseAssignIn(d, a)) : copySymbols(a, baseAssign(d, a));
|
|
441
|
-
} else {
|
|
442
|
-
if (!cloneableTags[_]) return l ? a : {};
|
|
443
|
-
d = initCloneByTag(a, _, f);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
u ||= new Stack();
|
|
447
|
-
var y = u.get(a);
|
|
448
|
-
if (y) return y;
|
|
449
|
-
u.set(a, d), isSet(a) ? a.forEach(function(c) {
|
|
450
|
-
d.add(baseClone(c, o, s, c, a, u));
|
|
451
|
-
}) : isMap(a) && a.forEach(function(c, l) {
|
|
452
|
-
d.set(l, baseClone(c, o, s, l, a, u));
|
|
453
|
-
});
|
|
454
|
-
var b = h ? void 0 : (m ? p ? getAllKeysIn : getAllKeys : p ? keysIn : keys)(a);
|
|
455
|
-
return arrayEach(b || a, function(c, l) {
|
|
456
|
-
b && (l = c, c = a[l]), assignValue(d, l, baseClone(c, o, s, l, a, u));
|
|
457
|
-
}), d;
|
|
458
|
-
}
|
|
459
|
-
var CLONE_DEEP_FLAG$1 = 1, CLONE_SYMBOLS_FLAG$1 = 4;
|
|
460
|
-
function cloneDeep(a) {
|
|
461
|
-
return baseClone(a, CLONE_DEEP_FLAG$1 | CLONE_SYMBOLS_FLAG$1);
|
|
462
|
-
}
|
|
463
|
-
var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
|
|
464
|
-
function baseIsMatch(a, o, s, c) {
|
|
465
|
-
var l = s.length, u = l, d = !c;
|
|
466
|
-
if (a == null) return !u;
|
|
467
|
-
for (a = Object(a); l--;) {
|
|
468
|
-
var f = s[l];
|
|
469
|
-
if (d && f[2] ? f[1] !== a[f[0]] : !(f[0] in a)) return !1;
|
|
470
|
-
}
|
|
471
|
-
for (; ++l < u;) {
|
|
472
|
-
f = s[l];
|
|
473
|
-
var p = f[0], m = a[p], h = f[1];
|
|
474
|
-
if (d && f[2]) {
|
|
475
|
-
if (m === void 0 && !(p in a)) return !1;
|
|
476
|
-
} else {
|
|
477
|
-
var g = new Stack();
|
|
478
|
-
if (c) var _ = c(m, h, p, a, o, g);
|
|
479
|
-
if (!(_ === void 0 ? baseIsEqual(h, m, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, c, g) : _)) return !1;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
return !0;
|
|
483
|
-
}
|
|
484
|
-
function isStrictComparable(a) {
|
|
485
|
-
return a === a && !isObject$1(a);
|
|
486
|
-
}
|
|
487
|
-
function getMatchData(a) {
|
|
488
|
-
for (var o = keys(a), s = o.length; s--;) {
|
|
489
|
-
var c = o[s], l = a[c];
|
|
490
|
-
o[s] = [
|
|
491
|
-
c,
|
|
492
|
-
l,
|
|
493
|
-
isStrictComparable(l)
|
|
494
|
-
];
|
|
495
|
-
}
|
|
496
|
-
return o;
|
|
497
|
-
}
|
|
498
|
-
function matchesStrictComparable(a, o) {
|
|
499
|
-
return function(s) {
|
|
500
|
-
return s == null ? !1 : s[a] === o && (o !== void 0 || a in Object(s));
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
function baseMatches(a) {
|
|
504
|
-
var o = getMatchData(a);
|
|
505
|
-
return o.length == 1 && o[0][2] ? matchesStrictComparable(o[0][0], o[0][1]) : function(s) {
|
|
506
|
-
return s === a || baseIsMatch(s, a, o);
|
|
507
|
-
};
|
|
508
|
-
}
|
|
509
|
-
function baseHasIn(a, o) {
|
|
510
|
-
return a != null && o in Object(a);
|
|
511
|
-
}
|
|
512
|
-
function hasPath(a, o, s) {
|
|
513
|
-
o = castPath(o, a);
|
|
514
|
-
for (var c = -1, l = o.length, u = !1; ++c < l;) {
|
|
515
|
-
var d = toKey(o[c]);
|
|
516
|
-
if (!(u = a != null && s(a, d))) break;
|
|
517
|
-
a = a[d];
|
|
518
|
-
}
|
|
519
|
-
return u || ++c != l ? u : (l = a == null ? 0 : a.length, !!l && isLength(l) && isIndex(d, l) && (isArray(a) || isArguments(a)));
|
|
520
|
-
}
|
|
521
|
-
function hasIn(a, o) {
|
|
522
|
-
return a != null && hasPath(a, o, baseHasIn);
|
|
523
|
-
}
|
|
524
|
-
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
525
|
-
function baseMatchesProperty(a, o) {
|
|
526
|
-
return isKey(a) && isStrictComparable(o) ? matchesStrictComparable(toKey(a), o) : function(s) {
|
|
527
|
-
var c = get$1(s, a);
|
|
528
|
-
return c === void 0 && c === o ? hasIn(s, a) : baseIsEqual(o, c, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
function baseProperty(a) {
|
|
532
|
-
return function(o) {
|
|
533
|
-
return o?.[a];
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
function basePropertyDeep(a) {
|
|
537
|
-
return function(o) {
|
|
538
|
-
return baseGet(o, a);
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
function property(a) {
|
|
542
|
-
return isKey(a) ? baseProperty(toKey(a)) : basePropertyDeep(a);
|
|
543
|
-
}
|
|
544
|
-
function baseIteratee(a) {
|
|
545
|
-
return typeof a == "function" ? a : a == null ? identity : typeof a == "object" ? isArray(a) ? baseMatchesProperty(a[0], a[1]) : baseMatches(a) : property(a);
|
|
546
|
-
}
|
|
547
|
-
var now = function() {
|
|
548
|
-
return root.Date.now();
|
|
549
|
-
}, FUNC_ERROR_TEXT = "Expected a function", nativeMax$1 = Math.max, nativeMin$1 = Math.min;
|
|
550
|
-
function debounce(a, o, s) {
|
|
551
|
-
var c, l, u, d, f, p, m = 0, h = !1, _ = !1, v = !0;
|
|
552
|
-
if (typeof a != "function") throw TypeError(FUNC_ERROR_TEXT);
|
|
553
|
-
o = toNumber(o) || 0, isObject$1(s) && (h = !!s.leading, _ = "maxWait" in s, u = _ ? nativeMax$1(toNumber(s.maxWait) || 0, o) : u, v = "trailing" in s ? !!s.trailing : v);
|
|
554
|
-
function y(o) {
|
|
555
|
-
var s = c, u = l;
|
|
556
|
-
return c = l = void 0, m = o, d = a.apply(u, s), d;
|
|
557
|
-
}
|
|
558
|
-
function b(a) {
|
|
559
|
-
return m = a, f = setTimeout(C, o), h ? y(a) : d;
|
|
560
|
-
}
|
|
561
|
-
function x(a) {
|
|
562
|
-
var s = a - p, c = a - m, l = o - s;
|
|
563
|
-
return _ ? nativeMin$1(l, u - c) : l;
|
|
564
|
-
}
|
|
565
|
-
function S(a) {
|
|
566
|
-
var s = a - p, c = a - m;
|
|
567
|
-
return p === void 0 || s >= o || s < 0 || _ && c >= u;
|
|
568
|
-
}
|
|
569
|
-
function C() {
|
|
570
|
-
var a = now();
|
|
571
|
-
if (S(a)) return w(a);
|
|
572
|
-
f = setTimeout(C, x(a));
|
|
573
|
-
}
|
|
574
|
-
function w(a) {
|
|
575
|
-
return f = void 0, v && c ? y(a) : (c = l = void 0, d);
|
|
576
|
-
}
|
|
577
|
-
function T() {
|
|
578
|
-
f !== void 0 && clearTimeout(f), m = 0, c = p = l = f = void 0;
|
|
579
|
-
}
|
|
580
|
-
function E() {
|
|
581
|
-
return f === void 0 ? d : w(now());
|
|
582
|
-
}
|
|
583
|
-
function D() {
|
|
584
|
-
var a = now(), s = S(a);
|
|
585
|
-
if (c = arguments, l = this, p = a, s) {
|
|
586
|
-
if (f === void 0) return b(p);
|
|
587
|
-
if (_) return clearTimeout(f), f = setTimeout(C, o), y(p);
|
|
588
|
-
}
|
|
589
|
-
return f === void 0 && (f = setTimeout(C, o)), d;
|
|
590
|
-
}
|
|
591
|
-
return D.cancel = T, D.flush = E, D;
|
|
592
|
-
}
|
|
593
|
-
function isArrayLikeObject(a) {
|
|
594
|
-
return isObjectLike(a) && isArrayLike(a);
|
|
595
|
-
}
|
|
596
|
-
function arrayIncludesWith(a, o, s) {
|
|
597
|
-
for (var c = -1, l = a == null ? 0 : a.length; ++c < l;) if (s(o, a[c])) return !0;
|
|
598
|
-
return !1;
|
|
599
|
-
}
|
|
600
|
-
function last(a) {
|
|
601
|
-
var o = a == null ? 0 : a.length;
|
|
602
|
-
return o ? a[o - 1] : void 0;
|
|
603
|
-
}
|
|
604
|
-
function createFind(a) {
|
|
605
|
-
return function(s, c, l) {
|
|
606
|
-
var u = Object(s);
|
|
607
|
-
if (!isArrayLike(s)) {
|
|
608
|
-
var d = baseIteratee(c, 3);
|
|
609
|
-
s = keys(s), c = function(a) {
|
|
610
|
-
return d(u[a], a, u);
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
var f = a(s, c, l);
|
|
614
|
-
return f > -1 ? u[d ? s[f] : f] : void 0;
|
|
615
|
-
};
|
|
616
|
-
}
|
|
617
|
-
var nativeMax = Math.max;
|
|
618
|
-
function findIndex(a, o, s) {
|
|
619
|
-
var c = a == null ? 0 : a.length;
|
|
620
|
-
if (!c) return -1;
|
|
621
|
-
var l = s == null ? 0 : toInteger(s);
|
|
622
|
-
return l < 0 && (l = nativeMax(c + l, 0)), baseFindIndex(a, baseIteratee(o, 3), l);
|
|
623
|
-
}
|
|
624
|
-
var find = createFind(findIndex), nativeMin = Math.min;
|
|
625
|
-
function baseIntersection(a, o, s) {
|
|
626
|
-
for (var c = s ? arrayIncludesWith : arrayIncludes, l = a[0].length, u = a.length, d = u, f = Array(u), p = Infinity, m = []; d--;) {
|
|
627
|
-
var h = a[d];
|
|
628
|
-
d && o && (h = arrayMap(h, baseUnary(o))), p = nativeMin(h.length, p), f[d] = !s && (o || l >= 120 && h.length >= 120) ? new SetCache(d && h) : void 0;
|
|
629
|
-
}
|
|
630
|
-
h = a[0];
|
|
631
|
-
var g = -1, _ = f[0];
|
|
632
|
-
outer: for (; ++g < l && m.length < p;) {
|
|
633
|
-
var y = h[g], b = o ? o(y) : y;
|
|
634
|
-
if (y = s || y !== 0 ? y : 0, !(_ ? cacheHas(_, b) : c(m, b, s))) {
|
|
635
|
-
for (d = u; --d;) {
|
|
636
|
-
var x = f[d];
|
|
637
|
-
if (!(x ? cacheHas(x, b) : c(a[d], b, s))) continue outer;
|
|
638
|
-
}
|
|
639
|
-
_ && _.push(b), m.push(y);
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
return m;
|
|
643
|
-
}
|
|
644
|
-
function castArrayLikeObject(a) {
|
|
645
|
-
return isArrayLikeObject(a) ? a : [];
|
|
646
|
-
}
|
|
647
|
-
var intersection = baseRest(function(a) {
|
|
648
|
-
var o = arrayMap(a, castArrayLikeObject);
|
|
649
|
-
return o.length && o[0] === a[0] ? baseIntersection(o) : [];
|
|
650
|
-
});
|
|
651
|
-
function parent(a, o) {
|
|
652
|
-
return o.length < 2 ? a : baseGet(a, baseSlice(o, 0, -1));
|
|
653
|
-
}
|
|
654
|
-
function baseUnset(a, o) {
|
|
655
|
-
return o = castPath(o, a), a = parent(a, o), a == null || delete a[toKey(last(o))];
|
|
656
|
-
}
|
|
657
|
-
function customOmitClone(a) {
|
|
658
|
-
return isPlainObject(a) ? void 0 : a;
|
|
659
|
-
}
|
|
660
|
-
var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4, omit = flatRest(function(a, o) {
|
|
661
|
-
var s = {};
|
|
662
|
-
if (a == null) return s;
|
|
663
|
-
var c = !1;
|
|
664
|
-
o = arrayMap(o, function(o) {
|
|
665
|
-
return o = castPath(o, a), c ||= o.length > 1, o;
|
|
666
|
-
}), copyObject(a, getAllKeysIn(a), s), c && (s = baseClone(s, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone));
|
|
667
|
-
for (var l = o.length; l--;) baseUnset(s, o[l]);
|
|
668
|
-
return s;
|
|
669
|
-
});
|
|
670
|
-
const responsiveArray = [
|
|
671
|
-
"xxxl",
|
|
672
|
-
"xxl",
|
|
673
|
-
"xl",
|
|
674
|
-
"lg",
|
|
675
|
-
"md",
|
|
676
|
-
"sm",
|
|
677
|
-
"xs"
|
|
678
|
-
];
|
|
679
|
-
var getResponsiveMap = (a) => ({
|
|
680
|
-
xs: `(max-width: ${a.screenXSMax}px)`,
|
|
681
|
-
sm: `(min-width: ${a.screenSM}px)`,
|
|
682
|
-
md: `(min-width: ${a.screenMD}px)`,
|
|
683
|
-
lg: `(min-width: ${a.screenLG}px)`,
|
|
684
|
-
xl: `(min-width: ${a.screenXL}px)`,
|
|
685
|
-
xxl: `(min-width: ${a.screenXXL}px)`,
|
|
686
|
-
xxxl: `{min-width: ${a.screenXXXL}px}`
|
|
687
|
-
});
|
|
688
|
-
function useResponsiveObserver() {
|
|
689
|
-
let [, a] = useToken();
|
|
690
|
-
return computed(() => {
|
|
691
|
-
let o = getResponsiveMap(a.value), s = /* @__PURE__ */ new Map(), c = -1, l = {};
|
|
692
|
-
return {
|
|
693
|
-
matchHandlers: {},
|
|
694
|
-
dispatch(a) {
|
|
695
|
-
return l = a, s.forEach((a) => a(l)), s.size >= 1;
|
|
696
|
-
},
|
|
697
|
-
subscribe(a) {
|
|
698
|
-
return s.size || this.register(), c += 1, s.set(c, a), a(l), c;
|
|
699
|
-
},
|
|
700
|
-
unsubscribe(a) {
|
|
701
|
-
s.delete(a), s.size || this.unregister();
|
|
702
|
-
},
|
|
703
|
-
unregister() {
|
|
704
|
-
Object.keys(o).forEach((a) => {
|
|
705
|
-
let s = o[a], c = this.matchHandlers[s];
|
|
706
|
-
c?.mql.removeListener(c?.listener);
|
|
707
|
-
}), s.clear();
|
|
708
|
-
},
|
|
709
|
-
register() {
|
|
710
|
-
Object.keys(o).forEach((a) => {
|
|
711
|
-
let s = o[a], c = (o) => {
|
|
712
|
-
let { matches: s } = o;
|
|
713
|
-
this.dispatch(_extends$1(_extends$1({}, l), { [a]: s }));
|
|
714
|
-
}, d = window.matchMedia(s);
|
|
715
|
-
d.addListener(c), this.matchHandlers[s] = {
|
|
716
|
-
mql: d,
|
|
717
|
-
listener: c
|
|
718
|
-
}, c(d);
|
|
719
|
-
});
|
|
720
|
-
},
|
|
721
|
-
responsiveMap: o
|
|
722
|
-
};
|
|
723
|
-
});
|
|
724
|
-
}
|
|
725
|
-
var useFlexGapSupport_default = (() => {
|
|
726
|
-
let a = shallowRef(!1);
|
|
727
|
-
return onMounted(() => {
|
|
728
|
-
a.value = detectFlexGapSupported();
|
|
729
|
-
}), a;
|
|
730
|
-
});
|
|
731
|
-
const RowContextKey = Symbol("rowContextKey");
|
|
732
|
-
var useProvideRow = (a) => {
|
|
733
|
-
provide(RowContextKey, a);
|
|
734
|
-
}, useInjectRow = () => inject(RowContextKey, {
|
|
735
|
-
gutter: computed(() => void 0),
|
|
736
|
-
wrap: computed(() => void 0),
|
|
737
|
-
supportFlexGap: computed(() => void 0)
|
|
738
|
-
}), genGridRowStyle = (a) => {
|
|
739
|
-
let { componentCls: o } = a;
|
|
740
|
-
return { [o]: {
|
|
741
|
-
display: "flex",
|
|
742
|
-
flexFlow: "row wrap",
|
|
743
|
-
minWidth: 0,
|
|
744
|
-
"&::before, &::after": { display: "flex" },
|
|
745
|
-
"&-no-wrap": { flexWrap: "nowrap" },
|
|
746
|
-
"&-start": { justifyContent: "flex-start" },
|
|
747
|
-
"&-center": { justifyContent: "center" },
|
|
748
|
-
"&-end": { justifyContent: "flex-end" },
|
|
749
|
-
"&-space-between": { justifyContent: "space-between" },
|
|
750
|
-
"&-space-around ": { justifyContent: "space-around" },
|
|
751
|
-
"&-space-evenly ": { justifyContent: "space-evenly" },
|
|
752
|
-
"&-top": { alignItems: "flex-start" },
|
|
753
|
-
"&-middle": { alignItems: "center" },
|
|
754
|
-
"&-bottom": { alignItems: "flex-end" }
|
|
755
|
-
} };
|
|
756
|
-
}, genGridColStyle = (a) => {
|
|
757
|
-
let { componentCls: o } = a;
|
|
758
|
-
return { [o]: {
|
|
759
|
-
position: "relative",
|
|
760
|
-
maxWidth: "100%",
|
|
761
|
-
minHeight: 1
|
|
762
|
-
} };
|
|
763
|
-
}, genLoopGridColumnsStyle = (a, o) => {
|
|
764
|
-
let { componentCls: s, gridColumns: c } = a, l = {};
|
|
765
|
-
for (let a = c; a >= 0; a--) a === 0 ? (l[`${s}${o}-${a}`] = { display: "none" }, l[`${s}-push-${a}`] = { insetInlineStart: "auto" }, l[`${s}-pull-${a}`] = { insetInlineEnd: "auto" }, l[`${s}${o}-push-${a}`] = { insetInlineStart: "auto" }, l[`${s}${o}-pull-${a}`] = { insetInlineEnd: "auto" }, l[`${s}${o}-offset-${a}`] = { marginInlineEnd: 0 }, l[`${s}${o}-order-${a}`] = { order: 0 }) : (l[`${s}${o}-${a}`] = {
|
|
766
|
-
display: "block",
|
|
767
|
-
flex: `0 0 ${a / c * 100}%`,
|
|
768
|
-
maxWidth: `${a / c * 100}%`
|
|
769
|
-
}, l[`${s}${o}-push-${a}`] = { insetInlineStart: `${a / c * 100}%` }, l[`${s}${o}-pull-${a}`] = { insetInlineEnd: `${a / c * 100}%` }, l[`${s}${o}-offset-${a}`] = { marginInlineStart: `${a / c * 100}%` }, l[`${s}${o}-order-${a}`] = { order: a });
|
|
770
|
-
return l;
|
|
771
|
-
}, genGridStyle = (a, o) => genLoopGridColumnsStyle(a, o), genGridMediaStyle = (a, o, s) => ({ [`@media (min-width: ${o}px)`]: _extends$1({}, genGridStyle(a, s)) });
|
|
772
|
-
const useRowStyle = genComponentStyleHook("Grid", (a) => [genGridRowStyle(a)]), useColStyle = genComponentStyleHook("Grid", (a) => {
|
|
773
|
-
let o = merge(a, { gridColumns: 24 }), s = {
|
|
774
|
-
"-sm": o.screenSMMin,
|
|
775
|
-
"-md": o.screenMDMin,
|
|
776
|
-
"-lg": o.screenLGMin,
|
|
777
|
-
"-xl": o.screenXLMin,
|
|
778
|
-
"-xxl": o.screenXXLMin
|
|
779
|
-
};
|
|
780
|
-
return [
|
|
781
|
-
genGridColStyle(o),
|
|
782
|
-
genGridStyle(o, ""),
|
|
783
|
-
genGridStyle(o, "-xs"),
|
|
784
|
-
Object.keys(s).map((a) => genGridMediaStyle(o, s[a], a)).reduce((a, o) => _extends$1(_extends$1({}, a), o), {})
|
|
785
|
-
];
|
|
786
|
-
});
|
|
787
|
-
var ARow = defineComponent({
|
|
788
|
-
compatConfig: { MODE: 3 },
|
|
789
|
-
name: "ARow",
|
|
790
|
-
inheritAttrs: !1,
|
|
791
|
-
props: {
|
|
792
|
-
align: someType([String, Object]),
|
|
793
|
-
justify: someType([String, Object]),
|
|
794
|
-
prefixCls: String,
|
|
795
|
-
gutter: someType([
|
|
796
|
-
Number,
|
|
797
|
-
Array,
|
|
798
|
-
Object
|
|
799
|
-
], 0),
|
|
800
|
-
wrap: {
|
|
801
|
-
type: Boolean,
|
|
802
|
-
default: void 0
|
|
803
|
-
}
|
|
804
|
-
},
|
|
805
|
-
setup(a, o) {
|
|
806
|
-
let { slots: s, attrs: c } = o, { prefixCls: l, direction: d } = useConfigInject_default("row", a), [f, p] = useRowStyle(l), m, h = useResponsiveObserver(), g = ref({
|
|
807
|
-
xs: !0,
|
|
808
|
-
sm: !0,
|
|
809
|
-
md: !0,
|
|
810
|
-
lg: !0,
|
|
811
|
-
xl: !0,
|
|
812
|
-
xxl: !0
|
|
813
|
-
}), _ = ref({
|
|
814
|
-
xs: !1,
|
|
815
|
-
sm: !1,
|
|
816
|
-
md: !1,
|
|
817
|
-
lg: !1,
|
|
818
|
-
xl: !1,
|
|
819
|
-
xxl: !1
|
|
820
|
-
}), v = (o) => computed(() => {
|
|
821
|
-
if (typeof a[o] == "string") return a[o];
|
|
822
|
-
if (typeof a[o] != "object") return "";
|
|
823
|
-
for (let s = 0; s < responsiveArray.length; s++) {
|
|
824
|
-
let c = responsiveArray[s];
|
|
825
|
-
if (!_.value[c]) continue;
|
|
826
|
-
let l = a[o][c];
|
|
827
|
-
if (l !== void 0) return l;
|
|
828
|
-
}
|
|
829
|
-
return "";
|
|
830
|
-
}), y = v("align"), b = v("justify"), x = useFlexGapSupport_default();
|
|
831
|
-
onMounted(() => {
|
|
832
|
-
m = h.value.subscribe((o) => {
|
|
833
|
-
_.value = o;
|
|
834
|
-
let s = a.gutter || 0;
|
|
835
|
-
(!Array.isArray(s) && typeof s == "object" || Array.isArray(s) && (typeof s[0] == "object" || typeof s[1] == "object")) && (g.value = o);
|
|
836
|
-
});
|
|
837
|
-
}), onBeforeUnmount(() => {
|
|
838
|
-
h.value.unsubscribe(m);
|
|
839
|
-
});
|
|
840
|
-
let S = computed(() => {
|
|
841
|
-
let o = [void 0, void 0], { gutter: s = 0 } = a;
|
|
842
|
-
return (Array.isArray(s) ? s : [s, void 0]).forEach((a, s) => {
|
|
843
|
-
if (typeof a == "object") for (let c = 0; c < responsiveArray.length; c++) {
|
|
844
|
-
let l = responsiveArray[c];
|
|
845
|
-
if (g.value[l] && a[l] !== void 0) {
|
|
846
|
-
o[s] = a[l];
|
|
847
|
-
break;
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
else o[s] = a;
|
|
851
|
-
}), o;
|
|
852
|
-
});
|
|
853
|
-
useProvideRow({
|
|
854
|
-
gutter: S,
|
|
855
|
-
supportFlexGap: x,
|
|
856
|
-
wrap: computed(() => a.wrap)
|
|
857
|
-
});
|
|
858
|
-
let C = computed(() => classNames(l.value, {
|
|
859
|
-
[`${l.value}-no-wrap`]: a.wrap === !1,
|
|
860
|
-
[`${l.value}-${b.value}`]: b.value,
|
|
861
|
-
[`${l.value}-${y.value}`]: y.value,
|
|
862
|
-
[`${l.value}-rtl`]: d.value === "rtl"
|
|
863
|
-
}, c.class, p.value)), w = computed(() => {
|
|
864
|
-
let a = S.value, o = {}, s = a[0] != null && a[0] > 0 ? `${a[0] / -2}px` : void 0, c = a[1] != null && a[1] > 0 ? `${a[1] / -2}px` : void 0;
|
|
865
|
-
return s && (o.marginLeft = s, o.marginRight = s), x.value ? o.rowGap = `${a[1]}px` : c && (o.marginTop = c, o.marginBottom = c), o;
|
|
866
|
-
});
|
|
867
|
-
return () => f(createVNode("div", _objectSpread2(_objectSpread2({}, c), {}, {
|
|
868
|
-
class: C.value,
|
|
869
|
-
style: _extends$1(_extends$1({}, w.value), c.style)
|
|
870
|
-
}), [s.default?.call(s)]));
|
|
871
|
-
}
|
|
872
|
-
});
|
|
873
|
-
function _extends() {
|
|
874
|
-
return _extends = Object.assign ? Object.assign.bind() : function(a) {
|
|
875
|
-
for (var o = 1; o < arguments.length; o++) {
|
|
876
|
-
var s = arguments[o];
|
|
877
|
-
for (var c in s) Object.prototype.hasOwnProperty.call(s, c) && (a[c] = s[c]);
|
|
878
|
-
}
|
|
879
|
-
return a;
|
|
880
|
-
}, _extends.apply(this, arguments);
|
|
881
|
-
}
|
|
882
|
-
function _inheritsLoose(a, o) {
|
|
883
|
-
a.prototype = Object.create(o.prototype), a.prototype.constructor = a, _setPrototypeOf(a, o);
|
|
884
|
-
}
|
|
885
|
-
function _getPrototypeOf(a) {
|
|
886
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(a) {
|
|
887
|
-
return a.__proto__ || Object.getPrototypeOf(a);
|
|
888
|
-
}, _getPrototypeOf(a);
|
|
889
|
-
}
|
|
890
|
-
function _setPrototypeOf(a, o) {
|
|
891
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, o) {
|
|
892
|
-
return a.__proto__ = o, a;
|
|
893
|
-
}, _setPrototypeOf(a, o);
|
|
894
|
-
}
|
|
895
|
-
function _isNativeReflectConstruct() {
|
|
896
|
-
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
897
|
-
if (typeof Proxy == "function") return !0;
|
|
898
|
-
try {
|
|
899
|
-
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0;
|
|
900
|
-
} catch {
|
|
901
|
-
return !1;
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
function _construct(a, o, s) {
|
|
905
|
-
return _construct = _isNativeReflectConstruct() ? Reflect.construct.bind() : function(a, o, s) {
|
|
906
|
-
var c = [null];
|
|
907
|
-
c.push.apply(c, o);
|
|
908
|
-
var l = new (Function.bind.apply(a, c))();
|
|
909
|
-
return s && _setPrototypeOf(l, s.prototype), l;
|
|
910
|
-
}, _construct.apply(null, arguments);
|
|
911
|
-
}
|
|
912
|
-
function _isNativeFunction(a) {
|
|
913
|
-
return Function.toString.call(a).indexOf("[native code]") !== -1;
|
|
914
|
-
}
|
|
915
|
-
function _wrapNativeSuper(a) {
|
|
916
|
-
var o = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
917
|
-
return _wrapNativeSuper = function(a) {
|
|
918
|
-
if (a === null || !_isNativeFunction(a)) return a;
|
|
919
|
-
if (typeof a != "function") throw TypeError("Super expression must either be null or a function");
|
|
920
|
-
if (o !== void 0) {
|
|
921
|
-
if (o.has(a)) return o.get(a);
|
|
922
|
-
o.set(a, s);
|
|
923
|
-
}
|
|
924
|
-
function s() {
|
|
925
|
-
return _construct(a, arguments, _getPrototypeOf(this).constructor);
|
|
926
|
-
}
|
|
927
|
-
return s.prototype = Object.create(a.prototype, { constructor: {
|
|
928
|
-
value: s,
|
|
929
|
-
enumerable: !1,
|
|
930
|
-
writable: !0,
|
|
931
|
-
configurable: !0
|
|
932
|
-
} }), _setPrototypeOf(s, a);
|
|
933
|
-
}, _wrapNativeSuper(a);
|
|
934
|
-
}
|
|
935
|
-
var formatRegExp = /%[sdj%]/g, warning = function() {};
|
|
936
|
-
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (warning = function(a, o) {
|
|
937
|
-
typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && o.every(function(a) {
|
|
938
|
-
return typeof a == "string";
|
|
939
|
-
}) && console.warn(a, o);
|
|
940
|
-
});
|
|
941
|
-
function convertFieldsError(a) {
|
|
942
|
-
if (!a || !a.length) return null;
|
|
943
|
-
var o = {};
|
|
944
|
-
return a.forEach(function(a) {
|
|
945
|
-
var s = a.field;
|
|
946
|
-
o[s] = o[s] || [], o[s].push(a);
|
|
947
|
-
}), o;
|
|
948
|
-
}
|
|
949
|
-
function format(a) {
|
|
950
|
-
var o = [...arguments].slice(1), s = 0, c = o.length;
|
|
951
|
-
return typeof a == "function" ? a.apply(null, o) : typeof a == "string" ? a.replace(formatRegExp, function(a) {
|
|
952
|
-
if (a === "%%") return "%";
|
|
953
|
-
if (s >= c) return a;
|
|
954
|
-
switch (a) {
|
|
955
|
-
case "%s": return String(o[s++]);
|
|
956
|
-
case "%d": return Number(o[s++]);
|
|
957
|
-
case "%j":
|
|
958
|
-
try {
|
|
959
|
-
return JSON.stringify(o[s++]);
|
|
960
|
-
} catch {
|
|
961
|
-
return "[Circular]";
|
|
962
|
-
}
|
|
963
|
-
break;
|
|
964
|
-
default: return a;
|
|
965
|
-
}
|
|
966
|
-
}) : a;
|
|
967
|
-
}
|
|
968
|
-
function isNativeStringType(a) {
|
|
969
|
-
return a === "string" || a === "url" || a === "hex" || a === "email" || a === "date" || a === "pattern";
|
|
970
|
-
}
|
|
971
|
-
function isEmptyValue(a, o) {
|
|
972
|
-
return !!(a == null || o === "array" && Array.isArray(a) && !a.length || isNativeStringType(o) && typeof a == "string" && !a);
|
|
973
|
-
}
|
|
974
|
-
function asyncParallelArray(a, o, s) {
|
|
975
|
-
var c = [], l = 0, u = a.length;
|
|
976
|
-
function d(a) {
|
|
977
|
-
c.push.apply(c, a || []), l++, l === u && s(c);
|
|
978
|
-
}
|
|
979
|
-
a.forEach(function(a) {
|
|
980
|
-
o(a, d);
|
|
981
|
-
});
|
|
982
|
-
}
|
|
983
|
-
function asyncSerialArray(a, o, s) {
|
|
984
|
-
var c = 0, l = a.length;
|
|
985
|
-
function u(d) {
|
|
986
|
-
if (d && d.length) {
|
|
987
|
-
s(d);
|
|
988
|
-
return;
|
|
989
|
-
}
|
|
990
|
-
var f = c;
|
|
991
|
-
c += 1, f < l ? o(a[f], u) : s([]);
|
|
992
|
-
}
|
|
993
|
-
u([]);
|
|
994
|
-
}
|
|
995
|
-
function flattenObjArr(a) {
|
|
996
|
-
var o = [];
|
|
997
|
-
return Object.keys(a).forEach(function(s) {
|
|
998
|
-
o.push.apply(o, a[s] || []);
|
|
999
|
-
}), o;
|
|
1000
|
-
}
|
|
1001
|
-
var AsyncValidationError = /* @__PURE__ */ function(a) {
|
|
1002
|
-
_inheritsLoose(o, a);
|
|
1003
|
-
function o(o, s) {
|
|
1004
|
-
var c = a.call(this, "Async Validation Error") || this;
|
|
1005
|
-
return c.errors = o, c.fields = s, c;
|
|
1006
|
-
}
|
|
1007
|
-
return o;
|
|
1008
|
-
}(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
1009
|
-
function asyncMap(a, o, s, c, l) {
|
|
1010
|
-
if (o.first) {
|
|
1011
|
-
var u = new Promise(function(o, u) {
|
|
1012
|
-
asyncSerialArray(flattenObjArr(a), s, function(a) {
|
|
1013
|
-
return c(a), a.length ? u(new AsyncValidationError(a, convertFieldsError(a))) : o(l);
|
|
1014
|
-
});
|
|
1015
|
-
});
|
|
1016
|
-
return u.catch(function(a) {
|
|
1017
|
-
return a;
|
|
1018
|
-
}), u;
|
|
1019
|
-
}
|
|
1020
|
-
var d = o.firstFields === !0 ? Object.keys(a) : o.firstFields || [], f = Object.keys(a), p = f.length, m = 0, h = [], g = new Promise(function(o, u) {
|
|
1021
|
-
var g = function(a) {
|
|
1022
|
-
if (h.push.apply(h, a), m++, m === p) return c(h), h.length ? u(new AsyncValidationError(h, convertFieldsError(h))) : o(l);
|
|
1023
|
-
};
|
|
1024
|
-
f.length || (c(h), o(l)), f.forEach(function(o) {
|
|
1025
|
-
var c = a[o];
|
|
1026
|
-
d.indexOf(o) === -1 ? asyncParallelArray(c, s, g) : asyncSerialArray(c, s, g);
|
|
1027
|
-
});
|
|
1028
|
-
});
|
|
1029
|
-
return g.catch(function(a) {
|
|
1030
|
-
return a;
|
|
1031
|
-
}), g;
|
|
1032
|
-
}
|
|
1033
|
-
function isErrorObj(a) {
|
|
1034
|
-
return !!(a && a.message !== void 0);
|
|
1035
|
-
}
|
|
1036
|
-
function getValue$1(a, o) {
|
|
1037
|
-
for (var s = a, c = 0; c < o.length; c++) {
|
|
1038
|
-
if (s == null) return s;
|
|
1039
|
-
s = s[o[c]];
|
|
1040
|
-
}
|
|
1041
|
-
return s;
|
|
1042
|
-
}
|
|
1043
|
-
function complementError(a, o) {
|
|
1044
|
-
return function(s) {
|
|
1045
|
-
var c = a.fullFields ? getValue$1(o, a.fullFields) : o[s.field || a.fullField];
|
|
1046
|
-
return isErrorObj(s) ? (s.field = s.field || a.fullField, s.fieldValue = c, s) : {
|
|
1047
|
-
message: typeof s == "function" ? s() : s,
|
|
1048
|
-
fieldValue: c,
|
|
1049
|
-
field: s.field || a.fullField
|
|
1050
|
-
};
|
|
1051
|
-
};
|
|
1052
|
-
}
|
|
1053
|
-
function deepMerge(a, o) {
|
|
1054
|
-
if (o) {
|
|
1055
|
-
for (var s in o) if (o.hasOwnProperty(s)) {
|
|
1056
|
-
var c = o[s];
|
|
1057
|
-
typeof c == "object" && typeof a[s] == "object" ? a[s] = _extends({}, a[s], c) : a[s] = c;
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
return a;
|
|
1061
|
-
}
|
|
1062
|
-
var required$1 = function(a, o, s, c, l, u) {
|
|
1063
|
-
a.required && (!s.hasOwnProperty(a.field) || isEmptyValue(o, u || a.type)) && c.push(format(l.messages.required, a.fullField));
|
|
1064
|
-
}, whitespace = function(a, o, s, c, l) {
|
|
1065
|
-
(/^\s+$/.test(o) || o === "") && c.push(format(l.messages.whitespace, a.fullField));
|
|
1066
|
-
}, urlReg, getUrlRegex = (function() {
|
|
1067
|
-
if (urlReg) return urlReg;
|
|
1068
|
-
var a = "[a-fA-F\\d:]", o = function(o) {
|
|
1069
|
-
return o && o.includeBoundaries ? "(?:(?<=\\s|^)(?=" + a + ")|(?<=" + a + ")(?=\\s|$))" : "";
|
|
1070
|
-
}, s = "(?: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}", c = "[a-fA-F\\d]{1,4}", l = ("\n(?:\n(?:" + c + ":){7}(?:" + c + "|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:" + c + ":){6}(?:" + s + "|:" + c + "|:)| // 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\n(?:" + c + ":){5}(?::" + s + "|(?::" + c + "){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\n(?:" + c + ":){4}(?:(?::" + c + "){0,1}:" + s + "|(?::" + c + "){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\n(?:" + c + ":){3}(?:(?::" + c + "){0,2}:" + s + "|(?::" + c + "){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\n(?:" + c + ":){2}(?:(?::" + c + "){0,3}:" + s + "|(?::" + c + "){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:" + c + ":){1}(?:(?::" + c + "){0,4}:" + s + "|(?::" + c + "){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::" + c + "){0,5}:" + s + "|(?::" + c + "){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), u = RegExp("(?:^" + s + "$)|(?:^" + l + "$)"), d = RegExp("^" + s + "$"), f = RegExp("^" + l + "$"), p = function(a) {
|
|
1071
|
-
return a && a.exact ? u : RegExp("(?:" + o(a) + s + o(a) + ")|(?:" + o(a) + l + o(a) + ")", "g");
|
|
1072
|
-
};
|
|
1073
|
-
p.v4 = function(a) {
|
|
1074
|
-
return a && a.exact ? d : RegExp("" + o(a) + s + o(a), "g");
|
|
1075
|
-
}, p.v6 = function(a) {
|
|
1076
|
-
return a && a.exact ? f : RegExp("" + o(a) + l + o(a), "g");
|
|
1077
|
-
};
|
|
1078
|
-
var m = "(?:(?:[a-z]+:)?//)", h = "(?:\\S+(?::\\S*)?@)?", g = p.v4().source, _ = p.v6().source, v = "(?:" + m + "|www\\.)" + h + "(?:localhost|" + g + "|" + _ + "|(?:(?:[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,})))(?::\\d{2,5})?(?:[/?#][^\\s\"]*)?";
|
|
1079
|
-
return urlReg = RegExp("(?:^" + v + "$)", "i"), urlReg;
|
|
1080
|
-
}), pattern$2 = {
|
|
1081
|
-
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,}))$/,
|
|
1082
|
-
hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
|
|
1083
|
-
}, types = {
|
|
1084
|
-
integer: function(a) {
|
|
1085
|
-
return types.number(a) && parseInt(a, 10) === a;
|
|
1086
|
-
},
|
|
1087
|
-
float: function(a) {
|
|
1088
|
-
return types.number(a) && !types.integer(a);
|
|
1089
|
-
},
|
|
1090
|
-
array: function(a) {
|
|
1091
|
-
return Array.isArray(a);
|
|
1092
|
-
},
|
|
1093
|
-
regexp: function(a) {
|
|
1094
|
-
if (a instanceof RegExp) return !0;
|
|
1095
|
-
try {
|
|
1096
|
-
return !!new RegExp(a);
|
|
1097
|
-
} catch {
|
|
1098
|
-
return !1;
|
|
1099
|
-
}
|
|
1100
|
-
},
|
|
1101
|
-
date: function(a) {
|
|
1102
|
-
return typeof a.getTime == "function" && typeof a.getMonth == "function" && typeof a.getYear == "function" && !isNaN(a.getTime());
|
|
1103
|
-
},
|
|
1104
|
-
number: function(a) {
|
|
1105
|
-
return isNaN(a) ? !1 : typeof a == "number";
|
|
1106
|
-
},
|
|
1107
|
-
object: function(a) {
|
|
1108
|
-
return typeof a == "object" && !types.array(a);
|
|
1109
|
-
},
|
|
1110
|
-
method: function(a) {
|
|
1111
|
-
return typeof a == "function";
|
|
1112
|
-
},
|
|
1113
|
-
email: function(a) {
|
|
1114
|
-
return typeof a == "string" && a.length <= 320 && !!a.match(pattern$2.email);
|
|
1115
|
-
},
|
|
1116
|
-
url: function(a) {
|
|
1117
|
-
return typeof a == "string" && a.length <= 2048 && !!a.match(getUrlRegex());
|
|
1118
|
-
},
|
|
1119
|
-
hex: function(a) {
|
|
1120
|
-
return typeof a == "string" && !!a.match(pattern$2.hex);
|
|
1121
|
-
}
|
|
1122
|
-
}, type$1 = function(a, o, s, c, l) {
|
|
1123
|
-
if (a.required && o === void 0) {
|
|
1124
|
-
required$1(a, o, s, c, l);
|
|
1125
|
-
return;
|
|
1126
|
-
}
|
|
1127
|
-
var u = [
|
|
1128
|
-
"integer",
|
|
1129
|
-
"float",
|
|
1130
|
-
"array",
|
|
1131
|
-
"regexp",
|
|
1132
|
-
"object",
|
|
1133
|
-
"method",
|
|
1134
|
-
"email",
|
|
1135
|
-
"number",
|
|
1136
|
-
"date",
|
|
1137
|
-
"url",
|
|
1138
|
-
"hex"
|
|
1139
|
-
], d = a.type;
|
|
1140
|
-
u.indexOf(d) > -1 ? types[d](o) || c.push(format(l.messages.types[d], a.fullField, a.type)) : d && typeof o !== a.type && c.push(format(l.messages.types[d], a.fullField, a.type));
|
|
1141
|
-
}, range = function(a, o, s, c, l) {
|
|
1142
|
-
var u = typeof a.len == "number", d = typeof a.min == "number", f = typeof a.max == "number", p = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, m = o, h = null, g = typeof o == "number", _ = typeof o == "string", v = Array.isArray(o);
|
|
1143
|
-
if (g ? h = "number" : _ ? h = "string" : v && (h = "array"), !h) return !1;
|
|
1144
|
-
v && (m = o.length), _ && (m = o.replace(p, "_").length), u ? m !== a.len && c.push(format(l.messages[h].len, a.fullField, a.len)) : d && !f && m < a.min ? c.push(format(l.messages[h].min, a.fullField, a.min)) : f && !d && m > a.max ? c.push(format(l.messages[h].max, a.fullField, a.max)) : d && f && (m < a.min || m > a.max) && c.push(format(l.messages[h].range, a.fullField, a.min, a.max));
|
|
1145
|
-
}, ENUM$1 = "enum", rules = {
|
|
1146
|
-
required: required$1,
|
|
1147
|
-
whitespace,
|
|
1148
|
-
type: type$1,
|
|
1149
|
-
range,
|
|
1150
|
-
enum: function(a, o, s, c, l) {
|
|
1151
|
-
a[ENUM$1] = Array.isArray(a[ENUM$1]) ? a[ENUM$1] : [], a[ENUM$1].indexOf(o) === -1 && c.push(format(l.messages[ENUM$1], a.fullField, a[ENUM$1].join(", ")));
|
|
1152
|
-
},
|
|
1153
|
-
pattern: function(a, o, s, c, l) {
|
|
1154
|
-
a.pattern && (a.pattern instanceof RegExp ? (a.pattern.lastIndex = 0, a.pattern.test(o) || c.push(format(l.messages.pattern.mismatch, a.fullField, o, a.pattern))) : typeof a.pattern == "string" && (new RegExp(a.pattern).test(o) || c.push(format(l.messages.pattern.mismatch, a.fullField, o, a.pattern))));
|
|
1155
|
-
}
|
|
1156
|
-
}, string = function(a, o, s, c, l) {
|
|
1157
|
-
var u = [];
|
|
1158
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1159
|
-
if (isEmptyValue(o, "string") && !a.required) return s();
|
|
1160
|
-
rules.required(a, o, c, u, l, "string"), isEmptyValue(o, "string") || (rules.type(a, o, c, u, l), rules.range(a, o, c, u, l), rules.pattern(a, o, c, u, l), a.whitespace === !0 && rules.whitespace(a, o, c, u, l));
|
|
1161
|
-
}
|
|
1162
|
-
s(u);
|
|
1163
|
-
}, method = function(a, o, s, c, l) {
|
|
1164
|
-
var u = [];
|
|
1165
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1166
|
-
if (isEmptyValue(o) && !a.required) return s();
|
|
1167
|
-
rules.required(a, o, c, u, l), o !== void 0 && rules.type(a, o, c, u, l);
|
|
1168
|
-
}
|
|
1169
|
-
s(u);
|
|
1170
|
-
}, number = function(a, o, s, c, l) {
|
|
1171
|
-
var u = [];
|
|
1172
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1173
|
-
if (o === "" && (o = void 0), isEmptyValue(o) && !a.required) return s();
|
|
1174
|
-
rules.required(a, o, c, u, l), o !== void 0 && (rules.type(a, o, c, u, l), rules.range(a, o, c, u, l));
|
|
1175
|
-
}
|
|
1176
|
-
s(u);
|
|
1177
|
-
}, _boolean = function(a, o, s, c, l) {
|
|
1178
|
-
var u = [];
|
|
1179
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1180
|
-
if (isEmptyValue(o) && !a.required) return s();
|
|
1181
|
-
rules.required(a, o, c, u, l), o !== void 0 && rules.type(a, o, c, u, l);
|
|
1182
|
-
}
|
|
1183
|
-
s(u);
|
|
1184
|
-
}, regexp = function(a, o, s, c, l) {
|
|
1185
|
-
var u = [];
|
|
1186
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1187
|
-
if (isEmptyValue(o) && !a.required) return s();
|
|
1188
|
-
rules.required(a, o, c, u, l), isEmptyValue(o) || rules.type(a, o, c, u, l);
|
|
1189
|
-
}
|
|
1190
|
-
s(u);
|
|
1191
|
-
}, integer = function(a, o, s, c, l) {
|
|
1192
|
-
var u = [];
|
|
1193
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1194
|
-
if (isEmptyValue(o) && !a.required) return s();
|
|
1195
|
-
rules.required(a, o, c, u, l), o !== void 0 && (rules.type(a, o, c, u, l), rules.range(a, o, c, u, l));
|
|
1196
|
-
}
|
|
1197
|
-
s(u);
|
|
1198
|
-
}, floatFn = function(a, o, s, c, l) {
|
|
1199
|
-
var u = [];
|
|
1200
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1201
|
-
if (isEmptyValue(o) && !a.required) return s();
|
|
1202
|
-
rules.required(a, o, c, u, l), o !== void 0 && (rules.type(a, o, c, u, l), rules.range(a, o, c, u, l));
|
|
1203
|
-
}
|
|
1204
|
-
s(u);
|
|
1205
|
-
}, array = function(a, o, s, c, l) {
|
|
1206
|
-
var u = [];
|
|
1207
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1208
|
-
if (o == null && !a.required) return s();
|
|
1209
|
-
rules.required(a, o, c, u, l, "array"), o != null && (rules.type(a, o, c, u, l), rules.range(a, o, c, u, l));
|
|
1210
|
-
}
|
|
1211
|
-
s(u);
|
|
1212
|
-
}, object = function(a, o, s, c, l) {
|
|
1213
|
-
var u = [];
|
|
1214
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1215
|
-
if (isEmptyValue(o) && !a.required) return s();
|
|
1216
|
-
rules.required(a, o, c, u, l), o !== void 0 && rules.type(a, o, c, u, l);
|
|
1217
|
-
}
|
|
1218
|
-
s(u);
|
|
1219
|
-
}, ENUM = "enum", enumerable = function(a, o, s, c, l) {
|
|
1220
|
-
var u = [];
|
|
1221
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1222
|
-
if (isEmptyValue(o) && !a.required) return s();
|
|
1223
|
-
rules.required(a, o, c, u, l), o !== void 0 && rules[ENUM](a, o, c, u, l);
|
|
1224
|
-
}
|
|
1225
|
-
s(u);
|
|
1226
|
-
}, pattern = function(a, o, s, c, l) {
|
|
1227
|
-
var u = [];
|
|
1228
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1229
|
-
if (isEmptyValue(o, "string") && !a.required) return s();
|
|
1230
|
-
rules.required(a, o, c, u, l), isEmptyValue(o, "string") || rules.pattern(a, o, c, u, l);
|
|
1231
|
-
}
|
|
1232
|
-
s(u);
|
|
1233
|
-
}, date = function(a, o, s, c, l) {
|
|
1234
|
-
var u = [];
|
|
1235
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1236
|
-
if (isEmptyValue(o, "date") && !a.required) return s();
|
|
1237
|
-
if (rules.required(a, o, c, u, l), !isEmptyValue(o, "date")) {
|
|
1238
|
-
var d = o instanceof Date ? o : new Date(o);
|
|
1239
|
-
rules.type(a, d, c, u, l), d && rules.range(a, d.getTime(), c, u, l);
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
s(u);
|
|
1243
|
-
}, required = function(a, o, s, c, l) {
|
|
1244
|
-
var u = [], d = Array.isArray(o) ? "array" : typeof o;
|
|
1245
|
-
rules.required(a, o, c, u, l, d), s(u);
|
|
1246
|
-
}, type = function(a, o, s, c, l) {
|
|
1247
|
-
var u = a.type, d = [];
|
|
1248
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1249
|
-
if (isEmptyValue(o, u) && !a.required) return s();
|
|
1250
|
-
rules.required(a, o, c, d, l, u), isEmptyValue(o, u) || rules.type(a, o, c, d, l);
|
|
1251
|
-
}
|
|
1252
|
-
s(d);
|
|
1253
|
-
}, validators = {
|
|
1254
|
-
string,
|
|
1255
|
-
method,
|
|
1256
|
-
number,
|
|
1257
|
-
boolean: _boolean,
|
|
1258
|
-
regexp,
|
|
1259
|
-
integer,
|
|
1260
|
-
float: floatFn,
|
|
1261
|
-
array,
|
|
1262
|
-
object,
|
|
1263
|
-
enum: enumerable,
|
|
1264
|
-
pattern,
|
|
1265
|
-
date,
|
|
1266
|
-
url: type,
|
|
1267
|
-
hex: type,
|
|
1268
|
-
email: type,
|
|
1269
|
-
required,
|
|
1270
|
-
any: function(a, o, s, c, l) {
|
|
1271
|
-
var u = [];
|
|
1272
|
-
if (a.required || !a.required && c.hasOwnProperty(a.field)) {
|
|
1273
|
-
if (isEmptyValue(o) && !a.required) return s();
|
|
1274
|
-
rules.required(a, o, c, u, l);
|
|
1275
|
-
}
|
|
1276
|
-
s(u);
|
|
1277
|
-
}
|
|
1278
|
-
};
|
|
1279
|
-
function newMessages() {
|
|
1280
|
-
return {
|
|
1281
|
-
default: "Validation error on field %s",
|
|
1282
|
-
required: "%s is required",
|
|
1283
|
-
enum: "%s must be one of %s",
|
|
1284
|
-
whitespace: "%s cannot be empty",
|
|
1285
|
-
date: {
|
|
1286
|
-
format: "%s date %s is invalid for format %s",
|
|
1287
|
-
parse: "%s date could not be parsed, %s is invalid ",
|
|
1288
|
-
invalid: "%s date %s is invalid"
|
|
1289
|
-
},
|
|
1290
|
-
types: {
|
|
1291
|
-
string: "%s is not a %s",
|
|
1292
|
-
method: "%s is not a %s (function)",
|
|
1293
|
-
array: "%s is not an %s",
|
|
1294
|
-
object: "%s is not an %s",
|
|
1295
|
-
number: "%s is not a %s",
|
|
1296
|
-
date: "%s is not a %s",
|
|
1297
|
-
boolean: "%s is not a %s",
|
|
1298
|
-
integer: "%s is not an %s",
|
|
1299
|
-
float: "%s is not a %s",
|
|
1300
|
-
regexp: "%s is not a valid %s",
|
|
1301
|
-
email: "%s is not a valid %s",
|
|
1302
|
-
url: "%s is not a valid %s",
|
|
1303
|
-
hex: "%s is not a valid %s"
|
|
1304
|
-
},
|
|
1305
|
-
string: {
|
|
1306
|
-
len: "%s must be exactly %s characters",
|
|
1307
|
-
min: "%s must be at least %s characters",
|
|
1308
|
-
max: "%s cannot be longer than %s characters",
|
|
1309
|
-
range: "%s must be between %s and %s characters"
|
|
1310
|
-
},
|
|
1311
|
-
number: {
|
|
1312
|
-
len: "%s must equal %s",
|
|
1313
|
-
min: "%s cannot be less than %s",
|
|
1314
|
-
max: "%s cannot be greater than %s",
|
|
1315
|
-
range: "%s must be between %s and %s"
|
|
1316
|
-
},
|
|
1317
|
-
array: {
|
|
1318
|
-
len: "%s must be exactly %s in length",
|
|
1319
|
-
min: "%s cannot be less than %s in length",
|
|
1320
|
-
max: "%s cannot be greater than %s in length",
|
|
1321
|
-
range: "%s must be between %s and %s in length"
|
|
1322
|
-
},
|
|
1323
|
-
pattern: { mismatch: "%s value %s does not match pattern %s" },
|
|
1324
|
-
clone: function() {
|
|
1325
|
-
var a = JSON.parse(JSON.stringify(this));
|
|
1326
|
-
return a.clone = this.clone, a;
|
|
1327
|
-
}
|
|
1328
|
-
};
|
|
1329
|
-
}
|
|
1330
|
-
var messages = newMessages(), Schema = /* @__PURE__ */ function() {
|
|
1331
|
-
function a(a) {
|
|
1332
|
-
this.rules = null, this._messages = messages, this.define(a);
|
|
1333
|
-
}
|
|
1334
|
-
var o = a.prototype;
|
|
1335
|
-
return o.define = function(a) {
|
|
1336
|
-
var o = this;
|
|
1337
|
-
if (!a) throw Error("Cannot configure a schema with no rules");
|
|
1338
|
-
if (typeof a != "object" || Array.isArray(a)) throw Error("Rules must be an object");
|
|
1339
|
-
this.rules = {}, Object.keys(a).forEach(function(s) {
|
|
1340
|
-
var c = a[s];
|
|
1341
|
-
o.rules[s] = Array.isArray(c) ? c : [c];
|
|
1342
|
-
});
|
|
1343
|
-
}, o.messages = function(a) {
|
|
1344
|
-
return a && (this._messages = deepMerge(newMessages(), a)), this._messages;
|
|
1345
|
-
}, o.validate = function(o, s, c) {
|
|
1346
|
-
var l = this;
|
|
1347
|
-
s === void 0 && (s = {}), c === void 0 && (c = function() {});
|
|
1348
|
-
var u = o, d = s, f = c;
|
|
1349
|
-
if (typeof d == "function" && (f = d, d = {}), !this.rules || Object.keys(this.rules).length === 0) return f && f(null, u), Promise.resolve(u);
|
|
1350
|
-
function p(a) {
|
|
1351
|
-
var o = [], s = {};
|
|
1352
|
-
function c(a) {
|
|
1353
|
-
if (Array.isArray(a)) {
|
|
1354
|
-
var s;
|
|
1355
|
-
o = (s = o).concat.apply(s, a);
|
|
1356
|
-
} else o.push(a);
|
|
1357
|
-
}
|
|
1358
|
-
for (var l = 0; l < a.length; l++) c(a[l]);
|
|
1359
|
-
o.length ? (s = convertFieldsError(o), f(o, s)) : f(null, u);
|
|
1360
|
-
}
|
|
1361
|
-
if (d.messages) {
|
|
1362
|
-
var m = this.messages();
|
|
1363
|
-
m === messages && (m = newMessages()), deepMerge(m, d.messages), d.messages = m;
|
|
1364
|
-
} else d.messages = this.messages();
|
|
1365
|
-
var h = {};
|
|
1366
|
-
(d.keys || Object.keys(this.rules)).forEach(function(a) {
|
|
1367
|
-
var s = l.rules[a], c = u[a];
|
|
1368
|
-
s.forEach(function(s) {
|
|
1369
|
-
var d = s;
|
|
1370
|
-
typeof d.transform == "function" && (u === o && (u = _extends({}, u)), c = u[a] = d.transform(c)), d = typeof d == "function" ? { validator: d } : _extends({}, d), d.validator = l.getValidationMethod(d), d.validator && (d.field = a, d.fullField = d.fullField || a, d.type = l.getType(d), h[a] = h[a] || [], h[a].push({
|
|
1371
|
-
rule: d,
|
|
1372
|
-
value: c,
|
|
1373
|
-
source: u,
|
|
1374
|
-
field: a
|
|
1375
|
-
}));
|
|
1376
|
-
});
|
|
1377
|
-
});
|
|
1378
|
-
var g = {};
|
|
1379
|
-
return asyncMap(h, d, function(o, s) {
|
|
1380
|
-
var c = o.rule, l = (c.type === "object" || c.type === "array") && (typeof c.fields == "object" || typeof c.defaultField == "object");
|
|
1381
|
-
l &&= c.required || !c.required && o.value, c.field = o.field;
|
|
1382
|
-
function f(a, o) {
|
|
1383
|
-
return _extends({}, o, {
|
|
1384
|
-
fullField: c.fullField + "." + a,
|
|
1385
|
-
fullFields: c.fullFields ? [].concat(c.fullFields, [a]) : [a]
|
|
1386
|
-
});
|
|
1387
|
-
}
|
|
1388
|
-
function p(p) {
|
|
1389
|
-
p === void 0 && (p = []);
|
|
1390
|
-
var m = Array.isArray(p) ? p : [p];
|
|
1391
|
-
!d.suppressWarning && m.length && a.warning("async-validator:", m), m.length && c.message !== void 0 && (m = [].concat(c.message));
|
|
1392
|
-
var h = m.map(complementError(c, u));
|
|
1393
|
-
if (d.first && h.length) return g[c.field] = 1, s(h);
|
|
1394
|
-
if (!l) s(h);
|
|
1395
|
-
else {
|
|
1396
|
-
if (c.required && !o.value) return c.message === void 0 ? d.error && (h = [d.error(c, format(d.messages.required, c.field))]) : h = [].concat(c.message).map(complementError(c, u)), s(h);
|
|
1397
|
-
var _ = {};
|
|
1398
|
-
c.defaultField && Object.keys(o.value).map(function(a) {
|
|
1399
|
-
_[a] = c.defaultField;
|
|
1400
|
-
}), _ = _extends({}, _, o.rule.fields);
|
|
1401
|
-
var v = {};
|
|
1402
|
-
Object.keys(_).forEach(function(a) {
|
|
1403
|
-
var o = _[a];
|
|
1404
|
-
v[a] = (Array.isArray(o) ? o : [o]).map(f.bind(null, a));
|
|
1405
|
-
});
|
|
1406
|
-
var y = new a(v);
|
|
1407
|
-
y.messages(d.messages), o.rule.options && (o.rule.options.messages = d.messages, o.rule.options.error = d.error), y.validate(o.value, o.rule.options || d, function(a) {
|
|
1408
|
-
var o = [];
|
|
1409
|
-
h && h.length && o.push.apply(o, h), a && a.length && o.push.apply(o, a), s(o.length ? o : null);
|
|
1410
|
-
});
|
|
1411
|
-
}
|
|
1412
|
-
}
|
|
1413
|
-
var m;
|
|
1414
|
-
if (c.asyncValidator) m = c.asyncValidator(c, o.value, p, o.source, d);
|
|
1415
|
-
else if (c.validator) {
|
|
1416
|
-
try {
|
|
1417
|
-
m = c.validator(c, o.value, p, o.source, d);
|
|
1418
|
-
} catch (a) {
|
|
1419
|
-
console.error == null || console.error(a), d.suppressValidatorError || setTimeout(function() {
|
|
1420
|
-
throw a;
|
|
1421
|
-
}, 0), p(a.message);
|
|
1422
|
-
}
|
|
1423
|
-
m === !0 ? p() : m === !1 ? p(typeof c.message == "function" ? c.message(c.fullField || c.field) : c.message || (c.fullField || c.field) + " fails") : m instanceof Array ? p(m) : m instanceof Error && p(m.message);
|
|
1424
|
-
}
|
|
1425
|
-
m && m.then && m.then(function() {
|
|
1426
|
-
return p();
|
|
1427
|
-
}, function(a) {
|
|
1428
|
-
return p(a);
|
|
1429
|
-
});
|
|
1430
|
-
}, function(a) {
|
|
1431
|
-
p(a);
|
|
1432
|
-
}, u);
|
|
1433
|
-
}, o.getType = function(a) {
|
|
1434
|
-
if (a.type === void 0 && a.pattern instanceof RegExp && (a.type = "pattern"), typeof a.validator != "function" && a.type && !validators.hasOwnProperty(a.type)) throw Error(format("Unknown rule type %s", a.type));
|
|
1435
|
-
return a.type || "string";
|
|
1436
|
-
}, o.getValidationMethod = function(a) {
|
|
1437
|
-
if (typeof a.validator == "function") return a.validator;
|
|
1438
|
-
var o = Object.keys(a), s = o.indexOf("message");
|
|
1439
|
-
return s !== -1 && o.splice(s, 1), o.length === 1 && o[0] === "required" ? validators.required : validators[this.getType(a)] || void 0;
|
|
1440
|
-
}, a;
|
|
1441
|
-
}();
|
|
1442
|
-
Schema.register = function(a, o) {
|
|
1443
|
-
if (typeof o != "function") throw Error("Cannot register a validator by type, validator is not a function");
|
|
1444
|
-
validators[a] = o;
|
|
1445
|
-
}, Schema.warning = warning, Schema.messages = messages, Schema.validators = validators;
|
|
1446
|
-
function toArray$1(a) {
|
|
1447
|
-
return a == null ? [] : Array.isArray(a) ? a : [a];
|
|
1448
|
-
}
|
|
1449
|
-
function get(a, o) {
|
|
1450
|
-
let s = a;
|
|
1451
|
-
for (let a = 0; a < o.length; a += 1) {
|
|
1452
|
-
if (s == null) return;
|
|
1453
|
-
s = s[o[a]];
|
|
1454
|
-
}
|
|
1455
|
-
return s;
|
|
1456
|
-
}
|
|
1457
|
-
function internalSet(a, o, s, c) {
|
|
1458
|
-
if (!o.length) return s;
|
|
1459
|
-
let [l, ...d] = o, f;
|
|
1460
|
-
return f = !a && typeof l == "number" ? [] : Array.isArray(a) ? [...a] : _extends$1({}, a), c && s === void 0 && d.length === 1 ? delete f[l][d[0]] : f[l] = internalSet(f[l], d, s, c), f;
|
|
1461
|
-
}
|
|
1462
|
-
function set(a, o, s) {
|
|
1463
|
-
let c = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
|
|
1464
|
-
return o.length && c && s === void 0 && !get(a, o.slice(0, -1)) ? a : internalSet(a, o, s, c);
|
|
1465
|
-
}
|
|
1466
|
-
function getNamePath(a) {
|
|
1467
|
-
return toArray$1(a);
|
|
1468
|
-
}
|
|
1469
|
-
function getValue(a, o) {
|
|
1470
|
-
return get(a, o);
|
|
1471
|
-
}
|
|
1472
|
-
function setValue(a, o, s) {
|
|
1473
|
-
return set(a, o, s, arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1);
|
|
1474
|
-
}
|
|
1475
|
-
function containsNamePath(a, o) {
|
|
1476
|
-
return a && a.some((a) => matchNamePath(a, o));
|
|
1477
|
-
}
|
|
1478
|
-
function isObject(a) {
|
|
1479
|
-
return typeof a == "object" && !!a && Object.getPrototypeOf(a) === Object.prototype;
|
|
1480
|
-
}
|
|
1481
|
-
function internalSetValues(a, o) {
|
|
1482
|
-
let s = Array.isArray(a) ? [...a] : _extends$1({}, a);
|
|
1483
|
-
return o && Object.keys(o).forEach((a) => {
|
|
1484
|
-
let c = s[a], l = o[a];
|
|
1485
|
-
s[a] = isObject(c) && isObject(l) ? internalSetValues(c, l || {}) : l;
|
|
1486
|
-
}), s;
|
|
1487
|
-
}
|
|
1488
|
-
function setValues(a) {
|
|
1489
|
-
return [...arguments].slice(1).reduce((a, o) => internalSetValues(a, o), a);
|
|
1490
|
-
}
|
|
1491
|
-
function cloneByNamePathList(a, o) {
|
|
1492
|
-
let s = {};
|
|
1493
|
-
return o.forEach((o) => {
|
|
1494
|
-
let c = getValue(a, o);
|
|
1495
|
-
s = setValue(s, o, c);
|
|
1496
|
-
}), s;
|
|
1497
|
-
}
|
|
1498
|
-
function matchNamePath(a, o) {
|
|
1499
|
-
return !a || !o || a.length !== o.length ? !1 : a.every((a, s) => o[s] === a);
|
|
1500
|
-
}
|
|
1501
|
-
var typeTemplate = "'${name}' is not a valid ${type}";
|
|
1502
|
-
const defaultValidateMessages = {
|
|
1503
|
-
default: "Validation error on field '${name}'",
|
|
1504
|
-
required: "'${name}' is required",
|
|
1505
|
-
enum: "'${name}' must be one of [${enum}]",
|
|
1506
|
-
whitespace: "'${name}' cannot be empty",
|
|
1507
|
-
date: {
|
|
1508
|
-
format: "'${name}' is invalid for format date",
|
|
1509
|
-
parse: "'${name}' could not be parsed as date",
|
|
1510
|
-
invalid: "'${name}' is invalid date"
|
|
1511
|
-
},
|
|
1512
|
-
types: {
|
|
1513
|
-
string: typeTemplate,
|
|
1514
|
-
method: typeTemplate,
|
|
1515
|
-
array: typeTemplate,
|
|
1516
|
-
object: typeTemplate,
|
|
1517
|
-
number: typeTemplate,
|
|
1518
|
-
date: typeTemplate,
|
|
1519
|
-
boolean: typeTemplate,
|
|
1520
|
-
integer: typeTemplate,
|
|
1521
|
-
float: typeTemplate,
|
|
1522
|
-
regexp: typeTemplate,
|
|
1523
|
-
email: typeTemplate,
|
|
1524
|
-
url: typeTemplate,
|
|
1525
|
-
hex: typeTemplate
|
|
1526
|
-
},
|
|
1527
|
-
string: {
|
|
1528
|
-
len: "'${name}' must be exactly ${len} characters",
|
|
1529
|
-
min: "'${name}' must be at least ${min} characters",
|
|
1530
|
-
max: "'${name}' cannot be longer than ${max} characters",
|
|
1531
|
-
range: "'${name}' must be between ${min} and ${max} characters"
|
|
1532
|
-
},
|
|
1533
|
-
number: {
|
|
1534
|
-
len: "'${name}' must equal ${len}",
|
|
1535
|
-
min: "'${name}' cannot be less than ${min}",
|
|
1536
|
-
max: "'${name}' cannot be greater than ${max}",
|
|
1537
|
-
range: "'${name}' must be between ${min} and ${max}"
|
|
1538
|
-
},
|
|
1539
|
-
array: {
|
|
1540
|
-
len: "'${name}' must be exactly ${len} in length",
|
|
1541
|
-
min: "'${name}' cannot be less than ${min} in length",
|
|
1542
|
-
max: "'${name}' cannot be greater than ${max} in length",
|
|
1543
|
-
range: "'${name}' must be between ${min} and ${max} in length"
|
|
1544
|
-
},
|
|
1545
|
-
pattern: { mismatch: "'${name}' does not match pattern ${pattern}" }
|
|
1546
|
-
};
|
|
1547
|
-
var __awaiter = function(a, o, s, c) {
|
|
1548
|
-
function l(a) {
|
|
1549
|
-
return a instanceof s ? a : new s(function(o) {
|
|
1550
|
-
o(a);
|
|
1551
|
-
});
|
|
1552
|
-
}
|
|
1553
|
-
return new (s ||= Promise)(function(s, u) {
|
|
1554
|
-
function d(a) {
|
|
1555
|
-
try {
|
|
1556
|
-
p(c.next(a));
|
|
1557
|
-
} catch (a) {
|
|
1558
|
-
u(a);
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
|
-
function f(a) {
|
|
1562
|
-
try {
|
|
1563
|
-
p(c.throw(a));
|
|
1564
|
-
} catch (a) {
|
|
1565
|
-
u(a);
|
|
1566
|
-
}
|
|
1567
|
-
}
|
|
1568
|
-
function p(a) {
|
|
1569
|
-
a.done ? s(a.value) : l(a.value).then(d, f);
|
|
1570
|
-
}
|
|
1571
|
-
p((c = c.apply(a, o || [])).next());
|
|
1572
|
-
});
|
|
1573
|
-
}, AsyncValidator = Schema;
|
|
1574
|
-
function replaceMessage(a, o) {
|
|
1575
|
-
return a.replace(/\$\{\w+\}/g, (a) => o[a.slice(2, -1)]);
|
|
1576
|
-
}
|
|
1577
|
-
function validateRule(a, o, s, c, l) {
|
|
1578
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1579
|
-
let d = _extends$1({}, s);
|
|
1580
|
-
delete d.ruleIndex, delete d.trigger;
|
|
1581
|
-
let f = null;
|
|
1582
|
-
d && d.type === "array" && d.defaultField && (f = d.defaultField, delete d.defaultField);
|
|
1583
|
-
let p = new AsyncValidator({ [a]: [d] }), m = setValues({}, defaultValidateMessages, c.validateMessages);
|
|
1584
|
-
p.messages(m);
|
|
1585
|
-
let h = [];
|
|
1586
|
-
try {
|
|
1587
|
-
yield Promise.resolve(p.validate({ [a]: o }, _extends$1({}, c)));
|
|
1588
|
-
} catch (a) {
|
|
1589
|
-
a.errors ? h = a.errors.map((a, o) => {
|
|
1590
|
-
let { message: s } = a;
|
|
1591
|
-
return isValidElement(s) ? cloneVNode(s, { key: `error_${o}` }) : s;
|
|
1592
|
-
}) : (console.error(a), h = [m.default()]);
|
|
1593
|
-
}
|
|
1594
|
-
if (!h.length && f) return (yield Promise.all(o.map((o, s) => validateRule(`${a}.${s}`, o, f, c, l)))).reduce((a, o) => [...a, ...o], []);
|
|
1595
|
-
let g = _extends$1(_extends$1(_extends$1({}, s), {
|
|
1596
|
-
name: a,
|
|
1597
|
-
enum: (s.enum || []).join(", ")
|
|
1598
|
-
}), l);
|
|
1599
|
-
return h.map((a) => typeof a == "string" ? replaceMessage(a, g) : a);
|
|
1600
|
-
});
|
|
1601
|
-
}
|
|
1602
|
-
function validateRules(a, o, c, l, d, f) {
|
|
1603
|
-
let p = a.join("."), m = c.map((a, o) => {
|
|
1604
|
-
let c = a.validator, l = _extends$1(_extends$1({}, a), { ruleIndex: o });
|
|
1605
|
-
return c && (l.validator = (a, o, l) => {
|
|
1606
|
-
let u = !1, d = c(a, o, function() {
|
|
1607
|
-
var a = [...arguments];
|
|
1608
|
-
Promise.resolve().then(() => {
|
|
1609
|
-
warning$1(!u, "Your validator function has already return a promise. `callback` will be ignored."), u || l(...a);
|
|
1610
|
-
});
|
|
1611
|
-
});
|
|
1612
|
-
u = d && typeof d.then == "function" && typeof d.catch == "function", warning$1(u, "`callback` is deprecated. Please return a promise instead."), u && d.then(() => {
|
|
1613
|
-
l();
|
|
1614
|
-
}).catch((a) => {
|
|
1615
|
-
l(a || " ");
|
|
1616
|
-
});
|
|
1617
|
-
}), l;
|
|
1618
|
-
}).sort((a, o) => {
|
|
1619
|
-
let { warningOnly: s, ruleIndex: c } = a, { warningOnly: l, ruleIndex: u } = o;
|
|
1620
|
-
return !!s == !!l ? c - u : s ? 1 : -1;
|
|
1621
|
-
}), h;
|
|
1622
|
-
if (d === !0) h = new Promise((a, s) => __awaiter(this, void 0, void 0, function* () {
|
|
1623
|
-
for (let a = 0; a < m.length; a += 1) {
|
|
1624
|
-
let c = m[a], u = yield validateRule(p, o, c, l, f);
|
|
1625
|
-
if (u.length) {
|
|
1626
|
-
s([{
|
|
1627
|
-
errors: u,
|
|
1628
|
-
rule: c
|
|
1629
|
-
}]);
|
|
1630
|
-
return;
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
a([]);
|
|
1634
|
-
}));
|
|
1635
|
-
else {
|
|
1636
|
-
let a = m.map((a) => validateRule(p, o, a, l, f).then((o) => ({
|
|
1637
|
-
errors: o,
|
|
1638
|
-
rule: a
|
|
1639
|
-
})));
|
|
1640
|
-
h = (d ? finishOnFirstFailed(a) : finishOnAllFailed(a)).then((a) => Promise.reject(a));
|
|
1641
|
-
}
|
|
1642
|
-
return h.catch((a) => a), h;
|
|
1643
|
-
}
|
|
1644
|
-
function finishOnAllFailed(a) {
|
|
1645
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1646
|
-
return Promise.all(a).then((a) => [].concat(...a));
|
|
1647
|
-
});
|
|
1648
|
-
}
|
|
1649
|
-
function finishOnFirstFailed(a) {
|
|
1650
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1651
|
-
let o = 0;
|
|
1652
|
-
return new Promise((s) => {
|
|
1653
|
-
a.forEach((c) => {
|
|
1654
|
-
c.then((c) => {
|
|
1655
|
-
c.errors.length && s([c]), o += 1, o === a.length && s([]);
|
|
1656
|
-
});
|
|
1657
|
-
});
|
|
1658
|
-
});
|
|
1659
|
-
});
|
|
1660
|
-
}
|
|
1661
|
-
const FormContextKey = Symbol("formContextKey"), useProvideForm = (a) => {
|
|
1662
|
-
provide(FormContextKey, a);
|
|
1663
|
-
}, useInjectForm = () => inject(FormContextKey, {
|
|
1664
|
-
name: computed(() => void 0),
|
|
1665
|
-
labelAlign: computed(() => "right"),
|
|
1666
|
-
vertical: computed(() => !1),
|
|
1667
|
-
addField: (a, o) => {},
|
|
1668
|
-
removeField: (a) => {},
|
|
1669
|
-
model: computed(() => void 0),
|
|
1670
|
-
rules: computed(() => void 0),
|
|
1671
|
-
colon: computed(() => void 0),
|
|
1672
|
-
labelWrap: computed(() => void 0),
|
|
1673
|
-
labelCol: computed(() => void 0),
|
|
1674
|
-
requiredMark: computed(() => !1),
|
|
1675
|
-
validateTrigger: computed(() => void 0),
|
|
1676
|
-
onValidate: () => {},
|
|
1677
|
-
validateMessages: computed(() => defaultValidateMessages)
|
|
1678
|
-
}), FormItemPrefixContextKey = Symbol("formItemPrefixContextKey"), useProvideFormItemPrefix = (a) => {
|
|
1679
|
-
provide(FormItemPrefixContextKey, a);
|
|
1680
|
-
}, useInjectFormItemPrefix = () => inject(FormItemPrefixContextKey, { prefixCls: computed(() => "") });
|
|
1681
|
-
function parseFlex(a) {
|
|
1682
|
-
return typeof a == "number" ? `${a} ${a} auto` : /^\d+(\.\d+)?(px|em|rem|%)$/.test(a) ? `0 0 ${a}` : a;
|
|
1683
|
-
}
|
|
1684
|
-
const colProps = () => ({
|
|
1685
|
-
span: [String, Number],
|
|
1686
|
-
order: [String, Number],
|
|
1687
|
-
offset: [String, Number],
|
|
1688
|
-
push: [String, Number],
|
|
1689
|
-
pull: [String, Number],
|
|
1690
|
-
xs: {
|
|
1691
|
-
type: [
|
|
1692
|
-
String,
|
|
1693
|
-
Number,
|
|
1694
|
-
Object
|
|
1695
|
-
],
|
|
1696
|
-
default: void 0
|
|
1697
|
-
},
|
|
1698
|
-
sm: {
|
|
1699
|
-
type: [
|
|
1700
|
-
String,
|
|
1701
|
-
Number,
|
|
1702
|
-
Object
|
|
1703
|
-
],
|
|
1704
|
-
default: void 0
|
|
1705
|
-
},
|
|
1706
|
-
md: {
|
|
1707
|
-
type: [
|
|
1708
|
-
String,
|
|
1709
|
-
Number,
|
|
1710
|
-
Object
|
|
1711
|
-
],
|
|
1712
|
-
default: void 0
|
|
1713
|
-
},
|
|
1714
|
-
lg: {
|
|
1715
|
-
type: [
|
|
1716
|
-
String,
|
|
1717
|
-
Number,
|
|
1718
|
-
Object
|
|
1719
|
-
],
|
|
1720
|
-
default: void 0
|
|
1721
|
-
},
|
|
1722
|
-
xl: {
|
|
1723
|
-
type: [
|
|
1724
|
-
String,
|
|
1725
|
-
Number,
|
|
1726
|
-
Object
|
|
1727
|
-
],
|
|
1728
|
-
default: void 0
|
|
1729
|
-
},
|
|
1730
|
-
xxl: {
|
|
1731
|
-
type: [
|
|
1732
|
-
String,
|
|
1733
|
-
Number,
|
|
1734
|
-
Object
|
|
1735
|
-
],
|
|
1736
|
-
default: void 0
|
|
1737
|
-
},
|
|
1738
|
-
prefixCls: String,
|
|
1739
|
-
flex: [String, Number]
|
|
1740
|
-
});
|
|
1741
|
-
var sizes = [
|
|
1742
|
-
"xs",
|
|
1743
|
-
"sm",
|
|
1744
|
-
"md",
|
|
1745
|
-
"lg",
|
|
1746
|
-
"xl",
|
|
1747
|
-
"xxl"
|
|
1748
|
-
], Col_default = defineComponent({
|
|
1749
|
-
compatConfig: { MODE: 3 },
|
|
1750
|
-
name: "ACol",
|
|
1751
|
-
inheritAttrs: !1,
|
|
1752
|
-
props: colProps(),
|
|
1753
|
-
setup(a, o) {
|
|
1754
|
-
let { slots: s, attrs: c } = o, { gutter: l, supportFlexGap: d, wrap: f } = useInjectRow(), { prefixCls: p, direction: m } = useConfigInject_default("col", a), [h, g] = useColStyle(p), _ = computed(() => {
|
|
1755
|
-
let { span: o, order: s, offset: l, push: d, pull: f } = a, h = p.value, _ = {};
|
|
1756
|
-
return sizes.forEach((o) => {
|
|
1757
|
-
let s = {}, c = a[o];
|
|
1758
|
-
typeof c == "number" ? s.span = c : typeof c == "object" && (s = c || {}), _ = _extends$1(_extends$1({}, _), {
|
|
1759
|
-
[`${h}-${o}-${s.span}`]: s.span !== void 0,
|
|
1760
|
-
[`${h}-${o}-order-${s.order}`]: s.order || s.order === 0,
|
|
1761
|
-
[`${h}-${o}-offset-${s.offset}`]: s.offset || s.offset === 0,
|
|
1762
|
-
[`${h}-${o}-push-${s.push}`]: s.push || s.push === 0,
|
|
1763
|
-
[`${h}-${o}-pull-${s.pull}`]: s.pull || s.pull === 0,
|
|
1764
|
-
[`${h}-rtl`]: m.value === "rtl"
|
|
1765
|
-
});
|
|
1766
|
-
}), classNames(h, {
|
|
1767
|
-
[`${h}-${o}`]: o !== void 0,
|
|
1768
|
-
[`${h}-order-${s}`]: s,
|
|
1769
|
-
[`${h}-offset-${l}`]: l,
|
|
1770
|
-
[`${h}-push-${d}`]: d,
|
|
1771
|
-
[`${h}-pull-${f}`]: f
|
|
1772
|
-
}, _, c.class, g.value);
|
|
1773
|
-
}), v = computed(() => {
|
|
1774
|
-
let { flex: o } = a, s = l.value, c = {};
|
|
1775
|
-
if (s && s[0] > 0) {
|
|
1776
|
-
let a = `${s[0] / 2}px`;
|
|
1777
|
-
c.paddingLeft = a, c.paddingRight = a;
|
|
1778
|
-
}
|
|
1779
|
-
if (s && s[1] > 0 && !d.value) {
|
|
1780
|
-
let a = `${s[1] / 2}px`;
|
|
1781
|
-
c.paddingTop = a, c.paddingBottom = a;
|
|
1782
|
-
}
|
|
1783
|
-
return o && (c.flex = parseFlex(o), f.value === !1 && !c.minWidth && (c.minWidth = 0)), c;
|
|
1784
|
-
});
|
|
1785
|
-
return () => h(createVNode("div", _objectSpread2(_objectSpread2({}, c), {}, {
|
|
1786
|
-
class: _.value,
|
|
1787
|
-
style: [v.value, c.style]
|
|
1788
|
-
}), [s.default?.call(s)]));
|
|
1789
|
-
}
|
|
1790
|
-
}), FormItemLabel = (a, o) => {
|
|
1791
|
-
let { slots: s, emit: c, attrs: l } = o, { prefixCls: d, htmlFor: f, labelCol: p, labelAlign: g, colon: _, required: v, requiredMark: y } = _extends$1(_extends$1({}, a), l), [b] = useLocaleReceiver("Form"), x = a.label ?? s.label?.call(s);
|
|
1792
|
-
if (!x) return null;
|
|
1793
|
-
let { vertical: S, labelAlign: C, labelCol: w, labelWrap: E, colon: D } = useInjectForm(), O = p || w?.value || {}, k = g || C?.value, A = `${d}-item-label`, j = classNames(A, k === "left" && `${A}-left`, O.class, { [`${A}-wrap`]: !!E.value }), M = x, N = _ === !0 || D?.value !== !1 && _ !== !1;
|
|
1794
|
-
if (N && !S.value && typeof x == "string" && x.trim() !== "" && (M = x.replace(/[:|:]\s*$/, "")), a.tooltip || s.tooltip) {
|
|
1795
|
-
let o = createVNode("span", { class: `${d}-item-tooltip` }, [createVNode(tooltip_default, { title: a.tooltip }, { default: () => [createVNode(QuestionCircleOutlined, null, null)] })]);
|
|
1796
|
-
M = createVNode(Fragment, null, [M, s.tooltip ? s.tooltip?.call(s, { class: `${d}-item-tooltip` }) : o]);
|
|
1797
|
-
}
|
|
1798
|
-
y === "optional" && !v && (M = createVNode(Fragment, null, [M, createVNode("span", { class: `${d}-item-optional` }, [b.value?.optional || localeValues.Form?.optional])]));
|
|
1799
|
-
let P = classNames({
|
|
1800
|
-
[`${d}-item-required`]: v,
|
|
1801
|
-
[`${d}-item-required-mark-optional`]: y === "optional",
|
|
1802
|
-
[`${d}-item-no-colon`]: !N
|
|
1803
|
-
});
|
|
1804
|
-
return createVNode(Col_default, _objectSpread2(_objectSpread2({}, O), {}, { class: j }), { default: () => [createVNode("label", {
|
|
1805
|
-
for: f,
|
|
1806
|
-
class: P,
|
|
1807
|
-
title: typeof x == "string" ? x : "",
|
|
1808
|
-
onClick: (a) => c("click", a)
|
|
1809
|
-
}, [M])] });
|
|
1810
|
-
};
|
|
1811
|
-
FormItemLabel.displayName = "FormItemLabel", FormItemLabel.inheritAttrs = !1;
|
|
1812
|
-
var genFormValidateMotionStyle = (a) => {
|
|
1813
|
-
let { componentCls: o } = a, s = `${o}-show-help`, c = `${o}-show-help-item`;
|
|
1814
|
-
return { [s]: {
|
|
1815
|
-
transition: `opacity ${a.motionDurationSlow} ${a.motionEaseInOut}`,
|
|
1816
|
-
"&-appear, &-enter": {
|
|
1817
|
-
opacity: 0,
|
|
1818
|
-
"&-active": { opacity: 1 }
|
|
1819
|
-
},
|
|
1820
|
-
"&-leave": {
|
|
1821
|
-
opacity: 1,
|
|
1822
|
-
"&-active": { opacity: 0 }
|
|
1823
|
-
},
|
|
1824
|
-
[c]: {
|
|
1825
|
-
overflow: "hidden",
|
|
1826
|
-
transition: `height ${a.motionDurationSlow} ${a.motionEaseInOut},
|
|
1827
|
-
opacity ${a.motionDurationSlow} ${a.motionEaseInOut},
|
|
1828
|
-
transform ${a.motionDurationSlow} ${a.motionEaseInOut} !important`,
|
|
1829
|
-
[`&${c}-appear, &${c}-enter`]: {
|
|
1830
|
-
transform: "translateY(-5px)",
|
|
1831
|
-
opacity: 0,
|
|
1832
|
-
"&-active": {
|
|
1833
|
-
transform: "translateY(0)",
|
|
1834
|
-
opacity: 1
|
|
1835
|
-
}
|
|
1836
|
-
},
|
|
1837
|
-
[`&${c}-leave-active`]: { transform: "translateY(-5px)" }
|
|
1838
|
-
}
|
|
1839
|
-
} };
|
|
1840
|
-
}, resetForm = (a) => ({
|
|
1841
|
-
legend: {
|
|
1842
|
-
display: "block",
|
|
1843
|
-
width: "100%",
|
|
1844
|
-
marginBottom: a.marginLG,
|
|
1845
|
-
padding: 0,
|
|
1846
|
-
color: a.colorTextDescription,
|
|
1847
|
-
fontSize: a.fontSizeLG,
|
|
1848
|
-
lineHeight: "inherit",
|
|
1849
|
-
border: 0,
|
|
1850
|
-
borderBottom: `${a.lineWidth}px ${a.lineType} ${a.colorBorder}`
|
|
1851
|
-
},
|
|
1852
|
-
label: { fontSize: a.fontSize },
|
|
1853
|
-
"input[type=\"search\"]": { boxSizing: "border-box" },
|
|
1854
|
-
"input[type=\"radio\"], input[type=\"checkbox\"]": { lineHeight: "normal" },
|
|
1855
|
-
"input[type=\"file\"]": { display: "block" },
|
|
1856
|
-
"input[type=\"range\"]": {
|
|
1857
|
-
display: "block",
|
|
1858
|
-
width: "100%"
|
|
1859
|
-
},
|
|
1860
|
-
"select[multiple], select[size]": { height: "auto" },
|
|
1861
|
-
"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus": {
|
|
1862
|
-
outline: 0,
|
|
1863
|
-
boxShadow: `0 0 0 ${a.controlOutlineWidth}px ${a.controlOutline}`
|
|
1864
|
-
},
|
|
1865
|
-
output: {
|
|
1866
|
-
display: "block",
|
|
1867
|
-
paddingTop: 15,
|
|
1868
|
-
color: a.colorText,
|
|
1869
|
-
fontSize: a.fontSize,
|
|
1870
|
-
lineHeight: a.lineHeight
|
|
1871
|
-
}
|
|
1872
|
-
}), genFormSize = (a, o) => {
|
|
1873
|
-
let { formItemCls: s } = a;
|
|
1874
|
-
return { [s]: {
|
|
1875
|
-
[`${s}-label > label`]: { height: o },
|
|
1876
|
-
[`${s}-control-input`]: { minHeight: o }
|
|
1877
|
-
} };
|
|
1878
|
-
}, genFormStyle = (a) => {
|
|
1879
|
-
let { componentCls: o } = a;
|
|
1880
|
-
return { [a.componentCls]: _extends$1(_extends$1(_extends$1({}, resetComponent(a)), resetForm(a)), {
|
|
1881
|
-
[`${o}-text`]: {
|
|
1882
|
-
display: "inline-block",
|
|
1883
|
-
paddingInlineEnd: a.paddingSM
|
|
1884
|
-
},
|
|
1885
|
-
"&-small": _extends$1({}, genFormSize(a, a.controlHeightSM)),
|
|
1886
|
-
"&-large": _extends$1({}, genFormSize(a, a.controlHeightLG))
|
|
1887
|
-
}) };
|
|
1888
|
-
}, genFormItemStyle = (a) => {
|
|
1889
|
-
let { formItemCls: o, iconCls: s, componentCls: c, rootPrefixCls: l } = a;
|
|
1890
|
-
return { [o]: _extends$1(_extends$1({}, resetComponent(a)), {
|
|
1891
|
-
marginBottom: a.marginLG,
|
|
1892
|
-
verticalAlign: "top",
|
|
1893
|
-
"&-with-help": { transition: "none" },
|
|
1894
|
-
[`&-hidden,
|
|
1895
|
-
&-hidden.${l}-row`]: { display: "none" },
|
|
1896
|
-
"&-has-warning": { [`${o}-split`]: { color: a.colorError } },
|
|
1897
|
-
"&-has-error": { [`${o}-split`]: { color: a.colorWarning } },
|
|
1898
|
-
[`${o}-label`]: {
|
|
1899
|
-
display: "inline-block",
|
|
1900
|
-
flexGrow: 0,
|
|
1901
|
-
overflow: "hidden",
|
|
1902
|
-
whiteSpace: "nowrap",
|
|
1903
|
-
textAlign: "end",
|
|
1904
|
-
verticalAlign: "middle",
|
|
1905
|
-
"&-left": { textAlign: "start" },
|
|
1906
|
-
"&-wrap": {
|
|
1907
|
-
overflow: "unset",
|
|
1908
|
-
lineHeight: `${a.lineHeight} - 0.25em`,
|
|
1909
|
-
whiteSpace: "unset"
|
|
1910
|
-
},
|
|
1911
|
-
"> label": {
|
|
1912
|
-
position: "relative",
|
|
1913
|
-
display: "inline-flex",
|
|
1914
|
-
alignItems: "center",
|
|
1915
|
-
maxWidth: "100%",
|
|
1916
|
-
height: a.controlHeight,
|
|
1917
|
-
color: a.colorTextHeading,
|
|
1918
|
-
fontSize: a.fontSize,
|
|
1919
|
-
[`> ${s}`]: {
|
|
1920
|
-
fontSize: a.fontSize,
|
|
1921
|
-
verticalAlign: "top"
|
|
1922
|
-
},
|
|
1923
|
-
[`&${o}-required:not(${o}-required-mark-optional)::before`]: {
|
|
1924
|
-
display: "inline-block",
|
|
1925
|
-
marginInlineEnd: a.marginXXS,
|
|
1926
|
-
color: a.colorError,
|
|
1927
|
-
fontSize: a.fontSize,
|
|
1928
|
-
fontFamily: "SimSun, sans-serif",
|
|
1929
|
-
lineHeight: 1,
|
|
1930
|
-
content: "\"*\"",
|
|
1931
|
-
[`${c}-hide-required-mark &`]: { display: "none" }
|
|
1932
|
-
},
|
|
1933
|
-
[`${o}-optional`]: {
|
|
1934
|
-
display: "inline-block",
|
|
1935
|
-
marginInlineStart: a.marginXXS,
|
|
1936
|
-
color: a.colorTextDescription,
|
|
1937
|
-
[`${c}-hide-required-mark &`]: { display: "none" }
|
|
1938
|
-
},
|
|
1939
|
-
[`${o}-tooltip`]: {
|
|
1940
|
-
color: a.colorTextDescription,
|
|
1941
|
-
cursor: "help",
|
|
1942
|
-
writingMode: "horizontal-tb",
|
|
1943
|
-
marginInlineStart: a.marginXXS
|
|
1944
|
-
},
|
|
1945
|
-
"&::after": {
|
|
1946
|
-
content: "\":\"",
|
|
1947
|
-
position: "relative",
|
|
1948
|
-
marginBlock: 0,
|
|
1949
|
-
marginInlineStart: a.marginXXS / 2,
|
|
1950
|
-
marginInlineEnd: a.marginXS
|
|
1951
|
-
},
|
|
1952
|
-
[`&${o}-no-colon::after`]: { content: "\" \"" }
|
|
1953
|
-
}
|
|
1954
|
-
},
|
|
1955
|
-
[`${o}-control`]: {
|
|
1956
|
-
display: "flex",
|
|
1957
|
-
flexDirection: "column",
|
|
1958
|
-
flexGrow: 1,
|
|
1959
|
-
[`&:first-child:not([class^="'${l}-col-'"]):not([class*="' ${l}-col-'"])`]: { width: "100%" },
|
|
1960
|
-
"&-input": {
|
|
1961
|
-
position: "relative",
|
|
1962
|
-
display: "flex",
|
|
1963
|
-
alignItems: "center",
|
|
1964
|
-
minHeight: a.controlHeight,
|
|
1965
|
-
"&-content": {
|
|
1966
|
-
flex: "auto",
|
|
1967
|
-
maxWidth: "100%"
|
|
1968
|
-
}
|
|
1969
|
-
}
|
|
1970
|
-
},
|
|
1971
|
-
[o]: {
|
|
1972
|
-
"&-explain, &-extra": {
|
|
1973
|
-
clear: "both",
|
|
1974
|
-
color: a.colorTextDescription,
|
|
1975
|
-
fontSize: a.fontSize,
|
|
1976
|
-
lineHeight: a.lineHeight
|
|
1977
|
-
},
|
|
1978
|
-
"&-explain-connected": { width: "100%" },
|
|
1979
|
-
"&-extra": {
|
|
1980
|
-
minHeight: a.controlHeightSM,
|
|
1981
|
-
transition: `color ${a.motionDurationMid} ${a.motionEaseOut}`
|
|
1982
|
-
},
|
|
1983
|
-
"&-explain": {
|
|
1984
|
-
"&-error": { color: a.colorError },
|
|
1985
|
-
"&-warning": { color: a.colorWarning }
|
|
1986
|
-
}
|
|
1987
|
-
},
|
|
1988
|
-
[`&-with-help ${o}-explain`]: {
|
|
1989
|
-
height: "auto",
|
|
1990
|
-
opacity: 1
|
|
1991
|
-
},
|
|
1992
|
-
[`${o}-feedback-icon`]: {
|
|
1993
|
-
fontSize: a.fontSize,
|
|
1994
|
-
textAlign: "center",
|
|
1995
|
-
visibility: "visible",
|
|
1996
|
-
animationName: zoomIn,
|
|
1997
|
-
animationDuration: a.motionDurationMid,
|
|
1998
|
-
animationTimingFunction: a.motionEaseOutBack,
|
|
1999
|
-
pointerEvents: "none",
|
|
2000
|
-
"&-success": { color: a.colorSuccess },
|
|
2001
|
-
"&-error": { color: a.colorError },
|
|
2002
|
-
"&-warning": { color: a.colorWarning },
|
|
2003
|
-
"&-validating": { color: a.colorPrimary }
|
|
2004
|
-
}
|
|
2005
|
-
}) };
|
|
2006
|
-
}, genHorizontalStyle = (a) => {
|
|
2007
|
-
let { componentCls: o, formItemCls: s, rootPrefixCls: c } = a;
|
|
2008
|
-
return { [`${o}-horizontal`]: {
|
|
2009
|
-
[`${s}-label`]: { flexGrow: 0 },
|
|
2010
|
-
[`${s}-control`]: {
|
|
2011
|
-
flex: "1 1 0",
|
|
2012
|
-
minWidth: 0
|
|
2013
|
-
},
|
|
2014
|
-
[`${s}-label.${c}-col-24 + ${s}-control`]: { minWidth: "unset" }
|
|
2015
|
-
} };
|
|
2016
|
-
}, genInlineStyle = (a) => {
|
|
2017
|
-
let { componentCls: o, formItemCls: s } = a;
|
|
2018
|
-
return { [`${o}-inline`]: {
|
|
2019
|
-
display: "flex",
|
|
2020
|
-
flexWrap: "wrap",
|
|
2021
|
-
[s]: {
|
|
2022
|
-
flex: "none",
|
|
2023
|
-
flexWrap: "nowrap",
|
|
2024
|
-
marginInlineEnd: a.margin,
|
|
2025
|
-
marginBottom: 0,
|
|
2026
|
-
"&-with-help": { marginBottom: a.marginLG },
|
|
2027
|
-
[`> ${s}-label,
|
|
2028
|
-
> ${s}-control`]: {
|
|
2029
|
-
display: "inline-block",
|
|
2030
|
-
verticalAlign: "top"
|
|
2031
|
-
},
|
|
2032
|
-
[`> ${s}-label`]: { flex: "none" },
|
|
2033
|
-
[`${o}-text`]: { display: "inline-block" },
|
|
2034
|
-
[`${s}-has-feedback`]: { display: "inline-block" }
|
|
2035
|
-
}
|
|
2036
|
-
} };
|
|
2037
|
-
}, makeVerticalLayoutLabel = (a) => ({
|
|
2038
|
-
margin: 0,
|
|
2039
|
-
padding: `0 0 ${a.paddingXS}px`,
|
|
2040
|
-
whiteSpace: "initial",
|
|
2041
|
-
textAlign: "start",
|
|
2042
|
-
"> label": {
|
|
2043
|
-
margin: 0,
|
|
2044
|
-
"&::after": { display: "none" }
|
|
2045
|
-
}
|
|
2046
|
-
}), makeVerticalLayout = (a) => {
|
|
2047
|
-
let { componentCls: o, formItemCls: s } = a;
|
|
2048
|
-
return {
|
|
2049
|
-
[`${s} ${s}-label`]: makeVerticalLayoutLabel(a),
|
|
2050
|
-
[o]: { [s]: {
|
|
2051
|
-
flexWrap: "wrap",
|
|
2052
|
-
[`${s}-label,
|
|
2053
|
-
${s}-control`]: {
|
|
2054
|
-
flex: "0 0 100%",
|
|
2055
|
-
maxWidth: "100%"
|
|
2056
|
-
}
|
|
2057
|
-
} }
|
|
2058
|
-
};
|
|
2059
|
-
}, genVerticalStyle = (a) => {
|
|
2060
|
-
let { componentCls: o, formItemCls: s, rootPrefixCls: c } = a;
|
|
2061
|
-
return {
|
|
2062
|
-
[`${o}-vertical`]: { [s]: {
|
|
2063
|
-
"&-row": { flexDirection: "column" },
|
|
2064
|
-
"&-label > label": { height: "auto" },
|
|
2065
|
-
[`${o}-item-control`]: { width: "100%" }
|
|
2066
|
-
} },
|
|
2067
|
-
[`${o}-vertical ${s}-label,
|
|
2068
|
-
.${c}-col-24${s}-label,
|
|
2069
|
-
.${c}-col-xl-24${s}-label`]: makeVerticalLayoutLabel(a),
|
|
2070
|
-
[`@media (max-width: ${a.screenXSMax}px)`]: [makeVerticalLayout(a), { [o]: { [`.${c}-col-xs-24${s}-label`]: makeVerticalLayoutLabel(a) } }],
|
|
2071
|
-
[`@media (max-width: ${a.screenSMMax}px)`]: { [o]: { [`.${c}-col-sm-24${s}-label`]: makeVerticalLayoutLabel(a) } },
|
|
2072
|
-
[`@media (max-width: ${a.screenMDMax}px)`]: { [o]: { [`.${c}-col-md-24${s}-label`]: makeVerticalLayoutLabel(a) } },
|
|
2073
|
-
[`@media (max-width: ${a.screenLGMax}px)`]: { [o]: { [`.${c}-col-lg-24${s}-label`]: makeVerticalLayoutLabel(a) } }
|
|
2074
|
-
};
|
|
2075
|
-
}, style_default = genComponentStyleHook("Form", (a, o) => {
|
|
2076
|
-
let { rootPrefixCls: s } = o, c = merge(a, {
|
|
2077
|
-
formItemCls: `${a.componentCls}-item`,
|
|
2078
|
-
rootPrefixCls: s
|
|
2079
|
-
});
|
|
2080
|
-
return [
|
|
2081
|
-
genFormStyle(c),
|
|
2082
|
-
genFormItemStyle(c),
|
|
2083
|
-
genFormValidateMotionStyle(c),
|
|
2084
|
-
genHorizontalStyle(c),
|
|
2085
|
-
genInlineStyle(c),
|
|
2086
|
-
genVerticalStyle(c),
|
|
2087
|
-
genCollapseMotion(c),
|
|
2088
|
-
zoomIn
|
|
2089
|
-
];
|
|
2090
|
-
}), ErrorList_default = defineComponent({
|
|
2091
|
-
compatConfig: { MODE: 3 },
|
|
2092
|
-
name: "ErrorList",
|
|
2093
|
-
inheritAttrs: !1,
|
|
2094
|
-
props: [
|
|
2095
|
-
"errors",
|
|
2096
|
-
"help",
|
|
2097
|
-
"onErrorVisibleChanged",
|
|
2098
|
-
"helpStatus",
|
|
2099
|
-
"warnings"
|
|
2100
|
-
],
|
|
2101
|
-
setup(a, o) {
|
|
2102
|
-
let { attrs: s } = o, { prefixCls: c, status: l } = useInjectFormItemPrefix(), u = computed(() => `${c.value}-item-explain`), f = computed(() => !!(a.errors && a.errors.length)), p = ref(l.value), [, m] = style_default(c);
|
|
2103
|
-
return watch([f, l], () => {
|
|
2104
|
-
f.value && (p.value = l.value);
|
|
2105
|
-
}), () => {
|
|
2106
|
-
let o = collapseMotion(`${c.value}-show-help-item`), l = getTransitionGroupProps(`${c.value}-show-help-item`, o);
|
|
2107
|
-
return l.role = "alert", l.class = [
|
|
2108
|
-
m.value,
|
|
2109
|
-
u.value,
|
|
2110
|
-
s.class,
|
|
2111
|
-
`${c.value}-show-help`
|
|
2112
|
-
], createVNode(Transition, _objectSpread2(_objectSpread2({}, getTransitionProps(`${c.value}-show-help`)), {}, {
|
|
2113
|
-
onAfterEnter: () => a.onErrorVisibleChanged(!0),
|
|
2114
|
-
onAfterLeave: () => a.onErrorVisibleChanged(!1)
|
|
2115
|
-
}), { default: () => [withDirectives(createVNode(TransitionGroup, _objectSpread2(_objectSpread2({}, l), {}, { tag: "div" }), { default: () => [a.errors?.map((a, o) => createVNode("div", {
|
|
2116
|
-
key: o,
|
|
2117
|
-
class: p.value ? `${u.value}-${p.value}` : ""
|
|
2118
|
-
}, [a]))] }), [[vShow, !!a.errors?.length]])] });
|
|
2119
|
-
};
|
|
2120
|
-
}
|
|
2121
|
-
}), FormItemInput = defineComponent({
|
|
2122
|
-
compatConfig: { MODE: 3 },
|
|
2123
|
-
slots: Object,
|
|
2124
|
-
inheritAttrs: !1,
|
|
2125
|
-
props: [
|
|
2126
|
-
"prefixCls",
|
|
2127
|
-
"errors",
|
|
2128
|
-
"hasFeedback",
|
|
2129
|
-
"onDomErrorVisibleChange",
|
|
2130
|
-
"wrapperCol",
|
|
2131
|
-
"help",
|
|
2132
|
-
"extra",
|
|
2133
|
-
"status",
|
|
2134
|
-
"marginBottom",
|
|
2135
|
-
"onErrorVisibleChanged"
|
|
2136
|
-
],
|
|
2137
|
-
setup(a, o) {
|
|
2138
|
-
let { slots: s } = o, c = useInjectForm(), { wrapperCol: l } = c, d = _extends$1({}, c);
|
|
2139
|
-
return delete d.labelCol, delete d.wrapperCol, useProvideForm(d), useProvideFormItemPrefix({
|
|
2140
|
-
prefixCls: computed(() => a.prefixCls),
|
|
2141
|
-
status: computed(() => a.status)
|
|
2142
|
-
}), () => {
|
|
2143
|
-
let { prefixCls: o, wrapperCol: c, marginBottom: u, onErrorVisibleChanged: d, help: f = s.help?.call(s), errors: p = filterEmpty(s.errors?.call(s)), extra: m = s.extra?.call(s) } = a, h = `${o}-item`, g = c || l?.value || {}, _ = classNames(`${h}-control`, g.class);
|
|
2144
|
-
return createVNode(Col_default, _objectSpread2(_objectSpread2({}, g), {}, { class: _ }), { default: () => createVNode(Fragment, null, [
|
|
2145
|
-
createVNode("div", { class: `${h}-control-input` }, [createVNode("div", { class: `${h}-control-input-content` }, [s.default?.call(s)])]),
|
|
2146
|
-
u !== null || p.length ? createVNode("div", { style: {
|
|
2147
|
-
display: "flex",
|
|
2148
|
-
flexWrap: "nowrap"
|
|
2149
|
-
} }, [createVNode(ErrorList_default, {
|
|
2150
|
-
errors: p,
|
|
2151
|
-
help: f,
|
|
2152
|
-
class: `${h}-explain-connected`,
|
|
2153
|
-
onErrorVisibleChanged: d
|
|
2154
|
-
}, null), !!u && createVNode("div", { style: {
|
|
2155
|
-
width: 0,
|
|
2156
|
-
height: `${u}px`
|
|
2157
|
-
} }, null)]) : null,
|
|
2158
|
-
m ? createVNode("div", { class: `${h}-extra` }, [m]) : null
|
|
2159
|
-
]) });
|
|
2160
|
-
};
|
|
2161
|
-
}
|
|
2162
|
-
});
|
|
2163
|
-
function useDebounce(a) {
|
|
2164
|
-
let o = shallowRef(a.value.slice()), s = null;
|
|
2165
|
-
return watchEffect(() => {
|
|
2166
|
-
clearTimeout(s), s = setTimeout(() => {
|
|
2167
|
-
o.value = a.value;
|
|
2168
|
-
}, a.value.length ? 0 : 10);
|
|
2169
|
-
}), o;
|
|
2170
|
-
}
|
|
2171
|
-
tuple("success", "warning", "error", "validating", "");
|
|
2172
|
-
var iconMap = {
|
|
2173
|
-
success: CheckCircleFilled,
|
|
2174
|
-
warning: ExclamationCircleFilled,
|
|
2175
|
-
error: CloseCircleFilled,
|
|
2176
|
-
validating: LoadingOutlined
|
|
2177
|
-
};
|
|
2178
|
-
function getPropByPath$1(a, o, s) {
|
|
2179
|
-
let c = a, l = o, u = 0;
|
|
2180
|
-
try {
|
|
2181
|
-
for (let a = l.length; u < a - 1 && !(!c && !s); ++u) {
|
|
2182
|
-
let a = l[u];
|
|
2183
|
-
if (a in c) c = c[a];
|
|
2184
|
-
else {
|
|
2185
|
-
if (s) throw Error("please transfer a valid name path to form item!");
|
|
2186
|
-
break;
|
|
2187
|
-
}
|
|
2188
|
-
}
|
|
2189
|
-
if (s && !c) throw Error("please transfer a valid name path to form item!");
|
|
2190
|
-
} catch {
|
|
2191
|
-
console.error("please transfer a valid name path to form item!");
|
|
2192
|
-
}
|
|
2193
|
-
return {
|
|
2194
|
-
o: c,
|
|
2195
|
-
k: l[u],
|
|
2196
|
-
v: c ? c[l[u]] : void 0
|
|
2197
|
-
};
|
|
2198
|
-
}
|
|
2199
|
-
const formItemProps = () => ({
|
|
2200
|
-
htmlFor: String,
|
|
2201
|
-
prefixCls: String,
|
|
2202
|
-
label: PropTypes.any,
|
|
2203
|
-
help: PropTypes.any,
|
|
2204
|
-
extra: PropTypes.any,
|
|
2205
|
-
labelCol: { type: Object },
|
|
2206
|
-
wrapperCol: { type: Object },
|
|
2207
|
-
hasFeedback: {
|
|
2208
|
-
type: Boolean,
|
|
2209
|
-
default: !1
|
|
2210
|
-
},
|
|
2211
|
-
colon: {
|
|
2212
|
-
type: Boolean,
|
|
2213
|
-
default: void 0
|
|
2214
|
-
},
|
|
2215
|
-
labelAlign: String,
|
|
2216
|
-
prop: { type: [
|
|
2217
|
-
String,
|
|
2218
|
-
Number,
|
|
2219
|
-
Array
|
|
2220
|
-
] },
|
|
2221
|
-
name: { type: [
|
|
2222
|
-
String,
|
|
2223
|
-
Number,
|
|
2224
|
-
Array
|
|
2225
|
-
] },
|
|
2226
|
-
rules: [Array, Object],
|
|
2227
|
-
autoLink: {
|
|
2228
|
-
type: Boolean,
|
|
2229
|
-
default: !0
|
|
2230
|
-
},
|
|
2231
|
-
required: {
|
|
2232
|
-
type: Boolean,
|
|
2233
|
-
default: void 0
|
|
2234
|
-
},
|
|
2235
|
-
validateFirst: {
|
|
2236
|
-
type: Boolean,
|
|
2237
|
-
default: void 0
|
|
2238
|
-
},
|
|
2239
|
-
validateStatus: PropTypes.oneOf(tuple("", "success", "warning", "error", "validating")),
|
|
2240
|
-
validateTrigger: { type: [String, Array] },
|
|
2241
|
-
messageVariables: { type: Object },
|
|
2242
|
-
hidden: Boolean,
|
|
2243
|
-
noStyle: Boolean,
|
|
2244
|
-
tooltip: String
|
|
2245
|
-
});
|
|
2246
|
-
var indexGuid = 0, defaultItemNamePrefixCls = "form_item", FormItem_default = defineComponent({
|
|
2247
|
-
compatConfig: { MODE: 3 },
|
|
2248
|
-
name: "AFormItem",
|
|
2249
|
-
inheritAttrs: !1,
|
|
2250
|
-
__ANT_NEW_FORM_ITEM: !0,
|
|
2251
|
-
props: formItemProps(),
|
|
2252
|
-
slots: Object,
|
|
2253
|
-
setup(a, o) {
|
|
2254
|
-
let { slots: c, attrs: l, expose: d } = o;
|
|
2255
|
-
warning$1(a.prop === void 0, "`prop` is deprecated. Please use `name` instead.");
|
|
2256
|
-
let f = `form-item-${++indexGuid}`, { prefixCls: p } = useConfigInject_default("form", a), [m, h] = style_default(p), g = shallowRef(), _ = useInjectForm(), v = computed(() => a.name || a.prop), y = shallowRef([]), b = shallowRef(!1), x = shallowRef(), S = computed(() => {
|
|
2257
|
-
let a = v.value;
|
|
2258
|
-
return getNamePath(a);
|
|
2259
|
-
}), C = computed(() => {
|
|
2260
|
-
if (S.value.length) {
|
|
2261
|
-
let a = _.name.value, o = S.value.join("_");
|
|
2262
|
-
return a ? `${a}_${o}` : `${defaultItemNamePrefixCls}_${o}`;
|
|
2263
|
-
} else return;
|
|
2264
|
-
}), w = () => {
|
|
2265
|
-
let a = _.model.value;
|
|
2266
|
-
if (!(!a || !v.value)) return getPropByPath$1(a, S.value, !0).v;
|
|
2267
|
-
}, T = computed(() => w()), E = shallowRef(cloneDeep(T.value)), D = computed(() => {
|
|
2268
|
-
let o = a.validateTrigger === void 0 ? _.validateTrigger.value : a.validateTrigger;
|
|
2269
|
-
return o = o === void 0 ? "change" : o, toArray$1(o);
|
|
2270
|
-
}), O = computed(() => {
|
|
2271
|
-
let o = _.rules.value, s = a.rules, c = a.required === void 0 ? [] : {
|
|
2272
|
-
required: !!a.required,
|
|
2273
|
-
trigger: D.value
|
|
2274
|
-
}, l = getPropByPath$1(o, S.value);
|
|
2275
|
-
o = o ? l.o[l.k] || l.v : [];
|
|
2276
|
-
let u = [].concat(s || o || []);
|
|
2277
|
-
return find(u, (a) => a.required) ? u : u.concat(c);
|
|
2278
|
-
}), k = computed(() => {
|
|
2279
|
-
let o = O.value, s = !1;
|
|
2280
|
-
return o && o.length && o.every((a) => a.required ? (s = !0, !1) : !0), s || a.required;
|
|
2281
|
-
}), A = shallowRef();
|
|
2282
|
-
watchEffect(() => {
|
|
2283
|
-
A.value = a.validateStatus;
|
|
2284
|
-
});
|
|
2285
|
-
let j = computed(() => {
|
|
2286
|
-
let o = {};
|
|
2287
|
-
return typeof a.label == "string" ? o.label = a.label : a.name && (o.label = String(a.name)), a.messageVariables && (o = _extends$1(_extends$1({}, o), a.messageVariables)), o;
|
|
2288
|
-
}), M = (o) => {
|
|
2289
|
-
if (S.value.length === 0) return;
|
|
2290
|
-
let { validateFirst: s = !1 } = a, { triggerName: c } = o || {}, l = O.value;
|
|
2291
|
-
if (c && (l = l.filter((a) => {
|
|
2292
|
-
let { trigger: o } = a;
|
|
2293
|
-
return !o && !D.value.length ? !0 : toArray$1(o || D.value).includes(c);
|
|
2294
|
-
})), !l.length) return Promise.resolve();
|
|
2295
|
-
let d = validateRules(S.value, T.value, l, _extends$1({ validateMessages: _.validateMessages.value }, o), s, j.value);
|
|
2296
|
-
return A.value = "validating", y.value = [], d.catch((a) => a).then(function() {
|
|
2297
|
-
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
2298
|
-
if (A.value === "validating") {
|
|
2299
|
-
let o = a.filter((a) => a && a.errors.length);
|
|
2300
|
-
A.value = o.length ? "error" : "success", y.value = o.map((a) => a.errors), _.onValidate(v.value, !y.value.length, y.value.length ? toRaw(y.value[0]) : null);
|
|
2301
|
-
}
|
|
2302
|
-
}), d;
|
|
2303
|
-
}, N = () => {
|
|
2304
|
-
M({ triggerName: "blur" });
|
|
2305
|
-
}, P = () => {
|
|
2306
|
-
if (b.value) {
|
|
2307
|
-
b.value = !1;
|
|
2308
|
-
return;
|
|
2309
|
-
}
|
|
2310
|
-
M({ triggerName: "change" });
|
|
2311
|
-
}, F = () => {
|
|
2312
|
-
A.value = a.validateStatus, b.value = !1, y.value = [];
|
|
2313
|
-
}, I = () => {
|
|
2314
|
-
A.value = a.validateStatus, b.value = !0, y.value = [];
|
|
2315
|
-
let o = _.model.value || {}, s = T.value, c = getPropByPath$1(o, S.value, !0);
|
|
2316
|
-
Array.isArray(s) ? c.o[c.k] = [].concat(E.value ?? []) : c.o[c.k] = E.value, nextTick(() => {
|
|
2317
|
-
b.value = !1;
|
|
2318
|
-
});
|
|
2319
|
-
}, L = computed(() => a.htmlFor === void 0 ? C.value : a.htmlFor), R = () => {
|
|
2320
|
-
let a = L.value;
|
|
2321
|
-
if (!a || !x.value) return;
|
|
2322
|
-
let o = x.value.$el.querySelector(`[id="${a}"]`);
|
|
2323
|
-
o && o.focus && o.focus();
|
|
2324
|
-
};
|
|
2325
|
-
d({
|
|
2326
|
-
onFieldBlur: N,
|
|
2327
|
-
onFieldChange: P,
|
|
2328
|
-
clearValidate: F,
|
|
2329
|
-
resetField: I
|
|
2330
|
-
}), useProvideFormItemContext({
|
|
2331
|
-
id: C,
|
|
2332
|
-
onFieldBlur: () => {
|
|
2333
|
-
a.autoLink && N();
|
|
2334
|
-
},
|
|
2335
|
-
onFieldChange: () => {
|
|
2336
|
-
a.autoLink && P();
|
|
2337
|
-
},
|
|
2338
|
-
clearValidate: F
|
|
2339
|
-
}, computed(() => !!(a.autoLink && _.model.value && v.value)));
|
|
2340
|
-
let z = !1;
|
|
2341
|
-
watch(v, (a) => {
|
|
2342
|
-
a ? z || (z = !0, _.addField(f, {
|
|
2343
|
-
fieldValue: T,
|
|
2344
|
-
fieldId: C,
|
|
2345
|
-
fieldName: v,
|
|
2346
|
-
resetField: I,
|
|
2347
|
-
clearValidate: F,
|
|
2348
|
-
namePath: S,
|
|
2349
|
-
validateRules: M,
|
|
2350
|
-
rules: O
|
|
2351
|
-
})) : (z = !1, _.removeField(f));
|
|
2352
|
-
}, { immediate: !0 }), onBeforeUnmount(() => {
|
|
2353
|
-
_.removeField(f);
|
|
2354
|
-
});
|
|
2355
|
-
let B = useDebounce(y), V = computed(() => a.validateStatus === void 0 ? B.value.length ? "error" : A.value : a.validateStatus), H = computed(() => ({
|
|
2356
|
-
[`${p.value}-item`]: !0,
|
|
2357
|
-
[h.value]: !0,
|
|
2358
|
-
[`${p.value}-item-has-feedback`]: V.value && a.hasFeedback,
|
|
2359
|
-
[`${p.value}-item-has-success`]: V.value === "success",
|
|
2360
|
-
[`${p.value}-item-has-warning`]: V.value === "warning",
|
|
2361
|
-
[`${p.value}-item-has-error`]: V.value === "error",
|
|
2362
|
-
[`${p.value}-item-is-validating`]: V.value === "validating",
|
|
2363
|
-
[`${p.value}-item-hidden`]: a.hidden
|
|
2364
|
-
})), U = reactive({});
|
|
2365
|
-
FormItemInputContext.useProvide(U), watchEffect(() => {
|
|
2366
|
-
let o;
|
|
2367
|
-
if (a.hasFeedback) {
|
|
2368
|
-
let a = V.value && iconMap[V.value];
|
|
2369
|
-
o = a ? createVNode("span", { class: classNames(`${p.value}-item-feedback-icon`, `${p.value}-item-feedback-icon-${V.value}`) }, [createVNode(a, null, null)]) : null;
|
|
2370
|
-
}
|
|
2371
|
-
_extends$1(U, {
|
|
2372
|
-
status: V.value,
|
|
2373
|
-
hasFeedback: a.hasFeedback,
|
|
2374
|
-
feedbackIcon: o,
|
|
2375
|
-
isFormItemInput: !0
|
|
2376
|
-
});
|
|
2377
|
-
});
|
|
2378
|
-
let W = shallowRef(null), G = shallowRef(!1), J = () => {
|
|
2379
|
-
if (g.value) {
|
|
2380
|
-
let a = getComputedStyle(g.value);
|
|
2381
|
-
W.value = parseInt(a.marginBottom, 10);
|
|
2382
|
-
}
|
|
2383
|
-
};
|
|
2384
|
-
onMounted(() => {
|
|
2385
|
-
watch(G, () => {
|
|
2386
|
-
G.value && J();
|
|
2387
|
-
}, {
|
|
2388
|
-
flush: "post",
|
|
2389
|
-
immediate: !0
|
|
2390
|
-
});
|
|
2391
|
-
});
|
|
2392
|
-
let Y = (a) => {
|
|
2393
|
-
a || (W.value = null);
|
|
2394
|
-
};
|
|
2395
|
-
return () => {
|
|
2396
|
-
if (a.noStyle) return c.default?.call(c);
|
|
2397
|
-
let o = a.help ?? (c.help ? filterEmpty(c.help()) : null), s = !!(o != null && Array.isArray(o) && o.length || B.value.length);
|
|
2398
|
-
return G.value = s, m(createVNode("div", {
|
|
2399
|
-
class: [
|
|
2400
|
-
H.value,
|
|
2401
|
-
s ? `${p.value}-item-with-help` : "",
|
|
2402
|
-
l.class
|
|
2403
|
-
],
|
|
2404
|
-
ref: g
|
|
2405
|
-
}, [createVNode(ARow, _objectSpread2(_objectSpread2({}, l), {}, {
|
|
2406
|
-
class: `${p.value}-item-row`,
|
|
2407
|
-
key: "row"
|
|
2408
|
-
}), { default: () => createVNode(Fragment, null, [createVNode(FormItemLabel, _objectSpread2(_objectSpread2({}, a), {}, {
|
|
2409
|
-
htmlFor: L.value,
|
|
2410
|
-
required: k.value,
|
|
2411
|
-
requiredMark: _.requiredMark.value,
|
|
2412
|
-
prefixCls: p.value,
|
|
2413
|
-
onClick: R,
|
|
2414
|
-
label: a.label
|
|
2415
|
-
}), {
|
|
2416
|
-
label: c.label,
|
|
2417
|
-
tooltip: c.tooltip
|
|
2418
|
-
}), createVNode(FormItemInput, _objectSpread2(_objectSpread2({}, a), {}, {
|
|
2419
|
-
errors: o == null ? B.value : toArray$1(o),
|
|
2420
|
-
marginBottom: W.value,
|
|
2421
|
-
prefixCls: p.value,
|
|
2422
|
-
status: V.value,
|
|
2423
|
-
ref: x,
|
|
2424
|
-
help: o,
|
|
2425
|
-
extra: a.extra ?? c.extra?.call(c),
|
|
2426
|
-
onErrorVisibleChanged: Y
|
|
2427
|
-
}), { default: c.default })]) }), !!W.value && createVNode("div", {
|
|
2428
|
-
class: `${p.value}-margin-offset`,
|
|
2429
|
-
style: { marginBottom: `-${W.value}px` }
|
|
2430
|
-
}, null)]));
|
|
2431
|
-
};
|
|
2432
|
-
}
|
|
2433
|
-
});
|
|
2434
|
-
function allPromiseFinish(a) {
|
|
2435
|
-
let o = !1, s = a.length, c = [];
|
|
2436
|
-
return a.length ? new Promise((l, u) => {
|
|
2437
|
-
a.forEach((a, d) => {
|
|
2438
|
-
a.catch((a) => (o = !0, a)).then((a) => {
|
|
2439
|
-
--s, c[d] = a, !(s > 0) && (o && u(c), l(c));
|
|
2440
|
-
});
|
|
2441
|
-
});
|
|
2442
|
-
}) : Promise.resolve([]);
|
|
2443
|
-
}
|
|
2444
|
-
function isRequired(a) {
|
|
2445
|
-
let o = !1;
|
|
2446
|
-
return a && a.length && a.every((a) => a.required ? (o = !0, !1) : !0), o;
|
|
2447
|
-
}
|
|
2448
|
-
function toArray(a) {
|
|
2449
|
-
return a == null ? [] : Array.isArray(a) ? a : [a];
|
|
2450
|
-
}
|
|
2451
|
-
function getPropByPath(a, o, s) {
|
|
2452
|
-
let c = a;
|
|
2453
|
-
o = o.replace(/\[(\w+)\]/g, ".$1"), o = o.replace(/^\./, "");
|
|
2454
|
-
let l = o.split("."), u = 0;
|
|
2455
|
-
for (let a = l.length; u < a - 1 && !(!c && !s); ++u) {
|
|
2456
|
-
let a = l[u];
|
|
2457
|
-
if (a in c) c = c[a];
|
|
2458
|
-
else {
|
|
2459
|
-
if (s) throw Error("please transfer a valid name path to validate!");
|
|
2460
|
-
break;
|
|
2461
|
-
}
|
|
2462
|
-
}
|
|
2463
|
-
return {
|
|
2464
|
-
o: c,
|
|
2465
|
-
k: l[u],
|
|
2466
|
-
v: c ? c[l[u]] : null,
|
|
2467
|
-
isValid: c && l[u] in c
|
|
2468
|
-
};
|
|
2469
|
-
}
|
|
2470
|
-
function useForm(a) {
|
|
2471
|
-
let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ref({}), s = arguments.length > 2 ? arguments[2] : void 0, c = cloneDeep(unref(a)), l = reactive({}), d = shallowRef([]), f = (s) => {
|
|
2472
|
-
_extends$1(unref(a), _extends$1(_extends$1({}, cloneDeep(c)), s)), nextTick(() => {
|
|
2473
|
-
Object.keys(l).forEach((a) => {
|
|
2474
|
-
l[a] = {
|
|
2475
|
-
autoLink: !1,
|
|
2476
|
-
required: isRequired(unref(o)[a])
|
|
2477
|
-
};
|
|
2478
|
-
});
|
|
2479
|
-
});
|
|
2480
|
-
}, p = function() {
|
|
2481
|
-
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], o = arguments.length > 1 ? arguments[1] : void 0;
|
|
2482
|
-
return o.length ? a.filter((a) => intersection(toArray(a.trigger || "change"), o).length) : a;
|
|
2483
|
-
}, m = null, h = function(s) {
|
|
2484
|
-
let c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = arguments.length > 2 ? arguments[2] : void 0, u = [], d = {};
|
|
2485
|
-
for (let f = 0; f < s.length; f++) {
|
|
2486
|
-
let m = s[f], h = getPropByPath(unref(a), m, l);
|
|
2487
|
-
if (!h.isValid) continue;
|
|
2488
|
-
d[m] = h.v;
|
|
2489
|
-
let _ = p(unref(o)[m], toArray(c && c.trigger));
|
|
2490
|
-
_.length && u.push(g(m, h.v, _, c || {}).then(() => ({
|
|
2491
|
-
name: m,
|
|
2492
|
-
errors: [],
|
|
2493
|
-
warnings: []
|
|
2494
|
-
})).catch((a) => {
|
|
2495
|
-
let o = [], s = [];
|
|
2496
|
-
return a.forEach((a) => {
|
|
2497
|
-
let { rule: { warningOnly: c }, errors: l } = a;
|
|
2498
|
-
c ? s.push(...l) : o.push(...l);
|
|
2499
|
-
}), o.length ? Promise.reject({
|
|
2500
|
-
name: m,
|
|
2501
|
-
errors: o,
|
|
2502
|
-
warnings: s
|
|
2503
|
-
}) : {
|
|
2504
|
-
name: m,
|
|
2505
|
-
errors: o,
|
|
2506
|
-
warnings: s
|
|
2507
|
-
};
|
|
2508
|
-
}));
|
|
2509
|
-
}
|
|
2510
|
-
let f = allPromiseFinish(u);
|
|
2511
|
-
m = f;
|
|
2512
|
-
let h = f.then(() => m === f ? Promise.resolve(d) : Promise.reject([])).catch((a) => {
|
|
2513
|
-
let o = a.filter((a) => a && a.errors.length);
|
|
2514
|
-
return o.length ? Promise.reject({
|
|
2515
|
-
values: d,
|
|
2516
|
-
errorFields: o,
|
|
2517
|
-
outOfDate: m !== f
|
|
2518
|
-
}) : Promise.resolve(d);
|
|
2519
|
-
});
|
|
2520
|
-
return h.catch((a) => a), h;
|
|
2521
|
-
}, g = function(a, o, c) {
|
|
2522
|
-
let d = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, f = validateRules([a], o, c, _extends$1({ validateMessages: defaultValidateMessages }, d), !!d.validateFirst);
|
|
2523
|
-
return l[a] ? (l[a].validateStatus = "validating", f.catch((a) => a).then(function() {
|
|
2524
|
-
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
2525
|
-
var c;
|
|
2526
|
-
if (l[a].validateStatus === "validating") {
|
|
2527
|
-
let u = o.filter((a) => a && a.errors.length);
|
|
2528
|
-
l[a].validateStatus = u.length ? "error" : "success", l[a].help = u.length ? u.map((a) => a.errors) : null, (c = s?.onValidate) == null || c.call(s, a, !u.length, u.length ? toRaw(l[a].help[0]) : null);
|
|
2529
|
-
}
|
|
2530
|
-
}), f) : f.catch((a) => a);
|
|
2531
|
-
}, _ = (a, o) => {
|
|
2532
|
-
let s = [], c = !0;
|
|
2533
|
-
a ? s = Array.isArray(a) ? a : [a] : (c = !1, s = d.value);
|
|
2534
|
-
let l = h(s, o || {}, c);
|
|
2535
|
-
return l.catch((a) => a), l;
|
|
2536
|
-
}, v = (a) => {
|
|
2537
|
-
let o = [];
|
|
2538
|
-
o = a ? Array.isArray(a) ? a : [a] : d.value, o.forEach((a) => {
|
|
2539
|
-
l[a] && _extends$1(l[a], {
|
|
2540
|
-
validateStatus: "",
|
|
2541
|
-
help: null
|
|
2542
|
-
});
|
|
2543
|
-
});
|
|
2544
|
-
}, y = (a) => {
|
|
2545
|
-
let o = { autoLink: !1 }, s = [], c = Array.isArray(a) ? a : [a];
|
|
2546
|
-
for (let a = 0; a < c.length; a++) {
|
|
2547
|
-
let l = c[a];
|
|
2548
|
-
l?.validateStatus === "error" && (o.validateStatus = "error", l.help && s.push(l.help)), o.required = o.required || l?.required;
|
|
2549
|
-
}
|
|
2550
|
-
return o.help = s, o;
|
|
2551
|
-
}, b = c, x = !0, S = (a) => {
|
|
2552
|
-
let o = [];
|
|
2553
|
-
d.value.forEach((c) => {
|
|
2554
|
-
let l = getPropByPath(a, c, !1), u = getPropByPath(b, c, !1);
|
|
2555
|
-
(x && s?.immediate && l.isValid || !isEqual(l.v, u.v)) && o.push(c);
|
|
2556
|
-
}), _(o, { trigger: "change" }), x = !1, b = cloneDeep(toRaw(a));
|
|
2557
|
-
}, C = s?.debounce, w = !0;
|
|
2558
|
-
return watch(o, () => {
|
|
2559
|
-
d.value = o ? Object.keys(unref(o)) : [], !w && s && s.validateOnRuleChange && _(), w = !1;
|
|
2560
|
-
}, {
|
|
2561
|
-
deep: !0,
|
|
2562
|
-
immediate: !0
|
|
2563
|
-
}), watch(d, () => {
|
|
2564
|
-
let a = {};
|
|
2565
|
-
d.value.forEach((s) => {
|
|
2566
|
-
a[s] = _extends$1({}, l[s], {
|
|
2567
|
-
autoLink: !1,
|
|
2568
|
-
required: isRequired(unref(o)[s])
|
|
2569
|
-
}), delete l[s];
|
|
2570
|
-
});
|
|
2571
|
-
for (let a in l) Object.prototype.hasOwnProperty.call(l, a) && delete l[a];
|
|
2572
|
-
_extends$1(l, a);
|
|
2573
|
-
}, { immediate: !0 }), watch(a, C && C.wait ? debounce(S, C.wait, omit(C, ["wait"])) : S, {
|
|
2574
|
-
immediate: s && !!s.immediate,
|
|
2575
|
-
deep: !0
|
|
2576
|
-
}), {
|
|
2577
|
-
modelRef: a,
|
|
2578
|
-
rulesRef: o,
|
|
2579
|
-
initialModel: c,
|
|
2580
|
-
validateInfos: l,
|
|
2581
|
-
resetFields: f,
|
|
2582
|
-
validate: _,
|
|
2583
|
-
validateField: g,
|
|
2584
|
-
mergeValidateInfo: y,
|
|
2585
|
-
clearValidate: v
|
|
2586
|
-
};
|
|
2587
|
-
}
|
|
2588
|
-
const formProps = () => ({
|
|
2589
|
-
layout: PropTypes.oneOf(tuple("horizontal", "inline", "vertical")),
|
|
2590
|
-
labelCol: objectType(),
|
|
2591
|
-
wrapperCol: objectType(),
|
|
2592
|
-
colon: booleanType(),
|
|
2593
|
-
labelAlign: stringType(),
|
|
2594
|
-
labelWrap: booleanType(),
|
|
2595
|
-
prefixCls: String,
|
|
2596
|
-
requiredMark: someType([String, Boolean]),
|
|
2597
|
-
hideRequiredMark: booleanType(),
|
|
2598
|
-
model: PropTypes.object,
|
|
2599
|
-
rules: objectType(),
|
|
2600
|
-
validateMessages: objectType(),
|
|
2601
|
-
validateOnRuleChange: booleanType(),
|
|
2602
|
-
scrollToFirstError: anyType(),
|
|
2603
|
-
onSubmit: functionType(),
|
|
2604
|
-
name: String,
|
|
2605
|
-
validateTrigger: someType([String, Array]),
|
|
2606
|
-
size: stringType(),
|
|
2607
|
-
disabled: booleanType(),
|
|
2608
|
-
onValuesChange: functionType(),
|
|
2609
|
-
onFieldsChange: functionType(),
|
|
2610
|
-
onFinish: functionType(),
|
|
2611
|
-
onFinishFailed: functionType(),
|
|
2612
|
-
onValidate: functionType()
|
|
2613
|
-
});
|
|
2614
|
-
function isEqualName(a, o) {
|
|
2615
|
-
return isEqual(toArray$1(a), toArray$1(o));
|
|
2616
|
-
}
|
|
2617
|
-
var Form = defineComponent({
|
|
2618
|
-
compatConfig: { MODE: 3 },
|
|
2619
|
-
name: "AForm",
|
|
2620
|
-
inheritAttrs: !1,
|
|
2621
|
-
props: initDefaultProps(formProps(), {
|
|
2622
|
-
layout: "horizontal",
|
|
2623
|
-
hideRequiredMark: !1,
|
|
2624
|
-
colon: !0
|
|
2625
|
-
}),
|
|
2626
|
-
Item: FormItem_default,
|
|
2627
|
-
useForm,
|
|
2628
|
-
setup(a, o) {
|
|
2629
|
-
let { emit: s, slots: c, expose: d, attrs: p } = o, { prefixCls: m, direction: h, form: g, size: _, disabled: v } = useConfigInject_default("form", a), y = computed(() => a.requiredMark === "" || a.requiredMark), b = computed(() => y.value === void 0 ? g && g.value?.requiredMark !== void 0 ? g.value.requiredMark : !a.hideRequiredMark : y.value);
|
|
2630
|
-
useProviderSize(_), useProviderDisabled(v);
|
|
2631
|
-
let x = computed(() => a.colon ?? g.value?.colon), { validateMessages: S } = useInjectGlobalForm(), C = computed(() => _extends$1(_extends$1(_extends$1({}, defaultValidateMessages), S.value), a.validateMessages)), [w, T] = style_default(m), E = computed(() => classNames(m.value, {
|
|
2632
|
-
[`${m.value}-${a.layout}`]: !0,
|
|
2633
|
-
[`${m.value}-hide-required-mark`]: b.value === !1,
|
|
2634
|
-
[`${m.value}-rtl`]: h.value === "rtl",
|
|
2635
|
-
[`${m.value}-${_.value}`]: _.value
|
|
2636
|
-
}, T.value)), D = ref(), O = {}, k = (a, o) => {
|
|
2637
|
-
O[a] = o;
|
|
2638
|
-
}, A = (a) => {
|
|
2639
|
-
delete O[a];
|
|
2640
|
-
}, j = (a) => {
|
|
2641
|
-
let o = !!a, s = o ? toArray$1(a).map(getNamePath) : [];
|
|
2642
|
-
return o ? Object.values(O).filter((a) => s.findIndex((o) => isEqualName(o, a.fieldName.value)) > -1) : Object.values(O);
|
|
2643
|
-
}, M = (o) => {
|
|
2644
|
-
if (!a.model) {
|
|
2645
|
-
warning_default(!1, "Form", "model is required for resetFields to work.");
|
|
2646
|
-
return;
|
|
2647
|
-
}
|
|
2648
|
-
j(o).forEach((a) => {
|
|
2649
|
-
a.resetField();
|
|
2650
|
-
});
|
|
2651
|
-
}, N = (a) => {
|
|
2652
|
-
j(a).forEach((a) => {
|
|
2653
|
-
a.clearValidate();
|
|
2654
|
-
});
|
|
2655
|
-
}, P = (o) => {
|
|
2656
|
-
let { scrollToFirstError: c } = a;
|
|
2657
|
-
if (s("finishFailed", o), c && o.errorFields.length) {
|
|
2658
|
-
let a = {};
|
|
2659
|
-
typeof c == "object" && (a = c), I(o.errorFields[0].name, a);
|
|
2660
|
-
}
|
|
2661
|
-
}, F = function() {
|
|
2662
|
-
return B(...arguments);
|
|
2663
|
-
}, I = function(a) {
|
|
2664
|
-
let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = j(a ? [a] : void 0);
|
|
2665
|
-
if (s.length) {
|
|
2666
|
-
let a = s[0].fieldId.value, c = a ? document.getElementById(a) : null;
|
|
2667
|
-
c && scrollIntoView(c, _extends$1({
|
|
2668
|
-
scrollMode: "if-needed",
|
|
2669
|
-
block: "nearest"
|
|
2670
|
-
}, o));
|
|
2671
|
-
}
|
|
2672
|
-
}, L = function() {
|
|
2673
|
-
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0;
|
|
2674
|
-
if (o === !0) {
|
|
2675
|
-
let o = [];
|
|
2676
|
-
return Object.values(O).forEach((a) => {
|
|
2677
|
-
let { namePath: s } = a;
|
|
2678
|
-
o.push(s.value);
|
|
2679
|
-
}), cloneByNamePathList(a.model, o);
|
|
2680
|
-
} else return cloneByNamePathList(a.model, o);
|
|
2681
|
-
}, R = (o, s) => {
|
|
2682
|
-
if (warning_default(!(o instanceof Function), "Form", "validateFields/validateField/validate not support callback, please use promise instead"), !a.model) return warning_default(!1, "Form", "model is required for validateFields to work."), Promise.reject("Form `model` is required for validateFields to work.");
|
|
2683
|
-
let c = !!o, l = c ? toArray$1(o).map(getNamePath) : [], d = [];
|
|
2684
|
-
Object.values(O).forEach((a) => {
|
|
2685
|
-
if (c || l.push(a.namePath.value), !a.rules?.value.length) return;
|
|
2686
|
-
let o = a.namePath.value;
|
|
2687
|
-
if (!c || containsNamePath(l, o)) {
|
|
2688
|
-
let c = a.validateRules(_extends$1({ validateMessages: C.value }, s));
|
|
2689
|
-
d.push(c.then(() => ({
|
|
2690
|
-
name: o,
|
|
2691
|
-
errors: [],
|
|
2692
|
-
warnings: []
|
|
2693
|
-
})).catch((a) => {
|
|
2694
|
-
let s = [], c = [];
|
|
2695
|
-
return a.forEach((a) => {
|
|
2696
|
-
let { rule: { warningOnly: o }, errors: l } = a;
|
|
2697
|
-
o ? c.push(...l) : s.push(...l);
|
|
2698
|
-
}), s.length ? Promise.reject({
|
|
2699
|
-
name: o,
|
|
2700
|
-
errors: s,
|
|
2701
|
-
warnings: c
|
|
2702
|
-
}) : {
|
|
2703
|
-
name: o,
|
|
2704
|
-
errors: s,
|
|
2705
|
-
warnings: c
|
|
2706
|
-
};
|
|
2707
|
-
}));
|
|
2708
|
-
}
|
|
2709
|
-
});
|
|
2710
|
-
let p = allPromiseFinish(d);
|
|
2711
|
-
D.value = p;
|
|
2712
|
-
let m = p.then(() => D.value === p ? Promise.resolve(L(l)) : Promise.reject([])).catch((a) => {
|
|
2713
|
-
let o = a.filter((a) => a && a.errors.length);
|
|
2714
|
-
return Promise.reject({
|
|
2715
|
-
values: L(l),
|
|
2716
|
-
errorFields: o,
|
|
2717
|
-
outOfDate: D.value !== p
|
|
2718
|
-
});
|
|
2719
|
-
});
|
|
2720
|
-
return m.catch((a) => a), m;
|
|
2721
|
-
}, B = function() {
|
|
2722
|
-
return R(...arguments);
|
|
2723
|
-
}, V = (o) => {
|
|
2724
|
-
o.preventDefault(), o.stopPropagation(), s("submit", o), a.model && R().then((a) => {
|
|
2725
|
-
s("finish", a);
|
|
2726
|
-
}).catch((a) => {
|
|
2727
|
-
P(a);
|
|
2728
|
-
});
|
|
2729
|
-
};
|
|
2730
|
-
return d({
|
|
2731
|
-
resetFields: M,
|
|
2732
|
-
clearValidate: N,
|
|
2733
|
-
validateFields: R,
|
|
2734
|
-
getFieldsValue: L,
|
|
2735
|
-
validate: F,
|
|
2736
|
-
scrollToField: I
|
|
2737
|
-
}), useProvideForm({
|
|
2738
|
-
model: computed(() => a.model),
|
|
2739
|
-
name: computed(() => a.name),
|
|
2740
|
-
labelAlign: computed(() => a.labelAlign),
|
|
2741
|
-
labelCol: computed(() => a.labelCol),
|
|
2742
|
-
labelWrap: computed(() => a.labelWrap),
|
|
2743
|
-
wrapperCol: computed(() => a.wrapperCol),
|
|
2744
|
-
vertical: computed(() => a.layout === "vertical"),
|
|
2745
|
-
colon: x,
|
|
2746
|
-
requiredMark: b,
|
|
2747
|
-
validateTrigger: computed(() => a.validateTrigger),
|
|
2748
|
-
rules: computed(() => a.rules),
|
|
2749
|
-
addField: k,
|
|
2750
|
-
removeField: A,
|
|
2751
|
-
onValidate: (a, o, c) => {
|
|
2752
|
-
s("validate", a, o, c);
|
|
2753
|
-
},
|
|
2754
|
-
validateMessages: C
|
|
2755
|
-
}), watch(() => a.rules, () => {
|
|
2756
|
-
a.validateOnRuleChange && R();
|
|
2757
|
-
}), () => w(createVNode("form", _objectSpread2(_objectSpread2({}, p), {}, {
|
|
2758
|
-
onSubmit: V,
|
|
2759
|
-
class: [E.value, p.class]
|
|
2760
|
-
}), [c.default?.call(c)]));
|
|
2761
|
-
}
|
|
2762
|
-
});
|
|
2763
|
-
/* istanbul ignore next */
|
|
2764
|
-
Form.useInjectFormItemContext = useInjectFormItemContext, Form.ItemRest = FormItemContext_default, Form.install = function(a) {
|
|
2765
|
-
return a.component(Form.name, Form), a.component(Form.Item.name, Form.Item), a.component(FormItemContext_default.name, FormItemContext_default), a;
|
|
2766
|
-
};
|
|
2767
|
-
var form_default = Form;
|
|
2768
|
-
export { copyObject as C, copyArray as D, arrayIncludes as E, toFinite as O, baseRest as S, baseAssignValue as T, flatRest as _, Col_default as a, castPath as b, useResponsiveObserver as c, isArrayLikeObject as d, debounce as f, cloneBuffer as g, cloneTypedArray as h, formItemProps as i, omit as l, initCloneObject as m, formProps as n, ARow as o, hasIn as p, FormItem_default as r, useFlexGapSupport_default as s, form_default as t, arrayIncludesWith as u, baseGet as v, assignValue as w, keysIn as x, toKey as y };
|