"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));

var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));

var _tslib = require("tslib");

var React = _interopRequireWildcard(require("react"));

var _mobxReact = require("mobx-react");

var _warning = _interopRequireDefault(require("../../../lib/_util/warning"));

var _Base = _interopRequireDefault(require("./Base"));

var _FormField2 = require("../field/FormField");

var _excluded = ["ellipsis", "rel", "children"];

var Link = /*#__PURE__*/function (_FormField) {
  (0, _inherits2["default"])(Link, _FormField);

  var _super = (0, _createSuper2["default"])(Link);

  function Link() {
    (0, _classCallCheck2["default"])(this, Link);
    return _super.apply(this, arguments);
  }

  (0, _createClass2["default"])(Link, [{
    key: "renderWrapper",
    value: function renderWrapper() {
      var _this$props = this.props,
          ellipsis = _this$props.ellipsis,
          rel = _this$props.rel,
          children = _this$props.children,
          restProps = (0, _objectWithoutProperties2["default"])(_this$props, _excluded);
      (0, _warning["default"])((0, _typeof2["default"])(ellipsis) !== 'object', 'Typography.Link `ellipsis` only supports boolean value.');
      var mergedProps = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, restProps), {}, {
        rel: rel === undefined && restProps.target === '_blank' ? 'noopener noreferrer' : rel
      });
      return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Base["default"], (0, _extends2["default"])({}, mergedProps, {
        ellipsis: !!ellipsis,
        component: "a"
      }), this.processRenderer(this.getValue()) || children), this.renderFloatLabel());
    }
  }]);
  return Link;
}(_FormField2.FormField);

Link.displayName = 'Link';
Link.__PRO_TEXT = true;
Link.defaultProps = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, _FormField2.FormField.defaultProps), {}, {
  suffixCls: 'link'
});
Link = (0, _tslib.__decorate)([_mobxReact.observer], Link);
var _default = Link;
exports["default"] = _default;
//# sourceMappingURL=Link.js.map
