@para-ui/core 4.0.0-rc.7 → 4.0.1

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.
Files changed (102) hide show
  1. package/Button/index.js +1 -1
  2. package/ButtonGroup/index.js +1 -1
  3. package/Cascader/index.js +4 -5
  4. package/ComboSelect/index.js +14 -16
  5. package/ComboSelect/lang/en_US.d.ts +1 -0
  6. package/ComboSelect/lang/index.d.ts +2 -0
  7. package/ComboSelect/lang/zh_CN.d.ts +1 -0
  8. package/CopyText/index.js +8 -6
  9. package/DatePicker/index.js +2 -4
  10. package/Descriptions/index.js +1 -1
  11. package/Desktop/index.js +1 -1
  12. package/Drawer/index.js +1 -1
  13. package/Dropdown/index.js +1 -1
  14. package/DynamicMultiBox/index.js +6 -9
  15. package/Form/index.js +5 -9
  16. package/FormItem/index.js +5 -9
  17. package/FunctionModal/index.js +3 -3
  18. package/InputLang/index.js +1 -1
  19. package/Modal/index.js +1 -1
  20. package/MultiBox/index.js +1 -1
  21. package/OperateBtn/index.js +1 -1
  22. package/PageHeader/index.js +1 -1
  23. package/Pagination/index.js +1 -1
  24. package/PopConfirm/index.js +2 -2
  25. package/Popover/index.js +1 -1
  26. package/QuickReply/index.js +2 -2
  27. package/README.md +6 -105
  28. package/Search/index.d.ts +1 -1
  29. package/Search/index.js +5 -3
  30. package/Select/index.js +3 -2
  31. package/SelectInput/index.js +2 -2
  32. package/Selector/index.js +328 -5
  33. package/SelectorPicker/index.js +3 -4
  34. package/SingleBox/index.js +1 -1
  35. package/Switch/index.js +8 -8
  36. package/Table/index.js +411 -473
  37. package/Tabs/index.js +3 -3
  38. package/Tag/index.js +53 -82
  39. package/TextEditor/index.js +3 -3
  40. package/TextField/index.js +2 -2
  41. package/TimePicker/index.js +2 -4
  42. package/Timeline/index.js +20 -14
  43. package/ToggleButton/index.js +27 -26
  44. package/Tooltip/index.js +27 -26
  45. package/Transfer/index.js +45 -50
  46. package/Tree/index.js +4 -8
  47. package/Upload/index.js +409 -626
  48. package/_verture/{index-f518e244.js → index-00dc302a.js} +1 -1
  49. package/_verture/{index-da9097d3.js → index-389675ab.js} +1 -1
  50. package/_verture/{index-466a3496.js → index-9784b09c.js} +18 -3
  51. package/_verture/{index-3156e3ef.js → index-e3011376.js} +312 -394
  52. package/_verture/{slicedToArray-75fa4188.js → slicedToArray-8223a2ef.js} +1 -1
  53. package/index.js +8 -10
  54. package/locale/en-US.d.ts +1 -0
  55. package/locale/index.d.ts +2 -0
  56. package/locale/index.js +4 -2
  57. package/locale/zh-CN.d.ts +1 -0
  58. package/package.json +3 -2
  59. package/umd/AutoBox.js +1 -1
  60. package/umd/Breadcrumbs.js +1 -1
  61. package/umd/Button.js +1 -1
  62. package/umd/ButtonGroup.js +1 -1
  63. package/umd/ComboSelect.js +2 -2
  64. package/umd/CopyText.js +2 -2
  65. package/umd/DatePicker.js +1 -1
  66. package/umd/Descriptions.js +1 -1
  67. package/umd/Desktop.js +1 -1
  68. package/umd/Drawer.js +1 -1
  69. package/umd/Dropdown.js +1 -1
  70. package/umd/DynamicMultiBox.js +2 -2
  71. package/umd/Form.js +4 -4
  72. package/umd/FormItem.js +2 -2
  73. package/umd/FunctionModal.js +1 -1
  74. package/umd/InputLang.js +1 -1
  75. package/umd/Modal.js +1 -1
  76. package/umd/MultiBox.js +1 -1
  77. package/umd/OperateBtn.js +1 -1
  78. package/umd/PageHeader.js +1 -1
  79. package/umd/Pagination.js +2 -2
  80. package/umd/PopConfirm.js +1 -1
  81. package/umd/Popover.js +1 -1
  82. package/umd/QuickReply.js +1 -1
  83. package/umd/Search.js +2 -2
  84. package/umd/Select.js +2 -2
  85. package/umd/SelectInput.js +2 -2
  86. package/umd/Selector.js +2 -2
  87. package/umd/SelectorPicker.js +2 -2
  88. package/umd/SingleBox.js +1 -1
  89. package/umd/Switch.js +1 -1
  90. package/umd/Table.js +2 -2
  91. package/umd/Tabs.js +1 -1
  92. package/umd/TextField.js +1 -1
  93. package/umd/TimePicker.js +1 -1
  94. package/umd/ToggleButton.js +1 -1
  95. package/umd/Transfer.js +2 -2
  96. package/umd/Upload.js +1 -1
  97. package/umd/locale.js +1 -1
  98. package/_verture/index-d63bd287.js +0 -327
  99. package/_verture/toConsumableArray-c7a8028f.js +0 -19
  100. /package/_verture/{index-d6093d1c.js → index-28a6bc3a.js} +0 -0
  101. /package/_verture/{modalContext-7b512b0c.js → modalContext-ea977824.js} +0 -0
  102. /package/_verture/{typeof-b240b062.js → typeof-c310ee4a.js} +0 -0
@@ -1,7 +1,3 @@
1
- import { _ as _toConsumableArray } from './toConsumableArray-c7a8028f.js';
2
- import { _ as _defineProperty } from './defineProperty-1d116156.js';
3
- import { _ as _slicedToArray } from './slicedToArray-75fa4188.js';
4
- import { r as regenerator } from './index-d63bd287.js';
5
1
  import { _ as __rest, a as __awaiter } from './tslib.es6-55ed4bd2.js';
6
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
7
3
  import React__default, { isValidElement, cloneElement, useRef, useState, useImperativeHandle, useEffect, useMemo } from 'react';
@@ -13,6 +9,7 @@ import FileOutlined from '@para-ui/icons/Document';
13
9
  import SolidArrowDown from '@para-ui/icons/DownTriangleF';
14
10
  import { Radio } from '../Radio/index.js';
15
11
  import { $ as $prefixCls } from './constant-5317fc89.js';
12
+ import { b as _slicedToArray } from './slicedToArray-8223a2ef.js';
16
13
  import ReactDOM from 'react-dom';
17
14
  import EditOutlinedIcon from '@para-ui/icons/EditFile';
18
15
  import AddOutlinedIcon from '@para-ui/icons/PlusCircle';
@@ -566,129 +563,110 @@ var OperateBar = function OperateBar(props) {
566
563
  };
567
564
 
568
565
  //默认分页信息
569
- var defaultPageSize = {
566
+ const defaultPageSize = {
570
567
  page: 1,
571
568
  size: 10
572
569
  };
573
570
  //tree 组件
574
- var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
575
- var url = props.url,
576
- ctx = props.ctx,
577
- _props$params = props.params,
578
- params = _props$params === void 0 ? null : _props$params,
579
- _props$method = props.method,
580
- method = _props$method === void 0 ? 'GET' : _props$method,
581
- headers = props.headers,
582
- requestCallback = props.requestCallback,
583
- refresh = props.refresh,
584
- _props$replaceFields = props.replaceFields,
585
- replaceFields = _props$replaceFields === void 0 ? {
571
+ const Tree = /*#__PURE__*/React__default.forwardRef((props, ref) => {
572
+ const {
573
+ url,
574
+ ctx,
575
+ params = null,
576
+ method = 'GET',
577
+ headers,
578
+ requestCallback,
579
+ refresh,
580
+ replaceFields = {
586
581
  key: 'key',
587
582
  parentId: 'parentId',
588
583
  children: 'children',
589
584
  title: 'title',
590
585
  loadKey: 'key'
591
- } : _props$replaceFields,
592
- originTreeData = props.treeData,
593
- className = props.className,
594
- showIcon = props.showIcon,
595
- _icon = props.icon,
596
- showLine = props.showLine,
597
- _switcherIcon = props.switcherIcon,
598
- blockNode = props.blockNode,
599
- checkable = props.checkable,
600
- selectable = props.selectable,
601
- _props$radioable = props.radioable,
602
- radioable = _props$radioable === void 0 ? false : _props$radioable,
603
- _props$showRadio = props.showRadio,
604
- showRadio = _props$showRadio === void 0 ? true : _props$showRadio,
605
- _props$checkStrictly = props.checkStrictly,
606
- checkStrictly = _props$checkStrictly === void 0 ? false : _props$checkStrictly,
607
- actionsCallback = props.actionsCallback,
608
- showActions = props.showActions,
609
- checkedKeys = props.checkedKeys,
610
- defaultCheckedKeys = props.defaultCheckedKeys,
611
- expandedKeys = props.expandedKeys,
612
- defaultExpandedKeys = props.defaultExpandedKeys,
613
- loadedKeys = props.loadedKeys,
614
- onCheck = props.onCheck,
615
- onExpand = props.onExpand,
616
- _props$asyncLoad = props.asyncLoad,
617
- asyncLoad = _props$asyncLoad === void 0 ? false : _props$asyncLoad,
618
- _props$pagination = props.pagination,
619
- pagination = _props$pagination === void 0 ? false : _props$pagination,
620
- _props$pageSize = props.pageSize,
621
- pageSize = _props$pageSize === void 0 ? defaultPageSize : _props$pageSize,
622
- loadData = props.loadData,
623
- _props$localFilter = props.localFilter,
624
- localFilter = _props$localFilter === void 0 ? false : _props$localFilter,
625
- localParams = props.localParams,
626
- onFilter = props.onFilter,
627
- _props$loadMoreNode = props.loadMoreNode,
628
- loadMoreNode = _props$loadMoreNode === void 0 ? null : _props$loadMoreNode,
629
- paramsCallback = props.paramsCallback,
630
- titleRender = props.titleRender,
631
- emptyProps = props.emptyProps,
632
- emptyClassName = props.emptyClassName,
633
- notFoundContent = props.notFoundContent,
634
- wrapperClassName = props.wrapperClassName,
635
- wrapperStyle = props.wrapperStyle,
636
- _props$showLoading = props.showLoading,
637
- showLoading = _props$showLoading === void 0 ? true : _props$showLoading,
638
- loadingNode = props.loadingNode,
639
- onLoadedKey = props.onLoadedKey,
640
- _props$tipMaxWidth = props.tipMaxWidth,
641
- tipMaxWidth = _props$tipMaxWidth === void 0 ? 500 : _props$tipMaxWidth;
642
- var _useState = useState([]),
643
- _useState2 = _slicedToArray(_useState, 2),
644
- treeData = _useState2[0],
645
- setTreeData = _useState2[1]; //树数据
646
- var _useState3 = useState([]),
647
- _useState4 = _slicedToArray(_useState3, 2),
648
- inCheckedKeys = _useState4[0],
649
- setInCheckedKeys = _useState4[1]; //选中keys
650
- var _useState5 = useState([]),
651
- _useState6 = _slicedToArray(_useState5, 2),
652
- inExpandedKeysKeys = _useState6[0],
653
- setInExpandedKeys = _useState6[1]; //展开keys
654
- var opRef = useRef({}); //操作栏
655
- var mouseInSectorRef = useRef(false); //是否鼠标进入扇形
656
- var timeSectorRef = useRef(-1); //定时显示扇形
657
- var nodesRef = useRef([]); //保存节点状态
658
- var prefixCls = "".concat($prefixCls, "-tree"); //tree容器前缀
659
- var treeMapRef = useRef({}); //tree map
660
- var treeOriDataRef = useRef([]); //tree origin data
661
- var nPageSize = Object.assign(Object.assign({}, defaultPageSize), pageSize);
662
- var halfCheckedKeys = useRef([]); //半选keys
663
- var intl = useFormatMessage('Tree', localeJson);
664
- var _useState7 = useState(false),
665
- _useState8 = _slicedToArray(_useState7, 2),
666
- loading = _useState8[0],
667
- setLoading = _useState8[1];
668
- var firstRender = useRef(true); //是否第一次渲染
669
- var _useState9 = useState([]),
670
- _useState10 = _slicedToArray(_useState9, 2),
671
- inLoadedKeys = _useState10[0],
672
- setInLoadKeys = _useState10[1];
586
+ },
587
+ treeData: originTreeData,
588
+ className,
589
+ showIcon,
590
+ icon,
591
+ showLine,
592
+ switcherIcon,
593
+ blockNode,
594
+ checkable,
595
+ selectable,
596
+ radioable = false,
597
+ showRadio = true,
598
+ checkStrictly = false,
599
+ actionsCallback,
600
+ showActions,
601
+ checkedKeys,
602
+ defaultCheckedKeys,
603
+ expandedKeys,
604
+ defaultExpandedKeys,
605
+ loadedKeys,
606
+ onCheck,
607
+ onExpand,
608
+ asyncLoad = false,
609
+ pagination = false,
610
+ pageSize = defaultPageSize,
611
+ loadData,
612
+ localFilter = false,
613
+ localParams,
614
+ onFilter,
615
+ loadMoreNode = null,
616
+ paramsCallback,
617
+ titleRender,
618
+ emptyProps,
619
+ emptyClassName,
620
+ notFoundContent,
621
+ wrapperClassName,
622
+ wrapperStyle,
623
+ showLoading = true,
624
+ loadingNode,
625
+ onLoadedKey,
626
+ tipMaxWidth = 500
627
+ } = props;
628
+ const [treeData, setTreeData] = useState([]); //树数据
629
+ const [inCheckedKeys, setInCheckedKeys] = useState([]); //选中keys
630
+ const [inExpandedKeysKeys, setInExpandedKeys] = useState([]); //展开keys
631
+ const opRef = useRef({}); //操作栏
632
+ const mouseInSectorRef = useRef(false); //是否鼠标进入扇形
633
+ const timeSectorRef = useRef(-1); //定时显示扇形
634
+ const nodesRef = useRef([]); //保存节点状态
635
+ const prefixCls = "".concat($prefixCls, "-tree"); //tree容器前缀
636
+ const treeMapRef = useRef({}); //tree map
637
+ const treeOriDataRef = useRef([]); //tree origin data
638
+ const nPageSize = Object.assign(Object.assign({}, defaultPageSize), pageSize);
639
+ const halfCheckedKeys = useRef([]); //半选keys
640
+ const intl = useFormatMessage('Tree', localeJson);
641
+ const [loading, setLoading] = useState(false);
642
+ const firstRender = useRef(true); //是否第一次渲染
643
+ const [inLoadedKeys, setInLoadKeys] = useState([]);
673
644
  //新属性
674
- var newProps = Object.assign(Object.assign({}, props), {
645
+ const newProps = Object.assign(Object.assign({}, props), {
675
646
  showLine: Boolean(showLine),
676
647
  checkStrictly: radioable || checkStrictly,
677
648
  showIcon: radioable || showIcon
678
649
  });
679
650
  //生成class
680
- var makeCls = function makeCls() {
681
- return clsx(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-icon-hide"), !showIcon), "".concat(prefixCls, "-block-node"), blockNode), "".concat(prefixCls, "-unselectable"), !selectable), "".concat(prefixCls, "-radioable"), radioable), "".concat(prefixCls, "-radioable-showradio"), radioable && showRadio), className);
651
+ const makeCls = () => {
652
+ return clsx({
653
+ ["".concat(prefixCls, "-icon-hide")]: !showIcon,
654
+ ["".concat(prefixCls, "-block-node")]: blockNode,
655
+ ["".concat(prefixCls, "-unselectable")]: !selectable,
656
+ ["".concat(prefixCls, "-radioable")]: radioable,
657
+ ["".concat(prefixCls, "-radioable-showradio")]: radioable && showRadio
658
+ }, className);
682
659
  };
683
660
  //格式化treeData 替换显示字段
684
- var formatTreeData = function formatTreeData(treeData) {
661
+ const formatTreeData = treeData => {
685
662
  function recursive(dataList) {
686
- var _ref = replaceFields || {},
687
- key = _ref.key,
688
- title = _ref.title,
689
- children = _ref.children,
690
- parentId = _ref.parentId;
691
- dataList.forEach(function (item) {
663
+ const {
664
+ key,
665
+ title,
666
+ children,
667
+ parentId
668
+ } = replaceFields || {};
669
+ dataList.forEach(item => {
692
670
  var _a;
693
671
  if (key) item.key = item[key];
694
672
  if (title) item.title = item[title];
@@ -701,7 +679,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
701
679
  return treeData;
702
680
  };
703
681
  //内部 tree title render
704
- var internalTitleRender = function internalTitleRender(nodeData) {
682
+ const internalTitleRender = nodeData => {
705
683
  if (nodeData.moreFlag) {
706
684
  //加载更多节点
707
685
  return jsx("span", Object.assign({
@@ -730,9 +708,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
730
708
  children: typeof titleRender === 'function' ? titleRender(nodeData) : nodeData.title
731
709
  })), !!showActions && jsx("div", Object.assign({
732
710
  className: "sector-anchor",
733
- onMouseEnter: function onMouseEnter(evt) {
734
- return handleSectorMEnter(nodeData, evt);
735
- },
711
+ onMouseEnter: evt => handleSectorMEnter(nodeData, evt),
736
712
  onMouseLeave: handleSectorMLeave
737
713
  }, {
738
714
  children: jsx(MoreOutlinedIcon, {
@@ -742,44 +718,44 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
742
718
  }));
743
719
  };
744
720
  //tree node mouse enter
745
- var handleTreeNodeMEnter = function handleTreeNodeMEnter(evt) {
721
+ const handleTreeNodeMEnter = evt => {
746
722
  evt.stopPropagation();
747
723
  clearNodesState();
748
- var _currTarget = evt.currentTarget;
724
+ const _currTarget = evt.currentTarget;
749
725
  if (_currTarget) {
750
- var pClsx = ".".concat($prefixCls, "-tree-node-content-wrapper");
751
- var cParentEl = _currTarget.closest(pClsx);
726
+ const pClsx = ".".concat($prefixCls, "-tree-node-content-wrapper");
727
+ const cParentEl = _currTarget.closest(pClsx);
752
728
  nodesRef.current.push(cParentEl);
753
729
  showMoreActionIcon(cParentEl, true);
754
730
  }
755
731
  };
756
732
  //tree node mouse leave
757
- var handleTreeNodeMLeave = function handleTreeNodeMLeave(evt) {
733
+ const handleTreeNodeMLeave = evt => {
758
734
  evt.stopPropagation();
759
735
  clearNodesState();
760
- var _currTarget = evt.currentTarget;
736
+ const _currTarget = evt.currentTarget;
761
737
  if (_currTarget) {
762
- var pClsx = ".".concat($prefixCls, "-tree-node-content-wrapper");
763
- var cParentEl = _currTarget.closest(pClsx);
738
+ const pClsx = ".".concat($prefixCls, "-tree-node-content-wrapper");
739
+ const cParentEl = _currTarget.closest(pClsx);
764
740
  showMoreActionIcon(cParentEl, false);
765
741
  }
766
742
  };
767
743
  // Tree node Click
768
- var handleTreeNodeClick = function handleTreeNodeClick() {
744
+ const handleTreeNodeClick = () => {
769
745
  var _a;
770
746
  if (!showActions) return;
771
747
  // 点击tree node 的时候 rc 内部会把node节点的样式重写,导致之前逻辑添加的样式不存在,需要点击的时候加上样式
772
748
  if (((_a = nodesRef.current) === null || _a === void 0 ? void 0 : _a.length) > 0) {
773
749
  // 需要滞后到下次事件循环
774
- setTimeout(function () {
775
- nodesRef.current.forEach(function (el) {
750
+ setTimeout(() => {
751
+ nodesRef.current.forEach(el => {
776
752
  showMoreActionIcon(el, true);
777
753
  });
778
754
  });
779
755
  }
780
756
  };
781
757
  //节点显示更多图标
782
- var showMoreActionIcon = function showMoreActionIcon(cParentEl, isShow) {
758
+ const showMoreActionIcon = (cParentEl, isShow) => {
783
759
  if (!cParentEl) return;
784
760
  if (isShow) {
785
761
  cParentEl === null || cParentEl === void 0 ? void 0 : cParentEl.classList.add("".concat($prefixCls, "-tree-node-content-wrapper--active"));
@@ -788,21 +764,21 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
788
764
  }
789
765
  };
790
766
  //mouse enter sector
791
- var handleSectorMEnter = function handleSectorMEnter(nodeData, evt) {
767
+ const handleSectorMEnter = (nodeData, evt) => {
792
768
  evt.stopPropagation();
793
- var _currTarget = evt.currentTarget;
769
+ const _currTarget = evt.currentTarget;
794
770
  opRef.current.anchorEl = _currTarget;
795
- timeSectorRef.current = setTimeout(function () {
771
+ timeSectorRef.current = setTimeout(() => {
796
772
  clearTimeout(timeSectorRef.current);
797
773
  showSector(_currTarget, nodeData);
798
774
  }, 300);
799
775
  };
800
776
  //mouse sector leave
801
- var handleSectorMLeave = function handleSectorMLeave(evt) {
777
+ const handleSectorMLeave = evt => {
802
778
  evt.stopPropagation();
803
779
  clearTimeout(timeSectorRef.current);
804
- var _anchor = evt.currentTarget;
805
- var timer = setTimeout(function () {
780
+ const _anchor = evt.currentTarget;
781
+ const timer = setTimeout(() => {
806
782
  clearTimeout(timer);
807
783
  if (!mouseInSectorRef.current) {
808
784
  removeSector(_anchor);
@@ -810,19 +786,19 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
810
786
  }, 300);
811
787
  };
812
788
  //显示扇形
813
- var showSector = function showSector(anchorEl, nodeData) {
789
+ const showSector = (anchorEl, nodeData) => {
814
790
  var _a, _b;
815
- var portalRoot = document.getElementById(opRef.current.uid);
791
+ const portalRoot = document.getElementById(opRef.current.uid);
816
792
  anchorEl.classList.add('sector-anchor--active');
817
793
  if (portalRoot) {
818
- var container = portalRoot.querySelector('.sector-container');
794
+ const container = portalRoot.querySelector('.sector-container');
819
795
  if (container) {
820
796
  (_b = (_a = opRef.current) === null || _a === void 0 ? void 0 : _a.onShowSector) === null || _b === void 0 ? void 0 : _b.call(_a, nodeData, true);
821
797
  }
822
798
  }
823
799
  };
824
800
  //移除扇形
825
- var removeSector = function removeSector(anchorEl) {
801
+ const removeSector = anchorEl => {
826
802
  var _a, _b;
827
803
  if (anchorEl) {
828
804
  anchorEl.classList.remove('sector-anchor--active');
@@ -830,19 +806,19 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
830
806
  }
831
807
  };
832
808
  //离开扇形回调
833
- var handleOnRemove = function handleOnRemove(anchorEl) {
809
+ const handleOnRemove = anchorEl => {
834
810
  if (anchorEl) {
835
- var pCls = ".".concat($prefixCls, "-tree-node-content-wrapper");
836
- var cParentEl = anchorEl.closest(pCls);
811
+ const pCls = ".".concat($prefixCls, "-tree-node-content-wrapper");
812
+ const cParentEl = anchorEl.closest(pCls);
837
813
  showMoreActionIcon(cParentEl, false);
838
814
  removeSector(anchorEl);
839
815
  }
840
816
  };
841
817
  //清除节点状态
842
- var clearNodesState = function clearNodesState() {
818
+ const clearNodesState = () => {
843
819
  var _a;
844
820
  if ((_a = nodesRef.current) === null || _a === void 0 ? void 0 : _a.length) {
845
- nodesRef.current.forEach(function (el) {
821
+ nodesRef.current.forEach(el => {
846
822
  var _a;
847
823
  (_a = el === null || el === void 0 ? void 0 : el.classList) === null || _a === void 0 ? void 0 : _a.remove("".concat($prefixCls, "-tree-node-content-wrapper--active"));
848
824
  });
@@ -850,14 +826,14 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
850
826
  }
851
827
  };
852
828
  //内部check
853
- var internalCheck = function internalCheck(checkedKeys, e) {
829
+ const internalCheck = (checkedKeys, e) => {
854
830
  var _a;
855
- var temp = [];
856
- var halfChecked = [];
831
+ let temp = [];
832
+ let halfChecked = [];
857
833
  if (radioable) {
858
834
  //单选
859
- var node = e.node;
860
- var key = (_a = replaceFields.key) !== null && _a !== void 0 ? _a : 'key';
835
+ const node = e.node;
836
+ const key = (_a = replaceFields.key) !== null && _a !== void 0 ? _a : 'key';
861
837
  if (e.checked) temp = [node[key]];
862
838
  } else if (checkStrictly) {
863
839
  //严格模式
@@ -874,59 +850,38 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
874
850
  onCheck === null || onCheck === void 0 ? void 0 : onCheck(temp, e, halfChecked);
875
851
  };
876
852
  //展开节点
877
- var internalExpand = function internalExpand(expandedKeys, e) {
853
+ const internalExpand = (expandedKeys, e) => {
878
854
  if (!('expandedKeys' in props)) {
879
- setInExpandedKeys(_toConsumableArray(expandedKeys));
855
+ setInExpandedKeys([...expandedKeys]);
880
856
  }
881
857
  onExpand === null || onExpand === void 0 ? void 0 : onExpand(expandedKeys, e);
882
858
  };
883
859
  //请求树数据
884
- var requestTreeData = function requestTreeData() {
885
- var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
886
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
887
- var tParams, m, opts, _yield$Request, data, err;
888
- return regenerator.wrap(function _callee$(_context) {
889
- while (1) switch (_context.prev = _context.next) {
890
- case 0:
891
- if (url) {
892
- _context.next = 2;
893
- break;
894
- }
895
- return _context.abrupt("return", []);
896
- case 2:
897
- showLoading && setLoading(true);
898
- tParams = (paramsCallback === null || paramsCallback === void 0 ? void 0 : paramsCallback(params)) || params;
899
- m = method === null || method === void 0 ? void 0 : method.toUpperCase();
900
- opts = _defineProperty({
901
- url: url,
902
- ctx: ctx,
903
- method: m
904
- }, m === 'GET' ? 'params' : 'data', tParams || {});
905
- if (headers) opts.headers = headers;
906
- _context.next = 9;
907
- return Request(opts);
908
- case 9:
909
- _yield$Request = _context.sent;
910
- data = _yield$Request.data;
911
- err = _yield$Request.err;
912
- //分页数据格式 {list,page,size,total},否则 []
913
- showLoading && setLoading(false);
914
- if (!err) {
915
- _context.next = 15;
916
- break;
917
- }
918
- return _context.abrupt("return", pagination ? {} : []);
919
- case 15:
920
- return _context.abrupt("return", pagination ? data.data || {} : data.data || []);
921
- case 16:
922
- case "end":
923
- return _context.stop();
924
- }
925
- }, _callee);
926
- }));
860
+ const requestTreeData = function () {
861
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
862
+ return __awaiter(void 0, void 0, void 0, function* () {
863
+ if (!url) return [];
864
+ showLoading && setLoading(true);
865
+ const tParams = (paramsCallback === null || paramsCallback === void 0 ? void 0 : paramsCallback(params)) || params;
866
+ const m = method === null || method === void 0 ? void 0 : method.toUpperCase();
867
+ const opts = {
868
+ url,
869
+ ctx,
870
+ method: m,
871
+ [m === 'GET' ? 'params' : 'data']: tParams || {}
872
+ };
873
+ if (headers) opts.headers = headers;
874
+ const {
875
+ data,
876
+ err
877
+ } = yield Request(opts); //分页数据格式 {list,page,size,total},否则 []
878
+ showLoading && setLoading(false);
879
+ if (err) return pagination ? {} : [];
880
+ return pagination ? data.data || {} : data.data || [];
881
+ });
927
882
  };
928
883
  //加载更多节点数据
929
- var getLoadMoreData = function getLoadMoreData() {
884
+ const getLoadMoreData = () => {
930
885
  return {
931
886
  key: String((Math.random() * 1000000 | 0) + Date.now()),
932
887
  title: intl({
@@ -941,10 +896,10 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
941
896
  };
942
897
  };
943
898
  //渲染加载更多节点
944
- var renderLoadMoreNode = function renderLoadMoreNode(dataNode) {
899
+ const renderLoadMoreNode = dataNode => {
945
900
  return jsx("span", Object.assign({
946
901
  className: "".concat($prefixCls, "-tree-treenode-more-wrapper"),
947
- onClick: function onClick(e) {
902
+ onClick: e => {
948
903
  e.stopPropagation();
949
904
  onLoadData(dataNode);
950
905
  }
@@ -953,24 +908,24 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
953
908
  }));
954
909
  };
955
910
  //更新tree数据
956
- var updateTreeData = function updateTreeData(list, key, children, moreFlag) {
911
+ const updateTreeData = (list, key, children, moreFlag) => {
957
912
  //root节点
958
913
  if (key === 'ROOT_KEY') {
959
914
  list.pop(); //删除加载更多节点
960
915
  return list.concat(children);
961
916
  }
962
- return list.map(function (node) {
917
+ return list.map(node => {
963
918
  if (node.key === key) {
964
919
  if (moreFlag) {
965
920
  //加载更多
966
- var child = node.children || [];
921
+ const child = node.children || [];
967
922
  child.pop();
968
923
  return Object.assign(Object.assign({}, node), {
969
924
  children: child.concat(children)
970
925
  });
971
926
  }
972
927
  return Object.assign(Object.assign({}, node), {
973
- children: children
928
+ children
974
929
  });
975
930
  }
976
931
  if (node.children) {
@@ -982,112 +937,101 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
982
937
  });
983
938
  };
984
939
  //异步数据加载 [moreFlag]:加载更多标识
985
- var onLoadData = function onLoadData(dataNode) {
986
- var key = dataNode.key,
987
- children = dataNode.children,
988
- parentId = dataNode.parentId,
989
- moreFlag = dataNode.moreFlag;
990
- setInLoadKeys([].concat(_toConsumableArray(inLoadedKeys), [key]));
940
+ const onLoadData = dataNode => {
941
+ const {
942
+ key,
943
+ children,
944
+ parentId,
945
+ moreFlag
946
+ } = dataNode;
947
+ setInLoadKeys([...inLoadedKeys, key]);
991
948
  onLoadedKey === null || onLoadedKey === void 0 ? void 0 : onLoadedKey(key, dataNode);
992
- return new Promise(function (resolve) {
993
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee2() {
994
- var _a, tKey, loadKey, loadParams, treeData, handledData, pageInfo, _treeData, _treeData$list, list, page, size, total;
995
- return regenerator.wrap(function _callee2$(_context2) {
996
- while (1) switch (_context2.prev = _context2.next) {
997
- case 0:
998
- if (!children) {
999
- _context2.next = 3;
1000
- break;
1001
- }
1002
- resolve();
1003
- return _context2.abrupt("return");
1004
- case 3:
1005
- //当前节点key
1006
- tKey = key; //参数动态字段
1007
- loadKey = (_a = replaceFields.loadKey) !== null && _a !== void 0 ? _a : 'key'; //加载节点时参数
1008
- loadParams = Object.assign(_defineProperty({}, loadKey, tKey), params); //是否分页
1009
- if (pagination) {
1010
- if (moreFlag) {
1011
- //是否加载更多
1012
- tKey = parentId;
1013
- treeMapRef.current[tKey].page += 1;
1014
- loadParams[loadKey] = tKey;
1015
- if (tKey === 'ROOT_KEY') {
1016
- //根节点加载更多,不需要key
1017
- delete loadParams[loadKey];
1018
- }
1019
- }
1020
- //分页参数
1021
- loadParams.page = treeMapRef.current[tKey].page;
1022
- loadParams.size = treeMapRef.current[tKey].size;
1023
- }
1024
- _context2.next = 9;
1025
- return requestTreeData(loadParams);
1026
- case 9:
1027
- treeData = _context2.sent;
1028
- _context2.next = 12;
1029
- return requestCallback === null || requestCallback === void 0 ? void 0 : requestCallback(treeData);
1030
- case 12:
1031
- handledData = _context2.sent;
1032
- if (handledData) treeData = handledData;
1033
- pageInfo = {}; //分页信息
1034
- if (!pagination) {
1035
- _context2.next = 22;
1036
- break;
1037
- }
1038
- if (Object.keys(treeData).length) {
1039
- _context2.next = 19;
1040
- break;
1041
- }
1042
- resolve();
1043
- return _context2.abrupt("return");
1044
- case 19:
1045
- _treeData = treeData, _treeData$list = _treeData.list, list = _treeData$list === void 0 ? [] : _treeData$list, page = _treeData.page, size = _treeData.size, total = _treeData.total;
1046
- treeData = list;
1047
- pageInfo = {
1048
- page: page,
1049
- size: size,
1050
- total: total
1051
- };
1052
- case 22:
1053
- if (treeData === null || treeData === void 0 ? void 0 : treeData.length) {
1054
- treeData = formatTreeData(treeData);
1055
- if (pagination) {
1056
- //是否分页
1057
- treeData = transformTreeData(treeData, pageInfo, tKey);
1058
- }
1059
- }
1060
- if (Array.isArray(treeData)) setTreeData(function (origin) {
1061
- return updateTreeData(origin, tKey, treeData, moreFlag);
1062
- });
1063
- resolve();
1064
- case 25:
1065
- case "end":
1066
- return _context2.stop();
949
+ return new Promise(resolve => __awaiter(void 0, void 0, void 0, function* () {
950
+ var _a;
951
+ if (children) {
952
+ resolve();
953
+ return;
954
+ }
955
+ //当前节点key
956
+ let tKey = key;
957
+ //参数动态字段
958
+ const loadKey = (_a = replaceFields.loadKey) !== null && _a !== void 0 ? _a : 'key';
959
+ //加载节点时参数
960
+ const loadParams = Object.assign({
961
+ [loadKey]: tKey
962
+ }, params);
963
+ //是否分页
964
+ if (pagination) {
965
+ if (moreFlag) {
966
+ //是否加载更多
967
+ tKey = parentId;
968
+ treeMapRef.current[tKey].page += 1;
969
+ loadParams[loadKey] = tKey;
970
+ if (tKey === 'ROOT_KEY') {
971
+ //根节点加载更多,不需要key
972
+ delete loadParams[loadKey];
1067
973
  }
1068
- }, _callee2);
1069
- }));
1070
- });
974
+ }
975
+ //分页参数
976
+ loadParams.page = treeMapRef.current[tKey].page;
977
+ loadParams.size = treeMapRef.current[tKey].size;
978
+ }
979
+ let treeData = yield requestTreeData(loadParams);
980
+ //透传数据
981
+ const handledData = yield requestCallback === null || requestCallback === void 0 ? void 0 : requestCallback(treeData);
982
+ if (handledData) treeData = handledData;
983
+ let pageInfo = {}; //分页信息
984
+ if (pagination) {
985
+ //分页数据格式 {list,page,size,total}
986
+ if (!Object.keys(treeData).length) {
987
+ resolve();
988
+ return;
989
+ }
990
+ const {
991
+ list = [],
992
+ page,
993
+ size,
994
+ total
995
+ } = treeData;
996
+ treeData = list;
997
+ pageInfo = {
998
+ page,
999
+ size,
1000
+ total
1001
+ };
1002
+ }
1003
+ if (treeData === null || treeData === void 0 ? void 0 : treeData.length) {
1004
+ treeData = formatTreeData(treeData);
1005
+ if (pagination) {
1006
+ //是否分页
1007
+ treeData = transformTreeData(treeData, pageInfo, tKey);
1008
+ }
1009
+ }
1010
+ if (Array.isArray(treeData)) setTreeData(origin => updateTreeData(origin, tKey, treeData, moreFlag));
1011
+ resolve();
1012
+ }));
1071
1013
  };
1072
1014
  //转化tree数据
1073
- var transformTreeData = function transformTreeData(treeData, pageInfo, parentId) {
1074
- var newTreeData = convert(treeData); //tree结构
1075
- var page = pageInfo.page,
1076
- size = pageInfo.size,
1077
- total = pageInfo.total;
1015
+ const transformTreeData = (treeData, pageInfo, parentId) => {
1016
+ const newTreeData = convert(treeData); //tree结构
1017
+ const {
1018
+ page,
1019
+ size,
1020
+ total
1021
+ } = pageInfo;
1078
1022
  //计算分页,是否显示加载更多
1079
1023
  if (page * size < total) {
1080
- var loadMoreData = getLoadMoreData();
1024
+ const loadMoreData = getLoadMoreData();
1081
1025
  loadMoreData.parentId = parentId || 'ROOT_KEY';
1082
1026
  loadMoreData.title = renderLoadMoreNode(loadMoreData);
1083
1027
  newTreeData.push(loadMoreData);
1084
1028
  }
1085
1029
  treeMapRef.current = _toObject(newTreeData);
1086
1030
  function _toObject(data) {
1087
- var obj = treeMapRef.current;
1031
+ const obj = treeMapRef.current;
1088
1032
  if (!(data === null || data === void 0 ? void 0 : data.length)) return obj;
1089
- data.forEach(function (item) {
1090
- var tKey = item.moreFlag ? item.parentId : item.key;
1033
+ data.forEach(item => {
1034
+ const tKey = item.moreFlag ? item.parentId : item.key;
1091
1035
  if (!obj[tKey]) {
1092
1036
  obj[tKey] = Object.assign(Object.assign({}, item), nPageSize);
1093
1037
  }
@@ -1097,73 +1041,49 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
1097
1041
  return newTreeData;
1098
1042
  };
1099
1043
  //初始化树
1100
- var initTree = function initTree() {
1101
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee3() {
1102
- var tParams, treeData, pageInfo, handledData, _treeData2, _treeData2$list, list, page, size, total;
1103
- return regenerator.wrap(function _callee3$(_context3) {
1104
- while (1) switch (_context3.prev = _context3.next) {
1105
- case 0:
1106
- tParams = Object.assign({}, params);
1107
- if (pagination) {
1108
- //分页参数
1109
- tParams.page = nPageSize.page;
1110
- tParams.size = nPageSize.size;
1111
- }
1112
- _context3.next = 4;
1113
- return requestTreeData(tParams);
1114
- case 4:
1115
- treeData = _context3.sent;
1116
- pageInfo = {}; //分页信息
1117
- //透传数据
1118
- _context3.next = 8;
1119
- return requestCallback === null || requestCallback === void 0 ? void 0 : requestCallback(treeData);
1120
- case 8:
1121
- handledData = _context3.sent;
1122
- if (handledData) treeData = handledData;
1123
- if (!pagination) {
1124
- _context3.next = 17;
1125
- break;
1126
- }
1127
- if (Object.keys(treeData).length) {
1128
- _context3.next = 13;
1129
- break;
1130
- }
1131
- return _context3.abrupt("return", setTreeData([]));
1132
- case 13:
1133
- _treeData2 = treeData, _treeData2$list = _treeData2.list, list = _treeData2$list === void 0 ? [] : _treeData2$list, page = _treeData2.page, size = _treeData2.size, total = _treeData2.total;
1134
- treeData = list;
1135
- pageInfo = {
1136
- page: page,
1137
- size: size,
1138
- total: total
1139
- };
1140
- //clean treeMapRef
1141
- treeMapRef.current = {};
1142
- case 17:
1143
- if (treeData === null || treeData === void 0 ? void 0 : treeData.length) {
1144
- _context3.next = 19;
1145
- break;
1146
- }
1147
- return _context3.abrupt("return", setTreeData([]));
1148
- case 19:
1149
- treeData = formatTreeData(treeData);
1150
- if (localFilter)
1151
- //本地过滤
1152
- treeOriDataRef.current = deepCopy(treeData);
1153
- if (pagination)
1154
- //是否分页
1155
- treeData = transformTreeData(treeData, pageInfo);
1156
- setTreeData(_toConsumableArray(treeData));
1157
- case 23:
1158
- case "end":
1159
- return _context3.stop();
1160
- }
1161
- }, _callee3);
1162
- }));
1163
- };
1044
+ const initTree = () => __awaiter(void 0, void 0, void 0, function* () {
1045
+ const tParams = Object.assign({}, params);
1046
+ if (pagination) {
1047
+ //分页参数
1048
+ tParams.page = nPageSize.page;
1049
+ tParams.size = nPageSize.size;
1050
+ }
1051
+ let treeData = yield requestTreeData(tParams);
1052
+ let pageInfo = {}; //分页信息
1053
+ //透传数据
1054
+ const handledData = yield requestCallback === null || requestCallback === void 0 ? void 0 : requestCallback(treeData);
1055
+ if (handledData) treeData = handledData;
1056
+ if (pagination) {
1057
+ //分页数据格式 {list,page,size,total}
1058
+ if (!Object.keys(treeData).length) return setTreeData([]);
1059
+ const {
1060
+ list = [],
1061
+ page,
1062
+ size,
1063
+ total
1064
+ } = treeData;
1065
+ treeData = list;
1066
+ pageInfo = {
1067
+ page,
1068
+ size,
1069
+ total
1070
+ };
1071
+ //clean treeMapRef
1072
+ treeMapRef.current = {};
1073
+ }
1074
+ if (!(treeData === null || treeData === void 0 ? void 0 : treeData.length)) return setTreeData([]);
1075
+ treeData = formatTreeData(treeData);
1076
+ if (localFilter)
1077
+ //本地过滤
1078
+ treeOriDataRef.current = deepCopy(treeData);
1079
+ if (pagination)
1080
+ //是否分页
1081
+ treeData = transformTreeData(treeData, pageInfo);
1082
+ setTreeData([...treeData]);
1083
+ });
1164
1084
  //额外的属性
1165
- var getAdditionProps = function getAdditionProps() {
1166
- var additionProps = {};
1085
+ const getAdditionProps = () => {
1086
+ const additionProps = {};
1167
1087
  if (asyncLoad)
1168
1088
  //异步加载
1169
1089
  additionProps.loadData = onLoadData;
@@ -1171,44 +1091,44 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
1171
1091
  additionProps.titleRender = internalTitleRender;
1172
1092
  return additionProps;
1173
1093
  };
1174
- useEffect(function () {
1094
+ useEffect(() => {
1175
1095
  if (defaultCheckedKeys) {
1176
1096
  //默认值checked
1177
- setInCheckedKeys(_toConsumableArray(defaultCheckedKeys));
1097
+ setInCheckedKeys([...defaultCheckedKeys]);
1178
1098
  }
1179
1099
  if (defaultExpandedKeys) {
1180
1100
  //默认值expanded
1181
- setInExpandedKeys(_toConsumableArray(defaultExpandedKeys));
1101
+ setInExpandedKeys([...defaultExpandedKeys]);
1182
1102
  }
1183
1103
  }, [defaultCheckedKeys, defaultExpandedKeys]);
1184
- useEffect(function () {
1104
+ useEffect(() => {
1185
1105
  if (checkedKeys) {
1186
1106
  //选中keys
1187
- setInCheckedKeys(_toConsumableArray(getCheckedKeys(checkedKeys)));
1107
+ setInCheckedKeys([...getCheckedKeys(checkedKeys)]);
1188
1108
  halfCheckedKeys.current = getHalfCheckedKeys(checkedKeys);
1189
1109
  }
1190
1110
  if (expandedKeys) {
1191
1111
  //展开keys
1192
- setInExpandedKeys(_toConsumableArray(expandedKeys));
1112
+ setInExpandedKeys([...expandedKeys]);
1193
1113
  }
1194
1114
  }, [checkedKeys, expandedKeys]);
1195
- useEffect(function () {
1115
+ useEffect(() => {
1196
1116
  if (loadedKeys) {
1197
1117
  //loadedKeys
1198
1118
  if (loadedKeys.length === 0) {
1199
1119
  setInLoadKeys([]);
1200
1120
  setInExpandedKeys([]);
1201
1121
  } else {
1202
- setInLoadKeys(_toConsumableArray(loadedKeys));
1122
+ setInLoadKeys([...loadedKeys]);
1203
1123
  }
1204
1124
  }
1205
1125
  }, [loadedKeys]);
1206
- useEffect(function () {
1126
+ useEffect(() => {
1207
1127
  //默认展开所有
1208
1128
  function _expandAllNode(newTreeData) {
1209
- var keys = [];
1129
+ const keys = [];
1210
1130
  function recursive(dataList) {
1211
- dataList.forEach(function (item) {
1131
+ dataList.forEach(item => {
1212
1132
  var _a;
1213
1133
  if ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) {
1214
1134
  keys.push(item.key);
@@ -1223,51 +1143,51 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
1223
1143
  }
1224
1144
  //tree 初始化
1225
1145
  if (Array.isArray(originTreeData)) {
1226
- var newTreeData = formatTreeData(originTreeData);
1146
+ const newTreeData = formatTreeData(originTreeData);
1227
1147
  //本地过滤
1228
1148
  if (localFilter) treeOriDataRef.current = deepCopy(newTreeData);
1229
1149
  if (newProps.defaultExpandAll) {
1230
1150
  //默认展开所有
1231
1151
  _expandAllNode(newTreeData);
1232
1152
  }
1233
- setTreeData(_toConsumableArray(newTreeData));
1153
+ setTreeData([...newTreeData]);
1234
1154
  } else {
1235
1155
  initTree();
1236
1156
  }
1237
1157
  }, [url, ctx, params, method, refresh, originTreeData]);
1238
- useEffect(function () {
1158
+ useEffect(() => {
1239
1159
  //过滤数据
1240
- function _filterData(_ref2) {
1241
- var searchKey = _ref2.searchKey,
1242
- searchValue = _ref2.searchValue;
1160
+ function _filterData(_ref) {
1161
+ let {
1162
+ searchKey,
1163
+ searchValue
1164
+ } = _ref;
1243
1165
  if (!searchKey) return;
1244
1166
  if (searchValue === '') {
1245
1167
  setTreeData(treeOriDataRef.current);
1246
- var tKeys = expandedKeys || defaultExpandedKeys;
1247
- setInExpandedKeys(_toConsumableArray(tKeys || []));
1168
+ const tKeys = expandedKeys || defaultExpandedKeys;
1169
+ setInExpandedKeys([...(tKeys || [])]);
1248
1170
  return;
1249
1171
  }
1250
- var flatData = flatten(treeOriDataRef.current);
1172
+ const flatData = flatten(treeOriDataRef.current);
1251
1173
  //匹配数据
1252
- var filterTreeData = flatData.reduce(function (acc, curr) {
1253
- var title = String(curr[searchKey]).toLowerCase();
1254
- var isMatch = title.includes(searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase());
1174
+ const filterTreeData = flatData.reduce((acc, curr) => {
1175
+ const title = String(curr[searchKey]).toLowerCase();
1176
+ const isMatch = title.includes(searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase());
1255
1177
  return isMatch ? acc.concat(curr) : acc;
1256
1178
  }, []);
1257
- var newTreeData = convertByFilter(deepCopy(flatData), filterTreeData);
1179
+ const newTreeData = convertByFilter(deepCopy(flatData), filterTreeData);
1258
1180
  setTreeData(newTreeData);
1259
1181
  setInExpandedKeys(_handleExpendKey(newTreeData));
1260
1182
  }
1261
1183
  //处理展开key
1262
1184
  function _handleExpendKey(list) {
1263
- return list.reduce(function (acc, curr) {
1264
- return acc.concat(curr.key, _handleExpendKey(curr.children || []));
1265
- }, []);
1185
+ return list.reduce((acc, curr) => acc.concat(curr.key, _handleExpendKey(curr.children || [])), []);
1266
1186
  }
1267
1187
  if (localFilter) {
1268
1188
  //开启本地过滤
1269
1189
  if (onFilter) {
1270
- var fData = onFilter(treeOriDataRef.current);
1190
+ const fData = onFilter(treeOriDataRef.current);
1271
1191
  if (!fData) return;
1272
1192
  setTreeData(fData);
1273
1193
  return;
@@ -1276,7 +1196,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
1276
1196
  }
1277
1197
  }, [localFilter, localParams]);
1278
1198
  //渲染空状态
1279
- var renderEmpty = jsx("div", Object.assign({
1199
+ const renderEmpty = jsx("div", Object.assign({
1280
1200
  className: clsx("".concat($prefixCls, "-tree ").concat($prefixCls, "-tree-empty"), className, emptyClassName),
1281
1201
  style: props.style
1282
1202
  }, {
@@ -1285,14 +1205,14 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
1285
1205
  }, emptyProps))
1286
1206
  }));
1287
1207
  //tree memo
1288
- var treeMemo = useMemo(function () {
1208
+ const treeMemo = useMemo(() => {
1289
1209
  if (!(treeData === null || treeData === void 0 ? void 0 : treeData.length) && firstRender.current) {
1290
1210
  firstRender.current = false;
1291
1211
  return null;
1292
1212
  } else if (!(treeData === null || treeData === void 0 ? void 0 : treeData.length)) {
1293
1213
  return !loading ? renderEmpty : null;
1294
1214
  }
1295
- var tCheckedKeys = inCheckedKeys;
1215
+ let tCheckedKeys = inCheckedKeys;
1296
1216
  if (checkStrictly) {
1297
1217
  tCheckedKeys = {
1298
1218
  checked: inCheckedKeys,
@@ -1309,9 +1229,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
1309
1229
  className: "".concat(prefixCls, "-checkbox-inner")
1310
1230
  }) : checkable,
1311
1231
  selectable: radioable ? false : selectable,
1312
- switcherIcon: function switcherIcon(nodeProps) {
1313
- return renderSwitcherIcon(prefixCls, _switcherIcon, showLine, nodeProps);
1314
- }
1232
+ switcherIcon: nodeProps => renderSwitcherIcon(prefixCls, switcherIcon, showLine, nodeProps)
1315
1233
  }, getAdditionProps(), {
1316
1234
  treeData: treeData,
1317
1235
  checkedKeys: tCheckedKeys,
@@ -1319,9 +1237,9 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
1319
1237
  loadedKeys: inLoadedKeys,
1320
1238
  onCheck: internalCheck,
1321
1239
  onExpand: internalExpand,
1322
- icon: function icon(nodeProps) {
1323
- if (_icon) {
1324
- return typeof _icon === 'function' ? _icon(nodeProps) : _icon;
1240
+ icon: nodeProps => {
1241
+ if (icon) {
1242
+ return typeof icon === 'function' ? icon(nodeProps) : icon;
1325
1243
  }
1326
1244
  if (nodeProps.checkable === false) return null;
1327
1245
  if (!radioable) {
@@ -1332,7 +1250,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
1332
1250
  }));
1333
1251
  }, [treeData, inCheckedKeys, inExpandedKeysKeys, newProps.selectedKeys, inLoadedKeys]);
1334
1252
  //OperateBar render
1335
- var renderOperateBar = function renderOperateBar() {
1253
+ const renderOperateBar = () => {
1336
1254
  return !!showActions ? jsx(OperateBar, {
1337
1255
  opRef: opRef,
1338
1256
  mouseInRef: mouseInSectorRef,