@iress-oss/ids-mcp-server 5.15.0 → 5.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generated/docs/components_components-alert-docs.md +496 -0
- package/generated/docs/components_components-autocomplete-docs.md +3429 -0
- package/generated/docs/{components-autocomplete-recipes-docs.md → components_components-autocomplete-recipes-docs.md} +39 -14
- package/generated/docs/{components-badge-docs.md → components_components-badge-docs.md} +222 -30
- package/generated/docs/components_components-button-docs.md +2078 -0
- package/generated/docs/components_components-button-recipes-docs.md +37 -0
- package/generated/docs/components_components-buttongroup-docs.md +1045 -0
- package/generated/docs/components_components-card-docs.md +2290 -0
- package/generated/docs/{components-card-recipes-docs.md → components_components-card-recipes-docs.md} +132 -15
- package/generated/docs/components_components-checkbox-docs.md +1040 -0
- package/generated/docs/{components-checkboxgroup-docs.md → components_components-checkboxgroup-docs.md} +1001 -82
- package/generated/docs/{components-checkboxgroup-recipes-docs.md → components_components-checkboxgroup-recipes-docs.md} +102 -12
- package/generated/docs/{components-col-docs.md → components_components-col-docs.md} +331 -58
- package/generated/docs/components_components-combobox-docs.md +3735 -0
- package/generated/docs/{components-container-docs.md → components_components-container-docs.md} +61 -24
- package/generated/docs/{components-divider-docs.md → components_components-divider-docs.md} +83 -24
- package/generated/docs/{components-expander-docs.md → components_components-expander-docs.md} +266 -33
- package/generated/docs/components_components-field-docs.md +1369 -0
- package/generated/docs/components_components-filter-docs.md +4080 -0
- package/generated/docs/{components-form-docs.md → components_components-form-docs.md} +1556 -360
- package/generated/docs/{components-form-recipes-docs.md → components_components-form-recipes-docs.md} +277 -60
- package/generated/docs/{components-hide-docs.md → components_components-hide-docs.md} +195 -124
- package/generated/docs/components_components-icon-docs.md +1337 -0
- package/generated/docs/{components-inline-docs.md → components_components-inline-docs.md} +462 -42
- package/generated/docs/components_components-input-docs.md +1468 -0
- package/generated/docs/components_components-input-recipes-docs.md +367 -0
- package/generated/docs/components_components-inputcurrency-docs.md +432 -0
- package/generated/docs/{components-inputcurrency-recipes-docs.md → components_components-inputcurrency-recipes-docs.md} +113 -17
- package/generated/docs/components_components-label-docs.md +323 -0
- package/generated/docs/components_components-menu-docs.md +2345 -0
- package/generated/docs/components_components-menu-menuitem-docs.md +633 -0
- package/generated/docs/{components-modal-docs.md → components_components-modal-docs.md} +1640 -231
- package/generated/docs/components_components-navbar-docs.md +1847 -0
- package/generated/docs/{components-navbar-recipes-docs.md → components_components-navbar-recipes-docs.md} +721 -40
- package/generated/docs/{components-panel-docs.md → components_components-panel-docs.md} +754 -57
- package/generated/docs/components_components-placeholder-docs.md +92 -0
- package/generated/docs/components_components-popover-docs.md +1643 -0
- package/generated/docs/components_components-popover-recipes-docs.md +491 -0
- package/generated/docs/components_components-progress-docs.md +115 -0
- package/generated/docs/{components-provider-docs.md → components_components-provider-docs.md} +42 -33
- package/generated/docs/components_components-radio-docs.md +491 -0
- package/generated/docs/{components-radiogroup-docs.md → components_components-radiogroup-docs.md} +927 -75
- package/generated/docs/components_components-readonly-docs.md +263 -0
- package/generated/docs/components_components-richselect-docs.md +6521 -0
- package/generated/docs/{components-row-docs.md → components_components-row-docs.md} +353 -43
- package/generated/docs/{components-select-docs.md → components_components-select-docs.md} +719 -61
- package/generated/docs/components_components-skeleton-docs.md +480 -0
- package/generated/docs/{components-skeleton-recipes-docs.md → components_components-skeleton-recipes-docs.md} +51 -11
- package/generated/docs/{components-skiplink-docs.md → components_components-skiplink-docs.md} +53 -14
- package/generated/docs/components_components-slideout-docs.md +2293 -0
- package/generated/docs/components_components-slider-docs.md +1276 -0
- package/generated/docs/components_components-spinner-docs.md +82 -0
- package/generated/docs/{components-stack-docs.md → components_components-stack-docs.md} +223 -40
- package/generated/docs/components_components-table-docs.md +3658 -0
- package/generated/docs/components_components-tabset-docs.md +772 -0
- package/generated/docs/components_components-tabset-tab-docs.md +262 -0
- package/generated/docs/components_components-tag-docs.md +257 -0
- package/generated/docs/{components-text-docs.md → components_components-text-docs.md} +491 -51
- package/generated/docs/{components-toaster-docs.md → components_components-toaster-docs.md} +187 -85
- package/generated/docs/components_components-toaster-toast-docs.md +634 -0
- package/generated/docs/components_components-toggle-docs.md +461 -0
- package/generated/docs/{components-tooltip-docs.md → components_components-tooltip-docs.md} +286 -41
- package/generated/docs/{components-validationmessage-docs.md → components_components-validationmessage-docs.md} +230 -61
- package/generated/docs/components_contact-us-docs.md +12 -0
- package/generated/docs/{foundations-accessibility-docs.md → components_foundations-accessibility-docs.md} +11 -21
- package/generated/docs/{foundations-colours-docs.md → components_foundations-colour-030-colours.md} +8 -15
- package/generated/docs/{foundations-consistency-docs.md → components_foundations-consistency-docs.md} +12 -20
- package/generated/docs/{foundations-content-docs.md → components_foundations-content-docs.md} +6 -11
- package/generated/docs/components_foundations-introduction-docs.md +15 -0
- package/generated/docs/{foundations-principles-docs.md → components_foundations-principles-docs.md} +14 -24
- package/generated/docs/components_foundations-typography-docs.md +608 -0
- package/generated/docs/{foundations-user-experience-docs.md → components_foundations-user-experience-docs.md} +16 -26
- package/generated/docs/{foundations-visual-design-docs.md → components_foundations-visual-design-docs.md} +10 -17
- package/generated/docs/{frequently-asked-questions-docs.md → components_frequently-asked-questions-docs.md} +14 -23
- package/generated/docs/components_get-started-develop-docs.md +84 -0
- package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
- package/generated/docs/components_introduction-docs.md +15 -0
- package/generated/docs/{patterns-loading-docs.md → components_patterns-loading-docs.md} +798 -153
- package/generated/docs/components_resources-changelog-docs.md +4 -0
- package/generated/docs/{resources-code-katas-docs.md → components_resources-code-katas-docs.md} +5 -9
- package/generated/docs/{resources-migration-guides-from-v4-to-v5-docs.md → components_resources-migration-guides-from-v4-to-v5-docs.md} +54 -239
- package/generated/docs/components_sandbox-docs.md +4 -0
- package/generated/docs/{versions-docs.md → components_versions-docs.md} +5 -8
- package/generated/docs/guidelines.md +484 -200
- package/generated/docs/introduction-docs.md +19 -30
- package/package.json +41 -45
- package/generated/docs/components-alert-docs.md +0 -130
- package/generated/docs/components-autocomplete-docs.md +0 -754
- package/generated/docs/components-button-docs.md +0 -362
- package/generated/docs/components-button-recipes-docs.md +0 -76
- package/generated/docs/components-buttongroup-docs.md +0 -310
- package/generated/docs/components-card-docs.md +0 -494
- package/generated/docs/components-checkbox-docs.md +0 -193
- package/generated/docs/components-combobox-docs.md +0 -1016
- package/generated/docs/components-field-docs.md +0 -675
- package/generated/docs/components-filter-docs.md +0 -1109
- package/generated/docs/components-icon-docs.md +0 -553
- package/generated/docs/components-input-docs.md +0 -335
- package/generated/docs/components-input-recipes-docs.md +0 -140
- package/generated/docs/components-inputcurrency-docs.md +0 -157
- package/generated/docs/components-label-docs.md +0 -135
- package/generated/docs/components-menu-docs.md +0 -704
- package/generated/docs/components-menu-menuitem-docs.md +0 -193
- package/generated/docs/components-navbar-docs.md +0 -291
- package/generated/docs/components-placeholder-docs.md +0 -27
- package/generated/docs/components-popover-docs.md +0 -464
- package/generated/docs/components-popover-recipes-docs.md +0 -245
- package/generated/docs/components-progress-docs.md +0 -104
- package/generated/docs/components-radio-docs.md +0 -107
- package/generated/docs/components-readonly-docs.md +0 -89
- package/generated/docs/components-richselect-docs.md +0 -2433
- package/generated/docs/components-skeleton-docs.md +0 -214
- package/generated/docs/components-slideout-docs.md +0 -538
- package/generated/docs/components-slider-docs.md +0 -346
- package/generated/docs/components-spinner-docs.md +0 -59
- package/generated/docs/components-table-ag-grid-docs.md +0 -1074
- package/generated/docs/components-table-docs.md +0 -1305
- package/generated/docs/components-tabset-docs.md +0 -341
- package/generated/docs/components-tabset-tab-docs.md +0 -86
- package/generated/docs/components-tag-docs.md +0 -115
- package/generated/docs/components-toaster-toast-docs.md +0 -157
- package/generated/docs/components-toggle-docs.md +0 -158
- package/generated/docs/contact-us-docs.md +0 -27
- package/generated/docs/extensions-editor-docs.md +0 -288
- package/generated/docs/extensions-editor-recipes-docs.md +0 -39
- package/generated/docs/foundations-introduction-docs.md +0 -17
- package/generated/docs/foundations-typography-docs.md +0 -191
- package/generated/docs/get-started-develop-docs.md +0 -209
- package/generated/docs/get-started-using-storybook-docs.md +0 -68
- package/generated/docs/resources-changelog-docs.md +0 -6
- package/generated/docs/themes-available-themes-docs.md +0 -66
- package/generated/docs/themes-introduction-docs.md +0 -121
- package/generated/docs/themes-tokens-docs.md +0 -1200
- /package/{LICENSE.txt → LICENSE} +0 -0
|
@@ -1,754 +0,0 @@
|
|
|
1
|
-
[](#autocomplete)Autocomplete
|
|
2
|
-
=============================
|
|
3
|
-
|
|
4
|
-
Overview
|
|
5
|
-
--------
|
|
6
|
-
|
|
7
|
-
Autocomplete allow for users to fill in their input by providing suggestions as they type.
|
|
8
|
-
|
|
9
|
-
Hide code
|
|
10
|
-
|
|
11
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
12
|
-
|
|
13
|
-
<IressAutocomplete
|
|
14
|
-
options\={\[
|
|
15
|
-
{
|
|
16
|
-
label: 'Option 1'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: 'Option 2'
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
label: 'Option 3'
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
label: 'Option 4'
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
label: 'Option 5'
|
|
29
|
-
}
|
|
30
|
-
\]}
|
|
31
|
-
popoverProps\={{
|
|
32
|
-
container: document.body
|
|
33
|
-
}}
|
|
34
|
-
/>
|
|
35
|
-
|
|
36
|
-
Copy
|
|
37
|
-
|
|
38
|
-
[](#usage)Usage
|
|
39
|
-
---------------
|
|
40
|
-
|
|
41
|
-
The `IressAutocomplete` element extends `IressInput` with additional functionality to provide suggestions to the user as they type.
|
|
42
|
-
|
|
43
|
-
There is no validation done between the suggestions and the input value. They are strictly suggestions to improve the user experience. If you would like to restrict the input to the suggestions, you can use `IressCombobox`.
|
|
44
|
-
|
|
45
|
-
### [](#uncontrolled)Uncontrolled
|
|
46
|
-
|
|
47
|
-
The `defaultValue` prop can be used to set the initial value of the input. The value will be managed by the component.
|
|
48
|
-
|
|
49
|
-
×Clear
|
|
50
|
-
|
|
51
|
-
Hide code
|
|
52
|
-
|
|
53
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
54
|
-
|
|
55
|
-
<IressAutocomplete
|
|
56
|
-
defaultValue\="Option 1"
|
|
57
|
-
options\={\[
|
|
58
|
-
{
|
|
59
|
-
label: 'Option 1'
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
label: 'Option 2'
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
label: 'Option 3'
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
label: 'Option 4'
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
label: 'Option 5'
|
|
72
|
-
}
|
|
73
|
-
\]}
|
|
74
|
-
popoverProps\={{
|
|
75
|
-
container: document.body
|
|
76
|
-
}}
|
|
77
|
-
/>
|
|
78
|
-
|
|
79
|
-
Copy
|
|
80
|
-
|
|
81
|
-
### [](#controlled)Controlled
|
|
82
|
-
|
|
83
|
-
The `value` prop can be used to completely control the state of the component. Use the `onChange` and `onClear` props to sync your state with the component.
|
|
84
|
-
|
|
85
|
-
×Clear
|
|
86
|
-
|
|
87
|
-
Hide code
|
|
88
|
-
|
|
89
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
90
|
-
|
|
91
|
-
import { IressAutocomplete, IressAutocompleteProps } from '@iress-oss/ids-components';
|
|
92
|
-
import { useState } from 'react';
|
|
93
|
-
export const AutocompleteUsingState \= () \=> {
|
|
94
|
-
const \[value, setValue\] \= useState('Option 1');
|
|
95
|
-
return (
|
|
96
|
-
<IressAutocomplete
|
|
97
|
-
{...{
|
|
98
|
-
popoverProps: {
|
|
99
|
-
container: document.body,
|
|
100
|
-
},
|
|
101
|
-
options: \[
|
|
102
|
-
{
|
|
103
|
-
label: 'Option 1',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
label: 'Option 2',
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
label: 'Option 3',
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
label: 'Option 4',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
label: 'Option 5',
|
|
116
|
-
},
|
|
117
|
-
\],
|
|
118
|
-
}}
|
|
119
|
-
onChange\={(\_e, newValue) \=> setValue(newValue ?? '')}
|
|
120
|
-
onClear\={() \=> setValue('')}
|
|
121
|
-
value\={value}
|
|
122
|
-
/>
|
|
123
|
-
);
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
Copy
|
|
127
|
-
|
|
128
|
-
### [](#providing-suggestions)Providing suggestions
|
|
129
|
-
|
|
130
|
-
#### [](#options)`options`
|
|
131
|
-
|
|
132
|
-
To use the suggestion functionality, you can provide an array of `LabelValueMeta[]` objects to the `options` prop.
|
|
133
|
-
|
|
134
|
-
**Note:** If `value` is provided on a suggestion item, it will be used (casted to a string) instead of the `label` key. This is useful when you want to display a different value to the user than what is used for filtering.
|
|
135
|
-
|
|
136
|
-
Hide code
|
|
137
|
-
|
|
138
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
139
|
-
|
|
140
|
-
<IressAutocomplete
|
|
141
|
-
options\={\[
|
|
142
|
-
{
|
|
143
|
-
label: 'Option 1'
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
label: 'Option 2'
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
label: 'Option 3'
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
label: 'Option 4'
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
label: 'Option 5'
|
|
156
|
-
}
|
|
157
|
-
\]}
|
|
158
|
-
popoverProps\={{
|
|
159
|
-
container: document.body
|
|
160
|
-
}}
|
|
161
|
-
/>
|
|
162
|
-
|
|
163
|
-
Copy
|
|
164
|
-
|
|
165
|
-
#### [](#asynchronous-options)Asynchronous `options`
|
|
166
|
-
|
|
167
|
-
If you would like to render suggestions from the server, you can pass a function to the `options` prop. It accepts a string parameter and returns a promise that resolves to an array of `LabelValueMeta[]` objects.
|
|
168
|
-
|
|
169
|
-
Hide code
|
|
170
|
-
|
|
171
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
172
|
-
|
|
173
|
-
import { IressAutocomplete, IressAutocompleteProps } from '@iress-oss/ids-components';
|
|
174
|
-
interface StarWarsCharacter {
|
|
175
|
-
name: string;
|
|
176
|
-
gender: string;
|
|
177
|
-
}
|
|
178
|
-
interface StarWarsCharacterApi {
|
|
179
|
-
results: StarWarsCharacter\[\];
|
|
180
|
-
}
|
|
181
|
-
export const AutocompleteUsingAsync \= () \=> (
|
|
182
|
-
<IressAutocomplete
|
|
183
|
-
{...{
|
|
184
|
-
popoverProps: {
|
|
185
|
-
container: document.body,
|
|
186
|
-
},
|
|
187
|
-
}}
|
|
188
|
-
options\={async (query: string) \=> {
|
|
189
|
-
if (query \=== 'error') {
|
|
190
|
-
throw new Error('This is an error');
|
|
191
|
-
}
|
|
192
|
-
const data \= await fetch(
|
|
193
|
-
\`https://swapi.py4e.com/api/people/?search=${query}\`,
|
|
194
|
-
).then((response) \=> response.json() as Promise<StarWarsCharacterApi\>);
|
|
195
|
-
return data.results.map((character: StarWarsCharacter) \=> ({
|
|
196
|
-
label: character.name,
|
|
197
|
-
value: character.name,
|
|
198
|
-
meta: character.gender,
|
|
199
|
-
}));
|
|
200
|
-
}}
|
|
201
|
-
/>
|
|
202
|
-
);
|
|
203
|
-
|
|
204
|
-
Copy
|
|
205
|
-
|
|
206
|
-
#### [](#initialoptions)`initialOptions`
|
|
207
|
-
|
|
208
|
-
If you want to provide initial options to the user, you can use the `initialOptions` prop. This is useful when you want to provide a list of options to the user before they start typing (eg. recommended search terms).
|
|
209
|
-
|
|
210
|
-
Hide code
|
|
211
|
-
|
|
212
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
213
|
-
|
|
214
|
-
<IressAutocomplete
|
|
215
|
-
initialOptions\={\[
|
|
216
|
-
{
|
|
217
|
-
label: 'Favourite option 1'
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
label: 'Favourite option 2'
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
label: 'Favourite option 3'
|
|
224
|
-
}
|
|
225
|
-
\]}
|
|
226
|
-
options\={\[
|
|
227
|
-
{
|
|
228
|
-
label: 'Option 1'
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
label: 'Option 2'
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
label: 'Option 3'
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
label: 'Option 4'
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
label: 'Option 5'
|
|
241
|
-
}
|
|
242
|
-
\]}
|
|
243
|
-
popoverProps\={{
|
|
244
|
-
container: document.body
|
|
245
|
-
}}
|
|
246
|
-
/>
|
|
247
|
-
|
|
248
|
-
Copy
|
|
249
|
-
|
|
250
|
-
[](#behaviour)Behaviour
|
|
251
|
-
-----------------------
|
|
252
|
-
|
|
253
|
-
* As long as there is a single character in the input, the suggestions will be displayed in a popover. Unless `initialOptions` are provided where the popover will be displayed immediately on focus.
|
|
254
|
-
* The popover will close when the input is empty, unless `initialOptions` are provided.
|
|
255
|
-
* The suggestions will be filtered based on the input value.
|
|
256
|
-
* Tapping on a suggestion with the mouse will change the input value to the selection and close the popover.
|
|
257
|
-
* When the user presses the arrows keys while the input is focussed, suggestions will be highlighted, but focus remains on the input.
|
|
258
|
-
* When the user presses the enter key while a suggestion is highlighted, the suggestion will be selected and the popover will close.
|
|
259
|
-
* When the user presses the down key while the popover is closed, it will open the popover.
|
|
260
|
-
* When the user pressed the up key while the first suggestion is highlighted, it will close the popover.
|
|
261
|
-
* When the user tabs away while no suggestion is highlighted, the input will not be changed.
|
|
262
|
-
* When the user tabs away while a suggestion is highlighted, the suggestion will be selected.
|
|
263
|
-
* When the user tabs away while the popover is open, the popover will close.
|
|
264
|
-
|
|
265
|
-
[](#accessibility)Accessibility
|
|
266
|
-
-------------------------------
|
|
267
|
-
|
|
268
|
-
The autocomplete component follows the [WAI combobox pattern: List autocomplete with manual selection](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/#:~:text=List%20autocomplete%20with%20manual,value%20in%20the%20popup). An example of this pattern outside of IDS can be seen at [WAI-ARIA combobox example](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/).
|
|
269
|
-
|
|
270
|
-
There is a key difference:
|
|
271
|
-
|
|
272
|
-
* For better usability, virtual focus is used to highlight the suggestions inside the popover. This means focus remains on the input, but the suggestions are highlighted as if they are in focus, allowing the user to type and navigate the suggestions with the arrow keys.
|
|
273
|
-
* To denote the highlighted suggestion to screen readers, the `aria-activedescendant` attribute is used.
|
|
274
|
-
|
|
275
|
-
[](#examples)Examples
|
|
276
|
-
---------------------
|
|
277
|
-
|
|
278
|
-
### [](#autoselect)`autoSelect`
|
|
279
|
-
|
|
280
|
-
The `autoSelect` prop will automatically select the highlighted option when the user blurs the autocomplete. This is set to true by default, but can be switched off.
|
|
281
|
-
|
|
282
|
-
Hide code
|
|
283
|
-
|
|
284
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
285
|
-
|
|
286
|
-
<IressAutocomplete
|
|
287
|
-
autoSelect\={false}
|
|
288
|
-
options\={\[
|
|
289
|
-
{
|
|
290
|
-
label: 'Option 1'
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
label: 'Option 2'
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
label: 'Option 3'
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
label: 'Option 4'
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
label: 'Option 5'
|
|
303
|
-
}
|
|
304
|
-
\]}
|
|
305
|
-
placeholder\="Should no longer auto-select when an item is highlighted"
|
|
306
|
-
popoverProps\={{
|
|
307
|
-
container: document.body
|
|
308
|
-
}}
|
|
309
|
-
/>
|
|
310
|
-
|
|
311
|
-
Copy
|
|
312
|
-
|
|
313
|
-
### [](#input-props)Input props
|
|
314
|
-
|
|
315
|
-
Autocomplete extends `IressInput`, hence it has the same properties as `IressInput`.
|
|
316
|
-
|
|
317
|
-
It does have some defaults to help with user experience. `append` automatically has a search icon, and `clearable` and `watermark` are set to true by default.
|
|
318
|
-
|
|
319
|
-
Hide code
|
|
320
|
-
|
|
321
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
322
|
-
|
|
323
|
-
<IressAutocomplete
|
|
324
|
-
append\={<IressPopover activator\={<IressButton mode\="tertiary"\><IressIcon name\="cog" /></IressButton\>} align\="bottom-end" container\={document.body}\><IressPanel className\="iress-u-text"\>Some settings in here</IressPanel\></IressPopover\>}
|
|
325
|
-
options\={\[
|
|
326
|
-
{
|
|
327
|
-
label: 'Option 1'
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
label: 'Option 2'
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
label: 'Option 3'
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
label: 'Option 4'
|
|
337
|
-
},
|
|
338
|
-
{
|
|
339
|
-
label: 'Option 5'
|
|
340
|
-
}
|
|
341
|
-
\]}
|
|
342
|
-
popoverProps\={{
|
|
343
|
-
container: document.body
|
|
344
|
-
}}
|
|
345
|
-
prepend\={<IressIcon name\="search" />}
|
|
346
|
-
width\="12"
|
|
347
|
-
/>
|
|
348
|
-
|
|
349
|
-
Copy
|
|
350
|
-
|
|
351
|
-
### [](#no-results)No results
|
|
352
|
-
|
|
353
|
-
If you would like to show a message when there are no results, you can use the `noResultsText` prop. It accepts any React node.
|
|
354
|
-
|
|
355
|
-
Hide code
|
|
356
|
-
|
|
357
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
358
|
-
|
|
359
|
-
<IressAutocomplete
|
|
360
|
-
noResultsText\={<IressPanel className\="iress-u-text"\>No results found</IressPanel\>}
|
|
361
|
-
options\={\[
|
|
362
|
-
{
|
|
363
|
-
label: 'Option 1'
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
label: 'Option 2'
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
label: 'Option 3'
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
label: 'Option 4'
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
label: 'Option 5'
|
|
376
|
-
}
|
|
377
|
-
\]}
|
|
378
|
-
placeholder\="Type "no" to see the no results text"
|
|
379
|
-
popoverProps\={{
|
|
380
|
-
container: document.body
|
|
381
|
-
}}
|
|
382
|
-
/>
|
|
383
|
-
|
|
384
|
-
Copy
|
|
385
|
-
|
|
386
|
-
### [](#popover-props)Popover props
|
|
387
|
-
|
|
388
|
-
Under the hood, autocomplete uses `IressInputPopover` to display the suggestions. It accepts `autoHighlight`, `align`, `className` and `displayMode`.
|
|
389
|
-
|
|
390
|
-
There are two additional props that autocomplete accepts to customise the popover: `append` and `prepend`. You can place additional content above or below the results using these props.
|
|
391
|
-
|
|
392
|
-
Hide code
|
|
393
|
-
|
|
394
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
395
|
-
|
|
396
|
-
<IressAutocomplete
|
|
397
|
-
options\={\[
|
|
398
|
-
{
|
|
399
|
-
label: 'Option 1'
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
label: 'Option 2'
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
label: 'Option 3'
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
label: 'Option 4'
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
label: 'Option 5'
|
|
412
|
-
}
|
|
413
|
-
\]}
|
|
414
|
-
popoverProps\={{
|
|
415
|
-
append: <IressPanel\><IressButton\>Add an option</IressButton\></IressPanel\>,
|
|
416
|
-
container: document.body
|
|
417
|
-
}}
|
|
418
|
-
/>
|
|
419
|
-
|
|
420
|
-
Copy
|
|
421
|
-
|
|
422
|
-
### [](#debounce-threshold)Debounce threshold
|
|
423
|
-
|
|
424
|
-
The `debounceThreshold` prop can be used to set the time in milliseconds to wait before making a request to the `options` function. This is useful when you want to prevent making too many requests to the server.
|
|
425
|
-
|
|
426
|
-
By default there is a debounce, but it can be removed by setting it to `0`.
|
|
427
|
-
|
|
428
|
-
Hide code
|
|
429
|
-
|
|
430
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
431
|
-
|
|
432
|
-
<IressAutocomplete
|
|
433
|
-
debounceThreshold\={0}
|
|
434
|
-
options\={\[
|
|
435
|
-
{
|
|
436
|
-
label: 'Option 1'
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
label: 'Option 2'
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
label: 'Option 3'
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
label: 'Option 4'
|
|
446
|
-
},
|
|
447
|
-
{
|
|
448
|
-
label: 'Option 5'
|
|
449
|
-
}
|
|
450
|
-
\]}
|
|
451
|
-
placeholder\="Instant search!"
|
|
452
|
-
popoverProps\={{
|
|
453
|
-
container: document.body
|
|
454
|
-
}}
|
|
455
|
-
/>
|
|
456
|
-
|
|
457
|
-
Copy
|
|
458
|
-
|
|
459
|
-
### [](#result-limits)Result limits
|
|
460
|
-
|
|
461
|
-
You can limit the maximum amount of search results displayed in the suggestions by setting the `limitDesktop` prop. This defaults to 12.
|
|
462
|
-
|
|
463
|
-
On smaller screens (< 768px), the number of options is further reduced by using the `limitMobile` prop, which defaults to 6.
|
|
464
|
-
|
|
465
|
-
`limitMobile` works by filtering the search results that have been filtered by `limitDesktop`, so must be a smaller value. For example:
|
|
466
|
-
|
|
467
|
-
\[data-radix-scroll-area-viewport\] {
|
|
468
|
-
scrollbar-width: none;
|
|
469
|
-
-ms-overflow-style: none;
|
|
470
|
-
-webkit-overflow-scrolling: touch;
|
|
471
|
-
}
|
|
472
|
-
\[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
|
|
473
|
-
display: none;
|
|
474
|
-
}
|
|
475
|
-
:where(\[data-radix-scroll-area-viewport\]) {
|
|
476
|
-
display: flex;
|
|
477
|
-
flex-direction: column;
|
|
478
|
-
align-items: stretch;
|
|
479
|
-
}
|
|
480
|
-
:where(\[data-radix-scroll-area-content\]) {
|
|
481
|
-
flex-grow: 1;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
// 12 results on large screens, 6 on small screens (default values)
|
|
485
|
-
<IressAutocomplete options\={...} />
|
|
486
|
-
// 4 results on large screens, 3 on small screens
|
|
487
|
-
<IressAutocomplete resultLimitDesktop\={4} resultLimitMobile\={3} options\={...} />
|
|
488
|
-
// 4 results on all screens (resultLimitMobile > resultLimitDesktop so has no effect)
|
|
489
|
-
<IressAutocomplete resultLimitDesktop\={4} resultLimitMobile\={5} options\={...} />
|
|
490
|
-
|
|
491
|
-
Copy
|
|
492
|
-
|
|
493
|
-
The result limits will also affect the number of initial options displayed, if the `initialOptions` prop is set.
|
|
494
|
-
|
|
495
|
-
**xl** breakpoint (1200px - 1499px)
|
|
496
|
-
|
|
497
|
-
Hide code
|
|
498
|
-
|
|
499
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
500
|
-
|
|
501
|
-
<IressStack gutter\="md"\>
|
|
502
|
-
<IressPanel className\="iress-u-text"\>
|
|
503
|
-
<CurrentBreakpoint />
|
|
504
|
-
</IressPanel\>
|
|
505
|
-
<IressAutocomplete
|
|
506
|
-
limitDesktop\={6}
|
|
507
|
-
limitMobile\={3}
|
|
508
|
-
options\={\[
|
|
509
|
-
{
|
|
510
|
-
label: 'Option 1'
|
|
511
|
-
},
|
|
512
|
-
{
|
|
513
|
-
label: 'Option 2'
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
label: 'Option 3'
|
|
517
|
-
},
|
|
518
|
-
{
|
|
519
|
-
label: 'Option 4'
|
|
520
|
-
},
|
|
521
|
-
{
|
|
522
|
-
label: 'Option 5'
|
|
523
|
-
},
|
|
524
|
-
{
|
|
525
|
-
label: 'Option 6'
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
label: 'Option 7'
|
|
529
|
-
},
|
|
530
|
-
{
|
|
531
|
-
label: 'Option 8'
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
label: 'Option 9'
|
|
535
|
-
},
|
|
536
|
-
{
|
|
537
|
-
label: 'Option 10'
|
|
538
|
-
},
|
|
539
|
-
{
|
|
540
|
-
label: 'Option 11'
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
label: 'Option 12'
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
label: 'Option 13'
|
|
547
|
-
},
|
|
548
|
-
{
|
|
549
|
-
label: 'Option 14'
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
label: 'Option 15'
|
|
553
|
-
}
|
|
554
|
-
\]}
|
|
555
|
-
popoverProps\={{
|
|
556
|
-
container: document.body
|
|
557
|
-
}}
|
|
558
|
-
/>
|
|
559
|
-
</IressStack\>
|
|
560
|
-
|
|
561
|
-
Copy
|
|
562
|
-
|
|
563
|
-
### [](#readonly)Readonly
|
|
564
|
-
|
|
565
|
-
The `readonly` prop can be set to `true` to prevent the user from changing the value of the autocomplete. This will change the input to a custom read-only style and the user will not be able to interact with the input.
|
|
566
|
-
|
|
567
|
-
If you need more control over the read-only state (for example, rendering a stylised version of the value), you can use the [`IressReadonly` component](?path=/docs/components-readonly--docs).
|
|
568
|
-
|
|
569
|
-
Option 1
|
|
570
|
-
|
|
571
|
-
Hide code
|
|
572
|
-
|
|
573
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
574
|
-
|
|
575
|
-
<IressAutocomplete
|
|
576
|
-
defaultValue\="Option 1"
|
|
577
|
-
options\={\[
|
|
578
|
-
{
|
|
579
|
-
label: 'Option 1'
|
|
580
|
-
},
|
|
581
|
-
{
|
|
582
|
-
label: 'Option 2'
|
|
583
|
-
},
|
|
584
|
-
{
|
|
585
|
-
label: 'Option 3'
|
|
586
|
-
},
|
|
587
|
-
{
|
|
588
|
-
label: 'Option 4'
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
label: 'Option 5'
|
|
592
|
-
}
|
|
593
|
-
\]}
|
|
594
|
-
popoverProps\={{
|
|
595
|
-
container: {}
|
|
596
|
-
}}
|
|
597
|
-
readOnly
|
|
598
|
-
/>
|
|
599
|
-
|
|
600
|
-
Copy
|
|
601
|
-
|
|
602
|
-
[](#testing)Testing
|
|
603
|
-
-------------------
|
|
604
|
-
|
|
605
|
-
To help you effectively test the autocomplete component, we have provided a few tips based on the behaviour of the component and our own experience.
|
|
606
|
-
|
|
607
|
-
**Note:** These are suggestions and not requirements. You should test the component in a way that best suits your use case.
|
|
608
|
-
|
|
609
|
-
### [](#partial-query-matching)Partial query matching
|
|
610
|
-
|
|
611
|
-
The suggestions are filtered based on the input value. If the input value only matches a part of the option, the input value is highlighted by a `<b />` tag in each option. You will need to account for this in your tests, either using an exact string match with a space to denote the highlighted value, or using a regex to match the string.
|
|
612
|
-
|
|
613
|
-
If you are using `meta`, `prepend` or `append` props in `LabelValueMeta`, you should also consider this in your search query for the option.
|
|
614
|
-
|
|
615
|
-
\[data-radix-scroll-area-viewport\] {
|
|
616
|
-
scrollbar-width: none;
|
|
617
|
-
-ms-overflow-style: none;
|
|
618
|
-
-webkit-overflow-scrolling: touch;
|
|
619
|
-
}
|
|
620
|
-
\[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
|
|
621
|
-
display: none;
|
|
622
|
-
}
|
|
623
|
-
:where(\[data-radix-scroll-area-viewport\]) {
|
|
624
|
-
display: flex;
|
|
625
|
-
flex-direction: column;
|
|
626
|
-
align-items: stretch;
|
|
627
|
-
}
|
|
628
|
-
:where(\[data-radix-scroll-area-content\]) {
|
|
629
|
-
flex-grow: 1;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
render(
|
|
633
|
-
<IressAutocomplete
|
|
634
|
-
options\={\[
|
|
635
|
-
{ label: 'Luke Skywalker', value: 'Luke Skywalker', meta: 'male' },
|
|
636
|
-
\]}
|
|
637
|
-
/>,
|
|
638
|
-
);
|
|
639
|
-
const autocomplete \= screen.getByRole('combobox');
|
|
640
|
-
await user.type(autocomplete, 'lu');
|
|
641
|
-
// Exact string match with a space to denote the highlighted value
|
|
642
|
-
const option \= await screen.findByRole('option', {
|
|
643
|
-
name: 'Lu ke Skywalker male',
|
|
644
|
-
});
|
|
645
|
-
expect(option).toBeInTheDocument();
|
|
646
|
-
// Using a regex to match the string
|
|
647
|
-
const option \= await screen.findByRole('option', { name: /Skywalker/ });
|
|
648
|
-
expect(option).toBeInTheDocument();
|
|
649
|
-
|
|
650
|
-
Copy
|
|
651
|
-
|
|
652
|
-
### [](#query-for-minimal-characters)Query for minimal characters
|
|
653
|
-
|
|
654
|
-
If you are testing if a specific option appears in the autocomplete that returns asynchronous `options`, it is recommended to use the shortest possible query to return the desired result. The longer the query, the longer it will take to see the results.
|
|
655
|
-
|
|
656
|
-
\[data-radix-scroll-area-viewport\] {
|
|
657
|
-
scrollbar-width: none;
|
|
658
|
-
-ms-overflow-style: none;
|
|
659
|
-
-webkit-overflow-scrolling: touch;
|
|
660
|
-
}
|
|
661
|
-
\[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
|
|
662
|
-
display: none;
|
|
663
|
-
}
|
|
664
|
-
:where(\[data-radix-scroll-area-viewport\]) {
|
|
665
|
-
display: flex;
|
|
666
|
-
flex-direction: column;
|
|
667
|
-
align-items: stretch;
|
|
668
|
-
}
|
|
669
|
-
:where(\[data-radix-scroll-area-content\]) {
|
|
670
|
-
flex-grow: 1;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
render(<IressAutocomplete options\={searchStarWarsCharacters} />);
|
|
674
|
-
const autocomplete \= screen.getByRole('combobox');
|
|
675
|
-
// DO: Use the shortest query to return the desired result
|
|
676
|
-
await user.type(autocomplete, 'lu');
|
|
677
|
-
const option \= await screen.findAllByRole('option');
|
|
678
|
-
// DON'T: Use a long query to return the desired result
|
|
679
|
-
await user.type(autocomplete, 'luke skywalker');
|
|
680
|
-
const option \= await screen.findAllByRole('option');
|
|
681
|
-
|
|
682
|
-
Copy
|
|
683
|
-
|
|
684
|
-
### [](#use-mocking-when-testing-apis)Use mocking when testing APIs
|
|
685
|
-
|
|
686
|
-
When testing the autocomplete component with asynchronous `options`, you should mock the API call to return a known set of results, rather than rely on a public prototyping API (eg. [https://swapi.py4e.com/](https://swapi.py4e.com/)). This will allow you to test the component in isolation without relying on the API to return the expected results, as well as reduce chance of flakiness due to timeouts in your tests.
|
|
687
|
-
|
|
688
|
-
We recommend using [Mock Service Worker](https://mswjs.io/) to mock the API calls in your tests.
|
|
689
|
-
|
|
690
|
-
\[data-radix-scroll-area-viewport\] {
|
|
691
|
-
scrollbar-width: none;
|
|
692
|
-
-ms-overflow-style: none;
|
|
693
|
-
-webkit-overflow-scrolling: touch;
|
|
694
|
-
}
|
|
695
|
-
\[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
|
|
696
|
-
display: none;
|
|
697
|
-
}
|
|
698
|
-
:where(\[data-radix-scroll-area-viewport\]) {
|
|
699
|
-
display: flex;
|
|
700
|
-
flex-direction: column;
|
|
701
|
-
align-items: stretch;
|
|
702
|
-
}
|
|
703
|
-
:where(\[data-radix-scroll-area-content\]) {
|
|
704
|
-
flex-grow: 1;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
// src/mocks/handlers.ts
|
|
708
|
-
import { http, HttpResponse } from 'msw';
|
|
709
|
-
export const handlers \= \[
|
|
710
|
-
// Intercept "GET https://swapi.py4e.com/api/people" requests...
|
|
711
|
-
http.get('https://swapi.py4e.com/api/people', () \=> {
|
|
712
|
-
// ...and respond to them using this JSON response.
|
|
713
|
-
return HttpResponse.json(\[
|
|
714
|
-
{ name: 'Luke Skywalker', gender: 'male' },
|
|
715
|
-
{ name: 'Leia Skywalker', gender: 'female' },
|
|
716
|
-
\]);
|
|
717
|
-
}),
|
|
718
|
-
\];
|
|
719
|
-
// src/mocks/node.js
|
|
720
|
-
import { setupServer } from 'msw/node';
|
|
721
|
-
import { handlers } from './handlers';
|
|
722
|
-
export const server \= setupServer(...handlers);
|
|
723
|
-
// src/CustomAutocomplete.test.tsx
|
|
724
|
-
import { server } from './mocks/node';
|
|
725
|
-
server.listen();
|
|
726
|
-
render(<IressAutocomplete options\={searchStarWarsCharacters} />);
|
|
727
|
-
const autocomplete \= screen.getByRole('combobox');
|
|
728
|
-
await user.type(autocomplete, 'lu');
|
|
729
|
-
const option \= await screen.findAllByRole('option');
|
|
730
|
-
|
|
731
|
-
Copy
|
|
732
|
-
|
|
733
|
-
On this page
|
|
734
|
-
|
|
735
|
-
* [Overview](#overview)
|
|
736
|
-
* [Props](#props)
|
|
737
|
-
* [Usage](#usage)
|
|
738
|
-
* [Uncontrolled](#uncontrolled)
|
|
739
|
-
* [Controlled](#controlled)
|
|
740
|
-
* [Providing suggestions](#providing-suggestions)
|
|
741
|
-
* [Behaviour](#behaviour)
|
|
742
|
-
* [Accessibility](#accessibility)
|
|
743
|
-
* [Examples](#examples)
|
|
744
|
-
* [autoSelect](#autoselect)
|
|
745
|
-
* [Input props](#input-props)
|
|
746
|
-
* [No results](#no-results)
|
|
747
|
-
* [Popover props](#popover-props)
|
|
748
|
-
* [Debounce threshold](#debounce-threshold)
|
|
749
|
-
* [Result limits](#result-limits)
|
|
750
|
-
* [Readonly](#readonly)
|
|
751
|
-
* [Testing](#testing)
|
|
752
|
-
* [Partial query matching](#partial-query-matching)
|
|
753
|
-
* [Query for minimal characters](#query-for-minimal-characters)
|
|
754
|
-
* [Use mocking when testing APIs](#use-mocking-when-testing-apis)
|