@zat-design/sisyphus-react 3.9.2-beta.7 → 3.9.2-beta.9
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/.vscode/extensions.json +5 -0
- package/es/ProAction/index.js +5 -5
- package/es/ProConfigProvider/index.js +3 -3
- package/es/ProDownload/index.d.ts +1 -1
- package/es/ProDownload/index.js +3 -3
- package/es/ProDownload/utils.js +3 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/es/ProDrawerForm/components/ProModal/index.js +3 -3
- package/es/ProEditLabel/index.js +3 -3
- package/es/ProEditTable/components/ActionButton/index.d.ts +1 -1
- package/es/ProEditTable/components/ActionButton/index.js +3 -3
- package/es/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +5 -5
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/es/ProEditTable/components/Summary/index.d.ts +1 -1
- package/es/ProEditTable/index.js +7 -3
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/config.js +2 -2
- package/es/ProEditTable/utils/index.js +5 -5
- package/es/ProEditTable/utils/tools.js +4 -4
- package/es/ProEnum/components/Group.d.ts +1 -1
- package/es/ProEnum/components/Tag.d.ts +1 -1
- package/es/ProEnum/hooks/useEnumRequest.js +2 -2
- package/es/ProEnum/index.d.ts +2 -2
- package/es/ProEnum/index.js +1 -1
- package/es/ProEnum/utils/eventCenter.js +1 -2
- package/es/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/es/ProForm/components/base/Input/index.d.ts +1 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +11 -8
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/LineFields.js +2 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +7 -4
- package/es/ProForm/components/combination/FormList/index.js +1 -1
- package/es/ProForm/components/combination/FormList/utils.js +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +15 -11
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +2 -0
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/es/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +1 -2
- package/es/ProForm/components/old/ProAddress/index.js +1 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +1 -2
- package/es/ProForm/components/render/ChangedWrapper.js +6 -4
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +14 -10
- package/es/ProForm/index.js +12 -9
- package/es/ProForm/utils/index.js +14 -10
- package/es/ProForm/utils/useForm.js +1 -1
- package/es/ProIcon/index.js +39 -22
- package/es/ProIcon/propsTypes.d.ts +2 -0
- package/es/ProIcon/utils/index.js +4 -3
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/es/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/es/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/es/ProLayout/index.d.ts +4 -4
- package/es/ProLayout/utils/index.js +9 -9
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProSelect/index.d.ts +1 -1
- package/es/ProStep/components/Anchor/index.d.ts +1 -1
- package/es/ProStep/components/Item/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +1 -1
- package/es/ProStep/components/Step/index.d.ts +1 -1
- package/es/ProStep/index.d.ts +2 -2
- package/es/ProStep/index.js +3 -3
- package/es/ProTable/components/FormatColumn/index.js +3 -3
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +9 -8
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/es/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/es/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/es/ProTable/components/TableResizable/index.d.ts +1 -1
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +2 -2
- package/es/ProTabs/components/Card/index.d.ts +1 -1
- package/es/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/es/ProThemeTools/index.d.ts +1 -1
- package/es/ProTooltip/index.d.ts +1 -1
- package/es/ProTree/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProTree/components/CloseIcon.d.ts +1 -2
- package/es/ProTree/components/List.d.ts +1 -1
- package/es/ProTree/components/ProTree.d.ts +1 -1
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +20 -20
- package/es/ProTree/components/SearchTitle.d.ts +1 -1
- package/es/ProTree/components/Tree.d.ts +1 -1
- package/es/ProTree/components/Tree.js +4 -4
- package/es/ProTree/index.d.ts +1 -1
- package/es/ProTree/utils.js +12 -11
- package/es/ProTreeModal/components/Cascader.d.ts +1 -1
- package/es/ProTreeModal/components/CloseIcon.d.ts +1 -2
- package/es/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/es/ProTreeModal/components/Tree.js +6 -6
- package/es/ProTreeModal/components/Trigger.d.ts +1 -1
- package/es/ProTreeModal/index.d.ts +1 -1
- package/es/ProTreeModal/index.js +3 -3
- package/es/ProTreeModal/utils.js +16 -14
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/es/ProUpload/components/ImageRender.js +1 -1
- package/es/ProViewer/index.js +2 -2
- package/es/old/ProEditableTable/index.js +4 -4
- package/lib/ProAction/index.js +5 -5
- package/lib/ProConfigProvider/index.js +2 -2
- package/lib/ProDownload/index.d.ts +1 -1
- package/lib/ProDownload/index.js +3 -3
- package/lib/ProDownload/utils.js +3 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/lib/ProDrawerForm/components/ProModal/index.js +3 -3
- package/lib/ProEditLabel/index.js +3 -3
- package/lib/ProEditTable/components/ActionButton/index.d.ts +1 -1
- package/lib/ProEditTable/components/ActionButton/index.js +3 -3
- package/lib/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +5 -5
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/lib/ProEditTable/components/Summary/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +6 -2
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/config.js +2 -2
- package/lib/ProEditTable/utils/index.js +5 -5
- package/lib/ProEditTable/utils/tools.js +4 -4
- package/lib/ProEnum/components/Group.d.ts +1 -1
- package/lib/ProEnum/components/Tag.d.ts +1 -1
- package/lib/ProEnum/hooks/useEnumRequest.js +2 -2
- package/lib/ProEnum/index.d.ts +2 -2
- package/lib/ProEnum/index.js +1 -1
- package/lib/ProEnum/utils/eventCenter.js +1 -2
- package/lib/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/lib/ProForm/components/base/Input/index.d.ts +1 -1
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +10 -7
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +2 -1
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +5 -3
- package/lib/ProForm/components/combination/FormList/index.js +1 -1
- package/lib/ProForm/components/combination/FormList/utils.js +1 -1
- package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +15 -11
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +2 -0
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/lib/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/lib/ProForm/components/old/ProAddress/index.d.ts +1 -2
- package/lib/ProForm/components/old/ProAddress/index.js +1 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +1 -2
- package/lib/ProForm/components/render/ChangedWrapper.js +6 -4
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +14 -10
- package/lib/ProForm/index.js +11 -8
- package/lib/ProForm/utils/index.js +10 -10
- package/lib/ProForm/utils/useForm.js +1 -1
- package/lib/ProIcon/index.js +37 -22
- package/lib/ProIcon/propsTypes.d.ts +2 -0
- package/lib/ProIcon/utils/index.js +3 -3
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/lib/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/lib/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/lib/ProLayout/index.d.ts +4 -4
- package/lib/ProLayout/utils/index.js +9 -9
- package/lib/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProSelect/index.d.ts +1 -1
- package/lib/ProStep/components/Anchor/index.d.ts +1 -1
- package/lib/ProStep/components/Item/index.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.js +1 -1
- package/lib/ProStep/components/Step/index.d.ts +1 -1
- package/lib/ProStep/index.d.ts +2 -2
- package/lib/ProStep/index.js +3 -3
- package/lib/ProTable/components/FormatColumn/index.js +3 -3
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/lib/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/lib/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/lib/ProTable/components/TableResizable/index.d.ts +1 -1
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +2 -2
- package/lib/ProTabs/components/Card/index.d.ts +1 -1
- package/lib/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/lib/ProThemeTools/index.d.ts +1 -1
- package/lib/ProTooltip/index.d.ts +1 -1
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProTree/components/CloseIcon.d.ts +1 -2
- package/lib/ProTree/components/List.d.ts +1 -1
- package/lib/ProTree/components/ProTree.d.ts +1 -1
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +20 -20
- package/lib/ProTree/components/SearchTitle.d.ts +1 -1
- package/lib/ProTree/components/Tree.d.ts +1 -1
- package/lib/ProTree/components/Tree.js +4 -4
- package/lib/ProTree/index.d.ts +1 -1
- package/lib/ProTree/utils.js +11 -11
- package/lib/ProTreeModal/components/Cascader.d.ts +1 -1
- package/lib/ProTreeModal/components/CloseIcon.d.ts +1 -2
- package/lib/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/lib/ProTreeModal/components/Tree.js +6 -6
- package/lib/ProTreeModal/components/Trigger.d.ts +1 -1
- package/lib/ProTreeModal/index.d.ts +1 -1
- package/lib/ProTreeModal/index.js +3 -3
- package/lib/ProTreeModal/utils.js +13 -13
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/lib/ProUpload/components/ImageRender.js +1 -1
- package/lib/ProViewer/index.js +2 -2
- package/lib/old/ProEditableTable/index.js +4 -4
- package/package.json +1 -1
@@ -13,11 +13,12 @@ var _excluded = ["label", "onClick", "onHandle", "type", "needConfirm", "confirm
|
|
13
13
|
_excluded2 = ["onClick", "label"];
|
14
14
|
import { createElement as _createElement } from "react";
|
15
15
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
16
|
-
import { isFunction } from 'lodash';
|
16
|
+
import { isFunction, omit } from 'lodash';
|
17
17
|
import { useMemo } from 'react';
|
18
18
|
import { CopyOutlined, DownSquareOutlined, PlusSquareOutlined, UpSquareOutlined } from '@ant-design/icons';
|
19
19
|
import ProIcon from '../../../../../ProIcon';
|
20
20
|
import locale from '../../../../../locale';
|
21
|
+
var filterKeys = ['actionType'];
|
21
22
|
var getDefaultActions = function getDefaultActions(mode) {
|
22
23
|
var originActions = {
|
23
24
|
add: {
|
@@ -42,9 +43,11 @@ var getDefaultActions = function getDefaultActions(mode) {
|
|
42
43
|
label: "".concat(locale.ProForm.formListActions[1]),
|
43
44
|
icon: mode === 'less' ? _jsx(ProIcon, {
|
44
45
|
type: "solid-close",
|
45
|
-
className: "single-delete"
|
46
|
+
className: "single-delete",
|
47
|
+
buttonIcon: false
|
46
48
|
}) : _jsx(ProIcon, {
|
47
|
-
type: "delete"
|
49
|
+
type: "delete",
|
50
|
+
buttonIcon: false
|
48
51
|
})
|
49
52
|
},
|
50
53
|
copy: {
|
@@ -133,7 +136,7 @@ var ActionButton = function ActionButton(props) {
|
|
133
136
|
return _actionProps;
|
134
137
|
}, [props.actionProps]);
|
135
138
|
var handleClick = /*#__PURE__*/function () {
|
136
|
-
var _ref6 = _asyncToGenerator(
|
139
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(defaultCallback, callback, index, item) {
|
137
140
|
var value, data;
|
138
141
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
139
142
|
while (1) switch (_context.prev = _context.next) {
|
@@ -240,14 +243,14 @@ var ActionButton = function ActionButton(props) {
|
|
240
243
|
handleClick(internalOnClick, _onClick, index, item);
|
241
244
|
}
|
242
245
|
}, _confirmProps), {}, {
|
243
|
-
children: _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, defaultRest), rest), {}, {
|
246
|
+
children: _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, defaultRest), omit(rest, filterKeys)), {}, {
|
244
247
|
type: "text",
|
245
248
|
onClick: function onClick(e) {
|
246
249
|
return e.stopPropagation();
|
247
250
|
},
|
248
251
|
children: label || defaultLabel
|
249
252
|
}))
|
250
|
-
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, defaultRest), rest), {}, {
|
253
|
+
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, defaultRest), omit(rest, filterKeys)), {}, {
|
251
254
|
type: "text",
|
252
255
|
onClick: function onClick(e) {
|
253
256
|
e.stopPropagation();
|
@@ -265,14 +268,14 @@ var ActionButton = function ActionButton(props) {
|
|
265
268
|
return customClick(_onClick, index);
|
266
269
|
}
|
267
270
|
}, _confirmProps), {}, {
|
268
|
-
children: _jsx(_Button, _objectSpread(_objectSpread({}, rest), {}, {
|
271
|
+
children: _jsx(_Button, _objectSpread(_objectSpread({}, omit(rest, filterKeys)), {}, {
|
269
272
|
type: "text",
|
270
273
|
onClick: function onClick(e) {
|
271
274
|
return e.stopPropagation();
|
272
275
|
},
|
273
276
|
children: label
|
274
277
|
}))
|
275
|
-
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (
|
278
|
+
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (/*#__PURE__*/_createElement(_Button, _objectSpread(_objectSpread({}, omit(rest, filterKeys)), {}, {
|
276
279
|
key: "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index),
|
277
280
|
type: "text",
|
278
281
|
onClick: function onClick(e) {
|
@@ -10,8 +10,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
10
10
|
var _excluded = ["label", "onClick", "onHandle", "type"],
|
11
11
|
_excluded2 = ["onClick", "label"];
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
13
|
+
/* eslint-disable react/no-array-index-key */
|
14
|
+
|
13
15
|
import { PlusOutlined } from '@ant-design/icons';
|
14
|
-
import { isFunction } from 'lodash';
|
16
|
+
import { isFunction, omit } from 'lodash';
|
15
17
|
import { useMemo } from 'react';
|
16
18
|
import locale from '../../../../../locale';
|
17
19
|
var actions = {
|
@@ -27,6 +29,7 @@ var actions = {
|
|
27
29
|
var defaultActionProps = [{
|
28
30
|
type: 'add'
|
29
31
|
}];
|
32
|
+
var filterKeys = ['actionType'];
|
30
33
|
var ToolbarButton = function ToolbarButton(props) {
|
31
34
|
var namePath = props.namePath,
|
32
35
|
form = props.form,
|
@@ -55,7 +58,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
55
58
|
return _toolbarProps;
|
56
59
|
}, [props.toolbarProps]);
|
57
60
|
var handleClick = /*#__PURE__*/function () {
|
58
|
-
var _ref2 = _asyncToGenerator(
|
61
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(defaultCallback, callback, item) {
|
59
62
|
var value, data;
|
60
63
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
61
64
|
while (1) switch (_context.prev = _context.next) {
|
@@ -128,7 +131,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
128
131
|
if (max && max <= fields.length && type === 'add') {
|
129
132
|
return false;
|
130
133
|
}
|
131
|
-
return _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, actions[type]), rest), {}, {
|
134
|
+
return _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, actions[type]), omit(rest, filterKeys)), {}, {
|
132
135
|
type: "link",
|
133
136
|
onClick: function onClick() {
|
134
137
|
return handleClick(internalOnClick, _onClick, item);
|
@@ -136,7 +139,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
136
139
|
children: label || defaultLabel
|
137
140
|
}), "".concat(type).concat(index));
|
138
141
|
}
|
139
|
-
return _jsx(_Button, _objectSpread(_objectSpread({}, rest), {}, {
|
142
|
+
return _jsx(_Button, _objectSpread(_objectSpread({}, omit(rest, filterKeys)), {}, {
|
140
143
|
type: "link",
|
141
144
|
onClick: function onClick() {
|
142
145
|
return customClick(_onClick2, item);
|
@@ -95,7 +95,7 @@ var FormList = function FormList(props, ref) {
|
|
95
95
|
}),
|
96
96
|
strategy: verticalListSortingStrategy,
|
97
97
|
children: [_fields.map(function (field, index) {
|
98
|
-
var namePath = [].concat(_toConsumableArray(_namePath), [
|
98
|
+
var namePath = [].concat(_toConsumableArray(_namePath), [field.name]);
|
99
99
|
var _columns = processColumns(index, namePath);
|
100
100
|
return mode === 'block' ? _jsx(BlockFields, _objectSpread(_objectSpread({}, props), {}, {
|
101
101
|
columns: _columns,
|
@@ -23,7 +23,7 @@ export var namesPathTransform = function namesPathTransform(_ref) {
|
|
23
23
|
// 比较memo
|
24
24
|
export var memoWith = function memoWith(pre, next) {
|
25
25
|
return isEqualWith(pre, next, function (objValue, othValue) {
|
26
|
-
if (
|
26
|
+
if (/*#__PURE__*/React.isValidElement(objValue) && /*#__PURE__*/React.isValidElement(othValue)) {
|
27
27
|
return true;
|
28
28
|
}
|
29
29
|
// 移除解决formlist函数里不更新问题
|
@@ -60,7 +60,7 @@ var ComRender = function ComRender(props) {
|
|
60
60
|
children: viewRender(componentProps)
|
61
61
|
});
|
62
62
|
}
|
63
|
-
var Component = component ? (
|
63
|
+
var Component = component ? (/*#__PURE__*/React.cloneElement(component, _objectSpread({}, componentProps))) : _jsx(TypeComponent, _objectSpread({}, componentProps));
|
64
64
|
var Com = getComRender(Component, props, componentProps);
|
65
65
|
return _jsx(FieldProvider, {
|
66
66
|
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ProCascaderProps } from './propsType';
|
3
|
-
declare const _default: import("react").MemoExoticComponent<(props: ProCascaderProps) => JSX.Element>;
|
3
|
+
declare const _default: import("react").MemoExoticComponent<(props: ProCascaderProps) => import("react/jsx-runtime").JSX.Element>;
|
4
4
|
export default _default;
|
@@ -13,7 +13,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
13
13
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
14
14
|
import "antd/es/typography/style";
|
15
15
|
import _Typography from "antd/es/typography";
|
16
|
-
var _excluded = ["className", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator", "detailPlaceholder"];
|
16
|
+
var _excluded = ["className", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator", "detailPlaceholder", "scrollFollowParent"];
|
17
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
18
18
|
import { useEffect, useState, memo, useMemo } from 'react';
|
19
19
|
import { omit, find as _find } from 'lodash';
|
@@ -29,9 +29,9 @@ var defaultFieldNames = {
|
|
29
29
|
value: 'code',
|
30
30
|
children: 'children'
|
31
31
|
};
|
32
|
-
var
|
32
|
+
var _filterDataSource = function filterDataSource(dataSource, level, fieldNames) {
|
33
33
|
return dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
34
|
-
return _objectSpread(_objectSpread({}, item), {}, _defineProperty({}, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children', level === 1 ? [] :
|
34
|
+
return _objectSpread(_objectSpread({}, item), {}, _defineProperty({}, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children', level === 1 ? [] : _filterDataSource(item === null || item === void 0 ? void 0 : item[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], level - 1, fieldNames)));
|
35
35
|
});
|
36
36
|
};
|
37
37
|
var getViewLabel = function getViewLabel(_ref) {
|
@@ -87,6 +87,7 @@ var ProCascader = function ProCascader(props) {
|
|
87
87
|
_props$separator = props.separator,
|
88
88
|
separator = _props$separator === void 0 ? '/' : _props$separator,
|
89
89
|
detailPlaceholder = props.detailPlaceholder,
|
90
|
+
scrollFollowParent = props.scrollFollowParent,
|
90
91
|
otherProps = _objectWithoutProperties(props, _excluded);
|
91
92
|
var _ref3 = ProForm.useFieldProps() || {},
|
92
93
|
isViewCon = _ref3.isView,
|
@@ -107,7 +108,7 @@ var ProCascader = function ProCascader(props) {
|
|
107
108
|
}, [dics === null || dics === void 0 ? void 0 : dics[addressCode], enumData]);
|
108
109
|
var realDataSource = useMemo(function () {
|
109
110
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
110
|
-
var result = transformDataName(isAddressMode && realLevel === 2 ?
|
111
|
+
var result = transformDataName(isAddressMode && realLevel === 2 ? _filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
111
112
|
return result;
|
112
113
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
113
114
|
var _useRequest = _objectSpread({}, useRequest),
|
@@ -123,7 +124,7 @@ var ProCascader = function ProCascader(props) {
|
|
123
124
|
defaultLabel = _useState4[0],
|
124
125
|
setDefaultLabel = _useState4[1];
|
125
126
|
var getFirstLevelOptions = /*#__PURE__*/function () {
|
126
|
-
var _ref4 = _asyncToGenerator(
|
127
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
127
128
|
var _yield$service, data, newData, transFormData, serviceData;
|
128
129
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
129
130
|
while (1) switch (_context.prev = _context.next) {
|
@@ -142,7 +143,7 @@ var ProCascader = function ProCascader(props) {
|
|
142
143
|
value: fieldNames.value,
|
143
144
|
children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
|
144
145
|
});
|
145
|
-
serviceData = isAddressMode && realLevel === 2 ?
|
146
|
+
serviceData = isAddressMode && realLevel === 2 ? _filterDataSource(transFormData, level, fieldNames) : transFormData;
|
146
147
|
setServiceData(serviceData);
|
147
148
|
case 9:
|
148
149
|
case "end":
|
@@ -212,7 +213,7 @@ var ProCascader = function ProCascader(props) {
|
|
212
213
|
})) === null || _ref5$filter === void 0 ? void 0 : _ref5$filter.join(separator)) || '-' : (defaultLabel === null || defaultLabel === void 0 ? void 0 : (_defaultLabel$filter = defaultLabel.filter(function (item) {
|
213
214
|
return !!item;
|
214
215
|
})) === null || _defaultLabel$filter === void 0 ? void 0 : _defaultLabel$filter.join(separator)) || '-';
|
215
|
-
var
|
216
|
+
var _findSelectedOptions = function findSelectedOptions(options, value) {
|
216
217
|
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
217
218
|
var _value = value !== null && value !== void 0 ? value : [];
|
218
219
|
// 基准情况:如果 value 数组为空,且 path 不为空,说明找到了完整的路径
|
@@ -231,7 +232,7 @@ var ProCascader = function ProCascader(props) {
|
|
231
232
|
if (foundOption) {
|
232
233
|
// 如果找到了匹配的选项,并且还有更多的 value 需要匹配,递归地在子选项中查找
|
233
234
|
if (_value.length > 1 && foundOption.children) {
|
234
|
-
return
|
235
|
+
return _findSelectedOptions(foundOption.children, _value.slice(1), [].concat(_toConsumableArray(path), [foundOption]));
|
235
236
|
}
|
236
237
|
// 如果没有更多的 value 需要匹配,返回当前选项(以及之前的路径)
|
237
238
|
return [].concat(_toConsumableArray(path), [foundOption]);
|
@@ -240,7 +241,7 @@ var ProCascader = function ProCascader(props) {
|
|
240
241
|
return null;
|
241
242
|
};
|
242
243
|
var _selectedOptions = useMemo(function () {
|
243
|
-
return
|
244
|
+
return _findSelectedOptions(service ? serviceData : realDataSource, addressValue);
|
244
245
|
}, [service, serviceData, realDataSource, addressValue]);
|
245
246
|
var handleAddressChange = function handleAddressChange(e) {
|
246
247
|
var cascaderValue = value === null || value === void 0 ? void 0 : value.slice(0, realLevel);
|
@@ -273,8 +274,11 @@ var ProCascader = function ProCascader(props) {
|
|
273
274
|
filter: handlefilter,
|
274
275
|
limit: 1000
|
275
276
|
},
|
276
|
-
onChange: handleChange
|
277
|
-
|
277
|
+
onChange: handleChange,
|
278
|
+
getPopupContainer: function getPopupContainer(trigger) {
|
279
|
+
return scrollFollowParent ? trigger.parentElement : document.body;
|
280
|
+
}
|
281
|
+
}, omit(otherProps, ['otherProps', 'scrollFollowParent']))), hasDetail && (tooltip && disabled && detail ? _jsx(_Tooltip, {
|
278
282
|
title: detail,
|
279
283
|
children: _jsx("span", {
|
280
284
|
className: "pro-address-detail",
|
@@ -24,7 +24,7 @@ var useDefaultOptions = function useDefaultOptions(options) {
|
|
24
24
|
});
|
25
25
|
};
|
26
26
|
var defaultService = /*#__PURE__*/function () {
|
27
|
-
var _ref = _asyncToGenerator(
|
27
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
28
28
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
29
29
|
while (1) switch (_context.prev = _context.next) {
|
30
30
|
case 0:
|
@@ -260,7 +260,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
260
260
|
onChange(val, option);
|
261
261
|
};
|
262
262
|
var handleClick = /*#__PURE__*/function () {
|
263
|
-
var _ref7 = _asyncToGenerator(
|
263
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
264
264
|
var _yield$beforeOpen, res;
|
265
265
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
266
266
|
while (1) switch (_context.prev = _context.next) {
|
@@ -327,7 +327,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
327
327
|
}
|
328
328
|
};
|
329
329
|
var handleFinish = /*#__PURE__*/function () {
|
330
|
-
var _ref8 = _asyncToGenerator(
|
330
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
331
331
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
332
332
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
333
333
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -392,7 +392,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
392
392
|
};
|
393
393
|
}();
|
394
394
|
var handleSearch = /*#__PURE__*/function () {
|
395
|
-
var _ref9 = _asyncToGenerator(
|
395
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
396
396
|
var values;
|
397
397
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
398
398
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -465,7 +465,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
465
465
|
};
|
466
466
|
// 初始化回显,当传入initParams时,前端用来回险
|
467
467
|
var getInitValues = /*#__PURE__*/function () {
|
468
|
-
var _ref10 = _asyncToGenerator(
|
468
|
+
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
469
469
|
var _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
470
470
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
471
471
|
while (1) switch (_context4.prev = _context4.next) {
|
@@ -525,7 +525,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
525
525
|
}();
|
526
526
|
// 初始化回显,当传入initParams时,前端用来回险
|
527
527
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
528
|
-
var _ref11 = _asyncToGenerator(
|
528
|
+
var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
529
529
|
var _useRequest$options4, _useRequest$options5;
|
530
530
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
531
531
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
@@ -12,5 +12,5 @@ export interface InputRangeProps {
|
|
12
12
|
isPositiveInteger?: boolean;
|
13
13
|
precision?: number;
|
14
14
|
}
|
15
|
-
declare const InputRange: ({ value, onChange, min, max, group, disabled, precision, isPositiveInteger, }: InputRangeProps) => JSX.Element;
|
15
|
+
declare const InputRange: ({ value, onChange, min, max, group, disabled, precision, isPositiveInteger, }: InputRangeProps) => import("react/jsx-runtime").JSX.Element;
|
16
16
|
export default InputRange;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { ProAddressPropsType } from './propsTypes';
|
3
2
|
export declare const transferAddressInfoToRegion: () => {
|
4
3
|
normalize: (value: any) => {
|
@@ -24,5 +23,5 @@ export declare const transferAddressInfoToRegion: () => {
|
|
24
23
|
};
|
25
24
|
};
|
26
25
|
};
|
27
|
-
export declare function ProAddress({ ...props }: ProAddressPropsType): JSX.Element;
|
26
|
+
export declare function ProAddress({ ...props }: ProAddressPropsType): import("react/jsx-runtime").JSX.Element;
|
28
27
|
export default ProAddress;
|
@@ -92,7 +92,7 @@ export function ProAddress(_ref3) {
|
|
92
92
|
secondCitys = _useState6[0],
|
93
93
|
setSecondCitys = _useState6[1];
|
94
94
|
var queryCity = /*#__PURE__*/function () {
|
95
|
-
var _ref5 = _asyncToGenerator(
|
95
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(code, type) {
|
96
96
|
var cityList, _cityList, newList, _secondCitys;
|
97
97
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
98
98
|
while (1) switch (_context.prev = _context.next) {
|
@@ -1,3 +1,2 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { ProRangeBoxPropsType } from './propsType';
|
3
|
-
export default function ProRangeBox({ configOption }: ProRangeBoxPropsType): JSX.Element;
|
2
|
+
export default function ProRangeBox({ configOption }: ProRangeBoxPropsType): import("react/jsx-runtime").JSX.Element;
|
@@ -13,6 +13,7 @@ import React, { useMemo } from 'react';
|
|
13
13
|
import { diffOriginal } from '../../utils/diffOriginal';
|
14
14
|
import { useProConfig } from '../../../ProConfigProvider';
|
15
15
|
import { isEmpty } from '../../../utils';
|
16
|
+
var componentsWithFloatWindow = ['Select', 'ProSelect', 'ProEnum', 'ProTimeLimit', 'ProModalSelect', 'ProCascader', 'DataPicker', 'RangePicker', 'TimePicker'];
|
16
17
|
var ChangedWrapper = function ChangedWrapper(props) {
|
17
18
|
var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
|
18
19
|
var name = props.name,
|
@@ -98,6 +99,9 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
98
99
|
'pro-form-item-add': isAdd
|
99
100
|
});
|
100
101
|
var open = tipOpenCalc();
|
102
|
+
var scrollFollowParentConfig = componentsWithFloatWindow.includes(type) ? {
|
103
|
+
scrollFollowParent: scrollFollowParent
|
104
|
+
} : {};
|
101
105
|
return _jsx(_Tooltip, {
|
102
106
|
open: open,
|
103
107
|
getPopupContainer: function getPopupContainer(trigger) {
|
@@ -115,8 +119,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
115
119
|
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
116
120
|
}), _showEllipse && _jsxs(_Space, {
|
117
121
|
className: "current-value-container",
|
118
|
-
children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
119
|
-
scrollFollowParent: scrollFollowParent,
|
122
|
+
children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, children.props), rest), scrollFollowParentConfig), {}, {
|
120
123
|
isView: true
|
121
124
|
})) : undefined]
|
122
125
|
})]
|
@@ -124,8 +127,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
124
127
|
children: _jsx("div", {
|
125
128
|
className: diffClassName,
|
126
129
|
style: style,
|
127
|
-
children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
128
|
-
scrollFollowParent: scrollFollowParent,
|
130
|
+
children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, children.props), rest), scrollFollowParentConfig), {}, {
|
129
131
|
otherProps: _objectSpread(_objectSpread({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
|
130
132
|
isDiffChange: isChanged
|
131
133
|
})
|
@@ -22,7 +22,7 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
22
22
|
var _ProForm$useFieldProp = ProForm.useFieldProps(),
|
23
23
|
form = _ProForm$useFieldProp.form;
|
24
24
|
var handleChange = /*#__PURE__*/function () {
|
25
|
-
var _ref = _asyncToGenerator(
|
25
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
|
26
26
|
var _len,
|
27
27
|
other,
|
28
28
|
_key,
|
@@ -136,6 +136,12 @@ var Render = function Render(props) {
|
|
136
136
|
var transforms = Array.isArray(otherProps === null || otherProps === void 0 ? void 0 : otherProps.names) ? transformNames(_objectSpread(_objectSpread({}, otherFormItemProps), valueTypeTransform()),
|
137
137
|
// 合并valueType的transform
|
138
138
|
form, otherProps.names, namesStr, otherProps.type) : valueTypeTransform();
|
139
|
+
/**
|
140
|
+
* globalControl 全局控制优先
|
141
|
+
* globalControl true时,优先级 全局【formDisabled】> formitem上【column.disabled】 > 组件上【fieldProps.disabled】
|
142
|
+
* globalControl false时,优先级 组件上【fieldProps.disabled】 > formitem上【column.disabled】 > 全局【formDisabled】
|
143
|
+
*/
|
144
|
+
var lastDisabled = globalControl ? (_ref2 = (_ref3 = formDisabled !== null && formDisabled !== void 0 ? formDisabled : _disabled) !== null && _ref3 !== void 0 ? _ref3 : _fieldProps === null || _fieldProps === void 0 ? void 0 : _fieldProps.disabled) !== null && _ref2 !== void 0 ? _ref2 : componentProps === null || componentProps === void 0 ? void 0 : componentProps.disabled : (_ref4 = (_ref5 = _disabled !== null && _disabled !== void 0 ? _disabled : _fieldProps === null || _fieldProps === void 0 ? void 0 : _fieldProps.disabled) !== null && _ref5 !== void 0 ? _ref5 : componentProps === null || componentProps === void 0 ? void 0 : componentProps.disabled) !== null && _ref4 !== void 0 ? _ref4 : formDisabled;
|
139
145
|
// ↑↑↑↑↑↑ formItem参数整理 ↑↑↑↑↑↑
|
140
146
|
Object.assign(otherFormItemProps, transforms, {
|
141
147
|
names: otherProps.names
|
@@ -148,6 +154,10 @@ var Render = function Render(props) {
|
|
148
154
|
} : null, _objectSpread({}, isTrim(type, trim, useProConfig())), // 优先取传进来的,其次取ProConfigProvider配置的
|
149
155
|
_objectSpread({}, isUpperCase(type, upperCase)), {
|
150
156
|
validateFirst: true
|
157
|
+
},
|
158
|
+
// 当某一规则校验不通过时,是否停止剩下的规则的校验
|
159
|
+
{
|
160
|
+
disabled: lastDisabled
|
151
161
|
});
|
152
162
|
// 添加label宽度
|
153
163
|
if (labelWidth) {
|
@@ -157,12 +167,6 @@ var Render = function Render(props) {
|
|
157
167
|
}
|
158
168
|
/** 移除多余参数,防止透传给formItem报错 */
|
159
169
|
var _otherFormItemProps = omit(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'toCSTString', 'switchValue', 'precision', 'clearNotShow', 'dependNames']);
|
160
|
-
/**
|
161
|
-
* globalControl 全局控制优先
|
162
|
-
* globalControl true时,优先级 全局【formDisabled】> formitem上【column.disabled】 > 组件上【fieldProps.disabled】
|
163
|
-
* globalControl false时,优先级 组件上【fieldProps.disabled】 > formitem上【column.disabled】 > 全局【formDisabled】
|
164
|
-
*/
|
165
|
-
var lastDisabled = globalControl ? (_ref2 = (_ref3 = formDisabled !== null && formDisabled !== void 0 ? formDisabled : _disabled) !== null && _ref3 !== void 0 ? _ref3 : _fieldProps === null || _fieldProps === void 0 ? void 0 : _fieldProps.disabled) !== null && _ref2 !== void 0 ? _ref2 : componentProps === null || componentProps === void 0 ? void 0 : componentProps.disabled : (_ref4 = (_ref5 = _disabled !== null && _disabled !== void 0 ? _disabled : _fieldProps === null || _fieldProps === void 0 ? void 0 : _fieldProps.disabled) !== null && _ref5 !== void 0 ? _ref5 : componentProps === null || componentProps === void 0 ? void 0 : componentProps.disabled) !== null && _ref4 !== void 0 ? _ref4 : formDisabled;
|
166
170
|
/**
|
167
171
|
* 最新fieldProps: 更新后的组件Props
|
168
172
|
*/
|
@@ -241,7 +245,7 @@ var Render = function Render(props) {
|
|
241
245
|
_args = functionArgs([].concat(args));
|
242
246
|
}
|
243
247
|
var inList = _otherFormItemProps === null || _otherFormItemProps === void 0 ? void 0 : (_otherFormItemProps$n3 = _otherFormItemProps.namePath) === null || _otherFormItemProps$n3 === void 0 ? void 0 : _otherFormItemProps$n3.length;
|
244
|
-
if (
|
248
|
+
if (/*#__PURE__*/React.isValidElement(AutoComponent)) {
|
245
249
|
var _AutoComponent$props$, _AutoComponent$props, _lastComponentProps$c;
|
246
250
|
((_AutoComponent$props$ = (_AutoComponent$props = AutoComponent === null || AutoComponent === void 0 ? void 0 : AutoComponent.props)[changeKey]) === null || _AutoComponent$props$ === void 0 ? void 0 : _AutoComponent$props$.call.apply(_AutoComponent$props$, [_AutoComponent$props].concat(_toConsumableArray(_args)))) || ((_lastComponentProps$c = lastComponentProps[changeKey]) === null || _lastComponentProps$c === void 0 ? void 0 : _lastComponentProps$c.call.apply(_lastComponentProps$c, [lastComponentProps].concat(_toConsumableArray(_args))));
|
247
251
|
return false;
|
@@ -291,7 +295,7 @@ var Render = function Render(props) {
|
|
291
295
|
* onBlur参数重置 (value, record, { form, index, namePath, option }) => void
|
292
296
|
*/
|
293
297
|
var handleBlur = /*#__PURE__*/function () {
|
294
|
-
var _ref7 = _asyncToGenerator(
|
298
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
295
299
|
var _len3,
|
296
300
|
args,
|
297
301
|
_key3,
|
@@ -374,7 +378,7 @@ var Render = function Render(props) {
|
|
374
378
|
if (originComponent) {
|
375
379
|
delete childProps.otherProps;
|
376
380
|
}
|
377
|
-
var child = /*#__PURE__*/React.isValidElement(AutoComponent) ? (
|
381
|
+
var child = /*#__PURE__*/React.isValidElement(AutoComponent) ? (/*#__PURE__*/React.cloneElement(AutoComponent, childProps)) : _jsx(AutoComponent, _objectSpread(_objectSpread({}, omit(lastComponentProps, [].concat(lastComponentPropsFilter, ['debounceWait']))), {}, {
|
378
382
|
otherProps: _objectSpread(_objectSpread({}, otherProps), {}, {
|
379
383
|
show: show,
|
380
384
|
disabled: lastDisabled,
|
@@ -401,7 +405,7 @@ var Render = function Render(props) {
|
|
401
405
|
};
|
402
406
|
}
|
403
407
|
// 需要过滤掉的form_item的key
|
404
|
-
var filterFormItemKey = ['onFieldChange', 'shouldUpdate', 'namePath', 'isView', 'parentNames', 'space', 'before', 'after', 'globalControl', 'listName'];
|
408
|
+
var filterFormItemKey = ['onFieldChange', 'shouldUpdate', 'namePath', 'isView', 'parentNames', 'space', 'before', 'after', 'globalControl', 'listName', 'fixed'];
|
405
409
|
if (type === 'FormList') {
|
406
410
|
lastComponentProps.disabled = lastDisabled;
|
407
411
|
var lessMode = lastComponentProps.mode === 'less';
|
package/es/ProForm/index.js
CHANGED
@@ -16,7 +16,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
import { DoubleLeftOutlined } from '@ant-design/icons';
|
17
17
|
import classnames from 'classnames';
|
18
18
|
import React, { forwardRef, useImperativeHandle, useMemo } from 'react';
|
19
|
-
import { isObject, merge } from 'lodash';
|
19
|
+
import { isObject, merge, omit } from 'lodash';
|
20
20
|
import { FormFooter, InputRange, ProAddress, ProCascader, ProCertNo, ProCertValidity, ProCombination, ProModalSelect, ProNumberRange, ProRangeBox, ProTimeLimit, transferAddressInfoToRegion, ProUpload, ProTreeModal, ProTree, EnumSelect } from './components';
|
21
21
|
import RenderFields from './components/render/RenderFields';
|
22
22
|
import { useProConfig, useContextForms } from '../ProConfigProvider';
|
@@ -91,12 +91,15 @@ var ProForm = function ProForm(props, ref) {
|
|
91
91
|
useMemo(function () {
|
92
92
|
if (formKey && forms[formKey] !== form) {
|
93
93
|
forms[formKey] = form;
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
94
|
+
// fix: Cannot update a component (`ProConfigProvider`) while rendering a different component (`ForwardRef(ProForm)`).
|
95
|
+
setTimeout(function () {
|
96
|
+
dispatch({
|
97
|
+
type: 'set',
|
98
|
+
payload: {
|
99
|
+
forms: _objectSpread({}, forms)
|
100
|
+
}
|
101
|
+
});
|
102
|
+
}, 300);
|
100
103
|
}
|
101
104
|
// 销毁
|
102
105
|
return function () {
|
@@ -200,7 +203,7 @@ var ProForm = function ProForm(props, ref) {
|
|
200
203
|
if (isView || disabled) {
|
201
204
|
// 查看或禁用模式
|
202
205
|
footerEle = null;
|
203
|
-
} else if (
|
206
|
+
} else if (/*#__PURE__*/React.isValidElement(footer)) {
|
204
207
|
// 传入组件渲染组件
|
205
208
|
footerEle = footer;
|
206
209
|
} else if (footer === undefined || footer || isObject(footer)) {
|
@@ -237,7 +240,7 @@ var ProForm = function ProForm(props, ref) {
|
|
237
240
|
},
|
238
241
|
className: cls,
|
239
242
|
form: form
|
240
|
-
}, formProps), config), otherProps), {}, {
|
243
|
+
}, formProps), omit(config, ['isDiffAll'])), otherProps), {}, {
|
241
244
|
labelAlign: (_ref = labelAlign !== null && labelAlign !== void 0 ? labelAlign : config.labelAlign) !== null && _ref !== void 0 ? _ref : 'left',
|
242
245
|
onValuesChange: handleValuesChange,
|
243
246
|
onFinish: handleFinish,
|