@splunk/react-ui 5.0.0-rc.2 → 5.1.0

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 (104) hide show
  1. package/Accordion.js +59 -59
  2. package/Avatar.js +20 -20
  3. package/Breadcrumbs.js +46 -46
  4. package/Button.js +24 -24
  5. package/CHANGELOG.md +380 -0
  6. package/Calendar.js +69 -69
  7. package/Card.js +68 -68
  8. package/Chip.js +16 -16
  9. package/Clickable.js +29 -29
  10. package/Code.js +654 -519
  11. package/CollapsiblePanel.js +112 -112
  12. package/Color.js +107 -107
  13. package/ColumnLayout.js +35 -35
  14. package/ComboBox.js +190 -206
  15. package/ControlGroup.js +129 -121
  16. package/Date.js +148 -146
  17. package/DefinitionList.js +26 -26
  18. package/Dropdown.js +9 -9
  19. package/DualListbox.js +701 -717
  20. package/File.js +403 -403
  21. package/FormRows.js +66 -63
  22. package/Image.js +15 -15
  23. package/JSONTree.js +458 -357
  24. package/Layer.js +60 -72
  25. package/MIGRATION.md +550 -1
  26. package/Markdown.js +66 -66
  27. package/Menu.js +44 -44
  28. package/Message.js +47 -43
  29. package/Modal.js +49 -49
  30. package/ModalLayer.js +21 -17
  31. package/Monogram.js +16 -16
  32. package/Multiselect.js +673 -669
  33. package/Number.js +100 -100
  34. package/Paginator.js +7 -7
  35. package/Popover.js +473 -424
  36. package/Progress.js +12 -12
  37. package/Prose.js +6 -6
  38. package/README.md +6 -6
  39. package/RadioBar.js +180 -166
  40. package/RadioList.js +80 -79
  41. package/ResultsMenu.js +129 -128
  42. package/Scroll.js +50 -50
  43. package/Search.js +148 -164
  44. package/Select.js +674 -674
  45. package/Slider.js +30 -30
  46. package/SlidingPanels.js +24 -24
  47. package/SplitButton.js +50 -50
  48. package/StepBar.js +100 -100
  49. package/Switch.js +45 -45
  50. package/TabBar.js +196 -196
  51. package/TabLayout.js +16 -16
  52. package/Table.js +1207 -1193
  53. package/Text.js +65 -65
  54. package/TextArea.js +108 -93
  55. package/Tooltip.js +203 -197
  56. package/TransitionOpen.js +4 -1
  57. package/Tree.js +464 -366
  58. package/package.json +11 -11
  59. package/stubs-dependencies.d.ts +0 -70
  60. package/stubs-splunkui.d.ts +4 -0
  61. package/types/src/Code/Code.d.ts +17 -1
  62. package/types/src/Code/LineHighlights.d.ts +11 -0
  63. package/types/src/Code/LineNumbers.d.ts +6 -0
  64. package/types/src/Code/docs/examples/LineHighlights.d.ts +3 -0
  65. package/types/src/Code/docs/examples/LineNumbers.d.ts +3 -0
  66. package/types/src/Code/docs/examples/LineNumbersCustomStart.d.ts +3 -0
  67. package/types/src/Date/Date.d.ts +6 -1
  68. package/types/src/DefinitionList/DefinitionList.d.ts +6 -6
  69. package/types/src/Dropdown/Dropdown.d.ts +1 -0
  70. package/types/src/FormRows/FormRows.d.ts +1 -1
  71. package/types/src/JSONTree/JSONTreeItem.d.ts +5 -2
  72. package/types/src/Markdown/Markdown.d.ts +1 -1
  73. package/types/src/Markdown/renderers/MarkdownBlockquote.d.ts +1 -1
  74. package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +1 -1
  75. package/types/src/Markdown/renderers/index.d.ts +1 -1
  76. package/types/src/Popover/Popover.d.ts +8 -2
  77. package/types/src/RadioBar/Option.d.ts +1 -1
  78. package/types/src/RadioBar/RadioBar.d.ts +13 -6
  79. package/types/src/RadioBar/RadioBarContext.d.ts +4 -2
  80. package/types/src/RadioList/RadioList.d.ts +2 -1
  81. package/types/src/ResultsMenu/ResultsMenu.d.ts +2 -1
  82. package/types/src/ScreenReaderContent/docs/examples/SkipLink.d.ts +3 -0
  83. package/types/src/Scroll/Inner.d.ts +1 -1
  84. package/types/src/Select/Option.d.ts +1 -1
  85. package/types/src/Select/Select.d.ts +1 -1
  86. package/types/src/Slider/docs/examples/Controlled.d.ts +1 -1
  87. package/types/src/TabLayout/Panel.d.ts +0 -1
  88. package/types/src/Table/Head.d.ts +1 -0
  89. package/types/src/Table/HeadCell.d.ts +2 -3
  90. package/types/src/Table/HeadDropdownCell.d.ts +2 -2
  91. package/types/src/Table/HeadInner.d.ts +4 -4
  92. package/types/src/Table/KeyboardSensor.d.ts +1 -1
  93. package/types/src/Table/RowDragCell.d.ts +1 -1
  94. package/types/src/Tooltip/Tooltip.d.ts +10 -5
  95. package/types/src/Tree/Item.d.ts +63 -0
  96. package/types/src/Tree/Tree.d.ts +13 -6
  97. package/types/src/Tree/TreeContext.d.ts +1 -1
  98. package/types/src/Tree/index.d.ts +1 -1
  99. package/types/src/useControlled/useControlled.d.ts +3 -1
  100. package/useControlled.js +29 -13
  101. package/CHANGELOG.v5.md +0 -354
  102. package/MIGRATION.v5.md +0 -552
  103. package/types/src/Button/docs/examples/Truncated.d.ts +0 -3
  104. package/types/src/Tree/TreeItem.d.ts +0 -44
package/Multiselect.js CHANGED
@@ -2,18 +2,33 @@
2
2
  // webpackBootstrap
3
3
  /******/ "use strict";
4
4
  /******/ var e = {
5
- /***/ 2907:
5
+ /***/ 3639:
6
6
  /***/ (e, n, r) => {
7
7
  // EXPORTS
8
8
  r.d(n, {
9
- default: () => /* reexport */ i
9
+ default: () => /* reexport */ s
10
10
  });
11
+ // UNUSED EXPORTS: isAllowedType, isPrimitive
11
12
  // EXTERNAL MODULE: external "react"
12
13
  var t = r(9497);
14
+ // CONCATENATED MODULE: external "lodash/isEqual"
15
+ const o = require("lodash/isEqual");
13
16
  // EXTERNAL MODULE: external "lodash/has"
14
- var o = r(5919);
15
- var l = r.n(o);
17
+ var l = r(5919);
18
+ var a = r.n(l);
16
19
  // CONCATENATED MODULE: ./src/useControlled/useControlled.tsx
20
+ function i(e) {
21
+ return e === null || e === undefined || typeof e === "boolean" || typeof e === "string" || typeof e === "number";
22
+ }
23
+ function u(e) {
24
+ if (i(e)) {
25
+ return true;
26
+ }
27
+ if (Array.isArray(e)) {
28
+ return e.every(i);
29
+ }
30
+ return false;
31
+ }
17
32
  /**
18
33
  * This is a private component not intended for use outside @splunk/react-ui
19
34
  *
@@ -23,10 +38,9 @@
23
38
  * are not happening.
24
39
  *
25
40
  * Return the controlled state of the component.
26
- */
27
- function a(e) {
28
- var n = e.componentProps, r = e.componentName, o = r === void 0 ? "this component" : r, a = e.defaultValuePropName, i = a === void 0 ? "defaultValue" : a, u = e.valuePropName, c = u === void 0 ? "value" : u;
29
- var s = (0, t.useRef)(l()(n, c));
41
+ */ function c(e) {
42
+ var n = e.componentProps, r = e.componentName, o = r === void 0 ? "this component" : r, l = e.defaultValuePropName, i = l === void 0 ? "defaultValue" : l, u = e.valuePropName, c = u === void 0 ? "value" : u;
43
+ var s = (0, t.useRef)(a()(n, c));
30
44
  var d = (0, t.useRef)(n[i]);
31
45
  (0, t.useEffect)((function() {
32
46
  if (false) {}
@@ -34,10 +48,11 @@
34
48
  (0, t.useEffect)((function() {
35
49
  if (false) {}
36
50
  if (false) {}
51
+ if (false) {}
37
52
  }), [ o, n, i, c ]);
38
53
  return s.current;
39
54
  }
40
- /* harmony default export */ const i = a;
55
+ /* harmony default export */ const s = c;
41
56
  } // CONCATENATED MODULE: ./src/useControlled/index.ts
42
57
  /***/ ,
43
58
  /***/ 5919:
@@ -136,17 +151,17 @@
136
151
  r.d(t, {
137
152
  Divider: () => /* reexport */ u.Divider,
138
153
  Heading: () => /* reexport */ u.Heading,
139
- Option: () => /* reexport */ E,
140
- default: () => /* reexport */ Hr
154
+ Option: () => /* reexport */ M,
155
+ default: () => /* reexport */ Kr
141
156
  });
142
157
  // EXTERNAL MODULE: external "react"
143
158
  var e = r(9497);
144
159
  var n = r.n(e);
145
- // CONCATENATED MODULE: external "prop-types"
146
- const o = require("prop-types");
147
- var l = r.n(o);
148
160
  // EXTERNAL MODULE: external "lodash/has"
149
- var a = r(5919);
161
+ var o = r(5919);
162
+ var l = r.n(o);
163
+ // CONCATENATED MODULE: external "prop-types"
164
+ const a = require("prop-types");
150
165
  var i = r.n(a);
151
166
  // CONCATENATED MODULE: external "@splunk/react-ui/Menu"
152
167
  const u = require("@splunk/react-ui/Menu");
@@ -197,18 +212,18 @@
197
212
  return e;
198
213
  }
199
214
  function m(e, n, r) {
200
- return (n = g(n)) in e ? Object.defineProperty(e, n, {
215
+ return (n = y(n)) in e ? Object.defineProperty(e, n, {
201
216
  value: r,
202
217
  enumerable: !0,
203
218
  configurable: !0,
204
219
  writable: !0
205
220
  }) : e[n] = r, e;
206
221
  }
207
- function g(e) {
208
- var n = y(e, "string");
222
+ function y(e) {
223
+ var n = g(e, "string");
209
224
  return "symbol" == f(n) ? n : n + "";
210
225
  }
211
- function y(e, n) {
226
+ function g(e, n) {
212
227
  if ("object" != f(e) || !e) return e;
213
228
  var r = e[Symbol.toPrimitive];
214
229
  if (void 0 !== r) {
@@ -242,52 +257,52 @@
242
257
  }
243
258
  var S = {
244
259
  /** @private */
245
- active: l().bool,
246
- children: l().node,
247
- description: l().string,
248
- descriptionPosition: l().oneOf([ "right", "bottom" ]),
249
- disabled: l().bool,
250
- elementRef: l().oneOfType([ l().func, l().object ]),
251
- hidden: l().bool,
252
- icon: l().node,
253
- label: l().string.isRequired,
260
+ active: i().bool,
261
+ children: i().node,
262
+ description: i().string,
263
+ descriptionPosition: i().oneOf([ "right", "bottom" ]),
264
+ disabled: i().bool,
265
+ elementRef: i().oneOfType([ i().func, i().object ]),
266
+ hidden: i().bool,
267
+ icon: i().node,
268
+ label: i().string.isRequired,
254
269
  /**
255
270
  * @private Passed down from <BaseSelect>
256
271
  */
257
- multiple: l().bool,
258
- matchRanges: l().arrayOf(l().shape({
259
- start: l().number.isRequired,
260
- end: l().number.isRequired
272
+ multiple: i().bool,
273
+ matchRanges: i().arrayOf(i().shape({
274
+ start: i().number.isRequired,
275
+ end: i().number.isRequired
261
276
  })),
262
277
  /** @private */
263
- onClick: l().func,
278
+ onClick: i().func,
264
279
  /** @private */
265
- role: l().oneOf([ "menuitemcheckbox", "option" ]),
280
+ role: i().oneOf([ "menuitemcheckbox", "option" ]),
266
281
  /** @private */
267
- selected: l().oneOfType([ l().bool, l().oneOf([ "some" ]) ]),
268
- truncate: l().bool,
269
- value: l().oneOfType([ l().string, l().number, l().bool ]).isRequired
282
+ selected: i().oneOfType([ i().bool, i().oneOf([ "some" ]) ]),
283
+ truncate: i().bool,
284
+ value: i().oneOfType([ i().string, i().number, i().bool ]).isRequired
270
285
  };
271
286
  /**
272
287
  * An option within a `Multiselect`.
273
288
  */ function w(r) {
274
- var t = r.children, o = r.descriptionPosition, l = o === void 0 ? "bottom" : o, a = r.disabled, i = r.elementRef, c = r.icon, s = r.label, d = r.multiple, f = r.onClick, v = r.role, m = v === void 0 ? "option" : v, g = r.value, y = h(r, [ "children", "descriptionPosition", "disabled", "elementRef", "icon", "label", "multiple", "onClick", "role", "value" ]);
289
+ var t = r.children, o = r.descriptionPosition, l = o === void 0 ? "bottom" : o, a = r.disabled, i = r.elementRef, c = r.icon, s = r.label, d = r.multiple, f = r.onClick, v = r.role, m = v === void 0 ? "option" : v, y = r.value, g = h(r, [ "children", "descriptionPosition", "disabled", "elementRef", "icon", "label", "multiple", "onClick", "role", "value" ]);
275
290
  // @docs-props-type OptionPropsBase
276
291
  var O = (0, e.useCallback)((function(e) {
277
292
  if (!a) {
278
293
  f === null || f === void 0 ? void 0 : f(e, {
279
- value: g
294
+ value: y
280
295
  });
281
296
  }
282
- }), [ a, f, g ]);
283
- var S = g.toString();
297
+ }), [ a, f, y ]);
298
+ var S = y.toString();
284
299
  var w = b({
285
300
  descriptionPosition: l,
286
301
  disabled: a ? "disabled" : undefined
287
- }, y);
302
+ }, g);
288
303
 
289
304
  return n().createElement(u.Item, p({
290
- "data-test-value": g,
305
+ "data-test-value": y,
291
306
  "data-test": "option",
292
307
  elementRef: i
293
308
  }, w, {
@@ -339,39 +354,39 @@
339
354
  }
340
355
  var P = {
341
356
  /** @private */
342
- active: l().bool,
343
- children: l().node,
357
+ active: i().bool,
358
+ children: i().node,
344
359
  /**
345
360
  * @private this is passed down from Multiselect.
346
361
  */
347
- compact: l().bool,
348
- description: l().string,
349
- descriptionPosition: l().oneOf([ "right", "bottom" ]),
350
- disabled: l().bool,
351
- elementRef: l().oneOfType([ l().func, l().object ]),
352
- hidden: l().bool,
353
- icon: l().node,
354
- label: l().string.isRequired,
355
- matchRanges: l().arrayOf(l().shape({
356
- start: l().number.isRequired,
357
- end: l().number.isRequired
362
+ compact: i().bool,
363
+ description: i().string,
364
+ descriptionPosition: i().oneOf([ "right", "bottom" ]),
365
+ disabled: i().bool,
366
+ elementRef: i().oneOfType([ i().func, i().object ]),
367
+ hidden: i().bool,
368
+ icon: i().node,
369
+ label: i().string.isRequired,
370
+ matchRanges: i().arrayOf(i().shape({
371
+ start: i().number.isRequired,
372
+ end: i().number.isRequired
358
373
  })),
359
374
  /** @private */
360
- onClick: l().func,
375
+ onClick: i().func,
361
376
  /** @private */
362
- role: l().oneOf([ "menuitemcheckbox", "option" ]),
377
+ role: i().oneOf([ "menuitemcheckbox", "option" ]),
363
378
  /** @private */
364
- selected: l().bool,
365
- selectedAppearance: l().oneOf([ "info", "success", "warning", "error" ]),
366
- selectedBackgroundColor: l().string,
367
- selectedForegroundColor: l().string,
368
- truncate: l().bool,
369
- value: l().oneOfType([ l().string, l().number, l().bool ]).isRequired
379
+ selected: i().bool,
380
+ selectedAppearance: i().oneOf([ "info", "success", "warning", "error" ]),
381
+ selectedBackgroundColor: i().string,
382
+ selectedForegroundColor: i().string,
383
+ truncate: i().bool,
384
+ value: i().oneOfType([ i().string, i().number, i().bool ]).isRequired
370
385
  };
371
386
  /**
372
387
  * An option within a `Multiselect`.
373
- */ function M(e) {
374
- var r = e.compact, t = e.children, o = e.description, l = e.descriptionPosition, a = l === void 0 ? "bottom" : l, i = e.disabled, u = e.elementRef, c = e.hidden, s = e.icon, d = e.label, f = e.matchRanges, p = e.role, v = e.selected, b = e.truncate, m = e.value, g = x(e, [ "compact", "children", "description", "descriptionPosition", "disabled", "elementRef", "hidden", "icon", "label", "matchRanges", "role", "selected", "truncate", "value" ]);
388
+ */ function E(e) {
389
+ var r = e.compact, t = e.children, o = e.description, l = e.descriptionPosition, a = l === void 0 ? "bottom" : l, i = e.disabled, u = e.elementRef, c = e.hidden, s = e.icon, d = e.label, f = e.matchRanges, p = e.role, v = e.selected, b = e.truncate, m = e.value, y = x(e, [ "compact", "children", "description", "descriptionPosition", "disabled", "elementRef", "hidden", "icon", "label", "matchRanges", "role", "selected", "truncate", "value" ]);
375
390
  // @docs-props-type OptionPropsBase
376
391
  // selectedAppearance, selectedBackgroundColor, and selectedForegroundColor are not used directly by the Option component.
377
392
  // They are consumed by the parent component (Multiselect-Normal) to render the Chip, so they are not included in the above prop list.
@@ -389,12 +404,12 @@
389
404
  selected: v,
390
405
  truncate: b,
391
406
  value: m
392
- }, g, {
407
+ }, y, {
393
408
  multiple: r
394
409
  }), t || d);
395
410
  }
396
- M.propTypes = P;
397
- /* harmony default export */ const E = M;
411
+ E.propTypes = P;
412
+ /* harmony default export */ const M = E;
398
413
  // CONCATENATED MODULE: external "lodash/castArray"
399
414
  const R = require("lodash/castArray");
400
415
  var A = r.n(R);
@@ -402,20 +417,20 @@
402
417
  const I = require("lodash/find");
403
418
  var B = r.n(I);
404
419
  // CONCATENATED MODULE: external "lodash/forEachRight"
405
- const T = require("lodash/forEachRight");
406
- var L = r.n(T);
420
+ const N = require("lodash/forEachRight");
421
+ var L = r.n(N);
407
422
  // CONCATENATED MODULE: external "lodash/includes"
408
- const N = require("lodash/includes");
409
- var V = r.n(N);
423
+ const V = require("lodash/includes");
424
+ var q = r.n(V);
410
425
  // CONCATENATED MODULE: external "lodash/memoize"
411
426
  const D = require("lodash/memoize");
412
- var q = r.n(D);
427
+ var T = r.n(D);
413
428
  // CONCATENATED MODULE: external "lodash/pick"
414
429
  const F = require("lodash/pick");
415
430
  var _ = r.n(F);
416
431
  // CONCATENATED MODULE: external "lodash/uniq"
417
- const H = require("lodash/uniq");
418
- var K = r.n(H);
432
+ const K = require("lodash/uniq");
433
+ var H = r.n(K);
419
434
  // CONCATENATED MODULE: external "lodash/without"
420
435
  const z = require("lodash/without");
421
436
  var $ = r.n(z);
@@ -434,11 +449,11 @@
434
449
  // CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
435
450
  const ee = require("@splunk/react-ui/ResultsMenu");
436
451
  var ne = r.n(ee);
437
- // CONCATENATED MODULE: external "@splunk/react-ui/Text"
438
- const re = require("@splunk/react-ui/Text");
439
- var te = r.n(re);
440
452
  // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
441
- const oe = require("@splunk/react-ui/ScreenReaderContent");
453
+ const re = require("@splunk/react-ui/ScreenReaderContent");
454
+ var te = r.n(re);
455
+ // CONCATENATED MODULE: external "@splunk/react-ui/Text"
456
+ const oe = require("@splunk/react-ui/Text");
442
457
  var le = r.n(oe);
443
458
  // CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
444
459
  const ae = require("@splunk/react-ui/usePrevious");
@@ -447,18 +462,20 @@
447
462
  const ue = require("@splunk/ui-utils/filter");
448
463
  // CONCATENATED MODULE: external "@splunk/ui-utils/id"
449
464
  const ce = require("@splunk/ui-utils/id");
465
+ // CONCATENATED MODULE: external "@splunk/ui-utils/scroll"
466
+ const se = require("@splunk/ui-utils/scroll");
450
467
  // CONCATENATED MODULE: ./src/Select/SelectAllOption.tsx
451
- var se = {
452
- active: l().bool,
453
- changedToggle: l().bool,
454
- elementRef: l().oneOfType([ l().func, l().object ]),
455
- id: l().string,
456
- onClick: l().func,
457
- selectAllLabel: l().string,
458
- selected: l().oneOfType([ l().bool, l().oneOf([ "some" ]) ]),
459
- totalCount: l().number
468
+ var de = {
469
+ active: i().bool,
470
+ changedToggle: i().bool,
471
+ elementRef: i().oneOfType([ i().func, i().object ]),
472
+ id: i().string,
473
+ onClick: i().func,
474
+ selectAllLabel: i().string,
475
+ selected: i().oneOfType([ i().bool, i().oneOf([ "some" ]) ]),
476
+ totalCount: i().number
460
477
  };
461
- function de(e) {
478
+ function fe(e) {
462
479
  var r = e.active, t = e.elementRef, o = e.id, l = e.onClick, a = e.selectAllLabel, i = e.totalCount, u = e.changedToggle, c = e.selected;
463
480
  // When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
464
481
  var s = u ? " (".concat(i === null || i === void 0 ? void 0 : i.toString(), ")") : "";
@@ -481,21 +498,21 @@
481
498
  value: "selectAll"
482
499
  });
483
500
  }
484
- de.propTypes = se;
485
- /* harmony default export */ const fe = de;
501
+ fe.propTypes = de;
502
+ /* harmony default export */ const pe = fe;
486
503
  // CONCATENATED MODULE: external "styled-components"
487
- const pe = require("styled-components");
488
- var ve = r.n(pe);
504
+ const ve = require("styled-components");
505
+ var be = r.n(ve);
489
506
  // CONCATENATED MODULE: external "@splunk/react-ui/Button"
490
- const be = require("@splunk/react-ui/Button");
491
- var me = r.n(be);
507
+ const me = require("@splunk/react-ui/Button");
508
+ var ye = r.n(me);
492
509
  // CONCATENATED MODULE: external "@splunk/react-ui/Divider"
493
510
  const ge = require("@splunk/react-ui/Divider");
494
- var ye = r.n(ge);
511
+ var he = r.n(ge);
495
512
  // CONCATENATED MODULE: external "@splunk/themes"
496
- const he = require("@splunk/themes");
513
+ const Oe = require("@splunk/themes");
497
514
  // CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
498
- var Oe = ve()(me()).withConfig({
515
+ var Se = be()(ye()).withConfig({
499
516
  displayName: "SelectBaseStyles__StyledButton",
500
517
  componentId: "sc-16cj7sk-0"
501
518
  })([ "&[data-inline]{width:", ";}", "" ], (function(e) {
@@ -505,52 +522,52 @@
505
522
  var n = e.$multiple;
506
523
  return !n && "flex-grow: 0;";
507
524
  }));
508
- var Se = ve().span.withConfig({
525
+ var we = be().span.withConfig({
509
526
  displayName: "SelectBaseStyles__StyledLinkIcon",
510
527
  componentId: "sc-16cj7sk-1"
511
- })([ "padding-right:", ";" ], he.variables.spacingXSmall);
512
- var we = ve().span.withConfig({
528
+ })([ "padding-right:", ";" ], Oe.variables.spacingXSmall);
529
+ var Ce = be().span.withConfig({
513
530
  displayName: "SelectBaseStyles__StyledLinkCaret",
514
531
  componentId: "sc-16cj7sk-2"
515
- })([ "padding-left:", ";" ], he.variables.spacingXSmall);
516
- var Ce = ve().div.withConfig({
532
+ })([ "padding-left:", ";" ], Oe.variables.spacingXSmall);
533
+ var ke = be().div.withConfig({
517
534
  displayName: "SelectBaseStyles__StyledFilter",
518
535
  componentId: "sc-16cj7sk-3"
519
- })([ "padding:", " ", " ", ";min-width:160px;" ], he.variables.spacingLarge, he.variables.spacingLarge, he.variables.spacingSmall);
520
- var ke = ve().span.withConfig({
536
+ })([ "padding:", " ", " ", ";min-width:160px;" ], Oe.variables.spacingLarge, Oe.variables.spacingLarge, Oe.variables.spacingSmall);
537
+ var xe = be().span.withConfig({
521
538
  displayName: "SelectBaseStyles__StyledCount",
522
539
  componentId: "sc-16cj7sk-4"
523
- })([ "padding-right:", ";" ], he.variables.spacingXSmall);
524
- var xe = ve()(Z()).withConfig({
540
+ })([ "padding-right:", ";" ], Oe.variables.spacingXSmall);
541
+ var je = be()(Z()).withConfig({
525
542
  displayName: "SelectBaseStyles__StyledControlsLink",
526
543
  componentId: "sc-16cj7sk-5"
527
544
  })([ "", ";" ], (function(e) {
528
545
  var n = e.$disabled;
529
- return n && (0, pe.css)([ "color:", ";" ], he.variables.contentColorDisabled);
546
+ return n && (0, ve.css)([ "color:", ";" ], Oe.variables.contentColorDisabled);
530
547
  }));
531
- var je = ve().div.withConfig({
548
+ var Pe = be().div.withConfig({
532
549
  displayName: "SelectBaseStyles__StyledToggleAllControls",
533
550
  componentId: "sc-16cj7sk-6"
534
- })([ "", ";gap:", ";padding:", " ", " ", ";" ], he.mixins.reset("flex"), he.variables.spacingMedium, he.variables.spacingXSmall, he.variables.spacingLarge, he.variables.spacingSmall);
535
- var Pe = ve()(ye()).withConfig({
551
+ })([ "", ";gap:", ";padding:", " ", " ", ";" ], Oe.mixins.reset("flex"), Oe.variables.spacingMedium, Oe.variables.spacingXSmall, Oe.variables.spacingLarge, Oe.variables.spacingSmall);
552
+ var Ee = be()(he()).withConfig({
536
553
  displayName: "SelectBaseStyles__StyledControlsDivider",
537
554
  componentId: "sc-16cj7sk-7"
538
- })([ "border-color:", ";" ], he.variables.borderColor);
539
- // EXTERNAL MODULE: ./src/useControlled/index.ts + 1 modules
540
- var Me = r(2907);
555
+ })([ "border-color:", ";" ], Oe.variables.borderColor);
556
+ // EXTERNAL MODULE: ./src/useControlled/index.ts + 2 modules
557
+ var Me = r(3639);
541
558
  // CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
542
559
  // A utility for matching keyboard characters to list values
543
- var Ee = function e(n, r) {
560
+ var Re = function e(n, r) {
544
561
  return n ? n.label.charAt(r).toLowerCase() : "";
545
562
  };
546
- var Re = function e(n, r) {
563
+ var Ae = function e(n, r) {
547
564
  if (!n.length) {
548
565
  return n;
549
566
  }
550
567
  var t = null;
551
568
  var o = false;
552
569
  var l = n.filter((function(e) {
553
- var n = Ee(e, r.index);
570
+ var n = Re(e, r.index);
554
571
  if (n === r.value) {
555
572
  o = true;
556
573
  return true;
@@ -558,7 +575,7 @@
558
575
  // If we haven't found a match yet, keep track of the next closest match.
559
576
  // Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
560
577
  if (!o) {
561
- var l = Ee(t, r.index);
578
+ var l = Re(t, r.index);
562
579
  if (!l) {
563
580
  t = e;
564
581
  } else if (n > r.value) {
@@ -575,24 +592,6 @@
575
592
  }));
576
593
  return l.length === 0 && t ? [ t ] : l;
577
594
  };
578
- // CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
579
- // A utility that attempts to move an element into view by scrolling it's derived parent.
580
- var Ae = function e(n) {
581
- if (!n) {
582
- return;
583
- }
584
- var r = n.offsetParent;
585
- if (!r) {
586
- return;
587
- }
588
- // Below the bottom of the container.
589
- if (r.scrollTop + r.clientHeight < n.offsetTop + n.clientHeight) {
590
- r.scrollTop = n.offsetTop + n.clientHeight - r.clientHeight;
591
- // Above the top of the container.
592
- } else if (r.scrollTop > n.offsetTop) {
593
- r.scrollTop = n.offsetTop;
594
- }
595
- };
596
595
  // CONCATENATED MODULE: ./src/utils/ssrDocument.ts
597
596
  /* eslint-disable @typescript-eslint/no-empty-function */
598
597
  var Ie = {
@@ -653,11 +652,11 @@
653
652
  var e = typeof document !== "undefined" ? document : Ie;
654
653
  return e;
655
654
  }
656
- var Te = Be();
657
- /* harmony default export */ const Le = /* unused pure expression or super */ null && Te;
655
+ var Ne = Be();
656
+ /* harmony default export */ const Le = /* unused pure expression or super */ null && Ne;
658
657
  // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
659
658
  /* eslint-disable @typescript-eslint/no-empty-function */
660
- var Ne = {
659
+ var Ve = {
661
660
  document: Ie,
662
661
  navigator: {
663
662
  userAgent: ""
@@ -712,12 +711,12 @@
712
711
  clearTimeout(n);
713
712
  }
714
713
  };
715
- function Ve() {
716
- var e = typeof window !== "undefined" ? window : Ne;
714
+ function qe() {
715
+ var e = typeof window !== "undefined" ? window : Ve;
717
716
  return e;
718
717
  }
719
- var De = Ve();
720
- /* harmony default export */ const qe = /* unused pure expression or super */ null && De;
718
+ var De = qe();
719
+ /* harmony default export */ const Te = /* unused pure expression or super */ null && De;
721
720
  // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
722
721
  /**
723
722
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
@@ -739,12 +738,12 @@
739
738
  }
740
739
  // CONCATENATED MODULE: ./src/Select/SelectBase.tsx
741
740
  function _e(e) {
742
- return ze(e) || Ke(e) || Xe(e) || He();
741
+ return ze(e) || He(e) || Xe(e) || Ke();
743
742
  }
744
- function He() {
743
+ function Ke() {
745
744
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
746
745
  }
747
- function Ke(e) {
746
+ function He(e) {
748
747
  if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
749
748
  }
750
749
  function ze(e) {
@@ -880,59 +879,59 @@
880
879
  return ("string" === n ? String : Number)(e);
881
880
  }
882
881
  var an = {
883
- allowKeyMatching: l().bool,
884
- allowNewValues: l().bool,
885
- animateLoading: l().bool,
886
- appearance: l().oneOf([ "default", "link", "subtle" ]),
887
- append: l().bool,
888
- children: l().node,
889
- defaultPlacement: l().oneOf([ "above", "below", "vertical" ]),
890
- defaultValues: l().array,
891
- describedBy: l().string,
892
- disabled: l().bool,
893
- elementRef: l().oneOfType([ l().func, l().object ]),
894
- error: l().bool,
895
- filter: l().oneOf([ false, true, "controlled" ]),
896
- footerMessage: l().node,
897
- inline: l().bool,
898
- inputId: l().string,
899
- inputRef: l().oneOfType([ l().func, l().object ]),
900
- isLoadingOptions: l().bool,
901
- labelledBy: l().string,
902
- labelText: l().string,
903
- loadingMessage: l().node,
904
- menuStyle: l().object,
905
- multiple: l().bool,
906
- name: l().string,
907
- noOptionsMessage: l().node,
908
- onChange: l().func,
909
- onClick: l().func,
910
- onClose: l().func,
911
- onFilterChange: l().func,
912
- onOpen: l().func,
913
- onScroll: l().func,
914
- onScrollBottom: l().func,
882
+ allowKeyMatching: i().bool,
883
+ allowNewValues: i().bool,
884
+ animateLoading: i().bool,
885
+ appearance: i().oneOf([ "default", "link", "subtle" ]),
886
+ append: i().bool,
887
+ children: i().node,
888
+ defaultPlacement: i().oneOf([ "above", "below", "vertical" ]),
889
+ defaultValues: i().array,
890
+ describedBy: i().string,
891
+ disabled: i().bool,
892
+ elementRef: i().oneOfType([ i().func, i().object ]),
893
+ error: i().bool,
894
+ filter: i().oneOf([ false, true, "controlled" ]),
895
+ footerMessage: i().node,
896
+ inline: i().bool,
897
+ inputId: i().string,
898
+ inputRef: i().oneOfType([ i().func, i().object ]),
899
+ isLoadingOptions: i().bool,
900
+ labelledBy: i().string,
901
+ labelText: i().string,
902
+ loadingMessage: i().node,
903
+ menuStyle: i().object,
904
+ multiple: i().bool,
905
+ name: i().string,
906
+ noOptionsMessage: i().node,
907
+ onChange: i().func,
908
+ onClick: i().func,
909
+ onClose: i().func,
910
+ onFilterChange: i().func,
911
+ onOpen: i().func,
912
+ onScroll: i().func,
913
+ onScrollBottom: i().func,
915
914
  /** @private. */
916
- required: l().bool,
917
- placeholder: l().string,
918
- prefixLabel: l().string,
919
- prepend: l().bool,
920
- repositionMode: l().oneOf([ "none", "flip" ]),
921
- selectAllAppearance: l().oneOf([ "buttongroup", "checkbox" ]),
922
- showSelectedValuesFirst: l().oneOf([ "nextOpen", "immediately", "never" ]),
923
- suffixLabel: l().string,
924
- tabConfirmsNewValue: l().bool,
925
- toggle: l().node,
926
- toggleContent: l().oneOf([ "optionChildren", "optionLabel" ]),
927
- values: l().array,
915
+ required: i().bool,
916
+ placeholder: i().string,
917
+ prefixLabel: i().string,
918
+ prepend: i().bool,
919
+ repositionMode: i().oneOf([ "none", "flip" ]),
920
+ selectAllAppearance: i().oneOf([ "buttongroup", "checkbox" ]),
921
+ showSelectedValuesFirst: i().oneOf([ "nextOpen", "immediately", "never" ]),
922
+ suffixLabel: i().string,
923
+ tabConfirmsNewValue: i().bool,
924
+ toggle: i().node,
925
+ toggleContent: i().oneOf([ "optionChildren", "optionLabel" ]),
926
+ values: i().array,
928
927
  /** @private. */
929
- virtualization: l().number
928
+ virtualization: i().number
930
929
  };
931
- var un = q()((function(e) {
930
+ var un = T()((function(e) {
932
931
  return [ e ];
933
932
  }));
934
933
  // preserve separate widths for single vs. multi mode
935
- var cn = q()((function(e) {
934
+ var cn = T()((function(e) {
936
935
  var n = e.anchorWidth, r = e.isMultiple, t = e.maxHeight, o = e.menuStyle;
937
936
  return r ? rn({
938
937
  width: Math.max(n !== null && n !== void 0 ? n : 0, 200),
@@ -945,7 +944,7 @@
945
944
  }));
946
945
  var sn = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
947
946
  function dn(e) {
948
- return e && i()(e.props, "value");
947
+ return e && l()(e.props, "value");
949
948
  }
950
949
  function fn(e, n) {
951
950
  return "".concat(en(e), "-").concat(e, "-").concat(n);
@@ -954,22 +953,22 @@
954
953
  var vn = (0, d._)("No matches");
955
954
  var bn = (0, d._)("Select...");
956
955
  var mn = n().createElement(G(), null);
957
- var gn = function e(r) {
958
- var t = r.activeItemId, o = r.filterA11yId, l = r.filterKeyword, a = r.hasChildren, i = r.inputId, u = r.inputRef, c = r.menuListboxId, s = r.multiple, f = r.onClearAll, p = r.onSelectAll, v = r.onTextBlur, b = r.onTextChange, m = r.onTextFocus, g = r.onTextKeyDown, y = r.optionSelection, h = r.placement, O = r.selectAllAppearance, S = r.textHasFocus;
959
- var w = (0, d._)("Select all options".concat(y.current === "all" ? " disabled" : ""));
960
- var C = (0, d._)("Clear all options".concat(y.current === "none" ? " disabled" : ""));
956
+ var yn = function e(r) {
957
+ var t = r.activeItemId, o = r.filterA11yId, l = r.filterKeyword, a = r.hasChildren, i = r.inputId, u = r.inputRef, c = r.menuListboxId, s = r.multiple, f = r.onClearAll, p = r.onSelectAll, v = r.onTextBlur, b = r.onTextChange, m = r.onTextFocus, y = r.onTextKeyDown, g = r.optionSelection, h = r.placement, O = r.selectAllAppearance, S = r.textHasFocus;
958
+ var w = (0, d._)("Select all options".concat(g.current === "all" ? " disabled" : ""));
959
+ var C = (0, d._)("Clear all options".concat(g.current === "none" ? " disabled" : ""));
961
960
  // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
962
- var k = n().createElement(je, {
961
+ var k = n().createElement(Pe, {
963
962
  key: "selectAll"
964
- }, n().createElement(xe, {
965
- disabled: y.current === "all",
963
+ }, n().createElement(je, {
964
+ disabled: g.current === "all",
966
965
  appearance: "standalone",
967
966
  "aria-label": w,
968
967
  onClick: p,
969
968
  "data-test": "select-all",
970
969
  tag: "button"
971
- }, l ? (0, d._)("Select all Matches") : (0, d._)("Select all")), n().createElement(xe, {
972
- disabled: y.current === "none",
970
+ }, l ? (0, d._)("Select all Matches") : (0, d._)("Select all")), n().createElement(je, {
971
+ disabled: g.current === "none",
973
972
  appearance: "standalone",
974
973
  "aria-label": C,
975
974
  onClick: f,
@@ -979,19 +978,19 @@
979
978
 
980
979
  return n().createElement("div", {
981
980
  key: "controls"
982
- }, o && n().createElement(le(), {
981
+ }, o && n().createElement(te(), {
983
982
  id: o
984
- }, (0, d._)("Type to filter")), h === "above" && n().createElement(Pe, null), n().createElement(Ce, {
983
+ }, (0, d._)("Type to filter")), h === "above" && n().createElement(Ee, null), n().createElement(ke, {
985
984
  key: "filter",
986
985
  "data-test": "filter"
987
- }, n().createElement(te(), {
986
+ }, n().createElement(le(), {
988
987
  value: l,
989
988
  autoCapitalize: "off",
990
989
  autoComplete: "off",
991
990
  autoCorrect: "off",
992
991
  spellCheck: false,
993
992
  onChange: b,
994
- onKeyDown: g,
993
+ onKeyDown: y,
995
994
  onFocus: m,
996
995
  onBlur: v,
997
996
  placeholder: (0, d._)("filter"),
@@ -1006,9 +1005,9 @@
1006
1005
  inputId: i,
1007
1006
  canClear: true,
1008
1007
  startAdornment: mn
1009
- })), s && a && O === "buttongroup" && k, h === "below" && n().createElement(Pe, null));
1008
+ })), s && a && O === "buttongroup" && k, h === "below" && n().createElement(Ee, null));
1010
1009
  };
1011
- var yn = function e(n) {
1010
+ var gn = function e(n) {
1012
1011
  var r = n.prefixLabel, t = n.label, o = n.suffixLabel;
1013
1012
  var l = t;
1014
1013
  if (r) {
@@ -1020,9 +1019,9 @@
1020
1019
  return l;
1021
1020
  };
1022
1021
  var hn = n().forwardRef((function(r, t) {
1023
- var o = r.appearance, l = o === void 0 ? "default" : o, a = r.append, i = r.children, u = r.currentValues, c = u === void 0 ? [] : u, s = r.describedBy, f = r.disabled, p = r.elementRef, v = r.error, b = r.inline, m = r.labelText, g = r.labelledBy, y = r.multiple, h = r.onClick, O = r.placeholder, S = r.prefixLabel, w = r.prepend, C = r.required, k = r.suffixLabel, x = r.toggle, j = r.toggleContent, P = Ye(r, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent" ]);
1024
- var M;
1022
+ var o = r.appearance, l = o === void 0 ? "default" : o, a = r.append, i = r.children, u = r.currentValues, c = u === void 0 ? [] : u, s = r.describedBy, f = r.disabled, p = r.elementRef, v = r.error, b = r.inline, m = r.labelText, y = r.labelledBy, g = r.multiple, h = r.onClick, O = r.placeholder, S = r.prefixLabel, w = r.prepend, C = r.required, k = r.suffixLabel, x = r.toggle, j = r.toggleContent, P = Ye(r, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent" ]);
1025
1023
  var E;
1024
+ var M;
1026
1025
  var R = [];
1027
1026
  // Generate buttonLabels
1028
1027
  var A = e.Children.toArray(i);
@@ -1036,10 +1035,10 @@
1036
1035
  e.push(s);
1037
1036
  R.push(u);
1038
1037
  // if not in multiple mode, add the icon
1039
- if (!y && c.length === 1) {
1040
- M = i;
1038
+ if (!g && c.length === 1) {
1039
+ E = i;
1041
1040
  }
1042
- } else if (y) {
1041
+ } else if (g) {
1043
1042
  // only add values that don't match an option in "multiple" mode to preserve old behaviour
1044
1043
  e.push(n);
1045
1044
  R.push(n.toString());
@@ -1050,36 +1049,36 @@
1050
1049
  }
1051
1050
  return e;
1052
1051
  }), []);
1053
- E = I;
1052
+ M = I;
1054
1053
  // only apply prefix / suffix if the label is not empty
1055
- if (E.length > 0) {
1054
+ if (M.length > 0) {
1056
1055
  // If there's more than one item selected, read out the selected total
1057
1056
  // rather than reading out each selected item
1058
- R = yn({
1057
+ R = gn({
1059
1058
  prefixLabel: S,
1060
- label: E.length > 1 ? [ "".concat(c.length, " items selected") ] : R,
1059
+ label: M.length > 1 ? [ "".concat(c.length, " items selected") ] : R,
1061
1060
  suffixLabel: k
1062
1061
  });
1063
- E = yn({
1062
+ M = gn({
1064
1063
  prefixLabel: S,
1065
- label: E,
1064
+ label: M,
1066
1065
  suffixLabel: k
1067
1066
  });
1068
1067
  }
1069
1068
  // single <Select> behaviour is to show the placeholder if all parts of the label
1070
1069
  // are empty strings so we replicate this behaviour here
1071
- if (E.length === 0 || !y && E.every((function(e) {
1070
+ if (M.length === 0 || !g && M.every((function(e) {
1072
1071
  return e === "";
1073
1072
  }))) {
1074
- E = un(O);
1075
- R = E;
1073
+ M = un(O);
1074
+ R = M;
1076
1075
  }
1077
- var T = Object.keys(P).includes("aria-labelledby");
1076
+ var N = Object.keys(P).includes("aria-labelledby");
1078
1077
  var L = rn({
1079
1078
  "aria-describedby": s,
1080
- "aria-label": g || T ? undefined : "".concat(m ? "".concat(m, ", ") : "").concat(R.join("")),
1079
+ "aria-label": y || N ? undefined : "".concat(m ? "".concat(m, ", ") : "").concat(R.join("")),
1081
1080
  // aria-labelledby takes precedence over aria-label, so existence of both is redundant
1082
- "aria-labelledby": g,
1081
+ "aria-labelledby": y,
1083
1082
  "aria-required": C,
1084
1083
  "data-select-appearance": l,
1085
1084
  append: a,
@@ -1091,11 +1090,11 @@
1091
1090
  error: v,
1092
1091
  ref: t
1093
1092
  }, P);
1094
- if (y) {
1093
+ if (g) {
1095
1094
  L["data-test-values"] = JSON.stringify(c);
1096
1095
  } else {
1097
- var N = We(c, 1), V = N[0];
1098
- L["data-test-value"] = V;
1096
+ var V = We(c, 1), q = V[0];
1097
+ L["data-test-value"] = q;
1099
1098
  }
1100
1099
  if (x) {
1101
1100
 
@@ -1108,28 +1107,28 @@
1108
1107
  appearance: "standalone"
1109
1108
  }, L, {
1110
1109
  "data-select-appearance": "link"
1111
- }), !!M && n().createElement(Se, null, M), E || O, n().createElement(we, null, n().createElement(U(), null)));
1110
+ }), !!E && n().createElement(we, null, E), M || O, n().createElement(Ce, null, n().createElement(U(), null)));
1112
1111
  }
1113
1112
  // Using Button's secondary appearance as Select's default appearance.
1114
1113
  var D = l === "default" ? "secondary" : l;
1115
1114
 
1116
- return n().createElement(Oe, $e({}, L, {
1117
- $multiple: y,
1115
+ return n().createElement(Se, $e({}, L, {
1116
+ $multiple: g,
1118
1117
  appearance: D,
1119
- label: E,
1118
+ label: M,
1120
1119
  error: v,
1121
- icon: M,
1120
+ icon: E,
1122
1121
  inline: b,
1123
1122
  isMenu: true,
1124
1123
  onClick: h
1125
- }, _()(P, pn)), !!c.length && y && n().createElement(ke, {
1124
+ }, _()(P, pn)), !!c.length && g && n().createElement(xe, {
1126
1125
  "data-role": "count"
1127
1126
  }, "(", c.length, ")"));
1128
1127
  }));
1129
1128
  function On(r) {
1130
- var t = r.allowKeyMatching, o = t === void 0 ? true : t, l = r.animateLoading, a = r.appearance, i = a === void 0 ? "default" : a, c = r.append, s = r.allowNewValues, f = r.children, p = r.defaultPlacement, v = p === void 0 ? "vertical" : p, b = r.defaultValues, m = r.describedBy, g = r.disabled, y = r.elementRef, h = r.error, O = r.filter, S = r.footerMessage, w = r.inline, k = r.inputId, x = r.inputRef, j = r.isLoadingOptions, P = r.labelledBy, M = r.labelText, E = r.loadingMessage, R = r.menuStyle, A = R === void 0 ? {} : R, I = r.multiple, T = r.name, N = r.noOptionsMessage, D = N === void 0 ? vn : N, q = r.onChange, F = r.onScroll, _ = r.onScrollBottom, H = r.onFilterChange, z = r.onClick, W = r.onClose, U = r.onOpen, X = r.required, G = r.placeholder, J = G === void 0 ? bn : G, Y = r.prefixLabel, Z = r.prepend, re = r.repositionMode, te = re === void 0 ? "flip" : re, oe = r.selectAllAppearance, le = oe === void 0 ? "buttongroup" : oe, ae = r.showSelectedValuesFirst, se = r.suffixLabel, de = r.tabConfirmsNewValue, pe = r.values, ve = r.virtualization, be = r.toggle, me = r.toggleContent, ge = me === void 0 ? "optionChildren" : me, ye = Ye(r, [ "allowKeyMatching", "animateLoading", "appearance", "append", "allowNewValues", "children", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "labelText", "loadingMessage", "menuStyle", "multiple", "name", "noOptionsMessage", "onChange", "onScroll", "onScrollBottom", "onFilterChange", "onClick", "onClose", "onOpen", "required", "placeholder", "prefixLabel", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "suffixLabel", "tabConfirmsNewValue", "values", "virtualization", "toggle", "toggleContent" ]);
1129
+ var t = r.allowKeyMatching, o = t === void 0 ? true : t, l = r.animateLoading, a = r.appearance, i = a === void 0 ? "default" : a, c = r.append, s = r.allowNewValues, f = r.children, p = r.defaultPlacement, v = p === void 0 ? "vertical" : p, b = r.defaultValues, m = r.describedBy, y = r.disabled, g = r.elementRef, h = r.error, O = r.filter, S = r.footerMessage, w = r.inline, k = r.inputId, x = r.inputRef, j = r.isLoadingOptions, P = r.labelledBy, E = r.labelText, M = r.loadingMessage, R = r.menuStyle, A = R === void 0 ? {} : R, I = r.multiple, N = r.name, V = r.noOptionsMessage, D = V === void 0 ? vn : V, T = r.onChange, F = r.onScroll, _ = r.onScrollBottom, K = r.onFilterChange, z = r.onClick, W = r.onClose, U = r.onOpen, X = r.required, G = r.placeholder, J = G === void 0 ? bn : G, Y = r.prefixLabel, Z = r.prepend, re = r.repositionMode, te = re === void 0 ? "flip" : re, oe = r.selectAllAppearance, le = oe === void 0 ? "buttongroup" : oe, ae = r.showSelectedValuesFirst, de = r.suffixLabel, fe = r.tabConfirmsNewValue, ve = r.values, be = r.virtualization, me = r.toggle, ye = r.toggleContent, ge = ye === void 0 ? "optionChildren" : ye, he = Ye(r, [ "allowKeyMatching", "animateLoading", "appearance", "append", "allowNewValues", "children", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "labelText", "loadingMessage", "menuStyle", "multiple", "name", "noOptionsMessage", "onChange", "onScroll", "onScrollBottom", "onFilterChange", "onClick", "onClose", "onOpen", "required", "placeholder", "prefixLabel", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "suffixLabel", "tabConfirmsNewValue", "values", "virtualization", "toggle", "toggleContent" ]);
1131
1130
  // @docs-props-type SelectBasePropsBase
1132
- var he = (0, Me["default"])({
1131
+ var Oe = (0, Me["default"])({
1133
1132
  componentName: "SelectBase",
1134
1133
  /* eslint-disable-next-line prefer-rest-params */
1135
1134
  componentProps: arguments[0],
@@ -1138,27 +1137,27 @@
1138
1137
  valuePropName: "values"
1139
1138
  });
1140
1139
  // states
1141
- var Oe = (0, e.useState)((function() {
1140
+ var Se = (0, e.useState)((function() {
1142
1141
  return {
1143
1142
  activeItemId: (0, ce.createDOMID)("active-item"),
1144
1143
  menuListboxId: (0, ce.createDOMID)("menu-listbox")
1145
1144
  };
1146
- })), Se = We(Oe, 1), we = Se[0], Ce = we.activeItemId, ke = we.menuListboxId;
1147
- var xe = (0, e.useState)(0), je = We(xe, 2), Pe = je[0], Ee = je[1];
1148
- var Ie = (0, e.useState)(""), Be = We(Ie, 2), Te = Be[0], Le = Be[1];
1149
- var Ne = (0, e.useState)(false), De = We(Ne, 2), qe = De[0], He = De[1];
1150
- var Ke = (0, e.useState)(false), ze = We(Ke, 2), Ue = ze[0], Xe = ze[1];
1145
+ })), we = We(Se, 1), Ce = we[0], ke = Ce.activeItemId, xe = Ce.menuListboxId;
1146
+ var je = (0, e.useState)(0), Pe = We(je, 2), Ee = Pe[0], Re = Pe[1];
1147
+ var Ie = (0, e.useState)(""), Be = We(Ie, 2), Ne = Be[0], Le = Be[1];
1148
+ var Ve = (0, e.useState)(false), De = We(Ve, 2), Te = De[0], Ke = De[1];
1149
+ var He = (0, e.useState)(false), ze = We(He, 2), Ue = ze[0], Xe = ze[1];
1151
1150
  var Ge = (0, e.useState)([]), Je = We(Ge, 2), Qe = Je[0], Ze = Je[1];
1152
1151
  var en = (0, e.useState)(b || []), nn = We(en, 2), rn = nn[0], tn = nn[1];
1153
1152
  // previous state
1154
- var on = ie()(Pe);
1153
+ var on = ie()(Ee);
1155
1154
  // refs
1156
1155
  var ln = (0, e.useRef)(null);
1157
1156
  var an = (0, e.useRef)(null);
1158
1157
  var un = (0, e.useRef)(null);
1159
1158
  var pn = (0, e.useRef)([]);
1160
1159
  var mn = (0, e.useRef)([]);
1161
- var yn = (0, e.useRef)(on);
1160
+ var gn = (0, e.useRef)(on);
1162
1161
  var On = (0, e.useRef)();
1163
1162
  var Sn = (0, e.useRef)({});
1164
1163
  var wn = (0, e.useRef)(0);
@@ -1167,48 +1166,48 @@
1167
1166
  var xn = (0, e.useRef)();
1168
1167
  var jn = (0, e.useRef)(0);
1169
1168
  var Pn = (0, e.useRef)("none");
1170
- var Mn = (0, e.useState)(O ? (0, ce.createDOMID)("filter") : undefined), En = We(Mn, 1), Rn = En[0];
1169
+ var En = (0, e.useState)(O ? (0, ce.createDOMID)("filter") : undefined), Mn = We(En, 1), Rn = Mn[0];
1171
1170
  (0, e.useEffect)((function() {
1172
1171
  if (false) {}
1173
1172
  }), [ i, c, h, Z ]);
1174
1173
  var An = (0, e.useCallback)((function() {
1175
- var e = he ? pe : rn;
1174
+ var e = Oe ? ve : rn;
1176
1175
  return I || e == null ? e : e.slice(0, 1);
1177
- }), [ he, I, pe, rn ]);
1176
+ }), [ Oe, I, ve, rn ]);
1178
1177
  var In = (0, e.useCallback)((function() {
1179
1178
  var e;
1180
1179
  // in non-multiple mode, don't move values to the top of the list
1181
1180
  return I && ae !== "never" ? (e = An()) !== null && e !== void 0 ? e : [] : [];
1182
1181
  }), [ An, I, ae ]);
1183
1182
  var Bn = (0, e.useCallback)((function(e) {
1184
- var n = Te;
1185
- He(true);
1183
+ var n = Ne;
1184
+ Ke(true);
1186
1185
  Ze(In());
1187
1186
  // SUI-3234: preserve existing behavior difference between <Select> and <Multiselect.Compact>
1188
1187
  if (I) {
1189
1188
  Le("");
1190
1189
  }
1191
- if (n !== Te) {
1192
- H === null || H === void 0 ? void 0 : H(e, {
1193
- keyword: Te
1190
+ if (n !== Ne) {
1191
+ K === null || K === void 0 ? void 0 : K(e, {
1192
+ keyword: Ne
1194
1193
  });
1195
1194
  }
1196
- }), [ Te, In, I, H ]);
1195
+ }), [ Ne, In, I, K ]);
1197
1196
  (0, e.useEffect)((function() {
1198
- if (qe) {
1197
+ if (Te) {
1199
1198
  U === null || U === void 0 ? void 0 : U();
1200
1199
  if (kn.current && !O) {
1201
1200
  kn.current.focus();
1202
1201
  } else {
1203
1202
  var e;
1204
- Ee((e = xn.current) !== null && e !== void 0 ? e : 0);
1203
+ Re((e = xn.current) !== null && e !== void 0 ? e : 0);
1205
1204
  }
1206
1205
  }
1207
- }), [ U, qe, Qe, Te, O ]);
1208
- var Tn = (0, e.useCallback)((function() {
1209
- He(false);
1210
- Ee(0);
1211
- yn.current = null;
1206
+ }), [ U, Te, Qe, Ne, O ]);
1207
+ var Nn = (0, e.useCallback)((function() {
1208
+ Ke(false);
1209
+ Re(0);
1210
+ gn.current = null;
1212
1211
  W === null || W === void 0 ? void 0 : W();
1213
1212
  }), [ W ]);
1214
1213
  var Ln = (0, e.useCallback)((function(e, n) {
@@ -1226,59 +1225,59 @@
1226
1225
  // non-multiple mode must always have a value
1227
1226
  l = [ n ];
1228
1227
  }
1229
- var a = !he;
1228
+ var a = !Oe;
1230
1229
  if (a) {
1231
1230
  tn(l);
1232
1231
  }
1233
1232
  if (I) {
1234
1233
  // in uncontrolled multiple mode, keep the menu open
1235
1234
  if (a) {
1236
- He(true);
1235
+ Ke(true);
1237
1236
  }
1238
1237
  } else {
1239
1238
  var i;
1240
1239
  // non-multiple mode only supports a single selection
1241
1240
  // so close the menu once a selection is made
1242
- Tn({
1241
+ Nn({
1243
1242
  reason: "contentClick"
1244
1243
  });
1245
1244
  (i = ln.current) === null || i === void 0 ? void 0 : i.focus();
1246
1245
  }
1247
- q === null || q === void 0 ? void 0 : q(e, {
1246
+ T === null || T === void 0 ? void 0 : T(e, {
1248
1247
  values: l,
1249
- name: T,
1248
+ name: N,
1250
1249
  reason: "valueToggle"
1251
1250
  });
1252
- }), [ An, Tn, he, I, T, q ]);
1253
- var Nn = function e() {
1251
+ }), [ An, Nn, Oe, I, N, T ]);
1252
+ var Vn = function e() {
1254
1253
  an.current = null;
1255
1254
  pn.current = [];
1256
1255
  if (un.current) {
1257
1256
  clearTimeout(un.current);
1258
1257
  }
1259
1258
  };
1260
- var Vn = (0, e.useCallback)((function(e) {
1259
+ var qn = (0, e.useCallback)((function(e) {
1261
1260
  var r;
1262
1261
  // this doesn't make sense if we can't select multiple values
1263
1262
  if (!I) {
1264
1263
  return;
1265
1264
  }
1266
1265
  var t = (r = An()) !== null && r !== void 0 ? r : [];
1267
- var o = K()(t.concat(Cn.current));
1266
+ var o = H()(t.concat(Cn.current));
1268
1267
  o = n().Children.toArray(f).filter((function(e) {
1269
- return dn(e) && V()(o, e.props.value) && (!e.props.disabled || V()(t, e.props.value));
1268
+ return dn(e) && q()(o, e.props.value) && (!e.props.disabled || q()(t, e.props.value));
1270
1269
  })).map((function(e) {
1271
1270
  return e.props.value;
1272
1271
  }));
1273
- if (!he) {
1272
+ if (!Oe) {
1274
1273
  tn(o);
1275
1274
  }
1276
- q === null || q === void 0 ? void 0 : q(e, {
1275
+ T === null || T === void 0 ? void 0 : T(e, {
1277
1276
  values: o,
1278
- name: T,
1277
+ name: N,
1279
1278
  reason: "selectAll"
1280
1279
  });
1281
- }), [ f, An, he, I, T, q ]);
1280
+ }), [ f, An, Oe, I, N, T ]);
1282
1281
  var Dn = (0, e.useCallback)((function(e) {
1283
1282
  var r;
1284
1283
  // this doesn't make sense if we can't select multiple values
@@ -1289,28 +1288,28 @@
1289
1288
  var o = $().apply(void 0, [ t ].concat(_e(Cn.current)));
1290
1289
  // this will unselect all selected values unless those values are disabled or hidden by the filter
1291
1290
  var l = n().Children.toArray(f).filter((function(e) {
1292
- return dn(e) && (V()(t, e.props.value) && e.props.disabled || V()(o, e.props.value));
1291
+ return dn(e) && (q()(t, e.props.value) && e.props.disabled || q()(o, e.props.value));
1293
1292
  })).map((function(e) {
1294
1293
  return e.props.value;
1295
1294
  }));
1296
- if (!he) {
1295
+ if (!Oe) {
1297
1296
  tn(l);
1298
1297
  }
1299
- q === null || q === void 0 ? void 0 : q(e, {
1298
+ T === null || T === void 0 ? void 0 : T(e, {
1300
1299
  values: l,
1301
- name: T,
1300
+ name: N,
1302
1301
  reason: "clearAll"
1303
1302
  });
1304
- }), [ f, An, he, I, T, q ]);
1305
- var qn = (0, e.useCallback)((function(e) {
1306
- if (qe && !j) {
1303
+ }), [ f, An, Oe, I, N, T ]);
1304
+ var Tn = (0, e.useCallback)((function(e) {
1305
+ if (Te && !j) {
1307
1306
  _ === null || _ === void 0 ? void 0 : _(e);
1308
1307
  }
1309
- }), [ qe, j, _ ]);
1308
+ }), [ Te, j, _ ]);
1310
1309
  var Fn = (0, e.useCallback)((function(n) {
1311
1310
  var r = n.key;
1312
1311
  if (r === "Tab") {
1313
- if (de && On.current && wn.current <= 1) {
1312
+ if (fe && On.current && wn.current <= 1) {
1314
1313
  n.preventDefault();
1315
1314
  Ln(n, On.current);
1316
1315
  }
@@ -1321,48 +1320,48 @@
1321
1320
  if (Pn.current === "all") {
1322
1321
  Dn(n);
1323
1322
  } else {
1324
- Vn(n);
1323
+ qn(n);
1325
1324
  }
1326
1325
  }
1327
1326
  return;
1328
1327
  }
1329
1328
  if (r === "ArrowDown") {
1330
1329
  n.preventDefault();
1331
- Ee(Math.min(Pe + 1, le === "checkbox" ? wn.current : wn.current - 1));
1330
+ Re(Math.min(Ee + 1, le === "checkbox" ? wn.current : wn.current - 1));
1332
1331
  if (f && _) {
1333
1332
  var t;
1334
1333
  var o = e.Children.toArray(f).length - (2 + ((t = An()) !== null && t !== void 0 ? t : []).length);
1335
- if (Pe === o) {
1336
- qn(n);
1334
+ if (Ee === o) {
1335
+ Tn(n);
1337
1336
  }
1338
1337
  }
1339
1338
  }
1340
1339
  if (r === "ArrowUp") {
1341
1340
  n.preventDefault();
1342
- Ee(Math.max(Pe - 1, 0));
1341
+ Re(Math.max(Ee - 1, 0));
1343
1342
  }
1344
- if (r === "Enter" && On.current && qe) {
1343
+ if (r === "Enter" && On.current && Te) {
1345
1344
  if (On.current === "selectAll") {
1346
1345
  if (Pn.current === "all") {
1347
1346
  Dn(n);
1348
1347
  } else {
1349
- Vn(n);
1348
+ qn(n);
1350
1349
  }
1351
1350
  } else {
1352
1351
  n.preventDefault();
1353
1352
  Ln(n, On.current);
1354
1353
  }
1355
1354
  }
1356
- }), [ Pe, f, An, Dn, qn, Vn, _, qe, le, de, Ln ]);
1355
+ }), [ Ee, f, An, Dn, Tn, qn, _, Te, le, fe, Ln ]);
1357
1356
  var _n = (0, e.useCallback)((function(e, n) {
1358
1357
  var r = n.value;
1359
1358
  e.preventDefault();
1360
- if (!qe) {
1359
+ if (!Te) {
1361
1360
  return;
1362
1361
  }
1363
1362
  Ln(e, r);
1364
- }), [ qe, Ln ]);
1365
- var Hn = (0, e.useCallback)((function(e, n) {
1363
+ }), [ Te, Ln ]);
1364
+ var Kn = (0, e.useCallback)((function(e, n) {
1366
1365
  var r = e.nativeEvent.key;
1367
1366
  // Checking for a single character to avoid complications from double-byte languages and emojis.
1368
1367
  if (r.length === 1) {
@@ -1373,13 +1372,13 @@
1373
1372
  };
1374
1373
  if (!an.current) {
1375
1374
  if (r === " ") {
1376
- Nn();
1375
+ Vn();
1377
1376
  return;
1378
1377
  }
1379
- t = Re(mn.current, o);
1378
+ t = Ae(mn.current, o);
1380
1379
  } else if (pn.current.length > 1) {
1381
1380
  o.index = an.current.index + 1;
1382
- t = Re(pn.current, o);
1381
+ t = Ae(pn.current, o);
1383
1382
  }
1384
1383
  if (t.length) {
1385
1384
  var l;
@@ -1401,20 +1400,20 @@
1401
1400
  if (un.current) {
1402
1401
  clearTimeout(un.current);
1403
1402
  }
1404
- un.current = setTimeout(Nn, 500);
1403
+ un.current = setTimeout(Vn, 500);
1405
1404
  e.preventDefault();
1406
1405
  e.stopPropagation();
1407
1406
  }
1408
1407
  }), []);
1409
- var Kn = (0, e.useCallback)((function(e, n) {
1408
+ var Hn = (0, e.useCallback)((function(e, n) {
1410
1409
  var r = n.value;
1411
1410
  Le(r);
1412
- He(true);
1413
- Ee(0);
1414
- H === null || H === void 0 ? void 0 : H(e, {
1411
+ Ke(true);
1412
+ Re(0);
1413
+ K === null || K === void 0 ? void 0 : K(e, {
1415
1414
  keyword: r
1416
1415
  });
1417
- }), [ H ]);
1416
+ }), [ K ]);
1418
1417
  var zn = (0, e.useCallback)((function() {
1419
1418
  Xe(true);
1420
1419
  }), []);
@@ -1422,10 +1421,10 @@
1422
1421
  Xe(false);
1423
1422
  }), []);
1424
1423
  var Wn = (0, e.useCallback)((function(e) {
1425
- if (yn.current !== Pe) {
1426
- Ae(e);
1424
+ if (gn.current !== Ee) {
1425
+ (0, se.scrollIntoViewIfNeeded)(e);
1427
1426
  }
1428
- }), [ Pe ]);
1427
+ }), [ Ee ]);
1429
1428
  var Un = (0, e.useCallback)((function(e, n, r) {
1430
1429
  if (r) {
1431
1430
  kn.current = e;
@@ -1438,8 +1437,8 @@
1438
1437
  }), [ Sn ]);
1439
1438
  var Xn = (0, e.useCallback)((function(e) {
1440
1439
  ln.current = e;
1441
- Fe(y, e);
1442
- }), [ y, ln ]);
1440
+ Fe(g, e);
1441
+ }), [ g, ln ]);
1443
1442
  var Gn = (0, e.useMemo)((function() {
1444
1443
  var e;
1445
1444
  return (e = An()) !== null && e !== void 0 ? e : [];
@@ -1476,11 +1475,11 @@
1476
1475
  }
1477
1476
  var f = s.props, p = f.disabled, v = f.hidden, b = f.label, m = f.value;
1478
1477
  // Find out if the search string exactly matches a value
1479
- if (m === Te) {
1478
+ if (m === Ne) {
1480
1479
  t = true;
1481
1480
  }
1482
- var g = Gn && Gn.indexOf(m) >= 0;
1483
- var y = !!g && !p && !i;
1481
+ var y = Gn && Gn.indexOf(m) >= 0;
1482
+ var g = !!y && !p && !i;
1484
1483
  var h = o && !I && !O && !j && !_;
1485
1484
  var S = fn(m, b);
1486
1485
  var w = -1;
@@ -1493,17 +1492,17 @@
1493
1492
  }
1494
1493
  // Format the Menu.Item
1495
1494
  var C = (0, e.cloneElement)(s, {
1496
- elementRef: r(S, y),
1495
+ elementRef: r(S, g),
1497
1496
  key: s.key || d,
1498
1497
  onClick: _n,
1499
1498
  onKeyDown: h ? function(e) {
1500
- return Hn(e, w);
1499
+ return Kn(e, w);
1501
1500
  } : undefined,
1502
- selected: g,
1501
+ selected: y,
1503
1502
  multiple: I,
1504
1503
  role: "option"
1505
1504
  });
1506
- if (y) {
1505
+ if (g) {
1507
1506
  i = true;
1508
1507
  }
1509
1508
  if (Yn && Yn.indexOf(m) >= 0) {
@@ -1527,7 +1526,7 @@
1527
1526
  return dn(n) && n.props && n.props.value === e;
1528
1527
  }));
1529
1528
  if (!o) {
1530
- if (e === Te) {
1529
+ if (e === Ne) {
1531
1530
  t = true;
1532
1531
  }
1533
1532
  var i = Yn && Yn.indexOf(e) >= 0;
@@ -1558,7 +1557,7 @@
1558
1557
  }
1559
1558
  var p = O === "controlled";
1560
1559
  // Filter the items
1561
- var v = (0, ue.stringToKeywords)(Te);
1560
+ var v = (0, ue.stringToKeywords)(Ne);
1562
1561
  c = p ? c : c.filter((function(e) {
1563
1562
  if (dn(e)) {
1564
1563
  return (0, ue.testPhrase)(e.props.label, v);
@@ -1577,21 +1576,21 @@
1577
1576
  });
1578
1577
  }));
1579
1578
  // Add the option to add the new value
1580
- if (s && !t && Te) {
1579
+ if (s && !t && Ne) {
1581
1580
  var b = a ? l + 1 : l;
1582
- var m = "".concat(Te, " (new value)");
1583
- var g = fn(Te, m);
1581
+ var m = "".concat(Ne, " (new value)");
1582
+ var y = fn(Ne, m);
1584
1583
  c.splice(b, 0, n().createElement(C, {
1585
- elementRef: r(g),
1584
+ elementRef: r(y),
1586
1585
  label: m,
1587
- value: Te,
1586
+ value: Ne,
1588
1587
  key: "newValue",
1589
1588
  multiple: I,
1590
1589
  onClick: _n
1591
1590
  }));
1592
1591
  }
1593
1592
  // When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
1594
- var y = le === "checkbox" && I && c.length > 1 ? 1 : 0;
1593
+ var g = le === "checkbox" && I && c.length > 1 ? 1 : 0;
1595
1594
  var h = true;
1596
1595
  // Highlight the selected Items and remove hidden
1597
1596
  c = c.reduce((function(n, r) {
@@ -1607,8 +1606,8 @@
1607
1606
  if (r.props.selected && !r.props.disabled && xn.current == null) {
1608
1607
  xn.current = wn.current;
1609
1608
  }
1610
- var t = y === Pe;
1611
- y += 1;
1609
+ var t = g === Ee;
1610
+ g += 1;
1612
1611
  wn.current += 1;
1613
1612
  jn.current += r.props.selected ? 1 : 0;
1614
1613
  if (r.key !== "newValue" && !r.props.disabled && !r.props.selected) {
@@ -1624,7 +1623,7 @@
1624
1623
  var o = (0, e.cloneElement)(r, {
1625
1624
  active: t,
1626
1625
  elementRef: Wn,
1627
- id: Ce
1626
+ id: ke
1628
1627
  });
1629
1628
  n.push(o);
1630
1629
  return n;
@@ -1634,26 +1633,26 @@
1634
1633
  if (le === "checkbox" && I && wn.current > 0) {
1635
1634
  var S;
1636
1635
  if (Pn.current === "all") {
1637
- if (Te === "") {
1636
+ if (Ne === "") {
1638
1637
  S = (0, d._)("Clear all");
1639
1638
  } else {
1640
1639
  S = (0, d._)("Clear all matches");
1641
1640
  }
1642
- } else if (Te === "") {
1641
+ } else if (Ne === "") {
1643
1642
  S = (0, d._)("Select all");
1644
1643
  } else {
1645
1644
  S = (0, d._)("Select all matches");
1646
1645
  }
1647
- if (Pe === 0 && Ue) {
1646
+ if (Ee === 0 && Ue) {
1648
1647
  On.current = "selectAll";
1649
1648
  }
1650
- c.unshift( n().createElement(fe, {
1649
+ c.unshift( n().createElement(pe, {
1651
1650
  key: "select-all-option",
1652
- active: Pe === 0,
1653
- changedToggle: !!be,
1651
+ active: Ee === 0,
1652
+ changedToggle: !!me,
1654
1653
  elementRef: Wn,
1655
- id: Pe === 0 ? Ce : undefined,
1656
- onClick: Pn.current === "all" ? Dn : Vn,
1654
+ id: Ee === 0 ? ke : undefined,
1655
+ onClick: Pn.current === "all" ? Dn : qn,
1657
1656
  selectAllLabel: S,
1658
1657
  selected: Pn.current === "all" || Pn.current !== "none" && "some",
1659
1658
  totalCount: Gn.length,
@@ -1669,33 +1668,33 @@
1669
1668
  return e;
1670
1669
  }), []);
1671
1670
  return c;
1672
- }), [ Pe, Ce, o, s, f, Gn, O, Te, Wn, Dn, _n, Hn, Un, Vn, j, I, Yn, _, le, Ue, be ]);
1671
+ }), [ Ee, ke, o, s, f, Gn, O, Ne, Wn, Dn, _n, Kn, Un, qn, j, I, Yn, _, le, Ue, me ]);
1673
1672
  var er = function e(r) {
1674
- var t = r.anchorWidth, o = r.maxHeight, a = r.placement;
1675
- var i = cn({
1673
+ var t = r.anchorWidth, o = r.maxHeight, a = r.placement, i = r.toggleId;
1674
+ var u = cn({
1676
1675
  anchorWidth: t,
1677
1676
  isMultiple: I,
1678
1677
  maxHeight: o,
1679
1678
  menuStyle: A
1680
1679
  });
1681
- var u = Gn.length > 0 && !Qn && !O ? 0 : undefined;
1682
- var c = {
1680
+ var c = Gn.length > 0 && !Qn && !O ? 0 : undefined;
1681
+ var s = {
1683
1682
  "aria-multiselectable": I || undefined,
1684
- childrenStart: !!O && n().createElement(gn, {
1685
- activeItemId: Ce,
1683
+ childrenStart: !!O && n().createElement(yn, {
1684
+ activeItemId: ke,
1686
1685
  filterA11yId: Rn,
1687
- filterKeyword: Te,
1686
+ filterKeyword: Ne,
1688
1687
  hasChildren: Zn.some((function(e) {
1689
1688
  return dn(e);
1690
1689
  })),
1691
1690
  inputId: k,
1692
1691
  inputRef: x,
1693
- menuListboxId: ke,
1692
+ menuListboxId: xe,
1694
1693
  multiple: I,
1695
1694
  onClearAll: Dn,
1696
- onSelectAll: Vn,
1695
+ onSelectAll: qn,
1697
1696
  onTextBlur: $n,
1698
- onTextChange: Kn,
1697
+ onTextChange: Hn,
1699
1698
  onTextFocus: zn,
1700
1699
  onTextKeyDown: Fn,
1701
1700
  optionSelection: Pn,
@@ -1705,25 +1704,27 @@
1705
1704
  }),
1706
1705
  focusMode: O ? "never" : undefined,
1707
1706
  isLoading: j,
1708
- menuId: ke,
1709
- onScrollBottom: _ ? qn : undefined,
1707
+ labelledBy: "".concat(Rn !== null && Rn !== void 0 ? Rn : "", " ").concat(i !== null && i !== void 0 ? i : "").trim(),
1708
+ // NVDA ignores aria-labelledby attribute on popover, but reads it on menu
1709
+ menuId: xe,
1710
+ onScrollBottom: _ ? Tn : undefined,
1710
1711
  placement: a !== null && a !== void 0 ? a : undefined,
1711
1712
  noOptionsMessage: D,
1712
1713
  footerMessage: S,
1713
1714
  animateLoading: l,
1714
- loadingMessage: E,
1715
+ loadingMessage: M,
1715
1716
  onScroll: F,
1716
- style: i,
1717
- tabIndex: u
1717
+ style: u,
1718
+ tabIndex: c
1718
1719
  };
1719
- if (ve) {
1720
+ if (be) {
1720
1721
 
1721
1722
  return n().createElement(ee.VirtualizedResultsMenu, $e({
1722
- virtualization: ve
1723
- }, c), Zn);
1723
+ virtualization: be
1724
+ }, s), Zn);
1724
1725
  }
1725
1726
 
1726
- return n().createElement(ne(), c, Zn);
1727
+ return n().createElement(ne(), s, Zn);
1727
1728
  };
1728
1729
  var nr = (0, e.useMemo)((function() {
1729
1730
 
@@ -1733,11 +1734,11 @@
1733
1734
  currentValues: An(),
1734
1735
  "data-test": I ? "multiselect" : "select",
1735
1736
  describedBy: m,
1736
- disabled: g,
1737
+ disabled: y,
1737
1738
  elementRef: Xn,
1738
1739
  error: h,
1739
1740
  inline: w,
1740
- labelText: M,
1741
+ labelText: E,
1741
1742
  labelledBy: P,
1742
1743
  multiple: I,
1743
1744
  onClick: z,
@@ -1745,11 +1746,11 @@
1745
1746
  prefixLabel: Y,
1746
1747
  prepend: Z,
1747
1748
  required: X,
1748
- suffixLabel: se,
1749
- toggle: be,
1749
+ suffixLabel: de,
1750
+ toggle: me,
1750
1751
  toggleContent: ge
1751
- }, ye), f);
1752
- }), [ i, c, An, I, m, g, h, Xn, w, M, P, z, J, Y, Z, X, se, be, ge, ye, f ]);
1752
+ }, he), f);
1753
+ }), [ i, c, An, I, m, y, h, Xn, w, E, P, z, J, Y, Z, X, de, me, ge, he, f ]);
1753
1754
 
1754
1755
  return n().createElement(Q(), {
1755
1756
  closeReasons: sn,
@@ -1757,12 +1758,12 @@
1757
1758
  "aria-labelledby": Rn,
1758
1759
  toggle: nr,
1759
1760
  onRequestOpen: Bn,
1760
- onRequestClose: Tn,
1761
- open: qe,
1761
+ onRequestClose: Nn,
1762
+ open: Te,
1762
1763
  openWithArrowKeys: true,
1763
1764
  repositionMode: te,
1764
1765
  defaultPlacement: v,
1765
- canCoverAnchor: Ve().innerHeight < 500,
1766
+ canCoverAnchor: qe().innerHeight < 500,
1766
1767
  retainFocus: false,
1767
1768
  takeFocus: Gn.length === 0 || Gn.length > 0 && !Qn || !!O
1768
1769
  }, er);
@@ -1808,48 +1809,48 @@
1808
1809
  return r;
1809
1810
  }
1810
1811
  var xn = {
1811
- allowNewValues: l().bool,
1812
- animateLoading: l().bool,
1813
- children: l().node,
1814
- controlledFilter: l().bool,
1815
- defaultPlacement: l().oneOf([ "above", "below", "vertical" ]),
1816
- defaultValues: l().array,
1817
- describedBy: l().string,
1818
- disabled: l().bool,
1819
- elementRef: l().oneOfType([ l().func, l().object ]),
1820
- error: l().bool,
1821
- filter: l().oneOf([ false, true, "controlled" ]),
1822
- footerMessage: l().node,
1823
- inline: l().bool,
1824
- inputId: l().string,
1825
- inputRef: l().oneOfType([ l().func, l().object ]),
1826
- isLoadingOptions: l().bool,
1827
- labelledBy: l().string,
1828
- loadingMessage: l().node,
1829
- menuStyle: l().object,
1830
- name: l().string,
1831
- noOptionsMessage: l().node,
1832
- onChange: l().func,
1833
- onClose: l().func,
1834
- onFilterChange: l().func,
1835
- onOpen: l().func,
1836
- onScroll: l().func,
1837
- onScrollBottom: l().func,
1838
- placeholder: l().string,
1839
- repositionMode: l().oneOf([ "none", "flip" ]),
1840
- selectAllAppearance: l().oneOf([ "buttongroup", "checkbox" ]),
1841
- showSelectedValuesFirst: l().oneOf([ "nextOpen", "immediately", "never" ]),
1842
- tabConfirmsNewValue: l().bool,
1843
- values: l().array,
1812
+ allowNewValues: i().bool,
1813
+ animateLoading: i().bool,
1814
+ children: i().node,
1815
+ controlledFilter: i().bool,
1816
+ defaultPlacement: i().oneOf([ "above", "below", "vertical" ]),
1817
+ defaultValues: i().array,
1818
+ describedBy: i().string,
1819
+ disabled: i().bool,
1820
+ elementRef: i().oneOfType([ i().func, i().object ]),
1821
+ error: i().bool,
1822
+ filter: i().oneOf([ false, true, "controlled" ]),
1823
+ footerMessage: i().node,
1824
+ inline: i().bool,
1825
+ inputId: i().string,
1826
+ inputRef: i().oneOfType([ i().func, i().object ]),
1827
+ isLoadingOptions: i().bool,
1828
+ labelledBy: i().string,
1829
+ loadingMessage: i().node,
1830
+ menuStyle: i().object,
1831
+ name: i().string,
1832
+ noOptionsMessage: i().node,
1833
+ onChange: i().func,
1834
+ onClose: i().func,
1835
+ onFilterChange: i().func,
1836
+ onOpen: i().func,
1837
+ onScroll: i().func,
1838
+ onScrollBottom: i().func,
1839
+ placeholder: i().string,
1840
+ repositionMode: i().oneOf([ "none", "flip" ]),
1841
+ selectAllAppearance: i().oneOf([ "buttongroup", "checkbox" ]),
1842
+ showSelectedValuesFirst: i().oneOf([ "nextOpen", "immediately", "never" ]),
1843
+ tabConfirmsNewValue: i().bool,
1844
+ values: i().array,
1844
1845
  /** @private */
1845
- virtualization: l().number
1846
+ virtualization: i().number
1846
1847
  };
1847
1848
  // TS: not typed controlled/uncontrolled, handled by Multiselect wrapper component
1848
1849
  var jn = {};
1849
1850
  var Pn = (0, d._)("No matches");
1850
- var Mn = (0, d._)("Select...");
1851
- function En(r) {
1852
- var t = r.allowNewValues, o = r.animateLoading, l = r.children, a = r.controlledFilter, i = r.defaultPlacement, u = i === void 0 ? "vertical" : i, c = r.defaultValues, s = r.describedBy, d = r.disabled, f = r.elementRef, p = r.error, v = r.filter, b = r.footerMessage, m = r.inline, g = r.inputId, y = r.inputRef, h = r.isLoadingOptions, O = r.labelledBy, S = r.loadingMessage, w = r.menuStyle, k = w === void 0 ? jn : w, x = r.name, j = r.noOptionsMessage, P = j === void 0 ? Pn : j, M = r.onChange, E = r.onClose, R = r.onFilterChange, A = r.onOpen, I = r.onScroll, B = r.onScrollBottom, T = r.placeholder, L = T === void 0 ? Mn : T, N = r.repositionMode, V = r.selectAllAppearance, D = r.showSelectedValuesFirst, q = D === void 0 ? "nextOpen" : D, F = r.tabConfirmsNewValue, _ = r.values, H = r.virtualization, K = Cn(r, [ "allowNewValues", "animateLoading", "children", "controlledFilter", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onChange", "onClose", "onFilterChange", "onOpen", "onScroll", "onScrollBottom", "placeholder", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "tabConfirmsNewValue", "values", "virtualization" ]);
1851
+ var En = (0, d._)("Select...");
1852
+ function Mn(r) {
1853
+ var t = r.allowNewValues, o = r.animateLoading, l = r.children, a = r.controlledFilter, i = r.defaultPlacement, u = i === void 0 ? "vertical" : i, c = r.defaultValues, s = r.describedBy, d = r.disabled, f = r.elementRef, p = r.error, v = r.filter, b = r.footerMessage, m = r.inline, y = r.inputId, g = r.inputRef, h = r.isLoadingOptions, O = r.labelledBy, S = r.loadingMessage, w = r.menuStyle, k = w === void 0 ? jn : w, x = r.name, j = r.noOptionsMessage, P = j === void 0 ? Pn : j, E = r.onChange, M = r.onClose, R = r.onFilterChange, A = r.onOpen, I = r.onScroll, B = r.onScrollBottom, N = r.placeholder, L = N === void 0 ? En : N, V = r.repositionMode, q = r.selectAllAppearance, D = r.showSelectedValuesFirst, T = D === void 0 ? "nextOpen" : D, F = r.tabConfirmsNewValue, _ = r.values, K = r.virtualization, H = Cn(r, [ "allowNewValues", "animateLoading", "children", "controlledFilter", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onChange", "onClose", "onFilterChange", "onOpen", "onScroll", "onScrollBottom", "placeholder", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "tabConfirmsNewValue", "values", "virtualization" ]);
1853
1854
  // @docs-props-type CompactPropsBase
1854
1855
  if (false) {}
1855
1856
  var z = true;
@@ -1892,56 +1893,56 @@
1892
1893
  error: p,
1893
1894
  footerMessage: b,
1894
1895
  inline: m,
1895
- inputId: g,
1896
- inputRef: y,
1896
+ inputId: y,
1897
+ inputRef: g,
1897
1898
  isLoadingOptions: h,
1898
1899
  labelledBy: O,
1899
1900
  loadingMessage: S,
1900
1901
  menuStyle: k,
1901
1902
  name: x,
1902
1903
  noOptionsMessage: P,
1903
- onChange: M,
1904
- onClose: E,
1904
+ onChange: E,
1905
+ onClose: M,
1905
1906
  onFilterChange: R,
1906
1907
  onOpen: A,
1907
1908
  onScroll: I,
1908
1909
  onScrollBottom: B,
1909
1910
  placeholder: L,
1910
- repositionMode: N,
1911
- selectAllAppearance: V,
1912
- showSelectedValuesFirst: q,
1911
+ repositionMode: V,
1912
+ selectAllAppearance: q,
1913
+ showSelectedValuesFirst: T,
1913
1914
  tabConfirmsNewValue: F,
1914
- virtualization: H
1915
- }, K, $, {
1915
+ virtualization: K
1916
+ }, H, $, {
1916
1917
  multiple: true
1917
1918
  }));
1918
1919
  }
1919
- En.propTypes = xn;
1920
- En.Option = E;
1921
- En.Divider = u.Divider;
1922
- En.Heading = u.Heading;
1923
- /* harmony default export */ const Rn = En;
1920
+ Mn.propTypes = xn;
1921
+ Mn.Option = M;
1922
+ Mn.Divider = u.Divider;
1923
+ Mn.Heading = u.Heading;
1924
+ /* harmony default export */ const Rn = Mn;
1924
1925
  // CONCATENATED MODULE: external "lodash/defer"
1925
1926
  const An = require("lodash/defer");
1926
1927
  var In = r.n(An);
1927
1928
  // CONCATENATED MODULE: external "lodash/get"
1928
1929
  const Bn = require("lodash/get");
1929
- var Tn = r.n(Bn);
1930
+ var Nn = r.n(Bn);
1930
1931
  // CONCATENATED MODULE: external "lodash/isString"
1931
1932
  const Ln = require("lodash/isString");
1932
- var Nn = r.n(Ln);
1933
+ var Vn = r.n(Ln);
1933
1934
  // CONCATENATED MODULE: external "lodash/keys"
1934
- const Vn = require("lodash/keys");
1935
- var Dn = r.n(Vn);
1935
+ const qn = require("lodash/keys");
1936
+ var Dn = r.n(qn);
1936
1937
  // CONCATENATED MODULE: external "lodash/last"
1937
- const qn = require("lodash/last");
1938
- var Fn = r.n(qn);
1938
+ const Tn = require("lodash/last");
1939
+ var Fn = r.n(Tn);
1939
1940
  // CONCATENATED MODULE: external "lodash/omit"
1940
1941
  const _n = require("lodash/omit");
1941
- var Hn = r.n(_n);
1942
+ var Kn = r.n(_n);
1942
1943
  // CONCATENATED MODULE: external "lodash/pickBy"
1943
- const Kn = require("lodash/pickBy");
1944
- var zn = r.n(Kn);
1944
+ const Hn = require("lodash/pickBy");
1945
+ var zn = r.n(Hn);
1945
1946
  // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
1946
1947
  const $n = require("@splunk/react-ui/Popover");
1947
1948
  var Wn = r.n($n);
@@ -1954,40 +1955,40 @@
1954
1955
  const Jn = require("@splunk/react-ui/Chip");
1955
1956
  var Qn = r.n(Jn);
1956
1957
  // CONCATENATED MODULE: ./src/Multiselect/NormalStyles.ts
1957
- var Yn = ve()(Gn()).withConfig({
1958
+ var Yn = be()(Gn()).withConfig({
1958
1959
  displayName: "NormalStyles__StyledBox",
1959
1960
  componentId: "sc-1uwwpco-0"
1960
- })([ "display:flex;align-items:center;flex-wrap:wrap;gap:", ";border-radius:", ";min-width:200px;min-height:", ";max-height:300px;overflow-y:auto;border:", " solid ", ";padding-inline:", ";background-color:", ";", " ", " ", " ", " ", " &[data-inline]{width:400px;}" ], he.variables.spacingXSmall, he.variables.borderRadius, he.variables.inputHeight, he.variables.inputBorderWidth, he.variables.interactiveColorBorder, he.variables.spacingXSmall, he.variables.interactiveColorBackground, (function(e) {
1961
+ })([ "display:flex;align-items:center;flex-wrap:wrap;gap:", ";border-radius:", ";min-width:200px;min-height:", ";max-height:300px;overflow-y:auto;border:", " solid ", ";padding-inline:", ";background-color:", ";", " ", " ", " ", " ", " &[data-inline]{width:400px;}" ], Oe.variables.spacingXSmall, Oe.variables.borderRadius, Oe.variables.inputHeight, Oe.variables.inputBorderWidth, Oe.variables.interactiveColorBorder, Oe.variables.spacingXSmall, Oe.variables.interactiveColorBackground, (function(e) {
1961
1962
  var n = e.$hasFocus;
1962
- return n && (0, pe.css)([ "box-shadow:", ";" ], he.variables.focusShadow);
1963
+ return n && (0, ve.css)([ "box-shadow:", ";" ], Oe.variables.focusShadow);
1963
1964
  }), (function(e) {
1964
1965
  var n = e.$error;
1965
- return n && (0, pe.css)([ "border-color:", ";&:hover:not([disabled]){border-color:", ";}" ], he.variables.interactiveColorAccentError, he.variables.interactiveColorAccentErrorStrong);
1966
+ return n && (0, ve.css)([ "border-color:", ";&:hover:not([disabled]){border-color:", ";}" ], Oe.variables.interactiveColorAccentError, Oe.variables.interactiveColorAccentErrorStrong);
1966
1967
  }), (function(e) {
1967
1968
  var n = e.$disabled;
1968
- return n && (0, pe.css)([ "border-color:", ";background-color:", ";cursor:not-allowed;" ], he.variables.interactiveColorBorderDisabled, he.variables.interactiveColorBackgroundDisabled);
1969
+ return n && (0, ve.css)([ "border-color:", ";background-color:", ";cursor:not-allowed;" ], Oe.variables.interactiveColorBorderDisabled, Oe.variables.interactiveColorBackgroundDisabled);
1969
1970
  }), (function(e) {
1970
1971
  var n = e.$disabled, r = e.$hasFocus;
1971
- return !n && !r && (0, pe.css)([ "&:hover{border-color:", ";}" ], he.variables.interactiveColorBorderHover);
1972
+ return !n && !r && (0, ve.css)([ "&:hover{border-color:", ";}" ], Oe.variables.interactiveColorBorderHover);
1972
1973
  }), (function(e) {
1973
1974
  var n = e.$popoverOpen;
1974
- return n && (0, pe.css)([ "position:relative;z-index:calc(", " - 2);" ], he.variables.zindexFixedNavbar);
1975
+ return n && (0, ve.css)([ "position:relative;z-index:calc(", " - 2);" ], Oe.variables.zindexFixedNavbar);
1975
1976
  }));
1976
- var Zn = ve().span.withConfig({
1977
+ var Zn = be().span.withConfig({
1977
1978
  displayName: "NormalStyles__StyledButtonsWrapper",
1978
1979
  componentId: "sc-1uwwpco-1"
1979
1980
  })([ "display:contents;" ]);
1980
- var er = ve().input.withConfig({
1981
+ var er = be().input.withConfig({
1981
1982
  displayName: "NormalStyles__StyledInput",
1982
1983
  componentId: "sc-1uwwpco-2"
1983
- })([ "", ";flex:1 0 auto;max-width:100%;" ], he.mixins.reset("block"));
1984
- var nr = ve()(Qn()).withConfig({
1984
+ })([ "", ";flex:1 0 auto;max-width:100%;" ], Oe.mixins.reset("block"));
1985
+ var nr = be()(Qn()).withConfig({
1985
1986
  displayName: "NormalStyles__StyledChip",
1986
1987
  componentId: "sc-1uwwpco-3"
1987
1988
  })([ "line-height:1.1429;height:auto;", ";&:not([disabled]):focus{box-shadow:", ";}" ], (0,
1988
- he.pick)({
1989
- compact: (0, pe.css)([ "padding-block:2px;" ])
1990
- }), he.variables.focusShadowInset);
1989
+ Oe.pick)({
1990
+ compact: (0, ve.css)([ "padding-block:2px;" ])
1991
+ }), Oe.variables.focusShadowInset);
1991
1992
  // CONCATENATED MODULE: ./src/Multiselect/Normal.tsx
1992
1993
  function rr(e) {
1993
1994
  "@babel/helpers - typeof";
@@ -2097,18 +2098,18 @@
2097
2098
  }
2098
2099
  return r;
2099
2100
  }
2100
- function gr(e) {
2101
+ function yr(e) {
2101
2102
  for (var n = 1; n < arguments.length; n++) {
2102
2103
  var r = null != arguments[n] ? arguments[n] : {};
2103
2104
  n % 2 ? mr(Object(r), !0).forEach((function(n) {
2104
- yr(e, n, r[n]);
2105
+ gr(e, n, r[n]);
2105
2106
  })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : mr(Object(r)).forEach((function(n) {
2106
2107
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
2107
2108
  }));
2108
2109
  }
2109
2110
  return e;
2110
2111
  }
2111
- function yr(e, n, r) {
2112
+ function gr(e, n, r) {
2112
2113
  return (n = hr(n)) in e ? Object.defineProperty(e, n, {
2113
2114
  value: r,
2114
2115
  enumerable: !0,
@@ -2131,49 +2132,49 @@
2131
2132
  return ("string" === n ? String : Number)(e);
2132
2133
  }
2133
2134
  var Sr = {
2134
- allowNewValues: l().bool,
2135
- animateLoading: l().bool,
2136
- children: l().node,
2137
- controlledFilter: l().bool,
2138
- defaultPlacement: l().oneOf([ "above", "below", "vertical" ]),
2139
- defaultValues: l().array,
2140
- describedBy: l().string,
2141
- disabled: l().bool,
2142
- elementRef: l().oneOfType([ l().func, l().object ]),
2143
- error: l().bool,
2144
- footerMessage: l().node,
2145
- inline: l().bool,
2146
- inputId: l().string,
2147
- inputRef: l().oneOfType([ l().func, l().object ]),
2148
- isLoadingOptions: l().bool,
2149
- labelledBy: l().string,
2150
- loadingMessage: l().node,
2151
- menuStyle: l().object,
2152
- name: l().string,
2153
- noOptionsMessage: l().node,
2154
- onChange: l().func,
2155
- onClose: l().func,
2156
- onFilterChange: l().func,
2157
- onOpen: l().func,
2158
- onScroll: l().func,
2159
- onScrollBottom: l().func,
2160
- placeholder: l().string,
2135
+ allowNewValues: i().bool,
2136
+ animateLoading: i().bool,
2137
+ children: i().node,
2138
+ controlledFilter: i().bool,
2139
+ defaultPlacement: i().oneOf([ "above", "below", "vertical" ]),
2140
+ defaultValues: i().array,
2141
+ describedBy: i().string,
2142
+ disabled: i().bool,
2143
+ elementRef: i().oneOfType([ i().func, i().object ]),
2144
+ error: i().bool,
2145
+ footerMessage: i().node,
2146
+ inline: i().bool,
2147
+ inputId: i().string,
2148
+ inputRef: i().oneOfType([ i().func, i().object ]),
2149
+ isLoadingOptions: i().bool,
2150
+ labelledBy: i().string,
2151
+ loadingMessage: i().node,
2152
+ menuStyle: i().object,
2153
+ name: i().string,
2154
+ noOptionsMessage: i().node,
2155
+ onChange: i().func,
2156
+ onClose: i().func,
2157
+ onFilterChange: i().func,
2158
+ onOpen: i().func,
2159
+ onScroll: i().func,
2160
+ onScrollBottom: i().func,
2161
+ placeholder: i().string,
2161
2162
  /** @private. */
2162
- required: l().bool,
2163
- repositionMode: l().oneOf([ "none", "flip" ]),
2164
- tabConfirmsNewValue: l().bool,
2165
- values: l().array
2163
+ required: i().bool,
2164
+ repositionMode: i().oneOf([ "none", "flip" ]),
2165
+ tabConfirmsNewValue: i().bool,
2166
+ values: i().array
2166
2167
  };
2167
- var wr = q()((function(e) {
2168
+ var wr = T()((function(e) {
2168
2169
  return {
2169
2170
  flexBasis: e,
2170
2171
  width: e
2171
2172
  };
2172
2173
  }));
2173
2174
  // export for testing purpose
2174
- var Cr = q()((function(e) {
2175
+ var Cr = T()((function(e) {
2175
2176
  var n = e.anchorWidth, r = n === void 0 ? 0 : n, t = e.maxHeight, o = e.menuStyle;
2176
- return gr({
2177
+ return yr({
2177
2178
  maxHeight: t,
2178
2179
  overflow: "auto",
2179
2180
  width: Math.max(r, 200)
@@ -2184,9 +2185,9 @@
2184
2185
  var xr = (0, d._)("No matches");
2185
2186
  var jr = (0, d._)("Select...");
2186
2187
  function Pr(r) {
2187
- var t = r.allowNewValues, o = r.animateLoading, l = r.children, a = r.controlledFilter, u = r.defaultPlacement, c = u === void 0 ? "vertical" : u, f = r.defaultValues, p = r.describedBy, v = r.disabled, b = r.elementRef, m = r.error, g = r.footerMessage, y = r.inline, h = r.inputId, O = r.inputRef, S = r.isLoadingOptions, w = r.labelledBy, C = r.loadingMessage, k = r.menuStyle, x = k === void 0 ? kr : k, j = r.name, P = r.noOptionsMessage, M = P === void 0 ? xr : P, R = r.onChange, A = r.onClose, I = r.onFilterChange, B = r.onScroll, T = r.onScrollBottom, L = r.onOpen, N = r.placeholder, V = N === void 0 ? jr : N, D = r.required, q = r.repositionMode, F = r.tabConfirmsNewValue, _ = r.values, H = vr(r, [ "allowNewValues", "animateLoading", "children", "controlledFilter", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onChange", "onClose", "onFilterChange", "onScroll", "onScrollBottom", "onOpen", "placeholder", "required", "repositionMode", "tabConfirmsNewValue", "values" ]);
2188
+ var t = r.allowNewValues, o = r.animateLoading, a = r.children, i = r.controlledFilter, u = r.defaultPlacement, c = u === void 0 ? "vertical" : u, f = r.defaultValues, p = r.describedBy, v = r.disabled, b = r.elementRef, m = r.error, y = r.footerMessage, g = r.inline, h = r.inputId, O = r.inputRef, S = r.isLoadingOptions, w = r.labelledBy, C = r.loadingMessage, k = r.menuStyle, x = k === void 0 ? kr : k, j = r.name, P = r.noOptionsMessage, E = P === void 0 ? xr : P, R = r.onChange, A = r.onClose, I = r.onFilterChange, B = r.onScroll, N = r.onScrollBottom, L = r.onOpen, V = r.placeholder, q = V === void 0 ? jr : V, D = r.required, T = r.repositionMode, F = r.tabConfirmsNewValue, _ = r.values, K = vr(r, [ "allowNewValues", "animateLoading", "children", "controlledFilter", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onChange", "onClose", "onFilterChange", "onScroll", "onScrollBottom", "onOpen", "placeholder", "required", "repositionMode", "tabConfirmsNewValue", "values" ]);
2188
2189
  // @docs-props-type NormalPropsBase
2189
- var K = s()({
2190
+ var H = s()({
2190
2191
  componentName: "Multiselect",
2191
2192
  /* eslint-disable-next-line prefer-rest-params */
2192
2193
  componentProps: arguments[0],
@@ -2197,161 +2198,165 @@
2197
2198
  if (false) {}
2198
2199
  var z = (0, e.useState)(0), W = ur(z, 2), U = W[0], X = W[1];
2199
2200
  var G = (0, e.useState)(null), J = ur(G, 2), Q = J[0], Y = J[1];
2200
- var Z = (0, e.useState)(""), ee = ur(Z, 2), re = ee[0], te = ee[1];
2201
- var oe = (0, e.useState)(false), ae = ur(oe, 2), ie = ae[0], se = ae[1];
2202
- var de = (0, e.useState)(false), fe = ur(de, 2), pe = fe[0], ve = fe[1];
2203
- var be = (0, e.useState)(f || []), me = ur(be, 2), ge = me[0], ye = me[1];
2204
- var he = (0, e.useState)(""), Oe = ur(he, 2), Se = Oe[0], we = Oe[1];
2205
- var Ce = K && _ ? _ : ge;
2206
- var ke = Ce.slice(0);
2207
- var xe = Ce.indexOf(re) >= 0;
2208
- var je = (0, e.useRef)(null);
2201
+ var Z = (0, e.useState)(""), ee = ur(Z, 2), re = ee[0], oe = ee[1];
2202
+ var le = (0, e.useState)(false), ae = ur(le, 2), ie = ae[0], de = ae[1];
2203
+ var fe = (0, e.useState)(false), pe = ur(fe, 2), ve = pe[0], be = pe[1];
2204
+ var me = (0, e.useState)(f || []), ye = ur(me, 2), ge = ye[0], he = ye[1];
2205
+ var Oe = (0, e.useState)(""), Se = ur(Oe, 2), we = Se[0], Ce = Se[1];
2206
+ var ke = H && _ ? _ : ge;
2207
+ var xe = ke.slice(0);
2208
+ var je = ke.indexOf(re) >= 0;
2209
2209
  var Pe = (0, e.useRef)(null);
2210
+ var Ee = (0, e.useRef)(null);
2210
2211
  var Me = (0, e.useRef)(undefined);
2211
- var Ee = (0, e.useRef)(0);
2212
- var Re = (0, e.useState)((function() {
2212
+ var Re = (0, e.useRef)(0);
2213
+ var Ae = (0, e.useState)((function() {
2213
2214
  return {
2214
2215
  activeItemId: (0, ce.createDOMID)("active-item"),
2215
2216
  popoverId: (0, ce.createDOMID)("popover")
2216
2217
  };
2217
- })), Ie = ur(Re, 1), Be = Ie[0], Te = Be.activeItemId, Le = Be.popoverId;
2218
+ })), Ie = ur(Ae, 1), Be = Ie[0], Ne = Be.activeItemId, Le = Be.popoverId;
2218
2219
  (0, e.useEffect)((function() {
2219
- if (K) {
2220
- te("");
2220
+ if (H) {
2221
+ oe("");
2221
2222
  X(0);
2222
2223
  }
2223
- }), [ _, K ]);
2224
- var Ne = (0, e.useCallback)((function(e) {
2224
+ }), [ _, H ]);
2225
+ // Tracks the prev activeIndex so its known if scrolling is needed in handleActiveOptionMount - can't use usePrevious b/c the value needs wiped on Menu close
2226
+ (0, e.useEffect)((function() {
2227
+ Ee.current = U;
2228
+ }), [ U ]);
2229
+ var Ve = (0, e.useCallback)((function(e) {
2225
2230
  var n = e.resetFilterKeyword;
2226
- if (!pe) {
2227
- te((function(e) {
2231
+ if (!ve) {
2232
+ oe((function(e) {
2228
2233
  return n ? "" : e;
2229
2234
  }));
2230
- se(true);
2231
- ve(true);
2235
+ de(true);
2236
+ be(true);
2232
2237
  L === null || L === void 0 ? void 0 : L();
2233
2238
  }
2234
- }), [ pe, L ]);
2235
- var Ve = (0, e.useCallback)((function() {
2239
+ }), [ ve, L ]);
2240
+ var qe = (0, e.useCallback)((function() {
2236
2241
  if (ie) {
2237
- Ne({
2242
+ Ve({
2238
2243
  resetFilterKeyword: false
2239
2244
  });
2240
2245
  } else {
2241
2246
  var e;
2242
- (e = je.current) === null || e === void 0 ? void 0 : e.focus();
2247
+ (e = Pe.current) === null || e === void 0 ? void 0 : e.focus();
2243
2248
  }
2244
- }), [ ie, Ne ]);
2249
+ }), [ ie, Ve ]);
2245
2250
  var De = (0, e.useCallback)((function(e, n) {
2246
- if (!pe) {
2251
+ if (!ve) {
2247
2252
  return;
2248
2253
  }
2249
- var r = (Ce || []).concat([ n ]);
2250
- if (!K) {
2251
- ye(r);
2254
+ var r = (ke || []).concat([ n ]);
2255
+ if (!H) {
2256
+ he(r);
2252
2257
  X(0);
2253
- ve(true);
2254
- te("");
2258
+ be(true);
2259
+ oe("");
2255
2260
  }
2256
2261
  R === null || R === void 0 ? void 0 : R(e, {
2257
2262
  values: r,
2258
2263
  name: j
2259
2264
  });
2260
- }), [ pe, Ce, K, R, j ]);
2261
- var qe = (0, e.useCallback)((function(e, n) {
2262
- var r = $()(Ce, n);
2263
- if (!K) {
2264
- ye(r);
2265
+ }), [ ve, ke, H, R, j ]);
2266
+ var Te = (0, e.useCallback)((function(e, n) {
2267
+ var r = $()(ke, n);
2268
+ if (!H) {
2269
+ he(r);
2265
2270
  }
2266
2271
  R === null || R === void 0 ? void 0 : R(e, {
2267
2272
  values: r,
2268
2273
  name: j
2269
2274
  });
2270
- }), [ Ce, K, j, R ]);
2275
+ }), [ ke, H, j, R ]);
2271
2276
  var _e = (0, e.useCallback)((function(e) {
2272
- if (pe && !S) {
2273
- T === null || T === void 0 ? void 0 : T(e);
2274
- we("".concat(Ee.current, " options, loading more options"));
2277
+ if (ve && !S) {
2278
+ N === null || N === void 0 ? void 0 : N(e);
2279
+ Ce("".concat(Re.current, " options, loading more options"));
2275
2280
  }
2276
- }), [ pe, S, T ]);
2277
- var He = (0, e.useCallback)((function(e, n) {
2281
+ }), [ ve, S, N ]);
2282
+ var Ke = (0, e.useCallback)((function(e, n) {
2278
2283
  var r = n.value;
2279
2284
  In()((function() {
2280
- return qe(e, r);
2285
+ return Te(e, r);
2281
2286
  }));
2282
- }), [ qe ]);
2283
- var Ke = (0, e.useCallback)((function(e) {
2287
+ }), [ Te ]);
2288
+ var He = (0, e.useCallback)((function(e) {
2284
2289
  if (re !== "") {
2285
2290
  I === null || I === void 0 ? void 0 : I(e, {
2286
2291
  keyword: ""
2287
2292
  });
2288
2293
  }
2289
- Ne({
2294
+ Ve({
2290
2295
  resetFilterKeyword: true
2291
2296
  });
2292
- }), [ re, I, Ne ]);
2297
+ }), [ re, I, Ve ]);
2293
2298
  var ze = (0, e.useCallback)((function(n) {
2294
2299
  var r;
2295
2300
  var t = n.key;
2296
- if (t === "Tab" && pe) {
2297
- if (F && Me.current !== undefined && Ee.current <= 1) {
2301
+ if (t === "Tab" && ve) {
2302
+ if (F && Me.current !== undefined && Re.current <= 1) {
2298
2303
  var o;
2299
2304
  n.preventDefault();
2300
2305
  De(n, Me.current);
2301
- (o = je.current) === null || o === void 0 ? void 0 : o.focus();
2306
+ (o = Pe.current) === null || o === void 0 ? void 0 : o.focus();
2302
2307
  } else {
2303
- ve(false);
2308
+ be(false);
2304
2309
  }
2305
2310
  }
2306
2311
  if (n.shiftKey || n.metaKey || n.ctrlKey) {
2307
2312
  return;
2308
2313
  }
2309
- if (t === "End" && pe) {
2314
+ if (t === "End" && ve) {
2310
2315
  n.preventDefault();
2311
- X(Ee.current - 1);
2316
+ X(Re.current - 1);
2312
2317
  }
2313
- if (t === "Home" && pe) {
2318
+ if (t === "Home" && ve) {
2314
2319
  n.preventDefault();
2315
2320
  X(0);
2316
2321
  }
2317
2322
  if (t === "ArrowDown") {
2318
2323
  n.preventDefault();
2319
- if (pe) {
2324
+ if (ve) {
2320
2325
  X((function(e) {
2321
- return Math.min(e + 1, Ee.current - 1);
2326
+ return Math.min(e + 1, Re.current - 1);
2322
2327
  }));
2323
2328
  } else {
2324
2329
  X(0);
2325
- ve(true);
2330
+ be(true);
2326
2331
  }
2327
- if (l && T) {
2328
- var a = e.Children.toArray(l).length - (2 + ((Ce === null || Ce === void 0 ? void 0 : Ce.length) || 0));
2329
- if (U === a) {
2332
+ if (a && N) {
2333
+ var l = e.Children.toArray(a).length - (2 + ((ke === null || ke === void 0 ? void 0 : ke.length) || 0));
2334
+ if (U === l) {
2330
2335
  _e(n);
2331
2336
  }
2332
2337
  }
2333
2338
  }
2334
2339
  if (t === "ArrowUp") {
2335
2340
  n.preventDefault();
2336
- if (pe) {
2341
+ if (ve) {
2337
2342
  X((function(e) {
2338
2343
  return Math.max(e - 1, 0);
2339
2344
  }));
2340
2345
  } else {
2341
2346
  X(0);
2342
- ve(true);
2347
+ be(true);
2343
2348
  }
2344
2349
  }
2345
- if (t === "Enter" && Me.current !== undefined && pe) {
2350
+ if (t === "Enter" && Me.current !== undefined && ve) {
2346
2351
  De(n, Me.current);
2347
2352
  }
2348
- if (t === "Backspace" && ((r = je.current) === null || r === void 0 ? void 0 : r.value) === "" && Ce.length) {
2349
- qe(n, Fn()(Ce));
2353
+ if (t === "Backspace" && ((r = Pe.current) === null || r === void 0 ? void 0 : r.value) === "" && ke.length) {
2354
+ Te(n, Fn()(ke));
2350
2355
  }
2351
- }), [ pe, Ce, F, De, l, T, U, _e, qe ]);
2356
+ }), [ ve, ke, F, De, a, N, U, _e, Te ]);
2352
2357
  var $e = (0, e.useCallback)((function(e) {
2353
- te(e.target.value);
2354
- ve(true);
2358
+ oe(e.target.value);
2359
+ be(true);
2355
2360
  X(0);
2356
2361
  I === null || I === void 0 ? void 0 : I(e, {
2357
2362
  keyword: e.target.value
@@ -2362,7 +2367,7 @@
2362
2367
  var t = n.value;
2363
2368
  e.stopPropagation();
2364
2369
  De(e, t);
2365
- (r = je.current) === null || r === void 0 ? void 0 : r.focus();
2370
+ (r = Pe.current) === null || r === void 0 ? void 0 : r.focus();
2366
2371
  }), [ De ]);
2367
2372
  var Ue = (0, e.useCallback)((function(e) {
2368
2373
  var n = document.getElementById(Le);
@@ -2370,8 +2375,8 @@
2370
2375
  // IE11 doesn't support relatedTarget but sets activeElement
2371
2376
  var t = n && r && n.contains(r);
2372
2377
  // TS: target as Node is an unsafe assumption
2373
- te(t ? re : "");
2374
- se(false);
2378
+ oe(t ? re : "");
2379
+ de(false);
2375
2380
  if (!t) {
2376
2381
  I === null || I === void 0 ? void 0 : I(e, {
2377
2382
  keyword: ""
@@ -2381,13 +2386,13 @@
2381
2386
  var Xe = (0, e.useCallback)((function(e) {
2382
2387
  var n = e.reason, r = e.event;
2383
2388
  if (n === "escapeKey" || n === "offScreen" || n === "clickAway" && r !== undefined && !(Q === null || Q === void 0 ? void 0 : Q.contains(r.target))) {
2384
- ve(false);
2385
- Pe.current = null;
2389
+ be(false);
2390
+ Ee.current = null;
2386
2391
  A === null || A === void 0 ? void 0 : A();
2387
2392
  }
2388
2393
  if (n === "escapeKey") {
2389
2394
  var t;
2390
- (t = je.current) === null || t === void 0 ? void 0 : t.focus();
2395
+ (t = Pe.current) === null || t === void 0 ? void 0 : t.focus();
2391
2396
  }
2392
2397
  }), [ Q, A ]);
2393
2398
  var Ge = (0, e.useCallback)((function(e) {
@@ -2395,12 +2400,12 @@
2395
2400
  Fe(b, e);
2396
2401
  }), [ b ]);
2397
2402
  var Je = (0, e.useCallback)((function(e) {
2398
- je.current = e;
2403
+ Pe.current = e;
2399
2404
  Fe(O, e);
2400
2405
  }), [ O ]);
2401
2406
  var Qe = (0, e.useCallback)((function(e) {
2402
- if (Pe.current !== U) {
2403
- Ae(e);
2407
+ if (Ee.current !== U) {
2408
+ (0, se.scrollIntoViewIfNeeded)(e);
2404
2409
  }
2405
2410
  }), [ U ]);
2406
2411
  var Ye = (0, e.useCallback)((function(e) {
@@ -2418,7 +2423,7 @@
2418
2423
  icon: l,
2419
2424
  key: s.toString(),
2420
2425
  "data-test": "selected-option",
2421
- onRequestRemove: He,
2426
+ onRequestRemove: Ke,
2422
2427
  role: "option",
2423
2428
  value: s,
2424
2429
  appearance: i,
@@ -2432,12 +2437,12 @@
2432
2437
  disabled: v,
2433
2438
  key: (0, ce.createGUID)(),
2434
2439
  "data-test": "selected-option",
2435
- onRequestRemove: He,
2440
+ onRequestRemove: Ke,
2436
2441
  role: "option",
2437
2442
  value: r
2438
2443
  }, r);
2439
2444
  }));
2440
- }), [ v, He ]);
2445
+ }), [ v, Ke ]);
2441
2446
  var Ze = function e(r) {
2442
2447
  return r.map((function(e) {
2443
2448
  var r = e;
@@ -2456,49 +2461,49 @@
2456
2461
  }));
2457
2462
  };
2458
2463
  // Map Options to selected values
2459
- if (Ce && Ce.length) {
2460
- e.Children.toArray(l).filter(e.isValidElement).filter((function(e) {
2461
- return e.type === E;
2464
+ if (ke && ke.length) {
2465
+ e.Children.toArray(a).filter(e.isValidElement).filter((function(e) {
2466
+ return e.type === M;
2462
2467
  })).forEach((function(e) {
2463
- if (e.type === E) {
2464
- var n = Ce.indexOf(e.props.value);
2468
+ if (e.type === M) {
2469
+ var n = ke.indexOf(e.props.value);
2465
2470
  if (n !== -1) {
2466
- ke[n] = e;
2471
+ xe[n] = e;
2467
2472
  }
2468
2473
  }
2469
2474
  }));
2470
2475
  }
2471
2476
  // Filter the items
2472
2477
  var en = (0, ue.stringToKeywords)(re);
2473
- var nn = a ? e.Children.toArray(l) : e.Children.toArray(l).filter((function(e) {
2474
- if (Tn()(e, [ "props", "label" ], false)) {
2478
+ var nn = i ? e.Children.toArray(a) : e.Children.toArray(a).filter((function(e) {
2479
+ if (Nn()(e, [ "props", "label" ], false)) {
2475
2480
  return (0, ue.testPhrase)(e.props.label, en);
2476
2481
  }
2477
2482
  return true;
2478
2483
  // Keep all headers and non-interactive options
2479
2484
  }));
2480
- Ee.current = 0;
2485
+ Re.current = 0;
2481
2486
  Me.current = undefined;
2482
2487
  var rn = e.Children.map(nn, (function(n, r) {
2483
2488
  var t = n.props;
2484
- if (!t || !i()(t, "value")) {
2489
+ if (!t || !l()(t, "value")) {
2485
2490
  // ignore Headings and Dividers
2486
2491
  return n;
2487
2492
  }
2488
2493
  var o = n;
2489
- var l = o.props, u = l.children, c = l.label, s = l.matchRanges, d = l.value;
2494
+ var a = o.props, u = a.children, c = a.label, s = a.matchRanges, d = a.value;
2490
2495
  // find out if the search string exactly matches a value
2491
2496
  if (d === re) {
2492
- xe = true;
2497
+ je = true;
2493
2498
  }
2494
2499
  // remove items that are already selected
2495
- var f = Ce.indexOf(d);
2500
+ var f = ke.indexOf(d);
2496
2501
  if (f >= 0) {
2497
2502
  return null;
2498
2503
  }
2499
2504
  // highlight matched text
2500
- var p = u === undefined || Nn()(u);
2501
- var v = p && !a && !s && en && (0, ue.keywordLocations)(c, en);
2505
+ var p = u === undefined || Vn()(u);
2506
+ var v = p && !i && !s && en && (0, ue.keywordLocations)(c, en);
2502
2507
  // clone item
2503
2508
  var b = (0, e.cloneElement)(o, {
2504
2509
  // eslint-disable-next-line react/no-array-index-key
@@ -2511,8 +2516,8 @@
2511
2516
  return e !== null;
2512
2517
  })) || [];
2513
2518
  // Add the option to add the new value
2514
- if (t && !xe && re) {
2515
- rn.unshift( n().createElement(E, {
2519
+ if (t && !je && re) {
2520
+ rn.unshift( n().createElement(M, {
2516
2521
  label: "".concat(re),
2517
2522
  description: (0, d._)("(New value)"),
2518
2523
  descriptionPosition: "right",
@@ -2524,23 +2529,23 @@
2524
2529
  // highlight the selected Item
2525
2530
  var tn = e.Children.map(rn, (function(n) {
2526
2531
  var r = n.props;
2527
- if (!r || !i()(r, "value")) {
2532
+ if (!r || !l()(r, "value")) {
2528
2533
  // ignore Headings and Dividers
2529
2534
  return n;
2530
2535
  }
2531
2536
  var t = n;
2532
- var o = t.props, l = o.disabled, a = o.value;
2533
- var u = Ee.current === U;
2534
- Ee.current += 1;
2537
+ var o = t.props, a = o.disabled, i = o.value;
2538
+ var u = Re.current === U;
2539
+ Re.current += 1;
2535
2540
  if (!u) {
2536
2541
  return t;
2537
2542
  }
2538
- if (!l) {
2539
- Me.current = a;
2543
+ if (!a) {
2544
+ Me.current = i;
2540
2545
  }
2541
2546
  var c = (0, e.cloneElement)(t, {
2542
2547
  active: u,
2543
- id: Te,
2548
+ id: Ne,
2544
2549
  elementRef: function e(n) {
2545
2550
  Qe(n);
2546
2551
  Fe(t.props.elementRef, n);
@@ -2560,9 +2565,9 @@
2560
2565
  focusMode: "never",
2561
2566
  placement: a !== null && a !== void 0 ? a : undefined,
2562
2567
  isLoading: S,
2563
- onScrollBottom: T ? _e : undefined,
2564
- noOptionsMessage: M,
2565
- footerMessage: g,
2568
+ onScrollBottom: N ? _e : undefined,
2569
+ noOptionsMessage: E,
2570
+ footerMessage: y,
2566
2571
  animateLoading: o,
2567
2572
  loadingMessage: C,
2568
2573
  onScroll: B,
@@ -2570,29 +2575,29 @@
2570
2575
  }, tn);
2571
2576
  };
2572
2577
  var ln = wr("".concat(re.length * .8, "em"));
2573
- var an = gr(gr({}, zn()(H, (function(e, n) {
2578
+ var an = yr(yr({}, zn()(K, (function(e, n) {
2574
2579
  return n === "role" || n.indexOf("aria-") === 0;
2575
2580
  }))), {}, {
2576
2581
  "aria-describedby": p,
2577
2582
  "aria-labelledby": w,
2578
2583
  "aria-invalid": m || undefined
2579
2584
  });
2580
- var un = gr({}, zn()(H, (function(e, n) {
2585
+ var un = yr({}, zn()(K, (function(e, n) {
2581
2586
  return n === "aria-label" || n === "aria-describedby";
2582
2587
  })));
2583
2588
 
2584
2589
  return n().createElement(n().Fragment, null, n().createElement(Yn, tr({
2585
2590
  key: "control",
2586
- "data-test-values": JSON.stringify(Ce),
2591
+ "data-test-values": JSON.stringify(ke),
2587
2592
  "data-test-disabled": v ? "disabled" : undefined,
2588
- inline: y,
2593
+ inline: g,
2589
2594
  $hasFocus: ie
2590
- }, Hn().apply(void 0, [ H ].concat(or(Dn()(an)))), {
2591
- onClick: v ? undefined : Ve,
2595
+ }, Kn().apply(void 0, [ K ].concat(or(Dn()(an)))), {
2596
+ onClick: v ? undefined : qe,
2592
2597
  $disabled: v,
2593
2598
  $error: m,
2594
2599
  "data-test-popover-id": Le,
2595
- $popoverOpen: pe,
2600
+ $popoverOpen: ve,
2596
2601
  flex: true,
2597
2602
  elementRef: Ge,
2598
2603
  role: "group",
@@ -2602,13 +2607,13 @@
2602
2607
  role: "listbox",
2603
2608
  "aria-invalid": m,
2604
2609
  "aria-multiselectable": "true"
2605
- }, Ye(ke)), !v && n().createElement(er, tr({
2610
+ }, Ye(xe)), !v && n().createElement(er, tr({
2606
2611
  role: "combobox",
2607
2612
  "data-test": "textbox",
2608
2613
  id: h,
2609
2614
  ref: Je,
2610
2615
  onBlur: Ue,
2611
- onFocus: Ke,
2616
+ onFocus: He,
2612
2617
  onChange: $e,
2613
2618
  onKeyDown: ze,
2614
2619
  value: re,
@@ -2617,44 +2622,44 @@
2617
2622
  autoCorrect: "off",
2618
2623
  spellCheck: false,
2619
2624
  style: ln,
2620
- placeholder: Ce.length ? "" : V,
2625
+ placeholder: ke.length ? "" : q,
2621
2626
  required: D,
2622
- "aria-activedescendant": pe && Ee.current > 0 ? Te : undefined,
2627
+ "aria-activedescendant": ve && Re.current > 0 ? Ne : undefined,
2623
2628
  "aria-autocomplete": "list",
2624
- "aria-controls": pe ? Le : undefined,
2625
- "aria-owns": pe ? Le : undefined,
2626
- "aria-expanded": pe,
2629
+ "aria-controls": ve ? Le : undefined,
2630
+ "aria-owns": ve ? Le : undefined,
2631
+ "aria-expanded": ve,
2627
2632
  "aria-haspopup": true
2628
2633
  }, an)), n().createElement(Wn(), {
2629
- open: pe && !!Q,
2634
+ open: ve && !!Q,
2630
2635
  autoCloseWhenOffScreen: true,
2631
2636
  anchor: Q,
2632
2637
  onRequestClose: Xe,
2633
2638
  canCoverAnchor: false,
2634
2639
  defaultPlacement: c,
2635
- repositionMode: q,
2640
+ repositionMode: T,
2636
2641
  id: Le
2637
- }, on)), n().createElement(le(), {
2642
+ }, on)), n().createElement(te(), {
2638
2643
  role: "status",
2639
2644
  "aria-relevant": "text"
2640
- }, Se), n().createElement(le(), {
2645
+ }, we), n().createElement(te(), {
2641
2646
  role: "alert",
2642
2647
  "aria-relevant": "additions"
2643
- }, Ze(ke)));
2648
+ }, Ze(xe)));
2644
2649
  }
2645
2650
  Pr.propTypes = Sr;
2646
- Pr.Option = E;
2651
+ Pr.Option = M;
2647
2652
  Pr.Divider = u.Divider;
2648
2653
  Pr.Heading = u.Heading;
2649
- /* harmony default export */ const Mr = Pr;
2654
+ /* harmony default export */ const Er = Pr;
2650
2655
  // CONCATENATED MODULE: ./src/Multiselect/Multiselect.tsx
2651
- function Er(e) {
2656
+ function Mr(e) {
2652
2657
  "@babel/helpers - typeof";
2653
- return Er = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
2658
+ return Mr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
2654
2659
  return typeof e;
2655
2660
  } : function(e) {
2656
2661
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2657
- }, Er(e);
2662
+ }, Mr(e);
2658
2663
  }
2659
2664
  function Rr() {
2660
2665
  return Rr = Object.assign ? Object.assign.bind() : function(e) {
@@ -2689,30 +2694,30 @@
2689
2694
  return e;
2690
2695
  }
2691
2696
  function Br(e, n, r) {
2692
- return (n = Tr(n)) in e ? Object.defineProperty(e, n, {
2697
+ return (n = Nr(n)) in e ? Object.defineProperty(e, n, {
2693
2698
  value: r,
2694
2699
  enumerable: !0,
2695
2700
  configurable: !0,
2696
2701
  writable: !0
2697
2702
  }) : e[n] = r, e;
2698
2703
  }
2699
- function Tr(e) {
2704
+ function Nr(e) {
2700
2705
  var n = Lr(e, "string");
2701
- return "symbol" == Er(n) ? n : n + "";
2706
+ return "symbol" == Mr(n) ? n : n + "";
2702
2707
  }
2703
2708
  function Lr(e, n) {
2704
- if ("object" != Er(e) || !e) return e;
2709
+ if ("object" != Mr(e) || !e) return e;
2705
2710
  var r = e[Symbol.toPrimitive];
2706
2711
  if (void 0 !== r) {
2707
2712
  var t = r.call(e, n || "default");
2708
- if ("object" != Er(t)) return t;
2713
+ if ("object" != Mr(t)) return t;
2709
2714
  throw new TypeError("@@toPrimitive must return a primitive value.");
2710
2715
  }
2711
2716
  return ("string" === n ? String : Number)(e);
2712
2717
  }
2713
- function Nr(e, n) {
2718
+ function Vr(e, n) {
2714
2719
  if (null == e) return {};
2715
- var r, t, o = Vr(e, n);
2720
+ var r, t, o = qr(e, n);
2716
2721
  if (Object.getOwnPropertySymbols) {
2717
2722
  var l = Object.getOwnPropertySymbols(e);
2718
2723
  for (t = 0; t < l.length; t++) {
@@ -2721,7 +2726,7 @@
2721
2726
  }
2722
2727
  return o;
2723
2728
  }
2724
- function Vr(e, n) {
2729
+ function qr(e, n) {
2725
2730
  if (null == e) return {};
2726
2731
  var r = {};
2727
2732
  for (var t in e) {
@@ -2735,47 +2740,47 @@
2735
2740
  /** @public */
2736
2741
  /** @public */
2737
2742
  /** @public */ var Dr = {
2738
- allowNewValues: l().bool,
2739
- animateLoading: l().bool,
2740
- children: l().node,
2741
- compact: l().bool,
2742
- controlledFilter: l().bool,
2743
- defaultPlacement: l().oneOf([ "above", "below", "vertical" ]),
2744
- defaultValues: l().array,
2745
- describedBy: l().string,
2746
- disabled: l().bool,
2747
- elementRef: l().oneOfType([ l().func, l().object ]),
2748
- error: l().bool,
2749
- filter: l().oneOf([ false, true, "controlled" ]),
2750
- footerMessage: l().node,
2751
- inline: l().bool,
2752
- inputId: l().string,
2753
- inputRef: l().oneOfType([ l().func, l().object ]),
2754
- isLoadingOptions: l().bool,
2755
- labelledBy: l().string,
2756
- loadingMessage: l().node,
2757
- menuStyle: l().object,
2758
- name: l().string,
2759
- noOptionsMessage: l().node,
2760
- onChange: l().func,
2761
- onClose: l().func,
2762
- onFilterChange: l().func,
2763
- onOpen: l().func,
2764
- onScroll: l().func,
2765
- onScrollBottom: l().func,
2766
- placeholder: l().string,
2767
- repositionMode: l().oneOf([ "none", "flip" ]),
2768
- selectAllAppearance: l().oneOf([ "buttongroup", "checkbox" ]),
2769
- showSelectedValuesFirst: l().oneOf([ "nextOpen", "immediately", "never" ]),
2770
- tabConfirmsNewValue: l().bool,
2771
- values: l().array,
2743
+ allowNewValues: i().bool,
2744
+ animateLoading: i().bool,
2745
+ children: i().node,
2746
+ compact: i().bool,
2747
+ controlledFilter: i().bool,
2748
+ defaultPlacement: i().oneOf([ "above", "below", "vertical" ]),
2749
+ defaultValues: i().array,
2750
+ describedBy: i().string,
2751
+ disabled: i().bool,
2752
+ elementRef: i().oneOfType([ i().func, i().object ]),
2753
+ error: i().bool,
2754
+ filter: i().oneOf([ false, true, "controlled" ]),
2755
+ footerMessage: i().node,
2756
+ inline: i().bool,
2757
+ inputId: i().string,
2758
+ inputRef: i().oneOfType([ i().func, i().object ]),
2759
+ isLoadingOptions: i().bool,
2760
+ labelledBy: i().string,
2761
+ loadingMessage: i().node,
2762
+ menuStyle: i().object,
2763
+ name: i().string,
2764
+ noOptionsMessage: i().node,
2765
+ onChange: i().func,
2766
+ onClose: i().func,
2767
+ onFilterChange: i().func,
2768
+ onOpen: i().func,
2769
+ onScroll: i().func,
2770
+ onScrollBottom: i().func,
2771
+ placeholder: i().string,
2772
+ repositionMode: i().oneOf([ "none", "flip" ]),
2773
+ selectAllAppearance: i().oneOf([ "buttongroup", "checkbox" ]),
2774
+ showSelectedValuesFirst: i().oneOf([ "nextOpen", "immediately", "never" ]),
2775
+ tabConfirmsNewValue: i().bool,
2776
+ values: i().array,
2772
2777
  /** @private */
2773
- virtualization: l().number
2778
+ virtualization: i().number
2774
2779
  };
2775
- var qr = (0, d._)("No matches");
2780
+ var Tr = (0, d._)("No matches");
2776
2781
  var Fr = (0, d._)("Select...");
2777
2782
  function _r(r) {
2778
- var t = r.allowNewValues, o = r.animateLoading, l = r.compact, a = r.children, i = r.controlledFilter, u = r.defaultPlacement, c = u === void 0 ? "vertical" : u, d = r.defaultValues, f = r.describedBy, p = r.disabled, v = r.elementRef, b = r.error, m = r.filter, g = r.footerMessage, y = r.inline, h = r.inputId, O = r.inputRef, S = r.isLoadingOptions, w = r.labelledBy, C = r.loadingMessage, k = r.menuStyle, x = r.name, j = r.noOptionsMessage, P = j === void 0 ? qr : j, M = r.onChange, E = r.onClose, R = r.onFilterChange, A = r.onOpen, I = r.onScroll, B = r.onScrollBottom, T = r.placeholder, L = T === void 0 ? Fr : T, N = r.repositionMode, V = N === void 0 ? "flip" : N, D = r.selectAllAppearance, q = r.showSelectedValuesFirst, F = r.tabConfirmsNewValue, _ = r.values, H = r.virtualization, K = Nr(r, [ "allowNewValues", "animateLoading", "compact", "children", "controlledFilter", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onChange", "onClose", "onFilterChange", "onOpen", "onScroll", "onScrollBottom", "placeholder", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "tabConfirmsNewValue", "values", "virtualization" ]);
2783
+ var t = r.allowNewValues, o = r.animateLoading, l = r.compact, a = r.children, i = r.controlledFilter, u = r.defaultPlacement, c = u === void 0 ? "vertical" : u, d = r.defaultValues, f = r.describedBy, p = r.disabled, v = r.elementRef, b = r.error, m = r.filter, y = r.footerMessage, g = r.inline, h = r.inputId, O = r.inputRef, S = r.isLoadingOptions, w = r.labelledBy, C = r.loadingMessage, k = r.menuStyle, x = r.name, j = r.noOptionsMessage, P = j === void 0 ? Tr : j, E = r.onChange, M = r.onClose, R = r.onFilterChange, A = r.onOpen, I = r.onScroll, B = r.onScrollBottom, N = r.placeholder, L = N === void 0 ? Fr : N, V = r.repositionMode, q = V === void 0 ? "flip" : V, D = r.selectAllAppearance, T = r.showSelectedValuesFirst, F = r.tabConfirmsNewValue, _ = r.values, K = r.virtualization, H = Vr(r, [ "allowNewValues", "animateLoading", "compact", "children", "controlledFilter", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onChange", "onClose", "onFilterChange", "onOpen", "onScroll", "onScrollBottom", "placeholder", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "tabConfirmsNewValue", "values", "virtualization" ]);
2779
2784
  // @docs-props-type MultiselectPropsBase
2780
2785
  var z = s()({
2781
2786
  componentName: "Multiselect",
@@ -2793,7 +2798,7 @@
2793
2798
  }
2794
2799
  }), [ l, $ ]);
2795
2800
  // Compact uses Button, which defaults `inline` to true, explicitly pass a boolean to prevent the underlying Button from applying its default.
2796
- var W = !!y;
2801
+ var W = !!g;
2797
2802
  var U = Ir({
2798
2803
  allowNewValues: t,
2799
2804
  animateLoading: o,
@@ -2804,7 +2809,7 @@
2804
2809
  disabled: p,
2805
2810
  elementRef: v,
2806
2811
  error: b,
2807
- footerMessage: g,
2812
+ footerMessage: y,
2808
2813
  inline: W,
2809
2814
  inputId: h,
2810
2815
  inputRef: O,
@@ -2814,20 +2819,19 @@
2814
2819
  menuStyle: k,
2815
2820
  name: x,
2816
2821
  noOptionsMessage: P,
2817
- onClose: E,
2818
- onChange: M,
2822
+ onClose: M,
2823
+ onChange: E,
2819
2824
  onFilterChange: R,
2820
2825
  onOpen: A,
2821
2826
  onScroll: I,
2822
2827
  onScrollBottom: B,
2823
2828
  placeholder: L,
2824
- repositionMode: V,
2825
- showSelectedValuesFirst: q,
2829
+ repositionMode: q,
2830
+ showSelectedValuesFirst: T,
2826
2831
  tabConfirmsNewValue: F,
2827
- virtualization: H
2828
- }, K);
2829
- // Memoized what ends up setting defaultValues otherwise useControlled in SelectBase (in Compact/Normal components) can trigger "default props changed after render" warning even though nothing changed on subsequent renders
2830
- var X = (0, e.useMemo)((function() {
2832
+ virtualization: K
2833
+ }, H);
2834
+ var X = (0, e.useMemo)((function() {
2831
2835
  return {
2832
2836
  defaultValues: d
2833
2837
  };
@@ -2843,8 +2847,8 @@
2843
2847
  var Q = {
2844
2848
  filter: m,
2845
2849
  selectAllAppearance: D,
2846
- showSelectedValuesFirst: q,
2847
- virtualization: H
2850
+ showSelectedValuesFirst: T,
2851
+ virtualization: K
2848
2852
  };
2849
2853
  if (l) {
2850
2854
 
@@ -2853,17 +2857,17 @@
2853
2857
  }, J, Q, U));
2854
2858
  }
2855
2859
 
2856
- return n().createElement(Mr, Rr({
2860
+ return n().createElement(Er, Rr({
2857
2861
  "data-test": "multiselect"
2858
2862
  }, J, U));
2859
2863
  }
2860
2864
  // TODO: SUI-3402, this can be removed when ControlGroup no longer needs to inspect componentType
2861
2865
  _r.componentType = "Multiselect";
2862
- _r.Option = E;
2866
+ _r.Option = M;
2863
2867
  _r.Heading = u.Heading;
2864
2868
  _r.Divider = u.Divider;
2865
2869
  _r.propTypes = Dr;
2866
- /* harmony default export */ const Hr = _r;
2870
+ /* harmony default export */ const Kr = _r;
2867
2871
  }) // CONCATENATED MODULE: ./src/Multiselect/index.ts
2868
2872
  ();
2869
2873
  module.exports = t;