|
| 1 | +import * as React from 'react'; |
| 2 | +import { FormHelperTextProps } from '@material-ui/core/FormHelperText' |
| 3 | +import {InputProps} from '@material-ui/core/Input' |
| 4 | +import {InputLabelProps} from '@material-ui/core/InputLabel' |
| 5 | + |
| 6 | +export interface ChipRendererArgs { |
| 7 | + value: string; |
| 8 | + text: string; |
| 9 | + chip: any; |
| 10 | + isFocused: boolean; |
| 11 | + isDisabled: boolean; |
| 12 | + handleClick: React.EventHandler<any>; |
| 13 | + handleDelete: React.EventHandler<any>; |
| 14 | + className: string; |
| 15 | +} |
| 16 | + |
| 17 | +export type ChipRenderer = ( |
| 18 | + args: ChipRendererArgs, |
| 19 | + key: any |
| 20 | +) => React.ReactNode; |
| 21 | + |
| 22 | +export interface Props { |
| 23 | + allowDuplicates?: boolean; |
| 24 | + blurBehavior?: 'clear' | 'add' | 'ignore'; |
| 25 | + chipRenderer?: ChipRenderer; |
| 26 | + clearInputValueOnChange?: boolean; |
| 27 | + dataSource?: any[]; |
| 28 | + dataSourceConfig?: { |
| 29 | + text: string; |
| 30 | + value: string; |
| 31 | + }; |
| 32 | + defaultValue?: any[]; |
| 33 | + disabled?: boolean; |
| 34 | + FormHelperTextProps?: FormHelperTextProps; |
| 35 | + fullWidth?: boolean; |
| 36 | + fullWidthInput?: boolean; |
| 37 | + helperText?: React.ReactNode; |
| 38 | + InputLabelProps?: InputLabelProps; |
| 39 | + InputProps?: InputProps; |
| 40 | + inputRef?: (ref: React.Ref<HTMLInputElement>) => any; |
| 41 | + label?: React.ReactNode; |
| 42 | + newChipKeyCodes?: number[]; |
| 43 | + onAdd?: (chip: any) => any; |
| 44 | + onBeforeAdd?: (chip: any) => boolean; |
| 45 | + onChange?: (chips: any[]) => any; |
| 46 | + onDelete?: (chip:any, index: number) => any; |
| 47 | + onUpdateInput?: React.EventHandler<any> |
| 48 | + placeholder?: string; |
| 49 | + value?: any[]; |
| 50 | + error?: boolean; |
| 51 | +} |
| 52 | + |
| 53 | +declare const ChipInput: React.ComponentType<Props>; |
| 54 | +export default ChipInput; |
0 commit comments