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

import { _ as _defineProperty } from '../_chunks/dep-2db7b3ec.mjs';
import { defineComponent, computed, provide, createVNode, TransitionGroup } from 'vue';
import '../hooks/useConfig.mjs';
import { useTNodeDefault } from '../hooks/tnode.mjs';
import props from './props.mjs';
import { useCLASSNAMES, injectKey } from './constants.mjs';
import useTree from './useTree.mjs';
import useExposeFunc from './hooks/useExposeFunc.mjs';
import { useConfig } from '../config-provider/useConfig.mjs';
import '../_chunks/dep-255303ba.mjs';
import '../_chunks/dep-5717e263.mjs';
import '../_chunks/dep-eba0ea6e.mjs';
import '../_chunks/dep-469b4ae0.mjs';
import '../_chunks/dep-a8bcacea.mjs';
import '../_chunks/dep-406cd044.mjs';
import '../_chunks/dep-42cc3015.mjs';
import '../_chunks/dep-b57180d0.mjs';
import '../_chunks/dep-c8d7b6b4.mjs';
import '../_chunks/dep-2bc37d52.mjs';
import '../_chunks/dep-3da99438.mjs';
import '../_chunks/dep-327559e8.mjs';
import '../_chunks/dep-b2235f26.mjs';
import '../_chunks/dep-8b989474.mjs';
import '../_chunks/dep-1372b2d3.mjs';
import '../_chunks/dep-9a85dac1.mjs';
import '../utils/render-tnode.mjs';
import '../_chunks/dep-888e80c4.mjs';
import '../_chunks/dep-334a4f6b.mjs';
import '../_chunks/dep-e5eb9f23.mjs';
import '../_chunks/dep-9fe2ef12.mjs';
import '../_chunks/dep-672e7d1a.mjs';
import '../_chunks/dep-4d7a675b.mjs';
import '../_chunks/dep-2e7f59b1.mjs';
import '../_chunks/dep-1434aa15.mjs';
import '../_chunks/dep-9262ee2f.mjs';
import '../_chunks/dep-876fb3ec.mjs';
import '../_chunks/dep-84acf3c2.mjs';
import '../_chunks/dep-b8d7992c.mjs';
import '../_common/js/tree/tree-store.mjs';
import '../_chunks/dep-ccbc47f4.mjs';
import '../_chunks/dep-3f21269a.mjs';
import '../_chunks/dep-c42916c7.mjs';
import '../_chunks/dep-bc1d737a.mjs';
import '../_chunks/dep-855db8bc.mjs';
import '../_chunks/dep-6884627f.mjs';
import '../_chunks/dep-8d3e9aa3.mjs';
import '../_chunks/dep-0fc02184.mjs';
import '../_chunks/dep-1e566bb5.mjs';
import '../_chunks/dep-dcc83161.mjs';
import '../_chunks/dep-f1994936.mjs';
import '../_chunks/dep-9cf86cf1.mjs';
import '../_chunks/dep-a87f3e4c.mjs';
import '../_chunks/dep-42a19209.mjs';
import 'mitt';
import '../_common/js/tree/tree-node.mjs';
import '../_chunks/dep-38ee6a8f.mjs';
import '../_chunks/dep-bf1e33c8.mjs';
import '../_chunks/dep-ed5ebb35.mjs';
import '../_chunks/dep-01e3f446.mjs';
import '../_chunks/dep-c81c0ee4.mjs';
import '../_chunks/dep-0d3dd4b5.mjs';
import '../_common/js/tree/tree-node-model.mjs';
import '../_chunks/dep-78847b2e.mjs';
import '../_chunks/dep-35e3b1aa.mjs';
import '../_chunks/dep-8932db97.mjs';
import '../_chunks/dep-550c24c1.mjs';
import '../_chunks/dep-350764bc.mjs';
import '../_chunks/dep-c989dff3.mjs';
import '../_common/js/log/log.mjs';
import '../_common/js/log/index.mjs';
import '../hooks/useDefaultValue.mjs';
import '../hooks/useVModel.mjs';
import './tree-item.mjs';
import '@ldesign/icons-vue-next';
import '../checkbox/index.mjs';
import '../utils/withInstall.mjs';
import '../checkbox/checkbox.mjs';
import '../form/hooks.mjs';
import '../hooks/useRipple.mjs';
import '../utils/set-style.mjs';
import '../hooks/useKeepAnimation.mjs';
import '../_chunks/dep-40d69a9c.mjs';
import '../_chunks/dep-345e1be3.mjs';
import '../_common/js/global-config/default-config.mjs';
import '../_common/js/global-config/locale/zh_CN.mjs';
import '../_chunks/dep-9888611c.mjs';
import '../_chunks/dep-697a1365.mjs';
import '../checkbox/props.mjs';
import '../checkbox/constants.mjs';
import '../_chunks/dep-095107f7.mjs';
import '../config-provider/type.mjs';
import '../checkbox/group.mjs';
import '../_chunks/dep-85ed244c.mjs';
import '../hooks/slot.mjs';
import '../checkbox/checkbox-group-props.mjs';
import '../checkbox/style/css.mjs';
import '../checkbox/type.mjs';
import '../loading/index.mjs';
import '../loading/directive.mjs';
import '../loading/plugin.mjs';
import '../utils/dom.mjs';
import '../utils/easing.mjs';
import '../loading/loading.mjs';
import '../hooks/useTeleport.mjs';
import '../loading/props.mjs';
import '../loading/icon/gradient.mjs';
import '../_common/js/loading/circle-adapter.mjs';
import '../_common/js/utils/set-style.mjs';
import '../_common/js/utils/helper.mjs';
import '../_chunks/dep-60fae668.mjs';
import '../loading/style/css.mjs';
import '../loading/type.mjs';
import '../hooks/useGlobalIcon.mjs';
import './util.mjs';
import './hooks/useDraggable.mjs';
import '../_chunks/dep-4f3ad3f8.mjs';
import '../_chunks/dep-9b6cf76d.mjs';
import '../_chunks/dep-f709f709.mjs';
import './hooks/useOnDrag.mjs';

var _TdTree = defineComponent({
  name: "TTree",
  props: props,
  setup: function setup(props2, _ref) {
    var expose = _ref.expose,
      slots = _ref.slots;
    var _useConfig = useConfig("tree"),
      globalConfig = _useConfig.globalConfig,
      t = _useConfig.t;
    var CLASS_NAMES = useCLASSNAMES();
    var renderTNodeJSX = useTNodeDefault();
    var statusContext = 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
      };
    });
    provide(injectKey, statusContext);
    var _useTree = useTree(props2),
      treeStore = _useTree.treeStore,
      treeNodeViews = _useTree.treeNodeViews;
    useExposeFunc(treeStore, expose);
    var classList = computed(function () {
      var _ref2;
      return [CLASS_NAMES.value.tree, (_ref2 = {}, _defineProperty(_ref2, CLASS_NAMES.value.disabled, props2.disabled), _defineProperty(_ref2, CLASS_NAMES.value.treeHoverAble, props2.hover), _defineProperty(_ref2, CLASS_NAMES.value.treeCheckable, props2.checkable), _defineProperty(_ref2, CLASS_NAMES.value.treeTransition, props2.transition), _defineProperty(_ref2, CLASS_NAMES.value.treeBlockNode, props2.expandOnClickNode), _ref2)];
    });
    return function () {
      return createVNode("div", {
        "class": classList.value
      }, [treeNodeViews.value.length === 0 ? createVNode("div", {
        "class": CLASS_NAMES.value.treeEmpty
      }, [renderTNodeJSX("empty", {
        defaultNode: t(globalConfig.value.empty)
      })]) : createVNode(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];
        }
      })]);
    };
  }
});

export { _TdTree as default };
//# sourceMappingURL=td-tree.mjs.map
