react-day-picker 9.14.0 → 10.0.0-next.1
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/dist/cjs/DayPicker.js +84 -82
- package/dist/cjs/UI.d.ts +2 -239
- package/dist/cjs/UI.js +2 -2
- package/dist/cjs/classes/DateLib.d.ts +0 -21
- package/dist/cjs/classes/DateLib.js +3 -13
- package/dist/cjs/components/Chevron.js +1 -3
- package/dist/cjs/components/Dropdown.d.ts +0 -11
- package/dist/cjs/components/Dropdown.js +3 -1
- package/dist/cjs/components/NextMonthButton.js +1 -3
- package/dist/cjs/components/PreviousMonthButton.js +1 -3
- package/dist/cjs/components/custom-components.d.ts +0 -1
- package/dist/cjs/components/custom-components.js +0 -1
- package/dist/cjs/formatters/formatCaption.d.ts +0 -6
- package/dist/cjs/formatters/formatCaption.js +0 -7
- package/dist/cjs/formatters/formatWeekNumber.d.ts +1 -1
- package/dist/cjs/formatters/formatYearDropdown.d.ts +0 -6
- package/dist/cjs/formatters/formatYearDropdown.js +0 -7
- package/dist/cjs/helpers/getFormatters.d.ts +0 -2
- package/dist/cjs/helpers/getFormatters.js +0 -7
- package/dist/cjs/helpers/getInitialMonth.d.ts +1 -1
- package/dist/cjs/helpers/getNavMonth.d.ts +1 -1
- package/dist/cjs/helpers/getNavMonth.js +1 -21
- package/dist/cjs/hijri/index.js +2 -8
- package/dist/cjs/labels/labelDayButton.d.ts +0 -5
- package/dist/cjs/labels/labelDayButton.js +0 -6
- package/dist/cjs/labels/labelGrid.d.ts +0 -5
- package/dist/cjs/labels/labelGrid.js +0 -6
- package/dist/cjs/types/index.d.ts +0 -1
- package/dist/cjs/types/index.js +0 -1
- package/dist/cjs/types/props.d.ts +3 -97
- package/dist/cjs/types/shared.d.ts +1 -45
- package/dist/cjs/useAnimation.js +1 -2
- package/dist/cjs/useCalendar.d.ts +1 -1
- package/dist/cjs/utils/dateMatchModifiers.d.ts +0 -5
- package/dist/cjs/utils/dateMatchModifiers.js +0 -6
- package/dist/cjs/utils/rangeIncludesDate.d.ts +1 -6
- package/dist/cjs/utils/rangeIncludesDate.js +0 -7
- package/dist/cjs/utils/rangeOverlaps.d.ts +1 -1
- package/dist/esm/DayPicker.js +84 -82
- package/dist/esm/UI.d.ts +2 -239
- package/dist/esm/UI.js +2 -2
- package/dist/esm/classes/DateLib.d.ts +0 -21
- package/dist/esm/classes/DateLib.js +2 -12
- package/dist/esm/components/Chevron.js +1 -3
- package/dist/esm/components/Dropdown.d.ts +0 -11
- package/dist/esm/components/Dropdown.js +3 -1
- package/dist/esm/components/NextMonthButton.js +1 -3
- package/dist/esm/components/PreviousMonthButton.js +1 -3
- package/dist/esm/components/custom-components.d.ts +0 -1
- package/dist/esm/components/custom-components.js +0 -1
- package/dist/esm/formatters/formatCaption.d.ts +0 -6
- package/dist/esm/formatters/formatCaption.js +0 -6
- package/dist/esm/formatters/formatWeekNumber.d.ts +1 -1
- package/dist/esm/formatters/formatYearDropdown.d.ts +0 -6
- package/dist/esm/formatters/formatYearDropdown.js +0 -6
- package/dist/esm/helpers/getFormatters.d.ts +0 -2
- package/dist/esm/helpers/getFormatters.js +0 -7
- package/dist/esm/helpers/getInitialMonth.d.ts +1 -1
- package/dist/esm/helpers/getNavMonth.d.ts +1 -1
- package/dist/esm/helpers/getNavMonth.js +1 -21
- package/dist/esm/hijri/index.js +2 -8
- package/dist/esm/labels/labelDayButton.d.ts +0 -5
- package/dist/esm/labels/labelDayButton.js +0 -5
- package/dist/esm/labels/labelGrid.d.ts +0 -5
- package/dist/esm/labels/labelGrid.js +0 -5
- package/dist/esm/types/index.d.ts +0 -1
- package/dist/esm/types/index.js +0 -1
- package/dist/esm/types/props.d.ts +3 -97
- package/dist/esm/types/shared.d.ts +1 -45
- package/dist/esm/useAnimation.js +1 -2
- package/dist/esm/useCalendar.d.ts +1 -1
- package/dist/esm/utils/dateMatchModifiers.d.ts +0 -5
- package/dist/esm/utils/dateMatchModifiers.js +0 -5
- package/dist/esm/utils/rangeIncludesDate.d.ts +1 -6
- package/dist/esm/utils/rangeIncludesDate.js +0 -5
- package/dist/esm/utils/rangeOverlaps.d.ts +1 -1
- package/package.json +13 -25
- package/dist/cjs/components/Button.d.ts +0 -9
- package/dist/cjs/components/Button.js +0 -16
- package/dist/cjs/jalali.d.ts +0 -2
- package/dist/cjs/jalali.js +0 -18
- package/dist/cjs/types/deprecated.d.ts +0 -180
- package/dist/cjs/types/deprecated.js +0 -26
- package/dist/esm/components/Button.d.ts +0 -9
- package/dist/esm/components/Button.js +0 -10
- package/dist/esm/jalali.d.ts +0 -2
- package/dist/esm/jalali.js +0 -2
- package/dist/esm/types/deprecated.d.ts +0 -180
- package/dist/esm/types/deprecated.js +0 -23
- package/jalali.d.ts +0 -1
- package/jalali.js +0 -3
|
@@ -12,9 +12,3 @@ import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
|
|
|
12
12
|
* @see https://daypicker.dev/docs/translation#custom-formatters
|
|
13
13
|
*/
|
|
14
14
|
export declare function formatCaption(month: Date, options?: DateLibOptions, dateLib?: DateLib): string;
|
|
15
|
-
/**
|
|
16
|
-
* @private
|
|
17
|
-
* @deprecated Use {@link formatCaption} instead.
|
|
18
|
-
* @group Formatters
|
|
19
|
-
*/
|
|
20
|
-
export declare const formatMonthCaption: typeof formatCaption;
|
|
@@ -15,9 +15,3 @@ export function formatCaption(month, options, dateLib) {
|
|
|
15
15
|
const lib = dateLib ?? new DateLib(options);
|
|
16
16
|
return lib.formatMonthYear(month);
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
19
|
-
* @private
|
|
20
|
-
* @deprecated Use {@link formatCaption} instead.
|
|
21
|
-
* @group Formatters
|
|
22
|
-
*/
|
|
23
|
-
export const formatMonthCaption = formatCaption;
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* @group Formatters
|
|
10
10
|
* @see https://daypicker.dev/docs/translation#custom-formatters
|
|
11
11
|
*/
|
|
12
|
-
export declare function formatWeekNumber(weekNumber: number, dateLib?: import("../
|
|
12
|
+
export declare function formatWeekNumber(weekNumber: number, dateLib?: import("../index.js").DateLib): string;
|
|
@@ -10,9 +10,3 @@ import { type DateLib } from "../classes/DateLib.js";
|
|
|
10
10
|
* @see https://daypicker.dev/docs/translation#custom-formatters
|
|
11
11
|
*/
|
|
12
12
|
export declare function formatYearDropdown(year: Date, dateLib?: DateLib): string;
|
|
13
|
-
/**
|
|
14
|
-
* @private
|
|
15
|
-
* @deprecated Use `formatYearDropdown` instead.
|
|
16
|
-
* @group Formatters
|
|
17
|
-
*/
|
|
18
|
-
export declare const formatYearCaption: typeof formatYearDropdown;
|
|
@@ -12,9 +12,3 @@ import { defaultDateLib } from "../classes/DateLib.js";
|
|
|
12
12
|
export function formatYearDropdown(year, dateLib = defaultDateLib) {
|
|
13
13
|
return dateLib.format(year, "yyyy");
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
16
|
-
* @private
|
|
17
|
-
* @deprecated Use `formatYearDropdown` instead.
|
|
18
|
-
* @group Formatters
|
|
19
|
-
*/
|
|
20
|
-
export const formatYearCaption = formatYearDropdown;
|
|
@@ -11,10 +11,8 @@ export declare function getFormatters(customFormatters: DayPickerProps["formatte
|
|
|
11
11
|
formatCaption: typeof defaultFormatters.formatCaption;
|
|
12
12
|
formatDay: typeof defaultFormatters.formatDay;
|
|
13
13
|
formatMonthDropdown: typeof defaultFormatters.formatMonthDropdown;
|
|
14
|
-
formatMonthCaption: typeof defaultFormatters.formatMonthCaption;
|
|
15
14
|
formatWeekNumber: typeof defaultFormatters.formatWeekNumber;
|
|
16
15
|
formatWeekNumberHeader: typeof defaultFormatters.formatWeekNumberHeader;
|
|
17
16
|
formatWeekdayName: typeof defaultFormatters.formatWeekdayName;
|
|
18
17
|
formatYearDropdown: typeof defaultFormatters.formatYearDropdown;
|
|
19
|
-
formatYearCaption: typeof defaultFormatters.formatYearCaption;
|
|
20
18
|
};
|
|
@@ -7,13 +7,6 @@ import * as defaultFormatters from "../formatters/index.js";
|
|
|
7
7
|
* @returns The merged formatters object.
|
|
8
8
|
*/
|
|
9
9
|
export function getFormatters(customFormatters) {
|
|
10
|
-
if (customFormatters?.formatMonthCaption && !customFormatters.formatCaption) {
|
|
11
|
-
customFormatters.formatCaption = customFormatters.formatMonthCaption;
|
|
12
|
-
}
|
|
13
|
-
if (customFormatters?.formatYearCaption &&
|
|
14
|
-
!customFormatters.formatYearDropdown) {
|
|
15
|
-
customFormatters.formatYearDropdown = customFormatters.formatYearCaption;
|
|
16
|
-
}
|
|
17
10
|
return {
|
|
18
11
|
...defaultFormatters,
|
|
19
12
|
...customFormatters,
|
|
@@ -11,4 +11,4 @@ import type { DayPickerProps } from "../types/props.js";
|
|
|
11
11
|
* @param dateLib The date library to use for date manipulation.
|
|
12
12
|
* @returns The initial month to display.
|
|
13
13
|
*/
|
|
14
|
-
export declare function getInitialMonth(props: Pick<DayPickerProps, "
|
|
14
|
+
export declare function getInitialMonth(props: Pick<DayPickerProps, "month" | "defaultMonth" | "today" | "numberOfMonths" | "timeZone">, navStart: Date | undefined, navEnd: Date | undefined, dateLib: DateLib): Date;
|
|
@@ -7,4 +7,4 @@ import type { DayPickerProps } from "../types/index.js";
|
|
|
7
7
|
* @param dateLib The date library to use for date manipulation.
|
|
8
8
|
* @returns A tuple containing the start and end months for navigation.
|
|
9
9
|
*/
|
|
10
|
-
export declare function getNavMonths(props: Pick<DayPickerProps, "captionLayout" | "endMonth" | "startMonth" | "today" | "timeZone"
|
|
10
|
+
export declare function getNavMonths(props: Pick<DayPickerProps, "captionLayout" | "endMonth" | "startMonth" | "today" | "timeZone">, dateLib: DateLib): [start: Date | undefined, end: Date | undefined];
|
|
@@ -7,38 +7,18 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export function getNavMonths(props, dateLib) {
|
|
9
9
|
let { startMonth, endMonth } = props;
|
|
10
|
-
const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear,
|
|
11
|
-
// Handle deprecated code
|
|
12
|
-
const { fromYear, toYear, fromMonth, toMonth } = props;
|
|
13
|
-
if (!startMonth && fromMonth) {
|
|
14
|
-
startMonth = fromMonth;
|
|
15
|
-
}
|
|
16
|
-
if (!startMonth && fromYear) {
|
|
17
|
-
startMonth = dateLib.newDate(fromYear, 0, 1);
|
|
18
|
-
}
|
|
19
|
-
if (!endMonth && toMonth) {
|
|
20
|
-
endMonth = toMonth;
|
|
21
|
-
}
|
|
22
|
-
if (!endMonth && toYear) {
|
|
23
|
-
endMonth = newDate(toYear, 11, 31);
|
|
24
|
-
}
|
|
10
|
+
const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear, today, } = dateLib;
|
|
25
11
|
const hasYearDropdown = props.captionLayout === "dropdown" ||
|
|
26
12
|
props.captionLayout === "dropdown-years";
|
|
27
13
|
if (startMonth) {
|
|
28
14
|
startMonth = startOfMonth(startMonth);
|
|
29
15
|
}
|
|
30
|
-
else if (fromYear) {
|
|
31
|
-
startMonth = newDate(fromYear, 0, 1);
|
|
32
|
-
}
|
|
33
16
|
else if (!startMonth && hasYearDropdown) {
|
|
34
17
|
startMonth = startOfYear(addYears(props.today ?? today(), -100));
|
|
35
18
|
}
|
|
36
19
|
if (endMonth) {
|
|
37
20
|
endMonth = endOfMonth(endMonth);
|
|
38
21
|
}
|
|
39
|
-
else if (toYear) {
|
|
40
|
-
endMonth = newDate(toYear, 11, 31);
|
|
41
|
-
}
|
|
42
22
|
else if (!endMonth && hasYearDropdown) {
|
|
43
23
|
endMonth = endOfYear(props.today ?? today());
|
|
44
24
|
}
|
package/dist/esm/hijri/index.js
CHANGED
|
@@ -25,12 +25,8 @@ function clampDateProp(date) {
|
|
|
25
25
|
*/
|
|
26
26
|
export function DayPicker(props) {
|
|
27
27
|
const { dateLib: dateLibProp, ...dayPickerProps } = props;
|
|
28
|
-
const hasStartBound = props.startMonth !== undefined
|
|
29
|
-
|
|
30
|
-
props.fromYear !== undefined;
|
|
31
|
-
const hasEndBound = props.endMonth !== undefined ||
|
|
32
|
-
props.toMonth !== undefined ||
|
|
33
|
-
props.toYear !== undefined;
|
|
28
|
+
const hasStartBound = props.startMonth !== undefined;
|
|
29
|
+
const hasEndBound = props.endMonth !== undefined;
|
|
34
30
|
const clampedProps = {
|
|
35
31
|
...dayPickerProps,
|
|
36
32
|
month: clampDateProp(props.month),
|
|
@@ -42,8 +38,6 @@ export function DayPicker(props) {
|
|
|
42
38
|
endMonth: hasEndBound
|
|
43
39
|
? clampDateProp(props.endMonth)
|
|
44
40
|
: new Date(GREGORIAN_MAX_DATE),
|
|
45
|
-
fromMonth: clampDateProp(props.fromMonth),
|
|
46
|
-
toMonth: clampDateProp(props.toMonth),
|
|
47
41
|
};
|
|
48
42
|
return (React.createElement(DayPickerComponent, { ...clampedProps, locale: props.locale ?? arSA, numerals: props.numerals ?? "arab", dir: props.dir ?? "rtl", dateLib: { ...hijriDateLib, ...dateLibProp } }));
|
|
49
43
|
}
|
|
@@ -16,8 +16,3 @@ import type { Modifiers } from "../types/index.js";
|
|
|
16
16
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
17
17
|
*/
|
|
18
18
|
export declare function labelDayButton(date: Date, modifiers: Modifiers, options?: DateLibOptions, dateLib?: DateLib): string;
|
|
19
|
-
/**
|
|
20
|
-
* @ignore
|
|
21
|
-
* @deprecated Use `labelDayButton` instead.
|
|
22
|
-
*/
|
|
23
|
-
export declare const labelDay: typeof labelDayButton;
|
|
@@ -12,8 +12,3 @@ import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
|
|
|
12
12
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
13
13
|
*/
|
|
14
14
|
export declare function labelGrid(date: Date, options?: DateLibOptions, dateLib?: DateLib): string;
|
|
15
|
-
/**
|
|
16
|
-
* @ignore
|
|
17
|
-
* @deprecated Use {@link labelGrid} instead.
|
|
18
|
-
*/
|
|
19
|
-
export declare const labelCaption: typeof labelGrid;
|
package/dist/esm/types/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { DateLib, DayPickerLocale } from "../classes/DateLib.js";
|
|
3
|
-
import type { DeprecatedUI } from "../UI.js";
|
|
4
3
|
import type { ClassNames, CustomComponents, DateRange, DayEventHandler, Formatters, Labels, Matcher, Mode, Modifiers, ModifiersClassNames, ModifiersStyles, MonthChangeEventHandler, Numerals, Styles } from "./shared.js";
|
|
5
4
|
/**
|
|
6
5
|
* The props for the `<DayPicker />` component.
|
|
@@ -42,7 +41,7 @@ export interface PropsBase {
|
|
|
42
41
|
*
|
|
43
42
|
* @see https://daypicker.dev/docs/styling
|
|
44
43
|
*/
|
|
45
|
-
classNames?: Partial<ClassNames
|
|
44
|
+
classNames?: Partial<ClassNames>;
|
|
46
45
|
/**
|
|
47
46
|
* Change the class name for the day matching the `modifiers`.
|
|
48
47
|
*
|
|
@@ -56,7 +55,7 @@ export interface PropsBase {
|
|
|
56
55
|
*
|
|
57
56
|
* @see https://daypicker.dev/docs/styling
|
|
58
57
|
*/
|
|
59
|
-
styles?: Partial<Styles
|
|
58
|
+
styles?: Partial<Styles>;
|
|
60
59
|
/**
|
|
61
60
|
* Change the class name for the day matching the {@link modifiers}.
|
|
62
61
|
*
|
|
@@ -98,26 +97,6 @@ export interface PropsBase {
|
|
|
98
97
|
* @see https://daypicker.dev/docs/navigation#start-and-end-dates
|
|
99
98
|
*/
|
|
100
99
|
startMonth?: Date | undefined;
|
|
101
|
-
/**
|
|
102
|
-
* @private
|
|
103
|
-
* @deprecated This prop has been removed. Use `hidden={{ before: date }}`
|
|
104
|
-
* instead.
|
|
105
|
-
* @see https://daypicker.dev/docs/navigation#start-and-end-dates
|
|
106
|
-
*/
|
|
107
|
-
fromDate?: Date | undefined;
|
|
108
|
-
/**
|
|
109
|
-
* @private
|
|
110
|
-
* @deprecated This prop has been renamed to `startMonth`.
|
|
111
|
-
* @see https://daypicker.dev/docs/navigation#start-and-end-dates
|
|
112
|
-
*/
|
|
113
|
-
fromMonth?: Date | undefined;
|
|
114
|
-
/**
|
|
115
|
-
* @private
|
|
116
|
-
* @deprecated Use `startMonth` instead. E.g. `startMonth={new Date(year,
|
|
117
|
-
* 0)}`.
|
|
118
|
-
* @see https://daypicker.dev/docs/navigation#start-and-end-dates
|
|
119
|
-
*/
|
|
120
|
-
fromYear?: number | undefined;
|
|
121
100
|
/**
|
|
122
101
|
* The latest month to end the month navigation.
|
|
123
102
|
*
|
|
@@ -125,25 +104,6 @@ export interface PropsBase {
|
|
|
125
104
|
* @see https://daypicker.dev/docs/navigation#start-and-end-dates
|
|
126
105
|
*/
|
|
127
106
|
endMonth?: Date;
|
|
128
|
-
/**
|
|
129
|
-
* @private
|
|
130
|
-
* @deprecated This prop has been removed. Use `hidden={{ after: date }}`
|
|
131
|
-
* instead.
|
|
132
|
-
* @see https://daypicker.dev/docs/navigation#start-and-end-dates
|
|
133
|
-
*/
|
|
134
|
-
toDate?: Date;
|
|
135
|
-
/**
|
|
136
|
-
* @private
|
|
137
|
-
* @deprecated This prop has been renamed to `endMonth`.
|
|
138
|
-
* @see https://daypicker.dev/docs/navigation#start-and-end-dates
|
|
139
|
-
*/
|
|
140
|
-
toMonth?: Date;
|
|
141
|
-
/**
|
|
142
|
-
* @private
|
|
143
|
-
* @deprecated Use `endMonth` instead. E.g. `endMonth={new Date(year, 0)}`.
|
|
144
|
-
* @see https://daypicker.dev/docs/navigation#start-and-end-dates
|
|
145
|
-
*/
|
|
146
|
-
toYear?: number;
|
|
147
107
|
/**
|
|
148
108
|
* Paginate the month navigation displaying the `numberOfMonths` at a time.
|
|
149
109
|
*
|
|
@@ -203,8 +163,7 @@ export interface PropsBase {
|
|
|
203
163
|
* - `after`: Displays the buttons after the caption. This ensures the tab order
|
|
204
164
|
* matches the visual order.
|
|
205
165
|
*
|
|
206
|
-
*
|
|
207
|
-
* the tab order may not align with the visual order.
|
|
166
|
+
* Default value is `after`.
|
|
208
167
|
*
|
|
209
168
|
* @since 9.7.0
|
|
210
169
|
* @see https://daypicker.dev/docs/customization#navigation-layouts
|
|
@@ -311,11 +270,6 @@ export interface PropsBase {
|
|
|
311
270
|
* @see https://daypicker.dev/guides/accessibility#autofocus
|
|
312
271
|
*/
|
|
313
272
|
autoFocus?: boolean;
|
|
314
|
-
/**
|
|
315
|
-
* @private
|
|
316
|
-
* @deprecated This prop will be removed. Use {@link autoFocus} instead.
|
|
317
|
-
*/
|
|
318
|
-
initialFocus?: boolean;
|
|
319
273
|
/**
|
|
320
274
|
* Apply the `disabled` modifier to the matching days. Disabled days cannot be
|
|
321
275
|
* selected when in a selection mode is set.
|
|
@@ -484,14 +438,6 @@ export interface PropsBase {
|
|
|
484
438
|
* @see https://daypicker.dev/docs/navigation
|
|
485
439
|
*/
|
|
486
440
|
onPrevClick?: MonthChangeEventHandler;
|
|
487
|
-
/**
|
|
488
|
-
* Event handler when a week number is clicked.
|
|
489
|
-
*
|
|
490
|
-
* @private
|
|
491
|
-
* @deprecated Use a custom `WeekNumber` component instead.
|
|
492
|
-
* @see https://daypicker.dev/docs/customization#showweeknumber
|
|
493
|
-
*/
|
|
494
|
-
onWeekNumberClick?: any;
|
|
495
441
|
/** Event handler when a day is clicked. */
|
|
496
442
|
onDayClick?: DayEventHandler<React.MouseEvent>;
|
|
497
443
|
/** Event handler when a day is focused. */
|
|
@@ -512,46 +458,6 @@ export interface PropsBase {
|
|
|
512
458
|
* @experimental
|
|
513
459
|
*/
|
|
514
460
|
dateLib?: Partial<typeof DateLib.prototype> | undefined;
|
|
515
|
-
/**
|
|
516
|
-
* @private
|
|
517
|
-
* @deprecated Use a custom `DayButton` component instead.
|
|
518
|
-
*/
|
|
519
|
-
onDayKeyUp?: DayEventHandler<React.KeyboardEvent>;
|
|
520
|
-
/**
|
|
521
|
-
* @private
|
|
522
|
-
* @deprecated Use a custom `DayButton` component instead.
|
|
523
|
-
*/
|
|
524
|
-
onDayKeyPress?: DayEventHandler<React.KeyboardEvent>;
|
|
525
|
-
/**
|
|
526
|
-
* @private
|
|
527
|
-
* @deprecated Use a custom `DayButton` component instead.
|
|
528
|
-
*/
|
|
529
|
-
onDayPointerEnter?: DayEventHandler<React.PointerEvent>;
|
|
530
|
-
/**
|
|
531
|
-
* @private
|
|
532
|
-
* @deprecated Use a custom `DayButton` component instead.
|
|
533
|
-
*/
|
|
534
|
-
onDayPointerLeave?: DayEventHandler<React.PointerEvent>;
|
|
535
|
-
/**
|
|
536
|
-
* @private
|
|
537
|
-
* @deprecated Use a custom `DayButton` component instead.
|
|
538
|
-
*/
|
|
539
|
-
onDayTouchCancel?: DayEventHandler<React.TouchEvent>;
|
|
540
|
-
/**
|
|
541
|
-
* @private
|
|
542
|
-
* @deprecated Use a custom `DayButton` component instead.
|
|
543
|
-
*/
|
|
544
|
-
onDayTouchEnd?: DayEventHandler<React.TouchEvent>;
|
|
545
|
-
/**
|
|
546
|
-
* @private
|
|
547
|
-
* @deprecated Use a custom `DayButton` component instead.
|
|
548
|
-
*/
|
|
549
|
-
onDayTouchMove?: DayEventHandler<React.TouchEvent>;
|
|
550
|
-
/**
|
|
551
|
-
* @private
|
|
552
|
-
* @deprecated Use a custom `DayButton` component instead.
|
|
553
|
-
*/
|
|
554
|
-
onDayTouchStart?: DayEventHandler<React.TouchEvent>;
|
|
555
461
|
}
|
|
556
462
|
/**
|
|
557
463
|
* Shared handler type for `onSelect` callback when a selection mode is set.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
2
|
import type * as components from "../components/custom-components.js";
|
|
3
|
-
import type { formatCaption, formatDay,
|
|
3
|
+
import type { formatCaption, formatDay, formatMonthDropdown, formatWeekdayName, formatWeekNumber, formatWeekNumberHeader, formatYearDropdown } from "../formatters/index.js";
|
|
4
4
|
import type { labelDayButton, labelGrid, labelGridcell, labelMonthDropdown, labelNav, labelNext, labelPrevious, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown } from "../labels/index.js";
|
|
5
5
|
import type { Animation, DayFlag, SelectionState, UI } from "../UI.js";
|
|
6
6
|
/**
|
|
@@ -19,13 +19,6 @@ export type Mode = "single" | "multiple" | "range";
|
|
|
19
19
|
* @see https://daypicker.dev/guides/custom-components
|
|
20
20
|
*/
|
|
21
21
|
export type CustomComponents = {
|
|
22
|
-
/**
|
|
23
|
-
* Render any button element in DayPicker.
|
|
24
|
-
*
|
|
25
|
-
* @deprecated Use {@link CustomComponents.NextMonthButton} or
|
|
26
|
-
* {@link CustomComponents.PreviousMonthButton} instead.
|
|
27
|
-
*/
|
|
28
|
-
Button: typeof components.Button;
|
|
29
22
|
/** Render the chevron icon used in the navigation buttons and dropdowns. */
|
|
30
23
|
Chevron: typeof components.Chevron;
|
|
31
24
|
/** Render the caption label of the month grid. */
|
|
@@ -85,13 +78,6 @@ export type Formatters = {
|
|
|
85
78
|
formatDay: typeof formatDay;
|
|
86
79
|
/** Format the label in the month dropdown. */
|
|
87
80
|
formatMonthDropdown: typeof formatMonthDropdown;
|
|
88
|
-
/**
|
|
89
|
-
* @ignore
|
|
90
|
-
* @deprecated Use {@link Formatters.formatCaption} instead.
|
|
91
|
-
*
|
|
92
|
-
* **Note:** This formatter will be removed in version 10.0.0.
|
|
93
|
-
*/
|
|
94
|
-
formatMonthCaption: typeof formatMonthCaption;
|
|
95
81
|
/** Format the week number. */
|
|
96
82
|
formatWeekNumber: typeof formatWeekNumber;
|
|
97
83
|
/** Format the header of the week number column. */
|
|
@@ -100,11 +86,6 @@ export type Formatters = {
|
|
|
100
86
|
formatWeekdayName: typeof formatWeekdayName;
|
|
101
87
|
/** Format the label in the year dropdown. */
|
|
102
88
|
formatYearDropdown: typeof formatYearDropdown;
|
|
103
|
-
/**
|
|
104
|
-
* @ignore
|
|
105
|
-
* @deprecated Use {@link Formatters.formatYearDropdown} instead.
|
|
106
|
-
*/
|
|
107
|
-
formatYearCaption: typeof formatYearCaption;
|
|
108
89
|
};
|
|
109
90
|
/** A map of functions to translate ARIA labels for various elements. */
|
|
110
91
|
export type Labels = {
|
|
@@ -124,11 +105,6 @@ export type Labels = {
|
|
|
124
105
|
labelPrevious: typeof labelPrevious;
|
|
125
106
|
/** The label for the day button. */
|
|
126
107
|
labelDayButton: typeof labelDayButton;
|
|
127
|
-
/**
|
|
128
|
-
* @ignore
|
|
129
|
-
* @deprecated Use {@link labelDayButton} instead.
|
|
130
|
-
*/
|
|
131
|
-
labelDay: typeof labelDayButton;
|
|
132
108
|
/** The label for the weekday. */
|
|
133
109
|
labelWeekday: typeof labelWeekday;
|
|
134
110
|
/** The label for the week number. */
|
|
@@ -285,26 +261,6 @@ export type ModifiersStyles = Record<string, CSSProperties>;
|
|
|
285
261
|
* };
|
|
286
262
|
*/
|
|
287
263
|
export type ModifiersClassNames = Record<string, string>;
|
|
288
|
-
/**
|
|
289
|
-
* The props that have been deprecated since version 9.0.0.
|
|
290
|
-
*
|
|
291
|
-
* @private
|
|
292
|
-
* @since 9.0.0
|
|
293
|
-
* @see https://daypicker.dev/upgrading
|
|
294
|
-
*/
|
|
295
|
-
export type V9DeprecatedProps =
|
|
296
|
-
/** Use `hidden` prop instead. */
|
|
297
|
-
"fromDate"
|
|
298
|
-
/** Use `hidden` prop instead. */
|
|
299
|
-
| "toDate"
|
|
300
|
-
/** Use `startMonth` instead. */
|
|
301
|
-
| "fromMonth"
|
|
302
|
-
/** Use `endMonth` instead. */
|
|
303
|
-
| "toMonth"
|
|
304
|
-
/** Use `startMonth` instead. */
|
|
305
|
-
| "fromYear"
|
|
306
|
-
/** Use `endMonth` instead. */
|
|
307
|
-
| "toYear";
|
|
308
264
|
/** The direction to move the focus relative to the current focused date. */
|
|
309
265
|
export type MoveFocusDir = "after" | "before";
|
|
310
266
|
/** The temporal unit to move the focus by. */
|
package/dist/esm/useAnimation.js
CHANGED
|
@@ -94,8 +94,7 @@ export function useAnimation(rootElRef, enabled, { classNames, months, focused,
|
|
|
94
94
|
: [];
|
|
95
95
|
const currentMonthEls = queryMonthEls(rootElRef.current);
|
|
96
96
|
if (currentMonthEls?.every((el) => el instanceof HTMLElement) &&
|
|
97
|
-
previousMonthEls
|
|
98
|
-
previousMonthEls.every((el) => el instanceof HTMLElement)) {
|
|
97
|
+
previousMonthEls?.every((el) => el instanceof HTMLElement)) {
|
|
99
98
|
animatingRef.current = true;
|
|
100
99
|
const cleanUpFunctions = [];
|
|
101
100
|
// set isolation to isolate to isolate the stacking context during animation
|
|
@@ -52,4 +52,4 @@ export interface Calendar {
|
|
|
52
52
|
* @returns The calendar object containing displayed days, weeks, months, and
|
|
53
53
|
* navigation methods.
|
|
54
54
|
*/
|
|
55
|
-
export declare function useCalendar(props: Pick<DayPickerProps, "captionLayout" | "endMonth" | "startMonth" | "today" | "fixedWeeks" | "ISOWeek" | "numberOfMonths" | "pagedNavigation" | "reverseMonths" | "disableNavigation" | "onMonthChange" | "month" | "defaultMonth" | "timeZone" | "broadcastCalendar"
|
|
55
|
+
export declare function useCalendar(props: Pick<DayPickerProps, "captionLayout" | "endMonth" | "startMonth" | "today" | "fixedWeeks" | "ISOWeek" | "numberOfMonths" | "pagedNavigation" | "reverseMonths" | "disableNavigation" | "onMonthChange" | "month" | "defaultMonth" | "timeZone" | "broadcastCalendar">, dateLib: DateLib): Calendar;
|
|
@@ -10,8 +10,3 @@ import type { Matcher } from "../types/index.js";
|
|
|
10
10
|
* @group Utilities
|
|
11
11
|
*/
|
|
12
12
|
export declare function dateMatchModifiers(date: Date, matchers: Matcher | Matcher[], dateLib?: DateLib): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* @private
|
|
15
|
-
* @deprecated Use {@link dateMatchModifiers} instead.
|
|
16
|
-
*/
|
|
17
|
-
export declare const isMatch: typeof dateMatchModifiers;
|
|
@@ -10,9 +10,4 @@ import type { DateRange } from "../types/index.js";
|
|
|
10
10
|
* @returns `true` if the date is within the range, otherwise `false`.
|
|
11
11
|
* @group Utilities
|
|
12
12
|
*/
|
|
13
|
-
export declare function rangeIncludesDate(range: DateRange, date: Date, excludeEnds?: boolean, dateLib?: import("../
|
|
14
|
-
/**
|
|
15
|
-
* @private
|
|
16
|
-
* @deprecated Use {@link rangeIncludesDate} instead.
|
|
17
|
-
*/
|
|
18
|
-
export declare const isDateInRange: (range: DateRange, date: Date) => boolean;
|
|
13
|
+
export declare function rangeIncludesDate(range: DateRange, date: Date, excludeEnds?: boolean, dateLib?: import("../index.js").DateLib): boolean;
|
|
@@ -30,8 +30,3 @@ export function rangeIncludesDate(range, date, excludeEnds = false, dateLib = de
|
|
|
30
30
|
}
|
|
31
31
|
return false;
|
|
32
32
|
}
|
|
33
|
-
/**
|
|
34
|
-
* @private
|
|
35
|
-
* @deprecated Use {@link rangeIncludesDate} instead.
|
|
36
|
-
*/
|
|
37
|
-
export const isDateInRange = (range, date) => rangeIncludesDate(range, date, false, defaultDateLib);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-day-picker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-next.1",
|
|
4
4
|
"description": "Customizable Date Picker for React",
|
|
5
5
|
"author": "Giampaolo Bellavite <io@gpbl.dev>",
|
|
6
6
|
"homepage": "https://daypicker.dev",
|
|
@@ -35,16 +35,6 @@
|
|
|
35
35
|
"default": "./dist/cjs/index.js"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
"./jalali": {
|
|
39
|
-
"import": {
|
|
40
|
-
"types": "./dist/esm/jalali.d.ts",
|
|
41
|
-
"default": "./dist/esm/jalali.js"
|
|
42
|
-
},
|
|
43
|
-
"require": {
|
|
44
|
-
"types": "./dist/cjs/jalali.d.ts",
|
|
45
|
-
"default": "./dist/cjs/jalali.js"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
38
|
"./persian": {
|
|
49
39
|
"import": {
|
|
50
40
|
"types": "./dist/esm/persian.d.ts",
|
|
@@ -217,7 +207,7 @@
|
|
|
217
207
|
"build:css": "./scripts/build-css.sh ./src/style.css ./src/style.module.css",
|
|
218
208
|
"format": "prettier -w \"**/*.{md,mdx,ts,tsx}\"",
|
|
219
209
|
"lint": "biome check",
|
|
220
|
-
"test": "jest --selectProjects examples --selectProjects src",
|
|
210
|
+
"test": "jest --selectProjects examples --selectProjects src --selectProjects scripts",
|
|
221
211
|
"test:tz": "TZ=Australia/Adelaide jest --selectProjects examples/timezone",
|
|
222
212
|
"test:build": "jest --selectProjects examples/built",
|
|
223
213
|
"test-watch": "jest --watch",
|
|
@@ -230,8 +220,6 @@
|
|
|
230
220
|
"src/style.module.css",
|
|
231
221
|
"src/style.css.d.ts",
|
|
232
222
|
"src/style.module.css.d.ts",
|
|
233
|
-
"jalali.js",
|
|
234
|
-
"jalali.d.ts",
|
|
235
223
|
"persian.js",
|
|
236
224
|
"persian.d.ts",
|
|
237
225
|
"buddhist.js",
|
|
@@ -250,30 +238,30 @@
|
|
|
250
238
|
"date-fns-jalali": "4.1.0-0"
|
|
251
239
|
},
|
|
252
240
|
"devDependencies": {
|
|
253
|
-
"@biomejs/biome": "2.
|
|
254
|
-
"@jest/types": "^30.
|
|
241
|
+
"@biomejs/biome": "2.4.12",
|
|
242
|
+
"@jest/types": "^30.3.0",
|
|
255
243
|
"@radix-ui/react-select": "^2.2.6",
|
|
256
|
-
"@swc/core": "^1.15.
|
|
244
|
+
"@swc/core": "^1.15.26",
|
|
257
245
|
"@swc/jest": "^0.2.39",
|
|
258
246
|
"@testing-library/dom": "^10.4.1",
|
|
259
247
|
"@testing-library/jest-dom": "^6.9.1",
|
|
260
248
|
"@testing-library/react": "^16.3.2",
|
|
261
249
|
"@testing-library/user-event": "^14.6.1",
|
|
262
250
|
"@types/jest": "^30.0.0",
|
|
263
|
-
"@types/node": "^25.
|
|
264
|
-
"@types/react": "^19.2.
|
|
251
|
+
"@types/node": "^25.6.0",
|
|
252
|
+
"@types/react": "^19.2.14",
|
|
265
253
|
"@types/react-dom": "^19.2.3",
|
|
266
|
-
"jest": "^30.
|
|
267
|
-
"jest-environment-jsdom": "^30.
|
|
254
|
+
"jest": "^30.3.0",
|
|
255
|
+
"jest-environment-jsdom": "^30.3.0",
|
|
268
256
|
"jest-transform-css": "^6.0.3",
|
|
269
257
|
"mockdate": "^3.0.5",
|
|
270
|
-
"prettier": "^3.8.
|
|
258
|
+
"prettier": "^3.8.3",
|
|
271
259
|
"prettier-plugin-jsdoc": "^1.8.0",
|
|
272
|
-
"react": "^19.2.
|
|
273
|
-
"react-dom": "^19.2.
|
|
260
|
+
"react": "^19.2.5",
|
|
261
|
+
"react-dom": "^19.2.5",
|
|
274
262
|
"ts-node": "^10.9.2",
|
|
275
263
|
"tslib": "^2.8.1",
|
|
276
|
-
"typescript": "^
|
|
264
|
+
"typescript": "^6.0.3",
|
|
277
265
|
"typescript-css-modules": "^1.0.4"
|
|
278
266
|
},
|
|
279
267
|
"peerDependencies": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React, { type ButtonHTMLAttributes } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Render the button elements in the calendar.
|
|
4
|
-
*
|
|
5
|
-
* @private
|
|
6
|
-
* @deprecated Use `PreviousMonthButton` or `@link NextMonthButton` instead.
|
|
7
|
-
*/
|
|
8
|
-
export declare function Button(props: ButtonHTMLAttributes<HTMLButtonElement>): React.JSX.Element;
|
|
9
|
-
export type ButtonProps = Parameters<typeof Button>[0];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Button = Button;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
/**
|
|
9
|
-
* Render the button elements in the calendar.
|
|
10
|
-
*
|
|
11
|
-
* @private
|
|
12
|
-
* @deprecated Use `PreviousMonthButton` or `@link NextMonthButton` instead.
|
|
13
|
-
*/
|
|
14
|
-
function Button(props) {
|
|
15
|
-
return react_1.default.createElement("button", { ...props });
|
|
16
|
-
}
|
package/dist/cjs/jalali.d.ts
DELETED