1 | import React from 'react';
|
2 | import { MultiselectTagListProps, RenderTagProp, TagComponentProp } from './MultiselectTagList';
|
3 | import { BaseListboxInputProps, Filterable, PopupWidgetProps, Searchable, WidgetHTMLProps, WidgetProps } from './shared';
|
4 | import { DataItem, Value, WidgetHandle } from './types';
|
5 | export declare type MultiselectHandle = WidgetHandle;
|
6 | export declare type ChangeHandler<TDataItem> = (dataItem: TDataItem[], metadata: {
|
7 | action: 'insert' | 'remove';
|
8 | dataItem: TDataItem;
|
9 | searchTerm?: string;
|
10 | lastValue: Value;
|
11 | originalEvent?: React.SyntheticEvent;
|
12 | }) => void;
|
13 | export interface MultiselectProps<TDataItem = DataItem> extends WidgetHTMLProps, WidgetProps, PopupWidgetProps, Filterable<TDataItem>, Searchable, Omit<BaseListboxInputProps<TDataItem, unknown[]>, 'onChange'> {
|
14 | onChange?: ChangeHandler<TDataItem>;
|
15 | onCreate?: (searchTerm: string) => void;
|
16 | showPlaceholderWithValues?: boolean;
|
17 | renderTagValue?: RenderTagProp<TDataItem>;
|
18 | clearTagIcon?: React.ReactNode;
|
19 | tagOptionComponent?: TagComponentProp;
|
20 | tagListComponent?: React.ComponentType<MultiselectTagListProps<DataItem>>;
|
21 | showSelectedItemsInList?: boolean;
|
22 | }
|
23 | declare interface Multiselect {
|
24 | <TDataItem = DataItem>(props: MultiselectProps<TDataItem> & React.RefAttributes<MultiselectHandle>): React.ReactElement | null;
|
25 | displayName?: string;
|
26 | propTypes?: any;
|
27 | }
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 | declare const Multiselect: Multiselect;
|
50 | export default Multiselect;
|
51 |
|
\ | No newline at end of file |