@birdnet/advanced-react-dates 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +67 -0
- package/.eslintrc +66 -0
- package/.nvmrc +1 -0
- package/.nyc_output/4d8efcd220c2aec1f2b4ffd49d875001.json +1 -0
- package/.nyc_output/66d34779498a5d49bcf9d757dfc7fdb5.json +1 -0
- package/.nyc_output/8ca7e04140934515928bc7d4ae476b73.json +1 -0
- package/.nyc_output/afc270bb597bfc50e690436959c2ae54.json +1 -0
- package/.nycrc +19 -0
- package/.travis.yml +13 -0
- package/CHANGELOG.md +665 -0
- package/CLAUDE.md +56 -0
- package/INTHEWILD.md +9 -0
- package/LICENSE +21 -0
- package/README.md +421 -2
- package/constants.js +2 -0
- package/esm/components/CalendarDay.js +321 -0
- package/esm/components/CalendarIcon.js +11 -0
- package/esm/components/CalendarMonth.js +254 -0
- package/esm/components/CalendarMonthGrid.js +365 -0
- package/esm/components/CalendarWeek.js +11 -0
- package/esm/components/ChevronDown.js +11 -0
- package/esm/components/ChevronUp.js +11 -0
- package/esm/components/CloseButton.js +12 -0
- package/esm/components/CustomizableCalendarDay.js +341 -0
- package/esm/components/DateInput.js +344 -0
- package/esm/components/DateRangePicker.js +647 -0
- package/esm/components/DateRangePickerInput.js +341 -0
- package/esm/components/DateRangePickerInputController.js +348 -0
- package/esm/components/DayPicker.js +1167 -0
- package/esm/components/DayPickerKeyboardShortcuts.js +364 -0
- package/esm/components/DayPickerNavigation.js +314 -0
- package/esm/components/DayPickerRangeController.js +1202 -0
- package/esm/components/DayPickerSingleDateController.js +690 -0
- package/esm/components/KeyboardShortcutRow.js +69 -0
- package/esm/components/LeftArrow.js +11 -0
- package/esm/components/RightArrow.js +11 -0
- package/esm/components/SingleDatePicker.js +605 -0
- package/esm/components/SingleDatePickerInput.js +264 -0
- package/esm/components/SingleDatePickerInputController.js +260 -0
- package/esm/constants.js +28 -0
- package/esm/defaultPhrases.js +225 -0
- package/esm/index.js +20 -0
- package/esm/initialize.js +2 -0
- package/esm/shapes/AnchorDirectionShape.js +3 -0
- package/esm/shapes/CalendarInfoPositionShape.js +3 -0
- package/esm/shapes/DateRangePickerShape.js +101 -0
- package/esm/shapes/DayOfWeekShape.js +3 -0
- package/esm/shapes/DisabledShape.js +3 -0
- package/esm/shapes/FocusedInputShape.js +3 -0
- package/esm/shapes/IconPositionShape.js +3 -0
- package/esm/shapes/ModifiersShape.js +18 -0
- package/esm/shapes/NavPositionShape.js +3 -0
- package/esm/shapes/OpenDirectionShape.js +3 -0
- package/esm/shapes/OrientationShape.js +3 -0
- package/esm/shapes/ScrollableOrientationShape.js +3 -0
- package/esm/shapes/SingleDatePickerShape.js +90 -0
- package/esm/theme/DefaultTheme.js +176 -0
- package/esm/utils/calculateDimension.js +28 -0
- package/esm/utils/disableScroll.js +67 -0
- package/esm/utils/getActiveElement.js +3 -0
- package/esm/utils/getCalendarDaySettings.js +48 -0
- package/esm/utils/getCalendarMonthWeeks.js +37 -0
- package/esm/utils/getCalendarMonthWidth.js +4 -0
- package/esm/utils/getDetachedContainerStyles.js +36 -0
- package/esm/utils/getInputHeight.js +42 -0
- package/esm/utils/getNumberOfCalendarMonthWeeks.js +11 -0
- package/esm/utils/getPhrase.js +7 -0
- package/esm/utils/getPhrasePropTypes.js +9 -0
- package/esm/utils/getPooledMoment.js +8 -0
- package/esm/utils/getPreviousMonthMemoLast.js +9 -0
- package/esm/utils/getResponsiveContainerStyles.js +8 -0
- package/esm/utils/getSelectedDateOffset.js +8 -0
- package/esm/utils/getTransformStyles.js +8 -0
- package/esm/utils/getVisibleDays.js +42 -0
- package/esm/utils/isAfterDay.js +7 -0
- package/esm/utils/isBeforeDay.js +13 -0
- package/esm/utils/isDayVisible.js +38 -0
- package/esm/utils/isInclusivelyAfterDay.js +6 -0
- package/esm/utils/isInclusivelyBeforeDay.js +6 -0
- package/esm/utils/isNextDay.js +7 -0
- package/esm/utils/isNextMonth.js +6 -0
- package/esm/utils/isPrevMonth.js +6 -0
- package/esm/utils/isPreviousDay.js +7 -0
- package/esm/utils/isSameDay.js +7 -0
- package/esm/utils/isSameMonth.js +7 -0
- package/esm/utils/isTransitionEndSupported.js +3 -0
- package/esm/utils/modifiers.js +94 -0
- package/esm/utils/noflip.js +10 -0
- package/esm/utils/registerCSSInterfaceWithDefaultTheme.js +5 -0
- package/esm/utils/registerInterfaceWithDefaultTheme.js +6 -0
- package/esm/utils/toISODateString.js +12 -0
- package/esm/utils/toISOMonthString.js +12 -0
- package/esm/utils/toLocalizedDateString.js +8 -0
- package/esm/utils/toMomentObject.js +7 -0
- package/index.js +2 -0
- package/initialize.js +2 -0
- package/karma.conf.js +82 -0
- package/lib/components/CalendarDay.js +327 -0
- package/lib/components/CalendarIcon.js +18 -0
- package/lib/components/CalendarMonth.js +259 -0
- package/lib/components/CalendarMonthGrid.js +372 -0
- package/lib/components/CalendarWeek.js +18 -0
- package/lib/components/ChevronDown.js +18 -0
- package/lib/components/ChevronUp.js +18 -0
- package/lib/components/CloseButton.js +19 -0
- package/lib/components/CustomizableCalendarDay.js +347 -0
- package/lib/components/DateInput.js +351 -0
- package/lib/components/DateRangePicker.js +653 -0
- package/lib/components/DateRangePickerInput.js +348 -0
- package/lib/components/DateRangePickerInputController.js +354 -0
- package/lib/components/DayPicker.js +1175 -0
- package/lib/components/DayPickerKeyboardShortcuts.js +371 -0
- package/lib/components/DayPickerNavigation.js +321 -0
- package/lib/components/DayPickerRangeController.js +1208 -0
- package/lib/components/DayPickerSingleDateController.js +695 -0
- package/lib/components/KeyboardShortcutRow.js +76 -0
- package/lib/components/LeftArrow.js +18 -0
- package/lib/components/RightArrow.js +18 -0
- package/lib/components/SingleDatePicker.js +611 -0
- package/lib/components/SingleDatePickerInput.js +271 -0
- package/lib/components/SingleDatePickerInputController.js +266 -0
- package/lib/constants.js +34 -0
- package/lib/css/_datepicker.css +886 -0
- package/lib/defaultPhrases.js +231 -0
- package/lib/index.js +146 -0
- package/lib/initialize.js +5 -0
- package/lib/shapes/AnchorDirectionShape.js +10 -0
- package/lib/shapes/CalendarInfoPositionShape.js +10 -0
- package/lib/shapes/DateRangePickerShape.js +108 -0
- package/lib/shapes/DayOfWeekShape.js +10 -0
- package/lib/shapes/DisabledShape.js +10 -0
- package/lib/shapes/FocusedInputShape.js +10 -0
- package/lib/shapes/IconPositionShape.js +10 -0
- package/lib/shapes/ModifiersShape.js +25 -0
- package/lib/shapes/NavPositionShape.js +10 -0
- package/lib/shapes/OpenDirectionShape.js +10 -0
- package/lib/shapes/OrientationShape.js +10 -0
- package/lib/shapes/ScrollableOrientationShape.js +10 -0
- package/lib/shapes/SingleDatePickerShape.js +97 -0
- package/lib/theme/DefaultTheme.js +182 -0
- package/lib/utils/calculateDimension.js +34 -0
- package/lib/utils/disableScroll.js +75 -0
- package/lib/utils/getActiveElement.js +9 -0
- package/lib/utils/getCalendarDaySettings.js +55 -0
- package/lib/utils/getCalendarMonthWeeks.js +44 -0
- package/lib/utils/getCalendarMonthWidth.js +10 -0
- package/lib/utils/getDetachedContainerStyles.js +41 -0
- package/lib/utils/getInputHeight.js +48 -0
- package/lib/utils/getNumberOfCalendarMonthWeeks.js +18 -0
- package/lib/utils/getPhrase.js +13 -0
- package/lib/utils/getPhrasePropTypes.js +16 -0
- package/lib/utils/getPooledMoment.js +15 -0
- package/lib/utils/getPreviousMonthMemoLast.js +15 -0
- package/lib/utils/getResponsiveContainerStyles.js +15 -0
- package/lib/utils/getSelectedDateOffset.js +14 -0
- package/lib/utils/getTransformStyles.js +14 -0
- package/lib/utils/getVisibleDays.js +49 -0
- package/lib/utils/isAfterDay.js +14 -0
- package/lib/utils/isBeforeDay.js +20 -0
- package/lib/utils/isDayVisible.js +45 -0
- package/lib/utils/isInclusivelyAfterDay.js +13 -0
- package/lib/utils/isInclusivelyBeforeDay.js +13 -0
- package/lib/utils/isNextDay.js +14 -0
- package/lib/utils/isNextMonth.js +13 -0
- package/lib/utils/isPrevMonth.js +13 -0
- package/lib/utils/isPreviousDay.js +14 -0
- package/lib/utils/isSameDay.js +14 -0
- package/lib/utils/isSameMonth.js +14 -0
- package/lib/utils/isTransitionEndSupported.js +9 -0
- package/lib/utils/modifiers.js +102 -0
- package/lib/utils/noflip.js +16 -0
- package/lib/utils/registerCSSInterfaceWithDefaultTheme.js +12 -0
- package/lib/utils/registerInterfaceWithDefaultTheme.js +13 -0
- package/lib/utils/toISODateString.js +19 -0
- package/lib/utils/toISOMonthString.js +19 -0
- package/lib/utils/toLocalizedDateString.js +15 -0
- package/lib/utils/toMomentObject.js +14 -0
- package/package.json +141 -4
- package/scripts/.eslintrc +7 -0
- package/scripts/buildCSS.js +37 -0
- package/scripts/pure-component-fallback.js +70 -0
- package/scripts/renderAllComponents.jsx +25 -0
- package/src/components/CalendarDay.jsx +366 -0
- package/src/components/CalendarIcon.jsx +3 -0
- package/src/components/CalendarMonth.jsx +300 -0
- package/src/components/CalendarMonthGrid.jsx +427 -0
- package/src/components/CalendarWeek.jsx +17 -0
- package/src/components/ChevronDown.jsx +3 -0
- package/src/components/ChevronUp.jsx +3 -0
- package/src/components/CloseButton.jsx +3 -0
- package/src/components/CustomizableCalendarDay.jsx +382 -0
- package/src/components/DateInput.jsx +401 -0
- package/src/components/DateRangePicker.jsx +777 -0
- package/src/components/DateRangePickerInput.jsx +434 -0
- package/src/components/DateRangePickerInputController.jsx +379 -0
- package/src/components/DayPicker.jsx +1407 -0
- package/src/components/DayPickerKeyboardShortcuts.jsx +443 -0
- package/src/components/DayPickerNavigation.jsx +445 -0
- package/src/components/DayPickerRangeController.jsx +1409 -0
- package/src/components/DayPickerSingleDateController.jsx +769 -0
- package/src/components/KeyboardShortcutRow.jsx +93 -0
- package/src/components/LeftArrow.jsx +3 -0
- package/src/components/RightArrow.jsx +3 -0
- package/src/components/SingleDatePicker.jsx +731 -0
- package/src/components/SingleDatePickerInput.jsx +329 -0
- package/src/components/SingleDatePickerInputController.jsx +280 -0
- package/src/constants.js +37 -0
- package/src/defaultPhrases.js +215 -0
- package/src/index.js +20 -0
- package/src/initialize.js +3 -0
- package/src/shapes/AnchorDirectionShape.js +8 -0
- package/src/shapes/CalendarInfoPositionShape.js +15 -0
- package/src/shapes/DateRangePickerShape.js +111 -0
- package/src/shapes/DayOfWeekShape.js +5 -0
- package/src/shapes/DisabledShape.js +5 -0
- package/src/shapes/FocusedInputShape.js +8 -0
- package/src/shapes/IconPositionShape.js +8 -0
- package/src/shapes/ModifiersShape.js +20 -0
- package/src/shapes/NavPositionShape.js +8 -0
- package/src/shapes/OpenDirectionShape.js +8 -0
- package/src/shapes/OrientationShape.js +8 -0
- package/src/shapes/ScrollableOrientationShape.js +13 -0
- package/src/shapes/SingleDatePickerShape.js +100 -0
- package/src/svg/arrow-left.svg +1 -0
- package/src/svg/arrow-right.svg +1 -0
- package/src/svg/calendar.svg +1 -0
- package/src/svg/chevron-down.svg +1 -0
- package/src/svg/chevron-up.svg +1 -0
- package/src/svg/close.svg +1 -0
- package/src/theme/DefaultTheme.js +196 -0
- package/src/utils/calculateDimension.js +32 -0
- package/src/utils/disableScroll.js +65 -0
- package/src/utils/getActiveElement.js +3 -0
- package/src/utils/getCalendarDaySettings.js +61 -0
- package/src/utils/getCalendarMonthWeeks.js +49 -0
- package/src/utils/getCalendarMonthWidth.js +3 -0
- package/src/utils/getDetachedContainerStyles.js +39 -0
- package/src/utils/getInputHeight.js +67 -0
- package/src/utils/getNumberOfCalendarMonthWeeks.js +15 -0
- package/src/utils/getPhrase.jsx +9 -0
- package/src/utils/getPhrasePropTypes.js +9 -0
- package/src/utils/getPooledMoment.js +10 -0
- package/src/utils/getPreviousMonthMemoLast.js +11 -0
- package/src/utils/getResponsiveContainerStyles.js +18 -0
- package/src/utils/getSelectedDateOffset.js +6 -0
- package/src/utils/getTransformStyles.js +8 -0
- package/src/utils/getVisibleDays.js +54 -0
- package/src/utils/isAfterDay.js +9 -0
- package/src/utils/isBeforeDay.js +18 -0
- package/src/utils/isDayVisible.js +57 -0
- package/src/utils/isInclusivelyAfterDay.js +8 -0
- package/src/utils/isInclusivelyBeforeDay.js +8 -0
- package/src/utils/isNextDay.js +9 -0
- package/src/utils/isNextMonth.js +8 -0
- package/src/utils/isPrevMonth.js +8 -0
- package/src/utils/isPreviousDay.js +9 -0
- package/src/utils/isSameDay.js +10 -0
- package/src/utils/isSameMonth.js +9 -0
- package/src/utils/isTransitionEndSupported.js +3 -0
- package/src/utils/modifiers.js +116 -0
- package/src/utils/noflip.js +11 -0
- package/src/utils/registerCSSInterfaceWithDefaultTheme.js +7 -0
- package/src/utils/registerInterfaceWithDefaultTheme.js +7 -0
- package/src/utils/toISODateString.js +14 -0
- package/src/utils/toISOMonthString.js +14 -0
- package/src/utils/toLocalizedDateString.js +12 -0
- package/src/utils/toMomentObject.js +12 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
var calendarLabel = 'Calendar';
|
|
2
|
+
var roleDescription = 'datepicker';
|
|
3
|
+
var closeDatePicker = 'Close';
|
|
4
|
+
var focusStartDate = 'Interact with the calendar and add the check-in date for your trip.';
|
|
5
|
+
var clearDate = 'Clear Date';
|
|
6
|
+
var clearDates = 'Clear Dates';
|
|
7
|
+
var jumpToPrevMonth = 'Move backward to switch to the previous month.';
|
|
8
|
+
var jumpToNextMonth = 'Move forward to switch to the next month.';
|
|
9
|
+
var keyboardShortcuts = 'Keyboard Shortcuts';
|
|
10
|
+
var showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.';
|
|
11
|
+
var hideKeyboardShortcutsPanel = 'Close the shortcuts panel.';
|
|
12
|
+
var openThisPanel = 'Open this panel.';
|
|
13
|
+
var enterKey = 'Enter key';
|
|
14
|
+
var leftArrowRightArrow = 'Right and left arrow keys';
|
|
15
|
+
var upArrowDownArrow = 'up and down arrow keys';
|
|
16
|
+
var pageUpPageDown = 'page up and page down keys';
|
|
17
|
+
var homeEnd = 'Home and end keys';
|
|
18
|
+
var escape = 'Escape key';
|
|
19
|
+
var questionMark = 'Question mark';
|
|
20
|
+
var selectFocusedDate = 'Select the date in focus.';
|
|
21
|
+
var moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.';
|
|
22
|
+
var moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.';
|
|
23
|
+
var moveFocusByOneMonth = 'Switch months.';
|
|
24
|
+
var moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.';
|
|
25
|
+
var returnFocusToInput = 'Return to the date input field.';
|
|
26
|
+
var keyboardForwardNavigationInstructions = 'Navigate forward to interact with the calendar and select a date. Press the question mark key to get the keyboard shortcuts for changing dates.';
|
|
27
|
+
var keyboardBackwardNavigationInstructions = 'Navigate backward to interact with the calendar and select a date. Press the question mark key to get the keyboard shortcuts for changing dates.';
|
|
28
|
+
var chooseAvailableStartDate = function chooseAvailableStartDate(_ref) {
|
|
29
|
+
var date = _ref.date;
|
|
30
|
+
return "Choose ".concat(date, " as your check-in date. It\u2019s available.");
|
|
31
|
+
};
|
|
32
|
+
var chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) {
|
|
33
|
+
var date = _ref2.date;
|
|
34
|
+
return "Choose ".concat(date, " as your check-out date. It\u2019s available.");
|
|
35
|
+
};
|
|
36
|
+
var chooseAvailableDate = function chooseAvailableDate(_ref3) {
|
|
37
|
+
var date = _ref3.date;
|
|
38
|
+
return date;
|
|
39
|
+
};
|
|
40
|
+
var dateIsUnavailable = function dateIsUnavailable(_ref4) {
|
|
41
|
+
var date = _ref4.date;
|
|
42
|
+
return "Not available. ".concat(date);
|
|
43
|
+
};
|
|
44
|
+
var dateIsSelected = function dateIsSelected(_ref5) {
|
|
45
|
+
var date = _ref5.date;
|
|
46
|
+
return "Selected. ".concat(date);
|
|
47
|
+
};
|
|
48
|
+
var dateIsSelectedAsStartDate = function dateIsSelectedAsStartDate(_ref6) {
|
|
49
|
+
var date = _ref6.date;
|
|
50
|
+
return "Selected as start date. ".concat(date);
|
|
51
|
+
};
|
|
52
|
+
var dateIsSelectedAsEndDate = function dateIsSelectedAsEndDate(_ref7) {
|
|
53
|
+
var date = _ref7.date;
|
|
54
|
+
return "Selected as end date. ".concat(date);
|
|
55
|
+
};
|
|
56
|
+
export default {
|
|
57
|
+
calendarLabel: calendarLabel,
|
|
58
|
+
roleDescription: roleDescription,
|
|
59
|
+
closeDatePicker: closeDatePicker,
|
|
60
|
+
focusStartDate: focusStartDate,
|
|
61
|
+
clearDate: clearDate,
|
|
62
|
+
clearDates: clearDates,
|
|
63
|
+
jumpToPrevMonth: jumpToPrevMonth,
|
|
64
|
+
jumpToNextMonth: jumpToNextMonth,
|
|
65
|
+
keyboardShortcuts: keyboardShortcuts,
|
|
66
|
+
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
|
|
67
|
+
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
|
|
68
|
+
openThisPanel: openThisPanel,
|
|
69
|
+
enterKey: enterKey,
|
|
70
|
+
leftArrowRightArrow: leftArrowRightArrow,
|
|
71
|
+
upArrowDownArrow: upArrowDownArrow,
|
|
72
|
+
pageUpPageDown: pageUpPageDown,
|
|
73
|
+
homeEnd: homeEnd,
|
|
74
|
+
escape: escape,
|
|
75
|
+
questionMark: questionMark,
|
|
76
|
+
selectFocusedDate: selectFocusedDate,
|
|
77
|
+
moveFocusByOneDay: moveFocusByOneDay,
|
|
78
|
+
moveFocusByOneWeek: moveFocusByOneWeek,
|
|
79
|
+
moveFocusByOneMonth: moveFocusByOneMonth,
|
|
80
|
+
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
|
|
81
|
+
returnFocusToInput: returnFocusToInput,
|
|
82
|
+
keyboardForwardNavigationInstructions: keyboardForwardNavigationInstructions,
|
|
83
|
+
keyboardBackwardNavigationInstructions: keyboardBackwardNavigationInstructions,
|
|
84
|
+
chooseAvailableStartDate: chooseAvailableStartDate,
|
|
85
|
+
chooseAvailableEndDate: chooseAvailableEndDate,
|
|
86
|
+
dateIsUnavailable: dateIsUnavailable,
|
|
87
|
+
dateIsSelected: dateIsSelected,
|
|
88
|
+
dateIsSelectedAsStartDate: dateIsSelectedAsStartDate,
|
|
89
|
+
dateIsSelectedAsEndDate: dateIsSelectedAsEndDate
|
|
90
|
+
};
|
|
91
|
+
export var DateRangePickerPhrases = {
|
|
92
|
+
calendarLabel: calendarLabel,
|
|
93
|
+
roleDescription: roleDescription,
|
|
94
|
+
closeDatePicker: closeDatePicker,
|
|
95
|
+
clearDates: clearDates,
|
|
96
|
+
focusStartDate: focusStartDate,
|
|
97
|
+
jumpToPrevMonth: jumpToPrevMonth,
|
|
98
|
+
jumpToNextMonth: jumpToNextMonth,
|
|
99
|
+
keyboardShortcuts: keyboardShortcuts,
|
|
100
|
+
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
|
|
101
|
+
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
|
|
102
|
+
openThisPanel: openThisPanel,
|
|
103
|
+
enterKey: enterKey,
|
|
104
|
+
leftArrowRightArrow: leftArrowRightArrow,
|
|
105
|
+
upArrowDownArrow: upArrowDownArrow,
|
|
106
|
+
pageUpPageDown: pageUpPageDown,
|
|
107
|
+
homeEnd: homeEnd,
|
|
108
|
+
escape: escape,
|
|
109
|
+
questionMark: questionMark,
|
|
110
|
+
selectFocusedDate: selectFocusedDate,
|
|
111
|
+
moveFocusByOneDay: moveFocusByOneDay,
|
|
112
|
+
moveFocusByOneWeek: moveFocusByOneWeek,
|
|
113
|
+
moveFocusByOneMonth: moveFocusByOneMonth,
|
|
114
|
+
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
|
|
115
|
+
returnFocusToInput: returnFocusToInput,
|
|
116
|
+
keyboardForwardNavigationInstructions: keyboardForwardNavigationInstructions,
|
|
117
|
+
keyboardBackwardNavigationInstructions: keyboardBackwardNavigationInstructions,
|
|
118
|
+
chooseAvailableStartDate: chooseAvailableStartDate,
|
|
119
|
+
chooseAvailableEndDate: chooseAvailableEndDate,
|
|
120
|
+
dateIsUnavailable: dateIsUnavailable,
|
|
121
|
+
dateIsSelected: dateIsSelected,
|
|
122
|
+
dateIsSelectedAsStartDate: dateIsSelectedAsStartDate,
|
|
123
|
+
dateIsSelectedAsEndDate: dateIsSelectedAsEndDate
|
|
124
|
+
};
|
|
125
|
+
export var DateRangePickerInputPhrases = {
|
|
126
|
+
focusStartDate: focusStartDate,
|
|
127
|
+
clearDates: clearDates,
|
|
128
|
+
keyboardForwardNavigationInstructions: keyboardForwardNavigationInstructions,
|
|
129
|
+
keyboardBackwardNavigationInstructions: keyboardBackwardNavigationInstructions
|
|
130
|
+
};
|
|
131
|
+
export var SingleDatePickerPhrases = {
|
|
132
|
+
calendarLabel: calendarLabel,
|
|
133
|
+
roleDescription: roleDescription,
|
|
134
|
+
closeDatePicker: closeDatePicker,
|
|
135
|
+
clearDate: clearDate,
|
|
136
|
+
jumpToPrevMonth: jumpToPrevMonth,
|
|
137
|
+
jumpToNextMonth: jumpToNextMonth,
|
|
138
|
+
keyboardShortcuts: keyboardShortcuts,
|
|
139
|
+
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
|
|
140
|
+
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
|
|
141
|
+
openThisPanel: openThisPanel,
|
|
142
|
+
enterKey: enterKey,
|
|
143
|
+
leftArrowRightArrow: leftArrowRightArrow,
|
|
144
|
+
upArrowDownArrow: upArrowDownArrow,
|
|
145
|
+
pageUpPageDown: pageUpPageDown,
|
|
146
|
+
homeEnd: homeEnd,
|
|
147
|
+
escape: escape,
|
|
148
|
+
questionMark: questionMark,
|
|
149
|
+
selectFocusedDate: selectFocusedDate,
|
|
150
|
+
moveFocusByOneDay: moveFocusByOneDay,
|
|
151
|
+
moveFocusByOneWeek: moveFocusByOneWeek,
|
|
152
|
+
moveFocusByOneMonth: moveFocusByOneMonth,
|
|
153
|
+
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
|
|
154
|
+
returnFocusToInput: returnFocusToInput,
|
|
155
|
+
keyboardForwardNavigationInstructions: keyboardForwardNavigationInstructions,
|
|
156
|
+
keyboardBackwardNavigationInstructions: keyboardBackwardNavigationInstructions,
|
|
157
|
+
chooseAvailableDate: chooseAvailableDate,
|
|
158
|
+
dateIsUnavailable: dateIsUnavailable,
|
|
159
|
+
dateIsSelected: dateIsSelected
|
|
160
|
+
};
|
|
161
|
+
export var SingleDatePickerInputPhrases = {
|
|
162
|
+
clearDate: clearDate,
|
|
163
|
+
keyboardForwardNavigationInstructions: keyboardForwardNavigationInstructions,
|
|
164
|
+
keyboardBackwardNavigationInstructions: keyboardBackwardNavigationInstructions
|
|
165
|
+
};
|
|
166
|
+
export var DayPickerPhrases = {
|
|
167
|
+
calendarLabel: calendarLabel,
|
|
168
|
+
roleDescription: roleDescription,
|
|
169
|
+
jumpToPrevMonth: jumpToPrevMonth,
|
|
170
|
+
jumpToNextMonth: jumpToNextMonth,
|
|
171
|
+
keyboardShortcuts: keyboardShortcuts,
|
|
172
|
+
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
|
|
173
|
+
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
|
|
174
|
+
openThisPanel: openThisPanel,
|
|
175
|
+
enterKey: enterKey,
|
|
176
|
+
leftArrowRightArrow: leftArrowRightArrow,
|
|
177
|
+
upArrowDownArrow: upArrowDownArrow,
|
|
178
|
+
pageUpPageDown: pageUpPageDown,
|
|
179
|
+
homeEnd: homeEnd,
|
|
180
|
+
escape: escape,
|
|
181
|
+
questionMark: questionMark,
|
|
182
|
+
selectFocusedDate: selectFocusedDate,
|
|
183
|
+
moveFocusByOneDay: moveFocusByOneDay,
|
|
184
|
+
moveFocusByOneWeek: moveFocusByOneWeek,
|
|
185
|
+
moveFocusByOneMonth: moveFocusByOneMonth,
|
|
186
|
+
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
|
|
187
|
+
returnFocusToInput: returnFocusToInput,
|
|
188
|
+
chooseAvailableStartDate: chooseAvailableStartDate,
|
|
189
|
+
chooseAvailableEndDate: chooseAvailableEndDate,
|
|
190
|
+
chooseAvailableDate: chooseAvailableDate,
|
|
191
|
+
dateIsUnavailable: dateIsUnavailable,
|
|
192
|
+
dateIsSelected: dateIsSelected,
|
|
193
|
+
dateIsSelectedAsStartDate: dateIsSelectedAsStartDate,
|
|
194
|
+
dateIsSelectedAsEndDate: dateIsSelectedAsEndDate
|
|
195
|
+
};
|
|
196
|
+
export var DayPickerKeyboardShortcutsPhrases = {
|
|
197
|
+
keyboardShortcuts: keyboardShortcuts,
|
|
198
|
+
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
|
|
199
|
+
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
|
|
200
|
+
openThisPanel: openThisPanel,
|
|
201
|
+
enterKey: enterKey,
|
|
202
|
+
leftArrowRightArrow: leftArrowRightArrow,
|
|
203
|
+
upArrowDownArrow: upArrowDownArrow,
|
|
204
|
+
pageUpPageDown: pageUpPageDown,
|
|
205
|
+
homeEnd: homeEnd,
|
|
206
|
+
escape: escape,
|
|
207
|
+
questionMark: questionMark,
|
|
208
|
+
selectFocusedDate: selectFocusedDate,
|
|
209
|
+
moveFocusByOneDay: moveFocusByOneDay,
|
|
210
|
+
moveFocusByOneWeek: moveFocusByOneWeek,
|
|
211
|
+
moveFocusByOneMonth: moveFocusByOneMonth,
|
|
212
|
+
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
|
|
213
|
+
returnFocusToInput: returnFocusToInput
|
|
214
|
+
};
|
|
215
|
+
export var DayPickerNavigationPhrases = {
|
|
216
|
+
jumpToPrevMonth: jumpToPrevMonth,
|
|
217
|
+
jumpToNextMonth: jumpToNextMonth
|
|
218
|
+
};
|
|
219
|
+
export var CalendarDayPhrases = {
|
|
220
|
+
chooseAvailableDate: chooseAvailableDate,
|
|
221
|
+
dateIsUnavailable: dateIsUnavailable,
|
|
222
|
+
dateIsSelected: dateIsSelected,
|
|
223
|
+
dateIsSelectedAsStartDate: dateIsSelectedAsStartDate,
|
|
224
|
+
dateIsSelectedAsEndDate: dateIsSelectedAsEndDate
|
|
225
|
+
};
|
package/esm/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { default as CalendarDay } from './components/CalendarDay';
|
|
2
|
+
export { default as CalendarMonth } from './components/CalendarMonth';
|
|
3
|
+
export { default as CalendarMonthGrid } from './components/CalendarMonthGrid';
|
|
4
|
+
export { default as DateRangePicker } from './components/DateRangePicker';
|
|
5
|
+
export { default as DateRangePickerInput } from './components/DateRangePickerInput';
|
|
6
|
+
export { default as DateRangePickerInputController } from './components/DateRangePickerInputController';
|
|
7
|
+
export { default as DateRangePickerShape } from './shapes/DateRangePickerShape';
|
|
8
|
+
export { default as DayPicker } from './components/DayPicker';
|
|
9
|
+
export { default as DayPickerRangeController } from './components/DayPickerRangeController';
|
|
10
|
+
export { default as DayPickerSingleDateController } from './components/DayPickerSingleDateController';
|
|
11
|
+
export { default as SingleDatePicker } from './components/SingleDatePicker';
|
|
12
|
+
export { default as SingleDatePickerInput } from './components/SingleDatePickerInput';
|
|
13
|
+
export { default as SingleDatePickerShape } from './shapes/SingleDatePickerShape';
|
|
14
|
+
export { default as isInclusivelyAfterDay } from './utils/isInclusivelyAfterDay';
|
|
15
|
+
export { default as isInclusivelyBeforeDay } from './utils/isInclusivelyBeforeDay';
|
|
16
|
+
export { default as isNextDay } from './utils/isNextDay';
|
|
17
|
+
export { default as isSameDay } from './utils/isSameDay';
|
|
18
|
+
export { default as toISODateString } from './utils/toISODateString';
|
|
19
|
+
export { default as toLocalizedDateString } from './utils/toLocalizedDateString';
|
|
20
|
+
export { default as toMomentObject } from './utils/toMomentObject';
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import momentPropTypes from 'react-moment-proptypes';
|
|
3
|
+
import { mutuallyExclusiveProps, nonNegativeInteger } from 'airbnb-prop-types';
|
|
4
|
+
import { DateRangePickerPhrases } from '../defaultPhrases';
|
|
5
|
+
import getPhrasePropTypes from '../utils/getPhrasePropTypes';
|
|
6
|
+
import FocusedInputShape from './FocusedInputShape';
|
|
7
|
+
import IconPositionShape from './IconPositionShape';
|
|
8
|
+
import OrientationShape from './OrientationShape';
|
|
9
|
+
import DisabledShape from './DisabledShape';
|
|
10
|
+
import anchorDirectionShape from './AnchorDirectionShape';
|
|
11
|
+
import openDirectionShape from './OpenDirectionShape';
|
|
12
|
+
import DayOfWeekShape from './DayOfWeekShape';
|
|
13
|
+
import CalendarInfoPositionShape from './CalendarInfoPositionShape';
|
|
14
|
+
import NavPositionShape from './NavPositionShape';
|
|
15
|
+
export default {
|
|
16
|
+
// required props for a functional interactive DateRangePicker
|
|
17
|
+
startDate: momentPropTypes.momentObj,
|
|
18
|
+
endDate: momentPropTypes.momentObj,
|
|
19
|
+
onDatesChange: PropTypes.func.isRequired,
|
|
20
|
+
focusedInput: FocusedInputShape,
|
|
21
|
+
onFocusChange: PropTypes.func.isRequired,
|
|
22
|
+
onClose: PropTypes.func,
|
|
23
|
+
// input related props
|
|
24
|
+
startDateId: PropTypes.string.isRequired,
|
|
25
|
+
startDatePlaceholderText: PropTypes.string,
|
|
26
|
+
startDateOffset: PropTypes.func,
|
|
27
|
+
endDateOffset: PropTypes.func,
|
|
28
|
+
endDateId: PropTypes.string.isRequired,
|
|
29
|
+
endDatePlaceholderText: PropTypes.string,
|
|
30
|
+
startDateAriaLabel: PropTypes.string,
|
|
31
|
+
endDateAriaLabel: PropTypes.string,
|
|
32
|
+
startDateTitleText: PropTypes.string,
|
|
33
|
+
endDateTitleText: PropTypes.string,
|
|
34
|
+
disabled: DisabledShape,
|
|
35
|
+
required: PropTypes.bool,
|
|
36
|
+
readOnly: PropTypes.bool,
|
|
37
|
+
screenReaderInputMessage: PropTypes.string,
|
|
38
|
+
showClearDates: PropTypes.bool,
|
|
39
|
+
showDefaultInputIcon: PropTypes.bool,
|
|
40
|
+
inputIconPosition: IconPositionShape,
|
|
41
|
+
customInputIcon: PropTypes.node,
|
|
42
|
+
customArrowIcon: PropTypes.node,
|
|
43
|
+
customCloseIcon: PropTypes.node,
|
|
44
|
+
noBorder: PropTypes.bool,
|
|
45
|
+
block: PropTypes.bool,
|
|
46
|
+
small: PropTypes.bool,
|
|
47
|
+
regular: PropTypes.bool,
|
|
48
|
+
keepFocusOnInput: PropTypes.bool,
|
|
49
|
+
autoComplete: PropTypes.string,
|
|
50
|
+
// calendar presentation and interaction related props
|
|
51
|
+
renderMonthText: mutuallyExclusiveProps(PropTypes.func, 'renderMonthText', 'renderMonthElement'),
|
|
52
|
+
renderMonthElement: mutuallyExclusiveProps(PropTypes.func, 'renderMonthText', 'renderMonthElement'),
|
|
53
|
+
renderWeekHeaderElement: PropTypes.func,
|
|
54
|
+
orientation: OrientationShape,
|
|
55
|
+
anchorDirection: anchorDirectionShape,
|
|
56
|
+
openDirection: openDirectionShape,
|
|
57
|
+
horizontalMargin: PropTypes.number,
|
|
58
|
+
withPortal: PropTypes.bool,
|
|
59
|
+
withFullScreenPortal: PropTypes.bool,
|
|
60
|
+
appendToBody: PropTypes.bool,
|
|
61
|
+
disableScroll: PropTypes.bool,
|
|
62
|
+
daySize: nonNegativeInteger,
|
|
63
|
+
isRTL: PropTypes.bool,
|
|
64
|
+
firstDayOfWeek: DayOfWeekShape,
|
|
65
|
+
initialVisibleMonth: PropTypes.func,
|
|
66
|
+
numberOfMonths: PropTypes.number,
|
|
67
|
+
keepOpenOnDateSelect: PropTypes.bool,
|
|
68
|
+
reopenPickerOnClearDates: PropTypes.bool,
|
|
69
|
+
renderCalendarInfo: PropTypes.func,
|
|
70
|
+
calendarInfoPosition: CalendarInfoPositionShape,
|
|
71
|
+
hideKeyboardShortcutsPanel: PropTypes.bool,
|
|
72
|
+
verticalHeight: nonNegativeInteger,
|
|
73
|
+
transitionDuration: nonNegativeInteger,
|
|
74
|
+
verticalSpacing: nonNegativeInteger,
|
|
75
|
+
horizontalMonthPadding: nonNegativeInteger,
|
|
76
|
+
// navigation related props
|
|
77
|
+
dayPickerNavigationInlineStyles: PropTypes.object,
|
|
78
|
+
navPosition: NavPositionShape,
|
|
79
|
+
navPrev: PropTypes.node,
|
|
80
|
+
navNext: PropTypes.node,
|
|
81
|
+
renderNavPrevButton: PropTypes.func,
|
|
82
|
+
renderNavNextButton: PropTypes.func,
|
|
83
|
+
onPrevMonthClick: PropTypes.func,
|
|
84
|
+
onNextMonthClick: PropTypes.func,
|
|
85
|
+
// day presentation and interaction related props
|
|
86
|
+
renderCalendarDay: PropTypes.func,
|
|
87
|
+
renderDayContents: PropTypes.func,
|
|
88
|
+
minimumNights: PropTypes.number,
|
|
89
|
+
minDate: momentPropTypes.momentObj,
|
|
90
|
+
maxDate: momentPropTypes.momentObj,
|
|
91
|
+
enableOutsideDays: PropTypes.bool,
|
|
92
|
+
isDayBlocked: PropTypes.func,
|
|
93
|
+
isOutsideRange: PropTypes.func,
|
|
94
|
+
isDayHighlighted: PropTypes.func,
|
|
95
|
+
// internationalization props
|
|
96
|
+
displayFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
|
97
|
+
monthFormat: PropTypes.string,
|
|
98
|
+
weekDayFormat: PropTypes.string,
|
|
99
|
+
phrases: PropTypes.shape(getPhrasePropTypes(DateRangePickerPhrases)),
|
|
100
|
+
dayAriaLabelFormat: PropTypes.string
|
|
101
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { and } from 'airbnb-prop-types';
|
|
5
|
+
export default and([PropTypes.instanceOf(Set), function modifiers(props, propName) {
|
|
6
|
+
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
7
|
+
rest[_key - 2] = arguments[_key];
|
|
8
|
+
}
|
|
9
|
+
var propValue = props[propName];
|
|
10
|
+
var firstError;
|
|
11
|
+
_toConsumableArray(propValue).some(function (v, i) {
|
|
12
|
+
var _PropTypes$string;
|
|
13
|
+
var fakePropName = "".concat(propName, ": index ").concat(i);
|
|
14
|
+
firstError = (_PropTypes$string = PropTypes.string).isRequired.apply(_PropTypes$string, [_defineProperty({}, fakePropName, v), fakePropName].concat(rest));
|
|
15
|
+
return firstError != null;
|
|
16
|
+
});
|
|
17
|
+
return firstError == null ? null : firstError;
|
|
18
|
+
}], 'Modifiers (Set of Strings)');
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import momentPropTypes from 'react-moment-proptypes';
|
|
3
|
+
import { mutuallyExclusiveProps, nonNegativeInteger } from 'airbnb-prop-types';
|
|
4
|
+
import { SingleDatePickerPhrases } from '../defaultPhrases';
|
|
5
|
+
import getPhrasePropTypes from '../utils/getPhrasePropTypes';
|
|
6
|
+
import IconPositionShape from './IconPositionShape';
|
|
7
|
+
import OrientationShape from './OrientationShape';
|
|
8
|
+
import anchorDirectionShape from './AnchorDirectionShape';
|
|
9
|
+
import openDirectionShape from './OpenDirectionShape';
|
|
10
|
+
import DayOfWeekShape from './DayOfWeekShape';
|
|
11
|
+
import CalendarInfoPositionShape from './CalendarInfoPositionShape';
|
|
12
|
+
import NavPositionShape from './NavPositionShape';
|
|
13
|
+
export 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
|
+
titleText: PropTypes.string,
|
|
24
|
+
disabled: PropTypes.bool,
|
|
25
|
+
required: PropTypes.bool,
|
|
26
|
+
readOnly: PropTypes.bool,
|
|
27
|
+
screenReaderInputMessage: PropTypes.string,
|
|
28
|
+
showClearDate: PropTypes.bool,
|
|
29
|
+
customCloseIcon: PropTypes.node,
|
|
30
|
+
showDefaultInputIcon: PropTypes.bool,
|
|
31
|
+
inputIconPosition: IconPositionShape,
|
|
32
|
+
customInputIcon: PropTypes.node,
|
|
33
|
+
noBorder: PropTypes.bool,
|
|
34
|
+
block: PropTypes.bool,
|
|
35
|
+
small: PropTypes.bool,
|
|
36
|
+
regular: PropTypes.bool,
|
|
37
|
+
verticalSpacing: nonNegativeInteger,
|
|
38
|
+
keepFocusOnInput: PropTypes.bool,
|
|
39
|
+
autoComplete: PropTypes.string,
|
|
40
|
+
// calendar presentation and interaction related props
|
|
41
|
+
renderMonthText: mutuallyExclusiveProps(PropTypes.func, 'renderMonthText', 'renderMonthElement'),
|
|
42
|
+
renderMonthElement: mutuallyExclusiveProps(PropTypes.func, 'renderMonthText', 'renderMonthElement'),
|
|
43
|
+
renderWeekHeaderElement: PropTypes.func,
|
|
44
|
+
orientation: OrientationShape,
|
|
45
|
+
anchorDirection: anchorDirectionShape,
|
|
46
|
+
openDirection: openDirectionShape,
|
|
47
|
+
horizontalMargin: PropTypes.number,
|
|
48
|
+
withPortal: PropTypes.bool,
|
|
49
|
+
withFullScreenPortal: PropTypes.bool,
|
|
50
|
+
appendToBody: PropTypes.bool,
|
|
51
|
+
disableScroll: PropTypes.bool,
|
|
52
|
+
initialVisibleMonth: PropTypes.func,
|
|
53
|
+
firstDayOfWeek: DayOfWeekShape,
|
|
54
|
+
numberOfMonths: PropTypes.number,
|
|
55
|
+
keepOpenOnDateSelect: PropTypes.bool,
|
|
56
|
+
reopenPickerOnClearDate: PropTypes.bool,
|
|
57
|
+
renderCalendarInfo: PropTypes.func,
|
|
58
|
+
calendarInfoPosition: CalendarInfoPositionShape,
|
|
59
|
+
hideKeyboardShortcutsPanel: PropTypes.bool,
|
|
60
|
+
daySize: nonNegativeInteger,
|
|
61
|
+
isRTL: PropTypes.bool,
|
|
62
|
+
verticalHeight: nonNegativeInteger,
|
|
63
|
+
transitionDuration: nonNegativeInteger,
|
|
64
|
+
horizontalMonthPadding: nonNegativeInteger,
|
|
65
|
+
// navigation related props
|
|
66
|
+
dayPickerNavigationInlineStyles: PropTypes.object,
|
|
67
|
+
navPosition: NavPositionShape,
|
|
68
|
+
navPrev: PropTypes.node,
|
|
69
|
+
navNext: PropTypes.node,
|
|
70
|
+
renderNavPrevButton: PropTypes.func,
|
|
71
|
+
renderNavNextButton: PropTypes.func,
|
|
72
|
+
onPrevMonthClick: PropTypes.func,
|
|
73
|
+
onNextMonthClick: PropTypes.func,
|
|
74
|
+
onClose: PropTypes.func,
|
|
75
|
+
// day presentation and interaction related props
|
|
76
|
+
renderCalendarDay: PropTypes.func,
|
|
77
|
+
renderDayContents: PropTypes.func,
|
|
78
|
+
enableOutsideDays: PropTypes.bool,
|
|
79
|
+
isDayBlocked: PropTypes.func,
|
|
80
|
+
isOutsideRange: PropTypes.func,
|
|
81
|
+
isDayHighlighted: PropTypes.func,
|
|
82
|
+
minDate: momentPropTypes.momentObj,
|
|
83
|
+
maxDate: momentPropTypes.momentObj,
|
|
84
|
+
// internationalization props
|
|
85
|
+
displayFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
|
86
|
+
monthFormat: PropTypes.string,
|
|
87
|
+
weekDayFormat: PropTypes.string,
|
|
88
|
+
phrases: PropTypes.shape(getPhrasePropTypes(SingleDatePickerPhrases)),
|
|
89
|
+
dayAriaLabelFormat: PropTypes.string
|
|
90
|
+
};
|