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

'use strict';

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

var utils_renderNode = require('../../utils/render-node.js');
var utils_event = require('../../utils/event.js');
var components_configProvider_configReceiver = require('../config-provider/config-receiver.js');
var utils_mixins = require('../../utils/mixins.js');
var components_tag_props = require('./props.js');
require('vue');
require('lodash');
require('../../utils/helper.js');
require('lodash/camelCase');
require('lodash/mergeWith');
require('../config-provider/context.js');
require('../../chunks/zh_CN.js');

const classPrefixMixins = components_configProvider_configReceiver.getClassPrefixMixins("tag");
var _CheckTag = utils_mixins["default"](classPrefixMixins).extend({
  name: "LCheckTag",
  props: {
    ...components_tag_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) {
        utils_event.emitEvent(this, "click", {
          e
        });
        utils_event.emitEvent(this, "change", !this.checked);
      }
    }
  },
  render() {
    const h = arguments[0];
    const tagContent = utils_renderNode.renderContent(this, "default", "content");
    return h("span", {
      "class": this.tagClass,
      "on": {
        "click": this.handleClick
      }
    }, [tagContent]);
  }
});

exports["default"] = _CheckTag;
//# sourceMappingURL=check-tag.js.map
