UNPKG

@elastic/eui

Version:

Elastic UI Component Library

622 lines (621 loc) 29.1 kB
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* * The MIT License (MIT) * * Copyright (c) 2018 HackerOne Inc and individual contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ import YearDropdown from "./year_dropdown"; import MonthDropdown from "./month_dropdown"; import MonthYearDropdown from "./month_year_dropdown"; import Month from "./month"; import Time from "./time"; import React from "react"; import PropTypes from "prop-types"; import classnames from "classnames"; import CalendarContainer from "./calendar_container"; import { EuiFocusTrap } from '../../../focus_trap'; import { EuiScreenReaderOnly } from '../../../accessibility/screen_reader_only'; import { EuiButtonIcon } from "../../../button"; import { now, setMonth, getMonth, addMonths, subtractMonths, getStartOfWeek, getStartOfDate, getStartOfMonth, addDays, cloneDate, localizeDate, setYear, getYear, isBefore, isAfter, getLocaleData, getFormattedWeekdayInLocale, getWeekdayShortInLocale, getWeekdayMinInLocale, isSameDay, allDaysDisabledBefore, allDaysDisabledAfter, getEffectiveMinDate, getEffectiveMaxDate } from "./date_utils"; import { jsx as ___EmotionJSX } from "@emotion/react"; var FocusTrapContainer = /*#__PURE__*/React.forwardRef(function (props, ref) { return ___EmotionJSX("div", _extends({ ref: ref, className: "react-datepicker__focusTrap" }, props)); }); var DROPDOWN_FOCUS_CLASSNAMES = ["react-datepicker__year-select", "react-datepicker__month-select", "react-datepicker__month-year-select"]; var isDropdownSelect = function isDropdownSelect() { var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var classNames = (element.className || "").split(/\s+/); return DROPDOWN_FOCUS_CLASSNAMES.some(function (testClassname) { return classNames.indexOf(testClassname) >= 0; }); }; var Calendar = /*#__PURE__*/function (_React$Component) { function Calendar(props) { var _this; _classCallCheck(this, Calendar); _this = _callSuper(this, Calendar, [props]); _defineProperty(_this, "setMonthRef", function (node) { _this.monthRef = node; }); _defineProperty(_this, "setYearRef", function (node) { _this.yearRef = node; }); _defineProperty(_this, "handleOnDropdownToggle", function (isOpen, dropdown) { _this.setState({ pauseFocusTrap: isOpen }); if (!isOpen) { var element = dropdown === 'month' ? _this.monthRef : _this.yearRef; if (element) { // The focus trap has been unpaused and will reinitialize focus // but does so on the wrong element (calendar) // This refocuses the previous element (dropdown button). // Duration arrived at by trial-and-error. setTimeout(function () { return element.focus(); }, 25); } } }); _defineProperty(_this, "handleClickOutside", function (event) { _this.props.onClickOutside(event); }); _defineProperty(_this, "handleDropdownFocus", function (event) { if (isDropdownSelect(event.target)) { _this.props.onDropdownFocus(); } }); _defineProperty(_this, "getDateInView", function () { var _this$props = _this.props, preSelection = _this$props.preSelection, selected = _this$props.selected, openToDate = _this$props.openToDate, utcOffset = _this$props.utcOffset; var minDate = getEffectiveMinDate(_this.props); var maxDate = getEffectiveMaxDate(_this.props); var current = now(utcOffset); var initialDate = openToDate || selected || preSelection; if (initialDate) { return initialDate; } else { if (minDate && isBefore(current, minDate)) { return minDate; } else if (maxDate && isAfter(current, maxDate)) { return maxDate; } } return current; }); _defineProperty(_this, "localizeDate", function (date) { return localizeDate(date, _this.props.locale); }); _defineProperty(_this, "increaseMonth", function () { _this.setState({ date: addMonths(cloneDate(_this.state.date), 1) }, function () { return _this.handleMonthChange(_this.state.date); }); }); _defineProperty(_this, "decreaseMonth", function () { _this.setState({ date: subtractMonths(cloneDate(_this.state.date), 1) }, function () { return _this.handleMonthChange(_this.state.date); }); }); _defineProperty(_this, "handleDayClick", function (day, event) { return _this.props.onSelect(day, event); }); _defineProperty(_this, "handleDayMouseEnter", function (day) { return _this.setState({ selectingDate: day }); }); _defineProperty(_this, "handleMonthMouseLeave", function () { return _this.setState({ selectingDate: null }); }); _defineProperty(_this, "handleYearChange", function (date) { if (_this.props.onYearChange) { _this.props.onYearChange(date); } if (_this.props.accessibleMode) { _this.handleSelectionChange(date); } }); _defineProperty(_this, "handleMonthChange", function (date) { if (_this.props.onMonthChange) { _this.props.onMonthChange(date); } if (_this.props.accessibleMode) { _this.handleSelectionChange(date); } }); _defineProperty(_this, "handleSelectionChange", function (date) { if (_this.props.adjustDateOnChange) { _this.props.updateSelection(date); } else { _this.props.updateSelection(getStartOfMonth(cloneDate(date))); } }); _defineProperty(_this, "handleMonthYearChange", function (date) { _this.handleYearChange(date); _this.handleMonthChange(date); }); _defineProperty(_this, "changeYear", function (year) { _this.setState({ date: setYear(cloneDate(_this.state.date), year) }, function () { return _this.handleYearChange(_this.state.date); }); }); _defineProperty(_this, "changeMonth", function (month) { _this.setState({ date: setMonth(cloneDate(_this.state.date), month) }, function () { return _this.handleMonthChange(_this.state.date); }); }); _defineProperty(_this, "changeMonthYear", function (monthYear) { _this.setState({ date: setYear(setMonth(cloneDate(_this.state.date), getMonth(monthYear)), getYear(monthYear)) }, function () { return _this.handleMonthYearChange(_this.state.date); }); }); _defineProperty(_this, "header", function () { var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.date; var startOfWeek = getStartOfWeek(cloneDate(date)); var dayNames = []; if (_this.props.showWeekNumbers) { dayNames.push(___EmotionJSX("div", { key: "W", className: "react-datepicker__day-name" }, _this.props.weekLabel || "#")); } return dayNames.concat([0, 1, 2, 3, 4, 5, 6].map(function (offset) { var day = addDays(cloneDate(startOfWeek), offset); var localeData = getLocaleData(day); var weekDayName = _this.formatWeekday(localeData, day); var weekDayNameLong = localeData.weekdays(day); return ___EmotionJSX("div", { key: offset, className: "react-datepicker__day-name" }, ___EmotionJSX("span", { "aria-hidden": "true" }, weekDayName), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, weekDayNameLong))); })); }); _defineProperty(_this, "formatWeekday", function (localeData, day) { if (_this.props.formatWeekDay) { return getFormattedWeekdayInLocale(localeData, day, _this.props.formatWeekDay); } return _this.props.useWeekdaysShort ? getWeekdayShortInLocale(localeData, day) : getWeekdayMinInLocale(localeData, day); }); _defineProperty(_this, "renderPreviousMonthButton", function () { if (_this.props.renderCustomHeader) { return; } var allPrevDaysDisabled = allDaysDisabledBefore(_this.state.date, "month", _this.props); if (!_this.props.forceShowMonthNavigation && !_this.props.showDisabledMonthNavigation && allPrevDaysDisabled || _this.props.showTimeSelectOnly) { return; } var classes = ["react-datepicker__navigation", "react-datepicker__navigation--previous"]; var clickHandler = _this.decreaseMonth; if (allPrevDaysDisabled && _this.props.showDisabledMonthNavigation) { classes.push("react-datepicker__navigation--previous--disabled"); clickHandler = null; } return ___EmotionJSX(EuiButtonIcon, { iconType: "sortLeft", size: "s", color: "text", className: classes.join(" "), onClick: clickHandler, disabled: !_this.props.accessibleMode, "aria-label": _this.props.previousMonthButtonLabel, title: _this.props.previousMonthButtonLabel }); }); _defineProperty(_this, "renderNextMonthButton", function () { if (_this.props.renderCustomHeader) { return; } var allNextDaysDisabled = allDaysDisabledAfter(_this.state.date, "month", _this.props); if (!_this.props.forceShowMonthNavigation && !_this.props.showDisabledMonthNavigation && allNextDaysDisabled || _this.props.showTimeSelectOnly) { return; } var classes = ["react-datepicker__navigation", "react-datepicker__navigation--next"]; if (_this.props.showTimeSelect) { classes.push("react-datepicker__navigation--next--with-time"); } if (_this.props.todayButton) { classes.push("react-datepicker__navigation--next--with-today-button"); } var clickHandler = _this.increaseMonth; if (allNextDaysDisabled && _this.props.showDisabledMonthNavigation) { classes.push("react-datepicker__navigation--next--disabled"); clickHandler = null; } return ___EmotionJSX(EuiButtonIcon, { iconType: "sortRight", size: "s", color: "text", className: classes.join(" "), onClick: clickHandler, disabled: !_this.props.accessibleMode, "aria-label": _this.props.nextMonthButtonLabel, title: _this.props.nextMonthButtonLabel }); }); _defineProperty(_this, "renderYearDropdown", function () { var overrideHide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (!_this.props.showYearDropdown || overrideHide) { return; } return ___EmotionJSX(YearDropdown, { adjustDateOnChange: _this.props.adjustDateOnChange, date: _this.state.date, onSelect: _this.props.onSelect, setOpen: _this.props.setOpen, dropdownMode: _this.props.dropdownMode, onChange: _this.changeYear, minDate: _this.props.minDate, maxDate: _this.props.maxDate, year: getYear(_this.state.date), scrollableYearDropdown: _this.props.scrollableYearDropdown, yearDropdownItemNumber: _this.props.yearDropdownItemNumber, accessibleMode: _this.props.accessibleMode, onDropdownToggle: _this.handleOnDropdownToggle, buttonRef: _this.setYearRef }); }); _defineProperty(_this, "renderMonthDropdown", function () { var overrideHide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (!_this.props.showMonthDropdown || overrideHide) { return; } return ___EmotionJSX(MonthDropdown, { dropdownMode: _this.props.dropdownMode, locale: _this.props.locale, dateFormat: _this.props.dateFormat, onChange: _this.changeMonth, month: getMonth(_this.state.date), useShortMonthInDropdown: _this.props.useShortMonthInDropdown, accessibleMode: _this.props.accessibleMode, onDropdownToggle: _this.handleOnDropdownToggle, buttonRef: _this.setMonthRef }); }); _defineProperty(_this, "renderMonthYearDropdown", function () { var overrideHide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (!_this.props.showMonthYearDropdown || overrideHide) { return; } return ___EmotionJSX(MonthYearDropdown, { dropdownMode: _this.props.dropdownMode, locale: _this.props.locale, dateFormat: _this.props.dateFormat, onChange: _this.changeMonthYear, minDate: _this.props.minDate, maxDate: _this.props.maxDate, date: _this.state.date, scrollableMonthYearDropdown: _this.props.scrollableMonthYearDropdown, accessibleMode: _this.props.accessibleMode }); }); _defineProperty(_this, "renderTodayButton", function () { if (!_this.props.todayButton || _this.props.showTimeSelectOnly) { return; } return ___EmotionJSX("div", { className: "react-datepicker__today-button", onClick: function onClick(e) { return _this.props.onSelect(getStartOfDate(now(_this.props.utcOffset)), e); } }, _this.props.todayButton); }); _defineProperty(_this, "renderDefaultHeader", function (_ref) { var monthDate = _ref.monthDate, i = _ref.i; return ___EmotionJSX("div", { className: "react-datepicker__header" }, ___EmotionJSX("div", { className: "react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(_this.props.dropdownMode), onFocus: _this.handleDropdownFocus }, _this.renderMonthDropdown(i !== 0), _this.renderMonthYearDropdown(i !== 0), _this.renderYearDropdown(i !== 0)), ___EmotionJSX("div", { className: "react-datepicker__day-names" }, _this.header(monthDate))); }); _defineProperty(_this, "renderCustomHeader", function (_ref2) { var monthDate = _ref2.monthDate, i = _ref2.i; if (i !== 0) { return null; } var prevMonthButtonDisabled = allDaysDisabledBefore(_this.state.date, "month", _this.props); var nextMonthButtonDisabled = allDaysDisabledAfter(_this.state.date, "month", _this.props); return ___EmotionJSX("div", { className: "react-datepicker__header react-datepicker__header--custom", onFocus: _this.props.onDropdownFocus }, _this.props.renderCustomHeader(_objectSpread(_objectSpread({}, _this.state), {}, { changeMonth: _this.changeMonth, changeYear: _this.changeYear, decreaseMonth: _this.decreaseMonth, increaseMonth: _this.increaseMonth, prevMonthButtonDisabled: prevMonthButtonDisabled, nextMonthButtonDisabled: nextMonthButtonDisabled })), ___EmotionJSX("div", { className: "react-datepicker__day-names" }, _this.header(monthDate))); }); _defineProperty(_this, "renderMonths", function () { if (_this.props.showTimeSelectOnly) { return; } var monthList = []; for (var i = 0; i < _this.props.monthsShown; ++i) { var monthDate = addMonths(cloneDate(_this.state.date), i); var monthKey = "month-".concat(i); monthList.push(___EmotionJSX("div", { key: monthKey, ref: function ref(div) { _this.monthContainer = div; }, className: "react-datepicker__month-container" }, _this.props.renderCustomHeader ? _this.renderCustomHeader({ monthDate: monthDate, i: i }) : _this.renderDefaultHeader({ monthDate: monthDate, i: i }), ___EmotionJSX(Month, { day: monthDate, dayClassName: _this.props.dayClassName, onDayClick: _this.handleDayClick, onDayMouseEnter: _this.handleDayMouseEnter, onMouseLeave: _this.handleMonthMouseLeave, onWeekSelect: _this.props.onWeekSelect, formatWeekNumber: _this.props.formatWeekNumber, minDate: _this.props.minDate, maxDate: _this.props.maxDate, excludeDates: _this.props.excludeDates, highlightDates: _this.props.highlightDates, selectingDate: _this.state.selectingDate, includeDates: _this.props.includeDates, inline: _this.props.inline, fixedHeight: _this.props.fixedHeight, filterDate: _this.props.filterDate, preSelection: _this.props.preSelection, selected: _this.props.selected, selectsStart: _this.props.selectsStart, selectsEnd: _this.props.selectsEnd, showWeekNumbers: _this.props.showWeekNumbers, startDate: _this.props.startDate, endDate: _this.props.endDate, peekNextMonth: _this.props.peekNextMonth, utcOffset: _this.props.utcOffset, setOpen: _this.props.setOpen, shouldCloseOnSelect: _this.props.shouldCloseOnSelect, renderDayContents: _this.props.renderDayContents, disabledKeyboardNavigation: _this.props.disabledKeyboardNavigation, updateSelection: _this.props.updateSelection, accessibleMode: _this.props.accessibleMode }))); } return monthList; }); _defineProperty(_this, "renderTimeSection", function () { if (_this.props.showTimeSelect && (_this.state.monthContainer || _this.props.showTimeSelectOnly)) { return ___EmotionJSX(Time, { selected: _this.props.selected, onChange: _this.props.onTimeChange, format: _this.props.timeFormat, includeTimes: _this.props.includeTimes, intervals: _this.props.timeIntervals, minTime: _this.props.minTime, maxTime: _this.props.maxTime, excludeTimes: _this.props.excludeTimes, timeCaption: _this.props.timeCaption, todayButton: _this.props.todayButton, showMonthDropdown: _this.props.showMonthDropdown, showMonthYearDropdown: _this.props.showMonthYearDropdown, showYearDropdown: _this.props.showYearDropdown, withPortal: _this.props.withPortal, monthRef: _this.state.monthContainer, injectTimes: _this.props.injectTimes, accessibleMode: _this.props.accessibleMode }); } }); _this.state = { date: _this.localizeDate(_this.getDateInView()), selectingDate: null, monthContainer: null, pauseFocusTrap: false }; _this.monthRef = /*#__PURE__*/React.createRef(); _this.yearRef = /*#__PURE__*/React.createRef(); return _this; } _inherits(Calendar, _React$Component); return _createClass(Calendar, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; // monthContainer height is needed in time component // to determine the height for the ul in the time component // setState here so height is given after final component // layout is rendered if (this.props.showTimeSelect) { this.assignMonthContainer = function () { _this2.setState({ monthContainer: _this2.monthContainer }); }(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.preSelection && !isSameDay(this.props.preSelection, prevProps.preSelection)) { this.setState({ date: this.localizeDate(this.props.preSelection) }); } else if (this.props.openToDate && !isSameDay(this.props.openToDate, prevProps.openToDate)) { this.setState({ date: this.localizeDate(this.props.openToDate) }); } } }, { key: "render", value: function render() { var Container = this.props.container || CalendarContainer; var classes = classnames("react-datepicker", this.props.className, { "react-datepicker--time-only": this.props.showTimeSelectOnly, "react-datepicker--non-interactive": !this.props.isCalendarInteractive }); var trapFocus = this.props.accessibleMode && !this.props.inline; var initialFocusTarget = this.props.showTimeSelectOnly ? ".react-datepicker__time-box--accessible" : ".react-datepicker__month--accessible"; if (trapFocus) { return ___EmotionJSX(Container, { className: classes }, ___EmotionJSX(EuiFocusTrap, { disabled: this.state.pauseFocusTrap || !this.props.enableFocusTrap, className: "react-datepicker__focusTrap", initialFocus: initialFocusTarget, onClickOutside: this.handleClickOutside }, this.renderPreviousMonthButton(), this.renderNextMonthButton(), this.renderMonths(), this.renderTodayButton(), this.renderTimeSection(), this.props.children)); } else { return ___EmotionJSX(Container, { className: classes }, this.renderPreviousMonthButton(), this.renderNextMonthButton(), this.renderMonths(), this.renderTodayButton(), this.renderTimeSection(), this.props.children); } } }], [{ key: "defaultProps", get: function get() { return { onDropdownFocus: function onDropdownFocus() {}, monthsShown: 1, forceShowMonthNavigation: false, timeCaption: "Time", previousMonthButtonLabel: "Previous Month", nextMonthButtonLabel: "Next Month", enableFocusTrap: true }; } }]); }(React.Component); _defineProperty(Calendar, "propTypes", { adjustDateOnChange: PropTypes.bool, className: PropTypes.string, children: PropTypes.node, container: PropTypes.func, dateFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired, dayClassName: PropTypes.func, disabledKeyboardNavigation: PropTypes.bool, dropdownMode: PropTypes.oneOf(["scroll", "select"]), endDate: PropTypes.object, excludeDates: PropTypes.array, filterDate: PropTypes.func, fixedHeight: PropTypes.bool, formatWeekNumber: PropTypes.func, highlightDates: PropTypes.instanceOf(Map), includeDates: PropTypes.array, includeTimes: PropTypes.array, injectTimes: PropTypes.array, inline: PropTypes.bool, locale: PropTypes.string, maxDate: PropTypes.object, minDate: PropTypes.object, monthsShown: PropTypes.number, onClickOutside: PropTypes.func.isRequired, onMonthChange: PropTypes.func, onYearChange: PropTypes.func, forceShowMonthNavigation: PropTypes.bool, onDropdownFocus: PropTypes.func, onSelect: PropTypes.func.isRequired, onWeekSelect: PropTypes.func, showTimeSelect: PropTypes.bool, showTimeSelectOnly: PropTypes.bool, timeFormat: PropTypes.string, timeIntervals: PropTypes.number, onTimeChange: PropTypes.func, minTime: PropTypes.object, maxTime: PropTypes.object, excludeTimes: PropTypes.array, timeCaption: PropTypes.string, openToDate: PropTypes.object, peekNextMonth: PropTypes.bool, scrollableYearDropdown: PropTypes.bool, scrollableMonthYearDropdown: PropTypes.bool, preSelection: PropTypes.object, selected: PropTypes.object, selectsEnd: PropTypes.bool, selectsStart: PropTypes.bool, showMonthDropdown: PropTypes.bool, showMonthYearDropdown: PropTypes.bool, showWeekNumbers: PropTypes.bool, showYearDropdown: PropTypes.bool, startDate: PropTypes.object, todayButton: PropTypes.node, useWeekdaysShort: PropTypes.bool, formatWeekDay: PropTypes.func, withPortal: PropTypes.bool, utcOffset: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), weekLabel: PropTypes.string, yearDropdownItemNumber: PropTypes.number, setOpen: PropTypes.func, shouldCloseOnSelect: PropTypes.bool, useShortMonthInDropdown: PropTypes.bool, showDisabledMonthNavigation: PropTypes.bool, previousMonthButtonLabel: PropTypes.string, nextMonthButtonLabel: PropTypes.string, renderCustomHeader: PropTypes.func, renderDayContents: PropTypes.func, updateSelection: PropTypes.func.isRequired, accessibleMode: PropTypes.bool, enableFocusTrap: PropTypes.bool }); export { Calendar as default };