UNPKG

1.86 kBTypeScriptView Raw
1/// <reference types="react" />
2/// <reference types="styled-jsx" />
3import { MaterialUiPickersDate } from '../typings/date';
4import { OutterCalendarProps } from '../views/Calendar/Calendar';
5import { ParsableDate } from '../constants/prop-types';
6import { WithKeyboardInputProps, WithPureInputProps } from '../Picker/makePickerWithState';
7export declare type DatePickerView = 'year' | 'date' | 'month';
8export interface BaseDatePickerProps extends OutterCalendarProps {
9 /**
10 * Min selectable date
11 * @default Date(1900-01-01)
12 */
13 minDate?: ParsableDate;
14 /**
15 * Max selectable date
16 * @default Date(2100-01-01)
17 */
18 maxDate?: ParsableDate;
19 /**
20 * Compare dates by the exact timestamp, instead of start/end of date
21 * @default false
22 */
23 strictCompareDates?: boolean;
24 /**
25 * Disable past dates
26 * @default false
27 */
28 disablePast?: boolean;
29 /**
30 * Disable future dates
31 * @default false
32 */
33 disableFuture?: boolean;
34 /**
35 * To animate scrolling to current year (using scrollIntoView)
36 * @default false
37 */
38 animateYearScrolling?: boolean;
39 /** Callback firing on year change @DateIOType */
40 onYearChange?: (date: MaterialUiPickersDate) => void;
41}
42export interface DatePickerViewsProps extends BaseDatePickerProps {
43 /**
44 * Array of views to show
45 * @type {Array<"year" | "date" | "month">}
46 */
47 views?: DatePickerView[];
48 /** First view to show in DatePicker */
49 openTo?: DatePickerView;
50}
51export declare type DatePickerProps = WithPureInputProps & DatePickerViewsProps;
52export declare type KeyboardDatePickerProps = WithKeyboardInputProps & DatePickerViewsProps;
53export declare const DatePicker: import("react").FC<DatePickerProps>;
54export declare const KeyboardDatePicker: import("react").FC<KeyboardDatePickerProps>;