@zat-design/sisyphus-react 3.8.0 → 3.8.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/.vscode/extensions.json +5 -0
- package/dist/index.esm.css +8 -52
- package/dist/less.esm.css +8 -52
- 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/ListChangedWrapper.js +9 -5
- package/es/ProEditTable/components/RenderField/index.js +9 -9
- package/es/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/es/ProEditTable/index.js +9 -5
- package/es/ProEditTable/style/index.less +2 -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/hooks/useEnumRequest.js +2 -2
- package/es/ProEnum/index.js +1 -1
- package/es/ProForm/components/FormFooter/index.js +6 -4
- 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/utils.js +8 -1
- package/es/ProForm/components/combination/ProCascader/index.js +6 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +12 -6
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProNumberRange/index.js +51 -47
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +51 -56
- package/es/ProForm/components/old/ProAddress/index.js +1 -1
- package/es/ProForm/components/render/ChangedWrapper.js +5 -3
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +4 -3
- package/es/ProForm/components/render/propsType.d.ts +1 -1
- package/es/ProForm/index.js +1 -1
- 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/ProStep/components/Listener/index.js +1 -1
- package/es/ProStep/index.js +3 -3
- package/es/ProTable/components/FormatColumn/index.d.ts +2 -1
- package/es/ProTable/components/FormatColumn/index.js +12 -9
- 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 +13 -3
- package/es/ProTable/propsType.d.ts +4 -0
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +10 -0
- package/es/ProTree/components/Tree.js +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 +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/ListChangedWrapper.js +9 -5
- package/lib/ProEditTable/components/RenderField/index.js +9 -9
- package/lib/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/lib/ProEditTable/index.js +9 -5
- package/lib/ProEditTable/style/index.less +2 -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/hooks/useEnumRequest.js +2 -2
- package/lib/ProEnum/index.js +1 -1
- package/lib/ProForm/components/FormFooter/index.js +5 -3
- 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/utils.js +8 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +6 -3
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +12 -6
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProNumberRange/index.js +45 -45
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +51 -56
- package/lib/ProForm/components/old/ProAddress/index.js +1 -1
- package/lib/ProForm/components/render/ChangedWrapper.js +5 -3
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +4 -3
- package/lib/ProForm/components/render/propsType.d.ts +1 -1
- package/lib/ProForm/index.js +1 -1
- 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/ProStep/components/Listener/index.js +1 -1
- package/lib/ProStep/index.js +3 -3
- package/lib/ProTable/components/FormatColumn/index.d.ts +2 -1
- package/lib/ProTable/components/FormatColumn/index.js +12 -9
- 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 +13 -3
- package/lib/ProTable/propsType.d.ts +4 -0
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +10 -0
- package/lib/ProTree/components/Tree.js +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 +4 -5
|
@@ -77,8 +77,6 @@ var RenderField = function RenderField(_ref) {
|
|
|
77
77
|
viewEmpty = config.viewEmpty,
|
|
78
78
|
originalValues = config.originalValues,
|
|
79
79
|
formNamePath = config.namePath,
|
|
80
|
-
_config$originalDiffT = config.originalDiffTip,
|
|
81
|
-
originalDiffTip = _config$originalDiffT === void 0 ? true : _config$originalDiffT,
|
|
82
80
|
rowDisabled = config.rowDisabled,
|
|
83
81
|
_config$validateTrigg = config.validateTrigger,
|
|
84
82
|
validateTrigger = _config$validateTrigg === void 0 ? ['onChange', 'onBlur', 'onSubmit'] : _config$validateTrigg,
|
|
@@ -223,10 +221,10 @@ var RenderField = function RenderField(_ref) {
|
|
|
223
221
|
var originalNames = names;
|
|
224
222
|
if (virtualKey) {
|
|
225
223
|
var _cellName$slice, _names2, _names2$map;
|
|
226
|
-
originalName = [].concat((0, _toConsumableArray2.default)(name), (0, _toConsumableArray2.default)(cellName === null || cellName === void 0 ? void 0 : (_cellName$slice = cellName.slice) === null || _cellName$slice === void 0 ? void 0 : _cellName$slice.call(cellName,
|
|
224
|
+
originalName = [].concat((0, _toConsumableArray2.default)(name), (0, _toConsumableArray2.default)(cellName === null || cellName === void 0 ? void 0 : (_cellName$slice = cellName.slice) === null || _cellName$slice === void 0 ? void 0 : _cellName$slice.call(cellName, name.length)));
|
|
227
225
|
originalNames = (_names2 = names) === null || _names2 === void 0 ? void 0 : (_names2$map = _names2.map) === null || _names2$map === void 0 ? void 0 : _names2$map.call(_names2, function (item) {
|
|
228
226
|
var _item$slice;
|
|
229
|
-
return [].concat((0, _toConsumableArray2.default)(name), (0, _toConsumableArray2.default)(item === null || item === void 0 ? void 0 : (_item$slice = item.slice) === null || _item$slice === void 0 ? void 0 : _item$slice.call(item,
|
|
227
|
+
return [].concat((0, _toConsumableArray2.default)(name), (0, _toConsumableArray2.default)(item === null || item === void 0 ? void 0 : (_item$slice = item.slice) === null || _item$slice === void 0 ? void 0 : _item$slice.call(item, name.length)));
|
|
230
228
|
});
|
|
231
229
|
}
|
|
232
230
|
/**
|
|
@@ -253,7 +251,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
253
251
|
if (typeof _editRender === 'function') {
|
|
254
252
|
TargetComponent = _editRender.apply(void 0, rowParams);
|
|
255
253
|
}
|
|
256
|
-
if (
|
|
254
|
+
if (/*#__PURE__*/_react.default.isValidElement(_editRender)) {
|
|
257
255
|
TargetComponent = _editRender;
|
|
258
256
|
}
|
|
259
257
|
}
|
|
@@ -269,7 +267,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
269
267
|
children: View
|
|
270
268
|
});
|
|
271
269
|
}
|
|
272
|
-
if (
|
|
270
|
+
if (/*#__PURE__*/_react.default.isValidElement(viewRender)) {
|
|
273
271
|
TargetComponent = viewRender;
|
|
274
272
|
}
|
|
275
273
|
}
|
|
@@ -312,7 +310,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
312
310
|
}, 100);
|
|
313
311
|
};
|
|
314
312
|
// 单元格更新数据时,加个防抖,防止更新频率过快,卡顿
|
|
315
|
-
var _onChange = (0, _lodash.debounce)(
|
|
313
|
+
var _onChange = (0, _lodash.debounce)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
316
314
|
var _len2,
|
|
317
315
|
args,
|
|
318
316
|
_key2,
|
|
@@ -416,7 +414,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
416
414
|
}, _callee);
|
|
417
415
|
})), 300);
|
|
418
416
|
var _onblur = /*#__PURE__*/function () {
|
|
419
|
-
var _ref3 = (0, _asyncToGenerator2.default)(
|
|
417
|
+
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
|
420
418
|
var _TargetComponent3, _TargetComponent3$pro, _TargetComponent$prop4;
|
|
421
419
|
var _len3,
|
|
422
420
|
args,
|
|
@@ -552,7 +550,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
552
550
|
var getFieldItem = function getFieldItem() {
|
|
553
551
|
var _componentProps;
|
|
554
552
|
var FormItem = null;
|
|
555
|
-
var FieldComponent = /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? (
|
|
553
|
+
var FieldComponent = /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? (/*#__PURE__*/_react.default.cloneElement(TargetComponent, componentProps)) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, componentProps));
|
|
556
554
|
if (originalValues) {
|
|
557
555
|
FieldComponent = (0, _jsxRuntime.jsx)(_ListChangedWrapper.default, {
|
|
558
556
|
name: cellName,
|
|
@@ -566,6 +564,8 @@ var RenderField = function RenderField(_ref) {
|
|
|
566
564
|
equalWith: equalWith,
|
|
567
565
|
type: type,
|
|
568
566
|
onChange: _onChange,
|
|
567
|
+
valuePropName: _formItemProps.valuePropName,
|
|
568
|
+
normalize: _formItemProps.normalize,
|
|
569
569
|
children: FieldComponent
|
|
570
570
|
});
|
|
571
571
|
}
|
|
@@ -82,7 +82,7 @@ var RenderToolbar = function RenderToolbar(config) {
|
|
|
82
82
|
toolbar.show = show !== null && show !== void 0 ? show : true;
|
|
83
83
|
toolbar.needConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : true;
|
|
84
84
|
toolbar.onEvent = /*#__PURE__*/function () {
|
|
85
|
-
var _ref = (0, _asyncToGenerator2.default)(
|
|
85
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(record, index) {
|
|
86
86
|
var onEvent, result;
|
|
87
87
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
88
88
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -180,7 +180,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
180
180
|
var isEdit = !virtualKey || editingKeys.includes(record.rowKey);
|
|
181
181
|
var className = isEdit ? 'is-editing' : '';
|
|
182
182
|
var originalArr = (0, _lodash.get)(originalValues, name);
|
|
183
|
-
if (
|
|
183
|
+
if (IsNew(originalArr, record)) {
|
|
184
184
|
return "is-new-row ".concat(className);
|
|
185
185
|
}
|
|
186
186
|
return className;
|
|
@@ -279,19 +279,23 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
279
279
|
return (0, _utils.transformColumns)(columns, config);
|
|
280
280
|
}, [valueChangeRef.current, disabled, forceUpdate, columns, page, actionProps, editingKeys, cellNamePath]);
|
|
281
281
|
(0, _react.useEffect)(function () {
|
|
282
|
-
var _value$every;
|
|
282
|
+
var _value$every, _originalArr$every;
|
|
283
283
|
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) {
|
|
284
284
|
return item.rowKey;
|
|
285
285
|
});
|
|
286
|
+
// 原始值也需要设置对应的rowkey,后续比对通过rowkey对比
|
|
287
|
+
var originalArr = (0, _lodash.get)(originalValues, name);
|
|
288
|
+
var isOriginalAllHasKey = originalArr ? originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$every = originalArr.every) === null || _originalArr$every === void 0 ? void 0 : _originalArr$every.call(originalArr, function (item) {
|
|
289
|
+
return item.rowKey;
|
|
290
|
+
}) : true;
|
|
286
291
|
// 初始化默认生成row-key
|
|
287
|
-
if ((value === null || value === void 0 ? void 0 : value.length) && !isAllHasKey) {
|
|
292
|
+
if ((value === null || value === void 0 ? void 0 : value.length) && !isAllHasKey || (originalArr === null || originalArr === void 0 ? void 0 : originalArr.length) && !isOriginalAllHasKey) {
|
|
288
293
|
var _originalArr$forEach;
|
|
289
294
|
var nextValues = value === null || value === void 0 ? void 0 : value.map(function (item) {
|
|
290
295
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
291
296
|
rowKey: getRowKey(item)
|
|
292
297
|
});
|
|
293
298
|
});
|
|
294
|
-
var originalArr = (0, _lodash.get)(originalValues, name);
|
|
295
299
|
originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$forEach = originalArr.forEach) === null || _originalArr$forEach === void 0 ? void 0 : _originalArr$forEach.call(originalArr, function (item) {
|
|
296
300
|
item.rowKey = getRowKey(item);
|
|
297
301
|
});
|
|
@@ -300,7 +304,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
300
304
|
form.setFieldValue(virtualRowName, nextValues);
|
|
301
305
|
}
|
|
302
306
|
}
|
|
303
|
-
}, [value]);
|
|
307
|
+
}, [value, originalValues]);
|
|
304
308
|
(0, _react.useImperativeHandle)((resetProps === null || resetProps === void 0 ? void 0 : resetProps.ref) || ref, function () {
|
|
305
309
|
return {
|
|
306
310
|
getInternalState: function getInternalState() {
|
|
@@ -69,7 +69,7 @@ var actions = exports.actions = {
|
|
|
69
69
|
});
|
|
70
70
|
},
|
|
71
71
|
save: function () {
|
|
72
|
-
var _save = (0, _asyncToGenerator2.default)(
|
|
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)(
|
|
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) {
|
|
@@ -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 (
|
|
33
|
+
if (/*#__PURE__*/_react.default.isValidElement(value)) {
|
|
34
34
|
return value;
|
|
35
35
|
}
|
|
36
36
|
}),
|
|
@@ -87,7 +87,7 @@ 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 _ref = (0, _asyncToGenerator2.default)(
|
|
90
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(record, index) {
|
|
91
91
|
var _form$getFieldValue;
|
|
92
92
|
var rowName, _record, onEvent, result;
|
|
93
93
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
@@ -238,7 +238,7 @@ var transformColumns = exports.transformColumns = function transformColumns() {
|
|
|
238
238
|
children: [before, columnTitle, (0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
239
239
|
title: tooltipTitle !== null && tooltipTitle !== void 0 ? tooltipTitle : tooltip
|
|
240
240
|
}, resetProps), {}, {
|
|
241
|
-
children: icon ? (
|
|
241
|
+
children: icon ? (/*#__PURE__*/_react.default.cloneElement(icon, {
|
|
242
242
|
className: 'icon-tip'
|
|
243
243
|
})) : (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
|
244
244
|
className: "icon-tip",
|
|
@@ -384,8 +384,8 @@ var transformColumns = exports.transformColumns = function transformColumns() {
|
|
|
384
384
|
}
|
|
385
385
|
// cacheMap 用来存储缓存值,若有值后不再请求
|
|
386
386
|
if (JSON.stringify(cacheMap.current) === '{}') {
|
|
387
|
-
Promise.all(Object.entries(_cacheMap).map(
|
|
388
|
-
var _ref3 = (0, _asyncToGenerator2.default)(
|
|
387
|
+
Promise.all(Object.entries(_cacheMap).map(/*#__PURE__*/function () {
|
|
388
|
+
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(item) {
|
|
389
389
|
var _item, key, value, _ref4, service, option;
|
|
390
390
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
391
391
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -199,7 +199,7 @@ var handleScrollToError = exports.handleScrollToError = function handleScrollToE
|
|
|
199
199
|
*/
|
|
200
200
|
function cloneDeepFilterNode(value) {
|
|
201
201
|
return (0, _lodash.cloneDeepWith)(value, function (val) {
|
|
202
|
-
if (
|
|
202
|
+
if (/*#__PURE__*/_react.default.isValidElement(val)) {
|
|
203
203
|
return val;
|
|
204
204
|
}
|
|
205
205
|
});
|
|
@@ -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)(
|
|
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)(
|
|
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.js
CHANGED
|
@@ -154,7 +154,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
154
154
|
list = [];
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
if (
|
|
157
|
+
if (/*#__PURE__*/_react.default.isValidElement(component)) {
|
|
158
158
|
var Component = component;
|
|
159
159
|
return (0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
|
|
160
160
|
dataSource: list,
|
|
@@ -34,11 +34,13 @@ var FormFooter = function FormFooter(props) {
|
|
|
34
34
|
var searchCache = (0, _react.useMemo)(function () {
|
|
35
35
|
var cacheStr = window.sessionStorage.getItem(PRO_FORM_CACHE);
|
|
36
36
|
var cache = JSON.parse(cacheStr || '{}');
|
|
37
|
-
if (formId && cache[formId]) {
|
|
38
|
-
form.setFieldsValue(cache[formId]);
|
|
39
|
-
}
|
|
40
37
|
return cache;
|
|
41
38
|
}, [formId]);
|
|
39
|
+
(0, _react.useEffect)(function () {
|
|
40
|
+
if (formId && searchCache[formId]) {
|
|
41
|
+
form.setFieldsValue(searchCache[formId]);
|
|
42
|
+
}
|
|
43
|
+
}, [formId]);
|
|
42
44
|
var _onOk = function _onOk() {
|
|
43
45
|
if (formId) {
|
|
44
46
|
var values = form.getFieldsValue();
|
|
@@ -134,7 +134,7 @@ var ActionButton = function ActionButton(props) {
|
|
|
134
134
|
return _actionProps;
|
|
135
135
|
}, [props.actionProps]);
|
|
136
136
|
var handleClick = /*#__PURE__*/function () {
|
|
137
|
-
var _ref6 = (0, _asyncToGenerator2.default)(
|
|
137
|
+
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(defaultCallback, callback, index, item) {
|
|
138
138
|
var value, data;
|
|
139
139
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
140
140
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -273,7 +273,7 @@ var ActionButton = function ActionButton(props) {
|
|
|
273
273
|
},
|
|
274
274
|
children: label
|
|
275
275
|
}))
|
|
276
|
-
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (
|
|
276
|
+
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (/*#__PURE__*/(0, _react.createElement)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, rest), {}, {
|
|
277
277
|
key: "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index),
|
|
278
278
|
type: "text",
|
|
279
279
|
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 (
|
|
23
|
+
if (/*#__PURE__*/_react.default.isValidElement(title)) {
|
|
24
24
|
return title;
|
|
25
25
|
}
|
|
26
26
|
var titleContent = title;
|
|
@@ -59,7 +59,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
|
59
59
|
return _toolbarProps;
|
|
60
60
|
}, [props.toolbarProps]);
|
|
61
61
|
var handleClick = /*#__PURE__*/function () {
|
|
62
|
-
var _ref2 = (0, _asyncToGenerator2.default)(
|
|
62
|
+
var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(defaultCallback, callback, item) {
|
|
63
63
|
var value, data;
|
|
64
64
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
65
65
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -30,7 +30,7 @@ var namesPathTransform = exports.namesPathTransform = function namesPathTransfor
|
|
|
30
30
|
// 比较memo
|
|
31
31
|
var memoWith = exports.memoWith = function memoWith(pre, next) {
|
|
32
32
|
return (0, _lodash.isEqualWith)(pre, next, function (objValue, othValue) {
|
|
33
|
-
if (
|
|
33
|
+
if (/*#__PURE__*/_react.default.isValidElement(objValue) && /*#__PURE__*/_react.default.isValidElement(othValue)) {
|
|
34
34
|
return true;
|
|
35
35
|
}
|
|
36
36
|
// 移除解决formlist函数里不更新问题
|
|
@@ -56,7 +56,7 @@ var ComRender = function ComRender(props) {
|
|
|
56
56
|
};
|
|
57
57
|
var _props = mergedGetValueProps(fieldProps.value);
|
|
58
58
|
var componentProps = (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, fieldProps), rest), _props);
|
|
59
|
-
var Component = component ? (
|
|
59
|
+
var Component = component ? (/*#__PURE__*/_react.default.cloneElement(component, (0, _objectSpread3.default)({}, componentProps))) : (0, _jsxRuntime.jsx)(TypeComponent, (0, _objectSpread3.default)({}, componentProps));
|
|
60
60
|
var Com = getComRender(Component, props, componentProps);
|
|
61
61
|
return (0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
62
62
|
value: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, contextProps), {}, {
|
|
@@ -290,10 +290,17 @@ var useTransformColumns = exports.useTransformColumns = function useTransformCol
|
|
|
290
290
|
option: args === null || args === void 0 ? void 0 : args[1]
|
|
291
291
|
});
|
|
292
292
|
};
|
|
293
|
+
// 内外一个为true则为true
|
|
294
|
+
var getLastDisabled = function getLastDisabled() {
|
|
295
|
+
if (Array.isArray(groupProps.disabled)) {
|
|
296
|
+
return reactiveProps.disabled || groupProps.disabled[index];
|
|
297
|
+
}
|
|
298
|
+
return reactiveProps.disabled || groupProps.disabled;
|
|
299
|
+
};
|
|
293
300
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, column), {}, {
|
|
294
301
|
name: columnName
|
|
295
302
|
}, reactiveProps), {}, {
|
|
296
|
-
disabled:
|
|
303
|
+
disabled: getLastDisabled(),
|
|
297
304
|
getValueProps: transform === null || transform === void 0 ? void 0 : transform.getValueProps,
|
|
298
305
|
fieldProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, column === null || column === void 0 ? void 0 : column.fieldProps), {}, {
|
|
299
306
|
onChange: handleChange,
|
|
@@ -96,8 +96,11 @@ var ProCascader = function ProCascader(props) {
|
|
|
96
96
|
enumDataSource = _ref5$ === void 0 ? [] : _ref5$;
|
|
97
97
|
var realDataSource = (0, _react.useMemo)(function () {
|
|
98
98
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
|
99
|
-
var result = isAddressMode && realLevel === 2 ? _filterDataSource(innerDataSource, level, fieldNames) : innerDataSource;
|
|
100
|
-
|
|
99
|
+
var result = (0, _index.transformDataName)(isAddressMode && realLevel === 2 ? _filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
|
100
|
+
if (transformResponse) {
|
|
101
|
+
return transformResponse(result);
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
101
104
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
|
102
105
|
var _useRequest = (0, _objectSpread3.default)({}, useRequest),
|
|
103
106
|
service = _useRequest.service,
|
|
@@ -112,7 +115,7 @@ var ProCascader = function ProCascader(props) {
|
|
|
112
115
|
defaultLabel = _useState4[0],
|
|
113
116
|
setDefaultLabel = _useState4[1];
|
|
114
117
|
var getFirstLevelOptions = /*#__PURE__*/function () {
|
|
115
|
-
var _ref6 = (0, _asyncToGenerator2.default)(
|
|
118
|
+
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
116
119
|
var _yield$service, data, newData, transFormData, serviceData;
|
|
117
120
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
118
121
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -33,7 +33,7 @@ var useDefaultOptions = function useDefaultOptions(options) {
|
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
var defaultService = /*#__PURE__*/function () {
|
|
36
|
-
var _ref = (0, _asyncToGenerator2.default)(
|
|
36
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
37
37
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
38
38
|
while (1) switch (_context.prev = _context.next) {
|
|
39
39
|
case 0:
|
|
@@ -25,7 +25,7 @@ var _Container = _interopRequireDefault(require("../../Container"));
|
|
|
25
25
|
var _view = _interopRequireDefault(require("../../../../assets/view.svg"));
|
|
26
26
|
var _useRequestList3 = _interopRequireDefault(require("./hooks/useRequestList"));
|
|
27
27
|
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
28
|
-
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "searchForm", "searchKey", "defaultOne"],
|
|
28
|
+
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "afterOpen", "isTooltip", "searchForm", "searchKey", "defaultOne"],
|
|
29
29
|
_excluded2 = ["onOk"],
|
|
30
30
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
|
31
31
|
var ProModalSelect = function ProModalSelect(props, ref) {
|
|
@@ -48,6 +48,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
48
48
|
style = props.style,
|
|
49
49
|
className = props.className,
|
|
50
50
|
beforeOpen = props.beforeOpen,
|
|
51
|
+
afterOpen = props.afterOpen,
|
|
51
52
|
isTooltip = props.isTooltip,
|
|
52
53
|
searchForm = props.searchForm,
|
|
53
54
|
searchKey = props.searchKey,
|
|
@@ -232,7 +233,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
232
233
|
onChange(val, option);
|
|
233
234
|
};
|
|
234
235
|
var handleClick = /*#__PURE__*/function () {
|
|
235
|
-
var _ref7 = (0, _asyncToGenerator2.default)(
|
|
236
|
+
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
236
237
|
var _yield$beforeOpen, res;
|
|
237
238
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
238
239
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -267,6 +268,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
267
268
|
setState({
|
|
268
269
|
onOff: true
|
|
269
270
|
});
|
|
271
|
+
setTimeout(function () {
|
|
272
|
+
afterOpen === null || afterOpen === void 0 ? void 0 : afterOpen({
|
|
273
|
+
setInnerState: setState
|
|
274
|
+
});
|
|
275
|
+
}, 100);
|
|
270
276
|
}
|
|
271
277
|
case 14:
|
|
272
278
|
case "end":
|
|
@@ -294,7 +300,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
294
300
|
}
|
|
295
301
|
};
|
|
296
302
|
var handleFinish = /*#__PURE__*/function () {
|
|
297
|
-
var _ref8 = (0, _asyncToGenerator2.default)(
|
|
303
|
+
var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
|
298
304
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
|
299
305
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
300
306
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -359,7 +365,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
359
365
|
};
|
|
360
366
|
}();
|
|
361
367
|
var handleSearch = /*#__PURE__*/function () {
|
|
362
|
-
var _ref9 = (0, _asyncToGenerator2.default)(
|
|
368
|
+
var _ref9 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
|
363
369
|
var values;
|
|
364
370
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
|
365
371
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -432,7 +438,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
432
438
|
};
|
|
433
439
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
434
440
|
var getInitValues = /*#__PURE__*/function () {
|
|
435
|
-
var _ref10 = (0, _asyncToGenerator2.default)(
|
|
441
|
+
var _ref10 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {
|
|
436
442
|
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
|
437
443
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {
|
|
438
444
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -495,7 +501,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
495
501
|
}();
|
|
496
502
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
497
503
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
|
498
|
-
var _ref11 = (0, _asyncToGenerator2.default)(
|
|
504
|
+
var _ref11 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {
|
|
499
505
|
var _useRequest$options4, _useRequest$options5;
|
|
500
506
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
|
501
507
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {
|
|
@@ -90,8 +90,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
90
90
|
};
|
|
91
91
|
var cls = (0, _classnames.default)({
|
|
92
92
|
'pro-number-range': true,
|
|
93
|
-
'pro-number-range-
|
|
94
|
-
'pro-number-range-before': addonBefore,
|
|
93
|
+
'pro-number-range-disabled': disabled,
|
|
95
94
|
className: className
|
|
96
95
|
});
|
|
97
96
|
// 查看模式
|
|
@@ -180,50 +179,51 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
180
179
|
}
|
|
181
180
|
return result;
|
|
182
181
|
};
|
|
183
|
-
return (0, _jsxRuntime.
|
|
184
|
-
compact: true,
|
|
182
|
+
return (0, _jsxRuntime.jsx)(_antd.Space, {
|
|
185
183
|
className: cls,
|
|
186
|
-
children:
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
} :
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
} :
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
184
|
+
children: (0, _jsxRuntime.jsxs)(_antd.Space.Compact, {
|
|
185
|
+
children: [(0, _jsxRuntime.jsx)(_antd.InputNumber, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
186
|
+
id: id,
|
|
187
|
+
className: "range-left",
|
|
188
|
+
value: (value === null || value === void 0 ? void 0 : value[0]) || range[0],
|
|
189
|
+
placeholder: "".concat(_locale.default.ProForm.inputPlaceholder),
|
|
190
|
+
precision: precision,
|
|
191
|
+
disabled: getDisabled(disabled, 0),
|
|
192
|
+
onChange: function onChange(e) {
|
|
193
|
+
firstHandleChange(e);
|
|
194
|
+
}
|
|
195
|
+
}, valueProps), {}, {
|
|
196
|
+
min: min !== null && min !== void 0 ? min : (_valueProps = valueProps) === null || _valueProps === void 0 ? void 0 : _valueProps.min,
|
|
197
|
+
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
|
|
198
|
+
}, childProps === null || childProps === void 0 ? void 0 : childProps[0])), addonBefore ? (0, _jsxRuntime.jsx)(_antd.Button, {
|
|
199
|
+
disabled: true,
|
|
200
|
+
className: "range-addon-before",
|
|
201
|
+
children: addonBefore
|
|
202
|
+
}) : null, (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
203
|
+
className: (0, _classnames.default)({
|
|
204
|
+
'range-split': true,
|
|
205
|
+
'range-split-disabled': !!disabled
|
|
206
|
+
}),
|
|
207
|
+
placeholder: "~",
|
|
208
|
+
disabled: true
|
|
209
|
+
}), (0, _jsxRuntime.jsx)(_antd.InputNumber, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
210
|
+
className: "range-right",
|
|
211
|
+
value: (value === null || value === void 0 ? void 0 : value[1]) || range[1],
|
|
212
|
+
placeholder: "".concat(_locale.default.ProForm.inputPlaceholder),
|
|
213
|
+
precision: precision,
|
|
214
|
+
disabled: getDisabled(disabled, 1),
|
|
215
|
+
onChange: function onChange(e) {
|
|
216
|
+
lastHandleChange(e);
|
|
217
|
+
}
|
|
218
|
+
}, valueProps), {}, {
|
|
219
|
+
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,
|
|
220
|
+
max: max !== null && max !== void 0 ? max : (_valueProps4 = valueProps) === null || _valueProps4 === void 0 ? void 0 : _valueProps4.max
|
|
221
|
+
}, childProps === null || childProps === void 0 ? void 0 : childProps[1])), addonAfter ? (0, _jsxRuntime.jsx)(_antd.Button, {
|
|
222
|
+
disabled: true,
|
|
223
|
+
className: "range-addon-after",
|
|
224
|
+
children: addonAfter
|
|
225
|
+
}) : null]
|
|
226
|
+
})
|
|
227
227
|
});
|
|
228
228
|
};
|
|
229
229
|
var _default = exports.default = ProNumberRange;
|