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

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

  var _proto = InputCounter.prototype;

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

    var ariaDescProps = this.getAriaDescProps(hasError);
    return React.createElement(InputCounterControl, _extends({}, this.getSafeProps(props), {
      ref: "control",
      hasFormGroupContainer: true,
      minValue: minValue,
      maxValue: maxValue
    }, ariaDescProps));
  };

  return InputCounter;
}(FormGroup);

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

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