import * as React from 'react'; import { FormControlProps } from '@material-ui/core/FormControl'; import { FormHelperTextProps } from '@material-ui/core/FormHelperText'; import { InputProps as StandardInputProps } from '@material-ui/core/Input'; import { FilledInputProps } from '@material-ui/core/FilledInput'; import { OutlinedInputProps } from '@material-ui/core/OutlinedInput'; import { InputLabelProps } from '@material-ui/core/InputLabel'; export interface ChipRendererArgs { value: string; text: string; chip: any; isFocused: boolean; isDisabled: boolean; isReadOnly: boolean; handleClick: React.EventHandler; handleDelete: React.EventHandler; className: string; } export type ChipRenderer = ( args: ChipRendererArgs, key: any ) => React.ReactNode; type Omit = Pick>; // omitting onChange from FormControlProps as we use a custom onChange export interface BaseTextFieldProps extends Omit { allowDuplicates?: boolean; alwaysShowPlaceholder?: boolean; blurBehavior?: 'clear' | 'add' | 'ignore'; chipRenderer?: ChipRenderer; classes?: Record; clearInputValueOnChange?: boolean; dataSource?: any[]; dataSourceConfig?: { text: string; value: string; }; defaultValue?: any[]; disabled?: boolean; disableUnderline?: boolean; FormHelperTextProps?: FormHelperTextProps; fullWidth?: boolean; fullWidthInput?: boolean; helperText?: React.ReactNode; InputLabelProps?: InputLabelProps; inputRef?: (ref: React.Ref) => any; inputValue?: string; label?: React.ReactNode; newChipKeyCodes?: number[]; newChipKeys?: string[]; onAdd?: (chip: any) => any; onBeforeAdd?: (chip: any) => boolean; onChange?: (chips: any[]) => any; onDelete?: (chip: any, index: number) => any; onUpdateInput?: React.EventHandler; placeholder?: string; readOnly?: boolean; value?: any[]; variant?: 'outlined' | 'standard' | 'filled'; } export interface StandardTextFieldProps extends BaseTextFieldProps { variant?: 'standard'; InputProps?: Partial; } export interface FilledTextFieldProps extends BaseTextFieldProps { variant: 'filled'; InputProps?: Partial; } export interface OutlinedTextFieldProps extends BaseTextFieldProps { variant: 'outlined'; InputProps?: Partial; } export type Props = StandardTextFieldProps | FilledTextFieldProps | OutlinedTextFieldProps; declare const ChipInput: React.ComponentType; export default ChipInput;