epic-designer-cjh
Version:
基于vue3的设计器,可视化开发页面表单
1,566 lines • 63.1 kB
JavaScript
import { i as ie } from "./interopRequireDefault-40f894e3.js";
import { r as fe } from "./_vue_commonjs-external-eb7fec7f.js";
import { r as ge, a as Ae } from "./public_api-1267ff2a.js";
import { r as Ct } from "./index-f96a976e.js";
import { i as wt, b as et, v as At, w as Tt, d as Xe, r as Dt, a as Lt, f as qt, e as Pt, h as Bt, t as zt, x as Ut, y as Wt, g as Ht } from "./useConfigInject-d85d8c62.js";
import { r as Gt } from "./LoadingOutlined-7a37e4f8.js";
import { r as Qt } from "./CloseCircleFilled-9cec1aca.js";
import { r as Xt, a as Kt } from "./ExclamationCircleFilled-5348250c.js";
import { r as It, a as kt, b as Yt, c as Jt, d as Zt } from "./omit-f0993d0d.js";
import { r as St, a as er } from "./Col-dad05aa8.js";
import { r as tr } from "./index-816021be.js";
import { r as rr } from "./index-0e1c5170.js";
import { r as ar } from "./AntdIcon-b29a156c.js";
import { r as lr } from "./transition-d16825f8.js";
import { r as nr } from "./collapseMotion-cf2619c2.js";
import { r as ir } from "./index-977e4f68.js";
import { r as Ot } from "./FormItemContext-6c3deaca.js";
import { m as Vt } from "./isEqual-b1699f9b.js";
import { r as or } from "./index-cd8ad455.js";
var Je = {}, _e = {}, $e = {}, Be = {}, ce = {}, ze = {}, lt;
function tt() {
if (lt)
return ze;
lt = 1, Object.defineProperty(ze, "__esModule", {
value: !0
}), ze.toArray = r;
function r(t) {
return t == null ? [] : Array.isArray(t) ? t : [t];
}
return ze;
}
var Ue = {}, nt;
function Mt() {
if (nt)
return Ue;
nt = 1, Object.defineProperty(Ue, "__esModule", {
value: !0
}), Ue.default = r;
function r(t, n) {
let g = t;
for (let $ = 0; $ < n.length; $ += 1) {
if (g == null)
return;
g = g[n[$]];
}
return g;
}
return Ue;
}
var We = {}, it;
function ur() {
if (it)
return We;
it = 1;
var r = ie;
Object.defineProperty(We, "__esModule", {
value: !0
}), We.default = $;
var t = r(ge()), n = r(Mt());
function g(h, I, C, b) {
if (!I.length)
return C;
const [o, ...w] = I;
let c;
return !h && typeof o == "number" ? c = [] : Array.isArray(h) ? c = [...h] : c = (0, t.default)({}, h), b && C === void 0 && w.length === 1 ? delete c[o][w[0]] : c[o] = g(c[o], w, C, b), c;
}
function $(h, I, C) {
let b = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
return I.length && b && C === void 0 && !(0, n.default)(h, I.slice(0, -1)) ? h : g(h, I, C, b);
}
return We;
}
var ot;
function rt() {
if (ot)
return ce;
ot = 1;
var r = ie;
Object.defineProperty(ce, "__esModule", {
value: !0
}), ce.cloneByNamePathList = F, ce.containsNamePath = b, ce.getNamePath = h, ce.getValue = I, ce.matchNamePath = q, ce.setValue = C, ce.setValues = c;
var t = r(ge()), n = tt(), g = r(Mt()), $ = r(ur());
function h(p) {
return (0, n.toArray)(p);
}
function I(p, i) {
return (0, g.default)(p, i);
}
function C(p, i, e) {
let a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
return (0, $.default)(p, i, e, a);
}
function b(p, i) {
return p && p.some((e) => q(e, i));
}
function o(p) {
return typeof p == "object" && p !== null && Object.getPrototypeOf(p) === Object.prototype;
}
function w(p, i) {
const e = Array.isArray(p) ? [...p] : (0, t.default)({}, p);
return i && Object.keys(i).forEach((a) => {
const l = e[a], u = i[a], s = o(l) && o(u);
e[a] = s ? w(l, u || {}) : u;
}), e;
}
function c(p) {
for (var i = arguments.length, e = new Array(i > 1 ? i - 1 : 0), a = 1; a < i; a++)
e[a - 1] = arguments[a];
return e.reduce((l, u) => w(l, u), p);
}
function F(p, i) {
let e = {};
return i.forEach((a) => {
const l = I(p, a);
e = C(e, a, l);
}), e;
}
function q(p, i) {
return !p || !i || p.length !== i.length ? !1 : p.every((e, a) => i[a] === e);
}
return ce;
}
var Oe = {}, ut;
function Ke() {
if (ut)
return Oe;
ut = 1, Object.defineProperty(Oe, "__esModule", {
value: !0
}), Oe.defaultValidateMessages = void 0;
const r = "'${name}' is not a valid ${type}", t = {
default: "Validation error on field '${name}'",
required: "'${name}' is required",
enum: "'${name}' must be one of [${enum}]",
whitespace: "'${name}' cannot be empty",
date: {
format: "'${name}' is invalid for format date",
parse: "'${name}' could not be parsed as date",
invalid: "'${name}' is invalid date"
},
types: {
string: r,
method: r,
array: r,
object: r,
number: r,
date: r,
boolean: r,
integer: r,
float: r,
regexp: r,
email: r,
url: r,
hex: r
},
string: {
len: "'${name}' must be exactly ${len} characters",
min: "'${name}' must be at least ${min} characters",
max: "'${name}' cannot be longer than ${max} characters",
range: "'${name}' must be between ${min} and ${max} characters"
},
number: {
len: "'${name}' must equal ${len}",
min: "'${name}' cannot be less than ${min}",
max: "'${name}' cannot be greater than ${max}",
range: "'${name}' must be between ${min} and ${max}"
},
array: {
len: "'${name}' must be exactly ${len} in length",
min: "'${name}' cannot be less than ${min} in length",
max: "'${name}' cannot be greater than ${max} in length",
range: "'${name}' must be between ${min} and ${max} in length"
},
pattern: {
mismatch: "'${name}' does not match pattern ${pattern}"
}
};
return Oe.defaultValidateMessages = t, Oe;
}
var st;
function Rt() {
if (st)
return Be;
st = 1;
var r = ie;
Object.defineProperty(Be, "__esModule", {
value: !0
}), Be.validateRules = F;
var t = r(ge()), n = r(tr), g = fe, $ = wt(), h = rt(), I = Ke(), C = et(), b = function(i, e, a, l) {
function u(s) {
return s instanceof a ? s : new a(function(P) {
P(s);
});
}
return new (a || (a = Promise))(function(s, P) {
function T(M) {
try {
O(l.next(M));
} catch (N) {
P(N);
}
}
function R(M) {
try {
O(l.throw(M));
} catch (N) {
P(N);
}
}
function O(M) {
M.done ? s(M.value) : u(M.value).then(T, R);
}
O((l = l.apply(i, e || [])).next());
});
};
const o = n.default;
function w(i, e) {
return i.replace(/\$\{\w+\}/g, (a) => {
const l = a.slice(2, -1);
return e[l];
});
}
function c(i, e, a, l, u) {
return b(this, void 0, void 0, function* () {
const s = (0, t.default)({}, a);
delete s.ruleIndex, delete s.trigger;
let P = null;
s && s.type === "array" && s.defaultField && (P = s.defaultField, delete s.defaultField);
const T = new o({
[i]: [s]
}), R = (0, h.setValues)({}, I.defaultValidateMessages, l.validateMessages);
T.messages(R);
let O = [];
try {
yield Promise.resolve(T.validate({
[i]: e
}, (0, t.default)({}, l)));
} catch (d) {
d.errors ? O = d.errors.map((D, W) => {
let {
message: G
} = D;
return (
// Wrap VueNode with `key`
(0, C.isValidElement)(G) ? (0, g.cloneVNode)(G, {
key: `error_${W}`
}) : G
);
}) : (console.error(d), O = [R.default()]);
}
if (!O.length && P)
return (yield Promise.all(e.map((D, W) => c(`${i}.${W}`, D, P, l, u)))).reduce((D, W) => [...D, ...W], []);
const M = (0, t.default)((0, t.default)((0, t.default)({}, a), {
name: i,
enum: (a.enum || []).join(", ")
}), u);
return O.map((d) => typeof d == "string" ? w(d, M) : d);
});
}
function F(i, e, a, l, u, s) {
const P = i.join("."), T = a.map((O, M) => {
const N = O.validator, d = (0, t.default)((0, t.default)({}, O), {
ruleIndex: M
});
return N && (d.validator = (D, W, G) => {
let Q = !1;
const B = N(D, W, function() {
for (var L = arguments.length, f = new Array(L), m = 0; m < L; m++)
f[m] = arguments[m];
Promise.resolve().then(() => {
(0, $.warning)(!Q, "Your validator function has already return a promise. `callback` will be ignored."), Q || G(...f);
});
});
Q = B && typeof B.then == "function" && typeof B.catch == "function", (0, $.warning)(Q, "`callback` is deprecated. Please return a promise instead."), Q && B.then(() => {
G();
}).catch((L) => {
G(L || " ");
});
}), d;
}).sort((O, M) => {
let {
warningOnly: N,
ruleIndex: d
} = O, {
warningOnly: D,
ruleIndex: W
} = M;
return !!N == !!D ? d - W : N ? 1 : -1;
});
let R;
if (u === !0)
R = new Promise((O, M) => b(this, void 0, void 0, function* () {
for (let N = 0; N < T.length; N += 1) {
const d = T[N], D = yield c(P, e, d, l, s);
if (D.length) {
M([{
errors: D,
rule: d
}]);
return;
}
}
O([]);
}));
else {
const O = T.map((M) => c(P, e, M, l, s).then((N) => ({
errors: N,
rule: M
})));
R = (u ? p(O) : q(O)).then((M) => Promise.reject(M));
}
return R.catch((O) => O), R;
}
function q(i) {
return b(this, void 0, void 0, function* () {
return Promise.all(i).then((e) => [].concat(...e));
});
}
function p(i) {
return b(this, void 0, void 0, function* () {
let e = 0;
return new Promise((a) => {
i.forEach((l) => {
l.then((u) => {
u.errors.length && a([u]), e += 1, e === i.length && a([]);
});
});
});
});
}
return Be;
}
var Z = {}, dt;
function Te() {
if (dt)
return Z;
dt = 1, Object.defineProperty(Z, "__esModule", {
value: !0
}), Z.useProvideFormItemPrefix = Z.useProvideForm = Z.useInjectFormItemPrefix = Z.useInjectForm = Z.FormItemPrefixContextKey = Z.FormContextKey = void 0;
var r = fe, t = Ke();
const n = Symbol("formContextKey");
Z.FormContextKey = n;
const g = (b) => {
(0, r.provide)(n, b);
};
Z.useProvideForm = g;
const $ = () => (0, r.inject)(n, {
name: (0, r.computed)(() => {
}),
labelAlign: (0, r.computed)(() => "right"),
vertical: (0, r.computed)(() => !1),
// eslint-disable-next-line @typescript-eslint/no-unused-vars
addField: (b, o) => {
},
// eslint-disable-next-line @typescript-eslint/no-unused-vars
removeField: (b) => {
},
model: (0, r.computed)(() => {
}),
rules: (0, r.computed)(() => {
}),
colon: (0, r.computed)(() => {
}),
labelWrap: (0, r.computed)(() => {
}),
labelCol: (0, r.computed)(() => {
}),
requiredMark: (0, r.computed)(() => !1),
validateTrigger: (0, r.computed)(() => {
}),
onValidate: () => {
},
validateMessages: (0, r.computed)(() => t.defaultValidateMessages)
});
Z.useInjectForm = $;
const h = Symbol("formItemPrefixContextKey");
Z.FormItemPrefixContextKey = h;
const I = (b) => {
(0, r.provide)(h, b);
};
Z.useProvideFormItemPrefix = I;
const C = () => (0, r.inject)(h, {
prefixCls: (0, r.computed)(() => "")
});
return Z.useInjectFormItemPrefix = C, Z;
}
var Ve = {}, Ze = {}, He = {}, ct;
function sr() {
if (ct)
return He;
ct = 1, Object.defineProperty(He, "__esModule", { value: !0 });
var r = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, name: "question-circle", theme: "outlined" };
return He.default = r, He;
}
var ft;
function dr() {
return ft || (ft = 1, function(r) {
Object.defineProperty(r, "__esModule", {
value: !0
}), r.default = void 0;
var t = fe, n = $(sr()), g = $(ar());
function $(o) {
return o && o.__esModule ? o : { default: o };
}
function h(o) {
for (var w = 1; w < arguments.length; w++) {
var c = arguments[w] != null ? Object(arguments[w]) : {}, F = Object.keys(c);
typeof Object.getOwnPropertySymbols == "function" && (F = F.concat(Object.getOwnPropertySymbols(c).filter(function(q) {
return Object.getOwnPropertyDescriptor(c, q).enumerable;
}))), F.forEach(function(q) {
I(o, q, c[q]);
});
}
return o;
}
function I(o, w, c) {
return w in o ? Object.defineProperty(o, w, { value: c, enumerable: !0, configurable: !0, writable: !0 }) : o[w] = c, o;
}
var C = function(w, c) {
var F = h({}, w, c.attrs);
return (0, t.createVNode)(g.default, h({}, F, {
icon: n.default
}), null);
};
C.displayName = "QuestionCircleOutlined", C.inheritAttrs = !1;
var b = C;
r.default = b;
}(Ze)), Ze;
}
var mt;
function cr() {
if (mt)
return Ve;
mt = 1;
var r = ie;
Object.defineProperty(Ve, "__esModule", {
value: !0
}), Ve.default = void 0;
var t = fe, n = r(Ae()), g = r(ge()), $ = r(St()), h = Te(), I = At(), C = r(Tt()), b = r(Xe()), o = r(rr()), w = r(dr());
const c = (q, p) => {
let {
slots: i,
emit: e,
attrs: a
} = p;
var l, u, s, P, T;
const {
prefixCls: R,
htmlFor: O,
labelCol: M,
labelAlign: N,
colon: d,
required: D,
requiredMark: W
} = (0, g.default)((0, g.default)({}, q), a), [G] = (0, I.useLocaleReceiver)("Form"), Q = (l = q.label) !== null && l !== void 0 ? l : (u = i.label) === null || u === void 0 ? void 0 : u.call(i);
if (!Q)
return null;
const {
vertical: y,
labelAlign: B,
labelCol: L,
labelWrap: f,
colon: m
} = (0, h.useInjectForm)(), S = M || (L == null ? void 0 : L.value) || {}, x = N || (B == null ? void 0 : B.value), E = `${R}-item-label`, A = (0, b.default)(E, x === "left" && `${E}-left`, S.class, {
[`${E}-wrap`]: !!f.value
});
let K = Q;
const V = d === !0 || (m == null ? void 0 : m.value) !== !1 && d !== !1;
if (V && !y.value && typeof Q == "string" && Q.trim() !== "" && (K = Q.replace(/[:|:]\s*$/, "")), q.tooltip || i.tooltip) {
const ee = (0, t.createVNode)("span", {
class: `${R}-item-tooltip`
}, [(0, t.createVNode)(o.default, {
title: q.tooltip
}, {
default: () => [(0, t.createVNode)(w.default, null, null)]
})]);
K = (0, t.createVNode)(t.Fragment, null, [K, i.tooltip ? (s = i.tooltip) === null || s === void 0 ? void 0 : s.call(i, {
class: `${R}-item-tooltip`
}) : ee]);
}
W === "optional" && !D && (K = (0, t.createVNode)(t.Fragment, null, [K, (0, t.createVNode)("span", {
class: `${R}-item-optional`
}, [((P = G.value) === null || P === void 0 ? void 0 : P.optional) || ((T = C.default.Form) === null || T === void 0 ? void 0 : T.optional)])]));
const k = (0, b.default)({
[`${R}-item-required`]: D,
[`${R}-item-required-mark-optional`]: W === "optional",
[`${R}-item-no-colon`]: !V
});
return (0, t.createVNode)($.default, (0, n.default)((0, n.default)({}, S), {}, {
class: A
}), {
default: () => [(0, t.createVNode)("label", {
for: O,
class: k,
title: typeof Q == "string" ? Q : "",
onClick: (ee) => e("click", ee)
}, [K])]
});
};
c.displayName = "FormItemLabel", c.inheritAttrs = !1;
var F = c;
return Ve.default = F, Ve;
}
var Me = {}, Re = {}, je = {}, Ne = {}, vt;
function fr() {
if (vt)
return Ne;
vt = 1, Object.defineProperty(Ne, "__esModule", {
value: !0
}), Ne.default = void 0;
var t = (n) => {
const {
componentCls: g
} = n, $ = `${g}-show-help`, h = `${g}-show-help-item`;
return {
[$]: {
// Explain holder
transition: `opacity ${n.motionDurationSlow} ${n.motionEaseInOut}`,
"&-appear, &-enter": {
opacity: 0,
"&-active": {
opacity: 1
}
},
"&-leave": {
opacity: 1,
"&-active": {
opacity: 0
}
},
// Explain
[h]: {
overflow: "hidden",
transition: `height ${n.motionDurationSlow} ${n.motionEaseInOut},
opacity ${n.motionDurationSlow} ${n.motionEaseInOut},
transform ${n.motionDurationSlow} ${n.motionEaseInOut} !important`,
[`&${h}-appear, &${h}-enter`]: {
transform: "translateY(-5px)",
opacity: 0,
"&-active": {
transform: "translateY(0)",
opacity: 1
}
},
[`&${h}-leave-active`]: {
transform: "translateY(-5px)"
}
}
}
};
};
return Ne.default = t, Ne;
}
var gt;
function at() {
if (gt)
return je;
gt = 1;
var r = ie;
Object.defineProperty(je, "__esModule", {
value: !0
}), je.default = void 0;
var t = r(ge()), n = ir(), g = Dt(), $ = Lt(), h = r(fr());
const I = (e) => ({
legend: {
display: "block",
width: "100%",
marginBottom: e.marginLG,
padding: 0,
color: e.colorTextDescription,
fontSize: e.fontSizeLG,
lineHeight: "inherit",
border: 0,
borderBottom: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}`
},
label: {
fontSize: e.fontSize
},
'input[type="search"]': {
boxSizing: "border-box"
},
// Position radios and checkboxes better
'input[type="radio"], input[type="checkbox"]': {
lineHeight: "normal"
},
'input[type="file"]': {
display: "block"
},
// Make range inputs behave like textual form controls
'input[type="range"]': {
display: "block",
width: "100%"
},
// Make multiple select elements height not fixed
"select[multiple], select[size]": {
height: "auto"
},
// Focus for file, radio, and checkbox
"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus": {
outline: 0,
boxShadow: `0 0 0 ${e.controlOutlineWidth}px ${e.controlOutline}`
},
// Adjust output element
output: {
display: "block",
paddingTop: 15,
color: e.colorText,
fontSize: e.fontSize,
lineHeight: e.lineHeight
}
}), C = (e, a) => {
const {
formItemCls: l
} = e;
return {
[l]: {
[`${l}-label > label`]: {
height: a
},
[`${l}-control-input`]: {
minHeight: a
}
}
};
}, b = (e) => {
const {
componentCls: a
} = e;
return {
[e.componentCls]: (0, t.default)((0, t.default)((0, t.default)({}, (0, $.resetComponent)(e)), I(e)), {
[`${a}-text`]: {
display: "inline-block",
paddingInlineEnd: e.paddingSM
},
// ================================================================
// = Size =
// ================================================================
"&-small": (0, t.default)({}, C(e, e.controlHeightSM)),
"&-large": (0, t.default)({}, C(e, e.controlHeightLG))
})
};
}, o = (e) => {
const {
formItemCls: a,
iconCls: l,
componentCls: u,
rootPrefixCls: s
} = e;
return {
[a]: (0, t.default)((0, t.default)({}, (0, $.resetComponent)(e)), {
marginBottom: e.marginLG,
verticalAlign: "top",
"&-with-help": {
transition: "none"
},
[`&-hidden,
&-hidden.${s}-row`]: {
// https://github.com/ant-design/ant-design/issues/26141
display: "none"
},
"&-has-warning": {
[`${a}-split`]: {
color: e.colorError
}
},
"&-has-error": {
[`${a}-split`]: {
color: e.colorWarning
}
},
// ==============================================================
// = Label =
// ==============================================================
[`${a}-label`]: {
display: "inline-block",
flexGrow: 0,
overflow: "hidden",
whiteSpace: "nowrap",
textAlign: "end",
verticalAlign: "middle",
"&-left": {
textAlign: "start"
},
"&-wrap": {
overflow: "unset",
lineHeight: `${e.lineHeight} - 0.25em`,
whiteSpace: "unset"
},
"> label": {
position: "relative",
display: "inline-flex",
alignItems: "center",
maxWidth: "100%",
height: e.controlHeight,
color: e.colorTextHeading,
fontSize: e.fontSize,
[`> ${l}`]: {
fontSize: e.fontSize,
verticalAlign: "top"
},
// Required mark
[`&${a}-required:not(${a}-required-mark-optional)::before`]: {
display: "inline-block",
marginInlineEnd: e.marginXXS,
color: e.colorError,
fontSize: e.fontSize,
fontFamily: "SimSun, sans-serif",
lineHeight: 1,
content: '"*"',
[`${u}-hide-required-mark &`]: {
display: "none"
}
},
// Optional mark
[`${a}-optional`]: {
display: "inline-block",
marginInlineStart: e.marginXXS,
color: e.colorTextDescription,
[`${u}-hide-required-mark &`]: {
display: "none"
}
},
// Optional mark
[`${a}-tooltip`]: {
color: e.colorTextDescription,
cursor: "help",
writingMode: "horizontal-tb",
marginInlineStart: e.marginXXS
},
"&::after": {
content: '":"',
position: "relative",
marginBlock: 0,
marginInlineStart: e.marginXXS / 2,
marginInlineEnd: e.marginXS
},
[`&${a}-no-colon::after`]: {
content: '" "'
}
}
},
// ==============================================================
// = Input =
// ==============================================================
[`${a}-control`]: {
display: "flex",
flexDirection: "column",
flexGrow: 1,
[`&:first-child:not([class^="'${s}-col-'"]):not([class*="' ${s}-col-'"])`]: {
width: "100%"
},
"&-input": {
position: "relative",
display: "flex",
alignItems: "center",
minHeight: e.controlHeight,
"&-content": {
flex: "auto",
maxWidth: "100%"
}
}
},
// ==============================================================
// = Explain =
// ==============================================================
[a]: {
"&-explain, &-extra": {
clear: "both",
color: e.colorTextDescription,
fontSize: e.fontSize,
lineHeight: e.lineHeight
},
"&-explain-connected": {
width: "100%"
},
"&-extra": {
minHeight: e.controlHeightSM,
transition: `color ${e.motionDurationMid} ${e.motionEaseOut}`
// sync input color transition
},
"&-explain": {
"&-error": {
color: e.colorError
},
"&-warning": {
color: e.colorWarning
}
}
},
[`&-with-help ${a}-explain`]: {
height: "auto",
opacity: 1
},
// ==============================================================
// = Feedback Icon =
// ==============================================================
[`${a}-feedback-icon`]: {
fontSize: e.fontSize,
textAlign: "center",
visibility: "visible",
animationName: n.zoomIn,
animationDuration: e.motionDurationMid,
animationTimingFunction: e.motionEaseOutBack,
pointerEvents: "none",
"&-success": {
color: e.colorSuccess
},
"&-error": {
color: e.colorError
},
"&-warning": {
color: e.colorWarning
},
"&-validating": {
color: e.colorPrimary
}
}
})
};
}, w = (e) => {
const {
componentCls: a,
formItemCls: l,
rootPrefixCls: u
} = e;
return {
[`${a}-horizontal`]: {
[`${l}-label`]: {
flexGrow: 0
},
[`${l}-control`]: {
flex: "1 1 0",
// https://github.com/ant-design/ant-design/issues/32777
// https://github.com/ant-design/ant-design/issues/33773
minWidth: 0
},
// https://github.com/ant-design/ant-design/issues/32980
[`${l}-label.${u}-col-24 + ${l}-control`]: {
minWidth: "unset"
}
}
};
}, c = (e) => {
const {
componentCls: a,
formItemCls: l
} = e;
return {
[`${a}-inline`]: {
display: "flex",
flexWrap: "wrap",
[l]: {
flex: "none",
flexWrap: "nowrap",
marginInlineEnd: e.margin,
marginBottom: 0,
"&-with-help": {
marginBottom: e.marginLG
},
[`> ${l}-label,
> ${l}-control`]: {
display: "inline-block",
verticalAlign: "top"
},
[`> ${l}-label`]: {
flex: "none"
},
[`${a}-text`]: {
display: "inline-block"
},
[`${l}-has-feedback`]: {
display: "inline-block"
}
}
}
};
}, F = (e) => ({
margin: 0,
padding: `0 0 ${e.paddingXS}px`,
whiteSpace: "initial",
textAlign: "start",
"> label": {
margin: 0,
"&::after": {
display: "none"
}
}
}), q = (e) => {
const {
componentCls: a,
formItemCls: l
} = e;
return {
[`${l} ${l}-label`]: F(e),
[a]: {
[l]: {
flexWrap: "wrap",
[`${l}-label,
${l}-control`]: {
flex: "0 0 100%",
maxWidth: "100%"
}
}
}
};
}, p = (e) => {
const {
componentCls: a,
formItemCls: l,
rootPrefixCls: u
} = e;
return {
[`${a}-vertical`]: {
[l]: {
"&-row": {
flexDirection: "column"
},
"&-label > label": {
height: "auto"
},
[`${a}-item-control`]: {
width: "100%"
}
}
},
[`${a}-vertical ${l}-label,
.${u}-col-24${l}-label,
.${u}-col-xl-24${l}-label`]: F(e),
[`@media (max-width: ${e.screenXSMax}px)`]: [q(e), {
[a]: {
[`.${u}-col-xs-24${l}-label`]: F(e)
}
}],
[`@media (max-width: ${e.screenSMMax}px)`]: {
[a]: {
[`.${u}-col-sm-24${l}-label`]: F(e)
}
},
[`@media (max-width: ${e.screenMDMax}px)`]: {
[a]: {
[`.${u}-col-md-24${l}-label`]: F(e)
}
},
[`@media (max-width: ${e.screenLGMax}px)`]: {
[a]: {
[`.${u}-col-lg-24${l}-label`]: F(e)
}
}
};
};
var i = (0, g.genComponentStyleHook)("Form", (e, a) => {
let {
rootPrefixCls: l
} = a;
const u = (0, g.mergeToken)(e, {
formItemCls: `${e.componentCls}-item`,
rootPrefixCls: l
});
return [b(u), o(u), (0, h.default)(u), w(u), c(u), p(u), (0, n.genCollapseMotion)(u), n.zoomIn];
});
return je.default = i, je;
}
var pt;
function mr() {
if (pt)
return Re;
pt = 1;
var r = ie;
Object.defineProperty(Re, "__esModule", {
value: !0
}), Re.default = void 0;
var t = fe, n = r(Ae()), g = Te(), $ = lr(), h = r(nr()), I = r(at()), C = (0, t.defineComponent)({
compatConfig: {
MODE: 3
},
name: "ErrorList",
inheritAttrs: !1,
props: ["errors", "help", "onErrorVisibleChanged", "helpStatus", "warnings"],
setup(b, o) {
let {
attrs: w
} = o;
const {
prefixCls: c,
status: F
} = (0, g.useInjectFormItemPrefix)(), q = (0, t.computed)(() => `${c.value}-item-explain`), p = (0, t.computed)(() => !!(b.errors && b.errors.length)), i = (0, t.ref)(F.value), [, e] = (0, I.default)(c);
return (0, t.watch)([p, F], () => {
p.value && (i.value = F.value);
}), () => {
var a, l;
const u = (0, h.default)(`${c.value}-show-help-item`), s = (0, $.getTransitionGroupProps)(`${c.value}-show-help-item`, u);
return s.role = "alert", s.class = [e.value, q.value, w.class, `${c.value}-show-help`], (0, t.createVNode)(t.Transition, (0, n.default)((0, n.default)({}, (0, $.getTransitionProps)(`${c.value}-show-help`)), {}, {
onAfterEnter: () => b.onErrorVisibleChanged(!0),
onAfterLeave: () => b.onErrorVisibleChanged(!1)
}), {
default: () => [(0, t.withDirectives)((0, t.createVNode)(t.TransitionGroup, (0, n.default)((0, n.default)({}, s), {}, {
tag: "div"
}), {
default: () => [(l = b.errors) === null || l === void 0 ? void 0 : l.map((P, T) => (0, t.createVNode)("div", {
key: T,
class: i.value ? `${q.value}-${i.value}` : ""
}, [P]))]
}), [[t.vShow, !!(!((a = b.errors) === null || a === void 0) && a.length)]])]
});
};
}
});
return Re.default = C, Re;
}
var ht;
function vr() {
if (ht)
return Me;
ht = 1;
var r = ie;
Object.defineProperty(Me, "__esModule", {
value: !0
}), Me.default = void 0;
var t = fe, n = r(Ae()), g = r(ge()), $ = r(St()), h = Te(), I = r(mr()), C = r(Xe()), b = et(), w = (0, t.defineComponent)({
compatConfig: {
MODE: 3
},
slots: Object,
inheritAttrs: !1,
props: ["prefixCls", "errors", "hasFeedback", "onDomErrorVisibleChange", "wrapperCol", "help", "extra", "status", "marginBottom", "onErrorVisibleChanged"],
setup(c, F) {
let {
slots: q
} = F;
const p = (0, h.useInjectForm)(), {
wrapperCol: i
} = p, e = (0, g.default)({}, p);
return delete e.labelCol, delete e.wrapperCol, (0, h.useProvideForm)(e), (0, h.useProvideFormItemPrefix)({
prefixCls: (0, t.computed)(() => c.prefixCls),
status: (0, t.computed)(() => c.status)
}), () => {
var a, l, u;
const {
prefixCls: s,
wrapperCol: P,
marginBottom: T,
onErrorVisibleChanged: R,
help: O = (a = q.help) === null || a === void 0 ? void 0 : a.call(q),
errors: M = (0, b.filterEmpty)((l = q.errors) === null || l === void 0 ? void 0 : l.call(q)),
// hasFeedback,
// status,
extra: N = (u = q.extra) === null || u === void 0 ? void 0 : u.call(q)
} = c, d = `${s}-item`, D = P || (i == null ? void 0 : i.value) || {}, W = (0, C.default)(`${d}-control`, D.class);
return (0, t.createVNode)($.default, (0, n.default)((0, n.default)({}, D), {}, {
class: W
}), {
default: () => {
var G;
return (0, t.createVNode)(t.Fragment, null, [(0, t.createVNode)("div", {
class: `${d}-control-input`
}, [(0, t.createVNode)("div", {
class: `${d}-control-input-content`
}, [(G = q.default) === null || G === void 0 ? void 0 : G.call(q)])]), T !== null || M.length ? (0, t.createVNode)("div", {
style: {
display: "flex",
flexWrap: "nowrap"
}
}, [(0, t.createVNode)(I.default, {
errors: M,
help: O,
class: `${d}-explain-connected`,
onErrorVisibleChanged: R
}, null), !!T && (0, t.createVNode)("div", {
style: {
width: 0,
height: `${T}px`
}
}, null)]) : null, N ? (0, t.createVNode)("div", {
class: `${d}-extra`
}, [N]) : null]);
}
});
};
}
});
return Me.default = w, Me;
}
var Ge = {}, bt;
function gr() {
if (bt)
return Ge;
bt = 1, Object.defineProperty(Ge, "__esModule", {
value: !0
}), Ge.default = t;
var r = fe;
function t(n) {
const g = (0, r.shallowRef)(n.value.slice());
let $ = null;
return (0, r.watchEffect)(() => {
clearTimeout($), $ = setTimeout(() => {
g.value = n.value;
}, n.value.length ? 0 : 10);
}), g;
}
return Ge;
}
var yt;
function jt() {
if (yt)
return $e;
yt = 1;
var r = ie;
Object.defineProperty($e, "__esModule", {
value: !0
}), $e.formItemProps = $e.default = void 0;
var t = fe, n = r(Ae()), g = r(ge()), $ = r(Gt()), h = r(Qt()), I = r(Xt()), C = r(Kt()), b = r(It()), o = r(Ct()), w = r(er()), c = et(), F = Rt(), q = rt(), p = tt(), i = wt(), e = r(kt()), a = qt(), l = r(Pt()), u = Te(), s = r(cr()), P = r(vr()), T = Ot(), R = r(gr()), O = r(Xe()), M = r(at());
(0, a.tuple)("success", "warning", "error", "validating", "");
const N = {
success: I.default,
warning: C.default,
error: h.default,
validating: $.default
};
function d(y, B, L) {
let f = y;
const m = B;
let S = 0;
try {
for (let x = m.length; S < x - 1 && !(!f && !L); ++S) {
const E = m[S];
if (E in f)
f = f[E];
else {
if (L)
throw Error("please transfer a valid name path to form item!");
break;
}
}
if (L && !f)
throw Error("please transfer a valid name path to form item!");
} catch {
console.error("please transfer a valid name path to form item!");
}
return {
o: f,
k: m[S],
v: f ? f[m[S]] : void 0
};
}
const D = () => ({
htmlFor: String,
prefixCls: String,
label: o.default.any,
help: o.default.any,
extra: o.default.any,
labelCol: {
type: Object
},
wrapperCol: {
type: Object
},
hasFeedback: {
type: Boolean,
default: !1
},
colon: {
type: Boolean,
default: void 0
},
labelAlign: String,
prop: {
type: [String, Number, Array]
},
name: {
type: [String, Number, Array]
},
rules: [Array, Object],
autoLink: {
type: Boolean,
default: !0
},
required: {
type: Boolean,
default: void 0
},
validateFirst: {
type: Boolean,
default: void 0
},
validateStatus: o.default.oneOf((0, a.tuple)("", "success", "warning", "error", "validating")),
validateTrigger: {
type: [String, Array]
},
messageVariables: {
type: Object
},
hidden: Boolean,
noStyle: Boolean,
tooltip: String
});
$e.formItemProps = D;
let W = 0;
const G = "form_item";
var Q = (0, t.defineComponent)({
compatConfig: {
MODE: 3
},
name: "AFormItem",
inheritAttrs: !1,
__ANT_NEW_FORM_ITEM: !0,
props: D(),
slots: Object,
setup(y, B) {
let {
slots: L,
attrs: f,
expose: m
} = B;
(0, i.warning)(y.prop === void 0, "`prop` is deprecated. Please use `name` instead.");
const S = `form-item-${++W}`, {
prefixCls: x
} = (0, l.default)("form", y), [E, A] = (0, M.default)(x), K = (0, t.shallowRef)(), V = (0, u.useInjectForm)(), z = (0, t.computed)(() => y.name || y.prop), k = (0, t.shallowRef)([]), ee = (0, t.shallowRef)(!1), me = (0, t.shallowRef)(), X = (0, t.computed)(() => {
const v = z.value;
return (0, q.getNamePath)(v);
}), ve = (0, t.computed)(() => {
if (X.value.length) {
const v = V.name.value, U = X.value.join("_");
return v ? `${v}_${U}` : `${G}_${U}`;
} else
return;
}), Fe = () => {
const v = V.model.value;
if (!(!v || !z.value))
return d(v, X.value, !0).v;
}, oe = (0, t.computed)(() => Fe()), ye = (0, t.shallowRef)((0, b.default)(oe.value)), Ce = (0, t.computed)(() => {
let v = y.validateTrigger !== void 0 ? y.validateTrigger : V.validateTrigger.value;
return v = v === void 0 ? "change" : v, (0, p.toArray)(v);
}), we = (0, t.computed)(() => {
let v = V.rules.value;
const U = y.rules, Y = y.required !== void 0 ? {
required: !!y.required,
trigger: Ce.value
} : [], J = d(v, X.value);
v = v ? J.o[J.k] || J.v : [];
const de = [].concat(U || v || []);
return (0, e.default)(de, (ne) => ne.required) ? de : de.concat(Y);
}), ke = (0, t.computed)(() => {
const v = we.value;
let U = !1;
return v && v.length && v.every((Y) => Y.required ? (U = !0, !1) : !0), U || y.required;
}), ue = (0, t.shallowRef)();
(0, t.watchEffect)(() => {
ue.value = y.validateStatus;
});
const qe = (0, t.computed)(() => {
let v = {};
return typeof y.label == "string" ? v.label = y.label : y.name && (v.label = String(y.name)), y.messageVariables && (v = (0, g.default)((0, g.default)({}, v), y.messageVariables)), v;
}), pe = (v) => {
if (X.value.length === 0)
return;
const {
validateFirst: U = !1
} = y, {
triggerName: Y
} = v || {};
let J = we.value;
if (Y && (J = J.filter((ne) => {
const {
trigger: Ie
} = ne;
return !Ie && !Ce.value.length ? !0 : (0, p.toArray)(Ie || Ce.value).includes(Y);
})), !J.length)
return Promise.resolve();
const de = (0, F.validateRules)(X.value, oe.value, J, (0, g.default)({
validateMessages: V.validateMessages.value
}, v), U, qe.value);
return ue.value = "validating", k.value = [], de.catch((ne) => ne).then(function() {
let ne = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
if (ue.value === "validating") {
const Ie = ne.filter((Se) => Se && Se.errors.length);
ue.value = Ie.length ? "error" : "success", k.value = Ie.map((Se) => Se.errors), V.onValidate(z.value, !k.value.length, k.value.length ? (0, t.toRaw)(k.value[0]) : null);
}
}), de;
}, De = () => {
pe({
triggerName: "blur"
});
}, Le = () => {
if (ee.value) {
ee.value = !1;
return;
}
pe({
triggerName: "change"
});
}, _ = () => {
ue.value = y.validateStatus, ee.value = !1, k.value = [];
}, j = () => {
var v;
ue.value = y.validateStatus, ee.value = !0, k.value = [];
const U = V.model.value || {}, Y = oe.value, J = d(U, X.value, !0);
Array.isArray(Y) ? J.o[J.k] = [].concat((v = ye.value) !== null && v !== void 0 ? v : []) : J.o[J.k] = ye.value, (0, t.nextTick)(() => {
ee.value = !1;
});
}, H = (0, t.computed)(() => y.htmlFor === void 0 ? ve.value : y.htmlFor), te = () => {
const v = H.value;
if (!v || !me.value)
return;
const U = me.value.$el.querySelector(`[id="${v}"]`);
U && U.focus && U.focus();
};
m({
onFieldBlur: De,
onFieldChange: Le,
clearValidate: _,
resetField: j
}), (0, T.useProvideFormItemContext)({
id: ve,
onFieldBlur: () => {
y.autoLink && De();
},
onFieldChange: () => {
y.autoLink && Le();
},
clearValidate: _
}, (0, t.computed)(() => !!(y.autoLink && V.model.value && z.value)));
let le = !1;
(0, t.watch)(z, (v) => {
v ? le || (le = !0, V.addField(S, {
fieldValue: oe,
fieldId: ve,
fieldName: z,
resetField: j,
clearValidate: _,
namePath: X,
validateRules: pe,
rules: we
})) : (le = !1, V.removeField(S));
}, {
immediate: !0
}), (0, t.onBeforeUnmount)(() => {
V.removeField(S);
});
const he = (0, R.default)(k), re = (0, t.computed)(() => y.validateStatus !== void 0 ? y.validateStatus : he.value.length ? "error" : ue.value), se = (0, t.computed)(() => ({
[`${x.value}-item`]: !0,
[A.value]: !0,
// Status
[`${x.value}-item-has-feedback`]: re.value && y.hasFeedback,
[`${x.value}-item-has-success`]: re.value === "success",
[`${x.value}-item-has-warning`]: re.value === "warning",
[`${x.value}-item-has-error`]: re.value === "error",
[`${x.value}-item-is-validating`]: re.value === "validating",
[`${x.value}-item-hidden`]: y.hidden
})), be = (0, t.reactive)({});
T.FormItemInputContext.useProvide(be), (0, t.watchEffect)(() => {
let v;
if (y.hasFeedback) {
const U = re.value && N[re.value];
v = U ? (0, t.createVNode)("span", {
class: (0, O.default)(`${x.value}-item-feedback-icon`, `${x.value}-item-feedback-icon-${re.value}`)
}, [(0, t.createVNode)(U, null, null)]) : null;
}
(0, g.default)(be, {
status: re.value,
hasFeedback: y.hasFeedback,
feedbackIcon: v,
isFormItemInput: !0
});
});
const ae = (0, t.shallowRef)(null), Pe = (0, t.shallowRef)(!1), Ye = () => {
if (K.value) {
const v = getComputedStyle(K.value);
ae.value = parseInt(v.marginBottom, 10);
}
};
(0, t.onMounted)(() => {
(0, t.watch)(Pe, () => {
Pe.value && Ye();
}, {
flush: "post",
immediate: !0
});
});
const xe = (v) => {
v || (ae.value = null);
};
return () => {
var v, U;
if (y.noStyle)
return (v = L.default) === null || v === void 0 ? void 0 : v.call(L);
const Y = (U = y.help) !== null && U !== void 0 ? U : L.help ? (0, c.filterEmpty)(L.help()) : null, J = !!(Y != null && Array.isArray(Y) && Y.length || he.value.length);
return Pe.value = J, E((0, t.createVNode)("div", {
class: [se.value, J ? `${x.value}-item-with-help` : "", f.class],
ref: K
}, [(0, t.createVNode)(w.default, (0, n.default)((0, n.default)({}, f), {}, {
class: `${x.value}-row`,
key: "row"
}), {
default: () => {
var de, ne;
return (0, t.createVNode)(t.Fragment, null, [(0, t.createVNode)(s.default, (0, n.default)((0, n.default)({}, y), {}, {
htmlFor: H.value,
required: ke.value,
requiredMark: V.requiredMark.value,
prefixCls: x.value,
onClick: te,
label: y.label
}), {
label: L.label,
tooltip: L.tooltip
}), (0, t.createVNode)(P.default, (0, n.default)((0, n.default)({}, y), {}, {
errors: Y != null ? (0, p.toArray)(Y) : he.value,
marginBottom: ae.value,
prefixCls: x.value,
status: re.value,
ref: me,
help: Y,
extra: (de = y.extra) !== null && de !== void 0 ? de : (ne = L.extra) === null || ne === void 0 ? void 0 : ne.call(L),
onErrorVisibleChanged: xe
}), {
default: L.default
})]);
}
}), !!ae.value && (0, t.createVNode)("div", {
class: `${x.value}-margin-offset`,
style: {
marginBottom: `-${ae.value}px`
}
}, null)]));
};
}
});
return $e.default = Q, $e;
}
var Qe = {}, _t;
function Nt() {
if (_t)
return Qe;
_t = 1, Object.defineProperty(Qe, "__esModule", {
value: !0
}), Qe.allPromiseFinish = r;
function r(t) {
let n = !1, g = t.length;
const $ = [];
return t.length ? new Promise((h, I) => {
t.forEach((C, b) => {
C.catch((o) => (n = !0, o)).then((o) => {
g -= 1, $[b] = o, !(g > 0) && (n && I($), h($));
});
});
}) : Promise.resolve([]);
}
return Qe;
}
var Ee = {}, $t;
function Et() {
if ($t)
return Ee;
$t = 1;
var r = ie;
Object.defineProperty(Ee, "__esModule", {
value: !0
}), Ee.default = void 0;
var t = r(ge()), n = fe, g = r(It()), $ = r(Yt()), h = r(Vt()), I = r(Jt()), C = r(Zt()), b = Rt(), o = Ke(), w = Nt();
function c(e) {
let a = !1;
return e && e.length && e.every((l) => l.required ? (a = !0, !1) : !0), a;
}
function F(e) {
return e == null ? [] : Array.isArray(e) ? e : [e];
}
function q(e, a, l) {
let u = e;
a = a.replace(/\[(\w+)\]/g, ".$1"), a = a.replace(/^\./, "");
const s = a.split(".");
let P = 0;
for (let T = s.length; P < T - 1 && !(!u && !l); ++P) {
const R = s[P];
if (R in u)
u = u[R];
else {
if (l)
throw new Error("please transfer a valid name path to validate!");
break;
}
}
return {
o: u,
k: s[P],
v: u ? u[s[P]] : null,
isValid: u && s[P] in u
};
}
function p(e) {
let a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : (0, n.ref)({}), l = arguments.length > 2 ? arguments[2] : void 0;
const u = (0, g.default)((0, n.unref)(e)), s = (0, n.reactive)({}), P = (0, n.shallowRef)([]), T = (f) => {
(0, t.default)((0, n.unref)(e), (0, t.default)((0, t.default)({}, (0, g.default)(u)), f)), (0, n.nextTick)(() => {
Object.keys(s).forEach((m) => {
s[m] = {
autoLink: !1,
required: c((0, n.unref)(a)[m])
};
});
});
}, R = function() {
let f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], m = arguments.length > 1 ? arguments[1] : void 0;
return m.length ? f.filter((S) => {
const x = F(S.trigger || "change");
return (0, $.default)(x, m).length;
}) : f;
};
let O = null;
const M = function(f) {
let m = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, S = arguments.length > 2 ? arguments[2] : void 0;
const x = [], E = {};
for (let V = 0; V < f.length; V++) {
const z = f[V], k = q((0, n.unref)(e), z, S);
if (!k.isValid)
continue;
E[z] = k.v;
const ee = R((0, n.unref)(a)[z], F(m && m.trigger));
ee.length && x.push(N(z, k.v, ee, m || {}).then(() => ({
name: z,
errors: [],
warnings: []
})).catch((me) => {
const X = [], ve = [];
return me.forEach((Fe) => {
let {
rule: {
warningOnly: oe
},
errors: ye
} = Fe;
oe ? ve.push(...ye) : X.push(...ye);
}), X.length ? Promise.reject({
name: z,
errors: X,
warnings: ve
}) : {
name: z,
errors: X,
warnings: ve
};
}));
}
const A = (0, w.allPromiseFinish)(x);
O = A;
const K = A.then(() => O === A ? Promise.resolve(E) : Promise.reject([])).catch((V) => {
const z = V.filter((k) => k && k.errors.length);
return Promise.reject({
values: E,
errorFields: z,
outOfDate: O !== A
});
});
return K.catch((V) => V), K;
}, N = function(f, m, S) {
let x = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
const E = (0, b.validateRules)([f], m, S, (0, t.default)({
validateMessages: o.defaultValidateMessages
}, x), !!x.validateFirst);
return s[f] ? (s[f].validateStatus = "validating", E.catch((A) => A).then(function() {
let A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
var K;
if (s[f].validateStatus === "validating") {
const V = A.filter((z) => z && z.errors.length);
s[f].validateStatus = V.length ? "error" : "success", s[f].help = V.length ? V.map((z) => z.errors) : null, (K = l == null ? void 0 : l.onValidate) === null || K === void 0 || K.call(l, f, !V.length, V.length ? (0, n.toRaw)(s[f].help[0]) : null);
}
}), E) : E.catch((A) => A);
}, d = (f, m) => {
let S = [], x = !