import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import React from 'react';
import Input from '../input';
import TreeNodeItem from './verticalTreeNode';
import VirtualList from '../components/rc-virtual-list';
import { onTreeNodeCheck, onTreeNodeSelect, getNodeKeys } from './utils/treeFunctions';
import { __DEFAULT_FIELDNAMES__, __AsTargetChildXOffset__, handleExportNodes, getExpandedKeys, getCheckedNodes, getNodeIsLeaf } from './utils/_utils';
import { traverseTreeNode, traverse } from './utils/traverseUtils';
var dragInitData = {
  dragStartNode: null,
  dragOverNode: null,
  dragStartPosition: null
};

var VerticalTreeRenderFunction = function VerticalTreeRenderFunction(props, ref) {
  var hover = props.hover,
      multiple = props.multiple,
      className = props.className,
      showSearch = props.showSearch,
      checkable = props.checkable,
      draggable = props.draggable,
      virtual = props.virtual,
      listHeight = props.height,
      allLineClickable = props.allLineClickable,
      prefixCls = props.prefixCls,
      switcherIcon = props.switcherIcon,
      searchListType = props.searchListType,
      placeholder = props.placeholder,
      outerSearchValue = props.searchValue,
      outerSearchList = props.searchList,
      outerTreeData = props.treeData,
      outerCheckedKeys = props.checkedKeys,
      outerSelectedKeys = props.selectedKeys,
      outerExpandedKeys = props.expandedKeys,
      _props$defaultChecked = props.defaultCheckedKeys,
      defaultCheckedKeys = _props$defaultChecked === void 0 ? [] : _props$defaultChecked,
      _props$defaultSelecte = props.defaultSelectedKeys,
      defaultSelectedKeys = _props$defaultSelecte === void 0 ? [] : _props$defaultSelecte,
      _props$defaultExpande = props.defaultExpandedKeys,
      defaultExpandedKeys = _props$defaultExpande === void 0 ? [] : _props$defaultExpande,
      defaultExpandAll = props.defaultExpandAll,
      autoExpandParent = props.autoExpandParent,
      _props$fieldNames = props.fieldNames,
      fieldNames = _props$fieldNames === void 0 ? __DEFAULT_FIELDNAMES__ : _props$fieldNames,
      customSearch = props.customSearch,
      onDrop = props.onDrop,
      showIcon = props.showIcon,
      showLine = props.showLine,
      searchProps = props.searchProps,
      renderTreeNode = props.renderTreeNode,
      onDragEnd = props.onDragEnd,
      onDragEnter = props.onDragEnter,
      onDragLeave = props.onDragLeave,
      onDragOver = props.onDragOver,
      onDragStart = props.onDragStart,
      onSelect = props.onSelect,
      onCheck = props.onCheck,
      onExpand = props.onExpand,
      onSearchChange = props.onSearchChange,
      onSearchListSelect = props.onSearchListSelect,
      loadData = props.loadData,
      reset = _objectWithoutProperties(props, ["hover", "multiple", "className", "showSearch", "checkable", "draggable", "virtual", "height", "allLineClickable", "prefixCls", "switcherIcon", "searchListType", "placeholder", "searchValue", "searchList", "treeData", "checkedKeys", "selectedKeys", "expandedKeys", "defaultCheckedKeys", "defaultSelectedKeys", "defaultExpandedKeys", "defaultExpandAll", "autoExpandParent", "fieldNames", "customSearch", "onDrop", "showIcon", "showLine", "searchProps", "renderTreeNode", "onDragEnd", "onDragEnter", "onDragLeave", "onDragOver", "onDragStart", "onSelect", "onCheck", "onExpand", "onSearchChange", "onSearchListSelect", "loadData"]);

  var endFieldNames = _objectSpread(_objectSpread({}, __DEFAULT_FIELDNAMES__), fieldNames); // key -> node


  var keyToTreeNodeMapRef = React.useRef(new Map()); // title -> key

  var titleToKeyMapRef = React.useRef(new Map()); // key number set

  var numberKeysSetRef = React.useRef(new Set()); // tree dom

  var verticalTreeRef = React.useRef(null); // 保存上一次的expandedKeys

  var prevExpandedKeysRef = React.useRef(); // 保存上一次的checkedKeys

  var prevCheckedKeysRef = React.useRef(); // 保存当前选中的keys

  var checkedKeysRef = React.useRef(); // 保存上一次的treeData

  var prevTreeDataRef = React.useRef(); // 保存转换后的treeData

  var traversedTreeDataRef = React.useRef([]);

  var _React$useState = React.useState([]),
      _React$useState2 = _slicedToArray(_React$useState, 2),
      searchList = _React$useState2[0],
      setSearchList = _React$useState2[1];

  var _React$useState3 = React.useState(null),
      _React$useState4 = _slicedToArray(_React$useState3, 2),
      curLoadingKey = _React$useState4[0],
      setCurLoadingKey = _React$useState4[1];

  var _React$useState5 = React.useState(outerCheckedKeys || defaultCheckedKeys),
      _React$useState6 = _slicedToArray(_React$useState5, 2),
      checkedKeys = _React$useState6[0],
      setCheckedKeys = _React$useState6[1];

  var _React$useState7 = React.useState(getExpandedKeys(traversedTreeDataRef.current, outerExpandedKeys || defaultExpandedKeys, // 默认展开并且不受控
  defaultExpandAll && typeof outerExpandedKeys === 'undefined', autoExpandParent)),
      _React$useState8 = _slicedToArray(_React$useState7, 2),
      expandedKeys = _React$useState8[0],
      setExpandedKeys = _React$useState8[1];

  var _React$useState9 = React.useState(outerSelectedKeys || defaultSelectedKeys),
      _React$useState10 = _slicedToArray(_React$useState9, 2),
      selectedKeys = _React$useState10[0],
      setSelectedKeys = _React$useState10[1];

  var _React$useState11 = React.useState(new Set()),
      _React$useState12 = _slicedToArray(_React$useState11, 2),
      halfCheckedKeys = _React$useState12[0],
      setHalfCheckedKeys = _React$useState12[1];

  var _React$useState13 = React.useState(outerSearchValue),
      _React$useState14 = _slicedToArray(_React$useState13, 2),
      inputValue = _React$useState14[0],
      setInputValue = _React$useState14[1];

  var _React$useState15 = React.useState({
    dragBottom: false
  }),
      _React$useState16 = _slicedToArray(_React$useState15, 2),
      dargoverInfo = _React$useState16[0],
      setDargoverInfo = _React$useState16[1];

  var updateKeys = function updateKeys(updateCheckedKeys) {
    var _getNodeKeys = getNodeKeys(updateCheckedKeys, keyToTreeNodeMapRef.current),
        _getNodeKeys2 = _slicedToArray(_getNodeKeys, 2),
        endKeys = _getNodeKeys2[0],
        halfKeys = _getNodeKeys2[1];

    setCheckedKeys(_toConsumableArray(endKeys));
    setHalfCheckedKeys(halfKeys);
  }; // 防止每次更新都对outerTreeData进行数据转换


  if (typeof outerTreeData !== 'undefined' && outerTreeData !== prevTreeDataRef.current) {
    traversedTreeDataRef.current = traverseTreeNode(outerTreeData, endFieldNames, keyToTreeNodeMapRef.current, numberKeysSetRef.current, false, titleToKeyMapRef.current); // 数据变化更新Keys

    if (checkable) {
      updateKeys(new Set(_toConsumableArray(checkedKeys)));
    }
  }

  var expandedKeysSet = new Set(expandedKeys);
  var checkedKeysSet = new Set(checkedKeys);
  var selectedKeysSet = new Set(selectedKeys); //保存拖拽信息

  var dragDataRef = React.useRef(dragInitData);

  if (typeof outerSearchValue !== 'undefined' && outerSearchValue !== inputValue) {
    setInputValue(outerSearchValue);
  }

  if (typeof outerSearchList !== 'undefined' && outerSearchList !== searchList) {
    setSearchList(outerSearchList);
  }

  if (typeof outerCheckedKeys !== 'undefined' && outerCheckedKeys !== prevCheckedKeysRef.current) {
    updateKeys(new Set(_toConsumableArray(outerCheckedKeys)));
  }

  if (typeof outerExpandedKeys !== 'undefined' && outerExpandedKeys !== prevExpandedKeysRef.current) {
    setExpandedKeys(getExpandedKeys(traversedTreeDataRef.current, outerExpandedKeys || defaultExpandedKeys, false, autoExpandParent));
  }

  if (typeof outerSelectedKeys !== 'undefined' && outerSelectedKeys !== selectedKeys) {
    setSelectedKeys(outerSelectedKeys);
  }

  prevCheckedKeysRef.current = outerCheckedKeys;
  prevExpandedKeysRef.current = outerExpandedKeys;
  prevTreeDataRef.current = outerTreeData;
  checkedKeysRef.current = checkedKeys;

  var nodeExpand = function nodeExpand(node) {
    var expanded = node.expanded;

    if (!expanded) {
      expandedKeysSet.add(node.nodeKey);
    } else {
      expandedKeysSet.delete(node.nodeKey);
    }

    if (typeof outerExpandedKeys === 'undefined') {
      setExpandedKeys(_toConsumableArray(expandedKeysSet));
    }

    onExpand === null || onExpand === void 0 ? void 0 : onExpand(_toConsumableArray(expandedKeysSet), {
      expand: !!expanded,
      node: node
    });
  };

  var onNodeExpand = function onNodeExpand(treeNode) {
    var copyTreeNode = _objectSpread(_objectSpread({}, treeNode), {}, {
      key: treeNode.nodeKey
    }); // 如果有children就代表数据已经加载过了


    if (loadData && !copyTreeNode.children && !copyTreeNode.isLeaf) {
      setCurLoadingKey(copyTreeNode.nodeKey);
      loadData(copyTreeNode, copyTreeNode.level + 1).then(function () {
        // 数据异步回来之后这里需要获取到最新的treeNode
        var newTreeNode = keyToTreeNodeMapRef.current.get(copyTreeNode.nodeKey);
        setCurLoadingKey(null);
        if (!newTreeNode) return; // updateKeys(checkedKeysSet);

        nodeExpand(newTreeNode);
      });
      return;
    }

    nodeExpand(copyTreeNode);
  };

  var onNodeSelect = function onNodeSelect(e, node) {
    var _onTreeNodeSelect = onTreeNodeSelect(node, selectedKeysSet, endFieldNames, keyToTreeNodeMapRef.current, multiple),
        _onTreeNodeSelect2 = _slicedToArray(_onTreeNodeSelect, 2),
        keys = _onTreeNodeSelect2[0],
        selectedTreeNodes = _onTreeNodeSelect2[1];

    if (typeof outerSelectedKeys === 'undefined') {
      setSelectedKeys(keys);
    }

    onSelect === null || onSelect === void 0 ? void 0 : onSelect(keys, {
      event: 'select',
      selected: !!node.selected,
      selectedNodes: selectedTreeNodes,
      nativeEvent: e.nativeEvent
    });
  };

  var onNodeCheck = function onNodeCheck(e, treeNode) {
    var newCheckedKeysSet = new Set(_toConsumableArray(checkedKeys));

    var _onTreeNodeCheck = onTreeNodeCheck(treeNode, e.target.checked, newCheckedKeysSet, keyToTreeNodeMapRef.current),
        _onTreeNodeCheck2 = _slicedToArray(_onTreeNodeCheck, 3),
        exportCheckedKeys = _onTreeNodeCheck2[0],
        exportFilterAnCheckedKeys = _onTreeNodeCheck2[1],
        halfKeysSet = _onTreeNodeCheck2[2];

    if (typeof outerCheckedKeys === 'undefined') {
      setCheckedKeys(_toConsumableArray(newCheckedKeysSet));
      setHalfCheckedKeys(halfKeysSet);
    }

    var _getCheckedNodes = getCheckedNodes(treeNode, checkedKeysSet, endFieldNames, keyToTreeNodeMapRef.current),
        _getCheckedNodes2 = _slicedToArray(_getCheckedNodes, 1),
        checkedTreeNode = _getCheckedNodes2[0];

    onCheck === null || onCheck === void 0 ? void 0 : onCheck(exportCheckedKeys, {
      checked: e.target.checked,
      checkedNodes: checkedTreeNode,
      event: 'check',
      nativeEvent: e.nativeEvent,
      checkedChildrenKeys: exportFilterAnCheckedKeys
    });
  };

  var clearDragState = function clearDragState() {
    setDargoverInfo({});
    dragDataRef.current = dragInitData;
  };

  var onNodeDragStart = function onNodeDragStart(e, node) {
    var clientX = e.clientX,
        clientY = e.clientY; // 设置当前正在拖拽的节点

    dragDataRef.current.dragStartNode = node; // 记录当前位置

    dragDataRef.current.dragStartPosition = [clientX, clientY];
    onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart({
      event: e,
      node: node
    });
  };

  var onNodeDragEnter = function onNodeDragEnter(e, node) {
    onDragEnter === null || onDragEnter === void 0 ? void 0 : onDragEnter({
      event: e,
      node: node
    });
  };

  var onNodeDragLeave = function onNodeDragLeave(e, node) {
    onDragLeave === null || onDragLeave === void 0 ? void 0 : onDragLeave({
      event: e,
      node: node
    });
  };

  var onNodeDragOver = function onNodeDragOver(e, node) {
    var _treeData$;

    e.preventDefault();
    var treeData = traversedTreeDataRef.current;
    var clientX = e.clientX,
        clientY = e.clientY,
        currentTarget = e.currentTarget;
    var isDragBottom,
        isDragTop = false;
    var dragBottom = dargoverInfo.dragBottom,
        dragTop = dargoverInfo.dragTop;
    /* eslint-disable prefer-const */

    var _dragDataRef$current = dragDataRef.current,
        dragOverNode = _dragDataRef$current.dragOverNode,
        dragStartNode = _dragDataRef$current.dragStartNode,
        dragStartPosition = _dragDataRef$current.dragStartPosition;

    if (!dragStartPosition) {
      dragStartPosition = [clientX, clientY];
    }

    var _dragStartPosition = dragStartPosition,
        _dragStartPosition2 = _slicedToArray(_dragStartPosition, 1),
        startX = _dragStartPosition2[0]; // 目标节点为第一个节点（treeData[0]）并且被拖拽节点期望和该节点交换位置


    var _e$target$getBounding = e.target.getBoundingClientRect(),
        top = _e$target$getBounding.top,
        height = _e$target$getBounding.height;

    if (((_treeData$ = treeData[0]) === null || _treeData$ === void 0 ? void 0 : _treeData$.nodeKey) === node.nodeKey && clientY < top + height / 2) {
      isDragTop = true;
    } else {
      isDragTop = false;
    } // 大于20代表当前拖动节点将作为目标元素子节点


    if (clientX - startX >= __AsTargetChildXOffset__) {
      isDragBottom = true;
    } else {
      isDragBottom = false;
    } // 防止dragover重复执行


    if ((dragOverNode === null || dragOverNode === void 0 ? void 0 : dragOverNode.nodeKey) === node.nodeKey && dragBottom === isDragBottom && dragTop === isDragTop) {
      return;
    } // 检测被拖拽的节点是否是目标节点的父节点


    var currentDragNodeIsFather = false;
    var temp = node;

    while (temp) {
      if ((dragStartNode === null || dragStartNode === void 0 ? void 0 : dragStartNode.nodeKey) === temp.nodeKey) {
        currentDragNodeIsFather = true;
      }

      temp = temp.parent;
    }

    if (currentDragNodeIsFather) return; // 目标节点显示下划线
    // setInfoKey(node.nodeKey)

    setDargoverInfo({
      targetKey: node.nodeKey,
      dragBottom: isDragBottom,
      dragTop: isDragTop
    }); // 当前节点未展开则展开节点

    if (!expandedKeysSet.has(node.nodeKey)) {
      onNodeExpand(node);
    }

    dragDataRef.current.dragOverNode = node;
    onDragOver === null || onDragOver === void 0 ? void 0 : onDragOver({
      node: node,
      event: e
    });
  };

  var onNodeDragEnd = function onNodeDragEnd(e, node) {
    clearDragState();
    onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd({
      event: e,
      node: node
    });
  };

  var onNodeDrop = function onNodeDrop(e, node) {
    var dragStartNode = dragDataRef.current.dragStartNode;

    if ((dragStartNode === null || dragStartNode === void 0 ? void 0 : dragStartNode.nodeKey) === node.nodeKey) {
      clearDragState();
      return;
    }

    var dragBottom = dargoverInfo.dragBottom,
        dragTop = dargoverInfo.dragTop;

    var _handleExportNodes = handleExportNodes([dragStartNode, node], endFieldNames),
        _handleExportNodes2 = _slicedToArray(_handleExportNodes, 1),
        _handleExportNodes2$ = _slicedToArray(_handleExportNodes2[0], 2),
        exportDragNode = _handleExportNodes2$[0],
        exportDropNode = _handleExportNodes2$[1];

    var dropPosition = 1;

    if (dragBottom) {
      dropPosition = 0;
    }

    if (dragTop) {
      dropPosition = -1;
    }

    onDrop === null || onDrop === void 0 ? void 0 : onDrop({
      dragNode: exportDragNode,
      node: exportDropNode,
      dropPosition: dropPosition,
      event: e
    });
    clearDragState();
  };

  var onInputChange = function onInputChange(val) {
    // 无法配合按需加载使用
    if (loadData || customSearch) return;
    var eKeysSet = new Set();
    var endSearchPanelList = [];
    titleToKeyMapRef.current.forEach(function (value, title) {
      if (title.includes(val)) {
        var nodeKey = titleToKeyMapRef.current.get(title);

        if (nodeKey) {
          eKeysSet.add(nodeKey);
        }
      }
    }); // 如果是展示成tree-list形式，内部逻辑

    if (searchListType === 'tree-list') {
      setExpandedKeys(getExpandedKeys(traversedTreeDataRef.current, [].concat(_toConsumableArray(outerExpandedKeys || []), _toConsumableArray(val ? eKeysSet : [])), false, autoExpandParent));
    } // 如果是展示成list形式，允许受控


    if (searchListType === 'list' && val) {
      var endKeysSet = new Set(_toConsumableArray(eKeysSet)); // 过滤数据

      eKeysSet.forEach(function (nodeKey) {
        var targetNode = keyToTreeNodeMapRef.current.get(nodeKey);
        if (!targetNode) return;
        var parent = targetNode.parent;

        while (parent) {
          if (endKeysSet.has(parent.nodeKey)) {
            endKeysSet.delete(parent.nodeKey);
          }

          parent = parent.parent;
        }
      });
      endKeysSet.forEach(function (nodeKey) {
        var currentPath = [];
        var targetNode = keyToTreeNodeMapRef.current.get(nodeKey);

        if (targetNode) {
          // 组装listpanel的数据
          currentPath.push(targetNode.title);
          var parent = targetNode.parent;

          while (parent) {
            currentPath.unshift(parent.title);
            parent = parent.parent;
          }

          var children = targetNode.children;
          traverse(children, function (node) {
            currentPath.push(node.title);
          }, function () {
            return currentPath.pop();
          });
          endSearchPanelList.push(currentPath);
        }
      });
    }

    if (typeof outerSearchList === 'undefined') {
      setSearchList(endSearchPanelList);
    }

    if (typeof outerSearchValue === 'undefined') {
      setInputValue(val);
    }

    onSearchChange === null || onSearchChange === void 0 ? void 0 : onSearchChange(val, endSearchPanelList);
  };

  var renderSearchedTitle = function renderSearchedTitle(title, searchValue) {
    if (searchValue && typeof title === 'string' && title.includes(searchValue)) {
      var index = title.indexOf(searchValue);
      var leftStr = title.slice(0, index);
      var rightStr = title.slice(index + searchValue.length, title.length);
      var searchedStr = title.slice(index, index + searchValue.length);
      return /*#__PURE__*/React.createElement(React.Fragment, null, leftStr, /*#__PURE__*/React.createElement("span", {
        className: "".concat(prefixCls, "-searching")
      }, searchedStr), rightStr);
    }

    return title;
  };

  var renderSearch = function renderSearch() {
    if (!showSearch) return null;
    return /*#__PURE__*/React.createElement("div", {
      className: "".concat(prefixCls, "-search-wrapper")
    }, /*#__PURE__*/React.createElement(Input.Search, Object.assign({
      className: "".concat(prefixCls, "-search"),
      // onSearch={onInputSearch}
      value: inputValue,
      onChange: function onChange(e) {
        return onInputChange(e.target.value);
      },
      placeholder: placeholder
    }, searchProps)));
  };

  React.useImperativeHandle(ref, function () {
    return {
      onSearchChange: onInputChange,
      element: verticalTreeRef
    };
  });
  /**
   * to do
   * 这里其实可以针对searchListPanel做个优化
   * searchListPanel的更新优先级较低
   * 因此依赖项都应该是deferredValue，比如searchList和inputValue
   */

  var renderSearchListPanel = function renderSearchListPanel() {
    if ((searchList === null || searchList === void 0 ? void 0 : searchList.length) && searchListType === 'list' && inputValue !== '') {
      return /*#__PURE__*/React.createElement("div", {
        className: "".concat(prefixCls, "-searchListPanel")
      }, searchList.map(function (path, outerIndex) {
        return /*#__PURE__*/React.createElement("div", {
          key: outerIndex,
          className: "".concat(prefixCls, "-searchListPanel-item"),
          title: path.join('/'),
          onClick: function onClick(e) {
            return onSearchListSelect === null || onSearchListSelect === void 0 ? void 0 : onSearchListSelect(path, e);
          }
        }, path.map(function (title, index) {
          return /*#__PURE__*/React.createElement("span", {
            key: index
          }, index === 0 ? '' : /*#__PURE__*/React.createElement("span", null, "\xA0/\xA0"), renderSearchedTitle(title, inputValue));
        }));
      }));
    }

    return null;
  };

  var renderTreeList = function renderTreeList() {
    if (searchList.length) return null;
    var nodeList = [];
    var treeData = traversedTreeDataRef.current;

    var renderTreeNodes = function renderTreeNodes(children) {
      if (!children || !children.length) return;
      children.forEach(function (treeNode, index) {
        // 当前节点层级不在第一级并且父级key不展开时
        if (treeNode.level !== 0 && treeNode.parent && !expandedKeysSet.has(treeNode.parent.nodeKey)) {
          return;
        }

        nodeList.push(_objectSpread({
          indexAtLevel: index,
          childrenLen: children.length
        }, treeNode));
        renderTreeNodes(treeNode.children);
      });
      return;
    };

    renderTreeNodes(treeData);
    return /*#__PURE__*/React.createElement(VirtualList, {
      itemKey: "key",
      itemHeight: 32,
      data: nodeList,
      height: listHeight,
      virtual: virtual,
      prefixCls: "".concat(prefixCls, "-list")
    }, function (treeNode) {
      return /*#__PURE__*/React.createElement(TreeNodeItem, Object.assign({}, treeNode, {
        fieldNames: endFieldNames,
        searchValue: inputValue,
        hover: hover,
        showIcon: showIcon,
        checkable: checkable,
        draggable: draggable,
        showLine: showLine,
        switcherIcon: switcherIcon,
        dragoverInfo: dargoverInfo,
        allLineClickable: allLineClickable,
        checked: checkedKeysSet.has(treeNode.nodeKey),
        expanded: expandedKeysSet.has(treeNode.nodeKey),
        selected: selectedKeysSet.has(treeNode.nodeKey),
        indeterminate: halfCheckedKeys.has(treeNode.nodeKey),
        numberKeysSet: numberKeysSetRef.current,
        isLeaf: getNodeIsLeaf(treeNode, !!loadData),
        loading: loadData && treeNode.nodeKey === curLoadingKey && !treeNode.children,
        renderTreeNode: renderTreeNode,
        renderSearchedTitle: renderSearchedTitle,
        onNodeSelect: onNodeSelect,
        onNodeExpand: onNodeExpand,
        onNodeCheck: onNodeCheck,
        onNodeDragStart: onNodeDragStart,
        onNodeDragEnd: onNodeDragEnd,
        onNodeDragEnter: onNodeDragEnter,
        onNodeDragOver: onNodeDragOver,
        onNodeDragLeave: onNodeDragLeave,
        onNodeDrop: onNodeDrop
      }));
    });
  };

  return /*#__PURE__*/React.createElement("div", Object.assign({}, reset, {
    className: className,
    ref: verticalTreeRef
  }), renderSearch(), renderTreeList(), renderSearchListPanel());
};

var VerticalTree = /*#__PURE__*/React.forwardRef(VerticalTreeRenderFunction);
VerticalTree.defaultProps = {
  // direction: 'horizontal'
  searchListType: 'tree-list',
  hover: 'longtest',
  multiple: false,
  checkable: false,
  virtual: true,
  autoExpandParent: false
};
export default VerticalTree;