"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;exports.__esModule = true;exports.NativeDateInput = void 0;var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));



var _utils = require("./utils");
var _NativeDateInput2 = require("./NativeDateInput.styles");









var DEFAULT_MIN_DATE = '1900-01-01';
var DEFAULT_MAX_DATE = '2099-12-31';var

NativeDateInput = exports.NativeDateInput = /*#__PURE__*/function (_React$Component) {function NativeDateInput() {var _this;for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;

























    /**
     * @public
     */_this.
    focus = function () {
      if (_this.input) {
        _this.input.focus();
      }
    };

    /**
     * @public
     */_this.
    click = function () {
      if (_this.input) {
        _this.input.click();
      }
    };_this.

    refInput = function (element) {
      _this.input = element;
    };return _this;}(0, _inheritsLoose2.default)(NativeDateInput, _React$Component);var _proto = NativeDateInput.prototype;_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement("input", { type: 'date', max: this.props.maxDate ? (0, _utils.getDateForNative)(this.props.maxDate) : DEFAULT_MAX_DATE, min: this.props.minDate ? (0, _utils.getDateForNative)(this.props.minDate) : DEFAULT_MIN_DATE, value: (0, _utils.getDateForNative)(this.props.value), onChange: function onChange(e) {if (_this2.props.onValueChange) {_this2.props.onValueChange((0, _utils.getDateForComponent)(e.target.value));}}, className: _NativeDateInput2.jsStyles.inputTypeDate(), ref: this.refInput, disabled: this.props.disabled, tabIndex: -1 });};return NativeDateInput;}(_react.default.Component);NativeDateInput.__KONTUR_REACT_UI__ = 'NativeDatePicker';NativeDateInput.displayName = 'NativeDatePicker';