UNPKG

rsuite

Version:

A suite of react components

42 lines (41 loc) 1.66 kB
import React from 'react'; import { InputPickerLocale } from '../locales'; import { PickerComponent } from '../Picker'; import { TagProps } from '../Tag'; import { ItemDataType, FormControlPickerProps } from '../@types/common'; import { SelectProps } from '../SelectPicker'; export declare type TriggerType = 'Enter' | 'Space' | 'Comma'; export interface InputPickerContextProps { /** Multiple selections are allowed */ multi?: boolean; /** Tag related props. */ tagProps: TagProps; /** * Set the trigger for creating tags. only valid when creatable */ trigger: TriggerType | TriggerType[]; /** * No overlay provides options */ disabledOptions?: boolean; } export declare const InputPickerContext: React.Context<InputPickerContextProps>; interface InputItemDataType extends ItemDataType { create?: boolean; } export declare type ValueType = any; export interface InputPickerProps<T = ValueType> extends FormControlPickerProps<T, InputPickerLocale, InputItemDataType>, SelectProps<T> { tabIndex?: number; /** Settings can create new options */ creatable?: boolean; /** Option to cache value when searching asynchronously */ cacheData?: InputItemDataType[]; /** The `onBlur` attribute for the `input` element. */ onBlur?: React.FocusEventHandler; /** The `onFocus` attribute for the `input` element. */ onFocus?: React.FocusEventHandler; /** Called when the option is created */ onCreate?: (value: ValueType, item: ItemDataType, event: React.SyntheticEvent) => void; } declare const InputPicker: PickerComponent<InputPickerProps>; export default InputPicker;