@zat-design/sisyphus-react 3.7.3 → 3.8.0-beat.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
- package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
- package/coverage/lcov-report/src/.umi/core/index.html +206 -0
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
- package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
- package/coverage/lcov-report/src/.umi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
- package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
- package/dist/index.esm.css +100 -4
- package/dist/less.esm.css +97 -4
- package/es/ProAction/index.js +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.js +3 -3
- package/es/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/es/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +22 -10
- package/es/ProEditTable/components/RenderField/index.js +8 -8
- package/es/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/es/ProEditTable/utils/config.js +2 -2
- package/es/ProEditTable/utils/index.js +5 -5
- package/es/ProEditTable/utils/tools.js +1 -1
- package/es/ProEnum/components/Group.js +10 -2
- package/es/ProEnum/hooks/useEnumRequest.js +2 -2
- package/es/ProEnum/index.js +6 -5
- package/es/ProEnum/style/index.less +14 -4
- package/es/ProEnum/utils/index.d.ts +1 -1
- package/es/ProEnum/utils/index.js +4 -0
- package/es/ProForm/components/combination/Container/index.js +5 -3
- package/es/ProForm/components/combination/Container/propsType.d.ts +2 -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 +6 -5
- package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/es/ProForm/components/combination/Group/utils.js +8 -1
- package/es/ProForm/components/combination/ProCascader/index.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +50 -45
- package/es/ProForm/components/combination/ProNumberRange/index.js +14 -5
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
- package/es/ProForm/components/old/ProAddress/index.js +1 -1
- package/es/ProForm/components/render/ChangedWrapper.d.ts +17 -0
- package/es/ProForm/components/render/ChangedWrapper.js +108 -0
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +10 -11
- package/es/ProForm/components/render/RenderFields.d.ts +2 -3
- package/es/ProForm/components/render/RenderFields.js +3 -4
- package/es/ProForm/components/render/propsType.d.ts +5 -4
- package/es/ProForm/index.js +4 -7
- package/es/ProForm/propsType.d.ts +13 -2
- package/es/ProForm/style/index.less +103 -5
- package/es/ProForm/utils/diffOriginal.d.ts +4 -4
- package/es/ProForm/utils/diffOriginal.js +18 -7
- package/es/ProForm/utils/transformValue.js +17 -11
- package/es/ProForm/utils/useForm.js +1 -1
- package/es/ProForm/utils/useShouldUpdate.d.ts +2 -2
- package/es/ProForm/utils/useShouldUpdate.js +1 -1
- package/es/ProSelect/index.js +12 -11
- package/es/ProSelect/propsType.d.ts +4 -0
- package/es/ProSelect/utils/index.js +5 -4
- package/es/ProStep/components/Listener/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +6 -3
- package/es/ProStep/index.d.ts +1 -1
- package/es/ProStep/index.js +25 -18
- package/es/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/es/ProTable/components/FormatColumn/index.js +14 -8
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.js +30 -13
- package/es/ProTable/propsType.d.ts +14 -1
- package/es/ProTable/style/index.less +1 -1
- package/es/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/es/ProTree/components/AdaptiveTooltip.js +55 -0
- package/es/ProTree/components/List.js +15 -3
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +28 -8
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
- package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/es/ProTree/components/SearchTitle.d.ts +2 -0
- package/es/ProTree/components/SearchTitle.js +17 -8
- package/es/ProTree/components/Tree.js +1 -1
- package/es/ProTree/style/index.less +14 -0
- package/es/ProTreeModal/components/Tree.js +15 -17
- package/es/ProTreeModal/index.js +62 -7
- package/es/ProTreeModal/utils.d.ts +1 -0
- package/es/ProTreeModal/utils.js +21 -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 +5 -0
- package/es/style/theme/index.less +2 -1
- package/es/style/theme/tokens.less +1 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +13 -0
- package/lib/ProAction/index.js +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.js +3 -3
- package/lib/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/lib/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +25 -11
- package/lib/ProEditTable/components/RenderField/index.js +8 -8
- package/lib/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/lib/ProEditTable/utils/config.js +2 -2
- package/lib/ProEditTable/utils/index.js +5 -5
- package/lib/ProEditTable/utils/tools.js +1 -1
- package/lib/ProEnum/components/Group.js +10 -2
- package/lib/ProEnum/hooks/useEnumRequest.js +2 -2
- package/lib/ProEnum/index.js +6 -5
- package/lib/ProEnum/style/index.less +14 -4
- package/lib/ProEnum/utils/index.d.ts +1 -1
- package/lib/ProEnum/utils/index.js +4 -0
- package/lib/ProForm/components/combination/Container/index.js +5 -3
- package/lib/ProForm/components/combination/Container/propsType.d.ts +2 -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 +5 -4
- package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/lib/ProForm/components/combination/Group/utils.js +8 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +49 -44
- package/lib/ProForm/components/combination/ProNumberRange/index.js +14 -5
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
- package/lib/ProForm/components/old/ProAddress/index.js +1 -1
- package/lib/ProForm/components/render/ChangedWrapper.d.ts +17 -0
- package/lib/ProForm/components/render/ChangedWrapper.js +113 -0
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +10 -11
- package/lib/ProForm/components/render/RenderFields.d.ts +2 -3
- package/lib/ProForm/components/render/RenderFields.js +3 -4
- package/lib/ProForm/components/render/propsType.d.ts +5 -4
- package/lib/ProForm/index.js +4 -7
- package/lib/ProForm/propsType.d.ts +13 -2
- package/lib/ProForm/style/index.less +103 -5
- package/lib/ProForm/utils/diffOriginal.d.ts +4 -4
- package/lib/ProForm/utils/diffOriginal.js +18 -7
- package/lib/ProForm/utils/transformValue.js +17 -11
- package/lib/ProForm/utils/useForm.js +1 -1
- package/lib/ProForm/utils/useShouldUpdate.d.ts +2 -2
- package/lib/ProForm/utils/useShouldUpdate.js +1 -1
- package/lib/ProSelect/index.js +12 -11
- package/lib/ProSelect/propsType.d.ts +4 -0
- package/lib/ProSelect/utils/index.js +5 -4
- package/lib/ProStep/components/Listener/index.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.js +6 -3
- package/lib/ProStep/index.d.ts +1 -1
- package/lib/ProStep/index.js +25 -18
- package/lib/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/lib/ProTable/components/FormatColumn/index.js +14 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.js +30 -13
- package/lib/ProTable/propsType.d.ts +14 -1
- package/lib/ProTable/style/index.less +1 -1
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/lib/ProTree/components/AdaptiveTooltip.js +61 -0
- package/lib/ProTree/components/List.js +15 -3
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +28 -8
- package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
- package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/lib/ProTree/components/SearchTitle.d.ts +2 -0
- package/lib/ProTree/components/SearchTitle.js +19 -7
- package/lib/ProTree/components/Tree.js +1 -1
- package/lib/ProTree/style/index.less +14 -0
- package/lib/ProTreeModal/components/Tree.js +15 -17
- package/lib/ProTreeModal/index.js +61 -6
- package/lib/ProTreeModal/utils.d.ts +1 -0
- package/lib/ProTreeModal/utils.js +20 -0
- 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 +5 -0
- package/lib/style/theme/index.less +2 -1
- package/lib/style/theme/tokens.less +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +19 -0
- package/package.json +3 -1
- package/patches/rc-table+7.26.0.patch +49 -0
- package/es/ProForm/components/render/Changed.d.ts +0 -14
- package/es/ProForm/components/render/Changed.js +0 -64
- package/lib/ProForm/components/render/Changed.d.ts +0 -14
- package/lib/ProForm/components/render/Changed.js +0 -69
- /package/es/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
- /package/es/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
- /package/es/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
- /package/es/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
- /package/lib/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
- /package/lib/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
- /package/lib/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
- /package/lib/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
|
@@ -132,10 +132,10 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
132
132
|
}, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
|
133
133
|
manual: true,
|
|
134
134
|
onSuccess: function onSuccess(res) {
|
|
135
|
-
var _res$data;
|
|
135
|
+
var _res$data, _ref5;
|
|
136
136
|
var list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list : res === null || res === void 0 ? void 0 : res.data;
|
|
137
137
|
setState({
|
|
138
|
-
options: transformResponse ? transformResponse(res === null || res === void 0 ? void 0 : res.data) : list
|
|
138
|
+
options: (_ref5 = transformResponse ? transformResponse(res === null || res === void 0 ? void 0 : res.data) : list) !== null && _ref5 !== void 0 ? _ref5 : []
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
})),
|
|
@@ -161,9 +161,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
161
161
|
};
|
|
162
162
|
var handleFormat = onFormat || defaultOptionRender;
|
|
163
163
|
if (showCodeName) {
|
|
164
|
-
handleFormat = function handleFormat(
|
|
165
|
-
var value =
|
|
166
|
-
label =
|
|
164
|
+
handleFormat = function handleFormat(_ref6) {
|
|
165
|
+
var value = _ref6.value,
|
|
166
|
+
label = _ref6.label;
|
|
167
167
|
return "".concat(value, "-").concat(label);
|
|
168
168
|
};
|
|
169
169
|
}
|
|
@@ -232,7 +232,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
232
232
|
onChange(val, option);
|
|
233
233
|
};
|
|
234
234
|
var handleClick = /*#__PURE__*/function () {
|
|
235
|
-
var
|
|
235
|
+
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
236
236
|
var _yield$beforeOpen, res;
|
|
237
237
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
238
238
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -275,7 +275,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
275
275
|
}, _callee);
|
|
276
276
|
}));
|
|
277
277
|
return function handleClick() {
|
|
278
|
-
return
|
|
278
|
+
return _ref7.apply(this, arguments);
|
|
279
279
|
};
|
|
280
280
|
}();
|
|
281
281
|
var handleClose = function handleClose() {
|
|
@@ -294,7 +294,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
294
294
|
}
|
|
295
295
|
};
|
|
296
296
|
var handleFinish = /*#__PURE__*/function () {
|
|
297
|
-
var
|
|
297
|
+
var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
|
298
298
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
|
299
299
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
300
300
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -355,11 +355,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
355
355
|
}, _callee2, null, [[0, 18]]);
|
|
356
356
|
}));
|
|
357
357
|
return function handleFinish() {
|
|
358
|
-
return
|
|
358
|
+
return _ref8.apply(this, arguments);
|
|
359
359
|
};
|
|
360
360
|
}();
|
|
361
361
|
var handleSearch = /*#__PURE__*/function () {
|
|
362
|
-
var
|
|
362
|
+
var _ref9 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
|
363
363
|
var values;
|
|
364
364
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
|
365
365
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -378,7 +378,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
378
378
|
}, _callee3);
|
|
379
379
|
}));
|
|
380
380
|
return function handleSearch() {
|
|
381
|
-
return
|
|
381
|
+
return _ref9.apply(this, arguments);
|
|
382
382
|
};
|
|
383
383
|
}();
|
|
384
384
|
var _rowSelection = (0, _objectSpread3.default)({
|
|
@@ -432,7 +432,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
432
432
|
};
|
|
433
433
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
434
434
|
var getInitValues = /*#__PURE__*/function () {
|
|
435
|
-
var
|
|
435
|
+
var _ref10 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {
|
|
436
436
|
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
|
437
437
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {
|
|
438
438
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -490,12 +490,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
490
490
|
}, _callee4);
|
|
491
491
|
}));
|
|
492
492
|
return function getInitValues() {
|
|
493
|
-
return
|
|
493
|
+
return _ref10.apply(this, arguments);
|
|
494
494
|
};
|
|
495
495
|
}();
|
|
496
496
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
497
497
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
|
498
|
-
var
|
|
498
|
+
var _ref11 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {
|
|
499
499
|
var _useRequest$options4, _useRequest$options5;
|
|
500
500
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
|
501
501
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {
|
|
@@ -543,7 +543,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
543
543
|
}, _callee5);
|
|
544
544
|
}));
|
|
545
545
|
return function getDefaultOneValues() {
|
|
546
|
-
return
|
|
546
|
+
return _ref11.apply(this, arguments);
|
|
547
547
|
};
|
|
548
548
|
}();
|
|
549
549
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
@@ -574,7 +574,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
574
574
|
});
|
|
575
575
|
}
|
|
576
576
|
});
|
|
577
|
-
(0,
|
|
577
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
578
578
|
if (onOff && !visible) {
|
|
579
579
|
var _useRequest$options6;
|
|
580
580
|
if ((useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options6 = useRequest.options) === null || _useRequest$options6 === void 0 ? void 0 : _useRequest$options6.manual) !== true) {
|
|
@@ -610,34 +610,39 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
610
610
|
setState(nextState);
|
|
611
611
|
}
|
|
612
612
|
}, [onOff, visible, value]);
|
|
613
|
-
(0,
|
|
614
|
-
if (value && !visible && isInit) {
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
pageSize: 50,
|
|
627
|
-
queryBean: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
628
|
-
} : (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
629
|
-
var nextParams = transformParams ? transformParams(params) : params;
|
|
630
|
-
run(nextParams);
|
|
631
|
-
setState({
|
|
632
|
-
isInit: false
|
|
633
|
-
});
|
|
634
|
-
}, 300);
|
|
635
|
-
} else {
|
|
636
|
-
getInitValues();
|
|
613
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
614
|
+
if (value && !visible && isInit && !readOnly) {
|
|
615
|
+
getInitValues();
|
|
616
|
+
}
|
|
617
|
+
}, [value, visible, isInit]);
|
|
618
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
619
|
+
if (value && !visible && readOnly) {
|
|
620
|
+
var _options$some;
|
|
621
|
+
var isHasValue = options === null || options === void 0 ? void 0 : (_options$some = options.some) === null || _options$some === void 0 ? void 0 : _options$some.call(options, function (item) {
|
|
622
|
+
return item[valueKey] === value;
|
|
623
|
+
});
|
|
624
|
+
if (isHasValue) {
|
|
625
|
+
return;
|
|
637
626
|
}
|
|
627
|
+
// 加定时器 修复依赖数据同步更新未取到问题
|
|
628
|
+
setTimeout(function () {
|
|
629
|
+
var _useRequest$options7, _useRequest$options8;
|
|
630
|
+
var initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
|
631
|
+
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
|
632
|
+
var _contentForm$getField2;
|
|
633
|
+
initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField2 = contentForm.getFieldsValue) === null || _contentForm$getField2 === void 0 ? void 0 : _contentForm$getField2.call(contentForm));
|
|
634
|
+
}
|
|
635
|
+
var params = withPagination ? {
|
|
636
|
+
pageNum: 1,
|
|
637
|
+
pageSize: 50,
|
|
638
|
+
queryBean: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
639
|
+
} : (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
640
|
+
var nextParams = transformParams ? transformParams(params) : params;
|
|
641
|
+
run(nextParams);
|
|
642
|
+
}, 300);
|
|
638
643
|
}
|
|
639
|
-
}, [value,
|
|
640
|
-
(0,
|
|
644
|
+
}, [value, options, visible, useRequest]);
|
|
645
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
641
646
|
if (!value) {
|
|
642
647
|
if (defaultOne) {
|
|
643
648
|
getDefaultOneValues();
|
|
@@ -737,7 +742,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
737
742
|
children: customRender
|
|
738
743
|
});
|
|
739
744
|
}
|
|
740
|
-
(0,
|
|
745
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
741
746
|
if (isTooltip && value) {
|
|
742
747
|
var dom = document.getElementById(uuid);
|
|
743
748
|
dom.addEventListener('mouseover', function (e) {
|
|
@@ -774,7 +779,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
774
779
|
}, [value, isTooltip]);
|
|
775
780
|
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
776
781
|
setState({
|
|
777
|
-
options: tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource
|
|
782
|
+
options: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource) || []
|
|
778
783
|
});
|
|
779
784
|
}, [tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource]);
|
|
780
785
|
// 当搜索条件只有一个时,且为输入框,默认设置suffix
|
|
@@ -17,11 +17,9 @@ var _utils = require("@zat-design/utils");
|
|
|
17
17
|
var _Container = _interopRequireDefault(require("../../Container"));
|
|
18
18
|
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
19
19
|
var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
|
20
|
-
var formatAmount = _utils.tools.formatAmount
|
|
21
|
-
formatPercent = _utils.tools.formatPercent,
|
|
22
|
-
formatPerMill = _utils.tools.formatPerMill;
|
|
20
|
+
var formatAmount = _utils.tools.formatAmount;
|
|
23
21
|
var ProNumberRange = function ProNumberRange(props) {
|
|
24
|
-
var _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
|
22
|
+
var _document$querySelect, _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
|
25
23
|
var _props$value = props.value,
|
|
26
24
|
value = _props$value === void 0 ? [] : _props$value,
|
|
27
25
|
_props$onChange = props.onChange,
|
|
@@ -46,6 +44,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
46
44
|
viewEmpty = _ref.viewEmpty,
|
|
47
45
|
valueType = _ref.valueType;
|
|
48
46
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
47
|
+
var addonAfterDomWidth = (_document$querySelect = document.querySelector('.ant-input-number-group-addon')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientWidth;
|
|
49
48
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
50
49
|
range: value || []
|
|
51
50
|
}),
|
|
@@ -91,11 +90,15 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
91
90
|
};
|
|
92
91
|
var cls = (0, _classnames.default)({
|
|
93
92
|
'pro-number-range': true,
|
|
93
|
+
'pro-number-range-after': addonAfter,
|
|
94
|
+
'pro-number-range-before': addonBefore,
|
|
94
95
|
className: className
|
|
95
96
|
});
|
|
96
97
|
// 查看模式
|
|
97
98
|
if (isView || props.isView) {
|
|
98
|
-
if ((0, _lodash.isEmpty)(value)) {
|
|
99
|
+
if ((0, _lodash.isEmpty)(value) || (value === null || value === void 0 ? void 0 : value.every(function (item) {
|
|
100
|
+
return typeof item !== 'number';
|
|
101
|
+
}))) {
|
|
99
102
|
return viewEmpty;
|
|
100
103
|
}
|
|
101
104
|
switch (valueType) {
|
|
@@ -192,6 +195,9 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
192
195
|
},
|
|
193
196
|
addonBefore: addonBefore
|
|
194
197
|
}, valueProps), {}, {
|
|
198
|
+
style: addonAfter ? {
|
|
199
|
+
width: "calc(50% - ".concat(16 + addonAfterDomWidth / 2, "px)")
|
|
200
|
+
} : null,
|
|
195
201
|
min: min !== null && min !== void 0 ? min : (_valueProps = valueProps) === null || _valueProps === void 0 ? void 0 : _valueProps.min,
|
|
196
202
|
max: (_ref2 = (_ref3 = (_value$ = value === null || value === void 0 ? void 0 : value[1]) !== null && _value$ !== void 0 ? _value$ : range[1]) !== null && _ref3 !== void 0 ? _ref3 : max) !== null && _ref2 !== void 0 ? _ref2 : (_valueProps2 = valueProps) === null || _valueProps2 === void 0 ? void 0 : _valueProps2.max
|
|
197
203
|
}, childProps === null || childProps === void 0 ? void 0 : childProps[0])), (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
@@ -212,6 +218,9 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
212
218
|
},
|
|
213
219
|
addonAfter: addonAfter
|
|
214
220
|
}, valueProps), {}, {
|
|
221
|
+
style: addonAfter ? {
|
|
222
|
+
width: "calc(50% - ".concat(16 - addonAfterDomWidth / 2, "px)")
|
|
223
|
+
} : null,
|
|
215
224
|
min: (_ref4 = (_ref5 = (_value$2 = value === null || value === void 0 ? void 0 : value[0]) !== null && _value$2 !== void 0 ? _value$2 : range[0]) !== null && _ref5 !== void 0 ? _ref5 : min) !== null && _ref4 !== void 0 ? _ref4 : (_valueProps3 = valueProps) === null || _valueProps3 === void 0 ? void 0 : _valueProps3.min,
|
|
216
225
|
max: max !== null && max !== void 0 ? max : (_valueProps4 = valueProps) === null || _valueProps4 === void 0 ? void 0 : _valueProps4.max
|
|
217
226
|
}, childProps === null || childProps === void 0 ? void 0 : childProps[1]))]
|
|
@@ -93,7 +93,7 @@ function ProAddress(_ref3) {
|
|
|
93
93
|
secondCitys = _useState6[0],
|
|
94
94
|
setSecondCitys = _useState6[1];
|
|
95
95
|
var queryCity = /*#__PURE__*/function () {
|
|
96
|
-
var _ref5 = (0, _asyncToGenerator2.default)(
|
|
96
|
+
var _ref5 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(code, type) {
|
|
97
97
|
var cityList, _cityList, newList, _secondCitys;
|
|
98
98
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
99
99
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FormInstance } from 'antd';
|
|
2
|
+
import { NamePath } from 'antd/lib/form/interface';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { DiffOriginalParams } from '../../utils/diffOriginal';
|
|
5
|
+
import { DiffConfigProps } from '../../propsType';
|
|
6
|
+
interface Props {
|
|
7
|
+
name?: NamePath;
|
|
8
|
+
names?: NamePath[];
|
|
9
|
+
namesStr?: string;
|
|
10
|
+
diffConfig?: DiffConfigProps;
|
|
11
|
+
form: FormInstance;
|
|
12
|
+
equalWith?: DiffOriginalParams['equalWith'];
|
|
13
|
+
valuePropName?: string;
|
|
14
|
+
[name: string]: any;
|
|
15
|
+
}
|
|
16
|
+
declare const ChangedWrapper: React.FC<Props>;
|
|
17
|
+
export default ChangedWrapper;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
var _antd = require("antd");
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
var _lodash = require("lodash");
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
var _diffOriginal = require("../../utils/diffOriginal");
|
|
18
|
+
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
19
|
+
var _utils = require("../../../utils");
|
|
20
|
+
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName"];
|
|
21
|
+
var ChangedWrapper = function ChangedWrapper(props) {
|
|
22
|
+
var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
|
|
23
|
+
var name = props.name,
|
|
24
|
+
names = props.names,
|
|
25
|
+
namesStr = props.namesStr,
|
|
26
|
+
form = props.form,
|
|
27
|
+
equalWith = props.equalWith,
|
|
28
|
+
children = props.children,
|
|
29
|
+
type = props.type,
|
|
30
|
+
diffConfig = props.diffConfig,
|
|
31
|
+
_props$valuePropName = props.valuePropName,
|
|
32
|
+
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
33
|
+
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
34
|
+
var _useProConfig = (0, _ProConfigProvider.useProConfig)('ProForm'),
|
|
35
|
+
isDiffAll = _useProConfig.isDiffAll;
|
|
36
|
+
var originalValues = diffConfig.originalValues,
|
|
37
|
+
changeTipColor = diffConfig.changeTipColor,
|
|
38
|
+
addTipColor = diffConfig.addTipColor;
|
|
39
|
+
var toolTip = (_diffConfig$toolTip = diffConfig.toolTip) !== null && _diffConfig$toolTip !== void 0 ? _diffConfig$toolTip : true;
|
|
40
|
+
var isWatch = toolTip && !['FormList', 'ProEditTable'].includes(type);
|
|
41
|
+
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
|
42
|
+
return (0, _lodash.get)(originalValues, name);
|
|
43
|
+
}) : (0, _lodash.get)(originalValues, name);
|
|
44
|
+
var noChange = !equalWith && (!originalValues || isDiffAll ? false : (0, _utils.isEmpty)(originalValue));
|
|
45
|
+
var diffType = (0, _react.useMemo)(function () {
|
|
46
|
+
if (!isWatch || noChange) return 'same';
|
|
47
|
+
return (0, _diffOriginal.diffOriginal)({
|
|
48
|
+
originalValue: originalValue,
|
|
49
|
+
value: props[valuePropName],
|
|
50
|
+
form: form,
|
|
51
|
+
equalWith: equalWith
|
|
52
|
+
// name: namesStr || name,
|
|
53
|
+
});
|
|
54
|
+
}, [isWatch, noChange, props[valuePropName], originalValue]);
|
|
55
|
+
var isAdd = diffType === 'add';
|
|
56
|
+
var isChanged = diffType === 'changed';
|
|
57
|
+
var tipContent = (0, _react.useMemo)(function () {
|
|
58
|
+
if (!isWatch || noChange) return undefined;
|
|
59
|
+
return /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), {}, (0, _defineProperty2.default)({
|
|
60
|
+
isView: true
|
|
61
|
+
}, valuePropName, originalValue))) : undefined;
|
|
62
|
+
}, [originalValue, children]);
|
|
63
|
+
if (!isWatch || noChange) {
|
|
64
|
+
// 嵌套子组件
|
|
65
|
+
var isNestedField = ['ProEditTable'].includes(type);
|
|
66
|
+
return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({
|
|
67
|
+
originalValues: isNestedField ? originalValues : undefined
|
|
68
|
+
}, children.props), rest));
|
|
69
|
+
}
|
|
70
|
+
var tipOpenCalc = function tipOpenCalc() {
|
|
71
|
+
if (!toolTip) return false;
|
|
72
|
+
// 传入undefined 鼠标移入显示移出隐藏
|
|
73
|
+
return isChanged ? undefined : false;
|
|
74
|
+
};
|
|
75
|
+
var style = {
|
|
76
|
+
'--zaui-contract-bg': changeTipColor,
|
|
77
|
+
'--zaui-contract-bg-add': addTipColor
|
|
78
|
+
};
|
|
79
|
+
var diffClassName = (0, _classnames.default)({
|
|
80
|
+
'pro-form-item-changed': isChanged,
|
|
81
|
+
'pro-form-item-add': isAdd
|
|
82
|
+
});
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
|
|
85
|
+
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
86
|
+
open: tipOpenCalc(),
|
|
87
|
+
// mouseEnterDelay={1}
|
|
88
|
+
getPopupContainer: function getPopupContainer(target) {
|
|
89
|
+
return target.parentElement;
|
|
90
|
+
},
|
|
91
|
+
title: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
92
|
+
direction: "vertical",
|
|
93
|
+
children: [(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
94
|
+
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
95
|
+
}), _showEllipse && (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
96
|
+
children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest), {}, {
|
|
97
|
+
isView: true
|
|
98
|
+
})) : undefined]
|
|
99
|
+
})]
|
|
100
|
+
}),
|
|
101
|
+
placement: "topLeft",
|
|
102
|
+
children: (0, _jsxRuntime.jsx)("div", {
|
|
103
|
+
className: diffClassName,
|
|
104
|
+
style: style,
|
|
105
|
+
children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest), {}, {
|
|
106
|
+
otherProps: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
|
|
107
|
+
isDiffChange: isChanged
|
|
108
|
+
})
|
|
109
|
+
})) : undefined
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
var _default = exports.default = ChangedWrapper;
|
|
@@ -28,7 +28,7 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
|
28
28
|
var _ProForm$useFieldProp = _index.default.useFieldProps(),
|
|
29
29
|
form = _ProForm$useFieldProp.form;
|
|
30
30
|
var handleChange = /*#__PURE__*/function () {
|
|
31
|
-
var _ref = (0, _asyncToGenerator2.default)(
|
|
31
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(value) {
|
|
32
32
|
var _len,
|
|
33
33
|
other,
|
|
34
34
|
_key,
|
|
@@ -26,7 +26,7 @@ var _valueType = _interopRequireDefault(require("../../utils/valueType"));
|
|
|
26
26
|
var _tip = _interopRequireDefault(require("../../../assets/tip.svg"));
|
|
27
27
|
var _useRules = _interopRequireDefault(require("../../utils/useRules"));
|
|
28
28
|
var _ConfirmWrapper = _interopRequireDefault(require("./ConfirmWrapper"));
|
|
29
|
-
var
|
|
29
|
+
var _ChangedWrapper = _interopRequireDefault(require("./ChangedWrapper"));
|
|
30
30
|
var _excluded = ["labelWidth", "hiddenNames", "trim", "upperCase", "className", "rules", "required", "labelRequired", "tooltip"];
|
|
31
31
|
/* eslint-disable prefer-destructuring */
|
|
32
32
|
// 这个组件只管渲染, 参数的整理在外部处理
|
|
@@ -46,12 +46,11 @@ var Render = function Render(props) {
|
|
|
46
46
|
formDisabled = props.formDisabled,
|
|
47
47
|
type = props.type,
|
|
48
48
|
isSelect = props.isSelect,
|
|
49
|
-
originalValues = props.originalValues,
|
|
50
49
|
equalWith = props.equalWith,
|
|
51
50
|
requiredOnView = props.requiredOnView,
|
|
52
|
-
originalDiffTip = props.originalDiffTip,
|
|
53
51
|
confirm = props.confirm,
|
|
54
|
-
globalControl = props.globalControl
|
|
52
|
+
globalControl = props.globalControl,
|
|
53
|
+
diffConfig = props.diffConfig;
|
|
55
54
|
var colProps = props.colProps;
|
|
56
55
|
// 剔除一些不是FormItem的属性, 防止控制台报warning
|
|
57
56
|
var labelWidth = formItemProps.labelWidth,
|
|
@@ -241,7 +240,7 @@ var Render = function Render(props) {
|
|
|
241
240
|
_args = functionArgs([].concat(args));
|
|
242
241
|
}
|
|
243
242
|
var inList = _otherFormItemProps === null || _otherFormItemProps === void 0 ? void 0 : (_otherFormItemProps$n3 = _otherFormItemProps.namePath) === null || _otherFormItemProps$n3 === void 0 ? void 0 : _otherFormItemProps$n3.length;
|
|
244
|
-
if (
|
|
243
|
+
if (/*#__PURE__*/_react.default.isValidElement(AutoComponent)) {
|
|
245
244
|
var _AutoComponent$props$, _AutoComponent$props, _lastComponentProps$c;
|
|
246
245
|
((_AutoComponent$props$ = (_AutoComponent$props = AutoComponent === null || AutoComponent === void 0 ? void 0 : AutoComponent.props)[changeKey]) === null || _AutoComponent$props$ === void 0 ? void 0 : _AutoComponent$props$.call.apply(_AutoComponent$props$, [_AutoComponent$props].concat((0, _toConsumableArray2.default)(_args)))) || ((_lastComponentProps$c = lastComponentProps[changeKey]) === null || _lastComponentProps$c === void 0 ? void 0 : _lastComponentProps$c.call.apply(_lastComponentProps$c, [lastComponentProps].concat((0, _toConsumableArray2.default)(_args))));
|
|
247
246
|
return false;
|
|
@@ -291,7 +290,7 @@ var Render = function Render(props) {
|
|
|
291
290
|
* onBlur参数重置 (value, record, { form, index, namePath, option }) => void
|
|
292
291
|
*/
|
|
293
292
|
var handleBlur = /*#__PURE__*/function () {
|
|
294
|
-
var _ref7 = (0, _asyncToGenerator2.default)(
|
|
293
|
+
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
295
294
|
var _len3,
|
|
296
295
|
args,
|
|
297
296
|
_key3,
|
|
@@ -374,7 +373,7 @@ var Render = function Render(props) {
|
|
|
374
373
|
if (originComponent) {
|
|
375
374
|
delete childProps.otherProps;
|
|
376
375
|
}
|
|
377
|
-
var child = /*#__PURE__*/_react.default.isValidElement(AutoComponent) ? (
|
|
376
|
+
var child = /*#__PURE__*/_react.default.isValidElement(AutoComponent) ? (/*#__PURE__*/_react.default.cloneElement(AutoComponent, childProps)) : (0, _jsxRuntime.jsx)(AutoComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(lastComponentProps, [].concat(lastComponentPropsFilter, ['debounceWait']))), {}, {
|
|
378
377
|
otherProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
|
379
378
|
show: show,
|
|
380
379
|
disabled: lastDisabled,
|
|
@@ -427,17 +426,17 @@ var Render = function Render(props) {
|
|
|
427
426
|
span: 24 // 默认占一行
|
|
428
427
|
});
|
|
429
428
|
}
|
|
430
|
-
if (
|
|
431
|
-
child = (0, _jsxRuntime.jsx)(
|
|
429
|
+
if (diffConfig) {
|
|
430
|
+
child = (0, _jsxRuntime.jsx)(_ChangedWrapper.default, {
|
|
432
431
|
name: formItemProps.name,
|
|
433
432
|
names: otherProps.names,
|
|
434
433
|
namesStr: namesStr,
|
|
435
|
-
|
|
434
|
+
diffConfig: diffConfig,
|
|
436
435
|
form: form,
|
|
437
436
|
equalWith: equalWith,
|
|
438
|
-
originalDiffTip: originalDiffTip,
|
|
439
437
|
type: type,
|
|
440
438
|
onChange: handleChange,
|
|
439
|
+
valuePropName: _otherFormItemProps.valuePropName,
|
|
441
440
|
children: child
|
|
442
441
|
});
|
|
443
442
|
}
|
|
@@ -2,7 +2,7 @@ import { ColProps } from 'antd';
|
|
|
2
2
|
import { FormInstance } from 'antd/es/form/Form';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { ProColumnProps } from './propsType';
|
|
5
|
-
import {
|
|
5
|
+
import { DiffConfigProps } from '../../propsType';
|
|
6
6
|
interface Props<T = any> {
|
|
7
7
|
isView?: boolean;
|
|
8
8
|
columns: ProColumnProps[];
|
|
@@ -13,11 +13,10 @@ interface Props<T = any> {
|
|
|
13
13
|
viewEmpty?: React.ReactNode;
|
|
14
14
|
openState?: boolean;
|
|
15
15
|
labelWidth?: string | number;
|
|
16
|
-
|
|
16
|
+
diffConfig?: DiffConfigProps;
|
|
17
17
|
clearNotShow?: boolean;
|
|
18
18
|
requiredOnView?: boolean;
|
|
19
19
|
required?: boolean | boolean[] | (() => boolean | boolean[]);
|
|
20
|
-
originalDiffTip?: boolean;
|
|
21
20
|
globalControl?: boolean;
|
|
22
21
|
}
|
|
23
22
|
declare const RenderFields: React.FC<Props>;
|
|
@@ -30,11 +30,10 @@ var RenderFields = function RenderFields(props) {
|
|
|
30
30
|
viewEmpty = _props$viewEmpty === void 0 ? '-' : _props$viewEmpty,
|
|
31
31
|
openState = props.openState,
|
|
32
32
|
labelWidth = props.labelWidth,
|
|
33
|
-
originalValues = props.originalValues,
|
|
34
33
|
outerClearNotShow = props.clearNotShow,
|
|
35
34
|
requiredOnView = props.requiredOnView,
|
|
36
35
|
required = props.required,
|
|
37
|
-
|
|
36
|
+
diffConfig = props.diffConfig,
|
|
38
37
|
globalControl = props.globalControl;
|
|
39
38
|
// 是否包含隐藏字段
|
|
40
39
|
var hiddenData = columns.filter(function (item) {
|
|
@@ -162,6 +161,7 @@ var RenderFields = function RenderFields(props) {
|
|
|
162
161
|
if (['ProCollapse', 'Container'].includes(_type)) {
|
|
163
162
|
componentProps.show = show;
|
|
164
163
|
componentProps.clearNotShow = clearNotShow;
|
|
164
|
+
componentProps.diffConfig = diffConfig;
|
|
165
165
|
}
|
|
166
166
|
// switch与SwitchCheckbox单独添加valuePropName
|
|
167
167
|
if (['Switch', 'SwitchCheckbox'].includes(_type)) {
|
|
@@ -214,10 +214,9 @@ var RenderFields = function RenderFields(props) {
|
|
|
214
214
|
otherProps: otherProps,
|
|
215
215
|
fieldProps: (0, _lodash.isFunction)(fieldProps) ? fieldProps : null,
|
|
216
216
|
isSelect: _isSelect,
|
|
217
|
-
|
|
217
|
+
diffConfig: diffConfig,
|
|
218
218
|
equalWith: equalWith,
|
|
219
219
|
requiredOnView: requiredOnView,
|
|
220
|
-
originalDiffTip: originalDiffTip,
|
|
221
220
|
globalControl: globalControl
|
|
222
221
|
})
|
|
223
222
|
}, "".concat(_formItemProps.name || _formItemProps.label).concat(index));
|
|
@@ -30,7 +30,8 @@ import { ProUploadProps } from '../../../ProUpload/propsType';
|
|
|
30
30
|
import { ProTreeProps } from '../../../ProTree/propsType';
|
|
31
31
|
import { GroupProps as GroupCopyProps } from '../combination/Group/propsType';
|
|
32
32
|
import { ProCollapseProps } from '../../../ProLayout/components/ProCollapse/PropTypes';
|
|
33
|
-
import { DistributiveOmit } from '../../propsType';
|
|
33
|
+
import { DistributiveOmit, DiffConfigProps } from '../../propsType';
|
|
34
|
+
import { DiffOriginalParams } from '../../utils/diffOriginal';
|
|
34
35
|
export type ComponentMap = keyof typeof componentMap;
|
|
35
36
|
type ValidateKey = keyof typeof validate;
|
|
36
37
|
type RegExpKey = keyof typeof regExp;
|
|
@@ -196,12 +197,12 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
196
197
|
* @default -
|
|
197
198
|
*/
|
|
198
199
|
labelWidth?: string | number;
|
|
199
|
-
disabled?: boolean | ReactiveFunction<Values, boolean>;
|
|
200
|
+
disabled?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
|
|
200
201
|
trim?: boolean;
|
|
201
202
|
upperCase?: boolean;
|
|
202
203
|
hiddenNames?: string[] | any[];
|
|
203
204
|
rules?: ProRule[] | ReactiveFunction<Values, ProRule[]>;
|
|
204
|
-
equalWith?:
|
|
205
|
+
equalWith?: DiffOriginalParams['equalWith'];
|
|
205
206
|
required?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
|
|
206
207
|
labelRequired?: boolean;
|
|
207
208
|
toISOString?: boolean;
|
|
@@ -267,7 +268,7 @@ export interface RenderProps<Values = any> {
|
|
|
267
268
|
form: FormInstance<Values>;
|
|
268
269
|
fieldProps?: ReactiveFunction<Values, React.ReactNode>;
|
|
269
270
|
isSelect: boolean;
|
|
270
|
-
|
|
271
|
+
diffConfig: DiffConfigProps;
|
|
271
272
|
requiredOnView?: boolean;
|
|
272
273
|
confirm?: ProFormColumnProps['confirm'];
|
|
273
274
|
globalControl?: boolean;
|
package/lib/ProForm/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var _useForm3 = require("./utils/useForm");
|
|
|
25
25
|
var _useFieldProps = require("./utils/useFieldProps");
|
|
26
26
|
var _locale = _interopRequireDefault(require("../locale"));
|
|
27
27
|
var _useWatch = _interopRequireDefault(require("./utils/useWatch"));
|
|
28
|
-
var _excluded = ["mode", "span", "disabled", "isView", "columns", "footer", "onOk", "okText", "onCancel", "confirmLoading", "cancelText", "form", "children", "rowProps", "className", "expand", "expandOpen", "expandOpenChange", "viewEmpty", "labelAlign", "labelWidth", "onValuesChange", "onFinish", "
|
|
28
|
+
var _excluded = ["mode", "span", "disabled", "isView", "columns", "footer", "onOk", "okText", "onCancel", "confirmLoading", "cancelText", "form", "children", "rowProps", "className", "expand", "expandOpen", "expandOpenChange", "viewEmpty", "labelAlign", "labelWidth", "onValuesChange", "onFinish", "diffConfig", "submitOnEnter", "clearNotShow", "initialValues", "requiredOnView", "formId", "required", "formKey", "globalControl", "scrollToError", "optimize"];
|
|
29
29
|
var ProForm = function ProForm(props, ref) {
|
|
30
30
|
var _forms$formKey, _localStorage, _ref;
|
|
31
31
|
var _props$mode = props.mode,
|
|
@@ -54,7 +54,7 @@ var ProForm = function ProForm(props, ref) {
|
|
|
54
54
|
labelWidth = props.labelWidth,
|
|
55
55
|
onValuesChange = props.onValuesChange,
|
|
56
56
|
onFinish = props.onFinish,
|
|
57
|
-
|
|
57
|
+
diffConfig = props.diffConfig,
|
|
58
58
|
submitOnEnter = props.submitOnEnter,
|
|
59
59
|
_props$clearNotShow = props.clearNotShow,
|
|
60
60
|
clearNotShow = _props$clearNotShow === void 0 ? true : _props$clearNotShow,
|
|
@@ -63,8 +63,6 @@ var ProForm = function ProForm(props, ref) {
|
|
|
63
63
|
requiredOnView = _props$requiredOnView === void 0 ? true : _props$requiredOnView,
|
|
64
64
|
formId = props.formId,
|
|
65
65
|
required = props.required,
|
|
66
|
-
_props$originalDiffTi = props.originalDiffTip,
|
|
67
|
-
originalDiffTip = _props$originalDiffTi === void 0 ? true : _props$originalDiffTi,
|
|
68
66
|
formKey = props.formKey,
|
|
69
67
|
globalControl = props.globalControl,
|
|
70
68
|
_props$scrollToError = props.scrollToError,
|
|
@@ -203,7 +201,7 @@ var ProForm = function ProForm(props, ref) {
|
|
|
203
201
|
if (isView || disabled) {
|
|
204
202
|
// 查看或禁用模式
|
|
205
203
|
footerEle = null;
|
|
206
|
-
} else if (
|
|
204
|
+
} else if (/*#__PURE__*/_react.default.isValidElement(footer)) {
|
|
207
205
|
// 传入组件渲染组件
|
|
208
206
|
footerEle = footer;
|
|
209
207
|
} else if (footer === undefined || footer || (0, _lodash.isObject)(footer)) {
|
|
@@ -262,11 +260,10 @@ var ProForm = function ProForm(props, ref) {
|
|
|
262
260
|
colProps: colProps,
|
|
263
261
|
viewEmpty: viewEmpty,
|
|
264
262
|
labelWidth: labelWidth,
|
|
265
|
-
|
|
263
|
+
diffConfig: diffConfig,
|
|
266
264
|
clearNotShow: clearNotShow,
|
|
267
265
|
requiredOnView: requiredOnView,
|
|
268
266
|
required: required,
|
|
269
|
-
originalDiffTip: originalDiffTip,
|
|
270
267
|
globalControl: globalControl
|
|
271
268
|
}), footerRender()]
|
|
272
269
|
})), children]
|