@stenajs-webui/calendar 25.1.7 → 25.2.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.
@@ -21,6 +21,12 @@ export interface TravelCalendarProps {
21
21
  hoverAnchor: Date | undefined;
22
22
  today: Date;
23
23
  isDateDisabled?: (date: Date) => boolean;
24
+ /** Also stops keyboard navigation into the previous month. */
25
+ prevMonthDisabled?: (visibleMonth: Date) => boolean;
26
+ /** Also stops keyboard navigation into the next month. */
27
+ nextMonthDisabled?: (visibleMonth: Date) => boolean;
28
+ /** The range field being edited. Its date gets the tab stop. */
29
+ activeField?: "startDate" | "endDate";
24
30
  /**
25
31
  * Renders the content of each date in the calendar, in place of the day
26
32
  * number. The cell around it, with the selection, focus and keyboard
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { DayData } from "../../../util/calendar/CalendarDataFactory";
3
+ import { Day } from "date-fns";
3
4
  import { TravelCalendarSizeVariant } from "./TravelCalendar";
4
5
  import { RenderTravelDateContent } from "../types";
5
6
  export interface TravelDateCellProps {
@@ -12,6 +13,11 @@ export interface TravelDateCellProps {
12
13
  onChangeVisibleMonth: (visibleMonth: Date) => void;
13
14
  /** Focuses the date once its month is shown, which the app decides. */
14
15
  focusDateWhenShown: (date: Date) => void;
16
+ onFocusDate: (date: Date) => void;
17
+ /** First day of the week in the grid, used by Home and End. */
18
+ weekStartsOn: Day;
19
+ isPrevMonthDisabled: boolean;
20
+ isNextMonthDisabled: boolean;
15
21
  onStartHover: (date: Date) => void;
16
22
  onEndHover: (date: Date) => void;
17
23
  /** Current date that the mouse is hovering over. */
@@ -1 +1,15 @@
1
- export declare const getDateToFocusOn: (currentDate: Date, key: string) => Date | undefined;
1
+ import { Day } from "date-fns";
2
+ export interface DateToFocusOnOptions {
3
+ /**
4
+ * First day of the week in the grid, 0 for Sunday. Required, since the
5
+ * date-fns default (Sunday) is wrong for most supported locales.
6
+ */
7
+ weekStartsOn: Day;
8
+ /**
9
+ * Home and End stay within this month. The days of the adjacent months in
10
+ * the first and last row are blank, so the row starts and ends where the
11
+ * month does.
12
+ */
13
+ visibleMonth: Date;
14
+ }
15
+ export declare const getDateToFocusOn: (currentDate: Date, key: string, { weekStartsOn, visibleMonth }: DateToFocusOnOptions) => Date | undefined;