"use strict";

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

var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");

_Object$defineProperty(exports, "__esModule", {
  value: true
});

exports.default = void 0;

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

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));

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

var _pickers = require("@material-ui/pickers");

var _helpers = require("../utils/helpers");

// @flow
var DateField = function DateField(_ref) {
  var value = _ref.value,
      _onChange = _ref.onChange,
      otherProps = (0, _objectWithoutProperties2.default)(_ref, ["value", "onChange"]);
  var valueAsDate = (0, _helpers.parseDateString)(value);
  return /*#__PURE__*/_react.default.createElement(_pickers.DatePicker, (0, _extends2.default)({
    fullWidth: true,
    variant: "inline",
    inputVariant: "outlined",
    margin: "normal",
    format: "dd/MM/yyyy",
    autoOk: true,
    value: valueAsDate,
    onChange: function onChange(date) {
      return _onChange((0, _helpers.getDateString)(date));
    }
  }, otherProps));
};

var _default = DateField;
exports.default = _default;
//# sourceMappingURL=DateField.js.map