react-day-picker 8.0.0-beta.36 → 8.0.0-beta.39
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 +20 -0
- package/{build → dist}/DayPicker.d.ts +0 -1
- package/dist/components/Button/Button.d.ts +7 -0
- package/{build → dist}/components/Button/index.d.ts +0 -0
- package/{build → dist}/components/Caption/Caption.d.ts +0 -1
- package/{build → dist}/components/Caption/index.d.ts +0 -0
- package/{build → dist}/components/CaptionLabel/CaptionLabel.d.ts +0 -1
- package/{build → dist}/components/CaptionLabel/index.d.ts +0 -0
- package/{build → dist}/components/Day/Day.d.ts +0 -1
- package/dist/components/Day/index.d.ts +1 -0
- package/{build → dist}/components/DayContent/DayContent.d.ts +3 -4
- package/{build → dist}/components/DayContent/index.d.ts +0 -0
- package/{build → dist}/components/Dropdown/Dropdown.d.ts +1 -1
- package/{build → dist}/components/Dropdown/index.d.ts +0 -0
- package/{build → dist}/components/Footer/Footer.d.ts +0 -1
- package/{build → dist}/components/Footer/index.d.ts +0 -0
- package/{build → dist}/components/Head/Head.d.ts +0 -1
- package/{build → dist}/components/Head/index.d.ts +0 -0
- package/{build → dist}/components/Head/utils/getWeekdays.d.ts +0 -0
- package/{build → dist}/components/Head/utils/index.d.ts +0 -0
- package/{build → dist}/components/IconDropdown/IconDropdown.d.ts +0 -1
- package/{build → dist}/components/IconDropdown/index.d.ts +0 -0
- package/{build → dist}/components/IconLeft/IconLeft.d.ts +0 -1
- package/{build → dist}/components/IconLeft/index.d.ts +0 -0
- package/{build → dist}/components/IconRight/IconRight.d.ts +0 -1
- package/{build → dist}/components/IconRight/index.d.ts +0 -0
- package/{build → dist}/components/Month/Month.d.ts +0 -1
- package/{build → dist}/components/Month/index.d.ts +0 -0
- package/{build → dist}/components/MonthsDropdown/MonthsDropdown.d.ts +1 -4
- package/{build → dist}/components/MonthsDropdown/index.d.ts +0 -0
- package/{build → dist}/components/Navigation/Navigation.d.ts +0 -0
- package/{build → dist}/components/Navigation/index.d.ts +0 -0
- package/dist/components/Root/Root.d.ts +2 -0
- package/{build → dist}/components/Root/index.d.ts +0 -0
- package/{build → dist}/components/Row/Row.d.ts +1 -4
- package/{build → dist}/components/Row/index.d.ts +0 -0
- package/{build → dist}/components/Table/Table.d.ts +2 -7
- package/{build → dist}/components/Table/index.d.ts +0 -0
- package/dist/components/Table/utils/daysToMonthWeeks.d.ts +8 -0
- package/dist/components/Table/utils/getMonthWeeks.d.ts +21 -0
- package/{build → dist}/components/WeekNumber/WeekNumber.d.ts +0 -1
- package/{build → dist}/components/WeekNumber/index.d.ts +0 -0
- package/{build → dist}/components/YearsDropdown/YearsDropdown.d.ts +0 -1
- package/{build → dist}/components/YearsDropdown/index.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/DayPickerContext.d.ts +9 -12
- package/{build → dist}/contexts/DayPicker/defaultClassNames.d.ts +0 -0
- package/dist/contexts/DayPicker/defaultContextValue.d.ts +6 -0
- package/{build → dist}/contexts/DayPicker/formatters/formatCaption.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/formatters/formatDay.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/formatters/formatMonthCaption.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/formatters/formatWeekNumber.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/formatters/formatWeekdayName.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/formatters/formatYearCaption.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/formatters/index.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/index.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/labels/index.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/labels/labelDay.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/labels/labelMonthDropdown.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/labels/labelNext.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/labels/labelPrevious.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/labels/labelWeekNumber.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/labels/labelWeekday.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/labels/labelYearDropdown.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/useDayPicker.d.ts +1 -1
- package/{build → dist}/contexts/DayPicker/utils/index.d.ts +0 -0
- package/{build → dist}/contexts/DayPicker/utils/parseFromToProps.d.ts +1 -4
- package/{build → dist}/contexts/Focus/FocusContext.d.ts +10 -10
- package/dist/contexts/Focus/index.d.ts +2 -0
- package/{build/contexts/Focus/useFocus.d.ts → dist/contexts/Focus/useFocusContext.d.ts} +1 -1
- package/dist/contexts/Focus/utils/getInitialFocusTarget.d.ts +3 -0
- package/{build → dist}/contexts/Modifiers/ModifiersContext.d.ts +2 -2
- package/dist/contexts/Modifiers/index.d.ts +2 -0
- package/dist/contexts/Modifiers/useModifiers.d.ts +6 -0
- package/dist/contexts/Modifiers/utils/getActiveModifiers.d.ts +7 -0
- package/dist/contexts/Modifiers/utils/getCustomModifiers.d.ts +3 -0
- package/{build → dist}/contexts/Modifiers/utils/getInternalModifiers.d.ts +0 -0
- package/{build/hooks/useDayModifiers → dist/contexts/Modifiers}/utils/isDateInRange.d.ts +1 -1
- package/dist/contexts/Modifiers/utils/isMatch.d.ts +19 -0
- package/dist/contexts/Modifiers/utils/matcherToArray.d.ts +3 -0
- package/{build → dist}/contexts/Navigation/NavigationContext.d.ts +9 -5
- package/{build → dist}/contexts/Navigation/index.d.ts +0 -0
- package/{build → dist}/contexts/Navigation/useNavigation.d.ts +0 -0
- package/{build → dist}/contexts/Navigation/useNavigationState.d.ts +0 -0
- package/{build → dist}/contexts/Navigation/utils/getDisplayMonths.d.ts +0 -0
- package/{build → dist}/contexts/Navigation/utils/getInitialMonth.d.ts +0 -0
- package/{build → dist}/contexts/Navigation/utils/getNextMonth.d.ts +0 -0
- package/{build → dist}/contexts/Navigation/utils/getPreviousMonth.d.ts +0 -0
- package/{build → dist}/contexts/RootProvider.d.ts +0 -0
- package/{build → dist}/contexts/SelectMultiple/SelectMultipleContext.d.ts +5 -5
- package/{build → dist}/contexts/SelectMultiple/index.d.ts +0 -0
- package/{build → dist}/contexts/SelectMultiple/useSelectMultiple.d.ts +0 -0
- package/{build → dist}/contexts/SelectRange/SelectRangeContext.d.ts +5 -5
- package/{build → dist}/contexts/SelectRange/index.d.ts +0 -0
- package/{build → dist}/contexts/SelectRange/useSelectRange.d.ts +0 -0
- package/{build → dist}/contexts/SelectRange/utils/addToRange.d.ts +0 -0
- package/{build → dist}/contexts/SelectSingle/SelectSingleContext.d.ts +0 -0
- package/{build → dist}/contexts/SelectSingle/index.d.ts +0 -0
- package/{build → dist}/contexts/SelectSingle/useSelectSingle.d.ts +0 -0
- package/dist/hooks/useActiveModifiers/index.d.ts +1 -0
- package/dist/hooks/useActiveModifiers/useActiveModifiers.d.ts +9 -0
- package/{build → dist}/hooks/useControlledValue/index.d.ts +0 -0
- package/{build → dist}/hooks/useControlledValue/useControlledValue.d.ts +0 -0
- package/dist/hooks/useDayEventHandlers/index.d.ts +1 -0
- package/dist/hooks/useDayEventHandlers/useDayEventHandlers.d.ts +28 -0
- package/dist/hooks/useDayRender/index.d.ts +1 -0
- package/dist/hooks/useDayRender/useDayRender.d.ts +39 -0
- package/dist/hooks/useDayRender/utils/getDayClassNames.d.ts +4 -0
- package/dist/hooks/useDayRender/utils/getDayStyle.d.ts +5 -0
- package/{build → dist}/hooks/useInput/index.d.ts +0 -0
- package/{build → dist}/hooks/useInput/useInput.d.ts +0 -0
- package/{build → dist}/hooks/useInput/utils/isValidDate.d.ts +0 -0
- package/dist/hooks/useSelectedDays/index.d.ts +1 -0
- package/dist/hooks/useSelectedDays/useSelectedDays.d.ts +8 -0
- package/{build → dist}/index.d.ts +3 -0
- package/dist/index.esm.js +2174 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2231 -38
- package/dist/index.js.map +1 -1
- package/dist/react-day-picker.min.js +1 -0
- package/{style.css → dist/style.css} +0 -0
- package/dist/style.css.d.ts +38 -0
- package/{build → dist}/types/DayPicker.d.ts +44 -36
- package/{build → dist}/types/DayPickerCustom.d.ts +0 -0
- package/{build → dist}/types/DayPickerMultiple.d.ts +0 -0
- package/{build → dist}/types/DayPickerRange.d.ts +0 -0
- package/{build → dist}/types/DayPickerSingle.d.ts +0 -0
- package/{build → dist}/types/EventHandlers.d.ts +9 -9
- package/{build → dist}/types/Formatters.d.ts +0 -0
- package/{build → dist}/types/Labels.d.ts +2 -2
- package/dist/types/Matchers.d.ts +84 -0
- package/{build → dist}/types/Modifiers.d.ts +25 -12
- package/{build → dist}/types/Styles.d.ts +1 -4
- package/package.json +40 -30
- package/build/DayPicker.js +0 -95
- package/build/DayPicker.js.map +0 -1
- package/build/components/Button/Button.d.ts +0 -7
- package/build/components/Button/Button.js +0 -20
- package/build/components/Button/Button.js.map +0 -1
- package/build/components/Button/index.js +0 -2
- package/build/components/Button/index.js.map +0 -1
- package/build/components/Caption/Caption.js +0 -62
- package/build/components/Caption/Caption.js.map +0 -1
- package/build/components/Caption/index.js +0 -2
- package/build/components/Caption/index.js.map +0 -1
- package/build/components/CaptionLabel/CaptionLabel.js +0 -8
- package/build/components/CaptionLabel/CaptionLabel.js.map +0 -1
- package/build/components/CaptionLabel/index.js +0 -2
- package/build/components/CaptionLabel/index.js.map +0 -1
- package/build/components/Day/Day.js +0 -21
- package/build/components/Day/Day.js.map +0 -1
- package/build/components/Day/hooks/index.d.ts +0 -1
- package/build/components/Day/hooks/index.js +0 -2
- package/build/components/Day/hooks/index.js.map +0 -1
- package/build/components/Day/hooks/useDay.d.ts +0 -60
- package/build/components/Day/hooks/useDay.js +0 -169
- package/build/components/Day/hooks/useDay.js.map +0 -1
- package/build/components/Day/hooks/useDayFocus.d.ts +0 -8
- package/build/components/Day/hooks/useDayFocus.js +0 -65
- package/build/components/Day/hooks/useDayFocus.js.map +0 -1
- package/build/components/Day/index.d.ts +0 -2
- package/build/components/Day/index.js +0 -3
- package/build/components/Day/index.js.map +0 -1
- package/build/components/DayContent/DayContent.js +0 -12
- package/build/components/DayContent/DayContent.js.map +0 -1
- package/build/components/DayContent/index.js +0 -2
- package/build/components/DayContent/index.js.map +0 -1
- package/build/components/Dropdown/Dropdown.js +0 -17
- package/build/components/Dropdown/Dropdown.js.map +0 -1
- package/build/components/Dropdown/index.js +0 -2
- package/build/components/Dropdown/index.js.map +0 -1
- package/build/components/Footer/Footer.js +0 -12
- package/build/components/Footer/Footer.js.map +0 -1
- package/build/components/Footer/index.js +0 -2
- package/build/components/Footer/index.js.map +0 -1
- package/build/components/Head/Head.js +0 -17
- package/build/components/Head/Head.js.map +0 -1
- package/build/components/Head/index.js +0 -2
- package/build/components/Head/index.js.map +0 -1
- package/build/components/Head/utils/getWeekdays.js +0 -15
- package/build/components/Head/utils/getWeekdays.js.map +0 -1
- package/build/components/Head/utils/index.js +0 -2
- package/build/components/Head/utils/index.js.map +0 -1
- package/build/components/IconDropdown/IconDropdown.js +0 -10
- package/build/components/IconDropdown/IconDropdown.js.map +0 -1
- package/build/components/IconDropdown/index.js +0 -2
- package/build/components/IconDropdown/index.js.map +0 -1
- package/build/components/IconLeft/IconLeft.js +0 -10
- package/build/components/IconLeft/IconLeft.js.map +0 -1
- package/build/components/IconLeft/index.js +0 -2
- package/build/components/IconLeft/index.js.map +0 -1
- package/build/components/IconRight/IconRight.js +0 -10
- package/build/components/IconRight/IconRight.js.map +0 -1
- package/build/components/IconRight/index.js +0 -2
- package/build/components/IconRight/index.js.map +0 -1
- package/build/components/Month/Month.js +0 -37
- package/build/components/Month/Month.js.map +0 -1
- package/build/components/Month/index.js +0 -2
- package/build/components/Month/index.js.map +0 -1
- package/build/components/MonthsDropdown/MonthsDropdown.js +0 -36
- package/build/components/MonthsDropdown/MonthsDropdown.js.map +0 -1
- package/build/components/MonthsDropdown/index.js +0 -2
- package/build/components/MonthsDropdown/index.js.map +0 -1
- package/build/components/Navigation/Navigation.js +0 -30
- package/build/components/Navigation/Navigation.js.map +0 -1
- package/build/components/Navigation/index.js +0 -2
- package/build/components/Navigation/index.js.map +0 -1
- package/build/components/Root/Root.d.ts +0 -6
- package/build/components/Root/Root.js +0 -32
- package/build/components/Root/Root.js.map +0 -1
- package/build/components/Root/index.js +0 -2
- package/build/components/Root/index.js.map +0 -1
- package/build/components/Row/Row.js +0 -19
- package/build/components/Row/Row.js.map +0 -1
- package/build/components/Row/index.js +0 -2
- package/build/components/Row/index.js.map +0 -1
- package/build/components/Table/Table.js +0 -15
- package/build/components/Table/Table.js.map +0 -1
- package/build/components/Table/index.js +0 -2
- package/build/components/Table/index.js.map +0 -1
- package/build/components/Table/utils/getOutsideEndDays.d.ts +0 -3
- package/build/components/Table/utils/getOutsideEndDays.js +0 -12
- package/build/components/Table/utils/getOutsideEndDays.js.map +0 -1
- package/build/components/Table/utils/getOutsideStartDays.d.ts +0 -4
- package/build/components/Table/utils/getOutsideStartDays.js +0 -12
- package/build/components/Table/utils/getOutsideStartDays.js.map +0 -1
- package/build/components/Table/utils/getWeeks.d.ts +0 -17
- package/build/components/Table/utils/getWeeks.js +0 -47
- package/build/components/Table/utils/getWeeks.js.map +0 -1
- package/build/components/WeekNumber/WeekNumber.js +0 -21
- package/build/components/WeekNumber/WeekNumber.js.map +0 -1
- package/build/components/WeekNumber/index.js +0 -2
- package/build/components/WeekNumber/index.js.map +0 -1
- package/build/components/YearsDropdown/YearsDropdown.js +0 -25
- package/build/components/YearsDropdown/YearsDropdown.js.map +0 -1
- package/build/components/YearsDropdown/index.js +0 -2
- package/build/components/YearsDropdown/index.js.map +0 -1
- package/build/contexts/DayPicker/DayPickerContext.js +0 -55
- package/build/contexts/DayPicker/DayPickerContext.js.map +0 -1
- package/build/contexts/DayPicker/defaultClassNames.js +0 -40
- package/build/contexts/DayPicker/defaultClassNames.js.map +0 -1
- package/build/contexts/DayPicker/formatters/formatCaption.js +0 -8
- package/build/contexts/DayPicker/formatters/formatCaption.js.map +0 -1
- package/build/contexts/DayPicker/formatters/formatDay.js +0 -8
- package/build/contexts/DayPicker/formatters/formatDay.js.map +0 -1
- package/build/contexts/DayPicker/formatters/formatMonthCaption.js +0 -8
- package/build/contexts/DayPicker/formatters/formatMonthCaption.js.map +0 -1
- package/build/contexts/DayPicker/formatters/formatWeekNumber.js +0 -7
- package/build/contexts/DayPicker/formatters/formatWeekNumber.js.map +0 -1
- package/build/contexts/DayPicker/formatters/formatWeekdayName.js +0 -8
- package/build/contexts/DayPicker/formatters/formatWeekdayName.js.map +0 -1
- package/build/contexts/DayPicker/formatters/formatYearCaption.js +0 -8
- package/build/contexts/DayPicker/formatters/formatYearCaption.js.map +0 -1
- package/build/contexts/DayPicker/formatters/index.js +0 -7
- package/build/contexts/DayPicker/formatters/index.js.map +0 -1
- package/build/contexts/DayPicker/index.js +0 -3
- package/build/contexts/DayPicker/index.js.map +0 -1
- package/build/contexts/DayPicker/labels/index.js +0 -8
- package/build/contexts/DayPicker/labels/index.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelDay.js +0 -8
- package/build/contexts/DayPicker/labels/labelDay.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelMonthDropdown.js +0 -7
- package/build/contexts/DayPicker/labels/labelMonthDropdown.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelNext.js +0 -7
- package/build/contexts/DayPicker/labels/labelNext.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelPrevious.js +0 -7
- package/build/contexts/DayPicker/labels/labelPrevious.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelWeekNumber.js +0 -7
- package/build/contexts/DayPicker/labels/labelWeekNumber.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelWeekday.js +0 -8
- package/build/contexts/DayPicker/labels/labelWeekday.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelYearDropdown.js +0 -7
- package/build/contexts/DayPicker/labels/labelYearDropdown.js.map +0 -1
- package/build/contexts/DayPicker/useDayPicker.js +0 -16
- package/build/contexts/DayPicker/useDayPicker.js.map +0 -1
- package/build/contexts/DayPicker/utils/index.js +0 -2
- package/build/contexts/DayPicker/utils/index.js.map +0 -1
- package/build/contexts/DayPicker/utils/parseFromToProps.js +0 -26
- package/build/contexts/DayPicker/utils/parseFromToProps.js.map +0 -1
- package/build/contexts/Focus/FocusContext.js +0 -131
- package/build/contexts/Focus/FocusContext.js.map +0 -1
- package/build/contexts/Focus/getInitialFocusTarget.d.ts +0 -10
- package/build/contexts/Focus/getInitialFocusTarget.js +0 -44
- package/build/contexts/Focus/getInitialFocusTarget.js.map +0 -1
- package/build/contexts/Focus/index.d.ts +0 -2
- package/build/contexts/Focus/index.js +0 -3
- package/build/contexts/Focus/index.js.map +0 -1
- package/build/contexts/Focus/useFocus.js +0 -11
- package/build/contexts/Focus/useFocus.js.map +0 -1
- package/build/contexts/Modifiers/ModifiersContext.js +0 -20
- package/build/contexts/Modifiers/ModifiersContext.js.map +0 -1
- package/build/contexts/Modifiers/index.d.ts +0 -2
- package/build/contexts/Modifiers/index.js +0 -3
- package/build/contexts/Modifiers/index.js.map +0 -1
- package/build/contexts/Modifiers/useModifiers.d.ts +0 -3
- package/build/contexts/Modifiers/useModifiers.js +0 -11
- package/build/contexts/Modifiers/useModifiers.js.map +0 -1
- package/build/contexts/Modifiers/utils/getCustomModifiers.d.ts +0 -4
- package/build/contexts/Modifiers/utils/getCustomModifiers.js +0 -11
- package/build/contexts/Modifiers/utils/getCustomModifiers.js.map +0 -1
- package/build/contexts/Modifiers/utils/getInternalModifiers.js +0 -34
- package/build/contexts/Modifiers/utils/getInternalModifiers.js.map +0 -1
- package/build/contexts/Modifiers/utils/toMatcherArray.d.ts +0 -2
- package/build/contexts/Modifiers/utils/toMatcherArray.js +0 -12
- package/build/contexts/Modifiers/utils/toMatcherArray.js.map +0 -1
- package/build/contexts/Navigation/NavigationContext.js +0 -28
- package/build/contexts/Navigation/NavigationContext.js.map +0 -1
- package/build/contexts/Navigation/index.js +0 -3
- package/build/contexts/Navigation/index.js.map +0 -1
- package/build/contexts/Navigation/useNavigation.js +0 -11
- package/build/contexts/Navigation/useNavigation.js.map +0 -1
- package/build/contexts/Navigation/useNavigationState.js +0 -16
- package/build/contexts/Navigation/useNavigationState.js.map +0 -1
- package/build/contexts/Navigation/utils/getDisplayMonths.js +0 -20
- package/build/contexts/Navigation/utils/getDisplayMonths.js.map +0 -1
- package/build/contexts/Navigation/utils/getInitialMonth.js +0 -18
- package/build/contexts/Navigation/utils/getInitialMonth.js.map +0 -1
- package/build/contexts/Navigation/utils/getNextMonth.js +0 -29
- package/build/contexts/Navigation/utils/getNextMonth.js.map +0 -1
- package/build/contexts/Navigation/utils/getPreviousMonth.js +0 -30
- package/build/contexts/Navigation/utils/getPreviousMonth.js.map +0 -1
- package/build/contexts/RootProvider.js +0 -21
- package/build/contexts/RootProvider.js.map +0 -1
- package/build/contexts/SelectMultiple/SelectMultipleContext.js +0 -76
- package/build/contexts/SelectMultiple/SelectMultipleContext.js.map +0 -1
- package/build/contexts/SelectMultiple/index.js +0 -3
- package/build/contexts/SelectMultiple/index.js.map +0 -1
- package/build/contexts/SelectMultiple/useSelectMultiple.js +0 -11
- package/build/contexts/SelectMultiple/useSelectMultiple.js.map +0 -1
- package/build/contexts/SelectRange/SelectRangeContext.js +0 -117
- package/build/contexts/SelectRange/SelectRangeContext.js.map +0 -1
- package/build/contexts/SelectRange/index.js +0 -3
- package/build/contexts/SelectRange/index.js.map +0 -1
- package/build/contexts/SelectRange/useSelectRange.js +0 -11
- package/build/contexts/SelectRange/useSelectRange.js.map +0 -1
- package/build/contexts/SelectRange/utils/addToRange.js +0 -36
- package/build/contexts/SelectRange/utils/addToRange.js.map +0 -1
- package/build/contexts/SelectSingle/SelectSingleContext.js +0 -36
- package/build/contexts/SelectSingle/SelectSingleContext.js.map +0 -1
- package/build/contexts/SelectSingle/index.js +0 -3
- package/build/contexts/SelectSingle/index.js.map +0 -1
- package/build/contexts/SelectSingle/useSelectSingle.js +0 -11
- package/build/contexts/SelectSingle/useSelectSingle.js.map +0 -1
- package/build/hooks/useControlledValue/index.js +0 -2
- package/build/hooks/useControlledValue/index.js.map +0 -1
- package/build/hooks/useControlledValue/useControlledValue.js +0 -16
- package/build/hooks/useControlledValue/useControlledValue.js.map +0 -1
- package/build/hooks/useDayModifiers/index.d.ts +0 -1
- package/build/hooks/useDayModifiers/index.js +0 -2
- package/build/hooks/useDayModifiers/index.js.map +0 -1
- package/build/hooks/useDayModifiers/useDayModifiers.d.ts +0 -12
- package/build/hooks/useDayModifiers/useDayModifiers.js +0 -34
- package/build/hooks/useDayModifiers/useDayModifiers.js.map +0 -1
- package/build/hooks/useDayModifiers/utils/getModifierStatus.d.ts +0 -7
- package/build/hooks/useDayModifiers/utils/getModifierStatus.js +0 -19
- package/build/hooks/useDayModifiers/utils/getModifierStatus.js.map +0 -1
- package/build/hooks/useDayModifiers/utils/isDateInRange.js +0 -22
- package/build/hooks/useDayModifiers/utils/isDateInRange.js.map +0 -1
- package/build/hooks/useDayModifiers/utils/isMatch.d.ts +0 -5
- package/build/hooks/useDayModifiers/utils/isMatch.js +0 -49
- package/build/hooks/useDayModifiers/utils/isMatch.js.map +0 -1
- package/build/hooks/useInput/index.js +0 -2
- package/build/hooks/useInput/index.js.map +0 -1
- package/build/hooks/useInput/useInput.js +0 -98
- package/build/hooks/useInput/useInput.js.map +0 -1
- package/build/hooks/useInput/utils/isValidDate.js +0 -5
- package/build/hooks/useInput/utils/isValidDate.js.map +0 -1
- package/build/index.js +0 -35
- package/build/index.js.map +0 -1
- package/build/types/DayPicker.js +0 -2
- package/build/types/DayPicker.js.map +0 -1
- package/build/types/DayPickerCustom.js +0 -5
- package/build/types/DayPickerCustom.js.map +0 -1
- package/build/types/DayPickerMultiple.js +0 -5
- package/build/types/DayPickerMultiple.js.map +0 -1
- package/build/types/DayPickerRange.js +0 -5
- package/build/types/DayPickerRange.js.map +0 -1
- package/build/types/DayPickerSingle.js +0 -5
- package/build/types/DayPickerSingle.js.map +0 -1
- package/build/types/EventHandlers.js +0 -2
- package/build/types/EventHandlers.js.map +0 -1
- package/build/types/Formatters.js +0 -2
- package/build/types/Formatters.js.map +0 -1
- package/build/types/Labels.js +0 -2
- package/build/types/Labels.js.map +0 -1
- package/build/types/Matchers.d.ts +0 -34
- package/build/types/Matchers.js +0 -25
- package/build/types/Matchers.js.map +0 -1
- package/build/types/Modifiers.js +0 -19
- package/build/types/Modifiers.js.map +0 -1
- package/build/types/Styles.js +0 -2
- package/build/types/Styles.js.map +0 -1
- package/dist/DayPicker.js +0 -99
- package/dist/DayPicker.js.map +0 -1
- package/dist/components/Button/Button.js +0 -23
- package/dist/components/Button/Button.js.map +0 -1
- package/dist/components/Button/index.js +0 -5
- package/dist/components/Button/index.js.map +0 -1
- package/dist/components/Caption/Caption.js +0 -67
- package/dist/components/Caption/Caption.js.map +0 -1
- package/dist/components/Caption/index.js +0 -5
- package/dist/components/Caption/index.js.map +0 -1
- package/dist/components/CaptionLabel/CaptionLabel.js +0 -13
- package/dist/components/CaptionLabel/CaptionLabel.js.map +0 -1
- package/dist/components/CaptionLabel/index.js +0 -5
- package/dist/components/CaptionLabel/index.js.map +0 -1
- package/dist/components/Day/Day.js +0 -25
- package/dist/components/Day/Day.js.map +0 -1
- package/dist/components/Day/hooks/index.js +0 -5
- package/dist/components/Day/hooks/index.js.map +0 -1
- package/dist/components/Day/hooks/useDay.js +0 -173
- package/dist/components/Day/hooks/useDay.js.map +0 -1
- package/dist/components/Day/hooks/useDayFocus.js +0 -70
- package/dist/components/Day/hooks/useDayFocus.js.map +0 -1
- package/dist/components/Day/index.js +0 -6
- package/dist/components/Day/index.js.map +0 -1
- package/dist/components/DayContent/DayContent.js +0 -17
- package/dist/components/DayContent/DayContent.js.map +0 -1
- package/dist/components/DayContent/index.js +0 -5
- package/dist/components/DayContent/index.js.map +0 -1
- package/dist/components/Dropdown/Dropdown.js +0 -22
- package/dist/components/Dropdown/Dropdown.js.map +0 -1
- package/dist/components/Dropdown/index.js +0 -5
- package/dist/components/Dropdown/index.js.map +0 -1
- package/dist/components/Footer/Footer.js +0 -17
- package/dist/components/Footer/Footer.js.map +0 -1
- package/dist/components/Footer/index.js +0 -5
- package/dist/components/Footer/index.js.map +0 -1
- package/dist/components/Head/Head.js +0 -22
- package/dist/components/Head/Head.js.map +0 -1
- package/dist/components/Head/index.js +0 -5
- 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/index.js +0 -5
- package/dist/components/Head/utils/index.js.map +0 -1
- package/dist/components/IconDropdown/IconDropdown.js +0 -14
- package/dist/components/IconDropdown/IconDropdown.js.map +0 -1
- package/dist/components/IconDropdown/index.js +0 -5
- package/dist/components/IconDropdown/index.js.map +0 -1
- package/dist/components/IconLeft/IconLeft.js +0 -14
- package/dist/components/IconLeft/IconLeft.js.map +0 -1
- package/dist/components/IconLeft/index.js +0 -5
- package/dist/components/IconLeft/index.js.map +0 -1
- package/dist/components/IconRight/IconRight.js +0 -14
- package/dist/components/IconRight/IconRight.js.map +0 -1
- package/dist/components/IconRight/index.js +0 -5
- package/dist/components/IconRight/index.js.map +0 -1
- package/dist/components/Month/Month.js +0 -41
- package/dist/components/Month/Month.js.map +0 -1
- package/dist/components/Month/index.js +0 -5
- package/dist/components/Month/index.js.map +0 -1
- package/dist/components/MonthsDropdown/MonthsDropdown.js +0 -41
- package/dist/components/MonthsDropdown/MonthsDropdown.js.map +0 -1
- package/dist/components/MonthsDropdown/index.js +0 -5
- package/dist/components/MonthsDropdown/index.js.map +0 -1
- package/dist/components/Navigation/Navigation.js +0 -35
- package/dist/components/Navigation/Navigation.js.map +0 -1
- package/dist/components/Navigation/index.js +0 -5
- package/dist/components/Navigation/index.js.map +0 -1
- package/dist/components/Root/Root.js +0 -36
- package/dist/components/Root/Root.js.map +0 -1
- package/dist/components/Root/index.js +0 -5
- package/dist/components/Root/index.js.map +0 -1
- package/dist/components/Row/Row.js +0 -24
- package/dist/components/Row/Row.js.map +0 -1
- package/dist/components/Row/index.js +0 -5
- package/dist/components/Row/index.js.map +0 -1
- package/dist/components/Table/Table.js +0 -20
- package/dist/components/Table/Table.js.map +0 -1
- package/dist/components/Table/index.js +0 -5
- 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 -51
- package/dist/components/Table/utils/getWeeks.js.map +0 -1
- package/dist/components/WeekNumber/WeekNumber.js +0 -26
- package/dist/components/WeekNumber/WeekNumber.js.map +0 -1
- package/dist/components/WeekNumber/index.js +0 -5
- package/dist/components/WeekNumber/index.js.map +0 -1
- package/dist/components/YearsDropdown/YearsDropdown.js +0 -30
- package/dist/components/YearsDropdown/YearsDropdown.js.map +0 -1
- package/dist/components/YearsDropdown/index.js +0 -5
- package/dist/components/YearsDropdown/index.js.map +0 -1
- package/dist/contexts/DayPicker/DayPickerContext.js +0 -57
- package/dist/contexts/DayPicker/DayPickerContext.js.map +0 -1
- package/dist/contexts/DayPicker/DayPickerProvider.js +0 -49
- package/dist/contexts/DayPicker/DayPickerProvider.js.map +0 -1
- package/dist/contexts/DayPicker/defaultClassNames.js +0 -43
- package/dist/contexts/DayPicker/defaultClassNames.js.map +0 -1
- package/dist/contexts/DayPicker/defaultContextValues.js +0 -65
- package/dist/contexts/DayPicker/defaultContextValues.js.map +0 -1
- package/dist/contexts/DayPicker/formatters/formatCaption.js +0 -12
- package/dist/contexts/DayPicker/formatters/formatCaption.js.map +0 -1
- package/dist/contexts/DayPicker/formatters/formatDay.js +0 -12
- package/dist/contexts/DayPicker/formatters/formatDay.js.map +0 -1
- package/dist/contexts/DayPicker/formatters/formatMonthCaption.js +0 -12
- package/dist/contexts/DayPicker/formatters/formatMonthCaption.js.map +0 -1
- package/dist/contexts/DayPicker/formatters/formatWeekNumber.js +0 -11
- package/dist/contexts/DayPicker/formatters/formatWeekNumber.js.map +0 -1
- package/dist/contexts/DayPicker/formatters/formatWeekdayName.js +0 -12
- package/dist/contexts/DayPicker/formatters/formatWeekdayName.js.map +0 -1
- package/dist/contexts/DayPicker/formatters/formatYearCaption.js +0 -12
- package/dist/contexts/DayPicker/formatters/formatYearCaption.js.map +0 -1
- package/dist/contexts/DayPicker/formatters/index.js +0 -10
- package/dist/contexts/DayPicker/formatters/index.js.map +0 -1
- package/dist/contexts/DayPicker/index.js +0 -6
- package/dist/contexts/DayPicker/index.js.map +0 -1
- package/dist/contexts/DayPicker/labels/index.js +0 -11
- package/dist/contexts/DayPicker/labels/index.js.map +0 -1
- package/dist/contexts/DayPicker/labels/labelDay.js +0 -12
- package/dist/contexts/DayPicker/labels/labelDay.js.map +0 -1
- package/dist/contexts/DayPicker/labels/labelMonthDropdown.js +0 -11
- package/dist/contexts/DayPicker/labels/labelMonthDropdown.js.map +0 -1
- package/dist/contexts/DayPicker/labels/labelNext.js +0 -11
- package/dist/contexts/DayPicker/labels/labelNext.js.map +0 -1
- package/dist/contexts/DayPicker/labels/labelPrevious.js +0 -11
- package/dist/contexts/DayPicker/labels/labelPrevious.js.map +0 -1
- package/dist/contexts/DayPicker/labels/labelWeekNumber.js +0 -11
- package/dist/contexts/DayPicker/labels/labelWeekNumber.js.map +0 -1
- package/dist/contexts/DayPicker/labels/labelWeekday.js +0 -12
- package/dist/contexts/DayPicker/labels/labelWeekday.js.map +0 -1
- package/dist/contexts/DayPicker/labels/labelYearDropdown.js +0 -11
- package/dist/contexts/DayPicker/labels/labelYearDropdown.js.map +0 -1
- package/dist/contexts/DayPicker/useDayPicker.js +0 -21
- package/dist/contexts/DayPicker/useDayPicker.js.map +0 -1
- package/dist/contexts/DayPicker/utils/index.js +0 -5
- package/dist/contexts/DayPicker/utils/index.js.map +0 -1
- package/dist/contexts/DayPicker/utils/parseFromToProps.js +0 -30
- package/dist/contexts/DayPicker/utils/parseFromToProps.js.map +0 -1
- package/dist/contexts/Focus/FocusContext.js +0 -136
- package/dist/contexts/Focus/FocusContext.js.map +0 -1
- package/dist/contexts/Focus/getInitialFocusTarget.js +0 -48
- package/dist/contexts/Focus/getInitialFocusTarget.js.map +0 -1
- package/dist/contexts/Focus/index.js +0 -6
- package/dist/contexts/Focus/index.js.map +0 -1
- package/dist/contexts/Focus/useFocus.js +0 -16
- package/dist/contexts/Focus/useFocus.js.map +0 -1
- package/dist/contexts/Modifiers/ModifiersContext.js +0 -65
- package/dist/contexts/Modifiers/ModifiersContext.js.map +0 -1
- package/dist/contexts/Modifiers/index.js +0 -6
- package/dist/contexts/Modifiers/index.js.map +0 -1
- package/dist/contexts/Modifiers/useModifiers.js +0 -16
- package/dist/contexts/Modifiers/useModifiers.js.map +0 -1
- package/dist/contexts/Modifiers/utils/getCustomModifiers.js +0 -15
- package/dist/contexts/Modifiers/utils/getCustomModifiers.js.map +0 -1
- package/dist/contexts/Modifiers/utils/getInternalModifiers.js +0 -39
- package/dist/contexts/Modifiers/utils/getInternalModifiers.js.map +0 -1
- package/dist/contexts/Modifiers/utils/matcherToArray.js +0 -17
- package/dist/contexts/Modifiers/utils/matcherToArray.js.map +0 -1
- package/dist/contexts/Modifiers/utils/toMatcherArray.js +0 -16
- package/dist/contexts/Modifiers/utils/toMatcherArray.js.map +0 -1
- package/dist/contexts/Navigation/NavigationContext.js +0 -33
- package/dist/contexts/Navigation/NavigationContext.js.map +0 -1
- package/dist/contexts/Navigation/index.js +0 -6
- package/dist/contexts/Navigation/index.js.map +0 -1
- package/dist/contexts/Navigation/useNavigation.js +0 -16
- package/dist/contexts/Navigation/useNavigation.js.map +0 -1
- package/dist/contexts/Navigation/useNavigationState.js +0 -20
- package/dist/contexts/Navigation/useNavigationState.js.map +0 -1
- package/dist/contexts/Navigation/utils/getDisplayMonths.js +0 -24
- package/dist/contexts/Navigation/utils/getDisplayMonths.js.map +0 -1
- package/dist/contexts/Navigation/utils/getInitialMonth.js +0 -22
- package/dist/contexts/Navigation/utils/getInitialMonth.js.map +0 -1
- package/dist/contexts/Navigation/utils/getNextMonth.js +0 -33
- package/dist/contexts/Navigation/utils/getNextMonth.js.map +0 -1
- package/dist/contexts/Navigation/utils/getPreviousMonth.js +0 -34
- package/dist/contexts/Navigation/utils/getPreviousMonth.js.map +0 -1
- package/dist/contexts/RootProvider.js +0 -25
- package/dist/contexts/RootProvider.js.map +0 -1
- package/dist/contexts/SelectMultiple/SelectMultipleContext.js +0 -81
- package/dist/contexts/SelectMultiple/SelectMultipleContext.js.map +0 -1
- package/dist/contexts/SelectMultiple/index.js +0 -6
- package/dist/contexts/SelectMultiple/index.js.map +0 -1
- package/dist/contexts/SelectMultiple/useSelectMultiple.js +0 -16
- package/dist/contexts/SelectMultiple/useSelectMultiple.js.map +0 -1
- package/dist/contexts/SelectRange/SelectRangeContext.js +0 -123
- package/dist/contexts/SelectRange/SelectRangeContext.js.map +0 -1
- package/dist/contexts/SelectRange/index.js +0 -6
- package/dist/contexts/SelectRange/index.js.map +0 -1
- package/dist/contexts/SelectRange/useSelectRange.js +0 -16
- package/dist/contexts/SelectRange/useSelectRange.js.map +0 -1
- package/dist/contexts/SelectRange/utils/addToRange.js +0 -40
- package/dist/contexts/SelectRange/utils/addToRange.js.map +0 -1
- package/dist/contexts/SelectSingle/SelectSingleContext.js +0 -42
- package/dist/contexts/SelectSingle/SelectSingleContext.js.map +0 -1
- package/dist/contexts/SelectSingle/index.js +0 -6
- package/dist/contexts/SelectSingle/index.js.map +0 -1
- package/dist/contexts/SelectSingle/useSelectSingle.js +0 -16
- package/dist/contexts/SelectSingle/useSelectSingle.js.map +0 -1
- package/dist/hooks/useControlledValue/index.js +0 -5
- package/dist/hooks/useControlledValue/index.js.map +0 -1
- package/dist/hooks/useControlledValue/useControlledValue.js +0 -21
- package/dist/hooks/useControlledValue/useControlledValue.js.map +0 -1
- package/dist/hooks/useDayModifiers/index.js +0 -5
- package/dist/hooks/useDayModifiers/index.js.map +0 -1
- package/dist/hooks/useDayModifiers/useDayModifiers.js +0 -38
- package/dist/hooks/useDayModifiers/useDayModifiers.js.map +0 -1
- package/dist/hooks/useDayModifiers/utils/getModifierStatus.js +0 -23
- package/dist/hooks/useDayModifiers/utils/getModifierStatus.js.map +0 -1
- package/dist/hooks/useDayModifiers/utils/isDateInRange.js +0 -26
- package/dist/hooks/useDayModifiers/utils/isDateInRange.js.map +0 -1
- package/dist/hooks/useDayModifiers/utils/isMatch.js +0 -53
- package/dist/hooks/useDayModifiers/utils/isMatch.js.map +0 -1
- package/dist/hooks/useInput/index.js +0 -5
- package/dist/hooks/useInput/index.js.map +0 -1
- package/dist/hooks/useInput/useInput.js +0 -103
- 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/types/DayPicker.js +0 -3
- package/dist/types/DayPicker.js.map +0 -1
- package/dist/types/DayPickerCustom.js +0 -9
- package/dist/types/DayPickerCustom.js.map +0 -1
- package/dist/types/DayPickerMultiple.js +0 -9
- package/dist/types/DayPickerMultiple.js.map +0 -1
- package/dist/types/DayPickerRange.js +0 -9
- package/dist/types/DayPickerRange.js.map +0 -1
- package/dist/types/DayPickerSingle.js +0 -9
- package/dist/types/DayPickerSingle.js.map +0 -1
- package/dist/types/EventHandlers.js +0 -3
- package/dist/types/EventHandlers.js.map +0 -1
- package/dist/types/Formatters.js +0 -3
- package/dist/types/Formatters.js.map +0 -1
- package/dist/types/Labels.js +0 -3
- package/dist/types/Labels.js.map +0 -1
- package/dist/types/Matchers.js +0 -33
- package/dist/types/Matchers.js.map +0 -1
- package/dist/types/Modifiers.js +0 -3
- package/dist/types/Modifiers.js.map +0 -1
- package/dist/types/Styles.js +0 -3
- package/dist/types/Styles.js.map +0 -1
- package/style.css.d.ts +0 -39
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value or a function that matches a specific day.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
* Matchers are passed to DayPicker via [[DayPickerProps.disabled]],
|
|
6
|
+
* [[DayPickerProps.hidden]] or [[DayPickerProps.selected]] and are used to
|
|
7
|
+
* determine if a day should get a [[Modifier]].
|
|
8
|
+
*
|
|
9
|
+
* Matchers can be of different types:
|
|
10
|
+
*
|
|
11
|
+
* ```
|
|
12
|
+
* // will always match the day
|
|
13
|
+
* const booleanMatcher: Matcher = true;
|
|
14
|
+
*
|
|
15
|
+
* // will match the today's date
|
|
16
|
+
* const dateMatcher: Matcher = new Date();
|
|
17
|
+
*
|
|
18
|
+
* // will match the days in the array
|
|
19
|
+
* const arrayMatcher: Matcher = [new Date(2019, 1, 2);, new Date(2019, 1, 4)];
|
|
20
|
+
*
|
|
21
|
+
* // will match days after the 2nd of February 2019
|
|
22
|
+
* const afterMatcher: DateAfter = { after: new Date(2019, 1, 2); };
|
|
23
|
+
* // will match days before the 2nd of February 2019 }
|
|
24
|
+
* const beforeMatcher: DateBefore = { before: : new Date(2019, 1, 2); };
|
|
25
|
+
*
|
|
26
|
+
* // will match Sundays
|
|
27
|
+
* const dayOfWeekMatcher: DayOfWeek = {
|
|
28
|
+
* dayOfWeek: 0
|
|
29
|
+
* };
|
|
30
|
+
*
|
|
31
|
+
* // will match the included days, except the two dates
|
|
32
|
+
* const intervalMatcher: DateInterval = {
|
|
33
|
+
* after: new Date(2019, 1, 2);,
|
|
34
|
+
* before: new Date(2019, 1, 5)
|
|
35
|
+
* };
|
|
36
|
+
*
|
|
37
|
+
* // will match the included days, including the two dates
|
|
38
|
+
* const rangeMatcher: DateRange = {
|
|
39
|
+
* from: new Date(2019, 1, 2);,
|
|
40
|
+
* to: new Date(2019, 1, 5)
|
|
41
|
+
* };
|
|
42
|
+
*
|
|
43
|
+
* // will match when the function return true
|
|
44
|
+
* const functionMatcher: Matcher = (day: Date) => {
|
|
45
|
+
* return (new Date()).getMonth() === 2 // match when month is March
|
|
46
|
+
* };
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @see [[isMatch]]
|
|
50
|
+
*
|
|
51
|
+
* */
|
|
52
|
+
export declare type Matcher = boolean | ((date: Date) => boolean) | Date | Date[] | DateRange | DateBefore | DateAfter | DateInterval | DayOfWeek;
|
|
53
|
+
/** A matcher to match a day falling after the specified date, with the date not included. */
|
|
54
|
+
export declare type DateAfter = {
|
|
55
|
+
after: Date;
|
|
56
|
+
};
|
|
57
|
+
/** A matcher to match a day falling before the specified date, with the date not included. */
|
|
58
|
+
export declare type DateBefore = {
|
|
59
|
+
before: Date;
|
|
60
|
+
};
|
|
61
|
+
/** A matcher to match a day falling before and after two dates, where the dates are not included. */
|
|
62
|
+
export declare type DateInterval = {
|
|
63
|
+
before: Date;
|
|
64
|
+
after: Date;
|
|
65
|
+
};
|
|
66
|
+
/** A matcher to match a range of dates. The range can be open. Differently from [[DateInterval]], the dates here are included. */
|
|
67
|
+
export declare type DateRange = {
|
|
68
|
+
from: Date | undefined;
|
|
69
|
+
to?: Date | undefined;
|
|
70
|
+
};
|
|
71
|
+
/** A matcher to match a date being one of the specified days of the week (`0-7`, where `0` is Sunday). */
|
|
72
|
+
export declare type DayOfWeek = {
|
|
73
|
+
dayOfWeek: number[];
|
|
74
|
+
};
|
|
75
|
+
/** Returns true if `matcher` is of type [[DateInterval]]. */
|
|
76
|
+
export declare function isDateInterval(matcher: unknown): matcher is DateInterval;
|
|
77
|
+
/** Returns true if `value` is a [[DateRange]] type. */
|
|
78
|
+
export declare function isDateRange(value: unknown): value is DateRange;
|
|
79
|
+
/** Returns true if `value` is of type [[DateAfter]]. */
|
|
80
|
+
export declare function isDateAfterType(value: unknown): value is DateAfter;
|
|
81
|
+
/** Returns true if `value` is of type [[DateBefore]]. */
|
|
82
|
+
export declare function isDateBeforeType(value: unknown): value is DateBefore;
|
|
83
|
+
/** Returns true if `value` is a [[DayOfWeek]] type. */
|
|
84
|
+
export declare function isDayOfWeekType(value: unknown): value is DayOfWeek;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Matcher } from './Matchers';
|
|
3
|
-
/**
|
|
4
|
-
export declare type
|
|
5
|
-
/** The modifiers
|
|
3
|
+
/** A _modifier_ represents different styles or states of a day displayed in the calendar. */
|
|
4
|
+
export declare type Modifier = string;
|
|
5
|
+
/** The modifiers used by DayPicker. */
|
|
6
|
+
export declare type Modifiers = CustomModifiers & InternalModifiers;
|
|
7
|
+
/** The name of the modifiers that are used internally by DayPicker. */
|
|
6
8
|
export declare enum InternalModifier {
|
|
9
|
+
Outside = "outside",
|
|
7
10
|
/** Name of the modifier applied to the disabled days, using the `disabled` prop. */
|
|
8
11
|
Disabled = "disabled",
|
|
9
12
|
/** Name of the modifier applied to the selected days using the `selected` prop). */
|
|
@@ -21,18 +24,28 @@ export declare enum InternalModifier {
|
|
|
21
24
|
}
|
|
22
25
|
/** Map of matchers used for the internal modifiers. */
|
|
23
26
|
export declare type InternalModifiers = Record<InternalModifier, Matcher[]>;
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Active modifiers are those Modifiers matching a specific day.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
*
|
|
32
|
+
* ```
|
|
33
|
+
* const activeModifiers: ActiveModifiers = {
|
|
34
|
+
* selected: true,
|
|
35
|
+
* customModifier: true
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* */
|
|
40
|
+
export declare type ActiveModifiers = Record<Modifier, true> & Partial<Record<InternalModifier, true>>;
|
|
41
|
+
/** The style to apply to each day element matching a modifier. */
|
|
42
|
+
export declare type ModifiersStyles = Record<Modifier, React.CSSProperties> & Partial<Record<InternalModifier, React.CSSProperties>>;
|
|
43
|
+
/** The classnames to assign to each day element matching a modifier. */
|
|
44
|
+
export declare type ModifiersClassNames = Record<Modifier, string> & Partial<Record<InternalModifier, string>>;
|
|
32
45
|
/** The custom modifiers passed to the [[DayPickerProps.modifiers]]. */
|
|
33
46
|
export declare type DayModifiers = Record<Modifier, Matcher | Matcher[]>;
|
|
34
47
|
/**
|
|
35
48
|
* A map of matchers used as custom modifiers by DayPicker component. This is
|
|
36
49
|
* the same as [[DayModifiers]], but it accepts only array of [[Matcher]]s.
|
|
37
|
-
|
|
50
|
+
*/
|
|
38
51
|
export declare type CustomModifiers = Record<Modifier, Matcher[]>;
|
|
@@ -74,12 +74,9 @@ export declare type StyledElement<T = string | React.CSSProperties> = {
|
|
|
74
74
|
export declare type ClassNames = Partial<StyledElement<string>>;
|
|
75
75
|
/** The inline-styles of each element. */
|
|
76
76
|
export declare type Styles = Partial<StyledElement<React.CSSProperties>>;
|
|
77
|
-
/**
|
|
77
|
+
/** Props of a component that can be styled via classNames or inline-styles. */
|
|
78
78
|
export declare type StyledComponent = {
|
|
79
|
-
/** The class name to apply to the container element. */
|
|
80
79
|
className?: string;
|
|
81
|
-
/** The inline style of the container element. */
|
|
82
80
|
style?: React.CSSProperties;
|
|
83
|
-
/** The content of the element. */
|
|
84
81
|
children?: React.ReactNode;
|
|
85
82
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-day-picker",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.39",
|
|
4
4
|
"description": "Customizable Date Picker for React",
|
|
5
5
|
"author": "Giampaolo Bellavite <io@gpbl.dev>",
|
|
6
6
|
"homepage": "http://react-day-picker.js.org",
|
|
@@ -12,15 +12,16 @@
|
|
|
12
12
|
"bugs": {
|
|
13
13
|
"url": "https://github.com/gpbl/react-day-picker/issues"
|
|
14
14
|
},
|
|
15
|
-
"module": "build/index.js",
|
|
16
15
|
"main": "dist/index.js",
|
|
17
|
-
"
|
|
16
|
+
"module": "dist/index.esm.js",
|
|
17
|
+
"browser": "dist/react-day-picker.min.js",
|
|
18
|
+
"unpkg": "dist/react-day-picker.min.js",
|
|
19
|
+
"types": "dist/index.d.ts",
|
|
20
|
+
"style": "dist/style.css",
|
|
18
21
|
"scripts": {
|
|
19
|
-
"build": "
|
|
20
|
-
"build-
|
|
21
|
-
"
|
|
22
|
-
"build-watch": "rimraf build && rimraf dist && yarn css-types && tsc --project tsconfig.cjs.json -w & tsc-alias -p tsconfig.cjs.json -w",
|
|
23
|
-
"css-types": "yarn tcm -p style.css",
|
|
22
|
+
"build": "rimraf dist && rollup -c",
|
|
23
|
+
"build-watch": "rollup -c -w --no-watch.clearScreen",
|
|
24
|
+
"css-types": "yarn tcm -p src/style.css",
|
|
24
25
|
"lint": "eslint --ext .ts,.tsx src",
|
|
25
26
|
"test": "jest",
|
|
26
27
|
"test-watch": "jest --watch",
|
|
@@ -28,45 +29,54 @@
|
|
|
28
29
|
"typecheck-watch": "tsc --project ./tsconfig.json --noEmit --skipLibCheck --watch"
|
|
29
30
|
},
|
|
30
31
|
"files": [
|
|
31
|
-
"
|
|
32
|
-
"dist",
|
|
33
|
-
"style.css",
|
|
34
|
-
"style.css.d.ts"
|
|
32
|
+
"dist"
|
|
35
33
|
],
|
|
36
34
|
"dependencies": {
|
|
37
35
|
"@reach/auto-id": "^0.16.0"
|
|
38
36
|
},
|
|
39
37
|
"devDependencies": {
|
|
40
|
-
"@
|
|
38
|
+
"@rollup/plugin-alias": "^3.1.9",
|
|
39
|
+
"@rollup/plugin-commonjs": "^21.0.2",
|
|
40
|
+
"@rollup/plugin-typescript": "^8.3.1",
|
|
41
|
+
"@testing-library/dom": "^8.11.3",
|
|
42
|
+
"@testing-library/react": "^12.1.4",
|
|
41
43
|
"@testing-library/react-hooks": "^7.0.2",
|
|
42
44
|
"@testing-library/user-event": "^13.5.0",
|
|
43
|
-
"@types/jest": "^27.
|
|
44
|
-
"@types/node": "^14.
|
|
45
|
-
"@types/react": "^17.0.
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
47
|
-
"@typescript-eslint/parser": "^5.
|
|
48
|
-
"date-fns": "^2.
|
|
49
|
-
"eslint": "^8.
|
|
50
|
-
"eslint-config-prettier": "^8.
|
|
51
|
-
"eslint-
|
|
52
|
-
"eslint-
|
|
45
|
+
"@types/jest": "^27.4.1",
|
|
46
|
+
"@types/node": "^14.18.12",
|
|
47
|
+
"@types/react": "^17.0.40",
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^5.15.0",
|
|
49
|
+
"@typescript-eslint/parser": "^5.15.0",
|
|
50
|
+
"date-fns": "^2.28.0",
|
|
51
|
+
"eslint": "^8.11.0",
|
|
52
|
+
"eslint-config-prettier": "^8.5.0",
|
|
53
|
+
"eslint-config-rdp": "workspace:^",
|
|
54
|
+
"eslint-import-resolver-typescript": "^2.5.0",
|
|
55
|
+
"eslint-plugin-import": "^2.25.4",
|
|
56
|
+
"eslint-plugin-jest": "^26.1.1",
|
|
53
57
|
"eslint-plugin-prettier": "^4.0.0",
|
|
54
58
|
"eslint-plugin-react-hooks": "^4.3.0",
|
|
55
|
-
"jest": "^27.
|
|
56
|
-
"prettier": "^2.
|
|
59
|
+
"jest": "^27.5.1",
|
|
60
|
+
"prettier": "^2.6.0",
|
|
57
61
|
"react": "^17.0.2",
|
|
58
62
|
"react-dom": "^17.0.2",
|
|
59
63
|
"rimraf": "^3.0.2",
|
|
64
|
+
"rollup": "^2.70.1",
|
|
65
|
+
"rollup-plugin-copy": "^3.4.0",
|
|
66
|
+
"rollup-plugin-local-resolve": "^1.0.7",
|
|
67
|
+
"rollup-plugin-node-resolve": "^5.2.0",
|
|
68
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
69
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
60
70
|
"timekeeper": "^2.2.0",
|
|
61
|
-
"ts-jest": "^27.1.
|
|
62
|
-
"ts-node": "^10.
|
|
63
|
-
"tsc-alias": "^1.4
|
|
71
|
+
"ts-jest": "^27.1.3",
|
|
72
|
+
"ts-node": "^10.7.0",
|
|
73
|
+
"tsc-alias": "^1.6.4",
|
|
64
74
|
"tslib": "^2.3.1",
|
|
65
75
|
"typed-css-modules": "^0.7.0",
|
|
66
|
-
"typescript": "~4.
|
|
76
|
+
"typescript": "~4.5.5"
|
|
67
77
|
},
|
|
68
78
|
"peerDependencies": {
|
|
69
|
-
"date-fns": "^2.
|
|
79
|
+
"date-fns": "^2.28.0",
|
|
70
80
|
"react": "^16.8.0 || ^17.0.0"
|
|
71
81
|
},
|
|
72
82
|
"funding": {
|
package/build/DayPicker.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Root } from './components/Root';
|
|
4
|
-
import { RootProvider } from './contexts/RootProvider';
|
|
5
|
-
/**
|
|
6
|
-
* DayPicker render a date picker component to let users pick dates from a
|
|
7
|
-
* calendar. See http://react-day-picker.js.org for updated documentation and
|
|
8
|
-
* examples.
|
|
9
|
-
*
|
|
10
|
-
* ### Customization
|
|
11
|
-
*
|
|
12
|
-
* DayPicker offers different customization props. For example,
|
|
13
|
-
*
|
|
14
|
-
* - show multiple months using `numberOfMonths`
|
|
15
|
-
* - display a dropdown to navigate the months via `captionLayout`
|
|
16
|
-
* - display the week numbers with `showWeekNumbers`
|
|
17
|
-
* - disable or hide days with `disabled` or `hidden`
|
|
18
|
-
*
|
|
19
|
-
* ### Controlling the months
|
|
20
|
-
*
|
|
21
|
-
* Change the initially displayed month using the `defaultMonth` prop. The
|
|
22
|
-
* displayed months are controlled by DayPicker and stored in its internal
|
|
23
|
-
* state. To control the months yourself, use `month` instead of `defaultMonth`
|
|
24
|
-
* and use the `onMonthChange` event to set it.
|
|
25
|
-
*
|
|
26
|
-
* To limit the months the user can navigate to, use
|
|
27
|
-
* `fromDate`/`fromMonth`/`fromYear` or `toDate`/`toMonth`/`toYear`.
|
|
28
|
-
*
|
|
29
|
-
* ### Selection modes
|
|
30
|
-
*
|
|
31
|
-
* DayPicker supports different selection mode that can be toggled using the
|
|
32
|
-
* `mode` prop:
|
|
33
|
-
*
|
|
34
|
-
* - `mode="single"`: only one day can be selected. Use `required` to make the
|
|
35
|
-
* selection required. Use the `onSelect` event handler to get the selected
|
|
36
|
-
* days.
|
|
37
|
-
* - `mode="multiple"`: users can select one or more days. Limit the amount of
|
|
38
|
-
* days that can be selected with the `min` or the `max` props.
|
|
39
|
-
* - `mode="range"`: users can select a range of days. Limit the amount of days
|
|
40
|
-
* in the range with the `min` or the `max` props.
|
|
41
|
-
* - `mode="custom"`: implement your own selection mode with `onDayClick`.
|
|
42
|
-
*
|
|
43
|
-
* These selection modes should cover the most common use cases. In case you
|
|
44
|
-
* need a more refined way of selecting days, use `mode="custom"`. Use the
|
|
45
|
-
* `selected` props and add the day event handlers to add/remove days from the
|
|
46
|
-
* selection.
|
|
47
|
-
*
|
|
48
|
-
* ### Modifiers
|
|
49
|
-
*
|
|
50
|
-
* A _modifier_ represents different styles or states for the days displayed in
|
|
51
|
-
* the calendar (like "selected" or "disabled"). Define custom modifiers using
|
|
52
|
-
* the `modifiers` prop.
|
|
53
|
-
*
|
|
54
|
-
* ### Formatters and custom component
|
|
55
|
-
*
|
|
56
|
-
* You can customize how the content is displayed in the date picker by using
|
|
57
|
-
* either the formatters or replacing the internal components.
|
|
58
|
-
*
|
|
59
|
-
* For the most common cases you want to use the `formatters` prop to change how
|
|
60
|
-
* the content is formatted in the calendar. Use the `components` prop to
|
|
61
|
-
* replace the internal components, like the navigation icons.
|
|
62
|
-
*
|
|
63
|
-
* ### Styling
|
|
64
|
-
*
|
|
65
|
-
* DayPicker comes with a default, basic style in `react-day-picker/style` – use
|
|
66
|
-
* it as template for your own style.
|
|
67
|
-
*
|
|
68
|
-
* If you are using CSS modules, pass the imported styles object the
|
|
69
|
-
* `classNames` props.
|
|
70
|
-
*
|
|
71
|
-
* You can also style the elements via inline-styles using the `styles` prop.
|
|
72
|
-
*
|
|
73
|
-
* ### Form fields
|
|
74
|
-
*
|
|
75
|
-
* If you need to bind the date picker to a form field, you can use the
|
|
76
|
-
* `useInput` hooks for a basic behavior. See the `useInput` source as an
|
|
77
|
-
* example to bind the date picker with form fields.
|
|
78
|
-
*
|
|
79
|
-
* ### Localization
|
|
80
|
-
*
|
|
81
|
-
* To localize DayPicker, import the locale from `date-fns` package and use the
|
|
82
|
-
* `locale` prop.
|
|
83
|
-
*
|
|
84
|
-
* For example, to use Spanish locale:
|
|
85
|
-
*
|
|
86
|
-
* ```
|
|
87
|
-
* import es from 'date-fns/locale/es';
|
|
88
|
-
* <DayPicker locale={es} />
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
export function DayPicker(props) {
|
|
92
|
-
return (React.createElement(RootProvider, __assign({}, props),
|
|
93
|
-
React.createElement(Root, null)));
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=DayPicker.js.map
|
package/build/DayPicker.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DayPicker.js","sourceRoot":"","sources":["../src/DayPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AACH,MAAM,UAAU,SAAS,CACvB,KAKwB;IAExB,OAAO,CACL,oBAAC,YAAY,eAAK,KAAK;QACrB,oBAAC,IAAI,OAAG,CACK,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/** The props for the [[Button]] component. */
|
|
3
|
-
export declare type ButtonProps = React.HTMLProps<HTMLButtonElement>;
|
|
4
|
-
/**
|
|
5
|
-
* Render a button HTML element applying the reset class name.
|
|
6
|
-
*/
|
|
7
|
-
export declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "children" | "className" | "id" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useDayPicker } from '../../contexts/DayPicker';
|
|
4
|
-
/**
|
|
5
|
-
* Render a button HTML element applying the reset class name.
|
|
6
|
-
*/
|
|
7
|
-
export var Button = React.forwardRef(function (props, ref) {
|
|
8
|
-
var _a = useDayPicker(), classNames = _a.classNames, styles = _a.styles;
|
|
9
|
-
var classNamesArr = [classNames.button_reset, classNames.button];
|
|
10
|
-
if (props.className) {
|
|
11
|
-
classNamesArr.push(props.className);
|
|
12
|
-
}
|
|
13
|
-
var className = classNamesArr.join(' ');
|
|
14
|
-
var style = __assign(__assign({}, styles.button_reset), styles.button);
|
|
15
|
-
if (props.style) {
|
|
16
|
-
Object.assign(style, props.style);
|
|
17
|
-
}
|
|
18
|
-
return (React.createElement("button", __assign({}, props, { ref: ref, type: "button", className: className, style: style })));
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKlD;;GAEG;AACH,MAAM,CAAC,IAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CACpC,UAAC,KAAK,EAAE,GAAG;IACH,IAAA,KAAyB,YAAY,EAAE,EAArC,UAAU,gBAAA,EAAE,MAAM,YAAmB,CAAC;IAE9C,IAAM,aAAa,GAAG,CAAC,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IACnE,IAAI,KAAK,CAAC,SAAS,EAAE;QACnB,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;KACrC;IACD,IAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE1C,IAAM,KAAK,yBAAQ,MAAM,CAAC,YAAY,GAAK,MAAM,CAAC,MAAM,CAAE,CAAC;IAC3D,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;KACnC;IAED,OAAO,CACL,2CACM,KAAK,IACT,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,IACZ,CACH,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { isSameMonth } from 'date-fns';
|
|
3
|
-
import { MonthsDropdown } from '../../components/MonthsDropdown';
|
|
4
|
-
import { Navigation } from '../../components/Navigation';
|
|
5
|
-
import { YearsDropdown } from '../../components/YearsDropdown';
|
|
6
|
-
import { useDayPicker } from '../../contexts/DayPicker';
|
|
7
|
-
import { useNavigation } from '../../contexts/Navigation';
|
|
8
|
-
/**
|
|
9
|
-
* Render the caption of a month, which includes title and navigation buttons.
|
|
10
|
-
* The caption has a different layout when setting the [[DayPickerProps.captionLayout]] prop.
|
|
11
|
-
*/
|
|
12
|
-
export function Caption(props) {
|
|
13
|
-
var _a;
|
|
14
|
-
var displayMonth = props.displayMonth;
|
|
15
|
-
var context = useDayPicker();
|
|
16
|
-
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;
|
|
17
|
-
var _b = useNavigation(), previousMonth = _b.previousMonth, nextMonth = _b.nextMonth, goToMonth = _b.goToMonth, displayMonths = _b.displayMonths;
|
|
18
|
-
var handlePreviousClick = function () {
|
|
19
|
-
if (!previousMonth)
|
|
20
|
-
return;
|
|
21
|
-
goToMonth(previousMonth);
|
|
22
|
-
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(previousMonth);
|
|
23
|
-
};
|
|
24
|
-
var handleNextClick = function () {
|
|
25
|
-
if (!nextMonth)
|
|
26
|
-
return;
|
|
27
|
-
goToMonth(nextMonth);
|
|
28
|
-
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(nextMonth);
|
|
29
|
-
};
|
|
30
|
-
var handleMonthChange = function (newMonth) {
|
|
31
|
-
goToMonth(newMonth);
|
|
32
|
-
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(newMonth);
|
|
33
|
-
};
|
|
34
|
-
var displayIndex = displayMonths.findIndex(function (month) {
|
|
35
|
-
return isSameMonth(displayMonth, month);
|
|
36
|
-
});
|
|
37
|
-
var isFirst = displayIndex === 0;
|
|
38
|
-
var isLast = displayIndex === displayMonths.length - 1;
|
|
39
|
-
if (dir === 'rtl') {
|
|
40
|
-
_a = [isFirst, isLast], isLast = _a[0], isFirst = _a[1];
|
|
41
|
-
}
|
|
42
|
-
var hideNext = numberOfMonths > 1 && (isFirst || !isLast);
|
|
43
|
-
var hidePrevious = numberOfMonths > 1 && (isLast || !isFirst);
|
|
44
|
-
var captionLabel = (React.createElement(CaptionLabel, { id: props.id, displayMonth: displayMonth }));
|
|
45
|
-
var captionContent;
|
|
46
|
-
if (disableNavigation) {
|
|
47
|
-
captionContent = captionLabel;
|
|
48
|
-
}
|
|
49
|
-
else if (captionLayout === 'dropdown') {
|
|
50
|
-
captionContent = (React.createElement("div", { className: classNames.caption_dropdowns, style: styles.caption_dropdowns },
|
|
51
|
-
React.createElement("div", { className: classNames.vhidden }, captionLabel),
|
|
52
|
-
React.createElement(MonthsDropdown, { onChange: handleMonthChange, displayMonth: displayMonth }),
|
|
53
|
-
React.createElement(YearsDropdown, { onChange: handleMonthChange, displayMonth: displayMonth })));
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
captionContent = (React.createElement(React.Fragment, null,
|
|
57
|
-
captionLabel,
|
|
58
|
-
React.createElement(Navigation, { displayMonth: displayMonth, hideNext: hideNext, hidePrevious: hidePrevious, nextMonth: nextMonth, previousMonth: previousMonth, onPreviousClick: handlePreviousClick, onNextClick: handleNextClick })));
|
|
59
|
-
}
|
|
60
|
-
return (React.createElement("div", { className: classNames.caption, style: styles.caption }, captionContent));
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=Caption.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Caption.js","sourceRoot":"","sources":["../../../src/components/Caption/Caption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAmBpD;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,KAAmB;;IACjC,IAAA,YAAY,GAAK,KAAK,aAAV,CAAW;IAC/B,IAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAE7B,IAAA,UAAU,GAQR,OAAO,WARC,EACV,cAAc,GAOZ,OAAO,eAPK,EACd,iBAAiB,GAMf,OAAO,kBANQ,EACjB,MAAM,GAKJ,OAAO,OALH,EACN,aAAa,GAIX,OAAO,cAJI,EACb,aAAa,GAGX,OAAO,cAHI,EACb,GAAG,GAED,OAAO,IAFN,EACW,YAAY,GACxB,OAAO,wBADiB,CAChB;IAEN,IAAA,KACJ,aAAa,EAAE,EADT,aAAa,mBAAA,EAAE,SAAS,eAAA,EAAE,SAAS,eAAA,EAAE,aAAa,mBACzC,CAAC;IAElB,IAAM,mBAAmB,GAA4B;QACnD,IAAI,CAAC,aAAa;YAAE,OAAO;QAC3B,SAAS,CAAC,aAAa,CAAC,CAAC;QACzB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,aAAa,CAAC,CAAC;IACjC,CAAC,CAAC;IAEF,IAAM,eAAe,GAA4B;QAC/C,IAAI,CAAC,SAAS;YAAE,OAAO;QACvB,SAAS,CAAC,SAAS,CAAC,CAAC;QACrB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,SAAS,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,IAAM,iBAAiB,GAA4B,UAAC,QAAQ;QAC1D,SAAS,CAAC,QAAQ,CAAC,CAAC;QACpB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,QAAQ,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,IAAM,YAAY,GAAG,aAAa,CAAC,SAAS,CAAC,UAAC,KAAK;QACjD,OAAA,WAAW,CAAC,YAAY,EAAE,KAAK,CAAC;IAAhC,CAAgC,CACjC,CAAC;IACF,IAAI,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC;IACjC,IAAI,MAAM,GAAG,YAAY,KAAK,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IACvD,IAAI,GAAG,KAAK,KAAK,EAAE;QACjB,KAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,EAApC,MAAM,QAAA,EAAE,OAAO,QAAA,CAAsB;KACvC;IAED,IAAM,QAAQ,GAAG,cAAc,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5D,IAAM,YAAY,GAAG,cAAc,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;IAEhE,IAAM,YAAY,GAAG,CACnB,oBAAC,YAAY,IAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,YAAY,EAAE,YAAY,GAAI,CAC3D,CAAC;IAEF,IAAI,cAAc,CAAC;IACnB,IAAI,iBAAiB,EAAE;QACrB,cAAc,GAAG,YAAY,CAAC;KAC/B;SAAM,IAAI,aAAa,KAAK,UAAU,EAAE;QACvC,cAAc,GAAG,CACf,6BACE,SAAS,EAAE,UAAU,CAAC,iBAAiB,EACvC,KAAK,EAAE,MAAM,CAAC,iBAAiB;YAG/B,6BAAK,SAAS,EAAE,UAAU,CAAC,OAAO,IAAG,YAAY,CAAO;YACxD,oBAAC,cAAc,IACb,QAAQ,EAAE,iBAAiB,EAC3B,YAAY,EAAE,YAAY,GAC1B;YACF,oBAAC,aAAa,IACZ,QAAQ,EAAE,iBAAiB,EAC3B,YAAY,EAAE,YAAY,GAC1B,CACE,CACP,CAAC;KACH;SAAM;QACL,cAAc,GAAG,CACf;YACG,YAAY;YACb,oBAAC,UAAU,IACT,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,mBAAmB,EACpC,WAAW,EAAE,eAAe,GAC5B,CACD,CACJ,CAAC;KACH;IAED,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,IACtD,cAAc,CACX,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Caption/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useDayPicker } from '../../contexts/DayPicker';
|
|
3
|
-
/** Render the caption for the displayed month. This component is used when `captionLayout="buttons"`. */
|
|
4
|
-
export function CaptionLabel(props) {
|
|
5
|
-
var _a = useDayPicker(), locale = _a.locale, classNames = _a.classNames, styles = _a.styles, formatCaption = _a.formatters.formatCaption;
|
|
6
|
-
return (React.createElement("h2", { className: classNames.caption_label, style: styles.caption_label, "aria-live": "polite", "aria-atomic": "true", id: props.id }, formatCaption(props.displayMonth, { locale: locale })));
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=CaptionLabel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CaptionLabel.js","sourceRoot":"","sources":["../../../src/components/CaptionLabel/CaptionLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAUlD,yGAAyG;AACzG,MAAM,UAAU,YAAY,CAAC,KAAwB;IAC7C,IAAA,KAKF,YAAY,EAAE,EAJhB,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,MAAM,YAAA,EACQ,aAAa,8BACX,CAAC;IACnB,OAAO,CACL,4BACE,SAAS,EAAE,UAAU,CAAC,aAAa,EACnC,KAAK,EAAE,MAAM,CAAC,aAAa,eACjB,QAAQ,iBACN,MAAM,EAClB,EAAE,EAAE,KAAK,CAAC,EAAE,IAEX,aAAa,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,CAC3C,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CaptionLabel/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Button } from '../Button';
|
|
4
|
-
import { useDay } from './hooks/useDay';
|
|
5
|
-
/**
|
|
6
|
-
* The content of a day cell – as a button or span element according to its
|
|
7
|
-
* modifiers.
|
|
8
|
-
*/
|
|
9
|
-
export function Day(props) {
|
|
10
|
-
var buttonRef = React.useRef(null);
|
|
11
|
-
var day = useDay(props.date, props.displayMonth, buttonRef);
|
|
12
|
-
var buttonProps = day.buttonProps, nonInteractiveProps = day.nonInteractiveProps;
|
|
13
|
-
if (!buttonProps && !nonInteractiveProps) {
|
|
14
|
-
return React.createElement(React.Fragment, null);
|
|
15
|
-
}
|
|
16
|
-
if (nonInteractiveProps) {
|
|
17
|
-
return React.createElement("div", __assign({}, nonInteractiveProps));
|
|
18
|
-
}
|
|
19
|
-
return React.createElement(Button, __assign({ ref: buttonRef }, buttonProps));
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=Day.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Day.js","sourceRoot":"","sources":["../../../src/components/Day/Day.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAUxC;;;GAGG;AACH,MAAM,UAAU,GAAG,CAAC,KAAe;IACjC,IAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,CAAC,CAAC;IAExD,IAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IACtD,IAAA,WAAW,GAA0B,GAAG,YAA7B,EAAE,mBAAmB,GAAK,GAAG,oBAAR,CAAS;IAEjD,IAAI,CAAC,WAAW,IAAI,CAAC,mBAAmB,EAAE;QACxC,OAAO,yCAAK,CAAC;KACd;IACD,IAAI,mBAAmB,EAAE;QACvB,OAAO,wCAAS,mBAAmB,EAAI,CAAC;KACzC;IACD,OAAO,oBAAC,MAAM,aAAC,GAAG,EAAE,SAAS,IAAM,WAAW,EAAI,CAAC;AACrD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useDay';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Day/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SelectMultipleContextValue } from '../../../contexts/SelectMultiple';
|
|
3
|
-
import { SelectRangeContextValue } from '../../../contexts/SelectRange';
|
|
4
|
-
import { SelectSingleContextValue } from '../../../contexts/SelectSingle';
|
|
5
|
-
import { DateRange } from '../../../types/Matchers';
|
|
6
|
-
import { ModifierStatus } from '../../../types/Modifiers';
|
|
7
|
-
import { StyledComponent } from '../../../types/Styles';
|
|
8
|
-
export declare type UseDay = {
|
|
9
|
-
/** Whether the date is outside the display month/ */
|
|
10
|
-
isOutside: boolean;
|
|
11
|
-
/** The modifiers for the given date. */
|
|
12
|
-
modifiers: ModifierStatus;
|
|
13
|
-
/** The days in DayPicker currently selected. */
|
|
14
|
-
selected: Date | Date[] | DateRange | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* The props for rendering the day as interactive element.
|
|
17
|
-
*
|
|
18
|
-
* When `undefined`, DayPicker should render a non interactive element with non-interactive
|
|
19
|
-
* props.
|
|
20
|
-
*/
|
|
21
|
-
buttonProps?: Omit<React.HTMLProps<HTMLButtonElement>, 'ref'>;
|
|
22
|
-
/**
|
|
23
|
-
* The props for rendering the day as not interactive element.
|
|
24
|
-
*
|
|
25
|
-
* When both this value and `buttonProps` are `undefined`, DayPicker should not render anything.
|
|
26
|
-
*/
|
|
27
|
-
nonInteractiveProps?: StyledComponent;
|
|
28
|
-
single: SelectSingleContextValue;
|
|
29
|
-
multiple: SelectMultipleContextValue;
|
|
30
|
-
range: SelectRangeContextValue;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* This hook returns details about the content to render in the day cell.
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* When a day cell is rendered in the table, DayPicker can either:
|
|
37
|
-
*
|
|
38
|
-
* - render nothing: when the day is outside the month or has matched the
|
|
39
|
-
* "hidden" modifier.
|
|
40
|
-
* - render a button. When a selection mode is set, DayPicker renders a button
|
|
41
|
-
* to allow the focus and the selection. In case of `custom` selection
|
|
42
|
-
* mode, DayPicker expects a `onDayClick` prop to render a button.
|
|
43
|
-
* - render a non-interactive element: when no selection mode is set, the day
|
|
44
|
-
* cell shouldn’t respond to any interaction. DayPicker should render a `div`
|
|
45
|
-
* or a `span`.
|
|
46
|
-
*
|
|
47
|
-
* ### Usage
|
|
48
|
-
*
|
|
49
|
-
* Use this hook to customize the behavior of the [[Day]] component. Create a
|
|
50
|
-
* new `Day` component using this hook and pass it to the `components` prop.
|
|
51
|
-
* The source of [[Day]] can be a good starting point.
|
|
52
|
-
*
|
|
53
|
-
* */
|
|
54
|
-
export declare function useDay(
|
|
55
|
-
/** The day rendered in the month. */
|
|
56
|
-
date: Date,
|
|
57
|
-
/** The month where the date is displayed. DayPicker renders days outside the display month when `showOutsideDays` is true. */
|
|
58
|
-
displayMonth: Date,
|
|
59
|
-
/** A ref to the button element. */
|
|
60
|
-
buttonRef: React.RefObject<HTMLButtonElement>): UseDay;
|