@helsenorge/datepicker 9.4.3 → 10.0.0-beta.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.
@@ -1,10 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  import { Locale } from 'date-fns';
3
- import { DayPickerSingleProps } from 'react-day-picker';
3
+ import { DayPickerProps } from 'react-day-picker';
4
4
  import { ErrorWrapperClassNameProps } from '@helsenorge/designsystem-react/components/ErrorWrapper';
5
5
  import { PopOverVariant } from '@helsenorge/designsystem-react/components/PopOver';
6
6
  export type DateFormat = 'dd.MM.yyyy';
7
- export interface DatePickerProps extends ErrorWrapperClassNameProps, Pick<React.InputHTMLAttributes<HTMLInputElement>, 'name' | 'aria-describedby' | 'onBlur' | 'autoComplete'>, Pick<DayPickerSingleProps, 'dir' | 'initialFocus'> {
7
+ export interface DatePickerProps extends ErrorWrapperClassNameProps, Pick<React.InputHTMLAttributes<HTMLInputElement>, 'name' | 'aria-describedby' | 'onBlur' | 'autoComplete'>, Pick<DayPickerProps, 'dir' | 'initialFocus'> {
8
8
  /** Adds custom classes to the element. */
9
9
  className?: string;
10
10
  /** Sets aria-label on the button that opens the datepicker dialogue */
@@ -40,7 +40,7 @@ export interface DatePickerProps extends ErrorWrapperClassNameProps, Pick<React.
40
40
  /** Minimum date allowed to be selected */
41
41
  minDate?: Date;
42
42
  /** onChange callback triggered by change in chosen date */
43
- onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<Element, MouseEvent>, date: Date | string | undefined) => void;
43
+ onChange?: (event?: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>, date?: Date | string | undefined) => void;
44
44
  /** Only use this to trigger validation. Callback triggered by change in chosen date via the datepicker popup */
45
45
  onDatePopupClosed?: (date: Date | string | undefined) => void;
46
46
  /** Sets the data-testid attribute. */
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { DayPickerSingleProps } from 'react-day-picker';
2
+ import { DayPickerProps, PropsSingle } from 'react-day-picker';
3
3
  import { PopOverVariant } from '@helsenorge/designsystem-react/components/PopOver';
4
- interface DatePickerPopupProps extends Pick<DayPickerSingleProps, 'dir' | 'disabled' | 'footer' | 'fromDate' | 'initialFocus' | 'locale' | 'month' | 'selected' | 'onSelect' | 'onMonthChange' | 'toDate'> {
4
+ interface DatePickerPopupProps extends Pick<DayPickerProps, 'dir' | 'disabled' | 'footer' | 'startMonth' | 'initialFocus' | 'locale' | 'month' | 'onMonthChange' | 'endMonth'>, Pick<PropsSingle, 'selected' | 'onSelect'> {
5
5
  datepickerWrapperRef: React.RefObject<HTMLDivElement>;
6
6
  inputRef: React.RefObject<HTMLInputElement>;
7
7
  testId?: string;