'use strict';

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

var vue = require('vue');
require('../../../utils/index.cjs');
var _class = require('../../../utils/dom/class.cjs');

function renderExpandIcon(locale) {
  return function expandIcon({
    prefixCls,
    onExpand,
    record,
    expanded,
    expandable
  }) {
    const iconPrefix = `${prefixCls}-row-expand-icon`;
    return vue.createVNode("button", {
      "type": "button",
      "onClick": (e) => {
        onExpand(record, e);
        e.stopPropagation();
      },
      "class": _class.classNames(iconPrefix, {
        [`${iconPrefix}-spaced`]: !expandable,
        [`${iconPrefix}-expanded`]: expandable && expanded,
        [`${iconPrefix}-collapsed`]: expandable && !expanded
      }),
      "aria-label": expanded ? locale.collapse : locale.expand,
      "aria-expanded": expanded
    }, null);
  };
}

exports.default = renderExpandIcon;
//# sourceMappingURL=ExpandIcon.cjs.map
