UNPKG

react-dates

Version:

A responsive and accessible date range picker component built with React

60 lines (49 loc) 1.96 kB
import { PropTypes } from 'react'; import momentPropTypes from 'react-moment-proptypes'; import { nonNegativeInteger } from 'airbnb-prop-types'; import { SingleDatePickerPhrases } from '../defaultPhrases'; import getPhrasePropTypes from '../utils/getPhrasePropTypes'; import OrientationShape from '../shapes/OrientationShape'; import anchorDirectionShape from '../shapes/AnchorDirectionShape'; export default { // required props for a functional interactive SingleDatePicker date: momentPropTypes.momentObj, onDateChange: PropTypes.func.isRequired, focused: PropTypes.bool, onFocusChange: PropTypes.func.isRequired, // input related props id: PropTypes.string.isRequired, placeholder: PropTypes.string, disabled: PropTypes.bool, required: PropTypes.bool, screenReaderInputMessage: PropTypes.string, showClearDate: PropTypes.bool, customCloseIcon: PropTypes.node, // calendar presentation and interaction related props orientation: OrientationShape, anchorDirection: anchorDirectionShape, horizontalMargin: PropTypes.number, withPortal: PropTypes.bool, withFullScreenPortal: PropTypes.bool, initialVisibleMonth: PropTypes.func, numberOfMonths: PropTypes.number, keepOpenOnDateSelect: PropTypes.bool, reopenPickerOnClearDate: PropTypes.bool, renderCalendarInfo: PropTypes.func, daySize: nonNegativeInteger, // navigation related props navPrev: PropTypes.node, navNext: PropTypes.node, onPrevMonthClick: PropTypes.func, onNextMonthClick: PropTypes.func, // day presentation and interaction related props renderDay: PropTypes.func, enableOutsideDays: PropTypes.bool, isDayBlocked: PropTypes.func, isOutsideRange: PropTypes.func, isDayHighlighted: PropTypes.func, // internationalization props displayFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), monthFormat: PropTypes.string, phrases: PropTypes.shape(getPhrasePropTypes(SingleDatePickerPhrases)), };