1 | import * as React from 'react';
|
2 | import { StandardProps } from '@material-ui/core';
|
3 | import { PopperProps } from '@material-ui/core/Popper';
|
4 | import {
|
5 | AutocompleteChangeDetails,
|
6 | AutocompleteChangeReason,
|
7 | AutocompleteCloseReason,
|
8 | AutocompleteInputChangeReason,
|
9 | createFilterOptions,
|
10 | UseAutocompleteProps,
|
11 | } from '../useAutocomplete';
|
12 | export {
|
13 | AutocompleteChangeDetails,
|
14 | AutocompleteChangeReason,
|
15 | AutocompleteCloseReason,
|
16 | AutocompleteInputChangeReason,
|
17 | createFilterOptions,
|
18 | };
|
19 |
|
20 | export interface AutocompleteRenderOptionState {
|
21 | inputValue: string;
|
22 | selected: boolean;
|
23 | }
|
24 |
|
25 | export type AutocompleteGetTagProps = ({ index }: { index: number }) => {};
|
26 |
|
27 | export interface AutocompleteRenderGroupParams {
|
28 | key: string;
|
29 | group: string;
|
30 | children: React.ReactNode;
|
31 | }
|
32 |
|
33 | export interface AutocompleteRenderInputParams {
|
34 | id: string;
|
35 | disabled: boolean;
|
36 | fullWidth: boolean;
|
37 | size: 'small' | undefined;
|
38 | InputLabelProps: object;
|
39 | InputProps: {
|
40 | ref: React.Ref<any>;
|
41 | className: string;
|
42 | startAdornment: React.ReactNode;
|
43 | endAdornment: React.ReactNode;
|
44 | };
|
45 | inputProps: object;
|
46 | }
|
47 |
|
48 | export interface AutocompleteProps<
|
49 | T,
|
50 | Multiple extends boolean | undefined,
|
51 | DisableClearable extends boolean | undefined,
|
52 | FreeSolo extends boolean | undefined
|
53 | >
|
54 | extends UseAutocompleteProps<T, Multiple, DisableClearable, FreeSolo>,
|
55 | StandardProps<
|
56 | React.HTMLAttributes<HTMLDivElement>,
|
57 | AutocompleteClassKey,
|
58 | 'defaultValue' | 'onChange' | 'children'
|
59 | > {
|
60 | |
61 |
|
62 |
|
63 | ChipProps?: object;
|
64 | |
65 |
|
66 |
|
67 | closeIcon?: React.ReactNode;
|
68 | |
69 |
|
70 |
|
71 |
|
72 |
|
73 | clearText?: string;
|
74 | |
75 |
|
76 |
|
77 |
|
78 |
|
79 | closeText?: string;
|
80 | |
81 |
|
82 |
|
83 | disabled?: boolean;
|
84 | |
85 |
|
86 |
|
87 |
|
88 | disablePortal?: boolean;
|
89 | |
90 |
|
91 |
|
92 | forcePopupIcon?: true | false | 'auto';
|
93 | |
94 |
|
95 |
|
96 | fullWidth?: boolean;
|
97 | |
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 | getLimitTagsText?: (more: number) => React.ReactNode;
|
104 | |
105 |
|
106 |
|
107 | ListboxComponent?: React.ComponentType<React.HTMLAttributes<HTMLElement>>;
|
108 | |
109 |
|
110 |
|
111 | ListboxProps?: object;
|
112 | |
113 |
|
114 |
|
115 | loading?: boolean;
|
116 | |
117 |
|
118 |
|
119 |
|
120 |
|
121 | loadingText?: React.ReactNode;
|
122 | |
123 |
|
124 |
|
125 |
|
126 | limitTags?: number;
|
127 | |
128 |
|
129 |
|
130 |
|
131 |
|
132 | noOptionsText?: React.ReactNode;
|
133 | |
134 |
|
135 |
|
136 |
|
137 |
|
138 | openText?: string;
|
139 | |
140 |
|
141 |
|
142 | PaperComponent?: React.ComponentType<React.HTMLAttributes<HTMLElement>>;
|
143 | |
144 |
|
145 |
|
146 | PopperComponent?: React.ComponentType<PopperProps>;
|
147 | |
148 |
|
149 |
|
150 | popupIcon?: React.ReactNode;
|
151 | |
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 | renderGroup?: (params: AutocompleteRenderGroupParams) => React.ReactNode;
|
158 | |
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 | renderInput: (params: AutocompleteRenderInputParams) => React.ReactNode;
|
165 | |
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 | renderOption?: (option: T, state: AutocompleteRenderOptionState) => React.ReactNode;
|
173 | |
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 | renderTags?: (value: T[], getTagProps: AutocompleteGetTagProps) => React.ReactNode;
|
181 | |
182 |
|
183 |
|
184 | size?: 'small' | 'medium';
|
185 | }
|
186 |
|
187 | export type AutocompleteClassKey =
|
188 | | 'root'
|
189 | | 'focused'
|
190 | | 'tag'
|
191 | | 'tagSizeSmall'
|
192 | | 'inputRoot'
|
193 | | 'input'
|
194 | | 'inputFocused'
|
195 | | 'endAdornment'
|
196 | | 'clearIndicator'
|
197 | | 'clearIndicatorDirty'
|
198 | | 'popupIndicator'
|
199 | | 'popupIndicatorOpen'
|
200 | | 'popper'
|
201 | | 'popperDisablePortal'
|
202 | | 'paper'
|
203 | | 'listbox'
|
204 | | 'loading'
|
205 | | 'noOptions'
|
206 | | 'option'
|
207 | | 'groupLabel'
|
208 | | 'groupUl';
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 | export default function Autocomplete<
|
221 | T,
|
222 | Multiple extends boolean | undefined = undefined,
|
223 | DisableClearable extends boolean | undefined = undefined,
|
224 | FreeSolo extends boolean | undefined = undefined
|
225 | >(props: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>): JSX.Element;
|