@uxf/datepicker 16.13.1 → 16.15.0
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/hooks/use-date-picker-navigation.d.ts +3 -3
- package/hooks/use-day.d.ts +1 -1
- package/hooks/use-decade.d.ts +1 -1
- package/hooks/use-hour.d.ts +1 -1
- package/hooks/use-minute.d.ts +2 -2
- package/hooks/use-time-picker.d.ts +5 -5
- package/hooks/use-year.d.ts +1 -1
- package/package.json +5 -5
- package/utils/can-select-range.d.ts +4 -4
- package/utils/get-days.d.ts +3 -3
- package/utils/get-months.d.ts +1 -1
- package/utils/get-years.d.ts +1 -1
- package/utils/is-date-blocked.d.ts +4 -4
- package/utils/is-date-hovered.d.ts +4 -4
- package/utils/types.d.ts +2 -2
|
@@ -3,11 +3,11 @@ import { Dispatch, SetStateAction } from "react";
|
|
|
3
3
|
import { MonthType } from "../utils/types";
|
|
4
4
|
export interface UseDatePickerNavigationProps {
|
|
5
5
|
activeMonths: MonthType[];
|
|
6
|
-
setActiveMonths: Dispatch<SetStateAction<MonthType[]>>;
|
|
7
|
-
setFocusedDate: (date: Date | null) => void;
|
|
8
|
-
minBookingDate?: DateString;
|
|
9
6
|
maxBookingDate?: DateString;
|
|
7
|
+
minBookingDate?: DateString;
|
|
10
8
|
numberOfMonths: number;
|
|
9
|
+
setActiveMonths: Dispatch<SetStateAction<MonthType[]>>;
|
|
10
|
+
setFocusedDate: (date: Date | null) => void;
|
|
11
11
|
}
|
|
12
12
|
export interface UseDatePickerNavigationReturnType {
|
|
13
13
|
canGoToMonth: (month: Date) => boolean;
|
package/hooks/use-day.d.ts
CHANGED
package/hooks/use-decade.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { CalendarYear } from "../utils/get-years";
|
|
|
2
2
|
export declare const yearLabelFormatFn: (date: Date) => string;
|
|
3
3
|
export declare const decadeLabelFormatFn: (start: Date, end: Date) => string;
|
|
4
4
|
export interface UseDecadeReturnType {
|
|
5
|
-
years: CalendarYear[];
|
|
6
5
|
decadeLabel: string;
|
|
6
|
+
years: CalendarYear[];
|
|
7
7
|
}
|
|
8
8
|
export interface UseDecadeProps {
|
|
9
9
|
decadeLabelFormat?: (start: Date, end: Date) => string;
|
package/hooks/use-hour.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { KeyboardEvent, RefObject } from "react";
|
|
2
2
|
export interface UseHourProps {
|
|
3
|
+
focusedHour: number | null;
|
|
3
4
|
hour: number;
|
|
4
5
|
hourRef?: RefObject<HTMLElement | null>;
|
|
5
|
-
focusedHour: number | null;
|
|
6
6
|
isHourFocused: (hour: number) => boolean;
|
|
7
7
|
isHourSelected: (hour: number) => boolean;
|
|
8
8
|
onHourFocus: (hour: number) => void;
|
package/hooks/use-minute.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { KeyboardEvent, RefObject } from "react";
|
|
2
2
|
export interface UseMinuteProps {
|
|
3
|
-
minute: number;
|
|
4
|
-
minuteRef?: RefObject<HTMLElement | null>;
|
|
5
3
|
focusedMinute: number | null;
|
|
6
4
|
isMinuteFocused: (minute: number) => boolean;
|
|
7
5
|
isMinuteSelected: (minute: number) => boolean;
|
|
6
|
+
minute: number;
|
|
7
|
+
minuteRef?: RefObject<HTMLElement | null>;
|
|
8
8
|
onMinuteFocus: (minute: number) => void;
|
|
9
9
|
onMinuteSelect: (minute: number) => void;
|
|
10
10
|
preventScroll?: boolean;
|
|
@@ -10,13 +10,12 @@ export interface UseTimePickerProps {
|
|
|
10
10
|
selectedTime: TimeType | null;
|
|
11
11
|
}
|
|
12
12
|
export interface UseTimePickerReturnType {
|
|
13
|
-
onTimeSelect: (time: TimeType) => void;
|
|
14
|
-
goToPrevHour: () => void;
|
|
15
|
-
goToPrevMinute: () => void;
|
|
16
|
-
goToNextHour: () => void;
|
|
17
|
-
goToNextMinute: () => void;
|
|
18
13
|
focusedHour: number | null;
|
|
19
14
|
focusedMinute: number | null;
|
|
15
|
+
goToNextHour: () => void;
|
|
16
|
+
goToNextMinute: () => void;
|
|
17
|
+
goToPrevHour: () => void;
|
|
18
|
+
goToPrevMinute: () => void;
|
|
20
19
|
isHourFocused: (hour: number) => boolean;
|
|
21
20
|
isHourSelected: (hour: number) => boolean;
|
|
22
21
|
isMinuteFocused: (minute: number) => boolean;
|
|
@@ -25,6 +24,7 @@ export interface UseTimePickerReturnType {
|
|
|
25
24
|
onHourSelect: (hour: number) => void;
|
|
26
25
|
onMinuteFocus: (minute: number) => void;
|
|
27
26
|
onMinuteSelect: (minute: number) => void;
|
|
27
|
+
onTimeSelect: (time: TimeType) => void;
|
|
28
28
|
preventScroll?: boolean;
|
|
29
29
|
}
|
|
30
30
|
export declare function useTimePicker({ selectedTime, onTimeChange, onSelectCallback, preventScroll, }: UseTimePickerProps): UseTimePickerReturnType;
|
package/hooks/use-year.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface UseYearReturnType {
|
|
|
6
6
|
yearLabel: string;
|
|
7
7
|
}
|
|
8
8
|
export interface UseYearProps extends GetMonthsProps {
|
|
9
|
-
yearLabelFormat?: (date: Date) => string;
|
|
10
9
|
monthLabelFormat?: (date: Date) => string;
|
|
10
|
+
yearLabelFormat?: (date: Date) => string;
|
|
11
11
|
}
|
|
12
12
|
export declare function useYear({ yearLabelFormat, monthLabelFormat, year, }: UseYearProps): UseYearReturnType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/datepicker",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.15.0",
|
|
4
4
|
"description": "A set of React hooks to create an awesome datepicker.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"homepage": "https://fe.uxf.dev/docs/datepicker",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@uxf/core": "16.
|
|
23
|
-
"@uxf/core-react": "16.
|
|
22
|
+
"@uxf/core": "16.15.0",
|
|
23
|
+
"@uxf/core-react": "16.15.0",
|
|
24
24
|
"dayjs": "^1.11.23",
|
|
25
25
|
"next": ">=16.4.3",
|
|
26
26
|
"react": "^19.3.0",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/react": "19.3.0",
|
|
36
36
|
"@types/react-dom": "19.3.0",
|
|
37
|
-
"@uxf/core": "16.
|
|
38
|
-
"@uxf/core-react": "16.
|
|
37
|
+
"@uxf/core": "16.15.0",
|
|
38
|
+
"@uxf/core-react": "16.15.0",
|
|
39
39
|
"dayjs": "^1.11.23",
|
|
40
40
|
"react": "19.3.1",
|
|
41
41
|
"react-dom": "19.3.1"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DateString } from "@uxf/core/date";
|
|
2
2
|
export interface CanSelectRangeProps {
|
|
3
|
-
startDate: DateString;
|
|
4
3
|
endDate: DateString | null;
|
|
5
|
-
isDateBlocked: ((date: DateString) => boolean) | null;
|
|
6
|
-
minBookingDays: number;
|
|
7
4
|
exactMinBookingDays?: boolean;
|
|
8
|
-
|
|
5
|
+
isDateBlocked: ((date: DateString) => boolean) | null;
|
|
9
6
|
maxBookingDate?: DateString;
|
|
7
|
+
minBookingDate?: DateString;
|
|
8
|
+
minBookingDays: number;
|
|
9
|
+
startDate: DateString;
|
|
10
10
|
}
|
|
11
11
|
export declare function canSelectRange({ startDate, endDate, isDateBlocked, minBookingDays, exactMinBookingDays, minBookingDate, maxBookingDate, }: CanSelectRangeProps): boolean;
|
package/utils/get-days.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FirstDayOfWeek } from "./types";
|
|
2
2
|
export interface GetDaysProps {
|
|
3
|
-
year: number;
|
|
4
|
-
month: number;
|
|
5
|
-
firstDayOfWeek?: FirstDayOfWeek;
|
|
6
3
|
dayLabelFormat?: (date: Date) => string;
|
|
4
|
+
firstDayOfWeek?: FirstDayOfWeek;
|
|
5
|
+
month: number;
|
|
6
|
+
year: number;
|
|
7
7
|
}
|
|
8
8
|
export type CalendarDay = {
|
|
9
9
|
dayLabel: string;
|
package/utils/get-months.d.ts
CHANGED
package/utils/get-years.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DateString } from "@uxf/core/date";
|
|
2
2
|
interface IsDateBlockedProps {
|
|
3
3
|
date: DateString;
|
|
4
|
-
startDate: DateString | null;
|
|
5
4
|
endDate: DateString | null;
|
|
6
|
-
minBookingDays?: number;
|
|
7
|
-
minBookingDate?: DateString;
|
|
8
|
-
maxBookingDate?: DateString;
|
|
9
5
|
isDateBlockedFn?: ((date: Date) => boolean) | null;
|
|
6
|
+
maxBookingDate?: DateString;
|
|
7
|
+
minBookingDate?: DateString;
|
|
8
|
+
minBookingDays?: number;
|
|
9
|
+
startDate: DateString | null;
|
|
10
10
|
unavailableDates?: DateString[];
|
|
11
11
|
}
|
|
12
12
|
export declare function isDateBlocked({ date, minBookingDate, maxBookingDate, isDateBlockedFn, startDate, endDate, minBookingDays, unavailableDates, }: IsDateBlockedProps): boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DateString } from "@uxf/core/date";
|
|
2
2
|
export interface IsDateHoveredProps {
|
|
3
|
-
startDate: DateString | null;
|
|
4
|
-
endDate: DateString | null;
|
|
5
3
|
date: DateString;
|
|
6
|
-
|
|
4
|
+
endDate: DateString | null;
|
|
5
|
+
exactMinBookingDays: boolean;
|
|
7
6
|
hoveredDate: DateString | null;
|
|
7
|
+
isDateBlocked: ((date: DateString) => boolean) | null;
|
|
8
8
|
minBookingDays: number;
|
|
9
|
-
|
|
9
|
+
startDate: DateString | null;
|
|
10
10
|
}
|
|
11
11
|
export declare function isDateHovered({ date, startDate, endDate, isDateBlocked, hoveredDate, minBookingDays, exactMinBookingDays, }: IsDateHoveredProps): boolean;
|