@zat-design/sisyphus-react 3.7.3 → 3.8.0-beat.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 +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} +29 -14
- package/es/ProEditTable/components/RenderField/index.js +10 -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 +6 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +57 -46
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- 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 +110 -0
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +11 -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 +38 -5
- 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} +32 -15
- package/lib/ProEditTable/components/RenderField/index.js +10 -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 +6 -3
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +56 -45
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- 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 +115 -0
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +11 -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 +38 -5
- 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 +4 -4
- 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
|
@@ -25,7 +25,7 @@ import useRules from '../../../ProForm/utils/useRules';
|
|
|
25
25
|
import { isSelect, isTrim } from '../../../ProForm/utils';
|
|
26
26
|
import ConfirmWrapper from '../../../ProForm/components/render/ConfirmWrapper';
|
|
27
27
|
import { getDefaultProps } from '../../utils/getDefaultProps';
|
|
28
|
-
import
|
|
28
|
+
import ListChangedWrapper from './ListChangedWrapper';
|
|
29
29
|
var RenderField = function RenderField(_ref) {
|
|
30
30
|
var _type, _type$replace, _fieldProps2, _names, _TargetComponent4, _componentProps2;
|
|
31
31
|
var value = _ref.text,
|
|
@@ -246,7 +246,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
246
246
|
if (typeof _editRender === 'function') {
|
|
247
247
|
TargetComponent = _editRender.apply(void 0, rowParams);
|
|
248
248
|
}
|
|
249
|
-
if (
|
|
249
|
+
if (/*#__PURE__*/React.isValidElement(_editRender)) {
|
|
250
250
|
TargetComponent = _editRender;
|
|
251
251
|
}
|
|
252
252
|
}
|
|
@@ -262,7 +262,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
262
262
|
children: View
|
|
263
263
|
});
|
|
264
264
|
}
|
|
265
|
-
if (
|
|
265
|
+
if (/*#__PURE__*/React.isValidElement(viewRender)) {
|
|
266
266
|
TargetComponent = viewRender;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
@@ -305,7 +305,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
305
305
|
}, 100);
|
|
306
306
|
};
|
|
307
307
|
// 单元格更新数据时,加个防抖,防止更新频率过快,卡顿
|
|
308
|
-
var _onChange = debounce(
|
|
308
|
+
var _onChange = debounce(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
309
309
|
var _len2,
|
|
310
310
|
args,
|
|
311
311
|
_key2,
|
|
@@ -409,7 +409,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
409
409
|
}, _callee);
|
|
410
410
|
})), 300);
|
|
411
411
|
var _onblur = /*#__PURE__*/function () {
|
|
412
|
-
var _ref3 = _asyncToGenerator(
|
|
412
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
413
413
|
var _TargetComponent3, _TargetComponent3$pro, _TargetComponent$prop4;
|
|
414
414
|
var _len3,
|
|
415
415
|
args,
|
|
@@ -510,7 +510,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
510
510
|
form: form,
|
|
511
511
|
names: names,
|
|
512
512
|
namePath: [].concat(_toConsumableArray(namePath), [index]),
|
|
513
|
-
name:
|
|
513
|
+
name: originalName,
|
|
514
514
|
listName: cellName,
|
|
515
515
|
viewEmpty: viewEmpty,
|
|
516
516
|
valueType: _valueType,
|
|
@@ -545,9 +545,9 @@ var RenderField = function RenderField(_ref) {
|
|
|
545
545
|
var getFieldItem = function getFieldItem() {
|
|
546
546
|
var _componentProps;
|
|
547
547
|
var FormItem = null;
|
|
548
|
-
var FieldComponent = /*#__PURE__*/React.isValidElement(TargetComponent) ? (
|
|
548
|
+
var FieldComponent = /*#__PURE__*/React.isValidElement(TargetComponent) ? (/*#__PURE__*/React.cloneElement(TargetComponent, componentProps)) : _jsx(TargetComponent, _objectSpread({}, componentProps));
|
|
549
549
|
if (originalValues) {
|
|
550
|
-
FieldComponent = _jsx(
|
|
550
|
+
FieldComponent = _jsx(ListChangedWrapper, {
|
|
551
551
|
name: cellName,
|
|
552
552
|
names: names,
|
|
553
553
|
namesStr: [].concat(_toConsumableArray(baseName), [index, dataIndex]),
|
|
@@ -559,6 +559,8 @@ var RenderField = function RenderField(_ref) {
|
|
|
559
559
|
equalWith: equalWith,
|
|
560
560
|
type: type,
|
|
561
561
|
onChange: _onChange,
|
|
562
|
+
valuePropName: _formItemProps.valuePropName,
|
|
563
|
+
normalize: _formItemProps.normalize,
|
|
562
564
|
children: FieldComponent
|
|
563
565
|
});
|
|
564
566
|
}
|
|
@@ -76,7 +76,7 @@ var RenderToolbar = function RenderToolbar(config) {
|
|
|
76
76
|
toolbar.show = show !== null && show !== void 0 ? show : true;
|
|
77
77
|
toolbar.needConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : true;
|
|
78
78
|
toolbar.onEvent = /*#__PURE__*/function () {
|
|
79
|
-
var _ref = _asyncToGenerator(
|
|
79
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(record, index) {
|
|
80
80
|
var onEvent, result;
|
|
81
81
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
82
82
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -63,7 +63,7 @@ export var actions = {
|
|
|
63
63
|
});
|
|
64
64
|
},
|
|
65
65
|
save: function () {
|
|
66
|
-
var _save = _asyncToGenerator(
|
|
66
|
+
var _save = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
|
67
67
|
var record, editingKeys, setState, form, rowName, virtualRowName, result, updateData, nextEditingKeys, values;
|
|
68
68
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
69
69
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -166,7 +166,7 @@ export var actions = {
|
|
|
166
166
|
}
|
|
167
167
|
},
|
|
168
168
|
add: function () {
|
|
169
|
-
var _add = _asyncToGenerator(
|
|
169
|
+
var _add = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref5) {
|
|
170
170
|
var _tableRef$current$que, _tableRef$current$que2;
|
|
171
171
|
var result, insertType, editingKeys, setState, form, name, virtualName, virtualKey, onlyOneLineMsg, tableRef, _ref5$prefixCls, prefixCls, nextData, rowKey, addData, nextEditingKeys;
|
|
172
172
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -26,7 +26,7 @@ import locale from '../../locale';
|
|
|
26
26
|
// 渲染操作栏
|
|
27
27
|
var getActionColumn = function getActionColumn(config) {
|
|
28
28
|
var _cloneDeepWith = cloneDeepWith(config, function (value) {
|
|
29
|
-
if (
|
|
29
|
+
if (/*#__PURE__*/React.isValidElement(value)) {
|
|
30
30
|
return value;
|
|
31
31
|
}
|
|
32
32
|
}),
|
|
@@ -83,7 +83,7 @@ var getActionColumn = function getActionColumn(config) {
|
|
|
83
83
|
action.show = show !== null && show !== void 0 ? show : true;
|
|
84
84
|
action.needConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : true;
|
|
85
85
|
action.onEvent = /*#__PURE__*/function () {
|
|
86
|
-
var _ref = _asyncToGenerator(
|
|
86
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(record, index) {
|
|
87
87
|
var _form$getFieldValue;
|
|
88
88
|
var rowName, _record, onEvent, result;
|
|
89
89
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -234,7 +234,7 @@ export var transformColumns = function transformColumns() {
|
|
|
234
234
|
children: [before, columnTitle, _jsx(_Tooltip, _objectSpread(_objectSpread({
|
|
235
235
|
title: tooltipTitle !== null && tooltipTitle !== void 0 ? tooltipTitle : tooltip
|
|
236
236
|
}, resetProps), {}, {
|
|
237
|
-
children: icon ? (
|
|
237
|
+
children: icon ? (/*#__PURE__*/React.cloneElement(icon, {
|
|
238
238
|
className: 'icon-tip'
|
|
239
239
|
})) : _jsx(ReactSVG, {
|
|
240
240
|
className: "icon-tip",
|
|
@@ -380,8 +380,8 @@ export var transformColumns = function transformColumns() {
|
|
|
380
380
|
}
|
|
381
381
|
// cacheMap 用来存储缓存值,若有值后不再请求
|
|
382
382
|
if (JSON.stringify(cacheMap.current) === '{}') {
|
|
383
|
-
Promise.all(Object.entries(_cacheMap).map(
|
|
384
|
-
var _ref3 = _asyncToGenerator(
|
|
383
|
+
Promise.all(Object.entries(_cacheMap).map(/*#__PURE__*/function () {
|
|
384
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(item) {
|
|
385
385
|
var _item, key, value, _ref4, service, option;
|
|
386
386
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
387
387
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -191,7 +191,7 @@ export var handleScrollToError = function handleScrollToError() {
|
|
|
191
191
|
*/
|
|
192
192
|
export function cloneDeepFilterNode(value) {
|
|
193
193
|
return cloneDeepWith(value, function (val) {
|
|
194
|
-
if (
|
|
194
|
+
if (/*#__PURE__*/React.isValidElement(val)) {
|
|
195
195
|
return val;
|
|
196
196
|
}
|
|
197
197
|
});
|
|
@@ -43,7 +43,10 @@ var Group = function Group(props) {
|
|
|
43
43
|
}
|
|
44
44
|
return _jsx("div", {
|
|
45
45
|
id: id,
|
|
46
|
-
className: classNames(
|
|
46
|
+
className: classNames({
|
|
47
|
+
'pro-enum-group-root': true,
|
|
48
|
+
'pro-enum-group-root-disabled': disabled
|
|
49
|
+
}),
|
|
47
50
|
children: dataSource.map(function (item, index) {
|
|
48
51
|
return _jsx("div", {
|
|
49
52
|
onClick: function onClick() {
|
|
@@ -51,7 +54,12 @@ var Group = function Group(props) {
|
|
|
51
54
|
handleClick(item[fieldValue], index);
|
|
52
55
|
}
|
|
53
56
|
},
|
|
54
|
-
className: classNames(
|
|
57
|
+
className: classNames({
|
|
58
|
+
'pro-enum-group-item': true,
|
|
59
|
+
'pro-enum-group-item-selected': value === item[fieldValue],
|
|
60
|
+
'pro-enum-group-item-disabled-after': index === idx.current || index + 1 === idx.current,
|
|
61
|
+
'pro-enum-group-item-disabled': item.disabled
|
|
62
|
+
}),
|
|
55
63
|
children: item[fieldLabel]
|
|
56
64
|
}, item[fieldValue]);
|
|
57
65
|
})
|
|
@@ -52,7 +52,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
52
52
|
staleTime: 6e4 * 60
|
|
53
53
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
|
54
54
|
setCache: function () {
|
|
55
|
-
var _setCache = _asyncToGenerator(
|
|
55
|
+
var _setCache = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
|
|
56
56
|
var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
|
|
57
57
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
58
58
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -162,7 +162,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
162
162
|
}
|
|
163
163
|
}));
|
|
164
164
|
var mergeData = /*#__PURE__*/function () {
|
|
165
|
-
var _ref3 = _asyncToGenerator(
|
|
165
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
166
166
|
var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res, _locale$ProEnum6;
|
|
167
167
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
168
168
|
while (1) switch (_context2.prev = _context2.next) {
|
package/es/ProEnum/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
11
11
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
12
12
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
13
13
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
14
|
-
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps"],
|
|
14
|
+
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps", "isView"],
|
|
15
15
|
_excluded2 = ["fieldNames", "clear", "cacheKey", "showCodeName"];
|
|
16
16
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
17
|
import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
|
|
@@ -39,10 +39,11 @@ var ProEnum = function ProEnum(props) {
|
|
|
39
39
|
onChange = props.onChange,
|
|
40
40
|
transformResponse = props.transformResponse,
|
|
41
41
|
otherProps = props.otherProps,
|
|
42
|
+
isView = props.isView,
|
|
42
43
|
enumProps = _objectWithoutProperties(props, _excluded);
|
|
43
44
|
var _ref = otherProps || {},
|
|
44
|
-
isView = _ref.isView,
|
|
45
45
|
viewEmpty = _ref.viewEmpty;
|
|
46
|
+
var _isView = isView || (otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView);
|
|
46
47
|
var _ref2 = useProConfig('ProEnum') || {},
|
|
47
48
|
fieldNames = _ref2.fieldNames,
|
|
48
49
|
_ref2$clear = _ref2.clear,
|
|
@@ -152,7 +153,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
152
153
|
list = [];
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
|
-
if (
|
|
156
|
+
if (/*#__PURE__*/React.isValidElement(component)) {
|
|
156
157
|
var Component = component;
|
|
157
158
|
return _jsx(Component, _objectSpread(_objectSpread({}, enumProps), {}, {
|
|
158
159
|
dataSource: list,
|
|
@@ -226,7 +227,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
226
227
|
if (!code && !dataSource && !useRequest) {
|
|
227
228
|
var _locale$ProEnum4;
|
|
228
229
|
_message.error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum4 = locale.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType);
|
|
229
|
-
return;
|
|
230
|
+
// return;
|
|
230
231
|
}
|
|
231
232
|
var transToLabel = function transToLabel(value) {
|
|
232
233
|
var list = dataList && dataList.length ? dataList : enumLists;
|
|
@@ -271,7 +272,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
271
272
|
};
|
|
272
273
|
return isFunction(props.optionRender) && record.length ? _optionRender() : labelList === null || labelList === void 0 ? void 0 : labelList.join(',');
|
|
273
274
|
};
|
|
274
|
-
if (
|
|
275
|
+
if (_isView) {
|
|
275
276
|
if (Array.isArray(value)) {
|
|
276
277
|
return _jsx(Container, {
|
|
277
278
|
tooltip: true,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@root-entry-name: 'default';
|
|
2
2
|
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
3
|
|
|
4
|
+
@zaui-disabled-bg: var(--zaui-disabled-bg);
|
|
5
|
+
|
|
4
6
|
.pro-enum {
|
|
5
7
|
&-tag-root {
|
|
6
8
|
display: flex;
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
justify-content: center;
|
|
20
22
|
margin-right: var(--zaui-space-size-sm);
|
|
21
23
|
padding: var(--zaui-space-size-xs) 10px;
|
|
22
|
-
background-color:
|
|
24
|
+
background-color: var(--zaui-disabled-bg);
|
|
23
25
|
border-radius: var(--zaui-space-size-xs);
|
|
24
26
|
cursor: pointer;
|
|
25
27
|
}
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
background-color: var(--zaui-brand);
|
|
30
32
|
}
|
|
31
33
|
&-tag-item-disabled {
|
|
32
|
-
background-color:
|
|
34
|
+
background-color: var(--zaui-disabled-bg);
|
|
33
35
|
pointer-events: none;
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -90,12 +92,20 @@
|
|
|
90
92
|
|
|
91
93
|
.pro-enum-group-item-disabled {
|
|
92
94
|
color: rgba(0, 0, 0, 0.25);
|
|
93
|
-
background:
|
|
95
|
+
background: var(--zaui-disabled-bg);
|
|
94
96
|
cursor: not-allowed;
|
|
95
97
|
}
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
&-group-root-disabled {
|
|
99
|
-
|
|
101
|
+
color: var(--zaui-aide-text);
|
|
102
|
+
|
|
103
|
+
.pro-enum-group-item {
|
|
104
|
+
background: var(--zaui-disabled-bg);
|
|
105
|
+
&.pro-enum-group-item-selected {
|
|
106
|
+
background: var(--zaui-brand-disabled);
|
|
107
|
+
border-color: var(--zaui-brand-disabled);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
100
110
|
}
|
|
101
111
|
}
|
|
@@ -5,7 +5,7 @@ interface EnumRes {
|
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
}
|
|
7
7
|
export declare function getEnumData(storage: StorageType, cacheKey: string, baseEnumStorage?: any): EnumRes;
|
|
8
|
-
export declare function setEnumData(storage: StorageType, cacheKey: string, data:
|
|
8
|
+
export declare function setEnumData(storage: StorageType, cacheKey: string, data: any): boolean;
|
|
9
9
|
export declare function hasEnumList(storage: StorageType, cacheKey: any, code: string): DataOption[];
|
|
10
10
|
export declare function isObject(obj: any): boolean;
|
|
11
11
|
export declare function mergeCacheData(storage: string, code: string, cacheKey: string, responseData: any): void;
|
|
@@ -13,6 +13,10 @@ export function getEnumData(storage, cacheKey, baseEnumStorage) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
export function setEnumData(storage, cacheKey, data) {
|
|
16
|
+
var _Object$keys;
|
|
17
|
+
if (!((_Object$keys = Object.keys(data === null || data === void 0 ? void 0 : data.data)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
16
20
|
if (storage === 'localStorage') {
|
|
17
21
|
window.localStorage.setItem(cacheKey, JSON.stringify(data));
|
|
18
22
|
} else if (storage === 'sessionStorage') {
|
|
@@ -9,11 +9,12 @@ import ProCollapse from '../../../../ProLayout/components/ProCollapse';
|
|
|
9
9
|
import ProForm from '../../../../ProForm';
|
|
10
10
|
var Container = function Container(props) {
|
|
11
11
|
var children = props.children,
|
|
12
|
-
otherProps = props.otherProps,
|
|
13
12
|
className = props.className,
|
|
14
13
|
container = props.container,
|
|
15
14
|
show = props.show,
|
|
16
|
-
clearNotShow = props.clearNotShow
|
|
15
|
+
clearNotShow = props.clearNotShow,
|
|
16
|
+
diffConfig = props.diffConfig,
|
|
17
|
+
otherProps = props.otherProps;
|
|
17
18
|
var _ref = ProForm.useFieldProps() || {},
|
|
18
19
|
type = _ref.type,
|
|
19
20
|
form = _ref.form,
|
|
@@ -38,7 +39,8 @@ var Container = function Container(props) {
|
|
|
38
39
|
var childRender = function childRender() {
|
|
39
40
|
var child = _jsx(RenderFields, _objectSpread({
|
|
40
41
|
columns: _children,
|
|
41
|
-
form: form
|
|
42
|
+
form: form,
|
|
43
|
+
diffConfig: diffConfig
|
|
42
44
|
}, otherProps));
|
|
43
45
|
if (type === 'ProCollapse') {
|
|
44
46
|
return _jsx(ProCollapse, _objectSpread(_objectSpread({}, omit(props, ['otherProps', 'children', 'onBlur', 'onChange', 'placeholder', 'className'])), {}, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RowProps } from 'antd';
|
|
3
|
-
import { ProColumnProps, ProFormOtherProps } from '../../../propsType';
|
|
3
|
+
import { ProColumnProps, ProFormOtherProps, DiffConfigProps } from '../../../propsType';
|
|
4
4
|
export interface ContainerProps {
|
|
5
5
|
children?: ProColumnProps[];
|
|
6
6
|
otherProps?: ProFormOtherProps;
|
|
@@ -8,5 +8,6 @@ export interface ContainerProps {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
container?: string | React.ReactNode;
|
|
10
10
|
show?: boolean | (() => boolean);
|
|
11
|
+
diffConfig?: DiffConfigProps;
|
|
11
12
|
clearNotShow?: boolean;
|
|
12
13
|
}
|
|
@@ -133,7 +133,7 @@ var ActionButton = function ActionButton(props) {
|
|
|
133
133
|
return _actionProps;
|
|
134
134
|
}, [props.actionProps]);
|
|
135
135
|
var handleClick = /*#__PURE__*/function () {
|
|
136
|
-
var _ref6 = _asyncToGenerator(
|
|
136
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(defaultCallback, callback, index, item) {
|
|
137
137
|
var value, data;
|
|
138
138
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
139
139
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -272,7 +272,7 @@ var ActionButton = function ActionButton(props) {
|
|
|
272
272
|
},
|
|
273
273
|
children: label
|
|
274
274
|
}))
|
|
275
|
-
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (
|
|
275
|
+
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (/*#__PURE__*/_createElement(_Button, _objectSpread(_objectSpread({}, rest), {}, {
|
|
276
276
|
key: "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index),
|
|
277
277
|
type: "text",
|
|
278
278
|
onClick: function onClick(e) {
|
|
@@ -55,7 +55,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
|
55
55
|
return _toolbarProps;
|
|
56
56
|
}, [props.toolbarProps]);
|
|
57
57
|
var handleClick = /*#__PURE__*/function () {
|
|
58
|
-
var _ref2 = _asyncToGenerator(
|
|
58
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(defaultCallback, callback, item) {
|
|
59
59
|
var value, data;
|
|
60
60
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
61
61
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isEqualWith
|
|
1
|
+
import { isEqualWith } from 'lodash';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* namesPath生产 [['list', 0, 'min'], ['list', 0, 'max']] => list_0_min-list_0_max
|
|
@@ -23,11 +23,12 @@ export var namesPathTransform = function namesPathTransform(_ref) {
|
|
|
23
23
|
// 比较memo
|
|
24
24
|
export var memoWith = function memoWith(pre, next) {
|
|
25
25
|
return isEqualWith(pre, next, function (objValue, othValue) {
|
|
26
|
-
if (
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
if (isFunction(objValue) && isFunction(othValue)) {
|
|
26
|
+
if (/*#__PURE__*/React.isValidElement(objValue) && /*#__PURE__*/React.isValidElement(othValue)) {
|
|
30
27
|
return true;
|
|
31
28
|
}
|
|
29
|
+
// 移除解决formlist函数里不更新问题
|
|
30
|
+
// if (isFunction(objValue) && isFunction(othValue)) {
|
|
31
|
+
// return true;
|
|
32
|
+
// }
|
|
32
33
|
});
|
|
33
34
|
};
|
|
@@ -48,7 +48,7 @@ var ComRender = function ComRender(props) {
|
|
|
48
48
|
};
|
|
49
49
|
var _props = mergedGetValueProps(fieldProps.value);
|
|
50
50
|
var componentProps = _objectSpread(_objectSpread(_objectSpread({}, fieldProps), rest), _props);
|
|
51
|
-
var Component = component ? (
|
|
51
|
+
var Component = component ? (/*#__PURE__*/React.cloneElement(component, _objectSpread({}, componentProps))) : _jsx(TypeComponent, _objectSpread({}, componentProps));
|
|
52
52
|
var Com = getComRender(Component, props, componentProps);
|
|
53
53
|
return _jsx(FieldProvider, {
|
|
54
54
|
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
|
@@ -283,10 +283,17 @@ export var useTransformColumns = function useTransformColumns(params) {
|
|
|
283
283
|
option: args === null || args === void 0 ? void 0 : args[1]
|
|
284
284
|
});
|
|
285
285
|
};
|
|
286
|
+
// 内外一个为true则为true
|
|
287
|
+
var getLastDisabled = function getLastDisabled() {
|
|
288
|
+
if (Array.isArray(groupProps.disabled)) {
|
|
289
|
+
return reactiveProps.disabled || groupProps.disabled[index];
|
|
290
|
+
}
|
|
291
|
+
return reactiveProps.disabled || groupProps.disabled;
|
|
292
|
+
};
|
|
286
293
|
return _objectSpread(_objectSpread(_objectSpread({}, column), {}, {
|
|
287
294
|
name: columnName
|
|
288
295
|
}, reactiveProps), {}, {
|
|
289
|
-
disabled:
|
|
296
|
+
disabled: getLastDisabled(),
|
|
290
297
|
getValueProps: transform === null || transform === void 0 ? void 0 : transform.getValueProps,
|
|
291
298
|
fieldProps: _objectSpread(_objectSpread({}, column === null || column === void 0 ? void 0 : column.fieldProps), {}, {
|
|
292
299
|
onChange: handleChange,
|
|
@@ -96,8 +96,11 @@ var ProCascader = function ProCascader(props) {
|
|
|
96
96
|
enumDataSource = _ref5$ === void 0 ? [] : _ref5$;
|
|
97
97
|
var realDataSource = useMemo(function () {
|
|
98
98
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
|
99
|
-
var result = isAddressMode && realLevel === 2 ? _filterDataSource(innerDataSource, level, fieldNames) : innerDataSource;
|
|
100
|
-
|
|
99
|
+
var result = 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 = _objectSpread({}, 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 = _asyncToGenerator(
|
|
118
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
116
119
|
var _yield$service, data, newData, transFormData, serviceData;
|
|
117
120
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
118
121
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -24,7 +24,7 @@ var useDefaultOptions = function useDefaultOptions(options) {
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var defaultService = /*#__PURE__*/function () {
|
|
27
|
-
var _ref = _asyncToGenerator(
|
|
27
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
28
28
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
29
29
|
while (1) switch (_context.prev = _context.next) {
|
|
30
30
|
case 0:
|