@zat-design/sisyphus-react 3.8.3-beta.19 → 3.8.3-beta.20
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 +0 -1
- package/dist/less.esm.css +0 -1
- 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 +9 -5
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +5 -5
- 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 +1 -2
- package/es/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/es/ProForm/components/base/Input/index.d.ts +1 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/es/ProForm/components/combination/FormList/utils.js +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +8 -8
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/es/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +1 -2
- package/es/ProForm/components/old/ProAddress/index.js +1 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +1 -2
- package/es/ProForm/components/render/ChangedWrapper.js +10 -6
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +3 -3
- package/es/ProForm/index.js +1 -1
- package/es/ProForm/style/index.less +0 -1
- package/es/ProForm/utils/index.js +14 -10
- package/es/ProForm/utils/useForm.js +1 -1
- package/es/ProIcon/utils/index.js +4 -3
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/es/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/es/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/es/ProLayout/index.d.ts +4 -4
- package/es/ProLayout/utils/index.js +9 -9
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProSelect/index.d.ts +1 -1
- package/es/ProStep/components/Anchor/index.d.ts +1 -1
- package/es/ProStep/components/Item/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +1 -1
- package/es/ProStep/components/Step/index.d.ts +1 -1
- package/es/ProStep/index.d.ts +2 -2
- package/es/ProStep/index.js +3 -3
- package/es/ProTable/components/FormatColumn/index.js +3 -3
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +9 -8
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/es/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/es/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/es/ProTable/components/TableResizable/index.d.ts +1 -1
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +2 -2
- package/es/ProTabs/components/Card/index.d.ts +1 -1
- package/es/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/es/ProThemeTools/index.d.ts +1 -1
- package/es/ProTooltip/index.d.ts +1 -1
- package/es/ProTree/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProTree/components/CloseIcon.d.ts +1 -2
- package/es/ProTree/components/List.d.ts +1 -1
- package/es/ProTree/components/ProTree.d.ts +1 -1
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +18 -18
- package/es/ProTree/components/SearchTitle.d.ts +1 -1
- package/es/ProTree/components/Tree.d.ts +1 -1
- package/es/ProTree/components/Tree.js +4 -4
- package/es/ProTree/index.d.ts +1 -1
- package/es/ProTree/utils.js +12 -11
- package/es/ProTreeModal/components/Cascader.d.ts +1 -1
- package/es/ProTreeModal/components/CloseIcon.d.ts +1 -2
- package/es/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/es/ProTreeModal/components/Tree.js +6 -6
- package/es/ProTreeModal/components/Trigger.d.ts +1 -1
- package/es/ProTreeModal/index.d.ts +1 -1
- package/es/ProTreeModal/index.js +3 -3
- package/es/ProTreeModal/utils.js +16 -14
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/es/ProUpload/components/ImageRender.js +1 -1
- package/es/ProViewer/index.js +2 -2
- package/es/old/ProEditableTable/index.js +4 -4
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +26 -0
- 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 +8 -6
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +5 -5
- 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 +1 -2
- package/lib/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/lib/ProForm/components/base/Input/index.d.ts +1 -1
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/lib/ProForm/components/combination/FormList/utils.js +1 -1
- package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +8 -8
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/lib/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/lib/ProForm/components/old/ProAddress/index.d.ts +1 -2
- package/lib/ProForm/components/old/ProAddress/index.js +1 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +1 -2
- package/lib/ProForm/components/render/ChangedWrapper.js +8 -4
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +3 -3
- package/lib/ProForm/index.js +1 -1
- package/lib/ProForm/style/index.less +0 -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.js +3 -3
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/lib/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/lib/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/lib/ProTable/components/TableResizable/index.d.ts +1 -1
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +2 -2
- package/lib/ProTabs/components/Card/index.d.ts +1 -1
- package/lib/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/lib/ProThemeTools/index.d.ts +1 -1
- package/lib/ProTooltip/index.d.ts +1 -1
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProTree/components/CloseIcon.d.ts +1 -2
- package/lib/ProTree/components/List.d.ts +1 -1
- package/lib/ProTree/components/ProTree.d.ts +1 -1
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +18 -18
- package/lib/ProTree/components/SearchTitle.d.ts +1 -1
- package/lib/ProTree/components/Tree.d.ts +1 -1
- package/lib/ProTree/components/Tree.js +4 -4
- package/lib/ProTree/index.d.ts +1 -1
- package/lib/ProTree/utils.js +11 -11
- package/lib/ProTreeModal/components/Cascader.d.ts +1 -1
- package/lib/ProTreeModal/components/CloseIcon.d.ts +1 -2
- package/lib/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/lib/ProTreeModal/components/Tree.js +6 -6
- package/lib/ProTreeModal/components/Trigger.d.ts +1 -1
- package/lib/ProTreeModal/index.d.ts +1 -1
- package/lib/ProTreeModal/index.js +3 -3
- package/lib/ProTreeModal/utils.js +13 -13
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/lib/ProUpload/components/ImageRender.js +1 -1
- package/lib/ProViewer/index.js +2 -2
- package/lib/old/ProEditableTable/index.js +4 -4
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +28 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ export default (function (_ref) {
|
|
|
14
14
|
var _useStep = useStep(),
|
|
15
15
|
notify = _useStep.notify;
|
|
16
16
|
return /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, props), {}, {
|
|
17
|
-
onClick: throttle(
|
|
17
|
+
onClick: throttle(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
18
18
|
var values;
|
|
19
19
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
20
20
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -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, excludes, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>;
|
|
11
11
|
};
|
|
12
12
|
export default ProStep;
|
package/es/ProStep/index.js
CHANGED
|
@@ -82,7 +82,7 @@ var ProStep = function ProStep(_ref) {
|
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
84
|
var subEvent = /*#__PURE__*/function () {
|
|
85
|
-
var _ref5 = _asyncToGenerator(
|
|
85
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
86
86
|
var value, _form$validateFields, _error$errorFields;
|
|
87
87
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
88
88
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -128,7 +128,7 @@ var ProStep = function ProStep(_ref) {
|
|
|
128
128
|
registerMap.current[id] = record;
|
|
129
129
|
};
|
|
130
130
|
var notify = /*#__PURE__*/function () {
|
|
131
|
-
var _ref6 = _asyncToGenerator(
|
|
131
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
132
132
|
var _ref7, excludes, triggerIds, events, res, nextErrorCollection;
|
|
133
133
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
134
134
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -167,7 +167,7 @@ var ProStep = function ProStep(_ref) {
|
|
|
167
167
|
};
|
|
168
168
|
}();
|
|
169
169
|
var triggerTo = /*#__PURE__*/function () {
|
|
170
|
-
var _ref9 = _asyncToGenerator(
|
|
170
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(keys) {
|
|
171
171
|
var events, result, nextErrorCollection;
|
|
172
172
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
173
173
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -528,14 +528,14 @@ export var getParentElement = function getParentElement(element, name) {
|
|
|
528
528
|
if (!element || !name) {
|
|
529
529
|
return result;
|
|
530
530
|
}
|
|
531
|
-
var
|
|
531
|
+
var _searchDom = function searchDom(element, name) {
|
|
532
532
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'className';
|
|
533
533
|
if (element.parentElement[type] === name) {
|
|
534
534
|
result = element.parentElement;
|
|
535
535
|
return false;
|
|
536
536
|
}
|
|
537
|
-
|
|
537
|
+
_searchDom(element.parentElement, name, type = 'className');
|
|
538
538
|
};
|
|
539
|
-
|
|
539
|
+
_searchDom(element, name, type = 'className');
|
|
540
540
|
return result;
|
|
541
541
|
};
|
package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js
CHANGED
|
@@ -74,7 +74,7 @@ var DndWrapper = function DndWrapper(_ref2) {
|
|
|
74
74
|
onDragStartGuard = _ref2.onDragStartGuard,
|
|
75
75
|
onDragEndGuard = _ref2.onDragEndGuard;
|
|
76
76
|
var onDragStart = /*#__PURE__*/function () {
|
|
77
|
-
var _ref4 = _asyncToGenerator(
|
|
77
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref3) {
|
|
78
78
|
var active, _transformedValue, activeObject;
|
|
79
79
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
80
80
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -105,7 +105,7 @@ var DndWrapper = function DndWrapper(_ref2) {
|
|
|
105
105
|
};
|
|
106
106
|
}();
|
|
107
107
|
var onDragEnd = /*#__PURE__*/function () {
|
|
108
|
-
var _ref6 = _asyncToGenerator(
|
|
108
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref5) {
|
|
109
109
|
var active, over, transformedValue, activeObject, overObject, activeLevel, activeParentId, overLevel, overParentId, nextDataSource, _flatTree, activeIndex, overIndex, nextValue;
|
|
110
110
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
111
111
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -9,7 +9,7 @@ export var getRowKey = function getRowKey(rowKey, record) {
|
|
|
9
9
|
}
|
|
10
10
|
return key;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
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,11 +18,12 @@ export 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 };
|
|
26
27
|
export function getFinalChildrenKey(tree, meta, options) {
|
|
27
28
|
if (typeof options.getChildrenKey === 'function') {
|
|
28
29
|
var dynamicChildrenKey = options.getChildrenKey(tree, meta);
|
|
@@ -33,7 +34,7 @@ export function getFinalChildrenKey(tree, meta, options) {
|
|
|
33
34
|
return options.childrenKey;
|
|
34
35
|
}
|
|
35
36
|
// 前置深度优先遍历
|
|
36
|
-
var
|
|
37
|
+
var _treeNodePreImpl = function treeNodePreImpl(treeItem, callback, options) {
|
|
37
38
|
var callbackResult = callback(treeItem, options);
|
|
38
39
|
if (callbackResult) {
|
|
39
40
|
return treeItem;
|
|
@@ -45,7 +46,7 @@ var treeNodePreImpl = function treeNodePreImpl(treeItem, callback, options) {
|
|
|
45
46
|
}
|
|
46
47
|
for (var i = 0, count = children.length; i < count; i++) {
|
|
47
48
|
var childItem = children[i];
|
|
48
|
-
var findOne =
|
|
49
|
+
var findOne = _treeNodePreImpl(childItem, callback, _objectSpread(_objectSpread({}, options), {}, {
|
|
49
50
|
parents: [].concat(_toConsumableArray(options.parents), [treeItem]),
|
|
50
51
|
depth: options.depth + 1
|
|
51
52
|
}));
|
|
@@ -56,7 +57,7 @@ var treeNodePreImpl = function treeNodePreImpl(treeItem, callback, options) {
|
|
|
56
57
|
return undefined;
|
|
57
58
|
};
|
|
58
59
|
var treeNodeStrategies = {
|
|
59
|
-
pre:
|
|
60
|
+
pre: _treeNodePreImpl
|
|
60
61
|
};
|
|
61
62
|
export function treeNodeFind(tree, callback, options) {
|
|
62
63
|
var _options$childrenKey, _options$strategy;
|
|
@@ -121,7 +122,7 @@ export function createTreeFromArray(array, options) {
|
|
|
121
122
|
return result;
|
|
122
123
|
}
|
|
123
124
|
// 前置遍历
|
|
124
|
-
var
|
|
125
|
+
var _treeForEachPreImpl = function treeForEachPreImpl(treeItem, callback, options) {
|
|
125
126
|
callback(treeItem, options);
|
|
126
127
|
var finalChildrenKey = getFinalChildrenKey(treeItem, options, options);
|
|
127
128
|
var children = treeItem === null || treeItem === void 0 ? void 0 : treeItem[finalChildrenKey];
|
|
@@ -131,12 +132,12 @@ var treeForEachPreImpl = function treeForEachPreImpl(treeItem, callback, options
|
|
|
131
132
|
depth: options.depth + 1
|
|
132
133
|
});
|
|
133
134
|
children.forEach(function (childItem) {
|
|
134
|
-
|
|
135
|
+
_treeForEachPreImpl(childItem, callback, nextLevelOptions);
|
|
135
136
|
});
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
139
|
var treeForEachStrategies = {
|
|
139
|
-
pre:
|
|
140
|
+
pre: _treeForEachPreImpl
|
|
140
141
|
};
|
|
141
142
|
export function treeForEach(tree, callback, options) {
|
|
142
143
|
var _options$childrenKey2, _options$strategy2;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const RenderFooter: (props: any) => JSX.Element;
|
|
1
|
+
declare const RenderFooter: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default RenderFooter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const RenderTableHeader: (props: any) => JSX.Element;
|
|
1
|
+
declare const RenderTableHeader: (props: any) => import("react/jsx-runtime").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(
|
|
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(
|
|
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(
|
|
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): 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/index.js
CHANGED
|
@@ -246,7 +246,7 @@ function ProTable(props) {
|
|
|
246
246
|
_scroll = props === null || props === void 0 ? void 0 : props.scroll;
|
|
247
247
|
}
|
|
248
248
|
var handleColumnConfig = /*#__PURE__*/function () {
|
|
249
|
-
var _ref6 = _asyncToGenerator(
|
|
249
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(checkList) {
|
|
250
250
|
var newColumns, _columnConfig$onColum, catchColumns;
|
|
251
251
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
252
252
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -355,7 +355,7 @@ function ProTable(props) {
|
|
|
355
355
|
return _rowSelection;
|
|
356
356
|
};
|
|
357
357
|
var onDataSourceChange = /*#__PURE__*/function () {
|
|
358
|
-
var _ref7 = _asyncToGenerator(
|
|
358
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(nextDataSource) {
|
|
359
359
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
360
360
|
while (1) switch (_context2.prev = _context2.next) {
|
|
361
361
|
case 0:
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DevToolsPropsType } from '../../propsType';
|
|
2
|
-
declare const ProTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => JSX.Element;
|
|
2
|
+
declare const ProTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => import("react/jsx-runtime").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): 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;
|
|
@@ -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(
|
|
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) => 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;
|
|
@@ -108,14 +108,14 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
108
108
|
}
|
|
109
109
|
var count = 0;
|
|
110
110
|
var result = [];
|
|
111
|
-
var
|
|
111
|
+
var _loopCount = function loopCount(data) {
|
|
112
112
|
data.map(function (item) {
|
|
113
113
|
count += 1;
|
|
114
114
|
var children = item.children,
|
|
115
115
|
other = _objectWithoutProperties(item, _excluded2);
|
|
116
116
|
result.push(_objectSpread({}, other));
|
|
117
117
|
if (item.children) {
|
|
118
|
-
|
|
118
|
+
_loopCount(item.children);
|
|
119
119
|
}
|
|
120
120
|
return item;
|
|
121
121
|
});
|
|
@@ -123,7 +123,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
123
123
|
if ((dictsEnum === null || dictsEnum === void 0 ? void 0 : dictsEnum.length) > 10) {
|
|
124
124
|
return dictsEnum;
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
_loopCount(dictsEnum);
|
|
127
127
|
if (count <= 10) {
|
|
128
128
|
return result;
|
|
129
129
|
}
|
|
@@ -137,17 +137,17 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
137
137
|
*/
|
|
138
138
|
var transferDataSource = function transferDataSource(dataArr, showCodeAndName) {
|
|
139
139
|
var copyData = cloneDeep(dataArr);
|
|
140
|
-
var
|
|
140
|
+
var _loop = function loop(arr) {
|
|
141
141
|
arr.map(function (item) {
|
|
142
142
|
item[label] = "".concat(item[code], "-").concat(item[label]);
|
|
143
143
|
if (item.children) {
|
|
144
|
-
|
|
144
|
+
_loop(item.children);
|
|
145
145
|
}
|
|
146
146
|
return item;
|
|
147
147
|
});
|
|
148
148
|
};
|
|
149
149
|
if (showCodeAndName) {
|
|
150
|
-
|
|
150
|
+
_loop(copyData);
|
|
151
151
|
}
|
|
152
152
|
return copyData;
|
|
153
153
|
};
|
|
@@ -241,19 +241,19 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
241
241
|
return viewEmpty;
|
|
242
242
|
}
|
|
243
243
|
var labelResult = [];
|
|
244
|
-
var
|
|
244
|
+
var _queryLabel = function queryLabel(dicts) {
|
|
245
245
|
return dicts.map(function (item) {
|
|
246
246
|
if (value.includes(item[code])) {
|
|
247
247
|
var labelText = item[label];
|
|
248
248
|
labelResult.push(labelText);
|
|
249
249
|
}
|
|
250
250
|
if (item.children) {
|
|
251
|
-
|
|
251
|
+
_queryLabel(item.children);
|
|
252
252
|
}
|
|
253
253
|
return item;
|
|
254
254
|
});
|
|
255
255
|
};
|
|
256
|
-
|
|
256
|
+
_queryLabel(origDataSource);
|
|
257
257
|
return labelResult === null || labelResult === void 0 ? void 0 : labelResult.join(',');
|
|
258
258
|
};
|
|
259
259
|
// 纯展示处理
|
|
@@ -291,7 +291,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
291
291
|
* @param node 每个节点数据对象
|
|
292
292
|
* @returns 整个react节点树
|
|
293
293
|
*/
|
|
294
|
-
var
|
|
294
|
+
var _renderTreeNode = function renderTreeNode(node, grade) {
|
|
295
295
|
var children = node.children,
|
|
296
296
|
icon = node.icon;
|
|
297
297
|
var labelText = node[label];
|
|
@@ -362,7 +362,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
362
362
|
checkable: node.checkable,
|
|
363
363
|
className: "node-val-".concat(value),
|
|
364
364
|
children: children.map(function (child) {
|
|
365
|
-
return
|
|
365
|
+
return _renderTreeNode(child, sonGrade);
|
|
366
366
|
})
|
|
367
367
|
}, key);
|
|
368
368
|
};
|
|
@@ -373,7 +373,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
373
373
|
* @returns 处理后得树
|
|
374
374
|
*/
|
|
375
375
|
function filterTree(sourceList, keyWord) {
|
|
376
|
-
var
|
|
376
|
+
var _filterData = function filterData(data) {
|
|
377
377
|
var currentAllNodeChild = []; // 记录当前节点得所有子节点
|
|
378
378
|
// 遍历数组
|
|
379
379
|
for (var i = 0; i < data.length; i++) {
|
|
@@ -381,7 +381,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
381
381
|
// 一直递归到最后一层子节点
|
|
382
382
|
var currentNodeChild = []; // 记录当前节点下得子节点匹配到的节点个数
|
|
383
383
|
if (item.children && item.children.length > 0) {
|
|
384
|
-
currentNodeChild =
|
|
384
|
+
currentNodeChild = _filterData(item.children);
|
|
385
385
|
}
|
|
386
386
|
// 迭代完子节点向上回溯,如果有匹配到得子节点,那么加入当前节点得孩子对象上,否则加入得是空数组
|
|
387
387
|
item.children = currentNodeChild;
|
|
@@ -395,7 +395,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
395
395
|
}
|
|
396
396
|
return currentAllNodeChild;
|
|
397
397
|
};
|
|
398
|
-
sourceList =
|
|
398
|
+
sourceList = _filterData(sourceList);
|
|
399
399
|
return sourceList;
|
|
400
400
|
}
|
|
401
401
|
var searchTreeEvent = function searchTreeEvent(searchVal) {
|
|
@@ -412,7 +412,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
412
412
|
};
|
|
413
413
|
function findTreeNode(treeList, nodeValue) {
|
|
414
414
|
var result = {};
|
|
415
|
-
var
|
|
415
|
+
var _filterData2 = function filterData(data) {
|
|
416
416
|
for (var i = 0; i < data.length; i++) {
|
|
417
417
|
var item = data[i];
|
|
418
418
|
if (item[code] === nodeValue || Array.isArray(nodeValue) && nodeValue.includes(item[code])) {
|
|
@@ -424,11 +424,11 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
424
424
|
}
|
|
425
425
|
// 一直递归到最后一层子节点
|
|
426
426
|
if (item.children && item.children.length > 0) {
|
|
427
|
-
|
|
427
|
+
_filterData2(item.children);
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
};
|
|
431
|
-
|
|
431
|
+
_filterData2(treeList);
|
|
432
432
|
return result;
|
|
433
433
|
}
|
|
434
434
|
function getLabelByValue(treeList, nodeValue) {
|
|
@@ -565,7 +565,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
565
565
|
}
|
|
566
566
|
}, treeProps), {}, {
|
|
567
567
|
children: selectList.map(function (node) {
|
|
568
|
-
return
|
|
568
|
+
return _renderTreeNode(node, 1);
|
|
569
569
|
})
|
|
570
570
|
}))
|
|
571
571
|
});
|
|
@@ -6,6 +6,6 @@ declare function SearchTitle(props: {
|
|
|
6
6
|
showEllipse?: boolean;
|
|
7
7
|
ellipseWidth?: string;
|
|
8
8
|
otherProps?: ProFormOtherProps;
|
|
9
|
-
}): JSX.Element;
|
|
9
|
+
}): import("react/jsx-runtime").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): JSX.Element;
|
|
26
|
+
declare function List(props: ListProps): import("react/jsx-runtime").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(
|
|
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
|
-
|
|
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;
|