import { defineComponent, createVNode } from 'vue';
import { DeleteOutlined } from '@ant-design/icons-vue';
import '../../../utils/index.mjs';
import '../../../vue-components/index.mjs';
import '../../../locale/index.mjs';
import { Checkbox } from '../../checkbox/index.mjs';
import LocaleReceiver from '../../locale-provider/src/LocaleReceiver.mjs';
import { transferListItemProps } from './props.mjs';
import { classNames } from '../../../utils/dom/class.mjs';
import localeValues from '../../../locale/lang/en_US.mjs';
import { TransButton } from '../../../vue-components/transition/src/transButton.mjs';

function noop() {
}
var ListItem = /* @__PURE__ */ defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "ListItem",
  inheritAttrs: false,
  props: transferListItemProps(),
  emits: ["click", "remove"],
  setup(props, {
    emit
  }) {
    return () => {
      const {
        renderedText,
        renderedEl,
        item,
        checked,
        disabled,
        prefixCls,
        showRemove
      } = props;
      const className = 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 createVNode(LocaleReceiver, {
        "componentName": "Transfer",
        "defaultLocale": localeValues.Transfer
      }, {
        default: (transferLocale) => {
          const labelNode = createVNode("span", {
            "class": `${prefixCls}-content-item-text`
          }, [renderedEl]);
          if (showRemove) {
            return createVNode("li", {
              "class": className,
              "title": title
            }, [labelNode, createVNode(TransButton, {
              "disabled": disabled || item.disabled,
              "class": `${prefixCls}-content-item-remove`,
              "aria-label": transferLocale.remove,
              "onClick": () => {
                emit("remove", item);
              }
            }, {
              default: () => [createVNode(DeleteOutlined, null, null)]
            })]);
          }
          return createVNode("li", {
            "class": className,
            "title": title,
            "onClick": disabled || item.disabled ? noop : () => emit("click", item)
          }, [createVNode(Checkbox, {
            "class": `${prefixCls}-checkbox`,
            "checked": checked,
            "disabled": disabled || item.disabled
          }, null), labelNode]);
        }
      });
    };
  }
});

export { ListItem as default };
//# sourceMappingURL=ListItem.mjs.map
