react-dates
Version:
A responsive and accessible date range picker component built with React
248 lines (239 loc) • 10.3 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CalendarDayPhrases = exports.DayPickerNavigationPhrases = exports.DayPickerKeyboardShortcutsPhrases = exports.DayPickerPhrases = exports.SingleDatePickerInputPhrases = exports.SingleDatePickerPhrases = exports.DateRangePickerInputPhrases = exports.DateRangePickerPhrases = exports["default"] = void 0;
var calendarLabel = 'Calendar';
var roleDescription = 'datepicker';
var closeDatePicker = 'Close';
var focusStartDate = 'Interact with the calendar and add the check-in date for your trip.';
var clearDate = 'Clear Date';
var clearDates = 'Clear Dates';
var jumpToPrevMonth = 'Move backward to switch to the previous month.';
var jumpToNextMonth = 'Move forward to switch to the next month.';
var keyboardShortcuts = 'Keyboard Shortcuts';
var showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.';
var hideKeyboardShortcutsPanel = 'Close the shortcuts panel.';
var openThisPanel = 'Open this panel.';
var enterKey = 'Enter key';
var leftArrowRightArrow = 'Right and left arrow keys';
var upArrowDownArrow = 'up and down arrow keys';
var pageUpPageDown = 'page up and page down keys';
var homeEnd = 'Home and end keys';
var escape = 'Escape key';
var questionMark = 'Question mark';
var selectFocusedDate = 'Select the date in focus.';
var moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.';
var moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.';
var moveFocusByOneMonth = 'Switch months.';
var moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.';
var returnFocusToInput = 'Return to the date input field.';
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.';
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.';
var chooseAvailableStartDate = function chooseAvailableStartDate(_ref) {
var date = _ref.date;
return "Choose ".concat(date, " as your check-in date. It\u2019s available.");
};
var chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) {
var date = _ref2.date;
return "Choose ".concat(date, " as your check-out date. It\u2019s available.");
};
var chooseAvailableDate = function chooseAvailableDate(_ref3) {
var date = _ref3.date;
return date;
};
var dateIsUnavailable = function dateIsUnavailable(_ref4) {
var date = _ref4.date;
return "Not available. ".concat(date);
};
var dateIsSelected = function dateIsSelected(_ref5) {
var date = _ref5.date;
return "Selected. ".concat(date);
};
var dateIsSelectedAsStartDate = function dateIsSelectedAsStartDate(_ref6) {
var date = _ref6.date;
return "Selected as start date. ".concat(date);
};
var dateIsSelectedAsEndDate = function dateIsSelectedAsEndDate(_ref7) {
var date = _ref7.date;
return "Selected as end date. ".concat(date);
};
var _default = {
calendarLabel: calendarLabel,
roleDescription: roleDescription,
closeDatePicker: closeDatePicker,
focusStartDate: focusStartDate,
clearDate: clearDate,
clearDates: clearDates,
jumpToPrevMonth: jumpToPrevMonth,
jumpToNextMonth: jumpToNextMonth,
keyboardShortcuts: keyboardShortcuts,
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
openThisPanel: openThisPanel,
enterKey: enterKey,
leftArrowRightArrow: leftArrowRightArrow,
upArrowDownArrow: upArrowDownArrow,
pageUpPageDown: pageUpPageDown,
homeEnd: homeEnd,
escape: escape,
questionMark: questionMark,
selectFocusedDate: selectFocusedDate,
moveFocusByOneDay: moveFocusByOneDay,
moveFocusByOneWeek: moveFocusByOneWeek,
moveFocusByOneMonth: moveFocusByOneMonth,
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
returnFocusToInput: returnFocusToInput,
keyboardForwardNavigationInstructions: keyboardForwardNavigationInstructions,
keyboardBackwardNavigationInstructions: keyboardBackwardNavigationInstructions,
chooseAvailableStartDate: chooseAvailableStartDate,
chooseAvailableEndDate: chooseAvailableEndDate,
dateIsUnavailable: dateIsUnavailable,
dateIsSelected: dateIsSelected,
dateIsSelectedAsStartDate: dateIsSelectedAsStartDate,
dateIsSelectedAsEndDate: dateIsSelectedAsEndDate
};
exports["default"] = _default;
var DateRangePickerPhrases = {
calendarLabel: calendarLabel,
roleDescription: roleDescription,
closeDatePicker: closeDatePicker,
clearDates: clearDates,
focusStartDate: focusStartDate,
jumpToPrevMonth: jumpToPrevMonth,
jumpToNextMonth: jumpToNextMonth,
keyboardShortcuts: keyboardShortcuts,
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
openThisPanel: openThisPanel,
enterKey: enterKey,
leftArrowRightArrow: leftArrowRightArrow,
upArrowDownArrow: upArrowDownArrow,
pageUpPageDown: pageUpPageDown,
homeEnd: homeEnd,
escape: escape,
questionMark: questionMark,
selectFocusedDate: selectFocusedDate,
moveFocusByOneDay: moveFocusByOneDay,
moveFocusByOneWeek: moveFocusByOneWeek,
moveFocusByOneMonth: moveFocusByOneMonth,
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
returnFocusToInput: returnFocusToInput,
keyboardForwardNavigationInstructions: keyboardForwardNavigationInstructions,
keyboardBackwardNavigationInstructions: keyboardBackwardNavigationInstructions,
chooseAvailableStartDate: chooseAvailableStartDate,
chooseAvailableEndDate: chooseAvailableEndDate,
dateIsUnavailable: dateIsUnavailable,
dateIsSelected: dateIsSelected,
dateIsSelectedAsStartDate: dateIsSelectedAsStartDate,
dateIsSelectedAsEndDate: dateIsSelectedAsEndDate
};
exports.DateRangePickerPhrases = DateRangePickerPhrases;
var DateRangePickerInputPhrases = {
focusStartDate: focusStartDate,
clearDates: clearDates,
keyboardForwardNavigationInstructions: keyboardForwardNavigationInstructions,
keyboardBackwardNavigationInstructions: keyboardBackwardNavigationInstructions
};
exports.DateRangePickerInputPhrases = DateRangePickerInputPhrases;
var SingleDatePickerPhrases = {
calendarLabel: calendarLabel,
roleDescription: roleDescription,
closeDatePicker: closeDatePicker,
clearDate: clearDate,
jumpToPrevMonth: jumpToPrevMonth,
jumpToNextMonth: jumpToNextMonth,
keyboardShortcuts: keyboardShortcuts,
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
openThisPanel: openThisPanel,
enterKey: enterKey,
leftArrowRightArrow: leftArrowRightArrow,
upArrowDownArrow: upArrowDownArrow,
pageUpPageDown: pageUpPageDown,
homeEnd: homeEnd,
escape: escape,
questionMark: questionMark,
selectFocusedDate: selectFocusedDate,
moveFocusByOneDay: moveFocusByOneDay,
moveFocusByOneWeek: moveFocusByOneWeek,
moveFocusByOneMonth: moveFocusByOneMonth,
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
returnFocusToInput: returnFocusToInput,
keyboardForwardNavigationInstructions: keyboardForwardNavigationInstructions,
keyboardBackwardNavigationInstructions: keyboardBackwardNavigationInstructions,
chooseAvailableDate: chooseAvailableDate,
dateIsUnavailable: dateIsUnavailable,
dateIsSelected: dateIsSelected
};
exports.SingleDatePickerPhrases = SingleDatePickerPhrases;
var SingleDatePickerInputPhrases = {
clearDate: clearDate,
keyboardForwardNavigationInstructions: keyboardForwardNavigationInstructions,
keyboardBackwardNavigationInstructions: keyboardBackwardNavigationInstructions
};
exports.SingleDatePickerInputPhrases = SingleDatePickerInputPhrases;
var DayPickerPhrases = {
calendarLabel: calendarLabel,
roleDescription: roleDescription,
jumpToPrevMonth: jumpToPrevMonth,
jumpToNextMonth: jumpToNextMonth,
keyboardShortcuts: keyboardShortcuts,
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
openThisPanel: openThisPanel,
enterKey: enterKey,
leftArrowRightArrow: leftArrowRightArrow,
upArrowDownArrow: upArrowDownArrow,
pageUpPageDown: pageUpPageDown,
homeEnd: homeEnd,
escape: escape,
questionMark: questionMark,
selectFocusedDate: selectFocusedDate,
moveFocusByOneDay: moveFocusByOneDay,
moveFocusByOneWeek: moveFocusByOneWeek,
moveFocusByOneMonth: moveFocusByOneMonth,
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
returnFocusToInput: returnFocusToInput,
chooseAvailableStartDate: chooseAvailableStartDate,
chooseAvailableEndDate: chooseAvailableEndDate,
chooseAvailableDate: chooseAvailableDate,
dateIsUnavailable: dateIsUnavailable,
dateIsSelected: dateIsSelected,
dateIsSelectedAsStartDate: dateIsSelectedAsStartDate,
dateIsSelectedAsEndDate: dateIsSelectedAsEndDate
};
exports.DayPickerPhrases = DayPickerPhrases;
var DayPickerKeyboardShortcutsPhrases = {
keyboardShortcuts: keyboardShortcuts,
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
openThisPanel: openThisPanel,
enterKey: enterKey,
leftArrowRightArrow: leftArrowRightArrow,
upArrowDownArrow: upArrowDownArrow,
pageUpPageDown: pageUpPageDown,
homeEnd: homeEnd,
escape: escape,
questionMark: questionMark,
selectFocusedDate: selectFocusedDate,
moveFocusByOneDay: moveFocusByOneDay,
moveFocusByOneWeek: moveFocusByOneWeek,
moveFocusByOneMonth: moveFocusByOneMonth,
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
returnFocusToInput: returnFocusToInput
};
exports.DayPickerKeyboardShortcutsPhrases = DayPickerKeyboardShortcutsPhrases;
var DayPickerNavigationPhrases = {
jumpToPrevMonth: jumpToPrevMonth,
jumpToNextMonth: jumpToNextMonth
};
exports.DayPickerNavigationPhrases = DayPickerNavigationPhrases;
var CalendarDayPhrases = {
chooseAvailableDate: chooseAvailableDate,
dateIsUnavailable: dateIsUnavailable,
dateIsSelected: dateIsSelected,
dateIsSelectedAsStartDate: dateIsSelectedAsStartDate,
dateIsSelectedAsEndDate: dateIsSelectedAsEndDate
};
exports.CalendarDayPhrases = CalendarDayPhrases;