@zat-design/sisyphus-react 3.9.0-beta.2 → 3.9.0-beta.21
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 +41 -15
- package/dist/less.esm.css +37 -13
- 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 +7 -5
- package/es/ProDrawerForm/components/ProModal/index.js +8 -6
- package/es/ProDrawerForm/propsType.d.ts +1 -0
- 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.js +7 -3
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +8 -7
- 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/index.js +23 -16
- package/es/ProEditTable/style/index.less +14 -2
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/config.js +2 -2
- 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 +7 -5
- package/es/ProEnum/propsType.d.ts +1 -0
- package/es/ProEnum/utils/eventCenter.js +2 -1
- package/es/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/es/ProForm/components/base/Input/index.d.ts +1 -1
- package/es/ProForm/components/base/SwitchCheckbox/index.js +9 -2
- 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.d.ts +1 -0
- package/es/ProForm/components/combination/Group/component/ComRender.js +13 -2
- package/es/ProForm/components/combination/Group/index.js +4 -3
- 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 +7 -6
- 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/ProAddress/index.js +1 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/es/ProForm/components/render/ChangedWrapper.js +1 -2
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +3 -3
- package/es/ProForm/components/render/RenderFields.js +3 -2
- package/es/ProForm/components/render/propsType.d.ts +1 -0
- package/es/ProForm/index.js +1 -1
- package/es/ProForm/style/index.less +8 -5
- package/es/ProForm/utils/diffOriginal.js +18 -12
- package/es/ProForm/utils/index.js +10 -14
- package/es/ProForm/utils/useForm.js +1 -1
- 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/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.d.ts +5 -3
- package/es/ProTable/components/FormatColumn/index.js +95 -74
- 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 +8 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.js +29 -11
- 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/components/TableResizable/index.js +1 -5
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.d.ts +6 -5
- package/es/ProTable/index.js +6 -8
- package/es/ProTable/propsType.d.ts +2 -1
- package/es/ProTable/style/index.less +10 -1
- package/es/ProTable/utils/index.d.ts +5 -2
- package/es/ProTable/utils/index.js +13 -4
- 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 +2 -1
- 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 +50 -31
- 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 +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/index.js +3 -3
- package/es/ProTreeModal/utils.js +14 -16
- 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/es/style/theme/antd.less +4 -2
- package/es/utils/index.d.ts +1 -1
- package/es/utils/index.js +4 -1
- 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 +7 -5
- package/lib/ProDrawerForm/components/ProModal/index.js +8 -6
- package/lib/ProDrawerForm/propsType.d.ts +1 -0
- 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.js +5 -1
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +8 -7
- 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/index.js +23 -16
- package/lib/ProEditTable/style/index.less +14 -2
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/config.js +2 -2
- 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 +7 -5
- package/lib/ProEnum/propsType.d.ts +1 -0
- package/lib/ProEnum/utils/eventCenter.js +2 -1
- package/lib/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/lib/ProForm/components/base/Input/index.d.ts +1 -1
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +9 -2
- 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.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/component/ComRender.js +13 -2
- package/lib/ProForm/components/combination/Group/index.js +4 -3
- 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 +7 -6
- 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/ProAddress/index.js +1 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/lib/ProForm/components/render/ChangedWrapper.js +1 -2
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +3 -3
- package/lib/ProForm/components/render/RenderFields.js +3 -2
- package/lib/ProForm/components/render/propsType.d.ts +1 -0
- package/lib/ProForm/index.js +1 -1
- package/lib/ProForm/style/index.less +8 -5
- package/lib/ProForm/utils/diffOriginal.js +18 -12
- package/lib/ProForm/utils/index.js +10 -10
- 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.d.ts +5 -3
- package/lib/ProTable/components/FormatColumn/index.js +94 -73
- 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/RenderColumn/index.d.ts +1 -1
- package/lib/ProTable/components/RenderColumn/index.js +29 -11
- 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/components/TableResizable/index.js +0 -4
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.d.ts +6 -5
- package/lib/ProTable/index.js +6 -8
- package/lib/ProTable/propsType.d.ts +2 -1
- package/lib/ProTable/style/index.less +10 -1
- package/lib/ProTable/utils/index.d.ts +5 -2
- package/lib/ProTable/utils/index.js +13 -4
- 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 +2 -1
- 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 +49 -30
- 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 +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/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/lib/style/theme/antd.less +4 -2
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +4 -1
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -5
@@ -8,8 +8,11 @@ import "antd/es/typography/style";
|
|
8
8
|
import _Typography from "antd/es/typography";
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
10
10
|
import { useSetState } from 'ahooks';
|
11
|
+
import { isBoolean } from 'lodash';
|
12
|
+
import classNames from 'classnames';
|
11
13
|
import { CheckOutlined } from '@ant-design/icons';
|
12
14
|
import { ReactSVG } from 'react-svg';
|
15
|
+
import { isEmpty } from '../../../utils';
|
13
16
|
import copySvg from '../../../assets/copy.svg';
|
14
17
|
var Paragraph = _Typography.Paragraph,
|
15
18
|
Text = _Typography.Text;
|
@@ -23,7 +26,6 @@ var RenderColumn = function RenderColumn(props) {
|
|
23
26
|
ellipsis = props.ellipsis,
|
24
27
|
width = props.width,
|
25
28
|
originalValue = props.originalValue,
|
26
|
-
originalDiffTip = props.originalDiffTip,
|
27
29
|
_props$toolTipProps = props.toolTipProps,
|
28
30
|
toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps,
|
29
31
|
minWidth = props.minWidth,
|
@@ -34,9 +36,13 @@ var RenderColumn = function RenderColumn(props) {
|
|
34
36
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
35
37
|
tooltip = _useSetState2[0].tooltip,
|
36
38
|
setState = _useSetState2[1];
|
37
|
-
|
39
|
+
var cellDiffCls = classNames({
|
40
|
+
'varied-cell': props === null || props === void 0 ? void 0 : props.isChanged
|
41
|
+
});
|
42
|
+
// 比对场景走的逻辑
|
43
|
+
if (!isInNewRowFlag && isBoolean(props === null || props === void 0 ? void 0 : props.isChanged)) {
|
38
44
|
var renderNode = value ? node : '-';
|
39
|
-
if (ellipsis ||
|
45
|
+
if (ellipsis || (props === null || props === void 0 ? void 0 : props.isChanged)) {
|
40
46
|
renderNode = _jsx(Text, {
|
41
47
|
style: {
|
42
48
|
width: currentValue === '-' ? 32.5 : width,
|
@@ -47,23 +53,35 @@ var RenderColumn = function RenderColumn(props) {
|
|
47
53
|
},
|
48
54
|
children: ellipsis ? currentValue : renderNode
|
49
55
|
});
|
56
|
+
if ((props === null || props === void 0 ? void 0 : props.isChanged) === false) {
|
57
|
+
return renderNode;
|
58
|
+
}
|
59
|
+
if (Array.isArray(originalValue)) {
|
60
|
+
console.error('Error: When enabled, dataIndex corresponds to an array, which needs to be converted using viewRender');
|
61
|
+
}
|
62
|
+
var originalValueCalc = function originalValueCalc() {
|
63
|
+
if (Array.isArray(originalValue)) {
|
64
|
+
return null;
|
65
|
+
}
|
66
|
+
return !isEmpty(originalValue) ? originalValue : '-';
|
67
|
+
};
|
50
68
|
return _jsx(_Tooltip, _objectSpread(_objectSpread({
|
51
|
-
className:
|
69
|
+
className: cellDiffCls,
|
52
70
|
style: {
|
53
71
|
width: width,
|
54
72
|
minWidth: minWidth
|
55
73
|
},
|
56
|
-
overlayClassName: "original-value-
|
74
|
+
overlayClassName: "original-value-tooltip",
|
57
75
|
placement: "topLeft",
|
58
76
|
autoAdjustOverflow: false,
|
59
77
|
title: _jsx(_Space, {
|
60
78
|
direction: "vertical",
|
61
79
|
className: "changed-tooltip",
|
62
|
-
children:
|
80
|
+
children: (props === null || props === void 0 ? void 0 : props.isChanged) ? _jsxs(_Fragment, {
|
63
81
|
children: [_jsxs(_Space, {
|
64
82
|
align: "start",
|
65
83
|
className: "original-value-container",
|
66
|
-
children: ["\u521D\u59CB\u503C\uFF1A",
|
84
|
+
children: ["\u521D\u59CB\u503C\uFF1A", originalValueCalc()]
|
67
85
|
}), _jsx(_Space, {
|
68
86
|
className: "current-value-container",
|
69
87
|
children: ellipsis ? _jsxs(_Space, {
|
@@ -79,8 +97,11 @@ var RenderColumn = function RenderColumn(props) {
|
|
79
97
|
children: renderNode
|
80
98
|
}));
|
81
99
|
}
|
100
|
+
if ((props === null || props === void 0 ? void 0 : props.isChanged) === false) {
|
101
|
+
return renderNode;
|
102
|
+
}
|
82
103
|
return _jsx("span", {
|
83
|
-
className:
|
104
|
+
className: cellDiffCls,
|
84
105
|
style: {
|
85
106
|
width: width,
|
86
107
|
minWidth: minWidth
|
@@ -129,15 +150,12 @@ var RenderColumn = function RenderColumn(props) {
|
|
129
150
|
range.setStart(box, 0);
|
130
151
|
range.setEnd(box, box.childNodes.length);
|
131
152
|
var rangeWidth = range.getBoundingClientRect().width;
|
132
|
-
var rangeHeight = range.getBoundingClientRect().height;
|
133
|
-
var contentWidth = rangeWidth - Math.floor(rangeWidth);
|
134
153
|
var _getPadding = getPadding(box),
|
135
154
|
pLeft = _getPadding.pLeft,
|
136
155
|
pRight = _getPadding.pRight,
|
137
156
|
pTop = _getPadding.pTop,
|
138
157
|
pBottom = _getPadding.pBottom;
|
139
158
|
var horizontalPadding = pLeft + pRight;
|
140
|
-
var verticalPadding = pTop + pBottom;
|
141
159
|
if (rangeWidth + horizontalPadding > box.clientWidth) {
|
142
160
|
return true;
|
143
161
|
}
|
@@ -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;
|
@@ -3,10 +3,9 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
4
|
var _excluded = ["onDrag", "width", "minwidth"];
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
-
import { useState
|
6
|
+
import { useState } from 'react';
|
7
7
|
import { Resizable } from 'react-resizable';
|
8
8
|
import classnames from 'classnames';
|
9
|
-
import { TableContext } from '../../index';
|
10
9
|
import { getParentElement } from '../FormatColumn';
|
11
10
|
var ResizableTitle = function ResizableTitle(props) {
|
12
11
|
var _restProps$className;
|
@@ -15,9 +14,6 @@ var ResizableTitle = function ResizableTitle(props) {
|
|
15
14
|
_props$minwidth = props.minwidth,
|
16
15
|
minwidth = _props$minwidth === void 0 ? 50 : _props$minwidth,
|
17
16
|
restProps = _objectWithoutProperties(props, _excluded);
|
18
|
-
var _useContext = useContext(TableContext),
|
19
|
-
tableConfig = _useContext.tableConfig,
|
20
|
-
Storage = _useContext.Storage;
|
21
17
|
// 添加偏移量
|
22
18
|
var _useState = useState(0),
|
23
19
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -276,7 +276,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
276
276
|
}
|
277
277
|
};
|
278
278
|
var handleRefresh = /*#__PURE__*/function () {
|
279
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
279
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
280
280
|
var res;
|
281
281
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
282
282
|
while (1) switch (_context.prev = _context.next) {
|
@@ -388,7 +388,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
388
388
|
total: total
|
389
389
|
}),
|
390
390
|
onSelect: function () {
|
391
|
-
var _onSelect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(changeableRowKeys) {
|
391
|
+
var _onSelect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(changeableRowKeys) {
|
392
392
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
393
393
|
while (1) switch (_context2.prev = _context2.next) {
|
394
394
|
case 0:
|
@@ -412,7 +412,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
412
412
|
key: 'uncheckAll',
|
413
413
|
text: locale === null || locale === void 0 ? void 0 : (_locale$ProTable4 = locale.ProTable) === null || _locale$ProTable4 === void 0 ? void 0 : _locale$ProTable4.deselect,
|
414
414
|
onSelect: function () {
|
415
|
-
var _onSelect2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
415
|
+
var _onSelect2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
416
416
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
417
417
|
while (1) switch (_context3.prev = _context3.next) {
|
418
418
|
case 0:
|
package/es/ProTable/index.d.ts
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ProTableProps } from './propsType';
|
3
|
+
import useAntdTable from './hooks/useAntdTable';
|
3
4
|
export declare const TableContext: import("react").Context<{}>;
|
4
5
|
export declare const defaultPage: {
|
5
6
|
pageNum: number;
|
6
7
|
pageSize: number;
|
7
8
|
};
|
8
|
-
declare
|
9
|
-
|
10
|
-
|
9
|
+
declare const ProTable: {
|
10
|
+
(props: ProTableProps): JSX.Element;
|
11
|
+
defaultProps: {
|
11
12
|
quickConfig: boolean;
|
12
13
|
stripe: boolean;
|
13
14
|
draggable: boolean;
|
14
15
|
disabled: boolean;
|
15
16
|
isView: boolean;
|
16
17
|
};
|
17
|
-
|
18
|
-
}
|
18
|
+
useAntdTable: typeof useAntdTable;
|
19
|
+
};
|
19
20
|
export default ProTable;
|
package/es/ProTable/index.js
CHANGED
@@ -29,7 +29,7 @@ export var defaultPage = {
|
|
29
29
|
pageNum: 1,
|
30
30
|
pageSize: 10
|
31
31
|
};
|
32
|
-
function ProTable(props) {
|
32
|
+
var ProTable = function ProTable(props) {
|
33
33
|
var _locale$ProTable, _props$scroll, _curTableConfig$pathK;
|
34
34
|
var _ref = useProConfig('globalConfig') || {},
|
35
35
|
configStorage = _ref.storage; // 获取全局缓存位置配置
|
@@ -114,7 +114,6 @@ function ProTable(props) {
|
|
114
114
|
});
|
115
115
|
});
|
116
116
|
var originalObj = _originalDataSource ? keyBy(_originalDataSource, 'rowKey') : undefined;
|
117
|
-
var dataSourceObj = _dataSource ? keyBy(_dataSource, 'rowKey') : {};
|
118
117
|
var propsColumnObj = useMemo(function () {
|
119
118
|
return propsColumns.reduce(function (acc, cur) {
|
120
119
|
// @ts-ignore
|
@@ -213,9 +212,8 @@ function ProTable(props) {
|
|
213
212
|
formatColumn({
|
214
213
|
column: item,
|
215
214
|
originalObj: originalObj,
|
216
|
-
|
217
|
-
|
218
|
-
diffToolTip: toolTip,
|
215
|
+
rowKey: props.rowKey,
|
216
|
+
diffConfig: diffConfig,
|
219
217
|
wrapToolTipProps: wrapToolTipProps,
|
220
218
|
scroll: _scroll,
|
221
219
|
onUpdateMinWidth: function onUpdateMinWidth(w) {
|
@@ -246,7 +244,7 @@ function ProTable(props) {
|
|
246
244
|
_scroll = props === null || props === void 0 ? void 0 : props.scroll;
|
247
245
|
}
|
248
246
|
var handleColumnConfig = /*#__PURE__*/function () {
|
249
|
-
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(checkList) {
|
247
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(checkList) {
|
250
248
|
var newColumns, _columnConfig$onColum, catchColumns;
|
251
249
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
252
250
|
while (1) switch (_context.prev = _context.next) {
|
@@ -355,7 +353,7 @@ function ProTable(props) {
|
|
355
353
|
return _rowSelection;
|
356
354
|
};
|
357
355
|
var onDataSourceChange = /*#__PURE__*/function () {
|
358
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(nextDataSource) {
|
356
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(nextDataSource) {
|
359
357
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
360
358
|
while (1) switch (_context2.prev = _context2.next) {
|
361
359
|
case 0:
|
@@ -447,7 +445,7 @@ function ProTable(props) {
|
|
447
445
|
})]
|
448
446
|
})
|
449
447
|
});
|
450
|
-
}
|
448
|
+
};
|
451
449
|
ProTable.defaultProps = {
|
452
450
|
quickConfig: false,
|
453
451
|
stripe: true,
|
@@ -31,7 +31,6 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
|
31
31
|
value: string | number;
|
32
32
|
}[];
|
33
33
|
copyable?: boolean;
|
34
|
-
originalDiffTip?: boolean;
|
35
34
|
prefix?: string | ReactNode | ((value: any, record?: any, index?: number) => any);
|
36
35
|
suffix?: string | ReactNode | ((value: any, record?: any, index?: number) => any);
|
37
36
|
tooltip?: ReactNode | {
|
@@ -45,6 +44,8 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
|
45
44
|
value: any;
|
46
45
|
originValue: any;
|
47
46
|
}) => boolean;
|
47
|
+
viewRender?: ({ value, record, index, originalValue, originalRecord }: any) => any;
|
48
|
+
isChanged?: boolean | null;
|
48
49
|
}
|
49
50
|
export interface CreateTreeFromArrayOptions {
|
50
51
|
itemKey?: string;
|
@@ -261,11 +261,20 @@
|
|
261
261
|
tr.@{ant-prefix}-table-row.new-cell {
|
262
262
|
background: var(--zaui-contract-bg-add; #d2fff4) !important;
|
263
263
|
background-color: var(--zaui-contract-bg-add; #d2fff4) !important;
|
264
|
-
|
265
264
|
td.@{ant-prefix}-table-cell {
|
266
265
|
background: var(--zaui-contract-bg-add; #d2fff4) !important;
|
267
266
|
background-color: var(--zaui-contract-bg-add; #d2fff4) !important;
|
268
267
|
border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
|
268
|
+
&.@{ant-prefix}-table-cell-fix-right {
|
269
|
+
background: var(--zaui-contract-bg-add; #d2fff4) !important;
|
270
|
+
background-color: var(--zaui-contract-bg-add; #d2fff4) !important;
|
271
|
+
border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
|
272
|
+
}
|
273
|
+
&.@{ant-prefix}-table-cell-fix-left {
|
274
|
+
background: var(--zaui-contract-bg-add; #d2fff4) !important;
|
275
|
+
background-color: var(--zaui-contract-bg-add; #d2fff4) !important;
|
276
|
+
border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
|
277
|
+
}
|
269
278
|
}
|
270
279
|
}
|
271
280
|
|
@@ -11,9 +11,12 @@ export declare const getDecimalDigits: (num?: number) => number;
|
|
11
11
|
* @param any value
|
12
12
|
* @param any originalObj
|
13
13
|
* @param {any} dataIndex
|
14
|
-
* @return {any}
|
14
|
+
* @return {any} isChanged 返回bool值,表示存在比对
|
15
15
|
*/
|
16
|
-
export declare const getOriginalValue: (value: any, record: any, originalObj: any, rowKey: any, dataIndex: any) =>
|
16
|
+
export declare const getOriginalValue: (value: any, record: any, originalObj: any, rowKey: any, dataIndex: any) => {
|
17
|
+
originalValue: any;
|
18
|
+
isChanged: boolean;
|
19
|
+
};
|
17
20
|
export declare const getColumnDataIndex: (dataIndex: string | string[]) => string;
|
18
21
|
/**
|
19
22
|
* 判断数据是否为Response<List<any>>结构
|
@@ -16,18 +16,27 @@ export var getDecimalDigits = function getDecimalDigits() {
|
|
16
16
|
* @param any value
|
17
17
|
* @param any originalObj
|
18
18
|
* @param {any} dataIndex
|
19
|
-
* @return {any}
|
19
|
+
* @return {any} isChanged 返回bool值,表示存在比对
|
20
20
|
*/
|
21
21
|
export var getOriginalValue = function getOriginalValue(value, record, originalObj, rowKey, dataIndex) {
|
22
22
|
if (!originalObj) {
|
23
|
-
return
|
23
|
+
return {
|
24
|
+
originalValue: null,
|
25
|
+
isChanged: null
|
26
|
+
};
|
24
27
|
}
|
25
28
|
var originalRecord = get(originalObj, get(record, rowKey));
|
26
29
|
var originalValue = get(originalRecord, dataIndex);
|
27
30
|
if (!isEqual(originalValue, value)) {
|
28
|
-
return
|
31
|
+
return {
|
32
|
+
originalValue: originalValue,
|
33
|
+
isChanged: true
|
34
|
+
};
|
29
35
|
}
|
30
|
-
return
|
36
|
+
return {
|
37
|
+
originalValue: null,
|
38
|
+
isChanged: false
|
39
|
+
};
|
31
40
|
};
|
32
41
|
export var getColumnDataIndex = function getColumnDataIndex(dataIndex) {
|
33
42
|
return typeof dataIndex === 'string' ? dataIndex : dataIndex === null || dataIndex === void 0 ? void 0 : dataIndex.join('-');
|
@@ -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;
|
@@ -359,7 +359,7 @@ var ProTree = function ProTree(props) {
|
|
359
359
|
};
|
360
360
|
/** 点击了树节点开始loading,改变自身state并将值通过onchange上传到form */
|
361
361
|
var onSelectTreeNode = /*#__PURE__*/function () {
|
362
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(props, info) {
|
362
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(props, info) {
|
363
363
|
var _options$;
|
364
364
|
var values, options, option;
|
365
365
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -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;
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import "antd/es/tooltip/style";
|
2
2
|
import _Tooltip from "antd/es/tooltip";
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
4
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
5
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
4
6
|
import "antd/es/input/style";
|
5
7
|
import _Input from "antd/es/input";
|
6
8
|
import "antd/es/message/style";
|
@@ -18,7 +20,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
20
|
import { useDeepCompareEffect, useRequest as useRequestFunc, useSetState } from 'ahooks';
|
19
21
|
import classnames from 'classnames';
|
20
22
|
import { useImperativeHandle, forwardRef } from 'react';
|
21
|
-
import { cloneDeep } from 'lodash';
|
23
|
+
import { cloneDeep, debounce } from 'lodash';
|
22
24
|
import { useProConfig } from '../../../ProConfigProvider';
|
23
25
|
import Container from '../../../ProForm/components/Container';
|
24
26
|
import AdaptiveTooltip from '../AdaptiveTooltip';
|
@@ -108,14 +110,14 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
108
110
|
}
|
109
111
|
var count = 0;
|
110
112
|
var result = [];
|
111
|
-
var
|
113
|
+
var loopCount = function loopCount(data) {
|
112
114
|
data.map(function (item) {
|
113
115
|
count += 1;
|
114
116
|
var children = item.children,
|
115
117
|
other = _objectWithoutProperties(item, _excluded2);
|
116
118
|
result.push(_objectSpread({}, other));
|
117
119
|
if (item.children) {
|
118
|
-
|
120
|
+
loopCount(item.children);
|
119
121
|
}
|
120
122
|
return item;
|
121
123
|
});
|
@@ -123,7 +125,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
123
125
|
if ((dictsEnum === null || dictsEnum === void 0 ? void 0 : dictsEnum.length) > 10) {
|
124
126
|
return dictsEnum;
|
125
127
|
}
|
126
|
-
|
128
|
+
loopCount(dictsEnum);
|
127
129
|
if (count <= 10) {
|
128
130
|
return result;
|
129
131
|
}
|
@@ -137,17 +139,17 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
137
139
|
*/
|
138
140
|
var transferDataSource = function transferDataSource(dataArr, showCodeAndName) {
|
139
141
|
var copyData = cloneDeep(dataArr);
|
140
|
-
var
|
142
|
+
var loop = function loop(arr) {
|
141
143
|
arr.map(function (item) {
|
142
144
|
item[label] = "".concat(item[code], "-").concat(item[label]);
|
143
145
|
if (item.children) {
|
144
|
-
|
146
|
+
loop(item.children);
|
145
147
|
}
|
146
148
|
return item;
|
147
149
|
});
|
148
150
|
};
|
149
151
|
if (showCodeAndName) {
|
150
|
-
|
152
|
+
loop(copyData);
|
151
153
|
}
|
152
154
|
return copyData;
|
153
155
|
};
|
@@ -241,19 +243,19 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
241
243
|
return viewEmpty;
|
242
244
|
}
|
243
245
|
var labelResult = [];
|
244
|
-
var
|
246
|
+
var queryLabel = function queryLabel(dicts) {
|
245
247
|
return dicts.map(function (item) {
|
246
248
|
if (value.includes(item[code])) {
|
247
249
|
var labelText = item[label];
|
248
250
|
labelResult.push(labelText);
|
249
251
|
}
|
250
252
|
if (item.children) {
|
251
|
-
|
253
|
+
queryLabel(item.children);
|
252
254
|
}
|
253
255
|
return item;
|
254
256
|
});
|
255
257
|
};
|
256
|
-
|
258
|
+
queryLabel(origDataSource);
|
257
259
|
return labelResult === null || labelResult === void 0 ? void 0 : labelResult.join(',');
|
258
260
|
};
|
259
261
|
// 纯展示处理
|
@@ -291,7 +293,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
291
293
|
* @param node 每个节点数据对象
|
292
294
|
* @returns 整个react节点树
|
293
295
|
*/
|
294
|
-
var
|
296
|
+
var renderTreeNode = function renderTreeNode(node, grade) {
|
295
297
|
var children = node.children,
|
296
298
|
icon = node.icon;
|
297
299
|
var labelText = node[label];
|
@@ -362,7 +364,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
362
364
|
checkable: node.checkable,
|
363
365
|
className: "node-val-".concat(value),
|
364
366
|
children: children.map(function (child) {
|
365
|
-
return
|
367
|
+
return renderTreeNode(child, sonGrade);
|
366
368
|
})
|
367
369
|
}, key);
|
368
370
|
};
|
@@ -373,7 +375,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
373
375
|
* @returns 处理后得树
|
374
376
|
*/
|
375
377
|
function filterTree(sourceList, keyWord) {
|
376
|
-
var
|
378
|
+
var filterData = function filterData(data) {
|
377
379
|
var currentAllNodeChild = []; // 记录当前节点得所有子节点
|
378
380
|
// 遍历数组
|
379
381
|
for (var i = 0; i < data.length; i++) {
|
@@ -381,7 +383,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
381
383
|
// 一直递归到最后一层子节点
|
382
384
|
var currentNodeChild = []; // 记录当前节点下得子节点匹配到的节点个数
|
383
385
|
if (item.children && item.children.length > 0) {
|
384
|
-
currentNodeChild =
|
386
|
+
currentNodeChild = filterData(item.children);
|
385
387
|
}
|
386
388
|
// 迭代完子节点向上回溯,如果有匹配到得子节点,那么加入当前节点得孩子对象上,否则加入得是空数组
|
387
389
|
item.children = currentNodeChild;
|
@@ -395,24 +397,41 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
395
397
|
}
|
396
398
|
return currentAllNodeChild;
|
397
399
|
};
|
398
|
-
sourceList =
|
400
|
+
sourceList = filterData(sourceList);
|
399
401
|
return sourceList;
|
400
402
|
}
|
401
|
-
var searchTreeEvent = function
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
403
|
+
var searchTreeEvent = debounce( /*#__PURE__*/function () {
|
404
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchVal) {
|
405
|
+
var result;
|
406
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
407
|
+
while (1) switch (_context.prev = _context.next) {
|
408
|
+
case 0:
|
409
|
+
if (searchVal) {
|
410
|
+
_context.next = 3;
|
411
|
+
break;
|
412
|
+
}
|
413
|
+
setState({
|
414
|
+
selectList: cloneDeep(origDataSource || [])
|
415
|
+
});
|
416
|
+
return _context.abrupt("return", null);
|
417
|
+
case 3:
|
418
|
+
result = filterTree(cloneDeep(origDataSource || []), searchVal);
|
419
|
+
setState({
|
420
|
+
selectList: result || []
|
421
|
+
});
|
422
|
+
case 5:
|
423
|
+
case "end":
|
424
|
+
return _context.stop();
|
425
|
+
}
|
426
|
+
}, _callee);
|
427
|
+
}));
|
428
|
+
return function (_x) {
|
429
|
+
return _ref5.apply(this, arguments);
|
430
|
+
};
|
431
|
+
}(), 500);
|
413
432
|
function findTreeNode(treeList, nodeValue) {
|
414
433
|
var result = {};
|
415
|
-
var
|
434
|
+
var filterData = function filterData(data) {
|
416
435
|
for (var i = 0; i < data.length; i++) {
|
417
436
|
var item = data[i];
|
418
437
|
if (item[code] === nodeValue || Array.isArray(nodeValue) && nodeValue.includes(item[code])) {
|
@@ -424,11 +443,11 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
424
443
|
}
|
425
444
|
// 一直递归到最后一层子节点
|
426
445
|
if (item.children && item.children.length > 0) {
|
427
|
-
|
446
|
+
filterData(item.children);
|
428
447
|
}
|
429
448
|
}
|
430
449
|
};
|
431
|
-
|
450
|
+
filterData(treeList);
|
432
451
|
return result;
|
433
452
|
}
|
434
453
|
function getLabelByValue(treeList, nodeValue) {
|
@@ -565,7 +584,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
565
584
|
}
|
566
585
|
}, treeProps), {}, {
|
567
586
|
children: selectList.map(function (node) {
|
568
|
-
return
|
587
|
+
return renderTreeNode(node, 1);
|
569
588
|
})
|
570
589
|
}))
|
571
590
|
});
|
@@ -6,6 +6,6 @@ declare function SearchTitle(props: {
|
|
6
6
|
showEllipse?: boolean;
|
7
7
|
ellipseWidth?: string;
|
8
8
|
otherProps?: ProFormOtherProps;
|
9
|
-
}):
|
9
|
+
}): JSX.Element;
|
10
10
|
declare const _default: import("react").MemoExoticComponent<typeof SearchTitle>;
|
11
11
|
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):
|
26
|
+
declare function List(props: ListProps): JSX.Element;
|
27
27
|
export default List;
|