@zat-design/sisyphus-react 3.9.8-beta.1 → 3.9.8-beta.10
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 +0 -5
- package/dist/less.esm.css +0 -5
- 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 +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 +51 -11
- 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 +28 -19
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderToolbar/index.js +17 -15
- package/es/ProEditTable/components/Summary/index.d.ts +1 -1
- package/es/ProEditTable/index.js +1 -1
- package/es/ProEditTable/propsType.d.ts +5 -3
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/config.js +2 -2
- package/es/ProEditTable/utils/diffOriginal.d.ts +1 -1
- package/es/ProEditTable/utils/diffOriginal.js +21 -22
- package/es/ProEditTable/utils/index.js +37 -33
- 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 +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/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.js +1 -1
- package/es/ProForm/components/combination/Group/index.js +7 -2
- package/es/ProForm/components/combination/Group/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/Group/utils.d.ts +6 -1
- package/es/ProForm/components/combination/Group/utils.js +28 -6
- 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 +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 +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/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +25 -13
- package/es/ProForm/components/render/RenderFields.d.ts +1 -0
- package/es/ProForm/components/render/RenderFields.js +8 -4
- package/es/ProForm/components/render/propsType.d.ts +3 -1
- package/es/ProForm/index.js +6 -3
- package/es/ProForm/propsType.d.ts +3 -0
- package/es/ProForm/utils/diffOriginal.js +9 -2
- package/es/ProForm/utils/index.js +10 -14
- package/es/ProForm/utils/useForm.js +1 -1
- package/es/ProForm/utils/useShouldUpdate.js +25 -5
- package/es/ProForm/utils/valueType.d.ts +8 -0
- package/es/ProForm/utils/valueType.js +98 -33
- 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/components/ProHeader/style/index.less +0 -8
- 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 +4 -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 +8 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.d.ts +2 -0
- package/es/ProTable/components/RenderColumn/index.js +10 -2
- 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 +7 -6
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +5 -5
- package/es/ProTable/propsType.d.ts +2 -0
- package/es/ProTable/utils/index.d.ts +4 -0
- package/es/ProTable/utils/index.js +15 -0
- 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 +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 +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/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 +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 +51 -11
- 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 +27 -18
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderToolbar/index.js +17 -15
- package/lib/ProEditTable/components/Summary/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +1 -1
- package/lib/ProEditTable/propsType.d.ts +5 -3
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/config.js +2 -2
- package/lib/ProEditTable/utils/diffOriginal.d.ts +1 -1
- package/lib/ProEditTable/utils/diffOriginal.js +21 -22
- package/lib/ProEditTable/utils/index.js +37 -33
- 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 +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/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.js +1 -1
- package/lib/ProForm/components/combination/Group/index.js +7 -2
- package/lib/ProForm/components/combination/Group/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/utils.d.ts +6 -1
- package/lib/ProForm/components/combination/Group/utils.js +28 -6
- 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 +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 +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/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +25 -13
- package/lib/ProForm/components/render/RenderFields.d.ts +1 -0
- package/lib/ProForm/components/render/RenderFields.js +8 -4
- package/lib/ProForm/components/render/propsType.d.ts +3 -1
- package/lib/ProForm/index.js +6 -3
- package/lib/ProForm/propsType.d.ts +3 -0
- package/lib/ProForm/utils/diffOriginal.js +9 -2
- package/lib/ProForm/utils/index.js +10 -10
- package/lib/ProForm/utils/useForm.js +1 -1
- package/lib/ProForm/utils/useShouldUpdate.js +25 -5
- package/lib/ProForm/utils/valueType.d.ts +8 -0
- package/lib/ProForm/utils/valueType.js +99 -34
- 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/components/ProHeader/style/index.less +0 -8
- 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 +4 -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/RenderColumn/index.d.ts +2 -0
- package/lib/ProTable/components/RenderColumn/index.js +10 -2
- 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 +6 -5
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +5 -5
- package/lib/ProTable/propsType.d.ts +2 -0
- package/lib/ProTable/utils/index.d.ts +4 -0
- package/lib/ProTable/utils/index.js +17 -1
- 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 +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 +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/package.json +1 -1
@@ -30,7 +30,7 @@ var _utils = require("../../../ProForm/utils");
|
|
30
30
|
var _ConfirmWrapper = _interopRequireDefault(require("../../../ProForm/components/render/ConfirmWrapper"));
|
31
31
|
var _getDefaultProps = require("../../utils/getDefaultProps");
|
32
32
|
var _ListChangedWrapper = _interopRequireDefault(require("./ListChangedWrapper"));
|
33
|
-
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "onDiff", "className", "trim", "confirm", "dependencies"];
|
33
|
+
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "onDiff", "className", "trim", "confirm", "dependencies", "desensitization"];
|
34
34
|
/* eslint-disable prefer-destructuring */
|
35
35
|
/* eslint-disable prefer-const */
|
36
36
|
var RenderField = function RenderField(_ref) {
|
@@ -64,6 +64,7 @@ var RenderField = function RenderField(_ref) {
|
|
64
64
|
trim = column.trim,
|
65
65
|
confirm = column.confirm,
|
66
66
|
dependencies = column.dependencies,
|
67
|
+
desensitization = column.desensitization,
|
67
68
|
resetProps = (0, _objectWithoutProperties2.default)(column, _excluded);
|
68
69
|
// editRender弃用使用component同ProForm
|
69
70
|
var _editRender = component || editRender;
|
@@ -89,6 +90,7 @@ var RenderField = function RenderField(_ref) {
|
|
89
90
|
var _required = required;
|
90
91
|
var _valueType = valueType;
|
91
92
|
var _disabled = false;
|
93
|
+
var _desensitization = desensitization || [];
|
92
94
|
var isCell = mode === 'cell';
|
93
95
|
if (isCell) {
|
94
96
|
record['is-view'] = !(0, _lodash.isEqual)(cellNamePath, cellName);
|
@@ -125,6 +127,9 @@ var RenderField = function RenderField(_ref) {
|
|
125
127
|
if ((0, _lodash.isFunction)(valueType)) {
|
126
128
|
_valueType = valueType.apply(void 0, rowParams);
|
127
129
|
}
|
130
|
+
if ((0, _lodash.isFunction)(desensitization)) {
|
131
|
+
_desensitization = desensitization.apply(void 0, rowParams);
|
132
|
+
}
|
128
133
|
// 获取最终的disabled
|
129
134
|
_disabled = (0, _tools.getDisabled)({
|
130
135
|
globalControl: otherProps === null || otherProps === void 0 ? void 0 : otherProps.globalControl,
|
@@ -136,9 +141,9 @@ var RenderField = function RenderField(_ref) {
|
|
136
141
|
});
|
137
142
|
if (typeof isEditable === 'function') {
|
138
143
|
isEditable = isEditable.apply(void 0, rowParams);
|
139
|
-
setTimeout(
|
140
|
-
|
141
|
-
}, 100);
|
144
|
+
// setTimeout(() => {
|
145
|
+
// !isEditable && form.validateFields([cellName]);
|
146
|
+
// }, 100);
|
142
147
|
}
|
143
148
|
// 是否只读文本
|
144
149
|
var isView = !isEditable || (record === null || record === void 0 ? void 0 : record['is-view']) || config.isView || virtualKey && !isEditing || (0, _tools.getDisabled)({
|
@@ -196,21 +201,23 @@ var RenderField = function RenderField(_ref) {
|
|
196
201
|
* 配置valueType时,基于formItem的normalize与getValueProps进行值类型转换
|
197
202
|
* @returns {}
|
198
203
|
*/
|
199
|
-
var valueTypeTransform =
|
200
|
-
var _fieldProps3;
|
201
|
-
// 不存在valueType返回空
|
202
|
-
if (!_valueType) {
|
203
|
-
return {};
|
204
|
-
}
|
204
|
+
var valueTypeTransform = function valueTypeTransform() {
|
205
|
+
var _fieldProps3, _desensitization2;
|
205
206
|
// SwitchCheckbox默认YN, 兼容已有组件
|
206
207
|
if (type === 'SwitchCheckbox') {
|
207
208
|
_valueType = 'switch';
|
208
209
|
}
|
209
210
|
var params = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, column), {}, {
|
210
|
-
mode: (_fieldProps3 = _fieldProps) === null || _fieldProps3 === void 0 ? void 0 : _fieldProps3.mode
|
211
|
+
mode: (_fieldProps3 = _fieldProps) === null || _fieldProps3 === void 0 ? void 0 : _fieldProps3.mode,
|
212
|
+
desensitization: _desensitization
|
211
213
|
});
|
214
|
+
var isDesensit = sessionStorage.getItem(otherProps === null || otherProps === void 0 ? void 0 : otherProps.desensitizationKey);
|
215
|
+
// 仅查看模式下进行数据脱敏
|
216
|
+
if (((_desensitization2 = _desensitization) === null || _desensitization2 === void 0 ? void 0 : _desensitization2.length) && _disabled && isDesensit === 'ON') {
|
217
|
+
_valueType = 'desensitization';
|
218
|
+
}
|
212
219
|
return (0, _lodash.isFunction)(_valueType2.default[_valueType]) ? _valueType2.default[_valueType](params) : {};
|
213
|
-
}
|
220
|
+
};
|
214
221
|
if ((_names = names) === null || _names === void 0 ? void 0 : _names.length) {
|
215
222
|
// 支持names配置,临时生成对应的formItem,用来存储单个对应的值
|
216
223
|
names = names.map(function (key) {
|
@@ -254,7 +261,7 @@ var RenderField = function RenderField(_ref) {
|
|
254
261
|
if (typeof _editRender === 'function') {
|
255
262
|
TargetComponent = _editRender.apply(void 0, rowParams);
|
256
263
|
}
|
257
|
-
if (/*#__PURE__*/_react.default.isValidElement(_editRender)) {
|
264
|
+
if ( /*#__PURE__*/_react.default.isValidElement(_editRender)) {
|
258
265
|
TargetComponent = _editRender;
|
259
266
|
}
|
260
267
|
}
|
@@ -270,7 +277,7 @@ var RenderField = function RenderField(_ref) {
|
|
270
277
|
children: View
|
271
278
|
});
|
272
279
|
}
|
273
|
-
if (/*#__PURE__*/_react.default.isValidElement(viewRender)) {
|
280
|
+
if ( /*#__PURE__*/_react.default.isValidElement(viewRender)) {
|
274
281
|
TargetComponent = viewRender;
|
275
282
|
}
|
276
283
|
}
|
@@ -313,7 +320,7 @@ var RenderField = function RenderField(_ref) {
|
|
313
320
|
}, 100);
|
314
321
|
};
|
315
322
|
// 单元格更新数据时,加个防抖,防止更新频率过快,卡顿
|
316
|
-
var _onChange = (0, _lodash.debounce)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
323
|
+
var _onChange = (0, _lodash.debounce)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
317
324
|
var _len2,
|
318
325
|
args,
|
319
326
|
_key2,
|
@@ -427,7 +434,7 @@ var RenderField = function RenderField(_ref) {
|
|
427
434
|
}, _callee);
|
428
435
|
})), 300);
|
429
436
|
var _onblur = /*#__PURE__*/function () {
|
430
|
-
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
437
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
431
438
|
var _TargetComponent3, _TargetComponent3$pro, _TargetComponent$prop4;
|
432
439
|
var _len3,
|
433
440
|
args,
|
@@ -524,6 +531,7 @@ var RenderField = function RenderField(_ref) {
|
|
524
531
|
onBlur: _onblur,
|
525
532
|
index: index,
|
526
533
|
confirm: confirm,
|
534
|
+
desensitization: _desensitization,
|
527
535
|
otherProps: {
|
528
536
|
form: form,
|
529
537
|
names: names,
|
@@ -532,7 +540,8 @@ var RenderField = function RenderField(_ref) {
|
|
532
540
|
listName: cellName,
|
533
541
|
viewEmpty: viewEmpty,
|
534
542
|
valueType: _valueType,
|
535
|
-
isView: isView
|
543
|
+
isView: isView,
|
544
|
+
desensitizationKey: otherProps === null || otherProps === void 0 ? void 0 : otherProps.desensitizationKey
|
536
545
|
}
|
537
546
|
});
|
538
547
|
componentProps = (0, _lodash.omit)(componentProps, ['onFieldChange', 'namePath', 'index']);
|
@@ -563,7 +572,7 @@ var RenderField = function RenderField(_ref) {
|
|
563
572
|
var getFieldItem = function getFieldItem() {
|
564
573
|
var _componentProps;
|
565
574
|
var FormItem = null;
|
566
|
-
var FieldComponent = /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? (/*#__PURE__*/_react.default.cloneElement(TargetComponent, componentProps)) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, componentProps));
|
575
|
+
var FieldComponent = /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? ( /*#__PURE__*/_react.default.cloneElement(TargetComponent, componentProps)) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, componentProps));
|
567
576
|
if (originalValues && !getIsNew(record)) {
|
568
577
|
FieldComponent = (0, _jsxRuntime.jsx)(_ListChangedWrapper.default, {
|
569
578
|
name: cellName,
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const RenderToolbar: (config: any) =>
|
1
|
+
declare const RenderToolbar: (config: any) => JSX.Element;
|
2
2
|
export default RenderToolbar;
|
@@ -25,10 +25,8 @@ var RenderToolbar = function RenderToolbar(config) {
|
|
25
25
|
virtualKey = config.virtualKey,
|
26
26
|
form = config.form,
|
27
27
|
disabled = config.disabled,
|
28
|
-
selectedRows = config.selectedRows,
|
29
28
|
tableLength = config.tableLength;
|
30
29
|
var virtualName = (0, _tools.getNamePath)(name, virtualKey);
|
31
|
-
var dataSource = form.getFieldValue(name);
|
32
30
|
// toolbarProps配置为false 默认不插入
|
33
31
|
if (toolbarProps === false || disabled) {
|
34
32
|
return null;
|
@@ -82,29 +80,33 @@ var RenderToolbar = function RenderToolbar(config) {
|
|
82
80
|
toolbar.show = show !== null && show !== void 0 ? show : true;
|
83
81
|
toolbar.needConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : true;
|
84
82
|
toolbar.onEvent = /*#__PURE__*/function () {
|
85
|
-
var
|
86
|
-
var onEvent, result;
|
83
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(record, _ref) {
|
84
|
+
var index, form, name, namePath, tableLength, onEvent, result;
|
87
85
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
88
86
|
while (1) switch (_context.prev = _context.next) {
|
89
87
|
case 0:
|
88
|
+
index = _ref.index, form = _ref.form, name = _ref.name, namePath = _ref.namePath, tableLength = _ref.tableLength;
|
90
89
|
onEvent = onClick || onHandle;
|
91
90
|
if (onEvent) {
|
92
|
-
_context.next =
|
91
|
+
_context.next = 6;
|
93
92
|
break;
|
94
93
|
}
|
95
94
|
result = true;
|
96
|
-
_context.next =
|
95
|
+
_context.next = 9;
|
97
96
|
break;
|
98
|
-
case
|
99
|
-
_context.next =
|
100
|
-
return onEvent === null || onEvent === void 0 ? void 0 : onEvent(
|
97
|
+
case 6:
|
98
|
+
_context.next = 8;
|
99
|
+
return onEvent === null || onEvent === void 0 ? void 0 : onEvent(record, {
|
100
|
+
index: index,
|
101
101
|
form: form,
|
102
|
-
|
102
|
+
name: name,
|
103
|
+
namePath: namePath,
|
104
|
+
tableLength: tableLength
|
103
105
|
});
|
104
|
-
case 7:
|
105
|
-
result = _context.sent;
|
106
106
|
case 8:
|
107
|
-
|
107
|
+
result = _context.sent;
|
108
|
+
case 9:
|
109
|
+
if (result !== false && type !== 'custom') {
|
108
110
|
_config.actions[type]((0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
|
109
111
|
index: index,
|
110
112
|
record: record,
|
@@ -113,14 +115,14 @@ var RenderToolbar = function RenderToolbar(config) {
|
|
113
115
|
virtualName: virtualName
|
114
116
|
}));
|
115
117
|
}
|
116
|
-
case
|
118
|
+
case 10:
|
117
119
|
case "end":
|
118
120
|
return _context.stop();
|
119
121
|
}
|
120
122
|
}, _callee);
|
121
123
|
}));
|
122
124
|
return function (_x, _x2) {
|
123
|
-
return
|
125
|
+
return _ref2.apply(this, arguments);
|
124
126
|
};
|
125
127
|
}();
|
126
128
|
toolbar.buttonProps = buttonProps;
|
@@ -8,5 +8,5 @@ interface SummaryProps<T = any> {
|
|
8
8
|
};
|
9
9
|
rowSelection: any;
|
10
10
|
}
|
11
|
-
declare const Summary: ({ data, summary, rowSelection, }: SummaryProps) =>
|
11
|
+
declare const Summary: ({ data, summary, rowSelection, }: SummaryProps) => JSX.Element;
|
12
12
|
export default Summary;
|
@@ -300,7 +300,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
300
300
|
}, [value, config.name]);
|
301
301
|
var _columns = (0, _react.useMemo)(function () {
|
302
302
|
return (0, _utils.transformColumns)(columns, config);
|
303
|
-
}, [valueChangeRef.current, disabled, forceUpdate, columns, page, actionProps, editingKeys, cellNamePath]);
|
303
|
+
}, [valueChangeRef.current, disabled, forceUpdate, columns, page, actionProps, editingKeys, cellNamePath, value === null || value === void 0 ? void 0 : value.length]);
|
304
304
|
var initDataSource = function initDataSource() {
|
305
305
|
var _value$every, _value$some;
|
306
306
|
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) {
|
@@ -11,9 +11,11 @@ import { ProFormValueType, ColumnPropsMap } from '../ProForm/components/render/p
|
|
11
11
|
import { DiffOriginalParams } from '../ProForm/utils/diffOriginal';
|
12
12
|
export type ActionType = 'edit' | 'delete' | 'save' | 'cancel' | 'add' | 'mulDelete' | 'custom';
|
13
13
|
export type ShowFunction<T> = (record?: T, options?: {
|
14
|
-
index
|
15
|
-
form
|
16
|
-
|
14
|
+
index: number;
|
15
|
+
form: FormInstance;
|
16
|
+
name: NamePath;
|
17
|
+
namePath: NamePath;
|
18
|
+
tableLength: number;
|
17
19
|
}) => Promise<any> | boolean | void;
|
18
20
|
export interface OptionsProps {
|
19
21
|
index: number;
|
@@ -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[];
|
@@ -69,7 +69,7 @@ var actions = exports.actions = {
|
|
69
69
|
});
|
70
70
|
},
|
71
71
|
save: function () {
|
72
|
-
var _save = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_ref2) {
|
72
|
+
var _save = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_ref2) {
|
73
73
|
var record, editingKeys, setState, form, rowName, virtualRowName, result, updateData, nextEditingKeys, values;
|
74
74
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
75
75
|
while (1) switch (_context.prev = _context.next) {
|
@@ -172,7 +172,7 @@ var actions = exports.actions = {
|
|
172
172
|
}
|
173
173
|
},
|
174
174
|
add: function () {
|
175
|
-
var _add = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref5) {
|
175
|
+
var _add = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref5) {
|
176
176
|
var _tableRef$current$que, _tableRef$current$que2;
|
177
177
|
var result, insertType, editingKeys, setState, form, name, virtualName, virtualKey, onlyOneLineMsg, tableRef, _ref5$prefixCls, prefixCls, nextData, rowKey, addData, nextEditingKeys;
|
178
178
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
@@ -4,7 +4,7 @@ export interface DiffOriginalParams {
|
|
4
4
|
originalValue: any;
|
5
5
|
value: any;
|
6
6
|
form: FormInstance;
|
7
|
-
equalWith?: ({ originValue, originRecord, value, record, index }: {
|
7
|
+
equalWith?: ({ originValue, originRecord, value, record, index, }: {
|
8
8
|
originValue: any;
|
9
9
|
originRecord: any;
|
10
10
|
value: any;
|
@@ -10,7 +10,20 @@ var isEmpty = _utils.validate.isEmpty;
|
|
10
10
|
// 过滤对象中undefined字段
|
11
11
|
// 防止{a: '1'} {a: '1', b: undefined | null}被认为不相等
|
12
12
|
var filterObject = function filterObject(data) {
|
13
|
-
if (!(0, _lodash.isObject)(data) ||
|
13
|
+
if (!(0, _lodash.isObject)(data) || data === null) return data;
|
14
|
+
// ['1', undefined] ['1', ''] 视为相等
|
15
|
+
if (Array.isArray(data)) {
|
16
|
+
// 数组中全是empty值的话 视为null
|
17
|
+
var isFillNull = true;
|
18
|
+
var arr = data.map(function (item) {
|
19
|
+
if (isEmpty(item)) {
|
20
|
+
return null;
|
21
|
+
}
|
22
|
+
isFillNull = false;
|
23
|
+
return item;
|
24
|
+
});
|
25
|
+
return isFillNull ? null : arr;
|
26
|
+
}
|
14
27
|
var resData = {};
|
15
28
|
Object.keys(data).forEach(function (key) {
|
16
29
|
if (!isEmpty(data[key])) {
|
@@ -47,25 +60,11 @@ var diffOriginal = exports.diffOriginal = function diffOriginal(params) {
|
|
47
60
|
}
|
48
61
|
var _value = filterObject(value);
|
49
62
|
var _originalValue = filterObject(originalValue);
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
// 如果两个值有一个不是空值, 则进行深比较
|
58
|
-
if (!isEmpty(value === null || value === void 0 ? void 0 : value[index]) || !isEmpty(valueItem)) {
|
59
|
-
return (0, _lodash.isEqual)(value === null || value === void 0 ? void 0 : value[index], valueItem);
|
60
|
-
}
|
61
|
-
return true;
|
62
|
-
});
|
63
|
-
return isSame ? 'same' : 'changed';
|
64
|
-
}
|
65
|
-
return 'changed';
|
66
|
-
}
|
67
|
-
if (!isEmpty(_originalValue) || !isEmpty(_value)) {
|
68
|
-
return (0, _lodash.isEqual)(_value, _originalValue) ? 'same' : 'changed';
|
69
|
-
}
|
70
|
-
return 'same';
|
63
|
+
var isEmptyVal = isEmpty(_value);
|
64
|
+
var isEmptyOrg = isEmpty(_originalValue);
|
65
|
+
// 都为空视为相等
|
66
|
+
if (isEmptyOrg && isEmptyVal) return 'same';
|
67
|
+
// 如果原始值为空 且当前有值的话 视为新增
|
68
|
+
if (isEmptyOrg && !isEmptyVal) return 'add';
|
69
|
+
return (0, _lodash.isEqual)(_value, _originalValue) ? 'same' : 'changed';
|
71
70
|
};
|
@@ -30,7 +30,7 @@ var _excluded = ["type", "label", "show", "needConfirm", "onHandle", "onClick"],
|
|
30
30
|
// 渲染操作栏
|
31
31
|
var getActionColumn = function getActionColumn(config) {
|
32
32
|
var _cloneDeepWith = (0, _lodash.cloneDeepWith)(config, function (value) {
|
33
|
-
if (/*#__PURE__*/_react.default.isValidElement(value)) {
|
33
|
+
if ( /*#__PURE__*/_react.default.isValidElement(value)) {
|
34
34
|
return value;
|
35
35
|
}
|
36
36
|
}),
|
@@ -87,49 +87,53 @@ var getActionColumn = function getActionColumn(config) {
|
|
87
87
|
action.show = show !== null && show !== void 0 ? show : true;
|
88
88
|
action.needConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : true;
|
89
89
|
action.onEvent = /*#__PURE__*/function () {
|
90
|
-
var
|
90
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(record, _ref) {
|
91
91
|
var _form$getFieldValue;
|
92
|
-
var rowName, _record, onEvent, result;
|
92
|
+
var index, form, name, namePath, tableLength, rowName, _record, onEvent, result;
|
93
93
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
94
94
|
while (1) switch (_context.prev = _context.next) {
|
95
95
|
case 0:
|
96
|
+
index = _ref.index, form = _ref.form, name = _ref.name, namePath = _ref.namePath, tableLength = _ref.tableLength;
|
96
97
|
index = _utils.tools.calc(firstIndex, '+', index);
|
97
98
|
rowName = [].concat((0, _toConsumableArray2.default)(virtualRowName), [index]);
|
98
99
|
if (!(type === 'save')) {
|
99
|
-
_context.next =
|
100
|
+
_context.next = 13;
|
100
101
|
break;
|
101
102
|
}
|
102
|
-
_context.prev =
|
103
|
-
_context.next =
|
103
|
+
_context.prev = 4;
|
104
|
+
_context.next = 7;
|
104
105
|
return (0, _tools.customValidate)(validateKeys, form, rowName);
|
105
|
-
case
|
106
|
-
_context.next =
|
106
|
+
case 7:
|
107
|
+
_context.next = 13;
|
107
108
|
break;
|
108
|
-
case
|
109
|
-
_context.prev =
|
110
|
-
_context.t0 = _context["catch"](
|
109
|
+
case 9:
|
110
|
+
_context.prev = 9;
|
111
|
+
_context.t0 = _context["catch"](4);
|
111
112
|
(0, _tools.handleScrollToError)();
|
112
113
|
return _context.abrupt("return", Promise.reject(_context.t0));
|
113
|
-
case
|
114
|
+
case 13:
|
114
115
|
// 编辑状态使用自定义form值,非编辑状态直接使用行数据
|
115
116
|
_record = (_form$getFieldValue = form.getFieldValue(rowName)) !== null && _form$getFieldValue !== void 0 ? _form$getFieldValue : record; // 新增事件可以设置初始默认值,当做函数的出参导出
|
116
117
|
onEvent = onClick || onHandle;
|
117
118
|
if (onEvent) {
|
118
|
-
_context.next =
|
119
|
+
_context.next = 19;
|
119
120
|
break;
|
120
121
|
}
|
121
122
|
result = true;
|
122
|
-
_context.next =
|
123
|
+
_context.next = 22;
|
123
124
|
break;
|
124
|
-
case
|
125
|
-
_context.next =
|
126
|
-
return onEvent === null || onEvent === void 0 ? void 0 : onEvent(_record,
|
125
|
+
case 19:
|
126
|
+
_context.next = 21;
|
127
|
+
return onEvent === null || onEvent === void 0 ? void 0 : onEvent(_record, {
|
127
128
|
form: form,
|
128
|
-
|
129
|
+
index: index,
|
130
|
+
tableLength: tableLength,
|
131
|
+
name: name,
|
132
|
+
namePath: namePath
|
129
133
|
});
|
130
|
-
case 20:
|
131
|
-
result = _context.sent;
|
132
134
|
case 21:
|
135
|
+
result = _context.sent;
|
136
|
+
case 22:
|
133
137
|
if (result !== false && type !== 'custom') {
|
134
138
|
_config.actions[type]((0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
|
135
139
|
rowName: [].concat((0, _toConsumableArray2.default)(name), [index]),
|
@@ -139,14 +143,14 @@ var getActionColumn = function getActionColumn(config) {
|
|
139
143
|
validateKeys: validateKeys
|
140
144
|
}));
|
141
145
|
}
|
142
|
-
case
|
146
|
+
case 23:
|
143
147
|
case "end":
|
144
148
|
return _context.stop();
|
145
149
|
}
|
146
|
-
}, _callee, null, [[
|
150
|
+
}, _callee, null, [[4, 9]]);
|
147
151
|
}));
|
148
152
|
return function (_x, _x2) {
|
149
|
-
return
|
153
|
+
return _ref2.apply(this, arguments);
|
150
154
|
};
|
151
155
|
}();
|
152
156
|
action.buttonProps = buttonProps;
|
@@ -229,16 +233,16 @@ var transformColumns = exports.transformColumns = function transformColumns() {
|
|
229
233
|
if (typeof columnTitle === 'string') {
|
230
234
|
item.originTitle = columnTitle;
|
231
235
|
if (tooltip) {
|
232
|
-
var
|
233
|
-
tooltipTitle =
|
234
|
-
icon =
|
235
|
-
resetProps = (0, _objectWithoutProperties2.default)(
|
236
|
+
var _ref3 = tooltip || {},
|
237
|
+
tooltipTitle = _ref3.title,
|
238
|
+
icon = _ref3.icon,
|
239
|
+
resetProps = (0, _objectWithoutProperties2.default)(_ref3, _excluded2);
|
236
240
|
item.title = (0, _jsxRuntime.jsxs)("span", {
|
237
241
|
className: "pro-edit-table-title pro-edit-table-tooltip",
|
238
242
|
children: [before, columnTitle, (0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
239
243
|
title: tooltipTitle !== null && tooltipTitle !== void 0 ? tooltipTitle : tooltip
|
240
244
|
}, resetProps), {}, {
|
241
|
-
children: icon ? (/*#__PURE__*/_react.default.cloneElement(icon, {
|
245
|
+
children: icon ? ( /*#__PURE__*/_react.default.cloneElement(icon, {
|
242
246
|
className: 'icon-tip'
|
243
247
|
})) : (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
244
248
|
className: "icon-tip",
|
@@ -391,14 +395,14 @@ var transformColumns = exports.transformColumns = function transformColumns() {
|
|
391
395
|
}
|
392
396
|
// cacheMap 用来存储缓存值,若有值后不再请求
|
393
397
|
if (JSON.stringify(cacheMap.current) === '{}') {
|
394
|
-
Promise.all(Object.entries(_cacheMap).map(/*#__PURE__*/function () {
|
395
|
-
var
|
396
|
-
var _item, key, value,
|
398
|
+
Promise.all(Object.entries(_cacheMap).map( /*#__PURE__*/function () {
|
399
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(item) {
|
400
|
+
var _item, key, value, _ref5, service, option;
|
397
401
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
398
402
|
while (1) switch (_context2.prev = _context2.next) {
|
399
403
|
case 0:
|
400
404
|
_item = (0, _slicedToArray2.default)(item, 2), key = _item[0], value = _item[1];
|
401
|
-
|
405
|
+
_ref5 = (value === null || value === void 0 ? void 0 : value.useRequest) || {}, service = _ref5.service, option = _ref5.option;
|
402
406
|
if (!service) {
|
403
407
|
_context2.next = 8;
|
404
408
|
break;
|
@@ -418,7 +422,7 @@ var transformColumns = exports.transformColumns = function transformColumns() {
|
|
418
422
|
}, _callee2);
|
419
423
|
}));
|
420
424
|
return function (_x3) {
|
421
|
-
return
|
425
|
+
return _ref4.apply(this, arguments);
|
422
426
|
};
|
423
427
|
}())).then(function (res) {
|
424
428
|
res.forEach(function (item) {
|
@@ -14,14 +14,14 @@ var getRandom = exports.getRandom = function getRandom() {
|
|
14
14
|
};
|
15
15
|
// 深层次对比两个对象且取出来差异值
|
16
16
|
var difference = exports.difference = function difference(object, base) {
|
17
|
-
var
|
17
|
+
var changes = function changes(object, base) {
|
18
18
|
return (0, _lodash.transform)(object, function (result, value, key) {
|
19
19
|
if (!(0, _lodash.isEqual)(value, base[key])) {
|
20
|
-
result[key] = (0, _lodash.isObject)(value) && (0, _lodash.isObject)(base[key]) ?
|
20
|
+
result[key] = (0, _lodash.isObject)(value) && (0, _lodash.isObject)(base[key]) ? changes(value, base[key]) : value;
|
21
21
|
}
|
22
22
|
});
|
23
23
|
};
|
24
|
-
return
|
24
|
+
return changes(object, base);
|
25
25
|
};
|
26
26
|
// 数组字段循环校验,解决validateFields无法批量校验的问题
|
27
27
|
var customValidate = exports.customValidate = function customValidate(validateKeys, form, rowName) {
|
@@ -214,7 +214,7 @@ var handleScrollToError = exports.handleScrollToError = function handleScrollToE
|
|
214
214
|
*/
|
215
215
|
function cloneDeepFilterNode(value) {
|
216
216
|
return (0, _lodash.cloneDeepWith)(value, function (val) {
|
217
|
-
if (/*#__PURE__*/_react.default.isValidElement(val)) {
|
217
|
+
if ( /*#__PURE__*/_react.default.isValidElement(val)) {
|
218
218
|
return val;
|
219
219
|
}
|
220
220
|
});
|
@@ -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;
|
@@ -59,7 +59,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
59
59
|
staleTime: 6e4 * 60
|
60
60
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
61
61
|
setCache: function () {
|
62
|
-
var _setCache = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(res) {
|
62
|
+
var _setCache = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(res) {
|
63
63
|
var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
|
64
64
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
65
65
|
while (1) switch (_context.prev = _context.next) {
|
@@ -169,7 +169,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
169
169
|
}
|
170
170
|
}));
|
171
171
|
var mergeData = /*#__PURE__*/function () {
|
172
|
-
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
172
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
173
173
|
var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res, _locale$ProEnum6;
|
174
174
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
175
175
|
while (1) switch (_context2.prev = _context2.next) {
|
package/lib/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/lib/ProEnum/index.js
CHANGED
@@ -158,7 +158,7 @@ var ProEnum = function ProEnum(props) {
|
|
158
158
|
list = [];
|
159
159
|
}
|
160
160
|
}
|
161
|
-
if (/*#__PURE__*/_react.default.isValidElement(component)) {
|
161
|
+
if ( /*#__PURE__*/_react.default.isValidElement(component)) {
|
162
162
|
var Component = component;
|
163
163
|
return (0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
|
164
164
|
dataSource: list,
|
@@ -10,7 +10,7 @@ var SimpleEventCenter = /*#__PURE__*/function () {
|
|
10
10
|
this.events = void 0;
|
11
11
|
this.events = new Map();
|
12
12
|
}
|
13
|
-
|
13
|
+
(0, _createClass2.default)(SimpleEventCenter, [{
|
14
14
|
key: "subscribe",
|
15
15
|
value: function subscribe(eventName, callback) {
|
16
16
|
if (!this.events.has(eventName)) {
|
@@ -37,5 +37,6 @@ var SimpleEventCenter = /*#__PURE__*/function () {
|
|
37
37
|
}
|
38
38
|
}
|
39
39
|
}]);
|
40
|
+
return SimpleEventCenter;
|
40
41
|
}(); // 将 eventCenter 实例添加到 window 对象上
|
41
42
|
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;
|
@@ -137,7 +137,7 @@ var ActionButton = function ActionButton(props) {
|
|
137
137
|
return _actionProps;
|
138
138
|
}, [props.actionProps]);
|
139
139
|
var handleClick = /*#__PURE__*/function () {
|
140
|
-
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(defaultCallback, callback, index, item) {
|
140
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(defaultCallback, callback, index, item) {
|
141
141
|
var value, data;
|
142
142
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
143
143
|
while (1) switch (_context.prev = _context.next) {
|
@@ -276,7 +276,7 @@ var ActionButton = function ActionButton(props) {
|
|
276
276
|
},
|
277
277
|
children: label
|
278
278
|
}))
|
279
|
-
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (/*#__PURE__*/(0, _react.createElement)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(rest, filterKeys)), {}, {
|
279
|
+
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : ( /*#__PURE__*/(0, _react.createElement)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(rest, filterKeys)), {}, {
|
280
280
|
key: "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index),
|
281
281
|
type: "text",
|
282
282
|
onClick: function onClick(e) {
|
@@ -20,7 +20,7 @@ var BlockTitle = function BlockTitle(props) {
|
|
20
20
|
if (!title) {
|
21
21
|
return (0, _jsxRuntime.jsx)("div", {});
|
22
22
|
}
|
23
|
-
if (/*#__PURE__*/_react.default.isValidElement(title)) {
|
23
|
+
if ( /*#__PURE__*/_react.default.isValidElement(title)) {
|
24
24
|
return title;
|
25
25
|
}
|
26
26
|
var titleContent = title;
|