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

import { usePrefixClass } from '../../hooks/useConfig.js';
import { getTNode } from '../util.js';
import '@vue/composition-api';
import '../../config-provider/useConfig.js';
import '../../config-provider/context.js';
import 'lodash/merge';
import 'lodash/mergeWith';
import '../../_common/js/global-config/default-config.js';
import '../../_common/js/global-config/locale/zh_CN.js';
import '@babel/runtime/helpers/typeof';
import '../../_chunks/dep-2cb61c79.js';
import 'dayjs';
import '@babel/runtime/helpers/defineProperty';
import 'lodash/camelCase';

function useRenderOperations(props) {
  var componentName = usePrefixClass("tree").value;
  var renderOperations = function renderOperations(h) {
    var node = props.node,
      treeScope = props.treeScope;
    var scopedSlots = treeScope.scopedSlots;
    var treeProps = (treeScope === null || treeScope === void 0 ? void 0 : treeScope.treeProps) || {};
    var operations = treeProps.operations;
    var opNode = null;
    if (scopedSlots !== null && scopedSlots !== void 0 && scopedSlots.operations) {
      opNode = scopedSlots.operations({
        node: node === null || node === void 0 ? void 0 : node.getModel()
      });
    } else {
      opNode = getTNode(operations, {
        createElement: h,
        node: node
      });
    }
    if (opNode) {
      opNode = h("span", {
        "class": "".concat(componentName, "__operations"),
        "attrs": {
          "ignore": "active,expand"
        }
      }, [opNode]);
    }
    return opNode;
  };
  return {
    renderOperations: renderOperations
  };
}

export { useRenderOperations as default };
//# sourceMappingURL=useRenderOperations.js.map
