UNPKG

1.87 kBTypeScriptView Raw
1import { Omit } from '@material-ui/core';
2import { DialogProps as DialogPropsType } from '@material-ui/core/Dialog';
3import * as React from 'react';
4import { DateTextFieldProps } from '../_shared/DateTextField';
5export interface ModalWrapperProps extends Omit<DateTextFieldProps, 'utils' | 'onClick'> {
6 onAccept?: () => void;
7 onDismiss?: () => void;
8 onClear?: () => void;
9 onSetToday?: () => void;
10 /** On open callback */
11 onOpen?: () => void;
12 /** On close callback */
13 onClose?: () => void;
14 /** "OK" label message */
15 okLabel?: React.ReactNode;
16 /** "Cancel" label message */
17 cancelLabel?: React.ReactNode;
18 /** "Clear" label message */
19 clearLabel?: React.ReactNode;
20 /** "Today" label message */
21 todayLabel?: React.ReactNode;
22 showTabs?: boolean;
23 /**
24 * If true today button will be displayed
25 * <b>Note*</b> that clear button has higher priority
26 */
27 showTodayButton?: boolean;
28 container?: React.ReactNode;
29 DialogProps?: Partial<Omit<DialogPropsType, 'classes'>>;
30 isAccepted?: boolean;
31 wider?: boolean;
32}
33export default class ModalWrapper extends React.PureComponent<ModalWrapperProps> {
34 static propTypes: any;
35 static defaultProps: {
36 value: Date;
37 okLabel: string;
38 cancelLabel: string;
39 clearLabel: string;
40 todayLabel: string;
41 clearable: boolean;
42 showTodayButton: boolean;
43 isAccepted: boolean;
44 };
45 static getDerivedStateFromProps(nextProps: ModalWrapperProps): {
46 open: boolean;
47 } | null;
48 state: {
49 open: boolean;
50 };
51 handleKeyDown: (event: KeyboardEvent) => void;
52 handleSetTodayDate: () => void;
53 open: () => void;
54 close: () => void;
55 handleAccept: () => void;
56 handleDismiss: () => void;
57 handleClear: () => void;
58 render(): JSX.Element;
59}