react-day-picker 8.0.0-beta.27 → 8.0.0-beta.31
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/CHANGELOG.md +8 -70
- package/LICENSE +1 -1
- package/README.md +4 -5
- package/build/DayPicker.d.ts +88 -0
- package/build/DayPicker.js +97 -0
- package/build/DayPicker.js.map +1 -0
- package/build/_virtual/_tslib.js +50 -0
- package/build/_virtual/_tslib.js.map +1 -0
- package/build/components/Button/Button.d.ts +7 -0
- package/build/components/Button/Button.js +23 -0
- package/build/components/Button/Button.js.map +1 -0
- package/build/components/Button/index.d.ts +1 -0
- package/build/components/Caption/Caption.d.ts +11 -0
- package/build/components/Caption/Caption.js +57 -0
- package/build/components/Caption/Caption.js.map +1 -0
- package/build/components/Caption/index.d.ts +1 -0
- package/build/components/CaptionLabel/CaptionLabel.d.ts +8 -0
- package/build/components/CaptionLabel/CaptionLabel.js +11 -0
- package/build/components/CaptionLabel/CaptionLabel.js.map +1 -0
- package/build/components/CaptionLabel/index.d.ts +1 -0
- package/build/components/Day/Day.d.ts +13 -0
- package/build/components/Day/Day.js +24 -0
- package/build/components/Day/Day.js.map +1 -0
- package/build/components/Day/hooks/index.d.ts +1 -0
- package/build/components/Day/hooks/useDay.d.ts +58 -0
- package/build/components/Day/hooks/useDay.js +176 -0
- package/build/components/Day/hooks/useDay.js.map +1 -0
- package/build/components/Day/hooks/useDayFocus.d.ts +8 -0
- package/build/components/Day/hooks/useDayFocus.js +49 -0
- package/build/components/Day/hooks/useDayFocus.js.map +1 -0
- package/build/components/Day/index.d.ts +2 -0
- package/build/components/DayContent/DayContent.d.ts +15 -0
- package/build/components/DayContent/DayContent.js +15 -0
- package/build/components/DayContent/DayContent.js.map +1 -0
- package/build/components/DayContent/index.d.ts +1 -0
- package/build/components/Dropdown/Dropdown.d.ts +16 -0
- package/build/components/Dropdown/Dropdown.js +20 -0
- package/build/components/Dropdown/Dropdown.js.map +1 -0
- package/build/components/Dropdown/index.d.ts +1 -0
- package/build/components/Footer/Footer.d.ts +3 -0
- package/build/components/Footer/Footer.js +15 -0
- package/build/components/Footer/Footer.js.map +1 -0
- package/build/components/Footer/index.d.ts +1 -0
- package/build/components/Head/Head.d.ts +5 -0
- package/build/components/Head/Head.js +20 -0
- package/build/components/Head/Head.js.map +1 -0
- package/build/components/Head/index.d.ts +1 -0
- package/build/components/Head/utils/getWeekdays.d.ts +6 -0
- package/build/components/Head/utils/getWeekdays.js +18 -0
- package/build/components/Head/utils/getWeekdays.js.map +1 -0
- package/build/components/Head/utils/index.d.ts +1 -0
- package/build/components/IconDropdown/IconDropdown.d.ts +6 -0
- package/build/components/IconDropdown/IconDropdown.js +13 -0
- package/build/components/IconDropdown/IconDropdown.js.map +1 -0
- package/build/components/IconDropdown/index.d.ts +1 -0
- package/build/components/IconNext/IconNext.d.ts +6 -0
- package/build/components/IconNext/IconNext.js +13 -0
- package/build/components/IconNext/IconNext.js.map +1 -0
- package/build/components/IconNext/index.d.ts +1 -0
- package/build/components/IconPrevious/IconPrevious.d.ts +6 -0
- package/build/components/IconPrevious/IconPrevious.js +13 -0
- package/build/components/IconPrevious/IconPrevious.js.map +1 -0
- package/build/components/IconPrevious/index.d.ts +1 -0
- package/build/components/MonthsDropdown/MonthsDropdown.d.ts +12 -0
- package/build/components/MonthsDropdown/MonthsDropdown.js +39 -0
- package/build/components/MonthsDropdown/MonthsDropdown.js.map +1 -0
- package/build/components/MonthsDropdown/index.d.ts +1 -0
- package/build/components/Navigation/Navigation.d.ts +20 -0
- package/build/components/Navigation/Navigation.js +37 -0
- package/build/components/Navigation/Navigation.js.map +1 -0
- package/build/components/Navigation/index.d.ts +1 -0
- package/build/components/Root/Root.d.ts +6 -0
- package/build/components/Root/Root.js +50 -0
- package/build/components/Root/Root.js.map +1 -0
- package/build/components/Root/index.d.ts +1 -0
- package/build/components/Row/Row.d.ts +16 -0
- package/build/components/Row/Row.js +22 -0
- package/build/components/Row/Row.js.map +1 -0
- package/build/components/Row/index.d.ts +1 -0
- package/build/components/Table/Table.d.ts +12 -0
- package/build/components/Table/Table.js +18 -0
- package/build/components/Table/Table.js.map +1 -0
- package/build/components/Table/index.d.ts +1 -0
- package/build/components/Table/utils/getOutsideEndDays.d.ts +3 -0
- package/build/components/Table/utils/getOutsideEndDays.js +15 -0
- package/build/components/Table/utils/getOutsideEndDays.js.map +1 -0
- package/build/components/Table/utils/getOutsideStartDays.d.ts +4 -0
- package/build/components/Table/utils/getOutsideStartDays.js +15 -0
- package/build/components/Table/utils/getOutsideStartDays.js.map +1 -0
- package/build/components/Table/utils/getWeeks.d.ts +17 -0
- package/build/components/Table/utils/getWeeks.js +50 -0
- package/build/components/Table/utils/getWeeks.js.map +1 -0
- package/build/components/WeekNumber/WeekNumber.d.ts +15 -0
- package/build/components/WeekNumber/WeekNumber.js +24 -0
- package/build/components/WeekNumber/WeekNumber.js.map +1 -0
- package/build/components/WeekNumber/index.d.ts +1 -0
- package/build/components/YearsDropdown/YearsDropdown.d.ts +16 -0
- package/build/components/YearsDropdown/YearsDropdown.js +28 -0
- package/build/components/YearsDropdown/YearsDropdown.js.map +1 -0
- package/build/components/YearsDropdown/index.d.ts +1 -0
- package/build/components/index.d.ts +18 -0
- package/build/contexts/ContextProvider.d.ts +8 -0
- package/build/contexts/ContextProvider.js +27 -0
- package/build/contexts/ContextProvider.js.map +1 -0
- package/build/contexts/DayPicker/DayPickerContext.d.ts +30 -0
- package/build/contexts/DayPicker/DayPickerContext.js +14 -0
- package/build/contexts/DayPicker/DayPickerContext.js.map +1 -0
- package/build/contexts/DayPicker/DayPickerProvider.d.ts +12 -0
- package/build/contexts/DayPicker/DayPickerProvider.js +59 -0
- package/build/contexts/DayPicker/DayPickerProvider.js.map +1 -0
- package/build/contexts/DayPicker/defaultClassNames.d.ts +5 -0
- package/build/contexts/DayPicker/defaultClassNames.js +44 -0
- package/build/contexts/DayPicker/defaultClassNames.js.map +1 -0
- package/build/contexts/DayPicker/formatters/formatCaption.d.ts +7 -0
- package/build/contexts/DayPicker/formatters/formatCaption.js +11 -0
- package/build/contexts/DayPicker/formatters/formatCaption.js.map +1 -0
- package/build/contexts/DayPicker/formatters/formatDay.d.ts +7 -0
- package/build/contexts/DayPicker/formatters/formatDay.js +11 -0
- package/build/contexts/DayPicker/formatters/formatDay.js.map +1 -0
- package/build/contexts/DayPicker/formatters/formatMonthCaption.d.ts +7 -0
- package/build/contexts/DayPicker/formatters/formatMonthCaption.js +11 -0
- package/build/contexts/DayPicker/formatters/formatMonthCaption.js.map +1 -0
- package/build/contexts/DayPicker/formatters/formatWeekNumber.d.ts +4 -0
- package/build/contexts/DayPicker/formatters/formatWeekNumber.js +9 -0
- package/build/contexts/DayPicker/formatters/formatWeekNumber.js.map +1 -0
- package/build/contexts/DayPicker/formatters/formatWeekdayName.d.ts +7 -0
- package/build/contexts/DayPicker/formatters/formatWeekdayName.js +11 -0
- package/build/contexts/DayPicker/formatters/formatWeekdayName.js.map +1 -0
- package/build/contexts/DayPicker/formatters/formatYearCaption.d.ts +6 -0
- package/build/contexts/DayPicker/formatters/formatYearCaption.js +11 -0
- package/build/contexts/DayPicker/formatters/formatYearCaption.js.map +1 -0
- package/build/contexts/DayPicker/formatters/index.d.ts +6 -0
- package/build/contexts/DayPicker/formatters/index.js +7 -0
- package/build/contexts/DayPicker/formatters/index.js.map +1 -0
- package/build/contexts/DayPicker/index.d.ts +1 -0
- package/build/contexts/DayPicker/labels/index.d.ts +7 -0
- package/build/contexts/DayPicker/labels/index.js +8 -0
- package/build/contexts/DayPicker/labels/index.js.map +1 -0
- package/build/contexts/DayPicker/labels/labelDay.d.ts +5 -0
- package/build/contexts/DayPicker/labels/labelDay.js +11 -0
- package/build/contexts/DayPicker/labels/labelDay.js.map +1 -0
- package/build/contexts/DayPicker/labels/labelMonthDropdown.d.ts +4 -0
- package/build/contexts/DayPicker/labels/labelMonthDropdown.js +9 -0
- package/build/contexts/DayPicker/labels/labelMonthDropdown.js.map +1 -0
- package/build/contexts/DayPicker/labels/labelNext.d.ts +5 -0
- package/build/contexts/DayPicker/labels/labelNext.js +9 -0
- package/build/contexts/DayPicker/labels/labelNext.js.map +1 -0
- package/build/contexts/DayPicker/labels/labelPrevious.d.ts +5 -0
- package/build/contexts/DayPicker/labels/labelPrevious.js +9 -0
- package/build/contexts/DayPicker/labels/labelPrevious.js.map +1 -0
- package/build/contexts/DayPicker/labels/labelWeekNumber.d.ts +5 -0
- package/build/contexts/DayPicker/labels/labelWeekNumber.js +9 -0
- package/build/contexts/DayPicker/labels/labelWeekNumber.js.map +1 -0
- package/build/contexts/DayPicker/labels/labelWeekday.d.ts +5 -0
- package/build/contexts/DayPicker/labels/labelWeekday.js +11 -0
- package/build/contexts/DayPicker/labels/labelWeekday.js.map +1 -0
- package/build/contexts/DayPicker/labels/labelYearDropdown.d.ts +4 -0
- package/build/contexts/DayPicker/labels/labelYearDropdown.js +9 -0
- package/build/contexts/DayPicker/labels/labelYearDropdown.js.map +1 -0
- package/build/contexts/DayPicker/useDayPicker.d.ts +8 -0
- package/build/contexts/DayPicker/useDayPicker.js +19 -0
- package/build/contexts/DayPicker/useDayPicker.js.map +1 -0
- package/build/contexts/DayPicker/utils/index.d.ts +2 -0
- package/build/contexts/DayPicker/utils/parseFromToProps.d.ts +9 -0
- package/build/contexts/DayPicker/utils/parseFromToProps.js +29 -0
- package/build/contexts/DayPicker/utils/parseFromToProps.js.map +1 -0
- package/build/contexts/DayPicker/utils/parseModifierProps.d.ts +9 -0
- package/build/contexts/DayPicker/utils/parseModifierProps.js +53 -0
- package/build/contexts/DayPicker/utils/parseModifierProps.js.map +1 -0
- package/build/contexts/Focus/FocusContext.d.ts +26 -0
- package/build/contexts/Focus/FocusContext.js +11 -0
- package/build/contexts/Focus/FocusContext.js.map +1 -0
- package/build/contexts/Focus/FocusProvider.d.ts +5 -0
- package/build/contexts/Focus/FocusProvider.js +66 -0
- package/build/contexts/Focus/FocusProvider.js.map +1 -0
- package/build/contexts/Focus/index.d.ts +3 -0
- package/build/contexts/Focus/useFocus.d.ts +3 -0
- package/build/contexts/Focus/useFocus.js +14 -0
- package/build/contexts/Focus/useFocus.js.map +1 -0
- package/build/contexts/Navigation/NavigationContext.d.ts +20 -0
- package/build/contexts/Navigation/NavigationContext.js +11 -0
- package/build/contexts/Navigation/NavigationContext.js.map +1 -0
- package/build/contexts/Navigation/NavigationProvider.d.ts +5 -0
- package/build/contexts/Navigation/NavigationProvider.js +26 -0
- package/build/contexts/Navigation/NavigationProvider.js.map +1 -0
- package/build/contexts/Navigation/index.d.ts +3 -0
- package/build/contexts/Navigation/useNavigation.d.ts +3 -0
- package/build/contexts/Navigation/useNavigation.js +14 -0
- package/build/contexts/Navigation/useNavigation.js.map +1 -0
- package/build/contexts/Navigation/useNavigationState.d.ts +7 -0
- package/build/contexts/Navigation/useNavigationState.js +19 -0
- package/build/contexts/Navigation/useNavigationState.js.map +1 -0
- package/build/contexts/Navigation/utils/getDisplayMonths.d.ts +8 -0
- package/build/contexts/Navigation/utils/getDisplayMonths.js +23 -0
- package/build/contexts/Navigation/utils/getDisplayMonths.js.map +1 -0
- package/build/contexts/Navigation/utils/getInitialMonth.d.ts +3 -0
- package/build/contexts/Navigation/utils/getInitialMonth.js +21 -0
- package/build/contexts/Navigation/utils/getInitialMonth.js.map +1 -0
- package/build/contexts/Navigation/utils/getNextMonth.d.ts +18 -0
- package/build/contexts/Navigation/utils/getNextMonth.js +32 -0
- package/build/contexts/Navigation/utils/getNextMonth.js.map +1 -0
- package/build/contexts/Navigation/utils/getPreviousMonth.d.ts +19 -0
- package/build/contexts/Navigation/utils/getPreviousMonth.js +33 -0
- package/build/contexts/Navigation/utils/getPreviousMonth.js.map +1 -0
- package/build/contexts/SelectMultiple/SelectMultipleContext.d.ts +20 -0
- package/build/contexts/SelectMultiple/SelectMultipleContext.js +12 -0
- package/build/contexts/SelectMultiple/SelectMultipleContext.js.map +1 -0
- package/build/contexts/SelectMultiple/SelectMultipleProvider.d.ts +9 -0
- package/build/contexts/SelectMultiple/SelectMultipleProvider.js +76 -0
- package/build/contexts/SelectMultiple/SelectMultipleProvider.js.map +1 -0
- package/build/contexts/SelectMultiple/index.d.ts +3 -0
- package/build/contexts/SelectMultiple/useSelectMultiple.d.ts +3 -0
- package/build/contexts/SelectMultiple/useSelectMultiple.js +14 -0
- package/build/contexts/SelectMultiple/useSelectMultiple.js.map +1 -0
- package/build/contexts/SelectRange/SelectRangeContext.d.ts +21 -0
- package/build/contexts/SelectRange/SelectRangeContext.js +12 -0
- package/build/contexts/SelectRange/SelectRangeContext.js.map +1 -0
- package/build/contexts/SelectRange/SelectRangeProvider.d.ts +13 -0
- package/build/contexts/SelectRange/SelectRangeProvider.js +119 -0
- package/build/contexts/SelectRange/SelectRangeProvider.js.map +1 -0
- package/build/contexts/SelectRange/index.d.ts +3 -0
- package/build/contexts/SelectRange/useSelectRange.d.ts +3 -0
- package/build/contexts/SelectRange/useSelectRange.js +14 -0
- package/build/contexts/SelectRange/useSelectRange.js.map +1 -0
- package/build/contexts/SelectRange/utils/addToRange.d.ts +8 -0
- package/build/contexts/SelectRange/utils/addToRange.js +39 -0
- package/build/contexts/SelectRange/utils/addToRange.js.map +1 -0
- package/build/contexts/SelectSingle/SelectSingleContext.d.ts +21 -0
- package/build/contexts/SelectSingle/SelectSingleContext.js +12 -0
- package/build/contexts/SelectSingle/SelectSingleContext.js.map +1 -0
- package/build/contexts/SelectSingle/SelectSingleProvider.d.ts +13 -0
- package/build/contexts/SelectSingle/SelectSingleProvider.js +44 -0
- package/build/contexts/SelectSingle/SelectSingleProvider.js.map +1 -0
- package/build/contexts/SelectSingle/index.d.ts +3 -0
- package/build/contexts/SelectSingle/useSelectSingle.d.ts +3 -0
- package/build/contexts/SelectSingle/useSelectSingle.js +14 -0
- package/build/contexts/SelectSingle/useSelectSingle.js.map +1 -0
- package/build/contexts/index.d.ts +7 -0
- package/build/hooks/index.d.ts +2 -0
- package/build/hooks/useControlledValue/index.d.ts +1 -0
- package/build/hooks/useControlledValue/useControlledValue.d.ts +12 -0
- package/build/hooks/useControlledValue/useControlledValue.js +19 -0
- package/build/hooks/useControlledValue/useControlledValue.js.map +1 -0
- package/build/hooks/useInput/index.d.ts +2 -0
- package/build/hooks/useInput/types/UseInput.d.ts +12 -0
- package/build/hooks/useInput/types/UseInputDayPickerProps.d.ts +14 -0
- package/build/hooks/useInput/types/UseInputFieldProps.d.ts +12 -0
- package/build/hooks/useInput/types/UseInputOptions.d.ts +35 -0
- package/build/hooks/useInput/types/index.d.ts +4 -0
- package/build/hooks/useInput/useInput.d.ts +4 -0
- package/build/hooks/useInput/useInput.js +103 -0
- package/build/hooks/useInput/useInput.js.map +1 -0
- package/build/hooks/useInput/utils/isValidDate.d.ts +2 -0
- package/build/hooks/useInput/utils/isValidDate.js +7 -0
- package/build/hooks/useInput/utils/isValidDate.js.map +1 -0
- package/build/hooks/useModifiers/index.d.ts +1 -0
- package/build/hooks/useModifiers/types/UseModifiers.d.ts +10 -0
- package/build/hooks/useModifiers/types/index.d.ts +1 -0
- package/build/hooks/useModifiers/useModifiers.d.ts +3 -0
- package/build/hooks/useModifiers/useModifiers.js +67 -0
- package/build/hooks/useModifiers/useModifiers.js.map +1 -0
- package/build/hooks/useModifiers/utils/getModifierStatus.d.ts +7 -0
- package/build/hooks/useModifiers/utils/getModifierStatus.js +22 -0
- package/build/hooks/useModifiers/utils/getModifierStatus.js.map +1 -0
- package/build/hooks/useModifiers/utils/isDateInRange.d.ts +3 -0
- package/build/hooks/useModifiers/utils/isDateInRange.js +25 -0
- package/build/hooks/useModifiers/utils/isDateInRange.js.map +1 -0
- package/build/hooks/useModifiers/utils/isMatch.d.ts +5 -0
- package/build/hooks/useModifiers/utils/isMatch.js +50 -0
- package/build/hooks/useModifiers/utils/isMatch.js.map +1 -0
- package/build/main.d.ts +5 -0
- package/build/main.js +51 -0
- package/build/main.js.map +1 -0
- package/build/test/PageObjects.d.ts +40 -0
- package/build/test/customRender.d.ts +4 -0
- package/build/test/customRenderHook.d.ts +3 -0
- package/build/test/index.d.ts +3 -0
- package/build/test/setup.d.ts +2 -0
- package/build/types/CaptionLayout.d.ts +7 -0
- package/build/types/ClassNames.d.ts +3 -0
- package/build/types/Components.d.ts +39 -0
- package/build/types/CustomModifiers.d.ts +4 -0
- package/build/types/DateAfter.d.ts +7 -0
- package/build/types/DateBefore.d.ts +7 -0
- package/build/types/DateFormatter.d.ts +6 -0
- package/build/types/DateInterval.d.ts +8 -0
- package/build/types/DateRange.d.ts +8 -0
- package/build/types/DayClickEventHandler.d.ts +6 -0
- package/build/types/DayFocusEventHandler.d.ts +6 -0
- package/build/types/DayKeyboardEventHandler.d.ts +6 -0
- package/build/types/DayLabelFormatter.d.ts +7 -0
- package/build/types/DayMouseEventHandler.d.ts +6 -0
- package/build/types/DayOfWeekMatcher.d.ts +7 -0
- package/build/types/DayPickerBase.d.ts +238 -0
- package/build/types/DayPickerCustom.d.ts +7 -0
- package/build/types/DayPickerMultiple.d.ts +17 -0
- package/build/types/DayPickerProps.d.ts +9 -0
- package/build/types/DayPickerRange.d.ts +20 -0
- package/build/types/DayPickerSingle.d.ts +15 -0
- package/build/types/DayTouchEventHandler.d.ts +6 -0
- package/build/types/Formatters.d.ts +19 -0
- package/build/types/InternalModifier.d.ts +2 -0
- package/build/types/Labels.d.ts +17 -0
- package/build/types/Matcher.d.ts +10 -0
- package/build/types/Modifier.d.ts +5 -0
- package/build/types/ModifierClassNames.d.ts +5 -0
- package/build/types/ModifierStatus.d.ts +5 -0
- package/build/types/ModifierStyles.d.ts +4 -0
- package/build/types/Modifiers.d.ts +5 -0
- package/build/types/MonthChangeEventHandler.d.ts +4 -0
- package/build/types/NavButtonLabelFormatter.d.ts +7 -0
- package/build/types/SelectMultipleEventHandler.d.ts +12 -0
- package/build/types/SelectRangeEventHandler.d.ts +10 -0
- package/build/types/SelectSingleEventHandler.d.ts +12 -0
- package/build/types/StyledComponentProps.d.ts +10 -0
- package/build/types/StyledElement.d.ts +76 -0
- package/build/types/Styles.d.ts +4 -0
- package/build/types/WeekNumberClickEventHandler.d.ts +9 -0
- package/build/types/WeekNumberFormatter.d.ts +6 -0
- package/build/types/WeekNumberLabelFormatter.d.ts +5 -0
- package/build/types/WeekdayLabelFormatter.d.ts +4 -0
- package/build/types/index.d.ts +54 -0
- package/build/types/isArrayOfDates.d.ts +2 -0
- package/build/types/isArrayOfDates.js +9 -0
- package/build/types/isArrayOfDates.js.map +1 -0
- package/build/types/isDateAfterType.d.ts +3 -0
- package/build/types/isDateAfterType.js +7 -0
- package/build/types/isDateAfterType.js.map +1 -0
- package/build/types/isDateBeforeType.d.ts +3 -0
- package/build/types/isDateBeforeType.js +7 -0
- package/build/types/isDateBeforeType.js.map +1 -0
- package/build/types/isDateInterval.d.ts +3 -0
- package/build/types/isDateInterval.js +10 -0
- package/build/types/isDateInterval.js.map +1 -0
- package/build/types/isDateRange.d.ts +3 -0
- package/build/types/isDateRange.js +8 -0
- package/build/types/isDateRange.js.map +1 -0
- package/build/types/isDateType.d.ts +2 -0
- package/build/types/isDateType.js +9 -0
- package/build/types/isDateType.js.map +1 -0
- package/build/types/isDayOfWeekType.d.ts +3 -0
- package/build/types/isDayOfWeekType.js +7 -0
- package/build/types/isDayOfWeekType.js.map +1 -0
- package/build/types/isDayPickerCustom.d.ts +4 -0
- package/build/types/isDayPickerCustom.js +7 -0
- package/build/types/isDayPickerCustom.js.map +1 -0
- package/build/types/isDayPickerMultiple.d.ts +4 -0
- package/build/types/isDayPickerMultiple.js +7 -0
- package/build/types/isDayPickerMultiple.js.map +1 -0
- package/build/types/isDayPickerRange.d.ts +4 -0
- package/build/types/isDayPickerRange.js +7 -0
- package/build/types/isDayPickerRange.js.map +1 -0
- package/build/types/isDayPickerSingle.d.ts +4 -0
- package/build/types/isDayPickerSingle.js +7 -0
- package/build/types/isDayPickerSingle.js.map +1 -0
- package/dist/main.js +1936 -0
- package/dist/main.js.map +1 -0
- package/package.json +35 -37
- package/style.css +19 -4
- package/style.css.d.ts +36 -34
- package/dist/DayPicker.js +0 -127
- package/dist/DayPicker.js.map +0 -1
- package/dist/DayPicker.test.js +0 -51
- package/dist/DayPicker.test.js.map +0 -1
- package/dist/components/Button/Button.js +0 -52
- package/dist/components/Button/Button.js.map +0 -1
- package/dist/components/Button/Button.test.js +0 -60
- package/dist/components/Button/Button.test.js.map +0 -1
- package/dist/components/Button/ButtonProps.js +0 -3
- package/dist/components/Button/ButtonProps.js.map +0 -1
- package/dist/components/Button/index.js +0 -14
- package/dist/components/Button/index.js.map +0 -1
- package/dist/components/Caption/Caption.js +0 -73
- package/dist/components/Caption/Caption.js.map +0 -1
- package/dist/components/Caption/Caption.test.js +0 -232
- package/dist/components/Caption/Caption.test.js.map +0 -1
- package/dist/components/Caption/CaptionProps.js +0 -3
- package/dist/components/Caption/CaptionProps.js.map +0 -1
- package/dist/components/Caption/index.js +0 -15
- package/dist/components/Caption/index.js.map +0 -1
- package/dist/components/CaptionLabel/CaptionLabel.js +0 -31
- package/dist/components/CaptionLabel/CaptionLabel.js.map +0 -1
- package/dist/components/CaptionLabel/CaptionLabel.test.js +0 -49
- package/dist/components/CaptionLabel/CaptionLabel.test.js.map +0 -1
- package/dist/components/CaptionLabel/CaptionLabelProps.js +0 -3
- package/dist/components/CaptionLabel/CaptionLabelProps.js.map +0 -1
- package/dist/components/CaptionLabel/index.js +0 -15
- package/dist/components/CaptionLabel/index.js.map +0 -1
- package/dist/components/Day/Day.js +0 -137
- package/dist/components/Day/Day.js.map +0 -1
- package/dist/components/Day/Day.test.js +0 -64
- package/dist/components/Day/Day.test.js.map +0 -1
- package/dist/components/Day/DayProps.js +0 -3
- package/dist/components/Day/DayProps.js.map +0 -1
- package/dist/components/Day/hooks/useDayFocus.js +0 -66
- package/dist/components/Day/hooks/useDayFocus.js.map +0 -1
- package/dist/components/Day/index.js +0 -15
- package/dist/components/Day/index.js.map +0 -1
- package/dist/components/DayContent/DayContent.js +0 -35
- package/dist/components/DayContent/DayContent.js.map +0 -1
- package/dist/components/DayContent/DayContent.test.js +0 -11
- package/dist/components/DayContent/DayContent.test.js.map +0 -1
- package/dist/components/DayContent/DayContentProps.js +0 -3
- package/dist/components/DayContent/DayContentProps.js.map +0 -1
- package/dist/components/DayContent/index.js +0 -15
- package/dist/components/DayContent/index.js.map +0 -1
- package/dist/components/Dropdown/Dropdown.js +0 -40
- package/dist/components/Dropdown/Dropdown.js.map +0 -1
- package/dist/components/Dropdown/Dropdown.test.js +0 -13
- package/dist/components/Dropdown/Dropdown.test.js.map +0 -1
- package/dist/components/Dropdown/DropdownProps.js +0 -3
- package/dist/components/Dropdown/DropdownProps.js.map +0 -1
- package/dist/components/Dropdown/index.js +0 -15
- package/dist/components/Dropdown/index.js.map +0 -1
- package/dist/components/Footer/Footer.js +0 -35
- package/dist/components/Footer/Footer.js.map +0 -1
- package/dist/components/Footer/Footer.test.js +0 -24
- package/dist/components/Footer/Footer.test.js.map +0 -1
- package/dist/components/Footer/index.js +0 -14
- package/dist/components/Footer/index.js.map +0 -1
- package/dist/components/Head/Head.js +0 -40
- package/dist/components/Head/Head.js.map +0 -1
- package/dist/components/Head/Head.test.js +0 -13
- package/dist/components/Head/Head.test.js.map +0 -1
- package/dist/components/Head/index.js +0 -14
- package/dist/components/Head/index.js.map +0 -1
- package/dist/components/Head/utils/getWeekdays.js +0 -19
- package/dist/components/Head/utils/getWeekdays.js.map +0 -1
- package/dist/components/Head/utils/getWeekdays.test.js +0 -3
- package/dist/components/Head/utils/getWeekdays.test.js.map +0 -1
- package/dist/components/Head/utils/index.js +0 -14
- package/dist/components/Head/utils/index.js.map +0 -1
- package/dist/components/IconDropdown/IconDropdown.js +0 -43
- package/dist/components/IconDropdown/IconDropdown.js.map +0 -1
- package/dist/components/IconDropdown/IconDropdown.test.js +0 -38
- package/dist/components/IconDropdown/IconDropdown.test.js.map +0 -1
- package/dist/components/IconDropdown/index.js +0 -14
- package/dist/components/IconDropdown/index.js.map +0 -1
- package/dist/components/IconNext/IconNext.js +0 -43
- package/dist/components/IconNext/IconNext.js.map +0 -1
- package/dist/components/IconNext/IconNext.test.js +0 -38
- package/dist/components/IconNext/IconNext.test.js.map +0 -1
- package/dist/components/IconNext/index.js +0 -14
- package/dist/components/IconNext/index.js.map +0 -1
- package/dist/components/IconPrevious/IconPrevious.js +0 -43
- package/dist/components/IconPrevious/IconPrevious.js.map +0 -1
- package/dist/components/IconPrevious/IconPrevious.test.js +0 -38
- package/dist/components/IconPrevious/IconPrevious.test.js.map +0 -1
- package/dist/components/IconPrevious/index.js +0 -14
- package/dist/components/IconPrevious/index.js.map +0 -1
- package/dist/components/MonthsDropdown/MonthsDropdown.js +0 -59
- package/dist/components/MonthsDropdown/MonthsDropdown.js.map +0 -1
- package/dist/components/MonthsDropdown/MonthsDropdownProps.js +0 -3
- package/dist/components/MonthsDropdown/MonthsDropdownProps.js.map +0 -1
- package/dist/components/MonthsDropdown/index.js +0 -15
- package/dist/components/MonthsDropdown/index.js.map +0 -1
- package/dist/components/Navigation/Navigation.js +0 -57
- package/dist/components/Navigation/Navigation.js.map +0 -1
- package/dist/components/Navigation/NavigationProps.js +0 -3
- package/dist/components/Navigation/NavigationProps.js.map +0 -1
- package/dist/components/Navigation/index.js +0 -15
- package/dist/components/Navigation/index.js.map +0 -1
- package/dist/components/Root/Root.js +0 -77
- package/dist/components/Root/Root.js.map +0 -1
- package/dist/components/Root/index.js +0 -14
- package/dist/components/Root/index.js.map +0 -1
- package/dist/components/Row/Row.js +0 -42
- package/dist/components/Row/Row.js.map +0 -1
- package/dist/components/Row/RowProps.js +0 -3
- package/dist/components/Row/RowProps.js.map +0 -1
- package/dist/components/Row/index.js +0 -15
- package/dist/components/Row/index.js.map +0 -1
- package/dist/components/Table/Table.js +0 -39
- package/dist/components/Table/Table.js.map +0 -1
- package/dist/components/Table/index.js +0 -14
- package/dist/components/Table/index.js.map +0 -1
- package/dist/components/Table/utils/getOutsideEndDays.js +0 -16
- package/dist/components/Table/utils/getOutsideEndDays.js.map +0 -1
- package/dist/components/Table/utils/getOutsideStartDays.js +0 -16
- package/dist/components/Table/utils/getOutsideStartDays.js.map +0 -1
- package/dist/components/Table/utils/getWeeks.js +0 -59
- package/dist/components/Table/utils/getWeeks.js.map +0 -1
- package/dist/components/WeekNumber/WeekNumber.js +0 -44
- package/dist/components/WeekNumber/WeekNumber.js.map +0 -1
- package/dist/components/WeekNumber/index.js +0 -14
- package/dist/components/WeekNumber/index.js.map +0 -1
- package/dist/components/YearsDropdown/YearsDropdown.js +0 -48
- package/dist/components/YearsDropdown/YearsDropdown.js.map +0 -1
- package/dist/components/YearsDropdown/index.js +0 -14
- package/dist/components/YearsDropdown/index.js.map +0 -1
- package/dist/components/index.js +0 -31
- package/dist/components/index.js.map +0 -1
- package/dist/contexts/ContextProvider.js +0 -52
- package/dist/contexts/ContextProvider.js.map +0 -1
- package/dist/contexts/DayPickerContext/DayPickerContext.js +0 -33
- package/dist/contexts/DayPickerContext/DayPickerContext.js.map +0 -1
- package/dist/contexts/DayPickerContext/DayPickerContextValue.js +0 -3
- package/dist/contexts/DayPickerContext/DayPickerContextValue.js.map +0 -1
- package/dist/contexts/DayPickerContext/DayPickerProvider.js +0 -89
- package/dist/contexts/DayPickerContext/DayPickerProvider.js.map +0 -1
- package/dist/contexts/DayPickerContext/defaultClassNames.js +0 -45
- package/dist/contexts/DayPickerContext/defaultClassNames.js.map +0 -1
- package/dist/contexts/DayPickerContext/formatters/formatCaption.js +0 -12
- package/dist/contexts/DayPickerContext/formatters/formatCaption.js.map +0 -1
- package/dist/contexts/DayPickerContext/formatters/formatDay.js +0 -12
- package/dist/contexts/DayPickerContext/formatters/formatDay.js.map +0 -1
- package/dist/contexts/DayPickerContext/formatters/formatMonthCaption.js +0 -12
- package/dist/contexts/DayPickerContext/formatters/formatMonthCaption.js.map +0 -1
- package/dist/contexts/DayPickerContext/formatters/formatWeekNumber.js +0 -11
- package/dist/contexts/DayPickerContext/formatters/formatWeekNumber.js.map +0 -1
- package/dist/contexts/DayPickerContext/formatters/formatWeekdayName.js +0 -12
- package/dist/contexts/DayPickerContext/formatters/formatWeekdayName.js.map +0 -1
- package/dist/contexts/DayPickerContext/formatters/formatYearCaption.js +0 -12
- package/dist/contexts/DayPickerContext/formatters/formatYearCaption.js.map +0 -1
- package/dist/contexts/DayPickerContext/formatters/index.js +0 -19
- package/dist/contexts/DayPickerContext/formatters/index.js.map +0 -1
- package/dist/contexts/DayPickerContext/index.js +0 -18
- package/dist/contexts/DayPickerContext/index.js.map +0 -1
- package/dist/contexts/DayPickerContext/labels/index.js +0 -20
- package/dist/contexts/DayPickerContext/labels/index.js.map +0 -1
- package/dist/contexts/DayPickerContext/labels/labelDay.js +0 -12
- package/dist/contexts/DayPickerContext/labels/labelDay.js.map +0 -1
- package/dist/contexts/DayPickerContext/labels/labelMonthDropdown.js +0 -11
- package/dist/contexts/DayPickerContext/labels/labelMonthDropdown.js.map +0 -1
- package/dist/contexts/DayPickerContext/labels/labelNext.js +0 -11
- package/dist/contexts/DayPickerContext/labels/labelNext.js.map +0 -1
- package/dist/contexts/DayPickerContext/labels/labelPrevious.js +0 -11
- package/dist/contexts/DayPickerContext/labels/labelPrevious.js.map +0 -1
- package/dist/contexts/DayPickerContext/labels/labelWeekNumber.js +0 -11
- package/dist/contexts/DayPickerContext/labels/labelWeekNumber.js.map +0 -1
- package/dist/contexts/DayPickerContext/labels/labelWeekday.js +0 -12
- package/dist/contexts/DayPickerContext/labels/labelWeekday.js.map +0 -1
- package/dist/contexts/DayPickerContext/labels/labelYearDropdown.js +0 -11
- package/dist/contexts/DayPickerContext/labels/labelYearDropdown.js.map +0 -1
- package/dist/contexts/DayPickerContext/useDayPicker.js +0 -39
- package/dist/contexts/DayPickerContext/useDayPicker.js.map +0 -1
- package/dist/contexts/DayPickerContext/utils/index.js +0 -15
- package/dist/contexts/DayPickerContext/utils/index.js.map +0 -1
- package/dist/contexts/DayPickerContext/utils/parseFromToProps.js +0 -30
- package/dist/contexts/DayPickerContext/utils/parseFromToProps.js.map +0 -1
- package/dist/contexts/DayPickerContext/utils/parseModifierProps.js +0 -53
- package/dist/contexts/DayPickerContext/utils/parseModifierProps.js.map +0 -1
- package/dist/contexts/FocusContext/FocusContext.js +0 -30
- package/dist/contexts/FocusContext/FocusContext.js.map +0 -1
- package/dist/contexts/FocusContext/FocusContextValue.js +0 -3
- package/dist/contexts/FocusContext/FocusContextValue.js.map +0 -1
- package/dist/contexts/FocusContext/FocusProvider.js +0 -84
- package/dist/contexts/FocusContext/FocusProvider.js.map +0 -1
- package/dist/contexts/FocusContext/index.js +0 -17
- package/dist/contexts/FocusContext/index.js.map +0 -1
- package/dist/contexts/FocusContext/useFocus.js +0 -34
- package/dist/contexts/FocusContext/useFocus.js.map +0 -1
- package/dist/contexts/NavigationContext/NavigationContext.js +0 -30
- package/dist/contexts/NavigationContext/NavigationContext.js.map +0 -1
- package/dist/contexts/NavigationContext/NavigationContextValue.js +0 -3
- package/dist/contexts/NavigationContext/NavigationContextValue.js.map +0 -1
- package/dist/contexts/NavigationContext/NavigationProvider.js +0 -46
- package/dist/contexts/NavigationContext/NavigationProvider.js.map +0 -1
- package/dist/contexts/NavigationContext/index.js +0 -17
- package/dist/contexts/NavigationContext/index.js.map +0 -1
- package/dist/contexts/NavigationContext/useNavigation.js +0 -34
- package/dist/contexts/NavigationContext/useNavigation.js.map +0 -1
- package/dist/contexts/NavigationContext/useNavigationState.js +0 -49
- package/dist/contexts/NavigationContext/useNavigationState.js.map +0 -1
- package/dist/contexts/NavigationContext/utils/getDisplayMonths.js +0 -24
- package/dist/contexts/NavigationContext/utils/getDisplayMonths.js.map +0 -1
- package/dist/contexts/NavigationContext/utils/getInitialMonth.js +0 -22
- package/dist/contexts/NavigationContext/utils/getInitialMonth.js.map +0 -1
- package/dist/contexts/NavigationContext/utils/getInitialMonth.test.js +0 -57
- package/dist/contexts/NavigationContext/utils/getInitialMonth.test.js.map +0 -1
- package/dist/contexts/NavigationContext/utils/getNextMonth.js +0 -33
- package/dist/contexts/NavigationContext/utils/getNextMonth.js.map +0 -1
- package/dist/contexts/NavigationContext/utils/getNextMonth.test.js +0 -75
- package/dist/contexts/NavigationContext/utils/getNextMonth.test.js.map +0 -1
- package/dist/contexts/NavigationContext/utils/getPreviousMonth.js +0 -34
- package/dist/contexts/NavigationContext/utils/getPreviousMonth.js.map +0 -1
- package/dist/contexts/NavigationContext/utils/getPreviousMonth.test.js +0 -55
- package/dist/contexts/NavigationContext/utils/getPreviousMonth.test.js.map +0 -1
- package/dist/contexts/SelectMultipleContext/SelectMultipleContext.js +0 -31
- package/dist/contexts/SelectMultipleContext/SelectMultipleContext.js.map +0 -1
- package/dist/contexts/SelectMultipleContext/SelectMultipleContextValue.js +0 -3
- package/dist/contexts/SelectMultipleContext/SelectMultipleContextValue.js.map +0 -1
- package/dist/contexts/SelectMultipleContext/SelectMultipleModifiers.js +0 -3
- package/dist/contexts/SelectMultipleContext/SelectMultipleModifiers.js.map +0 -1
- package/dist/contexts/SelectMultipleContext/SelectMultipleProvider.js +0 -101
- package/dist/contexts/SelectMultipleContext/SelectMultipleProvider.js.map +0 -1
- package/dist/contexts/SelectMultipleContext/index.js +0 -18
- package/dist/contexts/SelectMultipleContext/index.js.map +0 -1
- package/dist/contexts/SelectMultipleContext/useSelectMultiple.js +0 -34
- package/dist/contexts/SelectMultipleContext/useSelectMultiple.js.map +0 -1
- package/dist/contexts/SelectRangeContext/SelectRangeContext.js +0 -31
- package/dist/contexts/SelectRangeContext/SelectRangeContext.js.map +0 -1
- package/dist/contexts/SelectRangeContext/SelectRangeContextValue.js +0 -3
- package/dist/contexts/SelectRangeContext/SelectRangeContextValue.js.map +0 -1
- package/dist/contexts/SelectRangeContext/SelectRangeModifiers.js +0 -3
- package/dist/contexts/SelectRangeContext/SelectRangeModifiers.js.map +0 -1
- package/dist/contexts/SelectRangeContext/SelectRangeProvider.js +0 -131
- package/dist/contexts/SelectRangeContext/SelectRangeProvider.js.map +0 -1
- package/dist/contexts/SelectRangeContext/index.js +0 -18
- package/dist/contexts/SelectRangeContext/index.js.map +0 -1
- package/dist/contexts/SelectRangeContext/useSelectRange.js +0 -34
- package/dist/contexts/SelectRangeContext/useSelectRange.js.map +0 -1
- package/dist/contexts/SelectRangeContext/utils/addToRange.js +0 -40
- package/dist/contexts/SelectRangeContext/utils/addToRange.js.map +0 -1
- package/dist/contexts/SelectSingleContext/SelectSingleContext.js +0 -31
- package/dist/contexts/SelectSingleContext/SelectSingleContext.js.map +0 -1
- package/dist/contexts/SelectSingleContext/SelectSingleContextValue.js +0 -3
- package/dist/contexts/SelectSingleContext/SelectSingleContextValue.js.map +0 -1
- package/dist/contexts/SelectSingleContext/SelectSingleModifiers.js +0 -3
- package/dist/contexts/SelectSingleContext/SelectSingleModifiers.js.map +0 -1
- package/dist/contexts/SelectSingleContext/SelectSingleProvider.js +0 -52
- package/dist/contexts/SelectSingleContext/SelectSingleProvider.js.map +0 -1
- package/dist/contexts/SelectSingleContext/index.js +0 -18
- package/dist/contexts/SelectSingleContext/index.js.map +0 -1
- package/dist/contexts/SelectSingleContext/useSelectSingle.js +0 -34
- package/dist/contexts/SelectSingleContext/useSelectSingle.js.map +0 -1
- package/dist/contexts/index.js +0 -20
- package/dist/contexts/index.js.map +0 -1
- package/dist/hooks/index.js +0 -15
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/useInput/index.js +0 -15
- package/dist/hooks/useInput/index.js.map +0 -1
- package/dist/hooks/useInput/types/UseInput.js +0 -3
- package/dist/hooks/useInput/types/UseInput.js.map +0 -1
- package/dist/hooks/useInput/types/UseInputDayPickerProps.js +0 -3
- package/dist/hooks/useInput/types/UseInputDayPickerProps.js.map +0 -1
- package/dist/hooks/useInput/types/UseInputFieldProps.js +0 -3
- package/dist/hooks/useInput/types/UseInputFieldProps.js.map +0 -1
- package/dist/hooks/useInput/types/UseInputOptions.js +0 -3
- package/dist/hooks/useInput/types/UseInputOptions.js.map +0 -1
- package/dist/hooks/useInput/types/index.js +0 -17
- package/dist/hooks/useInput/types/index.js.map +0 -1
- package/dist/hooks/useInput/useInput.js +0 -123
- package/dist/hooks/useInput/useInput.js.map +0 -1
- package/dist/hooks/useInput/utils/isValidDate.js +0 -9
- package/dist/hooks/useInput/utils/isValidDate.js.map +0 -1
- package/dist/hooks/useModifiers/index.js +0 -14
- package/dist/hooks/useModifiers/index.js.map +0 -1
- package/dist/hooks/useModifiers/types/UseModifiers.js +0 -3
- package/dist/hooks/useModifiers/types/UseModifiers.js.map +0 -1
- package/dist/hooks/useModifiers/types/index.js +0 -14
- package/dist/hooks/useModifiers/types/index.js.map +0 -1
- package/dist/hooks/useModifiers/useModifiers.js +0 -70
- package/dist/hooks/useModifiers/useModifiers.js.map +0 -1
- package/dist/hooks/useModifiers/utils/getModifierStatus.js +0 -23
- package/dist/hooks/useModifiers/utils/getModifierStatus.js.map +0 -1
- package/dist/hooks/useModifiers/utils/isDateInRange.js +0 -26
- package/dist/hooks/useModifiers/utils/isDateInRange.js.map +0 -1
- package/dist/hooks/useModifiers/utils/isMatch.js +0 -45
- package/dist/hooks/useModifiers/utils/isMatch.js.map +0 -1
- package/dist/index.js +0 -18
- package/dist/index.js.map +0 -1
- package/dist/package.json +0 -3
- package/dist/test/PageObjects.js +0 -132
- package/dist/test/PageObjects.js.map +0 -1
- package/dist/test/customRender.js +0 -43
- package/dist/test/customRender.js.map +0 -1
- package/dist/test/index.js +0 -15
- package/dist/test/index.js.map +0 -1
- package/dist/test/setup.js +0 -5
- package/dist/test/setup.js.map +0 -1
- package/dist/types/CaptionLayout.js +0 -3
- package/dist/types/CaptionLayout.js.map +0 -1
- package/dist/types/ClassNames.js +0 -3
- package/dist/types/ClassNames.js.map +0 -1
- package/dist/types/Components.js +0 -3
- package/dist/types/Components.js.map +0 -1
- package/dist/types/CustomModifiers.js +0 -3
- package/dist/types/CustomModifiers.js.map +0 -1
- package/dist/types/DateAfter.js +0 -3
- package/dist/types/DateAfter.js.map +0 -1
- package/dist/types/DateBefore.js +0 -3
- package/dist/types/DateBefore.js.map +0 -1
- package/dist/types/DateFormatter.js +0 -3
- package/dist/types/DateFormatter.js.map +0 -1
- package/dist/types/DateInterval.js +0 -3
- package/dist/types/DateInterval.js.map +0 -1
- package/dist/types/DateRange.js +0 -3
- package/dist/types/DateRange.js.map +0 -1
- package/dist/types/DayClickEventHandler.js +0 -3
- package/dist/types/DayClickEventHandler.js.map +0 -1
- package/dist/types/DayFocusEventHandler.js +0 -3
- package/dist/types/DayFocusEventHandler.js.map +0 -1
- package/dist/types/DayKeyboardEventHandler.js +0 -3
- package/dist/types/DayKeyboardEventHandler.js.map +0 -1
- package/dist/types/DayLabelFormatter.js +0 -3
- package/dist/types/DayLabelFormatter.js.map +0 -1
- package/dist/types/DayMouseEventHandler.js +0 -3
- package/dist/types/DayMouseEventHandler.js.map +0 -1
- package/dist/types/DayOfWeekMatcher.js +0 -3
- package/dist/types/DayOfWeekMatcher.js.map +0 -1
- package/dist/types/DayPickerBase.js +0 -3
- package/dist/types/DayPickerBase.js.map +0 -1
- package/dist/types/DayPickerMultiple.js +0 -3
- package/dist/types/DayPickerMultiple.js.map +0 -1
- package/dist/types/DayPickerProps.js +0 -3
- package/dist/types/DayPickerProps.js.map +0 -1
- package/dist/types/DayPickerRange.js +0 -3
- package/dist/types/DayPickerRange.js.map +0 -1
- package/dist/types/DayPickerSingle.js +0 -3
- package/dist/types/DayPickerSingle.js.map +0 -1
- package/dist/types/DayPickerUncontrolled.js +0 -3
- package/dist/types/DayPickerUncontrolled.js.map +0 -1
- package/dist/types/DayTouchEventHandler.js +0 -3
- package/dist/types/DayTouchEventHandler.js.map +0 -1
- package/dist/types/Formatters.js +0 -3
- package/dist/types/Formatters.js.map +0 -1
- package/dist/types/InternalModifier.js +0 -3
- package/dist/types/InternalModifier.js.map +0 -1
- package/dist/types/Labels.js +0 -3
- package/dist/types/Labels.js.map +0 -1
- package/dist/types/Matcher.js +0 -3
- package/dist/types/Matcher.js.map +0 -1
- package/dist/types/Modifier.js +0 -3
- package/dist/types/Modifier.js.map +0 -1
- package/dist/types/ModifierClassNames.js +0 -3
- package/dist/types/ModifierClassNames.js.map +0 -1
- package/dist/types/ModifierStatus.js +0 -3
- package/dist/types/ModifierStatus.js.map +0 -1
- package/dist/types/ModifierStyles.js +0 -3
- package/dist/types/ModifierStyles.js.map +0 -1
- package/dist/types/Modifiers.js +0 -3
- package/dist/types/Modifiers.js.map +0 -1
- package/dist/types/MonthChangeEventHandler.js +0 -3
- package/dist/types/MonthChangeEventHandler.js.map +0 -1
- package/dist/types/NavButtonLabelFormatter.js +0 -3
- package/dist/types/NavButtonLabelFormatter.js.map +0 -1
- package/dist/types/SelectMultipleEventHandler.js +0 -3
- package/dist/types/SelectMultipleEventHandler.js.map +0 -1
- package/dist/types/SelectRangeEventHandler.js +0 -3
- package/dist/types/SelectRangeEventHandler.js.map +0 -1
- package/dist/types/SelectSingleEventHandler.js +0 -3
- package/dist/types/SelectSingleEventHandler.js.map +0 -1
- package/dist/types/StyledComponentProps.js +0 -3
- package/dist/types/StyledComponentProps.js.map +0 -1
- package/dist/types/StyledElement.js +0 -3
- package/dist/types/StyledElement.js.map +0 -1
- package/dist/types/Styles.js +0 -3
- package/dist/types/Styles.js.map +0 -1
- package/dist/types/WeekNumberClickEventHandler.js +0 -3
- package/dist/types/WeekNumberClickEventHandler.js.map +0 -1
- package/dist/types/WeekNumberFormatter.js +0 -3
- package/dist/types/WeekNumberFormatter.js.map +0 -1
- package/dist/types/WeekNumberLabelFormatter.js +0 -3
- package/dist/types/WeekNumberLabelFormatter.js.map +0 -1
- package/dist/types/WeekdayLabelFormatter.js +0 -3
- package/dist/types/WeekdayLabelFormatter.js.map +0 -1
- package/dist/types/index.js +0 -67
- package/dist/types/index.js.map +0 -1
- package/dist/types/isArrayOfDates.js +0 -10
- package/dist/types/isArrayOfDates.js.map +0 -1
- package/dist/types/isDateAfterType.js +0 -9
- package/dist/types/isDateAfterType.js.map +0 -1
- package/dist/types/isDateBeforeType.js +0 -9
- package/dist/types/isDateBeforeType.js.map +0 -1
- package/dist/types/isDateInterval.js +0 -12
- package/dist/types/isDateInterval.js.map +0 -1
- package/dist/types/isDateRange.js +0 -10
- package/dist/types/isDateRange.js.map +0 -1
- package/dist/types/isDateType.js +0 -10
- package/dist/types/isDateType.js.map +0 -1
- package/dist/types/isDayOfWeekType.js +0 -9
- package/dist/types/isDayOfWeekType.js.map +0 -1
- package/dist/types/isDayPickerMultiple.js +0 -9
- package/dist/types/isDayPickerMultiple.js.map +0 -1
- package/dist/types/isDayPickerRange.js +0 -9
- package/dist/types/isDayPickerRange.js.map +0 -1
- package/dist/types/isDayPickerSingle.js +0 -9
- package/dist/types/isDayPickerSingle.js.map +0 -1
- package/dist/types/isDayPickerUncontrolled.js +0 -9
- package/dist/types/isDayPickerUncontrolled.js.map +0 -1
- package/esm/DayPicker.d.ts +0 -88
- package/esm/DayPicker.js +0 -104
- package/esm/DayPicker.js.map +0 -1
- package/esm/DayPicker.test.d.ts +0 -0
- package/esm/DayPicker.test.js +0 -51
- package/esm/DayPicker.test.js.map +0 -1
- package/esm/components/Button/Button.d.ts +0 -6
- package/esm/components/Button/Button.js +0 -30
- package/esm/components/Button/Button.js.map +0 -1
- package/esm/components/Button/Button.test.d.ts +0 -1
- package/esm/components/Button/Button.test.js +0 -39
- package/esm/components/Button/Button.test.js.map +0 -1
- package/esm/components/Button/ButtonProps.d.ts +0 -3
- package/esm/components/Button/ButtonProps.js +0 -2
- package/esm/components/Button/ButtonProps.js.map +0 -1
- package/esm/components/Button/index.d.ts +0 -1
- package/esm/components/Button/index.js +0 -2
- package/esm/components/Button/index.js.map +0 -1
- package/esm/components/Caption/Caption.d.ts +0 -7
- package/esm/components/Caption/Caption.js +0 -50
- package/esm/components/Caption/Caption.js.map +0 -1
- package/esm/components/Caption/Caption.test.d.ts +0 -1
- package/esm/components/Caption/Caption.test.js +0 -208
- package/esm/components/Caption/Caption.test.js.map +0 -1
- package/esm/components/Caption/CaptionProps.d.ts +0 -5
- package/esm/components/Caption/CaptionProps.js +0 -2
- package/esm/components/Caption/CaptionProps.js.map +0 -1
- package/esm/components/Caption/index.d.ts +0 -2
- package/esm/components/Caption/index.js +0 -3
- package/esm/components/Caption/index.js.map +0 -1
- package/esm/components/CaptionLabel/CaptionLabel.d.ts +0 -4
- package/esm/components/CaptionLabel/CaptionLabel.js +0 -8
- package/esm/components/CaptionLabel/CaptionLabel.js.map +0 -1
- package/esm/components/CaptionLabel/CaptionLabel.test.d.ts +0 -1
- package/esm/components/CaptionLabel/CaptionLabel.test.js +0 -25
- package/esm/components/CaptionLabel/CaptionLabel.test.js.map +0 -1
- package/esm/components/CaptionLabel/CaptionLabelProps.d.ts +0 -5
- package/esm/components/CaptionLabel/CaptionLabelProps.js +0 -2
- package/esm/components/CaptionLabel/CaptionLabelProps.js.map +0 -1
- package/esm/components/CaptionLabel/index.d.ts +0 -2
- package/esm/components/CaptionLabel/index.js +0 -3
- package/esm/components/CaptionLabel/index.js.map +0 -1
- package/esm/components/Day/Day.d.ts +0 -7
- package/esm/components/Day/Day.js +0 -114
- package/esm/components/Day/Day.js.map +0 -1
- package/esm/components/Day/Day.test.d.ts +0 -0
- package/esm/components/Day/Day.test.js +0 -64
- package/esm/components/Day/Day.test.js.map +0 -1
- package/esm/components/Day/DayProps.d.ts +0 -7
- package/esm/components/Day/DayProps.js +0 -2
- package/esm/components/Day/DayProps.js.map +0 -1
- package/esm/components/Day/hooks/useDayFocus.d.ts +0 -8
- package/esm/components/Day/hooks/useDayFocus.js +0 -43
- package/esm/components/Day/hooks/useDayFocus.js.map +0 -1
- package/esm/components/Day/index.d.ts +0 -2
- package/esm/components/Day/index.js +0 -3
- package/esm/components/Day/index.js.map +0 -1
- package/esm/components/DayContent/DayContent.d.ts +0 -6
- package/esm/components/DayContent/DayContent.js +0 -12
- package/esm/components/DayContent/DayContent.js.map +0 -1
- package/esm/components/DayContent/DayContent.test.d.ts +0 -0
- package/esm/components/DayContent/DayContent.test.js +0 -11
- package/esm/components/DayContent/DayContent.test.js.map +0 -1
- package/esm/components/DayContent/DayContentProps.d.ts +0 -10
- package/esm/components/DayContent/DayContentProps.js +0 -2
- package/esm/components/DayContent/DayContentProps.js.map +0 -1
- package/esm/components/DayContent/index.d.ts +0 -2
- package/esm/components/DayContent/index.js +0 -3
- package/esm/components/DayContent/index.js.map +0 -1
- package/esm/components/Dropdown/Dropdown.d.ts +0 -7
- package/esm/components/Dropdown/Dropdown.js +0 -17
- package/esm/components/Dropdown/Dropdown.js.map +0 -1
- package/esm/components/Dropdown/Dropdown.test.d.ts +0 -0
- package/esm/components/Dropdown/Dropdown.test.js +0 -13
- package/esm/components/Dropdown/Dropdown.test.js.map +0 -1
- package/esm/components/Dropdown/DropdownProps.d.ts +0 -10
- package/esm/components/Dropdown/DropdownProps.js +0 -2
- package/esm/components/Dropdown/DropdownProps.js.map +0 -1
- package/esm/components/Dropdown/index.d.ts +0 -2
- package/esm/components/Dropdown/index.js +0 -3
- package/esm/components/Dropdown/index.js.map +0 -1
- package/esm/components/Footer/Footer.d.ts +0 -3
- package/esm/components/Footer/Footer.js +0 -12
- package/esm/components/Footer/Footer.js.map +0 -1
- package/esm/components/Footer/Footer.test.d.ts +0 -1
- package/esm/components/Footer/Footer.test.js +0 -19
- package/esm/components/Footer/Footer.test.js.map +0 -1
- package/esm/components/Footer/index.d.ts +0 -1
- package/esm/components/Footer/index.js +0 -2
- package/esm/components/Footer/index.js.map +0 -1
- package/esm/components/Head/Head.d.ts +0 -5
- package/esm/components/Head/Head.js +0 -17
- package/esm/components/Head/Head.js.map +0 -1
- package/esm/components/Head/Head.test.d.ts +0 -0
- package/esm/components/Head/Head.test.js +0 -13
- package/esm/components/Head/Head.test.js.map +0 -1
- package/esm/components/Head/index.d.ts +0 -1
- package/esm/components/Head/index.js +0 -2
- package/esm/components/Head/index.js.map +0 -1
- package/esm/components/Head/utils/getWeekdays.d.ts +0 -6
- package/esm/components/Head/utils/getWeekdays.js +0 -15
- package/esm/components/Head/utils/getWeekdays.js.map +0 -1
- package/esm/components/Head/utils/getWeekdays.test.d.ts +0 -0
- package/esm/components/Head/utils/getWeekdays.test.js +0 -3
- package/esm/components/Head/utils/getWeekdays.test.js.map +0 -1
- package/esm/components/Head/utils/index.d.ts +0 -1
- package/esm/components/Head/utils/index.js +0 -2
- package/esm/components/Head/utils/index.js.map +0 -1
- package/esm/components/IconDropdown/IconDropdown.d.ts +0 -6
- package/esm/components/IconDropdown/IconDropdown.js +0 -20
- package/esm/components/IconDropdown/IconDropdown.js.map +0 -1
- package/esm/components/IconDropdown/IconDropdown.test.d.ts +0 -1
- package/esm/components/IconDropdown/IconDropdown.test.js +0 -17
- package/esm/components/IconDropdown/IconDropdown.test.js.map +0 -1
- package/esm/components/IconDropdown/index.d.ts +0 -1
- package/esm/components/IconDropdown/index.js +0 -2
- package/esm/components/IconDropdown/index.js.map +0 -1
- package/esm/components/IconNext/IconNext.d.ts +0 -6
- package/esm/components/IconNext/IconNext.js +0 -20
- package/esm/components/IconNext/IconNext.js.map +0 -1
- package/esm/components/IconNext/IconNext.test.d.ts +0 -1
- package/esm/components/IconNext/IconNext.test.js +0 -17
- package/esm/components/IconNext/IconNext.test.js.map +0 -1
- package/esm/components/IconNext/index.d.ts +0 -1
- package/esm/components/IconNext/index.js +0 -2
- package/esm/components/IconNext/index.js.map +0 -1
- package/esm/components/IconPrevious/IconPrevious.d.ts +0 -6
- package/esm/components/IconPrevious/IconPrevious.js +0 -20
- package/esm/components/IconPrevious/IconPrevious.js.map +0 -1
- package/esm/components/IconPrevious/IconPrevious.test.d.ts +0 -1
- package/esm/components/IconPrevious/IconPrevious.test.js +0 -17
- package/esm/components/IconPrevious/IconPrevious.test.js.map +0 -1
- package/esm/components/IconPrevious/index.d.ts +0 -1
- package/esm/components/IconPrevious/index.js +0 -2
- package/esm/components/IconPrevious/index.js.map +0 -1
- package/esm/components/MonthsDropdown/MonthsDropdown.d.ts +0 -6
- package/esm/components/MonthsDropdown/MonthsDropdown.js +0 -36
- package/esm/components/MonthsDropdown/MonthsDropdown.js.map +0 -1
- package/esm/components/MonthsDropdown/MonthsDropdownProps.d.ts +0 -7
- package/esm/components/MonthsDropdown/MonthsDropdownProps.js +0 -2
- package/esm/components/MonthsDropdown/MonthsDropdownProps.js.map +0 -1
- package/esm/components/MonthsDropdown/index.d.ts +0 -2
- package/esm/components/MonthsDropdown/index.js +0 -3
- package/esm/components/MonthsDropdown/index.js.map +0 -1
- package/esm/components/Navigation/Navigation.d.ts +0 -4
- package/esm/components/Navigation/Navigation.js +0 -34
- package/esm/components/Navigation/Navigation.js.map +0 -1
- package/esm/components/Navigation/NavigationProps.d.ts +0 -18
- package/esm/components/Navigation/NavigationProps.js +0 -2
- package/esm/components/Navigation/NavigationProps.js.map +0 -1
- package/esm/components/Navigation/index.d.ts +0 -2
- package/esm/components/Navigation/index.js +0 -3
- package/esm/components/Navigation/index.js.map +0 -1
- package/esm/components/Root/Root.d.ts +0 -6
- package/esm/components/Root/Root.js +0 -54
- package/esm/components/Root/Root.js.map +0 -1
- package/esm/components/Root/index.d.ts +0 -1
- package/esm/components/Root/index.js +0 -2
- package/esm/components/Root/index.js.map +0 -1
- package/esm/components/Row/Row.d.ts +0 -6
- package/esm/components/Row/Row.js +0 -19
- package/esm/components/Row/Row.js.map +0 -1
- package/esm/components/Row/RowProps.d.ts +0 -11
- package/esm/components/Row/RowProps.js +0 -2
- package/esm/components/Row/RowProps.js.map +0 -1
- package/esm/components/Row/index.d.ts +0 -2
- package/esm/components/Row/index.js +0 -3
- package/esm/components/Row/index.js.map +0 -1
- package/esm/components/Table/Table.d.ts +0 -12
- package/esm/components/Table/Table.js +0 -16
- package/esm/components/Table/Table.js.map +0 -1
- package/esm/components/Table/index.d.ts +0 -1
- package/esm/components/Table/index.js +0 -2
- package/esm/components/Table/index.js.map +0 -1
- package/esm/components/Table/utils/getOutsideEndDays.d.ts +0 -3
- package/esm/components/Table/utils/getOutsideEndDays.js +0 -12
- package/esm/components/Table/utils/getOutsideEndDays.js.map +0 -1
- package/esm/components/Table/utils/getOutsideStartDays.d.ts +0 -4
- package/esm/components/Table/utils/getOutsideStartDays.js +0 -12
- package/esm/components/Table/utils/getOutsideStartDays.js.map +0 -1
- package/esm/components/Table/utils/getWeeks.d.ts +0 -15
- package/esm/components/Table/utils/getWeeks.js +0 -55
- package/esm/components/Table/utils/getWeeks.js.map +0 -1
- package/esm/components/WeekNumber/WeekNumber.d.ts +0 -15
- package/esm/components/WeekNumber/WeekNumber.js +0 -21
- package/esm/components/WeekNumber/WeekNumber.js.map +0 -1
- package/esm/components/WeekNumber/index.d.ts +0 -1
- package/esm/components/WeekNumber/index.js +0 -2
- package/esm/components/WeekNumber/index.js.map +0 -1
- package/esm/components/YearsDropdown/YearsDropdown.d.ts +0 -16
- package/esm/components/YearsDropdown/YearsDropdown.js +0 -25
- package/esm/components/YearsDropdown/YearsDropdown.js.map +0 -1
- package/esm/components/YearsDropdown/index.d.ts +0 -1
- package/esm/components/YearsDropdown/index.js +0 -2
- package/esm/components/YearsDropdown/index.js.map +0 -1
- package/esm/components/index.d.ts +0 -18
- package/esm/components/index.js +0 -19
- package/esm/components/index.js.map +0 -1
- package/esm/contexts/ContextProvider.d.ts +0 -8
- package/esm/contexts/ContextProvider.js +0 -29
- package/esm/contexts/ContextProvider.js.map +0 -1
- package/esm/contexts/DayPickerContext/DayPickerContext.d.ts +0 -78
- package/esm/contexts/DayPickerContext/DayPickerContext.js +0 -11
- package/esm/contexts/DayPickerContext/DayPickerContext.js.map +0 -1
- package/esm/contexts/DayPickerContext/DayPickerContextValue.d.ts +0 -20
- package/esm/contexts/DayPickerContext/DayPickerContextValue.js +0 -2
- package/esm/contexts/DayPickerContext/DayPickerContextValue.js.map +0 -1
- package/esm/contexts/DayPickerContext/DayPickerProvider.d.ts +0 -12
- package/esm/contexts/DayPickerContext/DayPickerProvider.js +0 -63
- package/esm/contexts/DayPickerContext/DayPickerProvider.js.map +0 -1
- package/esm/contexts/DayPickerContext/defaultClassNames.d.ts +0 -5
- package/esm/contexts/DayPickerContext/defaultClassNames.js +0 -42
- package/esm/contexts/DayPickerContext/defaultClassNames.js.map +0 -1
- package/esm/contexts/DayPickerContext/formatters/formatCaption.d.ts +0 -7
- package/esm/contexts/DayPickerContext/formatters/formatCaption.js +0 -8
- package/esm/contexts/DayPickerContext/formatters/formatCaption.js.map +0 -1
- package/esm/contexts/DayPickerContext/formatters/formatDay.d.ts +0 -7
- package/esm/contexts/DayPickerContext/formatters/formatDay.js +0 -8
- package/esm/contexts/DayPickerContext/formatters/formatDay.js.map +0 -1
- package/esm/contexts/DayPickerContext/formatters/formatMonthCaption.d.ts +0 -7
- package/esm/contexts/DayPickerContext/formatters/formatMonthCaption.js +0 -8
- package/esm/contexts/DayPickerContext/formatters/formatMonthCaption.js.map +0 -1
- package/esm/contexts/DayPickerContext/formatters/formatWeekNumber.d.ts +0 -4
- package/esm/contexts/DayPickerContext/formatters/formatWeekNumber.js +0 -7
- package/esm/contexts/DayPickerContext/formatters/formatWeekNumber.js.map +0 -1
- package/esm/contexts/DayPickerContext/formatters/formatWeekdayName.d.ts +0 -7
- package/esm/contexts/DayPickerContext/formatters/formatWeekdayName.js +0 -8
- package/esm/contexts/DayPickerContext/formatters/formatWeekdayName.js.map +0 -1
- package/esm/contexts/DayPickerContext/formatters/formatYearCaption.d.ts +0 -6
- package/esm/contexts/DayPickerContext/formatters/formatYearCaption.js +0 -8
- package/esm/contexts/DayPickerContext/formatters/formatYearCaption.js.map +0 -1
- package/esm/contexts/DayPickerContext/formatters/index.d.ts +0 -6
- package/esm/contexts/DayPickerContext/formatters/index.js +0 -7
- package/esm/contexts/DayPickerContext/formatters/index.js.map +0 -1
- package/esm/contexts/DayPickerContext/index.d.ts +0 -5
- package/esm/contexts/DayPickerContext/index.js +0 -6
- package/esm/contexts/DayPickerContext/index.js.map +0 -1
- package/esm/contexts/DayPickerContext/labels/index.d.ts +0 -7
- package/esm/contexts/DayPickerContext/labels/index.js +0 -8
- package/esm/contexts/DayPickerContext/labels/index.js.map +0 -1
- package/esm/contexts/DayPickerContext/labels/labelDay.d.ts +0 -5
- package/esm/contexts/DayPickerContext/labels/labelDay.js +0 -8
- package/esm/contexts/DayPickerContext/labels/labelDay.js.map +0 -1
- package/esm/contexts/DayPickerContext/labels/labelMonthDropdown.d.ts +0 -4
- package/esm/contexts/DayPickerContext/labels/labelMonthDropdown.js +0 -7
- package/esm/contexts/DayPickerContext/labels/labelMonthDropdown.js.map +0 -1
- package/esm/contexts/DayPickerContext/labels/labelNext.d.ts +0 -5
- package/esm/contexts/DayPickerContext/labels/labelNext.js +0 -7
- package/esm/contexts/DayPickerContext/labels/labelNext.js.map +0 -1
- package/esm/contexts/DayPickerContext/labels/labelPrevious.d.ts +0 -5
- package/esm/contexts/DayPickerContext/labels/labelPrevious.js +0 -7
- package/esm/contexts/DayPickerContext/labels/labelPrevious.js.map +0 -1
- package/esm/contexts/DayPickerContext/labels/labelWeekNumber.d.ts +0 -5
- package/esm/contexts/DayPickerContext/labels/labelWeekNumber.js +0 -7
- package/esm/contexts/DayPickerContext/labels/labelWeekNumber.js.map +0 -1
- package/esm/contexts/DayPickerContext/labels/labelWeekday.d.ts +0 -5
- package/esm/contexts/DayPickerContext/labels/labelWeekday.js +0 -8
- package/esm/contexts/DayPickerContext/labels/labelWeekday.js.map +0 -1
- package/esm/contexts/DayPickerContext/labels/labelYearDropdown.d.ts +0 -4
- package/esm/contexts/DayPickerContext/labels/labelYearDropdown.js +0 -7
- package/esm/contexts/DayPickerContext/labels/labelYearDropdown.js.map +0 -1
- package/esm/contexts/DayPickerContext/useDayPicker.d.ts +0 -8
- package/esm/contexts/DayPickerContext/useDayPicker.js +0 -16
- package/esm/contexts/DayPickerContext/useDayPicker.js.map +0 -1
- package/esm/contexts/DayPickerContext/utils/index.d.ts +0 -2
- package/esm/contexts/DayPickerContext/utils/index.js +0 -3
- package/esm/contexts/DayPickerContext/utils/index.js.map +0 -1
- package/esm/contexts/DayPickerContext/utils/parseFromToProps.d.ts +0 -9
- package/esm/contexts/DayPickerContext/utils/parseFromToProps.js +0 -26
- package/esm/contexts/DayPickerContext/utils/parseFromToProps.js.map +0 -1
- package/esm/contexts/DayPickerContext/utils/parseModifierProps.d.ts +0 -9
- package/esm/contexts/DayPickerContext/utils/parseModifierProps.js +0 -49
- package/esm/contexts/DayPickerContext/utils/parseModifierProps.js.map +0 -1
- package/esm/contexts/FocusContext/FocusContext.d.ts +0 -8
- package/esm/contexts/FocusContext/FocusContext.js +0 -8
- package/esm/contexts/FocusContext/FocusContext.js.map +0 -1
- package/esm/contexts/FocusContext/FocusContextValue.d.ts +0 -19
- package/esm/contexts/FocusContext/FocusContextValue.js +0 -2
- package/esm/contexts/FocusContext/FocusContextValue.js.map +0 -1
- package/esm/contexts/FocusContext/FocusProvider.d.ts +0 -5
- package/esm/contexts/FocusContext/FocusProvider.js +0 -61
- package/esm/contexts/FocusContext/FocusProvider.js.map +0 -1
- package/esm/contexts/FocusContext/index.d.ts +0 -4
- package/esm/contexts/FocusContext/index.js +0 -5
- package/esm/contexts/FocusContext/index.js.map +0 -1
- package/esm/contexts/FocusContext/useFocus.d.ts +0 -3
- package/esm/contexts/FocusContext/useFocus.js +0 -11
- package/esm/contexts/FocusContext/useFocus.js.map +0 -1
- package/esm/contexts/NavigationContext/NavigationContext.d.ts +0 -8
- package/esm/contexts/NavigationContext/NavigationContext.js +0 -8
- package/esm/contexts/NavigationContext/NavigationContext.js.map +0 -1
- package/esm/contexts/NavigationContext/NavigationContextValue.d.ts +0 -13
- package/esm/contexts/NavigationContext/NavigationContextValue.js +0 -2
- package/esm/contexts/NavigationContext/NavigationContextValue.js.map +0 -1
- package/esm/contexts/NavigationContext/NavigationProvider.d.ts +0 -5
- package/esm/contexts/NavigationContext/NavigationProvider.js +0 -23
- package/esm/contexts/NavigationContext/NavigationProvider.js.map +0 -1
- package/esm/contexts/NavigationContext/index.d.ts +0 -4
- package/esm/contexts/NavigationContext/index.js +0 -5
- package/esm/contexts/NavigationContext/index.js.map +0 -1
- package/esm/contexts/NavigationContext/useNavigation.d.ts +0 -3
- package/esm/contexts/NavigationContext/useNavigation.js +0 -11
- package/esm/contexts/NavigationContext/useNavigation.js.map +0 -1
- package/esm/contexts/NavigationContext/useNavigationState.d.ts +0 -7
- package/esm/contexts/NavigationContext/useNavigationState.js +0 -26
- package/esm/contexts/NavigationContext/useNavigationState.js.map +0 -1
- package/esm/contexts/NavigationContext/utils/getDisplayMonths.d.ts +0 -8
- package/esm/contexts/NavigationContext/utils/getDisplayMonths.js +0 -20
- package/esm/contexts/NavigationContext/utils/getDisplayMonths.js.map +0 -1
- package/esm/contexts/NavigationContext/utils/getInitialMonth.d.ts +0 -3
- package/esm/contexts/NavigationContext/utils/getInitialMonth.js +0 -18
- package/esm/contexts/NavigationContext/utils/getInitialMonth.js.map +0 -1
- package/esm/contexts/NavigationContext/utils/getInitialMonth.test.d.ts +0 -1
- package/esm/contexts/NavigationContext/utils/getInitialMonth.test.js +0 -55
- package/esm/contexts/NavigationContext/utils/getInitialMonth.test.js.map +0 -1
- package/esm/contexts/NavigationContext/utils/getNextMonth.d.ts +0 -18
- package/esm/contexts/NavigationContext/utils/getNextMonth.js +0 -29
- package/esm/contexts/NavigationContext/utils/getNextMonth.js.map +0 -1
- package/esm/contexts/NavigationContext/utils/getNextMonth.test.d.ts +0 -1
- package/esm/contexts/NavigationContext/utils/getNextMonth.test.js +0 -73
- package/esm/contexts/NavigationContext/utils/getNextMonth.test.js.map +0 -1
- package/esm/contexts/NavigationContext/utils/getPreviousMonth.d.ts +0 -19
- package/esm/contexts/NavigationContext/utils/getPreviousMonth.js +0 -30
- package/esm/contexts/NavigationContext/utils/getPreviousMonth.js.map +0 -1
- package/esm/contexts/NavigationContext/utils/getPreviousMonth.test.d.ts +0 -1
- package/esm/contexts/NavigationContext/utils/getPreviousMonth.test.js +0 -53
- package/esm/contexts/NavigationContext/utils/getPreviousMonth.test.js.map +0 -1
- package/esm/contexts/SelectMultipleContext/SelectMultipleContext.d.ts +0 -9
- package/esm/contexts/SelectMultipleContext/SelectMultipleContext.js +0 -9
- package/esm/contexts/SelectMultipleContext/SelectMultipleContext.js.map +0 -1
- package/esm/contexts/SelectMultipleContext/SelectMultipleContextValue.d.ts +0 -13
- package/esm/contexts/SelectMultipleContext/SelectMultipleContextValue.js +0 -2
- package/esm/contexts/SelectMultipleContext/SelectMultipleContextValue.js.map +0 -1
- package/esm/contexts/SelectMultipleContext/SelectMultipleModifiers.d.ts +0 -3
- package/esm/contexts/SelectMultipleContext/SelectMultipleModifiers.js +0 -2
- package/esm/contexts/SelectMultipleContext/SelectMultipleModifiers.js.map +0 -1
- package/esm/contexts/SelectMultipleContext/SelectMultipleProvider.d.ts +0 -7
- package/esm/contexts/SelectMultipleContext/SelectMultipleProvider.js +0 -78
- package/esm/contexts/SelectMultipleContext/SelectMultipleProvider.js.map +0 -1
- package/esm/contexts/SelectMultipleContext/index.d.ts +0 -5
- package/esm/contexts/SelectMultipleContext/index.js +0 -6
- package/esm/contexts/SelectMultipleContext/index.js.map +0 -1
- package/esm/contexts/SelectMultipleContext/useSelectMultiple.d.ts +0 -3
- package/esm/contexts/SelectMultipleContext/useSelectMultiple.js +0 -11
- package/esm/contexts/SelectMultipleContext/useSelectMultiple.js.map +0 -1
- package/esm/contexts/SelectRangeContext/SelectRangeContext.d.ts +0 -9
- package/esm/contexts/SelectRangeContext/SelectRangeContext.js +0 -9
- package/esm/contexts/SelectRangeContext/SelectRangeContext.js.map +0 -1
- package/esm/contexts/SelectRangeContext/SelectRangeContextValue.d.ts +0 -13
- package/esm/contexts/SelectRangeContext/SelectRangeContextValue.js +0 -2
- package/esm/contexts/SelectRangeContext/SelectRangeContextValue.js.map +0 -1
- package/esm/contexts/SelectRangeContext/SelectRangeModifiers.d.ts +0 -3
- package/esm/contexts/SelectRangeContext/SelectRangeModifiers.js +0 -2
- package/esm/contexts/SelectRangeContext/SelectRangeModifiers.js.map +0 -1
- package/esm/contexts/SelectRangeContext/SelectRangeProvider.d.ts +0 -7
- package/esm/contexts/SelectRangeContext/SelectRangeProvider.js +0 -108
- package/esm/contexts/SelectRangeContext/SelectRangeProvider.js.map +0 -1
- package/esm/contexts/SelectRangeContext/index.d.ts +0 -5
- package/esm/contexts/SelectRangeContext/index.js +0 -6
- package/esm/contexts/SelectRangeContext/index.js.map +0 -1
- package/esm/contexts/SelectRangeContext/useSelectRange.d.ts +0 -3
- package/esm/contexts/SelectRangeContext/useSelectRange.js +0 -11
- package/esm/contexts/SelectRangeContext/useSelectRange.js.map +0 -1
- package/esm/contexts/SelectRangeContext/utils/addToRange.d.ts +0 -8
- package/esm/contexts/SelectRangeContext/utils/addToRange.js +0 -36
- package/esm/contexts/SelectRangeContext/utils/addToRange.js.map +0 -1
- package/esm/contexts/SelectSingleContext/SelectSingleContext.d.ts +0 -9
- package/esm/contexts/SelectSingleContext/SelectSingleContext.js +0 -9
- package/esm/contexts/SelectSingleContext/SelectSingleContext.js.map +0 -1
- package/esm/contexts/SelectSingleContext/SelectSingleContextValue.d.ts +0 -11
- package/esm/contexts/SelectSingleContext/SelectSingleContextValue.js +0 -2
- package/esm/contexts/SelectSingleContext/SelectSingleContextValue.js.map +0 -1
- package/esm/contexts/SelectSingleContext/SelectSingleModifiers.d.ts +0 -3
- package/esm/contexts/SelectSingleContext/SelectSingleModifiers.js +0 -2
- package/esm/contexts/SelectSingleContext/SelectSingleModifiers.js.map +0 -1
- package/esm/contexts/SelectSingleContext/SelectSingleProvider.d.ts +0 -7
- package/esm/contexts/SelectSingleContext/SelectSingleProvider.js +0 -29
- package/esm/contexts/SelectSingleContext/SelectSingleProvider.js.map +0 -1
- package/esm/contexts/SelectSingleContext/index.d.ts +0 -5
- package/esm/contexts/SelectSingleContext/index.js +0 -6
- package/esm/contexts/SelectSingleContext/index.js.map +0 -1
- package/esm/contexts/SelectSingleContext/useSelectSingle.d.ts +0 -3
- package/esm/contexts/SelectSingleContext/useSelectSingle.js +0 -11
- package/esm/contexts/SelectSingleContext/useSelectSingle.js.map +0 -1
- package/esm/contexts/index.d.ts +0 -7
- package/esm/contexts/index.js +0 -8
- package/esm/contexts/index.js.map +0 -1
- package/esm/hooks/index.d.ts +0 -2
- package/esm/hooks/index.js +0 -3
- package/esm/hooks/index.js.map +0 -1
- package/esm/hooks/useInput/index.d.ts +0 -2
- package/esm/hooks/useInput/index.js +0 -3
- package/esm/hooks/useInput/index.js.map +0 -1
- package/esm/hooks/useInput/types/UseInput.d.ts +0 -12
- package/esm/hooks/useInput/types/UseInput.js +0 -2
- package/esm/hooks/useInput/types/UseInput.js.map +0 -1
- package/esm/hooks/useInput/types/UseInputDayPickerProps.d.ts +0 -14
- package/esm/hooks/useInput/types/UseInputDayPickerProps.js +0 -2
- package/esm/hooks/useInput/types/UseInputDayPickerProps.js.map +0 -1
- package/esm/hooks/useInput/types/UseInputFieldProps.d.ts +0 -12
- package/esm/hooks/useInput/types/UseInputFieldProps.js +0 -2
- package/esm/hooks/useInput/types/UseInputFieldProps.js.map +0 -1
- package/esm/hooks/useInput/types/UseInputOptions.d.ts +0 -35
- package/esm/hooks/useInput/types/UseInputOptions.js +0 -2
- package/esm/hooks/useInput/types/UseInputOptions.js.map +0 -1
- package/esm/hooks/useInput/types/index.d.ts +0 -4
- package/esm/hooks/useInput/types/index.js +0 -5
- package/esm/hooks/useInput/types/index.js.map +0 -1
- package/esm/hooks/useInput/useInput.d.ts +0 -4
- package/esm/hooks/useInput/useInput.js +0 -100
- package/esm/hooks/useInput/useInput.js.map +0 -1
- package/esm/hooks/useInput/utils/isValidDate.d.ts +0 -2
- package/esm/hooks/useInput/utils/isValidDate.js +0 -5
- package/esm/hooks/useInput/utils/isValidDate.js.map +0 -1
- package/esm/hooks/useModifiers/index.d.ts +0 -1
- package/esm/hooks/useModifiers/index.js +0 -2
- package/esm/hooks/useModifiers/index.js.map +0 -1
- package/esm/hooks/useModifiers/types/UseModifiers.d.ts +0 -10
- package/esm/hooks/useModifiers/types/UseModifiers.js +0 -2
- package/esm/hooks/useModifiers/types/UseModifiers.js.map +0 -1
- package/esm/hooks/useModifiers/types/index.d.ts +0 -1
- package/esm/hooks/useModifiers/types/index.js +0 -2
- package/esm/hooks/useModifiers/types/index.js.map +0 -1
- package/esm/hooks/useModifiers/useModifiers.d.ts +0 -3
- package/esm/hooks/useModifiers/useModifiers.js +0 -66
- package/esm/hooks/useModifiers/useModifiers.js.map +0 -1
- package/esm/hooks/useModifiers/utils/getModifierStatus.d.ts +0 -7
- package/esm/hooks/useModifiers/utils/getModifierStatus.js +0 -19
- package/esm/hooks/useModifiers/utils/getModifierStatus.js.map +0 -1
- package/esm/hooks/useModifiers/utils/isDateInRange.d.ts +0 -3
- package/esm/hooks/useModifiers/utils/isDateInRange.js +0 -22
- package/esm/hooks/useModifiers/utils/isDateInRange.js.map +0 -1
- package/esm/hooks/useModifiers/utils/isMatch.d.ts +0 -5
- package/esm/hooks/useModifiers/utils/isMatch.js +0 -41
- package/esm/hooks/useModifiers/utils/isMatch.js.map +0 -1
- package/esm/index.d.ts +0 -5
- package/esm/index.js +0 -6
- package/esm/index.js.map +0 -1
- package/esm/test/PageObjects.d.ts +0 -40
- package/esm/test/PageObjects.js +0 -129
- package/esm/test/PageObjects.js.map +0 -1
- package/esm/test/customRender.d.ts +0 -5
- package/esm/test/customRender.js +0 -20
- package/esm/test/customRender.js.map +0 -1
- package/esm/test/index.d.ts +0 -2
- package/esm/test/index.js +0 -3
- package/esm/test/index.js.map +0 -1
- package/esm/test/setup.d.ts +0 -2
- package/esm/test/setup.js +0 -3
- package/esm/test/setup.js.map +0 -1
- package/esm/types/CaptionLayout.d.ts +0 -7
- package/esm/types/CaptionLayout.js +0 -2
- package/esm/types/CaptionLayout.js.map +0 -1
- package/esm/types/ClassNames.d.ts +0 -3
- package/esm/types/ClassNames.js +0 -2
- package/esm/types/ClassNames.js.map +0 -1
- package/esm/types/Components.d.ts +0 -33
- package/esm/types/Components.js +0 -2
- package/esm/types/Components.js.map +0 -1
- package/esm/types/CustomModifiers.d.ts +0 -4
- package/esm/types/CustomModifiers.js +0 -2
- package/esm/types/CustomModifiers.js.map +0 -1
- package/esm/types/DateAfter.d.ts +0 -7
- package/esm/types/DateAfter.js +0 -2
- package/esm/types/DateAfter.js.map +0 -1
- package/esm/types/DateBefore.d.ts +0 -7
- package/esm/types/DateBefore.js +0 -2
- package/esm/types/DateBefore.js.map +0 -1
- package/esm/types/DateFormatter.d.ts +0 -6
- package/esm/types/DateFormatter.js +0 -2
- package/esm/types/DateFormatter.js.map +0 -1
- package/esm/types/DateInterval.d.ts +0 -8
- package/esm/types/DateInterval.js +0 -2
- package/esm/types/DateInterval.js.map +0 -1
- package/esm/types/DateRange.d.ts +0 -8
- package/esm/types/DateRange.js +0 -2
- package/esm/types/DateRange.js.map +0 -1
- package/esm/types/DayClickEventHandler.d.ts +0 -6
- package/esm/types/DayClickEventHandler.js +0 -2
- package/esm/types/DayClickEventHandler.js.map +0 -1
- package/esm/types/DayFocusEventHandler.d.ts +0 -6
- package/esm/types/DayFocusEventHandler.js +0 -2
- package/esm/types/DayFocusEventHandler.js.map +0 -1
- package/esm/types/DayKeyboardEventHandler.d.ts +0 -6
- package/esm/types/DayKeyboardEventHandler.js +0 -2
- package/esm/types/DayKeyboardEventHandler.js.map +0 -1
- package/esm/types/DayLabelFormatter.d.ts +0 -7
- package/esm/types/DayLabelFormatter.js +0 -2
- package/esm/types/DayLabelFormatter.js.map +0 -1
- package/esm/types/DayMouseEventHandler.d.ts +0 -6
- package/esm/types/DayMouseEventHandler.js +0 -2
- package/esm/types/DayMouseEventHandler.js.map +0 -1
- package/esm/types/DayOfWeekMatcher.d.ts +0 -7
- package/esm/types/DayOfWeekMatcher.js +0 -2
- package/esm/types/DayOfWeekMatcher.js.map +0 -1
- package/esm/types/DayPickerBase.d.ts +0 -269
- package/esm/types/DayPickerBase.js +0 -2
- package/esm/types/DayPickerBase.js.map +0 -1
- package/esm/types/DayPickerMultiple.d.ts +0 -15
- package/esm/types/DayPickerMultiple.js +0 -2
- package/esm/types/DayPickerMultiple.js.map +0 -1
- package/esm/types/DayPickerProps.d.ts +0 -9
- package/esm/types/DayPickerProps.js +0 -2
- package/esm/types/DayPickerProps.js.map +0 -1
- package/esm/types/DayPickerRange.d.ts +0 -16
- package/esm/types/DayPickerRange.js +0 -2
- package/esm/types/DayPickerRange.js.map +0 -1
- package/esm/types/DayPickerSingle.d.ts +0 -13
- package/esm/types/DayPickerSingle.js +0 -2
- package/esm/types/DayPickerSingle.js.map +0 -1
- package/esm/types/DayPickerUncontrolled.d.ts +0 -7
- package/esm/types/DayPickerUncontrolled.js +0 -2
- package/esm/types/DayPickerUncontrolled.js.map +0 -1
- package/esm/types/DayTouchEventHandler.d.ts +0 -6
- package/esm/types/DayTouchEventHandler.js +0 -2
- package/esm/types/DayTouchEventHandler.js.map +0 -1
- package/esm/types/Formatters.d.ts +0 -19
- package/esm/types/Formatters.js +0 -2
- package/esm/types/Formatters.js.map +0 -1
- package/esm/types/InternalModifier.d.ts +0 -2
- package/esm/types/InternalModifier.js +0 -2
- package/esm/types/InternalModifier.js.map +0 -1
- package/esm/types/Labels.d.ts +0 -17
- package/esm/types/Labels.js +0 -2
- package/esm/types/Labels.js.map +0 -1
- package/esm/types/Matcher.d.ts +0 -10
- package/esm/types/Matcher.js +0 -2
- package/esm/types/Matcher.js.map +0 -1
- package/esm/types/Modifier.d.ts +0 -5
- package/esm/types/Modifier.js +0 -2
- package/esm/types/Modifier.js.map +0 -1
- package/esm/types/ModifierClassNames.d.ts +0 -5
- package/esm/types/ModifierClassNames.js +0 -2
- package/esm/types/ModifierClassNames.js.map +0 -1
- package/esm/types/ModifierStatus.d.ts +0 -5
- package/esm/types/ModifierStatus.js +0 -2
- package/esm/types/ModifierStatus.js.map +0 -1
- package/esm/types/ModifierStyles.d.ts +0 -4
- package/esm/types/ModifierStyles.js +0 -2
- package/esm/types/ModifierStyles.js.map +0 -1
- package/esm/types/Modifiers.d.ts +0 -5
- package/esm/types/Modifiers.js +0 -2
- package/esm/types/Modifiers.js.map +0 -1
- package/esm/types/MonthChangeEventHandler.d.ts +0 -4
- package/esm/types/MonthChangeEventHandler.js +0 -2
- package/esm/types/MonthChangeEventHandler.js.map +0 -1
- package/esm/types/NavButtonLabelFormatter.d.ts +0 -7
- package/esm/types/NavButtonLabelFormatter.js +0 -2
- package/esm/types/NavButtonLabelFormatter.js.map +0 -1
- package/esm/types/SelectMultipleEventHandler.d.ts +0 -12
- package/esm/types/SelectMultipleEventHandler.js +0 -2
- package/esm/types/SelectMultipleEventHandler.js.map +0 -1
- package/esm/types/SelectRangeEventHandler.d.ts +0 -10
- package/esm/types/SelectRangeEventHandler.js +0 -2
- package/esm/types/SelectRangeEventHandler.js.map +0 -1
- package/esm/types/SelectSingleEventHandler.d.ts +0 -12
- package/esm/types/SelectSingleEventHandler.js +0 -2
- package/esm/types/SelectSingleEventHandler.js.map +0 -1
- package/esm/types/StyledComponentProps.d.ts +0 -8
- package/esm/types/StyledComponentProps.js +0 -2
- package/esm/types/StyledComponentProps.js.map +0 -1
- package/esm/types/StyledElement.d.ts +0 -76
- package/esm/types/StyledElement.js +0 -2
- package/esm/types/StyledElement.js.map +0 -1
- package/esm/types/Styles.d.ts +0 -4
- package/esm/types/Styles.js +0 -2
- package/esm/types/Styles.js.map +0 -1
- package/esm/types/WeekNumberClickEventHandler.d.ts +0 -9
- package/esm/types/WeekNumberClickEventHandler.js +0 -2
- package/esm/types/WeekNumberClickEventHandler.js.map +0 -1
- package/esm/types/WeekNumberFormatter.d.ts +0 -6
- package/esm/types/WeekNumberFormatter.js +0 -2
- package/esm/types/WeekNumberFormatter.js.map +0 -1
- package/esm/types/WeekNumberLabelFormatter.d.ts +0 -5
- package/esm/types/WeekNumberLabelFormatter.js +0 -2
- package/esm/types/WeekNumberLabelFormatter.js.map +0 -1
- package/esm/types/WeekdayLabelFormatter.d.ts +0 -4
- package/esm/types/WeekdayLabelFormatter.js +0 -2
- package/esm/types/WeekdayLabelFormatter.js.map +0 -1
- package/esm/types/index.d.ts +0 -54
- package/esm/types/index.js +0 -55
- package/esm/types/index.js.map +0 -1
- package/esm/types/isArrayOfDates.d.ts +0 -2
- package/esm/types/isArrayOfDates.js +0 -6
- package/esm/types/isArrayOfDates.js.map +0 -1
- package/esm/types/isDateAfterType.d.ts +0 -3
- package/esm/types/isDateAfterType.js +0 -5
- package/esm/types/isDateAfterType.js.map +0 -1
- package/esm/types/isDateBeforeType.d.ts +0 -3
- package/esm/types/isDateBeforeType.js +0 -5
- package/esm/types/isDateBeforeType.js.map +0 -1
- package/esm/types/isDateInterval.d.ts +0 -3
- package/esm/types/isDateInterval.js +0 -8
- package/esm/types/isDateInterval.js.map +0 -1
- package/esm/types/isDateRange.d.ts +0 -3
- package/esm/types/isDateRange.js +0 -6
- package/esm/types/isDateRange.js.map +0 -1
- package/esm/types/isDateType.d.ts +0 -2
- package/esm/types/isDateType.js +0 -6
- package/esm/types/isDateType.js.map +0 -1
- package/esm/types/isDayOfWeekType.d.ts +0 -3
- package/esm/types/isDayOfWeekType.js +0 -5
- package/esm/types/isDayOfWeekType.js.map +0 -1
- package/esm/types/isDayPickerMultiple.d.ts +0 -4
- package/esm/types/isDayPickerMultiple.js +0 -5
- package/esm/types/isDayPickerMultiple.js.map +0 -1
- package/esm/types/isDayPickerRange.d.ts +0 -4
- package/esm/types/isDayPickerRange.js +0 -5
- package/esm/types/isDayPickerRange.js.map +0 -1
- package/esm/types/isDayPickerSingle.d.ts +0 -4
- package/esm/types/isDayPickerSingle.js +0 -5
- package/esm/types/isDayPickerSingle.js.map +0 -1
- package/esm/types/isDayPickerUncontrolled.d.ts +0 -4
- package/esm/types/isDayPickerUncontrolled.js +0 -5
- package/esm/types/isDayPickerUncontrolled.js.map +0 -1
package/dist/main.js
ADDED
|
@@ -0,0 +1,1936 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var dateFns = require('date-fns');
|
|
7
|
+
var enUS = require('date-fns/locale/en-US');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
function _interopNamespace(e) {
|
|
12
|
+
if (e && e.__esModule) return e;
|
|
13
|
+
var n = Object.create(null);
|
|
14
|
+
if (e) {
|
|
15
|
+
Object.keys(e).forEach(function (k) {
|
|
16
|
+
if (k !== 'default') {
|
|
17
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return e[k]; }
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
n["default"] = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
31
|
+
var enUS__default = /*#__PURE__*/_interopDefaultLegacy(enUS);
|
|
32
|
+
|
|
33
|
+
/*! *****************************************************************************
|
|
34
|
+
Copyright (c) Microsoft Corporation.
|
|
35
|
+
|
|
36
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
37
|
+
purpose with or without fee is hereby granted.
|
|
38
|
+
|
|
39
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
40
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
41
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
42
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
43
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
44
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
45
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
46
|
+
***************************************************************************** */
|
|
47
|
+
|
|
48
|
+
var __assign = function() {
|
|
49
|
+
__assign = Object.assign || function __assign(t) {
|
|
50
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
51
|
+
s = arguments[i];
|
|
52
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
};
|
|
56
|
+
return __assign.apply(this, arguments);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
function __rest(s, e) {
|
|
60
|
+
var t = {};
|
|
61
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
62
|
+
t[p] = s[p];
|
|
63
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
64
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
65
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
66
|
+
t[p[i]] = s[p[i]];
|
|
67
|
+
}
|
|
68
|
+
return t;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function __spreadArray(to, from, pack) {
|
|
72
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
73
|
+
if (ar || !(i in from)) {
|
|
74
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
75
|
+
ar[i] = from[i];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The DayPicker context shares the props passed to DayPicker within the
|
|
83
|
+
* internal components. It is used to set the default values and perform
|
|
84
|
+
* one-time calculations required to render the days.
|
|
85
|
+
*
|
|
86
|
+
* Access this context from the [[useDayPicker]] hook when using custom
|
|
87
|
+
* components.
|
|
88
|
+
*/
|
|
89
|
+
var DayPickerContext = React__namespace.createContext(undefined);
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Hook to access the [[DayPickerContext]].
|
|
93
|
+
*
|
|
94
|
+
* To use this hook make sure to wrap the components with a one
|
|
95
|
+
* [[DayPickerProvider]].
|
|
96
|
+
* */
|
|
97
|
+
function useDayPicker() {
|
|
98
|
+
var context = React__namespace.useContext(DayPickerContext);
|
|
99
|
+
if (!context) {
|
|
100
|
+
throw new Error("Context is not defined. useDayPicker must be used within a DayPickerProvider with a valid values.");
|
|
101
|
+
}
|
|
102
|
+
return context;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function getOutsideEndDays(month, options) {
|
|
106
|
+
var days = [];
|
|
107
|
+
var lastDayOfWeek = dateFns.endOfWeek(month, options);
|
|
108
|
+
var endDiff = dateFns.differenceInCalendarDays(lastDayOfWeek, month);
|
|
109
|
+
for (var i = 1; i <= endDiff; i++) {
|
|
110
|
+
var dayDate = dateFns.addDays(month, i);
|
|
111
|
+
days.push(dayDate);
|
|
112
|
+
}
|
|
113
|
+
return days;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function getOutsideStartDays(month, options) {
|
|
117
|
+
var days = [];
|
|
118
|
+
var firstDayOfWeek = dateFns.startOfWeek(month, options);
|
|
119
|
+
var startDiff = dateFns.differenceInCalendarDays(month, firstDayOfWeek);
|
|
120
|
+
for (var i = 0; i < startDiff; i++) {
|
|
121
|
+
var newDay = dateFns.addDays(firstDayOfWeek, i);
|
|
122
|
+
days.push(newDay);
|
|
123
|
+
}
|
|
124
|
+
return days;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Return the weeks belonging to the given month.
|
|
129
|
+
*/
|
|
130
|
+
function getWeeks(month, _a) {
|
|
131
|
+
var locale = _a.locale, fixedWeeks = _a.fixedWeeks;
|
|
132
|
+
var monthStart = dateFns.startOfMonth(month);
|
|
133
|
+
var monthEnd = dateFns.endOfMonth(month);
|
|
134
|
+
var diff = dateFns.differenceInCalendarDays(monthEnd, monthStart);
|
|
135
|
+
var weeks = [];
|
|
136
|
+
var lastWeek = { weekNumber: 0, dates: [] };
|
|
137
|
+
for (var i = 0; i <= diff; i++) {
|
|
138
|
+
var date = dateFns.addDays(monthStart, i);
|
|
139
|
+
var week = dateFns.getWeek(date, { locale: locale });
|
|
140
|
+
if (lastWeek.weekNumber !== week) {
|
|
141
|
+
// Create a new week by adding outside start days
|
|
142
|
+
var startDays = getOutsideStartDays(date, { locale: locale });
|
|
143
|
+
lastWeek = { weekNumber: week, dates: startDays };
|
|
144
|
+
weeks.push(lastWeek);
|
|
145
|
+
}
|
|
146
|
+
lastWeek.dates.push(date);
|
|
147
|
+
}
|
|
148
|
+
var lastDay = lastWeek.dates[lastWeek.dates.length - 1];
|
|
149
|
+
var endDays = getOutsideEndDays(lastDay, { locale: locale });
|
|
150
|
+
lastWeek.dates = lastWeek.dates.concat(endDays);
|
|
151
|
+
// Add extra weeks to the month, up to 6 weeks
|
|
152
|
+
if (fixedWeeks) {
|
|
153
|
+
var lastWeekDate = lastWeek.dates[lastWeek.dates.length - 1];
|
|
154
|
+
var weeksInMonth = dateFns.getWeeksInMonth(month, { locale: locale });
|
|
155
|
+
if (weeksInMonth < 6) {
|
|
156
|
+
var diffDays = dateFns.differenceInCalendarDays(dateFns.addWeeks(lastWeekDate, 6 - weeksInMonth), lastWeekDate);
|
|
157
|
+
for (var i = 0; i < diffDays; i++) {
|
|
158
|
+
var date = dateFns.addDays(lastWeekDate, i + 1);
|
|
159
|
+
var week = dateFns.getWeek(date, { locale: locale });
|
|
160
|
+
if (lastWeek.weekNumber !== week) {
|
|
161
|
+
lastWeek = { weekNumber: week, dates: [] };
|
|
162
|
+
weeks.push(lastWeek);
|
|
163
|
+
}
|
|
164
|
+
lastWeek.dates.push(date);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return weeks;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Render the table with the calendar.
|
|
173
|
+
*/
|
|
174
|
+
function Table(props) {
|
|
175
|
+
var _a = useDayPicker(), locale = _a.locale, classNames = _a.classNames, styles = _a.styles, hideHead = _a.hideHead, fixedWeeks = _a.fixedWeeks, _b = _a.components, Head = _b.Head, Row = _b.Row, Footer = _b.Footer;
|
|
176
|
+
var weeks = getWeeks(props.displayMonth, { locale: locale, fixedWeeks: fixedWeeks });
|
|
177
|
+
return (React__namespace.createElement("table", { className: classNames.table, style: styles.table },
|
|
178
|
+
!hideHead && React__namespace.createElement(Head, null),
|
|
179
|
+
React__namespace.createElement("tbody", { className: classNames.tbody, style: styles.tbody }, weeks.map(function (week) { return (React__namespace.createElement(Row, { displayMonth: props.displayMonth, key: week.weekNumber, dates: week.dates, weekNumber: week.weekNumber })); })),
|
|
180
|
+
React__namespace.createElement(Footer, null)));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* The Navigation context shares details about the months being navigated in DayPicker.
|
|
185
|
+
*
|
|
186
|
+
* Access this context from the [[useNavigation]] hook.
|
|
187
|
+
*/
|
|
188
|
+
var NavigationContext = React__namespace.createContext(undefined);
|
|
189
|
+
|
|
190
|
+
/** Hook to access the [[NavigationContext]]. */
|
|
191
|
+
function useNavigation() {
|
|
192
|
+
var context = React__namespace.useContext(NavigationContext);
|
|
193
|
+
if (!context) {
|
|
194
|
+
throw new Error('useNavigation must be used within a NavigationProvider');
|
|
195
|
+
}
|
|
196
|
+
return context;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Render the container with the months and their captions. The number of months
|
|
201
|
+
* rendered depends by the `numberOfMonths` prop.
|
|
202
|
+
*/
|
|
203
|
+
function Root() {
|
|
204
|
+
var _a = useDayPicker(), dir = _a.dir, className = _a.className, classNames = _a.classNames, style = _a.style, styles = _a.styles, numberOfMonths = _a.numberOfMonths, showWeekNumber = _a.showWeekNumber, Caption = _a.components.Caption;
|
|
205
|
+
var displayMonths = useNavigation().displayMonths;
|
|
206
|
+
var rootClassNames = [className !== null && className !== void 0 ? className : classNames.root];
|
|
207
|
+
if (numberOfMonths > 1) {
|
|
208
|
+
rootClassNames.push(classNames.multiple_month);
|
|
209
|
+
}
|
|
210
|
+
if (showWeekNumber) {
|
|
211
|
+
rootClassNames.push(classNames.with_weeknumber);
|
|
212
|
+
}
|
|
213
|
+
if (className)
|
|
214
|
+
rootClassNames.concat(className.split(' '));
|
|
215
|
+
var renderMonth = function (displayMonth, displayIndex) {
|
|
216
|
+
var _a;
|
|
217
|
+
var className = [classNames.month];
|
|
218
|
+
var style = __assign({}, styles.month);
|
|
219
|
+
var isFirst = displayIndex === 0;
|
|
220
|
+
var isLast = displayIndex === displayMonths.length - 1;
|
|
221
|
+
if (dir === 'rtl')
|
|
222
|
+
_a = [isFirst, isLast], isLast = _a[0], isFirst = _a[1];
|
|
223
|
+
if (isFirst) {
|
|
224
|
+
className.push(classNames.caption_first);
|
|
225
|
+
Object.assign(style, styles.caption_first);
|
|
226
|
+
}
|
|
227
|
+
if (isLast)
|
|
228
|
+
className.push(classNames.caption_last);
|
|
229
|
+
if (!isFirst && !isLast)
|
|
230
|
+
className.push(classNames.caption_middle);
|
|
231
|
+
return (React__namespace.createElement("div", { key: displayIndex, className: className.join(' '), style: style },
|
|
232
|
+
React__namespace.createElement(Caption, { displayMonth: displayMonth }),
|
|
233
|
+
React__namespace.createElement(Table, { displayMonth: displayMonth })));
|
|
234
|
+
};
|
|
235
|
+
return (React__namespace.createElement("div", { className: rootClassNames.join(' '), style: __assign(__assign({}, styles.root), style), dir: dir },
|
|
236
|
+
React__namespace.createElement("div", { className: classNames.months, style: styles.months }, displayMonths.map(renderMonth))));
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Render the dropdown to navigate between months.
|
|
241
|
+
*/
|
|
242
|
+
function MonthsDropdown(props) {
|
|
243
|
+
var displayMonth = props.displayMonth;
|
|
244
|
+
var _a = useDayPicker(), fromDate = _a.fromDate, toDate = _a.toDate, styles = _a.styles, locale = _a.locale, formatMonthCaption = _a.formatters.formatMonthCaption, classNames = _a.classNames, Dropdown = _a.components.Dropdown, labelMonthDropdown = _a.labels.labelMonthDropdown;
|
|
245
|
+
if (!fromDate && !toDate) {
|
|
246
|
+
// TODO: use type guards
|
|
247
|
+
return React__namespace.createElement(React__namespace.Fragment, null);
|
|
248
|
+
}
|
|
249
|
+
var dropdownMonths = [];
|
|
250
|
+
if (fromDate && toDate) {
|
|
251
|
+
if (dateFns.isSameYear(fromDate, toDate)) {
|
|
252
|
+
// only display the months included in the range
|
|
253
|
+
for (var month = fromDate.getMonth(); month <= toDate.getMonth(); month++) {
|
|
254
|
+
dropdownMonths.push(dateFns.setMonth(dateFns.startOfMonth(fromDate), month));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
// display all the 12 months
|
|
259
|
+
for (var month = 0; month <= 11; month++) {
|
|
260
|
+
var anyDate = new Date(); // any date is OK, we just need the year
|
|
261
|
+
dropdownMonths.push(dateFns.setMonth(dateFns.startOfMonth(anyDate), month));
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
var handleChange = function (e) {
|
|
266
|
+
var newMonth = dateFns.setMonth(new Date(displayMonth), Number(e.target.value));
|
|
267
|
+
props.onChange(newMonth);
|
|
268
|
+
};
|
|
269
|
+
return (React__namespace.createElement(Dropdown, { "aria-label": labelMonthDropdown(), className: classNames.dropdown_month, style: styles.dropdown_month, onChange: handleChange, value: displayMonth.getMonth(), caption: formatMonthCaption(displayMonth, { locale: locale }) }, dropdownMonths.map(function (m) { return (React__namespace.createElement("option", { key: m.getMonth(), value: m.getMonth() }, formatMonthCaption(m, { locale: locale }))); })));
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Render a button HTML element applying the reset class name.
|
|
274
|
+
*/
|
|
275
|
+
var Button = React__namespace.forwardRef(function (props, ref) {
|
|
276
|
+
var _a = useDayPicker(), classNames = _a.classNames, styles = _a.styles;
|
|
277
|
+
var classNamesArr = [classNames.button_reset, classNames.button];
|
|
278
|
+
if (props.className) {
|
|
279
|
+
classNamesArr.push(props.className);
|
|
280
|
+
}
|
|
281
|
+
var className = classNamesArr.join(' ');
|
|
282
|
+
var style = __assign(__assign({}, styles.button_reset), styles.button);
|
|
283
|
+
if (props.style) {
|
|
284
|
+
Object.assign(style, props.style);
|
|
285
|
+
}
|
|
286
|
+
return (React__namespace.createElement("button", __assign({}, props, { ref: ref, type: "button", className: className, style: style })));
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
/** A component rendering the navigation buttons or the drop-downs. */
|
|
290
|
+
function Navigation(props) {
|
|
291
|
+
var _a;
|
|
292
|
+
var _b = useDayPicker(), dir = _b.dir, locale = _b.locale, classNames = _b.classNames, styles = _b.styles, _c = _b.labels, labelPrevious = _c.labelPrevious, labelNext = _c.labelNext, _d = _b.components, IconNext = _d.IconNext, IconPrevious = _d.IconPrevious;
|
|
293
|
+
var onPreviousClick = props.onPreviousClick, onNextClick = props.onNextClick;
|
|
294
|
+
if (dir === 'rtl') {
|
|
295
|
+
_a = [onPreviousClick, onNextClick], onNextClick = _a[0], onPreviousClick = _a[1];
|
|
296
|
+
}
|
|
297
|
+
var previousMonth = props.previousMonth, nextMonth = props.nextMonth;
|
|
298
|
+
var previousLabel = labelPrevious(previousMonth, { locale: locale });
|
|
299
|
+
var previousClassName = [
|
|
300
|
+
classNames.nav_button,
|
|
301
|
+
classNames.nav_button_previous
|
|
302
|
+
].join(' ');
|
|
303
|
+
var nextLabel = labelNext(nextMonth, { locale: locale });
|
|
304
|
+
var nextClassName = [
|
|
305
|
+
classNames.nav_button,
|
|
306
|
+
classNames.nav_button_next
|
|
307
|
+
].join(' ');
|
|
308
|
+
var previousButton = (React__namespace.createElement(Button, { key: "prev", "aria-label": previousLabel, className: previousClassName, style: styles.nav_button_previous, disabled: !previousMonth, onClick: onPreviousClick },
|
|
309
|
+
React__namespace.createElement(IconPrevious, { className: classNames.nav_icon, style: styles.nav_icon })));
|
|
310
|
+
var nextButton = (React__namespace.createElement(Button, { key: "next", "aria-label": nextLabel, className: nextClassName, disabled: !nextMonth, onClick: onNextClick, style: styles.nav_button_next },
|
|
311
|
+
React__namespace.createElement(IconNext, { className: classNames.nav_icon, style: styles.nav_icon })));
|
|
312
|
+
if (!nextMonth && !previousMonth) {
|
|
313
|
+
return React__namespace.createElement(React__namespace.Fragment, null);
|
|
314
|
+
}
|
|
315
|
+
return (React__namespace.createElement("div", { className: classNames.nav, style: styles.nav },
|
|
316
|
+
!props.hidePrevious && (dir === 'rtl' ? nextButton : previousButton),
|
|
317
|
+
!props.hideNext && (dir === 'rtl' ? previousButton : nextButton)));
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Render a dropdown to change the year. Take in account the `nav.fromDate` and
|
|
322
|
+
* `toDate` from context.
|
|
323
|
+
*/
|
|
324
|
+
function YearsDropdown(props) {
|
|
325
|
+
var displayMonth = props.displayMonth;
|
|
326
|
+
var _a = useDayPicker(), fromDate = _a.fromDate, toDate = _a.toDate, locale = _a.locale, styles = _a.styles, classNames = _a.classNames, Dropdown = _a.components.Dropdown, formatYearCaption = _a.formatters.formatYearCaption, labelYearDropdown = _a.labels.labelYearDropdown;
|
|
327
|
+
var years = [];
|
|
328
|
+
if (fromDate && toDate) {
|
|
329
|
+
var fromYear = fromDate.getFullYear();
|
|
330
|
+
var toYear = toDate.getFullYear();
|
|
331
|
+
for (var year = fromYear; year <= toYear; year++) {
|
|
332
|
+
years.push(dateFns.setYear(dateFns.startOfYear(new Date()), year));
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
var handleChange = function (e) {
|
|
336
|
+
var newMonth = dateFns.setYear(new Date(displayMonth), Number(e.target.value));
|
|
337
|
+
props.onChange(newMonth);
|
|
338
|
+
};
|
|
339
|
+
return (React__namespace.createElement(Dropdown, { "aria-label": labelYearDropdown(), className: classNames.dropdown_month, style: styles.dropdown_month, onChange: handleChange, value: displayMonth.getFullYear(), caption: formatYearCaption(displayMonth, { locale: locale }) }, years.map(function (year) { return (React__namespace.createElement("option", { key: year.getFullYear(), value: year.getFullYear() }, formatYearCaption(year, { locale: locale }))); })));
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Render the caption of a month, which includes title and navigation buttons.
|
|
344
|
+
* The caption has a different layout when setting the `numberOfMonths` prop.
|
|
345
|
+
*/
|
|
346
|
+
function Caption(props) {
|
|
347
|
+
var _a;
|
|
348
|
+
var displayMonth = props.displayMonth;
|
|
349
|
+
var context = useDayPicker();
|
|
350
|
+
var classNames = context.classNames, numberOfMonths = context.numberOfMonths, disableNavigation = context.disableNavigation, styles = context.styles, captionLayout = context.captionLayout, onMonthChange = context.onMonthChange, dir = context.dir, CaptionLabel = context.components.CaptionLabel;
|
|
351
|
+
var _b = useNavigation(), previousMonth = _b.previousMonth, nextMonth = _b.nextMonth, goToMonth = _b.goToMonth, displayMonths = _b.displayMonths;
|
|
352
|
+
var handlePreviousClick = function (e) {
|
|
353
|
+
if (!previousMonth)
|
|
354
|
+
return;
|
|
355
|
+
goToMonth(previousMonth);
|
|
356
|
+
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(previousMonth);
|
|
357
|
+
};
|
|
358
|
+
var handleNextClick = function (e) {
|
|
359
|
+
if (!nextMonth)
|
|
360
|
+
return;
|
|
361
|
+
goToMonth(nextMonth);
|
|
362
|
+
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(nextMonth);
|
|
363
|
+
};
|
|
364
|
+
var handleMonthChange = function (newMonth) {
|
|
365
|
+
goToMonth(newMonth);
|
|
366
|
+
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(newMonth);
|
|
367
|
+
};
|
|
368
|
+
var displayIndex = displayMonths.findIndex(function (month) {
|
|
369
|
+
return dateFns.isSameMonth(displayMonth, month);
|
|
370
|
+
});
|
|
371
|
+
var isFirst = displayIndex === 0;
|
|
372
|
+
var isLast = displayIndex === displayMonths.length - 1;
|
|
373
|
+
if (dir === 'rtl') {
|
|
374
|
+
_a = [isFirst, isLast], isLast = _a[0], isFirst = _a[1];
|
|
375
|
+
}
|
|
376
|
+
var captionLabel = React__namespace.createElement(CaptionLabel, { displayMonth: displayMonth });
|
|
377
|
+
var hideNext = numberOfMonths > 1 && (isFirst || !isLast);
|
|
378
|
+
var hidePrevious = numberOfMonths > 1 && (isLast || !isFirst);
|
|
379
|
+
return (React__namespace.createElement("div", { className: classNames.caption, style: styles.caption },
|
|
380
|
+
disableNavigation && captionLabel,
|
|
381
|
+
!disableNavigation && (React__namespace.createElement(React__namespace.Fragment, null, captionLayout === 'dropdown' ? (React__namespace.createElement("div", { className: classNames.caption_dropdowns, style: styles.caption_dropdowns },
|
|
382
|
+
React__namespace.createElement(MonthsDropdown, { onChange: handleMonthChange, displayMonth: displayMonth }),
|
|
383
|
+
React__namespace.createElement(YearsDropdown, { onChange: handleMonthChange, displayMonth: displayMonth }))) : (React__namespace.createElement(React__namespace.Fragment, null,
|
|
384
|
+
React__namespace.createElement(CaptionLabel, { displayMonth: displayMonth }),
|
|
385
|
+
React__namespace.createElement(Navigation, { displayMonth: displayMonth, hideNext: hideNext, hidePrevious: hidePrevious, nextMonth: nextMonth, previousMonth: previousMonth, onPreviousClick: handlePreviousClick, onNextClick: handleNextClick })))))));
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/** Render the caption for the displayed month. This component is used when `captionLayout="buttons"`. */
|
|
389
|
+
function CaptionLabel(props) {
|
|
390
|
+
var _a = useDayPicker(), locale = _a.locale, classNames = _a.classNames, styles = _a.styles, formatCaption = _a.formatters.formatCaption;
|
|
391
|
+
return (React__namespace.createElement("div", { key: "caption", className: classNames.caption_label, style: styles.caption_label, "aria-live": "polite", "aria-atomic": "true" }, formatCaption(props.displayMonth, { locale: locale })));
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/** Returns true when the props are of type [[DayPickerMultiple]]. */
|
|
395
|
+
function isDayPickerMultiple(props) {
|
|
396
|
+
return props.mode === 'multiple';
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/** Returns true when the props are of type [[DayPickerRange]]. */
|
|
400
|
+
function isDayPickerRange(props) {
|
|
401
|
+
return props.mode === 'range';
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/** Returns true when the props are of type [[DayPickerSingle]]. */
|
|
405
|
+
function isDayPickerSingle(props) {
|
|
406
|
+
return props.mode === 'single';
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* The SelectMultiple context shares details about the selected days when in
|
|
411
|
+
* multiple selection mode.
|
|
412
|
+
*
|
|
413
|
+
* Access this context from the [[useSelectMultiple]] hook.
|
|
414
|
+
*/
|
|
415
|
+
var SelectMultipleContext = React__namespace.createContext(undefined);
|
|
416
|
+
|
|
417
|
+
/** Hook to access the [[SelectMultipleContext]]. */
|
|
418
|
+
function useSelectMultiple() {
|
|
419
|
+
var context = React__namespace.useContext(SelectMultipleContext);
|
|
420
|
+
if (!context) {
|
|
421
|
+
throw new Error('useSelectMultiple must be used within a SelectMultipleProvider');
|
|
422
|
+
}
|
|
423
|
+
return context;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* The SelectRange context shares details about the selected days when in
|
|
428
|
+
* range selection mode.
|
|
429
|
+
*
|
|
430
|
+
* Access this context from the [[useSelectRange]] hook.
|
|
431
|
+
*/
|
|
432
|
+
var SelectRangeContext = React__namespace.createContext(undefined);
|
|
433
|
+
|
|
434
|
+
/** Hook to access the [[SelectRangeContext]]. */
|
|
435
|
+
function useSelectRange() {
|
|
436
|
+
var context = React__namespace.useContext(SelectRangeContext);
|
|
437
|
+
if (!context) {
|
|
438
|
+
throw new Error('useSelectRange must be used within a SelectRangeProvider');
|
|
439
|
+
}
|
|
440
|
+
return context;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* The SelectSingle context shares details about the selected days when in
|
|
445
|
+
* single selection mode.
|
|
446
|
+
*
|
|
447
|
+
* Access this context from the [[useSelectSingle]] hook.
|
|
448
|
+
*/
|
|
449
|
+
var SelectSingleContext = React__namespace.createContext(undefined);
|
|
450
|
+
|
|
451
|
+
/** Hook to access the [[SelectSingleContext]]. */
|
|
452
|
+
function useSelectSingle() {
|
|
453
|
+
var context = React__namespace.useContext(SelectSingleContext);
|
|
454
|
+
if (!context) {
|
|
455
|
+
throw new Error('useSelectSingle must be used within a SelectSingleProvider');
|
|
456
|
+
}
|
|
457
|
+
return context;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/** Returns true if `value` is an array of valid dates. */
|
|
461
|
+
function isArrayOfDates(value) {
|
|
462
|
+
return Array.isArray(value) && value.every(dateFns.isDate);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/** Returns true if `value` is of type [[DateAfter]]. */
|
|
466
|
+
function isDateAfterType(value) {
|
|
467
|
+
return Boolean(value && typeof value === 'object' && 'after' in value);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/** Returns true if `value` is of type [[DateBefore]]. */
|
|
471
|
+
function isDateBeforeType(value) {
|
|
472
|
+
return Boolean(value && typeof value === 'object' && 'before' in value);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/** Returns true if `matcher` is of type [[DateInterval]]. */
|
|
476
|
+
function isDateInterval(matcher) {
|
|
477
|
+
return Boolean(matcher &&
|
|
478
|
+
typeof matcher === 'object' &&
|
|
479
|
+
'before' in matcher &&
|
|
480
|
+
'after' in matcher);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/** Returns true if `value` is a [[DateRange]] type. */
|
|
484
|
+
function isDateRange(value) {
|
|
485
|
+
// TODO: Check if dates?!
|
|
486
|
+
return Boolean(value && typeof value === 'object' && 'from' in value);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/** Returns true if `value` is a Date type. */
|
|
490
|
+
function isDateType(value) {
|
|
491
|
+
return dateFns.isDate(value);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/** Returns true if `value` is a [[DayOfWeek]] type. */
|
|
495
|
+
function isDayOfWeekType(value) {
|
|
496
|
+
return Boolean(value && typeof value === 'object' && 'dayOfWeek' in value);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/** Return `true` whether the given date is inside the range. */
|
|
500
|
+
function isDateInRange(date, range) {
|
|
501
|
+
var _a;
|
|
502
|
+
var from = range.from, to = range.to;
|
|
503
|
+
if (!from) {
|
|
504
|
+
return false;
|
|
505
|
+
}
|
|
506
|
+
if (!to && dateFns.isSameDay(from, date)) {
|
|
507
|
+
return true;
|
|
508
|
+
}
|
|
509
|
+
if (!to) {
|
|
510
|
+
return false;
|
|
511
|
+
}
|
|
512
|
+
var isToBeforeFrom = dateFns.differenceInCalendarDays(to, from) < 0;
|
|
513
|
+
if (to && isToBeforeFrom) {
|
|
514
|
+
_a = [to, from], from = _a[0], to = _a[1];
|
|
515
|
+
}
|
|
516
|
+
return (dateFns.differenceInCalendarDays(date, from) >= 0 &&
|
|
517
|
+
dateFns.differenceInCalendarDays(to, date) >= 0);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Returns `true` whether the day matches against the given matchers.
|
|
522
|
+
*/
|
|
523
|
+
function isMatch(day, matchers) {
|
|
524
|
+
return matchers.some(function (matcher) {
|
|
525
|
+
if (typeof matcher === 'boolean') {
|
|
526
|
+
return matcher;
|
|
527
|
+
}
|
|
528
|
+
if (isDateType(matcher)) {
|
|
529
|
+
return dateFns.isSameDay(day, matcher);
|
|
530
|
+
}
|
|
531
|
+
if (isArrayOfDates(matcher)) {
|
|
532
|
+
return matcher.includes(day);
|
|
533
|
+
}
|
|
534
|
+
if (isDateRange(matcher)) {
|
|
535
|
+
return isDateInRange(day, matcher);
|
|
536
|
+
}
|
|
537
|
+
if (isDayOfWeekType(matcher)) {
|
|
538
|
+
return matcher.dayOfWeek.includes(day.getDay());
|
|
539
|
+
}
|
|
540
|
+
if (isDateInterval(matcher)) {
|
|
541
|
+
var isBefore = dateFns.differenceInCalendarDays(matcher.before, day) > 0;
|
|
542
|
+
var isAfter = dateFns.differenceInCalendarDays(day, matcher.after) > 0;
|
|
543
|
+
return isBefore && isAfter;
|
|
544
|
+
}
|
|
545
|
+
if (isDateAfterType(matcher)) {
|
|
546
|
+
return dateFns.differenceInCalendarDays(day, matcher.after) > 0;
|
|
547
|
+
}
|
|
548
|
+
if (isDateBeforeType(matcher)) {
|
|
549
|
+
return dateFns.differenceInCalendarDays(matcher.before, day) > 0;
|
|
550
|
+
}
|
|
551
|
+
if (typeof matcher === 'function') {
|
|
552
|
+
return matcher(day);
|
|
553
|
+
}
|
|
554
|
+
return false;
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Return the status of the modifiers that matches the given date.
|
|
560
|
+
*/
|
|
561
|
+
function getModifierStatus(date,
|
|
562
|
+
/** The modifiers to match for the given date. */
|
|
563
|
+
modifiers) {
|
|
564
|
+
var modifiersList = Object.keys(modifiers).reduce(function (previousValue, key) {
|
|
565
|
+
var modifier = modifiers[key];
|
|
566
|
+
if (isMatch(date, modifier)) {
|
|
567
|
+
previousValue.push(key);
|
|
568
|
+
}
|
|
569
|
+
return previousValue;
|
|
570
|
+
}, []);
|
|
571
|
+
var modifiersStatus = {};
|
|
572
|
+
modifiersList.forEach(function (modifier) { return (modifiersStatus[modifier] = true); });
|
|
573
|
+
return modifiersStatus;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/** Return the modifiers and its styles for the specified date. */
|
|
577
|
+
function useModifiers(date) {
|
|
578
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
579
|
+
var context = useDayPicker();
|
|
580
|
+
var singleSelect = useSelectSingle();
|
|
581
|
+
var multipleSelect = useSelectMultiple();
|
|
582
|
+
var rangeSelect = useSelectRange();
|
|
583
|
+
// TODO: modifiers from context should not be overridden
|
|
584
|
+
var modifiers = __assign(__assign({}, context.modifiers), { today: (_a = context.modifiers.today) !== null && _a !== void 0 ? _a : [context.today], disabled: context.modifiers.disabled });
|
|
585
|
+
if (isDayPickerSingle(context)) {
|
|
586
|
+
modifiers.selected = modifiers.selected.concat((_b = singleSelect.modifiers.selected) !== null && _b !== void 0 ? _b : []);
|
|
587
|
+
}
|
|
588
|
+
else if (isDayPickerMultiple(context)) {
|
|
589
|
+
modifiers.selected = modifiers.selected.concat((_c = multipleSelect.modifiers.selected) !== null && _c !== void 0 ? _c : []);
|
|
590
|
+
modifiers.disabled = modifiers.disabled.concat((_d = multipleSelect.modifiers.disabled) !== null && _d !== void 0 ? _d : []);
|
|
591
|
+
}
|
|
592
|
+
else if (isDayPickerRange(context)) {
|
|
593
|
+
modifiers.selected = modifiers.selected.concat((_e = rangeSelect.modifiers.selected) !== null && _e !== void 0 ? _e : []);
|
|
594
|
+
modifiers.disabled = modifiers.disabled.concat((_f = rangeSelect.modifiers.disabled) !== null && _f !== void 0 ? _f : []);
|
|
595
|
+
modifiers.range_start = (_g = rangeSelect.modifiers.range_start) !== null && _g !== void 0 ? _g : [];
|
|
596
|
+
modifiers.range_middle = (_h = rangeSelect.modifiers.range_middle) !== null && _h !== void 0 ? _h : [];
|
|
597
|
+
modifiers.range_end = (_j = rangeSelect.modifiers.range_end) !== null && _j !== void 0 ? _j : [];
|
|
598
|
+
}
|
|
599
|
+
var status = getModifierStatus(date, modifiers);
|
|
600
|
+
var modifierClassNames = [];
|
|
601
|
+
Object.keys(status)
|
|
602
|
+
.filter(function (modifier) { return Boolean(status[modifier]); })
|
|
603
|
+
.forEach(function (modifier) {
|
|
604
|
+
var customClassName = context.modifierClassNames[modifier];
|
|
605
|
+
if (customClassName) {
|
|
606
|
+
modifierClassNames.push(customClassName);
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
modifierClassNames.push("" + context.modifierPrefix + modifier);
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
var modifierStyle = {};
|
|
613
|
+
if (context.modifierStyles) {
|
|
614
|
+
Object.keys(status).forEach(function (modifier) {
|
|
615
|
+
var _a;
|
|
616
|
+
modifierStyle = __assign(__assign({}, modifierStyle), (_a = context.modifierStyles) === null || _a === void 0 ? void 0 : _a[modifier]);
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
return {
|
|
620
|
+
modifiers: status,
|
|
621
|
+
modifierClassNames: modifierClassNames,
|
|
622
|
+
modifierStyle: modifierStyle
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* The Focus context shares details about the focused day for the keyboard navigation.
|
|
628
|
+
*
|
|
629
|
+
* Access this context from the [[useFocus]] hook.
|
|
630
|
+
*/
|
|
631
|
+
var FocusContext = React__namespace.createContext(undefined);
|
|
632
|
+
|
|
633
|
+
/** Hook to access the [[FocusContext]]. */
|
|
634
|
+
function useFocus() {
|
|
635
|
+
var context = React__namespace.useContext(FocusContext);
|
|
636
|
+
if (!context) {
|
|
637
|
+
throw new Error('useFocus must be used within a FocusProvider');
|
|
638
|
+
}
|
|
639
|
+
return context;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/** Handle the focus for the day element. */
|
|
643
|
+
function useDayFocus(date, buttonRef) {
|
|
644
|
+
var _a = useFocus(), focusedDay = _a[0], _b = _a[1], focusDayAfter = _b.focusDayAfter, focusDayBefore = _b.focusDayBefore, focusWeekAfterDay = _b.focusWeekAfterDay, focusWeekBeforeDay = _b.focusWeekBeforeDay, blur = _b.blur, focus = _b.focus;
|
|
645
|
+
// Focus the HTML element if this is the focused day.
|
|
646
|
+
React__namespace.useEffect(function () {
|
|
647
|
+
var _a;
|
|
648
|
+
if (!focusedDay)
|
|
649
|
+
return;
|
|
650
|
+
if (dateFns.isSameDay(focusedDay, date)) {
|
|
651
|
+
(_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
652
|
+
}
|
|
653
|
+
}, [focusedDay, date, buttonRef]);
|
|
654
|
+
var focusOnKeyDown = function (e) {
|
|
655
|
+
switch (e.key) {
|
|
656
|
+
case 'ArrowLeft':
|
|
657
|
+
e.preventDefault();
|
|
658
|
+
e.stopPropagation();
|
|
659
|
+
focusDayBefore();
|
|
660
|
+
break;
|
|
661
|
+
case 'ArrowRight':
|
|
662
|
+
e.preventDefault();
|
|
663
|
+
e.stopPropagation();
|
|
664
|
+
focusDayAfter();
|
|
665
|
+
break;
|
|
666
|
+
case 'ArrowDown':
|
|
667
|
+
e.preventDefault();
|
|
668
|
+
e.stopPropagation();
|
|
669
|
+
focusWeekAfterDay();
|
|
670
|
+
break;
|
|
671
|
+
case 'ArrowUp':
|
|
672
|
+
e.preventDefault();
|
|
673
|
+
e.stopPropagation();
|
|
674
|
+
focusWeekBeforeDay();
|
|
675
|
+
break;
|
|
676
|
+
}
|
|
677
|
+
};
|
|
678
|
+
var isFocused = Boolean(focusedDay && !dateFns.isSameDay(focusedDay, date));
|
|
679
|
+
return { focus: focus, blur: blur, focusOnKeyDown: focusOnKeyDown, isFocused: isFocused };
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* This hook returns details about the content to render in the day cell.
|
|
684
|
+
*
|
|
685
|
+
*
|
|
686
|
+
* When a day cell is rendered in the table, DayPicker can either:
|
|
687
|
+
*
|
|
688
|
+
* - render nothing: when the day is outside the month or has matched the
|
|
689
|
+
* "hidden" modifier.
|
|
690
|
+
* - render a button. When a selection mode is set, DayPicker renders a button
|
|
691
|
+
* to allow the focus and the selection. In case of `custom` selection
|
|
692
|
+
* mode, DayPicker expects a `onDayClick` prop to render a button.
|
|
693
|
+
* - render a non-interactive element: when no selection mode is set, the day
|
|
694
|
+
* cell shouldn’t respond to any interaction. DayPicker should render a `div`
|
|
695
|
+
* or a `span`.
|
|
696
|
+
*
|
|
697
|
+
* ### Usage
|
|
698
|
+
*
|
|
699
|
+
* Use this hook to customize the behavior of the [[Day]] component. Create a
|
|
700
|
+
* new `Day` component using this hook and pass it to the `components` prop.
|
|
701
|
+
* The source of [[Day]] can be a good starting point.
|
|
702
|
+
*
|
|
703
|
+
* */
|
|
704
|
+
function useDay(
|
|
705
|
+
/** The day rendered in the month. */
|
|
706
|
+
date,
|
|
707
|
+
/** The month where the date is displayed. DayPicker renders days outside the display month when `showOutsideDays` is true. */
|
|
708
|
+
displayMonth,
|
|
709
|
+
/** A ref to the button element. */
|
|
710
|
+
buttonRef) {
|
|
711
|
+
var context = useDayPicker();
|
|
712
|
+
var single = useSelectSingle();
|
|
713
|
+
var multiple = useSelectMultiple();
|
|
714
|
+
var range = useSelectRange();
|
|
715
|
+
var _a = useDayFocus(date, buttonRef), focus = _a.focus, blur = _a.blur, focusOnKeyDown = _a.focusOnKeyDown, isFocused = _a.isFocused;
|
|
716
|
+
var _b = useModifiers(date), modifiers = _b.modifiers, modifierClassNames = _b.modifierClassNames, modifierStyle = _b.modifierStyle;
|
|
717
|
+
var isOutside = !dateFns.isSameMonth(date, displayMonth);
|
|
718
|
+
var returnValue = {
|
|
719
|
+
isOutside: isOutside,
|
|
720
|
+
modifiers: modifiers,
|
|
721
|
+
selected: isDayPickerSingle(context)
|
|
722
|
+
? single.selected
|
|
723
|
+
: isDayPickerMultiple(context)
|
|
724
|
+
? multiple.selected
|
|
725
|
+
: isDayPickerRange(context)
|
|
726
|
+
? range.selected
|
|
727
|
+
: undefined,
|
|
728
|
+
single: single,
|
|
729
|
+
multiple: multiple,
|
|
730
|
+
range: range
|
|
731
|
+
};
|
|
732
|
+
if (isOutside && !context.showOutsideDays) {
|
|
733
|
+
return returnValue;
|
|
734
|
+
}
|
|
735
|
+
if (modifiers.hidden) {
|
|
736
|
+
return returnValue;
|
|
737
|
+
}
|
|
738
|
+
var classNames = [context.classNames.day].concat(modifierClassNames);
|
|
739
|
+
var style = __assign(__assign({}, context.styles.day), modifierStyle);
|
|
740
|
+
if (isOutside) {
|
|
741
|
+
classNames.push(context.classNames.day_outside);
|
|
742
|
+
style = __assign(__assign({}, context.styles), context.styles.day_outside);
|
|
743
|
+
}
|
|
744
|
+
var DayContent = context.components.DayContent;
|
|
745
|
+
var children = (React__default["default"].createElement(DayContent, { date: date, displayMonth: displayMonth, modifiers: modifiers }));
|
|
746
|
+
var className = classNames.join(' ');
|
|
747
|
+
if (!context.mode) {
|
|
748
|
+
return __assign(__assign({}, returnValue), { nonInteractiveProps: {
|
|
749
|
+
style: style,
|
|
750
|
+
className: className,
|
|
751
|
+
children: children
|
|
752
|
+
} });
|
|
753
|
+
}
|
|
754
|
+
// #region Event handlers
|
|
755
|
+
var handleClick = function (e) {
|
|
756
|
+
var _a, _b, _c, _d;
|
|
757
|
+
if (isDayPickerSingle(context)) {
|
|
758
|
+
(_a = single.handleDayClick) === null || _a === void 0 ? void 0 : _a.call(single, date, modifiers, e);
|
|
759
|
+
}
|
|
760
|
+
else if (isDayPickerMultiple(context)) {
|
|
761
|
+
(_b = multiple.handleDayClick) === null || _b === void 0 ? void 0 : _b.call(multiple, date, modifiers, e);
|
|
762
|
+
}
|
|
763
|
+
else if (isDayPickerRange(context)) {
|
|
764
|
+
(_c = range.handleDayClick) === null || _c === void 0 ? void 0 : _c.call(range, date, modifiers, e);
|
|
765
|
+
}
|
|
766
|
+
(_d = context.onDayClick) === null || _d === void 0 ? void 0 : _d.call(context, date, modifiers, e);
|
|
767
|
+
};
|
|
768
|
+
var handleFocus = function (e) {
|
|
769
|
+
var _a;
|
|
770
|
+
focus(date);
|
|
771
|
+
(_a = context.onDayFocus) === null || _a === void 0 ? void 0 : _a.call(context, date, modifiers, e);
|
|
772
|
+
};
|
|
773
|
+
var handleBlur = function (e) {
|
|
774
|
+
var _a;
|
|
775
|
+
blur();
|
|
776
|
+
(_a = context.onDayBlur) === null || _a === void 0 ? void 0 : _a.call(context, date, modifiers, e);
|
|
777
|
+
};
|
|
778
|
+
var handleKeyDown = function (e) {
|
|
779
|
+
var _a;
|
|
780
|
+
focusOnKeyDown(e);
|
|
781
|
+
(_a = context.onDayKeyDown) === null || _a === void 0 ? void 0 : _a.call(context, date, modifiers, e);
|
|
782
|
+
};
|
|
783
|
+
var handleKeyUp = function (e) {
|
|
784
|
+
var _a;
|
|
785
|
+
(_a = context.onDayKeyUp) === null || _a === void 0 ? void 0 : _a.call(context, date, modifiers, e);
|
|
786
|
+
};
|
|
787
|
+
var handleMouseEnter = function (e) {
|
|
788
|
+
var _a;
|
|
789
|
+
(_a = context.onDayMouseEnter) === null || _a === void 0 ? void 0 : _a.call(context, date, modifiers, e);
|
|
790
|
+
};
|
|
791
|
+
var handleMouseLeave = function (e) {
|
|
792
|
+
var _a;
|
|
793
|
+
(_a = context.onDayMouseLeave) === null || _a === void 0 ? void 0 : _a.call(context, date, modifiers, e);
|
|
794
|
+
};
|
|
795
|
+
var handleTouchCancel = function (e) {
|
|
796
|
+
var _a;
|
|
797
|
+
(_a = context.onDayTouchCancel) === null || _a === void 0 ? void 0 : _a.call(context, date, modifiers, e);
|
|
798
|
+
};
|
|
799
|
+
var handleTouchEnd = function (e) {
|
|
800
|
+
var _a;
|
|
801
|
+
(_a = context.onDayTouchEnd) === null || _a === void 0 ? void 0 : _a.call(context, date, modifiers, e);
|
|
802
|
+
};
|
|
803
|
+
var handleTouchMove = function (e) {
|
|
804
|
+
var _a;
|
|
805
|
+
(_a = context.onDayTouchMove) === null || _a === void 0 ? void 0 : _a.call(context, date, modifiers, e);
|
|
806
|
+
};
|
|
807
|
+
var handleTouchStart = function (e) {
|
|
808
|
+
var _a;
|
|
809
|
+
(_a = context.onDayTouchStart) === null || _a === void 0 ? void 0 : _a.call(context, date, modifiers, e);
|
|
810
|
+
};
|
|
811
|
+
if (isOutside) {
|
|
812
|
+
classNames.push(context.classNames.day_outside);
|
|
813
|
+
style = __assign(__assign({}, context.styles), context.styles.day_outside);
|
|
814
|
+
}
|
|
815
|
+
className = classNames.join(' ');
|
|
816
|
+
var selected = modifiers.selected, disabled = modifiers.disabled;
|
|
817
|
+
var tabIndex = disabled || isFocused ? -1 : 0;
|
|
818
|
+
return __assign(__assign({}, returnValue), { buttonProps: {
|
|
819
|
+
children: children,
|
|
820
|
+
'aria-pressed': selected,
|
|
821
|
+
style: style,
|
|
822
|
+
disabled: disabled,
|
|
823
|
+
className: className,
|
|
824
|
+
tabIndex: tabIndex,
|
|
825
|
+
onClick: handleClick,
|
|
826
|
+
onFocus: handleFocus,
|
|
827
|
+
onBlur: handleBlur,
|
|
828
|
+
onKeyDown: handleKeyDown,
|
|
829
|
+
onKeyUp: handleKeyUp,
|
|
830
|
+
onMouseEnter: handleMouseEnter,
|
|
831
|
+
onMouseLeave: handleMouseLeave,
|
|
832
|
+
onTouchCancel: handleTouchCancel,
|
|
833
|
+
onTouchEnd: handleTouchEnd,
|
|
834
|
+
onTouchMove: handleTouchMove,
|
|
835
|
+
onTouchStart: handleTouchStart
|
|
836
|
+
} });
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* The content of a day cell – as a button or span element according to its
|
|
841
|
+
* modifiers.
|
|
842
|
+
*/
|
|
843
|
+
function Day(props) {
|
|
844
|
+
var buttonRef = React__namespace.useRef(null);
|
|
845
|
+
var day = useDay(props.date, props.displayMonth, buttonRef);
|
|
846
|
+
var buttonProps = day.buttonProps, nonInteractiveProps = day.nonInteractiveProps;
|
|
847
|
+
if (!buttonProps && !nonInteractiveProps) {
|
|
848
|
+
return React__namespace.createElement(React__namespace.Fragment, null);
|
|
849
|
+
}
|
|
850
|
+
if (nonInteractiveProps) {
|
|
851
|
+
return React__namespace.createElement("div", __assign({}, nonInteractiveProps));
|
|
852
|
+
}
|
|
853
|
+
return React__namespace.createElement(Button, __assign({ ref: buttonRef }, buttonProps));
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Build the `fromDate` and `toDate` values, given the fromMonth/toMonth
|
|
858
|
+
* or fromYear/toYear props.
|
|
859
|
+
*/
|
|
860
|
+
function parseFromToProps(props) {
|
|
861
|
+
var fromYear = props.fromYear, toYear = props.toYear, fromMonth = props.fromMonth, toMonth = props.toMonth;
|
|
862
|
+
var fromDate = props.fromDate, toDate = props.toDate;
|
|
863
|
+
if (fromMonth) {
|
|
864
|
+
fromDate = dateFns.startOfMonth(fromMonth);
|
|
865
|
+
}
|
|
866
|
+
else if (fromYear) {
|
|
867
|
+
fromDate = new Date(fromYear, 0, 1);
|
|
868
|
+
}
|
|
869
|
+
if (toMonth) {
|
|
870
|
+
toDate = dateFns.startOfMonth(toMonth);
|
|
871
|
+
}
|
|
872
|
+
else if (toYear) {
|
|
873
|
+
toDate = new Date(toYear, 11, 31);
|
|
874
|
+
}
|
|
875
|
+
return {
|
|
876
|
+
fromDate: fromDate ? dateFns.startOfDay(fromDate) : undefined,
|
|
877
|
+
toDate: toDate ? dateFns.startOfDay(toDate) : undefined
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/** Props that will merge into the modifiers. */
|
|
882
|
+
var modifierShortcuts = [
|
|
883
|
+
'selected',
|
|
884
|
+
'hidden',
|
|
885
|
+
'disabled'
|
|
886
|
+
];
|
|
887
|
+
/**
|
|
888
|
+
* Parse the modifiers from the props and return them as a map of array of
|
|
889
|
+
* matcher.
|
|
890
|
+
*
|
|
891
|
+
* Internally we want modifiers as an array of matchers – as opposite of the
|
|
892
|
+
* props which can accept also a matcher.
|
|
893
|
+
*/
|
|
894
|
+
function parseModifierProps(initialProps) {
|
|
895
|
+
var initialModifiers = initialProps.modifiers || {};
|
|
896
|
+
var modifiers = {
|
|
897
|
+
selected: [],
|
|
898
|
+
disabled: [],
|
|
899
|
+
hidden: [],
|
|
900
|
+
range_end: [],
|
|
901
|
+
range_middle: [],
|
|
902
|
+
range_start: []
|
|
903
|
+
};
|
|
904
|
+
Object.entries(initialModifiers).forEach(function (_a) {
|
|
905
|
+
var modifier = _a[0], matcher = _a[1];
|
|
906
|
+
if (Array.isArray(matcher)) {
|
|
907
|
+
modifiers[modifier] = matcher;
|
|
908
|
+
}
|
|
909
|
+
else if (matcher) {
|
|
910
|
+
modifiers[modifier] = [matcher];
|
|
911
|
+
}
|
|
912
|
+
else {
|
|
913
|
+
modifiers[modifier] = [];
|
|
914
|
+
}
|
|
915
|
+
});
|
|
916
|
+
modifierShortcuts.forEach(function (modifier) {
|
|
917
|
+
// @ts-expect-error TOFIX: initial props do not have some modifiers
|
|
918
|
+
var modifierFromProp = initialProps[modifier];
|
|
919
|
+
if (Array.isArray(modifierFromProp)) {
|
|
920
|
+
modifiers[modifier] = modifierFromProp;
|
|
921
|
+
}
|
|
922
|
+
else if (modifierFromProp !== undefined) {
|
|
923
|
+
modifiers[modifier] = [modifierFromProp];
|
|
924
|
+
}
|
|
925
|
+
else {
|
|
926
|
+
modifiers[modifier] = [];
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
return modifiers;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Render the content of the day cell.
|
|
934
|
+
*/
|
|
935
|
+
function DayContent(props) {
|
|
936
|
+
var _a = useDayPicker(), locale = _a.locale, classNames = _a.classNames, styles = _a.styles, labelDay = _a.labels.labelDay, formatDay = _a.formatters.formatDay;
|
|
937
|
+
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
938
|
+
React__namespace.createElement("span", { "aria-hidden": "true" }, formatDay(props.date, { locale: locale })),
|
|
939
|
+
React__namespace.createElement("span", { className: classNames.vhidden, style: styles.vhidden }, labelDay(props.date, props.modifiers, { locale: locale }))));
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Render a styled select component – displaying a caption and a custom
|
|
944
|
+
* drop-down icon.
|
|
945
|
+
*/
|
|
946
|
+
function Dropdown(props) {
|
|
947
|
+
var onChange = props.onChange, value = props.value, children = props.children, caption = props.caption, className = props.className, style = props.style;
|
|
948
|
+
var _a = useDayPicker(), classNames = _a.classNames, styles = _a.styles, IconDropdown = _a.components.IconDropdown;
|
|
949
|
+
return (React__namespace.createElement("div", { className: className, style: style },
|
|
950
|
+
React__namespace.createElement("span", { className: classNames.vhidden }, props['aria-label']),
|
|
951
|
+
React__namespace.createElement("select", { "aria-label": props['aria-label'], className: classNames.dropdown, style: styles.dropdown, value: value, onChange: onChange }, children),
|
|
952
|
+
React__namespace.createElement("div", { className: classNames.caption_label, style: styles.caption_label, "aria-hidden": "true" },
|
|
953
|
+
caption,
|
|
954
|
+
React__namespace.createElement(IconDropdown, { className: classNames.dropdown_icon, style: styles.dropdown_icon }))));
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/** Render the Footer component (empty as default).*/
|
|
958
|
+
function Footer() {
|
|
959
|
+
var _a = useDayPicker(), footer = _a.footer, styles = _a.styles, tfoot = _a.classNames.tfoot;
|
|
960
|
+
if (!footer)
|
|
961
|
+
return React__namespace.createElement(React__namespace.Fragment, null);
|
|
962
|
+
return (React__namespace.createElement("tfoot", { className: tfoot, style: styles.tfoot },
|
|
963
|
+
React__namespace.createElement("tr", null,
|
|
964
|
+
React__namespace.createElement("td", { colSpan: 8 }, footer))));
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
* Generate a series of 7 days, starting from the week, to use for formatting
|
|
969
|
+
* the weekday names (Monday, Tuesday, etc.).
|
|
970
|
+
*/
|
|
971
|
+
function getWeekdays(locale) {
|
|
972
|
+
var start = dateFns.startOfWeek(new Date(), { locale: locale });
|
|
973
|
+
var days = [];
|
|
974
|
+
for (var i = 0; i < 7; i++) {
|
|
975
|
+
var day = dateFns.addDays(start, i);
|
|
976
|
+
days.push(day);
|
|
977
|
+
}
|
|
978
|
+
return days;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* Render the Head component - i.e. the table head with the weekday names.
|
|
983
|
+
*/
|
|
984
|
+
function Head() {
|
|
985
|
+
var _a = useDayPicker(), classNames = _a.classNames, styles = _a.styles, showWeekNumber = _a.showWeekNumber, locale = _a.locale, formatWeekdayName = _a.formatters.formatWeekdayName, labelWeekday = _a.labels.labelWeekday;
|
|
986
|
+
var weekdays = getWeekdays(locale);
|
|
987
|
+
return (React__namespace.createElement("thead", { style: styles.head, className: classNames.head },
|
|
988
|
+
React__namespace.createElement("tr", { style: styles.head_row, className: classNames.head_row },
|
|
989
|
+
showWeekNumber && (React__namespace.createElement("th", { scope: "col", style: styles.head_cell, className: classNames.head_cell })),
|
|
990
|
+
weekdays.map(function (weekday, i) { return (React__namespace.createElement("th", { key: i, scope: "col", className: classNames.head_cell, style: styles.head_cell },
|
|
991
|
+
React__namespace.createElement("span", { className: classNames.vhidden, "aria-label": "" }, labelWeekday(weekday, { locale: locale })),
|
|
992
|
+
React__namespace.createElement("span", { "aria-hidden": true }, formatWeekdayName(weekday, { locale: locale })))); }))));
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
/**
|
|
996
|
+
* Render the icon in the styled drop-down.
|
|
997
|
+
*/
|
|
998
|
+
function IconDropdown(props) {
|
|
999
|
+
return (React__namespace.createElement("svg", __assign({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, props),
|
|
1000
|
+
React__namespace.createElement("path", { d: "M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z", fill: "currentColor", fillRule: "nonzero" })));
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* Render the "next month" button in the navigation.
|
|
1005
|
+
*/
|
|
1006
|
+
function IconNext(props) {
|
|
1007
|
+
return (React__namespace.createElement("svg", __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props, { "data-testid": "iconNext" }),
|
|
1008
|
+
React__namespace.createElement("path", { d: "M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z", fill: "currentColor" })));
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* Render the "previous month" button in the navigation.
|
|
1013
|
+
*/
|
|
1014
|
+
function IconPrevious(props) {
|
|
1015
|
+
return (React__namespace.createElement("svg", __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120", "data-testid": "iconPrevious" }, props),
|
|
1016
|
+
React__namespace.createElement("path", { d: "M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z", fill: "currentColor", fillRule: "nonzero" })));
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Render a row in the calendar, with the days and optionally the week number.
|
|
1021
|
+
*/
|
|
1022
|
+
function Row(props) {
|
|
1023
|
+
var _a = useDayPicker(), styles = _a.styles, classNames = _a.classNames, showWeekNumber = _a.showWeekNumber, _b = _a.components, Day = _b.Day, WeekNumber = _b.WeekNumber;
|
|
1024
|
+
var weekNumberCell;
|
|
1025
|
+
if (showWeekNumber) {
|
|
1026
|
+
weekNumberCell = (React__namespace.createElement("td", { className: classNames.cell, style: styles.cell },
|
|
1027
|
+
React__namespace.createElement(WeekNumber, { number: props.weekNumber, dates: props.dates })));
|
|
1028
|
+
}
|
|
1029
|
+
return (React__namespace.createElement("tr", { className: classNames.row, style: styles.row },
|
|
1030
|
+
weekNumberCell,
|
|
1031
|
+
props.dates.map(function (date) { return (React__namespace.createElement("td", { className: classNames.cell, style: styles.cell, key: dateFns.getUnixTime(date) },
|
|
1032
|
+
React__namespace.createElement(Day, { displayMonth: props.displayMonth, date: date }))); })));
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Render the week number element. If `onWeekNumberClick` is passed to DayPicker, it
|
|
1037
|
+
* renders a button, otherwise a span element.
|
|
1038
|
+
*/
|
|
1039
|
+
function WeekNumber(props) {
|
|
1040
|
+
var weekNumber = props.number, dates = props.dates;
|
|
1041
|
+
var _a = useDayPicker(), onWeekNumberClick = _a.onWeekNumberClick, styles = _a.styles, classNames = _a.classNames, locale = _a.locale, labelWeekNumber = _a.labels.labelWeekNumber, formatWeekNumber = _a.formatters.formatWeekNumber;
|
|
1042
|
+
var handleClick = function (e) {
|
|
1043
|
+
onWeekNumberClick === null || onWeekNumberClick === void 0 ? void 0 : onWeekNumberClick(weekNumber, dates, e);
|
|
1044
|
+
};
|
|
1045
|
+
var content = formatWeekNumber(Number(weekNumber), { locale: locale });
|
|
1046
|
+
if (!onWeekNumberClick) {
|
|
1047
|
+
return (React__namespace.createElement("span", { className: classNames.weeknumber, style: styles.weeknumber }, content));
|
|
1048
|
+
}
|
|
1049
|
+
var label = labelWeekNumber(Number(weekNumber), { locale: locale });
|
|
1050
|
+
return (React__namespace.createElement(Button, { "aria-label": label, className: classNames.weeknumber, style: styles.weeknumber, onClick: handleClick }, content));
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* The name of the default CSS classes.
|
|
1055
|
+
*/
|
|
1056
|
+
var defaultClassNames = {
|
|
1057
|
+
root: 'rdp',
|
|
1058
|
+
multiple_month: 'rdp-multiple_months',
|
|
1059
|
+
with_weeknumber: 'rdp-with_weeknumber',
|
|
1060
|
+
vhidden: 'rdp-vhidden',
|
|
1061
|
+
button_reset: 'rdp-button_reset',
|
|
1062
|
+
button: 'rdp-button',
|
|
1063
|
+
caption: 'rdp-caption',
|
|
1064
|
+
caption_first: 'rdp-caption_first',
|
|
1065
|
+
caption_last: 'rdp-caption_last',
|
|
1066
|
+
caption_middle: 'rdp-caption_middle',
|
|
1067
|
+
caption_label: 'rdp-caption_label',
|
|
1068
|
+
caption_dropdowns: 'rdp-caption_dropdowns',
|
|
1069
|
+
dropdown: 'rdp-dropdown',
|
|
1070
|
+
dropdown_month: 'rdp-dropdown_month',
|
|
1071
|
+
dropdown_year: 'rdp-dropdown_year',
|
|
1072
|
+
dropdown_icon: 'rdp-dropdown_icon',
|
|
1073
|
+
months: 'rdp-months',
|
|
1074
|
+
month: 'rdp-month',
|
|
1075
|
+
table: 'rdp-table',
|
|
1076
|
+
tbody: 'rdp-tbody',
|
|
1077
|
+
tfoot: 'rdp-tfoot',
|
|
1078
|
+
head: 'rdp-head',
|
|
1079
|
+
head_row: 'rdp-head_row',
|
|
1080
|
+
head_cell: 'rdp-head_cell',
|
|
1081
|
+
nav: 'rdp-nav',
|
|
1082
|
+
nav_button: 'rdp-nav_button',
|
|
1083
|
+
nav_button_previous: 'rdp-nav_button_previous',
|
|
1084
|
+
nav_button_next: 'rdp-nav_button_next',
|
|
1085
|
+
nav_icon: 'rdp-nav_icon',
|
|
1086
|
+
row: 'rdp-row',
|
|
1087
|
+
row_head: 'rdp-row_head',
|
|
1088
|
+
weeknumber: 'rdp-weeknumber',
|
|
1089
|
+
cell: 'rdp-cell',
|
|
1090
|
+
day: 'rdp-day',
|
|
1091
|
+
day_outside: 'rdp-day_outside',
|
|
1092
|
+
day_today: 'rdp-day_today'
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1095
|
+
/**
|
|
1096
|
+
* The default formatter for the caption.
|
|
1097
|
+
*/
|
|
1098
|
+
function formatCaption(month, options) {
|
|
1099
|
+
return dateFns.format(month, 'LLLL y', options);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
/**
|
|
1103
|
+
* The default formatter for the Day button.
|
|
1104
|
+
*/
|
|
1105
|
+
function formatDay(day, options) {
|
|
1106
|
+
return dateFns.format(day, 'd', options);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* The default formatter for the Month caption.
|
|
1111
|
+
*/
|
|
1112
|
+
function formatMonthCaption(month, options) {
|
|
1113
|
+
return dateFns.format(month, 'LLLL', options);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* The default formatter for the week number.
|
|
1118
|
+
*/
|
|
1119
|
+
function formatWeekNumber(weekNumber) {
|
|
1120
|
+
return "" + weekNumber;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
/**
|
|
1124
|
+
* The default formatter for the name of the weekday.
|
|
1125
|
+
*/
|
|
1126
|
+
function formatWeekdayName(weekday, options) {
|
|
1127
|
+
return dateFns.format(weekday, 'cccccc', options);
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
/**
|
|
1131
|
+
* The default formatter for the Year caption.
|
|
1132
|
+
*/
|
|
1133
|
+
function formatYearCaption(year, options) {
|
|
1134
|
+
return dateFns.format(year, 'yyyy', options);
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
1138
|
+
__proto__: null,
|
|
1139
|
+
formatCaption: formatCaption,
|
|
1140
|
+
formatDay: formatDay,
|
|
1141
|
+
formatMonthCaption: formatMonthCaption,
|
|
1142
|
+
formatWeekNumber: formatWeekNumber,
|
|
1143
|
+
formatWeekdayName: formatWeekdayName,
|
|
1144
|
+
formatYearCaption: formatYearCaption
|
|
1145
|
+
});
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
* The default ARIA label for the day button.
|
|
1149
|
+
*/
|
|
1150
|
+
var labelDay = function (day, options) {
|
|
1151
|
+
return dateFns.format(day, 'do MMMM (EEEE)', options);
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* The default ARIA label for the WeekNumber element.
|
|
1156
|
+
*/
|
|
1157
|
+
var labelMonthDropdown = function () {
|
|
1158
|
+
return 'Month: ';
|
|
1159
|
+
};
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* The default ARIA label for next month button in navigation
|
|
1163
|
+
*/
|
|
1164
|
+
var labelNext = function () {
|
|
1165
|
+
return 'Go to next month';
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* The default ARIA label for previous month button in navigation
|
|
1170
|
+
*/
|
|
1171
|
+
var labelPrevious = function () {
|
|
1172
|
+
return 'Go to previous month';
|
|
1173
|
+
};
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* The default ARIA label for the Weekday element.
|
|
1177
|
+
*/
|
|
1178
|
+
var labelWeekday = function (day, options) {
|
|
1179
|
+
return dateFns.format(day, 'cccc.', options);
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* The default ARIA label for the WeekNumber element.
|
|
1184
|
+
*/
|
|
1185
|
+
var labelWeekNumber = function (n) {
|
|
1186
|
+
return "Week n. " + n;
|
|
1187
|
+
};
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* The default ARIA label for the WeekNumber element.
|
|
1191
|
+
*/
|
|
1192
|
+
var labelYearDropdown = function () {
|
|
1193
|
+
return 'Year: ';
|
|
1194
|
+
};
|
|
1195
|
+
|
|
1196
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
1197
|
+
__proto__: null,
|
|
1198
|
+
labelDay: labelDay,
|
|
1199
|
+
labelMonthDropdown: labelMonthDropdown,
|
|
1200
|
+
labelNext: labelNext,
|
|
1201
|
+
labelPrevious: labelPrevious,
|
|
1202
|
+
labelWeekday: labelWeekday,
|
|
1203
|
+
labelWeekNumber: labelWeekNumber,
|
|
1204
|
+
labelYearDropdown: labelYearDropdown
|
|
1205
|
+
});
|
|
1206
|
+
|
|
1207
|
+
/**
|
|
1208
|
+
* The provider for the [[DayPickerContext]].
|
|
1209
|
+
*/
|
|
1210
|
+
function DayPickerProvider(props) {
|
|
1211
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1212
|
+
var children = props.children, initialProps = props.initialProps;
|
|
1213
|
+
var locale = (_a = initialProps.locale) !== null && _a !== void 0 ? _a : enUS__default["default"];
|
|
1214
|
+
var numberOfMonths = (_b = initialProps.numberOfMonths) !== null && _b !== void 0 ? _b : 1;
|
|
1215
|
+
var today = (_c = initialProps.today) !== null && _c !== void 0 ? _c : new Date();
|
|
1216
|
+
// Limit navigation
|
|
1217
|
+
var _g = parseFromToProps(initialProps), fromDate = _g.fromDate, toDate = _g.toDate;
|
|
1218
|
+
// Default caption layout. If calendar navigation is unlimited, it must be
|
|
1219
|
+
// always `buttons` – as we cannot display infinite options in the dropdown.
|
|
1220
|
+
var captionLayout = (_d = initialProps.captionLayout) !== null && _d !== void 0 ? _d : 'buttons';
|
|
1221
|
+
if (!fromDate && !toDate)
|
|
1222
|
+
captionLayout = 'buttons';
|
|
1223
|
+
var modifiers = parseModifierProps(initialProps);
|
|
1224
|
+
// Disable days before/after from/toDate
|
|
1225
|
+
if (fromDate) {
|
|
1226
|
+
modifiers.disabled.push({ before: fromDate });
|
|
1227
|
+
}
|
|
1228
|
+
if (toDate) {
|
|
1229
|
+
modifiers.disabled.push({ after: toDate });
|
|
1230
|
+
}
|
|
1231
|
+
initialProps.toYear; initialProps.fromYear; initialProps.toMonth; initialProps.fromMonth; var contextProps = __rest(initialProps, ["toYear", "fromYear", "toMonth", "fromMonth"]);
|
|
1232
|
+
var context = __assign(__assign({}, contextProps), { captionLayout: captionLayout, fromDate: fromDate, toDate: toDate, today: today, locale: locale, modifierClassNames: (_e = initialProps.modifierClassNames) !== null && _e !== void 0 ? _e : {}, modifierPrefix: 'rdp-day_', modifiers: modifiers, numberOfMonths: numberOfMonths, styles: (_f = initialProps.styles) !== null && _f !== void 0 ? _f : {}, classNames: __assign(__assign({}, defaultClassNames), initialProps.classNames), formatters: __assign(__assign({}, index), initialProps.formatters), labels: __assign(__assign({}, index$1), initialProps.labels), components: __assign({ Caption: Caption, CaptionLabel: CaptionLabel, Day: Day, DayContent: DayContent, Dropdown: Dropdown, Footer: Footer, Head: Head, IconDropdown: IconDropdown, IconNext: IconNext, IconPrevious: IconPrevious, Row: Row, WeekNumber: WeekNumber }, initialProps.components) });
|
|
1233
|
+
return (React__namespace.createElement(DayPickerContext.Provider, { value: context }, children));
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
/** The provider for the [[FocusContext]]. */
|
|
1237
|
+
function FocusProvider(_a) {
|
|
1238
|
+
var children = _a.children;
|
|
1239
|
+
var _b = React__namespace.useState(), focusedDay = _b[0], setDay = _b[1];
|
|
1240
|
+
var _c = useNavigation(), goToMonth = _c.goToMonth, displayMonths = _c.displayMonths;
|
|
1241
|
+
var numberOfMonths = useDayPicker().numberOfMonths;
|
|
1242
|
+
var blur = function () { return setDay(undefined); };
|
|
1243
|
+
var focus = function (date) { return setDay(date); };
|
|
1244
|
+
var switchMonth = function (date, offset) {
|
|
1245
|
+
if (displayMonths.some(function (m) { return dateFns.isSameMonth(date, m); }))
|
|
1246
|
+
return;
|
|
1247
|
+
if (offset < 0) {
|
|
1248
|
+
goToMonth(dateFns.addMonths(date, 1 + offset));
|
|
1249
|
+
}
|
|
1250
|
+
else {
|
|
1251
|
+
goToMonth(date);
|
|
1252
|
+
}
|
|
1253
|
+
};
|
|
1254
|
+
var focusDayBefore = function () {
|
|
1255
|
+
if (!focusedDay)
|
|
1256
|
+
return;
|
|
1257
|
+
var before = dateFns.addDays(focusedDay, -1);
|
|
1258
|
+
setDay(before);
|
|
1259
|
+
switchMonth(before, numberOfMonths * -1);
|
|
1260
|
+
};
|
|
1261
|
+
var focusDayAfter = function () {
|
|
1262
|
+
if (!focusedDay)
|
|
1263
|
+
return;
|
|
1264
|
+
var after = dateFns.addDays(focusedDay, 1);
|
|
1265
|
+
setDay(after);
|
|
1266
|
+
switchMonth(after, numberOfMonths);
|
|
1267
|
+
};
|
|
1268
|
+
var focusWeekBeforeDay = function () {
|
|
1269
|
+
if (!focusedDay)
|
|
1270
|
+
return;
|
|
1271
|
+
var up = dateFns.addWeeks(focusedDay, -1);
|
|
1272
|
+
setDay(up);
|
|
1273
|
+
switchMonth(up, numberOfMonths * -1);
|
|
1274
|
+
};
|
|
1275
|
+
var focusWeekAfterDay = function () {
|
|
1276
|
+
if (!focusedDay)
|
|
1277
|
+
return;
|
|
1278
|
+
var down = dateFns.addWeeks(focusedDay, 1);
|
|
1279
|
+
setDay(down);
|
|
1280
|
+
switchMonth(down, numberOfMonths);
|
|
1281
|
+
};
|
|
1282
|
+
var setters = {
|
|
1283
|
+
blur: blur,
|
|
1284
|
+
focus: focus,
|
|
1285
|
+
focusDayAfter: focusDayAfter,
|
|
1286
|
+
focusDayBefore: focusDayBefore,
|
|
1287
|
+
focusWeekAfterDay: focusWeekAfterDay,
|
|
1288
|
+
focusWeekBeforeDay: focusWeekBeforeDay
|
|
1289
|
+
};
|
|
1290
|
+
return (React__namespace.createElement(FocusContext.Provider, { value: [focusedDay, setters] }, children));
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
/** Return the initial month according to the given options. */
|
|
1294
|
+
function getInitialMonth(context) {
|
|
1295
|
+
var month = context.month, defaultMonth = context.defaultMonth, today = context.today;
|
|
1296
|
+
var initialMonth = month || defaultMonth || today || new Date();
|
|
1297
|
+
var toDate = context.toDate, fromDate = context.fromDate, _a = context.numberOfMonths, numberOfMonths = _a === void 0 ? 1 : _a;
|
|
1298
|
+
// Fix the initialMonth if is after the to-date
|
|
1299
|
+
if (toDate && dateFns.differenceInCalendarMonths(toDate, initialMonth) < 0) {
|
|
1300
|
+
var offset = -1 * (numberOfMonths - 1);
|
|
1301
|
+
initialMonth = dateFns.addMonths(toDate, offset);
|
|
1302
|
+
}
|
|
1303
|
+
// Fix the initialMonth if is before the from-date
|
|
1304
|
+
if (fromDate && dateFns.differenceInCalendarMonths(initialMonth, fromDate) < 0) {
|
|
1305
|
+
initialMonth = fromDate;
|
|
1306
|
+
}
|
|
1307
|
+
return dateFns.startOfMonth(initialMonth);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
/**
|
|
1311
|
+
* Helper hook for using controlled/uncontrolled values from a component props.
|
|
1312
|
+
*
|
|
1313
|
+
* When the value is not controlled, pass `undefined` as `controlledValue` and
|
|
1314
|
+
* use the returned setter to update it.
|
|
1315
|
+
*
|
|
1316
|
+
* When the value is controlled, pass the controlled value as second
|
|
1317
|
+
* argument, which will be always returned as `value`.
|
|
1318
|
+
*/
|
|
1319
|
+
function useControlledValue(defaultValue, controlledValue) {
|
|
1320
|
+
var _a = React__default["default"].useState(defaultValue), uncontrolledValue = _a[0], setValue = _a[1];
|
|
1321
|
+
var value = controlledValue === undefined ? uncontrolledValue : controlledValue;
|
|
1322
|
+
return [value, setValue];
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
/** Controls the navigation state. */
|
|
1326
|
+
function useNavigationState() {
|
|
1327
|
+
var context = useDayPicker();
|
|
1328
|
+
var initialMonth = getInitialMonth(context);
|
|
1329
|
+
var _a = useControlledValue(initialMonth, context.month), month = _a[0], setMonth = _a[1];
|
|
1330
|
+
var goToMonth = function (date) {
|
|
1331
|
+
if (context.disableNavigation)
|
|
1332
|
+
return;
|
|
1333
|
+
setMonth(date);
|
|
1334
|
+
};
|
|
1335
|
+
return [month, goToMonth];
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
/**
|
|
1339
|
+
* Return the months to display in the component according to the number of
|
|
1340
|
+
* months and the from/to date.
|
|
1341
|
+
*/
|
|
1342
|
+
function getDisplayMonths(month, _a) {
|
|
1343
|
+
var reverseMonths = _a.reverseMonths, numberOfMonths = _a.numberOfMonths;
|
|
1344
|
+
var start = dateFns.startOfMonth(month);
|
|
1345
|
+
var end = dateFns.startOfMonth(dateFns.addMonths(start, numberOfMonths));
|
|
1346
|
+
var monthsDiff = dateFns.differenceInCalendarMonths(end, start);
|
|
1347
|
+
var months = [];
|
|
1348
|
+
for (var i = 0; i < monthsDiff; i++) {
|
|
1349
|
+
var nextMonth = dateFns.addMonths(start, i);
|
|
1350
|
+
months.push(nextMonth);
|
|
1351
|
+
}
|
|
1352
|
+
if (reverseMonths)
|
|
1353
|
+
months = months.reverse();
|
|
1354
|
+
return months;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
/**
|
|
1358
|
+
* Returns the next month the user can navigate to according to the given
|
|
1359
|
+
* options.
|
|
1360
|
+
*
|
|
1361
|
+
* Please note that the next month is not always the next calendar month:
|
|
1362
|
+
*
|
|
1363
|
+
* - if after the `toDate` range, is undefined;
|
|
1364
|
+
* - if the navigation is paged, is the number of months displayed ahead.
|
|
1365
|
+
*
|
|
1366
|
+
*/
|
|
1367
|
+
function getNextMonth(startingMonth, options) {
|
|
1368
|
+
if (options.disableNavigation) {
|
|
1369
|
+
return undefined;
|
|
1370
|
+
}
|
|
1371
|
+
var toDate = options.toDate, pagedNavigation = options.pagedNavigation, _a = options.numberOfMonths, numberOfMonths = _a === void 0 ? 1 : _a;
|
|
1372
|
+
var offset = pagedNavigation ? numberOfMonths : 1;
|
|
1373
|
+
var month = dateFns.startOfMonth(startingMonth);
|
|
1374
|
+
if (!toDate) {
|
|
1375
|
+
return dateFns.addMonths(month, offset);
|
|
1376
|
+
}
|
|
1377
|
+
var monthsDiff = dateFns.differenceInCalendarMonths(toDate, startingMonth);
|
|
1378
|
+
if (monthsDiff < numberOfMonths) {
|
|
1379
|
+
return undefined;
|
|
1380
|
+
}
|
|
1381
|
+
// Jump forward as the number of months when paged navigation
|
|
1382
|
+
return dateFns.addMonths(month, offset);
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
/**
|
|
1386
|
+
* Returns the next previous the user can navigate to, according to the given
|
|
1387
|
+
* options.
|
|
1388
|
+
*
|
|
1389
|
+
* Please note that the previous month is not always the previous calendar
|
|
1390
|
+
* month:
|
|
1391
|
+
*
|
|
1392
|
+
* - if before the `fromDate` date, is `undefined`;
|
|
1393
|
+
* - if the navigation is paged, is the number of months displayed before.
|
|
1394
|
+
*
|
|
1395
|
+
*/
|
|
1396
|
+
function getPreviousMonth(startingMonth, options) {
|
|
1397
|
+
if (options.disableNavigation) {
|
|
1398
|
+
return undefined;
|
|
1399
|
+
}
|
|
1400
|
+
var fromDate = options.fromDate, pagedNavigation = options.pagedNavigation, _a = options.numberOfMonths, numberOfMonths = _a === void 0 ? 1 : _a;
|
|
1401
|
+
var offset = pagedNavigation ? numberOfMonths : 1;
|
|
1402
|
+
var month = dateFns.startOfMonth(startingMonth);
|
|
1403
|
+
if (!fromDate) {
|
|
1404
|
+
return dateFns.addMonths(month, -offset);
|
|
1405
|
+
}
|
|
1406
|
+
var monthsDiff = dateFns.differenceInCalendarMonths(month, fromDate);
|
|
1407
|
+
if (monthsDiff <= 0) {
|
|
1408
|
+
return undefined;
|
|
1409
|
+
}
|
|
1410
|
+
// Jump back as the number of months when paged navigation
|
|
1411
|
+
return dateFns.addMonths(month, -offset);
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
/** Provides the values for the [[NavigationContext]]. */
|
|
1415
|
+
function NavigationProvider(props) {
|
|
1416
|
+
var context = useDayPicker();
|
|
1417
|
+
var _a = useNavigationState(), month = _a[0], goToMonth = _a[1];
|
|
1418
|
+
var displayMonths = getDisplayMonths(month, context);
|
|
1419
|
+
var nextMonth = getNextMonth(month, context);
|
|
1420
|
+
var previousMonth = getPreviousMonth(month, context);
|
|
1421
|
+
return (React__namespace.createElement(NavigationContext.Provider, { value: {
|
|
1422
|
+
month: month,
|
|
1423
|
+
displayMonths: displayMonths,
|
|
1424
|
+
goToMonth: goToMonth,
|
|
1425
|
+
previousMonth: previousMonth,
|
|
1426
|
+
nextMonth: nextMonth
|
|
1427
|
+
} }, props.children));
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
function SelectMultipleProviderInternal(_a) {
|
|
1431
|
+
var initialProps = _a.initialProps, children = _a.children;
|
|
1432
|
+
var _b = useControlledValue(initialProps.defaultSelected, initialProps.selected), selectedDays = _b[0], setSelectedDays = _b[1];
|
|
1433
|
+
var handleDayClick = function (day, modifiers, e) {
|
|
1434
|
+
var _a, _b;
|
|
1435
|
+
(_a = initialProps.onDayClick) === null || _a === void 0 ? void 0 : _a.call(initialProps, day, modifiers, e);
|
|
1436
|
+
var isMinSelected = Boolean(initialProps.min &&
|
|
1437
|
+
modifiers.selected &&
|
|
1438
|
+
selectedDays &&
|
|
1439
|
+
selectedDays.length === initialProps.min);
|
|
1440
|
+
if (isMinSelected) {
|
|
1441
|
+
return;
|
|
1442
|
+
}
|
|
1443
|
+
var isMaxSelected = Boolean(initialProps.max &&
|
|
1444
|
+
!modifiers.selected &&
|
|
1445
|
+
selectedDays &&
|
|
1446
|
+
selectedDays.length === initialProps.max);
|
|
1447
|
+
if (isMaxSelected) {
|
|
1448
|
+
return;
|
|
1449
|
+
}
|
|
1450
|
+
var days = selectedDays ? __spreadArray([], selectedDays, true) : [];
|
|
1451
|
+
if (modifiers.selected) {
|
|
1452
|
+
var index = days.findIndex(function (selectedDay) {
|
|
1453
|
+
return dateFns.isSameDay(day, selectedDay);
|
|
1454
|
+
});
|
|
1455
|
+
days.splice(index, 1);
|
|
1456
|
+
}
|
|
1457
|
+
else {
|
|
1458
|
+
days.push(day);
|
|
1459
|
+
}
|
|
1460
|
+
setSelectedDays(days);
|
|
1461
|
+
(_b = initialProps.onSelect) === null || _b === void 0 ? void 0 : _b.call(initialProps, days, day, modifiers, e);
|
|
1462
|
+
};
|
|
1463
|
+
var modifiers = {
|
|
1464
|
+
selected: [],
|
|
1465
|
+
disabled: []
|
|
1466
|
+
};
|
|
1467
|
+
if (selectedDays) {
|
|
1468
|
+
modifiers.selected = selectedDays;
|
|
1469
|
+
modifiers.disabled = [
|
|
1470
|
+
function disableDay(day) {
|
|
1471
|
+
var isMaxSelected = initialProps.max && selectedDays.length > initialProps.max - 1;
|
|
1472
|
+
var isSelected = selectedDays.some(function (selectedDay) {
|
|
1473
|
+
return dateFns.isSameDay(selectedDay, day);
|
|
1474
|
+
});
|
|
1475
|
+
return Boolean(isMaxSelected && !isSelected);
|
|
1476
|
+
}
|
|
1477
|
+
];
|
|
1478
|
+
}
|
|
1479
|
+
var contextValue = { selected: selectedDays, handleDayClick: handleDayClick, modifiers: modifiers };
|
|
1480
|
+
return (React__namespace.createElement(SelectMultipleContext.Provider, { value: contextValue }, children));
|
|
1481
|
+
}
|
|
1482
|
+
/** Provides the values for the [[SelectMultipleContext]]. */
|
|
1483
|
+
function SelectMultipleProvider(props) {
|
|
1484
|
+
if (!isDayPickerMultiple(props.initialProps)) {
|
|
1485
|
+
var emptyContextValue = {
|
|
1486
|
+
selected: undefined,
|
|
1487
|
+
modifiers: {
|
|
1488
|
+
selected: [],
|
|
1489
|
+
disabled: []
|
|
1490
|
+
}
|
|
1491
|
+
};
|
|
1492
|
+
return (React__namespace.createElement(SelectMultipleContext.Provider, { value: emptyContextValue }, props.children));
|
|
1493
|
+
}
|
|
1494
|
+
return (React__namespace.createElement(SelectMultipleProviderInternal, { initialProps: props.initialProps, children: props.children }));
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
/**
|
|
1498
|
+
* Add a day to an existing range.
|
|
1499
|
+
*
|
|
1500
|
+
* The returned range takes in account the `undefined` values and if the added
|
|
1501
|
+
* day is already present in the range.
|
|
1502
|
+
*/
|
|
1503
|
+
function addToRange(day, range) {
|
|
1504
|
+
var _a = range || {}, from = _a.from, to = _a.to;
|
|
1505
|
+
if (!from) {
|
|
1506
|
+
return { from: day, to: day };
|
|
1507
|
+
}
|
|
1508
|
+
if (!to && dateFns.isSameDay(from, day)) {
|
|
1509
|
+
return undefined;
|
|
1510
|
+
}
|
|
1511
|
+
if (!to && dateFns.isBefore(day, from)) {
|
|
1512
|
+
return { from: day, to: from };
|
|
1513
|
+
}
|
|
1514
|
+
if (!to) {
|
|
1515
|
+
return { from: from, to: day };
|
|
1516
|
+
}
|
|
1517
|
+
if (dateFns.isSameDay(to, day) && dateFns.isSameDay(from, day)) {
|
|
1518
|
+
return undefined;
|
|
1519
|
+
}
|
|
1520
|
+
if (dateFns.isSameDay(to, day)) {
|
|
1521
|
+
return { from: to, to: to };
|
|
1522
|
+
}
|
|
1523
|
+
if (dateFns.isSameDay(from, day)) {
|
|
1524
|
+
return undefined;
|
|
1525
|
+
}
|
|
1526
|
+
if (dateFns.isAfter(from, day)) {
|
|
1527
|
+
return { from: day, to: to };
|
|
1528
|
+
}
|
|
1529
|
+
return { from: from, to: day };
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
function SelectRangeProviderInternal(_a) {
|
|
1533
|
+
var initialProps = _a.initialProps, children = _a.children;
|
|
1534
|
+
var _b = useControlledValue(initialProps.defaultSelected, initialProps.selected), selected = _b[0], setSelected = _b[1];
|
|
1535
|
+
var min = initialProps.min;
|
|
1536
|
+
var max = initialProps.max;
|
|
1537
|
+
var handleDayClick = function (day, modifiers, e) {
|
|
1538
|
+
var _a, _b;
|
|
1539
|
+
(_a = initialProps.onDayClick) === null || _a === void 0 ? void 0 : _a.call(initialProps, day, modifiers, e);
|
|
1540
|
+
var newValue = addToRange(day, selected);
|
|
1541
|
+
if ((min || max) &&
|
|
1542
|
+
selected &&
|
|
1543
|
+
(newValue === null || newValue === void 0 ? void 0 : newValue.to) &&
|
|
1544
|
+
newValue.from &&
|
|
1545
|
+
newValue.from !== newValue.to) {
|
|
1546
|
+
var diff = Math.abs(dateFns.differenceInCalendarDays(newValue === null || newValue === void 0 ? void 0 : newValue.to, newValue === null || newValue === void 0 ? void 0 : newValue.from));
|
|
1547
|
+
if (min && diff < min) {
|
|
1548
|
+
return;
|
|
1549
|
+
}
|
|
1550
|
+
if (max && diff >= max) {
|
|
1551
|
+
return;
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
setSelected(newValue);
|
|
1555
|
+
(_b = initialProps.onSelect) === null || _b === void 0 ? void 0 : _b.call(initialProps, newValue, day, modifiers, e);
|
|
1556
|
+
};
|
|
1557
|
+
var modifiers = {
|
|
1558
|
+
selected: [],
|
|
1559
|
+
range_start: [],
|
|
1560
|
+
range_end: [],
|
|
1561
|
+
range_middle: [],
|
|
1562
|
+
disabled: []
|
|
1563
|
+
};
|
|
1564
|
+
if (selected) {
|
|
1565
|
+
modifiers.selected = [selected];
|
|
1566
|
+
if (selected.from) {
|
|
1567
|
+
modifiers.range_start = [selected.from];
|
|
1568
|
+
if (selected.to) {
|
|
1569
|
+
modifiers.range_middle = [
|
|
1570
|
+
{
|
|
1571
|
+
after: selected.from,
|
|
1572
|
+
before: selected.to
|
|
1573
|
+
}
|
|
1574
|
+
];
|
|
1575
|
+
if (max || min) {
|
|
1576
|
+
modifiers.disabled = [
|
|
1577
|
+
function (date) {
|
|
1578
|
+
if (max &&
|
|
1579
|
+
selected.to &&
|
|
1580
|
+
selected.from &&
|
|
1581
|
+
dateFns.isBefore(date, selected.from)) {
|
|
1582
|
+
var diff = dateFns.differenceInCalendarDays(selected.to, date);
|
|
1583
|
+
if (diff >= max) {
|
|
1584
|
+
return true;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
if (max &&
|
|
1588
|
+
selected.to &&
|
|
1589
|
+
selected.from &&
|
|
1590
|
+
dateFns.isAfter(date, selected.to)) {
|
|
1591
|
+
var diff = dateFns.differenceInCalendarDays(date, selected.from);
|
|
1592
|
+
if (diff >= max) {
|
|
1593
|
+
return true;
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
if (min && selected.from && dateFns.isBefore(date, selected.from)) {
|
|
1597
|
+
var diff = dateFns.differenceInCalendarDays(selected.from, date);
|
|
1598
|
+
if (diff < min) {
|
|
1599
|
+
return true;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
if (min &&
|
|
1603
|
+
selected.to &&
|
|
1604
|
+
selected.from &&
|
|
1605
|
+
dateFns.isAfter(date, selected.to)) {
|
|
1606
|
+
var diff = dateFns.differenceInCalendarDays(date, selected.from);
|
|
1607
|
+
if (diff < min) {
|
|
1608
|
+
return true;
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
return false;
|
|
1612
|
+
}
|
|
1613
|
+
];
|
|
1614
|
+
}
|
|
1615
|
+
modifiers.range_end = [selected.to];
|
|
1616
|
+
}
|
|
1617
|
+
else {
|
|
1618
|
+
modifiers.range_end = [selected.from];
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
return (React__namespace.createElement(SelectRangeContext.Provider, { value: { selected: selected, handleDayClick: handleDayClick, modifiers: modifiers } }, children));
|
|
1623
|
+
}
|
|
1624
|
+
/** Provides the values for the [[SelectRangeProvider]]. */
|
|
1625
|
+
function SelectRangeProvider(props) {
|
|
1626
|
+
if (!isDayPickerRange(props.initialProps)) {
|
|
1627
|
+
var emptyContextValue = {
|
|
1628
|
+
selected: undefined,
|
|
1629
|
+
modifiers: {
|
|
1630
|
+
selected: [],
|
|
1631
|
+
range_start: [],
|
|
1632
|
+
range_end: [],
|
|
1633
|
+
range_middle: [],
|
|
1634
|
+
disabled: []
|
|
1635
|
+
}
|
|
1636
|
+
};
|
|
1637
|
+
return (React__namespace.createElement(SelectRangeContext.Provider, { value: emptyContextValue }, props.children));
|
|
1638
|
+
}
|
|
1639
|
+
return (React__namespace.createElement(SelectRangeProviderInternal, { initialProps: props.initialProps, children: props.children }));
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
function SelectSingleProviderInternal(_a) {
|
|
1643
|
+
var initialProps = _a.initialProps, children = _a.children;
|
|
1644
|
+
var _b = useControlledValue(initialProps.defaultSelected, initialProps.selected), selected = _b[0], setSelected = _b[1];
|
|
1645
|
+
var handleDayClick = function (day, dayModifiers, e) {
|
|
1646
|
+
var _a, _b;
|
|
1647
|
+
if (dayModifiers.selected && !initialProps.required) {
|
|
1648
|
+
setSelected(undefined);
|
|
1649
|
+
(_a = initialProps.onSelect) === null || _a === void 0 ? void 0 : _a.call(initialProps, undefined, day, dayModifiers, e);
|
|
1650
|
+
return;
|
|
1651
|
+
}
|
|
1652
|
+
setSelected(day);
|
|
1653
|
+
(_b = initialProps.onSelect) === null || _b === void 0 ? void 0 : _b.call(initialProps, day, day, dayModifiers, e);
|
|
1654
|
+
};
|
|
1655
|
+
var modifiers = { selected: [] };
|
|
1656
|
+
if (selected) {
|
|
1657
|
+
modifiers.selected = [selected];
|
|
1658
|
+
}
|
|
1659
|
+
var contextValue = {
|
|
1660
|
+
selected: selected,
|
|
1661
|
+
handleDayClick: handleDayClick,
|
|
1662
|
+
modifiers: modifiers
|
|
1663
|
+
};
|
|
1664
|
+
return (React__namespace.createElement(SelectSingleContext.Provider, { value: contextValue }, children));
|
|
1665
|
+
}
|
|
1666
|
+
/** Provides the values for the [[SelectSingleProvider]]. */
|
|
1667
|
+
function SelectSingleProvider(props) {
|
|
1668
|
+
if (!isDayPickerSingle(props.initialProps)) {
|
|
1669
|
+
var emptyContextValue = {
|
|
1670
|
+
selected: undefined,
|
|
1671
|
+
modifiers: { selected: [] }
|
|
1672
|
+
};
|
|
1673
|
+
return (React__namespace.createElement(SelectSingleContext.Provider, { value: emptyContextValue }, props.children));
|
|
1674
|
+
}
|
|
1675
|
+
return (React__namespace.createElement(SelectSingleProviderInternal, { initialProps: props.initialProps, children: props.children }));
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
/** Provide the value for all the context providers. */
|
|
1679
|
+
function ContextProvider(props) {
|
|
1680
|
+
var children = props.children, initialProps = __rest(props, ["children"]);
|
|
1681
|
+
return (React__namespace.createElement(DayPickerProvider, { initialProps: initialProps },
|
|
1682
|
+
React__namespace.createElement(NavigationProvider, null,
|
|
1683
|
+
React__namespace.createElement(SelectSingleProvider, { initialProps: initialProps },
|
|
1684
|
+
React__namespace.createElement(SelectMultipleProvider, { initialProps: initialProps },
|
|
1685
|
+
React__namespace.createElement(SelectRangeProvider, { initialProps: initialProps },
|
|
1686
|
+
React__namespace.createElement(FocusProvider, null, children)))))));
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* DayPicker render a date picker component to let users pick dates from a
|
|
1691
|
+
* calendar. See http://react-day-picker.js.org for updated documentation and
|
|
1692
|
+
* examples.
|
|
1693
|
+
*
|
|
1694
|
+
* ### Customization
|
|
1695
|
+
*
|
|
1696
|
+
* DayPicker offers different customization props. For example,
|
|
1697
|
+
*
|
|
1698
|
+
* - show multiple months using `numberOfMonths`
|
|
1699
|
+
* - display a dropdown to navigate the months via `captionLayout`
|
|
1700
|
+
* - display the week numbers with `showWeekNumbers`
|
|
1701
|
+
* - disable or hide days with `disabled` or `hidden`
|
|
1702
|
+
*
|
|
1703
|
+
* ### Controlling the months
|
|
1704
|
+
*
|
|
1705
|
+
* Change the initially displayed month using the `defaultMonth` prop. The
|
|
1706
|
+
* displayed months are controlled by DayPicker and stored in its internal
|
|
1707
|
+
* state. To control the months yourself, use `month` instead of `defaultMonth`
|
|
1708
|
+
* and use the `onMonthChange` event to set it.
|
|
1709
|
+
*
|
|
1710
|
+
* To limit the months the user can navigate to, use
|
|
1711
|
+
* `fromDate`/`fromMonth`/`fromYear` or `toDate`/`toMonth`/`toYear`.
|
|
1712
|
+
*
|
|
1713
|
+
* ### Selection modes
|
|
1714
|
+
*
|
|
1715
|
+
* DayPicker supports different selection mode that can be toggled using the
|
|
1716
|
+
* `mode` prop:
|
|
1717
|
+
*
|
|
1718
|
+
* - `mode="single"`: only one day can be selected. Use `required` to make the
|
|
1719
|
+
* selection required. Use the `onSelect` event handler to get the selected
|
|
1720
|
+
* days.
|
|
1721
|
+
* - `mode="multiple"`: users can select one or more days. Limit the amount of
|
|
1722
|
+
* days that can be selected with the `min` or the `max` props.
|
|
1723
|
+
* - `mode="range"`: users can select a range of days. Limit the amount of days
|
|
1724
|
+
* in the range with the `min` or the `max` props.
|
|
1725
|
+
*
|
|
1726
|
+
* These selection modes should cover the most common use cases. In case you
|
|
1727
|
+
* need a more refined way of selecting days, use `mode="custom"`. Use the
|
|
1728
|
+
* `selected` props and add the day event handlers to add/remove days from the
|
|
1729
|
+
* selection.
|
|
1730
|
+
*
|
|
1731
|
+
* ### Modifiers
|
|
1732
|
+
*
|
|
1733
|
+
* A _modifier_ represents different styles or states for the days displayed in
|
|
1734
|
+
* the calendar (like "selected" or "disabled"). Define custom modifiers using
|
|
1735
|
+
* the `modifiers` prop.
|
|
1736
|
+
*
|
|
1737
|
+
* ### Formatters and custom component
|
|
1738
|
+
*
|
|
1739
|
+
* You can customize how the content is displayed in the date picker by using
|
|
1740
|
+
* either the formatters or replacing the internal components.
|
|
1741
|
+
*
|
|
1742
|
+
* For the most common cases you want to use the `formatters` prop to change how
|
|
1743
|
+
* the content is formatted in the calendar. Use the `components` prop to
|
|
1744
|
+
* replace the internal components, like the navigation icons.
|
|
1745
|
+
*
|
|
1746
|
+
* ### Styling
|
|
1747
|
+
*
|
|
1748
|
+
* DayPicker comes with a default, basic style in `react-day-picker/style` –
|
|
1749
|
+
* use it as template for your own style.
|
|
1750
|
+
*
|
|
1751
|
+
* If you are using CSS modules, pass the imported styles object the
|
|
1752
|
+
* `classNames` props.
|
|
1753
|
+
*
|
|
1754
|
+
* You can also style the elements via inline-styles using the `styles` prop.
|
|
1755
|
+
*
|
|
1756
|
+
* ### Form fields
|
|
1757
|
+
*
|
|
1758
|
+
* If you need to bind the date picker to a form field, you can use the
|
|
1759
|
+
* `useInput` hooks for a basic behavior. See the `useInput` source as an
|
|
1760
|
+
* example to bind the date picker with form fields.
|
|
1761
|
+
*
|
|
1762
|
+
* ### Localization
|
|
1763
|
+
*
|
|
1764
|
+
* To localize DayPicker, import the locale from `date-fns` package and use the
|
|
1765
|
+
* `locale` prop.
|
|
1766
|
+
*
|
|
1767
|
+
* For example, to use Spanish locale:
|
|
1768
|
+
*
|
|
1769
|
+
* ```
|
|
1770
|
+
* import es from 'date-fns/locale/es';
|
|
1771
|
+
* <DayPicker locale={es} />
|
|
1772
|
+
* ```
|
|
1773
|
+
*/
|
|
1774
|
+
function DayPicker(props) {
|
|
1775
|
+
return (React__namespace.createElement(ContextProvider, __assign({}, props),
|
|
1776
|
+
React__namespace.createElement(Root, null)));
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
/** Returns true when the props are of type [[DayPickerCustom]]. */
|
|
1780
|
+
function isDayPickerCustom(props) {
|
|
1781
|
+
return props.mode === 'custom';
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
/** @private */
|
|
1785
|
+
function isValidDate(day) {
|
|
1786
|
+
return !isNaN(day.getTime());
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
var DefaultFormat = 'PP';
|
|
1790
|
+
/** Return props for binding an input field to DayPicker. */
|
|
1791
|
+
function useInput(options) {
|
|
1792
|
+
if (options === void 0) { options = {}; }
|
|
1793
|
+
var _a = options.locale, locale = _a === void 0 ? enUS__default["default"] : _a, required = options.required, _b = options.format, format$1 = _b === void 0 ? DefaultFormat : _b, defaultSelected = options.defaultSelected, _c = options.today, today = _c === void 0 ? new Date() : _c;
|
|
1794
|
+
var _d = parseFromToProps(options), fromDate = _d.fromDate, toDate = _d.toDate;
|
|
1795
|
+
var min = required ? 1 : 0;
|
|
1796
|
+
// Shortcut to the DateFns functions
|
|
1797
|
+
var parseValue = function (value) { return dateFns.parse(value, format$1, today, { locale: locale }); };
|
|
1798
|
+
// Initialize states
|
|
1799
|
+
var _e = React__namespace.useState(defaultSelected !== null && defaultSelected !== void 0 ? defaultSelected : today), month = _e[0], setMonth = _e[1];
|
|
1800
|
+
var _f = React__namespace.useState(defaultSelected), selectedDay = _f[0], setSelectedDay = _f[1];
|
|
1801
|
+
var defaultInputValue = defaultSelected
|
|
1802
|
+
? dateFns.format(defaultSelected, format$1, { locale: locale })
|
|
1803
|
+
: '';
|
|
1804
|
+
var _g = React__namespace.useState(defaultInputValue), inputValue = _g[0], setInputValue = _g[1];
|
|
1805
|
+
var reset = function () {
|
|
1806
|
+
setSelectedDay(defaultSelected);
|
|
1807
|
+
setMonth(defaultSelected !== null && defaultSelected !== void 0 ? defaultSelected : today);
|
|
1808
|
+
setInputValue(defaultInputValue !== null && defaultInputValue !== void 0 ? defaultInputValue : '');
|
|
1809
|
+
};
|
|
1810
|
+
var setSelected = function (date) {
|
|
1811
|
+
setSelectedDay(date);
|
|
1812
|
+
setMonth(date !== null && date !== void 0 ? date : today);
|
|
1813
|
+
setInputValue(date ? dateFns.format(date, format$1, { locale: locale }) : '');
|
|
1814
|
+
};
|
|
1815
|
+
var handleDayClick = function (day, _a) {
|
|
1816
|
+
var selected = _a.selected;
|
|
1817
|
+
if (!required && selected) {
|
|
1818
|
+
setSelectedDay(undefined);
|
|
1819
|
+
setInputValue('');
|
|
1820
|
+
return;
|
|
1821
|
+
}
|
|
1822
|
+
setSelectedDay(day);
|
|
1823
|
+
setInputValue(day ? dateFns.format(day, format$1, { locale: locale }) : '');
|
|
1824
|
+
};
|
|
1825
|
+
var handleMonthChange = function (month) {
|
|
1826
|
+
setMonth(month);
|
|
1827
|
+
};
|
|
1828
|
+
// When changing the input field, save its value in state and check if the
|
|
1829
|
+
// string is a valid date. If it is a valid day, set it as selected and update
|
|
1830
|
+
// the calendar’s month.
|
|
1831
|
+
var handleChange = function (e) {
|
|
1832
|
+
setInputValue(e.target.value);
|
|
1833
|
+
var day = parseValue(e.target.value);
|
|
1834
|
+
var isBefore = fromDate && dateFns.differenceInCalendarDays(fromDate, day) > 0;
|
|
1835
|
+
var isAfter = toDate && dateFns.differenceInCalendarDays(day, toDate) > 0;
|
|
1836
|
+
if (!isValidDate(day) || isBefore || isAfter) {
|
|
1837
|
+
setSelectedDay(undefined);
|
|
1838
|
+
return;
|
|
1839
|
+
}
|
|
1840
|
+
setSelectedDay(day);
|
|
1841
|
+
setMonth(day);
|
|
1842
|
+
};
|
|
1843
|
+
// Special case for _required_ fields: on blur, if the value of the input is not
|
|
1844
|
+
// a valid date, reset the calendar and the input value.
|
|
1845
|
+
var handleBlur = function (e) {
|
|
1846
|
+
var day = parseValue(e.target.value);
|
|
1847
|
+
if (!isValidDate(day)) {
|
|
1848
|
+
reset();
|
|
1849
|
+
}
|
|
1850
|
+
};
|
|
1851
|
+
// When focusing, make sure DayPicker visualizes the month of the date in the
|
|
1852
|
+
// input field.
|
|
1853
|
+
var handleFocus = function (e) {
|
|
1854
|
+
if (!e.target.value) {
|
|
1855
|
+
reset();
|
|
1856
|
+
return;
|
|
1857
|
+
}
|
|
1858
|
+
var day = parseValue(e.target.value);
|
|
1859
|
+
if (isValidDate(day)) {
|
|
1860
|
+
setMonth(day);
|
|
1861
|
+
}
|
|
1862
|
+
};
|
|
1863
|
+
var dayPickerProps = {
|
|
1864
|
+
mode: 'custom',
|
|
1865
|
+
month: month,
|
|
1866
|
+
onDayClick: handleDayClick,
|
|
1867
|
+
onMonthChange: handleMonthChange,
|
|
1868
|
+
selected: selectedDay,
|
|
1869
|
+
locale: locale,
|
|
1870
|
+
fromDate: options === null || options === void 0 ? void 0 : options.fromDate,
|
|
1871
|
+
toDate: options === null || options === void 0 ? void 0 : options.toDate,
|
|
1872
|
+
today: today,
|
|
1873
|
+
min: min
|
|
1874
|
+
};
|
|
1875
|
+
var fieldProps = {
|
|
1876
|
+
onBlur: handleBlur,
|
|
1877
|
+
onChange: handleChange,
|
|
1878
|
+
onFocus: handleFocus,
|
|
1879
|
+
value: inputValue
|
|
1880
|
+
};
|
|
1881
|
+
return { dayPickerProps: dayPickerProps, fieldProps: fieldProps, reset: reset, setSelected: setSelected };
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
exports.Button = Button;
|
|
1885
|
+
exports.Caption = Caption;
|
|
1886
|
+
exports.CaptionLabel = CaptionLabel;
|
|
1887
|
+
exports.ContextProvider = ContextProvider;
|
|
1888
|
+
exports.Day = Day;
|
|
1889
|
+
exports.DayContent = DayContent;
|
|
1890
|
+
exports.DayPicker = DayPicker;
|
|
1891
|
+
exports.Dropdown = Dropdown;
|
|
1892
|
+
exports.FocusContext = FocusContext;
|
|
1893
|
+
exports.FocusProvider = FocusProvider;
|
|
1894
|
+
exports.Footer = Footer;
|
|
1895
|
+
exports.Head = Head;
|
|
1896
|
+
exports.IconDropdown = IconDropdown;
|
|
1897
|
+
exports.IconNext = IconNext;
|
|
1898
|
+
exports.IconPrevious = IconPrevious;
|
|
1899
|
+
exports.MonthsDropdown = MonthsDropdown;
|
|
1900
|
+
exports.Navigation = Navigation;
|
|
1901
|
+
exports.NavigationContext = NavigationContext;
|
|
1902
|
+
exports.NavigationProvider = NavigationProvider;
|
|
1903
|
+
exports.Root = Root;
|
|
1904
|
+
exports.Row = Row;
|
|
1905
|
+
exports.SelectMultipleContext = SelectMultipleContext;
|
|
1906
|
+
exports.SelectMultipleProvider = SelectMultipleProvider;
|
|
1907
|
+
exports.SelectRangeContext = SelectRangeContext;
|
|
1908
|
+
exports.SelectRangeProvider = SelectRangeProvider;
|
|
1909
|
+
exports.SelectRangeProviderInternal = SelectRangeProviderInternal;
|
|
1910
|
+
exports.SelectSingleContext = SelectSingleContext;
|
|
1911
|
+
exports.SelectSingleProvider = SelectSingleProvider;
|
|
1912
|
+
exports.SelectSingleProviderInternal = SelectSingleProviderInternal;
|
|
1913
|
+
exports.Table = Table;
|
|
1914
|
+
exports.WeekNumber = WeekNumber;
|
|
1915
|
+
exports.YearsDropdown = YearsDropdown;
|
|
1916
|
+
exports.isArrayOfDates = isArrayOfDates;
|
|
1917
|
+
exports.isDateAfterType = isDateAfterType;
|
|
1918
|
+
exports.isDateBeforeType = isDateBeforeType;
|
|
1919
|
+
exports.isDateInterval = isDateInterval;
|
|
1920
|
+
exports.isDateRange = isDateRange;
|
|
1921
|
+
exports.isDateType = isDateType;
|
|
1922
|
+
exports.isDayOfWeekType = isDayOfWeekType;
|
|
1923
|
+
exports.isDayPickerCustom = isDayPickerCustom;
|
|
1924
|
+
exports.isDayPickerMultiple = isDayPickerMultiple;
|
|
1925
|
+
exports.isDayPickerRange = isDayPickerRange;
|
|
1926
|
+
exports.isDayPickerSingle = isDayPickerSingle;
|
|
1927
|
+
exports.useDay = useDay;
|
|
1928
|
+
exports.useDayPicker = useDayPicker;
|
|
1929
|
+
exports.useFocus = useFocus;
|
|
1930
|
+
exports.useInput = useInput;
|
|
1931
|
+
exports.useModifiers = useModifiers;
|
|
1932
|
+
exports.useNavigation = useNavigation;
|
|
1933
|
+
exports.useSelectMultiple = useSelectMultiple;
|
|
1934
|
+
exports.useSelectRange = useSelectRange;
|
|
1935
|
+
exports.useSelectSingle = useSelectSingle;
|
|
1936
|
+
//# sourceMappingURL=main.js.map
|