react-day-picker 8.0.0-beta.33 → 8.0.0-beta.38
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 +33 -0
- package/{build → dist}/DayPicker.d.ts +93 -89
- package/dist/components/Button/Button.d.ts +7 -0
- package/{build → dist}/components/Button/index.d.ts +1 -1
- package/{build → dist}/components/Caption/Caption.d.ts +20 -18
- package/{build → dist}/components/Caption/index.d.ts +1 -1
- package/{build → dist}/components/CaptionLabel/CaptionLabel.d.ts +10 -8
- package/{build → dist}/components/CaptionLabel/index.d.ts +1 -1
- package/{build → dist}/components/Day/Day.d.ts +13 -13
- package/dist/components/Day/index.d.ts +1 -0
- package/{build → dist}/components/DayContent/DayContent.d.ts +15 -15
- package/{build → dist}/components/DayContent/index.d.ts +1 -1
- package/{build → dist}/components/Dropdown/Dropdown.d.ts +16 -16
- package/{build → dist}/components/Dropdown/index.d.ts +1 -1
- package/{build → dist}/components/Footer/Footer.d.ts +3 -3
- package/{build → dist}/components/Footer/index.d.ts +1 -1
- package/{build → dist}/components/Head/Head.d.ts +5 -5
- package/{build → dist}/components/Head/index.d.ts +1 -1
- package/{build → dist}/components/Head/utils/getWeekdays.d.ts +6 -6
- package/{build → dist}/components/Head/utils/index.d.ts +1 -1
- package/{build → dist}/components/IconDropdown/IconDropdown.d.ts +6 -6
- package/{build → dist}/components/IconDropdown/index.d.ts +1 -1
- package/{build → dist}/components/IconLeft/IconLeft.d.ts +6 -6
- package/{build → dist}/components/IconLeft/index.d.ts +1 -1
- package/{build → dist}/components/IconRight/IconRight.d.ts +6 -6
- package/{build → dist}/components/IconRight/index.d.ts +1 -1
- package/dist/components/Month/Month.d.ts +8 -0
- package/dist/components/Month/index.d.ts +1 -0
- package/{build → dist}/components/MonthsDropdown/MonthsDropdown.d.ts +10 -12
- package/{build → dist}/components/MonthsDropdown/index.d.ts +1 -1
- package/{build → dist}/components/Navigation/Navigation.d.ts +20 -20
- package/{build → dist}/components/Navigation/index.d.ts +1 -1
- package/dist/components/Root/Root.d.ts +3 -0
- package/{build → dist}/components/Root/index.d.ts +1 -1
- package/{build → dist}/components/Row/Row.d.ts +14 -16
- package/{build → dist}/components/Row/index.d.ts +1 -1
- package/{build → dist}/components/Table/Table.d.ts +10 -12
- package/{build → dist}/components/Table/index.d.ts +1 -1
- package/{build → dist}/components/Table/utils/getOutsideEndDays.d.ts +3 -3
- package/{build → dist}/components/Table/utils/getOutsideStartDays.d.ts +4 -4
- package/{build → dist}/components/Table/utils/getWeeks.d.ts +17 -17
- package/{build → dist}/components/WeekNumber/WeekNumber.d.ts +15 -15
- package/{build → dist}/components/WeekNumber/index.d.ts +1 -1
- package/{build → dist}/components/YearsDropdown/YearsDropdown.d.ts +16 -16
- package/{build → dist}/components/YearsDropdown/index.d.ts +1 -1
- package/dist/contexts/DayPicker/DayPickerContext.d.ts +45 -0
- package/{build → dist}/contexts/DayPicker/defaultClassNames.d.ts +5 -5
- package/dist/contexts/DayPicker/defaultContextValue.d.ts +6 -0
- package/{build → dist}/contexts/DayPicker/formatters/formatCaption.d.ts +7 -7
- package/{build → dist}/contexts/DayPicker/formatters/formatDay.d.ts +7 -7
- package/{build → dist}/contexts/DayPicker/formatters/formatMonthCaption.d.ts +7 -7
- package/{build → dist}/contexts/DayPicker/formatters/formatWeekNumber.d.ts +4 -4
- package/{build → dist}/contexts/DayPicker/formatters/formatWeekdayName.d.ts +7 -7
- package/{build → dist}/contexts/DayPicker/formatters/formatYearCaption.d.ts +6 -6
- package/{build → dist}/contexts/DayPicker/formatters/index.d.ts +6 -6
- package/dist/contexts/DayPicker/index.d.ts +2 -0
- package/{build → dist}/contexts/DayPicker/labels/index.d.ts +7 -7
- package/{build → dist}/contexts/DayPicker/labels/labelDay.d.ts +5 -5
- package/{build → dist}/contexts/DayPicker/labels/labelMonthDropdown.d.ts +4 -4
- package/{build → dist}/contexts/DayPicker/labels/labelNext.d.ts +5 -5
- package/{build → dist}/contexts/DayPicker/labels/labelPrevious.d.ts +5 -5
- package/{build → dist}/contexts/DayPicker/labels/labelWeekNumber.d.ts +5 -5
- package/{build → dist}/contexts/DayPicker/labels/labelWeekday.d.ts +5 -5
- package/{build → dist}/contexts/DayPicker/labels/labelYearDropdown.d.ts +4 -4
- package/{build → dist}/contexts/DayPicker/useDayPicker.d.ts +8 -8
- package/dist/contexts/DayPicker/utils/index.d.ts +1 -0
- package/{build → dist}/contexts/DayPicker/utils/parseFromToProps.d.ts +6 -9
- package/dist/contexts/Focus/FocusContext.d.ts +36 -0
- package/dist/contexts/Focus/index.d.ts +2 -0
- package/{build/contexts/Focus/useFocus.d.ts → dist/contexts/Focus/useFocusContext.d.ts} +3 -3
- package/dist/contexts/Focus/utils/getInitialFocusTarget.d.ts +3 -0
- package/dist/contexts/Modifiers/ModifiersContext.d.ts +9 -0
- 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/dist/contexts/Modifiers/utils/getInternalModifiers.d.ts +6 -0
- package/{build/hooks/useModifiers → dist/contexts/Modifiers}/utils/isDateInRange.d.ts +3 -3
- package/{build/hooks/useModifiers → dist/contexts/Modifiers}/utils/isMatch.d.ts +3 -5
- package/dist/contexts/Modifiers/utils/matcherToArray.d.ts +3 -0
- package/{build → dist}/contexts/Navigation/NavigationContext.d.ts +28 -24
- package/{build → dist}/contexts/Navigation/index.d.ts +2 -2
- package/{build → dist}/contexts/Navigation/useNavigation.d.ts +3 -3
- package/{build → dist}/contexts/Navigation/useNavigationState.d.ts +7 -7
- package/{build → dist}/contexts/Navigation/utils/getDisplayMonths.d.ts +8 -8
- package/{build → dist}/contexts/Navigation/utils/getInitialMonth.d.ts +3 -3
- package/{build → dist}/contexts/Navigation/utils/getNextMonth.d.ts +18 -18
- package/{build → dist}/contexts/Navigation/utils/getPreviousMonth.d.ts +19 -19
- package/{build → dist}/contexts/RootProvider.d.ts +8 -8
- package/{build → dist}/contexts/SelectMultiple/SelectMultipleContext.d.ts +35 -32
- package/{build → dist}/contexts/SelectMultiple/index.d.ts +2 -2
- package/{build → dist}/contexts/SelectMultiple/useSelectMultiple.d.ts +3 -3
- package/{build → dist}/contexts/SelectRange/SelectRangeContext.d.ts +36 -32
- package/{build → dist}/contexts/SelectRange/index.d.ts +2 -2
- package/{build → dist}/contexts/SelectRange/useSelectRange.d.ts +3 -3
- package/{build → dist}/contexts/SelectRange/utils/addToRange.d.ts +8 -8
- package/{build → dist}/contexts/SelectSingle/SelectSingleContext.d.ts +30 -35
- package/{build → dist}/contexts/SelectSingle/index.d.ts +2 -2
- package/{build → dist}/contexts/SelectSingle/useSelectSingle.d.ts +3 -3
- 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 +1 -1
- package/{build → dist}/hooks/useControlledValue/useControlledValue.d.ts +12 -12
- 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 +1 -1
- package/{build → dist}/hooks/useInput/useInput.d.ts +28 -28
- package/{build → dist}/hooks/useInput/utils/isValidDate.d.ts +2 -2
- package/dist/hooks/useSelectedDays/index.d.ts +1 -0
- package/dist/hooks/useSelectedDays/useSelectedDays.d.ts +8 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.esm.js +2213 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/{main.js → index.js} +2116 -1744
- package/dist/index.js.map +1 -0
- package/dist/react-day-picker.min.js +1 -0
- package/{style.css → dist/style.css} +21 -10
- package/{style.css.d.ts → dist/style.css.d.ts} +2 -2
- package/{build → dist}/types/DayPicker.d.ts +249 -228
- package/{build → dist}/types/DayPickerCustom.d.ts +9 -11
- package/{build → dist}/types/DayPickerMultiple.d.ts +16 -16
- package/{build → dist}/types/DayPickerRange.d.ts +17 -17
- package/{build → dist}/types/DayPickerSingle.d.ts +14 -14
- package/{build → dist}/types/EventHandlers.d.ts +51 -51
- package/{build → dist}/types/Formatters.d.ts +24 -24
- package/{build → dist}/types/Labels.d.ts +28 -28
- package/{build → dist}/types/Matchers.d.ts +34 -34
- package/dist/types/Modifiers.d.ts +51 -0
- package/{build → dist}/types/Styles.d.ts +82 -85
- package/package.json +42 -29
- package/build/DayPicker.js +0 -98
- package/build/DayPicker.js.map +0 -1
- package/build/_virtual/_tslib.js +0 -50
- package/build/_virtual/_tslib.js.map +0 -1
- package/build/components/Button/Button.d.ts +0 -7
- package/build/components/Button/Button.js +0 -23
- package/build/components/Button/Button.js.map +0 -1
- package/build/components/Caption/Caption.js +0 -57
- package/build/components/Caption/Caption.js.map +0 -1
- package/build/components/CaptionLabel/CaptionLabel.js +0 -11
- package/build/components/CaptionLabel/CaptionLabel.js.map +0 -1
- package/build/components/Day/Day.js +0 -24
- package/build/components/Day/Day.js.map +0 -1
- package/build/components/Day/hooks/index.d.ts +0 -1
- package/build/components/Day/hooks/useDay.d.ts +0 -58
- package/build/components/Day/hooks/useDay.js +0 -176
- 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 -56
- package/build/components/Day/hooks/useDayFocus.js.map +0 -1
- package/build/components/Day/index.d.ts +0 -2
- package/build/components/DayContent/DayContent.js +0 -15
- package/build/components/DayContent/DayContent.js.map +0 -1
- package/build/components/Dropdown/Dropdown.js +0 -20
- package/build/components/Dropdown/Dropdown.js.map +0 -1
- package/build/components/Footer/Footer.js +0 -15
- package/build/components/Footer/Footer.js.map +0 -1
- package/build/components/Head/Head.js +0 -20
- package/build/components/Head/Head.js.map +0 -1
- package/build/components/Head/utils/getWeekdays.js +0 -18
- package/build/components/Head/utils/getWeekdays.js.map +0 -1
- package/build/components/IconDropdown/IconDropdown.js +0 -13
- package/build/components/IconDropdown/IconDropdown.js.map +0 -1
- package/build/components/IconLeft/IconLeft.js +0 -13
- package/build/components/IconLeft/IconLeft.js.map +0 -1
- package/build/components/IconRight/IconRight.js +0 -13
- package/build/components/IconRight/IconRight.js.map +0 -1
- package/build/components/MonthsDropdown/MonthsDropdown.js +0 -39
- package/build/components/MonthsDropdown/MonthsDropdown.js.map +0 -1
- package/build/components/Navigation/Navigation.js +0 -33
- package/build/components/Navigation/Navigation.js.map +0 -1
- package/build/components/Root/Root.d.ts +0 -6
- package/build/components/Root/Root.js +0 -49
- package/build/components/Root/Root.js.map +0 -1
- package/build/components/Row/Row.js +0 -22
- package/build/components/Row/Row.js.map +0 -1
- package/build/components/Table/Table.js +0 -18
- package/build/components/Table/Table.js.map +0 -1
- package/build/components/Table/utils/getOutsideEndDays.js +0 -15
- package/build/components/Table/utils/getOutsideEndDays.js.map +0 -1
- package/build/components/Table/utils/getOutsideStartDays.js +0 -15
- package/build/components/Table/utils/getOutsideStartDays.js.map +0 -1
- package/build/components/Table/utils/getWeeks.js +0 -50
- package/build/components/Table/utils/getWeeks.js.map +0 -1
- package/build/components/WeekNumber/WeekNumber.js +0 -24
- package/build/components/WeekNumber/WeekNumber.js.map +0 -1
- package/build/components/YearsDropdown/YearsDropdown.js +0 -28
- package/build/components/YearsDropdown/YearsDropdown.js.map +0 -1
- package/build/components/index.d.ts +0 -18
- package/build/contexts/DayPicker/DayPickerContext.d.ts +0 -31
- package/build/contexts/DayPicker/DayPickerContext.js +0 -14
- package/build/contexts/DayPicker/DayPickerContext.js.map +0 -1
- package/build/contexts/DayPicker/DayPickerProvider.d.ts +0 -12
- package/build/contexts/DayPicker/DayPickerProvider.js +0 -59
- package/build/contexts/DayPicker/DayPickerProvider.js.map +0 -1
- package/build/contexts/DayPicker/defaultClassNames.js +0 -42
- package/build/contexts/DayPicker/defaultClassNames.js.map +0 -1
- package/build/contexts/DayPicker/formatters/formatCaption.js +0 -11
- package/build/contexts/DayPicker/formatters/formatCaption.js.map +0 -1
- package/build/contexts/DayPicker/formatters/formatDay.js +0 -11
- package/build/contexts/DayPicker/formatters/formatDay.js.map +0 -1
- package/build/contexts/DayPicker/formatters/formatMonthCaption.js +0 -11
- package/build/contexts/DayPicker/formatters/formatMonthCaption.js.map +0 -1
- package/build/contexts/DayPicker/formatters/formatWeekNumber.js +0 -9
- package/build/contexts/DayPicker/formatters/formatWeekNumber.js.map +0 -1
- package/build/contexts/DayPicker/formatters/formatWeekdayName.js +0 -11
- package/build/contexts/DayPicker/formatters/formatWeekdayName.js.map +0 -1
- package/build/contexts/DayPicker/formatters/formatYearCaption.js +0 -11
- 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.d.ts +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 -11
- package/build/contexts/DayPicker/labels/labelDay.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelMonthDropdown.js +0 -9
- package/build/contexts/DayPicker/labels/labelMonthDropdown.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelNext.js +0 -9
- package/build/contexts/DayPicker/labels/labelNext.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelPrevious.js +0 -9
- package/build/contexts/DayPicker/labels/labelPrevious.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelWeekNumber.js +0 -9
- package/build/contexts/DayPicker/labels/labelWeekNumber.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelWeekday.js +0 -11
- package/build/contexts/DayPicker/labels/labelWeekday.js.map +0 -1
- package/build/contexts/DayPicker/labels/labelYearDropdown.js +0 -9
- package/build/contexts/DayPicker/labels/labelYearDropdown.js.map +0 -1
- package/build/contexts/DayPicker/useDayPicker.js +0 -19
- package/build/contexts/DayPicker/useDayPicker.js.map +0 -1
- package/build/contexts/DayPicker/utils/index.d.ts +0 -2
- package/build/contexts/DayPicker/utils/parseFromToProps.js +0 -29
- package/build/contexts/DayPicker/utils/parseFromToProps.js.map +0 -1
- package/build/contexts/DayPicker/utils/parseModifierProps.d.ts +0 -9
- package/build/contexts/DayPicker/utils/parseModifierProps.js +0 -54
- package/build/contexts/DayPicker/utils/parseModifierProps.js.map +0 -1
- package/build/contexts/Focus/FocusContext.d.ts +0 -30
- package/build/contexts/Focus/FocusContext.js +0 -71
- package/build/contexts/Focus/FocusContext.js.map +0 -1
- package/build/contexts/Focus/index.d.ts +0 -2
- package/build/contexts/Focus/useFocus.js +0 -14
- package/build/contexts/Focus/useFocus.js.map +0 -1
- package/build/contexts/Navigation/NavigationContext.js +0 -31
- package/build/contexts/Navigation/NavigationContext.js.map +0 -1
- package/build/contexts/Navigation/useNavigation.js +0 -14
- package/build/contexts/Navigation/useNavigation.js.map +0 -1
- package/build/contexts/Navigation/useNavigationState.js +0 -19
- package/build/contexts/Navigation/useNavigationState.js.map +0 -1
- package/build/contexts/Navigation/utils/getDisplayMonths.js +0 -23
- package/build/contexts/Navigation/utils/getDisplayMonths.js.map +0 -1
- package/build/contexts/Navigation/utils/getInitialMonth.js +0 -21
- package/build/contexts/Navigation/utils/getInitialMonth.js.map +0 -1
- package/build/contexts/Navigation/utils/getNextMonth.js +0 -32
- package/build/contexts/Navigation/utils/getNextMonth.js.map +0 -1
- package/build/contexts/Navigation/utils/getPreviousMonth.js +0 -33
- package/build/contexts/Navigation/utils/getPreviousMonth.js.map +0 -1
- package/build/contexts/RootProvider.js +0 -22
- package/build/contexts/RootProvider.js.map +0 -1
- package/build/contexts/SelectMultiple/SelectMultipleContext.js +0 -82
- package/build/contexts/SelectMultiple/SelectMultipleContext.js.map +0 -1
- package/build/contexts/SelectMultiple/useSelectMultiple.js +0 -14
- package/build/contexts/SelectMultiple/useSelectMultiple.js.map +0 -1
- package/build/contexts/SelectRange/SelectRangeContext.js +0 -123
- package/build/contexts/SelectRange/SelectRangeContext.js.map +0 -1
- package/build/contexts/SelectRange/useSelectRange.js +0 -14
- package/build/contexts/SelectRange/useSelectRange.js.map +0 -1
- package/build/contexts/SelectRange/utils/addToRange.js +0 -39
- package/build/contexts/SelectRange/utils/addToRange.js.map +0 -1
- package/build/contexts/SelectSingle/SelectSingleContext.js +0 -45
- package/build/contexts/SelectSingle/SelectSingleContext.js.map +0 -1
- package/build/contexts/SelectSingle/useSelectSingle.js +0 -14
- package/build/contexts/SelectSingle/useSelectSingle.js.map +0 -1
- package/build/contexts/index.d.ts +0 -7
- package/build/hooks/index.d.ts +0 -2
- package/build/hooks/useControlledValue/useControlledValue.js +0 -19
- package/build/hooks/useControlledValue/useControlledValue.js.map +0 -1
- package/build/hooks/useInput/useInput.js +0 -101
- package/build/hooks/useInput/useInput.js.map +0 -1
- package/build/hooks/useInput/utils/isValidDate.js +0 -7
- package/build/hooks/useInput/utils/isValidDate.js.map +0 -1
- package/build/hooks/useModifiers/index.d.ts +0 -1
- package/build/hooks/useModifiers/types/UseModifiers.d.ts +0 -10
- package/build/hooks/useModifiers/types/index.d.ts +0 -1
- package/build/hooks/useModifiers/useModifiers.d.ts +0 -3
- package/build/hooks/useModifiers/useModifiers.js +0 -65
- package/build/hooks/useModifiers/useModifiers.js.map +0 -1
- package/build/hooks/useModifiers/utils/getModifierStatus.d.ts +0 -7
- package/build/hooks/useModifiers/utils/getModifierStatus.js +0 -22
- package/build/hooks/useModifiers/utils/getModifierStatus.js.map +0 -1
- package/build/hooks/useModifiers/utils/isDateInRange.js +0 -25
- package/build/hooks/useModifiers/utils/isDateInRange.js.map +0 -1
- package/build/hooks/useModifiers/utils/isMatch.js +0 -52
- package/build/hooks/useModifiers/utils/isMatch.js.map +0 -1
- package/build/main.d.ts +0 -5
- package/build/main.js +0 -40
- package/build/main.js.map +0 -1
- package/build/test/PageObjects.d.ts +0 -40
- package/build/test/customRender.d.ts +0 -4
- package/build/test/customRenderHook.d.ts +0 -3
- package/build/test/index.d.ts +0 -3
- package/build/test/setup.d.ts +0 -2
- package/build/types/DayPickerCustom.js +0 -7
- package/build/types/DayPickerCustom.js.map +0 -1
- package/build/types/DayPickerMultiple.js +0 -7
- package/build/types/DayPickerMultiple.js.map +0 -1
- package/build/types/DayPickerRange.js +0 -7
- package/build/types/DayPickerRange.js.map +0 -1
- package/build/types/DayPickerSingle.js +0 -7
- package/build/types/DayPickerSingle.js.map +0 -1
- package/build/types/Matchers.js +0 -27
- package/build/types/Matchers.js.map +0 -1
- package/build/types/Modifiers.d.ts +0 -16
- package/build/types/index.d.ts +0 -11
- package/dist/main.js.map +0 -1
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/** Represents the value of the [[NavigationContext]]. */
|
|
3
|
-
export interface NavigationContextValue {
|
|
4
|
-
/** The current month. Note that when `numberOfMonths > 1` represent the first month in the displayed months. */
|
|
5
|
-
month: Date;
|
|
6
|
-
/** The months
|
|
7
|
-
displayMonths: Date[];
|
|
8
|
-
/** Navigate to the specified month. */
|
|
9
|
-
goToMonth: (month: Date) => void;
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
/** The
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
/** Represents the value of the [[NavigationContext]]. */
|
|
3
|
+
export interface NavigationContextValue {
|
|
4
|
+
/** The current month. Note that when `numberOfMonths > 1` represent the first month in the displayed months. */
|
|
5
|
+
month: Date;
|
|
6
|
+
/** The months rendered by DayPicker. DayPicker can render one than one month via `numberOfMonths`. */
|
|
7
|
+
displayMonths: Date[];
|
|
8
|
+
/** Navigate to the specified month. */
|
|
9
|
+
goToMonth: (month: Date) => void;
|
|
10
|
+
/** Navigate to the specified date. */
|
|
11
|
+
goToDate: (date: Date, refDate?: Date) => void;
|
|
12
|
+
/** The next month to display. `undefined` if no months left */
|
|
13
|
+
nextMonth?: Date;
|
|
14
|
+
/** The previous month to display. `undefined` if no months left */
|
|
15
|
+
previousMonth?: Date;
|
|
16
|
+
/** Return true if the day is displayed in the calendar. */
|
|
17
|
+
isDateDisplayed: (day: Date) => boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The Navigation context shares details about the months being navigated in DayPicker.
|
|
21
|
+
*
|
|
22
|
+
* Access this context from the [[useNavigation]] hook.
|
|
23
|
+
*/
|
|
24
|
+
export declare const NavigationContext: React.Context<NavigationContextValue | undefined>;
|
|
25
|
+
/** Provides the values for the [[NavigationContext]]. */
|
|
26
|
+
export declare function NavigationProvider(props: {
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
}): JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './NavigationContext';
|
|
2
|
-
export * from './useNavigation';
|
|
1
|
+
export * from './NavigationContext';
|
|
2
|
+
export * from './useNavigation';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { NavigationContextValue } from './NavigationContext';
|
|
2
|
-
/** Hook to access the [[NavigationContext]]. */
|
|
3
|
-
export declare function useNavigation(): NavigationContextValue;
|
|
1
|
+
import { NavigationContextValue } from './NavigationContext';
|
|
2
|
+
/** Hook to access the [[NavigationContext]]. */
|
|
3
|
+
export declare function useNavigation(): NavigationContextValue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** Controls the navigation state. */
|
|
2
|
-
export declare function useNavigationState(): [
|
|
3
|
-
/** The month DayPicker is navigating at */
|
|
4
|
-
month: Date,
|
|
5
|
-
/** Go to the specified month. */
|
|
6
|
-
goToMonth: (month: Date) => void
|
|
7
|
-
];
|
|
1
|
+
/** Controls the navigation state. */
|
|
2
|
+
export declare function useNavigationState(): [
|
|
3
|
+
/** The month DayPicker is navigating at */
|
|
4
|
+
month: Date,
|
|
5
|
+
/** Go to the specified month. */
|
|
6
|
+
goToMonth: (month: Date) => void
|
|
7
|
+
];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return the months to display in the component according to the number of
|
|
3
|
-
* months and the from/to date.
|
|
4
|
-
*/
|
|
5
|
-
export declare function getDisplayMonths(month: Date, { reverseMonths, numberOfMonths }: {
|
|
6
|
-
reverseMonths?: boolean;
|
|
7
|
-
numberOfMonths: number;
|
|
8
|
-
}): Date[];
|
|
1
|
+
/**
|
|
2
|
+
* Return the months to display in the component according to the number of
|
|
3
|
+
* months and the from/to date.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getDisplayMonths(month: Date, { reverseMonths, numberOfMonths }: {
|
|
6
|
+
reverseMonths?: boolean;
|
|
7
|
+
numberOfMonths: number;
|
|
8
|
+
}): Date[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DayPickerContextValue } from '
|
|
2
|
-
/** Return the initial month according to the given options. */
|
|
3
|
-
export declare function getInitialMonth(context: Partial<DayPickerContextValue>): Date;
|
|
1
|
+
import { DayPickerContextValue } from '../../../contexts/DayPicker';
|
|
2
|
+
/** Return the initial month according to the given options. */
|
|
3
|
+
export declare function getInitialMonth(context: Partial<DayPickerContextValue>): Date;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the next month the user can navigate to according to the given
|
|
3
|
-
* options.
|
|
4
|
-
*
|
|
5
|
-
* Please note that the next month is not always the next calendar month:
|
|
6
|
-
*
|
|
7
|
-
* - if after the `toDate` range, is undefined;
|
|
8
|
-
* - if the navigation is paged, is the number of months displayed ahead.
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
export declare function getNextMonth(startingMonth: Date, options: {
|
|
12
|
-
numberOfMonths?: number;
|
|
13
|
-
fromDate?: Date;
|
|
14
|
-
toDate?: Date;
|
|
15
|
-
pagedNavigation?: boolean;
|
|
16
|
-
today?: Date;
|
|
17
|
-
disableNavigation?: boolean;
|
|
18
|
-
}): Date | undefined;
|
|
1
|
+
/**
|
|
2
|
+
* Returns the next month the user can navigate to according to the given
|
|
3
|
+
* options.
|
|
4
|
+
*
|
|
5
|
+
* Please note that the next month is not always the next calendar month:
|
|
6
|
+
*
|
|
7
|
+
* - if after the `toDate` range, is undefined;
|
|
8
|
+
* - if the navigation is paged, is the number of months displayed ahead.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export declare function getNextMonth(startingMonth: Date, options: {
|
|
12
|
+
numberOfMonths?: number;
|
|
13
|
+
fromDate?: Date;
|
|
14
|
+
toDate?: Date;
|
|
15
|
+
pagedNavigation?: boolean;
|
|
16
|
+
today?: Date;
|
|
17
|
+
disableNavigation?: boolean;
|
|
18
|
+
}): Date | undefined;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the next previous the user can navigate to, according to the given
|
|
3
|
-
* options.
|
|
4
|
-
*
|
|
5
|
-
* Please note that the previous month is not always the previous calendar
|
|
6
|
-
* month:
|
|
7
|
-
*
|
|
8
|
-
* - if before the `fromDate` date, is `undefined`;
|
|
9
|
-
* - if the navigation is paged, is the number of months displayed before.
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export declare function getPreviousMonth(startingMonth: Date, options: {
|
|
13
|
-
numberOfMonths?: number;
|
|
14
|
-
fromDate?: Date;
|
|
15
|
-
toDate?: Date;
|
|
16
|
-
pagedNavigation?: boolean;
|
|
17
|
-
today?: Date;
|
|
18
|
-
disableNavigation?: boolean;
|
|
19
|
-
}): Date | undefined;
|
|
1
|
+
/**
|
|
2
|
+
* Returns the next previous the user can navigate to, according to the given
|
|
3
|
+
* options.
|
|
4
|
+
*
|
|
5
|
+
* Please note that the previous month is not always the previous calendar
|
|
6
|
+
* month:
|
|
7
|
+
*
|
|
8
|
+
* - if before the `fromDate` date, is `undefined`;
|
|
9
|
+
* - if the navigation is paged, is the number of months displayed before.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export declare function getPreviousMonth(startingMonth: Date, options: {
|
|
13
|
+
numberOfMonths?: number;
|
|
14
|
+
fromDate?: Date;
|
|
15
|
+
toDate?: Date;
|
|
16
|
+
pagedNavigation?: boolean;
|
|
17
|
+
today?: Date;
|
|
18
|
+
disableNavigation?: boolean;
|
|
19
|
+
}): Date | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DayPickerProps } from '../types';
|
|
3
|
-
/** The props of [[RootProvider]]. */
|
|
4
|
-
export declare type RootContext = DayPickerProps & {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
};
|
|
7
|
-
/** Provide the value for all the context providers. */
|
|
8
|
-
export declare function RootProvider(props: RootContext): JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DayPickerProps } from '../types/DayPicker';
|
|
3
|
+
/** The props of [[RootProvider]]. */
|
|
4
|
+
export declare type RootContext = DayPickerProps & {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
/** Provide the value for all the context providers. */
|
|
8
|
+
export declare function RootProvider(props: RootContext): JSX.Element;
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { DayPickerProps } from '../../types/DayPicker';
|
|
3
|
+
import { DayPickerMultipleProps } from '../../types/DayPickerMultiple';
|
|
4
|
+
import { DayClickEventHandler } from '../../types/EventHandlers';
|
|
5
|
+
import { InternalModifier, Modifiers } from '../../types/Modifiers';
|
|
6
|
+
/** Represent the modifiers that are changed by the multiple selection. */
|
|
7
|
+
export declare type SelectMultipleModifiers = Pick<Modifiers, InternalModifier.Disabled>;
|
|
8
|
+
/** Represents the value of a [[SelectMultipleContext]]. */
|
|
9
|
+
export interface SelectMultipleContextValue {
|
|
10
|
+
/** The days that have been selected. */
|
|
11
|
+
selected: Date[] | undefined;
|
|
12
|
+
/** The modifiers for the corresponding selection. */
|
|
13
|
+
modifiers: SelectMultipleModifiers;
|
|
14
|
+
/** Event handler to attach to the day button to enable the multiple select. */
|
|
15
|
+
onDayClick?: DayClickEventHandler;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The SelectMultiple context shares details about the selected days when in
|
|
19
|
+
* multiple selection mode.
|
|
20
|
+
*
|
|
21
|
+
* Access this context from the [[useSelectMultiple]] hook.
|
|
22
|
+
*/
|
|
23
|
+
export declare const SelectMultipleContext: React.Context<SelectMultipleContextValue | undefined>;
|
|
24
|
+
export declare type SelectMultipleProviderProps = {
|
|
25
|
+
initialProps: DayPickerProps;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
/** Provides the values for the [[SelectMultipleContext]]. */
|
|
29
|
+
export declare function SelectMultipleProvider(props: SelectMultipleProviderProps): JSX.Element;
|
|
30
|
+
declare type SelectMultipleProviderInternalProps = {
|
|
31
|
+
initialProps: DayPickerMultipleProps;
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
};
|
|
34
|
+
export declare function SelectMultipleProviderInternal({ initialProps, children }: SelectMultipleProviderInternalProps): JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './SelectMultipleContext';
|
|
2
|
-
export * from './useSelectMultiple';
|
|
1
|
+
export * from './SelectMultipleContext';
|
|
2
|
+
export * from './useSelectMultiple';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SelectMultipleContextValue } from './SelectMultipleContext';
|
|
2
|
-
/** Hook to access the [[SelectMultipleContext]]. */
|
|
3
|
-
export declare function useSelectMultiple(): SelectMultipleContextValue;
|
|
1
|
+
import { SelectMultipleContextValue } from './SelectMultipleContext';
|
|
2
|
+
/** Hook to access the [[SelectMultipleContext]]. */
|
|
3
|
+
export declare function useSelectMultiple(): SelectMultipleContextValue;
|
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { DayPickerProps } from '../../types/DayPicker';
|
|
3
|
+
import { DayPickerRangeProps } from '../../types/DayPickerRange';
|
|
4
|
+
import { DayClickEventHandler } from '../../types/EventHandlers';
|
|
5
|
+
import { DateRange } from '../../types/Matchers';
|
|
6
|
+
import { InternalModifier, Modifiers } from '../../types/Modifiers';
|
|
7
|
+
/** Represent the modifiers that are changed by the range selection. */
|
|
8
|
+
export declare type SelectRangeModifiers = Pick<Modifiers, InternalModifier.Disabled | InternalModifier.RangeEnd | InternalModifier.RangeMiddle | InternalModifier.RangeStart>;
|
|
9
|
+
/** Represents the value of a [[SelectRangeContext]]. */
|
|
10
|
+
export interface SelectRangeContextValue {
|
|
11
|
+
/** The range of days that has been selected. */
|
|
12
|
+
selected: DateRange | undefined;
|
|
13
|
+
/** The modifiers for the corresponding selection. */
|
|
14
|
+
modifiers: SelectRangeModifiers;
|
|
15
|
+
/** Event handler to attach to the day button to enable the range select. */
|
|
16
|
+
onDayClick?: DayClickEventHandler;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The SelectRange context shares details about the selected days when in
|
|
20
|
+
* range selection mode.
|
|
21
|
+
*
|
|
22
|
+
* Access this context from the [[useSelectRange]] hook.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SelectRangeContext: React.Context<SelectRangeContextValue | undefined>;
|
|
25
|
+
declare type SelectRangeProviderProps = {
|
|
26
|
+
initialProps: DayPickerProps;
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
};
|
|
29
|
+
/** Provides the values for the [[SelectRangeProvider]]. */
|
|
30
|
+
export declare function SelectRangeProvider(props: SelectRangeProviderProps): JSX.Element;
|
|
31
|
+
declare type SelectRangeProviderInternalProps = {
|
|
32
|
+
initialProps: DayPickerRangeProps;
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
};
|
|
35
|
+
export declare function SelectRangeProviderInternal({ initialProps, children }: SelectRangeProviderInternalProps): JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './SelectRangeContext';
|
|
2
|
-
export * from './useSelectRange';
|
|
1
|
+
export * from './SelectRangeContext';
|
|
2
|
+
export * from './useSelectRange';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SelectRangeContextValue } from './SelectRangeContext';
|
|
2
|
-
/** Hook to access the [[SelectRangeContext]]. */
|
|
3
|
-
export declare function useSelectRange(): SelectRangeContextValue;
|
|
1
|
+
import { SelectRangeContextValue } from './SelectRangeContext';
|
|
2
|
+
/** Hook to access the [[SelectRangeContext]]. */
|
|
3
|
+
export declare function useSelectRange(): SelectRangeContextValue;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DateRange } from '../../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Add a day to an existing range.
|
|
4
|
-
*
|
|
5
|
-
* The returned range takes in account the `undefined` values and if the added
|
|
6
|
-
* day is already present in the range.
|
|
7
|
-
*/
|
|
8
|
-
export declare function addToRange(day: Date, range?: DateRange): DateRange | undefined;
|
|
1
|
+
import { DateRange } from '../../../types/Matchers';
|
|
2
|
+
/**
|
|
3
|
+
* Add a day to an existing range.
|
|
4
|
+
*
|
|
5
|
+
* The returned range takes in account the `undefined` values and if the added
|
|
6
|
+
* day is already present in the range.
|
|
7
|
+
*/
|
|
8
|
+
export declare function addToRange(day: Date, range?: DateRange): DateRange | undefined;
|
|
@@ -1,35 +1,30 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DayPickerProps } from '../../types/DayPicker';
|
|
3
|
-
import { DayPickerSingleProps } from '../../types/DayPickerSingle';
|
|
4
|
-
import { DayClickEventHandler } from '../../types/EventHandlers';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
declare
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export declare function
|
|
30
|
-
|
|
31
|
-
initialProps: DayPickerSingleProps;
|
|
32
|
-
children: React.ReactNode;
|
|
33
|
-
};
|
|
34
|
-
export declare function SelectSingleProviderInternal({ initialProps, children }: SelectSingleProviderInternal): JSX.Element;
|
|
35
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DayPickerProps } from '../../types/DayPicker';
|
|
3
|
+
import { DayPickerSingleProps } from '../../types/DayPickerSingle';
|
|
4
|
+
import { DayClickEventHandler } from '../../types/EventHandlers';
|
|
5
|
+
/** Represents the value of a [[SelectSingleContext]]. */
|
|
6
|
+
export interface SelectSingleContextValue {
|
|
7
|
+
/** The day that has been selected. */
|
|
8
|
+
selected: Date | undefined;
|
|
9
|
+
/** Event handler to attach to the day button to enable the single select. */
|
|
10
|
+
onDayClick?: DayClickEventHandler;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The SelectSingle context shares details about the selected days when in
|
|
14
|
+
* single selection mode.
|
|
15
|
+
*
|
|
16
|
+
* Access this context from the [[useSelectSingle]] hook.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SelectSingleContext: React.Context<SelectSingleContextValue | undefined>;
|
|
19
|
+
declare type SelectSingleProviderProps = {
|
|
20
|
+
initialProps: DayPickerProps;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
};
|
|
23
|
+
/** Provides the values for the [[SelectSingleProvider]]. */
|
|
24
|
+
export declare function SelectSingleProvider(props: SelectSingleProviderProps): JSX.Element;
|
|
25
|
+
declare type SelectSingleProviderInternal = {
|
|
26
|
+
initialProps: DayPickerSingleProps;
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
};
|
|
29
|
+
export declare function SelectSingleProviderInternal({ initialProps, children }: SelectSingleProviderInternal): JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './SelectSingleContext';
|
|
2
|
-
export * from './useSelectSingle';
|
|
1
|
+
export * from './SelectSingleContext';
|
|
2
|
+
export * from './useSelectSingle';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SelectSingleContextValue } from './SelectSingleContext';
|
|
2
|
-
/** Hook to access the [[SelectSingleContext]]. */
|
|
3
|
-
export declare function useSelectSingle(): SelectSingleContextValue;
|
|
1
|
+
import { SelectSingleContextValue } from './SelectSingleContext';
|
|
2
|
+
/** Hook to access the [[SelectSingleContext]]. */
|
|
3
|
+
export declare function useSelectSingle(): SelectSingleContextValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useActiveModifiers';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActiveModifiers } from '../../types/Modifiers';
|
|
2
|
+
/**
|
|
3
|
+
* Return the active modifiers for the specified day.
|
|
4
|
+
*
|
|
5
|
+
* @param day
|
|
6
|
+
* @param displayMonth The month where the date is displayed. If not the same as
|
|
7
|
+
* `date`, the day is an "outside day".
|
|
8
|
+
*/
|
|
9
|
+
export declare function useActiveModifiers(day: Date, displayMonth?: Date): ActiveModifiers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './useControlledValue';
|
|
1
|
+
export * from './useControlledValue';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type DispatchStateAction<T> = React.Dispatch<React.SetStateAction<T>>;
|
|
3
|
-
/**
|
|
4
|
-
* Helper hook for using controlled/uncontrolled values from a component props.
|
|
5
|
-
*
|
|
6
|
-
* When the value is not controlled, pass `undefined` as `controlledValue` and
|
|
7
|
-
* use the returned setter to update it.
|
|
8
|
-
*
|
|
9
|
-
* When the value is controlled, pass the controlled value as second
|
|
10
|
-
* argument, which will be always returned as `value`.
|
|
11
|
-
*/
|
|
12
|
-
export declare function useControlledValue<T>(defaultValue: T, controlledValue: T | undefined): [T, DispatchStateAction<T>];
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type DispatchStateAction<T> = React.Dispatch<React.SetStateAction<T>>;
|
|
3
|
+
/**
|
|
4
|
+
* Helper hook for using controlled/uncontrolled values from a component props.
|
|
5
|
+
*
|
|
6
|
+
* When the value is not controlled, pass `undefined` as `controlledValue` and
|
|
7
|
+
* use the returned setter to update it.
|
|
8
|
+
*
|
|
9
|
+
* When the value is controlled, pass the controlled value as second
|
|
10
|
+
* argument, which will be always returned as `value`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useControlledValue<T>(defaultValue: T, controlledValue: T | undefined): [T, DispatchStateAction<T>];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useDayEventHandlers';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HTMLProps } from 'react';
|
|
2
|
+
import { ActiveModifiers } from '../../types/Modifiers';
|
|
3
|
+
export declare type EventName = 'onClick' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp' | 'onMouseEnter' | 'onMouseLeave' | 'onTouchCancel' | 'onTouchEnd' | 'onTouchMove' | 'onTouchStart';
|
|
4
|
+
export declare type DayEventName = 'onDayClick' | 'onDayFocus' | 'onDayBlur' | 'onDayKeyDown' | 'onDayKeyUp' | 'onDayMouseEnter' | 'onDayMouseLeave' | 'onDayTouchCancel' | 'onDayTouchEnd' | 'onDayTouchMove' | 'onDayTouchStart';
|
|
5
|
+
export declare type DayEventHandlers = Pick<HTMLProps<HTMLButtonElement>, EventName>;
|
|
6
|
+
/**
|
|
7
|
+
* This hook returns details about the content to render in the day cell.
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* When a day cell is rendered in the table, DayPicker can either:
|
|
11
|
+
*
|
|
12
|
+
* - render nothing: when the day is outside the month or has matched the
|
|
13
|
+
* "hidden" modifier.
|
|
14
|
+
* - render a button. When a selection mode is set, DayPicker renders a button
|
|
15
|
+
* to allow the focus and the selection. In case of `custom` selection
|
|
16
|
+
* mode, DayPicker expects a `onDayClick` prop to render a button.
|
|
17
|
+
* - render a non-interactive element: when no selection mode is set, the day
|
|
18
|
+
* cell shouldn’t respond to any interaction. DayPicker should render a `div`
|
|
19
|
+
* or a `span`.
|
|
20
|
+
*
|
|
21
|
+
* ### Usage
|
|
22
|
+
*
|
|
23
|
+
* Use this hook to customize the behavior of the [[Day]] component. Create a
|
|
24
|
+
* new `Day` component using this hook and pass it to the `components` prop.
|
|
25
|
+
* The source of [[Day]] can be a good starting point.
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export declare function useDayEventHandlers(date: Date, activeModifiers: ActiveModifiers): DayEventHandlers;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useDayRender';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps } from '../../components/Button';
|
|
3
|
+
import { DayEventHandlers } from '../../hooks/useDayEventHandlers';
|
|
4
|
+
import { SelectedDays } from '../../hooks/useSelectedDays';
|
|
5
|
+
import { ActiveModifiers } from '../../types/Modifiers';
|
|
6
|
+
import { StyledComponent } from '../../types/Styles';
|
|
7
|
+
export declare type DayRender = {
|
|
8
|
+
/** Whether the day should be rendered a `button` instead of a `div` */
|
|
9
|
+
isButton: boolean;
|
|
10
|
+
/** Whether the day should be hidden. */
|
|
11
|
+
isHidden: boolean;
|
|
12
|
+
/** The modifiers active for the given day. */
|
|
13
|
+
activeModifiers: ActiveModifiers;
|
|
14
|
+
/** The props to apply to the button element (when `isButton` is true). */
|
|
15
|
+
buttonProps: StyledComponent & Pick<ButtonProps, 'disabled' | 'aria-pressed' | 'tabIndex'> & DayEventHandlers;
|
|
16
|
+
/** The props to apply to the div element (when `isButton` is false). */
|
|
17
|
+
divProps: StyledComponent;
|
|
18
|
+
selectedDays: SelectedDays;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Return props and data used to render the [[Day]] component.
|
|
22
|
+
*
|
|
23
|
+
* Use this hook when creating a component to replace the built-in `Day`
|
|
24
|
+
* component.
|
|
25
|
+
*
|
|
26
|
+
* Each Day in DayPicker should render one of the following, according to the return
|
|
27
|
+
* value:
|
|
28
|
+
*
|
|
29
|
+
* - an empty `React.Fragment`, to render if `isHidden` is true
|
|
30
|
+
* - a `button` element, when the day is interactive, e.g. is selectable
|
|
31
|
+
* - a `div` element, whe the day is not interactive
|
|
32
|
+
*
|
|
33
|
+
* @param day The date to render
|
|
34
|
+
* @param displayMonth The month where the date is displayed (if not the same as
|
|
35
|
+
* `date`, it means it is an "outside" day)
|
|
36
|
+
* @param buttonRef A ref to the button element that will be target of focus
|
|
37
|
+
* when rendered (if required).
|
|
38
|
+
*/
|
|
39
|
+
export declare function useDayRender(day: Date, displayMonth: Date, buttonRef: React.RefObject<HTMLButtonElement>): DayRender;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DayPickerContextValue } from '../../../contexts/DayPicker';
|
|
2
|
+
import { ActiveModifiers } from '../../../types/Modifiers';
|
|
3
|
+
/** Return the class names for the Day element, according to the given active modifiers. */
|
|
4
|
+
export declare function getDayClassNames(dayPicker: Pick<DayPickerContextValue, 'modifiersClassNames' | 'classNames' | 'modifierPrefix'>, activeModifiers: ActiveModifiers): string[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DayPickerContextValue } from '../../../contexts/DayPicker';
|
|
3
|
+
import { ActiveModifiers } from '../../../types/Modifiers';
|
|
4
|
+
/** Return the style for the Day element, according to the given active modifiers. */
|
|
5
|
+
export declare function getDayStyle(dayPicker: Pick<DayPickerContextValue, 'modifiersStyles' | 'styles'>, activeModifiers: ActiveModifiers): React.CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './useInput';
|
|
1
|
+
export * from './useInput';
|