@para-ui/core 4.0.29 → 4.0.31

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