/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

import { renderContent } from '../../utils/render-node.js';
import { emitEvent } from '../../utils/event.js';
import { getClassPrefixMixins } from '../config-provider/config-receiver.js';
import mixins from '../../utils/mixins.js';
import { CheckTagProps } from './props.js';
import 'vue';
import 'lodash';
import '../../utils/helper.js';
import 'lodash/camelCase';
import 'lodash/mergeWith';
import '../config-provider/context.js';
import '../../_chunks/dep-def4c2ce.js';

const classPrefixMixins = getClassPrefixMixins("tag");
var _CheckTag = mixins(classPrefixMixins).extend({
  name: "LCheckTag",
  props: {
    ...CheckTagProps
  },
  computed: {
    tagClass() {
      return [`${this.componentName}`, `${this.componentName}--check`, `${this.componentName}--default`, this.commonSizeClassName[this.size], {
        [`${this.componentName}--checked`]: !this.disabled && this.checked,
        [`${this.classPrefix}-is-disabled`]: this.disabled,
        [`${this.componentName}--disabled`]: this.disabled
      }];
    }
  },
  methods: {
    handleClick(e) {
      if (!this.disabled) {
        emitEvent(this, "click", {
          e
        });
        emitEvent(this, "change", !this.checked);
      }
    }
  },
  render() {
    const h = arguments[0];
    const tagContent = renderContent(this, "default", "content");
    return h("span", {
      "class": this.tagClass,
      "on": {
        "click": this.handleClick
      }
    }, [tagContent]);
  }
});

export { _CheckTag as default };
//# sourceMappingURL=check-tag.js.map
