UNPKG

react-widgets-up

Version:

An à la carte set of polished, extensible, and accessible inputs built for React

39 lines (38 loc) 2.23 kB
import * as React from 'react'; import { BaseListboxInputProps, ChangeHandler, Filterable, PopupWidgetProps, SelectHandler, WidgetHTMLProps, WidgetProps } from './shared'; import { DataItem, WidgetHandle } from './types'; export type ComboboxHandle = WidgetHandle; export interface ComboboxProps<TDataItem = DataItem> extends WidgetHTMLProps, WidgetProps, PopupWidgetProps, Filterable<TDataItem>, BaseListboxInputProps<TDataItem, string | TDataItem> { name?: string; /** * If a `data` item matches the current typed value select it automatically. */ autoSelectMatches?: boolean; onChange?: ChangeHandler<TDataItem | string>; onSelect?: SelectHandler<TDataItem | string>; hideCaret?: boolean; hideEmptyPopup?: boolean; ref?: React.RefObject<ComboboxHandle>; } /** * --- * shortcuts: * - { key: alt + down arrow, label: open combobox } * - { key: alt + up arrow, label: close combobox } * - { key: down arrow, label: move focus to next item } * - { key: up arrow, label: move focus to previous item } * - { key: home, label: move focus to first item } * - { key: end, label: move focus to last item } * - { key: enter, label: select focused item } * - { key: any key, label: search list for item starting with key } * --- * * Select an item from the list, or input a custom value. The Combobox can also make suggestions as you type. * @public */ declare function ComboboxImpl<TDataItem>({ id, className, containerClassName, placeholder, autoFocus, textField, dataKey, autoSelectMatches, focusFirstItem, value, defaultValue, onChange, open, defaultOpen, onToggle, filter, busy, disabled, readOnly, selectIcon, hideCaret, hideEmptyPopup, busySpinner, dropUp, tabIndex, popupTransition, name, onSelect, onKeyDown, onBlur, onFocus, inputProps, listProps, popupProps, groupBy, renderListItem, renderListGroup, optionComponent, listComponent: ListComponent, popupComponent: Popup, data: rawData, messages: userMessages, ref: outerRef, ...elementProps }: ComboboxProps<TDataItem>): React.JSX.Element; declare namespace ComboboxImpl { var displayName: string; } export default ComboboxImpl; //# sourceMappingURL=Combobox.d.ts.map