'use strict';

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

var vue = require('vue');
require('../hooks/index.js');
var classNames = require('../_util/classNames.js');
var index = require('./style/index.js');
var useConfigInject = require('../config-provider/hooks/useConfigInject.js');

const checkableTagProps = () => ({
  "prefixCls": String,
  "checked": {
    type: Boolean,
    default: void 0
  },
  "onChange": {
    type: Function
  },
  "onClick": {
    type: Function
  },
  "onUpdate:checked": Function
});
const CheckableTag = /* @__PURE__ */ vue.defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "ACheckableTag",
  inheritAttrs: false,
  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(() => classNames.default(prefixCls.value, hashId.value, {
      [`${prefixCls.value}-checkable`]: true,
      [`${prefixCls.value}-checkable-checked`]: props.checked
    }));
    return () => {
      var _a;
      return wrapSSR(vue.createVNode("span", vue.mergeProps(attrs, {
        "class": cls.value,
        "onClick": handleClick
      }), [(_a = slots.default) == null ? void 0 : _a.call(slots)]));
    };
  }
});

exports.default = CheckableTag;
//# sourceMappingURL=CheckableTag.js.map
