|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[25159],{
|
|
|
|
|
|
/***/ 25035:
|
|
|
/*!***************************************************************************************!*\
|
|
|
!*** ./node_modules/@ant-design/icons/es/icons/QuestionCircleOutlined.js + 1 modules ***!
|
|
|
\***************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ icons_QuestionCircleOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(87462);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/QuestionCircleOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var QuestionCircleOutlined = { "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" };
|
|
|
/* harmony default export */ var asn_QuestionCircleOutlined = (QuestionCircleOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
|
var AntdIcon = __webpack_require__(74643);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/QuestionCircleOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var QuestionCircleOutlined_QuestionCircleOutlined = function QuestionCircleOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_QuestionCircleOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_QuestionCircleOutlined = (/*#__PURE__*/react.forwardRef(QuestionCircleOutlined_QuestionCircleOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 25159:
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./node_modules/antd/es/form/index.js + 17 modules ***!
|
|
|
\*********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ es_form; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__(74902);
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
|
var classnames = __webpack_require__(94184);
|
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-motion/es/index.js + 18 modules
|
|
|
var es = __webpack_require__(38379);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/motion.js
|
|
|
var motion = __webpack_require__(33603);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/context.js
|
|
|
var context = __webpack_require__(65223);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/hooks/useDebounce.js
|
|
|
|
|
|
function useDebounce(value) {
|
|
|
const [cacheValue, setCacheValue] = react.useState(value);
|
|
|
react.useEffect(() => {
|
|
|
const timeout = setTimeout(() => {
|
|
|
setCacheValue(value);
|
|
|
}, value.length ? 0 : 10);
|
|
|
return () => {
|
|
|
clearTimeout(timeout);
|
|
|
};
|
|
|
}, [value]);
|
|
|
return cacheValue;
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/index.js
|
|
|
var style = __webpack_require__(14747);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/motion/zoom.js
|
|
|
var zoom = __webpack_require__(50438);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/motion/collapse.js
|
|
|
var collapse = __webpack_require__(33507);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/genComponentStyleHook.js
|
|
|
var genComponentStyleHook = __webpack_require__(67968);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/statistic.js
|
|
|
var statistic = __webpack_require__(45503);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/style/explain.js
|
|
|
const genFormValidateMotionStyle = token => {
|
|
|
const {
|
|
|
componentCls
|
|
|
} = token;
|
|
|
const helpCls = `${componentCls}-show-help`;
|
|
|
const helpItemCls = `${componentCls}-show-help-item`;
|
|
|
return {
|
|
|
[helpCls]: {
|
|
|
// Explain holder
|
|
|
transition: `opacity ${token.motionDurationSlow} ${token.motionEaseInOut}`,
|
|
|
'&-appear, &-enter': {
|
|
|
opacity: 0,
|
|
|
'&-active': {
|
|
|
opacity: 1
|
|
|
}
|
|
|
},
|
|
|
'&-leave': {
|
|
|
opacity: 1,
|
|
|
'&-active': {
|
|
|
opacity: 0
|
|
|
}
|
|
|
},
|
|
|
// Explain
|
|
|
[helpItemCls]: {
|
|
|
overflow: 'hidden',
|
|
|
transition: `height ${token.motionDurationSlow} ${token.motionEaseInOut},
|
|
|
opacity ${token.motionDurationSlow} ${token.motionEaseInOut},
|
|
|
transform ${token.motionDurationSlow} ${token.motionEaseInOut} !important`,
|
|
|
[`&${helpItemCls}-appear, &${helpItemCls}-enter`]: {
|
|
|
transform: `translateY(-5px)`,
|
|
|
opacity: 0,
|
|
|
[`&-active`]: {
|
|
|
transform: 'translateY(0)',
|
|
|
opacity: 1
|
|
|
}
|
|
|
},
|
|
|
[`&${helpItemCls}-leave-active`]: {
|
|
|
transform: `translateY(-5px)`
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var explain = (genFormValidateMotionStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/style/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const resetForm = token => ({
|
|
|
legend: {
|
|
|
display: 'block',
|
|
|
width: '100%',
|
|
|
marginBottom: token.marginLG,
|
|
|
padding: 0,
|
|
|
color: token.colorTextDescription,
|
|
|
fontSize: token.fontSizeLG,
|
|
|
lineHeight: 'inherit',
|
|
|
border: 0,
|
|
|
borderBottom: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`
|
|
|
},
|
|
|
label: {
|
|
|
fontSize: token.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,
|
|
|
input[type='radio']:focus,
|
|
|
input[type='checkbox']:focus`]: {
|
|
|
outline: 0,
|
|
|
boxShadow: `0 0 0 ${token.controlOutlineWidth}px ${token.controlOutline}`
|
|
|
},
|
|
|
// Adjust output element
|
|
|
output: {
|
|
|
display: 'block',
|
|
|
paddingTop: 15,
|
|
|
color: token.colorText,
|
|
|
fontSize: token.fontSize,
|
|
|
lineHeight: token.lineHeight
|
|
|
}
|
|
|
});
|
|
|
const genFormSize = (token, height) => {
|
|
|
const {
|
|
|
formItemCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[formItemCls]: {
|
|
|
[`${formItemCls}-label > label`]: {
|
|
|
height
|
|
|
},
|
|
|
[`${formItemCls}-control-input`]: {
|
|
|
minHeight: height
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
const genFormStyle = token => {
|
|
|
const {
|
|
|
componentCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[token.componentCls]: Object.assign(Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), resetForm(token)), {
|
|
|
[`${componentCls}-text`]: {
|
|
|
display: 'inline-block',
|
|
|
paddingInlineEnd: token.paddingSM
|
|
|
},
|
|
|
// ================================================================
|
|
|
// = Size =
|
|
|
// ================================================================
|
|
|
'&-small': Object.assign({}, genFormSize(token, token.controlHeightSM)),
|
|
|
'&-large': Object.assign({}, genFormSize(token, token.controlHeightLG))
|
|
|
})
|
|
|
};
|
|
|
};
|
|
|
const genFormItemStyle = token => {
|
|
|
const {
|
|
|
formItemCls,
|
|
|
iconCls,
|
|
|
componentCls,
|
|
|
rootPrefixCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[formItemCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
|
marginBottom: token.marginLG,
|
|
|
verticalAlign: 'top',
|
|
|
'&-with-help': {
|
|
|
transition: 'none'
|
|
|
},
|
|
|
[`&-hidden,
|
|
|
&-hidden.${rootPrefixCls}-row`]: {
|
|
|
// https://github.com/ant-design/ant-design/issues/26141
|
|
|
display: 'none'
|
|
|
},
|
|
|
'&-has-warning': {
|
|
|
[`${formItemCls}-split`]: {
|
|
|
color: token.colorError
|
|
|
}
|
|
|
},
|
|
|
'&-has-error': {
|
|
|
[`${formItemCls}-split`]: {
|
|
|
color: token.colorWarning
|
|
|
}
|
|
|
},
|
|
|
// ==============================================================
|
|
|
// = Label =
|
|
|
// ==============================================================
|
|
|
[`${formItemCls}-label`]: {
|
|
|
display: 'inline-block',
|
|
|
flexGrow: 0,
|
|
|
overflow: 'hidden',
|
|
|
whiteSpace: 'nowrap',
|
|
|
textAlign: 'end',
|
|
|
verticalAlign: 'middle',
|
|
|
'&-left': {
|
|
|
textAlign: 'start'
|
|
|
},
|
|
|
'&-wrap': {
|
|
|
overflow: 'unset',
|
|
|
lineHeight: `${token.lineHeight} - 0.25em`,
|
|
|
whiteSpace: 'unset'
|
|
|
},
|
|
|
'> label': {
|
|
|
position: 'relative',
|
|
|
display: 'inline-flex',
|
|
|
alignItems: 'center',
|
|
|
maxWidth: '100%',
|
|
|
height: token.controlHeight,
|
|
|
color: token.colorTextHeading,
|
|
|
fontSize: token.fontSize,
|
|
|
[`> ${iconCls}`]: {
|
|
|
fontSize: token.fontSize,
|
|
|
verticalAlign: 'top'
|
|
|
},
|
|
|
// Required mark
|
|
|
[`&${formItemCls}-required:not(${formItemCls}-required-mark-optional)::before`]: {
|
|
|
display: 'inline-block',
|
|
|
marginInlineEnd: token.marginXXS,
|
|
|
color: token.colorError,
|
|
|
fontSize: token.fontSize,
|
|
|
fontFamily: 'SimSun, sans-serif',
|
|
|
lineHeight: 1,
|
|
|
content: '"*"',
|
|
|
[`${componentCls}-hide-required-mark &`]: {
|
|
|
display: 'none'
|
|
|
}
|
|
|
},
|
|
|
// Optional mark
|
|
|
[`${formItemCls}-optional`]: {
|
|
|
display: 'inline-block',
|
|
|
marginInlineStart: token.marginXXS,
|
|
|
color: token.colorTextDescription,
|
|
|
[`${componentCls}-hide-required-mark &`]: {
|
|
|
display: 'none'
|
|
|
}
|
|
|
},
|
|
|
// Optional mark
|
|
|
[`${formItemCls}-tooltip`]: {
|
|
|
color: token.colorTextDescription,
|
|
|
cursor: 'help',
|
|
|
writingMode: 'horizontal-tb',
|
|
|
marginInlineStart: token.marginXXS
|
|
|
},
|
|
|
'&::after': {
|
|
|
content: '":"',
|
|
|
position: 'relative',
|
|
|
marginBlock: 0,
|
|
|
marginInlineStart: token.marginXXS / 2,
|
|
|
marginInlineEnd: token.marginXS
|
|
|
},
|
|
|
[`&${formItemCls}-no-colon::after`]: {
|
|
|
content: '"\\a0"'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// ==============================================================
|
|
|
// = Input =
|
|
|
// ==============================================================
|
|
|
[`${formItemCls}-control`]: {
|
|
|
display: 'flex',
|
|
|
flexDirection: 'column',
|
|
|
flexGrow: 1,
|
|
|
[`&:first-child:not([class^="'${rootPrefixCls}-col-'"]):not([class*="' ${rootPrefixCls}-col-'"])`]: {
|
|
|
width: '100%'
|
|
|
},
|
|
|
'&-input': {
|
|
|
position: 'relative',
|
|
|
display: 'flex',
|
|
|
alignItems: 'center',
|
|
|
minHeight: token.controlHeight,
|
|
|
'&-content': {
|
|
|
flex: 'auto',
|
|
|
maxWidth: '100%'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// ==============================================================
|
|
|
// = Explain =
|
|
|
// ==============================================================
|
|
|
[formItemCls]: {
|
|
|
'&-explain, &-extra': {
|
|
|
clear: 'both',
|
|
|
color: token.colorTextDescription,
|
|
|
fontSize: token.fontSize,
|
|
|
lineHeight: token.lineHeight
|
|
|
},
|
|
|
'&-explain-connected': {
|
|
|
width: '100%'
|
|
|
},
|
|
|
'&-extra': {
|
|
|
minHeight: token.controlHeightSM,
|
|
|
transition: `color ${token.motionDurationMid} ${token.motionEaseOut}` // sync input color transition
|
|
|
},
|
|
|
|
|
|
'&-explain': {
|
|
|
'&-error': {
|
|
|
color: token.colorError
|
|
|
},
|
|
|
'&-warning': {
|
|
|
color: token.colorWarning
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
[`&-with-help ${formItemCls}-explain`]: {
|
|
|
height: 'auto',
|
|
|
opacity: 1
|
|
|
},
|
|
|
// ==============================================================
|
|
|
// = Feedback Icon =
|
|
|
// ==============================================================
|
|
|
[`${formItemCls}-feedback-icon`]: {
|
|
|
fontSize: token.fontSize,
|
|
|
textAlign: 'center',
|
|
|
visibility: 'visible',
|
|
|
animationName: zoom/* zoomIn */.kr,
|
|
|
animationDuration: token.motionDurationMid,
|
|
|
animationTimingFunction: token.motionEaseOutBack,
|
|
|
pointerEvents: 'none',
|
|
|
'&-success': {
|
|
|
color: token.colorSuccess
|
|
|
},
|
|
|
'&-error': {
|
|
|
color: token.colorError
|
|
|
},
|
|
|
'&-warning': {
|
|
|
color: token.colorWarning
|
|
|
},
|
|
|
'&-validating': {
|
|
|
color: token.colorPrimary
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
};
|
|
|
const genHorizontalStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
formItemCls,
|
|
|
rootPrefixCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${componentCls}-horizontal`]: {
|
|
|
[`${formItemCls}-label`]: {
|
|
|
flexGrow: 0
|
|
|
},
|
|
|
[`${formItemCls}-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
|
|
|
[`${formItemCls}-label.${rootPrefixCls}-col-24 + ${formItemCls}-control`]: {
|
|
|
minWidth: 'unset'
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
const genInlineStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
formItemCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${componentCls}-inline`]: {
|
|
|
display: 'flex',
|
|
|
flexWrap: 'wrap',
|
|
|
[formItemCls]: {
|
|
|
flex: 'none',
|
|
|
marginInlineEnd: token.margin,
|
|
|
marginBottom: 0,
|
|
|
'&-row': {
|
|
|
flexWrap: 'nowrap'
|
|
|
},
|
|
|
'&-with-help': {
|
|
|
marginBottom: token.marginLG
|
|
|
},
|
|
|
[`> ${formItemCls}-label,
|
|
|
> ${formItemCls}-control`]: {
|
|
|
display: 'inline-block',
|
|
|
verticalAlign: 'top'
|
|
|
},
|
|
|
[`> ${formItemCls}-label`]: {
|
|
|
flex: 'none'
|
|
|
},
|
|
|
[`${componentCls}-text`]: {
|
|
|
display: 'inline-block'
|
|
|
},
|
|
|
[`${formItemCls}-has-feedback`]: {
|
|
|
display: 'inline-block'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
const makeVerticalLayoutLabel = token => ({
|
|
|
padding: `0 0 ${token.paddingXS}px`,
|
|
|
whiteSpace: 'initial',
|
|
|
textAlign: 'start',
|
|
|
'> label': {
|
|
|
margin: 0,
|
|
|
'&::after': {
|
|
|
// https://github.com/ant-design/ant-design/issues/43538
|
|
|
visibility: 'hidden'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
const makeVerticalLayout = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
formItemCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${formItemCls} ${formItemCls}-label`]: makeVerticalLayoutLabel(token),
|
|
|
[componentCls]: {
|
|
|
[formItemCls]: {
|
|
|
flexWrap: 'wrap',
|
|
|
[`${formItemCls}-label,
|
|
|
${formItemCls}-control`]: {
|
|
|
flex: '0 0 100%',
|
|
|
maxWidth: '100%'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
const genVerticalStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
formItemCls,
|
|
|
rootPrefixCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${componentCls}-vertical`]: {
|
|
|
[formItemCls]: {
|
|
|
'&-row': {
|
|
|
flexDirection: 'column'
|
|
|
},
|
|
|
'&-label > label': {
|
|
|
height: 'auto'
|
|
|
},
|
|
|
[`${componentCls}-item-control`]: {
|
|
|
width: '100%'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-vertical ${formItemCls}-label,
|
|
|
.${rootPrefixCls}-col-24${formItemCls}-label,
|
|
|
.${rootPrefixCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token),
|
|
|
[`@media (max-width: ${token.screenXSMax}px)`]: [makeVerticalLayout(token), {
|
|
|
[componentCls]: {
|
|
|
[`.${rootPrefixCls}-col-xs-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
|
|
|
}
|
|
|
}],
|
|
|
[`@media (max-width: ${token.screenSMMax}px)`]: {
|
|
|
[componentCls]: {
|
|
|
[`.${rootPrefixCls}-col-sm-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
|
|
|
}
|
|
|
},
|
|
|
[`@media (max-width: ${token.screenMDMax}px)`]: {
|
|
|
[componentCls]: {
|
|
|
[`.${rootPrefixCls}-col-md-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
|
|
|
}
|
|
|
},
|
|
|
[`@media (max-width: ${token.screenLGMax}px)`]: {
|
|
|
[componentCls]: {
|
|
|
[`.${rootPrefixCls}-col-lg-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var form_style = ((0,genComponentStyleHook/* default */.Z)('Form', (token, _ref) => {
|
|
|
let {
|
|
|
rootPrefixCls
|
|
|
} = _ref;
|
|
|
const formToken = (0,statistic/* merge */.TS)(token, {
|
|
|
formItemCls: `${token.componentCls}-item`,
|
|
|
rootPrefixCls
|
|
|
});
|
|
|
return [genFormStyle(formToken), genFormItemStyle(formToken), explain(formToken), genHorizontalStyle(formToken), genInlineStyle(formToken), genVerticalStyle(formToken), (0,collapse/* default */.Z)(formToken), zoom/* zoomIn */.kr];
|
|
|
}));
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/ErrorList.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const EMPTY_LIST = [];
|
|
|
function toErrorEntity(error, prefix, errorStatus) {
|
|
|
let index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
|
return {
|
|
|
key: typeof error === 'string' ? error : `${prefix}-${index}`,
|
|
|
error,
|
|
|
errorStatus
|
|
|
};
|
|
|
}
|
|
|
function ErrorList(_ref) {
|
|
|
let {
|
|
|
help,
|
|
|
helpStatus,
|
|
|
errors = EMPTY_LIST,
|
|
|
warnings = EMPTY_LIST,
|
|
|
className: rootClassName,
|
|
|
fieldId,
|
|
|
onVisibleChanged
|
|
|
} = _ref;
|
|
|
const {
|
|
|
prefixCls
|
|
|
} = react.useContext(context/* FormItemPrefixContext */.Rk);
|
|
|
const baseClassName = `${prefixCls}-item-explain`;
|
|
|
const [, hashId] = form_style(prefixCls);
|
|
|
const collapseMotion = (0,react.useMemo)(() => (0,motion/* default */.ZP)(prefixCls), [prefixCls]);
|
|
|
// We have to debounce here again since somewhere use ErrorList directly still need no shaking
|
|
|
// ref: https://github.com/ant-design/ant-design/issues/36336
|
|
|
const debounceErrors = useDebounce(errors);
|
|
|
const debounceWarnings = useDebounce(warnings);
|
|
|
const fullKeyList = react.useMemo(() => {
|
|
|
if (help !== undefined && help !== null) {
|
|
|
return [toErrorEntity(help, 'help', helpStatus)];
|
|
|
}
|
|
|
return [].concat((0,toConsumableArray/* default */.Z)(debounceErrors.map((error, index) => toErrorEntity(error, 'error', 'error', index))), (0,toConsumableArray/* default */.Z)(debounceWarnings.map((warning, index) => toErrorEntity(warning, 'warning', 'warning', index))));
|
|
|
}, [help, helpStatus, debounceErrors, debounceWarnings]);
|
|
|
const helpProps = {};
|
|
|
if (fieldId) {
|
|
|
helpProps.id = `${fieldId}_help`;
|
|
|
}
|
|
|
return /*#__PURE__*/react.createElement(es["default"], {
|
|
|
motionDeadline: collapseMotion.motionDeadline,
|
|
|
motionName: `${prefixCls}-show-help`,
|
|
|
visible: !!fullKeyList.length,
|
|
|
onVisibleChanged: onVisibleChanged
|
|
|
}, holderProps => {
|
|
|
const {
|
|
|
className: holderClassName,
|
|
|
style: holderStyle
|
|
|
} = holderProps;
|
|
|
return /*#__PURE__*/react.createElement("div", Object.assign({}, helpProps, {
|
|
|
className: classnames_default()(baseClassName, holderClassName, rootClassName, hashId),
|
|
|
style: holderStyle,
|
|
|
role: "alert"
|
|
|
}), /*#__PURE__*/react.createElement(es.CSSMotionList, Object.assign({
|
|
|
keys: fullKeyList
|
|
|
}, (0,motion/* default */.ZP)(prefixCls), {
|
|
|
motionName: `${prefixCls}-show-help-item`,
|
|
|
component: false
|
|
|
}), itemProps => {
|
|
|
const {
|
|
|
key,
|
|
|
error,
|
|
|
errorStatus,
|
|
|
className: itemClassName,
|
|
|
style: itemStyle
|
|
|
} = itemProps;
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
key: key,
|
|
|
className: classnames_default()(itemClassName, {
|
|
|
[`${baseClassName}-${errorStatus}`]: errorStatus
|
|
|
}),
|
|
|
style: itemStyle
|
|
|
}, error);
|
|
|
}));
|
|
|
});
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-field-form/es/index.js + 20 modules
|
|
|
var rc_field_form_es = __webpack_require__(58083);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
|
var config_provider_context = __webpack_require__(53124);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/DisabledContext.js
|
|
|
var DisabledContext = __webpack_require__(98866);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/SizeContext.js
|
|
|
var SizeContext = __webpack_require__(97647);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/hooks/useSize.js
|
|
|
var useSize = __webpack_require__(98675);
|
|
|
// EXTERNAL MODULE: ./node_modules/scroll-into-view-if-needed/dist/index.js + 1 modules
|
|
|
var dist = __webpack_require__(17423);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/util.js
|
|
|
// form item name black list. in form ,you can use form.id get the form item element.
|
|
|
// use object hasOwnProperty will get better performance if black list is longer.
|
|
|
const formItemNameBlackList = ['parentNode'];
|
|
|
// default form item id prefix.
|
|
|
const defaultItemNamePrefixCls = 'form_item';
|
|
|
function toArray(candidate) {
|
|
|
if (candidate === undefined || candidate === false) return [];
|
|
|
return Array.isArray(candidate) ? candidate : [candidate];
|
|
|
}
|
|
|
function getFieldId(namePath, formName) {
|
|
|
if (!namePath.length) {
|
|
|
return undefined;
|
|
|
}
|
|
|
const mergedId = namePath.join('_');
|
|
|
if (formName) {
|
|
|
return `${formName}_${mergedId}`;
|
|
|
}
|
|
|
const isIllegalName = formItemNameBlackList.includes(mergedId);
|
|
|
return isIllegalName ? `${defaultItemNamePrefixCls}_${mergedId}` : mergedId;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/hooks/useForm.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function toNamePathStr(name) {
|
|
|
const namePath = toArray(name);
|
|
|
return namePath.join('_');
|
|
|
}
|
|
|
function useForm(form) {
|
|
|
const [rcForm] = (0,rc_field_form_es.useForm)();
|
|
|
const itemsRef = react.useRef({});
|
|
|
const wrapForm = react.useMemo(() => form !== null && form !== void 0 ? form : Object.assign(Object.assign({}, rcForm), {
|
|
|
__INTERNAL__: {
|
|
|
itemRef: name => node => {
|
|
|
const namePathStr = toNamePathStr(name);
|
|
|
if (node) {
|
|
|
itemsRef.current[namePathStr] = node;
|
|
|
} else {
|
|
|
delete itemsRef.current[namePathStr];
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
scrollToField: function (name) {
|
|
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
|
const namePath = toArray(name);
|
|
|
const fieldId = getFieldId(namePath, wrapForm.__INTERNAL__.name);
|
|
|
const node = fieldId ? document.getElementById(fieldId) : null;
|
|
|
if (node) {
|
|
|
(0,dist/* default */.Z)(node, Object.assign({
|
|
|
scrollMode: 'if-needed',
|
|
|
block: 'nearest'
|
|
|
}, options));
|
|
|
}
|
|
|
},
|
|
|
getFieldInstance: name => {
|
|
|
const namePathStr = toNamePathStr(name);
|
|
|
return itemsRef.current[namePathStr];
|
|
|
}
|
|
|
}), [form, rcForm]);
|
|
|
return [wrapForm];
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/validateMessagesContext.js
|
|
|
var validateMessagesContext = __webpack_require__(37920);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/Form.js
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalForm = (props, ref) => {
|
|
|
const contextDisabled = react.useContext(DisabledContext/* default */.Z);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
form: contextForm
|
|
|
} = react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
size,
|
|
|
disabled = contextDisabled,
|
|
|
form,
|
|
|
colon,
|
|
|
labelAlign,
|
|
|
labelWrap,
|
|
|
labelCol,
|
|
|
wrapperCol,
|
|
|
hideRequiredMark,
|
|
|
layout = 'horizontal',
|
|
|
scrollToFirstError,
|
|
|
requiredMark,
|
|
|
onFinishFailed,
|
|
|
name,
|
|
|
style
|
|
|
} = props,
|
|
|
restFormProps = __rest(props, ["prefixCls", "className", "rootClassName", "size", "disabled", "form", "colon", "labelAlign", "labelWrap", "labelCol", "wrapperCol", "hideRequiredMark", "layout", "scrollToFirstError", "requiredMark", "onFinishFailed", "name", "style"]);
|
|
|
const mergedSize = (0,useSize/* default */.Z)(size);
|
|
|
const contextValidateMessages = react.useContext(validateMessagesContext/* default */.Z);
|
|
|
if (false) {}
|
|
|
const mergedRequiredMark = (0,react.useMemo)(() => {
|
|
|
if (requiredMark !== undefined) {
|
|
|
return requiredMark;
|
|
|
}
|
|
|
if (contextForm && contextForm.requiredMark !== undefined) {
|
|
|
return contextForm.requiredMark;
|
|
|
}
|
|
|
if (hideRequiredMark) {
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
}, [hideRequiredMark, requiredMark, contextForm]);
|
|
|
const mergedColon = colon !== null && colon !== void 0 ? colon : contextForm === null || contextForm === void 0 ? void 0 : contextForm.colon;
|
|
|
const prefixCls = getPrefixCls('form', customizePrefixCls);
|
|
|
// Style
|
|
|
const [wrapSSR, hashId] = form_style(prefixCls);
|
|
|
const formClassName = classnames_default()(prefixCls, `${prefixCls}-${layout}`, {
|
|
|
[`${prefixCls}-hide-required-mark`]: mergedRequiredMark === false,
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
|
[`${prefixCls}-${mergedSize}`]: mergedSize
|
|
|
}, hashId, contextForm === null || contextForm === void 0 ? void 0 : contextForm.className, className, rootClassName);
|
|
|
const [wrapForm] = useForm(form);
|
|
|
const {
|
|
|
__INTERNAL__
|
|
|
} = wrapForm;
|
|
|
__INTERNAL__.name = name;
|
|
|
const formContextValue = (0,react.useMemo)(() => ({
|
|
|
name,
|
|
|
labelAlign,
|
|
|
labelCol,
|
|
|
labelWrap,
|
|
|
wrapperCol,
|
|
|
vertical: layout === 'vertical',
|
|
|
colon: mergedColon,
|
|
|
requiredMark: mergedRequiredMark,
|
|
|
itemRef: __INTERNAL__.itemRef,
|
|
|
form: wrapForm
|
|
|
}), [name, labelAlign, labelCol, wrapperCol, layout, mergedColon, mergedRequiredMark, wrapForm]);
|
|
|
react.useImperativeHandle(ref, () => wrapForm);
|
|
|
const scrollToField = (options, fieldName) => {
|
|
|
if (options) {
|
|
|
let defaultScrollToFirstError = {
|
|
|
block: 'nearest'
|
|
|
};
|
|
|
if (typeof options === 'object') {
|
|
|
defaultScrollToFirstError = options;
|
|
|
}
|
|
|
wrapForm.scrollToField(fieldName, defaultScrollToFirstError);
|
|
|
}
|
|
|
};
|
|
|
const onInternalFinishFailed = errorInfo => {
|
|
|
onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errorInfo);
|
|
|
if (errorInfo.errorFields.length) {
|
|
|
const fieldName = errorInfo.errorFields[0].name;
|
|
|
if (scrollToFirstError !== undefined) {
|
|
|
scrollToField(scrollToFirstError, fieldName);
|
|
|
return;
|
|
|
}
|
|
|
if (contextForm && contextForm.scrollToFirstError !== undefined) {
|
|
|
scrollToField(contextForm.scrollToFirstError, fieldName);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
return wrapSSR( /*#__PURE__*/react.createElement(DisabledContext/* DisabledContextProvider */.n, {
|
|
|
disabled: disabled
|
|
|
}, /*#__PURE__*/react.createElement(SizeContext/* SizeContextProvider */.q, {
|
|
|
size: mergedSize
|
|
|
}, /*#__PURE__*/react.createElement(context/* FormProvider */.RV, {
|
|
|
// This is not list in API, we pass with spread
|
|
|
validateMessages: contextValidateMessages
|
|
|
}, /*#__PURE__*/react.createElement(context/* FormContext.Provider */.q3.Provider, {
|
|
|
value: formContextValue
|
|
|
}, /*#__PURE__*/react.createElement(rc_field_form_es["default"], Object.assign({
|
|
|
id: name
|
|
|
}, restFormProps, {
|
|
|
name: name,
|
|
|
onFinishFailed: onInternalFinishFailed,
|
|
|
form: wrapForm,
|
|
|
style: Object.assign(Object.assign({}, contextForm === null || contextForm === void 0 ? void 0 : contextForm.style), style),
|
|
|
className: formClassName
|
|
|
})))))));
|
|
|
};
|
|
|
const Form = /*#__PURE__*/react.forwardRef(InternalForm);
|
|
|
if (false) {}
|
|
|
|
|
|
/* harmony default export */ var form_Form = (Form);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/hooks/useState.js
|
|
|
var useState = __webpack_require__(9475);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/ref.js
|
|
|
var ref = __webpack_require__(17799);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/reactNode.js
|
|
|
var reactNode = __webpack_require__(96159);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/hooks/useFormItemStatus.js
|
|
|
|
|
|
|
|
|
|
|
|
const useFormItemStatus = () => {
|
|
|
const {
|
|
|
status,
|
|
|
errors = [],
|
|
|
warnings = []
|
|
|
} = (0,react.useContext)(context/* FormItemInputContext */.aM);
|
|
|
false ? 0 : void 0;
|
|
|
return {
|
|
|
status,
|
|
|
errors,
|
|
|
warnings
|
|
|
};
|
|
|
};
|
|
|
// Only used for compatible package. Not promise this will work on future version.
|
|
|
useFormItemStatus.Context = context/* FormItemInputContext */.aM;
|
|
|
/* harmony default export */ var hooks_useFormItemStatus = (useFormItemStatus);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/raf.js
|
|
|
var raf = __webpack_require__(96523);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/hooks/useFrameState.js
|
|
|
|
|
|
|
|
|
|
|
|
function useFrameState(defaultValue) {
|
|
|
const [value, setValue] = react.useState(defaultValue);
|
|
|
const frameRef = (0,react.useRef)(null);
|
|
|
const batchRef = (0,react.useRef)([]);
|
|
|
const destroyRef = (0,react.useRef)(false);
|
|
|
react.useEffect(() => {
|
|
|
destroyRef.current = false;
|
|
|
return () => {
|
|
|
destroyRef.current = true;
|
|
|
raf/* default.cancel */.Z.cancel(frameRef.current);
|
|
|
frameRef.current = null;
|
|
|
};
|
|
|
}, []);
|
|
|
function setFrameValue(updater) {
|
|
|
if (destroyRef.current) {
|
|
|
return;
|
|
|
}
|
|
|
if (frameRef.current === null) {
|
|
|
batchRef.current = [];
|
|
|
frameRef.current = (0,raf/* default */.Z)(() => {
|
|
|
frameRef.current = null;
|
|
|
setValue(prevValue => {
|
|
|
let current = prevValue;
|
|
|
batchRef.current.forEach(func => {
|
|
|
current = func(current);
|
|
|
});
|
|
|
return current;
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
batchRef.current.push(updater);
|
|
|
}
|
|
|
return [value, setFrameValue];
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/hooks/useItemRef.js
|
|
|
|
|
|
|
|
|
|
|
|
function useItemRef() {
|
|
|
const {
|
|
|
itemRef
|
|
|
} = react.useContext(context/* FormContext */.q3);
|
|
|
const cacheRef = react.useRef({});
|
|
|
function getRef(name, children) {
|
|
|
const childrenRef = children && typeof children === 'object' && children.ref;
|
|
|
const nameStr = name.join('_');
|
|
|
if (cacheRef.current.name !== nameStr || cacheRef.current.originRef !== childrenRef) {
|
|
|
cacheRef.current.name = nameStr;
|
|
|
cacheRef.current.originRef = childrenRef;
|
|
|
cacheRef.current.ref = (0,ref/* composeRef */.sQ)(itemRef(name), childrenRef);
|
|
|
}
|
|
|
return cacheRef.current.ref;
|
|
|
}
|
|
|
return getRef;
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/CheckCircleFilled.js + 1 modules
|
|
|
var CheckCircleFilled = __webpack_require__(89739);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/CloseCircleFilled.js + 1 modules
|
|
|
var CloseCircleFilled = __webpack_require__(4340);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/ExclamationCircleFilled.js + 1 modules
|
|
|
var ExclamationCircleFilled = __webpack_require__(21640);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/LoadingOutlined.js + 1 modules
|
|
|
var LoadingOutlined = __webpack_require__(50888);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/hooks/useLayoutEffect.js
|
|
|
var useLayoutEffect = __webpack_require__(14075);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/Dom/isVisible.js
|
|
|
var isVisible = __webpack_require__(48130);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(10366);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/grid/row.js
|
|
|
var row = __webpack_require__(92820);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/grid/col.js
|
|
|
var col = __webpack_require__(21584);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/FormItemInput.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const FormItemInput = props => {
|
|
|
const {
|
|
|
prefixCls,
|
|
|
status,
|
|
|
wrapperCol,
|
|
|
children,
|
|
|
errors,
|
|
|
warnings,
|
|
|
_internalItemRender: formItemRender,
|
|
|
extra,
|
|
|
help,
|
|
|
fieldId,
|
|
|
marginBottom,
|
|
|
onErrorVisibleChanged
|
|
|
} = props;
|
|
|
const baseClassName = `${prefixCls}-item`;
|
|
|
const formContext = react.useContext(context/* FormContext */.q3);
|
|
|
const mergedWrapperCol = wrapperCol || formContext.wrapperCol || {};
|
|
|
const className = classnames_default()(`${baseClassName}-control`, mergedWrapperCol.className);
|
|
|
// Pass to sub FormItem should not with col info
|
|
|
const subFormContext = react.useMemo(() => Object.assign({}, formContext), [formContext]);
|
|
|
delete subFormContext.labelCol;
|
|
|
delete subFormContext.wrapperCol;
|
|
|
const inputDom = /*#__PURE__*/react.createElement("div", {
|
|
|
className: `${baseClassName}-control-input`
|
|
|
}, /*#__PURE__*/react.createElement("div", {
|
|
|
className: `${baseClassName}-control-input-content`
|
|
|
}, children));
|
|
|
const formItemContext = react.useMemo(() => ({
|
|
|
prefixCls,
|
|
|
status
|
|
|
}), [prefixCls, status]);
|
|
|
const errorListDom = marginBottom !== null || errors.length || warnings.length ? /*#__PURE__*/react.createElement("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
flexWrap: 'nowrap'
|
|
|
}
|
|
|
}, /*#__PURE__*/react.createElement(context/* FormItemPrefixContext.Provider */.Rk.Provider, {
|
|
|
value: formItemContext
|
|
|
}, /*#__PURE__*/react.createElement(ErrorList, {
|
|
|
fieldId: fieldId,
|
|
|
errors: errors,
|
|
|
warnings: warnings,
|
|
|
help: help,
|
|
|
helpStatus: status,
|
|
|
className: `${baseClassName}-explain-connected`,
|
|
|
onVisibleChanged: onErrorVisibleChanged
|
|
|
})), !!marginBottom && /*#__PURE__*/react.createElement("div", {
|
|
|
style: {
|
|
|
width: 0,
|
|
|
height: marginBottom
|
|
|
}
|
|
|
})) : null;
|
|
|
const extraProps = {};
|
|
|
if (fieldId) {
|
|
|
extraProps.id = `${fieldId}_extra`;
|
|
|
}
|
|
|
// If extra = 0, && will goes wrong
|
|
|
// 0&&error -> 0
|
|
|
const extraDom = extra ? /*#__PURE__*/react.createElement("div", Object.assign({}, extraProps, {
|
|
|
className: `${baseClassName}-extra`
|
|
|
}), extra) : null;
|
|
|
const dom = formItemRender && formItemRender.mark === 'pro_table_render' && formItemRender.render ? formItemRender.render(props, {
|
|
|
input: inputDom,
|
|
|
errorList: errorListDom,
|
|
|
extra: extraDom
|
|
|
}) : /*#__PURE__*/react.createElement(react.Fragment, null, inputDom, errorListDom, extraDom);
|
|
|
return /*#__PURE__*/react.createElement(context/* FormContext.Provider */.q3.Provider, {
|
|
|
value: subFormContext
|
|
|
}, /*#__PURE__*/react.createElement(col/* default */.Z, Object.assign({}, mergedWrapperCol, {
|
|
|
className: className
|
|
|
}), dom));
|
|
|
};
|
|
|
/* harmony default export */ var form_FormItemInput = (FormItemInput);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/QuestionCircleOutlined.js + 1 modules
|
|
|
var QuestionCircleOutlined = __webpack_require__(25035);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/locale/en_US.js + 1 modules
|
|
|
var en_US = __webpack_require__(24457);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/locale/useLocale.js
|
|
|
var useLocale = __webpack_require__(10110);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
|
|
|
var es_tooltip = __webpack_require__(83062);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/FormItemLabel.js
|
|
|
var FormItemLabel_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function toTooltipProps(tooltip) {
|
|
|
if (!tooltip) {
|
|
|
return null;
|
|
|
}
|
|
|
if (typeof tooltip === 'object' && ! /*#__PURE__*/react.isValidElement(tooltip)) {
|
|
|
return tooltip;
|
|
|
}
|
|
|
return {
|
|
|
title: tooltip
|
|
|
};
|
|
|
}
|
|
|
const FormItemLabel = _ref => {
|
|
|
let {
|
|
|
prefixCls,
|
|
|
label,
|
|
|
htmlFor,
|
|
|
labelCol,
|
|
|
labelAlign,
|
|
|
colon,
|
|
|
required,
|
|
|
requiredMark,
|
|
|
tooltip
|
|
|
} = _ref;
|
|
|
var _a;
|
|
|
const [formLocale] = (0,useLocale/* default */.Z)('Form');
|
|
|
const {
|
|
|
vertical,
|
|
|
labelAlign: contextLabelAlign,
|
|
|
labelCol: contextLabelCol,
|
|
|
labelWrap,
|
|
|
colon: contextColon
|
|
|
} = react.useContext(context/* FormContext */.q3);
|
|
|
if (!label) {
|
|
|
return null;
|
|
|
}
|
|
|
const mergedLabelCol = labelCol || contextLabelCol || {};
|
|
|
const mergedLabelAlign = labelAlign || contextLabelAlign;
|
|
|
const labelClsBasic = `${prefixCls}-item-label`;
|
|
|
const labelColClassName = classnames_default()(labelClsBasic, mergedLabelAlign === 'left' && `${labelClsBasic}-left`, mergedLabelCol.className, {
|
|
|
[`${labelClsBasic}-wrap`]: !!labelWrap
|
|
|
});
|
|
|
let labelChildren = label;
|
|
|
// Keep label is original where there should have no colon
|
|
|
const computedColon = colon === true || contextColon !== false && colon !== false;
|
|
|
const haveColon = computedColon && !vertical;
|
|
|
// Remove duplicated user input colon
|
|
|
if (haveColon && typeof label === 'string' && label.trim() !== '') {
|
|
|
labelChildren = label.replace(/[:|:]\s*$/, '');
|
|
|
}
|
|
|
// Tooltip
|
|
|
const tooltipProps = toTooltipProps(tooltip);
|
|
|
if (tooltipProps) {
|
|
|
const {
|
|
|
icon = /*#__PURE__*/react.createElement(QuestionCircleOutlined/* default */.Z, null)
|
|
|
} = tooltipProps,
|
|
|
restTooltipProps = FormItemLabel_rest(tooltipProps, ["icon"]);
|
|
|
const tooltipNode = /*#__PURE__*/react.createElement(es_tooltip/* default */.Z, Object.assign({}, restTooltipProps), /*#__PURE__*/react.cloneElement(icon, {
|
|
|
className: `${prefixCls}-item-tooltip`,
|
|
|
title: ''
|
|
|
}));
|
|
|
labelChildren = /*#__PURE__*/react.createElement(react.Fragment, null, labelChildren, tooltipNode);
|
|
|
}
|
|
|
if (requiredMark === 'optional' && !required) {
|
|
|
labelChildren = /*#__PURE__*/react.createElement(react.Fragment, null, labelChildren, /*#__PURE__*/react.createElement("span", {
|
|
|
className: `${prefixCls}-item-optional`,
|
|
|
title: ""
|
|
|
}, (formLocale === null || formLocale === void 0 ? void 0 : formLocale.optional) || ((_a = en_US/* default.Form */.Z.Form) === null || _a === void 0 ? void 0 : _a.optional)));
|
|
|
}
|
|
|
const labelClassName = classnames_default()({
|
|
|
[`${prefixCls}-item-required`]: required,
|
|
|
[`${prefixCls}-item-required-mark-optional`]: requiredMark === 'optional',
|
|
|
[`${prefixCls}-item-no-colon`]: !computedColon
|
|
|
});
|
|
|
return /*#__PURE__*/react.createElement(col/* default */.Z, Object.assign({}, mergedLabelCol, {
|
|
|
className: labelColClassName
|
|
|
}), /*#__PURE__*/react.createElement("label", {
|
|
|
htmlFor: htmlFor,
|
|
|
className: labelClassName,
|
|
|
title: typeof label === 'string' ? label : ''
|
|
|
}, labelChildren));
|
|
|
};
|
|
|
/* harmony default export */ var form_FormItemLabel = (FormItemLabel);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/FormItem/ItemHolder.js
|
|
|
var ItemHolder_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const iconMap = {
|
|
|
success: CheckCircleFilled/* default */.Z,
|
|
|
warning: ExclamationCircleFilled/* default */.Z,
|
|
|
error: CloseCircleFilled/* default */.Z,
|
|
|
validating: LoadingOutlined/* default */.Z
|
|
|
};
|
|
|
function ItemHolder(props) {
|
|
|
const {
|
|
|
prefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
style,
|
|
|
help,
|
|
|
errors,
|
|
|
warnings,
|
|
|
validateStatus,
|
|
|
meta,
|
|
|
hasFeedback,
|
|
|
hidden,
|
|
|
children,
|
|
|
fieldId,
|
|
|
required,
|
|
|
isRequired,
|
|
|
onSubItemMetaChange
|
|
|
} = props,
|
|
|
restProps = ItemHolder_rest(props, ["prefixCls", "className", "rootClassName", "style", "help", "errors", "warnings", "validateStatus", "meta", "hasFeedback", "hidden", "children", "fieldId", "required", "isRequired", "onSubItemMetaChange"]);
|
|
|
const itemPrefixCls = `${prefixCls}-item`;
|
|
|
const {
|
|
|
requiredMark
|
|
|
} = react.useContext(context/* FormContext */.q3);
|
|
|
// ======================== Margin ========================
|
|
|
const itemRef = react.useRef(null);
|
|
|
const debounceErrors = useDebounce(errors);
|
|
|
const debounceWarnings = useDebounce(warnings);
|
|
|
const hasHelp = help !== undefined && help !== null;
|
|
|
const hasError = !!(hasHelp || errors.length || warnings.length);
|
|
|
const isOnScreen = !!itemRef.current && (0,isVisible/* default */.Z)(itemRef.current);
|
|
|
const [marginBottom, setMarginBottom] = react.useState(null);
|
|
|
(0,useLayoutEffect/* default */.Z)(() => {
|
|
|
if (hasError && itemRef.current) {
|
|
|
// The element must be part of the DOMTree to use getComputedStyle
|
|
|
// https://stackoverflow.com/questions/35360711/getcomputedstyle-returns-a-cssstyledeclaration-but-all-properties-are-empty-on-a
|
|
|
const itemStyle = getComputedStyle(itemRef.current);
|
|
|
setMarginBottom(parseInt(itemStyle.marginBottom, 10));
|
|
|
}
|
|
|
}, [hasError, isOnScreen]);
|
|
|
const onErrorVisibleChanged = nextVisible => {
|
|
|
if (!nextVisible) {
|
|
|
setMarginBottom(null);
|
|
|
}
|
|
|
};
|
|
|
// ======================== Status ========================
|
|
|
const getValidateState = function () {
|
|
|
let isDebounce = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
|
let status = '';
|
|
|
const _errors = isDebounce ? debounceErrors : meta.errors;
|
|
|
const _warnings = isDebounce ? debounceWarnings : meta.warnings;
|
|
|
if (validateStatus !== undefined) {
|
|
|
status = validateStatus;
|
|
|
} else if (meta.validating) {
|
|
|
status = 'validating';
|
|
|
} else if (_errors.length) {
|
|
|
status = 'error';
|
|
|
} else if (_warnings.length) {
|
|
|
status = 'warning';
|
|
|
} else if (meta.touched || hasFeedback && meta.validated) {
|
|
|
// success feedback should display when pass hasFeedback prop and current value is valid value
|
|
|
status = 'success';
|
|
|
}
|
|
|
return status;
|
|
|
};
|
|
|
const mergedValidateStatus = getValidateState();
|
|
|
const formItemStatusContext = react.useMemo(() => {
|
|
|
let feedbackIcon;
|
|
|
if (hasFeedback) {
|
|
|
const IconNode = mergedValidateStatus && iconMap[mergedValidateStatus];
|
|
|
feedbackIcon = IconNode ? /*#__PURE__*/react.createElement("span", {
|
|
|
className: classnames_default()(`${itemPrefixCls}-feedback-icon`, `${itemPrefixCls}-feedback-icon-${mergedValidateStatus}`)
|
|
|
}, /*#__PURE__*/react.createElement(IconNode, null)) : null;
|
|
|
}
|
|
|
return {
|
|
|
status: mergedValidateStatus,
|
|
|
errors,
|
|
|
warnings,
|
|
|
hasFeedback,
|
|
|
feedbackIcon,
|
|
|
isFormItemInput: true
|
|
|
};
|
|
|
}, [mergedValidateStatus, hasFeedback]);
|
|
|
// ======================== Render ========================
|
|
|
const itemClassName = classnames_default()(itemPrefixCls, className, rootClassName, {
|
|
|
[`${itemPrefixCls}-with-help`]: hasHelp || debounceErrors.length || debounceWarnings.length,
|
|
|
// Status
|
|
|
[`${itemPrefixCls}-has-feedback`]: mergedValidateStatus && hasFeedback,
|
|
|
[`${itemPrefixCls}-has-success`]: mergedValidateStatus === 'success',
|
|
|
[`${itemPrefixCls}-has-warning`]: mergedValidateStatus === 'warning',
|
|
|
[`${itemPrefixCls}-has-error`]: mergedValidateStatus === 'error',
|
|
|
[`${itemPrefixCls}-is-validating`]: mergedValidateStatus === 'validating',
|
|
|
[`${itemPrefixCls}-hidden`]: hidden
|
|
|
});
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
className: itemClassName,
|
|
|
style: style,
|
|
|
ref: itemRef
|
|
|
}, /*#__PURE__*/react.createElement(row/* default */.Z, Object.assign({
|
|
|
className: `${itemPrefixCls}-row`
|
|
|
}, (0,omit/* default */.Z)(restProps, ['_internalItemRender', 'colon', 'dependencies', 'extra', 'fieldKey', 'getValueFromEvent', 'getValueProps', 'htmlFor', 'id', 'initialValue', 'isListField', 'label', 'labelAlign', 'labelCol', 'labelWrap', 'messageVariables', 'name', 'normalize', 'noStyle', 'preserve', 'requiredMark', 'rules', 'shouldUpdate', 'trigger', 'tooltip', 'validateFirst', 'validateTrigger', 'valuePropName', 'wrapperCol'])), /*#__PURE__*/react.createElement(form_FormItemLabel, Object.assign({
|
|
|
htmlFor: fieldId
|
|
|
}, props, {
|
|
|
requiredMark: requiredMark,
|
|
|
required: required !== null && required !== void 0 ? required : isRequired,
|
|
|
prefixCls: prefixCls
|
|
|
})), /*#__PURE__*/react.createElement(form_FormItemInput, Object.assign({}, props, meta, {
|
|
|
errors: debounceErrors,
|
|
|
warnings: debounceWarnings,
|
|
|
prefixCls: prefixCls,
|
|
|
status: mergedValidateStatus,
|
|
|
help: help,
|
|
|
marginBottom: marginBottom,
|
|
|
onErrorVisibleChanged: onErrorVisibleChanged
|
|
|
}), /*#__PURE__*/react.createElement(context/* NoStyleItemContext.Provider */.qI.Provider, {
|
|
|
value: onSubItemMetaChange
|
|
|
}, /*#__PURE__*/react.createElement(context/* FormItemInputContext.Provider */.aM.Provider, {
|
|
|
value: formItemStatusContext
|
|
|
}, children)))), !!marginBottom && /*#__PURE__*/react.createElement("div", {
|
|
|
className: `${itemPrefixCls}-margin-offset`,
|
|
|
style: {
|
|
|
marginBottom: -marginBottom
|
|
|
}
|
|
|
}));
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/Children/toArray.js
|
|
|
var Children_toArray = __webpack_require__(37419);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/hooks/useChildren.js
|
|
|
|
|
|
function useChildren(children) {
|
|
|
if (typeof children === 'function') {
|
|
|
return children;
|
|
|
}
|
|
|
const childList = (0,Children_toArray/* default */.Z)(children);
|
|
|
return childList.length <= 1 ? childList[0] : childList;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/FormItem/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const NAME_SPLIT = '__SPLIT__';
|
|
|
const ValidateStatuses = (/* unused pure expression or super */ null && (['success', 'warning', 'error', 'validating', '']));
|
|
|
const MemoInput = /*#__PURE__*/react.memo(_ref => {
|
|
|
let {
|
|
|
children
|
|
|
} = _ref;
|
|
|
return children;
|
|
|
}, (prev, next) => prev.value === next.value && prev.update === next.update && prev.childProps.length === next.childProps.length && prev.childProps.every((value, index) => value === next.childProps[index]));
|
|
|
function hasValidName(name) {
|
|
|
if (name === null) {
|
|
|
false ? 0 : void 0;
|
|
|
}
|
|
|
return !(name === undefined || name === null);
|
|
|
}
|
|
|
function genEmptyMeta() {
|
|
|
return {
|
|
|
errors: [],
|
|
|
warnings: [],
|
|
|
touched: false,
|
|
|
validating: false,
|
|
|
name: [],
|
|
|
validated: false
|
|
|
};
|
|
|
}
|
|
|
function InternalFormItem(props) {
|
|
|
const {
|
|
|
name,
|
|
|
noStyle,
|
|
|
className,
|
|
|
dependencies,
|
|
|
prefixCls: customizePrefixCls,
|
|
|
shouldUpdate,
|
|
|
rules,
|
|
|
children,
|
|
|
required,
|
|
|
label,
|
|
|
messageVariables,
|
|
|
trigger = 'onChange',
|
|
|
validateTrigger,
|
|
|
hidden,
|
|
|
help
|
|
|
} = props;
|
|
|
const {
|
|
|
getPrefixCls
|
|
|
} = react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
name: formName
|
|
|
} = react.useContext(context/* FormContext */.q3);
|
|
|
const mergedChildren = useChildren(children);
|
|
|
const isRenderProps = typeof mergedChildren === 'function';
|
|
|
const notifyParentMetaChange = react.useContext(context/* NoStyleItemContext */.qI);
|
|
|
const {
|
|
|
validateTrigger: contextValidateTrigger
|
|
|
} = react.useContext(rc_field_form_es.FieldContext);
|
|
|
const mergedValidateTrigger = validateTrigger !== undefined ? validateTrigger : contextValidateTrigger;
|
|
|
const hasName = hasValidName(name);
|
|
|
const prefixCls = getPrefixCls('form', customizePrefixCls);
|
|
|
// Style
|
|
|
const [wrapSSR, hashId] = form_style(prefixCls);
|
|
|
// ========================= MISC =========================
|
|
|
// Get `noStyle` required info
|
|
|
const listContext = react.useContext(rc_field_form_es.ListContext);
|
|
|
const fieldKeyPathRef = react.useRef();
|
|
|
// ======================== Errors ========================
|
|
|
// >>>>> Collect sub field errors
|
|
|
const [subFieldErrors, setSubFieldErrors] = useFrameState({});
|
|
|
// >>>>> Current field errors
|
|
|
const [meta, setMeta] = (0,useState/* default */.Z)(() => genEmptyMeta());
|
|
|
const onMetaChange = nextMeta => {
|
|
|
// This keyInfo is not correct when field is removed
|
|
|
// Since origin keyManager no longer keep the origin key anymore
|
|
|
// Which means we need cache origin one and reuse when removed
|
|
|
const keyInfo = listContext === null || listContext === void 0 ? void 0 : listContext.getKey(nextMeta.name);
|
|
|
// Destroy will reset all the meta
|
|
|
setMeta(nextMeta.destroy ? genEmptyMeta() : nextMeta, true);
|
|
|
// Bump to parent since noStyle
|
|
|
if (noStyle && help !== false && notifyParentMetaChange) {
|
|
|
let namePath = nextMeta.name;
|
|
|
if (!nextMeta.destroy) {
|
|
|
if (keyInfo !== undefined) {
|
|
|
const [fieldKey, restPath] = keyInfo;
|
|
|
namePath = [fieldKey].concat((0,toConsumableArray/* default */.Z)(restPath));
|
|
|
fieldKeyPathRef.current = namePath;
|
|
|
}
|
|
|
} else {
|
|
|
// Use origin cache data
|
|
|
namePath = fieldKeyPathRef.current || namePath;
|
|
|
}
|
|
|
notifyParentMetaChange(nextMeta, namePath);
|
|
|
}
|
|
|
};
|
|
|
// >>>>> Collect noStyle Field error to the top FormItem
|
|
|
const onSubItemMetaChange = (subMeta, uniqueKeys) => {
|
|
|
// Only `noStyle` sub item will trigger
|
|
|
setSubFieldErrors(prevSubFieldErrors => {
|
|
|
const clone = Object.assign({}, prevSubFieldErrors);
|
|
|
// name: ['user', 1] + key: [4] = ['user', 4]
|
|
|
const mergedNamePath = [].concat((0,toConsumableArray/* default */.Z)(subMeta.name.slice(0, -1)), (0,toConsumableArray/* default */.Z)(uniqueKeys));
|
|
|
const mergedNameKey = mergedNamePath.join(NAME_SPLIT);
|
|
|
if (subMeta.destroy) {
|
|
|
// Remove
|
|
|
delete clone[mergedNameKey];
|
|
|
} else {
|
|
|
// Update
|
|
|
clone[mergedNameKey] = subMeta;
|
|
|
}
|
|
|
return clone;
|
|
|
});
|
|
|
};
|
|
|
// >>>>> Get merged errors
|
|
|
const [mergedErrors, mergedWarnings] = react.useMemo(() => {
|
|
|
const errorList = (0,toConsumableArray/* default */.Z)(meta.errors);
|
|
|
const warningList = (0,toConsumableArray/* default */.Z)(meta.warnings);
|
|
|
Object.values(subFieldErrors).forEach(subFieldError => {
|
|
|
errorList.push.apply(errorList, (0,toConsumableArray/* default */.Z)(subFieldError.errors || []));
|
|
|
warningList.push.apply(warningList, (0,toConsumableArray/* default */.Z)(subFieldError.warnings || []));
|
|
|
});
|
|
|
return [errorList, warningList];
|
|
|
}, [subFieldErrors, meta.errors, meta.warnings]);
|
|
|
// ===================== Children Ref =====================
|
|
|
const getItemRef = useItemRef();
|
|
|
// ======================== Render ========================
|
|
|
function renderLayout(baseChildren, fieldId, isRequired) {
|
|
|
if (noStyle && !hidden) {
|
|
|
return baseChildren;
|
|
|
}
|
|
|
return /*#__PURE__*/react.createElement(ItemHolder, Object.assign({
|
|
|
key: "row"
|
|
|
}, props, {
|
|
|
className: classnames_default()(className, hashId),
|
|
|
prefixCls: prefixCls,
|
|
|
fieldId: fieldId,
|
|
|
isRequired: isRequired,
|
|
|
errors: mergedErrors,
|
|
|
warnings: mergedWarnings,
|
|
|
meta: meta,
|
|
|
onSubItemMetaChange: onSubItemMetaChange
|
|
|
}), baseChildren);
|
|
|
}
|
|
|
if (!hasName && !isRenderProps && !dependencies) {
|
|
|
return wrapSSR(renderLayout(mergedChildren));
|
|
|
}
|
|
|
let variables = {};
|
|
|
if (typeof label === 'string') {
|
|
|
variables.label = label;
|
|
|
} else if (name) {
|
|
|
variables.label = String(name);
|
|
|
}
|
|
|
if (messageVariables) {
|
|
|
variables = Object.assign(Object.assign({}, variables), messageVariables);
|
|
|
}
|
|
|
// >>>>> With Field
|
|
|
return wrapSSR( /*#__PURE__*/react.createElement(rc_field_form_es.Field, Object.assign({}, props, {
|
|
|
messageVariables: variables,
|
|
|
trigger: trigger,
|
|
|
validateTrigger: mergedValidateTrigger,
|
|
|
onMetaChange: onMetaChange
|
|
|
}), (control, renderMeta, context) => {
|
|
|
const mergedName = toArray(name).length && renderMeta ? renderMeta.name : [];
|
|
|
const fieldId = getFieldId(mergedName, formName);
|
|
|
const isRequired = required !== undefined ? required : !!(rules && rules.some(rule => {
|
|
|
if (rule && typeof rule === 'object' && rule.required && !rule.warningOnly) {
|
|
|
return true;
|
|
|
}
|
|
|
if (typeof rule === 'function') {
|
|
|
const ruleEntity = rule(context);
|
|
|
return ruleEntity && ruleEntity.required && !ruleEntity.warningOnly;
|
|
|
}
|
|
|
return false;
|
|
|
}));
|
|
|
// ======================= Children =======================
|
|
|
const mergedControl = Object.assign({}, control);
|
|
|
let childNode = null;
|
|
|
false ? 0 : void 0;
|
|
|
if (Array.isArray(mergedChildren) && hasName) {
|
|
|
false ? 0 : void 0;
|
|
|
childNode = mergedChildren;
|
|
|
} else if (isRenderProps && (!(shouldUpdate || dependencies) || hasName)) {
|
|
|
false ? 0 : void 0;
|
|
|
false ? 0 : void 0;
|
|
|
} else if (dependencies && !isRenderProps && !hasName) {
|
|
|
false ? 0 : void 0;
|
|
|
} else if ((0,reactNode/* isValidElement */.l$)(mergedChildren)) {
|
|
|
false ? 0 : void 0;
|
|
|
const childProps = Object.assign(Object.assign({}, mergedChildren.props), mergedControl);
|
|
|
if (!childProps.id) {
|
|
|
childProps.id = fieldId;
|
|
|
}
|
|
|
if (help || mergedErrors.length > 0 || mergedWarnings.length > 0 || props.extra) {
|
|
|
const describedbyArr = [];
|
|
|
if (help || mergedErrors.length > 0) {
|
|
|
describedbyArr.push(`${fieldId}_help`);
|
|
|
}
|
|
|
if (props.extra) {
|
|
|
describedbyArr.push(`${fieldId}_extra`);
|
|
|
}
|
|
|
childProps['aria-describedby'] = describedbyArr.join(' ');
|
|
|
}
|
|
|
if (mergedErrors.length > 0) {
|
|
|
childProps['aria-invalid'] = 'true';
|
|
|
}
|
|
|
if (isRequired) {
|
|
|
childProps['aria-required'] = 'true';
|
|
|
}
|
|
|
if ((0,ref/* supportRef */.Yr)(mergedChildren)) {
|
|
|
childProps.ref = getItemRef(mergedName, mergedChildren);
|
|
|
}
|
|
|
// We should keep user origin event handler
|
|
|
const triggers = new Set([].concat((0,toConsumableArray/* default */.Z)(toArray(trigger)), (0,toConsumableArray/* default */.Z)(toArray(mergedValidateTrigger))));
|
|
|
triggers.forEach(eventName => {
|
|
|
childProps[eventName] = function () {
|
|
|
var _a2, _c2;
|
|
|
var _a, _b, _c;
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
args[_key] = arguments[_key];
|
|
|
}
|
|
|
(_a = mergedControl[eventName]) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [mergedControl].concat(args));
|
|
|
(_c = (_b = mergedChildren.props)[eventName]) === null || _c === void 0 ? void 0 : (_c2 = _c).call.apply(_c2, [_b].concat(args));
|
|
|
};
|
|
|
});
|
|
|
// List of props that need to be watched for changes -> if changes are detected in MemoInput -> rerender
|
|
|
const watchingChildProps = [childProps['aria-required'], childProps['aria-invalid'], childProps['aria-describedby']];
|
|
|
childNode = /*#__PURE__*/react.createElement(MemoInput, {
|
|
|
value: mergedControl[props.valuePropName || 'value'],
|
|
|
update: mergedChildren,
|
|
|
childProps: watchingChildProps
|
|
|
}, (0,reactNode/* cloneElement */.Tm)(mergedChildren, childProps));
|
|
|
} else if (isRenderProps && (shouldUpdate || dependencies) && !hasName) {
|
|
|
childNode = mergedChildren(context);
|
|
|
} else {
|
|
|
false ? 0 : void 0;
|
|
|
childNode = mergedChildren;
|
|
|
}
|
|
|
return renderLayout(childNode, fieldId, isRequired);
|
|
|
}));
|
|
|
}
|
|
|
const FormItem = InternalFormItem;
|
|
|
FormItem.useStatus = hooks_useFormItemStatus;
|
|
|
/* harmony default export */ var form_FormItem = (FormItem);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/FormList.js
|
|
|
var FormList_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const FormList = _a => {
|
|
|
var {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
children
|
|
|
} = _a,
|
|
|
props = FormList_rest(_a, ["prefixCls", "children"]);
|
|
|
false ? 0 : void 0;
|
|
|
const {
|
|
|
getPrefixCls
|
|
|
} = react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
|
const prefixCls = getPrefixCls('form', customizePrefixCls);
|
|
|
const contextValue = react.useMemo(() => ({
|
|
|
prefixCls,
|
|
|
status: 'error'
|
|
|
}), [prefixCls]);
|
|
|
return /*#__PURE__*/react.createElement(rc_field_form_es.List, Object.assign({}, props), (fields, operation, meta) => /*#__PURE__*/react.createElement(context/* FormItemPrefixContext.Provider */.Rk.Provider, {
|
|
|
value: contextValue
|
|
|
}, children(fields.map(field => Object.assign(Object.assign({}, field), {
|
|
|
fieldKey: field.key
|
|
|
})), operation, {
|
|
|
errors: meta.errors,
|
|
|
warnings: meta.warnings
|
|
|
})));
|
|
|
};
|
|
|
/* harmony default export */ var form_FormList = (FormList);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/hooks/useFormInstance.js
|
|
|
|
|
|
|
|
|
function useFormInstance() {
|
|
|
const {
|
|
|
form
|
|
|
} = (0,react.useContext)(context/* FormContext */.q3);
|
|
|
return form;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/form/index.js
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const es_form_Form = form_Form;
|
|
|
es_form_Form.Item = form_FormItem;
|
|
|
es_form_Form.List = form_FormList;
|
|
|
es_form_Form.ErrorList = ErrorList;
|
|
|
es_form_Form.useForm = useForm;
|
|
|
es_form_Form.useFormInstance = useFormInstance;
|
|
|
es_form_Form.useWatch = rc_field_form_es.useWatch;
|
|
|
es_form_Form.Provider = context/* FormProvider */.RV;
|
|
|
es_form_Form.create = () => {
|
|
|
false ? 0 : void 0;
|
|
|
};
|
|
|
/* harmony default export */ var es_form = (es_form_Form);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 17423:
|
|
|
/*!***************************************************************************!*\
|
|
|
!*** ./node_modules/scroll-into-view-if-needed/dist/index.js + 1 modules ***!
|
|
|
\***************************************************************************/
|
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ dist_t; }
|
|
|
});
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/compute-scroll-into-view/dist/index.js
|
|
|
const t=t=>"object"==typeof t&&null!=t&&1===t.nodeType,e=(t,e)=>(!e||"hidden"!==t)&&("visible"!==t&&"clip"!==t),n=(t,n)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const o=getComputedStyle(t,null);return e(o.overflowY,n)||e(o.overflowX,n)||(t=>{const e=(t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}})(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)})(t)}return!1},o=(t,e,n,o,i,l,r,d)=>l<t&&r>e||l>t&&r<e?0:l<=t&&d<=n||r>=e&&d>=n?l-t-o:r>e&&d<n||l<t&&d>n?r-e+i:0,i=t=>{const e=t.parentElement;return null==e?t.getRootNode().host||null:e},dist_l=(e,l)=>{var r,d,s,h;if("undefined"==typeof document)return[];const{scrollMode:c,block:f,inline:u,boundary:a,skipOverflowHiddenElements:g}=l,m="function"==typeof a?a:t=>t!==a;if(!t(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,w=[];let W=e;for(;t(W)&&m(W);){if(W=i(W),W===p){w.push(W);break}null!=W&&W===document.body&&n(W)&&!n(document.documentElement)||null!=W&&n(W,g)&&w.push(W)}const H=null!=(d=null==(r=window.visualViewport)?void 0:r.width)?d:innerWidth,b=null!=(h=null==(s=window.visualViewport)?void 0:s.height)?h:innerHeight,{scrollX:v,scrollY:y}=window,{height:E,width:M,top:x,right:I,bottom:C,left:R}=e.getBoundingClientRect();let T="start"===f||"nearest"===f?x:"end"===f?C:x+E/2,V="center"===u?R+M/2:"end"===u?I:R;const k=[];for(let t=0;t<w.length;t++){const e=w[t],{height:n,width:i,top:l,right:r,bottom:d,left:s}=e.getBoundingClientRect();if("if-needed"===c&&x>=0&&R>=0&&C<=b&&I<=H&&x>=l&&C<=d&&R>=s&&I<=r)return k;const h=getComputedStyle(e),a=parseInt(h.borderLeftWidth,10),g=parseInt(h.borderTopWidth,10),m=parseInt(h.borderRightWidth,10),W=parseInt(h.borderBottomWidth,10);let B=0,D=0;const L="offsetWidth"in e?e.offsetWidth-e.clientWidth-a-m:0,S="offsetHeight"in e?e.offsetHeight-e.clientHeight-g-W:0,X="offsetWidth"in e?0===e.offsetWidth?0:i/e.offsetWidth:0,Y="offsetHeight"in e?0===e.offsetHeight?0:n/e.offsetHeight:0;if(p===e)B="start"===f?T:"end"===f?T-b:"nearest"===f?o(y,y+b,b,g,W,y+T,y+T+E,E):T-b/2,D="start"===u?V:"center"===u?V-H/2:"end"===u?V-H:o(v,v+H,H,a,m,v+V,v+V+M,M),B=Math.max(0,B+y),D=Math.max(0,D+v);else{B="start"===f?T-l-g:"end"===f?T-d+W+S:"nearest"===f?o(l,d,n,g,W+S,T,T+E,E):T-(l+n/2)+S/2,D="start"===u?V-s-a:"center"===u?V-(s+i/2)+L/2:"end"===u?V-r+m+L:o(s,r,i,a,m+L,V,V+M,M);const{scrollLeft:t,scrollTop:h}=e;B=Math.max(0,Math.min(h+B/Y,e.scrollHeight-n/Y+S)),D=Math.max(0,Math.min(t+D/X,e.scrollWidth-i/X+L)),T+=h-B,V+=t-D}k.push({el:e,top:B,left:D})}return k};//# sourceMappingURL=index.js.map
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/scroll-into-view-if-needed/dist/index.js
|
|
|
const dist_o=e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"};function dist_t(t,n){if(!t.isConnected||!(e=>{let o=e;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1})(t))return;if((e=>"object"==typeof e&&"function"==typeof e.behavior)(n))return n.behavior(dist_l(t,n));const r="boolean"==typeof n||null==n?void 0:n.behavior;for(const{el:i,top:a,left:l}of dist_l(t,dist_o(n)))i.scroll({top:a,left:l,behavior:r})}//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |