"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.VtxZtree = void 0;
var _react = _interopRequireDefault(require("react"));
var _antd = require("antd");
var _isEqual = _interopRequireDefault(require("lodash-es/isEqual"));
var _merge = _interopRequireDefault(require("lodash-es/merge"));
var _debounce = _interopRequireDefault(require("lodash-es/debounce"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _classnames2 = _interopRequireDefault(require("classnames"));
var _config = _interopRequireWildcard(require("../config"));
require("./style/index.less");
var _jsxRuntime = require("react/jsx-runtime");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
 * @Author: yemu
 * @Date: 2021-04-08 22:03:07
 * @LastEditTime: 2021-04-09 10:36:45
 * @LastEditors: yemu
 * @Description: 树形控件
 */
var VtxZtree = exports.VtxZtree = /*#__PURE__*/function (_React$Component) {
  _inherits(VtxZtree, _React$Component);
  var _super = _createSuper(VtxZtree);
  function VtxZtree(props) {
    var _this;
    _classCallCheck(this, VtxZtree);
    _this = _super.call(this, props);
    _this.treeId = "tree-".concat(new Date().getTime(), "-").concat(parseInt(Math.random() * 10000));
    _this.zTreeObj = null;
    _this.treeSetting = {};
    _this.treeNodes = [];
    _this.keyNameMapping = {};
    _this.searchTimeOutId = null;
    _this.loadComplete = false;
    _this.fuzzySearch = (0, _debounce.default)(_this.fuzzySearch.bind(_assertThisInitialized(_this)), 300);
    _this.state = {
      searchVal: '',
      isEmpty: false
    };
    _this.timer = null;
    _this.loadTreeResource();
    return _this;
  }
  _createClass(VtxZtree, [{
    key: "loadTreeResource",
    value: function loadTreeResource() {
      this.loadPromise = new Promise(function (resolve, reject) {
        (0, _config.ensurejQuery)().then(function () {
          if (!$.fn.zTree) {
            $.getScript("".concat(_config.default.ztreeServer, "/js/jquery.ztree.all.min.js"), function () {
              $.getScript("".concat(_config.default.ztreeServer, "/js/jquery.ztree.exhide.min.js"), function () {
                resolve();
              });
            });
            $('<link>').attr({
              rel: 'stylesheet',
              type: 'text/css',
              href: "".concat(_config.default.ztreeServer, "/css/zTreeStyle/zTreeStyle.css")
            }).appendTo('head');
          } else {
            resolve();
          }
        });
      });
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      var _this2 = this;
      this.loadPromise.then(function () {
        _this2.loadComplete = true;
        _this2.refreshTree(_this2.props);
      });
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate(prevProps) {
      if (!this.loadComplete) return;
      if (!(0, _isEqual.default)(prevProps.refreshFlag, this.props.refreshFlag) || !(0, _isEqual.default)(prevProps.data, this.props.data)) {
        this.refreshTree(this.props);
      }
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this.zTreeObj && this.zTreeObj.destroy();
    }

    // 初始化树的配置
  }, {
    key: "initTreeSetting",
    value: function initTreeSetting(props) {
      var t = this;
      // 初始化树的配置
      this.treeSetting = {
        check: {
          enable: !!props.checkable,
          chkboxType: props.checkStrictly ? {
            Y: '',
            N: ''
          } : {
            Y: 'ps',
            N: 'ps'
          }
        },
        view: {
          selectedMulti: !!props.multiple,
          showIcon: true,
          expandSpeed: 'normal',
          showTitle: false,
          fontCss: function fontCss(treeId, treeNode) {
            return treeNode.selectable ? {} : {
              color: '#B9B9B9',
              cursor: 'default'
            };
          }
        },
        callback: {
          beforeClick: function beforeClick(treeId, treeNode) {
            return treeNode.selectable;
          },
          beforeCheck: function beforeCheck(treeId, treeNode) {
            return props.beforeCheck ? props.beforeCheck(treeNode) : true;
          },
          onClick: function onClick(e, treeId, treeNode) {
            console.log('点击节点信息', treeNode, t.props.selectedKeys, typeof props.onClick == 'function');
            if (typeof props.onClick == 'function') {
              var _t$props$selectedKeys;
              var selectedNodes = t.getSelectedNodes();
              var obj = {
                key: treeNode.key,
                event: e,
                treeNode: treeNode,
                selectedNodes: selectedNodes,
                selectedKeys: selectedNodes.map(function (item) {
                  return item.key;
                }),
                selectedNames: selectedNodes.map(function (item) {
                  return item.name;
                })
              };
              if (t.props.supportCancelSelect && ((_t$props$selectedKeys = t.props.selectedKeys) === null || _t$props$selectedKeys === void 0 ? void 0 : _t$props$selectedKeys.length) > 0 && t.props.selectedKeys[0] == treeNode.key) {
                obj = {
                  key: '',
                  event: e,
                  treeNode: {},
                  selectedNodes: [],
                  selectedKeys: [],
                  selectedNames: []
                };
                t.cancelSelectedNodes(t.props.selectedKeys);
              }
              props.onClick(obj);
            }
          },
          onCheck: function onCheck(e, treeId, treeNode) {
            // console.log('勾选节点信息',treeNode)
            if (typeof props.onCheck == 'function') {
              var checkedNodes = t.getCheckedNodes();
              props.onCheck({
                key: treeNode.key,
                isChecked: treeNode.checked,
                treeNode: t.zTreeObj.getChangeCheckedNodes(),
                checkedNodes: checkedNodes,
                checkedKeys: checkedNodes.map(function (item) {
                  return item.key;
                }),
                checkedNames: checkedNodes.map(function (item) {
                  return item.name;
                })
              });
            }
          },
          onExpand: function onExpand(e, treeId, treeNode) {
            // console.log('展开节点信息',treeNode)
            if (typeof props.onExpand == 'function') {
              props.onExpand({
                key: treeNode.key,
                isExpand: true,
                treeNode: treeNode,
                expandedKeys: t.zTreeObj.getNodesByParam('open', true).map(function (item) {
                  return item.key;
                })
              });
            }
          },
          onCollapse: function onCollapse(e, treeId, treeNode) {
            // console.log('收起节点信息',treeNode)
            if (typeof props.onExpand == 'function') {
              props.onExpand({
                key: treeNode.key,
                isExpand: false,
                treeNode: treeNode,
                expandedKeys: t.zTreeObj.getNodesByParam('open', true).map(function (item) {
                  return item.key;
                })
              });
            }
          },
          onRightClick: function onRightClick(e, treeId, treeNode) {
            // console.log('右击节点信息',treeNode);
            if (typeof props.onRightClick == 'function') {
              props.onRightClick({
                event: e,
                key: treeNode.key,
                treeNode: treeNode
              });
            }
          },
          onDblClick: function onDblClick(e, treeId, treeNode) {
            // console.log('双击节点信息',treeNode);
            if (typeof props.onDblClick == 'function') {
              props.onDblClick({
                event: e,
                key: treeNode.key,
                treeNode: treeNode
              });
            }
          }
        }
      };
      // 继承外部配置
      if (_typeof(this.props.customCfg) == 'object') {
        (0, _merge.default)(this.treeSetting, this.props.customCfg);
      }
    }

    // 初始化树的数据，对expandedKeys，checkedKeys做处理
  }, {
    key: "initTreeNodes",
    value: function initTreeNodes(props) {
      var t = this;
      this.keyNameMapping = {};
      if (!Array.isArray(props.data)) {
        this.treeNodes = [];
      } else {
        var checkedKeys = props.checkedKeys || [];
        var expandedKeys = props.expandedKeys || [];
        var chkDisabled = !!props.disableCheckboxAll;
        this.treeNodes = function genNodes(nodes) {
          return nodes.map(function (item) {
            var checked = checkedKeys.indexOf(item.key) != -1;
            var open = expandedKeys.indexOf(item.key) != -1;
            t.keyNameMapping[item.key] = item.name;
            if (Array.isArray(item.children) && item.children.length > 0) {
              return _objectSpread(_objectSpread({
                chkDisabled: chkDisabled,
                selectable: true
              }, item), {}, {
                checked: checked,
                open: open,
                children: genNodes(item.children)
              });
            } else {
              return _objectSpread(_objectSpread({
                chkDisabled: chkDisabled,
                selectable: true
              }, item), {}, {
                checked: checked,
                open: open
              });
            }
          }).map(function (item) {
            if (Array.isArray(item.children) && item.children.length > 0) {
              var newNode = _objectSpread({}, item);
              // 如果子节点全部被勾选，父节点自动勾选
              if (item.children.every(function (item) {
                return item.checked;
              })) {
                newNode.checked = true;
              }
              // 如果配置了自动展开父节点，父节点自动展开
              if (props.autoExpandParent && item.children.some(function (item) {
                return item.open;
              })) {
                newNode.open = true;
              }
              return newNode;
            } else {
              return item;
            }
          });
        }(props.data);
      }
    }

    // 重新生成树
  }, {
    key: "refreshTree",
    value: function refreshTree(newProps) {
      this.zTreeObj && this.zTreeObj.destroy();
      this.initTreeSetting(newProps);
      this.initTreeNodes(newProps);
      this.zTreeObj = $.fn.zTree.init($("#".concat(this.treeId)), this.treeSetting, this.treeNodes);
      if (Array.isArray(newProps.selectedKeys)) {
        this.selectNodes(newProps.selectedKeys, newProps.multiple);
      }
      // 初始化全展开判断
      if (newProps.defaultExpandAll && !newProps.expandedKeys) {
        this.zTreeObj.expandAll(true);
      }
    }

    // 展开或折叠相关节点,expandFlag为true表示展开,false表示折叠
  }, {
    key: "expandNodes",
    value: function expandNodes(expandedKeys) {
      var expandFlag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      for (var i = 0, len = expandedKeys.length; i < len; i++) {
        var node = this.zTreeObj.getNodesByParam('key', expandedKeys[i]).pop();
        if (node) {
          this.zTreeObj.expandNode(node, expandFlag, false, false);
        }
      }
    }

    // 勾选节点, checkedFlag为true表示勾选,false表示取消勾选
  }, {
    key: "checkNodes",
    value: function checkNodes(checkedKeys) {
      var checkedFlag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      for (var i = 0, len = checkedKeys.length; i < len; i++) {
        var node = this.zTreeObj.getNodesByParam('key', checkedKeys[i]).pop();
        if (node) {
          // 隐藏节点的勾选状态也要改变
          node.checked = checkedFlag;
          this.zTreeObj.updateNode(node, true);
          // this.zTreeObj.checkNode(node,checkedFlag,false);
        }
      }
    }

    // 点击选择节点
  }, {
    key: "selectNodes",
    value: function selectNodes(selectedKeys, multiple) {
      for (var i = 0, len = selectedKeys.length; i < len; i++) {
        var node = this.zTreeObj.getNodesByParam('key', selectedKeys[i]).pop();
        if (node) {
          this.zTreeObj.selectNode(node, multiple, true);
        }
      }
    }

    // 取消选择节点
  }, {
    key: "cancelSelectedNodes",
    value: function cancelSelectedNodes(selectedKeys) {
      for (var i = 0, len = selectedKeys.length; i < len; i++) {
        var node = this.zTreeObj.getNodesByParam('key', selectedKeys[i]).pop();
        if (node) {
          this.zTreeObj.cancelSelectedNode(node);
        }
      }
    }
  }, {
    key: "fuzzySearch",
    value: function fuzzySearch(keyworld) {
      var isHighLight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      var callback = arguments.length > 2 ? arguments[2] : undefined;
      var t = this;
      var nameKey = this.zTreeObj.setting.data.key.name; // get the key of the node name
      // isHighLight = isHighLight===false?false:true;//default true, only use false to disable highlight
      // isExpand = isExpand?true:false; // not to expand in default
      this.zTreeObj.setting.view.nameIsHTML = isHighLight; // allow use html in node name for highlight use

      var metaChar = '[\\[\\]\\\\^\\$\\.\\|\\?\\*\\+\\(\\)]'; // js meta characters
      var rexMeta = new RegExp(metaChar, 'gi'); // regular expression to match meta characters

      // searchNodeLazy(keyworld);
      ztreeFilter(t.zTreeObj, keyworld);

      // -----------------------------内部函数----------------------------------
      // keywords filter function
      function ztreeFilter(zTreeObj, _keywords) {
        if (!_keywords) {
          _keywords = ''; // default blank for _keywords
        }

        // function to find the matching node
        function filterFunc(node) {
          if (node && node.oldname && node.oldname.length > 0) {
            node[nameKey] = node.oldname; // recover oldname of the node if exist
          }
          zTreeObj.updateNode(node); // update node to for modifications take effect
          if (_keywords.length == 0) {
            // return true to show all nodes if the keyword is blank
            zTreeObj.showNode(node);
            // zTreeObj.expandNode(node,isExpand);
            return true;
          }
          // transform node name and keywords to lowercase
          if (node[nameKey] && node[nameKey].toLowerCase().indexOf(_keywords.toLowerCase()) != -1) {
            if (isHighLight) {
              // highlight process
              // a new variable 'newKeywords' created to store the keywords information
              // keep the parameter '_keywords' as initial and it will be used in next node
              // process the meta characters in _keywords thus the RegExp can be correctly used in str.replace
              var newKeywords = _keywords.replace(rexMeta, function (matchStr) {
                // add escape character before meta characters
                return '\\' + matchStr;
              });
              node.oldname = node[nameKey]; // store the old name
              var rexGlobal = new RegExp(newKeywords, 'gi'); // 'g' for global,'i' for ignore case
              // use replace(RegExp,replacement) since replace(/substr/g,replacement) cannot be used here
              node[nameKey] = node.oldname.replace(rexGlobal, function (originalText) {
                // highlight the matching words in node name
                var highLightText = '<span style="color: whitesmoke;background-color:#f50;">' + originalText + '</span>';
                return highLightText;
              });
              zTreeObj.updateNode(node); // update node for modifications take effect
            }
            zTreeObj.showNode(node); // show node with matching keywords
            return true; // return true and show this node
          }
          zTreeObj.hideNode(node); // hide node that not matched
          return false; // return false for node not matched
        }
        var nodesShow = zTreeObj.getNodesByFilter(filterFunc); // get all nodes that would be shown
        processShowNodes(zTreeObj, nodesShow, _keywords); // nodes should be reprocessed to show correctly
      }

      /**
       * reprocess of nodes before showing
       */
      function processShowNodes(zTreeObj, nodesShow, _keywords) {
        if (nodesShow && nodesShow.length > 0) {
          // process the ancient nodes if _keywords is not blank
          if (_keywords.length > 0) {
            $.each(nodesShow, function (n, obj) {
              var pathOfOne = obj.getPath(); // get all the ancient nodes including current node
              if (pathOfOne && pathOfOne.length > 0) {
                // i < pathOfOne.length-1 process every node in path except self
                for (var i = 0; i < pathOfOne.length - 1; i++) {
                  zTreeObj.showNode(pathOfOne[i]); // show node
                  zTreeObj.expandNode(pathOfOne[i], true); // expand node
                }
              }
            });
          } else {
            // show all nodes when _keywords is blank and expand the root nodes
            var rootNodes = zTreeObj.getNodesByParam('level', '0'); // get all root nodes
            $.each(rootNodes, function (n, obj) {
              zTreeObj.expandNode(obj, true); // expand all root nodes
            });
          }
        }
        callback && callback(nodesShow);
      }
    }

    // 清空搜索框数据（供外部调用）
  }, {
    key: "clearSearch",
    value: function clearSearch() {
      if (this.state.searchVal.trim() == '') return;
      this.setState({
        searchVal: ''
      });
      this.refreshTree(this.props);
    }

    // 获取所有已被勾选的节点
  }, {
    key: "getCheckedNodes",
    value: function getCheckedNodes() {
      var _this3 = this;
      return this.zTreeObj.getNodesByFilter(function (node) {
        // 节点被勾选（非半勾状态）
        if (_this3.props.checkStrictly) return node.checked;
        return node.checked && node.check_Child_State != 1;
      }).map(function (item) {
        return _objectSpread(_objectSpread({}, item), {}, {
          name: item.oldname || item.name // 搜索树会改变节点的name
        });
      });
    }

    // 获取所有已被点击选中的节点
  }, {
    key: "getSelectedNodes",
    value: function getSelectedNodes() {
      return this.zTreeObj.getSelectedNodes().map(function (item) {
        return _objectSpread(_objectSpread({}, item), {}, {
          name: item.oldname || item.name
        });
      });
    }

    // 展开所有节点（供外部调用）
  }, {
    key: "expandAll",
    value: function expandAll() {
      this.zTreeObj.expandAll(true);
    }

    // 收起所有节点（供外部调用）
  }, {
    key: "collapseAll",
    value: function collapseAll() {
      this.zTreeObj.expandAll(false);
    }
  }, {
    key: "render",
    value: function render() {
      var t = this;
      var _t$props = t.props,
        prefixCls = _t$props.prefixCls,
        showSearch = _t$props.showSearch,
        searchPlaceholder = _t$props.searchPlaceholder;
      return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
        className: (0, _classnames2.default)("".concat(prefixCls, "-wraaper"), _defineProperty({}, "".concat(prefixCls, "-has-search"), showSearch)),
        children: [showSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
          className: "".concat(prefixCls, "-search"),
          children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Input, {
            value: t.state.searchVal,
            placeholder: searchPlaceholder || '请输入要查询的关键字',
            onChange: function onChange(e) {
              var obj = {
                searchVal: e.target.value
              };
              t.setState(obj);
              if (t.timer) {
                clearTimeout(t.timer);
                t.timer = null;
              }
              t.timer = setTimeout(function () {
                var _obj$searchVal;
                t.fuzzySearch((_obj$searchVal = obj.searchVal) === null || _obj$searchVal === void 0 ? void 0 : _obj$searchVal.trim(), true, function (arr) {
                  t.setState({
                    isEmpty: arr.length == 0
                  });
                  if (arr.length !== 0) {
                    if (Array.isArray(t.props.selectedKeys)) {
                      t.selectNodes(t.props.selectedKeys, t.props.multiple);
                    }
                  }
                });
                clearTimeout(t.timer);
                t.timer = null;
              }, 100);
            }
          })
        }), t.state.isEmpty && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
          className: "".concat(prefixCls, "-empty"),
          children: t.props.emptyNode ? t.props.emptyNode : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Empty, {
            description: "\u6682\u65E0\u6570\u636E"
          })
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
          id: this.treeId,
          className: (0, _classnames2.default)('ztree', prefixCls)
        })]
      });
    }
  }]);
  return VtxZtree;
}(_react.default.Component);
_defineProperty(VtxZtree, "defaultProps", {
  showSearch: true,
  prefixCls: 'vtx-ztree'
});
VtxZtree.propTypes = {
  showSearch: _propTypes.default.bool,
  searchPlaceholder: _propTypes.default.string,
  data: _propTypes.default.array,
  refreshFlag: _propTypes.default.number,
  customCfg: _propTypes.default.object,
  checkStrictly: _propTypes.default.bool,
  supportCancelSelect: _propTypes.default.bool,
  emptyNode: _propTypes.default.node
};
var _default = exports.default = VtxZtree;