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

'use strict';

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

var hooks_useConfig = require('../../hooks/useConfig.js');
var tree_util = require('../util.js');
require('@vue/composition-api');
require('../../config-provider/useConfig.js');
require('../../config-provider/context.js');
require('lodash/merge');
require('lodash/mergeWith');
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-7c884501.js');
require('dayjs');
require('@babel/runtime/helpers/defineProperty');
require('lodash/camelCase');

function useRenderOperations(props) {
  var componentName = hooks_useConfig.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 = tree_util.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
  };
}

exports["default"] = useRenderOperations;
//# sourceMappingURL=useRenderOperations.js.map
