@zat-design/sisyphus-react 3.6.5-beta.1 → 3.6.5-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ProAction/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 +6 -0
- package/es/ProEditTable/components/RcTable/BaseTable.js +75 -0
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +7 -0
- package/es/ProEditTable/components/RcTable/DraggableTable.js +90 -0
- package/es/ProEditTable/components/RcTable/VirtualTable1.d.ts +6 -0
- package/es/ProEditTable/components/RcTable/VirtualTable1.js +86 -0
- package/es/ProEditTable/components/RcTable/index.d.ts +6 -0
- package/es/ProEditTable/components/RcTable/index.js +6 -0
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +26 -18
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +3 -2
- package/es/ProEditTable/components/RenderToolbar/index.js +2 -2
- package/es/ProEditTable/components/Summary/index.d.ts +1 -1
- package/es/ProEditTable/index.js +33 -55
- package/es/ProEditTable/propsType.d.ts +6 -0
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/config.js +2 -2
- 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/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/ProCascader/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +7 -7
- 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/ProRangeBox/index.d.ts +1 -2
- package/es/ProForm/index.d.ts +3 -2
- package/es/ProForm/index.js +3 -17
- package/es/ProForm/utils/index.js +14 -10
- package/es/ProForm/utils/useShouldUpdate.js +9 -1
- package/es/ProForm/utils/useWatch.d.ts +7 -0
- package/es/ProForm/utils/useWatch.js +77 -0
- 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/Step/index.d.ts +1 -1
- package/es/ProStep/index.d.ts +2 -2
- package/es/ProTable/components/ResizableLine/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/ProTable/utils.js +4 -4
- package/es/ProTabs/components/Card/index.d.ts +1 -1
- package/es/ProThemeTools/component/PrdTools/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 +1 -2
- 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 +33 -22
- 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 +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/utils.js +12 -11
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- 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 +6 -0
- package/lib/ProEditTable/components/RcTable/BaseTable.js +81 -0
- package/lib/ProEditTable/components/RcTable/DraggableTable.d.ts +7 -0
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +96 -0
- package/lib/ProEditTable/components/RcTable/VirtualTable1.d.ts +6 -0
- package/lib/ProEditTable/components/RcTable/VirtualTable1.js +93 -0
- package/lib/ProEditTable/components/RcTable/index.d.ts +6 -0
- package/lib/ProEditTable/components/RcTable/index.js +27 -0
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +26 -18
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +3 -2
- package/lib/ProEditTable/components/RenderToolbar/index.js +3 -2
- package/lib/ProEditTable/components/Summary/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +32 -52
- package/lib/ProEditTable/propsType.d.ts +6 -0
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/config.js +2 -2
- 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/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/ProCascader/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +7 -7
- 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/ProRangeBox/index.d.ts +1 -2
- package/lib/ProForm/index.d.ts +3 -2
- package/lib/ProForm/index.js +2 -16
- package/lib/ProForm/utils/index.js +10 -10
- package/lib/ProForm/utils/useShouldUpdate.js +9 -1
- package/lib/ProForm/utils/useWatch.d.ts +7 -0
- package/lib/ProForm/utils/useWatch.js +87 -0
- 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/Step/index.d.ts +1 -1
- package/lib/ProStep/index.d.ts +2 -2
- package/lib/ProTable/components/ResizableLine/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/ProTable/utils.js +4 -4
- package/lib/ProTabs/components/Card/index.d.ts +1 -1
- package/lib/ProThemeTools/component/PrdTools/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 +1 -2
- 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 +33 -22
- 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 +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/utils.js +11 -11
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/package.json +3 -2
|
@@ -15,7 +15,7 @@ export var getIdsByPathName = function getIdsByPathName(menus, activeMenu) {
|
|
|
15
15
|
_pathName = activeMenu;
|
|
16
16
|
}
|
|
17
17
|
var result;
|
|
18
|
-
var
|
|
18
|
+
var _menuDeep = function menuDeep(menuDeepItem) {
|
|
19
19
|
for (var i = 0; i <= menuDeepItem.length - 1; i++) {
|
|
20
20
|
var item = menuDeepItem[i];
|
|
21
21
|
// 只包含一级菜单时,解决URL:/endorsement/demo/123无法选中问题
|
|
@@ -24,7 +24,7 @@ export var getIdsByPathName = function getIdsByPathName(menus, activeMenu) {
|
|
|
24
24
|
break;
|
|
25
25
|
}
|
|
26
26
|
if (Array.isArray(item.children) && item.children.length) {
|
|
27
|
-
|
|
27
|
+
_menuDeep(item.children);
|
|
28
28
|
} else if (((item === null || item === void 0 ? void 0 : item.url) && _pathName.includes(item.url.split('?')[0]) || (item === null || item === void 0 ? void 0 : item.redirectUrl) && _pathName.includes(item.redirectUrl.split('?')[0])) && !result) {
|
|
29
29
|
// 当循环到最后一层时判断URL是否包含最后一层的URL,解决URL在URL中不存在的场景
|
|
30
30
|
result = item.keyIdPath;
|
|
@@ -32,7 +32,7 @@ export var getIdsByPathName = function getIdsByPathName(menus, activeMenu) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
_menuDeep(menus);
|
|
36
36
|
return result || [];
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
@@ -42,7 +42,7 @@ export var getIdsByPathName = function getIdsByPathName(menus, activeMenu) {
|
|
|
42
42
|
*/
|
|
43
43
|
export var transformMenu = function transformMenu(menuData, pathPrefix) {
|
|
44
44
|
var data = _toConsumableArray(menuData);
|
|
45
|
-
var
|
|
45
|
+
var _menuDeep2 = function menuDeep(menuDeepItem) {
|
|
46
46
|
if (!Array.isArray(menuDeepItem) || !menuDeepItem.length) {
|
|
47
47
|
return [];
|
|
48
48
|
}
|
|
@@ -75,11 +75,11 @@ export var transformMenu = function transformMenu(menuData, pathPrefix) {
|
|
|
75
75
|
childrenItem.keyUrlPath = _toConsumableArray(item.keyUrlPath);
|
|
76
76
|
childrenItem.keyIdPath = _toConsumableArray(item.keyIdPath);
|
|
77
77
|
});
|
|
78
|
-
|
|
78
|
+
_menuDeep2(item.children);
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
_menuDeep2(data);
|
|
83
83
|
return data;
|
|
84
84
|
};
|
|
85
85
|
/**
|
|
@@ -134,7 +134,7 @@ export var getPathNameKey = function getPathNameKey(_ref) {
|
|
|
134
134
|
var menus = _ref.menus,
|
|
135
135
|
pathName = _ref.pathName;
|
|
136
136
|
var result;
|
|
137
|
-
var
|
|
137
|
+
var _menuDeep3 = function menuDeep(menuDeepItem) {
|
|
138
138
|
if (!Array.isArray(menuDeepItem) || !menuDeepItem.length) {
|
|
139
139
|
return [];
|
|
140
140
|
}
|
|
@@ -148,7 +148,7 @@ export var getPathNameKey = function getPathNameKey(_ref) {
|
|
|
148
148
|
break;
|
|
149
149
|
}
|
|
150
150
|
if (Array.isArray(item.children) && item.children.length) {
|
|
151
|
-
|
|
151
|
+
_menuDeep3(item.children);
|
|
152
152
|
} else if (((item === null || item === void 0 ? void 0 : item.url) && pathName.includes(item.url.split('?')[0]) || (item === null || item === void 0 ? void 0 : item.redirectUrl) && pathName.includes(item.redirectUrl.split('?')[0])) && !result) {
|
|
153
153
|
// URL未匹配时,循环到最后一层时判断URL是否包含最后一层的URL,解决URL在URL中不存在的场景
|
|
154
154
|
result = item.keyIdPath;
|
|
@@ -156,6 +156,6 @@ export var getPathNameKey = function getPathNameKey(_ref) {
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
|
-
|
|
159
|
+
_menuDeep3(menus);
|
|
160
160
|
return result;
|
|
161
161
|
};
|
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) => JSX.Element;
|
|
4
|
+
export declare const ProSelect: (props: PropSelectProps, ref: React.Ref<ProSelectAction> | undefined) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare const _default: React.ForwardRefExoticComponent<PropSelectProps & React.RefAttributes<ProSelectAction>>;
|
|
6
6
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const MenuItem: (props: any) => JSX.Element;
|
|
1
|
+
export declare const MenuItem: (props: any) => import("react/jsx-runtime").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) => JSX.Element;
|
|
2
|
+
declare const _default: ({ id, title, collapse: collapseItem, children, ...restProps }: ProStepItem) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default _default;
|
|
@@ -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
|
-
}) => JSX.Element;
|
|
4
|
+
}) => import("react/jsx-runtime").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): JSX.Element;
|
|
7
|
+
({ children, ...resetProps }: ProStepPropsType): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
useStep: () => any;
|
|
9
|
-
Item: ({ id, title, collapse: collapseItem, children, ...restProps }: import("./propsType").ProStepItem) => JSX.Element;
|
|
9
|
+
Item: ({ id, title, collapse: collapseItem, children, ...restProps }: import("./propsType").ProStepItem) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
Listener: ({ children, delayTime, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>;
|
|
11
11
|
};
|
|
12
12
|
export default ProStep;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const ResizableLine: () => JSX.Element;
|
|
1
|
+
declare const ResizableLine: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default ResizableLine;
|
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): JSX.Element;
|
|
8
|
+
declare function ProTable(props: ProTableProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
declare namespace ProTable {
|
|
10
10
|
var defaultProps: {
|
|
11
11
|
quickConfig: boolean;
|
package/es/ProTable/utils.js
CHANGED
|
@@ -105,7 +105,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
|
|
|
105
105
|
if (['percentage', 'permillage'].includes(valueType)) {
|
|
106
106
|
column.render = function (value, record, index) {
|
|
107
107
|
var multiple = valueType === 'percentage' ? 100 : 1000;
|
|
108
|
-
var realValue = tools.calc(Number(value), '*', multiple);
|
|
108
|
+
var realValue = tools.calc(Number(value !== null && value !== void 0 ? value : 0), '*', multiple);
|
|
109
109
|
var renderValue = getDecimalDigits(value) > valueTypePrecision ? realValue : realValue.toFixed(valueTypePrecision);
|
|
110
110
|
var originalValue = getOriginalValue(value, record, originalObj, rowKey, dataIndex);
|
|
111
111
|
var originalRealValue = tools.calc(Number(originalValue || null), '*', multiple);
|
|
@@ -382,15 +382,15 @@ export var getParentElement = function getParentElement(element, name) {
|
|
|
382
382
|
if (!element || !name) {
|
|
383
383
|
return result;
|
|
384
384
|
}
|
|
385
|
-
var
|
|
385
|
+
var _searchDom = function searchDom(element, name) {
|
|
386
386
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'className';
|
|
387
387
|
if (element.parentElement[type] === name) {
|
|
388
388
|
result = element.parentElement;
|
|
389
389
|
return false;
|
|
390
390
|
}
|
|
391
|
-
|
|
391
|
+
_searchDom(element.parentElement, name, type = 'className');
|
|
392
392
|
};
|
|
393
|
-
|
|
393
|
+
_searchDom(element, name, type = 'className');
|
|
394
394
|
return result;
|
|
395
395
|
};
|
|
396
396
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DevToolsPropsType } from '../../propsType';
|
|
2
|
-
declare const PrdTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => JSX.Element;
|
|
2
|
+
declare const PrdTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default PrdTools;
|
|
@@ -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): JSX.Element;
|
|
3
|
+
({ size, className, cacheTime, color, mode, iconFollowTheme, prefixCls, tableBorder, tableStripe, theme, onChange, ...props }: ProThemeToolsProps): import("react/jsx-runtime").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) => JSX.Element;
|
|
3
|
+
declare const ProTooltip: (props: ProTooltipPropsType) => import("react/jsx-runtime").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): JSX.Element;
|
|
15
|
+
declare function List(props: ListProps): import("react/jsx-runtime").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) => JSX.Element;
|
|
3
|
+
export declare const ProTreeSelect: (props: PropTreeSelectProps, ref: React.Ref<unknown> | undefined) => import("react/jsx-runtime").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,13 +351,13 @@ 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;
|
|
358
|
-
// let tag = false;
|
|
359
358
|
// 判断节点title是否包含关键字 如果有,那么直接进行下一循环
|
|
360
|
-
|
|
359
|
+
// @ts-ignore
|
|
360
|
+
if (item[label].indexOf(keyWord) > -1 && (selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode) !== 'treeSelect') {
|
|
361
361
|
var regExp = new RegExp(keyWord);
|
|
362
362
|
item[label] = item[label].replace(regExp, "<span class=\"highlight-search-text\">".concat(keyWord, "</span>"));
|
|
363
363
|
}
|
|
@@ -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 _filterData2 = 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
|
+
_filterData2(item.children);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
|
-
|
|
401
|
+
_filterData2(treeList);
|
|
402
402
|
return result;
|
|
403
403
|
}
|
|
404
404
|
function getLabelByValue(treeList, nodeValue) {
|
|
@@ -419,11 +419,22 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
419
419
|
}
|
|
420
420
|
var handleChange = function handleChange(newVal, label, extra) {
|
|
421
421
|
// newVal回来得一定是label、value
|
|
422
|
+
var _selectList = selectList.map(function (item) {
|
|
423
|
+
var label = item.label;
|
|
424
|
+
var _label = label;
|
|
425
|
+
if (label) {
|
|
426
|
+
var regex = /<span class="highlight-search-text">(.*?)<\/span>/g;
|
|
427
|
+
_label = item[label] = label === null || label === void 0 ? void 0 : label.replace(regex, '$1');
|
|
428
|
+
}
|
|
429
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
430
|
+
label: _label
|
|
431
|
+
});
|
|
432
|
+
});
|
|
422
433
|
var result = newVal;
|
|
423
434
|
if (props === null || props === void 0 ? void 0 : props.labelInValue) {
|
|
424
|
-
result = getLabelByValue(
|
|
435
|
+
result = getLabelByValue(_selectList, newVal);
|
|
425
436
|
}
|
|
426
|
-
var options = findTreeNode(
|
|
437
|
+
var options = findTreeNode(_selectList, extra === null || extra === void 0 ? void 0 : extra.triggerValue);
|
|
427
438
|
onChange && onChange(result, options, extra);
|
|
428
439
|
// 重置搜索
|
|
429
440
|
showSearch && searchTreeEvent('');
|
|
@@ -524,7 +535,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
524
535
|
}
|
|
525
536
|
}, treeProps), {}, {
|
|
526
537
|
children: selectList.map(function (node) {
|
|
527
|
-
return
|
|
538
|
+
return _renderTreeNode(node, 1);
|
|
528
539
|
})
|
|
529
540
|
}))
|
|
530
541
|
});
|
|
@@ -4,6 +4,6 @@ declare function SearchTitle(props: {
|
|
|
4
4
|
label?: string;
|
|
5
5
|
showEllipse?: boolean;
|
|
6
6
|
ellipseWidth?: string;
|
|
7
|
-
}): JSX.Element;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare const _default: import("react").MemoExoticComponent<typeof SearchTitle>;
|
|
9
9
|
export default _default;
|
|
@@ -23,5 +23,5 @@ interface ListProps extends ProTreeProps {
|
|
|
23
23
|
handleFilterClose?: (code: string, node?: any) => void;
|
|
24
24
|
[key: string]: any;
|
|
25
25
|
}
|
|
26
|
-
declare function List(props: ListProps): JSX.Element;
|
|
26
|
+
declare function List(props: ListProps): import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
export default List;
|
|
@@ -298,7 +298,7 @@ function List(props) {
|
|
|
298
298
|
}, onlyKey);
|
|
299
299
|
};
|
|
300
300
|
function fn() {
|
|
301
|
-
var
|
|
301
|
+
var _loop = function loop(data, index) {
|
|
302
302
|
index++;
|
|
303
303
|
var treeRow = data.map(function (item) {
|
|
304
304
|
var nodeClass = 'pro-tree-tree-node ';
|
|
@@ -320,7 +320,7 @@ function List(props) {
|
|
|
320
320
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
321
321
|
title: nodeTitle,
|
|
322
322
|
key: (item === null || item === void 0 ? void 0 : item.key) || item[fieldNameValue],
|
|
323
|
-
children:
|
|
323
|
+
children: _loop(item[fieldNames.children], index)
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
326
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -337,7 +337,7 @@ function List(props) {
|
|
|
337
337
|
if (searchStr) {
|
|
338
338
|
newTreeData = filterCheckedNodes(originalTreeData, [], searchStr, fieldNames);
|
|
339
339
|
}
|
|
340
|
-
return
|
|
340
|
+
return _loop(newTreeData, -1);
|
|
341
341
|
}
|
|
342
342
|
var _treeData = fn();
|
|
343
343
|
var onExpand = function onExpand(newExpandedKeys, nextPara) {
|
package/es/ProTree/index.d.ts
CHANGED
package/es/ProTree/utils.js
CHANGED
|
@@ -50,7 +50,7 @@ export function getAllKeys(data, fieldNames) {
|
|
|
50
50
|
* @param fieldNames
|
|
51
51
|
* @returns
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
var _getParentKey = function getParentKey(key, tree, fieldNames) {
|
|
54
54
|
var parentKey;
|
|
55
55
|
for (var i = 0; i < tree.length; i++) {
|
|
56
56
|
var node = tree[i];
|
|
@@ -59,16 +59,17 @@ export var getParentKey = function getParentKey(key, tree, fieldNames) {
|
|
|
59
59
|
return item[fieldNames.value] === key;
|
|
60
60
|
})) {
|
|
61
61
|
parentKey = node[fieldNames.value];
|
|
62
|
-
} else if (
|
|
63
|
-
parentKey =
|
|
62
|
+
} else if (_getParentKey(key, node[fieldNames.children], fieldNames)) {
|
|
63
|
+
parentKey = _getParentKey(key, node[fieldNames.children], fieldNames);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
return parentKey;
|
|
68
68
|
};
|
|
69
|
+
export { _getParentKey as getParentKey };
|
|
69
70
|
export function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
70
71
|
var result = [];
|
|
71
|
-
var
|
|
72
|
+
var _traverse = function traverse(node, parents) {
|
|
72
73
|
if (node[fieldNames.value] === key) {
|
|
73
74
|
result.push.apply(result, [node].concat(_toConsumableArray(parents)));
|
|
74
75
|
return true;
|
|
@@ -79,7 +80,7 @@ export function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
|
79
80
|
try {
|
|
80
81
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
81
82
|
var child = _step.value;
|
|
82
|
-
if (
|
|
83
|
+
if (_traverse(child, [node].concat(_toConsumableArray(parents)))) {
|
|
83
84
|
return true;
|
|
84
85
|
}
|
|
85
86
|
}
|
|
@@ -95,7 +96,7 @@ export function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
|
95
96
|
try {
|
|
96
97
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
97
98
|
var node = _step2.value;
|
|
98
|
-
|
|
99
|
+
_traverse(node, []);
|
|
99
100
|
}
|
|
100
101
|
} catch (err) {
|
|
101
102
|
_iterator2.e(err);
|
|
@@ -114,23 +115,23 @@ export function filterCheckedNodes(data, checkedKeys) {
|
|
|
114
115
|
var searchStr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
115
116
|
var fieldNames = arguments.length > 3 ? arguments[3] : undefined;
|
|
116
117
|
var result = [];
|
|
117
|
-
var
|
|
118
|
+
var _traverse2 = function traverse(node) {
|
|
118
119
|
var _node$fieldNames$chil3;
|
|
119
120
|
var title = node[fieldNames.value] + node[fieldNames.label];
|
|
120
121
|
if (!searchStr) {
|
|
121
122
|
if (checkedKeys.includes(node[fieldNames.value])) {
|
|
122
123
|
var _node$fieldNames$chil;
|
|
123
|
-
var _children = (node === null || node === void 0 ? void 0 : (_node$fieldNames$chil = node[fieldNames.children]) === null || _node$fieldNames$chil === void 0 ? void 0 : _node$fieldNames$chil.map(
|
|
124
|
+
var _children = (node === null || node === void 0 ? void 0 : (_node$fieldNames$chil = node[fieldNames.children]) === null || _node$fieldNames$chil === void 0 ? void 0 : _node$fieldNames$chil.map(_traverse2).filter(Boolean)) || [];
|
|
124
125
|
return _objectSpread(_objectSpread({}, node), {}, _defineProperty({}, fieldNames.children, _children));
|
|
125
126
|
}
|
|
126
127
|
} else if ((title === null || title === void 0 ? void 0 : title.indexOf(searchStr)) > -1) {
|
|
127
128
|
var _node$fieldNames$chil2;
|
|
128
|
-
var _children2 = ((_node$fieldNames$chil2 = node[fieldNames.children]) === null || _node$fieldNames$chil2 === void 0 ? void 0 : _node$fieldNames$chil2.map(
|
|
129
|
+
var _children2 = ((_node$fieldNames$chil2 = node[fieldNames.children]) === null || _node$fieldNames$chil2 === void 0 ? void 0 : _node$fieldNames$chil2.map(_traverse2).filter(Boolean)) || [];
|
|
129
130
|
return _objectSpread(_objectSpread({}, node), {}, {
|
|
130
131
|
children: _children2
|
|
131
132
|
});
|
|
132
133
|
}
|
|
133
|
-
var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map(
|
|
134
|
+
var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map(_traverse2).filter(Boolean);
|
|
134
135
|
if (children && children.length > 0) {
|
|
135
136
|
return _objectSpread(_objectSpread({}, node), {}, _defineProperty({}, fieldNames.children, children));
|
|
136
137
|
}
|
|
@@ -142,7 +143,7 @@ export function filterCheckedNodes(data, checkedKeys) {
|
|
|
142
143
|
try {
|
|
143
144
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
144
145
|
var node = _step3.value;
|
|
145
|
-
var filtered =
|
|
146
|
+
var filtered = _traverse2(node);
|
|
146
147
|
if (filtered) {
|
|
147
148
|
result.push(filtered);
|
|
148
149
|
}
|
|
@@ -10,5 +10,5 @@ interface CascaderProps {
|
|
|
10
10
|
handleOnChange?: (e: any, value: string) => void;
|
|
11
11
|
optionRender?: (item: any, searchStr: string) => string | ReactNode;
|
|
12
12
|
}
|
|
13
|
-
declare const Cascader: (props: CascaderProps) => JSX.Element;
|
|
13
|
+
declare const Cascader: (props: CascaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default Cascader;
|
|
@@ -59,7 +59,7 @@ function List(props, ref) {
|
|
|
59
59
|
}, [searchStr]);
|
|
60
60
|
var _treeData = useMemo(function () {
|
|
61
61
|
function fn() {
|
|
62
|
-
var
|
|
62
|
+
var _loop = function loop(data, index) {
|
|
63
63
|
index++;
|
|
64
64
|
return data.map(function (item) {
|
|
65
65
|
var title = showCodeName ? "".concat(item[fieldNameValue], "-").concat(item[fieldNameLabel]) : item[fieldNameLabel];
|
|
@@ -84,7 +84,7 @@ function List(props, ref) {
|
|
|
84
84
|
})]
|
|
85
85
|
}),
|
|
86
86
|
key: item[fieldNameValue],
|
|
87
|
-
children:
|
|
87
|
+
children: _loop(item[fieldNames.children], index)
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -117,12 +117,12 @@ function List(props, ref) {
|
|
|
117
117
|
if (searchStr) {
|
|
118
118
|
newTreeData = filterCheckedNodes(originalTreeData, [], searchStr, fieldNames);
|
|
119
119
|
}
|
|
120
|
-
return
|
|
120
|
+
return _loop(newTreeData, -1);
|
|
121
121
|
}
|
|
122
122
|
return fn();
|
|
123
123
|
}, [searchStr, expandedKeys, showCodeName]);
|
|
124
124
|
var treeViewData = useMemo(function () {
|
|
125
|
-
var
|
|
125
|
+
var _loop2 = function loop(data, index) {
|
|
126
126
|
index++;
|
|
127
127
|
return data.map(function (item) {
|
|
128
128
|
var title = showCodeName ? "".concat(item[fieldNameValue], "-").concat(item[fieldNameLabel]) : item[fieldNameLabel];
|
|
@@ -151,7 +151,7 @@ function List(props, ref) {
|
|
|
151
151
|
})]
|
|
152
152
|
}),
|
|
153
153
|
key: item[fieldNameValue],
|
|
154
|
-
children:
|
|
154
|
+
children: _loop2(item[fieldNames.children], index)
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -170,7 +170,7 @@ function List(props, ref) {
|
|
|
170
170
|
});
|
|
171
171
|
});
|
|
172
172
|
};
|
|
173
|
-
return
|
|
173
|
+
return _loop2(treeData, -1);
|
|
174
174
|
}, [treeData]);
|
|
175
175
|
var onExpand = function onExpand(newExpandedKeys) {
|
|
176
176
|
setExpandedKeys(newExpandedKeys);
|
|
@@ -17,5 +17,5 @@ interface TriggerProps {
|
|
|
17
17
|
handleClearAll: () => void;
|
|
18
18
|
appointChange: (appoint?: boolean) => void;
|
|
19
19
|
}
|
|
20
|
-
declare function Trigger(props: TriggerProps): JSX.Element;
|
|
20
|
+
declare function Trigger(props: TriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export default Trigger;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProTreeModalProps } from './propsType';
|
|
2
2
|
import './style/index.less';
|
|
3
3
|
export declare const CASCADER = "CASCADER";
|
|
4
|
-
declare const ProTreeModal: (props: ProTreeModalProps) => JSX.Element;
|
|
4
|
+
declare const ProTreeModal: (props: ProTreeModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default ProTreeModal;
|