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

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

  var _proto = Select.prototype;

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

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

  return Select;
}(FormGroup);

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

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