@zat-design/sisyphus-react 3.7.2 → 3.7.3-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +79 -0
- package/dist/less.esm.css +76 -0
- package/es/ProAction/index.js +4 -4
- package/es/ProDownload/index.d.ts +1 -1
- package/es/ProEditTable/components/ActionButton/index.d.ts +1 -1
- 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/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/es/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +22 -10
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +29 -24
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +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/getDefaultProps.js +2 -1
- package/es/ProEditTable/utils/tools.js +3 -3
- package/es/ProEnum/components/Group.d.ts +1 -1
- package/es/ProEnum/components/Tag.d.ts +1 -1
- package/es/ProEnum/index.d.ts +2 -2
- package/es/ProEnum/index.js +5 -4
- package/es/ProEnum/style/index.less +8 -4
- package/es/ProEnum/utils/eventCenter.js +2 -1
- package/es/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/es/ProEnum/utils/index.d.ts +1 -1
- package/es/ProEnum/utils/index.js +4 -0
- package/es/ProForm/components/base/Input/index.d.ts +1 -1
- package/es/ProForm/components/combination/Container/index.js +5 -3
- package/es/ProForm/components/combination/Container/propsType.d.ts +2 -1
- package/es/ProForm/components/combination/FormList/utils.js +5 -4
- package/es/ProForm/components/combination/Group/component/ComRender.js +3 -1
- package/es/ProForm/components/combination/Group/utils.js +22 -5
- package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +7 -7
- package/es/ProForm/components/combination/ProNumberRange/index.js +3 -1
- 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 +2 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/es/ProForm/components/render/ChangedWrapper.d.ts +16 -0
- package/es/ProForm/components/render/{Changed.js → ChangedWrapper.js} +43 -15
- package/es/ProForm/components/render/Render.js +7 -8
- package/es/ProForm/components/render/RenderFields.d.ts +2 -3
- package/es/ProForm/components/render/RenderFields.js +3 -4
- package/es/ProForm/components/render/propsType.d.ts +4 -3
- package/es/ProForm/index.js +3 -6
- package/es/ProForm/propsType.d.ts +12 -2
- package/es/ProForm/style/index.less +102 -4
- package/es/ProForm/utils/diffOriginal.d.ts +4 -4
- package/es/ProForm/utils/diffOriginal.js +18 -7
- package/es/ProForm/utils/index.js +10 -14
- package/es/ProForm/utils/rulesCreator.d.ts +1 -1
- package/es/ProForm/utils/rulesCreator.js +25 -22
- package/es/ProForm/utils/valueType.js +2 -2
- package/es/ProIcon/utils/index.js +3 -4
- 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/ProSelect/index.js +11 -8
- package/es/ProSelect/propsType.d.ts +4 -0
- package/es/ProSelect/utils/index.d.ts +1 -7
- package/es/ProSelect/utils/index.js +13 -5
- 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.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +5 -2
- package/es/ProStep/components/Step/index.d.ts +1 -1
- package/es/ProStep/index.d.ts +3 -3
- package/es/ProStep/index.js +24 -17
- 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/utils/index.js +8 -9
- 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/index.d.ts +1 -1
- 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/CloseIcon.d.ts +2 -1
- package/es/ProTree/components/List.d.ts +1 -1
- package/es/ProTree/components/ProTree.d.ts +1 -1
- package/es/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +18 -18
- package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/es/ProTree/components/SearchTitle.d.ts +1 -1
- package/es/ProTree/components/Tree.d.ts +1 -1
- package/es/ProTree/components/Tree.js +3 -3
- package/es/ProTree/index.d.ts +1 -1
- package/es/ProTree/utils.js +11 -12
- package/es/ProTreeModal/components/Cascader.d.ts +1 -1
- package/es/ProTreeModal/components/CloseIcon.d.ts +2 -1
- 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/utils.js +11 -12
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/es/ProUpload/index.js +1 -1
- package/es/ProUpload/propsType.d.ts +5 -0
- package/es/style/theme/antd.less +5 -0
- package/es/style/theme/index.less +1 -0
- package/es/style/theme/tokens.less +1 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +13 -0
- package/lib/ProAction/index.js +4 -4
- package/lib/ProDownload/index.d.ts +1 -1
- package/lib/ProEditTable/components/ActionButton/index.d.ts +1 -1
- 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/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/lib/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +25 -11
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +30 -25
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +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/getDefaultProps.js +3 -1
- package/lib/ProEditTable/utils/tools.js +3 -3
- package/lib/ProEnum/components/Group.d.ts +1 -1
- package/lib/ProEnum/components/Tag.d.ts +1 -1
- package/lib/ProEnum/index.d.ts +2 -2
- package/lib/ProEnum/index.js +5 -4
- package/lib/ProEnum/style/index.less +8 -4
- package/lib/ProEnum/utils/eventCenter.js +2 -1
- package/lib/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/lib/ProEnum/utils/index.d.ts +1 -1
- package/lib/ProEnum/utils/index.js +4 -0
- package/lib/ProForm/components/base/Input/index.d.ts +1 -1
- package/lib/ProForm/components/combination/Container/index.js +5 -3
- package/lib/ProForm/components/combination/Container/propsType.d.ts +2 -1
- package/lib/ProForm/components/combination/FormList/utils.js +4 -3
- package/lib/ProForm/components/combination/Group/component/ComRender.js +3 -1
- package/lib/ProForm/components/combination/Group/utils.js +22 -5
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +7 -7
- package/lib/ProForm/components/combination/ProNumberRange/index.js +3 -1
- 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 +2 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/lib/ProForm/components/render/ChangedWrapper.d.ts +16 -0
- package/lib/ProForm/components/render/{Changed.js → ChangedWrapper.js} +43 -15
- package/lib/ProForm/components/render/Render.js +7 -8
- package/lib/ProForm/components/render/RenderFields.d.ts +2 -3
- package/lib/ProForm/components/render/RenderFields.js +3 -4
- package/lib/ProForm/components/render/propsType.d.ts +4 -3
- package/lib/ProForm/index.js +3 -6
- package/lib/ProForm/propsType.d.ts +12 -2
- package/lib/ProForm/style/index.less +102 -4
- package/lib/ProForm/utils/diffOriginal.d.ts +4 -4
- package/lib/ProForm/utils/diffOriginal.js +18 -7
- package/lib/ProForm/utils/index.js +10 -10
- package/lib/ProForm/utils/rulesCreator.d.ts +1 -1
- package/lib/ProForm/utils/rulesCreator.js +25 -22
- package/lib/ProForm/utils/valueType.js +2 -2
- 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/ProSelect/index.js +11 -8
- package/lib/ProSelect/propsType.d.ts +4 -0
- package/lib/ProSelect/utils/index.d.ts +1 -7
- package/lib/ProSelect/utils/index.js +13 -5
- 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.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.js +5 -2
- package/lib/ProStep/components/Step/index.d.ts +1 -1
- package/lib/ProStep/index.d.ts +3 -3
- package/lib/ProStep/index.js +24 -17
- 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/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/index.d.ts +1 -1
- 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/CloseIcon.d.ts +2 -1
- package/lib/ProTree/components/List.d.ts +1 -1
- package/lib/ProTree/components/ProTree.d.ts +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +18 -18
- package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/lib/ProTree/components/SearchTitle.d.ts +1 -1
- package/lib/ProTree/components/Tree.d.ts +1 -1
- package/lib/ProTree/components/Tree.js +3 -3
- 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 +2 -1
- 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/utils.js +11 -11
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/lib/ProUpload/index.js +1 -1
- package/lib/ProUpload/propsType.d.ts +5 -0
- package/lib/style/theme/antd.less +5 -0
- package/lib/style/theme/index.less +1 -0
- package/lib/style/theme/tokens.less +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +19 -0
- package/package.json +2 -1
- package/es/ProForm/components/render/Changed.d.ts +0 -14
- package/lib/ProForm/components/render/Changed.d.ts +0 -14
- /package/es/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
- /package/es/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
- /package/es/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
- /package/es/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
- /package/lib/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
- /package/lib/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
- /package/lib/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
- /package/lib/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
package/es/ProSelect/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PropSelectProps, ProSelectAction } from './propsType';
|
|
3
3
|
import './index.less';
|
|
4
|
-
export declare const ProSelect: (props: PropSelectProps, ref: React.Ref<ProSelectAction> | undefined) =>
|
|
4
|
+
export declare const ProSelect: (props: PropSelectProps, ref: React.Ref<ProSelectAction> | undefined) => JSX.Element;
|
|
5
5
|
declare const _default: React.ForwardRefExoticComponent<PropSelectProps & React.RefAttributes<ProSelectAction>>;
|
|
6
6
|
export default _default;
|
package/es/ProSelect/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
10
10
|
import "antd/es/select/style";
|
|
11
11
|
import _Select from "antd/es/select";
|
|
12
|
-
var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "filterInList", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "isView"];
|
|
12
|
+
var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "filterInList", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "getValueProps", "isView"];
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
|
|
15
15
|
import React, { useImperativeHandle, useState, forwardRef } from 'react';
|
|
@@ -53,10 +53,11 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
|
53
53
|
onChange = props.onChange,
|
|
54
54
|
updateDataSource = props.updateDataSource,
|
|
55
55
|
transformResponse = props.transformResponse,
|
|
56
|
+
getValueProps = props.getValueProps,
|
|
56
57
|
isViewPro = props.isView,
|
|
57
58
|
selectProps = _objectWithoutProperties(props, _excluded);
|
|
58
59
|
selectProps.showCodeName = (_selectProps$showCode = selectProps.showCodeName) !== null && _selectProps$showCode !== void 0 ? _selectProps$showCode : showCodeName;
|
|
59
|
-
var value = props.value;
|
|
60
|
+
var value = getValueProps && props.value ? getValueProps(props.value) : props.value;
|
|
60
61
|
var _ref2 = ProForm.useFieldProps() || {},
|
|
61
62
|
isViewCon = _ref2.isView,
|
|
62
63
|
viewEmpty = _ref2.viewEmpty;
|
|
@@ -216,6 +217,7 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
|
216
217
|
return props.children;
|
|
217
218
|
};
|
|
218
219
|
var handleChange = function handleChange(value, option) {
|
|
220
|
+
var getChangeValue = selectProps.getChangeValue;
|
|
219
221
|
if (selectProps.mode && selectProps.mode === 'multiple') {
|
|
220
222
|
if (Array.isArray(option)) {
|
|
221
223
|
option.forEach(function (item) {
|
|
@@ -225,14 +227,14 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
|
225
227
|
});
|
|
226
228
|
}
|
|
227
229
|
if (labelInValue) {
|
|
228
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(getValueObject(value), option);
|
|
230
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(getChangeValue ? getChangeValue(getValueObject(value)) : getValueObject(value), option);
|
|
229
231
|
} else {
|
|
230
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(value, option);
|
|
232
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(getChangeValue ? getChangeValue(value) : value, option);
|
|
231
233
|
}
|
|
232
234
|
} else if (!selectProps.mode && labelInValue) {
|
|
233
|
-
onChange(getValueObject(value), option);
|
|
235
|
+
onChange(getChangeValue ? getChangeValue(getValueObject(value)) : getValueObject(value), option);
|
|
234
236
|
} else {
|
|
235
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(value, option === null || option === void 0 ? void 0 : option.record);
|
|
237
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(getChangeValue ? getChangeValue(value) : value, option === null || option === void 0 ? void 0 : option.record);
|
|
236
238
|
}
|
|
237
239
|
};
|
|
238
240
|
/**
|
|
@@ -278,10 +280,11 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
|
278
280
|
if ((otherProps === null || otherProps === void 0 ? void 0 : otherProps.listName) && filterInList) {
|
|
279
281
|
newSelectList = getSelectList({
|
|
280
282
|
otherProps: otherProps,
|
|
281
|
-
value:
|
|
283
|
+
value: value,
|
|
282
284
|
dataSource: selectList,
|
|
283
285
|
labelInValue: labelInValue,
|
|
284
|
-
fieldNames: fieldNames
|
|
286
|
+
fieldNames: fieldNames,
|
|
287
|
+
mode: selectProps.mode
|
|
285
288
|
});
|
|
286
289
|
}
|
|
287
290
|
return _jsx("div", {
|
|
@@ -46,6 +46,10 @@ export interface PropSelectProps extends Omit<SelectProps, 'onSearch'> {
|
|
|
46
46
|
onSearch?: (value: string, useRequest: Result<any, any>) => void;
|
|
47
47
|
/** 自定义展示 */
|
|
48
48
|
optionRender?: (value: DataOption) => string | ReactNode;
|
|
49
|
+
/** 用来转换修改value值 和 getValueProps配合使用 */
|
|
50
|
+
getChangeValue?: (value: DataOption) => any;
|
|
51
|
+
/** 用来转换传入的value值 getChangeValue配合使用 */
|
|
52
|
+
getValueProps?: (value: DataOption) => any;
|
|
49
53
|
}
|
|
50
54
|
export interface ProSelectAction {
|
|
51
55
|
/** 实例方法、根据 code | code[] 批量获取数据 */
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 返回当前组件可以显示的数据源
|
|
3
3
|
*/
|
|
4
|
-
export declare const getSelectList: ({ otherProps, value, dataSource, labelInValue, fieldNames, }:
|
|
5
|
-
otherProps: any;
|
|
6
|
-
value: any;
|
|
7
|
-
dataSource: any;
|
|
8
|
-
labelInValue: any;
|
|
9
|
-
fieldNames: any;
|
|
10
|
-
}) => any;
|
|
4
|
+
export declare const getSelectList: ({ otherProps, value, dataSource, labelInValue, fieldNames, mode, }: any) => any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
1
2
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
2
3
|
/* eslint-disable no-restricted-syntax */
|
|
3
4
|
import _ from 'lodash';
|
|
@@ -8,7 +9,8 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
|
|
|
8
9
|
value = _ref.value,
|
|
9
10
|
dataSource = _ref.dataSource,
|
|
10
11
|
labelInValue = _ref.labelInValue,
|
|
11
|
-
fieldNames = _ref.fieldNames
|
|
12
|
+
fieldNames = _ref.fieldNames,
|
|
13
|
+
mode = _ref.mode;
|
|
12
14
|
var selectValues = [];
|
|
13
15
|
list.forEach(function (item) {
|
|
14
16
|
var result = item;
|
|
@@ -27,9 +29,13 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
|
|
|
27
29
|
} finally {
|
|
28
30
|
_iterator.f();
|
|
29
31
|
}
|
|
30
|
-
|
|
32
|
+
if (mode === 'multiple') {
|
|
33
|
+
selectValues = [].concat(_toConsumableArray(selectValues), _toConsumableArray(result));
|
|
34
|
+
} else {
|
|
35
|
+
selectValues.push(result);
|
|
36
|
+
}
|
|
31
37
|
});
|
|
32
|
-
var diffList = _.difference(selectValues, [value]);
|
|
38
|
+
var diffList = _.difference(selectValues, mode === 'multiple' ? value : [value]);
|
|
33
39
|
return dataSource.filter(function (item) {
|
|
34
40
|
return !diffList.includes(labelInValue ? item : item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] || (item === null || item === void 0 ? void 0 : item.value));
|
|
35
41
|
});
|
|
@@ -42,7 +48,8 @@ export var getSelectList = function getSelectList(_ref2) {
|
|
|
42
48
|
value = _ref2.value,
|
|
43
49
|
dataSource = _ref2.dataSource,
|
|
44
50
|
labelInValue = _ref2.labelInValue,
|
|
45
|
-
fieldNames = _ref2.fieldNames
|
|
51
|
+
fieldNames = _ref2.fieldNames,
|
|
52
|
+
mode = _ref2.mode;
|
|
46
53
|
if (!otherProps) {
|
|
47
54
|
return null;
|
|
48
55
|
}
|
|
@@ -59,6 +66,7 @@ export var getSelectList = function getSelectList(_ref2) {
|
|
|
59
66
|
value: value,
|
|
60
67
|
dataSource: dataSource,
|
|
61
68
|
labelInValue: labelInValue,
|
|
62
|
-
fieldNames: fieldNames
|
|
69
|
+
fieldNames: fieldNames,
|
|
70
|
+
mode: mode
|
|
63
71
|
});
|
|
64
72
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const MenuItem: (props: any) =>
|
|
1
|
+
export declare const MenuItem: (props: any) => JSX.Element;
|
|
2
2
|
export default MenuItem;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ProStepItem } from '../../propsType';
|
|
2
|
-
declare const _default: ({ id, title, collapse: collapseItem, children, ...restProps }: ProStepItem) =>
|
|
2
|
+
declare const _default: ({ id, title, collapse: collapseItem, children, ...restProps }: ProStepItem) => JSX.Element;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const _default: ({ children, delayTime, ...props }: any) => React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
2
|
+
declare const _default: ({ children, delayTime, excludes, ...props }: any) => React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
3
3
|
export default _default;
|
|
@@ -2,13 +2,14 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["children", "delayTime"];
|
|
5
|
+
var _excluded = ["children", "delayTime", "excludes"];
|
|
6
6
|
import { throttle } from 'lodash';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { useStep } from '../../index';
|
|
9
9
|
export default (function (_ref) {
|
|
10
10
|
var children = _ref.children,
|
|
11
11
|
delayTime = _ref.delayTime,
|
|
12
|
+
excludes = _ref.excludes,
|
|
12
13
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
14
|
var _useStep = useStep(),
|
|
14
15
|
notify = _useStep.notify;
|
|
@@ -20,7 +21,9 @@ export default (function (_ref) {
|
|
|
20
21
|
case 0:
|
|
21
22
|
localStorage.setItem('cache-pro-step', '');
|
|
22
23
|
_context.next = 3;
|
|
23
|
-
return notify === null || notify === void 0 ? void 0 : notify(
|
|
24
|
+
return notify === null || notify === void 0 ? void 0 : notify({
|
|
25
|
+
excludes: excludes
|
|
26
|
+
});
|
|
24
27
|
case 3:
|
|
25
28
|
values = _context.sent;
|
|
26
29
|
setTimeout(function () {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProStepPropsType } from '../../propsType';
|
|
2
2
|
export declare const Step: ({ fixedTop, dataSource, activeKey, errorCollection, style, targetOffset, scrollToError, }: ProStepPropsType & {
|
|
3
3
|
errorCollection: object;
|
|
4
|
-
}) =>
|
|
4
|
+
}) => JSX.Element;
|
|
5
5
|
export default Step;
|
package/es/ProStep/index.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import './style/index.less';
|
|
|
4
4
|
export declare const ProStepContext: import("react").Context<any>;
|
|
5
5
|
export declare const useStep: () => any;
|
|
6
6
|
declare const ProStep: {
|
|
7
|
-
({ children, ...resetProps }: ProStepPropsType):
|
|
7
|
+
({ children, ...resetProps }: ProStepPropsType): JSX.Element;
|
|
8
8
|
useStep: () => any;
|
|
9
|
-
Item: ({ id, title, collapse: collapseItem, children, ...restProps }: import("./propsType").ProStepItem) =>
|
|
10
|
-
Listener: ({ children, delayTime, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>;
|
|
9
|
+
Item: ({ id, title, collapse: collapseItem, children, ...restProps }: import("./propsType").ProStepItem) => JSX.Element;
|
|
10
|
+
Listener: ({ children, delayTime, excludes, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>;
|
|
11
11
|
};
|
|
12
12
|
export default ProStep;
|
package/es/ProStep/index.js
CHANGED
|
@@ -128,47 +128,54 @@ var ProStep = function ProStep(_ref) {
|
|
|
128
128
|
registerMap.current[id] = record;
|
|
129
129
|
};
|
|
130
130
|
var notify = /*#__PURE__*/function () {
|
|
131
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
132
|
-
var events, res, nextErrorCollection;
|
|
131
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
132
|
+
var _ref7, excludes, triggerIds, events, res, nextErrorCollection;
|
|
133
133
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
134
134
|
while (1) switch (_context2.prev = _context2.next) {
|
|
135
135
|
case 0:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
_ref7 = params || {}, excludes = _ref7.excludes;
|
|
137
|
+
triggerIds = Object.keys(registerMap.current); // 排除指定模块不触发校验
|
|
138
|
+
if (excludes === null || excludes === void 0 ? void 0 : excludes.length) {
|
|
139
|
+
triggerIds = triggerIds.filter(function (id) {
|
|
140
|
+
return !excludes.includes(id);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
events = triggerIds.map(function (id) {
|
|
144
|
+
var _registerMap$current$, _registerMap$current$2;
|
|
145
|
+
return (_registerMap$current$ = registerMap.current[id]) === null || _registerMap$current$ === void 0 ? void 0 : (_registerMap$current$2 = _registerMap$current$.subEvent) === null || _registerMap$current$2 === void 0 ? void 0 : _registerMap$current$2.call(_registerMap$current$);
|
|
139
146
|
});
|
|
140
|
-
_context2.next =
|
|
147
|
+
_context2.next = 6;
|
|
141
148
|
return Promise.all(events);
|
|
142
|
-
case
|
|
149
|
+
case 6:
|
|
143
150
|
res = _context2.sent;
|
|
144
151
|
nextErrorCollection = {};
|
|
145
|
-
|
|
146
|
-
var
|
|
147
|
-
errorFields =
|
|
152
|
+
triggerIds.forEach(function (id, index) {
|
|
153
|
+
var _ref8 = (res === null || res === void 0 ? void 0 : res[index]) || {},
|
|
154
|
+
errorFields = _ref8.errorFields;
|
|
148
155
|
nextErrorCollection[id] = (errorFields === null || errorFields === void 0 ? void 0 : errorFields.length) || 0;
|
|
149
156
|
});
|
|
150
157
|
setErrorCollection(nextErrorCollection);
|
|
151
158
|
return _context2.abrupt("return", res);
|
|
152
|
-
case
|
|
159
|
+
case 11:
|
|
153
160
|
case "end":
|
|
154
161
|
return _context2.stop();
|
|
155
162
|
}
|
|
156
163
|
}, _callee2);
|
|
157
164
|
}));
|
|
158
|
-
return function notify() {
|
|
165
|
+
return function notify(_x) {
|
|
159
166
|
return _ref6.apply(this, arguments);
|
|
160
167
|
};
|
|
161
168
|
}();
|
|
162
169
|
var triggerTo = /*#__PURE__*/function () {
|
|
163
|
-
var
|
|
170
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(keys) {
|
|
164
171
|
var events, result, nextErrorCollection;
|
|
165
172
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
166
173
|
while (1) switch (_context3.prev = _context3.next) {
|
|
167
174
|
case 0:
|
|
168
175
|
events = [];
|
|
169
176
|
keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) {
|
|
170
|
-
var _registerMap$current, _registerMap$current
|
|
171
|
-
events.push(registerMap === null || registerMap === void 0 ? void 0 : (_registerMap$current = registerMap.current) === null || _registerMap$current === void 0 ? void 0 : (_registerMap$current$ = _registerMap$current[key]) === null || _registerMap$current$ === void 0 ? void 0 : (_registerMap$current$
|
|
177
|
+
var _registerMap$current, _registerMap$current$3, _registerMap$current$4;
|
|
178
|
+
events.push(registerMap === null || registerMap === void 0 ? void 0 : (_registerMap$current = registerMap.current) === null || _registerMap$current === void 0 ? void 0 : (_registerMap$current$3 = _registerMap$current[key]) === null || _registerMap$current$3 === void 0 ? void 0 : (_registerMap$current$4 = _registerMap$current$3.subEvent) === null || _registerMap$current$4 === void 0 ? void 0 : _registerMap$current$4.call(_registerMap$current$3));
|
|
172
179
|
});
|
|
173
180
|
_context3.next = 4;
|
|
174
181
|
return Promise.all(events);
|
|
@@ -190,8 +197,8 @@ var ProStep = function ProStep(_ref) {
|
|
|
190
197
|
}
|
|
191
198
|
}, _callee3);
|
|
192
199
|
}));
|
|
193
|
-
return function triggerTo(
|
|
194
|
-
return
|
|
200
|
+
return function triggerTo(_x2) {
|
|
201
|
+
return _ref9.apply(this, arguments);
|
|
195
202
|
};
|
|
196
203
|
}();
|
|
197
204
|
useDeepCompareEffect(function () {
|
|
@@ -365,14 +365,14 @@ export var getParentElement = function getParentElement(element, name) {
|
|
|
365
365
|
if (!element || !name) {
|
|
366
366
|
return result;
|
|
367
367
|
}
|
|
368
|
-
var
|
|
368
|
+
var searchDom = function searchDom(element, name) {
|
|
369
369
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'className';
|
|
370
370
|
if (element.parentElement[type] === name) {
|
|
371
371
|
result = element.parentElement;
|
|
372
372
|
return false;
|
|
373
373
|
}
|
|
374
|
-
|
|
374
|
+
searchDom(element.parentElement, name, type = 'className');
|
|
375
375
|
};
|
|
376
|
-
|
|
376
|
+
searchDom(element, name, type = 'className');
|
|
377
377
|
return result;
|
|
378
378
|
};
|
|
@@ -9,7 +9,7 @@ export var getRowKey = function getRowKey(rowKey, record) {
|
|
|
9
9
|
}
|
|
10
10
|
return key;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
12
|
+
export var addLevelAndParentId = function addLevelAndParentId(tree, rowKey) {
|
|
13
13
|
var currentLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
14
14
|
var currentParentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
15
15
|
return tree.map(function (node) {
|
|
@@ -18,12 +18,11 @@ var _addLevelAndParentId = function addLevelAndParentId(tree, rowKey) {
|
|
|
18
18
|
newNode.parentId = currentParentId;
|
|
19
19
|
newNode.rowKey = getRowKey(rowKey, node);
|
|
20
20
|
if (node.children) {
|
|
21
|
-
newNode.children =
|
|
21
|
+
newNode.children = addLevelAndParentId(node.children, rowKey, currentLevel + 1, newNode.rowKey);
|
|
22
22
|
}
|
|
23
23
|
return newNode;
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
export { _addLevelAndParentId as addLevelAndParentId };
|
|
27
26
|
export function getFinalChildrenKey(tree, meta, options) {
|
|
28
27
|
if (typeof options.getChildrenKey === 'function') {
|
|
29
28
|
var dynamicChildrenKey = options.getChildrenKey(tree, meta);
|
|
@@ -34,7 +33,7 @@ export function getFinalChildrenKey(tree, meta, options) {
|
|
|
34
33
|
return options.childrenKey;
|
|
35
34
|
}
|
|
36
35
|
// 前置深度优先遍历
|
|
37
|
-
var
|
|
36
|
+
var treeNodePreImpl = function treeNodePreImpl(treeItem, callback, options) {
|
|
38
37
|
var callbackResult = callback(treeItem, options);
|
|
39
38
|
if (callbackResult) {
|
|
40
39
|
return treeItem;
|
|
@@ -46,7 +45,7 @@ var _treeNodePreImpl = function treeNodePreImpl(treeItem, callback, options) {
|
|
|
46
45
|
}
|
|
47
46
|
for (var i = 0, count = children.length; i < count; i++) {
|
|
48
47
|
var childItem = children[i];
|
|
49
|
-
var findOne =
|
|
48
|
+
var findOne = treeNodePreImpl(childItem, callback, _objectSpread(_objectSpread({}, options), {}, {
|
|
50
49
|
parents: [].concat(_toConsumableArray(options.parents), [treeItem]),
|
|
51
50
|
depth: options.depth + 1
|
|
52
51
|
}));
|
|
@@ -57,7 +56,7 @@ var _treeNodePreImpl = function treeNodePreImpl(treeItem, callback, options) {
|
|
|
57
56
|
return undefined;
|
|
58
57
|
};
|
|
59
58
|
var treeNodeStrategies = {
|
|
60
|
-
pre:
|
|
59
|
+
pre: treeNodePreImpl
|
|
61
60
|
};
|
|
62
61
|
export function treeNodeFind(tree, callback, options) {
|
|
63
62
|
var _options$childrenKey, _options$strategy;
|
|
@@ -122,7 +121,7 @@ export function createTreeFromArray(array, options) {
|
|
|
122
121
|
return result;
|
|
123
122
|
}
|
|
124
123
|
// 前置遍历
|
|
125
|
-
var
|
|
124
|
+
var treeForEachPreImpl = function treeForEachPreImpl(treeItem, callback, options) {
|
|
126
125
|
callback(treeItem, options);
|
|
127
126
|
var finalChildrenKey = getFinalChildrenKey(treeItem, options, options);
|
|
128
127
|
var children = treeItem === null || treeItem === void 0 ? void 0 : treeItem[finalChildrenKey];
|
|
@@ -132,12 +131,12 @@ var _treeForEachPreImpl = function treeForEachPreImpl(treeItem, callback, option
|
|
|
132
131
|
depth: options.depth + 1
|
|
133
132
|
});
|
|
134
133
|
children.forEach(function (childItem) {
|
|
135
|
-
|
|
134
|
+
treeForEachPreImpl(childItem, callback, nextLevelOptions);
|
|
136
135
|
});
|
|
137
136
|
}
|
|
138
137
|
};
|
|
139
138
|
var treeForEachStrategies = {
|
|
140
|
-
pre:
|
|
139
|
+
pre: treeForEachPreImpl
|
|
141
140
|
};
|
|
142
141
|
export function treeForEach(tree, callback, options) {
|
|
143
142
|
var _options$childrenKey2, _options$strategy2;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const RenderFooter: (props: any) =>
|
|
1
|
+
declare const RenderFooter: (props: any) => JSX.Element;
|
|
2
2
|
export default RenderFooter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const RenderTableHeader: (props: any) =>
|
|
1
|
+
declare const RenderTableHeader: (props: any) => JSX.Element;
|
|
2
2
|
export default RenderTableHeader;
|
package/es/ProTable/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const defaultPage: {
|
|
|
5
5
|
pageNum: number;
|
|
6
6
|
pageSize: number;
|
|
7
7
|
};
|
|
8
|
-
declare function ProTable(props: ProTableProps):
|
|
8
|
+
declare function ProTable(props: ProTableProps): JSX.Element;
|
|
9
9
|
declare namespace ProTable {
|
|
10
10
|
var defaultProps: {
|
|
11
11
|
quickConfig: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DevToolsPropsType } from '../../propsType';
|
|
2
|
-
declare const ProTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) =>
|
|
2
|
+
declare const ProTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => JSX.Element;
|
|
3
3
|
export default ProTools;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProThemeToolsProps } from './propsType';
|
|
2
2
|
declare const ProThemeTools: {
|
|
3
|
-
({ size, className, cacheTime, color, mode, iconFollowTheme, prefixCls, tableBorder, tableStripe, theme, onChange, ...props }: ProThemeToolsProps):
|
|
3
|
+
({ size, className, cacheTime, color, mode, iconFollowTheme, prefixCls, tableBorder, tableStripe, theme, onChange, ...props }: ProThemeToolsProps): JSX.Element;
|
|
4
4
|
defaultProps: {
|
|
5
5
|
size: number;
|
|
6
6
|
mode: string;
|
package/es/ProTooltip/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ProTooltipPropsType } from './propsType';
|
|
2
2
|
import './style/index.less';
|
|
3
|
-
declare const ProTooltip: (props: ProTooltipPropsType) =>
|
|
3
|
+
declare const ProTooltip: (props: ProTooltipPropsType) => JSX.Element;
|
|
4
4
|
export default ProTooltip;
|
|
@@ -12,6 +12,6 @@ interface ListProps {
|
|
|
12
12
|
handleFilterClose?: (code: string) => void;
|
|
13
13
|
optionRender?: (item: any, searchStr?: string) => string | ReactNode;
|
|
14
14
|
}
|
|
15
|
-
declare function List(props: ListProps):
|
|
15
|
+
declare function List(props: ListProps): JSX.Element;
|
|
16
16
|
declare const _default: import("react").MemoExoticComponent<typeof List>;
|
|
17
17
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PropTreeSelectProps } from './propsType';
|
|
3
|
-
export declare const ProTreeSelect: (props: PropTreeSelectProps, ref: React.Ref<unknown> | undefined) =>
|
|
3
|
+
export declare const ProTreeSelect: (props: PropTreeSelectProps, ref: React.Ref<unknown> | undefined) => JSX.Element;
|
|
4
4
|
declare const _default: React.ForwardRefExoticComponent<PropTreeSelectProps & React.RefAttributes<unknown>>;
|
|
5
5
|
export default _default;
|
|
@@ -102,14 +102,14 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
102
102
|
}
|
|
103
103
|
var count = 0;
|
|
104
104
|
var result = [];
|
|
105
|
-
var
|
|
105
|
+
var loopCount = function loopCount(data) {
|
|
106
106
|
data.map(function (item) {
|
|
107
107
|
count += 1;
|
|
108
108
|
var children = item.children,
|
|
109
109
|
other = _objectWithoutProperties(item, _excluded2);
|
|
110
110
|
result.push(_objectSpread({}, other));
|
|
111
111
|
if (item.children) {
|
|
112
|
-
|
|
112
|
+
loopCount(item.children);
|
|
113
113
|
}
|
|
114
114
|
return item;
|
|
115
115
|
});
|
|
@@ -117,7 +117,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
117
117
|
if ((dictsEnum === null || dictsEnum === void 0 ? void 0 : dictsEnum.length) > 10) {
|
|
118
118
|
return dictsEnum;
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
loopCount(dictsEnum);
|
|
121
121
|
if (count <= 10) {
|
|
122
122
|
return result;
|
|
123
123
|
}
|
|
@@ -131,17 +131,17 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
131
131
|
*/
|
|
132
132
|
var transferDataSource = function transferDataSource(dataArr, showCodeAndName) {
|
|
133
133
|
var copyData = cloneDeep(dataArr);
|
|
134
|
-
var
|
|
134
|
+
var loop = function loop(arr) {
|
|
135
135
|
arr.map(function (item) {
|
|
136
136
|
item[label] = "".concat(item[code], "-").concat(item[label]);
|
|
137
137
|
if (item.children) {
|
|
138
|
-
|
|
138
|
+
loop(item.children);
|
|
139
139
|
}
|
|
140
140
|
return item;
|
|
141
141
|
});
|
|
142
142
|
};
|
|
143
143
|
if (showCodeAndName) {
|
|
144
|
-
|
|
144
|
+
loop(copyData);
|
|
145
145
|
}
|
|
146
146
|
return copyData;
|
|
147
147
|
};
|
|
@@ -235,19 +235,19 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
235
235
|
return viewEmpty;
|
|
236
236
|
}
|
|
237
237
|
var labelResult = [];
|
|
238
|
-
var
|
|
238
|
+
var queryLabel = function queryLabel(dicts) {
|
|
239
239
|
return dicts.map(function (item) {
|
|
240
240
|
if (value.includes(item[code])) {
|
|
241
241
|
var labelText = item[label];
|
|
242
242
|
labelResult.push(labelText);
|
|
243
243
|
}
|
|
244
244
|
if (item.children) {
|
|
245
|
-
|
|
245
|
+
queryLabel(item.children);
|
|
246
246
|
}
|
|
247
247
|
return item;
|
|
248
248
|
});
|
|
249
249
|
};
|
|
250
|
-
|
|
250
|
+
queryLabel(origDataSource);
|
|
251
251
|
return labelResult === null || labelResult === void 0 ? void 0 : labelResult.join(',');
|
|
252
252
|
};
|
|
253
253
|
// 纯展示处理
|
|
@@ -285,7 +285,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
285
285
|
* @param node 每个节点数据对象
|
|
286
286
|
* @returns 整个react节点树
|
|
287
287
|
*/
|
|
288
|
-
var
|
|
288
|
+
var renderTreeNode = function renderTreeNode(node, grade) {
|
|
289
289
|
var children = node.children,
|
|
290
290
|
icon = node.icon;
|
|
291
291
|
var labelText = node[label];
|
|
@@ -332,7 +332,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
332
332
|
checkable: node.checkable,
|
|
333
333
|
className: "node-val-".concat(value),
|
|
334
334
|
children: children.map(function (child) {
|
|
335
|
-
return
|
|
335
|
+
return renderTreeNode(child, sonGrade);
|
|
336
336
|
})
|
|
337
337
|
}, key);
|
|
338
338
|
};
|
|
@@ -343,7 +343,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
343
343
|
* @returns 处理后得树
|
|
344
344
|
*/
|
|
345
345
|
function filterTree(sourceList, keyWord) {
|
|
346
|
-
var
|
|
346
|
+
var filterData = function filterData(data) {
|
|
347
347
|
var currentAllNodeChild = []; // 记录当前节点得所有子节点
|
|
348
348
|
// 遍历数组
|
|
349
349
|
for (var i = 0; i < data.length; i++) {
|
|
@@ -351,7 +351,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
351
351
|
// 一直递归到最后一层子节点
|
|
352
352
|
var currentNodeChild = []; // 记录当前节点下得子节点匹配到的节点个数
|
|
353
353
|
if (item.children && item.children.length > 0) {
|
|
354
|
-
currentNodeChild =
|
|
354
|
+
currentNodeChild = filterData(item.children);
|
|
355
355
|
}
|
|
356
356
|
// 迭代完子节点向上回溯,如果有匹配到得子节点,那么加入当前节点得孩子对象上,否则加入得是空数组
|
|
357
357
|
item.children = currentNodeChild;
|
|
@@ -365,7 +365,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
365
365
|
}
|
|
366
366
|
return currentAllNodeChild;
|
|
367
367
|
};
|
|
368
|
-
sourceList =
|
|
368
|
+
sourceList = filterData(sourceList);
|
|
369
369
|
return sourceList;
|
|
370
370
|
}
|
|
371
371
|
var searchTreeEvent = function searchTreeEvent(searchVal) {
|
|
@@ -382,7 +382,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
382
382
|
};
|
|
383
383
|
function findTreeNode(treeList, nodeValue) {
|
|
384
384
|
var result = {};
|
|
385
|
-
var
|
|
385
|
+
var filterData = function filterData(data) {
|
|
386
386
|
for (var i = 0; i < data.length; i++) {
|
|
387
387
|
var item = data[i];
|
|
388
388
|
if (item[code] === nodeValue || Array.isArray(nodeValue) && nodeValue.includes(item[code])) {
|
|
@@ -394,11 +394,11 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
394
394
|
}
|
|
395
395
|
// 一直递归到最后一层子节点
|
|
396
396
|
if (item.children && item.children.length > 0) {
|
|
397
|
-
|
|
397
|
+
filterData(item.children);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
|
-
|
|
401
|
+
filterData(treeList);
|
|
402
402
|
return result;
|
|
403
403
|
}
|
|
404
404
|
function getLabelByValue(treeList, nodeValue) {
|
|
@@ -535,7 +535,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
535
535
|
}
|
|
536
536
|
}, treeProps), {}, {
|
|
537
537
|
children: selectList.map(function (node) {
|
|
538
|
-
return
|
|
538
|
+
return renderTreeNode(node, 1);
|
|
539
539
|
})
|
|
540
540
|
}))
|
|
541
541
|
});
|