@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
@@ -58,7 +58,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
58
58
|
return _toolbarProps;
|
59
59
|
}, [props.toolbarProps]);
|
60
60
|
var handleClick = /*#__PURE__*/function () {
|
61
|
-
var _ref2 = _asyncToGenerator(
|
61
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(defaultCallback, callback, item) {
|
62
62
|
var value, data;
|
63
63
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
64
64
|
while (1) switch (_context.prev = _context.next) {
|
@@ -23,7 +23,7 @@ export var namesPathTransform = function namesPathTransform(_ref) {
|
|
23
23
|
// 比较memo
|
24
24
|
export var memoWith = function memoWith(pre, next) {
|
25
25
|
return isEqualWith(pre, next, function (objValue, othValue) {
|
26
|
-
if (
|
26
|
+
if (/*#__PURE__*/React.isValidElement(objValue) && /*#__PURE__*/React.isValidElement(othValue)) {
|
27
27
|
return true;
|
28
28
|
}
|
29
29
|
// 移除解决formlist函数里不更新问题
|
@@ -68,7 +68,7 @@ var ComRender = function ComRender(props) {
|
|
68
68
|
children: viewRender(componentProps)
|
69
69
|
});
|
70
70
|
}
|
71
|
-
var Component = component ? (
|
71
|
+
var Component = component ? (/*#__PURE__*/React.cloneElement(component, _objectSpread({}, componentProps))) : _jsx(TypeComponent, _objectSpread({}, componentProps));
|
72
72
|
var Com = getComRender(Component, props, componentProps);
|
73
73
|
return _jsx(FieldProvider, {
|
74
74
|
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ProCascaderProps } from './propsType';
|
3
|
-
declare const _default: import("react").MemoExoticComponent<(props: ProCascaderProps) => JSX.Element>;
|
3
|
+
declare const _default: import("react").MemoExoticComponent<(props: ProCascaderProps) => import("react/jsx-runtime").JSX.Element>;
|
4
4
|
export default _default;
|
@@ -28,9 +28,9 @@ var defaultFieldNames = {
|
|
28
28
|
value: 'code',
|
29
29
|
children: 'children'
|
30
30
|
};
|
31
|
-
var
|
31
|
+
var _filterDataSource = function filterDataSource(dataSource, level, fieldNames) {
|
32
32
|
return dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
33
|
-
return _objectSpread(_objectSpread({}, item), {}, _defineProperty({}, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children', level === 1 ? [] :
|
33
|
+
return _objectSpread(_objectSpread({}, item), {}, _defineProperty({}, (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)));
|
34
34
|
});
|
35
35
|
};
|
36
36
|
var getViewLabel = function getViewLabel(_ref) {
|
@@ -109,7 +109,7 @@ var ProCascader = function ProCascader(props) {
|
|
109
109
|
}, [dics === null || dics === void 0 ? void 0 : dics[addressCode], enumData]);
|
110
110
|
var realDataSource = useMemo(function () {
|
111
111
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
112
|
-
var result = transformDataName(isAddressMode && realLevel === 2 ?
|
112
|
+
var result = transformDataName(isAddressMode && realLevel === 2 ? _filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
113
113
|
return result;
|
114
114
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
115
115
|
var lastDisabled = useMemo(function () {
|
@@ -131,7 +131,7 @@ var ProCascader = function ProCascader(props) {
|
|
131
131
|
defaultLabel = _useState4[0],
|
132
132
|
setDefaultLabel = _useState4[1];
|
133
133
|
var getFirstLevelOptions = /*#__PURE__*/function () {
|
134
|
-
var _ref4 = _asyncToGenerator(
|
134
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
135
135
|
var _yield$service, data, newData, transFormData, serviceData;
|
136
136
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
137
137
|
while (1) switch (_context.prev = _context.next) {
|
@@ -150,7 +150,7 @@ var ProCascader = function ProCascader(props) {
|
|
150
150
|
value: fieldNames.value,
|
151
151
|
children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
|
152
152
|
});
|
153
|
-
serviceData = isAddressMode && realLevel === 2 ?
|
153
|
+
serviceData = isAddressMode && realLevel === 2 ? _filterDataSource(transFormData, level, fieldNames) : transFormData;
|
154
154
|
setServiceData(serviceData);
|
155
155
|
case 9:
|
156
156
|
case "end":
|
@@ -220,7 +220,7 @@ var ProCascader = function ProCascader(props) {
|
|
220
220
|
})) === null || _ref5$filter === void 0 ? void 0 : _ref5$filter.join(separator)) || '-' : (defaultLabel === null || defaultLabel === void 0 ? void 0 : (_defaultLabel$filter = defaultLabel.filter(function (item) {
|
221
221
|
return !!item;
|
222
222
|
})) === null || _defaultLabel$filter === void 0 ? void 0 : _defaultLabel$filter.join(separator)) || '-';
|
223
|
-
var
|
223
|
+
var _findSelectedOptions = function findSelectedOptions(options, value) {
|
224
224
|
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
225
225
|
var _value = value !== null && value !== void 0 ? value : [];
|
226
226
|
// 基准情况:如果 value 数组为空,且 path 不为空,说明找到了完整的路径
|
@@ -239,7 +239,7 @@ var ProCascader = function ProCascader(props) {
|
|
239
239
|
if (foundOption) {
|
240
240
|
// 如果找到了匹配的选项,并且还有更多的 value 需要匹配,递归地在子选项中查找
|
241
241
|
if (_value.length > 1 && foundOption.children) {
|
242
|
-
return
|
242
|
+
return _findSelectedOptions(foundOption.children, _value.slice(1), [].concat(_toConsumableArray(path), [foundOption]));
|
243
243
|
}
|
244
244
|
// 如果没有更多的 value 需要匹配,返回当前选项(以及之前的路径)
|
245
245
|
return [].concat(_toConsumableArray(path), [foundOption]);
|
@@ -248,7 +248,7 @@ var ProCascader = function ProCascader(props) {
|
|
248
248
|
return null;
|
249
249
|
};
|
250
250
|
var _selectedOptions = useMemo(function () {
|
251
|
-
return
|
251
|
+
return _findSelectedOptions(service ? serviceData : realDataSource, addressValue);
|
252
252
|
}, [service, serviceData, realDataSource, addressValue]);
|
253
253
|
var handleAddressChange = function handleAddressChange(e) {
|
254
254
|
var cascaderValue = value === null || value === void 0 ? void 0 : value.slice(0, realLevel);
|
@@ -24,7 +24,7 @@ var useDefaultOptions = function useDefaultOptions(options) {
|
|
24
24
|
});
|
25
25
|
};
|
26
26
|
var defaultService = /*#__PURE__*/function () {
|
27
|
-
var _ref = _asyncToGenerator(
|
27
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
28
28
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
29
29
|
while (1) switch (_context.prev = _context.next) {
|
30
30
|
case 0:
|
@@ -260,7 +260,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
260
260
|
onChange(val, option);
|
261
261
|
};
|
262
262
|
var handleClick = /*#__PURE__*/function () {
|
263
|
-
var _ref7 = _asyncToGenerator(
|
263
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
264
264
|
var _yield$beforeOpen, res;
|
265
265
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
266
266
|
while (1) switch (_context.prev = _context.next) {
|
@@ -327,7 +327,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
327
327
|
}
|
328
328
|
};
|
329
329
|
var handleFinish = /*#__PURE__*/function () {
|
330
|
-
var _ref8 = _asyncToGenerator(
|
330
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
331
331
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
332
332
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
333
333
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -392,7 +392,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
392
392
|
};
|
393
393
|
}();
|
394
394
|
var handleSearch = /*#__PURE__*/function () {
|
395
|
-
var _ref9 = _asyncToGenerator(
|
395
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
396
396
|
var values;
|
397
397
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
398
398
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -465,7 +465,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
465
465
|
};
|
466
466
|
// 初始化回显,当传入initParams时,前端用来回险
|
467
467
|
var getInitValues = /*#__PURE__*/function () {
|
468
|
-
var _ref10 = _asyncToGenerator(
|
468
|
+
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
469
469
|
var _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
470
470
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
471
471
|
while (1) switch (_context4.prev = _context4.next) {
|
@@ -525,7 +525,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
525
525
|
}();
|
526
526
|
// 初始化回显,当传入initParams时,前端用来回险
|
527
527
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
528
|
-
var _ref11 = _asyncToGenerator(
|
528
|
+
var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
529
529
|
var _useRequest$options4, _useRequest$options5;
|
530
530
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
531
531
|
return _regeneratorRuntime().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;
|
@@ -92,7 +92,7 @@ export function ProAddress(_ref3) {
|
|
92
92
|
secondCitys = _useState6[0],
|
93
93
|
setSecondCitys = _useState6[1];
|
94
94
|
var queryCity = /*#__PURE__*/function () {
|
95
|
-
var _ref5 = _asyncToGenerator(
|
95
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(code, type) {
|
96
96
|
var cityList, _cityList, newList, _secondCitys;
|
97
97
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
98
98
|
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;
|
@@ -6,7 +6,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
7
7
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
8
8
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
9
|
-
var _excluded = ["name", "names", "namesStr", "form", "
|
9
|
+
var _excluded = ["name", "names", "namesStr", "form", "onDiff", "children", "type", "diffConfig", "valuePropName", "normalize", "getValueProps", "viewRender"];
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
11
11
|
import classNames from 'classnames';
|
12
12
|
import { get } from 'lodash';
|
@@ -21,7 +21,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
21
21
|
names = props.names,
|
22
22
|
namesStr = props.namesStr,
|
23
23
|
form = props.form,
|
24
|
-
|
24
|
+
onDiff = props.onDiff,
|
25
25
|
children = props.children,
|
26
26
|
type = props.type,
|
27
27
|
diffConfig = props.diffConfig,
|
@@ -43,7 +43,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
43
43
|
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
44
44
|
return get(originalValues, name);
|
45
45
|
}) : get(originalValues, name);
|
46
|
-
var noChange = !
|
46
|
+
var noChange = !onDiff && (!originalValues || isDiffAll ? false : isEmpty(originalValue));
|
47
47
|
var diffType = useMemo(function () {
|
48
48
|
if (!isWatch || noChange) return 'same';
|
49
49
|
var _value = normalize ? normalize(props[valuePropName], undefined, undefined, true) // true 代表是值比对时的调用
|
@@ -58,10 +58,10 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
58
58
|
value: _value,
|
59
59
|
originalValue: _originalValue,
|
60
60
|
form: form,
|
61
|
-
|
61
|
+
onDiff: onDiff
|
62
62
|
// name: namesStr || name,
|
63
63
|
});
|
64
|
-
}, [isWatch, noChange, props[valuePropName], originalValue, _typeof(
|
64
|
+
}, [isWatch, noChange, props[valuePropName], originalValue, _typeof(onDiff)]);
|
65
65
|
var isAdd = diffType === 'add';
|
66
66
|
var isChanged = diffType === 'changed';
|
67
67
|
var tipContent = useMemo(function () {
|
@@ -86,7 +86,6 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
86
86
|
}, children.props), rest));
|
87
87
|
}
|
88
88
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
89
|
-
// const isFocus = useFocus(contentRef.current);
|
90
89
|
var tipOpenCalc = function tipOpenCalc() {
|
91
90
|
if (!toolTip) return false;
|
92
91
|
// 传入undefined 鼠标移入显示移出隐藏 获得焦点时不显示气泡
|
@@ -22,7 +22,7 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
22
22
|
var _ProForm$useFieldProp = ProForm.useFieldProps(),
|
23
23
|
form = _ProForm$useFieldProp.form;
|
24
24
|
var handleChange = /*#__PURE__*/function () {
|
25
|
-
var _ref = _asyncToGenerator(
|
25
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
|
26
26
|
var _len,
|
27
27
|
other,
|
28
28
|
_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.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(_toConsumableArray(_args)))) || ((_lastComponentProps$c = lastComponentProps[changeKey]) === null || _lastComponentProps$c === void 0 ? void 0 : _lastComponentProps$c.call.apply(_lastComponentProps$c, [lastComponentProps].concat(_toConsumableArray(_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 = _asyncToGenerator(
|
302
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().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.isValidElement(AutoComponent) ? (
|
385
|
+
var child = /*#__PURE__*/React.isValidElement(AutoComponent) ? (/*#__PURE__*/React.cloneElement(AutoComponent, childProps)) : _jsx(AutoComponent, _objectSpread(_objectSpread({}, omit(lastComponentProps, [].concat(lastComponentPropsFilter, ['debounceWait']))), {}, {
|
386
386
|
otherProps: _objectSpread(_objectSpread({}, 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,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
-
var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "
|
3
|
+
var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "onDiff", "clearNotShow", "required", "confirm", "desensitization"];
|
4
4
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
5
5
|
import React from 'react';
|
6
6
|
import { isBoolean, isFunction, union, isString } from 'lodash';
|
@@ -69,7 +69,6 @@ var RenderFields = function RenderFields(props) {
|
|
69
69
|
formItemChildProps = _column$formItemChild === void 0 ? {} : _column$formItemChild,
|
70
70
|
_column$fieldProps = column.fieldProps,
|
71
71
|
fieldProps = _column$fieldProps === void 0 ? {} : _column$fieldProps,
|
72
|
-
equalWith = column.equalWith,
|
73
72
|
onDiff = column.onDiff,
|
74
73
|
_column$clearNotShow = column.clearNotShow,
|
75
74
|
clearNotShow = _column$clearNotShow === void 0 ? outerClearNotShow : _column$clearNotShow,
|
@@ -212,7 +211,7 @@ var RenderFields = function RenderFields(props) {
|
|
212
211
|
fieldProps: isFunction(fieldProps) ? fieldProps : null,
|
213
212
|
isSelect: _isSelect,
|
214
213
|
diffConfig: diffConfig,
|
215
|
-
|
214
|
+
onDiff: onDiff,
|
216
215
|
requiredOnView: requiredOnView,
|
217
216
|
globalControl: globalControl,
|
218
217
|
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/es/ProForm/index.js
CHANGED
@@ -176,7 +176,7 @@ var ProForm = function ProForm(props, ref) {
|
|
176
176
|
if (isView || disabled) {
|
177
177
|
// 查看或禁用模式
|
178
178
|
footerEle = null;
|
179
|
-
} else if (
|
179
|
+
} else if (/*#__PURE__*/React.isValidElement(footer)) {
|
180
180
|
// 传入组件渲染组件
|
181
181
|
footerEle = footer;
|
182
182
|
} else if (footer === undefined || footer || 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[];
|
@@ -8,18 +8,18 @@ export var useChanged = function useChanged(_ref) {
|
|
8
8
|
namesStr = _ref.namesStr,
|
9
9
|
originalValues = _ref.originalValues,
|
10
10
|
form = _ref.form,
|
11
|
-
|
11
|
+
onDiff = _ref.onDiff;
|
12
12
|
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
13
13
|
return get(originalValues, name);
|
14
14
|
}) : get(originalValues, name);
|
15
|
-
var notWatch = !
|
15
|
+
var notWatch = !onDiff && (!originalValues || originalValue === undefined);
|
16
16
|
if (notWatch) return [false];
|
17
17
|
var value = _Form.useWatch(namesStr || name, form);
|
18
18
|
var changed = diffOriginal({
|
19
19
|
originalValue: originalValue,
|
20
20
|
value: value,
|
21
21
|
form: form,
|
22
|
-
|
22
|
+
onDiff: onDiff
|
23
23
|
});
|
24
24
|
return [changed, originalValue];
|
25
25
|
};
|
@@ -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 {};
|
@@ -64,7 +64,7 @@ export var useListChanged = function useListChanged(params) {
|
|
64
64
|
originalNames = _params$originalNames === void 0 ? names : _params$originalNames,
|
65
65
|
originalValues = params.originalValues,
|
66
66
|
form = params.form,
|
67
|
-
|
67
|
+
onDiff = params.onDiff,
|
68
68
|
rowKeyPath = params.rowKeyPath;
|
69
69
|
var namePath = toNamePath(namesStr || name);
|
70
70
|
var originalNamePath = toNamePath(originalName);
|
@@ -78,7 +78,7 @@ export var useListChanged = function useListChanged(params) {
|
|
78
78
|
rowKeyPath: rowKeyPath,
|
79
79
|
form: form
|
80
80
|
}) : undefined;
|
81
|
-
var noChange = !
|
81
|
+
var noChange = !onDiff && (!originalValues || originalValue === undefined);
|
82
82
|
var _form = form;
|
83
83
|
if (notWatch || noChange) return [false];
|
84
84
|
var value = _Form.useWatch(namePath, _form);
|
@@ -86,7 +86,7 @@ export var useListChanged = function useListChanged(params) {
|
|
86
86
|
value: value,
|
87
87
|
originalValue: originalValue,
|
88
88
|
form: form,
|
89
|
-
|
89
|
+
onDiff: onDiff
|
90
90
|
// name: isString(namesStr) ? namesStr : originalName || name,
|
91
91
|
});
|
92
92
|
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;
|
@@ -30,10 +30,10 @@ var filterObject = function filterObject(data) {
|
|
30
30
|
export var diffOriginal = function diffOriginal(params) {
|
31
31
|
var originalValue = params.originalValue,
|
32
32
|
value = params.value,
|
33
|
-
|
33
|
+
onDiff = params.onDiff;
|
34
34
|
// 支持传入自定义比较事件
|
35
|
-
if (isFunction(
|
36
|
-
var diffRes =
|
35
|
+
if (isFunction(onDiff)) {
|
36
|
+
var diffRes = onDiff(originalValue, value);
|
37
37
|
// 如果返回undefined走内置比较逻辑
|
38
38
|
if (diffRes !== undefined) {
|
39
39
|
if (typeof diffRes === 'boolean') {
|
@@ -120,7 +120,7 @@ export var splitNameStr = function splitNameStr(name) {
|
|
120
120
|
});
|
121
121
|
};
|
122
122
|
// 过滤掉字段名中包含 '-' 的字段
|
123
|
-
|
123
|
+
var _filterInternalFields = function filterInternalFields(values, optimize) {
|
124
124
|
if (optimize) {
|
125
125
|
return values;
|
126
126
|
}
|
@@ -134,20 +134,21 @@ export var filterInternalFields = function filterInternalFields(values, optimize
|
|
134
134
|
}
|
135
135
|
if (Array.isArray(nextValues)) {
|
136
136
|
return nextValues.map(function (item) {
|
137
|
-
return
|
137
|
+
return _filterInternalFields(item);
|
138
138
|
});
|
139
139
|
}
|
140
140
|
if (isObject(nextValues)) {
|
141
141
|
var result = {};
|
142
142
|
Object.keys(nextValues).forEach(function (key) {
|
143
143
|
if (key.includes('-')) return;
|
144
|
-
result[key] =
|
144
|
+
result[key] = _filterInternalFields(nextValues[key]);
|
145
145
|
});
|
146
146
|
return result;
|
147
147
|
}
|
148
148
|
return nextValues;
|
149
149
|
};
|
150
|
-
export
|
150
|
+
export { _filterInternalFields as filterInternalFields };
|
151
|
+
var _getAllNamePath = function getAllNamePath(object) {
|
151
152
|
var currentPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
152
153
|
var keys = Object.keys(object);
|
153
154
|
var resultKeys = [];
|
@@ -161,13 +162,14 @@ export var getAllNamePath = function getAllNamePath(object) {
|
|
161
162
|
}
|
162
163
|
// 深度获取对象key
|
163
164
|
if (isObject(value)) {
|
164
|
-
resultKeys.concat(
|
165
|
+
resultKeys.concat(_getAllNamePath(value, [].concat(_toConsumableArray(currentPath), [key])));
|
165
166
|
}
|
166
167
|
resultKeys.push([].concat(_toConsumableArray(currentPath), [key]));
|
167
168
|
});
|
168
169
|
return resultKeys;
|
169
170
|
};
|
170
171
|
// 判断一个字段值是否算空
|
172
|
+
export { _getAllNamePath as getAllNamePath };
|
171
173
|
var nullList = [undefined, 'null', '""', '[]'];
|
172
174
|
export var isNullValue = function isNullValue(value) {
|
173
175
|
return nullList.includes(JSON.stringify(value));
|
@@ -304,7 +306,7 @@ export var customEqualForFun = function customEqualForFun(value, other) {
|
|
304
306
|
/**
|
305
307
|
* 查询数据中是否包含rowKey
|
306
308
|
*/
|
307
|
-
|
309
|
+
var _hasRowKey = function hasRowKey(obj) {
|
308
310
|
if (_typeof(obj) !== 'object' || obj === null) {
|
309
311
|
return false;
|
310
312
|
}
|
@@ -314,12 +316,13 @@ export var hasRowKey = function hasRowKey(obj) {
|
|
314
316
|
return true;
|
315
317
|
}
|
316
318
|
return keys.some(function (key) {
|
317
|
-
return
|
319
|
+
return _hasRowKey(obj[key]);
|
318
320
|
});
|
319
321
|
};
|
320
322
|
/**
|
321
323
|
* 查询数据中是否包含rowKey
|
322
324
|
*/
|
325
|
+
export { _hasRowKey as hasRowKey };
|
323
326
|
export var view = function view(obj) {
|
324
327
|
if (_typeof(obj) !== 'object' || obj === null) {
|
325
328
|
return false;
|
@@ -330,7 +333,7 @@ export var view = function view(obj) {
|
|
330
333
|
return true;
|
331
334
|
}
|
332
335
|
return keys.some(function (key) {
|
333
|
-
return
|
336
|
+
return _hasRowKey(obj[key]);
|
334
337
|
});
|
335
338
|
};
|
336
339
|
/**
|
@@ -366,7 +369,7 @@ export var deleteForPath = function deleteForPath(values, namePath) {
|
|
366
369
|
* @param value 选中值
|
367
370
|
* @returns {}
|
368
371
|
*/
|
369
|
-
|
372
|
+
var _findOptionByValue = function findOptionByValue(treeData, value, fieldNames) {
|
370
373
|
if (isObject(value)) {
|
371
374
|
return value;
|
372
375
|
}
|
@@ -376,7 +379,7 @@ export var findOptionByValue = function findOptionByValue(treeData, value, field
|
|
376
379
|
return omit(node, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
377
380
|
}
|
378
381
|
if (node.children) {
|
379
|
-
var foundNode =
|
382
|
+
var foundNode = _findOptionByValue(node[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], value, fieldNames);
|
380
383
|
if (foundNode) {
|
381
384
|
return omit(foundNode, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
382
385
|
}
|
@@ -386,6 +389,7 @@ export var findOptionByValue = function findOptionByValue(treeData, value, field
|
|
386
389
|
/**
|
387
390
|
* 对比依赖列表中的 值是否变更
|
388
391
|
*/
|
392
|
+
export { _findOptionByValue as findOptionByValue };
|
389
393
|
export var equalDependencies = function equalDependencies(dependencies, prevValues, currentValues) {
|
390
394
|
if (dependencies === null || dependencies === void 0 ? void 0 : dependencies.length) {
|
391
395
|
return dependencies.some(function (namePath) {
|
@@ -15,21 +15,21 @@ export var transformValue = function transformValue(names, form, fieldName, _nor
|
|
15
15
|
}
|
16
16
|
names.forEach(function (name, index) {
|
17
17
|
var _value2;
|
18
|
-
// @ts-ignore
|
19
18
|
set(form.getFieldsValue(true), name, (_value2 = _value) === null || _value2 === void 0 ? void 0 : _value2[index]);
|
20
19
|
});
|
21
20
|
return _value;
|
22
21
|
},
|
23
|
-
getValueProps: function getValueProps(value,
|
22
|
+
getValueProps: function getValueProps(value, isOrigin) {
|
24
23
|
var _curValue;
|
25
24
|
var _value = [];
|
26
|
-
if (
|
25
|
+
if (isOrigin) {
|
26
|
+
_value = value;
|
27
|
+
} else {
|
28
|
+
// 非比对names场景
|
27
29
|
names.forEach(function (name, index) {
|
28
30
|
var value = form.getFieldValue(name);
|
29
31
|
_value[index] = value;
|
30
32
|
});
|
31
|
-
} else {
|
32
|
-
_value = value;
|
33
33
|
}
|
34
34
|
// 支持外部传入转换函数
|
35
35
|
var res = (_getValueProps === null || _getValueProps === void 0 ? void 0 : _getValueProps(_value)) || {
|
@@ -43,8 +43,10 @@ export var transformValue = function transformValue(names, form, fieldName, _nor
|
|
43
43
|
})) {
|
44
44
|
curValue = undefined;
|
45
45
|
}
|
46
|
-
//
|
47
|
-
|
46
|
+
// 如果来源是比对且有names场景, 则不更新表单值
|
47
|
+
if (!isOrigin) {
|
48
|
+
set(form.getFieldsValue(true), fieldName, curValue);
|
49
|
+
}
|
48
50
|
// 如果表单里的值和组合得到的值不全等 更新表单里的值、
|
49
51
|
return _objectSpread(_objectSpread({}, res), {}, {
|
50
52
|
value: curValue
|
@@ -47,7 +47,7 @@ export var useForm = function useForm(originForm, options) {
|
|
47
47
|
return getFieldsValue(nameList, filterFunc);
|
48
48
|
};
|
49
49
|
var _validateFields = /*#__PURE__*/function () {
|
50
|
-
var _ref2 = _asyncToGenerator(
|
50
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(nameList) {
|
51
51
|
var _rest$,
|
52
52
|
_len,
|
53
53
|
rest,
|