@zat-design/sisyphus-react 3.8.0-beat.9 → 3.8.0-beta.16
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 +7 -51
- package/dist/less.esm.css +7 -51
- package/es/ProAction/index.js +5 -5
- package/es/ProDownload/index.d.ts +1 -1
- package/es/ProDownload/index.js +3 -3
- package/es/ProDownload/utils.js +3 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/es/ProDrawerForm/components/ProModal/index.js +3 -3
- package/es/ProEditLabel/index.js +3 -3
- package/es/ProEditTable/components/ActionButton/index.d.ts +1 -1
- package/es/ProEditTable/components/ActionButton/index.js +3 -3
- package/es/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +7 -3
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +9 -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/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 +1 -1
- package/es/ProEnum/utils/eventCenter.js +2 -1
- package/es/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/es/ProForm/components/FormFooter/index.js +6 -4
- package/es/ProForm/components/base/Input/index.d.ts +1 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/es/ProForm/components/combination/FormList/utils.js +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +8 -8
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/es/ProForm/components/combination/ProNumberRange/index.js +51 -47
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +51 -56
- 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 +4 -2
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +4 -3
- package/es/ProForm/index.js +1 -1
- 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 +2 -1
- package/es/ProTable/components/FormatColumn/index.js +15 -12
- 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/RenderFooter/index.d.ts +1 -1
- package/es/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/es/ProTable/components/TableResizable/index.d.ts +1 -1
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +13 -3
- package/es/ProTable/propsType.d.ts +4 -0
- 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 +18 -21
- 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/lib/ProAction/index.js +5 -5
- package/lib/ProDownload/index.d.ts +1 -1
- package/lib/ProDownload/index.js +3 -3
- package/lib/ProDownload/utils.js +3 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/lib/ProDrawerForm/components/ProModal/index.js +3 -3
- package/lib/ProEditLabel/index.js +3 -3
- package/lib/ProEditTable/components/ActionButton/index.d.ts +1 -1
- package/lib/ProEditTable/components/ActionButton/index.js +3 -3
- package/lib/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +7 -3
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +9 -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/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 +1 -1
- package/lib/ProEnum/utils/eventCenter.js +2 -1
- package/lib/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/lib/ProForm/components/FormFooter/index.js +5 -3
- package/lib/ProForm/components/base/Input/index.d.ts +1 -1
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/lib/ProForm/components/combination/FormList/utils.js +1 -1
- package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +8 -8
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/lib/ProForm/components/combination/ProNumberRange/index.js +45 -45
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +51 -56
- 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 +4 -2
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +4 -3
- package/lib/ProForm/index.js +1 -1
- 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 +2 -1
- package/lib/ProTable/components/FormatColumn/index.js +15 -12
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/lib/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/lib/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/lib/ProTable/components/TableResizable/index.d.ts +1 -1
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +13 -3
- package/lib/ProTable/propsType.d.ts +4 -0
- 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 +18 -21
- 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/package.json +1 -1
|
@@ -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;
|
|
@@ -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
|
@@ -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;
|
package/es/ProTable/index.js
CHANGED
|
@@ -56,6 +56,15 @@ function ProTable(props) {
|
|
|
56
56
|
onDragStartGuard = props.onDragStart,
|
|
57
57
|
onDragEndGuard = props.onDragEnd,
|
|
58
58
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
59
|
+
var _props$scrollFollowPa = props.scrollFollowParent,
|
|
60
|
+
scrollFollowParent = _props$scrollFollowPa === void 0 ? true : _props$scrollFollowPa;
|
|
61
|
+
var wrapToolTipProps = {
|
|
62
|
+
getPopupContainer: scrollFollowParent ? function (triggerNode) {
|
|
63
|
+
return triggerNode.parentNode;
|
|
64
|
+
} : function () {
|
|
65
|
+
return document.body;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
59
68
|
var _ref3 = diffConfig || {},
|
|
60
69
|
originalDataSource = _ref3.originalDataSource,
|
|
61
70
|
changeTipColor = _ref3.changeTipColor,
|
|
@@ -198,7 +207,8 @@ function ProTable(props) {
|
|
|
198
207
|
originalObj: originalObj,
|
|
199
208
|
dataSourceObj: dataSourceObj,
|
|
200
209
|
rowKey: 'rowKey',
|
|
201
|
-
diffToolTip: toolTip
|
|
210
|
+
diffToolTip: toolTip,
|
|
211
|
+
wrapToolTipProps: wrapToolTipProps
|
|
202
212
|
});
|
|
203
213
|
});
|
|
204
214
|
return newColumns;
|
|
@@ -216,7 +226,7 @@ function ProTable(props) {
|
|
|
216
226
|
});
|
|
217
227
|
}, [columns]);
|
|
218
228
|
var handleColumnConfig = /*#__PURE__*/function () {
|
|
219
|
-
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(checkList) {
|
|
229
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(checkList) {
|
|
220
230
|
var newColumns, _columnConfig$onColum, catchColumns;
|
|
221
231
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
222
232
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -325,7 +335,7 @@ function ProTable(props) {
|
|
|
325
335
|
return _rowSelection;
|
|
326
336
|
};
|
|
327
337
|
var onDataSourceChange = /*#__PURE__*/function () {
|
|
328
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(nextDataSource) {
|
|
338
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(nextDataSource) {
|
|
329
339
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
330
340
|
while (1) switch (_context2.prev = _context2.next) {
|
|
331
341
|
case 0:
|
|
@@ -103,6 +103,10 @@ export interface ProTableProps<T = any> extends Omit<TableProps<any>, 'summary'
|
|
|
103
103
|
*/
|
|
104
104
|
onDragStart?: DragStartGuardProps;
|
|
105
105
|
onDragEnd?: DragEndGuardProps;
|
|
106
|
+
/**
|
|
107
|
+
* 滚动额外配置
|
|
108
|
+
*/
|
|
109
|
+
scrollFollowParent?: boolean;
|
|
106
110
|
}
|
|
107
111
|
export type ProTableValueType = 'percentage' | 'permillage' | 'thousandth' | 'datePicker' | 'enumName' | 'enumCodeName' | 'address' | 'thousandthCNY' | 'date' | 'dateTime' | 'dateStartTime' | 'dateEndTime' | 'dateStartEndTime';
|
|
108
112
|
export interface Response<T = any> {
|
|
@@ -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;
|
|
@@ -79,9 +79,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
79
79
|
showEllipse = _props$showEllipse === void 0 ? true : _props$showEllipse;
|
|
80
80
|
var _ref2 = otherProps !== null && otherProps !== void 0 ? otherProps : {},
|
|
81
81
|
isDiffChange = _ref2.isDiffChange;
|
|
82
|
-
console.log('tag1', showEllipse, otherProps, isDiffChange);
|
|
83
82
|
var _showEllipse = showEllipse && !isDiffChange;
|
|
84
|
-
console.log('tag2', _showEllipse);
|
|
85
83
|
var _ref3 = otherProps || {},
|
|
86
84
|
isView = _ref3.isView,
|
|
87
85
|
viewEmpty = _ref3.viewEmpty;
|
|
@@ -110,14 +108,14 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
110
108
|
}
|
|
111
109
|
var count = 0;
|
|
112
110
|
var result = [];
|
|
113
|
-
var
|
|
111
|
+
var loopCount = function loopCount(data) {
|
|
114
112
|
data.map(function (item) {
|
|
115
113
|
count += 1;
|
|
116
114
|
var children = item.children,
|
|
117
115
|
other = _objectWithoutProperties(item, _excluded2);
|
|
118
116
|
result.push(_objectSpread({}, other));
|
|
119
117
|
if (item.children) {
|
|
120
|
-
|
|
118
|
+
loopCount(item.children);
|
|
121
119
|
}
|
|
122
120
|
return item;
|
|
123
121
|
});
|
|
@@ -125,7 +123,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
125
123
|
if ((dictsEnum === null || dictsEnum === void 0 ? void 0 : dictsEnum.length) > 10) {
|
|
126
124
|
return dictsEnum;
|
|
127
125
|
}
|
|
128
|
-
|
|
126
|
+
loopCount(dictsEnum);
|
|
129
127
|
if (count <= 10) {
|
|
130
128
|
return result;
|
|
131
129
|
}
|
|
@@ -139,17 +137,17 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
139
137
|
*/
|
|
140
138
|
var transferDataSource = function transferDataSource(dataArr, showCodeAndName) {
|
|
141
139
|
var copyData = cloneDeep(dataArr);
|
|
142
|
-
var
|
|
140
|
+
var loop = function loop(arr) {
|
|
143
141
|
arr.map(function (item) {
|
|
144
142
|
item[label] = "".concat(item[code], "-").concat(item[label]);
|
|
145
143
|
if (item.children) {
|
|
146
|
-
|
|
144
|
+
loop(item.children);
|
|
147
145
|
}
|
|
148
146
|
return item;
|
|
149
147
|
});
|
|
150
148
|
};
|
|
151
149
|
if (showCodeAndName) {
|
|
152
|
-
|
|
150
|
+
loop(copyData);
|
|
153
151
|
}
|
|
154
152
|
return copyData;
|
|
155
153
|
};
|
|
@@ -243,19 +241,19 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
243
241
|
return viewEmpty;
|
|
244
242
|
}
|
|
245
243
|
var labelResult = [];
|
|
246
|
-
var
|
|
244
|
+
var queryLabel = function queryLabel(dicts) {
|
|
247
245
|
return dicts.map(function (item) {
|
|
248
246
|
if (value.includes(item[code])) {
|
|
249
247
|
var labelText = item[label];
|
|
250
248
|
labelResult.push(labelText);
|
|
251
249
|
}
|
|
252
250
|
if (item.children) {
|
|
253
|
-
|
|
251
|
+
queryLabel(item.children);
|
|
254
252
|
}
|
|
255
253
|
return item;
|
|
256
254
|
});
|
|
257
255
|
};
|
|
258
|
-
|
|
256
|
+
queryLabel(origDataSource);
|
|
259
257
|
return labelResult === null || labelResult === void 0 ? void 0 : labelResult.join(',');
|
|
260
258
|
};
|
|
261
259
|
// 纯展示处理
|
|
@@ -293,7 +291,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
293
291
|
* @param node 每个节点数据对象
|
|
294
292
|
* @returns 整个react节点树
|
|
295
293
|
*/
|
|
296
|
-
var
|
|
294
|
+
var renderTreeNode = function renderTreeNode(node, grade) {
|
|
297
295
|
var children = node.children,
|
|
298
296
|
icon = node.icon;
|
|
299
297
|
var labelText = node[label];
|
|
@@ -331,7 +329,6 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
331
329
|
}) : null]
|
|
332
330
|
});
|
|
333
331
|
if (_showEllipse) {
|
|
334
|
-
console.log('tag3', '走自身气泡了');
|
|
335
332
|
title = _jsx(AdaptiveTooltip, {
|
|
336
333
|
children: treeCheckable ? titleHtml : _jsxs("span", {
|
|
337
334
|
className: "check-option-text",
|
|
@@ -365,7 +362,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
365
362
|
checkable: node.checkable,
|
|
366
363
|
className: "node-val-".concat(value),
|
|
367
364
|
children: children.map(function (child) {
|
|
368
|
-
return
|
|
365
|
+
return renderTreeNode(child, sonGrade);
|
|
369
366
|
})
|
|
370
367
|
}, key);
|
|
371
368
|
};
|
|
@@ -376,7 +373,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
376
373
|
* @returns 处理后得树
|
|
377
374
|
*/
|
|
378
375
|
function filterTree(sourceList, keyWord) {
|
|
379
|
-
var
|
|
376
|
+
var filterData = function filterData(data) {
|
|
380
377
|
var currentAllNodeChild = []; // 记录当前节点得所有子节点
|
|
381
378
|
// 遍历数组
|
|
382
379
|
for (var i = 0; i < data.length; i++) {
|
|
@@ -384,7 +381,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
384
381
|
// 一直递归到最后一层子节点
|
|
385
382
|
var currentNodeChild = []; // 记录当前节点下得子节点匹配到的节点个数
|
|
386
383
|
if (item.children && item.children.length > 0) {
|
|
387
|
-
currentNodeChild =
|
|
384
|
+
currentNodeChild = filterData(item.children);
|
|
388
385
|
}
|
|
389
386
|
// 迭代完子节点向上回溯,如果有匹配到得子节点,那么加入当前节点得孩子对象上,否则加入得是空数组
|
|
390
387
|
item.children = currentNodeChild;
|
|
@@ -398,7 +395,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
398
395
|
}
|
|
399
396
|
return currentAllNodeChild;
|
|
400
397
|
};
|
|
401
|
-
sourceList =
|
|
398
|
+
sourceList = filterData(sourceList);
|
|
402
399
|
return sourceList;
|
|
403
400
|
}
|
|
404
401
|
var searchTreeEvent = function searchTreeEvent(searchVal) {
|
|
@@ -415,7 +412,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
415
412
|
};
|
|
416
413
|
function findTreeNode(treeList, nodeValue) {
|
|
417
414
|
var result = {};
|
|
418
|
-
var
|
|
415
|
+
var filterData = function filterData(data) {
|
|
419
416
|
for (var i = 0; i < data.length; i++) {
|
|
420
417
|
var item = data[i];
|
|
421
418
|
if (item[code] === nodeValue || Array.isArray(nodeValue) && nodeValue.includes(item[code])) {
|
|
@@ -427,11 +424,11 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
427
424
|
}
|
|
428
425
|
// 一直递归到最后一层子节点
|
|
429
426
|
if (item.children && item.children.length > 0) {
|
|
430
|
-
|
|
427
|
+
filterData(item.children);
|
|
431
428
|
}
|
|
432
429
|
}
|
|
433
430
|
};
|
|
434
|
-
|
|
431
|
+
filterData(treeList);
|
|
435
432
|
return result;
|
|
436
433
|
}
|
|
437
434
|
function getLabelByValue(treeList, nodeValue) {
|
|
@@ -568,7 +565,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
568
565
|
}
|
|
569
566
|
}, treeProps), {}, {
|
|
570
567
|
children: selectList.map(function (node) {
|
|
571
|
-
return
|
|
568
|
+
return renderTreeNode(node, 1);
|
|
572
569
|
})
|
|
573
570
|
}))
|
|
574
571
|
});
|
|
@@ -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;
|
|
@@ -110,7 +110,7 @@ function List(props) {
|
|
|
110
110
|
}
|
|
111
111
|
}, [selectedKey]);
|
|
112
112
|
var onSelect = /*#__PURE__*/function () {
|
|
113
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, item) {
|
|
113
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, item) {
|
|
114
114
|
var _props$onSelect;
|
|
115
115
|
var val;
|
|
116
116
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -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
|
-
var
|
|
53
|
+
export 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,17 +59,16 @@ 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 };
|
|
70
69
|
export function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
71
70
|
var result = [];
|
|
72
|
-
var
|
|
71
|
+
var traverse = function traverse(node, parents) {
|
|
73
72
|
if (node[fieldNames.value] === key) {
|
|
74
73
|
result.push.apply(result, [node].concat(_toConsumableArray(parents)));
|
|
75
74
|
return true;
|
|
@@ -80,7 +79,7 @@ export function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
|
80
79
|
try {
|
|
81
80
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
82
81
|
var child = _step.value;
|
|
83
|
-
if (
|
|
82
|
+
if (traverse(child, [node].concat(_toConsumableArray(parents)))) {
|
|
84
83
|
return true;
|
|
85
84
|
}
|
|
86
85
|
}
|
|
@@ -96,7 +95,7 @@ export function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
|
96
95
|
try {
|
|
97
96
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
98
97
|
var node = _step2.value;
|
|
99
|
-
|
|
98
|
+
traverse(node, []);
|
|
100
99
|
}
|
|
101
100
|
} catch (err) {
|
|
102
101
|
_iterator2.e(err);
|
|
@@ -115,23 +114,23 @@ export function filterCheckedNodes(data, checkedKeys) {
|
|
|
115
114
|
var searchStr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
116
115
|
var fieldNames = arguments.length > 3 ? arguments[3] : undefined;
|
|
117
116
|
var result = [];
|
|
118
|
-
var
|
|
117
|
+
var traverse = function traverse(node) {
|
|
119
118
|
var _node$fieldNames$chil3;
|
|
120
119
|
var title = node[fieldNames.value] + node[fieldNames.label];
|
|
121
120
|
if (!searchStr) {
|
|
122
121
|
if (checkedKeys.includes(node[fieldNames.value])) {
|
|
123
122
|
var _node$fieldNames$chil;
|
|
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(
|
|
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(traverse).filter(Boolean)) || [];
|
|
125
124
|
return _objectSpread(_objectSpread({}, node), {}, _defineProperty({}, fieldNames.children, _children));
|
|
126
125
|
}
|
|
127
126
|
} else if ((title === null || title === void 0 ? void 0 : title.indexOf(searchStr)) > -1) {
|
|
128
127
|
var _node$fieldNames$chil2;
|
|
129
|
-
var _children2 = ((_node$fieldNames$chil2 = node[fieldNames.children]) === null || _node$fieldNames$chil2 === void 0 ? void 0 : _node$fieldNames$chil2.map(
|
|
128
|
+
var _children2 = ((_node$fieldNames$chil2 = node[fieldNames.children]) === null || _node$fieldNames$chil2 === void 0 ? void 0 : _node$fieldNames$chil2.map(traverse).filter(Boolean)) || [];
|
|
130
129
|
return _objectSpread(_objectSpread({}, node), {}, {
|
|
131
130
|
children: _children2
|
|
132
131
|
});
|
|
133
132
|
}
|
|
134
|
-
var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map(
|
|
133
|
+
var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map(traverse).filter(Boolean);
|
|
135
134
|
if (children && children.length > 0) {
|
|
136
135
|
return _objectSpread(_objectSpread({}, node), {}, _defineProperty({}, fieldNames.children, children));
|
|
137
136
|
}
|
|
@@ -143,7 +142,7 @@ export function filterCheckedNodes(data, checkedKeys) {
|
|
|
143
142
|
try {
|
|
144
143
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
145
144
|
var node = _step3.value;
|
|
146
|
-
var filtered =
|
|
145
|
+
var filtered = traverse(node);
|
|
147
146
|
if (filtered) {
|
|
148
147
|
result.push(filtered);
|
|
149
148
|
}
|
|
@@ -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) =>
|
|
13
|
+
declare const Cascader: (props: CascaderProps) => 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 loop = 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: loop(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 loop(treeData, -1);
|
|
174
174
|
}, [treeData]);
|
|
175
175
|
var onExpand = function onExpand(newExpandedKeys) {
|
|
176
176
|
setExpandedKeys(newExpandedKeys);
|