'use strict';

import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React from 'react';
import { FormGroup } from './FormGroup';
import { TextInputControl } from './TextInputControl';
export var TextInput =
/*#__PURE__*/
function (_FormGroup) {
  _inheritsLoose(TextInput, _FormGroup);

  function TextInput() {
    return _FormGroup.apply(this, arguments) || this;
  }

  var _proto = TextInput.prototype;

  _proto.renderInput = function renderInput(hasError) {
    var _this$props = this.props,
        readOnly = _this$props.readOnly,
        props = _objectWithoutPropertiesLoose(_this$props, ["readOnly"]);

    var readOnlyProp = readOnly === undefined ? {} : {
      readOnly: readOnly
    };
    var ariaDescProps = this.getAriaDescProps(hasError);
    return React.createElement(TextInputControl, _extends({}, this.getSafeProps(props), {
      ref: "control"
    }, ariaDescProps, {
      hasFormGroupContainer: true
    }, readOnlyProp));
  };

  return TextInput;
}(FormGroup);

_defineProperty(TextInput, "propTypes", Object.assign({}, FormGroup.propTypes));

_defineProperty(TextInput, "defaultProps", Object.assign({}, FormGroup.defaultProps, {
  testAutomationId: 'textInput'
}));