@zat-design/sisyphus-react 4.5.9 → 4.5.10-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/FormsProvider/index.js +14 -21
- package/es/ProAction/components/CheckModalContent/index.js +12 -26
- package/es/ProAction/index.js +79 -83
- package/es/ProAction/propsType.js +0 -1
- package/es/ProConfigProvider/index.js +63 -110
- package/es/ProConfigProvider/propsType.js +0 -1
- package/es/ProDownload/index.d.ts +2 -1
- package/es/ProDownload/index.js +74 -69
- package/es/ProDownload/propsType.js +0 -1
- package/es/ProDownload/utils.d.ts +10 -5
- package/es/ProDownload/utils.js +63 -95
- package/es/ProDrawerForm/components/ProDrawer/index.js +83 -113
- package/es/ProDrawerForm/components/ProModal/index.js +77 -108
- package/es/ProDrawerForm/components/index.js +6 -2
- package/es/ProDrawerForm/hooks/useConfirmClose.js +20 -39
- package/es/ProDrawerForm/index.js +29 -38
- package/es/ProDrawerForm/propsType.js +0 -1
- package/es/ProDrawerForm/utils/index.js +18 -36
- package/es/ProEditLabel/components/RenderProForm.js +45 -49
- package/es/ProEditLabel/index.js +126 -163
- package/es/ProEditLabel/propsType.js +0 -1
- package/es/ProEditLabel/utils/index.js +5 -8
- package/es/ProEditTable/components/ActionButton/index.js +111 -119
- package/es/ProEditTable/components/RcTable/BaseTable.js +38 -51
- package/es/ProEditTable/components/RcTable/DraggableTable.js +97 -129
- package/es/ProEditTable/components/RcTable/index.js +6 -4
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +77 -95
- package/es/ProEditTable/components/RenderField/index.js +490 -587
- package/es/ProEditTable/components/RenderField/propsType.js +0 -1
- package/es/ProEditTable/components/RenderField/tools.js +115 -112
- package/es/ProEditTable/components/RenderToolbar/index.js +47 -73
- package/es/ProEditTable/components/Summary/index.js +38 -64
- package/es/ProEditTable/components/Validator/index.js +46 -46
- package/es/ProEditTable/components/index.js +12 -5
- package/es/ProEditTable/index.js +456 -378
- package/es/ProEditTable/propsType.js +0 -1
- package/es/ProEditTable/utils/config.js +60 -122
- package/es/ProEditTable/utils/diffOriginal.js +45 -82
- package/es/ProEditTable/utils/getDefaultProps.js +19 -24
- package/es/ProEditTable/utils/index.js +154 -235
- package/es/ProEditTable/utils/tools.js +149 -286
- package/es/ProEditTable/utils/transform.js +25 -30
- package/es/ProEditTable/utils/useEditTableError.js +30 -43
- package/es/ProEditTable/utils/useShouldUpdateForTable.js +42 -72
- package/es/ProEditTable/utils/validateAll.js +87 -154
- package/es/ProEnum/components/Group.js +38 -30
- package/es/ProEnum/components/Tag.js +22 -26
- package/es/ProEnum/hooks/useEnum.js +48 -116
- package/es/ProEnum/hooks/useEnumRequest.js +182 -212
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +40 -48
- package/es/ProEnum/index.js +162 -172
- package/es/ProEnum/propsType.js +0 -1
- package/es/ProEnum/utils/eventCenter.js +10 -12
- package/es/ProEnum/utils/frequentEnum.js +35 -92
- package/es/ProEnum/utils/getEnum.js +32 -90
- package/es/ProEnum/utils/getEnumLabel.js +44 -49
- package/es/ProEnum/utils/index.js +93 -207
- package/es/ProForm/components/Container.js +13 -28
- package/es/ProForm/components/FormFooter/index.js +36 -44
- package/es/ProForm/components/FormFooter/propsType.js +0 -1
- package/es/ProForm/components/base/Checkbox/index.js +32 -59
- package/es/ProForm/components/base/DatePicker/index.js +49 -71
- package/es/ProForm/components/base/Input/index.js +63 -97
- package/es/ProForm/components/base/Input/propsType.js +0 -1
- package/es/ProForm/components/base/InputNumber/index.js +118 -172
- package/es/ProForm/components/base/Radio/index.js +39 -52
- package/es/ProForm/components/base/RangePicker/index.js +109 -127
- package/es/ProForm/components/base/RangePicker/useDateRange.js +20 -17
- package/es/ProForm/components/base/Select/index.js +63 -89
- package/es/ProForm/components/base/Switch/index.js +27 -35
- package/es/ProForm/components/base/SwitchCheckbox/index.js +36 -54
- package/es/ProForm/components/base/TextArea/index.js +30 -41
- package/es/ProForm/components/base/TimePicker/index.js +27 -37
- package/es/ProForm/components/combination/Container/index.js +37 -47
- package/es/ProForm/components/combination/Container/propsType.js +0 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +165 -237
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +98 -102
- package/es/ProForm/components/combination/FormList/components/Empty.js +28 -55
- package/es/ProForm/components/combination/FormList/components/LineFields.js +57 -54
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +61 -109
- package/es/ProForm/components/combination/FormList/index.js +151 -161
- package/es/ProForm/components/combination/FormList/propsType.js +0 -1
- package/es/ProForm/components/combination/FormList/style/index.less +6 -0
- package/es/ProForm/components/combination/FormList/utils.js +22 -38
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +12 -28
- package/es/ProForm/components/combination/Group/component/ComRender.js +50 -111
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.js +106 -213
- package/es/ProForm/components/combination/Group/hooks/index.js +69 -129
- package/es/ProForm/components/combination/Group/index.js +87 -126
- package/es/ProForm/components/combination/Group/propsType.js +0 -1
- package/es/ProForm/components/combination/Group/utils/index.js +124 -239
- package/es/ProForm/components/combination/ProCascader/index.js +156 -199
- package/es/ProForm/components/combination/ProCascader/propsType.js +0 -1
- package/es/ProForm/components/combination/ProCascader/utils/index.js +12 -21
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +72 -70
- package/es/ProForm/components/combination/ProModalSelect/index.js +309 -347
- package/es/ProForm/components/combination/ProModalSelect/propsType.js +0 -1
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +32 -39
- package/es/ProForm/components/combination/ProNumberRange/index.js +100 -156
- package/es/ProForm/components/combination/ProNumberRange/propsType.js +0 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.js +104 -115
- package/es/ProForm/components/combination/ProRangeLimit/propsType.js +0 -1
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +16 -16
- package/es/ProForm/components/combination/ProTimeLimit/index.js +75 -109
- package/es/ProForm/components/index.js +56 -34
- package/es/ProForm/components/render/ChangedWrapper.js +85 -94
- package/es/ProForm/components/render/ConfirmWrapper.js +27 -39
- package/es/ProForm/components/render/CustomComponentViewWrapper.js +65 -82
- package/es/ProForm/components/render/Render.js +223 -329
- package/es/ProForm/components/render/RenderFields.js +76 -113
- package/es/ProForm/components/render/propsType.js +0 -1
- package/es/ProForm/hooks/useControlled.js +8 -10
- package/es/ProForm/hooks/useDeepCompareMemo.js +11 -11
- package/es/ProForm/hooks/useFieldProps.js +8 -4
- package/es/ProForm/hooks/useForm.js +50 -110
- package/es/ProForm/hooks/useRules.js +17 -33
- package/es/ProForm/hooks/useShouldUpdate.js +77 -152
- package/es/ProForm/hooks/useWatch.js +62 -134
- package/es/ProForm/index.js +157 -194
- package/es/ProForm/propsType.js +15 -7
- package/es/ProForm/utils/buildFormItemProps.js +51 -58
- package/es/ProForm/utils/diffOriginal.js +43 -73
- package/es/ProForm/utils/getDefaultProps.js +18 -24
- package/es/ProForm/utils/index.js +160 -235
- package/es/ProForm/utils/processDependencies.js +21 -60
- package/es/ProForm/utils/reactiveValues.js +20 -34
- package/es/ProForm/utils/rulesCreator.js +42 -40
- package/es/ProForm/utils/transformNames.js +10 -13
- package/es/ProForm/utils/transformValue.js +16 -29
- package/es/ProForm/utils/valueType.js +96 -178
- package/es/ProIcon/config/index.js +340 -274
- package/es/ProIcon/index.js +135 -209
- package/es/ProIcon/propsTypes.js +0 -1
- package/es/ProIcon/utils/index.js +24 -39
- package/es/ProLayout/components/Layout/Header/index.js +108 -141
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +134 -190
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +113 -139
- package/es/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +0 -1
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +23 -31
- package/es/ProLayout/components/Layout/Menu/index.js +92 -89
- package/es/ProLayout/components/Layout/Notice/index.js +13 -27
- package/es/ProLayout/components/Layout/index.js +8 -3
- package/es/ProLayout/components/ProCollapse/PropTypes.js +0 -1
- package/es/ProLayout/components/ProCollapse/index.js +89 -111
- package/es/ProLayout/components/ProFooter/PropTypes.js +0 -1
- package/es/ProLayout/components/ProFooter/index.js +27 -24
- package/es/ProLayout/components/ProHeader/PropTypes.js +0 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +23 -21
- package/es/ProLayout/components/ProHeader/components/Describe/index.js +67 -84
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +18 -21
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +0 -1
- package/es/ProLayout/components/ProHeader/components/index.js +6 -2
- package/es/ProLayout/components/ProHeader/index.js +216 -356
- package/es/ProLayout/components/ProHeader/utils/index.js +19 -26
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.js +92 -85
- package/es/ProLayout/components/TabsManager/components/TabItem.js +53 -63
- package/es/ProLayout/components/TabsManager/components/TabsContext.js +5 -5
- package/es/ProLayout/components/TabsManager/components/TabsHeader.js +42 -52
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.js +8 -9
- package/es/ProLayout/components/TabsManager/hooks/useIframeRoute.js +19 -32
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +6 -20
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.js +25 -42
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +320 -350
- package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.d.ts +19 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.js +332 -0
- package/es/ProLayout/components/TabsManager/index.js +407 -351
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +4 -0
- package/es/ProLayout/components/TabsManager/propTypes.js +7 -15
- package/es/ProLayout/components/TabsManager/style/index.less +1 -1
- package/es/ProLayout/components/TabsManager/utils/historyObserver.d.ts +7 -0
- package/es/ProLayout/components/TabsManager/utils/historyObserver.js +65 -0
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +15 -2
- package/es/ProLayout/components/TabsManager/utils/index.js +156 -159
- package/es/ProLayout/components/index.js +8 -3
- package/es/ProLayout/index.js +173 -228
- package/es/ProLayout/propTypes.d.ts +28 -1
- package/es/ProLayout/propTypes.js +12 -52
- package/es/ProLayout/utils/index.js +48 -128
- package/es/ProSelect/components/AdaptiveTooltip.js +26 -25
- package/es/ProSelect/index.js +187 -223
- package/es/ProSelect/propsType.js +0 -1
- package/es/ProSelect/style/index.less +13 -0
- package/es/ProSelect/utils/index.js +100 -146
- package/es/ProStep/components/Anchor/index.js +71 -82
- package/es/ProStep/components/Item/index.js +49 -56
- package/es/ProStep/components/LazyLoad/index.js +23 -29
- package/es/ProStep/components/Listener/index.js +20 -33
- package/es/ProStep/components/Step/index.js +31 -38
- package/es/ProStep/constants.js +4 -1
- package/es/ProStep/index.js +166 -153
- package/es/ProStep/propsType.js +0 -1
- package/es/ProStep/style/index.less +1 -1
- package/es/ProStep/utils/index.js +29 -55
- package/es/ProStepTab/index.js +83 -138
- package/es/ProStepTab/propsType.js +0 -1
- package/es/ProTable/components/EditableCell/EditIcon.js +10 -14
- package/es/ProTable/components/EditableCell/index.js +37 -71
- package/es/ProTable/components/EditableCell/propsType.js +0 -1
- package/es/ProTable/components/FormatColumn/index.js +209 -340
- package/es/ProTable/components/FormatColumn/propsType.js +0 -1
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +35 -39
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +80 -107
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +54 -48
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +0 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +47 -54
- package/es/ProTable/components/RcTable/index.js +6 -4
- package/es/ProTable/components/RenderColumn/index.js +158 -186
- package/es/ProTable/components/RenderEmptyText/index.js +12 -21
- package/es/ProTable/components/RenderFooter/index.js +15 -15
- package/es/ProTable/components/RenderSummary/index.js +33 -50
- package/es/ProTable/components/RenderTableHeader/index.js +44 -46
- package/es/ProTable/components/RenderTabs/index.js +47 -51
- package/es/ProTable/components/TableResizable/index.js +56 -72
- package/es/ProTable/components/TooltipTitle/index.js +13 -21
- package/es/ProTable/components/index.js +16 -36
- package/es/ProTable/hooks/useAntdTable.js +191 -224
- package/es/ProTable/index.js +232 -249
- package/es/ProTable/propsType.js +0 -1
- package/es/ProTable/utils/columnStorage.js +63 -88
- package/es/ProTable/utils/index.js +57 -90
- package/es/ProTabs/components/Card/index.js +20 -48
- package/es/ProTabs/components/index.js +4 -1
- package/es/ProTabs/index.js +41 -58
- package/es/ProTabs/propType.js +0 -1
- package/es/ProThemeTools/component/ProTools/index.js +106 -158
- package/es/ProThemeTools/component/index.js +4 -1
- package/es/ProThemeTools/context/ThemeContext.js +67 -146
- package/es/ProThemeTools/index.js +103 -156
- package/es/ProThemeTools/propsType.js +0 -1
- package/es/ProThemeTools/utils/index.js +60 -109
- package/es/ProTooltip/index.js +132 -168
- package/es/ProTooltip/propsType.js +0 -1
- package/es/ProTree/components/AdaptiveTooltip.js +15 -17
- package/es/ProTree/components/CloseIcon.js +18 -26
- package/es/ProTree/components/List.js +28 -47
- package/es/ProTree/components/ProTree.js +152 -211
- package/es/ProTree/components/ProTreeSelect/index.js +255 -459
- package/es/ProTree/components/ProTreeSelect/propsType.js +0 -1
- package/es/ProTree/components/SearchTitle.js +23 -42
- package/es/ProTree/components/Tree.js +147 -195
- package/es/ProTree/components/index.js +10 -5
- package/es/ProTree/index.js +12 -16
- package/es/ProTree/propsType.js +0 -1
- package/es/ProTree/utils.js +46 -118
- package/es/ProTreeModal/components/Cascader.js +56 -64
- package/es/ProTreeModal/components/CloseIcon.js +18 -26
- package/es/ProTreeModal/components/List.js +114 -180
- package/es/ProTreeModal/components/SearchTitle.js +15 -18
- package/es/ProTreeModal/components/SortableItem.js +29 -58
- package/es/ProTreeModal/components/Tree.js +99 -113
- package/es/ProTreeModal/components/Trigger.js +87 -121
- package/es/ProTreeModal/components/index.js +14 -6
- package/es/ProTreeModal/index.js +397 -438
- package/es/ProTreeModal/propsType.js +0 -1
- package/es/ProTreeModal/utils.js +52 -95
- package/es/ProUpload/components/ButtonRender.js +44 -54
- package/es/ProUpload/components/DragRender.js +94 -148
- package/es/ProUpload/components/DraggableUploadListItem.js +12 -25
- package/es/ProUpload/components/Example.js +27 -31
- package/es/ProUpload/components/FileItem.js +69 -163
- package/es/ProUpload/components/ImageRender.js +134 -170
- package/es/ProUpload/index.js +68 -100
- package/es/ProUpload/propsType.js +0 -1
- package/es/ProUpload/uitls.js +8 -4
- package/es/ProUtils/utils/index.js +17 -13
- package/es/ProViewer/index.js +154 -175
- package/es/ProViewer/propsType.js +0 -5
- package/es/ProWaterMark/index.js +9 -16
- package/es/ProWaterMark/propsType.js +0 -1
- package/es/hooks/useDraggableRow.js +25 -53
- package/es/index.js +57 -77
- package/es/locale/en_US.js +153 -142
- package/es/locale/index.js +23 -36
- package/es/locale/zh_CN.js +145 -142
- package/es/tokens.js +84 -83
- package/es/utils/index.js +24 -51
- package/package.json +4 -2
- package/es/ProConfigProvider/demo/locale.js +0 -58
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import isBoolean from "lodash/isBoolean";
|
|
4
|
+
import isFunction from "lodash/isFunction";
|
|
5
|
+
import union from "lodash/union";
|
|
6
|
+
import isString from "lodash/isString";
|
|
6
7
|
import Render from "./Render";
|
|
7
8
|
import { getDefaultProps } from "../../utils/getDefaultProps";
|
|
8
9
|
import * as componentMap from "../index";
|
|
@@ -10,8 +11,7 @@ import { isSelect } from "../../utils";
|
|
|
10
11
|
import { FieldProvider } from "../../hooks/useFieldProps";
|
|
11
12
|
import locale from "../../../locale";
|
|
12
13
|
import processDependencies from "../../utils/processDependencies";
|
|
13
|
-
|
|
14
|
-
const RenderFields = props => {
|
|
14
|
+
const RenderFields = (props) => {
|
|
15
15
|
const {
|
|
16
16
|
isView,
|
|
17
17
|
columns = [],
|
|
@@ -20,7 +20,7 @@ const RenderFields = props => {
|
|
|
20
20
|
form,
|
|
21
21
|
expand,
|
|
22
22
|
colProps: defaultColProps,
|
|
23
|
-
viewEmpty =
|
|
23
|
+
viewEmpty = "-",
|
|
24
24
|
openState,
|
|
25
25
|
labelWidth,
|
|
26
26
|
clearNotShow: outerClearNotShow,
|
|
@@ -30,20 +30,18 @@ const RenderFields = props => {
|
|
|
30
30
|
globalControl,
|
|
31
31
|
shouldUpdateDebounce
|
|
32
32
|
} = props;
|
|
33
|
-
|
|
34
|
-
// 根据 hiddenNames 生成隐藏字段供表单收集(不可变:不修改入参 columns,避免稳定引用下跨渲染累积)
|
|
35
|
-
const hiddenColumns = columns.filter(item => Array.isArray(item.hiddenNames)).flatMap(item => item.hiddenNames).map(nameItem => ({
|
|
33
|
+
const hiddenColumns = columns.filter((item) => Array.isArray(item.hiddenNames)).flatMap((item) => item.hiddenNames).map((nameItem) => ({
|
|
36
34
|
name: Array.isArray(nameItem) ? nameItem : `${nameItem}`,
|
|
37
35
|
hidden: true
|
|
38
36
|
}));
|
|
39
37
|
const renderColumns = hiddenColumns.length ? [...columns, ...hiddenColumns] : columns;
|
|
40
38
|
const comList = renderColumns.flatMap((column, index) => {
|
|
39
|
+
var _a;
|
|
41
40
|
if (!!expand && !openState) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
if (typeof expand === "number") {
|
|
42
|
+
if (index >= expand && column.fixed !== true)
|
|
43
|
+
return [];
|
|
45
44
|
} else if (column.fixed !== true) {
|
|
46
|
-
// 否则只过滤非fixed的column
|
|
47
45
|
return [];
|
|
48
46
|
}
|
|
49
47
|
}
|
|
@@ -65,15 +63,10 @@ const RenderFields = props => {
|
|
|
65
63
|
span,
|
|
66
64
|
...otherFormItemProps
|
|
67
65
|
} = column;
|
|
68
|
-
const {
|
|
69
|
-
|
|
70
|
-
} = column;
|
|
71
|
-
const _isView = typeof column.isView === 'boolean' ? column.isView : isView;
|
|
66
|
+
const { component } = column;
|
|
67
|
+
const _isView = typeof column.isView === "boolean" ? column.isView : isView;
|
|
72
68
|
const defaultProps = getDefaultProps(column);
|
|
73
|
-
// 处理dependencies,支持namesPaths格式
|
|
74
69
|
const processedDeps = processDependencies(column.dependencies);
|
|
75
|
-
|
|
76
|
-
// formItem 的属性平铺在 column 最外层
|
|
77
70
|
const _formItemProps = {
|
|
78
71
|
...defaultProps,
|
|
79
72
|
...otherFormItemProps,
|
|
@@ -81,74 +74,54 @@ const RenderFields = props => {
|
|
|
81
74
|
clearNotShow,
|
|
82
75
|
dependencies: processedDeps
|
|
83
76
|
};
|
|
84
|
-
_formItemProps.labelWidth = _formItemProps.labelWidth || labelWidth;
|
|
85
|
-
|
|
77
|
+
_formItemProps.labelWidth = _formItemProps.labelWidth || labelWidth;
|
|
86
78
|
if (type && component) {
|
|
87
|
-
console.error(
|
|
79
|
+
console.error(
|
|
80
|
+
"Warning: type and component are mutually exclusive. type will not take effect"
|
|
81
|
+
);
|
|
88
82
|
}
|
|
89
|
-
let _type = type ||
|
|
83
|
+
let _type = type || "Input";
|
|
90
84
|
let TargetComponent;
|
|
91
|
-
|
|
92
|
-
// 查看高阶函数
|
|
93
85
|
const viewRenderHandle = () => {
|
|
86
|
+
var _a2;
|
|
94
87
|
let value = form.getFieldValue(column.name);
|
|
95
88
|
let record = form.getFieldsValue();
|
|
96
|
-
let
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
value = form.getFieldValue(_union(column.namePath, column?.name || []));
|
|
89
|
+
let index2;
|
|
90
|
+
if (Array.isArray(column == null ? void 0 : column.namePath) && ((_a2 = column == null ? void 0 : column.namePath) == null ? void 0 : _a2.length)) {
|
|
91
|
+
value = form.getFieldValue(union(column.namePath, (column == null ? void 0 : column.name) || []));
|
|
100
92
|
record = form.getFieldValue(column.namePath);
|
|
101
|
-
|
|
93
|
+
index2 = column == null ? void 0 : column.index;
|
|
102
94
|
}
|
|
103
|
-
return viewRender ? viewRender(value, record, {
|
|
104
|
-
form,
|
|
105
|
-
index,
|
|
106
|
-
namePath: column?.namePath
|
|
107
|
-
}) || null : null;
|
|
95
|
+
return viewRender ? viewRender(value, record, { form, index: index2, namePath: column == null ? void 0 : column.namePath }) || null : null;
|
|
108
96
|
};
|
|
109
|
-
if (typeof _type ===
|
|
97
|
+
if (typeof _type === "string") {
|
|
110
98
|
TargetComponent = _isView && viewRender ? viewRenderHandle : componentMap[_type];
|
|
111
99
|
}
|
|
112
|
-
|
|
113
|
-
if ('component' in column) {
|
|
100
|
+
if ("component" in column) {
|
|
114
101
|
_type = null;
|
|
115
102
|
}
|
|
116
|
-
if (component &&
|
|
103
|
+
if (component && React.isValidElement(component)) {
|
|
117
104
|
const newComponent = component;
|
|
118
|
-
const isProEditTable = newComponent
|
|
119
|
-
TargetComponent = _isView ? viewRenderHandle ||
|
|
120
|
-
// 可编辑表格内部支持
|
|
105
|
+
const isProEditTable = ((_a = newComponent == null ? void 0 : newComponent.props) == null ? void 0 : _a.onlyOneLineMsg) != null;
|
|
106
|
+
TargetComponent = _isView ? viewRenderHandle || "" : component;
|
|
121
107
|
if (isProEditTable) {
|
|
122
108
|
TargetComponent = _isView ? viewRenderHandle || component : component;
|
|
123
109
|
}
|
|
124
110
|
}
|
|
125
|
-
const {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
} = formItemChildProps;
|
|
130
|
-
const {
|
|
131
|
-
label: formLabel
|
|
132
|
-
} = _formItemProps;
|
|
133
|
-
const comDisabled = _formItemProps?.disabled ?? fieldProps.disabled; // 组件属性层disabled fieldProps可能为函数
|
|
134
|
-
|
|
135
|
-
// 当前组件是不是一个选择组件
|
|
136
|
-
const _isSelect = isSelect({
|
|
137
|
-
dataSource,
|
|
138
|
-
type: _type
|
|
139
|
-
});
|
|
111
|
+
const { label, placeholder, dataSource } = formItemChildProps;
|
|
112
|
+
const { label: formLabel } = _formItemProps;
|
|
113
|
+
const comDisabled = (_formItemProps == null ? void 0 : _formItemProps.disabled) ?? fieldProps.disabled;
|
|
114
|
+
const _isSelect = isSelect({ dataSource, type: _type });
|
|
140
115
|
const placeholderHandle = () => {
|
|
141
|
-
const _label =
|
|
142
|
-
const _formLabel =
|
|
143
|
-
return placeholder || `${_isSelect ? `${locale.ProForm.selectPlaceHolder}` : `${locale.ProForm.inputPlaceholder}`}${_label || _formLabel ||
|
|
116
|
+
const _label = isString(label) ? label : "";
|
|
117
|
+
const _formLabel = isString(formLabel) ? formLabel : "";
|
|
118
|
+
return placeholder || `${_isSelect ? `${locale.ProForm.selectPlaceHolder}` : `${locale.ProForm.inputPlaceholder}`}${_label || _formLabel || ""}`;
|
|
144
119
|
};
|
|
145
|
-
|
|
146
|
-
// 表单组件Props 兼容2.0版本
|
|
147
120
|
const _fieldProps = {
|
|
148
121
|
...formItemChildProps,
|
|
149
122
|
...fieldProps
|
|
150
123
|
};
|
|
151
|
-
if (
|
|
124
|
+
if (isBoolean(formDisabled)) {
|
|
152
125
|
_fieldProps.disabled = formDisabled;
|
|
153
126
|
}
|
|
154
127
|
const componentProps = {
|
|
@@ -156,38 +129,23 @@ const RenderFields = props => {
|
|
|
156
129
|
..._fieldProps,
|
|
157
130
|
disabled: comDisabled
|
|
158
131
|
};
|
|
159
|
-
|
|
160
|
-
// 容器组件,额外处理show的问题
|
|
161
|
-
if (['ProCollapse', 'Container'].includes(_type)) {
|
|
132
|
+
if (["ProCollapse", "Container"].includes(_type)) {
|
|
162
133
|
componentProps.show = show;
|
|
163
134
|
componentProps.clearNotShow = clearNotShow;
|
|
164
135
|
componentProps.diffConfig = diffConfig;
|
|
165
136
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
if (['Switch', 'SwitchCheckbox'].includes(_type)) {
|
|
169
|
-
_formItemProps.valuePropName = 'checked';
|
|
137
|
+
if (["Switch", "SwitchCheckbox"].includes(_type)) {
|
|
138
|
+
_formItemProps.valuePropName = "checked";
|
|
170
139
|
}
|
|
171
|
-
|
|
172
|
-
// 时间范围placeholder处理
|
|
173
|
-
if (['RangePicker'].includes(_type) && !fieldProps?.placeholder) {
|
|
140
|
+
if (["RangePicker"].includes(_type) && !(fieldProps == null ? void 0 : fieldProps.placeholder)) {
|
|
174
141
|
delete componentProps.placeholder;
|
|
175
142
|
}
|
|
176
|
-
|
|
177
|
-
// 没有找到对应组件 不渲染
|
|
178
143
|
if (!TargetComponent) {
|
|
179
144
|
return [];
|
|
180
145
|
}
|
|
181
|
-
const _colProps = span ? {
|
|
182
|
-
span
|
|
183
|
-
} : {
|
|
184
|
-
...defaultColProps,
|
|
185
|
-
...colProps
|
|
186
|
-
};
|
|
146
|
+
const _colProps = span ? { span } : { ...defaultColProps, ...colProps };
|
|
187
147
|
const columnName = _formItemProps.name;
|
|
188
|
-
const fieldKey = (Array.isArray(columnName) ? columnName.join(
|
|
189
|
-
|
|
190
|
-
// 其余参数收进对象里传给子组件 componentProps只包含子组件参数
|
|
148
|
+
const fieldKey = (Array.isArray(columnName) ? columnName.join(".") : columnName) ?? _formItemProps.label ?? _type;
|
|
191
149
|
const otherProps = {
|
|
192
150
|
label: _formItemProps.label,
|
|
193
151
|
name: _formItemProps.name,
|
|
@@ -209,31 +167,36 @@ const RenderFields = props => {
|
|
|
209
167
|
diffConfig,
|
|
210
168
|
shouldUpdateDebounce
|
|
211
169
|
};
|
|
212
|
-
return
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
170
|
+
return /* @__PURE__ */ jsx(
|
|
171
|
+
FieldProvider,
|
|
172
|
+
{
|
|
173
|
+
value: otherProps,
|
|
174
|
+
children: /* @__PURE__ */ jsx(
|
|
175
|
+
Render,
|
|
176
|
+
{
|
|
177
|
+
show,
|
|
178
|
+
disabled: column.disabled,
|
|
179
|
+
originComponent: component,
|
|
180
|
+
component: TargetComponent,
|
|
181
|
+
formItemProps: _formItemProps,
|
|
182
|
+
confirm,
|
|
183
|
+
componentProps,
|
|
184
|
+
otherProps,
|
|
185
|
+
fieldProps: isFunction(fieldProps) ? fieldProps : null,
|
|
186
|
+
isSelect: _isSelect,
|
|
187
|
+
onDiff,
|
|
188
|
+
requiredOnView,
|
|
189
|
+
viewRender,
|
|
190
|
+
desensitization
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
},
|
|
194
|
+
fieldKey != null && fieldKey !== "" ? String(fieldKey) : `column-${index}`
|
|
195
|
+
);
|
|
237
196
|
});
|
|
197
|
+
return /* @__PURE__ */ jsx(Fragment, { children: comList });
|
|
198
|
+
};
|
|
199
|
+
var RenderFields_default = RenderFields;
|
|
200
|
+
export {
|
|
201
|
+
RenderFields_default as default
|
|
238
202
|
};
|
|
239
|
-
export default RenderFields;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { useState } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const useControlled = props => {
|
|
5
|
-
const {
|
|
6
|
-
value,
|
|
7
|
-
onChange
|
|
8
|
-
} = props;
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
const useControlled = (props) => {
|
|
3
|
+
const { value, onChange } = props;
|
|
9
4
|
const [state, setState] = useState(value || false);
|
|
10
|
-
if (value !==
|
|
5
|
+
if (value !== void 0) {
|
|
11
6
|
return [value, onChange];
|
|
12
7
|
}
|
|
13
8
|
return [state, setState];
|
|
14
|
-
};
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
useControlled
|
|
12
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
import isEqualWith from "lodash/isEqualWith";
|
|
3
3
|
import { customEqualForFunction } from "../../utils";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const lastRes = useRef({}); // 上一次的结果
|
|
9
|
-
|
|
10
|
-
if (!_isEqualWith(depList, lastDependency?.current, customEqualForFunction)) {
|
|
4
|
+
const useDeepCompareMemo = (fun, changedCb, depList) => {
|
|
5
|
+
const lastDependency = useRef({});
|
|
6
|
+
const lastRes = useRef({});
|
|
7
|
+
if (!isEqualWith(depList, lastDependency == null ? void 0 : lastDependency.current, customEqualForFunction)) {
|
|
11
8
|
const res = fun();
|
|
12
|
-
changedCb
|
|
9
|
+
changedCb == null ? void 0 : changedCb(lastRes.current, res);
|
|
13
10
|
lastRes.current = res;
|
|
14
11
|
}
|
|
15
12
|
lastDependency.current = depList;
|
|
16
13
|
return lastRes.current;
|
|
17
|
-
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
useDeepCompareMemo
|
|
17
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import React, { useContext } from
|
|
2
|
-
const FieldContext =
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
const FieldContext = React.createContext({});
|
|
3
|
+
const FieldProvider = FieldContext.Provider;
|
|
4
|
+
const useFieldProps = () => useContext(FieldContext);
|
|
5
|
+
export {
|
|
6
|
+
FieldProvider,
|
|
7
|
+
useFieldProps
|
|
8
|
+
};
|
|
@@ -1,48 +1,30 @@
|
|
|
1
|
-
import { Form } from
|
|
2
|
-
import { useContext } from
|
|
1
|
+
import { Form } from "antd";
|
|
2
|
+
import { useContext } from "react";
|
|
3
3
|
import { filterInternalFields, getFormFieldPaths, mergeNames, isListForm } from "../utils";
|
|
4
4
|
import { handleScrollToError as handleScrollToErrorProEditTable } from "../../ProEditTable/utils/tools";
|
|
5
5
|
import { FormsContext } from "../../FormsProvider";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const {
|
|
14
|
-
scrollToError = true,
|
|
15
|
-
optimize,
|
|
16
|
-
formKey,
|
|
17
|
-
source
|
|
18
|
-
} = _options || {};
|
|
19
|
-
|
|
20
|
-
// formKey全局共享逻辑
|
|
6
|
+
const useForm = function(originForm, options) {
|
|
7
|
+
const _originForm = (originForm == null ? void 0 : originForm._init) ? originForm : void 0;
|
|
8
|
+
const _options = (
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
options || (originForm && !(originForm == null ? void 0 : originForm._init) ? originForm : void 0)
|
|
11
|
+
);
|
|
12
|
+
const { scrollToError = true, optimize, formKey, source } = _options || {};
|
|
21
13
|
const forms = useContext(FormsContext);
|
|
22
14
|
const [localForm] = Form.useForm(_originForm);
|
|
23
|
-
// 同步注册共享实例,确保同一渲染流程中相同 formKey 复用同一个实例
|
|
24
15
|
if (formKey && !forms[formKey]) {
|
|
25
16
|
forms[formKey] = localForm;
|
|
26
17
|
localForm.formKey = formKey;
|
|
27
18
|
}
|
|
28
|
-
const sharedForm = formKey ? forms[formKey] :
|
|
19
|
+
const sharedForm = formKey ? forms[formKey] : void 0;
|
|
29
20
|
const form = sharedForm || localForm;
|
|
30
21
|
if (formKey && form.formKey !== formKey) {
|
|
31
22
|
form.formKey = formKey;
|
|
32
23
|
}
|
|
33
|
-
const {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
isModified,
|
|
37
|
-
setFields,
|
|
38
|
-
getFieldsError,
|
|
39
|
-
setFieldsValue
|
|
40
|
-
} = form;
|
|
41
|
-
if (isModified) return [form];
|
|
42
|
-
|
|
43
|
-
// @ts-ignore
|
|
24
|
+
const { getFieldsValue, validateFields, isModified, setFields, getFieldsError, setFieldsValue } = form;
|
|
25
|
+
if (isModified)
|
|
26
|
+
return [form];
|
|
44
27
|
const nextGetFieldsValue = (nameList, filterFunc) => {
|
|
45
|
-
// 全部查询
|
|
46
28
|
if (nameList !== true) {
|
|
47
29
|
const values = getFieldsValue(nameList || true, filterFunc);
|
|
48
30
|
return filterInternalFields(values, optimize);
|
|
@@ -50,69 +32,43 @@ export const useForm = function (originForm, options) {
|
|
|
50
32
|
return getFieldsValue(nameList, filterFunc);
|
|
51
33
|
};
|
|
52
34
|
const nextValidateFields = async (nameList, ...rest) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const skipScrollOnError = !!rest?.[0]?.__skipScrollOnError;
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
const restForNative = rest?.[0] ? [(({
|
|
59
|
-
__skipScrollOnError,
|
|
60
|
-
...opts
|
|
61
|
-
}) => opts)(rest[0]), ...rest.slice(1)] : rest;
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
36
|
+
const skipScrollOnError = !!((_a = rest == null ? void 0 : rest[0]) == null ? void 0 : _a.__skipScrollOnError);
|
|
37
|
+
const restForNative = (rest == null ? void 0 : rest[0]) ? [(({ __skipScrollOnError, ...opts }) => opts)(rest[0]), ...rest.slice(1)] : rest;
|
|
62
38
|
try {
|
|
63
|
-
const isRecursive = rest
|
|
64
|
-
const stopOnFirstError = form
|
|
65
|
-
|
|
66
|
-
// 如果启用了 stopOnFirstError 且没有指定字段列表
|
|
39
|
+
const isRecursive = (_b = rest == null ? void 0 : rest[0]) == null ? void 0 : _b.recursive;
|
|
40
|
+
const stopOnFirstError = (_c = form == null ? void 0 : form.__INTERNAL_CONFIG__) == null ? void 0 : _c.stopOnFirstError;
|
|
67
41
|
if (stopOnFirstError && !nameList) {
|
|
68
|
-
// 获取所有表单字段
|
|
69
42
|
const allFields = getFormFieldPaths(form);
|
|
70
|
-
// 单独验证每个字段
|
|
71
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
72
43
|
for (const field of allFields) {
|
|
73
44
|
try {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
} : {};
|
|
79
|
-
delete options.stopOnFirstError;
|
|
80
|
-
delete options.__skipScrollOnError;
|
|
81
|
-
// 验证单个字段
|
|
82
|
-
// eslint-disable-next-line no-await-in-loop
|
|
83
|
-
await validateFields([field], options);
|
|
45
|
+
const options2 = (rest == null ? void 0 : rest[0]) ? { ...rest[0] } : {};
|
|
46
|
+
delete options2.stopOnFirstError;
|
|
47
|
+
delete options2.__skipScrollOnError;
|
|
48
|
+
await validateFields([field], options2);
|
|
84
49
|
} catch (error) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
behavior: 'smooth'
|
|
50
|
+
if (!skipScrollOnError && scrollToError && ((_d = error == null ? void 0 : error.errorFields) == null ? void 0 : _d.length)) {
|
|
51
|
+
form.scrollToField((_e = error.errorFields[0]) == null ? void 0 : _e.name, {
|
|
52
|
+
block: "center",
|
|
53
|
+
behavior: "smooth"
|
|
90
54
|
});
|
|
91
55
|
}
|
|
92
|
-
// 中止验证,抛出错误
|
|
93
56
|
throw error;
|
|
94
57
|
}
|
|
95
58
|
}
|
|
96
|
-
// 全部验证通过,返回表单值
|
|
97
59
|
return form.getFieldsValue();
|
|
98
60
|
}
|
|
99
61
|
let validateNames = [];
|
|
100
|
-
// 前缀校验模式
|
|
101
62
|
if (isRecursive) {
|
|
102
|
-
|
|
103
|
-
const {
|
|
104
|
-
getFields
|
|
105
|
-
} = form.getInternalHooks('RC_FORM_INTERNAL_HOOKS');
|
|
63
|
+
const { getFields } = form.getInternalHooks("RC_FORM_INTERNAL_HOOKS");
|
|
106
64
|
const fieldsList = getFields();
|
|
107
|
-
|
|
108
|
-
// formList& proEditTable 特殊处理
|
|
109
65
|
if (Array.isArray(nameList) && isListForm(String(nameList))) {
|
|
110
|
-
const fieldsNames = fieldsList.map(item => item.name);
|
|
66
|
+
const fieldsNames = fieldsList.map((item) => item.name);
|
|
111
67
|
validateNames = mergeNames(nameList, fieldsNames);
|
|
112
68
|
} else {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if (nameList[0] === item.name
|
|
69
|
+
fieldsList.forEach((item) => {
|
|
70
|
+
var _a2, _b2, _c2;
|
|
71
|
+
if (nameList[0] === ((_a2 = item.name) == null ? void 0 : _a2[0]) || ((_c2 = (_b2 = item.name) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.startsWith(`${nameList[0]}_`))) {
|
|
116
72
|
validateNames.push(item.name);
|
|
117
73
|
}
|
|
118
74
|
});
|
|
@@ -120,30 +76,25 @@ export const useForm = function (originForm, options) {
|
|
|
120
76
|
if (Array.isArray(nameList) && nameList.length && !validateNames.length) {
|
|
121
77
|
validateNames = [...nameList];
|
|
122
78
|
}
|
|
123
|
-
|
|
124
|
-
// @ts-ignore
|
|
125
|
-
return await validateFields(validateNames, ...restForNative).then(values => {
|
|
79
|
+
return await validateFields(validateNames, ...restForNative).then((values) => {
|
|
126
80
|
return filterInternalFields(values, optimize);
|
|
127
81
|
});
|
|
128
82
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (nameList?.length && !nameList.join('-').includes(',')) {
|
|
132
|
-
const tablePagination = document && document?.querySelector(`#pro-edit-table-pagination-${nameList.join('-')}`);
|
|
83
|
+
if ((nameList == null ? void 0 : nameList.length) && !nameList.join("-").includes(",")) {
|
|
84
|
+
const tablePagination = document && (document == null ? void 0 : document.querySelector(`#pro-edit-table-pagination-${nameList.join("-")}`));
|
|
133
85
|
if (tablePagination) {
|
|
134
|
-
tablePagination
|
|
86
|
+
(_f = tablePagination == null ? void 0 : tablePagination.click) == null ? void 0 : _f.call(tablePagination);
|
|
135
87
|
}
|
|
136
88
|
}
|
|
137
|
-
return await validateFields(nameList, ...restForNative).then(values => {
|
|
89
|
+
return await validateFields(nameList, ...restForNative).then((values) => {
|
|
138
90
|
return nameList ? values : nextGetFieldsValue();
|
|
139
91
|
});
|
|
140
92
|
} catch (error) {
|
|
141
|
-
// skipScrollOnError(行内联动等被动校验)时不滚动,仅抛出错误
|
|
142
93
|
if (!skipScrollOnError) {
|
|
143
|
-
if (scrollToError && error
|
|
144
|
-
form.scrollToField(error.errorFields[0]
|
|
145
|
-
block:
|
|
146
|
-
behavior:
|
|
94
|
+
if (scrollToError && ((_g = error == null ? void 0 : error.errorFields) == null ? void 0 : _g.length) && source === "ProForm") {
|
|
95
|
+
form.scrollToField((_h = error.errorFields[0]) == null ? void 0 : _h.name, {
|
|
96
|
+
block: "center",
|
|
97
|
+
behavior: "smooth"
|
|
147
98
|
});
|
|
148
99
|
}
|
|
149
100
|
handleScrollToErrorProEditTable();
|
|
@@ -153,21 +104,12 @@ export const useForm = function (originForm, options) {
|
|
|
153
104
|
};
|
|
154
105
|
const nextSetFieldValue = (name, value, info) => {
|
|
155
106
|
if (info) {
|
|
156
|
-
setFields([{
|
|
157
|
-
name,
|
|
158
|
-
value,
|
|
159
|
-
...info
|
|
160
|
-
}]);
|
|
107
|
+
setFields([{ name, value, ...info }]);
|
|
161
108
|
} else {
|
|
162
|
-
setFields([{
|
|
163
|
-
name,
|
|
164
|
-
value,
|
|
165
|
-
errors: [],
|
|
166
|
-
warnings: []
|
|
167
|
-
}]);
|
|
109
|
+
setFields([{ name, value, errors: [], warnings: [] }]);
|
|
168
110
|
}
|
|
169
111
|
};
|
|
170
|
-
const nextSetFieldsValue = values => {
|
|
112
|
+
const nextSetFieldsValue = (values) => {
|
|
171
113
|
const errors = getFieldsError();
|
|
172
114
|
const errorNames = errors.reduce((acc, entry) => {
|
|
173
115
|
if (entry.errors.length > 0) {
|
|
@@ -176,14 +118,9 @@ export const useForm = function (originForm, options) {
|
|
|
176
118
|
return acc;
|
|
177
119
|
}, []) || [];
|
|
178
120
|
if (errorNames.length) {
|
|
179
|
-
errorNames.forEach(errorName => {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
setFields([{
|
|
183
|
-
name: errorName,
|
|
184
|
-
errors: [],
|
|
185
|
-
warnings: []
|
|
186
|
-
}]);
|
|
121
|
+
errorNames.forEach((errorName) => {
|
|
122
|
+
if (errorName.includes("-")) {
|
|
123
|
+
setFields([{ name: errorName, errors: [], warnings: [] }]);
|
|
187
124
|
}
|
|
188
125
|
});
|
|
189
126
|
setFieldsValue(values);
|
|
@@ -198,4 +135,7 @@ export const useForm = function (originForm, options) {
|
|
|
198
135
|
form.isModified = true;
|
|
199
136
|
form.__INTERNAL_CONFIG__ = {};
|
|
200
137
|
return [form];
|
|
201
|
-
};
|
|
138
|
+
};
|
|
139
|
+
export {
|
|
140
|
+
useForm
|
|
141
|
+
};
|