import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import _typeof from "@babel/runtime/helpers/typeof";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper";
var _excluded = ["ellipsis", "children"];
import { __decorate } from "tslib";
import * as React from 'react';
import warning from '../../../es/_util/warning';
import { observer } from 'mobx-react';
import omit from 'lodash/omit';
import Base from './Base';
import { FormField } from '../field/FormField';

var Text = /*#__PURE__*/function (_FormField) {
  _inherits(Text, _FormField);

  var _super = _createSuper(Text);

  function Text() {
    _classCallCheck(this, Text);

    return _super.apply(this, arguments);
  }

  _createClass(Text, [{
    key: "mergedEllipsis",
    get: function get() {
      var ellipsis = this.props.ellipsis;

      if (ellipsis && _typeof(ellipsis) === 'object') {
        return omit(ellipsis, ['expandable', 'rows']);
      }

      return ellipsis;
    }
  }, {
    key: "renderWrapper",
    value: function renderWrapper() {
      var _this$props = this.props,
          ellipsis = _this$props.ellipsis,
          children = _this$props.children,
          restProps = _objectWithoutProperties(_this$props, _excluded);

      warning(_typeof(ellipsis) !== 'object' || !ellipsis || !('expandable' in ellipsis) && !('rows' in ellipsis), 'Typography.Text `ellipsis` do not support `expandable` or `rows` props.');
      return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Base, _extends({}, restProps, {
        ellipsis: this.mergedEllipsis,
        component: "span"
      }), this.processRenderer(this.getValue()) || children), this.renderFloatLabel());
    }
  }]);

  return Text;
}(FormField);

Text.displayName = 'Text';
Text.__PRO_TEXT = true;
Text.defaultProps = _objectSpread(_objectSpread({}, FormField.defaultProps), {}, {
  suffixCls: 'text'
});
Text = __decorate([observer], Text);
export default Text;
//# sourceMappingURL=Text.js.map
