import * as React from 'react'; import { IconButtonProps as MuiIconButtonProps } from '@material-ui/core/IconButton'; import { InputAdornmentProps as MuiInputAdornmentProps } from '@material-ui/core/InputAdornment'; import { BaseTextFieldProps, TextFieldProps } from '@material-ui/core/TextField'; import { MaskedInputProps } from 'react-text-mask'; import { DateType } from '../constants/prop-types'; import { MaterialUiPickersDate } from '../typings/date'; import { ExtendMui } from '../typings/extendMui'; import { WithUtilsProps } from './WithUtils'; export interface DateTextFieldProps extends WithUtilsProps, ExtendMui { variant?: TextFieldProps['variant']; InputProps?: TextFieldProps['InputProps']; inputProps?: TextFieldProps['inputProps']; value: DateType; minDate?: DateType; /** Error message, shown if date is less then minimal date */ minDateMessage?: React.ReactNode; disablePast?: boolean; disableFuture?: boolean; maxDate?: DateType; /** Error message, shown if date is more then maximal date */ maxDateMessage?: React.ReactNode; /** Input mask, used in keyboard mode read more here */ mask?: MaskedInputProps['mask']; pipe?: any; keepCharPositions?: boolean; onChange: (date: MaterialUiPickersDate) => void; onClear?: () => void; /** On/off manual keyboard input mode */ keyboard?: boolean; /** Format string */ format: string; /** Message displaying in text field, if date is invalid (doesn't work in keyboard mode) */ invalidLabel?: string; /** Message displaying in text field, if null passed (doesn't work in keyboard mode) */ emptyLabel?: string; /** Do not open picker on enter keypress */ disableOpenOnEnter?: boolean; /** Dynamic label generation function */ labelFunc?: (date: MaterialUiPickersDate, invalidLabel: string) => string; /** Icon displayed for open picker button in keyboard mode */ keyboardIcon?: React.ReactNode; /** Message, appearing when date cannot be parsed */ invalidDateMessage?: React.ReactNode; /** Clearable mode (for inline pickers works only for clearing input) */ clearable?: boolean; /** Component that should replace the default Material-UI TextField */ TextFieldComponent?: React.ComponentType | React.ReactType>; /** Props to pass to keyboard input adornment */ InputAdornmentProps?: Partial; /** Props to pass to keyboard adornment button */ KeyboardButtonProps?: Partial; /** Specifies position of keyboard button adornment */ adornmentPosition?: MuiInputAdornmentProps['position']; onClick: (e: React.SyntheticEvent) => void; onError?: (newValue: MaterialUiPickersDate, error: React.ReactNode) => void; onInputChange?: (e: React.FormEvent) => void; } export declare class DateTextField extends React.PureComponent { static propTypes: any; static defaultProps: { disabled: boolean; invalidLabel: string; emptyLabel: string; keyboard: boolean; keyboardIcon: JSX.Element; disableOpenOnEnter: boolean; invalidDateMessage: string; clearable: boolean; disablePast: boolean; disableFuture: boolean; minDate: Date; maxDate: Date; minDateMessage: string; maxDateMessage: string; TextFieldComponent: React.ComponentType; InputAdornmentProps: {}; KeyboardButtonProps: {}; adornmentPosition: "end" | "start"; keepCharPositions: boolean; }; static getStateFromProps: (props: DateTextFieldProps) => { value: DateType; displayValue: string | undefined; error: React.ReactNode; }; state: { value: DateType; displayValue: string | undefined; error: React.ReactNode; }; componentDidUpdate(prevProps: DateTextFieldProps): void; commitUpdates: (value: string) => void; handleBlur: (e: React.ChangeEvent) => void; handleChange: (e: React.ChangeEvent) => void; handleFocus: (e: React.SyntheticEvent) => void; handleKeyPress: (e: React.KeyboardEvent) => void; openPicker: (e: React.SyntheticEvent) => void; render(): JSX.Element; } declare const _default: React.FunctionComponent>; export default _default;