@iress-oss/ids-mcp-server 5.14.2 → 5.20.1

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.
Files changed (132) hide show
  1. package/generated/docs/components_components-alert-docs.md +492 -0
  2. package/generated/docs/components_components-autocomplete-docs.md +3485 -0
  3. package/generated/docs/{components-autocomplete-recipes-docs.md → components_components-autocomplete-recipes-docs.md} +32 -14
  4. package/generated/docs/{components-badge-docs.md → components_components-badge-docs.md} +222 -30
  5. package/generated/docs/components_components-button-docs.md +2078 -0
  6. package/generated/docs/components_components-button-recipes-docs.md +37 -0
  7. package/generated/docs/components_components-buttongroup-docs.md +1045 -0
  8. package/generated/docs/components_components-card-docs.md +2276 -0
  9. package/generated/docs/{components-card-recipes-docs.md → components_components-card-recipes-docs.md} +131 -14
  10. package/generated/docs/components_components-checkbox-docs.md +1054 -0
  11. package/generated/docs/{components-checkboxgroup-docs.md → components_components-checkboxgroup-docs.md} +1000 -81
  12. package/generated/docs/{components-checkboxgroup-recipes-docs.md → components_components-checkboxgroup-recipes-docs.md} +101 -11
  13. package/generated/docs/{components-col-docs.md → components_components-col-docs.md} +331 -58
  14. package/generated/docs/components_components-combobox-docs.md +3767 -0
  15. package/generated/docs/{components-container-docs.md → components_components-container-docs.md} +61 -24
  16. package/generated/docs/{components-divider-docs.md → components_components-divider-docs.md} +83 -24
  17. package/generated/docs/{components-expander-docs.md → components_components-expander-docs.md} +264 -33
  18. package/generated/docs/{components-field-docs.md → components_components-field-docs.md} +814 -120
  19. package/generated/docs/components_components-filter-docs.md +4080 -0
  20. package/generated/docs/{components-form-docs.md → components_components-form-docs.md} +1488 -358
  21. package/generated/docs/{components-form-recipes-docs.md → components_components-form-recipes-docs.md} +174 -64
  22. package/generated/docs/components_components-hide-docs.md +293 -0
  23. package/generated/docs/components_components-icon-docs.md +1337 -0
  24. package/generated/docs/{components-inline-docs.md → components_components-inline-docs.md} +462 -42
  25. package/generated/docs/components_components-input-docs.md +1468 -0
  26. package/generated/docs/components_components-input-recipes-docs.md +367 -0
  27. package/generated/docs/components_components-inputcurrency-docs.md +432 -0
  28. package/generated/docs/{components-inputcurrency-recipes-docs.md → components_components-inputcurrency-recipes-docs.md} +110 -17
  29. package/generated/docs/components_components-label-docs.md +323 -0
  30. package/generated/docs/components_components-menu-docs.md +2345 -0
  31. package/generated/docs/components_components-menu-menuitem-docs.md +633 -0
  32. package/generated/docs/{components-modal-docs.md → components_components-modal-docs.md} +1625 -232
  33. package/generated/docs/components_components-navbar-docs.md +1847 -0
  34. package/generated/docs/{components-navbar-recipes-docs.md → components_components-navbar-recipes-docs.md} +697 -39
  35. package/generated/docs/{components-panel-docs.md → components_components-panel-docs.md} +754 -57
  36. package/generated/docs/components_components-placeholder-docs.md +92 -0
  37. package/generated/docs/components_components-popover-docs.md +1641 -0
  38. package/generated/docs/{components-popover-recipes-docs.md → components_components-popover-recipes-docs.md} +347 -17
  39. package/generated/docs/components_components-progress-docs.md +115 -0
  40. package/generated/docs/components_components-provider-docs.md +114 -0
  41. package/generated/docs/components_components-radio-docs.md +491 -0
  42. package/generated/docs/{components-radiogroup-docs.md → components_components-radiogroup-docs.md} +943 -75
  43. package/generated/docs/components_components-readonly-docs.md +263 -0
  44. package/generated/docs/components_components-richselect-docs.md +6497 -0
  45. package/generated/docs/{components-row-docs.md → components_components-row-docs.md} +353 -43
  46. package/generated/docs/{components-select-docs.md → components_components-select-docs.md} +719 -61
  47. package/generated/docs/components_components-skeleton-docs.md +480 -0
  48. package/generated/docs/{components-skeleton-recipes-docs.md → components_components-skeleton-recipes-docs.md} +50 -10
  49. package/generated/docs/{components-skiplink-docs.md → components_components-skiplink-docs.md} +53 -14
  50. package/generated/docs/components_components-slideout-docs.md +2262 -0
  51. package/generated/docs/components_components-slider-docs.md +1276 -0
  52. package/generated/docs/components_components-spinner-docs.md +82 -0
  53. package/generated/docs/{components-stack-docs.md → components_components-stack-docs.md} +223 -40
  54. package/generated/docs/components_components-table-docs.md +3651 -0
  55. package/generated/docs/components_components-tabset-docs.md +772 -0
  56. package/generated/docs/components_components-tabset-tab-docs.md +262 -0
  57. package/generated/docs/components_components-tag-docs.md +259 -0
  58. package/generated/docs/{components-text-docs.md → components_components-text-docs.md} +491 -51
  59. package/generated/docs/{components-toaster-docs.md → components_components-toaster-docs.md} +224 -71
  60. package/generated/docs/components_components-toaster-toast-docs.md +634 -0
  61. package/generated/docs/components_components-toggle-docs.md +461 -0
  62. package/generated/docs/{components-tooltip-docs.md → components_components-tooltip-docs.md} +286 -41
  63. package/generated/docs/{components-validationmessage-docs.md → components_components-validationmessage-docs.md} +230 -61
  64. package/generated/docs/components_contact-us-docs.md +12 -0
  65. package/generated/docs/{foundations-accessibility-docs.md → components_foundations-accessibility-docs.md} +11 -21
  66. package/generated/docs/{foundations-colours-docs.md → components_foundations-colour-030-colours.md} +8 -15
  67. package/generated/docs/{foundations-consistency-docs.md → components_foundations-consistency-docs.md} +12 -20
  68. package/generated/docs/{foundations-content-docs.md → components_foundations-content-docs.md} +6 -11
  69. package/generated/docs/components_foundations-introduction-docs.md +15 -0
  70. package/generated/docs/{foundations-principles-docs.md → components_foundations-principles-docs.md} +14 -24
  71. package/generated/docs/components_foundations-typography-docs.md +608 -0
  72. package/generated/docs/{foundations-user-experience-docs.md → components_foundations-user-experience-docs.md} +16 -26
  73. package/generated/docs/{foundations-visual-design-docs.md → components_foundations-visual-design-docs.md} +10 -17
  74. package/generated/docs/{frequently-asked-questions-docs.md → components_frequently-asked-questions-docs.md} +14 -23
  75. package/generated/docs/components_get-started-develop-docs.md +84 -0
  76. package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
  77. package/generated/docs/components_introduction-docs.md +15 -0
  78. package/generated/docs/{patterns-loading-docs.md → components_patterns-loading-docs.md} +711 -143
  79. package/generated/docs/components_resources-changelog-docs.md +4 -0
  80. package/generated/docs/{resources-code-katas-docs.md → components_resources-code-katas-docs.md} +5 -9
  81. package/generated/docs/{resources-migration-guides-from-v4-to-v5-docs.md → components_resources-migration-guides-from-v4-to-v5-docs.md} +54 -239
  82. package/generated/docs/{versions-docs.md → components_versions-docs.md} +5 -8
  83. package/generated/docs/guidelines.md +484 -200
  84. package/generated/docs/introduction-docs.md +19 -30
  85. package/package.json +41 -45
  86. package/generated/docs/components-alert-docs.md +0 -130
  87. package/generated/docs/components-autocomplete-docs.md +0 -754
  88. package/generated/docs/components-button-docs.md +0 -362
  89. package/generated/docs/components-button-recipes-docs.md +0 -76
  90. package/generated/docs/components-buttongroup-docs.md +0 -310
  91. package/generated/docs/components-card-docs.md +0 -494
  92. package/generated/docs/components-checkbox-docs.md +0 -193
  93. package/generated/docs/components-combobox-docs.md +0 -1016
  94. package/generated/docs/components-filter-docs.md +0 -1109
  95. package/generated/docs/components-hide-docs.md +0 -265
  96. package/generated/docs/components-icon-docs.md +0 -553
  97. package/generated/docs/components-input-docs.md +0 -335
  98. package/generated/docs/components-input-recipes-docs.md +0 -140
  99. package/generated/docs/components-inputcurrency-docs.md +0 -157
  100. package/generated/docs/components-label-docs.md +0 -135
  101. package/generated/docs/components-menu-docs.md +0 -704
  102. package/generated/docs/components-menu-menuitem-docs.md +0 -193
  103. package/generated/docs/components-navbar-docs.md +0 -291
  104. package/generated/docs/components-placeholder-docs.md +0 -27
  105. package/generated/docs/components-popover-docs.md +0 -464
  106. package/generated/docs/components-progress-docs.md +0 -104
  107. package/generated/docs/components-radio-docs.md +0 -107
  108. package/generated/docs/components-readonly-docs.md +0 -89
  109. package/generated/docs/components-richselect-docs.md +0 -2433
  110. package/generated/docs/components-skeleton-docs.md +0 -214
  111. package/generated/docs/components-slideout-docs.md +0 -538
  112. package/generated/docs/components-slider-docs.md +0 -346
  113. package/generated/docs/components-spinner-docs.md +0 -59
  114. package/generated/docs/components-table-ag-grid-docs.md +0 -2666
  115. package/generated/docs/components-table-docs.md +0 -1305
  116. package/generated/docs/components-tabset-docs.md +0 -341
  117. package/generated/docs/components-tabset-tab-docs.md +0 -86
  118. package/generated/docs/components-tag-docs.md +0 -115
  119. package/generated/docs/components-toaster-toast-docs.md +0 -157
  120. package/generated/docs/components-toggle-docs.md +0 -158
  121. package/generated/docs/contact-us-docs.md +0 -27
  122. package/generated/docs/extensions-editor-docs.md +0 -288
  123. package/generated/docs/extensions-editor-recipes-docs.md +0 -39
  124. package/generated/docs/foundations-introduction-docs.md +0 -17
  125. package/generated/docs/foundations-typography-docs.md +0 -191
  126. package/generated/docs/get-started-develop-docs.md +0 -48
  127. package/generated/docs/get-started-using-storybook-docs.md +0 -68
  128. package/generated/docs/resources-changelog-docs.md +0 -6
  129. package/generated/docs/themes-available-themes-docs.md +0 -66
  130. package/generated/docs/themes-introduction-docs.md +0 -121
  131. package/generated/docs/themes-tokens-docs.md +0 -1200
  132. /package/{LICENSE.txt → LICENSE} +0 -0
@@ -0,0 +1,3767 @@
1
+ Combobox
2
+ ========
3
+
4
+ Overview
5
+ --------
6
+
7
+ Comboboxes provide select and multi-select functionality with the benefit of live filtering.
8
+
9
+ * * *
10
+
11
+ Caution
12
+
13
+ **Use IressRichSelect instead**
14
+
15
+ The design of this component is changing. Please use the new component/props instead.
16
+
17
+ [](./iframe.html?id=components-combobox--default)
18
+
19
+ None selected
20
+
21
+ ```
22
+
23
+ <IressCombobox
24
+ options\={\[
25
+ {
26
+ label: 'Option 1',
27
+ value: 1
28
+ },
29
+ {
30
+ label: 'Option 2',
31
+ value: 2
32
+ },
33
+ {
34
+ label: 'Option 3',
35
+ value: 3
36
+ },
37
+ {
38
+ label: 'Option 4',
39
+ value: 4
40
+ },
41
+ {
42
+ label: 'Option 5',
43
+ value: 5
44
+ }
45
+ \]}
46
+ popoverProps\={{
47
+ container: {}
48
+ }}
49
+ />
50
+
51
+ ```
52
+
53
+ Props
54
+ -----
55
+
56
+ | Name | Description | Default | Control |
57
+ | --- | --- | --- | --- |
58
+ | append |
59
+ |
60
+
61
+ <IressIcon />
62
+
63
+
64
+
65
+ | Set object |
66
+ | autoComplete |
67
+
68
+ |
69
+
70
+ 'off'
71
+
72
+ | Set object |
73
+ | autoSelect |
74
+
75
+ |
76
+
77
+ true
78
+
79
+ | Set object |
80
+ | clearable |
81
+
82
+ |
83
+
84
+ true
85
+
86
+ | Set object |
87
+ | defaultValue |
88
+
89
+ Value of selected option for uncontrolled combobox.
90
+
91
+ LabelValueMeta
92
+
93
+
94
+
95
+ | \- | Set object |
96
+ | hiddenInputProps |
97
+
98
+ Add additional props to the hidden input.
99
+
100
+ Omit
101
+
102
+
103
+
104
+ | \- | Set object |
105
+ | limitDesktop |
106
+
107
+ |
108
+
109
+ 12
110
+
111
+ | Set object |
112
+ | limitMobile |
113
+
114
+ |
115
+
116
+ 6
117
+
118
+ | Set object |
119
+ | onChange |
120
+
121
+ Emitted when the value changes.
122
+
123
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
124
+
125
+ | \- | \- |
126
+ | options\* |
127
+
128
+ Options data set, the available options that the user can select from.
129
+
130
+ union
131
+
132
+
133
+
134
+ | \- |
135
+
136
+ RAW
137
+
138
+ * options :
139
+
140
+ \[
141
+
142
+ * 0 :
143
+
144
+ {...} 2 keys
145
+
146
+ * 1 :
147
+
148
+ {...} 2 keys
149
+
150
+ * 2 :
151
+
152
+ {...} 2 keys
153
+
154
+ * 3 :
155
+
156
+ {...} 2 keys
157
+
158
+ * 4 :
159
+
160
+ {...} 2 keys
161
+
162
+
163
+ \]
164
+
165
+
166
+
167
+
168
+ |
169
+ | popoverProps |
170
+
171
+ object
172
+
173
+
174
+
175
+ | { } |
176
+
177
+ RAW
178
+
179
+ popoverProps :
180
+
181
+ {
182
+
183
+ }
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+ |
192
+ | value |
193
+
194
+ Value of selected option for controlled combobox.
195
+
196
+ LabelValueMeta
197
+
198
+
199
+
200
+ | \- | Set object |
201
+ | watermark |
202
+
203
+ |
204
+
205
+ true
206
+
207
+ | Set object |
208
+
209
+ Usage
210
+ -----
211
+
212
+ `IressCombobox` is an alternative to `IressSelect` when you have a large number of options and want to provide a search functionality to help the user find the option they are looking for.
213
+
214
+ It extends `IressAutocomplete`, however it restricts the input to the options provided. This means that the user can only select from the options provided. If you do not need this restriction, please use `IressAutocomplete`.
215
+
216
+ ### Uncontrolled
217
+
218
+ The `defaultValue` prop can be used to set the initial value of the combobox. The value will be managed by the component.
219
+
220
+ **Note:** The `defaultValue` prop is not checked against the options provided, allowing it to work with asynchronous options.
221
+
222
+ [](./iframe.html?id=components-combobox--uncontrolled)
223
+
224
+ ×Clear
225
+
226
+ None selected
227
+
228
+ ```
229
+
230
+ <IressCombobox
231
+ defaultValue\={{
232
+ label: 'Option 1',
233
+ value: 1
234
+ }}
235
+ options\={\[
236
+ {
237
+ label: 'Option 1',
238
+ value: 1
239
+ },
240
+ {
241
+ label: 'Option 2',
242
+ value: 2
243
+ },
244
+ {
245
+ label: 'Option 3',
246
+ value: 3
247
+ },
248
+ {
249
+ label: 'Option 4',
250
+ value: 4
251
+ },
252
+ {
253
+ label: 'Option 5',
254
+ value: 5
255
+ }
256
+ \]}
257
+ popoverProps\={{
258
+ container: {}
259
+ }}
260
+ />
261
+
262
+ ```
263
+
264
+ #### Props
265
+
266
+ | Name | Description | Default | Control |
267
+ | --- | --- | --- | --- |
268
+ | append |
269
+ |
270
+
271
+ <IressIcon />
272
+
273
+
274
+
275
+ | Set object |
276
+ | autoComplete |
277
+
278
+ |
279
+
280
+ 'off'
281
+
282
+ | Set object |
283
+ | autoSelect |
284
+
285
+ |
286
+
287
+ true
288
+
289
+ | Set object |
290
+ | clearable |
291
+
292
+ |
293
+
294
+ true
295
+
296
+ | Set object |
297
+ | defaultValue |
298
+
299
+ Value of selected option for uncontrolled combobox.
300
+
301
+ LabelValueMeta
302
+
303
+
304
+
305
+ | \- |
306
+
307
+ RAW
308
+
309
+ defaultValue :
310
+
311
+ {
312
+
313
+ * label : "Option 1"
314
+ * value : 1
315
+
316
+ }
317
+
318
+
319
+
320
+
321
+
322
+
323
+
324
+ |
325
+ | hiddenInputProps |
326
+
327
+ Add additional props to the hidden input.
328
+
329
+ Omit
330
+
331
+
332
+
333
+ | \- | Set object |
334
+ | limitDesktop |
335
+
336
+ |
337
+
338
+ 12
339
+
340
+ | Set object |
341
+ | limitMobile |
342
+
343
+ |
344
+
345
+ 6
346
+
347
+ | Set object |
348
+ | onChange |
349
+
350
+ Emitted when the value changes.
351
+
352
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
353
+
354
+ | \- | \- |
355
+ | options\* |
356
+
357
+ Options data set, the available options that the user can select from.
358
+
359
+ union
360
+
361
+
362
+
363
+ | \- |
364
+
365
+ RAW
366
+
367
+ * options :
368
+
369
+ \[
370
+
371
+ * 0 :
372
+
373
+ {...} 2 keys
374
+
375
+ * 1 :
376
+
377
+ {...} 2 keys
378
+
379
+ * 2 :
380
+
381
+ {...} 2 keys
382
+
383
+ * 3 :
384
+
385
+ {...} 2 keys
386
+
387
+ * 4 :
388
+
389
+ {...} 2 keys
390
+
391
+
392
+ \]
393
+
394
+
395
+
396
+
397
+ |
398
+ | popoverProps |
399
+
400
+ object
401
+
402
+
403
+
404
+ | { } |
405
+
406
+ RAW
407
+
408
+ popoverProps :
409
+
410
+ {
411
+
412
+ }
413
+
414
+
415
+
416
+
417
+
418
+
419
+
420
+ |
421
+ | value |
422
+
423
+ Value of selected option for controlled combobox.
424
+
425
+ LabelValueMeta
426
+
427
+
428
+
429
+ | \- | Set object |
430
+ | watermark |
431
+
432
+ |
433
+
434
+ true
435
+
436
+ | Set object |
437
+
438
+ ### Controlled
439
+
440
+ 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.
441
+
442
+ **Note:** The `value` prop is not checked against the options provided, allowing it to work with asynchronous options.
443
+
444
+ [](./iframe.html?id=components-combobox--controlled)
445
+
446
+ None selected
447
+
448
+ ```
449
+
450
+ import {
451
+ IressCombobox,
452
+ type IressComboboxProps,
453
+ type LabelValueMeta,
454
+ } from '@iress-oss/ids-components';
455
+ import { useState } from 'react';
456
+ export const ComboboxUsingState \= () \=> {
457
+ const \[value, setValue\] \= useState<LabelValueMeta | undefined\>();
458
+ return (
459
+ <IressCombobox
460
+ {...{
461
+ popoverProps: {
462
+ container: {},
463
+ },
464
+ options: \[
465
+ {
466
+ label: 'Option 1',
467
+ value: 1,
468
+ },
469
+ {
470
+ label: 'Option 2',
471
+ value: 2,
472
+ },
473
+ {
474
+ label: 'Option 3',
475
+ value: 3,
476
+ },
477
+ {
478
+ label: 'Option 4',
479
+ value: 4,
480
+ },
481
+ {
482
+ label: 'Option 5',
483
+ value: 5,
484
+ },
485
+ \],
486
+ }}
487
+ onChange\={(\_e, newValue) \=> setValue(newValue)}
488
+ onClear\={() \=> setValue(undefined)}
489
+ value\={value}
490
+ />
491
+ );
492
+ };
493
+
494
+ ```
495
+
496
+ #### Props
497
+
498
+ | Name | Description | Default | Control |
499
+ | --- | --- | --- | --- |
500
+ | append |
501
+ |
502
+
503
+ <IressIcon />
504
+
505
+
506
+
507
+ | Set object |
508
+ | autoComplete |
509
+
510
+ |
511
+
512
+ 'off'
513
+
514
+ | Set object |
515
+ | autoSelect |
516
+
517
+ |
518
+
519
+ true
520
+
521
+ | Set object |
522
+ | clearable |
523
+
524
+ |
525
+
526
+ true
527
+
528
+ | Set object |
529
+ | defaultValue |
530
+
531
+ Value of selected option for uncontrolled combobox.
532
+
533
+ LabelValueMeta
534
+
535
+
536
+
537
+ | \- | \- |
538
+ | hiddenInputProps |
539
+
540
+ Add additional props to the hidden input.
541
+
542
+ Omit
543
+
544
+
545
+
546
+ | \- | Set object |
547
+ | limitDesktop |
548
+
549
+ |
550
+
551
+ 12
552
+
553
+ | Set object |
554
+ | limitMobile |
555
+
556
+ |
557
+
558
+ 6
559
+
560
+ | Set object |
561
+ | onChange |
562
+
563
+ Emitted when the value changes.
564
+
565
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
566
+
567
+ | \- | \- |
568
+ | options\* |
569
+
570
+ Options data set, the available options that the user can select from.
571
+
572
+ union
573
+
574
+
575
+
576
+ | \- |
577
+
578
+ RAW
579
+
580
+ * options :
581
+
582
+ \[
583
+
584
+ * 0 :
585
+
586
+ {...} 2 keys
587
+
588
+ * 1 :
589
+
590
+ {...} 2 keys
591
+
592
+ * 2 :
593
+
594
+ {...} 2 keys
595
+
596
+ * 3 :
597
+
598
+ {...} 2 keys
599
+
600
+ * 4 :
601
+
602
+ {...} 2 keys
603
+
604
+
605
+ \]
606
+
607
+
608
+
609
+
610
+ |
611
+ | popoverProps |
612
+
613
+ object
614
+
615
+
616
+
617
+ | { } |
618
+
619
+ RAW
620
+
621
+ popoverProps :
622
+
623
+ {
624
+
625
+ }
626
+
627
+
628
+
629
+
630
+
631
+
632
+
633
+ |
634
+ | value |
635
+
636
+ Value of selected option for controlled combobox.
637
+
638
+ LabelValueMeta
639
+
640
+
641
+
642
+ | \- | \- |
643
+ | watermark |
644
+
645
+ |
646
+
647
+ true
648
+
649
+ | Set object |
650
+
651
+ ### Providing options
652
+
653
+ #### `options`
654
+
655
+ The `options` prop is required for the combobox. You can provide an array of `LabelValueMeta[]` objects to the `options` prop. Filtering is done based on the `label` property.
656
+
657
+ [](./iframe.html?id=components-combobox--options)
658
+
659
+ None selected
660
+
661
+ ```
662
+
663
+ <IressCombobox
664
+ options\={\[
665
+ {
666
+ label: 'Option 1',
667
+ value: 1
668
+ },
669
+ {
670
+ label: 'Option 2',
671
+ value: 2
672
+ },
673
+ {
674
+ label: 'Option 3',
675
+ value: 3
676
+ },
677
+ {
678
+ label: 'Option 4',
679
+ value: 4
680
+ },
681
+ {
682
+ label: 'Option 5',
683
+ value: 5
684
+ }
685
+ \]}
686
+ popoverProps\={{
687
+ container: {}
688
+ }}
689
+ />
690
+
691
+ ```
692
+
693
+ #### Props
694
+
695
+ | Name | Description | Default | Control |
696
+ | --- | --- | --- | --- |
697
+ | append |
698
+ |
699
+
700
+ <IressIcon />
701
+
702
+
703
+
704
+ | Set object |
705
+ | autoComplete |
706
+
707
+ |
708
+
709
+ 'off'
710
+
711
+ | Set object |
712
+ | autoSelect |
713
+
714
+ |
715
+
716
+ true
717
+
718
+ | Set object |
719
+ | clearable |
720
+
721
+ |
722
+
723
+ true
724
+
725
+ | Set object |
726
+ | defaultValue |
727
+
728
+ Value of selected option for uncontrolled combobox.
729
+
730
+ LabelValueMeta
731
+
732
+
733
+
734
+ | \- | Set object |
735
+ | hiddenInputProps |
736
+
737
+ Add additional props to the hidden input.
738
+
739
+ Omit
740
+
741
+
742
+
743
+ | \- | Set object |
744
+ | limitDesktop |
745
+
746
+ |
747
+
748
+ 12
749
+
750
+ | Set object |
751
+ | limitMobile |
752
+
753
+ |
754
+
755
+ 6
756
+
757
+ | Set object |
758
+ | onChange |
759
+
760
+ Emitted when the value changes.
761
+
762
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
763
+
764
+ | \- | \- |
765
+ | options\* |
766
+
767
+ Options data set, the available options that the user can select from.
768
+
769
+ union
770
+
771
+
772
+
773
+ | \- |
774
+
775
+ RAW
776
+
777
+ * options :
778
+
779
+ \[
780
+
781
+ * 0 :
782
+
783
+ {...} 2 keys
784
+
785
+ * 1 :
786
+
787
+ {...} 2 keys
788
+
789
+ * 2 :
790
+
791
+ {...} 2 keys
792
+
793
+ * 3 :
794
+
795
+ {...} 2 keys
796
+
797
+ * 4 :
798
+
799
+ {...} 2 keys
800
+
801
+
802
+ \]
803
+
804
+
805
+
806
+
807
+ |
808
+ | popoverProps |
809
+
810
+ object
811
+
812
+
813
+
814
+ | { } |
815
+
816
+ RAW
817
+
818
+ popoverProps :
819
+
820
+ {
821
+
822
+ }
823
+
824
+
825
+
826
+
827
+
828
+
829
+
830
+ |
831
+ | value |
832
+
833
+ Value of selected option for controlled combobox.
834
+
835
+ LabelValueMeta
836
+
837
+
838
+
839
+ | \- | Set object |
840
+ | watermark |
841
+
842
+ |
843
+
844
+ true
845
+
846
+ | Set object |
847
+
848
+ #### Asynchronous `options`
849
+
850
+ 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. No filtering is done for asynchronous options, you must filter the options yourself using the query.
851
+
852
+ [](./iframe.html?id=components-combobox--async-options)
853
+
854
+ None selected
855
+
856
+ ```
857
+
858
+ import { IressCombobox, type IressComboboxProps } from '@iress-oss/ids-components';
859
+ interface StarWarsCharacter {
860
+ name: string;
861
+ gender: string;
862
+ }
863
+ interface StarWarsCharacterApi {
864
+ results: StarWarsCharacter\[\];
865
+ }
866
+ export const ComboboxUsingAsync \= (args: IressComboboxProps) \=> (
867
+ <IressCombobox
868
+ {...args}
869
+ options\={async (query: string) \=> {
870
+ if (!query) return \[\];
871
+ const data \= await fetch(
872
+ \`https://swapi.py4e.com/api/people/?search=${query}\`,
873
+ ).then((response) \=> response.json() as Promise<StarWarsCharacterApi\>);
874
+ return data.results.map((character: StarWarsCharacter) \=> ({
875
+ label: character.name,
876
+ value: character.name,
877
+ meta: character.gender,
878
+ }));
879
+ }}
880
+ />
881
+ );
882
+
883
+ ```
884
+
885
+ #### Props
886
+
887
+ | Name | Description | Default | Control |
888
+ | --- | --- | --- | --- |
889
+ | append |
890
+ |
891
+
892
+ <IressIcon />
893
+
894
+
895
+
896
+ | Set object |
897
+ | autoComplete |
898
+
899
+ |
900
+
901
+ 'off'
902
+
903
+ | Set object |
904
+ | autoSelect |
905
+
906
+ |
907
+
908
+ true
909
+
910
+ | Set object |
911
+ | clearable |
912
+
913
+ |
914
+
915
+ true
916
+
917
+ | Set object |
918
+ | defaultValue |
919
+
920
+ Value of selected option for uncontrolled combobox.
921
+
922
+ LabelValueMeta
923
+
924
+
925
+
926
+ | \- | Set object |
927
+ | hiddenInputProps |
928
+
929
+ Add additional props to the hidden input.
930
+
931
+ Omit
932
+
933
+
934
+
935
+ | \- | Set object |
936
+ | limitDesktop |
937
+
938
+ |
939
+
940
+ 12
941
+
942
+ | Set object |
943
+ | limitMobile |
944
+
945
+ |
946
+
947
+ 6
948
+
949
+ | Set object |
950
+ | onChange |
951
+
952
+ Emitted when the value changes.
953
+
954
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
955
+
956
+ | \- | \- |
957
+ | options\* |
958
+
959
+ Options data set, the available options that the user can select from.
960
+
961
+ union
962
+
963
+
964
+
965
+ | \- | \- |
966
+ | popoverProps |
967
+
968
+ object
969
+
970
+
971
+
972
+ | { } |
973
+
974
+ RAW
975
+
976
+ popoverProps :
977
+
978
+ {
979
+
980
+ }
981
+
982
+
983
+
984
+
985
+
986
+
987
+
988
+ |
989
+ | value |
990
+
991
+ Value of selected option for controlled combobox.
992
+
993
+ LabelValueMeta
994
+
995
+
996
+
997
+ | \- | Set object |
998
+ | watermark |
999
+
1000
+ |
1001
+
1002
+ true
1003
+
1004
+ | Set object |
1005
+
1006
+ #### `initialOptions`
1007
+
1008
+ 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).
1009
+
1010
+ **Note:** Once an option is selected from `initialOptions`, the input will be updated, meaning that the user can no longer see the initial options. If you want to keep the initial options visible, you should make sure they are part of the `options` prop as well.
1011
+
1012
+ [](./iframe.html?id=components-combobox--initial-options)
1013
+
1014
+ None selected
1015
+
1016
+ ```
1017
+
1018
+ <IressCombobox
1019
+ initialOptions\={\[
1020
+ {
1021
+ label: 'Favourite option 1'
1022
+ },
1023
+ {
1024
+ label: 'Favourite option 2'
1025
+ },
1026
+ {
1027
+ label: 'Favourite option 3'
1028
+ }
1029
+ \]}
1030
+ options\={\[
1031
+ {
1032
+ label: 'Option 1',
1033
+ value: 1
1034
+ },
1035
+ {
1036
+ label: 'Option 2',
1037
+ value: 2
1038
+ },
1039
+ {
1040
+ label: 'Option 3',
1041
+ value: 3
1042
+ },
1043
+ {
1044
+ label: 'Option 4',
1045
+ value: 4
1046
+ },
1047
+ {
1048
+ label: 'Option 5',
1049
+ value: 5
1050
+ }
1051
+ \]}
1052
+ popoverProps\={{
1053
+ container: {}
1054
+ }}
1055
+ />
1056
+
1057
+ ```
1058
+
1059
+ #### Props
1060
+
1061
+ | Name | Description | Default | Control |
1062
+ | --- | --- | --- | --- |
1063
+ | append |
1064
+ |
1065
+
1066
+ <IressIcon />
1067
+
1068
+
1069
+
1070
+ | Set object |
1071
+ | autoComplete |
1072
+
1073
+ |
1074
+
1075
+ 'off'
1076
+
1077
+ | Set object |
1078
+ | autoSelect |
1079
+
1080
+ |
1081
+
1082
+ true
1083
+
1084
+ | Set object |
1085
+ | clearable |
1086
+
1087
+ |
1088
+
1089
+ true
1090
+
1091
+ | Set object |
1092
+ | defaultValue |
1093
+
1094
+ Value of selected option for uncontrolled combobox.
1095
+
1096
+ LabelValueMeta
1097
+
1098
+
1099
+
1100
+ | \- | Set object |
1101
+ | hiddenInputProps |
1102
+
1103
+ Add additional props to the hidden input.
1104
+
1105
+ Omit
1106
+
1107
+
1108
+
1109
+ | \- | Set object |
1110
+ | initialOptions |
1111
+
1112
+ array
1113
+
1114
+
1115
+
1116
+ | \- |
1117
+
1118
+ RAW
1119
+
1120
+ * initialOptions :
1121
+
1122
+ \[
1123
+
1124
+ * 0 :
1125
+
1126
+ {...} 1 key
1127
+
1128
+ * 1 :
1129
+
1130
+ {...} 1 key
1131
+
1132
+ * 2 :
1133
+
1134
+ {...} 1 key
1135
+
1136
+
1137
+ \]
1138
+
1139
+
1140
+
1141
+
1142
+ |
1143
+ | limitDesktop |
1144
+
1145
+ |
1146
+
1147
+ 12
1148
+
1149
+ | Set object |
1150
+ | limitMobile |
1151
+
1152
+ |
1153
+
1154
+ 6
1155
+
1156
+ | Set object |
1157
+ | onChange |
1158
+
1159
+ Emitted when the value changes.
1160
+
1161
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
1162
+
1163
+ | \- | \- |
1164
+ | options\* |
1165
+
1166
+ Options data set, the available options that the user can select from.
1167
+
1168
+ union
1169
+
1170
+
1171
+
1172
+ | \- |
1173
+
1174
+ RAW
1175
+
1176
+ * options :
1177
+
1178
+ \[
1179
+
1180
+ * 0 :
1181
+
1182
+ {...} 2 keys
1183
+
1184
+ * 1 :
1185
+
1186
+ {...} 2 keys
1187
+
1188
+ * 2 :
1189
+
1190
+ {...} 2 keys
1191
+
1192
+ * 3 :
1193
+
1194
+ {...} 2 keys
1195
+
1196
+ * 4 :
1197
+
1198
+ {...} 2 keys
1199
+
1200
+
1201
+ \]
1202
+
1203
+
1204
+
1205
+
1206
+ |
1207
+ | popoverProps |
1208
+
1209
+ object
1210
+
1211
+
1212
+
1213
+ | { } |
1214
+
1215
+ RAW
1216
+
1217
+ popoverProps :
1218
+
1219
+ {
1220
+
1221
+ }
1222
+
1223
+
1224
+
1225
+
1226
+
1227
+
1228
+
1229
+ |
1230
+ | value |
1231
+
1232
+ Value of selected option for controlled combobox.
1233
+
1234
+ LabelValueMeta
1235
+
1236
+
1237
+
1238
+ | \- | Set object |
1239
+ | watermark |
1240
+
1241
+ |
1242
+
1243
+ true
1244
+
1245
+ | Set object |
1246
+
1247
+ Behaviour
1248
+ ---------
1249
+
1250
+ * If `initialOptions` are provided the options will be displayed in a popover immediately on focus. The popover will close when the input loses focus.
1251
+ * If `initialOptions` are not provided, the popover will be displayed as long as there is a single character in the input. The popover will close when the input is empty.
1252
+ * The options will be filtered based on the input value.
1253
+ * If `autoSelect` is true, the first option filtered will become the value of the combobox, unless the backspace key is pressed.
1254
+ * Tapping on an option with the mouse will change the input value to the `label` of the selected option. The entire `LabelValueMeta` of the selected option will be returned in the `onChange` callback.
1255
+ * When the user presses the arrow keys while the input is focussed, options will be selected, but focus remains on the input.
1256
+ * If `autoSelect` is true, the option will become the value of the combobox.
1257
+ * If `autoSelect` is true, the text not matching the input will be selected.
1258
+ * When the user presses the enter key while a option is highlighted, the option will be selected and the popover will close.
1259
+ * When the user presses the down key while the popover is closed, it will open the popover.
1260
+ * When the user pressed the up key while the first option is highlighted, it will close the popover.
1261
+ * When the user tabs away while the popover is open, the popover will close.
1262
+ * If `autoSelect` is true and there is a highlighted option, it will become the value of the combobox.
1263
+
1264
+ Accessibility
1265
+ -------------
1266
+
1267
+ The autocomplete component follows the [WAI combobox pattern: List with inline autocomplete and automatic selection](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/#:~:text=List%20autocomplete%20with%20automatic,has%20a%20selected%20state). 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-both/).
1268
+
1269
+ There is a key difference:
1270
+
1271
+ * 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.
1272
+ * To denote the highlighted suggestion to screen readers, the `aria-activedescendant` attribute is used.
1273
+
1274
+ Examples
1275
+ --------
1276
+
1277
+ ### Remove `autoSelect`
1278
+
1279
+ The `autoSelect` prop will automatically select the highlighted option. This is set to true by default, but can be switched off, in which case the user must interact with the popover to select an option.
1280
+
1281
+ [](./iframe.html?id=components-combobox--remove-auto-select)
1282
+
1283
+ None selected
1284
+
1285
+ ```
1286
+
1287
+ <IressCombobox
1288
+ autoSelect\={false}
1289
+ options\={\[
1290
+ {
1291
+ label: 'Option 1',
1292
+ value: 1
1293
+ },
1294
+ {
1295
+ label: 'Option 2',
1296
+ value: 2
1297
+ },
1298
+ {
1299
+ label: 'Option 3',
1300
+ value: 3
1301
+ },
1302
+ {
1303
+ label: 'Option 4',
1304
+ value: 4
1305
+ },
1306
+ {
1307
+ label: 'Option 5',
1308
+ value: 5
1309
+ }
1310
+ \]}
1311
+ placeholder\="Should no longer auto-select when an item is highlighted"
1312
+ popoverProps\={{
1313
+ container: {}
1314
+ }}
1315
+ />
1316
+
1317
+ ```
1318
+
1319
+ #### Props
1320
+
1321
+ | Name | Description | Default | Control |
1322
+ | --- | --- | --- | --- |
1323
+ | append |
1324
+ |
1325
+
1326
+ <IressIcon />
1327
+
1328
+
1329
+
1330
+ | Set object |
1331
+ | autoComplete |
1332
+
1333
+ |
1334
+
1335
+ 'off'
1336
+
1337
+ | Set object |
1338
+ | autoSelect |
1339
+
1340
+ boolean
1341
+
1342
+
1343
+
1344
+ |
1345
+
1346
+ true
1347
+
1348
+ | FalseTrue |
1349
+ | clearable |
1350
+
1351
+ |
1352
+
1353
+ true
1354
+
1355
+ | Set object |
1356
+ | defaultValue |
1357
+
1358
+ Value of selected option for uncontrolled combobox.
1359
+
1360
+ LabelValueMeta
1361
+
1362
+
1363
+
1364
+ | \- | Set object |
1365
+ | hiddenInputProps |
1366
+
1367
+ Add additional props to the hidden input.
1368
+
1369
+ Omit
1370
+
1371
+
1372
+
1373
+ | \- | Set object |
1374
+ | limitDesktop |
1375
+
1376
+ |
1377
+
1378
+ 12
1379
+
1380
+ | Set object |
1381
+ | limitMobile |
1382
+
1383
+ |
1384
+
1385
+ 6
1386
+
1387
+ | Set object |
1388
+ | onChange |
1389
+
1390
+ Emitted when the value changes.
1391
+
1392
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
1393
+
1394
+ | \- | \- |
1395
+ | options\* |
1396
+
1397
+ Options data set, the available options that the user can select from.
1398
+
1399
+ union
1400
+
1401
+
1402
+
1403
+ | \- |
1404
+
1405
+ RAW
1406
+
1407
+ * options :
1408
+
1409
+ \[
1410
+
1411
+ * 0 :
1412
+
1413
+ {...} 2 keys
1414
+
1415
+ * 1 :
1416
+
1417
+ {...} 2 keys
1418
+
1419
+ * 2 :
1420
+
1421
+ {...} 2 keys
1422
+
1423
+ * 3 :
1424
+
1425
+ {...} 2 keys
1426
+
1427
+ * 4 :
1428
+
1429
+ {...} 2 keys
1430
+
1431
+
1432
+ \]
1433
+
1434
+
1435
+
1436
+
1437
+ |
1438
+ | placeholder |
1439
+
1440
+ string
1441
+
1442
+
1443
+
1444
+ | \- | Should no longer auto-select when an item is highlighted |
1445
+ | popoverProps |
1446
+
1447
+ object
1448
+
1449
+
1450
+
1451
+ | { } |
1452
+
1453
+ RAW
1454
+
1455
+ popoverProps :
1456
+
1457
+ {
1458
+
1459
+ }
1460
+
1461
+
1462
+
1463
+
1464
+
1465
+
1466
+
1467
+ |
1468
+ | value |
1469
+
1470
+ Value of selected option for controlled combobox.
1471
+
1472
+ LabelValueMeta
1473
+
1474
+
1475
+
1476
+ | \- | Set object |
1477
+ | watermark |
1478
+
1479
+ |
1480
+
1481
+ true
1482
+
1483
+ | Set object |
1484
+
1485
+ ### Input props
1486
+
1487
+ Autocomplete extends `IressInput`, hence it has the same properties as `IressInput`.
1488
+
1489
+ 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.
1490
+
1491
+ [](./iframe.html?id=components-combobox--input-props)
1492
+
1493
+ None selected
1494
+
1495
+ ```
1496
+
1497
+ <IressCombobox
1498
+ 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\>}
1499
+ options\={\[
1500
+ {
1501
+ label: 'Option 1',
1502
+ value: 1
1503
+ },
1504
+ {
1505
+ label: 'Option 2',
1506
+ value: 2
1507
+ },
1508
+ {
1509
+ label: 'Option 3',
1510
+ value: 3
1511
+ },
1512
+ {
1513
+ label: 'Option 4',
1514
+ value: 4
1515
+ },
1516
+ {
1517
+ label: 'Option 5',
1518
+ value: 5
1519
+ }
1520
+ \]}
1521
+ popoverProps\={{
1522
+ container: {}
1523
+ }}
1524
+ prepend\={<IressIcon name\="search" />}
1525
+ width\="12"
1526
+ />
1527
+
1528
+ ```
1529
+
1530
+ #### Props
1531
+
1532
+ | Name | Description | Default | Control |
1533
+ | --- | --- | --- | --- |
1534
+ | append |
1535
+ object
1536
+
1537
+
1538
+
1539
+ |
1540
+
1541
+ <IressIcon />
1542
+
1543
+
1544
+
1545
+ |
1546
+
1547
+ RAW
1548
+
1549
+ append :
1550
+
1551
+ {
1552
+
1553
+ * $$typeof : Symbol(react.transitional.element)
1554
+ * type :
1555
+
1556
+ {...} 5 keys
1557
+
1558
+ * key : null
1559
+ * props :
1560
+
1561
+ {...} 4 keys
1562
+
1563
+ * \_owner : null
1564
+ * \_store :
1565
+
1566
+ {...} 0 keys
1567
+
1568
+
1569
+ }
1570
+
1571
+
1572
+
1573
+
1574
+
1575
+
1576
+
1577
+ |
1578
+ | autoComplete |
1579
+
1580
+ |
1581
+
1582
+ 'off'
1583
+
1584
+ | Set object |
1585
+ | autoSelect |
1586
+
1587
+ |
1588
+
1589
+ true
1590
+
1591
+ | Set object |
1592
+ | clearable |
1593
+
1594
+ |
1595
+
1596
+ true
1597
+
1598
+ | Set object |
1599
+ | defaultValue |
1600
+
1601
+ Value of selected option for uncontrolled combobox.
1602
+
1603
+ LabelValueMeta
1604
+
1605
+
1606
+
1607
+ | \- | Set object |
1608
+ | hiddenInputProps |
1609
+
1610
+ Add additional props to the hidden input.
1611
+
1612
+ Omit
1613
+
1614
+
1615
+
1616
+ | \- | Set object |
1617
+ | limitDesktop |
1618
+
1619
+ |
1620
+
1621
+ 12
1622
+
1623
+ | Set object |
1624
+ | limitMobile |
1625
+
1626
+ |
1627
+
1628
+ 6
1629
+
1630
+ | Set object |
1631
+ | onChange |
1632
+
1633
+ Emitted when the value changes.
1634
+
1635
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
1636
+
1637
+ | \- | \- |
1638
+ | options\* |
1639
+
1640
+ Options data set, the available options that the user can select from.
1641
+
1642
+ union
1643
+
1644
+
1645
+
1646
+ | \- |
1647
+
1648
+ RAW
1649
+
1650
+ * options :
1651
+
1652
+ \[
1653
+
1654
+ * 0 :
1655
+
1656
+ {...} 2 keys
1657
+
1658
+ * 1 :
1659
+
1660
+ {...} 2 keys
1661
+
1662
+ * 2 :
1663
+
1664
+ {...} 2 keys
1665
+
1666
+ * 3 :
1667
+
1668
+ {...} 2 keys
1669
+
1670
+ * 4 :
1671
+
1672
+ {...} 2 keys
1673
+
1674
+
1675
+ \]
1676
+
1677
+
1678
+
1679
+
1680
+ |
1681
+ | popoverProps |
1682
+
1683
+ object
1684
+
1685
+
1686
+
1687
+ | { } |
1688
+
1689
+ RAW
1690
+
1691
+ popoverProps :
1692
+
1693
+ {
1694
+
1695
+ }
1696
+
1697
+
1698
+
1699
+
1700
+
1701
+
1702
+
1703
+ |
1704
+ | prepend |
1705
+
1706
+ object
1707
+
1708
+
1709
+
1710
+ | \- |
1711
+
1712
+ RAW
1713
+
1714
+ prepend :
1715
+
1716
+ {
1717
+
1718
+ * $$typeof : Symbol(react.transitional.element)
1719
+ * type :
1720
+
1721
+ {...} 9 keys
1722
+
1723
+ * key : null
1724
+ * props :
1725
+
1726
+ {...} 1 key
1727
+
1728
+ * \_owner : null
1729
+ * \_store :
1730
+
1731
+ {...} 0 keys
1732
+
1733
+
1734
+ }
1735
+
1736
+
1737
+
1738
+
1739
+
1740
+
1741
+
1742
+ |
1743
+ | value |
1744
+
1745
+ Value of selected option for controlled combobox.
1746
+
1747
+ LabelValueMeta
1748
+
1749
+
1750
+
1751
+ | \- | Set object |
1752
+ | watermark |
1753
+
1754
+ |
1755
+
1756
+ true
1757
+
1758
+ | Set object |
1759
+ | width |
1760
+
1761
+ string
1762
+
1763
+
1764
+
1765
+ | \- | 12 |
1766
+
1767
+ ### No results
1768
+
1769
+ If you would like to show a message when there are no results, you can use the `noResultsText` prop. It accepts any React node.
1770
+
1771
+ [](./iframe.html?id=components-combobox--no-results-text)
1772
+
1773
+ None selected
1774
+
1775
+ ```
1776
+
1777
+ <IressCombobox
1778
+ noResultsText\={<IressPanel className\="iress-u-text"\>No results found</IressPanel\>}
1779
+ options\={\[
1780
+ {
1781
+ label: 'Option 1',
1782
+ value: 1
1783
+ },
1784
+ {
1785
+ label: 'Option 2',
1786
+ value: 2
1787
+ },
1788
+ {
1789
+ label: 'Option 3',
1790
+ value: 3
1791
+ },
1792
+ {
1793
+ label: 'Option 4',
1794
+ value: 4
1795
+ },
1796
+ {
1797
+ label: 'Option 5',
1798
+ value: 5
1799
+ }
1800
+ \]}
1801
+ placeholder\="Type &quot;no&quot; to see the no results text"
1802
+ popoverProps\={{
1803
+ container: {}
1804
+ }}
1805
+ />
1806
+
1807
+ ```
1808
+
1809
+ #### Props
1810
+
1811
+ | Name | Description | Default | Control |
1812
+ | --- | --- | --- | --- |
1813
+ | append |
1814
+ |
1815
+
1816
+ <IressIcon />
1817
+
1818
+
1819
+
1820
+ | Set object |
1821
+ | autoComplete |
1822
+
1823
+ |
1824
+
1825
+ 'off'
1826
+
1827
+ | Set object |
1828
+ | autoSelect |
1829
+
1830
+ |
1831
+
1832
+ true
1833
+
1834
+ | Set object |
1835
+ | clearable |
1836
+
1837
+ |
1838
+
1839
+ true
1840
+
1841
+ | Set object |
1842
+ | defaultValue |
1843
+
1844
+ Value of selected option for uncontrolled combobox.
1845
+
1846
+ LabelValueMeta
1847
+
1848
+
1849
+
1850
+ | \- | Set object |
1851
+ | hiddenInputProps |
1852
+
1853
+ Add additional props to the hidden input.
1854
+
1855
+ Omit
1856
+
1857
+
1858
+
1859
+ | \- | Set object |
1860
+ | limitDesktop |
1861
+
1862
+ |
1863
+
1864
+ 12
1865
+
1866
+ | Set object |
1867
+ | limitMobile |
1868
+
1869
+ |
1870
+
1871
+ 6
1872
+
1873
+ | Set object |
1874
+ | noResultsText |
1875
+
1876
+ object
1877
+
1878
+
1879
+
1880
+ | \- |
1881
+
1882
+ RAW
1883
+
1884
+ noResultsText :
1885
+
1886
+ {
1887
+
1888
+ * $$typeof : Symbol(react.transitional.element)
1889
+ * type : ({ children, background = "default", noBorderRadius, noGutter, padding = "md", stretch, textAlign = "inherit", className, ...restProps }) => { const classMap = { \[PanelCssClass.Stretch\]: stretch, \[PanelCssClass.NoBorderRadius\]: noBorderRadius, \[PanelCssClass.NoGutter\]: noGutter }; const cssClasses = classNames( className, PanelCssClass.Base, \`${GlobalCSSClass.TextAlignBase}--${textAlign}\`, \`${PanelCssClass.Background}--${background}\`, getResponsivePaddingClasses(padding), classMap ); return /\* @\_\_PURE\_\_ \*/ jsxDEV("div", { className: cssClasses, ...restProps, children }, void 0, false, { fileName: "/home/runner/work/design-system/design-system/packages/components/src/components/Panel/Panel.tsx", lineNumber: 38, columnNumber: 5 }, this); }
1890
+ * key : null
1891
+ * props :
1892
+
1893
+ {...} 2 keys
1894
+
1895
+ * \_owner : null
1896
+ * \_store :
1897
+
1898
+ {...} 0 keys
1899
+
1900
+
1901
+ }
1902
+
1903
+
1904
+
1905
+
1906
+
1907
+
1908
+
1909
+ |
1910
+ | onChange |
1911
+
1912
+ Emitted when the value changes.
1913
+
1914
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
1915
+
1916
+ | \- | \- |
1917
+ | options\* |
1918
+
1919
+ Options data set, the available options that the user can select from.
1920
+
1921
+ union
1922
+
1923
+
1924
+
1925
+ | \- |
1926
+
1927
+ RAW
1928
+
1929
+ * options :
1930
+
1931
+ \[
1932
+
1933
+ * 0 :
1934
+
1935
+ {...} 2 keys
1936
+
1937
+ * 1 :
1938
+
1939
+ {...} 2 keys
1940
+
1941
+ * 2 :
1942
+
1943
+ {...} 2 keys
1944
+
1945
+ * 3 :
1946
+
1947
+ {...} 2 keys
1948
+
1949
+ * 4 :
1950
+
1951
+ {...} 2 keys
1952
+
1953
+
1954
+ \]
1955
+
1956
+
1957
+
1958
+
1959
+ |
1960
+ | placeholder |
1961
+
1962
+ string
1963
+
1964
+
1965
+
1966
+ | \- | Type "no" to see the no results text |
1967
+ | popoverProps |
1968
+
1969
+ object
1970
+
1971
+
1972
+
1973
+ | { } |
1974
+
1975
+ RAW
1976
+
1977
+ popoverProps :
1978
+
1979
+ {
1980
+
1981
+ }
1982
+
1983
+
1984
+
1985
+
1986
+
1987
+
1988
+
1989
+ |
1990
+ | value |
1991
+
1992
+ Value of selected option for controlled combobox.
1993
+
1994
+ LabelValueMeta
1995
+
1996
+
1997
+
1998
+ | \- | Set object |
1999
+ | watermark |
2000
+
2001
+ |
2002
+
2003
+ true
2004
+
2005
+ | Set object |
2006
+
2007
+ ### Popover props
2008
+
2009
+ Under the hood, autocomplete uses `IressInputPopover` to display the suggestions. It accepts `autoHighlight`, `align`, `className` and `displayMode`.
2010
+
2011
+ 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.
2012
+
2013
+ [](./iframe.html?id=components-combobox--popover-props)
2014
+
2015
+ None selected
2016
+
2017
+ ```
2018
+
2019
+ <IressCombobox
2020
+ options\={\[
2021
+ {
2022
+ label: 'Option 1',
2023
+ value: 1
2024
+ },
2025
+ {
2026
+ label: 'Option 2',
2027
+ value: 2
2028
+ },
2029
+ {
2030
+ label: 'Option 3',
2031
+ value: 3
2032
+ },
2033
+ {
2034
+ label: 'Option 4',
2035
+ value: 4
2036
+ },
2037
+ {
2038
+ label: 'Option 5',
2039
+ value: 5
2040
+ }
2041
+ \]}
2042
+ popoverProps\={{
2043
+ append: <IressPanel\><IressButton\>Add an option</IressButton\></IressPanel\>,
2044
+ container: {}
2045
+ }}
2046
+ />
2047
+
2048
+ ```
2049
+
2050
+ #### Props
2051
+
2052
+ | Name | Description | Default | Control |
2053
+ | --- | --- | --- | --- |
2054
+ | append |
2055
+ |
2056
+
2057
+ <IressIcon />
2058
+
2059
+
2060
+
2061
+ | Set object |
2062
+ | autoComplete |
2063
+
2064
+ |
2065
+
2066
+ 'off'
2067
+
2068
+ | Set object |
2069
+ | autoSelect |
2070
+
2071
+ |
2072
+
2073
+ true
2074
+
2075
+ | Set object |
2076
+ | clearable |
2077
+
2078
+ |
2079
+
2080
+ true
2081
+
2082
+ | Set object |
2083
+ | defaultValue |
2084
+
2085
+ Value of selected option for uncontrolled combobox.
2086
+
2087
+ LabelValueMeta
2088
+
2089
+
2090
+
2091
+ | \- | Set object |
2092
+ | hiddenInputProps |
2093
+
2094
+ Add additional props to the hidden input.
2095
+
2096
+ Omit
2097
+
2098
+
2099
+
2100
+ | \- | Set object |
2101
+ | limitDesktop |
2102
+
2103
+ |
2104
+
2105
+ 12
2106
+
2107
+ | Set object |
2108
+ | limitMobile |
2109
+
2110
+ |
2111
+
2112
+ 6
2113
+
2114
+ | Set object |
2115
+ | onChange |
2116
+
2117
+ Emitted when the value changes.
2118
+
2119
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
2120
+
2121
+ | \- | \- |
2122
+ | options\* |
2123
+
2124
+ Options data set, the available options that the user can select from.
2125
+
2126
+ union
2127
+
2128
+
2129
+
2130
+ | \- |
2131
+
2132
+ RAW
2133
+
2134
+ * options :
2135
+
2136
+ \[
2137
+
2138
+ * 0 :
2139
+
2140
+ {...} 2 keys
2141
+
2142
+ * 1 :
2143
+
2144
+ {...} 2 keys
2145
+
2146
+ * 2 :
2147
+
2148
+ {...} 2 keys
2149
+
2150
+ * 3 :
2151
+
2152
+ {...} 2 keys
2153
+
2154
+ * 4 :
2155
+
2156
+ {...} 2 keys
2157
+
2158
+
2159
+ \]
2160
+
2161
+
2162
+
2163
+
2164
+ |
2165
+ | popoverProps |
2166
+
2167
+ object
2168
+
2169
+
2170
+
2171
+ | { } |
2172
+
2173
+ RAW
2174
+
2175
+ popoverProps :
2176
+
2177
+ {
2178
+
2179
+ * append :
2180
+
2181
+ {...} 6 keys
2182
+
2183
+
2184
+ }
2185
+
2186
+
2187
+
2188
+
2189
+
2190
+
2191
+
2192
+ |
2193
+ | value |
2194
+
2195
+ Value of selected option for controlled combobox.
2196
+
2197
+ LabelValueMeta
2198
+
2199
+
2200
+
2201
+ | \- | Set object |
2202
+ | watermark |
2203
+
2204
+ |
2205
+
2206
+ true
2207
+
2208
+ | Set object |
2209
+
2210
+ ### Debounce threshold
2211
+
2212
+ 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.
2213
+
2214
+ By default there is a debounce of `500`ms, but it can be removed by setting it to `0`.
2215
+
2216
+ **Note:** Removing the debounce and keeping `autoSelect` true may cause some weird highlighting issues if the user types quickly.
2217
+
2218
+ [](./iframe.html?id=components-combobox--debounce-threshold)
2219
+
2220
+ None selected
2221
+
2222
+ ```
2223
+
2224
+ <IressCombobox
2225
+ debounceThreshold\={0}
2226
+ options\={\[
2227
+ {
2228
+ label: 'Option 1',
2229
+ value: 1
2230
+ },
2231
+ {
2232
+ label: 'Option 2',
2233
+ value: 2
2234
+ },
2235
+ {
2236
+ label: 'Option 3',
2237
+ value: 3
2238
+ },
2239
+ {
2240
+ label: 'Option 4',
2241
+ value: 4
2242
+ },
2243
+ {
2244
+ label: 'Option 5',
2245
+ value: 5
2246
+ }
2247
+ \]}
2248
+ placeholder\="Instant search!"
2249
+ popoverProps\={{
2250
+ container: {}
2251
+ }}
2252
+ />
2253
+
2254
+ ```
2255
+
2256
+ #### Props
2257
+
2258
+ | Name | Description | Default | Control |
2259
+ | --- | --- | --- | --- |
2260
+ | append |
2261
+ |
2262
+
2263
+ <IressIcon />
2264
+
2265
+
2266
+
2267
+ | Set object |
2268
+ | autoComplete |
2269
+
2270
+ |
2271
+
2272
+ 'off'
2273
+
2274
+ | Set object |
2275
+ | autoSelect |
2276
+
2277
+ |
2278
+
2279
+ true
2280
+
2281
+ | Set object |
2282
+ | clearable |
2283
+
2284
+ |
2285
+
2286
+ true
2287
+
2288
+ | Set object |
2289
+ | debounceThreshold |
2290
+
2291
+ number
2292
+
2293
+
2294
+
2295
+ | \- | |
2296
+ | defaultValue |
2297
+
2298
+ Value of selected option for uncontrolled combobox.
2299
+
2300
+ LabelValueMeta
2301
+
2302
+
2303
+
2304
+ | \- | Set object |
2305
+ | hiddenInputProps |
2306
+
2307
+ Add additional props to the hidden input.
2308
+
2309
+ Omit
2310
+
2311
+
2312
+
2313
+ | \- | Set object |
2314
+ | limitDesktop |
2315
+
2316
+ |
2317
+
2318
+ 12
2319
+
2320
+ | Set object |
2321
+ | limitMobile |
2322
+
2323
+ |
2324
+
2325
+ 6
2326
+
2327
+ | Set object |
2328
+ | onChange |
2329
+
2330
+ Emitted when the value changes.
2331
+
2332
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
2333
+
2334
+ | \- | \- |
2335
+ | options\* |
2336
+
2337
+ Options data set, the available options that the user can select from.
2338
+
2339
+ union
2340
+
2341
+
2342
+
2343
+ | \- |
2344
+
2345
+ RAW
2346
+
2347
+ * options :
2348
+
2349
+ \[
2350
+
2351
+ * 0 :
2352
+
2353
+ {...} 2 keys
2354
+
2355
+ * 1 :
2356
+
2357
+ {...} 2 keys
2358
+
2359
+ * 2 :
2360
+
2361
+ {...} 2 keys
2362
+
2363
+ * 3 :
2364
+
2365
+ {...} 2 keys
2366
+
2367
+ * 4 :
2368
+
2369
+ {...} 2 keys
2370
+
2371
+
2372
+ \]
2373
+
2374
+
2375
+
2376
+
2377
+ |
2378
+ | placeholder |
2379
+
2380
+ string
2381
+
2382
+
2383
+
2384
+ | \- | Instant search! |
2385
+ | popoverProps |
2386
+
2387
+ object
2388
+
2389
+
2390
+
2391
+ | { } |
2392
+
2393
+ RAW
2394
+
2395
+ popoverProps :
2396
+
2397
+ {
2398
+
2399
+ }
2400
+
2401
+
2402
+
2403
+
2404
+
2405
+
2406
+
2407
+ |
2408
+ | value |
2409
+
2410
+ Value of selected option for controlled combobox.
2411
+
2412
+ LabelValueMeta
2413
+
2414
+
2415
+
2416
+ | \- | Set object |
2417
+ | watermark |
2418
+
2419
+ |
2420
+
2421
+ true
2422
+
2423
+ | Set object |
2424
+
2425
+ ### Result limits
2426
+
2427
+ You can limit the maximum amount of search results displayed in the suggestions by setting the `limitDesktop` prop. This defaults to 12.
2428
+
2429
+ On smaller screens (< 768px), the number of options is further reduced by using the `limitMobile` prop, which defaults to 6.
2430
+
2431
+ `limitMobile` works by filtering the search results that have been filtered by `limitDesktop`, so must be a smaller value. For example:
2432
+
2433
+ // 12 results on large screens, 6 on small screens (default values)
2434
+ <IressCombobox options\={...} />
2435
+ // 4 results on large screens, 3 on small screens
2436
+ <IressCombobox limitDesktop\={4} limitMobile\={3} options\={...} />
2437
+ // 4 results on all screens (resultLimitMobile > resultLimitDesktop so has no effect)
2438
+ <IressCombobox limitDesktop\={4} limitMobile\={5} options\={...} />
2439
+
2440
+ ```
2441
+
2442
+ The result limits will also affect the number of initial options displayed, if the `initialOptions` prop is set.
2443
+
2444
+ [](./iframe.html?id=components-combobox--result-limits)
2445
+
2446
+ **xl** breakpoint (1200px - 1499px)
2447
+
2448
+ None selected
2449
+
2450
+ ```
2451
+
2452
+ <IressStack gutter\="md"\>
2453
+ <IressPanel className\="iress-u-text"\>
2454
+ <kn />
2455
+ </IressPanel\>
2456
+ <IressCombobox
2457
+ limitDesktop\={6}
2458
+ limitMobile\={3}
2459
+ options\={\[
2460
+ {
2461
+ label: 'Option 1'
2462
+ },
2463
+ {
2464
+ label: 'Option 2'
2465
+ },
2466
+ {
2467
+ label: 'Option 3'
2468
+ },
2469
+ {
2470
+ label: 'Option 4'
2471
+ },
2472
+ {
2473
+ label: 'Option 5'
2474
+ },
2475
+ {
2476
+ label: 'Option 6'
2477
+ },
2478
+ {
2479
+ label: 'Option 7'
2480
+ },
2481
+ {
2482
+ label: 'Option 8'
2483
+ },
2484
+ {
2485
+ label: 'Option 9'
2486
+ },
2487
+ {
2488
+ label: 'Option 10'
2489
+ },
2490
+ {
2491
+ label: 'Option 11'
2492
+ },
2493
+ {
2494
+ label: 'Option 12'
2495
+ },
2496
+ {
2497
+ label: 'Option 13'
2498
+ },
2499
+ {
2500
+ label: 'Option 14'
2501
+ },
2502
+ {
2503
+ label: 'Option 15'
2504
+ }
2505
+ \]}
2506
+ popoverProps\={{
2507
+ container: {}
2508
+ }}
2509
+ />
2510
+ </IressStack\>
2511
+
2512
+ ```
2513
+
2514
+ #### Props
2515
+
2516
+ | Name | Description | Default | Control |
2517
+ | --- | --- | --- | --- |
2518
+ | append |
2519
+ |
2520
+
2521
+ <IressIcon />
2522
+
2523
+
2524
+
2525
+ | Set object |
2526
+ | autoComplete |
2527
+
2528
+ |
2529
+
2530
+ 'off'
2531
+
2532
+ | Set object |
2533
+ | autoSelect |
2534
+
2535
+ |
2536
+
2537
+ true
2538
+
2539
+ | Set object |
2540
+ | clearable |
2541
+
2542
+ |
2543
+
2544
+ true
2545
+
2546
+ | Set object |
2547
+ | defaultValue |
2548
+
2549
+ Value of selected option for uncontrolled combobox.
2550
+
2551
+ LabelValueMeta
2552
+
2553
+
2554
+
2555
+ | \- | Set object |
2556
+ | hiddenInputProps |
2557
+
2558
+ Add additional props to the hidden input.
2559
+
2560
+ Omit
2561
+
2562
+
2563
+
2564
+ | \- | Set object |
2565
+ | limitDesktop |
2566
+
2567
+ number
2568
+
2569
+
2570
+
2571
+ |
2572
+
2573
+ 12
2574
+
2575
+ | |
2576
+ | limitMobile |
2577
+
2578
+ number
2579
+
2580
+
2581
+
2582
+ |
2583
+
2584
+ 6
2585
+
2586
+ | |
2587
+ | onChange |
2588
+
2589
+ Emitted when the value changes.
2590
+
2591
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
2592
+
2593
+ | \- | \- |
2594
+ | options\* |
2595
+
2596
+ Options data set, the available options that the user can select from.
2597
+
2598
+ union
2599
+
2600
+
2601
+
2602
+ | \- |
2603
+
2604
+ RAW
2605
+
2606
+ * options :
2607
+
2608
+ \[
2609
+
2610
+ * 0 :
2611
+
2612
+ {...} 1 key
2613
+
2614
+ * 1 :
2615
+
2616
+ {...} 1 key
2617
+
2618
+ * 2 :
2619
+
2620
+ {...} 1 key
2621
+
2622
+ * 3 :
2623
+
2624
+ {...} 1 key
2625
+
2626
+ * 4 :
2627
+
2628
+ {...} 1 key
2629
+
2630
+ * 5 :
2631
+
2632
+ {...} 1 key
2633
+
2634
+ * 6 :
2635
+
2636
+ {...} 1 key
2637
+
2638
+ * 7 :
2639
+
2640
+ {...} 1 key
2641
+
2642
+ * 8 :
2643
+
2644
+ {...} 1 key
2645
+
2646
+ * 9 :
2647
+
2648
+ {...} 1 key
2649
+
2650
+ * 10 :
2651
+
2652
+ {...} 1 key
2653
+
2654
+ * 11 :
2655
+
2656
+ {...} 1 key
2657
+
2658
+ * 12 :
2659
+
2660
+ {...} 1 key
2661
+
2662
+ * 13 :
2663
+
2664
+ {...} 1 key
2665
+
2666
+ * 14 :
2667
+
2668
+ {...} 1 key
2669
+
2670
+
2671
+ \]
2672
+
2673
+
2674
+
2675
+
2676
+ |
2677
+ | popoverProps |
2678
+
2679
+ object
2680
+
2681
+
2682
+
2683
+ | { } |
2684
+
2685
+ RAW
2686
+
2687
+ popoverProps :
2688
+
2689
+ {
2690
+
2691
+ }
2692
+
2693
+
2694
+
2695
+
2696
+
2697
+
2698
+
2699
+ |
2700
+ | value |
2701
+
2702
+ Value of selected option for controlled combobox.
2703
+
2704
+ LabelValueMeta
2705
+
2706
+
2707
+
2708
+ | \- | Set object |
2709
+ | watermark |
2710
+
2711
+ |
2712
+
2713
+ true
2714
+
2715
+ | Set object |
2716
+
2717
+ ### Readonly
2718
+
2719
+ The `readOnly` prop can be set 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.
2720
+
2721
+ 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).
2722
+
2723
+ [](./iframe.html?id=components-combobox--readonly)
2724
+
2725
+ Option 1
2726
+
2727
+ ```
2728
+
2729
+ <IressCombobox
2730
+ defaultValue\={{
2731
+ label: 'Option 1',
2732
+ value: 1
2733
+ }}
2734
+ options\={\[
2735
+ {
2736
+ label: 'Option 1',
2737
+ value: 1
2738
+ },
2739
+ {
2740
+ label: 'Option 2',
2741
+ value: 2
2742
+ },
2743
+ {
2744
+ label: 'Option 3',
2745
+ value: 3
2746
+ },
2747
+ {
2748
+ label: 'Option 4',
2749
+ value: 4
2750
+ },
2751
+ {
2752
+ label: 'Option 5',
2753
+ value: 5
2754
+ }
2755
+ \]}
2756
+ popoverProps\={{
2757
+ container: {}
2758
+ }}
2759
+ readOnly
2760
+ />
2761
+
2762
+ ```
2763
+
2764
+ #### Props
2765
+
2766
+ | Name | Description | Default | Control |
2767
+ | --- | --- | --- | --- |
2768
+ | append |
2769
+ |
2770
+
2771
+ <IressIcon />
2772
+
2773
+
2774
+
2775
+ | Set object |
2776
+ | autoComplete |
2777
+
2778
+ |
2779
+
2780
+ 'off'
2781
+
2782
+ | Set object |
2783
+ | autoSelect |
2784
+
2785
+ |
2786
+
2787
+ true
2788
+
2789
+ | Set object |
2790
+ | clearable |
2791
+
2792
+ |
2793
+
2794
+ true
2795
+
2796
+ | Set object |
2797
+ | defaultValue |
2798
+
2799
+ Value of selected option for uncontrolled combobox.
2800
+
2801
+ LabelValueMeta
2802
+
2803
+
2804
+
2805
+ | \- |
2806
+
2807
+ RAW
2808
+
2809
+ defaultValue :
2810
+
2811
+ {
2812
+
2813
+ * label : "Option 1"
2814
+ * value : 1
2815
+
2816
+ }
2817
+
2818
+
2819
+
2820
+
2821
+
2822
+
2823
+
2824
+ |
2825
+ | hiddenInputProps |
2826
+
2827
+ Add additional props to the hidden input.
2828
+
2829
+ Omit
2830
+
2831
+
2832
+
2833
+ | \- | Set object |
2834
+ | limitDesktop |
2835
+
2836
+ |
2837
+
2838
+ 12
2839
+
2840
+ | Set object |
2841
+ | limitMobile |
2842
+
2843
+ |
2844
+
2845
+ 6
2846
+
2847
+ | Set object |
2848
+ | onChange |
2849
+
2850
+ Emitted when the value changes.
2851
+
2852
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
2853
+
2854
+ | \- | \- |
2855
+ | options\* |
2856
+
2857
+ Options data set, the available options that the user can select from.
2858
+
2859
+ union
2860
+
2861
+
2862
+
2863
+ | \- |
2864
+
2865
+ RAW
2866
+
2867
+ * options :
2868
+
2869
+ \[
2870
+
2871
+ * 0 :
2872
+
2873
+ {...} 2 keys
2874
+
2875
+ * 1 :
2876
+
2877
+ {...} 2 keys
2878
+
2879
+ * 2 :
2880
+
2881
+ {...} 2 keys
2882
+
2883
+ * 3 :
2884
+
2885
+ {...} 2 keys
2886
+
2887
+ * 4 :
2888
+
2889
+ {...} 2 keys
2890
+
2891
+
2892
+ \]
2893
+
2894
+
2895
+
2896
+
2897
+ |
2898
+ | popoverProps |
2899
+
2900
+ object
2901
+
2902
+
2903
+
2904
+ | { } |
2905
+
2906
+ RAW
2907
+
2908
+ popoverProps :
2909
+
2910
+ {
2911
+
2912
+ }
2913
+
2914
+
2915
+
2916
+
2917
+
2918
+
2919
+
2920
+ |
2921
+ | readOnly |
2922
+
2923
+ boolean
2924
+
2925
+
2926
+
2927
+ | \- | FalseTrue |
2928
+ | value |
2929
+
2930
+ Value of selected option for controlled combobox.
2931
+
2932
+ LabelValueMeta
2933
+
2934
+
2935
+
2936
+ | \- | Set object |
2937
+ | watermark |
2938
+
2939
+ |
2940
+
2941
+ true
2942
+
2943
+ | Set object |
2944
+
2945
+ `IressMultiCombobox`
2946
+ --------------------
2947
+
2948
+ `IressMultiCombobox` is a multi-select version of `IressCombobox`. It allows the user to select multiple options from a list. The selected items will be displayed as tags, as well as within the popover.
2949
+
2950
+ * * *
2951
+
2952
+ Caution
2953
+
2954
+ **Use IressRichSelect instead**
2955
+
2956
+ The design of this component is changing. Please use the new component/props instead.
2957
+
2958
+ [](./iframe.html?id=components-combobox-multicombobox--options)
2959
+
2960
+ None selected
2961
+
2962
+ ```
2963
+
2964
+ <IressMultiCombobox
2965
+ options\={\[
2966
+ {
2967
+ label: 'Option 1',
2968
+ value: 1
2969
+ },
2970
+ {
2971
+ label: 'Option 2',
2972
+ value: 2
2973
+ },
2974
+ {
2975
+ label: 'Option 3',
2976
+ value: 3
2977
+ },
2978
+ {
2979
+ label: 'Option 4',
2980
+ value: 4
2981
+ },
2982
+ {
2983
+ label: 'Option 5',
2984
+ value: 5
2985
+ }
2986
+ \]}
2987
+ popoverProps\={{
2988
+ container: {}
2989
+ }}
2990
+ />
2991
+
2992
+ ```
2993
+
2994
+ #### Props
2995
+
2996
+ | Name | Description | Default | Control |
2997
+ | --- | --- | --- | --- |
2998
+ | append |
2999
+ |
3000
+
3001
+ <IressIcon />
3002
+
3003
+
3004
+
3005
+ | Set object |
3006
+ | autoComplete |
3007
+
3008
+ |
3009
+
3010
+ 'off'
3011
+
3012
+ | Set object |
3013
+ | autoSelect |
3014
+
3015
+ |
3016
+
3017
+ true
3018
+
3019
+ | Set object |
3020
+ | clearable |
3021
+
3022
+ |
3023
+
3024
+ true
3025
+
3026
+ | Set object |
3027
+ | defaultValue |
3028
+
3029
+ Value of selected option for uncontrolled combobox.
3030
+
3031
+ LabelValueMeta\[\]
3032
+
3033
+ | \- | Set object |
3034
+ | limitDesktop |
3035
+
3036
+ |
3037
+
3038
+ 12
3039
+
3040
+ | Set object |
3041
+ | limitMobile |
3042
+
3043
+ |
3044
+
3045
+ 6
3046
+
3047
+ | Set object |
3048
+ | multiOptionTagLimit |
3049
+
3050
+ The number of select options before the view switches to a single aggregate tag.
3051
+
3052
+ number
3053
+
3054
+
3055
+
3056
+ |
3057
+
3058
+ 4
3059
+
3060
+ | Set number |
3061
+ | onChange |
3062
+
3063
+ Emitted when the value changes.
3064
+
3065
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta\[\], ) => void
3066
+
3067
+ | \- | \- |
3068
+ | options |
3069
+
3070
+ array
3071
+
3072
+
3073
+
3074
+ | \- |
3075
+
3076
+ RAW
3077
+
3078
+ * options :
3079
+
3080
+ \[
3081
+
3082
+ * 0 :
3083
+
3084
+ {...} 2 keys
3085
+
3086
+ * 1 :
3087
+
3088
+ {...} 2 keys
3089
+
3090
+ * 2 :
3091
+
3092
+ {...} 2 keys
3093
+
3094
+ * 3 :
3095
+
3096
+ {...} 2 keys
3097
+
3098
+ * 4 :
3099
+
3100
+ {...} 2 keys
3101
+
3102
+
3103
+ \]
3104
+
3105
+
3106
+
3107
+
3108
+ |
3109
+ | popoverProps |
3110
+
3111
+ object
3112
+
3113
+
3114
+
3115
+ | { } |
3116
+
3117
+ RAW
3118
+
3119
+ popoverProps :
3120
+
3121
+ {
3122
+
3123
+ }
3124
+
3125
+
3126
+
3127
+
3128
+
3129
+
3130
+
3131
+ |
3132
+ | selectedOptionsTagText |
3133
+
3134
+ Text displayed next to tag count in tag when tag limit is exceeded.
3135
+
3136
+ string
3137
+
3138
+
3139
+
3140
+ |
3141
+
3142
+ 'options selected'
3143
+
3144
+ | Set string |
3145
+ | type |
3146
+
3147
+ |
3148
+
3149
+ 'search'
3150
+
3151
+ | Set object |
3152
+ | value |
3153
+
3154
+ Value of selected option for controlled combobox.
3155
+
3156
+ LabelValueMeta\[\]
3157
+
3158
+ | \- | Set object |
3159
+ | watermark |
3160
+
3161
+ |
3162
+
3163
+ true
3164
+
3165
+ | Set object |
3166
+
3167
+ ### Tag limit
3168
+
3169
+ When combobox is in multi-select mode and the number of selected options exceeds the `multiOptionTagLimit` (`4` by default), the view will switch from a collection of tags to a single aggregate tag with a count of the number of selected options.
3170
+
3171
+ The text displayed in the single tag can be modified using the `selectedOptionsTagText` prop (it is set to `options selected` by default).
3172
+
3173
+ [](./iframe.html?id=components-combobox-multicombobox--tag-limit)
3174
+
3175
+ 3 options selected
3176
+
3177
+ None selected
3178
+
3179
+ ```
3180
+
3181
+ <IressMultiCombobox
3182
+ defaultValue\={\[
3183
+ {
3184
+ label: 'Option 1',
3185
+ value: 1
3186
+ },
3187
+ {
3188
+ label: 'Option 2',
3189
+ value: 2
3190
+ },
3191
+ {
3192
+ label: 'Option 3',
3193
+ value: 3
3194
+ }
3195
+ \]}
3196
+ multiOptionTagLimit\={2}
3197
+ options\={\[
3198
+ {
3199
+ label: 'Option 1',
3200
+ value: 1
3201
+ },
3202
+ {
3203
+ label: 'Option 2',
3204
+ value: 2
3205
+ },
3206
+ {
3207
+ label: 'Option 3',
3208
+ value: 3
3209
+ },
3210
+ {
3211
+ label: 'Option 4',
3212
+ value: 4
3213
+ },
3214
+ {
3215
+ label: 'Option 5',
3216
+ value: 5
3217
+ }
3218
+ \]}
3219
+ popoverProps\={{
3220
+ container: {}
3221
+ }}
3222
+ selectedOptionsTagText\="options selected"
3223
+ />
3224
+
3225
+ ```
3226
+
3227
+ #### Props
3228
+
3229
+ | Name | Description | Default | Control |
3230
+ | --- | --- | --- | --- |
3231
+ | append |
3232
+ |
3233
+
3234
+ <IressIcon />
3235
+
3236
+
3237
+
3238
+ | Set object |
3239
+ | autoComplete |
3240
+
3241
+ |
3242
+
3243
+ 'off'
3244
+
3245
+ | Set object |
3246
+ | autoSelect |
3247
+
3248
+ |
3249
+
3250
+ true
3251
+
3252
+ | Set object |
3253
+ | clearable |
3254
+
3255
+ |
3256
+
3257
+ true
3258
+
3259
+ | Set object |
3260
+ | defaultValue |
3261
+
3262
+ Value of selected option for uncontrolled combobox.
3263
+
3264
+ LabelValueMeta\[\]
3265
+
3266
+ | \- |
3267
+
3268
+ RAW
3269
+
3270
+ * defaultValue :
3271
+
3272
+ \[
3273
+
3274
+ * 0 :
3275
+
3276
+ {...} 2 keys
3277
+
3278
+ * 1 :
3279
+
3280
+ {...} 2 keys
3281
+
3282
+ * 2 :
3283
+
3284
+ {...} 2 keys
3285
+
3286
+
3287
+ \]
3288
+
3289
+
3290
+
3291
+
3292
+ |
3293
+ | limitDesktop |
3294
+
3295
+ |
3296
+
3297
+ 12
3298
+
3299
+ | Set object |
3300
+ | limitMobile |
3301
+
3302
+ |
3303
+
3304
+ 6
3305
+
3306
+ | Set object |
3307
+ | multiOptionTagLimit |
3308
+
3309
+ The number of select options before the view switches to a single aggregate tag.
3310
+
3311
+ number
3312
+
3313
+
3314
+
3315
+ |
3316
+
3317
+ 4
3318
+
3319
+ | |
3320
+ | onChange |
3321
+
3322
+ Emitted when the value changes.
3323
+
3324
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta\[\], ) => void
3325
+
3326
+ | \- | \- |
3327
+ | options |
3328
+
3329
+ array
3330
+
3331
+
3332
+
3333
+ | \- |
3334
+
3335
+ RAW
3336
+
3337
+ * options :
3338
+
3339
+ \[
3340
+
3341
+ * 0 :
3342
+
3343
+ {...} 2 keys
3344
+
3345
+ * 1 :
3346
+
3347
+ {...} 2 keys
3348
+
3349
+ * 2 :
3350
+
3351
+ {...} 2 keys
3352
+
3353
+ * 3 :
3354
+
3355
+ {...} 2 keys
3356
+
3357
+ * 4 :
3358
+
3359
+ {...} 2 keys
3360
+
3361
+
3362
+ \]
3363
+
3364
+
3365
+
3366
+
3367
+ |
3368
+ | popoverProps |
3369
+
3370
+ object
3371
+
3372
+
3373
+
3374
+ | { } |
3375
+
3376
+ RAW
3377
+
3378
+ popoverProps :
3379
+
3380
+ {
3381
+
3382
+ }
3383
+
3384
+
3385
+
3386
+
3387
+
3388
+
3389
+
3390
+ |
3391
+ | selectedOptionsTagText |
3392
+
3393
+ Text displayed next to tag count in tag when tag limit is exceeded.
3394
+
3395
+ string
3396
+
3397
+
3398
+
3399
+ |
3400
+
3401
+ 'options selected'
3402
+
3403
+ | options selected |
3404
+ | type |
3405
+
3406
+ |
3407
+
3408
+ 'search'
3409
+
3410
+ | Set object |
3411
+ | value |
3412
+
3413
+ Value of selected option for controlled combobox.
3414
+
3415
+ LabelValueMeta\[\]
3416
+
3417
+ | \- | Set object |
3418
+ | watermark |
3419
+
3420
+ |
3421
+
3422
+ true
3423
+
3424
+ | Set object |
3425
+
3426
+ ### Readonly
3427
+
3428
+ The `readOnly` prop can be set to prevent the user from changing the value of the multi-combobox. This will change the input to a custom read-only style and the user will not be able to interact with the input. Multiple values are seperated by a comma.
3429
+
3430
+ 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).
3431
+
3432
+ [](./iframe.html?id=components-combobox-multicombobox--readonly)
3433
+
3434
+ Option 1, Option 2, Option 3
3435
+
3436
+ ```
3437
+
3438
+ <IressMultiCombobox
3439
+ defaultValue\={\[
3440
+ {
3441
+ label: 'Option 1',
3442
+ value: 1
3443
+ },
3444
+ {
3445
+ label: 'Option 2',
3446
+ value: 2
3447
+ },
3448
+ {
3449
+ label: 'Option 3',
3450
+ value: 3
3451
+ }
3452
+ \]}
3453
+ options\={\[
3454
+ {
3455
+ label: 'Option 1',
3456
+ value: 1
3457
+ },
3458
+ {
3459
+ label: 'Option 2',
3460
+ value: 2
3461
+ },
3462
+ {
3463
+ label: 'Option 3',
3464
+ value: 3
3465
+ },
3466
+ {
3467
+ label: 'Option 4',
3468
+ value: 4
3469
+ },
3470
+ {
3471
+ label: 'Option 5',
3472
+ value: 5
3473
+ }
3474
+ \]}
3475
+ popoverProps\={{
3476
+ container: {}
3477
+ }}
3478
+ readOnly
3479
+ />
3480
+
3481
+ ```
3482
+
3483
+ #### Props
3484
+
3485
+ | Name | Description | Default | Control |
3486
+ | --- | --- | --- | --- |
3487
+ | append |
3488
+ |
3489
+
3490
+ <IressIcon />
3491
+
3492
+
3493
+
3494
+ | Set object |
3495
+ | autoComplete |
3496
+
3497
+ |
3498
+
3499
+ 'off'
3500
+
3501
+ | Set object |
3502
+ | autoSelect |
3503
+
3504
+ |
3505
+
3506
+ true
3507
+
3508
+ | Set object |
3509
+ | clearable |
3510
+
3511
+ |
3512
+
3513
+ true
3514
+
3515
+ | Set object |
3516
+ | defaultValue |
3517
+
3518
+ Value of selected option for uncontrolled combobox.
3519
+
3520
+ LabelValueMeta\[\]
3521
+
3522
+ | \- |
3523
+
3524
+ RAW
3525
+
3526
+ * defaultValue :
3527
+
3528
+ \[
3529
+
3530
+ * 0 :
3531
+
3532
+ {...} 2 keys
3533
+
3534
+ * 1 :
3535
+
3536
+ {...} 2 keys
3537
+
3538
+ * 2 :
3539
+
3540
+ {...} 2 keys
3541
+
3542
+
3543
+ \]
3544
+
3545
+
3546
+
3547
+
3548
+ |
3549
+ | limitDesktop |
3550
+
3551
+ |
3552
+
3553
+ 12
3554
+
3555
+ | Set object |
3556
+ | limitMobile |
3557
+
3558
+ |
3559
+
3560
+ 6
3561
+
3562
+ | Set object |
3563
+ | multiOptionTagLimit |
3564
+
3565
+ The number of select options before the view switches to a single aggregate tag.
3566
+
3567
+ number
3568
+
3569
+
3570
+
3571
+ |
3572
+
3573
+ 4
3574
+
3575
+ | Set number |
3576
+ | onChange |
3577
+
3578
+ Emitted when the value changes.
3579
+
3580
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta\[\], ) => void
3581
+
3582
+ | \- | \- |
3583
+ | options |
3584
+
3585
+ array
3586
+
3587
+
3588
+
3589
+ | \- |
3590
+
3591
+ RAW
3592
+
3593
+ * options :
3594
+
3595
+ \[
3596
+
3597
+ * 0 :
3598
+
3599
+ {...} 2 keys
3600
+
3601
+ * 1 :
3602
+
3603
+ {...} 2 keys
3604
+
3605
+ * 2 :
3606
+
3607
+ {...} 2 keys
3608
+
3609
+ * 3 :
3610
+
3611
+ {...} 2 keys
3612
+
3613
+ * 4 :
3614
+
3615
+ {...} 2 keys
3616
+
3617
+
3618
+ \]
3619
+
3620
+
3621
+
3622
+
3623
+ |
3624
+ | popoverProps |
3625
+
3626
+ object
3627
+
3628
+
3629
+
3630
+ | { } |
3631
+
3632
+ RAW
3633
+
3634
+ popoverProps :
3635
+
3636
+ {
3637
+
3638
+ }
3639
+
3640
+
3641
+
3642
+
3643
+
3644
+
3645
+
3646
+ |
3647
+ | readOnly |
3648
+
3649
+ boolean
3650
+
3651
+
3652
+
3653
+ | \- | FalseTrue |
3654
+ | selectedOptionsTagText |
3655
+
3656
+ Text displayed next to tag count in tag when tag limit is exceeded.
3657
+
3658
+ string
3659
+
3660
+
3661
+
3662
+ |
3663
+
3664
+ 'options selected'
3665
+
3666
+ | Set string |
3667
+ | type |
3668
+
3669
+ |
3670
+
3671
+ 'search'
3672
+
3673
+ | Set object |
3674
+ | value |
3675
+
3676
+ Value of selected option for controlled combobox.
3677
+
3678
+ LabelValueMeta\[\]
3679
+
3680
+ | \- | Set object |
3681
+ | watermark |
3682
+
3683
+ |
3684
+
3685
+ true
3686
+
3687
+ | Set object |
3688
+
3689
+ Testing
3690
+ -------
3691
+
3692
+ To help you effectively test the combobox component, we have provided a few tips based on the behaviour of the component and our own experience.
3693
+
3694
+ **Note:** These are suggestions and not requirements. You should test the component in a way that best suits your use case.
3695
+
3696
+ ### Partial query matching
3697
+
3698
+ 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.
3699
+
3700
+ If you are using `meta`, `prepend` or `append` props in `LabelValueMeta`, you should also consider this in your search query for the option.
3701
+
3702
+ render(
3703
+ <IressCombobox
3704
+ options\={\[
3705
+ { label: 'Luke Skywalker', value: 'Luke Skywalker', meta: 'male' },
3706
+ \]}
3707
+ />,
3708
+ );
3709
+ const autocomplete \= screen.getByRole('combobox');
3710
+ await user.type(autocomplete, 'lu');
3711
+ // Exact string match with a space to denote the highlighted value
3712
+ const option \= await screen.findByRole('option', {
3713
+ name: 'Lu ke Skywalker male',
3714
+ });
3715
+ expect(option).toBeInTheDocument();
3716
+ // Using a regex to match the string
3717
+ const option \= await screen.findByRole('option', { name: /Skywalker/ });
3718
+ expect(option).toBeInTheDocument();
3719
+
3720
+ ```
3721
+
3722
+ ### Query for minimal characters
3723
+
3724
+ 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.
3725
+
3726
+ render(<IressCombobox options\={searchStarWarsCharacters} />);
3727
+ const autocomplete \= screen.getByRole('combobox');
3728
+ // DO: Use the shortest query to return the desired result
3729
+ await user.type(autocomplete, 'lu');
3730
+ const option \= await screen.findAllByRole('option');
3731
+ // DON'T: Use a long query to return the desired result
3732
+ await user.type(autocomplete, 'luke skywalker');
3733
+ const option \= await screen.findAllByRole('option');
3734
+
3735
+ ```
3736
+
3737
+ ### Use mocking when testing APIs
3738
+
3739
+ 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.
3740
+
3741
+ We recommend using [Mock Service Worker](https://mswjs.io/) to mock the API calls in your tests.
3742
+
3743
+ // src/mocks/handlers.ts
3744
+ import { http, HttpResponse } from 'msw';
3745
+ export const handlers \= \[
3746
+ // Intercept "GET https://swapi.py4e.com/api/people" requests...
3747
+ http.get('https://swapi.py4e.com/api/people', () \=> {
3748
+ // ...and respond to them using this JSON response.
3749
+ return HttpResponse.json(\[
3750
+ { name: 'Luke Skywalker', gender: 'male' },
3751
+ { name: 'Leia Skywalker', gender: 'female' },
3752
+ \]);
3753
+ }),
3754
+ \];
3755
+ // src/mocks/node.js
3756
+ import { setupServer } from 'msw/node';
3757
+ import { handlers } from './handlers';
3758
+ export const server \= setupServer(...handlers);
3759
+ // src/CustomAutocomplete.test.tsx
3760
+ import { server } from './mocks/node';
3761
+ server.listen();
3762
+ render(<IressCombobox options\={searchStarWarsCharacters} />);
3763
+ const autocomplete \= screen.getByRole('combobox');
3764
+ await user.type(autocomplete, 'lu');
3765
+ const option \= await screen.findAllByRole('option');
3766
+
3767
+ ```