@zat-design/sisyphus-react 3.6.6-beta.5 → 3.6.6-beta.7
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 +9 -0
- package/dist/less.esm.css +9 -0
- package/es/ProAction/index.js +4 -4
- package/es/ProDownload/index.d.ts +1 -1
- package/es/ProEditTable/components/ActionButton/index.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderToolbar/index.js +8 -6
- package/es/ProEditTable/components/Summary/index.d.ts +1 -1
- package/es/ProEditTable/index.js +1 -1
- package/es/ProEditTable/propsType.d.ts +5 -0
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/tools.js +3 -3
- package/es/ProEnum/components/Group.d.ts +1 -1
- package/es/ProEnum/components/Tag.d.ts +1 -1
- package/es/ProEnum/index.d.ts +2 -2
- package/es/ProEnum/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/base/InputNumber/index.js +8 -2
- package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +7 -7
- package/es/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +1 -2
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +1 -2
- package/es/ProForm/utils/index.js +14 -10
- package/es/ProForm/utils/useWatch.d.ts +1 -2
- package/es/ProIcon/utils/index.js +4 -3
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/es/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/es/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/es/ProLayout/index.d.ts +4 -4
- package/es/ProLayout/utils/index.js +9 -9
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProSelect/index.d.ts +1 -1
- package/es/ProStep/components/Anchor/index.d.ts +1 -1
- package/es/ProStep/components/Item/index.d.ts +1 -1
- package/es/ProStep/components/Step/index.d.ts +1 -1
- package/es/ProStep/index.d.ts +2 -2
- package/es/ProTable/components/DndWrapper/index.d.ts +2 -1
- package/es/ProTable/components/DndWrapper/index.js +49 -10
- package/es/ProTable/components/DndWrapper/utils/index.d.ts +8 -0
- package/es/ProTable/components/DndWrapper/utils/index.js +165 -0
- package/es/ProTable/components/DndWrapper/utils/propsType.d.ts +61 -0
- package/es/ProTable/components/DndWrapper/utils/propsType.js +1 -0
- package/es/ProTable/components/ResizableLine/index.d.ts +1 -1
- package/es/ProTable/components/TableResizable/index.d.ts +1 -1
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +1 -0
- package/es/ProTable/style/index.less +9 -0
- package/es/ProTable/utils.js +3 -3
- package/es/ProTabs/components/Card/index.d.ts +1 -1
- package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/es/ProThemeTools/index.d.ts +1 -1
- package/es/ProTooltip/index.d.ts +1 -1
- package/es/ProTree/components/CloseIcon.d.ts +1 -2
- package/es/ProTree/components/List.d.ts +1 -1
- package/es/ProTree/components/ProTree.d.ts +1 -1
- package/es/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +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 +3 -3
- package/es/ProTree/index.d.ts +1 -1
- package/es/ProTree/utils.js +12 -11
- package/es/ProTreeModal/components/Cascader.d.ts +1 -1
- package/es/ProTreeModal/components/CloseIcon.d.ts +1 -2
- package/es/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/es/ProTreeModal/components/Tree.js +6 -6
- package/es/ProTreeModal/components/Trigger.d.ts +1 -1
- package/es/ProTreeModal/index.d.ts +1 -1
- package/es/ProTreeModal/utils.js +12 -11
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/lib/ProAction/index.js +4 -4
- package/lib/ProDownload/index.d.ts +1 -1
- package/lib/ProEditTable/components/ActionButton/index.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/BaseTable.d.ts +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/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderToolbar/index.js +7 -5
- package/lib/ProEditTable/components/Summary/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +1 -1
- package/lib/ProEditTable/propsType.d.ts +5 -0
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/tools.js +3 -3
- package/lib/ProEnum/components/Group.d.ts +1 -1
- package/lib/ProEnum/components/Tag.d.ts +1 -1
- package/lib/ProEnum/index.d.ts +2 -2
- package/lib/ProEnum/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/base/InputNumber/index.js +8 -2
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +7 -7
- package/lib/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/lib/ProForm/components/old/ProAddress/index.d.ts +1 -2
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +1 -2
- package/lib/ProForm/utils/index.js +10 -10
- package/lib/ProForm/utils/useWatch.d.ts +1 -2
- package/lib/ProIcon/utils/index.js +3 -3
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/lib/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/lib/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/lib/ProLayout/index.d.ts +4 -4
- package/lib/ProLayout/utils/index.js +9 -9
- package/lib/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProSelect/index.d.ts +1 -1
- package/lib/ProStep/components/Anchor/index.d.ts +1 -1
- package/lib/ProStep/components/Item/index.d.ts +1 -1
- package/lib/ProStep/components/Step/index.d.ts +1 -1
- package/lib/ProStep/index.d.ts +2 -2
- package/lib/ProTable/components/DndWrapper/index.d.ts +2 -1
- package/lib/ProTable/components/DndWrapper/index.js +48 -9
- package/lib/ProTable/components/DndWrapper/utils/index.d.ts +8 -0
- package/lib/ProTable/components/DndWrapper/utils/index.js +177 -0
- package/lib/ProTable/components/DndWrapper/utils/propsType.d.ts +61 -0
- package/lib/ProTable/components/DndWrapper/utils/propsType.js +5 -0
- package/lib/ProTable/components/ResizableLine/index.d.ts +1 -1
- package/lib/ProTable/components/TableResizable/index.d.ts +1 -1
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +1 -0
- package/lib/ProTable/style/index.less +9 -0
- package/lib/ProTable/utils.js +3 -3
- package/lib/ProTabs/components/Card/index.d.ts +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/lib/ProThemeTools/index.d.ts +1 -1
- package/lib/ProTooltip/index.d.ts +1 -1
- package/lib/ProTree/components/CloseIcon.d.ts +1 -2
- package/lib/ProTree/components/List.d.ts +1 -1
- package/lib/ProTree/components/ProTree.d.ts +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +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 +3 -3
- package/lib/ProTree/index.d.ts +1 -1
- package/lib/ProTree/utils.js +11 -11
- package/lib/ProTreeModal/components/Cascader.d.ts +1 -1
- package/lib/ProTreeModal/components/CloseIcon.d.ts +1 -2
- package/lib/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/lib/ProTreeModal/components/Tree.js +6 -6
- package/lib/ProTreeModal/components/Trigger.d.ts +1 -1
- package/lib/ProTreeModal/index.d.ts +1 -1
- package/lib/ProTreeModal/utils.js +11 -11
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/package.json +2 -1
| @@ -0,0 +1,177 @@ | |
| 1 | 
            +
            "use strict";
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
         | 
| 4 | 
            +
            Object.defineProperty(exports, "__esModule", {
         | 
| 5 | 
            +
              value: true
         | 
| 6 | 
            +
            });
         | 
| 7 | 
            +
            exports.addLevelAndParentId = void 0;
         | 
| 8 | 
            +
            exports.createTreeFromArray = createTreeFromArray;
         | 
| 9 | 
            +
            exports.getFinalChildrenKey = getFinalChildrenKey;
         | 
| 10 | 
            +
            exports.getRowKey = void 0;
         | 
| 11 | 
            +
            exports.transformTreeToArray = transformTreeToArray;
         | 
| 12 | 
            +
            exports.treeForEach = treeForEach;
         | 
| 13 | 
            +
            exports.treeNodeFind = treeNodeFind;
         | 
| 14 | 
            +
            var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
         | 
| 15 | 
            +
            var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
         | 
| 16 | 
            +
            var getRowKey = exports.getRowKey = function getRowKey(rowKey, record) {
         | 
| 17 | 
            +
              // 默认取id
         | 
| 18 | 
            +
              var key = record.rowKey || 'id';
         | 
| 19 | 
            +
              if (rowKey) {
         | 
| 20 | 
            +
                var _ref;
         | 
| 21 | 
            +
                key = (_ref = typeof rowKey === 'function' ? rowKey(record) : record[rowKey]) !== null && _ref !== void 0 ? _ref : key;
         | 
| 22 | 
            +
              }
         | 
| 23 | 
            +
              return key;
         | 
| 24 | 
            +
            };
         | 
| 25 | 
            +
            var _addLevelAndParentId = exports.addLevelAndParentId = function addLevelAndParentId(tree, rowKey) {
         | 
| 26 | 
            +
              var currentLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
         | 
| 27 | 
            +
              var currentParentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
         | 
| 28 | 
            +
              return tree.map(function (node) {
         | 
| 29 | 
            +
                var newNode = (0, _objectSpread2.default)({}, node);
         | 
| 30 | 
            +
                newNode.level = currentLevel;
         | 
| 31 | 
            +
                newNode.parentId = currentParentId;
         | 
| 32 | 
            +
                newNode.rowKey = getRowKey(rowKey, node);
         | 
| 33 | 
            +
                if (node.children) {
         | 
| 34 | 
            +
                  newNode.children = _addLevelAndParentId(node.children, rowKey, currentLevel + 1, newNode.rowKey);
         | 
| 35 | 
            +
                }
         | 
| 36 | 
            +
                return newNode;
         | 
| 37 | 
            +
              });
         | 
| 38 | 
            +
            };
         | 
| 39 | 
            +
            function getFinalChildrenKey(tree, meta, options) {
         | 
| 40 | 
            +
              if (typeof options.getChildrenKey === 'function') {
         | 
| 41 | 
            +
                var dynamicChildrenKey = options.getChildrenKey(tree, meta);
         | 
| 42 | 
            +
                if (dynamicChildrenKey != null) {
         | 
| 43 | 
            +
                  return dynamicChildrenKey;
         | 
| 44 | 
            +
                }
         | 
| 45 | 
            +
              }
         | 
| 46 | 
            +
              return options.childrenKey;
         | 
| 47 | 
            +
            }
         | 
| 48 | 
            +
            // 前置深度优先遍历
         | 
| 49 | 
            +
            var _treeNodePreImpl = function treeNodePreImpl(treeItem, callback, options) {
         | 
| 50 | 
            +
              var callbackResult = callback(treeItem, options);
         | 
| 51 | 
            +
              if (callbackResult) {
         | 
| 52 | 
            +
                return treeItem;
         | 
| 53 | 
            +
              }
         | 
| 54 | 
            +
              var finalChildrenKey = getFinalChildrenKey(treeItem, options, options);
         | 
| 55 | 
            +
              var children = treeItem[finalChildrenKey];
         | 
| 56 | 
            +
              if (!children || !Array.isArray(children)) {
         | 
| 57 | 
            +
                return undefined;
         | 
| 58 | 
            +
              }
         | 
| 59 | 
            +
              for (var i = 0, count = children.length; i < count; i++) {
         | 
| 60 | 
            +
                var childItem = children[i];
         | 
| 61 | 
            +
                var findOne = _treeNodePreImpl(childItem, callback, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, options), {}, {
         | 
| 62 | 
            +
                  parents: [].concat((0, _toConsumableArray2.default)(options.parents), [treeItem]),
         | 
| 63 | 
            +
                  depth: options.depth + 1
         | 
| 64 | 
            +
                }));
         | 
| 65 | 
            +
                if (findOne) {
         | 
| 66 | 
            +
                  return findOne;
         | 
| 67 | 
            +
                }
         | 
| 68 | 
            +
              }
         | 
| 69 | 
            +
              return undefined;
         | 
| 70 | 
            +
            };
         | 
| 71 | 
            +
            var treeNodeStrategies = {
         | 
| 72 | 
            +
              pre: _treeNodePreImpl
         | 
| 73 | 
            +
            };
         | 
| 74 | 
            +
            function treeNodeFind(tree, callback, options) {
         | 
| 75 | 
            +
              var _options$childrenKey, _options$strategy;
         | 
| 76 | 
            +
              var childrenKey = (_options$childrenKey = options === null || options === void 0 ? void 0 : options.childrenKey) !== null && _options$childrenKey !== void 0 ? _options$childrenKey : 'children';
         | 
| 77 | 
            +
              var strategy = (_options$strategy = options === null || options === void 0 ? void 0 : options.strategy) !== null && _options$strategy !== void 0 ? _options$strategy : 'pre';
         | 
| 78 | 
            +
              var getChildrenKey = options === null || options === void 0 ? void 0 : options.getChildrenKey;
         | 
| 79 | 
            +
              var method = treeNodeStrategies[strategy];
         | 
| 80 | 
            +
              var innerOptions = {
         | 
| 81 | 
            +
                childrenKey: childrenKey,
         | 
| 82 | 
            +
                depth: 0,
         | 
| 83 | 
            +
                parents: [],
         | 
| 84 | 
            +
                getChildrenKey: getChildrenKey
         | 
| 85 | 
            +
              };
         | 
| 86 | 
            +
              if (Array.isArray(tree)) {
         | 
| 87 | 
            +
                for (var i = 0, count = tree.length; i < count; i++) {
         | 
| 88 | 
            +
                  var treeItem = tree[i];
         | 
| 89 | 
            +
                  var result = method(treeItem, callback, innerOptions);
         | 
| 90 | 
            +
                  if (result) {
         | 
| 91 | 
            +
                    return result;
         | 
| 92 | 
            +
                  }
         | 
| 93 | 
            +
                }
         | 
| 94 | 
            +
                return undefined;
         | 
| 95 | 
            +
              }
         | 
| 96 | 
            +
              return method(tree, callback, innerOptions);
         | 
| 97 | 
            +
            }
         | 
| 98 | 
            +
            function createTreeFromArray(array, options) {
         | 
| 99 | 
            +
              var result = [];
         | 
| 100 | 
            +
              var _ref2 = options || {},
         | 
| 101 | 
            +
                _ref2$parentKey = _ref2.parentKey,
         | 
| 102 | 
            +
                parentKey = _ref2$parentKey === void 0 ? 'pid' : _ref2$parentKey,
         | 
| 103 | 
            +
                _ref2$itemKey = _ref2.itemKey,
         | 
| 104 | 
            +
                itemKey = _ref2$itemKey === void 0 ? 'id' : _ref2$itemKey,
         | 
| 105 | 
            +
                _ref2$childrenKey = _ref2.childrenKey,
         | 
| 106 | 
            +
                childrenKey = _ref2$childrenKey === void 0 ? 'children' : _ref2$childrenKey;
         | 
| 107 | 
            +
              var map = new Map();
         | 
| 108 | 
            +
              array.map(function (item) {
         | 
| 109 | 
            +
                var itemKeyValue = item[itemKey];
         | 
| 110 | 
            +
                if (!map.get(itemKeyValue)) {
         | 
| 111 | 
            +
                  map.set(itemKeyValue, item);
         | 
| 112 | 
            +
                }
         | 
| 113 | 
            +
                return item;
         | 
| 114 | 
            +
              });
         | 
| 115 | 
            +
              array.map(function (item) {
         | 
| 116 | 
            +
                var parentKeyValue = item[parentKey];
         | 
| 117 | 
            +
                var parentItem = map.get(parentKeyValue);
         | 
| 118 | 
            +
                if (!parentItem || !parentKeyValue) {
         | 
| 119 | 
            +
                  result.push(item);
         | 
| 120 | 
            +
                  return;
         | 
| 121 | 
            +
                }
         | 
| 122 | 
            +
                var siblings = parentItem[childrenKey];
         | 
| 123 | 
            +
                if (siblings === null || siblings === undefined) {
         | 
| 124 | 
            +
                  // disable eslint tslint
         | 
| 125 | 
            +
                  parentItem[childrenKey] = [item];
         | 
| 126 | 
            +
                } else if (Array.isArray(siblings)) {
         | 
| 127 | 
            +
                  siblings.push(item);
         | 
| 128 | 
            +
                } else {
         | 
| 129 | 
            +
                  var msg = "the key \"".concat(childrenKey, "\" is not an array, please check your data");
         | 
| 130 | 
            +
                  throw new Error(msg);
         | 
| 131 | 
            +
                }
         | 
| 132 | 
            +
                return item;
         | 
| 133 | 
            +
              });
         | 
| 134 | 
            +
              return result;
         | 
| 135 | 
            +
            }
         | 
| 136 | 
            +
            // 前置遍历
         | 
| 137 | 
            +
            var _treeForEachPreImpl = function treeForEachPreImpl(treeItem, callback, options) {
         | 
| 138 | 
            +
              callback(treeItem, options);
         | 
| 139 | 
            +
              var finalChildrenKey = getFinalChildrenKey(treeItem, options, options);
         | 
| 140 | 
            +
              var children = treeItem[finalChildrenKey];
         | 
| 141 | 
            +
              if (children && Array.isArray(children)) {
         | 
| 142 | 
            +
                var nextLevelOptions = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, options), {}, {
         | 
| 143 | 
            +
                  parents: [].concat((0, _toConsumableArray2.default)(options.parents), [treeItem]),
         | 
| 144 | 
            +
                  depth: options.depth + 1
         | 
| 145 | 
            +
                });
         | 
| 146 | 
            +
                children.forEach(function (childItem) {
         | 
| 147 | 
            +
                  _treeForEachPreImpl(childItem, callback, nextLevelOptions);
         | 
| 148 | 
            +
                });
         | 
| 149 | 
            +
              }
         | 
| 150 | 
            +
            };
         | 
| 151 | 
            +
            var treeForEachStrategies = {
         | 
| 152 | 
            +
              pre: _treeForEachPreImpl
         | 
| 153 | 
            +
            };
         | 
| 154 | 
            +
            function treeForEach(tree, callback, options) {
         | 
| 155 | 
            +
              var _options$childrenKey2, _options$strategy2;
         | 
| 156 | 
            +
              var childrenKey = (_options$childrenKey2 = options === null || options === void 0 ? void 0 : options.childrenKey) !== null && _options$childrenKey2 !== void 0 ? _options$childrenKey2 : 'children';
         | 
| 157 | 
            +
              var strategy = (_options$strategy2 = options === null || options === void 0 ? void 0 : options.strategy) !== null && _options$strategy2 !== void 0 ? _options$strategy2 : 'pre';
         | 
| 158 | 
            +
              var getChildrenKey = options === null || options === void 0 ? void 0 : options.getChildrenKey;
         | 
| 159 | 
            +
              var isForest = Array.isArray(tree);
         | 
| 160 | 
            +
              var method = treeForEachStrategies[strategy];
         | 
| 161 | 
            +
              var innerOptions = {
         | 
| 162 | 
            +
                childrenKey: childrenKey,
         | 
| 163 | 
            +
                depth: 0,
         | 
| 164 | 
            +
                parents: [],
         | 
| 165 | 
            +
                getChildrenKey: getChildrenKey
         | 
| 166 | 
            +
              };
         | 
| 167 | 
            +
              isForest ? tree.forEach(function (tree) {
         | 
| 168 | 
            +
                method(tree, callback, innerOptions);
         | 
| 169 | 
            +
              }) : method(tree, callback, innerOptions);
         | 
| 170 | 
            +
            }
         | 
| 171 | 
            +
            function transformTreeToArray(tree, options) {
         | 
| 172 | 
            +
              var results = [];
         | 
| 173 | 
            +
              treeForEach(tree, function (t) {
         | 
| 174 | 
            +
                results.push(t);
         | 
| 175 | 
            +
              }, options);
         | 
| 176 | 
            +
              return results;
         | 
| 177 | 
            +
            }
         | 
| @@ -0,0 +1,61 @@ | |
| 1 | 
            +
            export type TreeKey = string | number;
         | 
| 2 | 
            +
            export type ChildrenKey = TreeKey;
         | 
| 3 | 
            +
            export type Tree<T extends ChildrenKey = 'children'> = {
         | 
| 4 | 
            +
                [key in T]?: Tree<T>[];
         | 
| 5 | 
            +
            } & {
         | 
| 6 | 
            +
                [key in TreeKey]: any;
         | 
| 7 | 
            +
            };
         | 
| 8 | 
            +
            export type Strategy = 'pre' | 'post' | 'breadth';
         | 
| 9 | 
            +
            export interface BaseOptions {
         | 
| 10 | 
            +
                itemKey?: String;
         | 
| 11 | 
            +
                parentKey?: String;
         | 
| 12 | 
            +
                childrenKey?: ChildrenKey;
         | 
| 13 | 
            +
                strategy?: Strategy;
         | 
| 14 | 
            +
                getChildrenKey?: (tree: Tree, meta: BaseCallbackMeta) => ChildrenKey | undefined;
         | 
| 15 | 
            +
            }
         | 
| 16 | 
            +
            export interface BaseInnerOptions<T extends ChildrenKey = 'children'> {
         | 
| 17 | 
            +
                childrenKey: ChildrenKey;
         | 
| 18 | 
            +
                parents: Tree<T>[];
         | 
| 19 | 
            +
                depth: number;
         | 
| 20 | 
            +
                getChildrenKey?: (tree: Tree, meta: BaseCallbackMeta) => ChildrenKey | undefined;
         | 
| 21 | 
            +
            }
         | 
| 22 | 
            +
            export interface BaseCallbackMeta<T extends ChildrenKey = 'children'> {
         | 
| 23 | 
            +
                depth: number;
         | 
| 24 | 
            +
                parents?: Tree<T>[];
         | 
| 25 | 
            +
            }
         | 
| 26 | 
            +
            export type FindOptions = BaseOptions;
         | 
| 27 | 
            +
            export type FindCallbackMeta<T extends ChildrenKey> = BaseCallbackMeta<T>;
         | 
| 28 | 
            +
            export type FindCallback<T extends ChildrenKey> = (treeItem: Tree<T>, meta: FindCallbackMeta<T>) => boolean | undefined;
         | 
| 29 | 
            +
            type FindInnerOption<T extends ChildrenKey> = BaseInnerOptions<T>;
         | 
| 30 | 
            +
            export type FindImpl<T extends ChildrenKey> = (treeItem: Tree<T>, callback: FindCallback<T>, options: FindInnerOption<T>) => Tree<T> | undefined;
         | 
| 31 | 
            +
            export interface QueueItem {
         | 
| 32 | 
            +
                tree: Tree<ChildrenKey>;
         | 
| 33 | 
            +
                options: FindInnerOption<ChildrenKey>;
         | 
| 34 | 
            +
            }
         | 
| 35 | 
            +
            export type TypeOfKey = string;
         | 
| 36 | 
            +
            export type KeyValue = string | number | undefined | null;
         | 
| 37 | 
            +
            export type ArrayItemWithParentKey<P extends TypeOfKey, K extends TypeOfKey> = Record<string, any> & {
         | 
| 38 | 
            +
                [key in P]?: KeyValue;
         | 
| 39 | 
            +
            } & {
         | 
| 40 | 
            +
                [key in K]?: KeyValue;
         | 
| 41 | 
            +
            };
         | 
| 42 | 
            +
            export type TreeWithParentKey<K extends TypeOfKey, P extends TypeOfKey, T extends ChildrenKey> = Record<string, any> & {
         | 
| 43 | 
            +
                [key in P]?: KeyValue;
         | 
| 44 | 
            +
            } & {
         | 
| 45 | 
            +
                [key in K]: KeyValue;
         | 
| 46 | 
            +
            } & {
         | 
| 47 | 
            +
                [key in T]?: TreeWithParentKey<K, P, T>[];
         | 
| 48 | 
            +
            };
         | 
| 49 | 
            +
            export interface FromArrayOptions {
         | 
| 50 | 
            +
                parentKey?: TypeOfKey;
         | 
| 51 | 
            +
                itemKey?: TypeOfKey;
         | 
| 52 | 
            +
                childrenKey?: ChildrenKey;
         | 
| 53 | 
            +
            }
         | 
| 54 | 
            +
            export type FromArray<K extends TypeOfKey, P extends TypeOfKey, T extends ChildrenKey> = (array: ArrayItemWithParentKey<K, P>[], options: FromArrayOptions) => TreeWithParentKey<K, P, T>[];
         | 
| 55 | 
            +
            export type ForeachOptions = BaseOptions;
         | 
| 56 | 
            +
            export type ForeachCallbackMeta<T extends ChildrenKey> = BaseCallbackMeta<T>;
         | 
| 57 | 
            +
            export type ForeachCallback<T extends ChildrenKey> = (treeItem: Tree<T>, meta: ForeachCallbackMeta<T>) => void;
         | 
| 58 | 
            +
            export type ForeachInnerOption<T extends ChildrenKey> = BaseInnerOptions<T>;
         | 
| 59 | 
            +
            export type ForeachImpl<T extends ChildrenKey> = (treeItem: Tree<T>, callback: ForeachCallback<T>, options: ForeachInnerOption<T>) => void;
         | 
| 60 | 
            +
            export type ToArrayOptions = ForeachOptions;
         | 
| 61 | 
            +
            export {};
         | 
| @@ -1,2 +1,2 @@ | |
| 1 | 
            -
            declare const ResizableLine: () => JSX.Element;
         | 
| 1 | 
            +
            declare const ResizableLine: () => import("react/jsx-runtime").JSX.Element;
         | 
| 2 2 | 
             
            export default ResizableLine;
         | 
    
        package/lib/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/lib/ProTable/index.js
    CHANGED
    
    | @@ -374,6 +374,7 @@ function ProTable(props) { | |
| 374 374 | 
             
                    onChange: onDataSourceChange,
         | 
| 375 375 | 
             
                    disabled: false,
         | 
| 376 376 | 
             
                    draggable: draggable,
         | 
| 377 | 
            +
                    rowKey: rowKey,
         | 
| 377 378 | 
             
                    children: [(headerRender || columnConfig || resizeColumn) && (0, _jsxRuntime.jsxs)("div", {
         | 
| 378 379 | 
             
                      className: "column-config",
         | 
| 379 380 | 
             
                      children: [(0, _jsxRuntime.jsx)("div", {
         | 
| @@ -9,6 +9,15 @@ | |
| 9 9 | 
             
                  }
         | 
| 10 10 | 
             
                }
         | 
| 11 11 | 
             
              }
         | 
| 12 | 
            +
              .@{ant-prefix}-table-cell-with-append {
         | 
| 13 | 
            +
                white-space: nowrap;
         | 
| 14 | 
            +
                position: relative;
         | 
| 15 | 
            +
                z-index: 100;
         | 
| 16 | 
            +
              }
         | 
| 17 | 
            +
              .@{ant-prefix}-table-row-expand-icon {
         | 
| 18 | 
            +
                position: absolute;
         | 
| 19 | 
            +
                left: -16px;
         | 
| 20 | 
            +
              }
         | 
| 12 21 |  | 
| 13 22 | 
             
              .@{ant-prefix}-table-content {
         | 
| 14 23 | 
             
                >table {
         | 
    
        package/lib/ProTable/utils.js
    CHANGED
    
    | @@ -389,15 +389,15 @@ var getParentElement = exports.getParentElement = function getParentElement(elem | |
| 389 389 | 
             
              if (!element || !name) {
         | 
| 390 390 | 
             
                return result;
         | 
| 391 391 | 
             
              }
         | 
| 392 | 
            -
              var  | 
| 392 | 
            +
              var _searchDom = function searchDom(element, name) {
         | 
| 393 393 | 
             
                var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'className';
         | 
| 394 394 | 
             
                if (element.parentElement[type] === name) {
         | 
| 395 395 | 
             
                  result = element.parentElement;
         | 
| 396 396 | 
             
                  return false;
         | 
| 397 397 | 
             
                }
         | 
| 398 | 
            -
                 | 
| 398 | 
            +
                _searchDom(element.parentElement, name, type = 'className');
         | 
| 399 399 | 
             
              };
         | 
| 400 | 
            -
               | 
| 400 | 
            +
              _searchDom(element, name, type = 'className');
         | 
| 401 401 | 
             
              return result;
         | 
| 402 402 | 
             
            };
         | 
| 403 403 | 
             
            /**
         | 
| @@ -1,3 +1,3 @@ | |
| 1 1 | 
             
            import type { DevToolsPropsType } from '../../propsType';
         | 
| 2 | 
            -
            declare const PrdTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => JSX.Element;
         | 
| 2 | 
            +
            declare const PrdTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => import("react/jsx-runtime").JSX.Element;
         | 
| 3 3 | 
             
            export default PrdTools;
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            import type { ProThemeToolsProps } from './propsType';
         | 
| 2 2 | 
             
            declare const ProThemeTools: {
         | 
| 3 | 
            -
                ({ size, className, cacheTime, color, mode, iconFollowTheme, prefixCls, tableBorder, tableStripe, theme, onChange, ...props }: ProThemeToolsProps): JSX.Element;
         | 
| 3 | 
            +
                ({ size, className, cacheTime, color, mode, iconFollowTheme, prefixCls, tableBorder, tableStripe, theme, onChange, ...props }: ProThemeToolsProps): import("react/jsx-runtime").JSX.Element;
         | 
| 4 4 | 
             
                defaultProps: {
         | 
| 5 5 | 
             
                    size: number;
         | 
| 6 6 | 
             
                    mode: string;
         | 
| @@ -1,4 +1,4 @@ | |
| 1 1 | 
             
            import { ProTooltipPropsType } from './propsType';
         | 
| 2 2 | 
             
            import './style/index.less';
         | 
| 3 | 
            -
            declare const ProTooltip: (props: ProTooltipPropsType) => JSX.Element;
         | 
| 3 | 
            +
            declare const ProTooltip: (props: ProTooltipPropsType) => import("react/jsx-runtime").JSX.Element;
         | 
| 4 4 | 
             
            export default ProTooltip;
         | 
| @@ -12,6 +12,6 @@ interface ListProps { | |
| 12 12 | 
             
                handleFilterClose?: (code: string) => void;
         | 
| 13 13 | 
             
                optionRender?: (item: any, searchStr?: string) => string | ReactNode;
         | 
| 14 14 | 
             
            }
         | 
| 15 | 
            -
            declare function List(props: ListProps): JSX.Element;
         | 
| 15 | 
            +
            declare function List(props: ListProps): import("react/jsx-runtime").JSX.Element;
         | 
| 16 16 | 
             
            declare const _default: import("react").MemoExoticComponent<typeof List>;
         | 
| 17 17 | 
             
            export default _default;
         | 
| @@ -1,5 +1,5 @@ | |
| 1 1 | 
             
            import React from 'react';
         | 
| 2 2 | 
             
            import { PropTreeSelectProps } from './propsType';
         | 
| 3 | 
            -
            export declare const ProTreeSelect: (props: PropTreeSelectProps, ref: React.Ref<unknown> | undefined) => JSX.Element;
         | 
| 3 | 
            +
            export declare const ProTreeSelect: (props: PropTreeSelectProps, ref: React.Ref<unknown> | undefined) => import("react/jsx-runtime").JSX.Element;
         | 
| 4 4 | 
             
            declare const _default: React.ForwardRefExoticComponent<PropTreeSelectProps & React.RefAttributes<unknown>>;
         | 
| 5 5 | 
             
            export default _default;
         | 
| @@ -102,14 +102,14 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) { | |
| 102 102 | 
             
                }
         | 
| 103 103 | 
             
                var count = 0;
         | 
| 104 104 | 
             
                var result = [];
         | 
| 105 | 
            -
                var  | 
| 105 | 
            +
                var _loopCount = function loopCount(data) {
         | 
| 106 106 | 
             
                  data.map(function (item) {
         | 
| 107 107 | 
             
                    count += 1;
         | 
| 108 108 | 
             
                    var children = item.children,
         | 
| 109 109 | 
             
                      other = (0, _objectWithoutProperties2.default)(item, _excluded2);
         | 
| 110 110 | 
             
                    result.push((0, _objectSpread2.default)({}, other));
         | 
| 111 111 | 
             
                    if (item.children) {
         | 
| 112 | 
            -
                       | 
| 112 | 
            +
                      _loopCount(item.children);
         | 
| 113 113 | 
             
                    }
         | 
| 114 114 | 
             
                    return item;
         | 
| 115 115 | 
             
                  });
         | 
| @@ -117,7 +117,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) { | |
| 117 117 | 
             
                if ((dictsEnum === null || dictsEnum === void 0 ? void 0 : dictsEnum.length) > 10) {
         | 
| 118 118 | 
             
                  return dictsEnum;
         | 
| 119 119 | 
             
                }
         | 
| 120 | 
            -
                 | 
| 120 | 
            +
                _loopCount(dictsEnum);
         | 
| 121 121 | 
             
                if (count <= 10) {
         | 
| 122 122 | 
             
                  return result;
         | 
| 123 123 | 
             
                }
         | 
| @@ -131,17 +131,17 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) { | |
| 131 131 | 
             
               */
         | 
| 132 132 | 
             
              var transferDataSource = function transferDataSource(dataArr, showCodeAndName) {
         | 
| 133 133 | 
             
                var copyData = (0, _lodash.cloneDeep)(dataArr);
         | 
| 134 | 
            -
                var  | 
| 134 | 
            +
                var _loop = function loop(arr) {
         | 
| 135 135 | 
             
                  arr.map(function (item) {
         | 
| 136 136 | 
             
                    item[label] = "".concat(item[code], "-").concat(item[label]);
         | 
| 137 137 | 
             
                    if (item.children) {
         | 
| 138 | 
            -
                       | 
| 138 | 
            +
                      _loop(item.children);
         | 
| 139 139 | 
             
                    }
         | 
| 140 140 | 
             
                    return item;
         | 
| 141 141 | 
             
                  });
         | 
| 142 142 | 
             
                };
         | 
| 143 143 | 
             
                if (showCodeAndName) {
         | 
| 144 | 
            -
                   | 
| 144 | 
            +
                  _loop(copyData);
         | 
| 145 145 | 
             
                }
         | 
| 146 146 | 
             
                return copyData;
         | 
| 147 147 | 
             
              };
         | 
| @@ -235,19 +235,19 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) { | |
| 235 235 | 
             
                  return viewEmpty;
         | 
| 236 236 | 
             
                }
         | 
| 237 237 | 
             
                var labelResult = [];
         | 
| 238 | 
            -
                var  | 
| 238 | 
            +
                var _queryLabel = function queryLabel(dicts) {
         | 
| 239 239 | 
             
                  return dicts.map(function (item) {
         | 
| 240 240 | 
             
                    if (value.includes(item[code])) {
         | 
| 241 241 | 
             
                      var labelText = item[label];
         | 
| 242 242 | 
             
                      labelResult.push(labelText);
         | 
| 243 243 | 
             
                    }
         | 
| 244 244 | 
             
                    if (item.children) {
         | 
| 245 | 
            -
                       | 
| 245 | 
            +
                      _queryLabel(item.children);
         | 
| 246 246 | 
             
                    }
         | 
| 247 247 | 
             
                    return item;
         | 
| 248 248 | 
             
                  });
         | 
| 249 249 | 
             
                };
         | 
| 250 | 
            -
                 | 
| 250 | 
            +
                _queryLabel(origDataSource);
         | 
| 251 251 | 
             
                return labelResult === null || labelResult === void 0 ? void 0 : labelResult.join(',');
         | 
| 252 252 | 
             
              };
         | 
| 253 253 | 
             
              // 纯展示处理
         | 
| @@ -285,7 +285,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) { | |
| 285 285 | 
             
               * @param node 每个节点数据对象
         | 
| 286 286 | 
             
               * @returns 整个react节点树
         | 
| 287 287 | 
             
               */
         | 
| 288 | 
            -
              var  | 
| 288 | 
            +
              var _renderTreeNode = function renderTreeNode(node, grade) {
         | 
| 289 289 | 
             
                var children = node.children,
         | 
| 290 290 | 
             
                  icon = node.icon;
         | 
| 291 291 | 
             
                var labelText = node[label];
         | 
| @@ -332,7 +332,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) { | |
| 332 332 | 
             
                  checkable: node.checkable,
         | 
| 333 333 | 
             
                  className: "node-val-".concat(value),
         | 
| 334 334 | 
             
                  children: children.map(function (child) {
         | 
| 335 | 
            -
                    return  | 
| 335 | 
            +
                    return _renderTreeNode(child, sonGrade);
         | 
| 336 336 | 
             
                  })
         | 
| 337 337 | 
             
                }, key);
         | 
| 338 338 | 
             
              };
         | 
| @@ -343,7 +343,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) { | |
| 343 343 | 
             
               * @returns 处理后得树
         | 
| 344 344 | 
             
               */
         | 
| 345 345 | 
             
              function filterTree(sourceList, keyWord) {
         | 
| 346 | 
            -
                var  | 
| 346 | 
            +
                var _filterData = function filterData(data) {
         | 
| 347 347 | 
             
                  var currentAllNodeChild = []; // 记录当前节点得所有子节点
         | 
| 348 348 | 
             
                  // 遍历数组
         | 
| 349 349 | 
             
                  for (var i = 0; i < data.length; i++) {
         | 
| @@ -351,7 +351,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) { | |
| 351 351 | 
             
                    // 一直递归到最后一层子节点
         | 
| 352 352 | 
             
                    var currentNodeChild = []; // 记录当前节点下得子节点匹配到的节点个数
         | 
| 353 353 | 
             
                    if (item.children && item.children.length > 0) {
         | 
| 354 | 
            -
                      currentNodeChild =  | 
| 354 | 
            +
                      currentNodeChild = _filterData(item.children);
         | 
| 355 355 | 
             
                    }
         | 
| 356 356 | 
             
                    // 迭代完子节点向上回溯,如果有匹配到得子节点,那么加入当前节点得孩子对象上,否则加入得是空数组
         | 
| 357 357 | 
             
                    item.children = currentNodeChild;
         | 
| @@ -365,7 +365,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) { | |
| 365 365 | 
             
                  }
         | 
| 366 366 | 
             
                  return currentAllNodeChild;
         | 
| 367 367 | 
             
                };
         | 
| 368 | 
            -
                sourceList =  | 
| 368 | 
            +
                sourceList = _filterData(sourceList);
         | 
| 369 369 | 
             
                return sourceList;
         | 
| 370 370 | 
             
              }
         | 
| 371 371 | 
             
              var searchTreeEvent = function searchTreeEvent(searchVal) {
         | 
| @@ -382,7 +382,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) { | |
| 382 382 | 
             
              };
         | 
| 383 383 | 
             
              function findTreeNode(treeList, nodeValue) {
         | 
| 384 384 | 
             
                var result = {};
         | 
| 385 | 
            -
                var  | 
| 385 | 
            +
                var _filterData2 = function filterData(data) {
         | 
| 386 386 | 
             
                  for (var i = 0; i < data.length; i++) {
         | 
| 387 387 | 
             
                    var item = data[i];
         | 
| 388 388 | 
             
                    if (item[code] === nodeValue || Array.isArray(nodeValue) && nodeValue.includes(item[code])) {
         | 
| @@ -394,11 +394,11 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) { | |
| 394 394 | 
             
                    }
         | 
| 395 395 | 
             
                    // 一直递归到最后一层子节点
         | 
| 396 396 | 
             
                    if (item.children && item.children.length > 0) {
         | 
| 397 | 
            -
                       | 
| 397 | 
            +
                      _filterData2(item.children);
         | 
| 398 398 | 
             
                    }
         | 
| 399 399 | 
             
                  }
         | 
| 400 400 | 
             
                };
         | 
| 401 | 
            -
                 | 
| 401 | 
            +
                _filterData2(treeList);
         | 
| 402 402 | 
             
                return result;
         | 
| 403 403 | 
             
              }
         | 
| 404 404 | 
             
              function getLabelByValue(treeList, nodeValue) {
         | 
| @@ -535,7 +535,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) { | |
| 535 535 | 
             
                  }
         | 
| 536 536 | 
             
                }, treeProps), {}, {
         | 
| 537 537 | 
             
                  children: selectList.map(function (node) {
         | 
| 538 | 
            -
                    return  | 
| 538 | 
            +
                    return _renderTreeNode(node, 1);
         | 
| 539 539 | 
             
                  })
         | 
| 540 540 | 
             
                }))
         | 
| 541 541 | 
             
              });
         | 
| @@ -4,6 +4,6 @@ declare function SearchTitle(props: { | |
| 4 4 | 
             
                label?: string;
         | 
| 5 5 | 
             
                showEllipse?: boolean;
         | 
| 6 6 | 
             
                ellipseWidth?: string;
         | 
| 7 | 
            -
            }): JSX.Element;
         | 
| 7 | 
            +
            }): import("react/jsx-runtime").JSX.Element;
         | 
| 8 8 | 
             
            declare const _default: import("react").MemoExoticComponent<typeof SearchTitle>;
         | 
| 9 9 | 
             
            export default _default;
         | 
| @@ -23,5 +23,5 @@ interface ListProps extends ProTreeProps { | |
| 23 23 | 
             
                handleFilterClose?: (code: string, node?: any) => void;
         | 
| 24 24 | 
             
                [key: string]: any;
         | 
| 25 25 | 
             
            }
         | 
| 26 | 
            -
            declare function List(props: ListProps): JSX.Element;
         | 
| 26 | 
            +
            declare function List(props: ListProps): import("react/jsx-runtime").JSX.Element;
         | 
| 27 27 | 
             
            export default List;
         | 
| @@ -303,7 +303,7 @@ function List(props) { | |
| 303 303 | 
             
                }, onlyKey);
         | 
| 304 304 | 
             
              };
         | 
| 305 305 | 
             
              function fn() {
         | 
| 306 | 
            -
                var  | 
| 306 | 
            +
                var _loop = function loop(data, index) {
         | 
| 307 307 | 
             
                  index++;
         | 
| 308 308 | 
             
                  var treeRow = data.map(function (item) {
         | 
| 309 309 | 
             
                    var nodeClass = 'pro-tree-tree-node ';
         | 
| @@ -325,7 +325,7 @@ function List(props) { | |
| 325 325 | 
             
                      return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
         | 
| 326 326 | 
             
                        title: nodeTitle,
         | 
| 327 327 | 
             
                        key: (item === null || item === void 0 ? void 0 : item.key) || item[fieldNameValue],
         | 
| 328 | 
            -
                        children:  | 
| 328 | 
            +
                        children: _loop(item[fieldNames.children], index)
         | 
| 329 329 | 
             
                      });
         | 
| 330 330 | 
             
                    }
         | 
| 331 331 | 
             
                    return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
         | 
| @@ -342,7 +342,7 @@ function List(props) { | |
| 342 342 | 
             
                if (searchStr) {
         | 
| 343 343 | 
             
                  newTreeData = (0, _utils.filterCheckedNodes)(originalTreeData, [], searchStr, fieldNames);
         | 
| 344 344 | 
             
                }
         | 
| 345 | 
            -
                return  | 
| 345 | 
            +
                return _loop(newTreeData, -1);
         | 
| 346 346 | 
             
              }
         | 
| 347 347 | 
             
              var _treeData = fn();
         | 
| 348 348 | 
             
              var onExpand = function onExpand(newExpandedKeys, nextPara) {
         | 
    
        package/lib/ProTree/index.d.ts
    CHANGED
    
    
    
        package/lib/ProTree/utils.js
    CHANGED
    
    | @@ -63,7 +63,7 @@ function getAllKeys(data, fieldNames) { | |
| 63 63 | 
             
             * @param fieldNames
         | 
| 64 64 | 
             
             * @returns
         | 
| 65 65 | 
             
             */
         | 
| 66 | 
            -
            var  | 
| 66 | 
            +
            var _getParentKey = exports.getParentKey = function getParentKey(key, tree, fieldNames) {
         | 
| 67 67 | 
             
              var parentKey;
         | 
| 68 68 | 
             
              for (var i = 0; i < tree.length; i++) {
         | 
| 69 69 | 
             
                var node = tree[i];
         | 
| @@ -72,8 +72,8 @@ var getParentKey = exports.getParentKey = function getParentKey(key, tree, field | |
| 72 72 | 
             
                    return item[fieldNames.value] === key;
         | 
| 73 73 | 
             
                  })) {
         | 
| 74 74 | 
             
                    parentKey = node[fieldNames.value];
         | 
| 75 | 
            -
                  } else if ( | 
| 76 | 
            -
                    parentKey =  | 
| 75 | 
            +
                  } else if (_getParentKey(key, node[fieldNames.children], fieldNames)) {
         | 
| 76 | 
            +
                    parentKey = _getParentKey(key, node[fieldNames.children], fieldNames);
         | 
| 77 77 | 
             
                  }
         | 
| 78 78 | 
             
                }
         | 
| 79 79 | 
             
              }
         | 
| @@ -81,7 +81,7 @@ var getParentKey = exports.getParentKey = function getParentKey(key, tree, field | |
| 81 81 | 
             
            };
         | 
| 82 82 | 
             
            function findTreeNodeByKey(treeData, key, fieldNames) {
         | 
| 83 83 | 
             
              var result = [];
         | 
| 84 | 
            -
              var  | 
| 84 | 
            +
              var _traverse = function traverse(node, parents) {
         | 
| 85 85 | 
             
                if (node[fieldNames.value] === key) {
         | 
| 86 86 | 
             
                  result.push.apply(result, [node].concat((0, _toConsumableArray2.default)(parents)));
         | 
| 87 87 | 
             
                  return true;
         | 
| @@ -92,7 +92,7 @@ function findTreeNodeByKey(treeData, key, fieldNames) { | |
| 92 92 | 
             
                try {
         | 
| 93 93 | 
             
                  for (_iterator.s(); !(_step = _iterator.n()).done;) {
         | 
| 94 94 | 
             
                    var child = _step.value;
         | 
| 95 | 
            -
                    if ( | 
| 95 | 
            +
                    if (_traverse(child, [node].concat((0, _toConsumableArray2.default)(parents)))) {
         | 
| 96 96 | 
             
                      return true;
         | 
| 97 97 | 
             
                    }
         | 
| 98 98 | 
             
                  }
         | 
| @@ -108,7 +108,7 @@ function findTreeNodeByKey(treeData, key, fieldNames) { | |
| 108 108 | 
             
              try {
         | 
| 109 109 | 
             
                for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
         | 
| 110 110 | 
             
                  var node = _step2.value;
         | 
| 111 | 
            -
                   | 
| 111 | 
            +
                  _traverse(node, []);
         | 
| 112 112 | 
             
                }
         | 
| 113 113 | 
             
              } catch (err) {
         | 
| 114 114 | 
             
                _iterator2.e(err);
         | 
| @@ -127,23 +127,23 @@ function filterCheckedNodes(data, checkedKeys) { | |
| 127 127 | 
             
              var searchStr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
         | 
| 128 128 | 
             
              var fieldNames = arguments.length > 3 ? arguments[3] : undefined;
         | 
| 129 129 | 
             
              var result = [];
         | 
| 130 | 
            -
              var  | 
| 130 | 
            +
              var _traverse2 = function traverse(node) {
         | 
| 131 131 | 
             
                var _node$fieldNames$chil3;
         | 
| 132 132 | 
             
                var title = node[fieldNames.value] + node[fieldNames.label];
         | 
| 133 133 | 
             
                if (!searchStr) {
         | 
| 134 134 | 
             
                  if (checkedKeys.includes(node[fieldNames.value])) {
         | 
| 135 135 | 
             
                    var _node$fieldNames$chil;
         | 
| 136 | 
            -
                    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( | 
| 136 | 
            +
                    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)) || [];
         | 
| 137 137 | 
             
                    return (0, _objectSpread4.default)((0, _objectSpread4.default)({}, node), {}, (0, _defineProperty2.default)({}, fieldNames.children, _children));
         | 
| 138 138 | 
             
                  }
         | 
| 139 139 | 
             
                } else if ((title === null || title === void 0 ? void 0 : title.indexOf(searchStr)) > -1) {
         | 
| 140 140 | 
             
                  var _node$fieldNames$chil2;
         | 
| 141 | 
            -
                  var _children2 = ((_node$fieldNames$chil2 = node[fieldNames.children]) === null || _node$fieldNames$chil2 === void 0 ? void 0 : _node$fieldNames$chil2.map( | 
| 141 | 
            +
                  var _children2 = ((_node$fieldNames$chil2 = node[fieldNames.children]) === null || _node$fieldNames$chil2 === void 0 ? void 0 : _node$fieldNames$chil2.map(_traverse2).filter(Boolean)) || [];
         | 
| 142 142 | 
             
                  return (0, _objectSpread4.default)((0, _objectSpread4.default)({}, node), {}, {
         | 
| 143 143 | 
             
                    children: _children2
         | 
| 144 144 | 
             
                  });
         | 
| 145 145 | 
             
                }
         | 
| 146 | 
            -
                var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map( | 
| 146 | 
            +
                var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map(_traverse2).filter(Boolean);
         | 
| 147 147 | 
             
                if (children && children.length > 0) {
         | 
| 148 148 | 
             
                  return (0, _objectSpread4.default)((0, _objectSpread4.default)({}, node), {}, (0, _defineProperty2.default)({}, fieldNames.children, children));
         | 
| 149 149 | 
             
                }
         | 
| @@ -155,7 +155,7 @@ function filterCheckedNodes(data, checkedKeys) { | |
| 155 155 | 
             
              try {
         | 
| 156 156 | 
             
                for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
         | 
| 157 157 | 
             
                  var node = _step3.value;
         | 
| 158 | 
            -
                  var filtered =  | 
| 158 | 
            +
                  var filtered = _traverse2(node);
         | 
| 159 159 | 
             
                  if (filtered) {
         | 
| 160 160 | 
             
                    result.push(filtered);
         | 
| 161 161 | 
             
                  }
         | 
| @@ -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;
         |