1 | import * as React from 'react';
|
2 | import { TextInputProps } from '../TextInput/TextInput';
|
3 | import { PopoverProps } from '../Popover/Popover';
|
4 | import { CalendarFormat } from '../CalendarMonth';
|
5 | export interface DatePickerProps extends CalendarFormat, Omit<React.HTMLProps<HTMLInputElement>, 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'ref'> {
|
6 |
|
7 | className?: string;
|
8 |
|
9 | 'aria-label'?: string;
|
10 |
|
11 | dateFormat?: (date: Date) => string;
|
12 |
|
13 | dateParse?: (value: string) => Date;
|
14 |
|
15 | isDisabled?: boolean;
|
16 |
|
17 | placeholder?: string;
|
18 |
|
19 | value?: string;
|
20 |
|
21 | invalidFormatText?: string;
|
22 |
|
23 | onChange?: (value: string, date?: Date) => void;
|
24 |
|
25 | onBlur?: (value: string, date?: Date) => void;
|
26 |
|
27 | helperText?: React.ReactNode;
|
28 |
|
29 | buttonAriaLabel?: string;
|
30 |
|
31 | appendTo?: HTMLElement | ((ref?: HTMLElement) => HTMLElement);
|
32 | /** Props to pass to the Popover */
|
33 | popoverProps?: Omit<PopoverProps, 'appendTo'>;
|
34 | /** Functions that returns an error message if a date is invalid */
|
35 | validators?: ((date: Date) => string)[];
|
36 | /** Additional props for input field */
|
37 | inputProps?: TextInputProps;
|
38 | }
|
39 | export interface DatePickerRef {
|
40 | /** Sets the calendar open status */
|
41 | setCalendarOpen: (isOpen: boolean) => void;
|
42 |
|
43 | toggleCalendar: () => void;
|
44 | }
|
45 | export declare const yyyyMMddFormat: (date: Date) => string;
|
46 | export declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<DatePickerRef>>;
|
47 |
|
\ | No newline at end of file |