import { defineComponent, computed, createVNode } from 'vue';
import '../../../utils/index.mjs';
import useConfigInject from '../../config-provider/src/hooks/useConfigInject.mjs';
import useStyle from '../style/index.mjs';
import { checkableTagProps } from './props.mjs';
import { classNames } from '../../../utils/dom/class.mjs';

var ACheckableTag = /* @__PURE__ */ defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "ACheckableTag",
  inheritAttrs: false,
  props: checkableTagProps(),
  // emits: ['update:checked', 'change', 'click'],
  setup(props, {
    slots,
    emit,
    attrs
  }) {
    const {
      prefixCls
    } = useConfigInject("tag", props);
    const [wrapSSR, hashId] = useStyle(prefixCls);
    const handleClick = (e) => {
      const {
        checked
      } = props;
      emit("update:checked", !checked);
      emit("change", !checked);
      emit("click", e);
    };
    const cls = computed(() => classNames(prefixCls.value, hashId.value, {
      [`${prefixCls.value}-checkable`]: true,
      [`${prefixCls.value}-checkable-checked`]: props.checked
    }));
    return () => {
      var _a;
      return wrapSSR(createVNode("span", {
        ...attrs,
        "class": [cls.value, attrs.class],
        "onClick": handleClick
      }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]));
    };
  }
});

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