'use strict';

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

exports.__esModule = true;
exports.FileUpload = void 0;

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

var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _react = _interopRequireDefault(require("react"));

var _FormGroup2 = require("./FormGroup");

var _FileUploadControl = require("./FileUploadControl");

var FileUpload =
/*#__PURE__*/
function (_FormGroup) {
  (0, _inheritsLoose2.default)(FileUpload, _FormGroup);

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

  var _proto = FileUpload.prototype;

  _proto.renderInput = function renderInput(hasError) {
    var bsStyle = this.props.bsStyle;
    var ariaDescProps = this.getAriaDescProps(hasError);
    return _react.default.createElement(_FileUploadControl.FileUploadControl, (0, _extends2.default)({}, this.getSafeProps(this.props), {
      ref: "control",
      hasFormGroupContainer: true,
      bsStyle: bsStyle
    }, ariaDescProps));
  };

  return FileUpload;
}(_FormGroup2.FormGroup);

exports.FileUpload = FileUpload;
(0, _defineProperty2.default)(FileUpload, "propTypes", Object.assign({}, _FormGroup2.FormGroup.propTypes));
(0, _defineProperty2.default)(FileUpload, "defaultProps", Object.assign({}, _FormGroup2.FormGroup.defaultProps, {
  testAutomationId: 'fileUpload'
}));