@zat-design/sisyphus-react 3.10.2-beta.3 → 3.10.2-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/extensions.json +5 -0
- package/es/ProAction/index.js +5 -5
- package/es/ProDownload/index.d.ts +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.d.ts +1 -1
- package/es/ProEditTable/components/ActionButton/index.js +3 -3
- package/es/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +4 -4
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +6 -6
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/es/ProEditTable/components/Summary/index.d.ts +1 -1
- package/es/ProEditTable/propsType.d.ts +1 -1
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/config.js +2 -2
- package/es/ProEditTable/utils/diffOriginal.d.ts +1 -1
- package/es/ProEditTable/utils/diffOriginal.js +3 -3
- package/es/ProEditTable/utils/index.js +5 -5
- package/es/ProEditTable/utils/tools.js +4 -4
- package/es/ProEnum/components/Group.d.ts +1 -1
- package/es/ProEnum/components/Tag.d.ts +1 -1
- package/es/ProEnum/hooks/useEnumRequest.js +2 -2
- package/es/ProEnum/index.d.ts +2 -2
- package/es/ProEnum/index.js +1 -1
- package/es/ProEnum/utils/eventCenter.js +1 -2
- package/es/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/es/ProForm/components/base/Input/index.d.ts +1 -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 +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +8 -8
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/es/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +1 -2
- package/es/ProForm/components/old/ProAddress/index.js +1 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +1 -2
- package/es/ProForm/components/render/ChangedWrapper.d.ts +1 -1
- package/es/ProForm/components/render/ChangedWrapper.js +5 -6
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +5 -5
- package/es/ProForm/components/render/RenderFields.js +2 -3
- package/es/ProForm/components/render/propsType.d.ts +1 -2
- package/es/ProForm/index.js +1 -1
- package/es/ProForm/utils/_useChanged.d.ts +2 -2
- package/es/ProForm/utils/_useChanged.js +3 -3
- package/es/ProForm/utils/_useListChanged.d.ts +1 -1
- package/es/ProForm/utils/_useListChanged.js +3 -3
- package/es/ProForm/utils/diffOriginal.d.ts +1 -1
- package/es/ProForm/utils/diffOriginal.js +3 -3
- package/es/ProForm/utils/index.js +14 -10
- package/es/ProForm/utils/transformValue.js +9 -7
- package/es/ProForm/utils/useForm.js +1 -1
- package/es/ProIcon/utils/index.js +4 -3
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/es/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/es/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/es/ProLayout/index.d.ts +4 -4
- package/es/ProLayout/utils/index.js +9 -9
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProSelect/index.d.ts +1 -1
- package/es/ProStep/components/Anchor/index.d.ts +1 -1
- package/es/ProStep/components/Item/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +1 -1
- package/es/ProStep/components/Step/index.d.ts +1 -1
- package/es/ProStep/index.d.ts +2 -2
- package/es/ProStep/index.js +3 -3
- package/es/ProTable/components/FormatColumn/index.js +3 -3
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +9 -8
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/es/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/es/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/es/ProTable/components/TableResizable/index.d.ts +1 -1
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +5 -5
- package/es/ProTabs/components/Card/index.d.ts +1 -1
- package/es/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/es/ProThemeTools/index.d.ts +1 -1
- package/es/ProTooltip/index.d.ts +1 -1
- package/es/ProTree/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProTree/components/CloseIcon.d.ts +1 -2
- package/es/ProTree/components/List.d.ts +1 -1
- package/es/ProTree/components/ProTree.d.ts +1 -1
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +20 -20
- package/es/ProTree/components/SearchTitle.d.ts +1 -1
- package/es/ProTree/components/Tree.d.ts +1 -1
- package/es/ProTree/components/Tree.js +4 -4
- package/es/ProTree/index.d.ts +1 -1
- package/es/ProTree/utils.js +12 -11
- package/es/ProTreeModal/components/Cascader.d.ts +1 -1
- package/es/ProTreeModal/components/CloseIcon.d.ts +1 -2
- package/es/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/es/ProTreeModal/components/Tree.js +6 -6
- package/es/ProTreeModal/components/Trigger.d.ts +1 -1
- package/es/ProTreeModal/index.d.ts +1 -1
- package/es/ProTreeModal/index.js +3 -3
- package/es/ProTreeModal/utils.js +16 -14
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/es/ProUpload/components/ImageRender.js +1 -1
- package/es/ProViewer/index.js +2 -2
- package/es/old/ProEditableTable/index.js +4 -4
- package/lib/ProAction/index.js +5 -5
- package/lib/ProDownload/index.d.ts +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.d.ts +1 -1
- package/lib/ProEditTable/components/ActionButton/index.js +3 -3
- package/lib/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +4 -4
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +6 -6
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/lib/ProEditTable/components/Summary/index.d.ts +1 -1
- package/lib/ProEditTable/propsType.d.ts +1 -1
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/config.js +2 -2
- package/lib/ProEditTable/utils/diffOriginal.d.ts +1 -1
- package/lib/ProEditTable/utils/diffOriginal.js +3 -3
- package/lib/ProEditTable/utils/index.js +5 -5
- package/lib/ProEditTable/utils/tools.js +4 -4
- package/lib/ProEnum/components/Group.d.ts +1 -1
- package/lib/ProEnum/components/Tag.d.ts +1 -1
- package/lib/ProEnum/hooks/useEnumRequest.js +2 -2
- package/lib/ProEnum/index.d.ts +2 -2
- package/lib/ProEnum/index.js +1 -1
- package/lib/ProEnum/utils/eventCenter.js +1 -2
- package/lib/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/lib/ProForm/components/base/Input/index.d.ts +1 -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 +1 -1
- package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +8 -8
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/lib/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/lib/ProForm/components/old/ProAddress/index.d.ts +1 -2
- package/lib/ProForm/components/old/ProAddress/index.js +1 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +1 -2
- package/lib/ProForm/components/render/ChangedWrapper.d.ts +1 -1
- package/lib/ProForm/components/render/ChangedWrapper.js +5 -6
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +5 -5
- package/lib/ProForm/components/render/RenderFields.js +2 -3
- package/lib/ProForm/components/render/propsType.d.ts +1 -2
- package/lib/ProForm/index.js +1 -1
- package/lib/ProForm/utils/_useChanged.d.ts +2 -2
- package/lib/ProForm/utils/_useChanged.js +3 -3
- package/lib/ProForm/utils/_useListChanged.d.ts +1 -1
- package/lib/ProForm/utils/_useListChanged.js +3 -3
- package/lib/ProForm/utils/diffOriginal.d.ts +1 -1
- package/lib/ProForm/utils/diffOriginal.js +3 -3
- package/lib/ProForm/utils/index.js +10 -10
- package/lib/ProForm/utils/transformValue.js +9 -7
- package/lib/ProForm/utils/useForm.js +1 -1
- package/lib/ProIcon/utils/index.js +3 -3
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/lib/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/lib/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/lib/ProLayout/index.d.ts +4 -4
- package/lib/ProLayout/utils/index.js +9 -9
- package/lib/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProSelect/index.d.ts +1 -1
- package/lib/ProStep/components/Anchor/index.d.ts +1 -1
- package/lib/ProStep/components/Item/index.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.js +1 -1
- package/lib/ProStep/components/Step/index.d.ts +1 -1
- package/lib/ProStep/index.d.ts +2 -2
- package/lib/ProStep/index.js +3 -3
- package/lib/ProTable/components/FormatColumn/index.js +3 -3
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/lib/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/lib/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/lib/ProTable/components/TableResizable/index.d.ts +1 -1
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +5 -5
- package/lib/ProTabs/components/Card/index.d.ts +1 -1
- package/lib/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/lib/ProThemeTools/index.d.ts +1 -1
- package/lib/ProTooltip/index.d.ts +1 -1
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProTree/components/CloseIcon.d.ts +1 -2
- package/lib/ProTree/components/List.d.ts +1 -1
- package/lib/ProTree/components/ProTree.d.ts +1 -1
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +20 -20
- package/lib/ProTree/components/SearchTitle.d.ts +1 -1
- package/lib/ProTree/components/Tree.d.ts +1 -1
- package/lib/ProTree/components/Tree.js +4 -4
- package/lib/ProTree/index.d.ts +1 -1
- package/lib/ProTree/utils.js +11 -11
- package/lib/ProTreeModal/components/Cascader.d.ts +1 -1
- package/lib/ProTreeModal/components/CloseIcon.d.ts +1 -2
- package/lib/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/lib/ProTreeModal/components/Tree.js +6 -6
- package/lib/ProTreeModal/components/Trigger.d.ts +1 -1
- package/lib/ProTreeModal/index.d.ts +1 -1
- package/lib/ProTreeModal/index.js +3 -3
- package/lib/ProTreeModal/utils.js +13 -13
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/lib/ProUpload/components/ImageRender.js +1 -1
- package/lib/ProViewer/index.js +2 -2
- package/lib/old/ProEditableTable/index.js +4 -4
- package/package.json +1 -1
@@ -30,9 +30,9 @@ var defaultFieldNames = {
|
|
30
30
|
value: 'code',
|
31
31
|
children: 'children'
|
32
32
|
};
|
33
|
-
var
|
33
|
+
var _filterDataSource = function filterDataSource(dataSource, level, fieldNames) {
|
34
34
|
return dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
35
|
-
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, item), {}, (0, _defineProperty2.default)({}, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children', level === 1 ? [] :
|
35
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, item), {}, (0, _defineProperty2.default)({}, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children', level === 1 ? [] : _filterDataSource(item === null || item === void 0 ? void 0 : item[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], level - 1, fieldNames)));
|
36
36
|
});
|
37
37
|
};
|
38
38
|
var getViewLabel = function getViewLabel(_ref) {
|
@@ -111,7 +111,7 @@ var ProCascader = function ProCascader(props) {
|
|
111
111
|
}, [dics === null || dics === void 0 ? void 0 : dics[addressCode], enumData]);
|
112
112
|
var realDataSource = (0, _react.useMemo)(function () {
|
113
113
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
114
|
-
var result = (0, _index.transformDataName)(isAddressMode && realLevel === 2 ?
|
114
|
+
var result = (0, _index.transformDataName)(isAddressMode && realLevel === 2 ? _filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
115
115
|
return result;
|
116
116
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
117
117
|
var lastDisabled = (0, _react.useMemo)(function () {
|
@@ -133,7 +133,7 @@ var ProCascader = function ProCascader(props) {
|
|
133
133
|
defaultLabel = _useState4[0],
|
134
134
|
setDefaultLabel = _useState4[1];
|
135
135
|
var getFirstLevelOptions = /*#__PURE__*/function () {
|
136
|
-
var _ref4 = (0, _asyncToGenerator2.default)(
|
136
|
+
var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
137
137
|
var _yield$service, data, newData, transFormData, serviceData;
|
138
138
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
139
139
|
while (1) switch (_context.prev = _context.next) {
|
@@ -152,7 +152,7 @@ var ProCascader = function ProCascader(props) {
|
|
152
152
|
value: fieldNames.value,
|
153
153
|
children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
|
154
154
|
});
|
155
|
-
serviceData = isAddressMode && realLevel === 2 ?
|
155
|
+
serviceData = isAddressMode && realLevel === 2 ? _filterDataSource(transFormData, level, fieldNames) : transFormData;
|
156
156
|
setServiceData(serviceData);
|
157
157
|
case 9:
|
158
158
|
case "end":
|
@@ -222,7 +222,7 @@ var ProCascader = function ProCascader(props) {
|
|
222
222
|
})) === null || _ref5$filter === void 0 ? void 0 : _ref5$filter.join(separator)) || '-' : (defaultLabel === null || defaultLabel === void 0 ? void 0 : (_defaultLabel$filter = defaultLabel.filter(function (item) {
|
223
223
|
return !!item;
|
224
224
|
})) === null || _defaultLabel$filter === void 0 ? void 0 : _defaultLabel$filter.join(separator)) || '-';
|
225
|
-
var
|
225
|
+
var _findSelectedOptions = function findSelectedOptions(options, value) {
|
226
226
|
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
227
227
|
var _value = value !== null && value !== void 0 ? value : [];
|
228
228
|
// 基准情况:如果 value 数组为空,且 path 不为空,说明找到了完整的路径
|
@@ -241,7 +241,7 @@ var ProCascader = function ProCascader(props) {
|
|
241
241
|
if (foundOption) {
|
242
242
|
// 如果找到了匹配的选项,并且还有更多的 value 需要匹配,递归地在子选项中查找
|
243
243
|
if (_value.length > 1 && foundOption.children) {
|
244
|
-
return
|
244
|
+
return _findSelectedOptions(foundOption.children, _value.slice(1), [].concat((0, _toConsumableArray2.default)(path), [foundOption]));
|
245
245
|
}
|
246
246
|
// 如果没有更多的 value 需要匹配,返回当前选项(以及之前的路径)
|
247
247
|
return [].concat((0, _toConsumableArray2.default)(path), [foundOption]);
|
@@ -250,7 +250,7 @@ var ProCascader = function ProCascader(props) {
|
|
250
250
|
return null;
|
251
251
|
};
|
252
252
|
var _selectedOptions = (0, _react.useMemo)(function () {
|
253
|
-
return
|
253
|
+
return _findSelectedOptions(service ? serviceData : realDataSource, addressValue);
|
254
254
|
}, [service, serviceData, realDataSource, addressValue]);
|
255
255
|
var handleAddressChange = function handleAddressChange(e) {
|
256
256
|
var cascaderValue = value === null || value === void 0 ? void 0 : value.slice(0, realLevel);
|
@@ -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:
|
@@ -255,7 +255,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
255
255
|
onChange(val, option);
|
256
256
|
};
|
257
257
|
var handleClick = /*#__PURE__*/function () {
|
258
|
-
var _ref7 = (0, _asyncToGenerator2.default)(
|
258
|
+
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
259
259
|
var _yield$beforeOpen, res;
|
260
260
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
261
261
|
while (1) switch (_context.prev = _context.next) {
|
@@ -322,7 +322,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
322
322
|
}
|
323
323
|
};
|
324
324
|
var handleFinish = /*#__PURE__*/function () {
|
325
|
-
var _ref8 = (0, _asyncToGenerator2.default)(
|
325
|
+
var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
326
326
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
327
327
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
328
328
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -387,7 +387,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
387
387
|
};
|
388
388
|
}();
|
389
389
|
var handleSearch = /*#__PURE__*/function () {
|
390
|
-
var _ref9 = (0, _asyncToGenerator2.default)(
|
390
|
+
var _ref9 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
391
391
|
var values;
|
392
392
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
393
393
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -460,7 +460,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
460
460
|
};
|
461
461
|
// 初始化回显,当传入initParams时,前端用来回险
|
462
462
|
var getInitValues = /*#__PURE__*/function () {
|
463
|
-
var _ref10 = (0, _asyncToGenerator2.default)(
|
463
|
+
var _ref10 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {
|
464
464
|
var _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
465
465
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {
|
466
466
|
while (1) switch (_context4.prev = _context4.next) {
|
@@ -520,7 +520,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
520
520
|
}();
|
521
521
|
// 初始化回显,当传入initParams时,前端用来回险
|
522
522
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
523
|
-
var _ref11 = (0, _asyncToGenerator2.default)(
|
523
|
+
var _ref11 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {
|
524
524
|
var _useRequest$options4, _useRequest$options5;
|
525
525
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
526
526
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {
|
@@ -12,5 +12,5 @@ export interface InputRangeProps {
|
|
12
12
|
isPositiveInteger?: boolean;
|
13
13
|
precision?: number;
|
14
14
|
}
|
15
|
-
declare const InputRange: ({ value, onChange, min, max, group, disabled, precision, isPositiveInteger, }: InputRangeProps) => JSX.Element;
|
15
|
+
declare const InputRange: ({ value, onChange, min, max, group, disabled, precision, isPositiveInteger, }: InputRangeProps) => import("react/jsx-runtime").JSX.Element;
|
16
16
|
export default InputRange;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { ProAddressPropsType } from './propsTypes';
|
3
2
|
export declare const transferAddressInfoToRegion: () => {
|
4
3
|
normalize: (value: any) => {
|
@@ -24,5 +23,5 @@ export declare const transferAddressInfoToRegion: () => {
|
|
24
23
|
};
|
25
24
|
};
|
26
25
|
};
|
27
|
-
export declare function ProAddress({ ...props }: ProAddressPropsType): JSX.Element;
|
26
|
+
export declare function ProAddress({ ...props }: ProAddressPropsType): import("react/jsx-runtime").JSX.Element;
|
28
27
|
export default ProAddress;
|
@@ -93,7 +93,7 @@ function ProAddress(_ref3) {
|
|
93
93
|
secondCitys = _useState6[0],
|
94
94
|
setSecondCitys = _useState6[1];
|
95
95
|
var queryCity = /*#__PURE__*/function () {
|
96
|
-
var _ref5 = (0, _asyncToGenerator2.default)(
|
96
|
+
var _ref5 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(code, type) {
|
97
97
|
var cityList, _cityList, newList, _secondCitys;
|
98
98
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
99
99
|
while (1) switch (_context.prev = _context.next) {
|
@@ -1,3 +1,2 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { ProRangeBoxPropsType } from './propsType';
|
3
|
-
export default function ProRangeBox({ configOption }: ProRangeBoxPropsType): JSX.Element;
|
2
|
+
export default function ProRangeBox({ configOption }: ProRangeBoxPropsType): import("react/jsx-runtime").JSX.Element;
|
@@ -18,7 +18,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
18
18
|
var _diffOriginal = require("../../utils/diffOriginal");
|
19
19
|
var _ProConfigProvider = require("../../../ProConfigProvider");
|
20
20
|
var _utils = require("../../../utils");
|
21
|
-
var _excluded = ["name", "names", "namesStr", "form", "
|
21
|
+
var _excluded = ["name", "names", "namesStr", "form", "onDiff", "children", "type", "diffConfig", "valuePropName", "normalize", "getValueProps", "viewRender"];
|
22
22
|
var componentsWithFloatWindow = ['Select', 'ProSelect', 'ProEnum', 'ProTimeLimit', 'ProModalSelect', 'ProCascader', 'DataPicker', 'RangePicker', 'TimePicker'];
|
23
23
|
var ChangedWrapper = function ChangedWrapper(props) {
|
24
24
|
var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
|
@@ -26,7 +26,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
26
26
|
names = props.names,
|
27
27
|
namesStr = props.namesStr,
|
28
28
|
form = props.form,
|
29
|
-
|
29
|
+
onDiff = props.onDiff,
|
30
30
|
children = props.children,
|
31
31
|
type = props.type,
|
32
32
|
diffConfig = props.diffConfig,
|
@@ -48,7 +48,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
48
48
|
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
49
49
|
return (0, _lodash.get)(originalValues, name);
|
50
50
|
}) : (0, _lodash.get)(originalValues, name);
|
51
|
-
var noChange = !
|
51
|
+
var noChange = !onDiff && (!originalValues || isDiffAll ? false : (0, _utils.isEmpty)(originalValue));
|
52
52
|
var diffType = (0, _react.useMemo)(function () {
|
53
53
|
if (!isWatch || noChange) return 'same';
|
54
54
|
var _value = normalize ? normalize(props[valuePropName], undefined, undefined, true) // true 代表是值比对时的调用
|
@@ -63,10 +63,10 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
63
63
|
value: _value,
|
64
64
|
originalValue: _originalValue,
|
65
65
|
form: form,
|
66
|
-
|
66
|
+
onDiff: onDiff
|
67
67
|
// name: namesStr || name,
|
68
68
|
});
|
69
|
-
}, [isWatch, noChange, props[valuePropName], originalValue, (0, _typeof2.default)(
|
69
|
+
}, [isWatch, noChange, props[valuePropName], originalValue, (0, _typeof2.default)(onDiff)]);
|
70
70
|
var isAdd = diffType === 'add';
|
71
71
|
var isChanged = diffType === 'changed';
|
72
72
|
var tipContent = (0, _react.useMemo)(function () {
|
@@ -91,7 +91,6 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
91
91
|
}, children.props), rest));
|
92
92
|
}
|
93
93
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
94
|
-
// const isFocus = useFocus(contentRef.current);
|
95
94
|
var tipOpenCalc = function tipOpenCalc() {
|
96
95
|
if (!toolTip) return false;
|
97
96
|
// 传入undefined 鼠标移入显示移出隐藏 获得焦点时不显示气泡
|
@@ -28,7 +28,7 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
28
28
|
var _ProForm$useFieldProp = _index.default.useFieldProps(),
|
29
29
|
form = _ProForm$useFieldProp.form;
|
30
30
|
var handleChange = /*#__PURE__*/function () {
|
31
|
-
var _ref = (0, _asyncToGenerator2.default)(
|
31
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(value) {
|
32
32
|
var _len,
|
33
33
|
other,
|
34
34
|
_key,
|
@@ -46,7 +46,7 @@ var Render = function Render(props) {
|
|
46
46
|
formDisabled = props.formDisabled,
|
47
47
|
type = props.type,
|
48
48
|
isSelect = props.isSelect,
|
49
|
-
|
49
|
+
onDiff = props.onDiff,
|
50
50
|
requiredOnView = props.requiredOnView,
|
51
51
|
confirm = props.confirm,
|
52
52
|
globalControl = props.globalControl,
|
@@ -249,7 +249,7 @@ var Render = function Render(props) {
|
|
249
249
|
_args = functionArgs([].concat(args));
|
250
250
|
}
|
251
251
|
var inList = _otherFormItemProps === null || _otherFormItemProps === void 0 ? void 0 : (_otherFormItemProps$n3 = _otherFormItemProps.namePath) === null || _otherFormItemProps$n3 === void 0 ? void 0 : _otherFormItemProps$n3.length;
|
252
|
-
if (
|
252
|
+
if (/*#__PURE__*/_react.default.isValidElement(AutoComponent)) {
|
253
253
|
var _AutoComponent$props$, _AutoComponent$props, _lastComponentProps$c;
|
254
254
|
((_AutoComponent$props$ = (_AutoComponent$props = AutoComponent === null || AutoComponent === void 0 ? void 0 : AutoComponent.props)[changeKey]) === null || _AutoComponent$props$ === void 0 ? void 0 : _AutoComponent$props$.call.apply(_AutoComponent$props$, [_AutoComponent$props].concat((0, _toConsumableArray2.default)(_args)))) || ((_lastComponentProps$c = lastComponentProps[changeKey]) === null || _lastComponentProps$c === void 0 ? void 0 : _lastComponentProps$c.call.apply(_lastComponentProps$c, [lastComponentProps].concat((0, _toConsumableArray2.default)(_args))));
|
255
255
|
return false;
|
@@ -299,7 +299,7 @@ var Render = function Render(props) {
|
|
299
299
|
* onBlur参数重置 (value, record, { form, index, namePath, option }) => void
|
300
300
|
*/
|
301
301
|
var handleBlur = /*#__PURE__*/function () {
|
302
|
-
var _ref7 = (0, _asyncToGenerator2.default)(
|
302
|
+
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
303
303
|
var _len3,
|
304
304
|
args,
|
305
305
|
_key3,
|
@@ -382,7 +382,7 @@ var Render = function Render(props) {
|
|
382
382
|
if (originComponent) {
|
383
383
|
delete childProps.otherProps;
|
384
384
|
}
|
385
|
-
var child = /*#__PURE__*/_react.default.isValidElement(AutoComponent) ? (
|
385
|
+
var child = /*#__PURE__*/_react.default.isValidElement(AutoComponent) ? (/*#__PURE__*/_react.default.cloneElement(AutoComponent, childProps)) : (0, _jsxRuntime.jsx)(AutoComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(lastComponentProps, [].concat(lastComponentPropsFilter, ['debounceWait']))), {}, {
|
386
386
|
otherProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
387
387
|
show: show,
|
388
388
|
disabled: lastDisabled,
|
@@ -447,7 +447,7 @@ var Render = function Render(props) {
|
|
447
447
|
namesStr: namesStr,
|
448
448
|
diffConfig: diffConfig,
|
449
449
|
form: form,
|
450
|
-
|
450
|
+
onDiff: onDiff,
|
451
451
|
type: type,
|
452
452
|
onChange: handleChange,
|
453
453
|
valuePropName: _otherFormItemProps.valuePropName,
|
@@ -17,7 +17,7 @@ var componentMap = _interopRequireWildcard(require("../index"));
|
|
17
17
|
var _utils = require("../../utils");
|
18
18
|
var _useFieldProps = require("../../utils/useFieldProps");
|
19
19
|
var _locale = _interopRequireDefault(require("../../../locale"));
|
20
|
-
var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "
|
20
|
+
var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "onDiff", "clearNotShow", "required", "confirm", "desensitization"];
|
21
21
|
var RenderFields = function RenderFields(props) {
|
22
22
|
var isView = props.isView,
|
23
23
|
_props$columns = props.columns,
|
@@ -77,7 +77,6 @@ var RenderFields = function RenderFields(props) {
|
|
77
77
|
formItemChildProps = _column$formItemChild === void 0 ? {} : _column$formItemChild,
|
78
78
|
_column$fieldProps = column.fieldProps,
|
79
79
|
fieldProps = _column$fieldProps === void 0 ? {} : _column$fieldProps,
|
80
|
-
equalWith = column.equalWith,
|
81
80
|
onDiff = column.onDiff,
|
82
81
|
_column$clearNotShow = column.clearNotShow,
|
83
82
|
clearNotShow = _column$clearNotShow === void 0 ? outerClearNotShow : _column$clearNotShow,
|
@@ -220,7 +219,7 @@ var RenderFields = function RenderFields(props) {
|
|
220
219
|
fieldProps: (0, _lodash.isFunction)(fieldProps) ? fieldProps : null,
|
221
220
|
isSelect: _isSelect,
|
222
221
|
diffConfig: diffConfig,
|
223
|
-
|
222
|
+
onDiff: onDiff,
|
224
223
|
requiredOnView: requiredOnView,
|
225
224
|
globalControl: globalControl,
|
226
225
|
viewRender: viewRender,
|
@@ -206,8 +206,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
206
206
|
upperCase?: boolean;
|
207
207
|
hiddenNames?: string[] | any[];
|
208
208
|
rules?: ProRule[] | ReactiveFunction<Values, ProRule[]>;
|
209
|
-
|
210
|
-
onDiff?: DiffOriginalParams['equalWith'];
|
209
|
+
onDiff?: DiffOriginalParams['onDiff'];
|
211
210
|
required?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
|
212
211
|
labelRequired?: boolean;
|
213
212
|
toISOString?: boolean;
|
package/lib/ProForm/index.js
CHANGED
@@ -177,7 +177,7 @@ var ProForm = function ProForm(props, ref) {
|
|
177
177
|
if (isView || disabled) {
|
178
178
|
// 查看或禁用模式
|
179
179
|
footerEle = null;
|
180
|
-
} else if (
|
180
|
+
} else if (/*#__PURE__*/_react.default.isValidElement(footer)) {
|
181
181
|
// 传入组件渲染组件
|
182
182
|
footerEle = footer;
|
183
183
|
} else if (footer === undefined || footer || (0, _lodash.isObject)(footer)) {
|
@@ -1,8 +1,8 @@
|
|
1
|
-
export declare const useChanged: ({ name, names, namesStr, originalValues, form,
|
1
|
+
export declare const useChanged: ({ name, names, namesStr, originalValues, form, onDiff }: {
|
2
2
|
name: any;
|
3
3
|
names: any;
|
4
4
|
namesStr: any;
|
5
5
|
originalValues: any;
|
6
6
|
form: any;
|
7
|
-
|
7
|
+
onDiff: any;
|
8
8
|
}) => any[];
|
@@ -13,18 +13,18 @@ var useChanged = exports.useChanged = function useChanged(_ref) {
|
|
13
13
|
namesStr = _ref.namesStr,
|
14
14
|
originalValues = _ref.originalValues,
|
15
15
|
form = _ref.form,
|
16
|
-
|
16
|
+
onDiff = _ref.onDiff;
|
17
17
|
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
18
18
|
return (0, _lodash.get)(originalValues, name);
|
19
19
|
}) : (0, _lodash.get)(originalValues, name);
|
20
|
-
var notWatch = !
|
20
|
+
var notWatch = !onDiff && (!originalValues || originalValue === undefined);
|
21
21
|
if (notWatch) return [false];
|
22
22
|
var value = _antd.Form.useWatch(namesStr || name, form);
|
23
23
|
var changed = (0, _diffOriginal.diffOriginal)({
|
24
24
|
originalValue: originalValue,
|
25
25
|
value: value,
|
26
26
|
form: form,
|
27
|
-
|
27
|
+
onDiff: onDiff
|
28
28
|
});
|
29
29
|
return [changed, originalValue];
|
30
30
|
};
|
@@ -10,7 +10,7 @@ interface Params {
|
|
10
10
|
originalValues: any;
|
11
11
|
form: FormInstance;
|
12
12
|
rowKeyPath?: InternalNamePath;
|
13
|
-
|
13
|
+
onDiff?: (originalValue: any, currentValue: any) => boolean;
|
14
14
|
}
|
15
15
|
export declare const useListChanged: (params: Params) => any[];
|
16
16
|
export {};
|
@@ -69,7 +69,7 @@ var useListChanged = exports.useListChanged = function useListChanged(params) {
|
|
69
69
|
originalNames = _params$originalNames === void 0 ? names : _params$originalNames,
|
70
70
|
originalValues = params.originalValues,
|
71
71
|
form = params.form,
|
72
|
-
|
72
|
+
onDiff = params.onDiff,
|
73
73
|
rowKeyPath = params.rowKeyPath;
|
74
74
|
var namePath = toNamePath(namesStr || name);
|
75
75
|
var originalNamePath = toNamePath(originalName);
|
@@ -83,7 +83,7 @@ var useListChanged = exports.useListChanged = function useListChanged(params) {
|
|
83
83
|
rowKeyPath: rowKeyPath,
|
84
84
|
form: form
|
85
85
|
}) : undefined;
|
86
|
-
var noChange = !
|
86
|
+
var noChange = !onDiff && (!originalValues || originalValue === undefined);
|
87
87
|
var _form = form;
|
88
88
|
if (notWatch || noChange) return [false];
|
89
89
|
var value = _antd.Form.useWatch(namePath, _form);
|
@@ -91,7 +91,7 @@ var useListChanged = exports.useListChanged = function useListChanged(params) {
|
|
91
91
|
value: value,
|
92
92
|
originalValue: originalValue,
|
93
93
|
form: form,
|
94
|
-
|
94
|
+
onDiff: onDiff
|
95
95
|
// name: isString(namesStr) ? namesStr : originalName || name,
|
96
96
|
});
|
97
97
|
return [changed, originalValue];
|
@@ -3,7 +3,7 @@ export interface DiffOriginalParams {
|
|
3
3
|
originalValue: any;
|
4
4
|
value: any;
|
5
5
|
form: FormInstance;
|
6
|
-
|
6
|
+
onDiff?: (originalValue: any, currentValue: any) => DiffType | boolean | undefined;
|
7
7
|
}
|
8
8
|
export type DiffType = 'same' | 'add' | 'changed';
|
9
9
|
export declare const diffOriginal: (params: DiffOriginalParams) => DiffType;
|
@@ -36,10 +36,10 @@ var filterObject = function filterObject(data) {
|
|
36
36
|
var diffOriginal = exports.diffOriginal = function diffOriginal(params) {
|
37
37
|
var originalValue = params.originalValue,
|
38
38
|
value = params.value,
|
39
|
-
|
39
|
+
onDiff = params.onDiff;
|
40
40
|
// 支持传入自定义比较事件
|
41
|
-
if ((0, _lodash.isFunction)(
|
42
|
-
var diffRes =
|
41
|
+
if ((0, _lodash.isFunction)(onDiff)) {
|
42
|
+
var diffRes = onDiff(originalValue, value);
|
43
43
|
// 如果返回undefined走内置比较逻辑
|
44
44
|
if (diffRes !== undefined) {
|
45
45
|
if (typeof diffRes === 'boolean') {
|
@@ -136,7 +136,7 @@ var splitNameStr = exports.splitNameStr = function splitNameStr(name) {
|
|
136
136
|
});
|
137
137
|
};
|
138
138
|
// 过滤掉字段名中包含 '-' 的字段
|
139
|
-
var
|
139
|
+
var _filterInternalFields = exports.filterInternalFields = function filterInternalFields(values, optimize) {
|
140
140
|
if (optimize) {
|
141
141
|
return values;
|
142
142
|
}
|
@@ -150,20 +150,20 @@ var filterInternalFields = exports.filterInternalFields = function filterInterna
|
|
150
150
|
}
|
151
151
|
if (Array.isArray(nextValues)) {
|
152
152
|
return nextValues.map(function (item) {
|
153
|
-
return
|
153
|
+
return _filterInternalFields(item);
|
154
154
|
});
|
155
155
|
}
|
156
156
|
if ((0, _lodash.isObject)(nextValues)) {
|
157
157
|
var result = {};
|
158
158
|
Object.keys(nextValues).forEach(function (key) {
|
159
159
|
if (key.includes('-')) return;
|
160
|
-
result[key] =
|
160
|
+
result[key] = _filterInternalFields(nextValues[key]);
|
161
161
|
});
|
162
162
|
return result;
|
163
163
|
}
|
164
164
|
return nextValues;
|
165
165
|
};
|
166
|
-
var
|
166
|
+
var _getAllNamePath = exports.getAllNamePath = function getAllNamePath(object) {
|
167
167
|
var currentPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
168
168
|
var keys = Object.keys(object);
|
169
169
|
var resultKeys = [];
|
@@ -177,7 +177,7 @@ var getAllNamePath = exports.getAllNamePath = function getAllNamePath(object) {
|
|
177
177
|
}
|
178
178
|
// 深度获取对象key
|
179
179
|
if ((0, _lodash.isObject)(value)) {
|
180
|
-
resultKeys.concat(
|
180
|
+
resultKeys.concat(_getAllNamePath(value, [].concat((0, _toConsumableArray2.default)(currentPath), [key])));
|
181
181
|
}
|
182
182
|
resultKeys.push([].concat((0, _toConsumableArray2.default)(currentPath), [key]));
|
183
183
|
});
|
@@ -320,7 +320,7 @@ var customEqualForFun = exports.customEqualForFun = function customEqualForFun(v
|
|
320
320
|
/**
|
321
321
|
* 查询数据中是否包含rowKey
|
322
322
|
*/
|
323
|
-
var
|
323
|
+
var _hasRowKey = exports.hasRowKey = function hasRowKey(obj) {
|
324
324
|
if ((0, _typeof2.default)(obj) !== 'object' || obj === null) {
|
325
325
|
return false;
|
326
326
|
}
|
@@ -330,7 +330,7 @@ var hasRowKey = exports.hasRowKey = function hasRowKey(obj) {
|
|
330
330
|
return true;
|
331
331
|
}
|
332
332
|
return keys.some(function (key) {
|
333
|
-
return
|
333
|
+
return _hasRowKey(obj[key]);
|
334
334
|
});
|
335
335
|
};
|
336
336
|
/**
|
@@ -346,7 +346,7 @@ var view = exports.view = function view(obj) {
|
|
346
346
|
return true;
|
347
347
|
}
|
348
348
|
return keys.some(function (key) {
|
349
|
-
return
|
349
|
+
return _hasRowKey(obj[key]);
|
350
350
|
});
|
351
351
|
};
|
352
352
|
/**
|
@@ -382,7 +382,7 @@ var deleteForPath = exports.deleteForPath = function deleteForPath(values, nameP
|
|
382
382
|
* @param value 选中值
|
383
383
|
* @returns {}
|
384
384
|
*/
|
385
|
-
var
|
385
|
+
var _findOptionByValue = exports.findOptionByValue = function findOptionByValue(treeData, value, fieldNames) {
|
386
386
|
if ((0, _lodash.isObject)(value)) {
|
387
387
|
return value;
|
388
388
|
}
|
@@ -392,7 +392,7 @@ var findOptionByValue = exports.findOptionByValue = function findOptionByValue(t
|
|
392
392
|
return (0, _lodash.omit)(node, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
393
393
|
}
|
394
394
|
if (node.children) {
|
395
|
-
var foundNode =
|
395
|
+
var foundNode = _findOptionByValue(node[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], value, fieldNames);
|
396
396
|
if (foundNode) {
|
397
397
|
return (0, _lodash.omit)(foundNode, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
398
398
|
}
|
@@ -22,21 +22,21 @@ var transformValue = exports.transformValue = function transformValue(names, for
|
|
22
22
|
}
|
23
23
|
names.forEach(function (name, index) {
|
24
24
|
var _value2;
|
25
|
-
// @ts-ignore
|
26
25
|
(0, _lodash.set)(form.getFieldsValue(true), name, (_value2 = _value) === null || _value2 === void 0 ? void 0 : _value2[index]);
|
27
26
|
});
|
28
27
|
return _value;
|
29
28
|
},
|
30
|
-
getValueProps: function getValueProps(value,
|
29
|
+
getValueProps: function getValueProps(value, isOrigin) {
|
31
30
|
var _curValue;
|
32
31
|
var _value = [];
|
33
|
-
if (
|
32
|
+
if (isOrigin) {
|
33
|
+
_value = value;
|
34
|
+
} else {
|
35
|
+
// 非比对names场景
|
34
36
|
names.forEach(function (name, index) {
|
35
37
|
var value = form.getFieldValue(name);
|
36
38
|
_value[index] = value;
|
37
39
|
});
|
38
|
-
} else {
|
39
|
-
_value = value;
|
40
40
|
}
|
41
41
|
// 支持外部传入转换函数
|
42
42
|
var res = (_getValueProps === null || _getValueProps === void 0 ? void 0 : _getValueProps(_value)) || {
|
@@ -50,8 +50,10 @@ var transformValue = exports.transformValue = function transformValue(names, for
|
|
50
50
|
})) {
|
51
51
|
curValue = undefined;
|
52
52
|
}
|
53
|
-
//
|
54
|
-
|
53
|
+
// 如果来源是比对且有names场景, 则不更新表单值
|
54
|
+
if (!isOrigin) {
|
55
|
+
(0, _lodash.set)(form.getFieldsValue(true), fieldName, curValue);
|
56
|
+
}
|
55
57
|
// 如果表单里的值和组合得到的值不全等 更新表单里的值、
|
56
58
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, res), {}, {
|
57
59
|
value: curValue
|
@@ -53,7 +53,7 @@ var useForm = exports.useForm = function useForm(originForm, options) {
|
|
53
53
|
return getFieldsValue(nameList, filterFunc);
|
54
54
|
};
|
55
55
|
var _validateFields = /*#__PURE__*/function () {
|
56
|
-
var _ref2 = (0, _asyncToGenerator2.default)(
|
56
|
+
var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(nameList) {
|
57
57
|
var _rest$,
|
58
58
|
_len,
|
59
59
|
rest,
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
exports.recurseGetNodes = exports.onBeforeInjection = void 0;
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
9
9
|
var _config = require("../config");
|
10
|
-
var
|
10
|
+
var _recurseGetNodes = exports.recurseGetNodes = function recurseGetNodes(type, node, queue) {
|
11
11
|
switch (type) {
|
12
12
|
// 渐变
|
13
13
|
case 'gradation':
|
@@ -26,7 +26,7 @@ var recurseGetNodes = exports.recurseGetNodes = function recurseGetNodes(type, n
|
|
26
26
|
}
|
27
27
|
if (node.childNodes) {
|
28
28
|
for (var i = 0; i < node.childNodes.length; i++) {
|
29
|
-
|
29
|
+
_recurseGetNodes(type, node.childNodes[i], queue);
|
30
30
|
}
|
31
31
|
}
|
32
32
|
};
|
@@ -56,7 +56,7 @@ var onBeforeInjection = exports.onBeforeInjection = function onBeforeInjection(_
|
|
56
56
|
// 目前只支持处理渐变及fill填充
|
57
57
|
var types = Reflect.ownKeys(nodeMap !== null && nodeMap !== void 0 ? nodeMap : {});
|
58
58
|
types.forEach(function (typeKey) {
|
59
|
-
|
59
|
+
_recurseGetNodes(typeKey, svg, nodeMap[typeKey]);
|
60
60
|
});
|
61
61
|
if ((gradList === null || gradList === void 0 ? void 0 : gradList.length) > 0) {
|
62
62
|
nodeMap.gradation.forEach(function (item, index) {
|
@@ -56,7 +56,7 @@ var OpenMenu = function OpenMenu(props) {
|
|
56
56
|
if (!Array.isArray(result) || !result.length) {
|
57
57
|
return [];
|
58
58
|
}
|
59
|
-
var
|
59
|
+
var _menuDeep = function menuDeep(data) {
|
60
60
|
data.forEach(function (item) {
|
61
61
|
var _item$keyIdPath, _item$keyIdPath2, _item$children;
|
62
62
|
// 是否是第一级菜单,展开模式一级菜单有icon, 收起模式二级菜单有icon
|
@@ -97,7 +97,7 @@ var OpenMenu = function OpenMenu(props) {
|
|
97
97
|
if ((_item === null || _item === void 0 ? void 0 : _item.hideInMenu) || ['TAB', 'QUERY', 'BUTTON'].includes(_item === null || _item === void 0 ? void 0 : _item.type)) {
|
98
98
|
delete item.children;
|
99
99
|
} else {
|
100
|
-
|
100
|
+
_menuDeep(item.children);
|
101
101
|
}
|
102
102
|
} else {
|
103
103
|
delete item.children;
|
@@ -105,7 +105,7 @@ var OpenMenu = function OpenMenu(props) {
|
|
105
105
|
});
|
106
106
|
return data;
|
107
107
|
};
|
108
|
-
|
108
|
+
_menuDeep(result);
|
109
109
|
return result;
|
110
110
|
}, [dataSource]);
|
111
111
|
(0, _ahooks.useDeepCompareEffect)(function () {
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ProFooterProps } from './PropTypes';
|
3
|
-
declare const _default: import("react").MemoExoticComponent<(props: ProFooterProps) => JSX.Element>;
|
3
|
+
declare const _default: import("react").MemoExoticComponent<(props: ProFooterProps) => import("react/jsx-runtime").JSX.Element>;
|
4
4
|
export default _default;
|