UNPKG

3.44 kBJavaScriptView Raw
1import PropTypes from 'prop-types';
2import momentPropTypes from 'react-moment-proptypes';
3import { mutuallyExclusiveProps, nonNegativeInteger } from 'airbnb-prop-types';
4import { SingleDatePickerPhrases } from '../defaultPhrases';
5import getPhrasePropTypes from '../utils/getPhrasePropTypes';
6import IconPositionShape from './IconPositionShape';
7import OrientationShape from './OrientationShape';
8import anchorDirectionShape from './AnchorDirectionShape';
9import openDirectionShape from './OpenDirectionShape';
10import DayOfWeekShape from './DayOfWeekShape';
11import CalendarInfoPositionShape from './CalendarInfoPositionShape';
12import NavPositionShape from './NavPositionShape';
13export default {
14 // required props for a functional interactive SingleDatePicker
15 date: momentPropTypes.momentObj,
16 onDateChange: PropTypes.func.isRequired,
17 focused: PropTypes.bool,
18 onFocusChange: PropTypes.func.isRequired,
19 // input related props
20 id: PropTypes.string.isRequired,
21 placeholder: PropTypes.string,
22 ariaLabel: PropTypes.string,
23 disabled: PropTypes.bool,
24 required: PropTypes.bool,
25 readOnly: PropTypes.bool,
26 screenReaderInputMessage: PropTypes.string,
27 showClearDate: PropTypes.bool,
28 customCloseIcon: PropTypes.node,
29 showDefaultInputIcon: PropTypes.bool,
30 inputIconPosition: IconPositionShape,
31 customInputIcon: PropTypes.node,
32 noBorder: PropTypes.bool,
33 block: PropTypes.bool,
34 small: PropTypes.bool,
35 regular: PropTypes.bool,
36 verticalSpacing: nonNegativeInteger,
37 keepFocusOnInput: PropTypes.bool,
38 // calendar presentation and interaction related props
39 renderMonthText: mutuallyExclusiveProps(PropTypes.func, 'renderMonthText', 'renderMonthElement'),
40 renderMonthElement: mutuallyExclusiveProps(PropTypes.func, 'renderMonthText', 'renderMonthElement'),
41 renderWeekHeaderElement: PropTypes.func,
42 orientation: OrientationShape,
43 anchorDirection: anchorDirectionShape,
44 openDirection: openDirectionShape,
45 horizontalMargin: PropTypes.number,
46 withPortal: PropTypes.bool,
47 withFullScreenPortal: PropTypes.bool,
48 appendToBody: PropTypes.bool,
49 disableScroll: PropTypes.bool,
50 initialVisibleMonth: PropTypes.func,
51 firstDayOfWeek: DayOfWeekShape,
52 numberOfMonths: PropTypes.number,
53 keepOpenOnDateSelect: PropTypes.bool,
54 reopenPickerOnClearDate: PropTypes.bool,
55 renderCalendarInfo: PropTypes.func,
56 calendarInfoPosition: CalendarInfoPositionShape,
57 hideKeyboardShortcutsPanel: PropTypes.bool,
58 daySize: nonNegativeInteger,
59 isRTL: PropTypes.bool,
60 verticalHeight: nonNegativeInteger,
61 transitionDuration: nonNegativeInteger,
62 horizontalMonthPadding: nonNegativeInteger,
63 // navigation related props
64 dayPickerNavigationInlineStyles: PropTypes.object,
65 navPosition: NavPositionShape,
66 navPrev: PropTypes.node,
67 navNext: PropTypes.node,
68 onPrevMonthClick: PropTypes.func,
69 onNextMonthClick: PropTypes.func,
70 onClose: PropTypes.func,
71 // day presentation and interaction related props
72 renderCalendarDay: PropTypes.func,
73 renderDayContents: PropTypes.func,
74 enableOutsideDays: PropTypes.bool,
75 isDayBlocked: PropTypes.func,
76 isOutsideRange: PropTypes.func,
77 isDayHighlighted: PropTypes.func,
78 // internationalization props
79 displayFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
80 monthFormat: PropTypes.string,
81 weekDayFormat: PropTypes.string,
82 phrases: PropTypes.shape(getPhrasePropTypes(SingleDatePickerPhrases)),
83 dayAriaLabelFormat: PropTypes.string
84};
\No newline at end of file