import _extends from "@babel/runtime/helpers/extends";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React from 'react';
import _ from 'lodash';
import 'react-dates/initialize';
import { FormGroup } from '../FormGroup';
import { SingleDatePickerInputControl } from '../DateTimePicker/SingleDatePickerInputControl';
export var SingleDatePicker =
/*#__PURE__*/
function (_FormGroup) {
  _inheritsLoose(SingleDatePicker, _FormGroup);

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

  var _proto = SingleDatePicker.prototype;

  _proto.filterGroupProps = function filterGroupProps(props) {
    return _.omit(props, ['inputProps', 'hasMomentFormat', 'hasDateFormat', 'locale', 'timeFormat', 'isValidDate']);
  };

  _proto.renderInput = function renderInput(hasError) {
    return React.createElement(SingleDatePickerInputControl, _extends({}, this.getSafeProps(this.props), {
      ref: "control",
      hasFormGroupContainer: true
    }, this.getAriaDescProps(hasError)));
  };

  return SingleDatePicker;
}(FormGroup);

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

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