@react-stately/calendar
Advanced tools
Comparing version 3.0.0-nightly.1446 to 3.0.0-nightly.1452
@@ -5,43 +5,85 @@ import { CalendarDate, Calendar, DateDuration } from "@internationalized/date"; | ||
export interface CalendarStateBase { | ||
isDisabled: boolean; | ||
isReadOnly: boolean; | ||
visibleRange: RangeValue<CalendarDate>; | ||
timeZone: string; | ||
focusedDate: CalendarDate; | ||
/** Whether the calendar is disabled. */ | ||
readonly isDisabled: boolean; | ||
/** Whether the calendar is in a read only state. */ | ||
readonly isReadOnly: boolean; | ||
/** The date range that is currently visible in the calendar. */ | ||
readonly visibleRange: RangeValue<CalendarDate>; | ||
/** The time zone of the dates currently being displayed. */ | ||
readonly timeZone: string; | ||
/** The currently focused date. */ | ||
readonly focusedDate: CalendarDate; | ||
/** Sets the focused date. */ | ||
setFocusedDate(value: CalendarDate): void; | ||
/** Moves focus to the next calendar date. */ | ||
focusNextDay(): void; | ||
/** Moves focus to the previous calendar date. */ | ||
focusPreviousDay(): void; | ||
/** Moves focus to the next row of dates, e.g. the next week. */ | ||
focusNextRow(): void; | ||
/** Moves focus to the previous row of dates, e.g. the previous work. */ | ||
focusPreviousRow(): void; | ||
/** Moves focus to the next page of dates, e.g. the next month if one month is visible. */ | ||
focusNextPage(): void; | ||
/** Moves focus to the previous page of dates, e.g. the previous month if one month is visible. */ | ||
focusPreviousPage(): void; | ||
/** Moves focus to the start of the current page of dates, e.g. the start of the first visible month. */ | ||
focusPageStart(): void; | ||
/** Moves focus to the end of the current page of dates, e.g. the end of the last visible month. */ | ||
focusPageEnd(): void; | ||
/** | ||
* Moves focus to the next larger section of dates based on what is currently displayed. | ||
* If days are displayed, then moves to the next visible range. If weeks are displayed, then | ||
* moves to the next month. If months or years are displayed, moves to the next year. | ||
*/ | ||
focusNextSection(): void; | ||
/** | ||
* Moves focus to the previous larger section of dates based on what is currently displayed. | ||
* If days are displayed, then moves to the previous visible range. If weeks are displayed, then | ||
* moves to the previous month. If months or years are displayed, moves to the previous year. | ||
*/ | ||
focusPreviousSection(): void; | ||
focusNextPage(): void; | ||
focusPreviousPage(): void; | ||
/** Selects the currently focused date. */ | ||
selectFocusedDate(): void; | ||
/** Selects the given date. */ | ||
selectDate(date: CalendarDate): void; | ||
isFocused: boolean; | ||
/** Whether focus is currently within the calendar. */ | ||
readonly isFocused: boolean; | ||
/** Sets whether focus is currently within the calendar. */ | ||
setFocused(value: boolean): void; | ||
/** Returns whether the given date is invalid according to the `minValue` and `maxValue` props. */ | ||
isInvalid(date: CalendarDate): boolean; | ||
/** Returns whether the given date is currently selected. */ | ||
isSelected(date: CalendarDate): boolean; | ||
/** Returns whether the given date is currently focused. */ | ||
isCellFocused(date: CalendarDate): boolean; | ||
/** Returns whether the given date is disabled according to the `minValue, `maxValue`, and `isDisabled` props. */ | ||
isCellDisabled(date: CalendarDate): boolean; | ||
/** Returns whether the previous visible date range is allowed to be selected according to the `minValue` prop. */ | ||
isPreviousVisibleRangeInvalid(): boolean; | ||
/** Returns whether the next visible date range is allowed to be selected according to the `maxValue` prop. */ | ||
isNextVisibleRangeInvalid(): boolean; | ||
} | ||
export interface CalendarState extends CalendarStateBase { | ||
value: CalendarDate; | ||
/** The currently selected date. */ | ||
readonly value: CalendarDate; | ||
/** Sets the currently selected date. */ | ||
setValue(value: CalendarDate): void; | ||
} | ||
export interface RangeCalendarState extends CalendarStateBase { | ||
value: RangeValue<DateValue>; | ||
/** The currently selected date range. */ | ||
readonly value: RangeValue<DateValue>; | ||
/** Sets the currently selected date range. */ | ||
setValue(value: RangeValue<DateValue>): void; | ||
/** Highlights the given date during selection, e.g. by hovering or dragging. */ | ||
highlightDate(date: CalendarDate): void; | ||
anchorDate: CalendarDate | null; | ||
/** The current anchor date that the user clicked on to begin range selection. */ | ||
readonly anchorDate: CalendarDate | null; | ||
/** Sets the anchor date that the user clicked on to begin range selection. */ | ||
setAnchorDate(date: CalendarDate | null): void; | ||
highlightedRange: RangeValue<CalendarDate>; | ||
isDragging: boolean; | ||
/** The currently highlighted date range. */ | ||
readonly highlightedRange: RangeValue<CalendarDate>; | ||
/** Whether the user is currently dragging over the calendar. */ | ||
readonly isDragging: boolean; | ||
/** Sets whether the user is dragging over the calendar. */ | ||
setDragging(isDragging: boolean): void; | ||
@@ -48,0 +90,0 @@ } |
{ | ||
"name": "@react-stately/calendar", | ||
"version": "3.0.0-nightly.1446+51ff50c6f", | ||
"version": "3.0.0-nightly.1452+320c69908", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,8 +21,8 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@internationalized/date": "3.0.0-nightly.3142+51ff50c6f", | ||
"@react-aria/i18n": "3.0.0-nightly.1446+51ff50c6f", | ||
"@react-stately/utils": "3.0.0-nightly.1446+51ff50c6f", | ||
"@react-types/calendar": "3.0.0-nightly.3142+51ff50c6f", | ||
"@react-types/datepicker": "3.0.0-nightly.3142+51ff50c6f", | ||
"@react-types/shared": "3.0.0-nightly.1446+51ff50c6f", | ||
"@internationalized/date": "3.0.0-nightly.3148+320c69908", | ||
"@react-aria/i18n": "3.0.0-nightly.1452+320c69908", | ||
"@react-stately/utils": "3.0.0-nightly.1452+320c69908", | ||
"@react-types/calendar": "3.0.0-nightly.3148+320c69908", | ||
"@react-types/datepicker": "3.0.0-nightly.3148+320c69908", | ||
"@react-types/shared": "3.0.0-nightly.1452+320c69908", | ||
"date-fns": "^1.30.1" | ||
@@ -36,3 +36,3 @@ }, | ||
}, | ||
"gitHead": "51ff50c6fed6df76c22467622b17b2af2d9380e0" | ||
"gitHead": "320c69908b41be47a3abb2878d04f90384e54321" | ||
} |
@@ -18,29 +18,61 @@ /* | ||
export interface CalendarStateBase { | ||
isDisabled: boolean, | ||
isReadOnly: boolean, | ||
visibleRange: RangeValue<CalendarDate>, | ||
timeZone: string, | ||
focusedDate: CalendarDate, | ||
/** Whether the calendar is disabled. */ | ||
readonly isDisabled: boolean, | ||
/** Whether the calendar is in a read only state. */ | ||
readonly isReadOnly: boolean, | ||
/** The date range that is currently visible in the calendar. */ | ||
readonly visibleRange: RangeValue<CalendarDate>, | ||
/** The time zone of the dates currently being displayed. */ | ||
readonly timeZone: string, | ||
/** The currently focused date. */ | ||
readonly focusedDate: CalendarDate, | ||
/** Sets the focused date. */ | ||
setFocusedDate(value: CalendarDate): void, | ||
/** Moves focus to the next calendar date. */ | ||
focusNextDay(): void, | ||
/** Moves focus to the previous calendar date. */ | ||
focusPreviousDay(): void, | ||
/** Moves focus to the next row of dates, e.g. the next week. */ | ||
focusNextRow(): void, | ||
/** Moves focus to the previous row of dates, e.g. the previous work. */ | ||
focusPreviousRow(): void, | ||
/** Moves focus to the next page of dates, e.g. the next month if one month is visible. */ | ||
focusNextPage(): void, | ||
/** Moves focus to the previous page of dates, e.g. the previous month if one month is visible. */ | ||
focusPreviousPage(): void, | ||
/** Moves focus to the start of the current page of dates, e.g. the start of the first visible month. */ | ||
focusPageStart(): void, | ||
/** Moves focus to the end of the current page of dates, e.g. the end of the last visible month. */ | ||
focusPageEnd(): void, | ||
/** | ||
* Moves focus to the next larger section of dates based on what is currently displayed. | ||
* If days are displayed, then moves to the next visible range. If weeks are displayed, then | ||
* moves to the next month. If months or years are displayed, moves to the next year. | ||
*/ | ||
focusNextSection(): void, | ||
/** | ||
* Moves focus to the previous larger section of dates based on what is currently displayed. | ||
* If days are displayed, then moves to the previous visible range. If weeks are displayed, then | ||
* moves to the previous month. If months or years are displayed, moves to the previous year. | ||
*/ | ||
focusPreviousSection(): void, | ||
focusNextPage(): void, | ||
focusPreviousPage(): void, | ||
/** Selects the currently focused date. */ | ||
selectFocusedDate(): void, | ||
/** Selects the given date. */ | ||
selectDate(date: CalendarDate): void, | ||
isFocused: boolean, | ||
/** Whether focus is currently within the calendar. */ | ||
readonly isFocused: boolean, | ||
/** Sets whether focus is currently within the calendar. */ | ||
setFocused(value: boolean): void, | ||
/** Returns whether the given date is invalid according to the `minValue` and `maxValue` props. */ | ||
isInvalid(date: CalendarDate): boolean, | ||
/** Returns whether the given date is currently selected. */ | ||
isSelected(date: CalendarDate): boolean, | ||
/** Returns whether the given date is currently focused. */ | ||
isCellFocused(date: CalendarDate): boolean, | ||
/** Returns whether the given date is disabled according to the `minValue, `maxValue`, and `isDisabled` props. */ | ||
isCellDisabled(date: CalendarDate): boolean, | ||
/** Returns whether the previous visible date range is allowed to be selected according to the `minValue` prop. */ | ||
isPreviousVisibleRangeInvalid(): boolean, | ||
/** Returns whether the next visible date range is allowed to be selected according to the `maxValue` prop. */ | ||
isNextVisibleRangeInvalid(): boolean | ||
@@ -50,3 +82,5 @@ } | ||
export interface CalendarState extends CalendarStateBase { | ||
value: CalendarDate, | ||
/** The currently selected date. */ | ||
readonly value: CalendarDate, | ||
/** Sets the currently selected date. */ | ||
setValue(value: CalendarDate): void | ||
@@ -56,10 +90,18 @@ } | ||
export interface RangeCalendarState extends CalendarStateBase { | ||
value: RangeValue<DateValue>, | ||
/** The currently selected date range. */ | ||
readonly value: RangeValue<DateValue>, | ||
/** Sets the currently selected date range. */ | ||
setValue(value: RangeValue<DateValue>): void, | ||
/** Highlights the given date during selection, e.g. by hovering or dragging. */ | ||
highlightDate(date: CalendarDate): void, | ||
anchorDate: CalendarDate | null, | ||
/** The current anchor date that the user clicked on to begin range selection. */ | ||
readonly anchorDate: CalendarDate | null, | ||
/** Sets the anchor date that the user clicked on to begin range selection. */ | ||
setAnchorDate(date: CalendarDate | null): void, | ||
highlightedRange: RangeValue<CalendarDate>, | ||
isDragging: boolean, | ||
/** The currently highlighted date range. */ | ||
readonly highlightedRange: RangeValue<CalendarDate>, | ||
/** Whether the user is currently dragging over the calendar. */ | ||
readonly isDragging: boolean, | ||
/** Sets whether the user is dragging over the calendar. */ | ||
setDragging(isDragging: boolean): void | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
141862
1287