/**
 * ldesign v0.4.2
 * (c) 2023 ldesign
 * @license MIT
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var vue = require('vue');
var configProvider_useConfig = require('../config-provider/useConfig.js');
var hooks_tnode = require('../hooks/tnode.js');
var tree_props = require('./props.js');
var tree_constants = require('./constants.js');
var tree_useTree = require('./useTree.js');
var tree_hooks_useExposeFunc = require('./hooks/useExposeFunc.js');
require('lodash/cloneDeep');
require('lodash/isFunction');
require('lodash/isString');
require('../config-provider/context.js');
require('lodash/mergeWith');
require('lodash/merge');
require('lodash/isArray');
require('../_common/js/global-config/default-config.js');
require('../_common/js/global-config/locale/zh_CN.js');
require('@babel/runtime/helpers/typeof');
require('../_chunks/dep-7f0559c3.js');
require('dayjs');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../utils/render-tnode.js');
require('lodash/isEmpty');
require('lodash/isObject');
require('../hooks/useConfig.js');
require('@babel/runtime/helpers/slicedToArray');
require('../_common/js/tree/tree-store.js');
require('@babel/runtime/helpers/classCallCheck');
require('@babel/runtime/helpers/createClass');
require('lodash/isNumber');
require('lodash/difference');
require('lodash/isPlainObject');
require('mitt');
require('../_common/js/tree/tree-node.js');
require('@babel/runtime/helpers/asyncToGenerator');
require('@babel/runtime/helpers/toConsumableArray');
require('@babel/runtime/regenerator');
require('lodash/isNull');
require('lodash/uniqueId');
require('lodash/isNil');
require('lodash/get');
require('../_common/js/log/log.js');
require('../_common/js/tree/tree-node-model.js');
require('lodash/isUndefined');
require('lodash/isBoolean');
require('lodash/pick');
require('lodash/omit');
require('../hooks/useDefaultValue.js');
require('../hooks/useVModel.js');
require('./tree-item.js');
require('@ldesign/icons-vue-next');
require('../checkbox/index.js');
require('../utils/withInstall.js');
require('../checkbox/checkbox.js');
require('../form/hooks.js');
require('../hooks/useRipple.js');
require('../utils/set-style.js');
require('../hooks/useKeepAnimation.js');
require('../checkbox/props.js');
require('../checkbox/constants.js');
require('../checkbox/group.js');
require('lodash/intersection');
require('../hooks/slot.js');
require('../checkbox/checkbox-group-props.js');
require('../loading/index.js');
require('../loading/directive.js');
require('../loading/plugin.js');
require('../utils/dom.js');
require('../utils/easing.js');
require('../loading/loading.js');
require('../hooks/useTeleport.js');
require('../loading/props.js');
require('../loading/icon/gradient.js');
require('../_common/js/loading/circle-adapter.js');
require('../_common/js/utils/set-style.js');
require('../_common/js/utils/helper.js');
require('@babel/runtime/helpers/objectWithoutProperties');
require('../hooks/useGlobalIcon.js');
require('./util.js');
require('./hooks/useDraggable.js');
require('lodash/throttle');
require('./hooks/useOnDrag.js');
require('lodash/upperFirst');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);

var _TdTree = vue.defineComponent({
  name: "TTree",
  props: tree_props["default"],
  setup: function setup(props2, _ref) {
    var expose = _ref.expose,
      slots = _ref.slots;
    var _useConfig = configProvider_useConfig.useConfig("tree"),
      globalConfig = _useConfig.globalConfig,
      t = _useConfig.t;
    var CLASS_NAMES = tree_constants.useCLASSNAMES();
    var renderTNodeJSX = hooks_tnode.useTNodeDefault();
    var statusContext = vue.computed(function () {
      var checkProps = props2.checkProps,
        empty = props2.empty,
        icon = props2.icon,
        label = props2.label,
        line = props2.line,
        disableCheck = props2.disableCheck,
        operations = props2.operations;
      return {
        checkProps: checkProps,
        empty: empty,
        icon: icon,
        label: label,
        line: line,
        disableCheck: disableCheck,
        operations: operations,
        scopedSlots: slots
      };
    });
    vue.provide(tree_constants.injectKey, statusContext);
    var _useTree = tree_useTree["default"](props2),
      treeStore = _useTree.treeStore,
      treeNodeViews = _useTree.treeNodeViews;
    tree_hooks_useExposeFunc["default"](treeStore, expose);
    var classList = vue.computed(function () {
      var _ref2;
      return [CLASS_NAMES.value.tree, (_ref2 = {}, _defineProperty__default["default"](_ref2, CLASS_NAMES.value.disabled, props2.disabled), _defineProperty__default["default"](_ref2, CLASS_NAMES.value.treeHoverAble, props2.hover), _defineProperty__default["default"](_ref2, CLASS_NAMES.value.treeCheckable, props2.checkable), _defineProperty__default["default"](_ref2, CLASS_NAMES.value.treeTransition, props2.transition), _defineProperty__default["default"](_ref2, CLASS_NAMES.value.treeBlockNode, props2.expandOnClickNode), _ref2)];
    });
    return function () {
      return vue.createVNode("div", {
        "class": classList.value
      }, [treeNodeViews.value.length === 0 ? vue.createVNode("div", {
        "class": CLASS_NAMES.value.treeEmpty
      }, [renderTNodeJSX("empty", {
        defaultNode: t(globalConfig.value.empty)
      })]) : vue.createVNode(vue.TransitionGroup, {
        "name": CLASS_NAMES.value.treeNodeToggle,
        "tag": "div",
        "enter-active-class": CLASS_NAMES.value.treeNodeEnter,
        "leave-active-class": CLASS_NAMES.value.treeNodeLeave
      }, {
        "default": function _default() {
          return [treeNodeViews.value];
        }
      })]);
    };
  }
});

exports["default"] = _TdTree;
//# sourceMappingURL=td-tree.js.map
