'use strict';

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

var vue = require('vue');
require('../../../utils/index.cjs');
var useConfigInject = require('../../config-provider/src/hooks/useConfigInject.cjs');
var index = require('../style/index.cjs');
var props = require('./props.cjs');
var _class = require('../../../utils/dom/class.cjs');

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

exports.default = ACheckableTag;
//# sourceMappingURL=CheckableTag.cjs.map
