/**
 * tdesign v0.46.4
 * (c) 2022 tdesign
 * @license MIT
 */

import _defineProperty from '@babel/runtime/helpers/defineProperty';
import { renderContent, renderTNodeJSX } from '../utils/render-tnode.js';
import props from './props.js';
import { getClassPrefixMixins } from '../config-provider/config-receiver.js';
import mixins from '../utils/mixins.js';
import '@babel/runtime/helpers/typeof';
import 'vue';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import 'lodash/mergeWith';
import '../config-provider/context.js';
import 'lodash/merge';
import '../_common/js/global-config/default-config.js';
import '../_common/js/global-config/locale/zh_CN.js';
import '../config-provider/type.js';

var classPrefixMixins = getClassPrefixMixins("link");
var _Link = mixins(classPrefixMixins).extend({
  name: "TLink",
  props: props,
  methods: {
    handleClick: function handleClick(e) {
      var _this$onClick;

      if (this.disabled) return;
      this.$emit("click", e);
      (_this$onClick = this.onClick) === null || _this$onClick === void 0 ? void 0 : _this$onClick.call(this, e);
    }
  },
  render: function render() {
    var _ref;

    var h = arguments[0];
    var linkContent = renderContent(this, "default", "content");
    var prefixContent = renderTNodeJSX(this, "prefixIcon");
    var suffixContent = renderTNodeJSX(this, "suffixIcon");
    var linkClass = [this.componentName, this.commonSizeClassName[this.size], "".concat(this.componentName, "--theme-").concat(this.theme), (_ref = {}, _defineProperty(_ref, this.commonStatusClassName.disabled, this.disabled), _defineProperty(_ref, "".concat(this.classPrefix, "-is-underline"), this.underline), _defineProperty(_ref, "".concat(this.componentName, "--hover-").concat(this.hover), !this.disabled), _ref)];
    return h("a", {
      "class": linkClass,
      "attrs": {
        "href": this.disabled || !this.href ? void 0 : this.href,
        "target": this.target
      },
      "on": {
        "click": this.handleClick
      }
    }, [prefixContent && h("span", {
      "class": "".concat(this.componentName, "__prefix-icon")
    }, [prefixContent]), linkContent, suffixContent && h("span", {
      "class": "".concat(this.componentName, "__suffix-icon")
    }, [suffixContent])]);
  }
});

export { _Link as default };
//# sourceMappingURL=link.js.map
