UNPKG

1.98 kBTypeScriptView Raw
1import * as React from 'react';
2import { IconButtonProps } from '@material-ui/core/IconButton';
3import { InputAdornmentProps } from '@material-ui/core/InputAdornment';
4import { BaseTextFieldProps, TextFieldProps } from '@material-ui/core/TextField';
5import { ExtendMui } from '../typings/extendMui';
6export interface KeyboardDateInputProps extends ExtendMui<BaseTextFieldProps, 'variant' | 'onError' | 'value'> {
7 format: string;
8 onChange: (value: string | null) => void;
9 openPicker: () => void;
10 validationError?: React.ReactNode;
11 inputValue: string;
12 inputProps?: TextFieldProps['inputProps'];
13 InputProps?: TextFieldProps['InputProps'];
14 onBlur?: TextFieldProps['onBlur'];
15 onFocus?: TextFieldProps['onFocus'];
16 /** Override input component */
17 TextFieldComponent?: React.ComponentType<TextFieldProps>;
18 /** Icon displaying for open picker button */
19 keyboardIcon?: React.ReactNode;
20 /** Pass material-ui text field variant down, bypass internal variant prop */
21 inputVariant?: TextFieldProps['variant'];
22 /**
23 * Custom mask. Can be used to override generate from format. (e.g. __/__/____ __:__)
24 */
25 mask?: string;
26 /**
27 * Char string that will be replaced with number (for "_" mask will be "__/__/____")
28 * @default '_'
29 */
30 maskChar?: string;
31 /**
32 * Refuse values regexp
33 * @default /[^\d]+/gi
34 */
35 refuse?: RegExp;
36 /**
37 * Props to pass to keyboard input adornment
38 * @type {Partial<InputAdornmentProps>}
39 */
40 InputAdornmentProps?: Partial<InputAdornmentProps>;
41 /**
42 * Props to pass to keyboard adornment button
43 * @type {Partial<IconButtonProps>}
44 */
45 KeyboardButtonProps?: Partial<IconButtonProps>;
46 /** Custom formatter to be passed into Rifm component */
47 rifmFormatter?: (str: string) => string;
48}
49export declare const KeyboardDateInput: React.FunctionComponent<KeyboardDateInputProps>;
50export default KeyboardDateInput;