'use strict';

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

var vue = require('vue');
var iconsVue = require('@ant-design/icons-vue');
require('../../../utils/index.cjs');
require('../../../vue-components/index.cjs');
require('../../../locale/index.cjs');
var index = require('../../checkbox/index.cjs');
var LocaleReceiver = require('../../locale-provider/src/LocaleReceiver.cjs');
var props = require('./props.cjs');
var _class = require('../../../utils/dom/class.cjs');
var en_US = require('../../../locale/lang/en_US.cjs');
var transButton = require('../../../vue-components/transition/src/transButton.cjs');

function noop() {
}
var ListItem = /* @__PURE__ */ vue.defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "ListItem",
  inheritAttrs: false,
  props: props.transferListItemProps(),
  emits: ["click", "remove"],
  setup(props, {
    emit
  }) {
    return () => {
      const {
        renderedText,
        renderedEl,
        item,
        checked,
        disabled,
        prefixCls,
        showRemove
      } = props;
      const className = _class.classNames({
        [`${prefixCls}-content-item`]: true,
        [`${prefixCls}-content-item-disabled`]: disabled || item.disabled
      });
      let title;
      if (typeof renderedText === "string" || typeof renderedText === "number")
        title = String(renderedText);
      return vue.createVNode(LocaleReceiver.default, {
        "componentName": "Transfer",
        "defaultLocale": en_US.default.Transfer
      }, {
        default: (transferLocale) => {
          const labelNode = vue.createVNode("span", {
            "class": `${prefixCls}-content-item-text`
          }, [renderedEl]);
          if (showRemove) {
            return vue.createVNode("li", {
              "class": className,
              "title": title
            }, [labelNode, vue.createVNode(transButton.TransButton, {
              "disabled": disabled || item.disabled,
              "class": `${prefixCls}-content-item-remove`,
              "aria-label": transferLocale.remove,
              "onClick": () => {
                emit("remove", item);
              }
            }, {
              default: () => [vue.createVNode(iconsVue.DeleteOutlined, null, null)]
            })]);
          }
          return vue.createVNode("li", {
            "class": className,
            "title": title,
            "onClick": disabled || item.disabled ? noop : () => emit("click", item)
          }, [vue.createVNode(index.Checkbox, {
            "class": `${prefixCls}-checkbox`,
            "checked": checked,
            "disabled": disabled || item.disabled
          }, null), labelNode]);
        }
      });
    };
  }
});

exports.default = ListItem;
//# sourceMappingURL=ListItem.cjs.map
