1 | /// <reference types="react" />
|
2 | import { MaterialUiPickersDate } from './date';
|
3 | import { WrapperVariant } from '../wrappers/Wrapper';
|
4 | import { ParsableDate } from '../constants/prop-types';
|
5 | import { ToolbarComponentProps } from '../Picker/Picker';
|
6 | export interface BasePickerProps {
|
7 | /** Picker value */
|
8 | value: ParsableDate;
|
9 | /** onChange callback @DateIOType */
|
10 | onChange: (date: MaterialUiPickersDate) => void;
|
11 | /**
|
12 | * Auto accept date on selection
|
13 | * @default false
|
14 | */
|
15 | autoOk?: boolean;
|
16 | /** Format string */
|
17 | format?: string;
|
18 | /** Disable picker and text field */
|
19 | disabled?: boolean;
|
20 | /** Make picker read only */
|
21 | readOnly?: boolean;
|
22 | /** Dynamic formatter of text field value @DateIOType */
|
23 | labelFunc?: (date: MaterialUiPickersDate, invalidLabel: string) => string;
|
24 | /** Date that will be initially highlighted if null was passed */
|
25 | initialFocusedDate?: ParsableDate;
|
26 | /**
|
27 | * Message displaying in text field if date is invalid (doesn't work in keyboard mode)
|
28 | * @default 'unknown'
|
29 | */
|
30 | invalidLabel?: string;
|
31 | /**
|
32 | * Message displaying in text field, if null passed (doesn't work in keyboard mode)
|
33 | * @default ' '
|
34 | */
|
35 | emptyLabel?: string;
|
36 | /** Callback fired when date is accepted @DateIOType */
|
37 | onAccept?: (date: MaterialUiPickersDate) => void;
|
38 | /** Callback fired when new error should be displayed
|
39 | * (!! This is a side effect. Be careful if you want to rerender the component) @DateIOType
|
40 | */
|
41 | onError?: (error: React.ReactNode, value: MaterialUiPickersDate | ParsableDate) => void;
|
42 | /** On open callback */
|
43 | onOpen?: () => void;
|
44 | /** On close callback */
|
45 | onClose?: () => void;
|
46 | /** Controlled picker open state */
|
47 | open?: boolean;
|
48 | /**
|
49 | * Hide toolbar and show only date/time views
|
50 | * @default false
|
51 | */
|
52 | disableToolbar?: boolean;
|
53 | /**
|
54 | * Force rendering in particular orientation
|
55 | * @default "portrait"
|
56 | */
|
57 | orientation?: 'portrait' | 'landscape';
|
58 | /** Component that will replace default toolbar renderer */
|
59 | ToolbarComponent?: React.ComponentType<ToolbarComponentProps>;
|
60 | variant?: WrapperVariant;
|
61 | }
|