'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 { TextAreaControl } from './TextAreaControl';
export var TextArea =
/*#__PURE__*/
function (_FormGroup) {
  _inheritsLoose(TextArea, _FormGroup);

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

  var _proto = TextArea.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(TextAreaControl, _extends({}, this.getSafeProps(props), {
      ref: "control"
    }, ariaDescProps, {
      hasFormGroupContainer: true
    }, readOnlyProp));
  };

  return TextArea;
}(FormGroup);

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

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