@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
|
@@ -11,8 +11,11 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _antd = require("antd");
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
15
|
var _lodash = require("lodash");
|
|
15
16
|
var _diffOriginal = require("../../../ProForm/utils/diffOriginal");
|
|
17
|
+
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
18
|
+
var _utils = require("../../../utils");
|
|
16
19
|
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type"];
|
|
17
20
|
var toNamePath = function toNamePath(name) {
|
|
18
21
|
if (Array.isArray(name)) {
|
|
@@ -66,7 +69,7 @@ var getOriginalValue = function getOriginalValue(_ref) {
|
|
|
66
69
|
return (0, _lodash.get)(originalValues, originalName);
|
|
67
70
|
}) : (0, _lodash.get)(originalValues, originalName);
|
|
68
71
|
};
|
|
69
|
-
var
|
|
72
|
+
var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
70
73
|
var name = props.name,
|
|
71
74
|
names = props.names,
|
|
72
75
|
namesStr = props.namesStr,
|
|
@@ -81,11 +84,13 @@ var ListChanged = function ListChanged(props) {
|
|
|
81
84
|
children = props.children,
|
|
82
85
|
type = props.type,
|
|
83
86
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
87
|
+
var _ref2 = (0, _ProConfigProvider.useProConfig)('ProEditTable') || {},
|
|
88
|
+
isDiffAll = _ref2.isDiffAll;
|
|
84
89
|
var namePath = toNamePath(namesStr || name);
|
|
85
90
|
var originalNamePath = toNamePath(originalName);
|
|
86
91
|
var originalNamePaths = originalNames && toNamePaths(originalNames);
|
|
87
|
-
var
|
|
88
|
-
var originalValue =
|
|
92
|
+
var isWatch = originalValues && !['FormList', 'ProEditTable'].includes(type);
|
|
93
|
+
var originalValue = isWatch ? getOriginalValue({
|
|
89
94
|
namePath: namePath,
|
|
90
95
|
originalName: originalNamePath,
|
|
91
96
|
originalNames: originalNamePaths,
|
|
@@ -93,9 +98,9 @@ var ListChanged = function ListChanged(props) {
|
|
|
93
98
|
rowKeyPath: rowKeyPath,
|
|
94
99
|
form: form
|
|
95
100
|
}) : undefined;
|
|
96
|
-
var noChange = !equalWith && (!originalValues ||
|
|
97
|
-
var
|
|
98
|
-
if (
|
|
101
|
+
var noChange = !equalWith && (!originalValues || isDiffAll ? false : (0, _utils.isEmpty)(originalValue));
|
|
102
|
+
var diffType = (0, _react.useMemo)(function () {
|
|
103
|
+
if (!isWatch || noChange) return 'same';
|
|
99
104
|
return (0, _diffOriginal.diffOriginal)({
|
|
100
105
|
value: props.value,
|
|
101
106
|
originalValue: originalValue,
|
|
@@ -104,11 +109,20 @@ var ListChanged = function ListChanged(props) {
|
|
|
104
109
|
// name: isString(namesStr) ? namesStr : originalName || name,
|
|
105
110
|
});
|
|
106
111
|
}, [props.value, originalValue]);
|
|
107
|
-
|
|
112
|
+
var isAdd = diffType === 'add';
|
|
113
|
+
var isChanged = diffType === 'changed';
|
|
114
|
+
if (!isWatch || noChange) {
|
|
108
115
|
return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, children.props), rest));
|
|
109
116
|
}
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
var diffClassName = (0, _classnames.default)({
|
|
118
|
+
'pro-form-item-changed': isChanged,
|
|
119
|
+
'pro-form-item-add': isAdd
|
|
120
|
+
});
|
|
121
|
+
return (0, _jsxRuntime.jsx)(_antd.Tooltip
|
|
122
|
+
// 传入undefined 鼠标移入显示移出隐藏
|
|
123
|
+
, {
|
|
124
|
+
// 传入undefined 鼠标移入显示移出隐藏
|
|
125
|
+
open: isChanged ? undefined : false,
|
|
112
126
|
getPopupContainer: function getPopupContainer(target) {
|
|
113
127
|
return target.parentElement;
|
|
114
128
|
},
|
|
@@ -121,9 +135,9 @@ var ListChanged = function ListChanged(props) {
|
|
|
121
135
|
})) : undefined]
|
|
122
136
|
}),
|
|
123
137
|
children: (0, _jsxRuntime.jsx)("div", {
|
|
124
|
-
className:
|
|
138
|
+
className: diffClassName,
|
|
125
139
|
children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, children.props), rest)) : undefined
|
|
126
140
|
})
|
|
127
141
|
});
|
|
128
142
|
};
|
|
129
|
-
var _default = exports.default =
|
|
143
|
+
var _default = exports.default = ListChangedWrapper;
|
|
@@ -29,7 +29,7 @@ var _useRules = _interopRequireDefault(require("../../../ProForm/utils/useRules"
|
|
|
29
29
|
var _utils = require("../../../ProForm/utils");
|
|
30
30
|
var _ConfirmWrapper = _interopRequireDefault(require("../../../ProForm/components/render/ConfirmWrapper"));
|
|
31
31
|
var _getDefaultProps = require("../../utils/getDefaultProps");
|
|
32
|
-
var
|
|
32
|
+
var _ListChangedWrapper = _interopRequireDefault(require("./ListChangedWrapper"));
|
|
33
33
|
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "className", "trim", "confirm"];
|
|
34
34
|
/* eslint-disable prefer-destructuring */
|
|
35
35
|
/* eslint-disable prefer-const */
|
|
@@ -253,7 +253,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
253
253
|
if (typeof _editRender === 'function') {
|
|
254
254
|
TargetComponent = _editRender.apply(void 0, rowParams);
|
|
255
255
|
}
|
|
256
|
-
if (
|
|
256
|
+
if (/*#__PURE__*/_react.default.isValidElement(_editRender)) {
|
|
257
257
|
TargetComponent = _editRender;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
@@ -269,7 +269,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
269
269
|
children: View
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
|
-
if (
|
|
272
|
+
if (/*#__PURE__*/_react.default.isValidElement(viewRender)) {
|
|
273
273
|
TargetComponent = viewRender;
|
|
274
274
|
}
|
|
275
275
|
}
|
|
@@ -312,7 +312,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
312
312
|
}, 100);
|
|
313
313
|
};
|
|
314
314
|
// 单元格更新数据时,加个防抖,防止更新频率过快,卡顿
|
|
315
|
-
var _onChange = (0, _lodash.debounce)(
|
|
315
|
+
var _onChange = (0, _lodash.debounce)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
316
316
|
var _len2,
|
|
317
317
|
args,
|
|
318
318
|
_key2,
|
|
@@ -416,7 +416,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
416
416
|
}, _callee);
|
|
417
417
|
})), 300);
|
|
418
418
|
var _onblur = /*#__PURE__*/function () {
|
|
419
|
-
var _ref3 = (0, _asyncToGenerator2.default)(
|
|
419
|
+
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
|
420
420
|
var _TargetComponent3, _TargetComponent3$pro, _TargetComponent$prop4;
|
|
421
421
|
var _len3,
|
|
422
422
|
args,
|
|
@@ -517,7 +517,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
517
517
|
form: form,
|
|
518
518
|
names: names,
|
|
519
519
|
namePath: [].concat((0, _toConsumableArray2.default)(namePath), [index]),
|
|
520
|
-
name:
|
|
520
|
+
name: originalName,
|
|
521
521
|
listName: cellName,
|
|
522
522
|
viewEmpty: viewEmpty,
|
|
523
523
|
valueType: _valueType,
|
|
@@ -552,9 +552,9 @@ var RenderField = function RenderField(_ref) {
|
|
|
552
552
|
var getFieldItem = function getFieldItem() {
|
|
553
553
|
var _componentProps;
|
|
554
554
|
var FormItem = null;
|
|
555
|
-
var FieldComponent = /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? (
|
|
555
|
+
var FieldComponent = /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? (/*#__PURE__*/_react.default.cloneElement(TargetComponent, componentProps)) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, componentProps));
|
|
556
556
|
if (originalValues) {
|
|
557
|
-
FieldComponent = (0, _jsxRuntime.jsx)(
|
|
557
|
+
FieldComponent = (0, _jsxRuntime.jsx)(_ListChangedWrapper.default, {
|
|
558
558
|
name: cellName,
|
|
559
559
|
names: names,
|
|
560
560
|
namesStr: [].concat((0, _toConsumableArray2.default)(baseName), [index, dataIndex]),
|
|
@@ -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) {
|
|
@@ -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
|
});
|
|
@@ -50,7 +50,10 @@ var Group = function Group(props) {
|
|
|
50
50
|
}
|
|
51
51
|
return (0, _jsxRuntime.jsx)("div", {
|
|
52
52
|
id: id,
|
|
53
|
-
className: (0, _classnames.default)(
|
|
53
|
+
className: (0, _classnames.default)({
|
|
54
|
+
'pro-enum-group-root': true,
|
|
55
|
+
'pro-enum-group-root-disabled': disabled
|
|
56
|
+
}),
|
|
54
57
|
children: dataSource.map(function (item, index) {
|
|
55
58
|
return (0, _jsxRuntime.jsx)("div", {
|
|
56
59
|
onClick: function onClick() {
|
|
@@ -58,7 +61,12 @@ var Group = function Group(props) {
|
|
|
58
61
|
handleClick(item[fieldValue], index);
|
|
59
62
|
}
|
|
60
63
|
},
|
|
61
|
-
className: (0, _classnames.default)(
|
|
64
|
+
className: (0, _classnames.default)({
|
|
65
|
+
'pro-enum-group-item': true,
|
|
66
|
+
'pro-enum-group-item-selected': value === item[fieldValue],
|
|
67
|
+
'pro-enum-group-item-disabled-after': index === idx.current || index + 1 === idx.current,
|
|
68
|
+
'pro-enum-group-item-disabled': item.disabled
|
|
69
|
+
}),
|
|
62
70
|
children: item[fieldLabel]
|
|
63
71
|
}, item[fieldValue]);
|
|
64
72
|
})
|
|
@@ -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
|
@@ -26,7 +26,7 @@ var _getEnumLabel = _interopRequireDefault(require("./utils/getEnumLabel"));
|
|
|
26
26
|
var _useEnum = _interopRequireDefault(require("./hooks/useEnum"));
|
|
27
27
|
var _locale = _interopRequireDefault(require("../locale"));
|
|
28
28
|
require("./style/index.less");
|
|
29
|
-
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps"],
|
|
29
|
+
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps", "isView"],
|
|
30
30
|
_excluded2 = ["fieldNames", "clear", "cacheKey", "showCodeName"];
|
|
31
31
|
var ProEnum = function ProEnum(props) {
|
|
32
32
|
var _enumProps$showCodeNa;
|
|
@@ -40,10 +40,11 @@ var ProEnum = function ProEnum(props) {
|
|
|
40
40
|
onChange = props.onChange,
|
|
41
41
|
transformResponse = props.transformResponse,
|
|
42
42
|
otherProps = props.otherProps,
|
|
43
|
+
isView = props.isView,
|
|
43
44
|
enumProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
44
45
|
var _ref = otherProps || {},
|
|
45
|
-
isView = _ref.isView,
|
|
46
46
|
viewEmpty = _ref.viewEmpty;
|
|
47
|
+
var _isView = isView || (otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView);
|
|
47
48
|
var _ref2 = (0, _ProConfigProvider.useProConfig)('ProEnum') || {},
|
|
48
49
|
fieldNames = _ref2.fieldNames,
|
|
49
50
|
_ref2$clear = _ref2.clear,
|
|
@@ -153,7 +154,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
153
154
|
list = [];
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
|
-
if (
|
|
157
|
+
if (/*#__PURE__*/_react.default.isValidElement(component)) {
|
|
157
158
|
var Component = component;
|
|
158
159
|
return (0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
|
|
159
160
|
dataSource: list,
|
|
@@ -227,7 +228,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
227
228
|
if (!code && !dataSource && !useRequest) {
|
|
228
229
|
var _locale$ProEnum4;
|
|
229
230
|
_antd.message.error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum4 = _locale.default.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType);
|
|
230
|
-
return;
|
|
231
|
+
// return;
|
|
231
232
|
}
|
|
232
233
|
var transToLabel = function transToLabel(value) {
|
|
233
234
|
var list = dataList && dataList.length ? dataList : enumLists;
|
|
@@ -272,7 +273,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
272
273
|
};
|
|
273
274
|
return (0, _lodash.isFunction)(props.optionRender) && record.length ? _optionRender() : labelList === null || labelList === void 0 ? void 0 : labelList.join(',');
|
|
274
275
|
};
|
|
275
|
-
if (
|
|
276
|
+
if (_isView) {
|
|
276
277
|
if (Array.isArray(value)) {
|
|
277
278
|
return (0, _jsxRuntime.jsx)(_Container.default, {
|
|
278
279
|
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;
|
|
@@ -26,6 +26,10 @@ function getEnumData(storage, cacheKey, baseEnumStorage) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
function setEnumData(storage, cacheKey, data) {
|
|
29
|
+
var _Object$keys;
|
|
30
|
+
if (!((_Object$keys = Object.keys(data === null || data === void 0 ? void 0 : data.data)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length)) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
29
33
|
if (storage === 'localStorage') {
|
|
30
34
|
window.localStorage.setItem(cacheKey, JSON.stringify(data));
|
|
31
35
|
} else if (storage === 'sessionStorage') {
|
|
@@ -16,11 +16,12 @@ var _ProCollapse = _interopRequireDefault(require("../../../../ProLayout/compone
|
|
|
16
16
|
var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
|
17
17
|
var Container = function Container(props) {
|
|
18
18
|
var children = props.children,
|
|
19
|
-
otherProps = props.otherProps,
|
|
20
19
|
className = props.className,
|
|
21
20
|
container = props.container,
|
|
22
21
|
show = props.show,
|
|
23
|
-
clearNotShow = props.clearNotShow
|
|
22
|
+
clearNotShow = props.clearNotShow,
|
|
23
|
+
diffConfig = props.diffConfig,
|
|
24
|
+
otherProps = props.otherProps;
|
|
24
25
|
var _ref = _ProForm.default.useFieldProps() || {},
|
|
25
26
|
type = _ref.type,
|
|
26
27
|
form = _ref.form,
|
|
@@ -45,7 +46,8 @@ var Container = function Container(props) {
|
|
|
45
46
|
var childRender = function childRender() {
|
|
46
47
|
var child = (0, _jsxRuntime.jsx)(_RenderFields.default, (0, _objectSpread2.default)({
|
|
47
48
|
columns: _children,
|
|
48
|
-
form: form
|
|
49
|
+
form: form,
|
|
50
|
+
diffConfig: diffConfig
|
|
49
51
|
}, otherProps));
|
|
50
52
|
if (type === 'ProCollapse') {
|
|
51
53
|
return (0, _jsxRuntime.jsx)(_ProCollapse.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.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
|
}
|
|
@@ -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,11 +30,12 @@ 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 (
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
if ((0, _lodash.isFunction)(objValue) && (0, _lodash.isFunction)(othValue)) {
|
|
33
|
+
if (/*#__PURE__*/_react.default.isValidElement(objValue) && /*#__PURE__*/_react.default.isValidElement(othValue)) {
|
|
37
34
|
return true;
|
|
38
35
|
}
|
|
36
|
+
// 移除解决formlist函数里不更新问题
|
|
37
|
+
// if (isFunction(objValue) && isFunction(othValue)) {
|
|
38
|
+
// return true;
|
|
39
|
+
// }
|
|
39
40
|
});
|
|
40
41
|
};
|
|
@@ -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,
|
|
@@ -112,7 +112,7 @@ var ProCascader = function ProCascader(props) {
|
|
|
112
112
|
defaultLabel = _useState4[0],
|
|
113
113
|
setDefaultLabel = _useState4[1];
|
|
114
114
|
var getFirstLevelOptions = /*#__PURE__*/function () {
|
|
115
|
-
var _ref6 = (0, _asyncToGenerator2.default)(
|
|
115
|
+
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
116
116
|
var _yield$service, data, newData, transFormData, serviceData;
|
|
117
117
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
118
118
|
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:
|