@stenajs-webui/calendar 21.47.2 → 22.0.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.
@@ -14,6 +14,9 @@ export interface TravelDateCalendarProps extends ValueAndOnValueChangeProps<stri
14
14
  headingLevel?: HeadingVariant;
15
15
  firstMonthInMonthPicker?: Date;
16
16
  numMonthsInMonthPicker?: number;
17
+ isDateDisabled?: (date: Date) => boolean;
18
+ prevMonthDisabled?: (visibleMonth: Date) => boolean;
19
+ nextMonthDisabled?: (visibleMonth: Date) => boolean;
17
20
  size?: TravelCalendarSizeVariant;
18
21
  dateTestId?: (date: Date) => string | undefined;
19
22
  previousMonthButtonTestId?: string;
@@ -15,6 +15,9 @@ export interface TravelDateRangeCalendarProps extends ValueAndOnValueChangeProps
15
15
  headingLevel?: HeadingVariant;
16
16
  firstMonthInMonthPicker?: Date;
17
17
  numMonthsInMonthPicker?: number;
18
+ isDateDisabled?: (date: Date) => boolean;
19
+ prevMonthDisabled?: (visibleMonth: Date) => boolean;
20
+ nextMonthDisabled?: (visibleMonth: Date) => boolean;
18
21
  size?: TravelCalendarSizeVariant;
19
22
  dateTestId?: (date: Date) => string | undefined;
20
23
  previousMonthButtonTestId?: string;
@@ -18,6 +18,9 @@ export interface TravelDateInputProps extends ValueAndOnValueChangeProps<string>
18
18
  headingLevel?: HeadingVariant;
19
19
  firstMonthInMonthPicker?: Date;
20
20
  numMonthsInMonthPicker?: number;
21
+ isDateDisabled?: (date: Date) => boolean;
22
+ prevMonthDisabled?: (visibleMonth: Date) => boolean;
23
+ nextMonthDisabled?: (visibleMonth: Date) => boolean;
21
24
  zIndex?: number;
22
25
  zIndexWhenClosed?: number;
23
26
  onHideCalendar?: () => void;
@@ -19,6 +19,9 @@ export interface TravelDateRangeInputProps extends ValueAndOnValueChangeProps<Tr
19
19
  headingLevel?: HeadingVariant;
20
20
  firstMonthInMonthPicker?: Date;
21
21
  numMonthsInMonthPicker?: number;
22
+ isDateDisabled?: (date: Date) => boolean;
23
+ prevMonthDisabled?: (visibleMonth: Date) => boolean;
24
+ nextMonthDisabled?: (visibleMonth: Date) => boolean;
22
25
  zIndex?: number;
23
26
  zIndexWhenClosed?: number;
24
27
  onHideCalendar?: () => void;
@@ -11,7 +11,8 @@ export interface MonthHeaderProps {
11
11
  monthPickerButtonRef: Ref<HTMLButtonElement>;
12
12
  visibleMonth: Date;
13
13
  setVisibleMonth: (date: Date) => void;
14
- prevMonthDisabled: boolean;
14
+ prevMonthDisabled?: (visibleMonth: Date) => boolean;
15
+ nextMonthDisabled?: (visibleMonth: Date) => boolean;
15
16
  calendarSize: TravelCalendarSizeVariant;
16
17
  previousMonthButtonTestId?: string;
17
18
  nextMonthButtonTestId?: string;
@@ -13,7 +13,7 @@ export interface TravelCalendarProps {
13
13
  selectedEndDate: Date | undefined;
14
14
  hoverDate: Date | undefined;
15
15
  today: Date;
16
- isDateDisabled: (date: Date) => boolean;
16
+ isDateDisabled?: (date: Date) => boolean;
17
17
  dateTestId?: (date: Date) => string | undefined;
18
18
  calendarId: string;
19
19
  todayIsInVisibleMonth: boolean;
@@ -15,7 +15,7 @@ export interface TravelDateCellProps {
15
15
  today: Date;
16
16
  todayIsInVisibleMonth: boolean;
17
17
  calendarId: string;
18
- isDateDisabled: (date: Date) => boolean;
18
+ isDateDisabled?: (date: Date) => boolean;
19
19
  dateTestId?: (date: Date) => string | undefined;
20
20
  size: TravelCalendarSizeVariant;
21
21
  }
@@ -0,0 +1,2 @@
1
+ export declare const useDisabledBeforeToday: () => (date: Date) => boolean;
2
+ export declare const usePrevMonthDisabledBeforeToday: () => (visibleMonth: Date) => boolean;
@@ -1,10 +1,8 @@
1
1
  import { SupportedLocaleCode } from "../../localize-date-format/LocaleMapper";
2
2
  import { VisiblePanel } from "../types";
3
3
  export declare const useTravelDateInput: (value: string | undefined, onValueChange: ((value: string) => void) | undefined, localeCode: SupportedLocaleCode, initialMonthInFocus: Date | undefined) => {
4
- isDateDisabled: (date: Date) => boolean;
5
4
  onClickDate: (date: Date) => void;
6
5
  onValueChangeByInputs: (value: string) => void;
7
- prevMonthDisabled: boolean;
8
6
  monthPickerButtonRef: import("react").RefObject<HTMLButtonElement | null>;
9
7
  calendarId: string;
10
8
  monthPickerButtonLabel: string;
@@ -1,11 +1,9 @@
1
1
  import { SupportedLocaleCode } from "../../localize-date-format/LocaleMapper";
2
2
  import { TravelDateRangeInputValue, VisiblePanel } from "../types";
3
3
  export declare const useTravelDateRangeInput: (value: TravelDateRangeInputValue | undefined, onValueChange: ((value: TravelDateRangeInputValue) => void) | undefined, localeCode: SupportedLocaleCode, initialMonthInFocus: Date | undefined) => {
4
- isDateDisabled: (date: Date) => boolean;
5
4
  onClickDate: (date: Date) => void;
6
5
  onValueChangeByInputs: (value: TravelDateRangeInputValue) => void;
7
6
  isValidDateRange: boolean;
8
- prevMonthDisabled: boolean;
9
7
  monthPickerButtonRef: import("react").RefObject<HTMLButtonElement | null>;
10
8
  calendarId: string;
11
9
  monthPickerButtonLabel: string;
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export * from "./components/input-types/travel-date-range-input/TravelDateRangeI
32
32
  export * from "./components/input-types/travel-date-input/TravelDateInput";
33
33
  export * from "./components/calendar-types/travel-date-calendar/TravelDateCalendar";
34
34
  export * from "./components/calendar-types/travel-date-range-calendar/TravelDateRangeCalendar";
35
+ export * from "./features/travel-calendar/hooks/DisabledDateHooks";
35
36
  export * from "./features/travel-calendar/types";
36
37
  export * from "./features/localize-date-format/LocalizedDateFormatter";
37
38
  export * from "./features/localize-date-format/LocalizedDateParser";