"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const index = require("../../../hooks/use-namespace/index.js");
const index$1 = require("../../text/index.js");
const tokens = require("./tokens.js");
const Vue = require("vue");
var tree_node_content_vue_vue_type_script_lang_default = Vue.defineComponent({
  name: "ElTreeNodeContent",
  props: {
    node: {
      type: Object,
      required: true
    },
    renderContent: Function
  },
  setup(props) {
    const ns = index.useNamespace("tree");
    const nodeInstance = Vue.inject(tokens.NODE_INSTANCE_INJECTION_KEY);
    const tree = Vue.inject(tokens.ROOT_TREE_INJECTION_KEY);
    return () => {
      const node = props.node;
      const { data, store } = node;
      return props.renderContent ? props.renderContent(Vue.h, {
        _self: nodeInstance,
        node,
        data,
        store
      }) : Vue.renderSlot(tree.ctx.slots, "default", {
        node,
        data
      }, () => [Vue.h(index$1.ElText, {
        tag: "span",
        truncated: true,
        class: ns.be("node", "label")
      }, () => [node.label])]);
    };
  }
});
exports.default = tree_node_content_vue_vue_type_script_lang_default;
