react-day-picker 8.0.0-beta.38 → 8.0.0-beta.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/DayPicker.d.ts +0 -1
- package/dist/components/Caption/Caption.d.ts +0 -1
- package/dist/components/CaptionLabel/CaptionLabel.d.ts +0 -1
- package/dist/components/Day/Day.d.ts +0 -1
- package/dist/components/DayContent/DayContent.d.ts +0 -1
- package/dist/components/Footer/Footer.d.ts +0 -1
- package/dist/components/Head/Head.d.ts +0 -1
- package/dist/components/IconDropdown/IconDropdown.d.ts +0 -1
- package/dist/components/IconLeft/IconLeft.d.ts +0 -1
- package/dist/components/IconRight/IconRight.d.ts +0 -1
- package/dist/components/Month/Month.d.ts +0 -1
- package/dist/components/MonthsDropdown/MonthsDropdown.d.ts +0 -1
- package/dist/components/Root/Root.d.ts +0 -1
- package/dist/components/Row/Row.d.ts +0 -1
- package/dist/components/Table/Table.d.ts +0 -1
- package/dist/components/Table/utils/daysToMonthWeeks.d.ts +8 -0
- package/dist/components/Table/utils/getMonthWeeks.d.ts +21 -0
- package/dist/components/WeekNumber/WeekNumber.d.ts +0 -1
- package/dist/components/YearsDropdown/YearsDropdown.d.ts +0 -1
- package/dist/contexts/Modifiers/utils/isMatch.d.ts +17 -1
- package/dist/contexts/Navigation/NavigationContext.d.ts +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +147 -186
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +147 -185
- package/dist/index.js.map +1 -1
- package/dist/react-day-picker.min.js +1 -1
- package/dist/style.css.d.ts +35 -36
- package/dist/types/Matchers.d.ts +51 -1
- package/package.json +20 -20
- package/dist/components/Table/utils/getOutsideEndDays.d.ts +0 -3
- package/dist/components/Table/utils/getOutsideStartDays.d.ts +0 -4
- package/dist/components/Table/utils/getWeeks.d.ts +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,13 @@ See the preview website at https://react-day-picker-next.netlify.app.
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
+
### v8.0.0-beta.39
|
|
22
|
+
|
|
23
|
+
- chore: cleaned up icon components
|
|
24
|
+
- chore: exported `isMatch` function
|
|
25
|
+
- fix: useNavigation not setting the start of the month
|
|
26
|
+
- chore: completed unit tests
|
|
27
|
+
|
|
21
28
|
### v8.0.0-beta.38
|
|
22
29
|
|
|
23
30
|
- fix(regression): restore missing `Caption` component
|
package/dist/DayPicker.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Locale } from 'date-fns';
|
|
2
|
+
import { MonthWeek } from './getMonthWeeks';
|
|
3
|
+
/** Return the weeks between two dates. */
|
|
4
|
+
export declare function daysToMonthWeeks(fromDate: Date, toDate: Date, options?: {
|
|
5
|
+
locale?: Locale;
|
|
6
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
7
|
+
firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
8
|
+
}): MonthWeek[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Locale } from 'date-fns';
|
|
2
|
+
/** Represents a week in the month.*/
|
|
3
|
+
export declare type MonthWeek = {
|
|
4
|
+
/** The week number from the start of the year. */
|
|
5
|
+
weekNumber: number;
|
|
6
|
+
/** The dates in the week. */
|
|
7
|
+
dates: Date[];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Return the weeks belonging to the given month, adding the "outside days" to
|
|
11
|
+
* the first and last week.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getMonthWeeks(
|
|
14
|
+
/** The month to get the weeks from */
|
|
15
|
+
month: Date, options: {
|
|
16
|
+
locale: Locale;
|
|
17
|
+
/** Add extra weeks up to 6 weeks */
|
|
18
|
+
useFixedWeeks?: boolean;
|
|
19
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
20
|
+
firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
21
|
+
}): MonthWeek[];
|
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
import { Matcher } from '../../../types/Matchers';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Returns whether a day matches against at least one of the given Matchers.
|
|
4
|
+
*
|
|
5
|
+
* ```
|
|
6
|
+
* const day = new Date(2022, 5, 19);
|
|
7
|
+
* const matcher1: DateRange = {
|
|
8
|
+
* from: new Date(2021, 12, 21),
|
|
9
|
+
* to: new Date(2021, 12, 30)
|
|
10
|
+
* }
|
|
11
|
+
* const matcher2: DateRange = {
|
|
12
|
+
* from: new Date(2022, 5, 1),
|
|
13
|
+
* to: new Date(2022, 5, 23)
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* const isMatch(day, [matcher1, matcher2]); // true, since day is in the matcher1 range.
|
|
17
|
+
* ```
|
|
18
|
+
* */
|
|
3
19
|
export declare function isMatch(day: Date, matchers: Matcher[]): boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
/** Represents the value of the [[NavigationContext]]. */
|
|
3
3
|
export interface NavigationContextValue {
|
|
4
|
-
/** The
|
|
5
|
-
|
|
4
|
+
/** The month to display in the calendar. Note that when `numberOfMonths > 1` represent the first month in the displayed months. */
|
|
5
|
+
currentMonth: Date;
|
|
6
6
|
/** The months rendered by DayPicker. DayPicker can render one than one month via `numberOfMonths`. */
|
|
7
7
|
displayMonths: Date[];
|
|
8
8
|
/** Navigate to the specified month. */
|
|
@@ -13,7 +13,7 @@ export interface NavigationContextValue {
|
|
|
13
13
|
nextMonth?: Date;
|
|
14
14
|
/** The previous month to display. `undefined` if no months left */
|
|
15
15
|
previousMonth?: Date;
|
|
16
|
-
/** Return true if the day is displayed in the calendar. */
|
|
16
|
+
/** Return true if the day is currently included in the months displayed in the calendar. */
|
|
17
17
|
isDateDisplayed: (day: Date) => boolean;
|
|
18
18
|
}
|
|
19
19
|
/**
|
package/dist/index.d.ts
CHANGED