react-day-picker 8.0.0-beta.3 → 8.0.0-beta.33
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 +30 -1112
- package/LICENSE +1 -1
- package/README.md +14 -27
- package/build/DayPicker.d.ts +89 -0
- package/build/DayPicker.js +98 -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 +18 -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 +56 -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/{lib → build}/components/Head/index.d.ts +1 -1
- 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/IconLeft/IconLeft.d.ts +6 -0
- package/build/components/IconLeft/IconLeft.js +13 -0
- package/build/components/IconLeft/IconLeft.js.map +1 -0
- package/build/components/IconLeft/index.d.ts +1 -0
- package/build/components/IconRight/IconRight.d.ts +6 -0
- package/build/components/IconRight/IconRight.js +13 -0
- package/build/components/IconRight/IconRight.js.map +1 -0
- package/build/components/IconRight/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 +33 -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 +49 -0
- package/build/components/Root/Root.js.map +1 -0
- package/{lib → build}/components/Root/index.d.ts +1 -1
- 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/{lib → build}/components/Row/index.d.ts +1 -1
- 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/{lib → build}/components/Table/index.d.ts +1 -1
- 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/DayPicker/DayPickerContext.d.ts +31 -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 +42 -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 +54 -0
- package/build/contexts/DayPicker/utils/parseModifierProps.js.map +1 -0
- package/build/contexts/Focus/FocusContext.d.ts +30 -0
- package/build/contexts/Focus/FocusContext.js +71 -0
- package/build/contexts/Focus/FocusContext.js.map +1 -0
- package/build/contexts/Focus/index.d.ts +2 -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 +24 -0
- package/build/contexts/Navigation/NavigationContext.js +31 -0
- package/build/contexts/Navigation/NavigationContext.js.map +1 -0
- package/build/contexts/Navigation/index.d.ts +2 -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/RootProvider.d.ts +8 -0
- package/build/contexts/RootProvider.js +22 -0
- package/build/contexts/RootProvider.js.map +1 -0
- package/build/contexts/SelectMultiple/SelectMultipleContext.d.ts +32 -0
- package/build/contexts/SelectMultiple/SelectMultipleContext.js +82 -0
- package/build/contexts/SelectMultiple/SelectMultipleContext.js.map +1 -0
- package/build/contexts/SelectMultiple/index.d.ts +2 -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 +32 -0
- package/build/contexts/SelectRange/SelectRangeContext.js +123 -0
- package/build/contexts/SelectRange/SelectRangeContext.js.map +1 -0
- package/build/contexts/SelectRange/index.d.ts +2 -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/{lib/hooks/useRange → build/contexts/SelectRange/utils}/addToRange.d.ts +8 -8
- 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 +35 -0
- package/build/contexts/SelectSingle/SelectSingleContext.js +45 -0
- package/build/contexts/SelectSingle/SelectSingleContext.js.map +1 -0
- package/build/contexts/SelectSingle/index.d.ts +2 -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/{lib → build}/hooks/useInput/index.d.ts +1 -1
- package/build/hooks/useInput/useInput.d.ts +28 -0
- package/build/hooks/useInput/useInput.js +101 -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 +65 -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 +52 -0
- package/build/hooks/useModifiers/utils/isMatch.js.map +1 -0
- package/{src/index.ts → build/main.d.ts} +5 -3
- package/build/main.js +40 -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/DayPicker.d.ts +228 -0
- package/build/types/DayPickerCustom.d.ts +11 -0
- package/build/types/DayPickerCustom.js +7 -0
- package/build/types/DayPickerCustom.js.map +1 -0
- package/build/types/DayPickerMultiple.d.ts +16 -0
- package/build/types/DayPickerMultiple.js +7 -0
- package/build/types/DayPickerMultiple.js.map +1 -0
- package/build/types/DayPickerRange.d.ts +17 -0
- package/build/types/DayPickerRange.js +7 -0
- package/build/types/DayPickerRange.js.map +1 -0
- package/build/types/DayPickerSingle.d.ts +14 -0
- package/build/types/DayPickerSingle.js +7 -0
- package/build/types/DayPickerSingle.js.map +1 -0
- package/build/types/EventHandlers.d.ts +51 -0
- package/build/types/Formatters.d.ts +24 -0
- package/build/types/Labels.d.ts +28 -0
- package/build/types/Matchers.d.ts +34 -0
- package/build/types/Matchers.js +27 -0
- package/build/types/Matchers.js.map +1 -0
- package/build/types/Modifiers.d.ts +16 -0
- package/build/types/Styles.d.ts +85 -0
- package/build/types/index.d.ts +11 -0
- package/dist/main.js +1897 -0
- package/dist/main.js.map +1 -0
- package/package.json +50 -46
- package/style.css +299 -0
- package/style.css.d.ts +39 -0
- package/dist/index.js +0 -2103
- package/dist/index.js.map +0 -1
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -1
- package/dist/style.css +0 -144
- package/lib/components/Caption/Caption.d.ts +0 -3
- package/lib/components/Caption/Caption.js +0 -19
- package/lib/components/Caption/Caption.js.map +0 -1
- package/lib/components/Caption/getCaptionComponent.d.ts +0 -5
- package/lib/components/Caption/getCaptionComponent.js +0 -12
- package/lib/components/Caption/getCaptionComponent.js.map +0 -1
- package/lib/components/Caption/getCaptionComponent.test.d.ts +0 -1
- package/lib/components/Caption/getCaptionComponent.test.js +0 -29
- package/lib/components/Caption/getCaptionComponent.test.js.map +0 -1
- package/lib/components/Caption/index.d.ts +0 -2
- package/lib/components/Caption/index.js +0 -3
- package/lib/components/Caption/index.js.map +0 -1
- package/lib/components/Day/Day.d.ts +0 -3
- package/lib/components/Day/Day.js +0 -31
- package/lib/components/Day/Day.js.map +0 -1
- package/lib/components/Day/getDayComponent.d.ts +0 -6
- package/lib/components/Day/getDayComponent.js +0 -29
- package/lib/components/Day/getDayComponent.js.map +0 -1
- package/lib/components/Day/index.d.ts +0 -3
- package/lib/components/Day/index.js +0 -4
- package/lib/components/Day/index.js.map +0 -1
- package/lib/components/Day/utils/createClassName.d.ts +0 -2
- package/lib/components/Day/utils/createClassName.js +0 -19
- package/lib/components/Day/utils/createClassName.js.map +0 -1
- package/lib/components/Day/utils/createEventHandlers.d.ts +0 -16
- package/lib/components/Day/utils/createEventHandlers.js +0 -105
- package/lib/components/Day/utils/createEventHandlers.js.map +0 -1
- package/lib/components/Day/utils/createStyle.d.ts +0 -3
- package/lib/components/Day/utils/createStyle.js +0 -27
- package/lib/components/Day/utils/createStyle.js.map +0 -1
- package/lib/components/Day/utils/createTabIndex.d.ts +0 -2
- package/lib/components/Day/utils/createTabIndex.js +0 -22
- package/lib/components/Day/utils/createTabIndex.js.map +0 -1
- package/lib/components/Day/utils/findModifiers.d.ts +0 -6
- package/lib/components/Day/utils/findModifiers.js +0 -16
- package/lib/components/Day/utils/findModifiers.js.map +0 -1
- package/lib/components/Day/utils/getModifiers.d.ts +0 -5
- package/lib/components/Day/utils/getModifiers.js +0 -43
- package/lib/components/Day/utils/getModifiers.js.map +0 -1
- package/lib/components/Day/utils/getModifiersFromProps.d.ts +0 -2
- package/lib/components/Day/utils/getModifiersFromProps.js +0 -14
- package/lib/components/Day/utils/getModifiersFromProps.js.map +0 -1
- package/lib/components/Day/utils/getOutsideModifier.d.ts +0 -4
- package/lib/components/Day/utils/getOutsideModifier.js +0 -12
- package/lib/components/Day/utils/getOutsideModifier.js.map +0 -1
- package/lib/components/Day/utils/matchModifier.d.ts +0 -2
- package/lib/components/Day/utils/matchModifier.js +0 -80
- package/lib/components/Day/utils/matchModifier.js.map +0 -1
- package/lib/components/DayPicker/DayPicker.d.ts +0 -21
- package/lib/components/DayPicker/DayPicker.js +0 -74
- package/lib/components/DayPicker/DayPicker.js.map +0 -1
- package/lib/components/DayPicker/defaults/defaultClassNames.d.ts +0 -2
- package/lib/components/DayPicker/defaults/defaultClassNames.js +0 -32
- package/lib/components/DayPicker/defaults/defaultClassNames.js.map +0 -1
- package/lib/components/DayPicker/defaults/defaultLabels.d.ts +0 -2
- package/lib/components/DayPicker/defaults/defaultLabels.js +0 -24
- package/lib/components/DayPicker/defaults/defaultLabels.js.map +0 -1
- package/lib/components/DayPicker/defaults/defaultModifiers.d.ts +0 -2
- package/lib/components/DayPicker/defaults/defaultModifiers.js +0 -10
- package/lib/components/DayPicker/defaults/defaultModifiers.js.map +0 -1
- package/lib/components/DayPicker/defaults/defaultModifiersClassNames.d.ts +0 -2
- package/lib/components/DayPicker/defaults/defaultModifiersClassNames.js +0 -9
- package/lib/components/DayPicker/defaults/defaultModifiersClassNames.js.map +0 -1
- package/lib/components/DayPicker/defaults/defaultProps.d.ts +0 -2
- package/lib/components/DayPicker/defaults/defaultProps.js +0 -47
- package/lib/components/DayPicker/defaults/defaultProps.js.map +0 -1
- package/lib/components/DayPicker/defaults/index.d.ts +0 -5
- package/lib/components/DayPicker/defaults/index.js +0 -6
- package/lib/components/DayPicker/defaults/index.js.map +0 -1
- package/lib/components/DayPicker/index.d.ts +0 -2
- package/lib/components/DayPicker/index.js +0 -3
- package/lib/components/DayPicker/index.js.map +0 -1
- package/lib/components/DayPicker/utils/formatCaption.d.ts +0 -8
- package/lib/components/DayPicker/utils/formatCaption.js +0 -9
- package/lib/components/DayPicker/utils/formatCaption.js.map +0 -1
- package/lib/components/DayPicker/utils/formatDay.d.ts +0 -8
- package/lib/components/DayPicker/utils/formatDay.js +0 -9
- package/lib/components/DayPicker/utils/formatDay.js.map +0 -1
- package/lib/components/DayPicker/utils/formatWeekNumber.d.ts +0 -5
- package/lib/components/DayPicker/utils/formatWeekNumber.js +0 -8
- package/lib/components/DayPicker/utils/formatWeekNumber.js.map +0 -1
- package/lib/components/DayPicker/utils/formatWeekdayName.d.ts +0 -8
- package/lib/components/DayPicker/utils/formatWeekdayName.js +0 -10
- package/lib/components/DayPicker/utils/formatWeekdayName.js.map +0 -1
- package/lib/components/DayPicker/utils/getMonthFromProps.d.ts +0 -2
- package/lib/components/DayPicker/utils/getMonthFromProps.js +0 -17
- package/lib/components/DayPicker/utils/getMonthFromProps.js.map +0 -1
- package/lib/components/Head/Head.d.ts +0 -3
- package/lib/components/Head/Head.js +0 -11
- package/lib/components/Head/Head.js.map +0 -1
- package/lib/components/Head/index.js +0 -2
- package/lib/components/Head/index.js.map +0 -1
- package/lib/components/Head/utils/getWeekdays.d.ts +0 -6
- package/lib/components/Head/utils/getWeekdays.js +0 -15
- package/lib/components/Head/utils/getWeekdays.js.map +0 -1
- package/lib/components/Navigation/Navigation.d.ts +0 -3
- package/lib/components/Navigation/Navigation.js +0 -28
- package/lib/components/Navigation/Navigation.js.map +0 -1
- package/lib/components/Navigation/getNavigationComponent.d.ts +0 -12
- package/lib/components/Navigation/getNavigationComponent.js +0 -50
- package/lib/components/Navigation/getNavigationComponent.js.map +0 -1
- package/lib/components/Navigation/getNavigationComponent.test.d.ts +0 -0
- package/lib/components/Navigation/getNavigationComponent.test.js +0 -11
- package/lib/components/Navigation/getNavigationComponent.test.js.map +0 -1
- package/lib/components/Navigation/index.d.ts +0 -2
- package/lib/components/Navigation/index.js +0 -3
- package/lib/components/Navigation/index.js.map +0 -1
- package/lib/components/Navigation/utils/getPrevNextMonths.d.ts +0 -5
- package/lib/components/Navigation/utils/getPrevNextMonths.js +0 -20
- package/lib/components/Navigation/utils/getPrevNextMonths.js.map +0 -1
- package/lib/components/Navigation/utils/getPrevNextMonths.test.d.ts +0 -1
- package/lib/components/Navigation/utils/getPrevNextMonths.test.js +0 -44
- package/lib/components/Navigation/utils/getPrevNextMonths.test.js.map +0 -1
- package/lib/components/NextIcon/NextIcon.d.ts +0 -2
- package/lib/components/NextIcon/NextIcon.js +0 -6
- package/lib/components/NextIcon/NextIcon.js.map +0 -1
- package/lib/components/NextIcon/index.d.ts +0 -1
- package/lib/components/NextIcon/index.js +0 -2
- package/lib/components/NextIcon/index.js.map +0 -1
- package/lib/components/PrevIcon/PrevIcon.d.ts +0 -2
- package/lib/components/PrevIcon/PrevIcon.js +0 -6
- package/lib/components/PrevIcon/PrevIcon.js.map +0 -1
- package/lib/components/PrevIcon/index.d.ts +0 -1
- package/lib/components/PrevIcon/index.js +0 -2
- package/lib/components/PrevIcon/index.js.map +0 -1
- package/lib/components/Root/Root.d.ts +0 -3
- package/lib/components/Root/Root.js +0 -53
- package/lib/components/Root/Root.js.map +0 -1
- package/lib/components/Root/index.js +0 -2
- package/lib/components/Root/index.js.map +0 -1
- package/lib/components/Root/utils/getMonths.d.ts +0 -6
- package/lib/components/Root/utils/getMonths.js +0 -29
- package/lib/components/Root/utils/getMonths.js.map +0 -1
- package/lib/components/Root/utils/getMonths.test.d.ts +0 -1
- package/lib/components/Root/utils/getMonths.test.js +0 -41
- package/lib/components/Root/utils/getMonths.test.js.map +0 -1
- package/lib/components/Row/Row.d.ts +0 -3
- package/lib/components/Row/Row.js +0 -12
- package/lib/components/Row/Row.js.map +0 -1
- package/lib/components/Row/index.js +0 -2
- package/lib/components/Row/index.js.map +0 -1
- package/lib/components/Table/Table.d.ts +0 -3
- package/lib/components/Table/Table.js +0 -15
- package/lib/components/Table/Table.js.map +0 -1
- package/lib/components/Table/index.js +0 -2
- package/lib/components/Table/index.js.map +0 -1
- package/lib/components/Table/utils/getOutsideEndDays.d.ts +0 -2
- package/lib/components/Table/utils/getOutsideEndDays.js +0 -13
- package/lib/components/Table/utils/getOutsideEndDays.js.map +0 -1
- package/lib/components/Table/utils/getOutsideStartDays.d.ts +0 -2
- package/lib/components/Table/utils/getOutsideStartDays.js +0 -13
- package/lib/components/Table/utils/getOutsideStartDays.js.map +0 -1
- package/lib/components/Table/utils/getWeeks.d.ts +0 -13
- package/lib/components/Table/utils/getWeeks.js +0 -55
- package/lib/components/Table/utils/getWeeks.js.map +0 -1
- package/lib/components/index.d.ts +0 -10
- package/lib/components/index.js +0 -11
- package/lib/components/index.js.map +0 -1
- package/lib/hooks/index.d.ts +0 -2
- package/lib/hooks/index.js +0 -3
- package/lib/hooks/index.js.map +0 -1
- package/lib/hooks/useInput/index.js +0 -2
- package/lib/hooks/useInput/index.js.map +0 -1
- package/lib/hooks/useInput/useInput.d.ts +0 -22
- package/lib/hooks/useInput/useInput.js +0 -109
- package/lib/hooks/useInput/useInput.js.map +0 -1
- package/lib/hooks/useRange/addToRange.js +0 -25
- package/lib/hooks/useRange/addToRange.js.map +0 -1
- package/lib/hooks/useRange/index.d.ts +0 -2
- package/lib/hooks/useRange/index.js +0 -3
- package/lib/hooks/useRange/index.js.map +0 -1
- package/lib/hooks/useRange/useRange.d.ts +0 -14
- package/lib/hooks/useRange/useRange.js +0 -30
- package/lib/hooks/useRange/useRange.js.map +0 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -4
- package/lib/index.js.map +0 -1
- package/lib/types/CaptionProps.d.ts +0 -5
- package/lib/types/CaptionProps.js +0 -2
- package/lib/types/CaptionProps.js.map +0 -1
- package/lib/types/CustomizableComponents.d.ts +0 -12
- package/lib/types/CustomizableComponents.js +0 -2
- package/lib/types/CustomizableComponents.js.map +0 -1
- package/lib/types/DateFormatter.d.ts +0 -4
- package/lib/types/DateFormatter.js +0 -2
- package/lib/types/DateFormatter.js.map +0 -1
- package/lib/types/DayClickEventHandler.d.ts +0 -3
- package/lib/types/DayClickEventHandler.js +0 -2
- package/lib/types/DayClickEventHandler.js.map +0 -1
- package/lib/types/DayFocusEventHandler.d.ts +0 -3
- package/lib/types/DayFocusEventHandler.js +0 -2
- package/lib/types/DayFocusEventHandler.js.map +0 -1
- package/lib/types/DayKeyboardEventHandler.d.ts +0 -3
- package/lib/types/DayKeyboardEventHandler.js +0 -2
- package/lib/types/DayKeyboardEventHandler.js.map +0 -1
- package/lib/types/DayLabelFormatter.d.ts +0 -5
- package/lib/types/DayLabelFormatter.js +0 -2
- package/lib/types/DayLabelFormatter.js.map +0 -1
- package/lib/types/DayMouseEventHandler.d.ts +0 -3
- package/lib/types/DayMouseEventHandler.js +0 -2
- package/lib/types/DayMouseEventHandler.js.map +0 -1
- package/lib/types/DayPickerClassNames.d.ts +0 -4
- package/lib/types/DayPickerClassNames.js +0 -2
- package/lib/types/DayPickerClassNames.js.map +0 -1
- package/lib/types/DayPickerComponentProps.d.ts +0 -410
- package/lib/types/DayPickerComponentProps.js +0 -2
- package/lib/types/DayPickerComponentProps.js.map +0 -1
- package/lib/types/DayPickerProps.d.ts +0 -42
- package/lib/types/DayPickerProps.js +0 -2
- package/lib/types/DayPickerProps.js.map +0 -1
- package/lib/types/DayPickerStyles.d.ts +0 -5
- package/lib/types/DayPickerStyles.js +0 -2
- package/lib/types/DayPickerStyles.js.map +0 -1
- package/lib/types/DayProps.d.ts +0 -9
- package/lib/types/DayProps.js +0 -2
- package/lib/types/DayProps.js.map +0 -1
- package/lib/types/DayTouchEventHandler.d.ts +0 -3
- package/lib/types/DayTouchEventHandler.js +0 -2
- package/lib/types/DayTouchEventHandler.js.map +0 -1
- package/lib/types/DaysRange.d.ts +0 -4
- package/lib/types/DaysRange.js +0 -2
- package/lib/types/DaysRange.js.map +0 -1
- package/lib/types/DefaultModifier.d.ts +0 -1
- package/lib/types/DefaultModifier.js +0 -2
- package/lib/types/DefaultModifier.js.map +0 -1
- package/lib/types/HeadProps.d.ts +0 -5
- package/lib/types/HeadProps.js +0 -2
- package/lib/types/HeadProps.js.map +0 -1
- package/lib/types/LabelsFormatters.d.ts +0 -11
- package/lib/types/LabelsFormatters.js +0 -2
- package/lib/types/LabelsFormatters.js.map +0 -1
- package/lib/types/MatchAfter.d.ts +0 -6
- package/lib/types/MatchAfter.js +0 -2
- package/lib/types/MatchAfter.js.map +0 -1
- package/lib/types/MatchBefore.d.ts +0 -4
- package/lib/types/MatchBefore.js +0 -2
- package/lib/types/MatchBefore.js.map +0 -1
- package/lib/types/MatchDate.d.ts +0 -2
- package/lib/types/MatchDate.js +0 -2
- package/lib/types/MatchDate.js.map +0 -1
- package/lib/types/MatchDaysOfWeek.d.ts +0 -7
- package/lib/types/MatchDaysOfWeek.js +0 -2
- package/lib/types/MatchDaysOfWeek.js.map +0 -1
- package/lib/types/MatchFromTo.d.ts +0 -7
- package/lib/types/MatchFromTo.js +0 -2
- package/lib/types/MatchFromTo.js.map +0 -1
- package/lib/types/Matcher.d.ts +0 -10
- package/lib/types/Matcher.js +0 -2
- package/lib/types/Matcher.js.map +0 -1
- package/lib/types/Modifier.d.ts +0 -5
- package/lib/types/Modifier.js +0 -2
- package/lib/types/Modifier.js.map +0 -1
- package/lib/types/ModifiersClassNames.d.ts +0 -7
- package/lib/types/ModifiersClassNames.js +0 -2
- package/lib/types/ModifiersClassNames.js.map +0 -1
- package/lib/types/ModifiersMatchers.d.ts +0 -18
- package/lib/types/ModifiersMatchers.js +0 -2
- package/lib/types/ModifiersMatchers.js.map +0 -1
- package/lib/types/ModifiersStatus.d.ts +0 -19
- package/lib/types/ModifiersStatus.js +0 -2
- package/lib/types/ModifiersStatus.js.map +0 -1
- package/lib/types/ModifiersStyles.d.ts +0 -8
- package/lib/types/ModifiersStyles.js +0 -2
- package/lib/types/ModifiersStyles.js.map +0 -1
- package/lib/types/MonthChangeEventHandler.d.ts +0 -2
- package/lib/types/MonthChangeEventHandler.js +0 -2
- package/lib/types/MonthChangeEventHandler.js.map +0 -1
- package/lib/types/MonthKeyDownEventHandler.d.ts +0 -2
- package/lib/types/MonthKeyDownEventHandler.js +0 -2
- package/lib/types/MonthKeyDownEventHandler.js.map +0 -1
- package/lib/types/NavButtonLabelFormatter.d.ts +0 -5
- package/lib/types/NavButtonLabelFormatter.js +0 -2
- package/lib/types/NavButtonLabelFormatter.js.map +0 -1
- package/lib/types/NavigationProps.d.ts +0 -4
- package/lib/types/NavigationProps.js +0 -2
- package/lib/types/NavigationProps.js.map +0 -1
- package/lib/types/RootProps.d.ts +0 -4
- package/lib/types/RootProps.js +0 -2
- package/lib/types/RootProps.js.map +0 -1
- package/lib/types/RowProps.d.ts +0 -7
- package/lib/types/RowProps.js +0 -2
- package/lib/types/RowProps.js.map +0 -1
- package/lib/types/TableProps.d.ts +0 -5
- package/lib/types/TableProps.js +0 -2
- package/lib/types/TableProps.js.map +0 -1
- package/lib/types/UIElement.d.ts +0 -27
- package/lib/types/UIElement.js +0 -2
- package/lib/types/UIElement.js.map +0 -1
- package/lib/types/UseInput.d.ts +0 -8
- package/lib/types/UseInput.js +0 -2
- package/lib/types/UseInput.js.map +0 -1
- package/lib/types/UseInputOptions.d.ts +0 -5
- package/lib/types/UseInputOptions.js +0 -2
- package/lib/types/UseInputOptions.js.map +0 -1
- package/lib/types/WeekNumberFormatter.d.ts +0 -4
- package/lib/types/WeekNumberFormatter.js +0 -2
- package/lib/types/WeekNumberFormatter.js.map +0 -1
- package/lib/types/WeekNumberLabelFormatter.d.ts +0 -5
- package/lib/types/WeekNumberLabelFormatter.js +0 -2
- package/lib/types/WeekNumberLabelFormatter.js.map +0 -1
- package/lib/types/WeekNumberProps.d.ts +0 -6
- package/lib/types/WeekNumberProps.js +0 -2
- package/lib/types/WeekNumberProps.js.map +0 -1
- package/lib/types/WeekdayFormatter.d.ts +0 -4
- package/lib/types/WeekdayFormatter.js +0 -2
- package/lib/types/WeekdayFormatter.js.map +0 -1
- package/lib/types/WeekdayLabelFormatter.d.ts +0 -5
- package/lib/types/WeekdayLabelFormatter.js +0 -2
- package/lib/types/WeekdayLabelFormatter.js.map +0 -1
- package/lib/types/index.d.ts +0 -43
- package/lib/types/index.js +0 -44
- package/lib/types/index.js.map +0 -1
- package/src/components/Caption/Caption.tsx +0 -12
- package/src/components/Caption/getCaptionComponent.test.ts +0 -23
- package/src/components/Caption/getCaptionComponent.ts +0 -16
- package/src/components/Caption/index.ts +0 -2
- package/src/components/Day/Day.tsx +0 -32
- package/src/components/Day/getDayComponent.ts +0 -39
- package/src/components/Day/index.ts +0 -3
- package/src/components/Day/utils/createClassName.ts +0 -25
- package/src/components/Day/utils/createEventHandlers.ts +0 -111
- package/src/components/Day/utils/createStyle.ts +0 -21
- package/src/components/Day/utils/createTabIndex.ts +0 -27
- package/src/components/Day/utils/findModifiers.ts +0 -25
- package/src/components/Day/utils/getModifiers.ts +0 -47
- package/src/components/Day/utils/getModifiersFromProps.ts +0 -17
- package/src/components/Day/utils/getOutsideModifier.ts +0 -13
- package/src/components/Day/utils/matchModifier.ts +0 -84
- package/src/components/DayPicker/DayPicker.tsx +0 -81
- package/src/components/DayPicker/defaults/defaultClassNames.ts +0 -39
- package/src/components/DayPicker/defaults/defaultLabels.ts +0 -24
- package/src/components/DayPicker/defaults/defaultModifiers.ts +0 -11
- package/src/components/DayPicker/defaults/defaultModifiersClassNames.ts +0 -10
- package/src/components/DayPicker/defaults/defaultProps.ts +0 -49
- package/src/components/DayPicker/defaults/index.ts +0 -5
- package/src/components/DayPicker/index.ts +0 -2
- package/src/components/DayPicker/utils/formatCaption.ts +0 -12
- package/src/components/DayPicker/utils/formatDay.ts +0 -12
- package/src/components/DayPicker/utils/formatWeekNumber.ts +0 -7
- package/src/components/DayPicker/utils/formatWeekdayName.ts +0 -13
- package/src/components/DayPicker/utils/getMonthFromProps.tsx +0 -24
- package/src/components/Head/Head.tsx +0 -39
- package/src/components/Head/index.ts +0 -1
- package/src/components/Head/utils/getWeekdays.ts +0 -15
- package/src/components/Navigation/Navigation.tsx +0 -30
- package/src/components/Navigation/getNavigationComponent.test.ts +0 -10
- package/src/components/Navigation/getNavigationComponent.ts +0 -67
- package/src/components/Navigation/index.ts +0 -2
- package/src/components/Navigation/utils/getPrevNextMonths.test.ts +0 -51
- package/src/components/Navigation/utils/getPrevNextMonths.ts +0 -27
- package/src/components/NextIcon/NextIcon.tsx +0 -13
- package/src/components/NextIcon/index.ts +0 -1
- package/src/components/PrevIcon/PrevIcon.tsx +0 -13
- package/src/components/PrevIcon/index.ts +0 -1
- package/src/components/Root/Root.tsx +0 -83
- package/src/components/Root/index.ts +0 -1
- package/src/components/Root/utils/getMonths.test.ts +0 -45
- package/src/components/Root/utils/getMonths.ts +0 -33
- package/src/components/Row/Row.tsx +0 -48
- package/src/components/Row/index.ts +0 -1
- package/src/components/Table/Table.tsx +0 -37
- package/src/components/Table/index.ts +0 -1
- package/src/components/Table/utils/getOutsideEndDays.ts +0 -18
- package/src/components/Table/utils/getOutsideStartDays.ts +0 -18
- package/src/components/Table/utils/getWeeks.ts +0 -83
- package/src/components/index.ts +0 -10
- package/src/hooks/index.ts +0 -2
- package/src/hooks/useInput/index.ts +0 -1
- package/src/hooks/useInput/useInput.ts +0 -122
- package/src/hooks/useRange/addToRange.ts +0 -27
- package/src/hooks/useRange/index.ts +0 -2
- package/src/hooks/useRange/useRange.ts +0 -35
- package/src/style.css +0 -144
- package/src/types/CaptionProps.ts +0 -6
- package/src/types/CustomizableComponents.ts +0 -13
- package/src/types/DateFormatter.ts +0 -6
- package/src/types/DayClickEventHandler.ts +0 -7
- package/src/types/DayFocusEventHandler.ts +0 -7
- package/src/types/DayKeyboardEventHandler.ts +0 -7
- package/src/types/DayLabelFormatter.ts +0 -10
- package/src/types/DayMouseEventHandler.ts +0 -7
- package/src/types/DayPickerClassNames.ts +0 -5
- package/src/types/DayPickerComponentProps.ts +0 -437
- package/src/types/DayPickerProps.ts +0 -48
- package/src/types/DayPickerStyles.ts +0 -5
- package/src/types/DayProps.ts +0 -10
- package/src/types/DayTouchEventHandler.ts +0 -7
- package/src/types/DaysRange.ts +0 -1
- package/src/types/DefaultModifier.ts +0 -8
- package/src/types/HeadProps.ts +0 -6
- package/src/types/LabelsFormatters.ts +0 -17
- package/src/types/MatchAfter.ts +0 -4
- package/src/types/MatchBefore.ts +0 -2
- package/src/types/MatchDate.ts +0 -2
- package/src/types/MatchDaysOfWeek.ts +0 -5
- package/src/types/MatchFromTo.ts +0 -4
- package/src/types/Matcher.ts +0 -18
- package/src/types/Modifier.ts +0 -6
- package/src/types/ModifiersClassNames.ts +0 -8
- package/src/types/ModifiersMatchers.ts +0 -19
- package/src/types/ModifiersStatus.ts +0 -20
- package/src/types/ModifiersStyles.ts +0 -8
- package/src/types/MonthChangeEventHandler.ts +0 -4
- package/src/types/MonthKeyDownEventHandler.ts +0 -4
- package/src/types/NavButtonLabelFormatter.ts +0 -9
- package/src/types/NavigationProps.ts +0 -5
- package/src/types/RootProps.ts +0 -5
- package/src/types/RowProps.ts +0 -9
- package/src/types/TableProps.ts +0 -6
- package/src/types/UIElement.ts +0 -33
- package/src/types/UseInput.ts +0 -9
- package/src/types/UseInputOptions.ts +0 -6
- package/src/types/WeekNumberFormatter.ts +0 -6
- package/src/types/WeekNumberLabelFormatter.ts +0 -9
- package/src/types/WeekNumberProps.ts +0 -7
- package/src/types/WeekdayFormatter.ts +0 -7
- package/src/types/WeekdayLabelFormatter.ts +0 -9
- package/src/types/index.ts +0 -43
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2014-2021 Giampaolo Bellavite <io@gpbl.dev>
|
|
3
|
+
Copyright (c) 2014-2021 Giampaolo Bellavite <io@gpbl.dev> and contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,42 +1,29 @@
|
|
|
1
|
-
# DayPicker
|
|
1
|
+
# React DayPicker (beta)
|
|
2
2
|
|
|
3
|
-
DayPicker is a
|
|
3
|
+
DayPicker is a date picker component for [React](https://reactjs.org).
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
$ npm install react-day-picker@next
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### Beta version ⚠️
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
and not ready for production. For the stable version see the [**v7
|
|
13
|
-
branch**](https://github.com/gpbl/react-day-picker/tree/v7).
|
|
11
|
+
The [**master branch**](https://github.com/gpbl/react-day-picker/tree/master) is for the next major version 8 – which is currently in development
|
|
12
|
+
and not ready for production. For the stable version see the [**v7 branch**](https://github.com/gpbl/react-day-picker/tree/v7).
|
|
14
13
|
|
|
15
14
|
## Main features
|
|
16
15
|
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
- support
|
|
20
|
-
|
|
21
|
-
- localizable
|
|
22
|
-
-
|
|
16
|
+
- ☀️ select days, ranges or whatever
|
|
17
|
+
- 🗓 create multiple calendars
|
|
18
|
+
- ♿️ complete [ARIA](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) support
|
|
19
|
+
- ➡️ keyboard navigation
|
|
20
|
+
- 🌎 localizable in any language
|
|
21
|
+
- 🎨 easy to style and customize
|
|
22
|
+
- 🤖 native Typescript support
|
|
23
|
+
- 📄 easy integration with input elements
|
|
24
|
+
- 🧘♀️ using [date-fns](http://date-fns.org) as date library
|
|
23
25
|
|
|
24
26
|
## Documentation
|
|
25
27
|
|
|
26
28
|
- [v7 website (current version)](http://react-day-picker.js.org)
|
|
27
29
|
- [v8 website (beta)](http://react-day-picker-next.netlify.app)
|
|
28
|
-
|
|
29
|
-
## Example
|
|
30
|
-
|
|
31
|
-
```jsx showOutput
|
|
32
|
-
function Example() {
|
|
33
|
-
const [selected, setSelected] = useState();
|
|
34
|
-
|
|
35
|
-
const handleDayClick = (day, { selected }) => {
|
|
36
|
-
if (!selected) setSelected(day);
|
|
37
|
-
else setSelected();
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return <DayPicker selected={selected} onDayClick={handleDayClick} />;
|
|
41
|
-
}
|
|
42
|
-
```
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DayPickerCustomProps, DayPickerMultipleProps, DayPickerProps, DayPickerRangeProps, DayPickerSingleProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* DayPicker render a date picker component to let users pick dates from a
|
|
5
|
+
* calendar. See http://react-day-picker.js.org for updated documentation and
|
|
6
|
+
* examples.
|
|
7
|
+
*
|
|
8
|
+
* ### Customization
|
|
9
|
+
*
|
|
10
|
+
* DayPicker offers different customization props. For example,
|
|
11
|
+
*
|
|
12
|
+
* - show multiple months using `numberOfMonths`
|
|
13
|
+
* - display a dropdown to navigate the months via `captionLayout`
|
|
14
|
+
* - display the week numbers with `showWeekNumbers`
|
|
15
|
+
* - disable or hide days with `disabled` or `hidden`
|
|
16
|
+
*
|
|
17
|
+
* ### Controlling the months
|
|
18
|
+
*
|
|
19
|
+
* Change the initially displayed month using the `defaultMonth` prop. The
|
|
20
|
+
* displayed months are controlled by DayPicker and stored in its internal
|
|
21
|
+
* state. To control the months yourself, use `month` instead of `defaultMonth`
|
|
22
|
+
* and use the `onMonthChange` event to set it.
|
|
23
|
+
*
|
|
24
|
+
* To limit the months the user can navigate to, use
|
|
25
|
+
* `fromDate`/`fromMonth`/`fromYear` or `toDate`/`toMonth`/`toYear`.
|
|
26
|
+
*
|
|
27
|
+
* ### Selection modes
|
|
28
|
+
*
|
|
29
|
+
* DayPicker supports different selection mode that can be toggled using the
|
|
30
|
+
* `mode` prop:
|
|
31
|
+
*
|
|
32
|
+
* - `mode="single"`: only one day can be selected. Use `required` to make the
|
|
33
|
+
* selection required. Use the `onSelect` event handler to get the selected
|
|
34
|
+
* days.
|
|
35
|
+
* - `mode="multiple"`: users can select one or more days. Limit the amount of
|
|
36
|
+
* days that can be selected with the `min` or the `max` props.
|
|
37
|
+
* - `mode="range"`: users can select a range of days. Limit the amount of days
|
|
38
|
+
* in the range with the `min` or the `max` props.
|
|
39
|
+
* - `mode="custom"`: implement your own selection mode with `onDayClick`.
|
|
40
|
+
*
|
|
41
|
+
* These selection modes should cover the most common use cases. In case you
|
|
42
|
+
* need a more refined way of selecting days, use `mode="custom"`. Use the
|
|
43
|
+
* `selected` props and add the day event handlers to add/remove days from the
|
|
44
|
+
* selection.
|
|
45
|
+
*
|
|
46
|
+
* ### Modifiers
|
|
47
|
+
*
|
|
48
|
+
* A _modifier_ represents different styles or states for the days displayed in
|
|
49
|
+
* the calendar (like "selected" or "disabled"). Define custom modifiers using
|
|
50
|
+
* the `modifiers` prop.
|
|
51
|
+
*
|
|
52
|
+
* ### Formatters and custom component
|
|
53
|
+
*
|
|
54
|
+
* You can customize how the content is displayed in the date picker by using
|
|
55
|
+
* either the formatters or replacing the internal components.
|
|
56
|
+
*
|
|
57
|
+
* For the most common cases you want to use the `formatters` prop to change how
|
|
58
|
+
* the content is formatted in the calendar. Use the `components` prop to
|
|
59
|
+
* replace the internal components, like the navigation icons.
|
|
60
|
+
*
|
|
61
|
+
* ### Styling
|
|
62
|
+
*
|
|
63
|
+
* DayPicker comes with a default, basic style in `react-day-picker/style` – use
|
|
64
|
+
* it as template for your own style.
|
|
65
|
+
*
|
|
66
|
+
* If you are using CSS modules, pass the imported styles object the
|
|
67
|
+
* `classNames` props.
|
|
68
|
+
*
|
|
69
|
+
* You can also style the elements via inline-styles using the `styles` prop.
|
|
70
|
+
*
|
|
71
|
+
* ### Form fields
|
|
72
|
+
*
|
|
73
|
+
* If you need to bind the date picker to a form field, you can use the
|
|
74
|
+
* `useInput` hooks for a basic behavior. See the `useInput` source as an
|
|
75
|
+
* example to bind the date picker with form fields.
|
|
76
|
+
*
|
|
77
|
+
* ### Localization
|
|
78
|
+
*
|
|
79
|
+
* To localize DayPicker, import the locale from `date-fns` package and use the
|
|
80
|
+
* `locale` prop.
|
|
81
|
+
*
|
|
82
|
+
* For example, to use Spanish locale:
|
|
83
|
+
*
|
|
84
|
+
* ```
|
|
85
|
+
* import es from 'date-fns/locale/es';
|
|
86
|
+
* <DayPicker locale={es} />
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare function DayPicker(props: DayPickerProps | DayPickerSingleProps | DayPickerMultipleProps | DayPickerRangeProps | DayPickerCustomProps): JSX.Element;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { __assign } from './_virtual/_tslib.js';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Root } from './components/Root/Root.js';
|
|
4
|
+
import { RootProvider } from './contexts/RootProvider.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* DayPicker render a date picker component to let users pick dates from a
|
|
8
|
+
* calendar. See http://react-day-picker.js.org for updated documentation and
|
|
9
|
+
* examples.
|
|
10
|
+
*
|
|
11
|
+
* ### Customization
|
|
12
|
+
*
|
|
13
|
+
* DayPicker offers different customization props. For example,
|
|
14
|
+
*
|
|
15
|
+
* - show multiple months using `numberOfMonths`
|
|
16
|
+
* - display a dropdown to navigate the months via `captionLayout`
|
|
17
|
+
* - display the week numbers with `showWeekNumbers`
|
|
18
|
+
* - disable or hide days with `disabled` or `hidden`
|
|
19
|
+
*
|
|
20
|
+
* ### Controlling the months
|
|
21
|
+
*
|
|
22
|
+
* Change the initially displayed month using the `defaultMonth` prop. The
|
|
23
|
+
* displayed months are controlled by DayPicker and stored in its internal
|
|
24
|
+
* state. To control the months yourself, use `month` instead of `defaultMonth`
|
|
25
|
+
* and use the `onMonthChange` event to set it.
|
|
26
|
+
*
|
|
27
|
+
* To limit the months the user can navigate to, use
|
|
28
|
+
* `fromDate`/`fromMonth`/`fromYear` or `toDate`/`toMonth`/`toYear`.
|
|
29
|
+
*
|
|
30
|
+
* ### Selection modes
|
|
31
|
+
*
|
|
32
|
+
* DayPicker supports different selection mode that can be toggled using the
|
|
33
|
+
* `mode` prop:
|
|
34
|
+
*
|
|
35
|
+
* - `mode="single"`: only one day can be selected. Use `required` to make the
|
|
36
|
+
* selection required. Use the `onSelect` event handler to get the selected
|
|
37
|
+
* days.
|
|
38
|
+
* - `mode="multiple"`: users can select one or more days. Limit the amount of
|
|
39
|
+
* days that can be selected with the `min` or the `max` props.
|
|
40
|
+
* - `mode="range"`: users can select a range of days. Limit the amount of days
|
|
41
|
+
* in the range with the `min` or the `max` props.
|
|
42
|
+
* - `mode="custom"`: implement your own selection mode with `onDayClick`.
|
|
43
|
+
*
|
|
44
|
+
* These selection modes should cover the most common use cases. In case you
|
|
45
|
+
* need a more refined way of selecting days, use `mode="custom"`. Use the
|
|
46
|
+
* `selected` props and add the day event handlers to add/remove days from the
|
|
47
|
+
* selection.
|
|
48
|
+
*
|
|
49
|
+
* ### Modifiers
|
|
50
|
+
*
|
|
51
|
+
* A _modifier_ represents different styles or states for the days displayed in
|
|
52
|
+
* the calendar (like "selected" or "disabled"). Define custom modifiers using
|
|
53
|
+
* the `modifiers` prop.
|
|
54
|
+
*
|
|
55
|
+
* ### Formatters and custom component
|
|
56
|
+
*
|
|
57
|
+
* You can customize how the content is displayed in the date picker by using
|
|
58
|
+
* either the formatters or replacing the internal components.
|
|
59
|
+
*
|
|
60
|
+
* For the most common cases you want to use the `formatters` prop to change how
|
|
61
|
+
* the content is formatted in the calendar. Use the `components` prop to
|
|
62
|
+
* replace the internal components, like the navigation icons.
|
|
63
|
+
*
|
|
64
|
+
* ### Styling
|
|
65
|
+
*
|
|
66
|
+
* DayPicker comes with a default, basic style in `react-day-picker/style` – use
|
|
67
|
+
* it as template for your own style.
|
|
68
|
+
*
|
|
69
|
+
* If you are using CSS modules, pass the imported styles object the
|
|
70
|
+
* `classNames` props.
|
|
71
|
+
*
|
|
72
|
+
* You can also style the elements via inline-styles using the `styles` prop.
|
|
73
|
+
*
|
|
74
|
+
* ### Form fields
|
|
75
|
+
*
|
|
76
|
+
* If you need to bind the date picker to a form field, you can use the
|
|
77
|
+
* `useInput` hooks for a basic behavior. See the `useInput` source as an
|
|
78
|
+
* example to bind the date picker with form fields.
|
|
79
|
+
*
|
|
80
|
+
* ### Localization
|
|
81
|
+
*
|
|
82
|
+
* To localize DayPicker, import the locale from `date-fns` package and use the
|
|
83
|
+
* `locale` prop.
|
|
84
|
+
*
|
|
85
|
+
* For example, to use Spanish locale:
|
|
86
|
+
*
|
|
87
|
+
* ```
|
|
88
|
+
* import es from 'date-fns/locale/es';
|
|
89
|
+
* <DayPicker locale={es} />
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
function DayPicker(props) {
|
|
93
|
+
return (React.createElement(RootProvider, __assign({}, props),
|
|
94
|
+
React.createElement(Root, null)));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { DayPicker };
|
|
98
|
+
//# sourceMappingURL=DayPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DayPicker.js","sources":["../src/DayPicker.tsx"],"sourcesContent":["import React from 'react';\n\nimport {\n DayPickerCustomProps,\n DayPickerMultipleProps,\n DayPickerProps,\n DayPickerRangeProps,\n DayPickerSingleProps\n} from './types';\n\nimport { Root } from './components/Root';\nimport { RootProvider } from './contexts/RootProvider';\n\n/**\n * DayPicker render a date picker component to let users pick dates from a\n * calendar. See http://react-day-picker.js.org for updated documentation and\n * examples.\n *\n * ### Customization\n *\n * DayPicker offers different customization props. For example,\n *\n * - show multiple months using `numberOfMonths`\n * - display a dropdown to navigate the months via `captionLayout`\n * - display the week numbers with `showWeekNumbers`\n * - disable or hide days with `disabled` or `hidden`\n *\n * ### Controlling the months\n *\n * Change the initially displayed month using the `defaultMonth` prop. The\n * displayed months are controlled by DayPicker and stored in its internal\n * state. To control the months yourself, use `month` instead of `defaultMonth`\n * and use the `onMonthChange` event to set it.\n *\n * To limit the months the user can navigate to, use\n * `fromDate`/`fromMonth`/`fromYear` or `toDate`/`toMonth`/`toYear`.\n *\n * ### Selection modes\n *\n * DayPicker supports different selection mode that can be toggled using the\n * `mode` prop:\n *\n * - `mode=\"single\"`: only one day can be selected. Use `required` to make the\n * selection required. Use the `onSelect` event handler to get the selected\n * days.\n * - `mode=\"multiple\"`: users can select one or more days. Limit the amount of\n * days that can be selected with the `min` or the `max` props.\n * - `mode=\"range\"`: users can select a range of days. Limit the amount of days\n * in the range with the `min` or the `max` props.\n * - `mode=\"custom\"`: implement your own selection mode with `onDayClick`.\n *\n * These selection modes should cover the most common use cases. In case you\n * need a more refined way of selecting days, use `mode=\"custom\"`. Use the\n * `selected` props and add the day event handlers to add/remove days from the\n * selection.\n *\n * ### Modifiers\n *\n * A _modifier_ represents different styles or states for the days displayed in\n * the calendar (like \"selected\" or \"disabled\"). Define custom modifiers using\n * the `modifiers` prop.\n *\n * ### Formatters and custom component\n *\n * You can customize how the content is displayed in the date picker by using\n * either the formatters or replacing the internal components.\n *\n * For the most common cases you want to use the `formatters` prop to change how\n * the content is formatted in the calendar. Use the `components` prop to\n * replace the internal components, like the navigation icons.\n *\n * ### Styling\n *\n * DayPicker comes with a default, basic style in `react-day-picker/style` – use\n * it as template for your own style.\n *\n * If you are using CSS modules, pass the imported styles object the\n * `classNames` props.\n *\n * You can also style the elements via inline-styles using the `styles` prop.\n *\n * ### Form fields\n *\n * If you need to bind the date picker to a form field, you can use the\n * `useInput` hooks for a basic behavior. See the `useInput` source as an\n * example to bind the date picker with form fields.\n *\n * ### Localization\n *\n * To localize DayPicker, import the locale from `date-fns` package and use the\n * `locale` prop.\n *\n * For example, to use Spanish locale:\n *\n * ```\n * import es from 'date-fns/locale/es';\n * <DayPicker locale={es} />\n * ```\n */\nexport function DayPicker(\n props:\n | DayPickerProps\n | DayPickerSingleProps\n | DayPickerMultipleProps\n | DayPickerRangeProps\n | DayPickerCustomProps\n): JSX.Element {\n return (\n <RootProvider {...props}>\n <Root />\n </RootProvider>\n );\n}\n"],"names":[],"mappings":";;;;;AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAsFgB,SAAS,CACvB,KAKwB;IAExB,QACE,oBAAC,YAAY,eAAK,KAAK;QACrB,oBAAC,IAAI,OAAG,CACK,EACf;AACJ;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
|
|
16
|
+
var __assign = function() {
|
|
17
|
+
__assign = Object.assign || function __assign(t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
return __assign.apply(this, arguments);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function __rest(s, e) {
|
|
28
|
+
var t = {};
|
|
29
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
30
|
+
t[p] = s[p];
|
|
31
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
32
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
34
|
+
t[p[i]] = s[p[i]];
|
|
35
|
+
}
|
|
36
|
+
return t;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function __spreadArray(to, from, pack) {
|
|
40
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
41
|
+
if (ar || !(i in from)) {
|
|
42
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
43
|
+
ar[i] = from[i];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { __assign, __rest, __spreadArray };
|
|
50
|
+
//# sourceMappingURL=_tslib.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_tslib.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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, "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "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" | "children" | "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>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __assign } from '../../_virtual/_tslib.js';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useDayPicker } from '../../contexts/DayPicker/useDayPicker.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Render a button HTML element applying the reset class name.
|
|
7
|
+
*/
|
|
8
|
+
var Button = React.forwardRef(function (props, ref) {
|
|
9
|
+
var _a = useDayPicker(), classNames = _a.classNames, styles = _a.styles;
|
|
10
|
+
var classNamesArr = [classNames.button_reset, classNames.button];
|
|
11
|
+
if (props.className) {
|
|
12
|
+
classNamesArr.push(props.className);
|
|
13
|
+
}
|
|
14
|
+
var className = classNamesArr.join(' ');
|
|
15
|
+
var style = __assign(__assign({}, styles.button_reset), styles.button);
|
|
16
|
+
if (props.style) {
|
|
17
|
+
Object.assign(style, props.style);
|
|
18
|
+
}
|
|
19
|
+
return (React.createElement("button", __assign({}, props, { ref: ref, type: "button", className: className, style: style })));
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export { Button };
|
|
23
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useDayPicker } from '../../contexts/DayPicker';\n\n/** The props for the [[Button]] component. */\nexport type ButtonProps = React.HTMLProps<HTMLButtonElement>;\n\n/**\n * Render a button HTML element applying the reset class name.\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (props, ref) => {\n const { classNames, styles } = useDayPicker();\n\n const classNamesArr = [classNames.button_reset, classNames.button];\n if (props.className) {\n classNamesArr.push(props.className);\n }\n const className = classNamesArr.join(' ');\n\n const style = { ...styles.button_reset, ...styles.button };\n if (props.style) {\n Object.assign(style, props.style);\n }\n\n return (\n <button\n {...props}\n ref={ref}\n type=\"button\"\n className={className}\n style={style}\n />\n );\n }\n);\n"],"names":[],"mappings":";;;;AAOA;;;IAGa,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,QACE,2CACM,KAAK,IACT,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,IACZ,EACF;AACJ,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Button';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/** Represent the props of the [[Caption]] component. */
|
|
3
|
+
export interface CaptionProps {
|
|
4
|
+
/** The month where the caption is displayed. */
|
|
5
|
+
displayMonth: Date;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The layout of the caption:
|
|
9
|
+
*
|
|
10
|
+
* - `dropdown` - display a month / year dropdown
|
|
11
|
+
* - `buttons` - display previous / next month button.
|
|
12
|
+
*/
|
|
13
|
+
export declare type CaptionLayout = 'dropdown' | 'buttons';
|
|
14
|
+
/**
|
|
15
|
+
* Render the caption of a month, which includes title and navigation buttons.
|
|
16
|
+
* The caption has a different layout when setting the `numberOfMonths` prop.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Caption(props: CaptionProps): JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { isSameMonth } from 'date-fns';
|
|
3
|
+
import { useDayPicker } from '../../contexts/DayPicker/useDayPicker.js';
|
|
4
|
+
import '../../contexts/Navigation/NavigationContext.js';
|
|
5
|
+
import { useNavigation } from '../../contexts/Navigation/useNavigation.js';
|
|
6
|
+
import { MonthsDropdown } from '../MonthsDropdown/MonthsDropdown.js';
|
|
7
|
+
import { Navigation } from '../Navigation/Navigation.js';
|
|
8
|
+
import { YearsDropdown } from '../YearsDropdown/YearsDropdown.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Render the caption of a month, which includes title and navigation buttons.
|
|
12
|
+
* The caption has a different layout when setting the `numberOfMonths` prop.
|
|
13
|
+
*/
|
|
14
|
+
function Caption(props) {
|
|
15
|
+
var _a;
|
|
16
|
+
var displayMonth = props.displayMonth;
|
|
17
|
+
var context = useDayPicker();
|
|
18
|
+
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;
|
|
19
|
+
var _b = useNavigation(), previousMonth = _b.previousMonth, nextMonth = _b.nextMonth, goToMonth = _b.goToMonth, displayMonths = _b.displayMonths;
|
|
20
|
+
var handlePreviousClick = function (e) {
|
|
21
|
+
if (!previousMonth)
|
|
22
|
+
return;
|
|
23
|
+
goToMonth(previousMonth);
|
|
24
|
+
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(previousMonth);
|
|
25
|
+
};
|
|
26
|
+
var handleNextClick = function (e) {
|
|
27
|
+
if (!nextMonth)
|
|
28
|
+
return;
|
|
29
|
+
goToMonth(nextMonth);
|
|
30
|
+
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(nextMonth);
|
|
31
|
+
};
|
|
32
|
+
var handleMonthChange = function (newMonth) {
|
|
33
|
+
goToMonth(newMonth);
|
|
34
|
+
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(newMonth);
|
|
35
|
+
};
|
|
36
|
+
var displayIndex = displayMonths.findIndex(function (month) {
|
|
37
|
+
return isSameMonth(displayMonth, month);
|
|
38
|
+
});
|
|
39
|
+
var isFirst = displayIndex === 0;
|
|
40
|
+
var isLast = displayIndex === displayMonths.length - 1;
|
|
41
|
+
if (dir === 'rtl') {
|
|
42
|
+
_a = [isFirst, isLast], isLast = _a[0], isFirst = _a[1];
|
|
43
|
+
}
|
|
44
|
+
var captionLabel = React.createElement(CaptionLabel, { displayMonth: displayMonth });
|
|
45
|
+
var hideNext = numberOfMonths > 1 && (isFirst || !isLast);
|
|
46
|
+
var hidePrevious = numberOfMonths > 1 && (isLast || !isFirst);
|
|
47
|
+
return (React.createElement("div", { className: classNames.caption, style: styles.caption },
|
|
48
|
+
disableNavigation && captionLabel,
|
|
49
|
+
!disableNavigation && (React.createElement(React.Fragment, null, captionLayout === 'dropdown' ? (React.createElement("div", { className: classNames.caption_dropdowns, style: styles.caption_dropdowns },
|
|
50
|
+
React.createElement(MonthsDropdown, { onChange: handleMonthChange, displayMonth: displayMonth }),
|
|
51
|
+
React.createElement(YearsDropdown, { onChange: handleMonthChange, displayMonth: displayMonth }))) : (React.createElement(React.Fragment, null,
|
|
52
|
+
React.createElement(CaptionLabel, { displayMonth: displayMonth }),
|
|
53
|
+
React.createElement(Navigation, { displayMonth: displayMonth, hideNext: hideNext, hidePrevious: hidePrevious, nextMonth: nextMonth, previousMonth: previousMonth, onPreviousClick: handlePreviousClick, onNextClick: handleNextClick })))))));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { Caption };
|
|
57
|
+
//# sourceMappingURL=Caption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Caption.js","sources":["../../../src/components/Caption/Caption.tsx"],"sourcesContent":["import React from 'react';\n\nimport { isSameMonth } from 'date-fns';\n\nimport { useDayPicker } from '../../contexts/DayPicker';\nimport { useNavigation } from '../../contexts/Navigation';\nimport { MonthsDropdown } from '../MonthsDropdown';\nimport { Navigation } from '../Navigation';\nimport { YearsDropdown } from '../YearsDropdown';\nimport { MonthChangeEventHandler } from '../../types/EventHandlers';\n\n/** Represent the props of the [[Caption]] component. */\nexport interface CaptionProps {\n /** The month where the caption is displayed. */\n displayMonth: Date;\n}\n\n/**\n * The layout of the caption:\n *\n * - `dropdown` - display a month / year dropdown\n * - `buttons` - display previous / next month button.\n */\nexport type CaptionLayout = 'dropdown' | 'buttons';\n\n/**\n * Render the caption of a month, which includes title and navigation buttons.\n * The caption has a different layout when setting the `numberOfMonths` prop.\n */\nexport function Caption(props: CaptionProps): JSX.Element {\n const { displayMonth } = props;\n const context = useDayPicker();\n const {\n classNames,\n numberOfMonths,\n disableNavigation,\n styles,\n captionLayout,\n onMonthChange,\n dir,\n components: { CaptionLabel }\n } = context;\n\n const { previousMonth, nextMonth, goToMonth, displayMonths } =\n useNavigation();\n\n const handlePreviousClick: React.MouseEventHandler = (e) => {\n if (!previousMonth) return;\n goToMonth(previousMonth);\n onMonthChange?.(previousMonth);\n };\n\n const handleNextClick: React.MouseEventHandler = (e) => {\n if (!nextMonth) return;\n goToMonth(nextMonth);\n onMonthChange?.(nextMonth);\n };\n\n const handleMonthChange: MonthChangeEventHandler = (newMonth) => {\n goToMonth(newMonth);\n onMonthChange?.(newMonth);\n };\n\n const displayIndex = displayMonths.findIndex((month) =>\n isSameMonth(displayMonth, month)\n );\n let isFirst = displayIndex === 0;\n let isLast = displayIndex === displayMonths.length - 1;\n if (dir === 'rtl') {\n [isLast, isFirst] = [isFirst, isLast];\n }\n\n const captionLabel = <CaptionLabel displayMonth={displayMonth} />;\n const hideNext = numberOfMonths > 1 && (isFirst || !isLast);\n const hidePrevious = numberOfMonths > 1 && (isLast || !isFirst);\n\n return (\n <div className={classNames.caption} style={styles.caption}>\n {disableNavigation && captionLabel}\n {!disableNavigation && (\n <>\n {captionLayout === 'dropdown' ? (\n <div\n className={classNames.caption_dropdowns}\n style={styles.caption_dropdowns}\n >\n <MonthsDropdown\n onChange={handleMonthChange}\n displayMonth={displayMonth}\n />\n <YearsDropdown\n onChange={handleMonthChange}\n displayMonth={displayMonth}\n />\n </div>\n ) : (\n <>\n <CaptionLabel displayMonth={displayMonth} />\n <Navigation\n displayMonth={displayMonth}\n hideNext={hideNext}\n hidePrevious={hidePrevious}\n nextMonth={nextMonth}\n previousMonth={previousMonth}\n onPreviousClick={handlePreviousClick}\n onNextClick={handleNextClick}\n />\n </>\n )}\n </>\n )}\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAyBA;;;;SAIgB,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,UAAC,CAAC;QACrD,IAAI,CAAC,aAAa;YAAE,OAAO;QAC3B,SAAS,CAAC,aAAa,CAAC,CAAC;QACzB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,aAAa,CAAC,CAAC;KAChC,CAAC;IAEF,IAAM,eAAe,GAA4B,UAAC,CAAC;QACjD,IAAI,CAAC,SAAS;YAAE,OAAO;QACvB,SAAS,CAAC,SAAS,CAAC,CAAC;QACrB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,SAAS,CAAC,CAAC;KAC5B,CAAC;IAEF,IAAM,iBAAiB,GAA4B,UAAC,QAAQ;QAC1D,SAAS,CAAC,QAAQ,CAAC,CAAC;QACpB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,QAAQ,CAAC,CAAC;KAC3B,CAAC;IAEF,IAAM,YAAY,GAAG,aAAa,CAAC,SAAS,CAAC,UAAC,KAAK;QACjD,OAAA,WAAW,CAAC,YAAY,EAAE,KAAK,CAAC;KAAA,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,YAAY,GAAG,oBAAC,YAAY,IAAC,YAAY,EAAE,YAAY,GAAI,CAAC;IAClE,IAAM,QAAQ,GAAG,cAAc,GAAG,CAAC,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5D,IAAM,YAAY,GAAG,cAAc,GAAG,CAAC,KAAK,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;IAEhE,QACE,6BAAK,SAAS,EAAE,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO;QACtD,iBAAiB,IAAI,YAAY;QACjC,CAAC,iBAAiB,KACjB,0CACG,aAAa,KAAK,UAAU,IAC3B,6BACE,SAAS,EAAE,UAAU,CAAC,iBAAiB,EACvC,KAAK,EAAE,MAAM,CAAC,iBAAiB;YAE/B,oBAAC,cAAc,IACb,QAAQ,EAAE,iBAAiB,EAC3B,YAAY,EAAE,YAAY,GAC1B;YACF,oBAAC,aAAa,IACZ,QAAQ,EAAE,iBAAiB,EAC3B,YAAY,EAAE,YAAY,GAC1B,CACE,KAEN;YACE,oBAAC,YAAY,IAAC,YAAY,EAAE,YAAY,GAAI;YAC5C,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,CACA,CACJ,CACG,EACN;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Caption';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/** The props for the [[CaptionLabel]] component. */
|
|
3
|
+
export interface CaptionLabelProps {
|
|
4
|
+
/** The month where the caption is displayed. */
|
|
5
|
+
displayMonth: Date;
|
|
6
|
+
}
|
|
7
|
+
/** Render the caption for the displayed month. This component is used when `captionLayout="buttons"`. */
|
|
8
|
+
export declare function CaptionLabel(props: CaptionLabelProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useDayPicker } from '../../contexts/DayPicker/useDayPicker.js';
|
|
3
|
+
|
|
4
|
+
/** Render the caption for the displayed month. This component is used when `captionLayout="buttons"`. */
|
|
5
|
+
function CaptionLabel(props) {
|
|
6
|
+
var _a = useDayPicker(), locale = _a.locale, classNames = _a.classNames, styles = _a.styles, formatCaption = _a.formatters.formatCaption;
|
|
7
|
+
return (React.createElement("div", { key: "caption", className: classNames.caption_label, style: styles.caption_label, "aria-live": "polite", "aria-atomic": "true" }, formatCaption(props.displayMonth, { locale: locale })));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { CaptionLabel };
|
|
11
|
+
//# sourceMappingURL=CaptionLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaptionLabel.js","sources":["../../../src/components/CaptionLabel/CaptionLabel.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useDayPicker } from '../../contexts/DayPicker';\n\n/** The props for the [[CaptionLabel]] component. */\nexport interface CaptionLabelProps {\n /** The month where the caption is displayed. */\n displayMonth: Date;\n}\n\n/** Render the caption for the displayed month. This component is used when `captionLayout=\"buttons\"`. */\nexport function CaptionLabel(props: CaptionLabelProps): JSX.Element {\n const {\n locale,\n classNames,\n styles,\n formatters: { formatCaption }\n } = useDayPicker();\n return (\n <div\n key=\"caption\"\n className={classNames.caption_label}\n style={styles.caption_label}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {formatCaption(props.displayMonth, { locale })}\n </div>\n );\n}\n"],"names":[],"mappings":";;;AAUA;SACgB,YAAY,CAAC,KAAwB;IAC7C,IAAA,KAKF,YAAY,EAAE,EAJhB,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,MAAM,YAAA,EACQ,aAAa,8BACX,CAAC;IACnB,QACE,6BACE,GAAG,EAAC,SAAS,EACb,SAAS,EAAE,UAAU,CAAC,aAAa,EACnC,KAAK,EAAE,MAAM,CAAC,aAAa,eACjB,QAAQ,iBACN,MAAM,IAEjB,aAAa,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,CAC1C,EACN;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CaptionLabel';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/** Represent the props used by the [[Day]] component. */
|
|
3
|
+
export interface DayProps {
|
|
4
|
+
/** The month where the date is displayed. */
|
|
5
|
+
displayMonth: Date;
|
|
6
|
+
/** The date to render. */
|
|
7
|
+
date: Date;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The content of a day cell – as a button or span element according to its
|
|
11
|
+
* modifiers.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Day(props: DayProps): JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __assign } from '../../_virtual/_tslib.js';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Button } from '../Button/Button.js';
|
|
4
|
+
import { useDay } from './hooks/useDay.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The content of a day cell – as a button or span element according to its
|
|
8
|
+
* modifiers.
|
|
9
|
+
*/
|
|
10
|
+
function Day(props) {
|
|
11
|
+
var buttonRef = React.useRef(null);
|
|
12
|
+
var day = useDay(props.date, props.displayMonth, buttonRef);
|
|
13
|
+
var buttonProps = day.buttonProps, nonInteractiveProps = day.nonInteractiveProps;
|
|
14
|
+
if (!buttonProps && !nonInteractiveProps) {
|
|
15
|
+
return React.createElement(React.Fragment, null);
|
|
16
|
+
}
|
|
17
|
+
if (nonInteractiveProps) {
|
|
18
|
+
return React.createElement("div", __assign({}, nonInteractiveProps));
|
|
19
|
+
}
|
|
20
|
+
return React.createElement(Button, __assign({ ref: buttonRef }, buttonProps));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { Day };
|
|
24
|
+
//# sourceMappingURL=Day.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Day.js","sources":["../../../src/components/Day/Day.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Button } from '../Button';\n\nimport { useDay } from './hooks/useDay';\n\n/** Represent the props used by the [[Day]] component. */\nexport interface DayProps {\n /** The month where the date is displayed. */\n displayMonth: Date;\n /** The date to render. */\n date: Date;\n}\n\n/**\n * The content of a day cell – as a button or span element according to its\n * modifiers.\n */\nexport function Day(props: DayProps): JSX.Element {\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n\n const day = useDay(props.date, props.displayMonth, buttonRef);\n const { buttonProps, nonInteractiveProps } = day;\n\n if (!buttonProps && !nonInteractiveProps) {\n return <></>;\n }\n if (nonInteractiveProps) {\n return <div {...nonInteractiveProps} />;\n }\n return <Button ref={buttonRef} {...buttonProps} />;\n}\n"],"names":[],"mappings":";;;;;AAcA;;;;SAIgB,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;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useDay';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateRange, ModifierStatus, StyledComponent } from '../../../types';
|
|
3
|
+
import { SelectMultipleContextValue } from '../../../contexts/SelectMultiple';
|
|
4
|
+
import { SelectRangeContextValue } from '../../../contexts/SelectRange';
|
|
5
|
+
import { SelectSingleContextValue } from '../../../contexts/SelectSingle';
|
|
6
|
+
export declare type UseDay = {
|
|
7
|
+
/** Whether the date is outside the display month/ */
|
|
8
|
+
isOutside: boolean;
|
|
9
|
+
/** The modifiers for the given date. */
|
|
10
|
+
modifiers: ModifierStatus;
|
|
11
|
+
/** The days in DayPicker currently selected. */
|
|
12
|
+
selected: Date | Date[] | DateRange | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The props for rendering the day as interactive element.
|
|
15
|
+
*
|
|
16
|
+
* When `undefined`, DayPicker should render a non interactive element with non-interactive
|
|
17
|
+
* props.
|
|
18
|
+
*/
|
|
19
|
+
buttonProps?: Omit<React.HTMLProps<HTMLButtonElement>, 'ref'>;
|
|
20
|
+
/**
|
|
21
|
+
* The props for rendering the day as not interactive element.
|
|
22
|
+
*
|
|
23
|
+
* When both this value and `buttonProps` are `undefined`, DayPicker should not render anything.
|
|
24
|
+
*/
|
|
25
|
+
nonInteractiveProps?: StyledComponent;
|
|
26
|
+
single: SelectSingleContextValue;
|
|
27
|
+
multiple: SelectMultipleContextValue;
|
|
28
|
+
range: SelectRangeContextValue;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* This hook returns details about the content to render in the day cell.
|
|
32
|
+
*
|
|
33
|
+
*
|
|
34
|
+
* When a day cell is rendered in the table, DayPicker can either:
|
|
35
|
+
*
|
|
36
|
+
* - render nothing: when the day is outside the month or has matched the
|
|
37
|
+
* "hidden" modifier.
|
|
38
|
+
* - render a button. When a selection mode is set, DayPicker renders a button
|
|
39
|
+
* to allow the focus and the selection. In case of `custom` selection
|
|
40
|
+
* mode, DayPicker expects a `onDayClick` prop to render a button.
|
|
41
|
+
* - render a non-interactive element: when no selection mode is set, the day
|
|
42
|
+
* cell shouldn’t respond to any interaction. DayPicker should render a `div`
|
|
43
|
+
* or a `span`.
|
|
44
|
+
*
|
|
45
|
+
* ### Usage
|
|
46
|
+
*
|
|
47
|
+
* Use this hook to customize the behavior of the [[Day]] component. Create a
|
|
48
|
+
* new `Day` component using this hook and pass it to the `components` prop.
|
|
49
|
+
* The source of [[Day]] can be a good starting point.
|
|
50
|
+
*
|
|
51
|
+
* */
|
|
52
|
+
export declare function useDay(
|
|
53
|
+
/** The day rendered in the month. */
|
|
54
|
+
date: Date,
|
|
55
|
+
/** The month where the date is displayed. DayPicker renders days outside the display month when `showOutsideDays` is true. */
|
|
56
|
+
displayMonth: Date,
|
|
57
|
+
/** A ref to the button element. */
|
|
58
|
+
buttonRef: React.RefObject<HTMLButtonElement>): UseDay;
|