@zat-design/sisyphus-react 3.13.7 → 3.13.9
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/es/ProAction/components/CheckModalContent/index.css +22 -0
- package/es/ProAction/components/CheckModalContent/index.d.ts +8 -0
- package/es/ProAction/components/CheckModalContent/index.js +38 -0
- package/es/ProAction/components/CheckModalContent/index.less +28 -0
- package/es/ProAction/index.js +39 -41
- package/es/ProAction/index.less +5 -6
- package/es/ProAction/propsType.d.ts +8 -6
- package/es/ProDownload/index.js +4 -3
- package/es/ProDownload/utils.js +5 -4
- package/es/ProDrawerForm/components/ProDrawer/index.js +2 -2
- package/es/ProDrawerForm/components/ProModal/index.js +2 -2
- package/es/ProEditLabel/components/RenderProForm.js +3 -3
- package/es/ProEditLabel/index.js +2 -2
- package/es/ProEditTable/components/ActionButton/index.js +9 -8
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +6 -6
- package/es/ProEditTable/components/RenderField/index.js +20 -16
- package/es/ProEditTable/index.js +10 -7
- package/es/ProEditTable/utils/config.js +3 -3
- package/es/ProEditTable/utils/diffOriginal.js +6 -4
- package/es/ProEditTable/utils/getDefaultProps.js +8 -7
- package/es/ProEditTable/utils/index.js +21 -18
- package/es/ProEditTable/utils/tools.js +32 -24
- package/es/ProEditTable/utils/useEditTableError.js +2 -2
- package/es/ProEnum/index.js +16 -11
- package/es/ProEnum/utils/eventCenter.js +2 -2
- package/es/ProEnum/utils/getEnumLabel.js +5 -4
- package/es/ProEnum/utils/index.js +3 -2
- package/es/ProForm/components/base/DatePicker/index.js +11 -8
- package/es/ProForm/components/base/Input/index.js +3 -3
- package/es/ProForm/components/base/InputNumber/index.js +6 -4
- package/es/ProForm/components/base/RangePicker/index.js +12 -8
- package/es/ProForm/components/base/Select/index.js +2 -2
- package/es/ProForm/components/base/Switch/index.js +3 -2
- package/es/ProForm/components/base/SwitchCheckbox/index.js +3 -2
- package/es/ProForm/components/base/TextArea/index.js +2 -2
- package/es/ProForm/components/combination/Container/index.js +2 -2
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +7 -6
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +2 -2
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +2 -2
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +5 -4
- package/es/ProForm/components/combination/FormList/index.js +2 -2
- package/es/ProForm/components/combination/FormList/utils.js +2 -2
- package/es/ProForm/components/combination/Group/hooks/index.js +4 -3
- package/es/ProForm/components/combination/Group/index.js +2 -2
- package/es/ProForm/components/combination/Group/utils.js +6 -6
- package/es/ProForm/components/combination/ProCascader/index.js +6 -4
- package/es/ProForm/components/combination/ProCascader/utils/index.js +2 -2
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/index.js +13 -10
- package/es/ProForm/components/combination/ProNumberRange/index.js +2 -2
- package/es/ProForm/components/combination/ProRangeLimit/index.js +8 -5
- package/es/ProForm/components/combination/ProTimeLimit/index.js +10 -7
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.js +3 -3
- package/es/ProForm/components/old/EnumSelect/index.js +3 -3
- package/es/ProForm/components/render/ChangedWrapper.js +3 -3
- package/es/ProForm/components/render/ConfirmWrapper.js +4 -3
- package/es/ProForm/components/render/Render.js +17 -13
- package/es/ProForm/components/render/RenderFields.js +9 -6
- package/es/ProForm/index.js +6 -4
- package/es/ProForm/utils/_useChanged.js +3 -3
- package/es/ProForm/utils/_useListChanged.js +6 -6
- package/es/ProForm/utils/diffOriginal.js +6 -4
- package/es/ProForm/utils/getDefaultProps.js +7 -6
- package/es/ProForm/utils/index.js +20 -15
- package/es/ProForm/utils/rulesCreator.js +4 -3
- package/es/ProForm/utils/transformNames.js +2 -2
- package/es/ProForm/utils/transformValue.js +3 -3
- package/es/ProForm/utils/useDeepCompareMemo.js +2 -2
- package/es/ProForm/utils/useRules.js +4 -3
- package/es/ProForm/utils/useShouldUpdate.js +23 -21
- package/es/ProForm/utils/useWatch.js +2 -2
- package/es/ProForm/utils/valueType.js +2 -2
- package/es/ProIcon/index.js +2 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +2 -2
- package/es/ProLayout/components/ProCollapse/index.js +2 -2
- package/es/ProLayout/components/ProHeader/index.js +12 -9
- package/es/ProLayout/utils/index.js +3 -2
- package/es/ProSelect/index.js +11 -7
- package/es/ProSelect/utils/index.js +5 -3
- package/es/ProStep/components/Item/index.js +2 -2
- package/es/ProStep/components/Listener/index.js +2 -2
- package/es/ProStep/components/Step/index.js +2 -2
- package/es/ProStep/index.js +2 -2
- package/es/ProStep/utils/index.js +4 -3
- package/es/ProStepTab/index.js +3 -3
- package/es/ProTable/components/FormatColumn/index.js +16 -12
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +3 -3
- package/es/ProTable/components/RenderColumn/index.js +2 -2
- package/es/ProTable/components/RenderSummary/index.js +3 -3
- package/es/ProTable/hooks/useAntdTable.js +15 -10
- package/es/ProTable/index.js +12 -7
- package/es/ProTable/utils/index.js +5 -4
- package/es/ProTabs/index.js +2 -2
- package/es/ProThemeTools/index.js +2 -2
- package/es/ProTree/components/ProTree.js +5 -4
- package/es/ProTree/components/ProTreeSelect/index.js +6 -5
- package/es/ProTreeModal/index.js +5 -4
- package/es/ProUpload/components/ImageRender.js +2 -2
- package/es/ProUpload/index.js +5 -4
- package/es/old/ProEditableTable/index.js +7 -7
- package/es/old/ProEditableTable/utils.js +2 -2
- package/lib/ProAction/components/CheckModalContent/index.css +22 -0
- package/lib/ProAction/components/CheckModalContent/index.d.ts +8 -0
- package/lib/ProAction/components/CheckModalContent/index.js +45 -0
- package/lib/ProAction/components/CheckModalContent/index.less +28 -0
- package/lib/ProAction/index.js +45 -44
- package/lib/ProAction/index.less +5 -6
- package/lib/ProAction/propsType.d.ts +8 -6
- package/lib/ProConfigProvider/index.js +3 -2
- package/lib/ProDownload/index.js +7 -6
- package/lib/ProDownload/utils.js +9 -7
- package/lib/ProDrawerForm/components/ProDrawer/index.js +12 -7
- package/lib/ProDrawerForm/components/ProModal/index.js +12 -7
- package/lib/ProEditLabel/components/RenderProForm.js +6 -5
- package/lib/ProEditLabel/index.js +15 -8
- package/lib/ProEditTable/components/ActionButton/index.js +15 -11
- package/lib/ProEditTable/components/RcTable/BaseTable.js +6 -3
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +3 -2
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +14 -11
- package/lib/ProEditTable/components/RenderField/index.js +25 -20
- package/lib/ProEditTable/components/RenderToolbar/index.js +3 -2
- package/lib/ProEditTable/components/Summary/index.js +8 -5
- package/lib/ProEditTable/components/Validator/index.js +7 -3
- package/lib/ProEditTable/index.js +20 -12
- package/lib/ProEditTable/utils/config.js +8 -7
- package/lib/ProEditTable/utils/diffOriginal.js +7 -4
- package/lib/ProEditTable/utils/getDefaultProps.js +8 -7
- package/lib/ProEditTable/utils/index.js +27 -21
- package/lib/ProEditTable/utils/tools.js +32 -24
- package/lib/ProEditTable/utils/useEditTableError.js +2 -2
- package/lib/ProEnum/index.js +31 -19
- package/lib/ProEnum/utils/eventCenter.js +2 -2
- package/lib/ProEnum/utils/getEnumLabel.js +5 -4
- package/lib/ProEnum/utils/index.js +3 -2
- package/lib/ProForm/components/Container.js +3 -2
- package/lib/ProForm/components/FormFooter/index.js +7 -4
- package/lib/ProForm/components/base/Checkbox/index.js +4 -3
- package/lib/ProForm/components/base/DatePicker/index.js +14 -10
- package/lib/ProForm/components/base/Input/index.js +6 -5
- package/lib/ProForm/components/base/InputNumber/index.js +12 -7
- package/lib/ProForm/components/base/Radio/index.js +4 -3
- package/lib/ProForm/components/base/RangePicker/index.js +15 -10
- package/lib/ProForm/components/base/Select/index.js +5 -4
- package/lib/ProForm/components/base/Switch/index.js +6 -4
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +6 -4
- package/lib/ProForm/components/base/TextArea/index.js +5 -4
- package/lib/ProForm/components/base/TimePicker/index.js +3 -2
- package/lib/ProForm/components/combination/Container/index.js +2 -2
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +16 -10
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +8 -5
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +2 -2
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +3 -2
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +10 -6
- package/lib/ProForm/components/combination/FormList/index.js +5 -4
- package/lib/ProForm/components/combination/FormList/utils.js +2 -2
- package/lib/ProForm/components/combination/Group/hooks/index.js +4 -3
- package/lib/ProForm/components/combination/Group/index.js +6 -5
- package/lib/ProForm/components/combination/Group/utils.js +10 -9
- package/lib/ProForm/components/combination/ProCascader/index.js +14 -7
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +2 -2
- package/lib/ProForm/components/combination/ProCombination/index.js +9 -4
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +3 -3
- package/lib/ProForm/components/combination/ProModalSelect/index.js +35 -19
- package/lib/ProForm/components/combination/ProNumberRange/index.js +17 -10
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +17 -9
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +19 -11
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.js +3 -3
- package/lib/ProForm/components/old/EnumSelect/index.js +15 -8
- package/lib/ProForm/components/old/InputRange/index.js +8 -5
- package/lib/ProForm/components/old/InputWithSuffix/index.js +4 -3
- package/lib/ProForm/components/old/ProAddress/index.js +18 -11
- package/lib/ProForm/components/old/ProCertNo/index.js +12 -7
- package/lib/ProForm/components/old/ProCertValidity/index.js +11 -6
- package/lib/ProForm/components/old/ProRangeBox/index.js +21 -12
- package/lib/ProForm/components/render/ChangedWrapper.js +11 -8
- package/lib/ProForm/components/render/ConfirmWrapper.js +8 -6
- package/lib/ProForm/components/render/Render.js +34 -23
- package/lib/ProForm/components/render/RenderFields.js +9 -6
- package/lib/ProForm/index.js +21 -12
- package/lib/ProForm/utils/_useChanged.js +7 -5
- package/lib/ProForm/utils/_useListChanged.js +10 -8
- package/lib/ProForm/utils/diffOriginal.js +7 -4
- package/lib/ProForm/utils/getDefaultProps.js +8 -6
- package/lib/ProForm/utils/index.js +20 -15
- package/lib/ProForm/utils/rulesCreator.js +4 -3
- package/lib/ProForm/utils/transformNames.js +3 -2
- package/lib/ProForm/utils/transformValue.js +3 -3
- package/lib/ProForm/utils/useDeepCompareMemo.js +3 -2
- package/lib/ProForm/utils/useForm.js +3 -2
- package/lib/ProForm/utils/useRules.js +4 -3
- package/lib/ProForm/utils/useShouldUpdate.js +23 -21
- package/lib/ProForm/utils/useWatch.js +2 -2
- package/lib/ProForm/utils/valueType.js +2 -2
- package/lib/ProIcon/index.js +13 -8
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +6 -3
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +5 -4
- package/lib/ProLayout/components/ProCollapse/index.js +13 -8
- package/lib/ProLayout/components/ProFooter/index.js +3 -2
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +3 -2
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +3 -2
- package/lib/ProLayout/components/ProHeader/index.js +37 -25
- package/lib/ProLayout/index.js +3 -2
- package/lib/ProLayout/utils/index.js +2 -2
- package/lib/ProSelect/components/AdaptiveTooltip.js +3 -2
- package/lib/ProSelect/index.js +25 -14
- package/lib/ProSelect/utils/index.js +4 -4
- package/lib/ProStep/components/Anchor/index.js +3 -2
- package/lib/ProStep/components/Item/index.js +2 -2
- package/lib/ProStep/components/Listener/index.js +2 -2
- package/lib/ProStep/components/Step/index.js +2 -2
- package/lib/ProStep/index.js +2 -2
- package/lib/ProStep/utils/index.js +4 -3
- package/lib/ProStepTab/index.js +3 -3
- package/lib/ProTable/components/FormatColumn/index.js +26 -21
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +3 -2
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +3 -3
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +3 -2
- package/lib/ProTable/components/RenderColumn/index.js +17 -12
- package/lib/ProTable/components/RenderSummary/index.js +8 -7
- package/lib/ProTable/components/RenderTableHeader/index.js +5 -3
- package/lib/ProTable/components/RenderTabs/index.js +6 -3
- package/lib/ProTable/components/TooltipTitle/index.js +3 -2
- package/lib/ProTable/hooks/useAntdTable.js +21 -13
- package/lib/ProTable/index.js +12 -7
- package/lib/ProTable/utils/index.js +5 -4
- package/lib/ProTabs/components/Card/index.js +11 -5
- package/lib/ProTabs/index.js +5 -4
- package/lib/ProThemeTools/component/ProTools/index.js +19 -12
- package/lib/ProThemeTools/index.js +12 -9
- package/lib/ProThemeTools/utils/index.js +3 -2
- package/lib/ProTooltip/index.js +5 -4
- package/lib/ProTree/components/AdaptiveTooltip.js +4 -2
- package/lib/ProTree/components/List.js +4 -3
- package/lib/ProTree/components/ProTree.js +17 -9
- package/lib/ProTree/components/ProTreeSelect/index.js +22 -14
- package/lib/ProTree/components/Tree.js +6 -3
- package/lib/ProTreeModal/components/Cascader.js +4 -3
- package/lib/ProTreeModal/components/List.js +14 -9
- package/lib/ProTreeModal/components/SortableItem.js +3 -2
- package/lib/ProTreeModal/components/Tree.js +4 -3
- package/lib/ProTreeModal/components/Trigger.js +11 -6
- package/lib/ProTreeModal/index.js +21 -13
- package/lib/ProUpload/components/ButtonRender.js +6 -3
- package/lib/ProUpload/components/DragRender.js +3 -2
- package/lib/ProUpload/components/FileItem.js +15 -10
- package/lib/ProUpload/components/ImageRender.js +19 -10
- package/lib/ProUpload/index.js +9 -7
- package/lib/ProViewer/index.js +9 -4
- package/lib/old/ProCertValidity/index.js +11 -6
- package/lib/old/ProEditableTable/index.js +36 -23
- package/lib/old/ProEditableTable/utils.js +35 -18
- package/package.json +2 -1
package/es/ProEnum/index.js
CHANGED
@@ -11,12 +11,17 @@ 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
|
+
import _isNumber from "lodash/isNumber";
|
15
|
+
import _omit from "lodash/omit";
|
16
|
+
import _isArray from "lodash/isArray";
|
17
|
+
import _isString from "lodash/isString";
|
18
|
+
import _isFunction from "lodash/isFunction";
|
19
|
+
import _cloneDeep from "lodash/cloneDeep";
|
14
20
|
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps", "isView"],
|
15
21
|
_excluded2 = ["fieldNames", "clear", "cacheKey", "showCodeName"];
|
16
22
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
17
23
|
import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
|
18
24
|
import React, { useState, useEffect, useMemo } from 'react';
|
19
|
-
import { cloneDeep, isFunction, isString, isArray, omit, isNumber } from 'lodash';
|
20
25
|
import ProSelect from '../ProSelect';
|
21
26
|
import { useProConfig } from '../ProConfigProvider';
|
22
27
|
import ProEnumTag from './components/Tag';
|
@@ -113,7 +118,7 @@ var ProEnum = function ProEnum(props) {
|
|
113
118
|
if (Array.isArray(data)) {
|
114
119
|
setData(_toConsumableArray(data));
|
115
120
|
}
|
116
|
-
if (isObject(data) &&
|
121
|
+
if (isObject(data) && _isString(code)) {
|
117
122
|
setData(data[code]);
|
118
123
|
}
|
119
124
|
} else {
|
@@ -134,13 +139,13 @@ var ProEnum = function ProEnum(props) {
|
|
134
139
|
}, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.options]);
|
135
140
|
var enumLists = useMemo(function () {
|
136
141
|
var lists = [];
|
137
|
-
if (
|
142
|
+
if (_isString(code)) {
|
138
143
|
lists = (dics === null || dics === void 0 ? void 0 : dics[code]) || [];
|
139
144
|
}
|
140
|
-
if (
|
145
|
+
if (_isArray(code)) {
|
141
146
|
code.forEach(function (enumCode) {
|
142
147
|
var _lists;
|
143
|
-
|
148
|
+
_isArray(dics === null || dics === void 0 ? void 0 : dics[enumCode]) && (_lists = lists).push.apply(_lists, _toConsumableArray(dics === null || dics === void 0 ? void 0 : dics[enumCode]));
|
144
149
|
});
|
145
150
|
}
|
146
151
|
return lists;
|
@@ -148,7 +153,7 @@ var ProEnum = function ProEnum(props) {
|
|
148
153
|
var renderComponent = function renderComponent() {
|
149
154
|
var list = [];
|
150
155
|
// 优先使用组件内部自己传入的数据源或者请求得到的数据
|
151
|
-
list =
|
156
|
+
list = _cloneDeep(dataList && dataList.length ? dataList : enumLists);
|
152
157
|
// 对数据进行一系列的过滤等操作
|
153
158
|
if (!(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service) && transformResponse) {
|
154
159
|
list = transformResponse(list);
|
@@ -183,7 +188,7 @@ var ProEnum = function ProEnum(props) {
|
|
183
188
|
onChange: onChange
|
184
189
|
}));
|
185
190
|
case 'Radio':
|
186
|
-
return _jsx(_Radio.Group, _objectSpread(_objectSpread({},
|
191
|
+
return _jsx(_Radio.Group, _objectSpread(_objectSpread({}, _omit(enumProps, ['fieldNames', 'showCodeName'])), {}, {
|
187
192
|
options: list,
|
188
193
|
value: value,
|
189
194
|
onChange: onChange,
|
@@ -196,7 +201,7 @@ var ProEnum = function ProEnum(props) {
|
|
196
201
|
})
|
197
202
|
}));
|
198
203
|
case 'Checkbox':
|
199
|
-
return _jsx(_Checkbox.Group, _objectSpread(_objectSpread({},
|
204
|
+
return _jsx(_Checkbox.Group, _objectSpread(_objectSpread({}, _omit(enumProps, ['fieldNames', 'showCodeName'])), {}, {
|
200
205
|
options: list,
|
201
206
|
value: value,
|
202
207
|
onChange: onChange,
|
@@ -218,7 +223,7 @@ var ProEnum = function ProEnum(props) {
|
|
218
223
|
dataSource: list
|
219
224
|
});
|
220
225
|
case 'Group':
|
221
|
-
return _jsx(ProEnumGroup, _objectSpread(_objectSpread({},
|
226
|
+
return _jsx(ProEnumGroup, _objectSpread(_objectSpread({}, _omit(enumProps, ['showCodeName'])), {}, {
|
222
227
|
value: value,
|
223
228
|
onChange: onChange,
|
224
229
|
fieldLabel: label,
|
@@ -274,7 +279,7 @@ var ProEnum = function ProEnum(props) {
|
|
274
279
|
})
|
275
280
|
});
|
276
281
|
};
|
277
|
-
return
|
282
|
+
return _isFunction(props.optionRender) && record.length ? _optionRender() : labelList === null || labelList === void 0 ? void 0 : labelList.join(',');
|
278
283
|
};
|
279
284
|
if (_isView) {
|
280
285
|
var __value = value || _defalutValue;
|
@@ -287,7 +292,7 @@ var ProEnum = function ProEnum(props) {
|
|
287
292
|
}
|
288
293
|
return _jsx(Container, {
|
289
294
|
viewEmpty: viewEmpty,
|
290
|
-
children: __value ||
|
295
|
+
children: __value || _isNumber(__value) ? transToLabel([__value]) : null
|
291
296
|
});
|
292
297
|
}
|
293
298
|
return _jsx(_Fragment, {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
3
|
-
import
|
3
|
+
import _isFunction from "lodash/isFunction";
|
4
4
|
var SimpleEventCenter = /*#__PURE__*/function () {
|
5
5
|
function SimpleEventCenter() {
|
6
6
|
_classCallCheck(this, SimpleEventCenter);
|
@@ -20,7 +20,7 @@ var SimpleEventCenter = /*#__PURE__*/function () {
|
|
20
20
|
value: function publish(eventName, data) {
|
21
21
|
if (this.events.has(eventName)) {
|
22
22
|
this.events.get(eventName).forEach(function (callback) {
|
23
|
-
|
23
|
+
_isFunction(callback) && (callback === null || callback === void 0 ? void 0 : callback(data));
|
24
24
|
});
|
25
25
|
}
|
26
26
|
}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
2
|
+
import _isString from "lodash/isString";
|
3
|
+
import _isArray from "lodash/isArray";
|
2
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
3
5
|
import { useMemo } from 'react';
|
4
|
-
import { isArray, isString } from 'lodash';
|
5
6
|
import { useProConfig } from '../../ProConfigProvider';
|
6
7
|
var EnumLabel = function EnumLabel(props) {
|
7
8
|
var fieldNameLabel = '';
|
@@ -28,13 +29,13 @@ var EnumLabel = function EnumLabel(props) {
|
|
28
29
|
dics = _useProConfig$dics === void 0 ? {} : _useProConfig$dics;
|
29
30
|
var enumLists = useMemo(function () {
|
30
31
|
var lists = [];
|
31
|
-
if (
|
32
|
+
if (_isString(code)) {
|
32
33
|
lists = (dics === null || dics === void 0 ? void 0 : dics[code]) || [];
|
33
34
|
}
|
34
|
-
if (
|
35
|
+
if (_isArray(code)) {
|
35
36
|
code.forEach(function (enumCode) {
|
36
37
|
var _lists;
|
37
|
-
|
38
|
+
_isArray(dics === null || dics === void 0 ? void 0 : dics[enumCode]) && (_lists = lists).push.apply(_lists, _toConsumableArray(dics === null || dics === void 0 ? void 0 : dics[enumCode]));
|
38
39
|
});
|
39
40
|
}
|
40
41
|
return lists;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
2
|
+
import _isUndefined from "lodash/isUndefined";
|
3
|
+
import _isNull from "lodash/isNull";
|
2
4
|
var _excluded = ["children"];
|
3
|
-
import { isNull, isUndefined } from 'lodash';
|
4
5
|
/**
|
5
6
|
* 获取枚举数据
|
6
7
|
* @param storage
|
@@ -104,7 +105,7 @@ export function cacheFieldNames(fieldNames, dataSource) {
|
|
104
105
|
var result = {};
|
105
106
|
Object.keys(restFieldNames).forEach(function (key) {
|
106
107
|
var value = dataSource[restFieldNames[key]] ? dataSource[restFieldNames[key]] : dataSource[key];
|
107
|
-
if (!(
|
108
|
+
if (!(_isUndefined(value) || _isNull(value))) {
|
108
109
|
result[key] = dataSource[restFieldNames[key]] ? dataSource[restFieldNames[key]] : dataSource[key];
|
109
110
|
}
|
110
111
|
});
|
@@ -4,9 +4,12 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
6
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
7
|
+
import _uniq from "lodash/uniq";
|
8
|
+
import _isObject from "lodash/isObject";
|
9
|
+
import _isString from "lodash/isString";
|
10
|
+
import _isFunction from "lodash/isFunction";
|
7
11
|
var _excluded = ["className", "format"];
|
8
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
|
-
import { isFunction, isString, isObject, uniq } from 'lodash';
|
10
13
|
import classNames from 'classnames';
|
11
14
|
import moment from 'moment';
|
12
15
|
import { useProConfig } from '../../../../ProConfigProvider';
|
@@ -28,10 +31,10 @@ var DatePicker = function DatePicker(props) {
|
|
28
31
|
}, className, !!className));
|
29
32
|
var _viewFormat = Array.isArray(format) ? format[0] : format;
|
30
33
|
var tempFormat = Array.isArray(format) ? format : [format];
|
31
|
-
if (
|
34
|
+
if (_isFunction(format)) {
|
32
35
|
tempFormat = [];
|
33
36
|
}
|
34
|
-
var _format =
|
37
|
+
var _format = _uniq([].concat(_toConsumableArray(tempFormat), ['YYYY-MM-DD', 'YYYYMMDD', 'YYYY/MM/DD', 'YYYY_MM_DD', 'YYYY.MM.DD'])).filter(function (formatKey) {
|
35
38
|
return !!formatKey;
|
36
39
|
});
|
37
40
|
if (isView) {
|
@@ -39,11 +42,11 @@ var DatePicker = function DatePicker(props) {
|
|
39
42
|
var viewChildren = null;
|
40
43
|
if (!value) {
|
41
44
|
viewChildren = null;
|
42
|
-
} else if (typeof format === 'string' &&
|
45
|
+
} else if (typeof format === 'string' && _isObject(value)) {
|
43
46
|
viewChildren = value.format(format);
|
44
|
-
} else if (
|
47
|
+
} else if (_isFunction(format)) {
|
45
48
|
viewChildren = format(value);
|
46
|
-
} else if (
|
49
|
+
} else if (_isString(value)) {
|
47
50
|
viewChildren = moment(value).format(_viewFormat);
|
48
51
|
}
|
49
52
|
return _jsx(Container, {
|
@@ -63,13 +66,13 @@ var DatePicker = function DatePicker(props) {
|
|
63
66
|
}
|
64
67
|
}
|
65
68
|
// 字符串时间格式兼容
|
66
|
-
if (
|
69
|
+
if (_isString(_rest.value)) {
|
67
70
|
_rest.value = moment(_rest.value);
|
68
71
|
}
|
69
72
|
if (_rest.showTime === true) {
|
70
73
|
_rest.showTime = _objectSpread({}, _defaultShowTime);
|
71
74
|
}
|
72
|
-
if (
|
75
|
+
if (_isObject(_rest.showTime)) {
|
73
76
|
_rest.showTime = Object.assign(_defaultShowTime, _rest.showTime);
|
74
77
|
}
|
75
78
|
return _jsx(_DatePicker, _objectSpread(_objectSpread(_objectSpread({}, initialConfig), {}, {
|
@@ -2,10 +2,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "antd/es/input/style";
|
3
3
|
import _Input from "antd/es/input";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
5
|
+
import _omit from "lodash/omit";
|
5
6
|
var _excluded = ["label", "form", "placeholder", "fieldName", "otherProps", "desensitization"];
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
8
|
import React from 'react';
|
8
|
-
import { omit } from 'lodash';
|
9
9
|
import { useProConfig } from '../../../../ProConfigProvider';
|
10
10
|
import Container from '../../Container';
|
11
11
|
import locale from '../../../../locale';
|
@@ -49,7 +49,7 @@ var Input = function Input(props) {
|
|
49
49
|
allowClear: true,
|
50
50
|
autoComplete: "off",
|
51
51
|
placeholder: placeholder || "".concat(locale.ProForm.inputPlaceholder)
|
52
|
-
},
|
52
|
+
}, _omit(initialConfig, ['trim', 'upperCase'])), rest));
|
53
53
|
// 仅查看模式下进行数据脱敏
|
54
54
|
if ((desensitization === null || desensitization === void 0 ? void 0 : desensitization.length) && (props === null || props === void 0 ? void 0 : props.disabled)) {
|
55
55
|
var _isDesensit = sessionStorage.getItem(otherProps === null || otherProps === void 0 ? void 0 : otherProps.desensitizationKey);
|
@@ -62,7 +62,7 @@ var Input = function Input(props) {
|
|
62
62
|
allowClear: true,
|
63
63
|
autoComplete: 'off',
|
64
64
|
placeholder: placeholder || "".concat(locale.ProForm.inputPlaceholder)
|
65
|
-
},
|
65
|
+
}, _omit(initialConfig, ['trim', 'upperCase'])), rest), {}, {
|
66
66
|
value: maskStringRangeWithRegex(rest.value, desensitization)
|
67
67
|
}));
|
68
68
|
}
|
@@ -6,13 +6,15 @@ import _Space from "antd/es/space";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
7
7
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
8
8
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
9
|
+
import _isUndefined from "lodash/isUndefined";
|
10
|
+
import _isNumber from "lodash/isNumber";
|
11
|
+
import _isNull from "lodash/isNull";
|
9
12
|
var _excluded = ["placeholder", "className", "otherProps", "range", "min", "max", "onBlur", "onFocus"];
|
10
13
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
11
14
|
import { useMemo, useRef } from 'react';
|
12
15
|
import classNames from 'classnames';
|
13
16
|
import Big from 'big.js';
|
14
17
|
import { tools } from '@zat-design/utils';
|
15
|
-
import { isNull, isNumber, isUndefined } from 'lodash';
|
16
18
|
import { useProConfig } from '../../../../ProConfigProvider';
|
17
19
|
import Container from '../../Container';
|
18
20
|
import { getDecimalDigits } from '../../../utils/index';
|
@@ -172,7 +174,7 @@ var InputNumber = function InputNumber(props) {
|
|
172
174
|
var value = rest.value,
|
173
175
|
precision = rest.precision;
|
174
176
|
// 值为空时返回viewEmpty
|
175
|
-
if (
|
177
|
+
if (_isNull(value) || _isUndefined(value)) {
|
176
178
|
return _jsx(_Fragment, {
|
177
179
|
children: viewEmpty
|
178
180
|
});
|
@@ -195,7 +197,7 @@ var InputNumber = function InputNumber(props) {
|
|
195
197
|
}
|
196
198
|
return _jsx(Container, {
|
197
199
|
viewEmpty: viewEmpty,
|
198
|
-
children: Big(value).toNumber().toFixed(
|
200
|
+
children: Big(value).toNumber().toFixed(_isNumber(precision) ? precision : 2)
|
199
201
|
});
|
200
202
|
// 千分比
|
201
203
|
case 'permillage':
|
@@ -213,7 +215,7 @@ var InputNumber = function InputNumber(props) {
|
|
213
215
|
}
|
214
216
|
return _jsx(Container, {
|
215
217
|
viewEmpty: viewEmpty,
|
216
|
-
children: Big(value).toNumber().toFixed(
|
218
|
+
children: Big(value).toNumber().toFixed(_isNumber(precision) ? precision : 2)
|
217
219
|
});
|
218
220
|
// 千分位
|
219
221
|
case 'amount':
|
@@ -3,11 +3,15 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
4
|
import "antd/es/date-picker/style";
|
5
5
|
import _DatePicker from "antd/es/date-picker";
|
6
|
+
import _uniq from "lodash/uniq";
|
7
|
+
import _omit from "lodash/omit";
|
8
|
+
import _isString from "lodash/isString";
|
9
|
+
import _isObject from "lodash/isObject";
|
10
|
+
import _isFunction from "lodash/isFunction";
|
6
11
|
var _excluded = ["format", "otherProps", "separator", "range"];
|
7
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
13
|
// @ts-check
|
9
14
|
|
10
|
-
import { isFunction, isObject, isString, omit, uniq } from 'lodash';
|
11
15
|
import moment from 'moment';
|
12
16
|
import { useProConfig } from '../../../../ProConfigProvider';
|
13
17
|
import ProForm from '../../../../ProForm';
|
@@ -44,15 +48,15 @@ var RangePicker = function RangePicker(props) {
|
|
44
48
|
}
|
45
49
|
}
|
46
50
|
// 字符串时间格式兼容
|
47
|
-
if (Array.isArray(_rest.value) &&
|
51
|
+
if (Array.isArray(_rest.value) && _isString(_rest.value[0]) && _isString(_rest.value[1])) {
|
48
52
|
_rest.value = [moment(_rest.value[0]), moment(_rest.value[1])];
|
49
53
|
}
|
50
54
|
var _viewFormat = Array.isArray(format) ? format[0] : format;
|
51
55
|
var tempFormat = Array.isArray(format) ? format : [format];
|
52
|
-
if (
|
56
|
+
if (_isFunction(format)) {
|
53
57
|
tempFormat = [];
|
54
58
|
}
|
55
|
-
var _format =
|
59
|
+
var _format = _uniq([].concat(_toConsumableArray(tempFormat), ['YYYY-MM-DD', 'YYYYMMDD', 'YYYY/MM/DD', 'YYYY_MM_DD', 'YYYY.MM.DD'])).filter(function (formatKey) {
|
56
60
|
return !!formatKey;
|
57
61
|
});
|
58
62
|
var _defaultShowTime = {
|
@@ -66,13 +70,13 @@ var RangePicker = function RangePicker(props) {
|
|
66
70
|
viewChildren = null;
|
67
71
|
} else if (Array.isArray(format)) {
|
68
72
|
var formattedList = format.map(function (formatItem, index) {
|
69
|
-
if (
|
73
|
+
if (_isFunction(formatItem)) {
|
70
74
|
return formatItem(value[index]);
|
71
75
|
}
|
72
76
|
return value[index].format(formatItem);
|
73
77
|
});
|
74
78
|
viewChildren = formattedList.join(separator);
|
75
|
-
} else if (
|
79
|
+
} else if (_isFunction(format)) {
|
76
80
|
viewChildren = "".concat(format(value[0]), " ").concat(separator, " ").concat(format(value[1]));
|
77
81
|
} else {
|
78
82
|
viewChildren = "".concat(value[0].format(_viewFormat), " ").concat(separator, " ").concat(value[1].format(_viewFormat));
|
@@ -85,10 +89,10 @@ var RangePicker = function RangePicker(props) {
|
|
85
89
|
if (_rest.showTime === true) {
|
86
90
|
_rest.showTime = _objectSpread({}, _defaultShowTime);
|
87
91
|
}
|
88
|
-
if (
|
92
|
+
if (_isObject(_rest.showTime)) {
|
89
93
|
_rest.showTime = Object.assign(_defaultShowTime, _rest.showTime);
|
90
94
|
}
|
91
|
-
return _jsx(AntRangePicker, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, initialConfig),
|
95
|
+
return _jsx(AntRangePicker, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, initialConfig), _omit(_rest, ['separator'])), rangeRegulator), {}, {
|
92
96
|
format: _format
|
93
97
|
}));
|
94
98
|
};
|
@@ -2,9 +2,9 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "antd/es/select/style";
|
3
3
|
import _Select from "antd/es/select";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
5
|
+
import _isNumber from "lodash/isNumber";
|
5
6
|
var _excluded = ["dataSource", "fieldNames", "otherProps", "scrollFollowParent"];
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
import { isNumber } from 'lodash';
|
8
8
|
import Container from '../../Container';
|
9
9
|
import { useProConfig } from '../../../../ProConfigProvider';
|
10
10
|
import locale from '../../../../locale';
|
@@ -46,7 +46,7 @@ var Select = function Select(props) {
|
|
46
46
|
}
|
47
47
|
return _jsx(Container, {
|
48
48
|
viewEmpty: viewEmpty,
|
49
|
-
children: value ||
|
49
|
+
children: value || _isNumber(value) ? transToLabel([value]) : null
|
50
50
|
});
|
51
51
|
}
|
52
52
|
return _jsx(_Select, _objectSpread(_objectSpread(_objectSpread({
|
@@ -2,9 +2,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "antd/es/switch/style";
|
3
3
|
import _Switch from "antd/es/switch";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
5
|
+
import _isUndefined from "lodash/isUndefined";
|
6
|
+
import _isNull from "lodash/isNull";
|
5
7
|
var _excluded = ["disabled", "otherProps"];
|
6
8
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
import { isNull, isUndefined } from 'lodash';
|
8
9
|
import { useProConfig } from '../../../../ProConfigProvider';
|
9
10
|
import Container from '../../Container';
|
10
11
|
import locale from '../../../../locale';
|
@@ -20,7 +21,7 @@ var Switch = function Switch(props) {
|
|
20
21
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
|
21
22
|
var config = useProConfig('Switch');
|
22
23
|
if (isView) {
|
23
|
-
if (
|
24
|
+
if (_isUndefined(res === null || res === void 0 ? void 0 : res.checked) || _isNull(res === null || res === void 0 ? void 0 : res.checked) || valueType === 'switch' && _isUndefined(res.value)) {
|
24
25
|
return _jsx(_Fragment, {
|
25
26
|
children: viewEmpty
|
26
27
|
});
|
@@ -2,9 +2,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "antd/es/checkbox/style";
|
3
3
|
import _Checkbox from "antd/es/checkbox";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
5
|
+
import _isUndefined from "lodash/isUndefined";
|
6
|
+
import _isNull from "lodash/isNull";
|
5
7
|
var _excluded = ["onChange", "disabled", "value", "otherProps", "className"];
|
6
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
7
|
-
import { isNull, isUndefined } from 'lodash';
|
8
9
|
import classnames from 'classnames';
|
9
10
|
import { useProConfig } from '../../../../ProConfigProvider';
|
10
11
|
import locale from '../../../../locale';
|
@@ -26,7 +27,7 @@ var SwitchCheckbox = function SwitchCheckbox(props) {
|
|
26
27
|
onChange(e.target.checked);
|
27
28
|
};
|
28
29
|
if (isView) {
|
29
|
-
if (
|
30
|
+
if (_isUndefined(restProps.checked) || _isNull(restProps.checked) || valueType === 'switch' && _isUndefined(value)) {
|
30
31
|
return _jsxs("span", {
|
31
32
|
className: "switch-checkbox-view",
|
32
33
|
children: [_jsx("span", {
|
@@ -3,9 +3,9 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
4
|
import "antd/es/input/style";
|
5
5
|
import _Input from "antd/es/input";
|
6
|
+
import _omit from "lodash/omit";
|
6
7
|
var _excluded = ["placeholder", "otherProps", "className", "tooltip"];
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
-
import { omit } from 'lodash';
|
9
9
|
import classnames from 'classnames';
|
10
10
|
import { useProConfig } from '../../../../ProConfigProvider';
|
11
11
|
import locale from '../../../../locale';
|
@@ -44,7 +44,7 @@ var TextAreaDef = function TextAreaDef(props) {
|
|
44
44
|
autoComplete: "off",
|
45
45
|
placeholder: placeholder || "".concat(locale.ProForm.inputPlaceholder).concat(label || ''),
|
46
46
|
autoSize: !(props === null || props === void 0 ? void 0 : (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.height)
|
47
|
-
},
|
47
|
+
}, _omit(initialConfig, ['trim', 'upperCase'])), rest), {}, {
|
48
48
|
className: _className
|
49
49
|
}));
|
50
50
|
};
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
3
|
+
import _omit from "lodash/omit";
|
3
4
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
4
5
|
import { useMemo } from 'react';
|
5
|
-
import { omit } from 'lodash';
|
6
6
|
import classnames from 'classnames';
|
7
7
|
import RenderFields from '../../render/RenderFields';
|
8
8
|
import ProCollapse from '../../../../ProLayout/components/ProCollapse';
|
@@ -43,7 +43,7 @@ var Container = function Container(props) {
|
|
43
43
|
diffConfig: diffConfig
|
44
44
|
}, otherProps));
|
45
45
|
if (type === 'ProCollapse') {
|
46
|
-
return _jsx(ProCollapse, _objectSpread(_objectSpread({},
|
46
|
+
return _jsx(ProCollapse, _objectSpread(_objectSpread({}, _omit(props, ['otherProps', 'children', 'onBlur', 'onChange', 'placeholder', 'className'])), {}, {
|
47
47
|
children: child
|
48
48
|
}));
|
49
49
|
}
|
@@ -9,11 +9,12 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
9
9
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
10
10
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
11
11
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
12
|
+
import _omit from "lodash/omit";
|
13
|
+
import _isFunction from "lodash/isFunction";
|
12
14
|
var _excluded = ["label", "onClick", "onHandle", "type", "needConfirm", "confirmProps", "title"],
|
13
15
|
_excluded2 = ["onClick", "label"];
|
14
16
|
import { createElement as _createElement } from "react";
|
15
17
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
16
|
-
import { isFunction, omit } from 'lodash';
|
17
18
|
import { useMemo } from 'react';
|
18
19
|
import { CopyOutlined, PlusSquareOutlined, ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons';
|
19
20
|
import ProIcon from '../../../../../ProIcon';
|
@@ -193,7 +194,7 @@ var ActionButton = function ActionButton(props) {
|
|
193
194
|
className: "pro-form-list-action",
|
194
195
|
children: actionProps === null || actionProps === void 0 ? void 0 : actionProps.map(function (item) {
|
195
196
|
if (item.show === false) return _jsx("span", {}, "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index));
|
196
|
-
if (
|
197
|
+
if (_isFunction(item.show) && !item.show(form.getFieldValue(namePath), {
|
197
198
|
namePath: namePath,
|
198
199
|
index: index,
|
199
200
|
form: form
|
@@ -243,14 +244,14 @@ var ActionButton = function ActionButton(props) {
|
|
243
244
|
handleClick(internalOnClick, _onClick, index, item);
|
244
245
|
}
|
245
246
|
}, _confirmProps), {}, {
|
246
|
-
children: _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, defaultRest),
|
247
|
+
children: _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, defaultRest), _omit(rest, filterKeys)), {}, {
|
247
248
|
type: "text",
|
248
249
|
onClick: function onClick(e) {
|
249
250
|
return e.stopPropagation();
|
250
251
|
},
|
251
252
|
children: label || defaultLabel
|
252
253
|
}))
|
253
|
-
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, defaultRest),
|
254
|
+
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, defaultRest), _omit(rest, filterKeys)), {}, {
|
254
255
|
type: "text",
|
255
256
|
onClick: function onClick(e) {
|
256
257
|
e.stopPropagation();
|
@@ -268,14 +269,14 @@ var ActionButton = function ActionButton(props) {
|
|
268
269
|
return customClick(_onClick, index);
|
269
270
|
}
|
270
271
|
}, _confirmProps), {}, {
|
271
|
-
children: _jsx(_Button, _objectSpread(_objectSpread({},
|
272
|
+
children: _jsx(_Button, _objectSpread(_objectSpread({}, _omit(rest, filterKeys)), {}, {
|
272
273
|
type: "text",
|
273
274
|
onClick: function onClick(e) {
|
274
275
|
return e.stopPropagation();
|
275
276
|
},
|
276
277
|
children: label
|
277
278
|
}))
|
278
|
-
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (/*#__PURE__*/_createElement(_Button, _objectSpread(_objectSpread({},
|
279
|
+
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (/*#__PURE__*/_createElement(_Button, _objectSpread(_objectSpread({}, _omit(rest, filterKeys)), {}, {
|
279
280
|
key: "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index),
|
280
281
|
type: "text",
|
281
282
|
onClick: function onClick(e) {
|
@@ -3,9 +3,9 @@ import _Row from "antd/es/row";
|
|
3
3
|
import "antd/es/space/style";
|
4
4
|
import _Space from "antd/es/space";
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
6
|
+
import _isFunction from "lodash/isFunction";
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
8
|
import React, { useMemo } from 'react';
|
8
|
-
import { isFunction } from 'lodash';
|
9
9
|
import classNames from 'classnames';
|
10
10
|
import ActionButton from './ActionButton';
|
11
11
|
import RenderFields from '../../../render/RenderFields';
|
@@ -34,7 +34,7 @@ var BlockFields = function BlockFields(props) {
|
|
34
34
|
id = props.id,
|
35
35
|
diffConfig = props.diffConfig;
|
36
36
|
var _title = useMemo(function () {
|
37
|
-
if (
|
37
|
+
if (_isFunction(title)) {
|
38
38
|
var record = form.getFieldValue(namePath);
|
39
39
|
return title(record, index, form);
|
40
40
|
}
|
@@ -1,6 +1,6 @@
|
|
1
|
+
import _isFunction from "lodash/isFunction";
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
3
|
import React from 'react';
|
3
|
-
import { isFunction } from 'lodash';
|
4
4
|
var BlockTitle = function BlockTitle(props) {
|
5
5
|
var mode = props.mode,
|
6
6
|
namePath = props.namePath,
|
@@ -17,7 +17,7 @@ var BlockTitle = function BlockTitle(props) {
|
|
17
17
|
return title;
|
18
18
|
}
|
19
19
|
var titleContent = title;
|
20
|
-
if (
|
20
|
+
if (_isFunction(title)) {
|
21
21
|
var record = form.getFieldValue(namePath);
|
22
22
|
titleContent = title(record, index, form);
|
23
23
|
}
|
@@ -7,13 +7,14 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
7
7
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
8
8
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
9
9
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
10
|
+
import _omit from "lodash/omit";
|
11
|
+
import _isFunction from "lodash/isFunction";
|
10
12
|
var _excluded = ["label", "onClick", "onHandle", "type"],
|
11
13
|
_excluded2 = ["onClick", "label"];
|
12
14
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
13
15
|
/* eslint-disable react/no-array-index-key */
|
14
16
|
|
15
17
|
import { PlusOutlined } from '@ant-design/icons';
|
16
|
-
import { isFunction, omit } from 'lodash';
|
17
18
|
import { useMemo } from 'react';
|
18
19
|
import locale from '../../../../../locale';
|
19
20
|
var actions = {
|
@@ -109,7 +110,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
109
110
|
className: "pro-form-list-toolbar",
|
110
111
|
children: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.map(function (item, index) {
|
111
112
|
if (item.show === false) return _jsx(_Fragment, {});
|
112
|
-
if (
|
113
|
+
if (_isFunction(item.show) && !item.show(form.getFieldValue(namePath), {
|
113
114
|
namePath: namePath,
|
114
115
|
form: form
|
115
116
|
})) {
|
@@ -131,7 +132,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
131
132
|
if (max && max <= fields.length && type === 'add') {
|
132
133
|
return false;
|
133
134
|
}
|
134
|
-
return _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, actions[type]),
|
135
|
+
return _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, actions[type]), _omit(rest, filterKeys)), {}, {
|
135
136
|
type: "link",
|
136
137
|
onClick: function onClick() {
|
137
138
|
return handleClick(internalOnClick, _onClick, item);
|
@@ -139,7 +140,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
139
140
|
children: label || defaultLabel
|
140
141
|
}), "".concat(type).concat(index));
|
141
142
|
}
|
142
|
-
return _jsx(_Button, _objectSpread(_objectSpread({},
|
143
|
+
return _jsx(_Button, _objectSpread(_objectSpread({}, _omit(rest, filterKeys)), {}, {
|
143
144
|
type: "link",
|
144
145
|
onClick: function onClick() {
|
145
146
|
return customClick(_onClick2, item);
|
@@ -2,10 +2,10 @@ import "antd/es/form/style";
|
|
2
2
|
import _Form from "antd/es/form";
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
5
|
+
import _get from "lodash/get";
|
5
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
6
7
|
import { forwardRef, useCallback, useImperativeHandle } from 'react';
|
7
8
|
import { DndContext } from '@dnd-kit/core';
|
8
|
-
import { get } from 'lodash';
|
9
9
|
import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
10
10
|
import { toArray } from '../../../utils';
|
11
11
|
import { namesPathTransform } from './utils';
|
@@ -41,7 +41,7 @@ var FormList = function FormList(props, ref) {
|
|
41
41
|
isDiffAll = _useProConfig.isDiffAll;
|
42
42
|
var errors = meta.errors;
|
43
43
|
var _namePath = toArray(name);
|
44
|
-
var orgValues =
|
44
|
+
var orgValues = _get(diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalValues, name);
|
45
45
|
var _diffConfig = _objectSpread(_objectSpread({}, diffConfig), {}, {
|
46
46
|
originalValues: (diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalValues) && isDiffAll ? orgValues || [] : orgValues
|
47
47
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import _isEqualWith from "lodash/isEqualWith";
|
2
2
|
import React from 'react';
|
3
3
|
/**
|
4
4
|
* namesPath生产 [['list', 0, 'min'], ['list', 0, 'max']] => list_0_min-list_0_max
|
@@ -22,7 +22,7 @@ export var namesPathTransform = function namesPathTransform(_ref) {
|
|
22
22
|
};
|
23
23
|
// 比较memo
|
24
24
|
export var memoWith = function memoWith(pre, next) {
|
25
|
-
return
|
25
|
+
return _isEqualWith(pre, next, function (objValue, othValue) {
|
26
26
|
if (/*#__PURE__*/React.isValidElement(objValue) && /*#__PURE__*/React.isValidElement(othValue)) {
|
27
27
|
return true;
|
28
28
|
}
|