@zat-design/sisyphus-react 3.9.0-beta.2 → 3.9.0-beta.21
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 +41 -15
- package/dist/less.esm.css +37 -13
- package/es/ProAction/index.js +5 -5
- 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 +7 -5
- package/es/ProDrawerForm/components/ProModal/index.js +8 -6
- package/es/ProDrawerForm/propsType.d.ts +1 -0
- 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/ListChangedWrapper.js +7 -3
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +8 -7
- 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 +23 -16
- package/es/ProEditTable/style/index.less +14 -2
- 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 +7 -5
- package/es/ProEnum/propsType.d.ts +1 -0
- package/es/ProEnum/utils/eventCenter.js +2 -1
- package/es/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/es/ProForm/components/base/Input/index.d.ts +1 -1
- package/es/ProForm/components/base/SwitchCheckbox/index.js +9 -2
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/es/ProForm/components/combination/FormList/utils.js +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.d.ts +1 -0
- package/es/ProForm/components/combination/Group/component/ComRender.js +13 -2
- package/es/ProForm/components/combination/Group/index.js +4 -3
- package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +8 -8
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +7 -6
- 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 +2 -1
- package/es/ProForm/components/old/ProAddress/index.js +1 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/es/ProForm/components/render/ChangedWrapper.js +1 -2
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +3 -3
- package/es/ProForm/components/render/RenderFields.js +3 -2
- package/es/ProForm/components/render/propsType.d.ts +1 -0
- package/es/ProForm/index.js +1 -1
- package/es/ProForm/style/index.less +8 -5
- package/es/ProForm/utils/diffOriginal.js +18 -12
- package/es/ProForm/utils/index.js +10 -14
- package/es/ProForm/utils/useForm.js +1 -1
- package/es/ProIcon/utils/index.js +3 -4
- 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.d.ts +5 -3
- package/es/ProTable/components/FormatColumn/index.js +95 -74
- 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 +8 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.js +29 -11
- 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/components/TableResizable/index.js +1 -5
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.d.ts +6 -5
- package/es/ProTable/index.js +6 -8
- package/es/ProTable/propsType.d.ts +2 -1
- package/es/ProTable/style/index.less +10 -1
- package/es/ProTable/utils/index.d.ts +5 -2
- package/es/ProTable/utils/index.js +13 -4
- 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 +2 -1
- 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 +50 -31
- 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 +11 -12
- package/es/ProTreeModal/components/Cascader.d.ts +1 -1
- package/es/ProTreeModal/components/CloseIcon.d.ts +2 -1
- 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 +14 -16
- 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/es/style/theme/antd.less +4 -2
- package/es/utils/index.d.ts +1 -1
- package/es/utils/index.js +4 -1
- package/lib/ProAction/index.js +5 -5
- 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 +7 -5
- package/lib/ProDrawerForm/components/ProModal/index.js +8 -6
- package/lib/ProDrawerForm/propsType.d.ts +1 -0
- 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/ListChangedWrapper.js +5 -1
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +8 -7
- 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 +23 -16
- package/lib/ProEditTable/style/index.less +14 -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 +7 -5
- package/lib/ProEnum/propsType.d.ts +1 -0
- package/lib/ProEnum/utils/eventCenter.js +2 -1
- package/lib/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/lib/ProForm/components/base/Input/index.d.ts +1 -1
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +9 -2
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/lib/ProForm/components/combination/FormList/utils.js +1 -1
- package/lib/ProForm/components/combination/Group/component/ComRender.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/component/ComRender.js +13 -2
- package/lib/ProForm/components/combination/Group/index.js +4 -3
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +8 -8
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +7 -6
- 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 +2 -1
- package/lib/ProForm/components/old/ProAddress/index.js +1 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/lib/ProForm/components/render/ChangedWrapper.js +1 -2
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +3 -3
- package/lib/ProForm/components/render/RenderFields.js +3 -2
- package/lib/ProForm/components/render/propsType.d.ts +1 -0
- package/lib/ProForm/index.js +1 -1
- package/lib/ProForm/style/index.less +8 -5
- package/lib/ProForm/utils/diffOriginal.js +18 -12
- package/lib/ProForm/utils/index.js +10 -10
- package/lib/ProForm/utils/useForm.js +1 -1
- 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.d.ts +5 -3
- package/lib/ProTable/components/FormatColumn/index.js +94 -73
- 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/RenderColumn/index.d.ts +1 -1
- package/lib/ProTable/components/RenderColumn/index.js +29 -11
- 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/components/TableResizable/index.js +0 -4
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.d.ts +6 -5
- package/lib/ProTable/index.js +6 -8
- package/lib/ProTable/propsType.d.ts +2 -1
- package/lib/ProTable/style/index.less +10 -1
- package/lib/ProTable/utils/index.d.ts +5 -2
- package/lib/ProTable/utils/index.js +13 -4
- 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 +2 -1
- 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 +49 -30
- 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 +2 -1
- 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/lib/style/theme/antd.less +4 -2
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +4 -1
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -5
package/es/ProEditTable/index.js
CHANGED
@@ -2,6 +2,7 @@ import "antd/es/affix/style";
|
|
2
2
|
import _Affix from "antd/es/affix";
|
3
3
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
5
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
5
6
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
6
7
|
import "antd/es/config-provider/style";
|
7
8
|
import _ConfigProvider from "antd/es/config-provider";
|
@@ -9,7 +10,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
9
10
|
import "antd/es/form/style";
|
10
11
|
import _Form from "antd/es/form";
|
11
12
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
12
|
-
var _excluded = ["value", "onChange", "onDrag", "className", "columns", "type", "mode", "stripe", "draggable", "virtual", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "
|
13
|
+
var _excluded = ["value", "onChange", "onDrag", "className", "columns", "type", "mode", "stripe", "draggable", "virtual", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "rowKey", "rowDisabled", "rowDraggable", "footerRender", "scroll", "actionDirection", "diffConfig"];
|
13
14
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
14
15
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
15
16
|
import { get, isArray, isBoolean } from 'lodash';
|
@@ -50,7 +51,6 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
50
51
|
max = _ref.max,
|
51
52
|
headerRender = _ref.headerRender,
|
52
53
|
pagination = _ref.pagination,
|
53
|
-
originalValues = _ref.originalValues,
|
54
54
|
rowKey = _ref.rowKey,
|
55
55
|
rowDisabled = _ref.rowDisabled,
|
56
56
|
rowDraggable = _ref.rowDraggable,
|
@@ -136,6 +136,25 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
136
136
|
return getRowKey(item) === getRowKey(record);
|
137
137
|
}));
|
138
138
|
};
|
139
|
+
var originalValues = useMemo(function () {
|
140
|
+
var _originalArr$every, _originalArr$some;
|
141
|
+
// 原始值也需要设置对应的rowkey,后续比对通过rowkey对比
|
142
|
+
var originalArr = get(resetProps === null || resetProps === void 0 ? void 0 : resetProps.originalValues, name);
|
143
|
+
var isOriginalAllHasKey = originalArr ? originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$every = originalArr.every) === null || _originalArr$every === void 0 ? void 0 : _originalArr$every.call(originalArr, function (item) {
|
144
|
+
return item.rowKey;
|
145
|
+
}) : true;
|
146
|
+
var isNeedCoverOriginal = originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$some = originalArr.some) === null || _originalArr$some === void 0 ? void 0 : _originalArr$some.call(originalArr, function (item) {
|
147
|
+
return item.rowKey !== getRowKey(item);
|
148
|
+
});
|
149
|
+
// 初始化默认生成row-key
|
150
|
+
if ((originalArr === null || originalArr === void 0 ? void 0 : originalArr.length) && (!isOriginalAllHasKey || isNeedCoverOriginal)) {
|
151
|
+
var _originalArr$forEach;
|
152
|
+
originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$forEach = originalArr.forEach) === null || _originalArr$forEach === void 0 ? void 0 : _originalArr$forEach.call(originalArr, function (item) {
|
153
|
+
item.rowKey = getRowKey(item);
|
154
|
+
});
|
155
|
+
}
|
156
|
+
return _defineProperty({}, name, originalArr);
|
157
|
+
}, [resetProps === null || resetProps === void 0 ? void 0 : resetProps.originalValues]);
|
139
158
|
var config = _objectSpread({
|
140
159
|
form: form,
|
141
160
|
mode: mode,
|
@@ -275,33 +294,21 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
275
294
|
return transformColumns(columns, config);
|
276
295
|
}, [valueChangeRef.current, disabled, forceUpdate, columns, page, actionProps, editingKeys, cellNamePath]);
|
277
296
|
var initDataSource = function initDataSource() {
|
278
|
-
var _value$every,
|
297
|
+
var _value$every, _value$some;
|
279
298
|
var isAllHasKey = value === null || value === void 0 ? void 0 : (_value$every = value.every) === null || _value$every === void 0 ? void 0 : _value$every.call(value, function (item) {
|
280
299
|
return item.rowKey;
|
281
300
|
});
|
282
|
-
// 原始值也需要设置对应的rowkey,后续比对通过rowkey对比
|
283
|
-
var originalArr = get(originalValues, name);
|
284
|
-
var isOriginalAllHasKey = originalArr ? originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$every = originalArr.every) === null || _originalArr$every === void 0 ? void 0 : _originalArr$every.call(originalArr, function (item) {
|
285
|
-
return item.rowKey;
|
286
|
-
}) : true;
|
287
301
|
// 检测当前rowkey是否与制定key的值是否一致,不一致,则执行覆盖
|
288
302
|
var isNeedCover = value === null || value === void 0 ? void 0 : (_value$some = value.some) === null || _value$some === void 0 ? void 0 : _value$some.call(value, function (item) {
|
289
303
|
return item.rowKey !== getRowKey(item);
|
290
304
|
});
|
291
|
-
var isNeedCoverOriginal = originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$some = originalArr.some) === null || _originalArr$some === void 0 ? void 0 : _originalArr$some.call(originalArr, function (item) {
|
292
|
-
return item.rowKey !== getRowKey(item);
|
293
|
-
});
|
294
305
|
// 初始化默认生成row-key
|
295
|
-
if ((value === null || value === void 0 ? void 0 : value.length) && (!isAllHasKey || isNeedCover)
|
296
|
-
var _originalArr$forEach;
|
306
|
+
if ((value === null || value === void 0 ? void 0 : value.length) && (!isAllHasKey || isNeedCover)) {
|
297
307
|
var nextValues = value === null || value === void 0 ? void 0 : value.map(function (item) {
|
298
308
|
return _objectSpread(_objectSpread({}, item), {}, {
|
299
309
|
rowKey: getRowKey(item)
|
300
310
|
});
|
301
311
|
});
|
302
|
-
originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$forEach = originalArr.forEach) === null || _originalArr$forEach === void 0 ? void 0 : _originalArr$forEach.call(originalArr, function (item) {
|
303
|
-
item.rowKey = getRowKey(item);
|
304
|
-
});
|
305
312
|
onChange(nextValues);
|
306
313
|
if (virtualKey) {
|
307
314
|
form.setFieldValue(virtualRowName, nextValues);
|
@@ -281,8 +281,20 @@
|
|
281
281
|
}
|
282
282
|
}
|
283
283
|
|
284
|
-
|
285
|
-
|
284
|
+
.@{ant-prefix}-table .@{ant-prefix}-table-tbody, .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row td{
|
285
|
+
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
286
|
+
}
|
287
|
+
.@{ant-prefix}-table .@{ant-prefix}-table-tbody .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row:hover{
|
288
|
+
td, .@{ant-prefix}-table-cell-row-hover {
|
289
|
+
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
290
|
+
}
|
291
|
+
}
|
292
|
+
|
293
|
+
.@{ant-prefix}-table .@{ant-prefix}-table-body, .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row td{
|
294
|
+
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
295
|
+
}
|
296
|
+
.@{ant-prefix}-table .@{ant-prefix}-table-body .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row:hover{
|
297
|
+
td, .@{ant-prefix}-table-cell-row-hover {
|
286
298
|
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
287
299
|
}
|
288
300
|
}
|
@@ -9,7 +9,7 @@ export declare const defaultBtnNameMap: {
|
|
9
9
|
custom: any;
|
10
10
|
};
|
11
11
|
export declare const iconMap: {
|
12
|
-
add:
|
12
|
+
add: JSX.Element;
|
13
13
|
};
|
14
14
|
export declare const defaultSingleActionKeys: string[];
|
15
15
|
export declare const defaultMultipleActionKeys: string[];
|
@@ -63,7 +63,7 @@ export var actions = {
|
|
63
63
|
});
|
64
64
|
},
|
65
65
|
save: function () {
|
66
|
-
var _save = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
66
|
+
var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
67
67
|
var record, editingKeys, setState, form, rowName, virtualRowName, result, updateData, nextEditingKeys, values;
|
68
68
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
69
69
|
while (1) switch (_context.prev = _context.next) {
|
@@ -166,7 +166,7 @@ export var actions = {
|
|
166
166
|
}
|
167
167
|
},
|
168
168
|
add: function () {
|
169
|
-
var _add = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref5) {
|
169
|
+
var _add = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref5) {
|
170
170
|
var _tableRef$current$que, _tableRef$current$que2;
|
171
171
|
var result, insertType, editingKeys, setState, form, name, virtualName, virtualKey, onlyOneLineMsg, tableRef, _ref5$prefixCls, prefixCls, nextData, rowKey, addData, nextEditingKeys;
|
172
172
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -26,7 +26,7 @@ import locale from '../../locale';
|
|
26
26
|
// 渲染操作栏
|
27
27
|
var getActionColumn = function getActionColumn(config) {
|
28
28
|
var _cloneDeepWith = cloneDeepWith(config, function (value) {
|
29
|
-
if (/*#__PURE__*/React.isValidElement(value)) {
|
29
|
+
if ( /*#__PURE__*/React.isValidElement(value)) {
|
30
30
|
return value;
|
31
31
|
}
|
32
32
|
}),
|
@@ -83,7 +83,7 @@ var getActionColumn = function getActionColumn(config) {
|
|
83
83
|
action.show = show !== null && show !== void 0 ? show : true;
|
84
84
|
action.needConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : true;
|
85
85
|
action.onEvent = /*#__PURE__*/function () {
|
86
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(record, index) {
|
86
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(record, index) {
|
87
87
|
var _form$getFieldValue;
|
88
88
|
var rowName, _record, onEvent, result;
|
89
89
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -234,7 +234,7 @@ export var transformColumns = function transformColumns() {
|
|
234
234
|
children: [before, columnTitle, _jsx(_Tooltip, _objectSpread(_objectSpread({
|
235
235
|
title: tooltipTitle !== null && tooltipTitle !== void 0 ? tooltipTitle : tooltip
|
236
236
|
}, resetProps), {}, {
|
237
|
-
children: icon ? (/*#__PURE__*/React.cloneElement(icon, {
|
237
|
+
children: icon ? ( /*#__PURE__*/React.cloneElement(icon, {
|
238
238
|
className: 'icon-tip'
|
239
239
|
})) : _jsx(ReactSVG, {
|
240
240
|
className: "icon-tip",
|
@@ -387,8 +387,8 @@ export var transformColumns = function transformColumns() {
|
|
387
387
|
}
|
388
388
|
// cacheMap 用来存储缓存值,若有值后不再请求
|
389
389
|
if (JSON.stringify(cacheMap.current) === '{}') {
|
390
|
-
Promise.all(Object.entries(_cacheMap).map(/*#__PURE__*/function () {
|
391
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(item) {
|
390
|
+
Promise.all(Object.entries(_cacheMap).map( /*#__PURE__*/function () {
|
391
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(item) {
|
392
392
|
var _item, key, value, _ref4, service, option;
|
393
393
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
394
394
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -6,14 +6,14 @@ export var getRandom = function getRandom() {
|
|
6
6
|
};
|
7
7
|
// 深层次对比两个对象且取出来差异值
|
8
8
|
export var difference = function difference(object, base) {
|
9
|
-
var
|
9
|
+
var changes = function changes(object, base) {
|
10
10
|
return transform(object, function (result, value, key) {
|
11
11
|
if (!isEqual(value, base[key])) {
|
12
|
-
result[key] = isObject(value) && isObject(base[key]) ?
|
12
|
+
result[key] = isObject(value) && isObject(base[key]) ? changes(value, base[key]) : value;
|
13
13
|
}
|
14
14
|
});
|
15
15
|
};
|
16
|
-
return
|
16
|
+
return changes(object, base);
|
17
17
|
};
|
18
18
|
// 数组字段循环校验,解决validateFields无法批量校验的问题
|
19
19
|
export var customValidate = function customValidate(validateKeys, form, rowName) {
|
@@ -191,7 +191,7 @@ export var handleScrollToError = function handleScrollToError() {
|
|
191
191
|
*/
|
192
192
|
export function cloneDeepFilterNode(value) {
|
193
193
|
return cloneDeepWith(value, function (val) {
|
194
|
-
if (/*#__PURE__*/React.isValidElement(val)) {
|
194
|
+
if ( /*#__PURE__*/React.isValidElement(val)) {
|
195
195
|
return val;
|
196
196
|
}
|
197
197
|
});
|
@@ -6,5 +6,5 @@ interface Props extends Pick<ProEnum, 'id' | 'value' | 'onChange' | 'dataSource'
|
|
6
6
|
allowClear?: boolean;
|
7
7
|
button?: boolean;
|
8
8
|
}
|
9
|
-
declare const Group: (props: Props) =>
|
9
|
+
declare const Group: (props: Props) => JSX.Element;
|
10
10
|
export default Group;
|
@@ -3,5 +3,5 @@ interface Props extends Pick<ProEnum, 'id' | 'value' | 'onChange' | 'dataSource'
|
|
3
3
|
fieldValue: string;
|
4
4
|
fieldLabel: string;
|
5
5
|
}
|
6
|
-
declare const ProEnumTag: (props: Props) =>
|
6
|
+
declare const ProEnumTag: (props: Props) => JSX.Element;
|
7
7
|
export default ProEnumTag;
|
@@ -52,7 +52,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
52
52
|
staleTime: 6e4 * 60
|
53
53
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
54
54
|
setCache: function () {
|
55
|
-
var _setCache = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
|
55
|
+
var _setCache = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
|
56
56
|
var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
|
57
57
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
58
58
|
while (1) switch (_context.prev = _context.next) {
|
@@ -162,7 +162,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
162
162
|
}
|
163
163
|
}));
|
164
164
|
var mergeData = /*#__PURE__*/function () {
|
165
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
165
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
166
166
|
var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res, _locale$ProEnum6;
|
167
167
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
168
168
|
while (1) switch (_context2.prev = _context2.next) {
|
package/es/ProEnum/index.d.ts
CHANGED
@@ -2,8 +2,8 @@ import useEnum from './hooks/useEnum';
|
|
2
2
|
import { ProEnumProps } from './propsType';
|
3
3
|
import './style/index.less';
|
4
4
|
declare const ProEnum: {
|
5
|
-
(props: ProEnumProps):
|
6
|
-
getEnumLabel: (code: string | string[], value: any, compose?: boolean, fieldNameLabel?: string, fieldNameValue?: string) =>
|
5
|
+
(props: ProEnumProps): JSX.Element;
|
6
|
+
getEnumLabel: (code: string | string[], value: any, compose?: boolean, fieldNameLabel?: string, fieldNameValue?: string) => JSX.Element;
|
7
7
|
useEnum: typeof useEnum;
|
8
8
|
};
|
9
9
|
export default ProEnum;
|
package/es/ProEnum/index.js
CHANGED
@@ -43,7 +43,8 @@ var ProEnum = function ProEnum(props) {
|
|
43
43
|
enumProps = _objectWithoutProperties(props, _excluded);
|
44
44
|
var _ref = otherProps || {},
|
45
45
|
viewEmpty = _ref.viewEmpty;
|
46
|
-
var _isView = isView
|
46
|
+
var _isView = isView !== undefined && isView !== null ? isView : otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView;
|
47
|
+
var _defalutValue = props === null || props === void 0 ? void 0 : props.defaultValue;
|
47
48
|
var _ref2 = useProConfig('ProEnum') || {},
|
48
49
|
fieldNames = _ref2.fieldNames,
|
49
50
|
_ref2$clear = _ref2.clear,
|
@@ -153,7 +154,7 @@ var ProEnum = function ProEnum(props) {
|
|
153
154
|
list = [];
|
154
155
|
}
|
155
156
|
}
|
156
|
-
if (/*#__PURE__*/React.isValidElement(component)) {
|
157
|
+
if ( /*#__PURE__*/React.isValidElement(component)) {
|
157
158
|
var Component = component;
|
158
159
|
return _jsx(Component, _objectSpread(_objectSpread({}, enumProps), {}, {
|
159
160
|
dataSource: list,
|
@@ -273,16 +274,17 @@ var ProEnum = function ProEnum(props) {
|
|
273
274
|
return isFunction(props.optionRender) && record.length ? _optionRender() : labelList === null || labelList === void 0 ? void 0 : labelList.join(',');
|
274
275
|
};
|
275
276
|
if (_isView) {
|
276
|
-
|
277
|
+
var __value = value || _defalutValue;
|
278
|
+
if (Array.isArray(__value)) {
|
277
279
|
return _jsx(Container, {
|
278
280
|
tooltip: true,
|
279
281
|
viewEmpty: viewEmpty,
|
280
|
-
children: transToLabel(
|
282
|
+
children: transToLabel(__value)
|
281
283
|
});
|
282
284
|
}
|
283
285
|
return _jsx(Container, {
|
284
286
|
viewEmpty: viewEmpty,
|
285
|
-
children:
|
287
|
+
children: __value || isNumber(__value) ? transToLabel([__value]) : null
|
286
288
|
});
|
287
289
|
}
|
288
290
|
return _jsx(_Fragment, {
|
@@ -7,7 +7,7 @@ var SimpleEventCenter = /*#__PURE__*/function () {
|
|
7
7
|
this.events = void 0;
|
8
8
|
this.events = new Map();
|
9
9
|
}
|
10
|
-
|
10
|
+
_createClass(SimpleEventCenter, [{
|
11
11
|
key: "subscribe",
|
12
12
|
value: function subscribe(eventName, callback) {
|
13
13
|
if (!this.events.has(eventName)) {
|
@@ -34,5 +34,6 @@ var SimpleEventCenter = /*#__PURE__*/function () {
|
|
34
34
|
}
|
35
35
|
}
|
36
36
|
}]);
|
37
|
+
return SimpleEventCenter;
|
37
38
|
}(); // 将 eventCenter 实例添加到 window 对象上
|
38
39
|
window.eventCenter = new SimpleEventCenter();
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const getEnumLabel: (code: string | string[], value: any, compose?: boolean, fieldNameLabel?: string, fieldNameValue?: string) =>
|
1
|
+
declare const getEnumLabel: (code: string | string[], value: any, compose?: boolean, fieldNameLabel?: string, fieldNameValue?: string) => JSX.Element;
|
2
2
|
export default getEnumLabel;
|
@@ -2,9 +2,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "antd/es/checkbox/style";
|
3
3
|
import _Checkbox from "antd/es/checkbox";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
5
|
-
var _excluded = ["onChange", "disabled", "value", "otherProps"];
|
5
|
+
var _excluded = ["onChange", "disabled", "value", "otherProps", "className"];
|
6
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
7
7
|
import { isNull, isUndefined } from 'lodash';
|
8
|
+
import classnames from 'classnames';
|
8
9
|
import { useProConfig } from '../../../../ProConfigProvider';
|
9
10
|
import locale from '../../../../locale';
|
10
11
|
import ProForm from '../../../../ProForm';
|
@@ -13,6 +14,7 @@ var SwitchCheckbox = function SwitchCheckbox(props) {
|
|
13
14
|
disabled = props.disabled,
|
14
15
|
value = props.value,
|
15
16
|
otherProps = props.otherProps,
|
17
|
+
className = props.className,
|
16
18
|
restProps = _objectWithoutProperties(props, _excluded);
|
17
19
|
var _ref = ProForm.useFieldProps() || {},
|
18
20
|
isViewCon = _ref.isView,
|
@@ -47,9 +49,14 @@ var SwitchCheckbox = function SwitchCheckbox(props) {
|
|
47
49
|
})]
|
48
50
|
});
|
49
51
|
}
|
52
|
+
var classNames = classnames({
|
53
|
+
'pro-switch-checkbox': true,
|
54
|
+
className: className
|
55
|
+
});
|
50
56
|
return _jsx(_Checkbox, _objectSpread(_objectSpread(_objectSpread({
|
51
57
|
disabled: disabled,
|
52
|
-
onChange: changeVal
|
58
|
+
onChange: changeVal,
|
59
|
+
className: classNames
|
53
60
|
}, initialConfig), restProps), {}, {
|
54
61
|
children: restProps.label
|
55
62
|
}));
|
@@ -133,7 +133,7 @@ var ActionButton = function ActionButton(props) {
|
|
133
133
|
return _actionProps;
|
134
134
|
}, [props.actionProps]);
|
135
135
|
var handleClick = /*#__PURE__*/function () {
|
136
|
-
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(defaultCallback, callback, index, item) {
|
136
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(defaultCallback, callback, index, item) {
|
137
137
|
var value, data;
|
138
138
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
139
139
|
while (1) switch (_context.prev = _context.next) {
|
@@ -272,7 +272,7 @@ var ActionButton = function ActionButton(props) {
|
|
272
272
|
},
|
273
273
|
children: label
|
274
274
|
}))
|
275
|
-
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (/*#__PURE__*/_createElement(_Button, _objectSpread(_objectSpread({}, rest), {}, {
|
275
|
+
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : ( /*#__PURE__*/_createElement(_Button, _objectSpread(_objectSpread({}, rest), {}, {
|
276
276
|
key: "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index),
|
277
277
|
type: "text",
|
278
278
|
onClick: function onClick(e) {
|
@@ -55,7 +55,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
55
55
|
return _toolbarProps;
|
56
56
|
}, [props.toolbarProps]);
|
57
57
|
var handleClick = /*#__PURE__*/function () {
|
58
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(defaultCallback, callback, item) {
|
58
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(defaultCallback, callback, item) {
|
59
59
|
var value, data;
|
60
60
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
61
61
|
while (1) switch (_context.prev = _context.next) {
|
@@ -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 (/*#__PURE__*/React.isValidElement(objValue) && /*#__PURE__*/React.isValidElement(othValue)) {
|
26
|
+
if ( /*#__PURE__*/React.isValidElement(objValue) && /*#__PURE__*/React.isValidElement(othValue)) {
|
27
27
|
return true;
|
28
28
|
}
|
29
29
|
// 移除解决formlist函数里不更新问题
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
4
|
-
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView"];
|
4
|
+
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView", "viewRender"];
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
6
|
import React from 'react';
|
7
7
|
import ConfirmWrapper from '../../../../components/render/ConfirmWrapper';
|
@@ -42,6 +42,7 @@ var ComRender = function ComRender(props) {
|
|
42
42
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
43
43
|
valueType = props.valueType,
|
44
44
|
isView = props.isView,
|
45
|
+
viewRender = props.viewRender,
|
45
46
|
rest = _objectWithoutProperties(props, _excluded);
|
46
47
|
var TypeComponent = componentMap[type];
|
47
48
|
var mergedGetValueProps = getValueProps || function (val) {
|
@@ -49,7 +50,17 @@ var ComRender = function ComRender(props) {
|
|
49
50
|
};
|
50
51
|
var _props = mergedGetValueProps(fieldProps.value);
|
51
52
|
var componentProps = _objectSpread(_objectSpread(_objectSpread({}, fieldProps), rest), _props);
|
52
|
-
|
53
|
+
if (viewRender && isView) {
|
54
|
+
return _jsx(FieldProvider, {
|
55
|
+
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
56
|
+
valueType: valueType,
|
57
|
+
type: type,
|
58
|
+
isView: isView
|
59
|
+
}),
|
60
|
+
children: viewRender(componentProps)
|
61
|
+
});
|
62
|
+
}
|
63
|
+
var Component = component ? ( /*#__PURE__*/React.cloneElement(component, _objectSpread({}, componentProps))) : _jsx(TypeComponent, _objectSpread({}, componentProps));
|
53
64
|
var Com = getComRender(Component, props, componentProps);
|
54
65
|
return _jsx(FieldProvider, {
|
55
66
|
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
@@ -26,7 +26,8 @@ var Group = function Group(props) {
|
|
26
26
|
value = props.value,
|
27
27
|
onChange = props.onChange,
|
28
28
|
otherProps = props.otherProps,
|
29
|
-
id = props.id
|
29
|
+
id = props.id,
|
30
|
+
isParentView = props.isView;
|
30
31
|
var contextProps = ProForm.useFieldProps() || {};
|
31
32
|
var names = contextProps.names,
|
32
33
|
name = contextProps.name,
|
@@ -71,7 +72,7 @@ var Group = function Group(props) {
|
|
71
72
|
children: columns.map(function (column, index) {
|
72
73
|
return _jsx(ComRender, _objectSpread(_objectSpread({
|
73
74
|
contextProps: contextProps,
|
74
|
-
isView: isView
|
75
|
+
isView: isParentView || isView
|
75
76
|
}, column), {}, {
|
76
77
|
otherProps: otherProps
|
77
78
|
}), column.name);
|
@@ -82,7 +83,7 @@ var Group = function Group(props) {
|
|
82
83
|
children: columns.map(function (column, index) {
|
83
84
|
return _jsx(ComRender, _objectSpread(_objectSpread({
|
84
85
|
contextProps: contextProps,
|
85
|
-
isView: isView
|
86
|
+
isView: isParentView || isView
|
86
87
|
}, column), {}, {
|
87
88
|
otherProps: otherProps
|
88
89
|
}), column.name);
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ProCascaderProps } from './propsType';
|
3
|
-
declare const _default: import("react").MemoExoticComponent<(props: ProCascaderProps) =>
|
3
|
+
declare const _default: import("react").MemoExoticComponent<(props: ProCascaderProps) => JSX.Element>;
|
4
4
|
export default _default;
|
@@ -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) {
|
@@ -101,7 +101,7 @@ var ProCascader = function ProCascader(props) {
|
|
101
101
|
}, [dics === null || dics === void 0 ? void 0 : dics[addressCode], enumData]);
|
102
102
|
var realDataSource = useMemo(function () {
|
103
103
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
104
|
-
var result = transformDataName(isAddressMode && realLevel === 2 ?
|
104
|
+
var result = transformDataName(isAddressMode && realLevel === 2 ? filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
105
105
|
return result;
|
106
106
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
107
107
|
var _useRequest = _objectSpread({}, useRequest),
|
@@ -117,7 +117,7 @@ var ProCascader = function ProCascader(props) {
|
|
117
117
|
defaultLabel = _useState4[0],
|
118
118
|
setDefaultLabel = _useState4[1];
|
119
119
|
var getFirstLevelOptions = /*#__PURE__*/function () {
|
120
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
120
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
121
121
|
var _yield$service, data, newData, transFormData, serviceData;
|
122
122
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
123
123
|
while (1) switch (_context.prev = _context.next) {
|
@@ -136,7 +136,7 @@ var ProCascader = function ProCascader(props) {
|
|
136
136
|
value: fieldNames.value,
|
137
137
|
children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
|
138
138
|
});
|
139
|
-
serviceData = isAddressMode && realLevel === 2 ?
|
139
|
+
serviceData = isAddressMode && realLevel === 2 ? filterDataSource(transFormData, level, fieldNames) : transFormData;
|
140
140
|
setServiceData(serviceData);
|
141
141
|
case 9:
|
142
142
|
case "end":
|
@@ -206,7 +206,7 @@ var ProCascader = function ProCascader(props) {
|
|
206
206
|
})) === null || _ref5$filter === void 0 ? void 0 : _ref5$filter.join(separator)) || '-' : (defaultLabel === null || defaultLabel === void 0 ? void 0 : (_defaultLabel$filter = defaultLabel.filter(function (item) {
|
207
207
|
return !!item;
|
208
208
|
})) === null || _defaultLabel$filter === void 0 ? void 0 : _defaultLabel$filter.join(separator)) || '-';
|
209
|
-
var
|
209
|
+
var findSelectedOptions = function findSelectedOptions(options, value) {
|
210
210
|
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
211
211
|
var _value = value !== null && value !== void 0 ? value : [];
|
212
212
|
// 基准情况:如果 value 数组为空,且 path 不为空,说明找到了完整的路径
|
@@ -225,7 +225,7 @@ var ProCascader = function ProCascader(props) {
|
|
225
225
|
if (foundOption) {
|
226
226
|
// 如果找到了匹配的选项,并且还有更多的 value 需要匹配,递归地在子选项中查找
|
227
227
|
if (_value.length > 1 && foundOption.children) {
|
228
|
-
return
|
228
|
+
return findSelectedOptions(foundOption.children, _value.slice(1), [].concat(_toConsumableArray(path), [foundOption]));
|
229
229
|
}
|
230
230
|
// 如果没有更多的 value 需要匹配,返回当前选项(以及之前的路径)
|
231
231
|
return [].concat(_toConsumableArray(path), [foundOption]);
|
@@ -234,7 +234,7 @@ var ProCascader = function ProCascader(props) {
|
|
234
234
|
return null;
|
235
235
|
};
|
236
236
|
var _selectedOptions = useMemo(function () {
|
237
|
-
return
|
237
|
+
return findSelectedOptions(service ? serviceData : realDataSource, addressValue);
|
238
238
|
}, [service, serviceData, realDataSource, addressValue]);
|
239
239
|
var handleAddressChange = function handleAddressChange(e) {
|
240
240
|
var cascaderValue = value === null || value === void 0 ? void 0 : value.slice(0, realLevel);
|
@@ -24,7 +24,7 @@ var useDefaultOptions = function useDefaultOptions(options) {
|
|
24
24
|
});
|
25
25
|
};
|
26
26
|
var defaultService = /*#__PURE__*/function () {
|
27
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
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:
|
@@ -252,7 +252,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
252
252
|
onChange(val, option);
|
253
253
|
};
|
254
254
|
var handleClick = /*#__PURE__*/function () {
|
255
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
255
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
256
256
|
var _yield$beforeOpen, res;
|
257
257
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
258
258
|
while (1) switch (_context.prev = _context.next) {
|
@@ -319,7 +319,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
319
319
|
}
|
320
320
|
};
|
321
321
|
var handleFinish = /*#__PURE__*/function () {
|
322
|
-
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
322
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
323
323
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
324
324
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
325
325
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -384,7 +384,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
384
384
|
};
|
385
385
|
}();
|
386
386
|
var handleSearch = /*#__PURE__*/function () {
|
387
|
-
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
387
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
388
388
|
var values;
|
389
389
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
390
390
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -457,7 +457,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
457
457
|
};
|
458
458
|
// 初始化回显,当传入initParams时,前端用来回险
|
459
459
|
var getInitValues = /*#__PURE__*/function () {
|
460
|
-
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
460
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
461
461
|
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
462
462
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
463
463
|
while (1) switch (_context4.prev = _context4.next) {
|
@@ -520,7 +520,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
520
520
|
}();
|
521
521
|
// 初始化回显,当传入initParams时,前端用来回险
|
522
522
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
523
|
-
var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
523
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
524
524
|
var _useRequest$options4, _useRequest$options5;
|
525
525
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
526
526
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
@@ -845,7 +845,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
845
845
|
onOk: handleFinish,
|
846
846
|
// @ts-ignore
|
847
847
|
onCancel: handleClose,
|
848
|
-
visible: visible
|
848
|
+
visible: visible,
|
849
|
+
zIndex: 1071
|
849
850
|
}, restModalProps), {}, {
|
850
851
|
children: [_jsx(ProForm, {
|
851
852
|
submitOnEnter: true,
|