UNPKG

1.69 kBTypeScriptView Raw
1import * as React from 'react';
2import { BaseListboxInputProps, ChangeHandler, Filterable, PopupWidgetProps, SelectHandler, WidgetHTMLProps, WidgetProps } from './shared';
3import { DataItem, WidgetHandle } from './types';
4export declare type ComboboxHandle = WidgetHandle;
5export interface ComboboxProps<TDataItem = DataItem> extends WidgetHTMLProps, WidgetProps, PopupWidgetProps, Filterable<TDataItem>, BaseListboxInputProps<TDataItem, string | TDataItem> {
6 name?: string;
7 /**
8 * If a `data` item matches the current typed value select it automatically.
9 */
10 autoSelectMatches?: boolean;
11 onChange?: ChangeHandler<TDataItem | string>;
12 onSelect?: SelectHandler<TDataItem | string>;
13 hideCaret?: boolean;
14 hideEmptyPopup?: boolean;
15}
16declare interface Combobox {
17 <TDataItem = DataItem>(props: ComboboxProps<TDataItem> & React.RefAttributes<ComboboxHandle>): React.ReactElement | null;
18 displayName?: string;
19 propTypes?: any;
20}
21/**
22 * ---
23 * shortcuts:
24 * - { key: alt + down arrow, label: open combobox }
25 * - { key: alt + up arrow, label: close combobox }
26 * - { key: down arrow, label: move focus to next item }
27 * - { key: up arrow, label: move focus to previous item }
28 * - { key: home, label: move focus to first item }
29 * - { key: end, label: move focus to last item }
30 * - { key: enter, label: select focused item }
31 * - { key: any key, label: search list for item starting with key }
32 * ---
33 *
34 * Select an item from the list, or input a custom value. The Combobox can also make suggestions as you type.
35
36 * @public
37 */
38declare const ComboboxImpl: Combobox;
39export default ComboboxImpl;
40//# sourceMappingURL=Combobox.d.ts.map
\No newline at end of file