@splunk/react-ui 5.4.0 → 5.5.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 (76) hide show
  1. package/Badge.js +154 -0
  2. package/CHANGELOG.md +27 -0
  3. package/Code.js +1097 -500
  4. package/Color.js +142 -141
  5. package/ComboBox.js +6 -5
  6. package/Link.js +74 -44
  7. package/MIGRATION.md +32 -1
  8. package/Menu.js +41 -43
  9. package/Multiselect.js +596 -2143
  10. package/Number.js +3 -3
  11. package/PhoneNumber.d.ts +2 -0
  12. package/PhoneNumber.js +769 -0
  13. package/Popover.js +73 -75
  14. package/RadioList.js +166 -151
  15. package/ResultsMenu.js +27 -29
  16. package/Select.js +179 -1768
  17. package/SelectBase.d.ts +2 -0
  18. package/SelectBase.js +1681 -0
  19. package/Slider.js +202 -199
  20. package/SlidingPanels.js +55 -62
  21. package/Switch.js +42 -27
  22. package/TabBar.js +295 -294
  23. package/TabLayout.js +14 -14
  24. package/Table.js +1087 -1040
  25. package/TransitionOpen.js +82 -74
  26. package/docker-compose.yml +99 -52
  27. package/package.json +9 -5
  28. package/stubs-splunkui.d.ts +0 -86
  29. package/test-runner-jest.config.js +1 -0
  30. package/types/src/Badge/Badge.d.ts +29 -0
  31. package/types/src/Badge/docs/examples/Basic.d.ts +5 -0
  32. package/types/src/Badge/docs/examples/Count.d.ts +6 -0
  33. package/types/src/Badge/docs/examples/CustomColors.d.ts +8 -0
  34. package/types/src/Badge/docs/examples/Icon.d.ts +6 -0
  35. package/types/src/Badge/index.d.ts +2 -0
  36. package/types/src/Code/Code.d.ts +4 -3
  37. package/types/src/Code/index.d.ts +1 -0
  38. package/types/src/Link/Link.d.ts +4 -0
  39. package/types/src/Link/LinkContext.d.ts +14 -0
  40. package/types/src/Link/docs/examples/Visited.d.ts +7 -0
  41. package/types/src/Link/index.d.ts +1 -0
  42. package/types/src/Multiselect/Compact.d.ts +1 -1
  43. package/types/src/Multiselect/Multiselect.d.ts +1 -1
  44. package/types/src/PhoneNumber/PhoneNumber.d.ts +139 -0
  45. package/types/src/PhoneNumber/docs/examples/Controlled.d.ts +7 -0
  46. package/types/src/PhoneNumber/docs/examples/DefaultCountry.d.ts +7 -0
  47. package/types/src/PhoneNumber/docs/examples/Disabled.d.ts +6 -0
  48. package/types/src/PhoneNumber/docs/examples/Error.d.ts +6 -0
  49. package/types/src/PhoneNumber/docs/examples/Inline.d.ts +7 -0
  50. package/types/src/PhoneNumber/docs/examples/Uncontrolled.d.ts +7 -0
  51. package/types/src/PhoneNumber/index.d.ts +2 -0
  52. package/types/src/PhoneNumber/utils.d.ts +47 -0
  53. package/types/src/RadioList/Option.d.ts +6 -1
  54. package/types/src/RadioList/docs/examples/Description.d.ts +6 -0
  55. package/types/src/Select/Option.d.ts +8 -3
  56. package/types/src/Select/Select.d.ts +1 -1
  57. package/types/src/{Select → SelectBase}/OptionBase.d.ts +8 -2
  58. package/types/src/{Select → SelectBase}/SelectBase.d.ts +3 -1
  59. package/types/src/SelectBase/index.d.ts +2 -0
  60. package/types/src/Switch/Switch.d.ts +3 -0
  61. package/types/src/Table/Body.d.ts +6 -1
  62. package/types/src/Table/Cell.d.ts +5 -1
  63. package/types/src/Table/Head.d.ts +6 -2
  64. package/types/src/Table/HeadCell.d.ts +5 -1
  65. package/types/src/Table/Row.d.ts +5 -1
  66. package/types/src/Table/Table.d.ts +20 -1
  67. package/types/src/Table/TableContext.d.ts +1 -0
  68. package/types/src/Table/docs/examples/HorizontalOverflowScroll.d.ts +8 -0
  69. package/types/src/Table/docs/examples/PinActionColumn.d.ts +7 -0
  70. package/types/src/TransitionOpen/TransitionOpen.d.ts +3 -1
  71. package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -0
  72. package/types/src/useRovingFocus/useRovingFocus.d.ts +8 -1
  73. package/usePrevious.d.ts +2 -0
  74. package/useResizeObserver.js +59 -92
  75. package/useRovingFocus.js +96 -41
  76. /package/types/src/{Select → SelectBase}/SelectAllOption.d.ts +0 -0
package/Multiselect.js CHANGED
@@ -63,8 +63,8 @@
63
63
  e.d(n, {
64
64
  Divider: () => /* reexport */ u.Divider,
65
65
  Heading: () => /* reexport */ u.Heading,
66
- Option: () => /* reexport */ M,
67
- default: () => /* reexport */ et
66
+ Option: () => /* reexport */ h,
67
+ default: () => /* reexport */ an
68
68
  });
69
69
  // CONCATENATED MODULE: external "react"
70
70
  const r = require("react");
@@ -78,1715 +78,128 @@
78
78
  // CONCATENATED MODULE: external "@splunk/react-ui/Menu"
79
79
  const u = require("@splunk/react-ui/Menu");
80
80
  // CONCATENATED MODULE: external "@splunk/react-ui/useControlled"
81
- const c = require("@splunk/react-ui/useControlled");
82
- var s = e.n(c);
81
+ const s = require("@splunk/react-ui/useControlled");
82
+ var c = e.n(s);
83
83
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
84
84
  const d = require("@splunk/ui-utils/i18n");
85
- // CONCATENATED MODULE: ./src/Select/OptionBase.tsx
86
- function f(e) {
87
- "@babel/helpers - typeof";
88
- return f = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
89
- return typeof e;
90
- } : function(e) {
91
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
92
- }, f(e);
93
- }
94
- function p() {
95
- return p = Object.assign ? Object.assign.bind() : function(e) {
96
- for (var n = 1; n < arguments.length; n++) {
97
- var r = arguments[n];
98
- for (var t in r) {
99
- ({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
100
- }
101
- }
102
- return e;
103
- }, p.apply(null, arguments);
104
- }
105
- function v(e, n) {
106
- var r = Object.keys(e);
107
- if (Object.getOwnPropertySymbols) {
108
- var t = Object.getOwnPropertySymbols(e);
109
- n && (t = t.filter((function(n) {
110
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
111
- }))), r.push.apply(r, t);
112
- }
113
- return r;
114
- }
115
- function b(e) {
116
- for (var n = 1; n < arguments.length; n++) {
117
- var r = null != arguments[n] ? arguments[n] : {};
118
- n % 2 ? v(Object(r), !0).forEach((function(n) {
119
- m(e, n, r[n]);
120
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : v(Object(r)).forEach((function(n) {
121
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
122
- }));
123
- }
124
- return e;
125
- }
126
- function m(e, n, r) {
127
- return (n = y(n)) in e ? Object.defineProperty(e, n, {
128
- value: r,
129
- enumerable: !0,
130
- configurable: !0,
131
- writable: !0
132
- }) : e[n] = r, e;
133
- }
134
- function y(e) {
135
- var n = g(e, "string");
136
- return "symbol" == f(n) ? n : n + "";
137
- }
138
- function g(e, n) {
139
- if ("object" != f(e) || !e) return e;
140
- var r = e[Symbol.toPrimitive];
141
- if (void 0 !== r) {
142
- var t = r.call(e, n || "default");
143
- if ("object" != f(t)) return t;
144
- throw new TypeError("@@toPrimitive must return a primitive value.");
145
- }
146
- return ("string" === n ? String : Number)(e);
147
- }
148
- function h(e, n) {
149
- if (null == e) return {};
150
- var r, t, o = O(e, n);
151
- if (Object.getOwnPropertySymbols) {
152
- var a = Object.getOwnPropertySymbols(e);
153
- for (t = 0; t < a.length; t++) {
154
- r = a[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
155
- }
156
- }
157
- return o;
158
- }
159
- function O(e, n) {
160
- if (null == e) return {};
161
- var r = {};
162
- for (var t in e) {
163
- if ({}.hasOwnProperty.call(e, t)) {
164
- if (-1 !== n.indexOf(t)) continue;
165
- r[t] = e[t];
166
- }
167
- }
168
- return r;
169
- }
170
- var S = {
171
- /** @private */
172
- active: i().bool,
173
- children: i().node,
174
- description: i().string,
175
- descriptionPosition: i().oneOf([ "right", "bottom" ]),
176
- disabled: i().bool,
177
- elementRef: i().oneOfType([ i().func, i().object ]),
178
- hidden: i().bool,
179
- icon: i().node,
180
- label: i().string.isRequired,
181
- /**
182
- * @private Passed down from <BaseSelect>
183
- */
184
- multiple: i().bool,
185
- matchRanges: i().arrayOf(i().shape({
186
- start: i().number.isRequired,
187
- end: i().number.isRequired
188
- })),
189
- /** @private */
190
- onClick: i().func,
191
- /** @private */
192
- role: i().oneOf([ "menuitemcheckbox", "option" ]),
193
- /** @private */
194
- selected: i().oneOfType([ i().bool, i().oneOf([ "some" ]) ]),
195
- truncate: i().bool,
196
- value: i().oneOfType([ i().string, i().number, i().bool ]).isRequired
197
- };
198
- /**
199
- * An option within a `Multiselect`.
200
- */ function w(e) {
201
- var n = e.children, o = e.descriptionPosition, a = o === void 0 ? "bottom" : o, l = e.disabled, i = e.elementRef, c = e.icon, s = e.label, d = e.multiple, f = e.onClick, v = e.role, m = v === void 0 ? "option" : v, y = e.value, g = h(e, [ "children", "descriptionPosition", "disabled", "elementRef", "icon", "label", "multiple", "onClick", "role", "value" ]);
202
- // @docs-props-type OptionPropsBase
203
- var O = (0, r.useCallback)((function(e) {
204
- if (!l) {
205
- f === null || f === void 0 ? void 0 : f(e, {
206
- value: y
207
- });
208
- }
209
- }), [ l, f, y ]);
210
- var S = y.toString();
211
- var w = b({
212
- descriptionPosition: a,
213
- disabled: l ? "disabled" : undefined
214
- }, g);
215
-
216
- return t().createElement(u.Item, p({
217
- "data-test-value": y,
218
- "data-test": "option",
219
- elementRef: i
220
- }, w, {
221
- selectable: true,
222
- selectableAppearance: d ? "checkbox" : "checkmark",
223
- startAdornment: c,
224
- onClick: O,
225
- role: m,
226
- value: S
227
- }), n || s);
228
- }
229
- w.propTypes = S;
230
- w.type = u.Item;
231
- // For components to distinguish if their children are Options or Headings/Dividers
232
- /* harmony default export */ const C = w;
233
- // CONCATENATED MODULE: ./src/Multiselect/Option.tsx
234
- function k() {
235
- return k = Object.assign ? Object.assign.bind() : function(e) {
236
- for (var n = 1; n < arguments.length; n++) {
237
- var r = arguments[n];
238
- for (var t in r) {
239
- ({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
240
- }
241
- }
242
- return e;
243
- }, k.apply(null, arguments);
244
- }
245
- function j(e, n) {
246
- if (null == e) return {};
247
- var r, t, o = x(e, n);
248
- if (Object.getOwnPropertySymbols) {
249
- var a = Object.getOwnPropertySymbols(e);
250
- for (t = 0; t < a.length; t++) {
251
- r = a[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
252
- }
253
- }
254
- return o;
255
- }
256
- function x(e, n) {
257
- if (null == e) return {};
258
- var r = {};
259
- for (var t in e) {
260
- if ({}.hasOwnProperty.call(e, t)) {
261
- if (-1 !== n.indexOf(t)) continue;
262
- r[t] = e[t];
263
- }
264
- }
265
- return r;
266
- }
267
- // eslint-disable-next-line no-relative-imports-of-published -- TODO(SUI-8264): Ordinarily we do not want to cross component boundaries relatively like this but OptionBase is unpublished therefore can't be imported externally/aliased with @splunk... which prevents risk of mixed relative/external imports in bundles.
268
- var P = {
269
- /** @private */
270
- active: i().bool,
271
- children: i().node,
272
- /**
273
- * @private this is passed down from Multiselect.
274
- */
275
- compact: i().bool,
276
- description: i().string,
277
- descriptionPosition: i().oneOf([ "right", "bottom" ]),
278
- disabled: i().bool,
279
- elementRef: i().oneOfType([ i().func, i().object ]),
280
- hidden: i().bool,
281
- icon: i().node,
282
- label: i().string.isRequired,
283
- matchRanges: i().arrayOf(i().shape({
284
- start: i().number.isRequired,
285
- end: i().number.isRequired
286
- })),
287
- /** @private */
288
- onClick: i().func,
289
- /** @private */
290
- role: i().oneOf([ "menuitemcheckbox", "option" ]),
291
- /** @private */
292
- selected: i().bool,
293
- selectedAppearance: i().oneOf([ "info", "success", "warning", "error" ]),
294
- selectedBackgroundColor: i().string,
295
- selectedForegroundColor: i().string,
296
- truncate: i().bool,
297
- value: i().oneOfType([ i().string, i().number, i().bool ]).isRequired
298
- };
299
- /**
300
- * An option within a `Multiselect`.
301
- */ function E(e) {
302
- var n = e.compact, r = e.children, o = e.description, a = e.descriptionPosition, l = a === void 0 ? "bottom" : a, 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 = j(e, [ "compact", "children", "description", "descriptionPosition", "disabled", "elementRef", "hidden", "icon", "label", "matchRanges", "role", "selected", "truncate", "value" ]);
303
- // @docs-props-type OptionPropsBase
304
- // selectedAppearance, selectedBackgroundColor, and selectedForegroundColor are not used directly by the Option component.
305
- // They are consumed by the parent component (Multiselect-Normal) to render the Chip, so they are not included in the above prop list.
306
-
307
- return t().createElement(C, k({
308
- description: o,
309
- descriptionPosition: l,
310
- disabled: i,
311
- elementRef: u,
312
- hidden: c,
313
- icon: s,
314
- label: d,
315
- matchRanges: f,
316
- role: p,
317
- selected: v,
318
- truncate: b,
319
- value: m
320
- }, y, {
321
- multiple: n
322
- }), r || d);
323
- }
324
- E.propTypes = P;
325
- /* harmony default export */ const M = E;
326
- // CONCATENATED MODULE: external "lodash/castArray"
327
- const R = require("lodash/castArray");
328
- var A = e.n(R);
329
- // CONCATENATED MODULE: external "lodash/find"
330
- const I = require("lodash/find");
331
- var B = e.n(I);
332
- // CONCATENATED MODULE: external "lodash/forEachRight"
333
- const N = require("lodash/forEachRight");
334
- var V = e.n(N);
335
- // CONCATENATED MODULE: external "lodash/includes"
336
- const D = require("lodash/includes");
337
- var L = e.n(D);
338
- // CONCATENATED MODULE: external "lodash/memoize"
339
- const q = require("lodash/memoize");
340
- var T = e.n(q);
341
- // CONCATENATED MODULE: external "lodash/pick"
342
- const F = require("lodash/pick");
343
- var _ = e.n(F);
344
- // CONCATENATED MODULE: external "lodash/uniq"
345
- const K = require("lodash/uniq");
346
- var H = e.n(K);
347
- // CONCATENATED MODULE: external "lodash/without"
348
- const $ = require("lodash/without");
349
- var z = e.n($);
350
- // CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
351
- const W = require("@splunk/react-icons/CaretSmallDown");
352
- var U = e.n(W);
353
- // CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
354
- const X = require("@splunk/react-icons/Magnifier");
355
- var G = e.n(X);
356
- // CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
357
- const J = require("@splunk/react-ui/Dropdown");
358
- var Q = e.n(J);
359
- // CONCATENATED MODULE: external "@splunk/react-ui/Link"
360
- const Y = require("@splunk/react-ui/Link");
361
- var Z = e.n(Y);
362
- // CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
363
- const ee = require("@splunk/react-ui/ResultsMenu");
364
- var ne = e.n(ee);
365
- // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
366
- const re = require("@splunk/react-ui/ScreenReaderContent");
367
- var te = e.n(re);
368
- // CONCATENATED MODULE: external "@splunk/react-ui/Text"
369
- const oe = require("@splunk/react-ui/Text");
370
- var ae = e.n(oe);
371
- // CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
372
- const le = require("@splunk/react-ui/usePrevious");
373
- var ie = e.n(le);
374
- // CONCATENATED MODULE: external "@splunk/ui-utils/filter"
375
- const ue = require("@splunk/ui-utils/filter");
376
- // CONCATENATED MODULE: external "@splunk/ui-utils/id"
377
- const ce = require("@splunk/ui-utils/id");
378
- // CONCATENATED MODULE: external "@splunk/ui-utils/scroll"
379
- const se = require("@splunk/ui-utils/scroll");
380
- // CONCATENATED MODULE: ./src/Select/SelectAllOption.tsx
381
- function de(e) {
382
- "@babel/helpers - typeof";
383
- return de = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
384
- return typeof e;
385
- } : function(e) {
386
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
387
- }, de(e);
388
- }
389
- function fe() {
390
- return fe = Object.assign ? Object.assign.bind() : function(e) {
391
- for (var n = 1; n < arguments.length; n++) {
392
- var r = arguments[n];
393
- for (var t in r) {
394
- ({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
395
- }
396
- }
397
- return e;
398
- }, fe.apply(null, arguments);
399
- }
400
- function pe(e, n) {
401
- if (null == e) return {};
402
- var r, t, o = ve(e, n);
403
- if (Object.getOwnPropertySymbols) {
404
- var a = Object.getOwnPropertySymbols(e);
405
- for (t = 0; t < a.length; t++) {
406
- r = a[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
407
- }
408
- }
409
- return o;
410
- }
411
- function ve(e, n) {
412
- if (null == e) return {};
413
- var r = {};
414
- for (var t in e) {
415
- if ({}.hasOwnProperty.call(e, t)) {
416
- if (-1 !== n.indexOf(t)) continue;
417
- r[t] = e[t];
418
- }
419
- }
420
- return r;
421
- }
422
- function be(e, n) {
423
- var r = Object.keys(e);
424
- if (Object.getOwnPropertySymbols) {
425
- var t = Object.getOwnPropertySymbols(e);
426
- n && (t = t.filter((function(n) {
427
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
428
- }))), r.push.apply(r, t);
429
- }
430
- return r;
431
- }
432
- function me(e) {
433
- for (var n = 1; n < arguments.length; n++) {
434
- var r = null != arguments[n] ? arguments[n] : {};
435
- n % 2 ? be(Object(r), !0).forEach((function(n) {
436
- ye(e, n, r[n]);
437
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : be(Object(r)).forEach((function(n) {
438
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
439
- }));
440
- }
441
- return e;
442
- }
443
- function ye(e, n, r) {
444
- return (n = ge(n)) in e ? Object.defineProperty(e, n, {
445
- value: r,
446
- enumerable: !0,
447
- configurable: !0,
448
- writable: !0
449
- }) : e[n] = r, e;
450
- }
451
- function ge(e) {
452
- var n = he(e, "string");
453
- return "symbol" == de(n) ? n : n + "";
454
- }
455
- function he(e, n) {
456
- if ("object" != de(e) || !e) return e;
457
- var r = e[Symbol.toPrimitive];
458
- if (void 0 !== r) {
459
- var t = r.call(e, n || "default");
460
- if ("object" != de(t)) return t;
461
- throw new TypeError("@@toPrimitive must return a primitive value.");
462
- }
463
- return ("string" === n ? String : Number)(e);
464
- }
465
- var Oe = me(me({}, C.propTypes), {}, {
466
- totalCount: i().number,
467
- // unlike OptionBase, there's a default value for this prop
468
- value: i().string
469
- });
470
- function Se(e) {
471
- var n = e.active, r = e.elementRef, o = e.id, a = e.label, l = e.onClick, i = e.selected, u = e.totalCount, c = e.value, s = c === void 0 ? "selectAll" : c, d = pe(e, [ "active", "elementRef", "id", "label", "onClick", "selected", "totalCount", "value" ]);
472
- // @docs-props-type SelectAllOptionPropsBase
473
- // When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
474
- var f = u != null ? " (".concat(u === null || u === void 0 ? void 0 : u.toString(), ")") : "";
475
-
476
- return t().createElement(C, fe({
477
- active: n,
478
- elementRef: r,
479
- "aria-keyshortcuts": "Control+A",
480
- "data-test": "select-all",
481
- description: "".concat(f, " Ctrl-a"),
482
- descriptionPosition: "right",
483
- id: o,
484
- key: "selectAll",
485
- multiple: true,
486
- label: a,
487
- onClick: l,
488
- selected: i,
489
- role: "menuitemcheckbox",
490
- value: s
491
- }, d));
492
- }
493
- Se.propTypes = Oe;
494
- /* harmony default export */ const we = Se;
495
- // CONCATENATED MODULE: external "styled-components"
496
- const Ce = require("styled-components");
497
- var ke = e.n(Ce);
498
- // CONCATENATED MODULE: external "@splunk/react-ui/Button"
499
- const je = require("@splunk/react-ui/Button");
500
- var xe = e.n(je);
501
- // CONCATENATED MODULE: external "@splunk/react-ui/Divider"
502
- const Pe = require("@splunk/react-ui/Divider");
503
- var Ee = e.n(Pe);
504
- // CONCATENATED MODULE: external "@splunk/themes"
505
- const Me = require("@splunk/themes");
506
- // CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
507
- var Re = ke()(xe()).withConfig({
508
- displayName: "SelectBaseStyles__StyledButton",
509
- componentId: "sc-16cj7sk-0"
510
- })([ "&[data-inline]{width:", ";}", "" ], (function(e) {
511
- var n = e.$multiple;
512
- return n ? "400px" : "auto";
513
- }), (function(e) {
514
- var n = e.$multiple;
515
- return !n && "flex-grow: 0;";
516
- }));
517
- var Ae = ke().span.withConfig({
518
- displayName: "SelectBaseStyles__StyledLinkIcon",
519
- componentId: "sc-16cj7sk-1"
520
- })([ "padding-right:", ";" ], Me.variables.spacingXSmall);
521
- var Ie = ke().span.withConfig({
522
- displayName: "SelectBaseStyles__StyledLinkCaret",
523
- componentId: "sc-16cj7sk-2"
524
- })([ "padding-left:", ";" ], Me.variables.spacingXSmall);
525
- var Be = ke().div.withConfig({
526
- displayName: "SelectBaseStyles__StyledFilter",
527
- componentId: "sc-16cj7sk-3"
528
- })([ "padding:", " ", " ", ";min-width:160px;" ], Me.variables.spacingLarge, Me.variables.spacingLarge, Me.variables.spacingSmall);
529
- var Ne = ke().span.withConfig({
530
- displayName: "SelectBaseStyles__StyledCount",
531
- componentId: "sc-16cj7sk-4"
532
- })([ "padding-right:", ";" ], Me.variables.spacingXSmall);
533
- var Ve = ke()(Z()).withConfig({
534
- displayName: "SelectBaseStyles__StyledControlsLink",
535
- componentId: "sc-16cj7sk-5"
536
- })([ "", ";" ], (function(e) {
537
- var n = e.$disabled;
538
- return n && (0, Ce.css)([ "color:", ";" ], Me.variables.contentColorDisabled);
539
- }));
540
- var De = ke().div.withConfig({
541
- displayName: "SelectBaseStyles__StyledToggleAllControls",
542
- componentId: "sc-16cj7sk-6"
543
- })([ "", ";gap:", ";padding:", " ", " ", ";" ], Me.mixins.reset("flex"), Me.variables.spacingMedium, Me.variables.spacingXSmall, Me.variables.spacingLarge, Me.variables.spacingSmall);
544
- var Le = ke()(Ee()).withConfig({
545
- displayName: "SelectBaseStyles__StyledControlsDivider",
546
- componentId: "sc-16cj7sk-7"
547
- })([ "border-color:", ";" ], Me.variables.borderColor);
548
- // CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
549
- // A utility for matching keyboard characters to list values
550
- var qe = function e(n, r) {
551
- return n ? n.label.charAt(r).toLowerCase() : "";
552
- };
553
- var Te = function e(n, r) {
554
- if (!n.length) {
555
- return n;
556
- }
557
- var t = null;
558
- var o = false;
559
- var a = n.filter((function(e) {
560
- var n = qe(e, r.index);
561
- if (n === r.value) {
562
- o = true;
563
- return true;
564
- }
565
- // If we haven't found a match yet, keep track of the next closest match.
566
- // Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
567
- if (!o) {
568
- var a = qe(t, r.index);
569
- if (!a) {
570
- t = e;
571
- } else if (n > r.value) {
572
- if (a < r.value) {
573
- t = e;
574
- } else if (a > n) {
575
- t = e;
576
- }
577
- } else if (n > a) {
578
- t = e;
579
- }
580
- }
581
- return false;
582
- }));
583
- return a.length === 0 && t ? [ t ] : a;
584
- };
585
- // CONCATENATED MODULE: ./src/utils/ssrDocument.ts
586
- /* eslint-disable @typescript-eslint/no-empty-function */
587
- var Fe = {
588
- body: {
589
- appendChild: function e() {
590
- return [];
591
- }
592
- },
593
- addEventListener: function e() {},
594
- removeEventListener: function e() {},
595
- activeElement: {
596
- blur: function e() {},
597
- nodeName: ""
598
- },
599
- querySelector: function e() {
600
- return null;
601
- },
602
- querySelectorAll: function e() {
603
- return [];
604
- },
605
- getElementById: function e() {
606
- return null;
607
- },
608
- createEvent: function e() {
609
- return {
610
- initEvent: function e() {}
611
- };
612
- },
613
- createElement: function e() {
614
- return {
615
- children: [],
616
- childNodes: [],
617
- style: {},
618
- setAttribute: function e() {},
619
- getElementsByTagName: function e() {
620
- return [];
621
- }
622
- };
623
- },
624
- createElementNS: function e() {
625
- return {};
626
- },
627
- importNode: function e() {
628
- return null;
629
- },
630
- location: {
631
- hash: "",
632
- host: "",
633
- hostname: "",
634
- href: "",
635
- origin: "",
636
- pathname: "",
637
- protocol: "",
638
- search: ""
639
- }
640
- };
641
- function _e() {
642
- var e = typeof document !== "undefined" ? document : Fe;
643
- return e;
644
- }
645
- var Ke = _e();
646
- /* harmony default export */ const He = /* unused pure expression or super */ null && Ke;
647
- // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
648
- /* eslint-disable @typescript-eslint/no-empty-function */
649
- var $e = {
650
- document: Fe,
651
- navigator: {
652
- userAgent: ""
653
- },
654
- location: {
655
- hash: "",
656
- host: "",
657
- hostname: "",
658
- href: "",
659
- origin: "",
660
- pathname: "",
661
- protocol: "",
662
- search: ""
663
- },
664
- history: {
665
- replaceState: function e() {},
666
- pushState: function e() {},
667
- go: function e() {},
668
- back: function e() {}
669
- },
670
- CustomEvent: function e() {
671
- return this;
672
- },
673
- addEventListener: function e() {},
674
- removeEventListener: function e() {},
675
- getComputedStyle: function e() {
676
- return {
677
- getPropertyValue: function e() {
678
- return "";
679
- }
680
- };
681
- },
682
- Image: function e() {},
683
- Date: function e() {},
684
- screen: {},
685
- setTimeout: function e() {},
686
- clearTimeout: function e() {},
687
- matchMedia: function e() {
688
- return {};
689
- },
690
- requestAnimationFrame: function e(n) {
691
- if (typeof setTimeout === "undefined") {
692
- n();
693
- return null;
694
- }
695
- return setTimeout(n, 0);
696
- },
697
- cancelAnimationFrame: function e(n) {
698
- if (typeof setTimeout === "undefined") {
699
- return;
700
- }
701
- clearTimeout(n);
702
- }
703
- };
704
- function ze() {
705
- var e = typeof window !== "undefined" ? window : $e;
706
- return e;
707
- }
708
- var We = ze();
709
- /* harmony default export */ const Ue = /* unused pure expression or super */ null && We;
710
- // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
711
- /**
712
- * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
713
- *
714
- * @param ref - The React callback or object ref. Can be `null` or `undefined`.
715
- * @param current - The new value of the ref.
716
- */
717
- function Xe(e, n) {
718
- if (e) {
719
- if (typeof e === "function") {
720
- e(n);
721
- } else {
722
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
723
- // the intention here is to signal "we will take care of setting 'current', not you".
724
- e.current = n;
725
- // eslint-disable-line no-param-reassign
726
- }
727
- }
728
- }
729
- // CONCATENATED MODULE: ./src/Select/SelectBase.tsx
730
- function Ge(e) {
731
- return Ye(e) || Qe(e) || rn(e) || Je();
732
- }
733
- function Je() {
734
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
735
- }
736
- function Qe(e) {
737
- if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
738
- }
739
- function Ye(e) {
740
- if (Array.isArray(e)) return tn(e);
741
- }
742
- function Ze() {
743
- return Ze = Object.assign ? Object.assign.bind() : function(e) {
744
- for (var n = 1; n < arguments.length; n++) {
745
- var r = arguments[n];
746
- for (var t in r) {
747
- ({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
748
- }
749
- }
750
- return e;
751
- }, Ze.apply(null, arguments);
752
- }
753
- function en(e, n) {
754
- return an(e) || on(e, n) || rn(e, n) || nn();
755
- }
756
- function nn() {
757
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
758
- }
759
- function rn(e, n) {
760
- if (e) {
761
- if ("string" == typeof e) return tn(e, n);
762
- var r = {}.toString.call(e).slice(8, -1);
763
- return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? tn(e, n) : void 0;
764
- }
765
- }
766
- function tn(e, n) {
767
- (null == n || n > e.length) && (n = e.length);
768
- for (var r = 0, t = Array(n); r < n; r++) {
769
- t[r] = e[r];
770
- }
771
- return t;
772
- }
773
- function on(e, n) {
774
- var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
775
- if (null != r) {
776
- var t, o, a, l, i = [], u = !0, c = !1;
777
- try {
778
- if (a = (r = r.call(e)).next, 0 === n) {
779
- if (Object(r) !== r) return;
780
- u = !1;
781
- } else for (;!(u = (t = a.call(r)).done) && (i.push(t.value), i.length !== n); u = !0) {
782
- }
783
- } catch (e) {
784
- c = !0, o = e;
785
- } finally {
786
- try {
787
- if (!u && null != r["return"] && (l = r["return"](), Object(l) !== l)) return;
788
- } finally {
789
- if (c) throw o;
790
- }
791
- }
792
- return i;
793
- }
794
- }
795
- function an(e) {
796
- if (Array.isArray(e)) return e;
797
- }
798
- function ln(e, n) {
799
- if (null == e) return {};
800
- var r, t, o = un(e, n);
801
- if (Object.getOwnPropertySymbols) {
802
- var a = Object.getOwnPropertySymbols(e);
803
- for (t = 0; t < a.length; t++) {
804
- r = a[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
805
- }
806
- }
807
- return o;
808
- }
809
- function un(e, n) {
810
- if (null == e) return {};
811
- var r = {};
812
- for (var t in e) {
813
- if ({}.hasOwnProperty.call(e, t)) {
814
- if (-1 !== n.indexOf(t)) continue;
815
- r[t] = e[t];
816
- }
817
- }
818
- return r;
819
- }
820
- function cn(e) {
821
- "@babel/helpers - typeof";
822
- return cn = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
823
- return typeof e;
824
- } : function(e) {
825
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
826
- }, cn(e);
827
- }
828
- function sn(e, n) {
829
- var r = Object.keys(e);
830
- if (Object.getOwnPropertySymbols) {
831
- var t = Object.getOwnPropertySymbols(e);
832
- n && (t = t.filter((function(n) {
833
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
834
- }))), r.push.apply(r, t);
835
- }
836
- return r;
837
- }
838
- function dn(e) {
839
- for (var n = 1; n < arguments.length; n++) {
840
- var r = null != arguments[n] ? arguments[n] : {};
841
- n % 2 ? sn(Object(r), !0).forEach((function(n) {
842
- fn(e, n, r[n]);
843
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : sn(Object(r)).forEach((function(n) {
844
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
845
- }));
846
- }
847
- return e;
848
- }
849
- function fn(e, n, r) {
850
- return (n = pn(n)) in e ? Object.defineProperty(e, n, {
851
- value: r,
852
- enumerable: !0,
853
- configurable: !0,
854
- writable: !0
855
- }) : e[n] = r, e;
856
- }
857
- function pn(e) {
858
- var n = vn(e, "string");
859
- return "symbol" == cn(n) ? n : n + "";
860
- }
861
- function vn(e, n) {
862
- if ("object" != cn(e) || !e) return e;
863
- var r = e[Symbol.toPrimitive];
864
- if (void 0 !== r) {
865
- var t = r.call(e, n || "default");
866
- if ("object" != cn(t)) return t;
867
- throw new TypeError("@@toPrimitive must return a primitive value.");
868
- }
869
- return ("string" === n ? String : Number)(e);
870
- }
871
- var bn = {
872
- allowKeyMatching: i().bool,
873
- allowNewValues: i().bool,
874
- animateLoading: i().bool,
875
- appearance: i().oneOf([ "default", "link", "subtle" ]),
876
- append: i().bool,
877
- children: i().node,
878
- defaultPlacement: i().oneOf([ "above", "below", "vertical" ]),
879
- defaultValues: i().array,
880
- describedBy: i().string,
881
- disabled: i().bool,
882
- elementRef: i().oneOfType([ i().func, i().object ]),
883
- error: i().bool,
884
- filter: i().oneOf([ false, true, "controlled" ]),
885
- footerMessage: i().node,
886
- inline: i().bool,
887
- inputId: i().string,
888
- inputRef: i().oneOfType([ i().func, i().object ]),
889
- isLoadingOptions: i().bool,
890
- labelledBy: i().string,
891
- labelText: i().string,
892
- loadingMessage: i().node,
893
- menuStyle: i().object,
894
- multiple: i().bool,
895
- name: i().string,
896
- noOptionsMessage: i().node,
897
- onChange: i().func,
898
- onClick: i().func,
899
- onClose: i().func,
900
- onFilterChange: i().func,
901
- onOpen: i().func,
902
- onScroll: i().func,
903
- onScrollBottom: i().func,
904
- /** @private. */
905
- required: i().bool,
906
- placeholder: i().string,
907
- prefixLabel: i().string,
908
- prepend: i().bool,
909
- repositionMode: i().oneOf([ "none", "flip" ]),
910
- selectAllAppearance: i().oneOf([ "buttongroup", "checkbox", "none" ]),
911
- showSelectedValuesFirst: i().oneOf([ "nextOpen", "immediately", "never" ]),
912
- suffixLabel: i().string,
913
- tabConfirmsNewValue: i().bool,
914
- toggle: i().node,
915
- toggleContent: i().oneOf([ "optionChildren", "optionLabel" ]),
916
- values: i().array,
917
- /** @private. */
918
- virtualization: i().number
919
- };
920
- var mn = T()((function(e) {
921
- return [ e ];
922
- }));
923
- // preserve separate widths for single vs. multi mode
924
- var yn = T()((function(e) {
925
- var n = e.anchorWidth, r = e.isMultiple, t = e.maxHeight, o = e.menuStyle;
926
- return r ? dn({
927
- width: Math.max(n !== null && n !== void 0 ? n : 0, 200),
928
- maxHeight: t
929
- }, o) : dn({
930
- minWidth: n !== null && n !== void 0 ? n : undefined,
931
- maxWidth: Math.max(n !== null && n !== void 0 ? n : 0, 300),
932
- maxHeight: t
933
- }, o);
934
- }));
935
- var gn = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
936
- function hn(e) {
937
- return e && a()(e.props, "value");
938
- }
939
- function On(e, n) {
940
- return "".concat(cn(e), "-").concat(e, "-").concat(n);
941
- }
942
- var Sn = [ "append", "error", "prepend" ];
943
- var wn = (0, d._)("No matches");
944
- var Cn = (0, d._)("Select...");
945
- var kn = t().createElement(G(), null);
946
- var jn = function e(n) {
947
- var r = n.activeItemId, o = n.filterA11yId, a = n.filterKeyword, l = n.hasChildren, i = n.inputId, u = n.inputRef, c = n.menuListboxId, s = n.multiple, f = n.onClearAll, p = n.onSelectAll, v = n.onTextBlur, b = n.onTextChange, m = n.onTextFocus, y = n.onTextKeyDown, g = n.optionSelection, h = n.placement, O = n.selectAllAppearance, S = n.textHasFocus;
948
- var w = (0, d._)("Select all options".concat(g.current === "all" ? " disabled" : ""));
949
- var C = (0, d._)("Clear all options".concat(g.current === "none" ? " disabled" : ""));
950
- // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
951
- var k = t().createElement(De, {
952
- key: "selectAll"
953
- }, t().createElement(Ve, {
954
- disabled: g.current === "all",
955
- appearance: "standalone",
956
- "aria-label": w,
957
- onClick: p,
958
- "data-test": "select-all",
959
- tag: "button"
960
- }, a ? (0, d._)("Select all Matches") : (0, d._)("Select all")), t().createElement(Ve, {
961
- disabled: g.current === "none",
962
- appearance: "standalone",
963
- "aria-label": C,
964
- onClick: f,
965
- "data-test": "clear-all",
966
- tag: "button"
967
- }, a ? (0, d._)("Clear all Matches") : (0, d._)("Clear all")));
968
-
969
- return t().createElement("div", {
970
- key: "controls"
971
- }, o && t().createElement(te(), {
972
- id: o
973
- }, (0, d._)("Type to filter")), h === "above" && t().createElement(Le, null), t().createElement(Be, {
974
- key: "filter",
975
- "data-test": "filter"
976
- }, t().createElement(ae(), {
977
- value: a,
978
- autoCapitalize: "off",
979
- autoComplete: "off",
980
- autoCorrect: "off",
981
- spellCheck: false,
982
- onChange: b,
983
- onKeyDown: y,
984
- onFocus: m,
985
- onBlur: v,
986
- placeholder: (0, d._)("filter"),
987
- role: "combobox",
988
- "aria-expanded": "true",
989
- "aria-controls": c,
990
- "aria-owns": S && l ? r : undefined,
991
- "aria-label": (0, d._)("Filter"),
992
- "aria-autocomplete": "list",
993
- "aria-activedescendant": S && l ? r : undefined,
994
- inputRef: u,
995
- inputId: i,
996
- canClear: true,
997
- startAdornment: kn
998
- })), s && l && O === "buttongroup" && k, h === "below" && t().createElement(Le, null));
999
- };
1000
- var xn = function e(n) {
1001
- var r = n.prefixLabel, t = n.label, o = n.suffixLabel;
1002
- var a = t;
1003
- if (r) {
1004
- a = [ "".concat(r, ": ") ].concat(a);
1005
- }
1006
- if (o) {
1007
- a = A()(a).concat(" ".concat(o));
1008
- }
1009
- return a;
1010
- };
1011
- var Pn = t().forwardRef((function(e, n) {
1012
- var o = e.appearance, a = o === void 0 ? "default" : o, l = e.append, i = e.children, u = e.currentValues, c = u === void 0 ? [] : u, s = e.describedBy, f = e.disabled, p = e.elementRef, v = e.error, b = e.inline, m = e.labelText, y = e.labelledBy, g = e.multiple, h = e.onClick, O = e.placeholder, S = e.prefixLabel, w = e.prepend, C = e.required, k = e.suffixLabel, j = e.toggle, x = e.toggleContent, P = ln(e, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent" ]);
1013
- var E;
1014
- var M;
1015
- var R = [];
1016
- // Generate buttonLabels
1017
- var A = r.Children.toArray(i);
1018
- var I = c.reduce((function(e, n, r, t) {
1019
- var o = B()(A, (function(e) {
1020
- return hn(e) && e.props.value === n;
1021
- }));
1022
- if (o) {
1023
- var a = o.props, l = a.children, i = a.icon, u = a.label;
1024
- var s = x !== "optionLabel" && l ? l : u;
1025
- e.push(s);
1026
- R.push(u);
1027
- // if not in multiple mode, add the icon
1028
- if (!g && c.length === 1) {
1029
- E = i;
85
+ // CONCATENATED MODULE: external "@splunk/react-ui/SelectBase"
86
+ const f = require("@splunk/react-ui/SelectBase");
87
+ var p = e.n(f);
88
+ // CONCATENATED MODULE: ./src/Multiselect/Option.tsx
89
+ function v() {
90
+ return v = Object.assign ? Object.assign.bind() : function(e) {
91
+ for (var n = 1; n < arguments.length; n++) {
92
+ var r = arguments[n];
93
+ for (var t in r) {
94
+ ({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
1030
95
  }
1031
- } else if (g) {
1032
- // only add values that don't match an option in "multiple" mode to preserve old behaviour
1033
- e.push(n);
1034
- R.push(n.toString());
1035
- }
1036
- if (r < t.length - 1) {
1037
- e.push((0, d._)(", "));
1038
- R.push((0, d._)(", "));
1039
96
  }
1040
97
  return e;
1041
- }), []);
1042
- M = I;
1043
- // only apply prefix / suffix if the label is not empty
1044
- if (M.length > 0) {
1045
- // If there's more than one item selected, read out the selected total
1046
- // rather than reading out each selected item
1047
- R = xn({
1048
- prefixLabel: S,
1049
- label: M.length > 1 ? [ "".concat(c.length, " items selected") ] : R,
1050
- suffixLabel: k
1051
- });
1052
- M = xn({
1053
- prefixLabel: S,
1054
- label: M,
1055
- suffixLabel: k
1056
- });
1057
- }
1058
- // single <Select> behaviour is to show the placeholder if all parts of the label
1059
- // are empty strings so we replicate this behaviour here
1060
- if (M.length === 0 || !g && M.every((function(e) {
1061
- return e === "";
1062
- }))) {
1063
- M = mn(O);
1064
- R = M;
1065
- }
1066
- var N = Object.keys(P).includes("aria-labelledby");
1067
- var V = dn({
1068
- "aria-describedby": s,
1069
- "aria-label": y || N ? undefined : "".concat(m ? "".concat(m, ", ") : "").concat(R.join("")),
1070
- // aria-labelledby takes precedence over aria-label, so existence of both is redundant
1071
- "aria-labelledby": y,
1072
- "aria-required": C,
1073
- "data-select-appearance": a,
1074
- append: l,
1075
- prepend: w,
1076
- onClick: h,
1077
- role: "combobox",
1078
- disabled: f ? "disabled" : undefined,
1079
- elementRef: p,
1080
- error: v,
1081
- ref: n
1082
- }, P);
1083
- if (g) {
1084
- V["data-test-values"] = JSON.stringify(c);
1085
- } else {
1086
- var D = en(c, 1), L = D[0];
1087
- V["data-test-value"] = L;
1088
- }
1089
- if (j) {
1090
-
1091
- return (0, r.cloneElement)(j, V);
1092
- }
1093
- if (a === "link") {
1094
-
1095
- return t().createElement(Z(), Ze({
1096
- tag: "button",
1097
- appearance: "standalone"
1098
- }, V, {
1099
- "data-select-appearance": "link"
1100
- }), !!E && t().createElement(Ae, null, E), M || O, t().createElement(Ie, null, t().createElement(U(), null)));
1101
- }
1102
- // Using Button's secondary appearance as Select's default appearance.
1103
- var q = a === "default" ? "secondary" : a;
1104
-
1105
- return t().createElement(Re, Ze({}, V, {
1106
- $multiple: g,
1107
- appearance: q,
1108
- label: M,
1109
- error: v,
1110
- icon: E,
1111
- inline: b,
1112
- isMenu: true,
1113
- onClick: h
1114
- }, _()(P, Sn)), !!c.length && g && t().createElement(Ne, {
1115
- "data-role": "count"
1116
- }, "(", c.length, ")"));
1117
- }));
1118
- function En(e) {
1119
- var n = e.allowKeyMatching, o = n === void 0 ? true : n, a = e.animateLoading, l = e.appearance, i = l === void 0 ? "default" : l, c = e.append, f = e.allowNewValues, p = e.children, v = e.defaultPlacement, b = v === void 0 ? "vertical" : v, m = e.defaultValues, y = e.describedBy, g = e.disabled, h = e.elementRef, O = e.error, S = e.filter, w = e.footerMessage, k = e.inline, j = e.inputId, x = e.inputRef, P = e.isLoadingOptions, E = e.labelledBy, M = e.labelText, R = e.loadingMessage, A = e.menuStyle, I = A === void 0 ? {} : A, N = e.multiple, D = e.name, q = e.noOptionsMessage, T = q === void 0 ? wn : q, F = e.onChange, _ = e.onScroll, K = e.onScrollBottom, $ = e.onFilterChange, W = e.onClick, U = e.onClose, X = e.onOpen, G = e.required, J = e.placeholder, Y = J === void 0 ? Cn : J, Z = e.prefixLabel, re = e.prepend, te = e.repositionMode, oe = te === void 0 ? "flip" : te, ae = e.selectAllAppearance, le = ae === void 0 ? "buttongroup" : ae, de = e.showSelectedValuesFirst, fe = e.suffixLabel, pe = e.tabConfirmsNewValue, ve = e.values, be = e.virtualization, me = e.toggle, ye = e.toggleContent, ge = ye === void 0 ? "optionChildren" : ye, he = ln(e, [ "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" ]);
1120
- // @docs-props-type SelectBasePropsBase
1121
- var Oe = s()({
1122
- componentName: "SelectBase",
1123
- /* eslint-disable-next-line prefer-rest-params */
1124
- componentProps: arguments[0],
1125
- // see SUI-7028
1126
- defaultValuePropName: "defaultValues",
1127
- valuePropName: "values"
1128
- });
1129
- // states
1130
- var Se = (0, r.useState)((function() {
1131
- return {
1132
- activeItemId: (0, ce.createDOMID)("active-item"),
1133
- menuListboxId: (0, ce.createDOMID)("menu-listbox")
1134
- };
1135
- })), Ce = en(Se, 1), ke = Ce[0], je = ke.activeItemId, xe = ke.menuListboxId;
1136
- var Pe = (0, r.useState)(0), Ee = en(Pe, 2), Me = Ee[0], Re = Ee[1];
1137
- var Ae = (0, r.useState)(""), Ie = en(Ae, 2), Be = Ie[0], Ne = Ie[1];
1138
- var Ve = (0, r.useState)(false), De = en(Ve, 2), Le = De[0], qe = De[1];
1139
- var Fe = (0, r.useState)(false), _e = en(Fe, 2), Ke = _e[0], He = _e[1];
1140
- var $e = (0, r.useState)([]), We = en($e, 2), Ue = We[0], Je = We[1];
1141
- var Qe = (0, r.useState)(m || []), Ye = en(Qe, 2), nn = Ye[0], rn = Ye[1];
1142
- // previous state
1143
- var tn = ie()(Me);
1144
- // refs
1145
- var on = (0, r.useRef)(null);
1146
- var an = (0, r.useRef)(null);
1147
- var un = (0, r.useRef)(null);
1148
- var cn = (0, r.useRef)([]);
1149
- var sn = (0, r.useRef)([]);
1150
- var dn = (0, r.useRef)(tn);
1151
- var fn = (0, r.useRef)();
1152
- var pn = (0, r.useRef)({});
1153
- var vn = (0, r.useRef)(0);
1154
- var bn = (0, r.useRef)([]);
1155
- var mn = (0, r.useRef)(null);
1156
- var Sn = (0, r.useRef)();
1157
- var kn = (0, r.useRef)(0);
1158
- var xn = (0, r.useRef)("none");
1159
- var En = (0, r.useState)(S ? (0, ce.createDOMID)("filter") : undefined), Mn = en(En, 1), Rn = Mn[0];
1160
- (0, r.useEffect)((function() {
1161
- if (false) {}
1162
- }), [ i, c, O, re ]);
1163
- var An = (0, r.useCallback)((function() {
1164
- var e = Oe ? ve : nn;
1165
- return N || e == null ? e : e.slice(0, 1);
1166
- }), [ Oe, N, ve, nn ]);
1167
- var In = (0, r.useCallback)((function() {
1168
- var e;
1169
- // in non-multiple mode, don't move values to the top of the list
1170
- return N && de !== "never" ? (e = An()) !== null && e !== void 0 ? e : [] : [];
1171
- }), [ An, N, de ]);
1172
- var Bn = (0, r.useCallback)((function(e) {
1173
- var n = Be;
1174
- qe(true);
1175
- Je(In());
1176
- // SUI-3234: preserve existing behavior difference between <Select> and <Multiselect.Compact>
1177
- if (N) {
1178
- Ne("");
1179
- }
1180
- if (n !== Be) {
1181
- $ === null || $ === void 0 ? void 0 : $(e, {
1182
- keyword: Be
1183
- });
1184
- }
1185
- }), [ Be, In, N, $ ]);
1186
- (0, r.useEffect)((function() {
1187
- if (Le) {
1188
- X === null || X === void 0 ? void 0 : X();
1189
- if (mn.current && !S) {
1190
- mn.current.focus();
1191
- } else {
1192
- var e;
1193
- Re((e = Sn.current) !== null && e !== void 0 ? e : 0);
1194
- }
1195
- }
1196
- }), [ X, Le, Ue, Be, S ]);
1197
- var Nn = (0, r.useCallback)((function() {
1198
- qe(false);
1199
- Re(0);
1200
- dn.current = null;
1201
- U === null || U === void 0 ? void 0 : U();
1202
- }), [ U ]);
1203
- var Vn = (0, r.useCallback)((function(e, n) {
1204
- var r;
1205
- var t = (r = An()) !== null && r !== void 0 ? r : [];
1206
- var o = t.indexOf(n);
1207
- var a;
1208
- if (N) {
1209
- if (o >= 0) {
1210
- a = [].concat(Ge(t.slice(0, o)), Ge(t.slice(o + 1)));
1211
- } else {
1212
- a = t.concat([ n ]);
1213
- }
1214
- } else {
1215
- // non-multiple mode must always have a value
1216
- a = [ n ];
1217
- }
1218
- var l = !Oe;
1219
- if (l) {
1220
- rn(a);
1221
- }
1222
- if (N) {
1223
- // in uncontrolled multiple mode, keep the menu open
1224
- if (l) {
1225
- qe(true);
1226
- }
1227
- } else {
1228
- var i;
1229
- // non-multiple mode only supports a single selection
1230
- // so close the menu once a selection is made
1231
- Nn({
1232
- reason: "contentClick"
1233
- });
1234
- (i = on.current) === null || i === void 0 ? void 0 : i.focus();
1235
- }
1236
- F === null || F === void 0 ? void 0 : F(e, {
1237
- values: a,
1238
- name: D,
1239
- reason: "valueToggle"
1240
- });
1241
- }), [ An, Nn, Oe, N, D, F ]);
1242
- var Dn = function e() {
1243
- an.current = null;
1244
- cn.current = [];
1245
- if (un.current) {
1246
- clearTimeout(un.current);
1247
- }
1248
- };
1249
- var Ln = (0, r.useCallback)((function(e) {
1250
- var n;
1251
- // this doesn't make sense if we can't select multiple values
1252
- if (!N) {
1253
- return;
1254
- }
1255
- var r = (n = An()) !== null && n !== void 0 ? n : [];
1256
- var o = H()(r.concat(bn.current));
1257
- o = t().Children.toArray(p).filter((function(e) {
1258
- return hn(e) && L()(o, e.props.value) && (!e.props.disabled || L()(r, e.props.value));
1259
- })).map((function(e) {
1260
- return e.props.value;
1261
- }));
1262
- if (!Oe) {
1263
- rn(o);
1264
- }
1265
- F === null || F === void 0 ? void 0 : F(e, {
1266
- values: o,
1267
- name: D,
1268
- reason: "selectAll"
1269
- });
1270
- }), [ p, An, Oe, N, D, F ]);
1271
- var qn = (0, r.useCallback)((function(e) {
1272
- var n;
1273
- // this doesn't make sense if we can't select multiple values
1274
- if (!N) {
1275
- return;
1276
- }
1277
- var r = (n = An()) !== null && n !== void 0 ? n : [];
1278
- var o = z().apply(void 0, [ r ].concat(Ge(bn.current)));
1279
- // this will unselect all selected values unless those values are disabled or hidden by the filter
1280
- var a = t().Children.toArray(p).filter((function(e) {
1281
- return hn(e) && (L()(r, e.props.value) && e.props.disabled || L()(o, e.props.value));
1282
- })).map((function(e) {
1283
- return e.props.value;
1284
- }));
1285
- if (!Oe) {
1286
- rn(a);
1287
- }
1288
- F === null || F === void 0 ? void 0 : F(e, {
1289
- values: a,
1290
- name: D,
1291
- reason: "clearAll"
1292
- });
1293
- }), [ p, An, Oe, N, D, F ]);
1294
- var Tn = (0, r.useCallback)((function(e) {
1295
- if (Le && !P) {
1296
- K === null || K === void 0 ? void 0 : K(e);
1297
- }
1298
- }), [ Le, P, K ]);
1299
- var Fn = (0, r.useCallback)((function(e) {
1300
- var n = e.key;
1301
- if (n === "Tab") {
1302
- if (pe && fn.current && vn.current <= 1) {
1303
- e.preventDefault();
1304
- Vn(e, fn.current);
1305
- }
1306
- }
1307
- if (e.shiftKey || e.metaKey || e.ctrlKey) {
1308
- if (n === "a" && (e.ctrlKey || e.metaKey)) {
1309
- // handle control + A
1310
- if (xn.current === "all") {
1311
- qn(e);
1312
- } else {
1313
- Ln(e);
1314
- }
1315
- }
1316
- return;
1317
- }
1318
- if (n === "ArrowDown") {
1319
- e.preventDefault();
1320
- Re(Math.min(Me + 1, le === "checkbox" ? vn.current : vn.current - 1));
1321
- if (p && K) {
1322
- var t;
1323
- var o = r.Children.toArray(p).length - (2 + ((t = An()) !== null && t !== void 0 ? t : []).length);
1324
- if (Me === o) {
1325
- Tn(e);
1326
- }
1327
- }
1328
- }
1329
- if (n === "ArrowUp") {
1330
- e.preventDefault();
1331
- Re(Math.max(Me - 1, 0));
1332
- }
1333
- if (n === "Enter" && fn.current && Le) {
1334
- if (fn.current === "selectAll") {
1335
- if (xn.current === "all") {
1336
- qn(e);
1337
- } else {
1338
- Ln(e);
1339
- }
1340
- } else {
1341
- e.preventDefault();
1342
- Vn(e, fn.current);
1343
- }
1344
- }
1345
- }), [ Me, p, An, qn, Tn, Ln, K, Le, le, pe, Vn ]);
1346
- var _n = (0, r.useCallback)((function(e, n) {
1347
- var r = n.value;
1348
- e.preventDefault();
1349
- if (!Le) {
1350
- return;
1351
- }
1352
- Vn(e, r);
1353
- }), [ Le, Vn ]);
1354
- var Kn = (0, r.useCallback)((function(e, n) {
1355
- var r = e.nativeEvent.key;
1356
- // Checking for a single character to avoid complications from double-byte languages and emojis.
1357
- if (r.length === 1) {
1358
- var t = [];
1359
- var o = {
1360
- index: 0,
1361
- value: r
1362
- };
1363
- if (!an.current) {
1364
- if (r === " ") {
1365
- Dn();
1366
- return;
1367
- }
1368
- t = Te(sn.current, o);
1369
- } else if (cn.current.length > 1) {
1370
- o.index = an.current.index + 1;
1371
- t = Te(cn.current, o);
1372
- }
1373
- if (t.length) {
1374
- var a;
1375
- var l = 0;
1376
- // If the active option is a first character match, cycle to the next matching option.
1377
- if (o.index === 0 && t.length > 1) {
1378
- var i = t.indexOf(sn.current[n]);
1379
- if (i >= 0) {
1380
- l = i === t.length - 1 ? 0 : i + 1;
1381
- }
1382
- }
1383
- var u = t[l];
1384
- var c = u.value, s = u.label;
1385
- var d = pn.current[On(c, s)];
1386
- d === null || d === void 0 ? void 0 : (a = d.focus) === null || a === void 0 ? void 0 : a.call(d);
1387
- }
1388
- cn.current = t;
1389
- an.current = o;
1390
- if (un.current) {
1391
- clearTimeout(un.current);
1392
- }
1393
- un.current = setTimeout(Dn, 500);
1394
- e.preventDefault();
1395
- e.stopPropagation();
1396
- }
1397
- }), []);
1398
- var Hn = (0, r.useCallback)((function(e, n) {
1399
- var r = n.value;
1400
- Ne(r);
1401
- qe(true);
1402
- Re(0);
1403
- $ === null || $ === void 0 ? void 0 : $(e, {
1404
- keyword: r
1405
- });
1406
- }), [ $ ]);
1407
- var $n = (0, r.useCallback)((function() {
1408
- He(true);
1409
- }), []);
1410
- var zn = (0, r.useCallback)((function() {
1411
- He(false);
1412
- }), []);
1413
- var Wn = (0, r.useCallback)((function(e) {
1414
- if (dn.current !== Me) {
1415
- (0, se.scrollIntoViewIfNeeded)(e);
1416
- }
1417
- }), [ Me ]);
1418
- var Un = (0, r.useCallback)((function(e, n, r) {
1419
- if (r) {
1420
- mn.current = e;
1421
- }
1422
- if (e == null) {
1423
- delete pn.current[n];
1424
- } else {
1425
- pn.current[n] = e;
1426
- }
1427
- }), [ pn ]);
1428
- var Xn = (0, r.useCallback)((function(e) {
1429
- on.current = e;
1430
- Xe(h, e);
1431
- }), [ h, on ]);
1432
- var Gn = (0, r.useMemo)((function() {
1433
- var e;
1434
- return (e = An()) !== null && e !== void 0 ? e : [];
1435
- }), [ An ]);
1436
- var Jn = r.Children.toArray(p);
1437
- var Qn = Gn.some((function(e) {
1438
- var n = B()(Jn, (function(n) {
1439
- return hn(n) && n.props.value === e;
1440
- }));
1441
- return n && !n.props.disabled;
1442
- }));
1443
- var Yn = de === "immediately" ? In() : Ue;
1444
- var Zn = (0, r.useMemo)((function() {
1445
- vn.current = 0;
1446
- Sn.current = undefined;
1447
- kn.current = 0;
1448
- fn.current = undefined;
1449
- sn.current = [];
1450
- var e = function e(n, r) {
1451
- return function(e) {
1452
- return Un(e, n, r);
1453
- };
1454
- };
1455
- var n;
1456
- var a = 0;
1457
- var l = false;
1458
- // used to avoid overwriting the selected item ref in multiple mode
1459
- var i;
1460
- var c = r.Children.toArray(p).reduce((function(c, s, d) {
1461
- // ignore Headings and Dividers
1462
- if (!hn(s)) {
1463
- c.push(s);
1464
- return c;
1465
- }
1466
- var f = s.props, p = f.disabled, v = f.hidden, b = f.label, m = f.value;
1467
- // Find out if the search string exactly matches a value
1468
- if (m === Be) {
1469
- n = true;
1470
- }
1471
- var y = Gn && Gn.indexOf(m) >= 0;
1472
- var g = !!y && !p && !i;
1473
- var h = o && !N && !S && !P && !K;
1474
- var O = On(m, b);
1475
- var w = -1;
1476
- if (h && !p && !v) {
1477
- sn.current.push({
1478
- label: b,
1479
- value: m
1480
- });
1481
- w = sn.current.length - 1;
1482
- }
1483
- // Format the Menu.Item
1484
- var C = (0, r.cloneElement)(s, {
1485
- elementRef: e(O, g),
1486
- key: s.key || d,
1487
- onClick: _n,
1488
- onKeyDown: h ? function(e) {
1489
- return Kn(e, w);
1490
- } : undefined,
1491
- selected: y,
1492
- multiple: N,
1493
- role: "option"
1494
- });
1495
- if (g) {
1496
- i = true;
1497
- }
1498
- if (Yn && Yn.indexOf(m) >= 0) {
1499
- if (a === 0) {
1500
- c.splice(a, 0, t().createElement(u.Divider, {
1501
- key: "topDivider"
1502
- }));
1503
- l = true;
1504
- }
1505
- c.splice(a, 0, C);
1506
- a += 1;
1507
- } else {
1508
- c.push(C);
1509
- }
1510
- return c;
1511
- }), []);
1512
- // In multiple mode, add missing items
1513
- if (N) {
1514
- V()(Gn, (function(r) {
1515
- var o = B()(c, (function(e) {
1516
- return hn(e) && e.props && e.props.value === r;
1517
- }));
1518
- if (!o) {
1519
- if (r === Be) {
1520
- n = true;
1521
- }
1522
- var i = Yn && Yn.indexOf(r) >= 0;
1523
- var s = Yn.length;
1524
- if (a === 0) {
1525
- c.splice(0, 0, t().createElement(u.Divider, {
1526
- key: "topDivider"
1527
- }));
1528
- a += 1;
1529
- l = true;
1530
- }
1531
- var d = String(r);
1532
- var f = On(r, d);
1533
- c.splice(i ? 0 : s + 1, 0, t().createElement(C, {
1534
- elementRef: e(f),
1535
- label: d,
1536
- value: r,
1537
- key: "missing-value-".concat(r),
1538
- onClick: _n,
1539
- multiple: N,
1540
- selected: true
1541
- }));
1542
- if (i) {
1543
- a += 1;
1544
- }
1545
- }
1546
- }));
1547
- }
1548
- var s = S === "controlled";
1549
- // Filter the items
1550
- var v = (0, ue.stringToKeywords)(Be);
1551
- c = s ? c : c.filter((function(e) {
1552
- if (hn(e)) {
1553
- return (0, ue.testPhrase)(e.props.label, v);
1554
- }
1555
- return true;
1556
- // Keep all headers and non-interactive options
1557
- })).map((function(e) {
1558
- if (!hn(e)) {
1559
- return e;
1560
- }
1561
- // highlight matched text
1562
- var n = v && (0, ue.keywordLocations)(e.props.label, v);
1563
-
1564
- return (0, r.cloneElement)(e, {
1565
- matchRanges: n || undefined
1566
- });
1567
- }));
1568
- // Add the option to add the new value
1569
- if (f && !n && Be) {
1570
- var b = l ? a + 1 : a;
1571
- var m = "".concat(Be, " (new value)");
1572
- var y = On(Be, m);
1573
- c.splice(b, 0, t().createElement(C, {
1574
- elementRef: e(y),
1575
- label: m,
1576
- value: Be,
1577
- key: "newValue",
1578
- multiple: N,
1579
- onClick: _n
1580
- }));
98
+ }, v.apply(null, arguments);
99
+ }
100
+ function b(e, n) {
101
+ if (null == e) return {};
102
+ var r, t, o = m(e, n);
103
+ if (Object.getOwnPropertySymbols) {
104
+ var a = Object.getOwnPropertySymbols(e);
105
+ for (t = 0; t < a.length; t++) {
106
+ r = a[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
1581
107
  }
1582
- // When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
1583
- var g = le === "checkbox" && N && c.length > 1 ? 1 : 0;
1584
- var h = true;
1585
- // Highlight the selected Items and remove hidden
1586
- c = c.reduce((function(e, n) {
1587
- // ignore Dividers & Headings
1588
- if (!hn(n)) {
1589
- e.push(n);
1590
- return e;
1591
- }
1592
- // Ignore any hidden items
1593
- if (n.props && n.props.hidden) {
1594
- return e;
1595
- }
1596
- if (n.props.selected && !n.props.disabled && Sn.current == null) {
1597
- Sn.current = vn.current;
1598
- }
1599
- var t = g === Me;
1600
- g += 1;
1601
- vn.current += 1;
1602
- kn.current += n.props.selected ? 1 : 0;
1603
- if (n.key !== "newValue" && !n.props.disabled && !n.props.selected) {
1604
- h = false;
1605
- }
1606
- if (!t || !Ke) {
1607
- e.push(n);
1608
- return e;
1609
- }
1610
- if (!n.props.disabled) {
1611
- fn.current = n.props.value;
1612
- }
1613
- var o = (0, r.cloneElement)(n, {
1614
- active: t,
1615
- elementRef: Wn,
1616
- id: je
1617
- });
1618
- e.push(o);
1619
- return e;
1620
- }), []);
1621
- xn.current = kn.current === 0 && "none" || h && "all" || "some";
1622
- // add select all option
1623
- if (le === "checkbox" && N && vn.current > 0) {
1624
- var O = Me === 0 && !!S;
1625
- var w;
1626
- if (xn.current === "all") {
1627
- if (Be === "") {
1628
- w = (0, d._)("Clear all");
1629
- } else {
1630
- w = (0, d._)("Clear all matches");
1631
- }
1632
- } else if (Be === "") {
1633
- w = (0, d._)("Select all");
1634
- } else {
1635
- w = (0, d._)("Select all matches");
1636
- }
1637
- if (O) {
1638
- fn.current = "selectAll";
1639
- }
1640
- c.unshift( t().createElement(we, {
1641
- key: "select-all-option",
1642
- active: O,
1643
- elementRef: Wn,
1644
- id: O ? je : undefined,
1645
- onClick: xn.current === "all" ? qn : Ln,
1646
- label: w,
1647
- selected: xn.current === "all" || xn.current !== "none" && "some",
1648
- totalCount: !!me && Gn.length || undefined,
1649
- tabIndex: S ? -1 : undefined
1650
- }), t().createElement(u.Divider, {
1651
- key: "selectAllDivider"
1652
- }));
108
+ }
109
+ return o;
110
+ }
111
+ function m(e, n) {
112
+ if (null == e) return {};
113
+ var r = {};
114
+ for (var t in e) {
115
+ if ({}.hasOwnProperty.call(e, t)) {
116
+ if (-1 !== n.indexOf(t)) continue;
117
+ r[t] = e[t];
1653
118
  }
1654
- bn.current = c.reduce((function(e, n) {
1655
- if (hn(n)) {
1656
- e.push(n.props.value);
1657
- }
1658
- return e;
1659
- }), []);
1660
- return c;
1661
- }), [ Me, je, o, f, p, Gn, S, Be, Wn, qn, _n, Kn, Un, Ln, P, N, Yn, K, le, Ke, me ]);
1662
- var er = function e(n) {
1663
- var r = n.anchorWidth, o = n.maxHeight, l = n.placement, i = n.toggleId;
1664
- var u = yn({
1665
- anchorWidth: r,
1666
- isMultiple: N,
1667
- maxHeight: o,
1668
- menuStyle: I
1669
- });
1670
- var c = Gn.length > 0 && !Qn && !S ? 0 : undefined;
1671
- var s = {
1672
- "aria-multiselectable": N || undefined,
1673
- childrenStart: !!S && t().createElement(jn, {
1674
- activeItemId: je,
1675
- filterA11yId: Rn,
1676
- filterKeyword: Be,
1677
- hasChildren: Zn.some((function(e) {
1678
- return hn(e);
1679
- })),
1680
- inputId: j,
1681
- inputRef: x,
1682
- menuListboxId: xe,
1683
- multiple: N,
1684
- onClearAll: qn,
1685
- onSelectAll: Ln,
1686
- onTextBlur: zn,
1687
- onTextChange: Hn,
1688
- onTextFocus: $n,
1689
- onTextKeyDown: Fn,
1690
- optionSelection: xn,
1691
- placement: l,
1692
- selectAllAppearance: le,
1693
- textHasFocus: Ke
1694
- }),
1695
- focusMode: S ? "never" : undefined,
1696
- isLoading: P,
1697
- labelledBy: "".concat(Rn !== null && Rn !== void 0 ? Rn : "", " ").concat(i !== null && i !== void 0 ? i : "").trim(),
1698
- // NVDA ignores aria-labelledby attribute on popover, but reads it on menu
1699
- menuId: xe,
1700
- onScrollBottom: K ? Tn : undefined,
1701
- placement: l !== null && l !== void 0 ? l : undefined,
1702
- noOptionsMessage: T,
1703
- footerMessage: w,
1704
- animateLoading: a,
1705
- loadingMessage: R,
1706
- onScroll: _,
1707
- style: u,
1708
- tabIndex: c
1709
- };
1710
- if (be) {
119
+ }
120
+ return r;
121
+ }
122
+ var g = {
123
+ /** @private */
124
+ active: i().bool,
125
+ children: i().node,
126
+ /**
127
+ * @private this is passed down from Multiselect.
128
+ */
129
+ compact: i().bool,
130
+ description: i().string,
131
+ descriptionPosition: i().oneOf([ "right", "bottom" ]),
132
+ disabled: i().bool,
133
+ elementRef: i().oneOfType([ i().func, i().object ]),
134
+ hidden: i().bool,
135
+ icon: i().node,
136
+ label: i().string.isRequired,
137
+ matchRanges: i().arrayOf(i().shape({
138
+ start: i().number.isRequired,
139
+ end: i().number.isRequired
140
+ })),
141
+ /** @private */
142
+ onClick: i().func,
143
+ /** @private */
144
+ role: i().oneOf([ "menuitemcheckbox", "option" ]),
145
+ /** @private */
146
+ selected: i().bool,
147
+ selectedAppearance: i().oneOf([ "info", "success", "warning", "error" ]),
148
+ selectedBackgroundColor: i().string,
149
+ selectedForegroundColor: i().string,
150
+ truncate: i().bool,
151
+ value: i().oneOfType([ i().string, i().number, i().bool ]).isRequired
152
+ };
153
+ /**
154
+ * An option within a `Multiselect`.
155
+ */ function y(e) {
156
+ var n = e.compact, r = e.children, o = e.description, a = e.descriptionPosition, l = a === void 0 ? "bottom" : a, i = e.disabled, u = e.elementRef, s = e.hidden, c = e.icon, d = e.label, p = e.matchRanges, m = e.role, g = e.selected, y = e.truncate, h = e.value, O = b(e, [ "compact", "children", "description", "descriptionPosition", "disabled", "elementRef", "hidden", "icon", "label", "matchRanges", "role", "selected", "truncate", "value" ]);
157
+ // @docs-props-type OptionPropsBase
158
+ // selectedAppearance, selectedBackgroundColor, and selectedForegroundColor are not used directly by the Option component.
159
+ // They are consumed by the parent component (Multiselect-Normal) to render the Chip, so they are not included in the above prop list.
1711
160
 
1712
- return t().createElement(ee.VirtualizedResultsMenu, Ze({
1713
- virtualization: be
1714
- }, s), Zn);
1715
- }
1716
-
1717
- return t().createElement(ne(), s, Zn);
1718
- };
1719
- var nr = (0, r.useMemo)((function() {
1720
-
1721
- return t().createElement(Pn, Ze({
1722
- appearance: i,
1723
- append: c,
1724
- currentValues: An(),
1725
- "data-test": N ? "multiselect" : "select",
1726
- describedBy: y,
1727
- disabled: g,
1728
- elementRef: Xn,
1729
- error: O,
1730
- inline: k,
1731
- labelText: M,
1732
- labelledBy: E,
1733
- multiple: N,
1734
- onClick: W,
1735
- placeholder: Y,
1736
- prefixLabel: Z,
1737
- prepend: re,
1738
- required: G,
1739
- suffixLabel: fe,
1740
- toggle: me,
1741
- toggleContent: ge
1742
- }, he), p);
1743
- }), [ i, c, An, N, y, g, O, Xn, k, M, E, W, Y, Z, re, G, fe, me, ge, he, p ]);
1744
-
1745
- return t().createElement(Q(), {
1746
- closeReasons: gn,
1747
- inputId: j,
1748
- "aria-labelledby": Rn,
1749
- toggle: nr,
1750
- onRequestOpen: Bn,
1751
- onRequestClose: Nn,
1752
- open: Le,
1753
- openWithArrowKeys: true,
1754
- repositionMode: oe,
1755
- defaultPlacement: b,
1756
- canCoverAnchor: ze().innerHeight < 500,
1757
- retainFocus: false,
1758
- takeFocus: Gn.length === 0 || Gn.length > 0 && !Qn || !!S
1759
- }, er);
161
+ return t().createElement(f.Option, v({
162
+ description: o,
163
+ descriptionPosition: l,
164
+ disabled: i,
165
+ elementRef: u,
166
+ hidden: s,
167
+ icon: c,
168
+ label: d,
169
+ matchRanges: p,
170
+ role: m,
171
+ selected: g,
172
+ truncate: y,
173
+ value: h
174
+ }, O, {
175
+ multiple: n
176
+ }), r || d);
1760
177
  }
1761
- En.propTypes = bn;
1762
- En.componentType = "SelectBase";
1763
- En.Option = C;
1764
- En.Divider = u.Divider;
1765
- En.Heading = u.Heading;
1766
- /* harmony default export */ const Mn = En;
178
+ y.propTypes = g;
179
+ /* harmony default export */ const h = y;
1767
180
  // CONCATENATED MODULE: ./src/utils/useDeprecate.tsx
1768
- var Rn = "is deprecated and will be removed in the next major version.";
1769
- var An = function e(n) {
181
+ var O = "is deprecated and will be removed in the next major version.";
182
+ var w = function e(n) {
1770
183
  var r = n.additionalMessage, t = r === void 0 ? "" : r, o = n.componentName;
1771
184
  useEffect((function() {
1772
185
  if (false) {}
1773
186
  }), [ t, o ]);
1774
187
  };
1775
- var In = function e(n) {
188
+ var S = function e(n) {
1776
189
  var r = n.additionalMessage, t = r === void 0 ? "" : r, o = n.componentName, a = n.propName, l = n.propValue;
1777
190
  useEffect((function() {
1778
191
  if (false) {}
1779
192
  }), [ t, o, a, l ]);
1780
193
  };
1781
- var Bn = function e(n) {
194
+ var C = function e(n) {
1782
195
  var t = n.additionalMessage, o = t === void 0 ? "" : t, a = n.componentName, l = n.deprecatedPropValue, i = n.propName, u = n.propValue;
1783
196
  (0, r.useEffect)((function() {
1784
197
  if (false) {}
1785
198
  }), [ o, a, i, u, l ]);
1786
199
  };
1787
200
  // CONCATENATED MODULE: ./src/Multiselect/Compact.tsx
1788
- function Nn() {
1789
- return Nn = Object.assign ? Object.assign.bind() : function(e) {
201
+ function M() {
202
+ return M = Object.assign ? Object.assign.bind() : function(e) {
1790
203
  for (var n = 1; n < arguments.length; n++) {
1791
204
  var r = arguments[n];
1792
205
  for (var t in r) {
@@ -1794,11 +207,11 @@
1794
207
  }
1795
208
  }
1796
209
  return e;
1797
- }, Nn.apply(null, arguments);
210
+ }, M.apply(null, arguments);
1798
211
  }
1799
- function Vn(e, n) {
212
+ function P(e, n) {
1800
213
  if (null == e) return {};
1801
- var r, t, o = Dn(e, n);
214
+ var r, t, o = k(e, n);
1802
215
  if (Object.getOwnPropertySymbols) {
1803
216
  var a = Object.getOwnPropertySymbols(e);
1804
217
  for (t = 0; t < a.length; t++) {
@@ -1807,7 +220,7 @@
1807
220
  }
1808
221
  return o;
1809
222
  }
1810
- function Dn(e, n) {
223
+ function k(e, n) {
1811
224
  if (null == e) return {};
1812
225
  var r = {};
1813
226
  for (var t in e) {
@@ -1818,9 +231,7 @@
1818
231
  }
1819
232
  return r;
1820
233
  }
1821
- // eslint-disable-next-line no-relative-imports-of-published -- TODO(SUI-8264): Ordinarily we do not want to cross component boundaries relatively like this but OptionBase is unpublished therefore can't be imported externally/aliased with @splunk... which prevents risk of mixed relative/external imports in bundles.
1822
- // eslint-disable-next-line no-relative-imports-of-published -- TODO(SUI-8264): Ordinarily we do not want to cross component boundaries relatively like this but SelectBase is unpublished therefore can't be imported externally/aliased with @splunk... which prevents risk of mixed relative/external imports in bundles.
1823
- var Ln = {
234
+ var j = {
1824
235
  allowNewValues: i().bool,
1825
236
  animateLoading: i().bool,
1826
237
  append: i().bool,
@@ -1860,32 +271,32 @@
1860
271
  virtualization: i().number
1861
272
  };
1862
273
  // TS: not typed controlled/uncontrolled, handled by Multiselect wrapper component
1863
- var qn = {};
1864
- var Tn = (0, d._)("No matches");
1865
- var Fn = (0, d._)("Select...");
1866
- function _n(e) {
1867
- var n = e.allowNewValues, o = e.animateLoading, a = e.append, l = e.children, i = e.controlledFilter, u = e.defaultPlacement, c = u === void 0 ? "vertical" : u, s = e.defaultValues, d = e.describedBy, f = e.disabled, p = e.elementRef, v = e.error, b = e.filter, m = e.footerMessage, y = e.inline, g = e.inputId, h = e.inputRef, O = e.isLoadingOptions, S = e.labelledBy, w = e.loadingMessage, k = e.menuStyle, j = k === void 0 ? qn : k, x = e.name, P = e.noOptionsMessage, E = P === void 0 ? Tn : P, M = e.onChange, R = e.onClose, A = e.onFilterChange, I = e.onOpen, B = e.onScroll, N = e.onScrollBottom, V = e.placeholder, D = V === void 0 ? Fn : V, L = e.prepend, q = e.repositionMode, T = e.selectAllAppearance, F = e.showSelectedValuesFirst, _ = F === void 0 ? "nextOpen" : F, K = e.tabConfirmsNewValue, H = e.values, $ = e.virtualization, z = Vn(e, [ "allowNewValues", "animateLoading", "append", "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", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "tabConfirmsNewValue", "values", "virtualization" ]);
274
+ var V = {};
275
+ var x = (0, d._)("No matches");
276
+ var N = (0, d._)("Select...");
277
+ function B(e) {
278
+ var n = e.allowNewValues, o = e.animateLoading, a = e.append, l = e.children, i = e.controlledFilter, u = e.defaultPlacement, s = u === void 0 ? "vertical" : u, c = e.defaultValues, d = e.describedBy, v = e.disabled, b = e.elementRef, m = e.error, g = e.filter, y = e.footerMessage, h = e.inline, O = e.inputId, w = e.inputRef, S = e.isLoadingOptions, k = e.labelledBy, j = e.loadingMessage, B = e.menuStyle, R = B === void 0 ? V : B, E = e.name, F = e.noOptionsMessage, A = F === void 0 ? x : F, I = e.onChange, q = e.onClose, D = e.onFilterChange, L = e.onOpen, T = e.onScroll, _ = e.onScrollBottom, H = e.placeholder, $ = H === void 0 ? N : H, z = e.prepend, K = e.repositionMode, W = e.selectAllAppearance, U = e.showSelectedValuesFirst, G = U === void 0 ? "nextOpen" : U, X = e.tabConfirmsNewValue, J = e.values, Q = e.virtualization, Y = P(e, [ "allowNewValues", "animateLoading", "append", "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", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "tabConfirmsNewValue", "values", "virtualization" ]);
1868
279
  // @docs-props-type CompactPropsBase
1869
- Bn({
280
+ C({
1870
281
  componentName: "Multiselect",
1871
282
  deprecatedPropValue: "buttongroup",
1872
283
  propName: "selectAllAppearance",
1873
- propValue: T
284
+ propValue: W
1874
285
  });
1875
- var W = true;
1876
- if (b != null) {
1877
- W = b;
286
+ var Z = true;
287
+ if (g != null) {
288
+ Z = g;
1878
289
  if (false) {}
1879
290
  } else {
1880
- W = i ? "controlled" : true;
291
+ Z = i ? "controlled" : true;
1881
292
  }
1882
- var U = {
293
+ var ee = {
1883
294
  children: r.Children.toArray(l).map((function(e) {
1884
- if (hn(e)) {
295
+ if ((0, f.isOption)(e)) {
1885
296
  var n;
1886
297
  var r = (n = e.key) !== null && n !== void 0 ? n : "".concat(e.props.label, "-").concat(e.props.value);
1887
298
 
1888
- return t().createElement(C, Nn({
299
+ return t().createElement(f.Option, M({
1889
300
  key: r
1890
301
  }, e.props, {
1891
302
  multiple: true
@@ -1893,140 +304,182 @@
1893
304
  }
1894
305
  return e;
1895
306
  })),
1896
- filter: W
307
+ filter: Z
1897
308
  };
1898
- if (s != null) {
1899
- U.defaultValues = s;
309
+ if (c != null) {
310
+ ee.defaultValues = c;
1900
311
  }
1901
- if (H != null) {
1902
- U.values = H;
312
+ if (J != null) {
313
+ ee.values = J;
1903
314
  }
1904
315
 
1905
- return t().createElement(Mn, Nn({
316
+ return t().createElement(p(), M({
1906
317
  allowNewValues: n,
1907
318
  animateLoading: o,
1908
319
  append: a,
1909
320
  describedBy: d,
1910
- disabled: f,
1911
- defaultPlacement: c,
1912
- elementRef: p,
1913
- error: v,
1914
- footerMessage: m,
1915
- inline: y,
1916
- inputId: g,
1917
- inputRef: h,
1918
- isLoadingOptions: O,
1919
- labelledBy: S,
1920
- loadingMessage: w,
1921
- menuStyle: j,
1922
- name: x,
1923
- noOptionsMessage: E,
1924
- onChange: M,
1925
- onClose: R,
1926
- onFilterChange: A,
1927
- onOpen: I,
1928
- onScroll: B,
1929
- onScrollBottom: N,
1930
- placeholder: D,
1931
- prepend: L,
1932
- repositionMode: q,
1933
- selectAllAppearance: T,
1934
- showSelectedValuesFirst: _,
1935
- tabConfirmsNewValue: K,
1936
- virtualization: $
1937
- }, z, U, {
321
+ disabled: v,
322
+ defaultPlacement: s,
323
+ elementRef: b,
324
+ error: m,
325
+ footerMessage: y,
326
+ inline: h,
327
+ inputId: O,
328
+ inputRef: w,
329
+ isLoadingOptions: S,
330
+ labelledBy: k,
331
+ loadingMessage: j,
332
+ menuStyle: R,
333
+ name: E,
334
+ noOptionsMessage: A,
335
+ onChange: I,
336
+ onClose: q,
337
+ onFilterChange: D,
338
+ onOpen: L,
339
+ onScroll: T,
340
+ onScrollBottom: _,
341
+ placeholder: $,
342
+ prepend: z,
343
+ repositionMode: K,
344
+ selectAllAppearance: W,
345
+ showSelectedValuesFirst: G,
346
+ tabConfirmsNewValue: X,
347
+ virtualization: Q
348
+ }, Y, ee, {
1938
349
  multiple: true
1939
350
  }));
1940
351
  }
1941
- _n.propTypes = Ln;
1942
- _n.Option = M;
1943
- _n.Divider = u.Divider;
1944
- _n.Heading = u.Heading;
1945
- /* harmony default export */ const Kn = _n;
352
+ B.propTypes = j;
353
+ B.Option = h;
354
+ B.Divider = u.Divider;
355
+ B.Heading = u.Heading;
356
+ /* harmony default export */ const R = B;
1946
357
  // CONCATENATED MODULE: external "lodash/defer"
1947
- const Hn = require("lodash/defer");
1948
- var $n = e.n(Hn);
358
+ const E = require("lodash/defer");
359
+ var F = e.n(E);
1949
360
  // CONCATENATED MODULE: external "lodash/get"
1950
- const zn = require("lodash/get");
1951
- var Wn = e.n(zn);
361
+ const A = require("lodash/get");
362
+ var I = e.n(A);
1952
363
  // CONCATENATED MODULE: external "lodash/isString"
1953
- const Un = require("lodash/isString");
1954
- var Xn = e.n(Un);
364
+ const q = require("lodash/isString");
365
+ var D = e.n(q);
1955
366
  // CONCATENATED MODULE: external "lodash/keys"
1956
- const Gn = require("lodash/keys");
1957
- var Jn = e.n(Gn);
367
+ const L = require("lodash/keys");
368
+ var T = e.n(L);
1958
369
  // CONCATENATED MODULE: external "lodash/last"
1959
- const Qn = require("lodash/last");
1960
- var Yn = e.n(Qn);
370
+ const _ = require("lodash/last");
371
+ var H = e.n(_);
372
+ // CONCATENATED MODULE: external "lodash/memoize"
373
+ const $ = require("lodash/memoize");
374
+ var z = e.n($);
1961
375
  // CONCATENATED MODULE: external "lodash/omit"
1962
- const Zn = require("lodash/omit");
1963
- var er = e.n(Zn);
376
+ const K = require("lodash/omit");
377
+ var W = e.n(K);
1964
378
  // CONCATENATED MODULE: external "lodash/pickBy"
1965
- const nr = require("lodash/pickBy");
1966
- var rr = e.n(nr);
379
+ const U = require("lodash/pickBy");
380
+ var G = e.n(U);
381
+ // CONCATENATED MODULE: external "lodash/without"
382
+ const X = require("lodash/without");
383
+ var J = e.n(X);
1967
384
  // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
1968
- const tr = require("@splunk/react-ui/Popover");
1969
- var or = e.n(tr);
385
+ const Q = require("@splunk/react-ui/Popover");
386
+ var Y = e.n(Q);
387
+ // CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
388
+ const Z = require("@splunk/react-ui/ResultsMenu");
389
+ var ee = e.n(Z);
390
+ // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
391
+ const ne = require("@splunk/react-ui/ScreenReaderContent");
392
+ var re = e.n(ne);
393
+ // CONCATENATED MODULE: external "@splunk/ui-utils/filter"
394
+ const te = require("@splunk/ui-utils/filter");
1970
395
  // CONCATENATED MODULE: external "@splunk/ui-utils/format"
1971
- const ar = require("@splunk/ui-utils/format");
396
+ const oe = require("@splunk/ui-utils/format");
397
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
398
+ const ae = require("@splunk/ui-utils/id");
399
+ // CONCATENATED MODULE: external "@splunk/ui-utils/scroll"
400
+ const le = require("@splunk/ui-utils/scroll");
401
+ // CONCATENATED MODULE: external "styled-components"
402
+ const ie = require("styled-components");
403
+ var ue = e.n(ie);
1972
404
  // CONCATENATED MODULE: external "@splunk/react-ui/Box"
1973
- const lr = require("@splunk/react-ui/Box");
1974
- var ir = e.n(lr);
405
+ const se = require("@splunk/react-ui/Box");
406
+ var ce = e.n(se);
1975
407
  // CONCATENATED MODULE: external "@splunk/react-ui/Chip"
1976
- const ur = require("@splunk/react-ui/Chip");
1977
- var cr = e.n(ur);
408
+ const de = require("@splunk/react-ui/Chip");
409
+ var fe = e.n(de);
410
+ // CONCATENATED MODULE: external "@splunk/themes"
411
+ const pe = require("@splunk/themes");
1978
412
  // CONCATENATED MODULE: ./src/Multiselect/NormalStyles.ts
1979
- var sr = ke()(ir()).withConfig({
413
+ var ve = ue()(ce()).withConfig({
1980
414
  displayName: "NormalStyles__StyledBox",
1981
415
  componentId: "sc-1uwwpco-0"
1982
- })([ "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;}" ], Me.variables.spacingXSmall, Me.variables.borderRadius, Me.variables.inputHeight, Me.variables.inputBorderWidth, Me.variables.interactiveColorBorder, Me.variables.spacingXSmall, Me.variables.interactiveColorBackground, (function(e) {
416
+ })([ "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;}" ], pe.variables.spacingXSmall, pe.variables.borderRadius, pe.variables.inputHeight, pe.variables.inputBorderWidth, pe.variables.interactiveColorBorder, pe.variables.spacingXSmall, pe.variables.interactiveColorBackground, (function(e) {
1983
417
  var n = e.$append;
1984
- return n && (0, Ce.css)([ "border-start-end-radius:0;border-end-end-radius:0;border-inline-end:none;" ]);
418
+ return n && (0, ie.css)([ "border-start-end-radius:0;border-end-end-radius:0;border-inline-end:none;" ]);
1985
419
  }), (function(e) {
1986
420
  var n = e.$prepend;
1987
- return n && (0, Ce.css)([ "border-start-start-radius:0;border-end-start-radius:0;" ]);
421
+ return n && (0, ie.css)([ "border-start-start-radius:0;border-end-start-radius:0;" ]);
1988
422
  }), (function(e) {
1989
423
  var n = e.$hasFocus;
1990
- return n && (0, Ce.css)([ "box-shadow:", ";" ], Me.variables.focusShadow);
424
+ return n && (0, ie.css)([ "box-shadow:", ";" ], pe.variables.focusShadow);
1991
425
  }), (function(e) {
1992
426
  var n = e.$error;
1993
- return n && (0, Ce.css)([ "border-color:", ";&:hover:not([disabled]){border-color:", ";}" ], Me.variables.interactiveColorAccentError, Me.variables.interactiveColorAccentErrorStrong);
427
+ return n && (0, ie.css)([ "border-color:", ";&:hover:not([disabled]){border-color:", ";}" ], pe.variables.interactiveColorAccentError, pe.variables.interactiveColorAccentErrorStrong);
1994
428
  }), (function(e) {
1995
429
  var n = e.$disabled;
1996
- return n && (0, Ce.css)([ "border-color:", ";background-color:", ";cursor:not-allowed;" ], Me.variables.interactiveColorBorderDisabled, Me.variables.interactiveColorBackgroundDisabled);
430
+ return n && (0, ie.css)([ "border-color:", ";background-color:", ";cursor:not-allowed;" ], pe.variables.interactiveColorBorderDisabled, pe.variables.interactiveColorBackgroundDisabled);
1997
431
  }), (function(e) {
1998
432
  var n = e.$disabled, r = e.$hasFocus;
1999
- return !n && !r && (0, Ce.css)([ "&:hover{border-color:", ";}" ], Me.variables.interactiveColorBorderHover);
433
+ return !n && !r && (0, ie.css)([ "&:hover{border-color:", ";}" ], pe.variables.interactiveColorBorderHover);
2000
434
  }), (function(e) {
2001
435
  var n = e.$popoverOpen;
2002
- return n && (0, Ce.css)([ "position:relative;z-index:calc(", " - 2);" ], Me.variables.zindexFixedNavbar);
436
+ return n && (0, ie.css)([ "position:relative;z-index:calc(", " - 2);" ], pe.variables.zindexFixedNavbar);
2003
437
  }));
2004
- var dr = ke().span.withConfig({
438
+ var be = ue().span.withConfig({
2005
439
  displayName: "NormalStyles__StyledButtonsWrapper",
2006
440
  componentId: "sc-1uwwpco-1"
2007
441
  })([ "display:contents;" ]);
2008
- var fr = ke().input.withConfig({
442
+ var me = ue().input.withConfig({
2009
443
  displayName: "NormalStyles__StyledInput",
2010
444
  componentId: "sc-1uwwpco-2"
2011
- })([ "", ";flex:1 0 auto;max-width:100%;" ], Me.mixins.reset("block"));
2012
- var pr = ke()(cr()).withConfig({
445
+ })([ "", ";flex:1 0 auto;max-width:100%;" ], pe.mixins.reset("block"));
446
+ var ge = ue()(fe()).withConfig({
2013
447
  displayName: "NormalStyles__StyledChip",
2014
448
  componentId: "sc-1uwwpco-3"
2015
449
  })([ "line-height:1.1429;height:auto;", ";&:not([disabled]):focus{box-shadow:", ";}" ], (0,
2016
- Me.pick)({
2017
- compact: (0, Ce.css)([ "padding-block:2px;" ])
2018
- }), Me.variables.focusShadowInset);
450
+ pe.pick)({
451
+ compact: (0, ie.css)([ "padding-block:2px;" ])
452
+ }), pe.variables.focusShadowInset);
453
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
454
+ /**
455
+ * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
456
+ *
457
+ * @param ref - The React callback or object ref. Can be `null` or `undefined`.
458
+ * @param current - The new value of the ref.
459
+ */
460
+ function ye(e, n) {
461
+ if (e) {
462
+ if (typeof e === "function") {
463
+ e(n);
464
+ } else {
465
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
466
+ // the intention here is to signal "we will take care of setting 'current', not you".
467
+ e.current = n;
468
+ // eslint-disable-line no-param-reassign
469
+ }
470
+ }
471
+ }
2019
472
  // CONCATENATED MODULE: ./src/Multiselect/Normal.tsx
2020
- function vr(e) {
473
+ function he(e) {
2021
474
  "@babel/helpers - typeof";
2022
- return vr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
475
+ return he = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
2023
476
  return typeof e;
2024
477
  } : function(e) {
2025
478
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2026
- }, vr(e);
479
+ }, he(e);
2027
480
  }
2028
- function br() {
2029
- return br = Object.assign ? Object.assign.bind() : function(e) {
481
+ function Oe() {
482
+ return Oe = Object.assign ? Object.assign.bind() : function(e) {
2030
483
  for (var n = 1; n < arguments.length; n++) {
2031
484
  var r = arguments[n];
2032
485
  for (var t in r) {
@@ -2034,44 +487,44 @@
2034
487
  }
2035
488
  }
2036
489
  return e;
2037
- }, br.apply(null, arguments);
490
+ }, Oe.apply(null, arguments);
2038
491
  }
2039
- function mr(e) {
2040
- return hr(e) || gr(e) || wr(e) || yr();
492
+ function we(e) {
493
+ return Me(e) || Ce(e) || je(e) || Se();
2041
494
  }
2042
- function yr() {
495
+ function Se() {
2043
496
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2044
497
  }
2045
- function gr(e) {
498
+ function Ce(e) {
2046
499
  if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
2047
500
  }
2048
- function hr(e) {
2049
- if (Array.isArray(e)) return Cr(e);
501
+ function Me(e) {
502
+ if (Array.isArray(e)) return Ve(e);
2050
503
  }
2051
- function Or(e, n) {
2052
- return jr(e) || kr(e, n) || wr(e, n) || Sr();
504
+ function Pe(e, n) {
505
+ return Ne(e) || xe(e, n) || je(e, n) || ke();
2053
506
  }
2054
- function Sr() {
507
+ function ke() {
2055
508
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2056
509
  }
2057
- function wr(e, n) {
510
+ function je(e, n) {
2058
511
  if (e) {
2059
- if ("string" == typeof e) return Cr(e, n);
512
+ if ("string" == typeof e) return Ve(e, n);
2060
513
  var r = {}.toString.call(e).slice(8, -1);
2061
- return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Cr(e, n) : void 0;
514
+ return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Ve(e, n) : void 0;
2062
515
  }
2063
516
  }
2064
- function Cr(e, n) {
517
+ function Ve(e, n) {
2065
518
  (null == n || n > e.length) && (n = e.length);
2066
519
  for (var r = 0, t = Array(n); r < n; r++) {
2067
520
  t[r] = e[r];
2068
521
  }
2069
522
  return t;
2070
523
  }
2071
- function kr(e, n) {
524
+ function xe(e, n) {
2072
525
  var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
2073
526
  if (null != r) {
2074
- var t, o, a, l, i = [], u = !0, c = !1;
527
+ var t, o, a, l, i = [], u = !0, s = !1;
2075
528
  try {
2076
529
  if (a = (r = r.call(e)).next, 0 === n) {
2077
530
  if (Object(r) !== r) return;
@@ -2079,23 +532,23 @@
2079
532
  } else for (;!(u = (t = a.call(r)).done) && (i.push(t.value), i.length !== n); u = !0) {
2080
533
  }
2081
534
  } catch (e) {
2082
- c = !0, o = e;
535
+ s = !0, o = e;
2083
536
  } finally {
2084
537
  try {
2085
538
  if (!u && null != r["return"] && (l = r["return"](), Object(l) !== l)) return;
2086
539
  } finally {
2087
- if (c) throw o;
540
+ if (s) throw o;
2088
541
  }
2089
542
  }
2090
543
  return i;
2091
544
  }
2092
545
  }
2093
- function jr(e) {
546
+ function Ne(e) {
2094
547
  if (Array.isArray(e)) return e;
2095
548
  }
2096
- function xr(e, n) {
549
+ function Be(e, n) {
2097
550
  if (null == e) return {};
2098
- var r, t, o = Pr(e, n);
551
+ var r, t, o = Re(e, n);
2099
552
  if (Object.getOwnPropertySymbols) {
2100
553
  var a = Object.getOwnPropertySymbols(e);
2101
554
  for (t = 0; t < a.length; t++) {
@@ -2104,7 +557,7 @@
2104
557
  }
2105
558
  return o;
2106
559
  }
2107
- function Pr(e, n) {
560
+ function Re(e, n) {
2108
561
  if (null == e) return {};
2109
562
  var r = {};
2110
563
  for (var t in e) {
@@ -2115,7 +568,7 @@
2115
568
  }
2116
569
  return r;
2117
570
  }
2118
- function Er(e, n) {
571
+ function Ee(e, n) {
2119
572
  var r = Object.keys(e);
2120
573
  if (Object.getOwnPropertySymbols) {
2121
574
  var t = Object.getOwnPropertySymbols(e);
@@ -2125,40 +578,40 @@
2125
578
  }
2126
579
  return r;
2127
580
  }
2128
- function Mr(e) {
581
+ function Fe(e) {
2129
582
  for (var n = 1; n < arguments.length; n++) {
2130
583
  var r = null != arguments[n] ? arguments[n] : {};
2131
- n % 2 ? Er(Object(r), !0).forEach((function(n) {
2132
- Rr(e, n, r[n]);
2133
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Er(Object(r)).forEach((function(n) {
584
+ n % 2 ? Ee(Object(r), !0).forEach((function(n) {
585
+ Ae(e, n, r[n]);
586
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ee(Object(r)).forEach((function(n) {
2134
587
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
2135
588
  }));
2136
589
  }
2137
590
  return e;
2138
591
  }
2139
- function Rr(e, n, r) {
2140
- return (n = Ar(n)) in e ? Object.defineProperty(e, n, {
592
+ function Ae(e, n, r) {
593
+ return (n = Ie(n)) in e ? Object.defineProperty(e, n, {
2141
594
  value: r,
2142
595
  enumerable: !0,
2143
596
  configurable: !0,
2144
597
  writable: !0
2145
598
  }) : e[n] = r, e;
2146
599
  }
2147
- function Ar(e) {
2148
- var n = Ir(e, "string");
2149
- return "symbol" == vr(n) ? n : n + "";
600
+ function Ie(e) {
601
+ var n = qe(e, "string");
602
+ return "symbol" == he(n) ? n : n + "";
2150
603
  }
2151
- function Ir(e, n) {
2152
- if ("object" != vr(e) || !e) return e;
604
+ function qe(e, n) {
605
+ if ("object" != he(e) || !e) return e;
2153
606
  var r = e[Symbol.toPrimitive];
2154
607
  if (void 0 !== r) {
2155
608
  var t = r.call(e, n || "default");
2156
- if ("object" != vr(t)) return t;
609
+ if ("object" != he(t)) return t;
2157
610
  throw new TypeError("@@toPrimitive must return a primitive value.");
2158
611
  }
2159
612
  return ("string" === n ? String : Number)(e);
2160
613
  }
2161
- var Br = {
614
+ var De = {
2162
615
  allowNewValues: i().bool,
2163
616
  animateLoading: i().bool,
2164
617
  append: i().bool,
@@ -2194,29 +647,29 @@
2194
647
  tabConfirmsNewValue: i().bool,
2195
648
  values: i().array
2196
649
  };
2197
- var Nr = T()((function(e) {
650
+ var Le = z()((function(e) {
2198
651
  return {
2199
652
  flexBasis: e,
2200
653
  width: e
2201
654
  };
2202
655
  }));
2203
656
  // export for testing purpose
2204
- var Vr = T()((function(e) {
657
+ var Te = z()((function(e) {
2205
658
  var n = e.anchorWidth, r = n === void 0 ? 0 : n, t = e.maxHeight, o = e.menuStyle;
2206
- return Mr({
659
+ return Fe({
2207
660
  maxHeight: t,
2208
661
  overflow: "auto",
2209
662
  width: Math.max(r, 200)
2210
663
  }, o || {});
2211
664
  }));
2212
665
  // TS: not typed controlled/uncontrolled, handled by Multiselect wrapper component
2213
- var Dr = {};
2214
- var Lr = (0, d._)("No matches");
2215
- var qr = (0, d._)("Select...");
2216
- function Tr(e) {
2217
- var n = e.allowNewValues, o = e.animateLoading, l = e.append, i = e.children, u = e.controlledFilter, c = e.defaultPlacement, f = c === void 0 ? "vertical" : c, p = e.defaultValues, v = e.describedBy, b = e.disabled, m = e.elementRef, y = e.error, g = e.footerMessage, h = e.inline, O = e.inputId, S = e.inputRef, w = e.isLoadingOptions, C = e.labelledBy, k = e.loadingMessage, j = e.menuStyle, x = j === void 0 ? Dr : j, P = e.name, E = e.noOptionsMessage, R = E === void 0 ? Lr : E, A = e.onChange, I = e.onClose, B = e.onFilterChange, N = e.onScroll, V = e.onScrollBottom, D = e.onOpen, L = e.placeholder, q = L === void 0 ? qr : L, T = e.prepend, F = e.required, _ = e.repositionMode, K = e.tabConfirmsNewValue, H = e.values, $ = xr(e, [ "allowNewValues", "animateLoading", "append", "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", "prepend", "required", "repositionMode", "tabConfirmsNewValue", "values" ]);
666
+ var _e = {};
667
+ var He = (0, d._)("No matches");
668
+ var $e = (0, d._)("Select...");
669
+ function ze(e) {
670
+ var n = e.allowNewValues, o = e.animateLoading, l = e.append, i = e.children, u = e.controlledFilter, s = e.defaultPlacement, f = s === void 0 ? "vertical" : s, p = e.defaultValues, v = e.describedBy, b = e.disabled, m = e.elementRef, g = e.error, y = e.footerMessage, O = e.inline, w = e.inputId, S = e.inputRef, C = e.isLoadingOptions, M = e.labelledBy, P = e.loadingMessage, k = e.menuStyle, j = k === void 0 ? _e : k, V = e.name, x = e.noOptionsMessage, N = x === void 0 ? He : x, B = e.onChange, R = e.onClose, E = e.onFilterChange, A = e.onScroll, q = e.onScrollBottom, L = e.onOpen, _ = e.placeholder, $ = _ === void 0 ? $e : _, z = e.prepend, K = e.required, U = e.repositionMode, X = e.tabConfirmsNewValue, Q = e.values, Z = Be(e, [ "allowNewValues", "animateLoading", "append", "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", "prepend", "required", "repositionMode", "tabConfirmsNewValue", "values" ]);
2218
671
  // @docs-props-type NormalPropsBase
2219
- var W = s()({
672
+ var ne = c()({
2220
673
  componentName: "Multiselect",
2221
674
  /* eslint-disable-next-line prefer-rest-params */
2222
675
  componentProps: arguments[0],
@@ -2225,254 +678,254 @@
2225
678
  valuePropName: "values"
2226
679
  });
2227
680
  if (false) {}
2228
- var U = (0, r.useState)(0), X = Or(U, 2), G = X[0], J = X[1];
2229
- var Q = (0, r.useState)(null), Y = Or(Q, 2), Z = Y[0], ee = Y[1];
2230
- var re = (0, r.useState)(""), oe = Or(re, 2), ae = oe[0], le = oe[1];
2231
- var ie = (0, r.useState)(false), de = Or(ie, 2), fe = de[0], pe = de[1];
2232
- var ve = (0, r.useState)(false), be = Or(ve, 2), me = be[0], ye = be[1];
2233
- var ge = (0, r.useState)(p || []), he = Or(ge, 2), Oe = he[0], Se = he[1];
2234
- var we = (0, r.useState)(""), Ce = Or(we, 2), ke = Ce[0], je = Ce[1];
2235
- var xe = W && H ? H : Oe;
2236
- var Pe = xe.slice(0);
2237
- var Ee = xe.indexOf(ae) >= 0;
2238
- var Me = (0, r.useRef)(null);
2239
- var Re = (0, r.useRef)(null);
2240
- var Ae = (0, r.useRef)(undefined);
2241
- var Ie = (0, r.useRef)(0);
2242
- var Be = (0, r.useState)((function() {
681
+ var ie = (0, r.useState)(0), ue = Pe(ie, 2), se = ue[0], ce = ue[1];
682
+ var de = (0, r.useState)(null), fe = Pe(de, 2), pe = fe[0], he = fe[1];
683
+ var Se = (0, r.useState)(""), Ce = Pe(Se, 2), Me = Ce[0], ke = Ce[1];
684
+ var je = (0, r.useState)(false), Ve = Pe(je, 2), xe = Ve[0], Ne = Ve[1];
685
+ var Re = (0, r.useState)(false), Ee = Pe(Re, 2), Ae = Ee[0], Ie = Ee[1];
686
+ var qe = (0, r.useState)(p || []), De = Pe(qe, 2), ze = De[0], Ke = De[1];
687
+ var We = (0, r.useState)(""), Ue = Pe(We, 2), Ge = Ue[0], Xe = Ue[1];
688
+ var Je = ne && Q ? Q : ze;
689
+ var Qe = Je.slice(0);
690
+ var Ye = Je.indexOf(Me) >= 0;
691
+ var Ze = (0, r.useRef)(null);
692
+ var en = (0, r.useRef)(null);
693
+ var nn = (0, r.useRef)(undefined);
694
+ var rn = (0, r.useRef)(0);
695
+ var tn = (0, r.useState)((function() {
2243
696
  return {
2244
- activeItemId: (0, ce.createDOMID)("active-item"),
2245
- popoverId: (0, ce.createDOMID)("popover")
697
+ activeItemId: (0, ae.createDOMID)("active-item"),
698
+ popoverId: (0, ae.createDOMID)("popover")
2246
699
  };
2247
- })), Ne = Or(Be, 1), Ve = Ne[0], De = Ve.activeItemId, Le = Ve.popoverId;
700
+ })), on = Pe(tn, 1), an = on[0], ln = an.activeItemId, un = an.popoverId;
2248
701
  (0, r.useEffect)((function() {
2249
- if (W) {
2250
- le("");
2251
- J(0);
702
+ if (ne) {
703
+ ke("");
704
+ ce(0);
2252
705
  }
2253
- }), [ H, W ]);
706
+ }), [ Q, ne ]);
2254
707
  // 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
2255
708
  (0, r.useEffect)((function() {
2256
- Re.current = G;
2257
- }), [ G ]);
2258
- var qe = (0, r.useCallback)((function(e) {
709
+ en.current = se;
710
+ }), [ se ]);
711
+ var sn = (0, r.useCallback)((function(e) {
2259
712
  var n = e.resetFilterKeyword;
2260
- if (!me) {
2261
- le((function(e) {
713
+ if (!Ae) {
714
+ ke((function(e) {
2262
715
  return n ? "" : e;
2263
716
  }));
2264
- pe(true);
2265
- ye(true);
2266
- D === null || D === void 0 ? void 0 : D();
2267
- }
2268
- }), [ me, D ]);
2269
- var Te = (0, r.useCallback)((function() {
2270
- if (fe) {
2271
- qe({
717
+ Ne(true);
718
+ Ie(true);
719
+ L === null || L === void 0 ? void 0 : L();
720
+ }
721
+ }), [ Ae, L ]);
722
+ var cn = (0, r.useCallback)((function() {
723
+ if (xe) {
724
+ sn({
2272
725
  resetFilterKeyword: false
2273
726
  });
2274
727
  } else {
2275
728
  var e;
2276
- (e = Me.current) === null || e === void 0 ? void 0 : e.focus();
729
+ (e = Ze.current) === null || e === void 0 ? void 0 : e.focus();
2277
730
  }
2278
- }), [ fe, qe ]);
2279
- var Fe = (0, r.useCallback)((function(e, n) {
2280
- if (!me) {
731
+ }), [ xe, sn ]);
732
+ var dn = (0, r.useCallback)((function(e, n) {
733
+ if (!Ae) {
2281
734
  return;
2282
735
  }
2283
- var r = (xe || []).concat([ n ]);
2284
- if (!W) {
2285
- Se(r);
2286
- J(0);
2287
- ye(true);
2288
- le("");
736
+ var r = (Je || []).concat([ n ]);
737
+ if (!ne) {
738
+ Ke(r);
739
+ ce(0);
740
+ Ie(true);
741
+ ke("");
2289
742
  }
2290
- A === null || A === void 0 ? void 0 : A(e, {
743
+ B === null || B === void 0 ? void 0 : B(e, {
2291
744
  values: r,
2292
- name: P
745
+ name: V
2293
746
  });
2294
- }), [ me, xe, W, A, P ]);
2295
- var _e = (0, r.useCallback)((function(e, n) {
2296
- var r = z()(xe, n);
2297
- if (!W) {
2298
- Se(r);
747
+ }), [ Ae, Je, ne, B, V ]);
748
+ var fn = (0, r.useCallback)((function(e, n) {
749
+ var r = J()(Je, n);
750
+ if (!ne) {
751
+ Ke(r);
2299
752
  }
2300
- A === null || A === void 0 ? void 0 : A(e, {
753
+ B === null || B === void 0 ? void 0 : B(e, {
2301
754
  values: r,
2302
- name: P
755
+ name: V
2303
756
  });
2304
- }), [ xe, W, P, A ]);
2305
- var Ke = (0, r.useCallback)((function(e) {
2306
- if (me && !w) {
2307
- V === null || V === void 0 ? void 0 : V(e);
2308
- je("".concat(Ie.current, " options, loading more options"));
2309
- }
2310
- }), [ me, w, V ]);
2311
- var He = (0, r.useCallback)((function(e, n) {
757
+ }), [ Je, ne, V, B ]);
758
+ var pn = (0, r.useCallback)((function(e) {
759
+ if (Ae && !C) {
760
+ q === null || q === void 0 ? void 0 : q(e);
761
+ Xe("".concat(rn.current, " options, loading more options"));
762
+ }
763
+ }), [ Ae, C, q ]);
764
+ var vn = (0, r.useCallback)((function(e, n) {
2312
765
  var r = n.value;
2313
- $n()((function() {
2314
- return _e(e, r);
766
+ F()((function() {
767
+ return fn(e, r);
2315
768
  }));
2316
- }), [ _e ]);
2317
- var $e = (0, r.useCallback)((function(e) {
2318
- if (ae !== "") {
2319
- B === null || B === void 0 ? void 0 : B(e, {
769
+ }), [ fn ]);
770
+ var bn = (0, r.useCallback)((function(e) {
771
+ if (Me !== "") {
772
+ E === null || E === void 0 ? void 0 : E(e, {
2320
773
  keyword: ""
2321
774
  });
2322
775
  }
2323
- qe({
776
+ sn({
2324
777
  resetFilterKeyword: true
2325
778
  });
2326
- }), [ ae, B, qe ]);
2327
- var ze = (0, r.useCallback)((function(e) {
779
+ }), [ Me, E, sn ]);
780
+ var mn = (0, r.useCallback)((function(e) {
2328
781
  var n;
2329
782
  var t = e.key;
2330
- if (t === "Tab" && me) {
2331
- if (K && Ae.current !== undefined && Ie.current <= 1) {
783
+ if (t === "Tab" && Ae) {
784
+ if (X && nn.current !== undefined && rn.current <= 1) {
2332
785
  var o;
2333
786
  e.preventDefault();
2334
- Fe(e, Ae.current);
2335
- (o = Me.current) === null || o === void 0 ? void 0 : o.focus();
787
+ dn(e, nn.current);
788
+ (o = Ze.current) === null || o === void 0 ? void 0 : o.focus();
2336
789
  } else {
2337
- ye(false);
790
+ Ie(false);
2338
791
  }
2339
792
  }
2340
793
  if (e.shiftKey || e.metaKey || e.ctrlKey) {
2341
794
  return;
2342
795
  }
2343
- if (t === "End" && me) {
796
+ if (t === "End" && Ae) {
2344
797
  e.preventDefault();
2345
- J(Ie.current - 1);
798
+ ce(rn.current - 1);
2346
799
  }
2347
- if (t === "Home" && me) {
800
+ if (t === "Home" && Ae) {
2348
801
  e.preventDefault();
2349
- J(0);
802
+ ce(0);
2350
803
  }
2351
804
  if (t === "ArrowDown") {
2352
805
  e.preventDefault();
2353
- if (me) {
2354
- J((function(e) {
2355
- return Math.min(e + 1, Ie.current - 1);
806
+ if (Ae) {
807
+ ce((function(e) {
808
+ return Math.min(e + 1, rn.current - 1);
2356
809
  }));
2357
810
  } else {
2358
- J(0);
2359
- ye(true);
811
+ ce(0);
812
+ Ie(true);
2360
813
  }
2361
- if (i && V) {
2362
- var a = r.Children.toArray(i).length - (2 + ((xe === null || xe === void 0 ? void 0 : xe.length) || 0));
2363
- if (G === a) {
2364
- Ke(e);
814
+ if (i && q) {
815
+ var a = r.Children.toArray(i).length - (2 + ((Je === null || Je === void 0 ? void 0 : Je.length) || 0));
816
+ if (se === a) {
817
+ pn(e);
2365
818
  }
2366
819
  }
2367
820
  }
2368
821
  if (t === "ArrowUp") {
2369
822
  e.preventDefault();
2370
- if (me) {
2371
- J((function(e) {
823
+ if (Ae) {
824
+ ce((function(e) {
2372
825
  return Math.max(e - 1, 0);
2373
826
  }));
2374
827
  } else {
2375
- J(0);
2376
- ye(true);
828
+ ce(0);
829
+ Ie(true);
2377
830
  }
2378
831
  }
2379
- if (t === "Enter" && Ae.current !== undefined && me) {
2380
- Fe(e, Ae.current);
832
+ if (t === "Enter" && nn.current !== undefined && Ae) {
833
+ dn(e, nn.current);
2381
834
  }
2382
- if (t === "Backspace" && ((n = Me.current) === null || n === void 0 ? void 0 : n.value) === "" && xe.length) {
2383
- _e(e, Yn()(xe));
835
+ if (t === "Backspace" && ((n = Ze.current) === null || n === void 0 ? void 0 : n.value) === "" && Je.length) {
836
+ fn(e, H()(Je));
2384
837
  }
2385
- }), [ me, xe, K, Fe, i, V, G, Ke, _e ]);
2386
- var We = (0, r.useCallback)((function(e) {
2387
- le(e.target.value);
2388
- ye(true);
2389
- J(0);
2390
- B === null || B === void 0 ? void 0 : B(e, {
838
+ }), [ Ae, Je, X, dn, i, q, se, pn, fn ]);
839
+ var gn = (0, r.useCallback)((function(e) {
840
+ ke(e.target.value);
841
+ Ie(true);
842
+ ce(0);
843
+ E === null || E === void 0 ? void 0 : E(e, {
2391
844
  keyword: e.target.value
2392
845
  });
2393
- }), [ B ]);
2394
- var Ue = (0, r.useCallback)((function(e, n) {
846
+ }), [ E ]);
847
+ var yn = (0, r.useCallback)((function(e, n) {
2395
848
  var r;
2396
849
  var t = n.value;
2397
850
  e.stopPropagation();
2398
- Fe(e, t);
2399
- (r = Me.current) === null || r === void 0 ? void 0 : r.focus();
2400
- }), [ Fe ]);
2401
- var Ge = (0, r.useCallback)((function(e) {
2402
- var n = document.getElementById(Le);
851
+ dn(e, t);
852
+ (r = Ze.current) === null || r === void 0 ? void 0 : r.focus();
853
+ }), [ dn ]);
854
+ var hn = (0, r.useCallback)((function(e) {
855
+ var n = document.getElementById(un);
2403
856
  var r = e.relatedTarget || document.activeElement;
2404
857
  // IE11 doesn't support relatedTarget but sets activeElement
2405
858
  var t = n && r && n.contains(r);
2406
859
  // TS: target as Node is an unsafe assumption
2407
- le(t ? ae : "");
2408
- pe(false);
860
+ ke(t ? Me : "");
861
+ Ne(false);
2409
862
  if (!t) {
2410
- B === null || B === void 0 ? void 0 : B(e, {
863
+ E === null || E === void 0 ? void 0 : E(e, {
2411
864
  keyword: ""
2412
865
  });
2413
866
  }
2414
- }), [ ae, B, Le ]);
2415
- var Je = (0, r.useCallback)((function(e) {
867
+ }), [ Me, E, un ]);
868
+ var On = (0, r.useCallback)((function(e) {
2416
869
  var n = e.reason, r = e.event;
2417
- if (n === "escapeKey" || n === "offScreen" || n === "clickAway" && r !== undefined && !(Z === null || Z === void 0 ? void 0 : Z.contains(r.target))) {
2418
- ye(false);
2419
- Re.current = null;
2420
- I === null || I === void 0 ? void 0 : I();
870
+ if (n === "escapeKey" || n === "offScreen" || n === "clickAway" && r !== undefined && !(pe === null || pe === void 0 ? void 0 : pe.contains(r.target))) {
871
+ Ie(false);
872
+ en.current = null;
873
+ R === null || R === void 0 ? void 0 : R();
2421
874
  }
2422
875
  if (n === "escapeKey") {
2423
876
  var t;
2424
- (t = Me.current) === null || t === void 0 ? void 0 : t.focus();
877
+ (t = Ze.current) === null || t === void 0 ? void 0 : t.focus();
2425
878
  }
2426
- }), [ Z, I ]);
2427
- var Qe = (0, r.useCallback)((function(e) {
2428
- ee(e);
2429
- Xe(m, e);
879
+ }), [ pe, R ]);
880
+ var wn = (0, r.useCallback)((function(e) {
881
+ he(e);
882
+ ye(m, e);
2430
883
  }), [ m ]);
2431
- var Ye = (0, r.useCallback)((function(e) {
2432
- Me.current = e;
2433
- Xe(S, e);
884
+ var Sn = (0, r.useCallback)((function(e) {
885
+ Ze.current = e;
886
+ ye(S, e);
2434
887
  }), [ S ]);
2435
- var Ze = (0, r.useCallback)((function(e) {
2436
- if (Re.current !== G) {
2437
- (0, se.scrollIntoViewIfNeeded)(e);
888
+ var Cn = (0, r.useCallback)((function(e) {
889
+ if (en.current !== se) {
890
+ (0, le.scrollIntoViewIfNeeded)(e);
2438
891
  }
2439
- }), [ G ]);
2440
- var en = (0, r.useCallback)((function(e) {
892
+ }), [ se ]);
893
+ var Mn = (0, r.useCallback)((function(e) {
2441
894
  // selectedOptions may contain items or unmatched values at this point
2442
895
  return e.map((function(e) {
2443
896
  var n = e;
2444
897
  // TS: faking props here
2445
898
  var r = n.props;
2446
899
  if (r != null) {
2447
- var o = r.children, a = r.icon, l = r.label, i = r.selectedAppearance, u = r.selectedBackgroundColor, c = r.selectedForegroundColor, s = r.value;
900
+ var o = r.children, a = r.icon, l = r.label, i = r.selectedAppearance, u = r.selectedBackgroundColor, s = r.selectedForegroundColor, c = r.value;
2448
901
 
2449
- return t().createElement(pr, {
902
+ return t().createElement(ge, {
2450
903
  "aria-selected": true,
2451
904
  disabled: b,
2452
905
  icon: a,
2453
- key: s.toString(),
906
+ key: c.toString(),
2454
907
  "data-test": "selected-option",
2455
- onRequestRemove: He,
908
+ onRequestRemove: vn,
2456
909
  role: "option",
2457
- value: s,
910
+ value: c,
2458
911
  appearance: i,
2459
912
  backgroundColor: u,
2460
- foregroundColor: c
913
+ foregroundColor: s
2461
914
  }, o || l);
2462
915
  }
2463
916
 
2464
- return t().createElement(pr, {
917
+ return t().createElement(ge, {
2465
918
  "aria-selected": true,
2466
919
  disabled: b,
2467
- key: (0, ce.createGUID)(),
920
+ key: (0, ae.createGUID)(),
2468
921
  "data-test": "selected-option",
2469
- onRequestRemove: He,
922
+ onRequestRemove: vn,
2470
923
  role: "option",
2471
924
  value: n
2472
925
  }, n);
2473
926
  }));
2474
- }), [ b, He ]);
2475
- var nn = function e(n) {
927
+ }), [ b, vn ]);
928
+ var Pn = function e(n) {
2476
929
  return n.map((function(e) {
2477
930
  var n = e;
2478
931
  // TS: faking props here
@@ -2481,82 +934,82 @@
2481
934
 
2482
935
  return t().createElement("span", {
2483
936
  key: r.value.toString()
2484
- }, r.children || r.label, (0, ar.sprintf)((0, d._)(" selected")));
937
+ }, r.children || r.label, (0, oe.sprintf)((0, d._)(" selected")));
2485
938
  }
2486
939
 
2487
940
  return t().createElement("span", {
2488
- key: (0, ce.createGUID)()
2489
- }, t().createElement(t().Fragment, null, n, (0, ar.sprintf)((0, d._)(" selected"))));
941
+ key: (0, ae.createGUID)()
942
+ }, t().createElement(t().Fragment, null, n, (0, oe.sprintf)((0, d._)(" selected"))));
2490
943
  }));
2491
944
  };
2492
945
  // Map Options to selected values
2493
- if (xe && xe.length) {
946
+ if (Je && Je.length) {
2494
947
  r.Children.toArray(i).filter(r.isValidElement).filter((function(e) {
2495
- return e.type === M;
948
+ return e.type === h;
2496
949
  })).forEach((function(e) {
2497
- if (e.type === M) {
2498
- var n = xe.indexOf(e.props.value);
950
+ if (e.type === h) {
951
+ var n = Je.indexOf(e.props.value);
2499
952
  if (n !== -1) {
2500
- Pe[n] = e;
953
+ Qe[n] = e;
2501
954
  }
2502
955
  }
2503
956
  }));
2504
957
  }
2505
958
  // Filter the items
2506
- var rn = (0, ue.stringToKeywords)(ae);
2507
- var tn = u ? r.Children.toArray(i) : r.Children.toArray(i).filter((function(e) {
2508
- if (Wn()(e, [ "props", "label" ], false)) {
2509
- return (0, ue.testPhrase)(e.props.label, rn);
959
+ var kn = (0, te.stringToKeywords)(Me);
960
+ var jn = u ? r.Children.toArray(i) : r.Children.toArray(i).filter((function(e) {
961
+ if (I()(e, [ "props", "label" ], false)) {
962
+ return (0, te.testPhrase)(e.props.label, kn);
2510
963
  }
2511
964
  return true;
2512
965
  // Keep all headers and non-interactive options
2513
966
  }));
2514
- Ie.current = 0;
2515
- Ae.current = undefined;
2516
- var on = r.Children.map(tn, (function(e, n) {
967
+ rn.current = 0;
968
+ nn.current = undefined;
969
+ var Vn = r.Children.map(jn, (function(e, n) {
2517
970
  var t = e.props;
2518
971
  if (!t || !a()(t, "value")) {
2519
972
  // ignore Headings and Dividers
2520
973
  return e;
2521
974
  }
2522
975
  var o = e;
2523
- var l = o.props, i = l.children, c = l.label, s = l.matchRanges, d = l.value;
976
+ var l = o.props, i = l.children, s = l.label, c = l.matchRanges, d = l.value;
2524
977
  // find out if the search string exactly matches a value
2525
- if (d === ae) {
2526
- Ee = true;
978
+ if (d === Me) {
979
+ Ye = true;
2527
980
  }
2528
981
  // remove items that are already selected
2529
- var f = xe.indexOf(d);
982
+ var f = Je.indexOf(d);
2530
983
  if (f >= 0) {
2531
984
  return null;
2532
985
  }
2533
986
  // highlight matched text
2534
- var p = i === undefined || Xn()(i);
2535
- var v = p && !u && !s && rn && (0, ue.keywordLocations)(c, rn);
987
+ var p = i === undefined || D()(i);
988
+ var v = p && !u && !c && kn && (0, te.keywordLocations)(s, kn);
2536
989
  // clone item
2537
990
  var b = (0, r.cloneElement)(o, {
2538
991
  // eslint-disable-next-line react/no-array-index-key
2539
992
  key: n,
2540
- onClick: Ue,
2541
- matchRanges: p && (s || v) || undefined
993
+ onClick: yn,
994
+ matchRanges: p && (c || v) || undefined
2542
995
  });
2543
996
  return b;
2544
997
  })).filter((function(e) {
2545
998
  return e !== null;
2546
999
  })) || [];
2547
1000
  // Add the option to add the new value
2548
- if (n && !Ee && ae) {
2549
- on.unshift( t().createElement(M, {
2550
- label: "".concat(ae),
1001
+ if (n && !Ye && Me) {
1002
+ Vn.unshift( t().createElement(h, {
1003
+ label: "".concat(Me),
2551
1004
  description: (0, d._)("(New value)"),
2552
1005
  descriptionPosition: "right",
2553
- value: ae,
1006
+ value: Me,
2554
1007
  key: "newValue",
2555
- onClick: Ue
1008
+ onClick: yn
2556
1009
  }));
2557
1010
  }
2558
1011
  // highlight the selected Item
2559
- var an = r.Children.map(on, (function(e) {
1012
+ var xn = r.Children.map(Vn, (function(e) {
2560
1013
  var n = e.props;
2561
1014
  if (!n || !a()(n, "value")) {
2562
1015
  // ignore Headings and Dividers
@@ -2564,136 +1017,136 @@
2564
1017
  }
2565
1018
  var t = e;
2566
1019
  var o = t.props, l = o.disabled, i = o.value;
2567
- var u = Ie.current === G;
2568
- Ie.current += 1;
1020
+ var u = rn.current === se;
1021
+ rn.current += 1;
2569
1022
  if (!u) {
2570
1023
  return t;
2571
1024
  }
2572
1025
  if (!l) {
2573
- Ae.current = i;
1026
+ nn.current = i;
2574
1027
  }
2575
- var c = (0, r.cloneElement)(t, {
1028
+ var s = (0, r.cloneElement)(t, {
2576
1029
  active: u,
2577
- id: De,
1030
+ id: ln,
2578
1031
  elementRef: function e(n) {
2579
- Ze(n);
2580
- Xe(t.props.elementRef, n);
1032
+ Cn(n);
1033
+ ye(t.props.elementRef, n);
2581
1034
  }
2582
1035
  });
2583
- return c;
1036
+ return s;
2584
1037
  }));
2585
- var ln = function e(n) {
1038
+ var Nn = function e(n) {
2586
1039
  var r = n.anchorWidth, a = n.maxHeight, l = n.placement;
2587
- var i = Vr({
1040
+ var i = Te({
2588
1041
  anchorWidth: r,
2589
1042
  maxHeight: a,
2590
- menuStyle: x
1043
+ menuStyle: j
2591
1044
  });
2592
1045
 
2593
- return t().createElement(ne(), {
1046
+ return t().createElement(ee(), {
2594
1047
  focusMode: "never",
2595
1048
  placement: l !== null && l !== void 0 ? l : undefined,
2596
- isLoading: w,
2597
- onScrollBottom: V ? Ke : undefined,
2598
- noOptionsMessage: R,
2599
- footerMessage: g,
1049
+ isLoading: C,
1050
+ onScrollBottom: q ? pn : undefined,
1051
+ noOptionsMessage: N,
1052
+ footerMessage: y,
2600
1053
  animateLoading: o,
2601
- loadingMessage: k,
2602
- onScroll: N,
1054
+ loadingMessage: P,
1055
+ onScroll: A,
2603
1056
  style: i
2604
- }, an);
1057
+ }, xn);
2605
1058
  };
2606
- var un = Nr("".concat(ae.length * .8, "em"));
2607
- var cn = Mr(Mr({}, rr()($, (function(e, n) {
1059
+ var Bn = Le("".concat(Me.length * .8, "em"));
1060
+ var Rn = Fe(Fe({}, G()(Z, (function(e, n) {
2608
1061
  return n === "role" || n.indexOf("aria-") === 0;
2609
1062
  }))), {}, {
2610
1063
  "aria-describedby": v,
2611
- "aria-labelledby": C,
2612
- "aria-invalid": y || undefined
1064
+ "aria-labelledby": M,
1065
+ "aria-invalid": g || undefined
2613
1066
  });
2614
- var sn = Mr({}, rr()($, (function(e, n) {
1067
+ var En = Fe({}, G()(Z, (function(e, n) {
2615
1068
  return n === "aria-label" || n === "aria-describedby";
2616
1069
  })));
2617
1070
 
2618
- return t().createElement(t().Fragment, null, t().createElement(sr, br({
1071
+ return t().createElement(t().Fragment, null, t().createElement(ve, Oe({
2619
1072
  key: "control",
2620
1073
  $append: l,
2621
- "data-test-values": JSON.stringify(xe),
1074
+ "data-test-values": JSON.stringify(Je),
2622
1075
  "data-test-disabled": b ? "disabled" : undefined,
2623
- inline: h,
2624
- $hasFocus: fe
2625
- }, er().apply(void 0, [ $ ].concat(mr(Jn()(cn)))), {
2626
- onClick: b ? undefined : Te,
1076
+ inline: O,
1077
+ $hasFocus: xe
1078
+ }, W().apply(void 0, [ Z ].concat(we(T()(Rn)))), {
1079
+ onClick: b ? undefined : cn,
2627
1080
  $disabled: b,
2628
- $error: y,
2629
- "data-test-popover-id": Le,
2630
- $popoverOpen: me,
2631
- $prepend: T,
1081
+ $error: g,
1082
+ "data-test-popover-id": un,
1083
+ $popoverOpen: Ae,
1084
+ $prepend: z,
2632
1085
  flex: true,
2633
- elementRef: Qe,
1086
+ elementRef: wn,
2634
1087
  role: "group",
2635
1088
  "aria-disabled": b || undefined,
2636
- "aria-labelledby": C
2637
- }, sn), t().createElement(dr, {
1089
+ "aria-labelledby": M
1090
+ }, En), t().createElement(be, {
2638
1091
  role: "listbox",
2639
- "aria-invalid": y,
1092
+ "aria-invalid": g,
2640
1093
  "aria-multiselectable": "true"
2641
- }, en(Pe)), !b && t().createElement(fr, br({
1094
+ }, Mn(Qe)), !b && t().createElement(me, Oe({
2642
1095
  role: "combobox",
2643
1096
  "data-test": "textbox",
2644
- id: O,
2645
- ref: Ye,
2646
- onBlur: Ge,
2647
- onFocus: $e,
2648
- onChange: We,
2649
- onKeyDown: ze,
2650
- value: ae,
1097
+ id: w,
1098
+ ref: Sn,
1099
+ onBlur: hn,
1100
+ onFocus: bn,
1101
+ onChange: gn,
1102
+ onKeyDown: mn,
1103
+ value: Me,
2651
1104
  autoCapitalize: "off",
2652
1105
  autoComplete: "off",
2653
1106
  autoCorrect: "off",
2654
1107
  spellCheck: false,
2655
- style: un,
2656
- placeholder: xe.length ? "" : q,
2657
- required: F,
2658
- "aria-activedescendant": me && Ie.current > 0 ? De : undefined,
1108
+ style: Bn,
1109
+ placeholder: Je.length ? "" : $,
1110
+ required: K,
1111
+ "aria-activedescendant": Ae && rn.current > 0 ? ln : undefined,
2659
1112
  "aria-autocomplete": "list",
2660
- "aria-controls": me ? Le : undefined,
2661
- "aria-owns": me ? Le : undefined,
2662
- "aria-expanded": me,
1113
+ "aria-controls": Ae ? un : undefined,
1114
+ "aria-owns": Ae ? un : undefined,
1115
+ "aria-expanded": Ae,
2663
1116
  "aria-haspopup": true
2664
- }, cn)), t().createElement(or(), {
2665
- open: me && !!Z,
1117
+ }, Rn)), t().createElement(Y(), {
1118
+ open: Ae && !!pe,
2666
1119
  autoCloseWhenOffScreen: true,
2667
- anchor: Z,
2668
- onRequestClose: Je,
1120
+ anchor: pe,
1121
+ onRequestClose: On,
2669
1122
  canCoverAnchor: false,
2670
1123
  defaultPlacement: f,
2671
- repositionMode: _,
2672
- id: Le
2673
- }, ln)), t().createElement(te(), {
1124
+ repositionMode: U,
1125
+ id: un
1126
+ }, Nn)), t().createElement(re(), {
2674
1127
  role: "status",
2675
1128
  "aria-relevant": "text"
2676
- }, ke), t().createElement(te(), {
1129
+ }, Ge), t().createElement(re(), {
2677
1130
  role: "alert",
2678
1131
  "aria-relevant": "additions"
2679
- }, nn(Pe)));
1132
+ }, Pn(Qe)));
2680
1133
  }
2681
- Tr.propTypes = Br;
2682
- Tr.Option = M;
2683
- Tr.Divider = u.Divider;
2684
- Tr.Heading = u.Heading;
2685
- /* harmony default export */ const Fr = Tr;
1134
+ ze.propTypes = De;
1135
+ ze.Option = h;
1136
+ ze.Divider = u.Divider;
1137
+ ze.Heading = u.Heading;
1138
+ /* harmony default export */ const Ke = ze;
2686
1139
  // CONCATENATED MODULE: ./src/Multiselect/Multiselect.tsx
2687
- function _r(e) {
1140
+ function We(e) {
2688
1141
  "@babel/helpers - typeof";
2689
- return _r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
1142
+ return We = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
2690
1143
  return typeof e;
2691
1144
  } : function(e) {
2692
1145
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2693
- }, _r(e);
1146
+ }, We(e);
2694
1147
  }
2695
- function Kr() {
2696
- return Kr = Object.assign ? Object.assign.bind() : function(e) {
1148
+ function Ue() {
1149
+ return Ue = Object.assign ? Object.assign.bind() : function(e) {
2697
1150
  for (var n = 1; n < arguments.length; n++) {
2698
1151
  var r = arguments[n];
2699
1152
  for (var t in r) {
@@ -2701,9 +1154,9 @@
2701
1154
  }
2702
1155
  }
2703
1156
  return e;
2704
- }, Kr.apply(null, arguments);
1157
+ }, Ue.apply(null, arguments);
2705
1158
  }
2706
- function Hr(e, n) {
1159
+ function Ge(e, n) {
2707
1160
  var r = Object.keys(e);
2708
1161
  if (Object.getOwnPropertySymbols) {
2709
1162
  var t = Object.getOwnPropertySymbols(e);
@@ -2713,42 +1166,42 @@
2713
1166
  }
2714
1167
  return r;
2715
1168
  }
2716
- function $r(e) {
1169
+ function Xe(e) {
2717
1170
  for (var n = 1; n < arguments.length; n++) {
2718
1171
  var r = null != arguments[n] ? arguments[n] : {};
2719
- n % 2 ? Hr(Object(r), !0).forEach((function(n) {
2720
- zr(e, n, r[n]);
2721
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Hr(Object(r)).forEach((function(n) {
1172
+ n % 2 ? Ge(Object(r), !0).forEach((function(n) {
1173
+ Je(e, n, r[n]);
1174
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ge(Object(r)).forEach((function(n) {
2722
1175
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
2723
1176
  }));
2724
1177
  }
2725
1178
  return e;
2726
1179
  }
2727
- function zr(e, n, r) {
2728
- return (n = Wr(n)) in e ? Object.defineProperty(e, n, {
1180
+ function Je(e, n, r) {
1181
+ return (n = Qe(n)) in e ? Object.defineProperty(e, n, {
2729
1182
  value: r,
2730
1183
  enumerable: !0,
2731
1184
  configurable: !0,
2732
1185
  writable: !0
2733
1186
  }) : e[n] = r, e;
2734
1187
  }
2735
- function Wr(e) {
2736
- var n = Ur(e, "string");
2737
- return "symbol" == _r(n) ? n : n + "";
1188
+ function Qe(e) {
1189
+ var n = Ye(e, "string");
1190
+ return "symbol" == We(n) ? n : n + "";
2738
1191
  }
2739
- function Ur(e, n) {
2740
- if ("object" != _r(e) || !e) return e;
1192
+ function Ye(e, n) {
1193
+ if ("object" != We(e) || !e) return e;
2741
1194
  var r = e[Symbol.toPrimitive];
2742
1195
  if (void 0 !== r) {
2743
1196
  var t = r.call(e, n || "default");
2744
- if ("object" != _r(t)) return t;
1197
+ if ("object" != We(t)) return t;
2745
1198
  throw new TypeError("@@toPrimitive must return a primitive value.");
2746
1199
  }
2747
1200
  return ("string" === n ? String : Number)(e);
2748
1201
  }
2749
- function Xr(e, n) {
1202
+ function Ze(e, n) {
2750
1203
  if (null == e) return {};
2751
- var r, t, o = Gr(e, n);
1204
+ var r, t, o = en(e, n);
2752
1205
  if (Object.getOwnPropertySymbols) {
2753
1206
  var a = Object.getOwnPropertySymbols(e);
2754
1207
  for (t = 0; t < a.length; t++) {
@@ -2757,7 +1210,7 @@
2757
1210
  }
2758
1211
  return o;
2759
1212
  }
2760
- function Gr(e, n) {
1213
+ function en(e, n) {
2761
1214
  if (null == e) return {};
2762
1215
  var r = {};
2763
1216
  for (var t in e) {
@@ -2770,7 +1223,7 @@
2770
1223
  }
2771
1224
  /** @public */
2772
1225
  /** @public */
2773
- /** @public */ var Jr = {
1226
+ /** @public */ var nn = {
2774
1227
  allowNewValues: i().bool,
2775
1228
  animateLoading: i().bool,
2776
1229
  append: i().bool,
@@ -2810,12 +1263,12 @@
2810
1263
  /** @private */
2811
1264
  virtualization: i().number
2812
1265
  };
2813
- var Qr = (0, d._)("No matches");
2814
- var Yr = (0, d._)("Select...");
2815
- function Zr(e) {
2816
- var n = e.allowNewValues, o = e.animateLoading, a = e.append, l = e.compact, i = e.children, u = e.controlledFilter, c = e.defaultPlacement, d = c === void 0 ? "vertical" : c, f = e.defaultValues, p = e.describedBy, v = e.disabled, b = e.elementRef, m = e.error, y = e.filter, g = e.footerMessage, h = e.inline, O = e.inputId, S = e.inputRef, w = e.isLoadingOptions, C = e.labelledBy, k = e.loadingMessage, j = e.menuStyle, x = e.name, P = e.noOptionsMessage, E = P === void 0 ? Qr : P, M = e.onChange, R = e.onClose, A = e.onFilterChange, I = e.onOpen, B = e.onScroll, N = e.onScrollBottom, V = e.placeholder, D = V === void 0 ? Yr : V, L = e.prepend, q = e.repositionMode, T = q === void 0 ? "flip" : q, F = e.selectAllAppearance, _ = e.showSelectedValuesFirst, K = e.tabConfirmsNewValue, H = e.values, $ = e.virtualization, z = Xr(e, [ "allowNewValues", "animateLoading", "append", "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", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "tabConfirmsNewValue", "values", "virtualization" ]);
1266
+ var rn = (0, d._)("No matches");
1267
+ var tn = (0, d._)("Select...");
1268
+ function on(e) {
1269
+ var n = e.allowNewValues, o = e.animateLoading, a = e.append, l = e.compact, i = e.children, u = e.controlledFilter, s = e.defaultPlacement, d = s === void 0 ? "vertical" : s, f = e.defaultValues, p = e.describedBy, v = e.disabled, b = e.elementRef, m = e.error, g = e.filter, y = e.footerMessage, h = e.inline, O = e.inputId, w = e.inputRef, S = e.isLoadingOptions, C = e.labelledBy, M = e.loadingMessage, P = e.menuStyle, k = e.name, j = e.noOptionsMessage, V = j === void 0 ? rn : j, x = e.onChange, N = e.onClose, B = e.onFilterChange, E = e.onOpen, F = e.onScroll, A = e.onScrollBottom, I = e.placeholder, q = I === void 0 ? tn : I, D = e.prepend, L = e.repositionMode, T = L === void 0 ? "flip" : L, _ = e.selectAllAppearance, H = e.showSelectedValuesFirst, $ = e.tabConfirmsNewValue, z = e.values, K = e.virtualization, W = Ze(e, [ "allowNewValues", "animateLoading", "append", "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", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "tabConfirmsNewValue", "values", "virtualization" ]);
2817
1270
  // @docs-props-type MultiselectPropsBase
2818
- var W = s()({
1271
+ var U = c()({
2819
1272
  componentName: "Multiselect",
2820
1273
  /* eslint-disable-next-line prefer-rest-params */
2821
1274
  componentProps: arguments[0],
@@ -2823,16 +1276,16 @@
2823
1276
  defaultValuePropName: "defaultValues",
2824
1277
  valuePropName: "values"
2825
1278
  });
2826
- /* eslint-disable-next-line prefer-rest-params */ var U = arguments[0];
1279
+ /* eslint-disable-next-line prefer-rest-params */ var G = arguments[0];
2827
1280
  (0, r.useEffect)((function() {
2828
1281
  if (l !== true) {
2829
1282
  if (false) {}
2830
1283
  if (false) {}
2831
1284
  }
2832
- }), [ l, U ]);
1285
+ }), [ l, G ]);
2833
1286
  // Compact uses Button, which defaults `inline` to true, explicitly pass a boolean to prevent the underlying Button from applying its default.
2834
1287
  var X = !!h;
2835
- var G = $r({
1288
+ var J = Xe({
2836
1289
  allowNewValues: n,
2837
1290
  animateLoading: o,
2838
1291
  append: a,
@@ -2843,66 +1296,66 @@
2843
1296
  disabled: v,
2844
1297
  elementRef: b,
2845
1298
  error: m,
2846
- footerMessage: g,
1299
+ footerMessage: y,
2847
1300
  inline: X,
2848
1301
  inputId: O,
2849
- inputRef: S,
2850
- isLoadingOptions: w,
1302
+ inputRef: w,
1303
+ isLoadingOptions: S,
2851
1304
  labelledBy: C,
2852
- loadingMessage: k,
2853
- menuStyle: j,
2854
- name: x,
2855
- noOptionsMessage: E,
2856
- onClose: R,
2857
- onChange: M,
2858
- onFilterChange: A,
2859
- onOpen: I,
2860
- onScroll: B,
2861
- onScrollBottom: N,
2862
- placeholder: D,
2863
- prepend: L,
1305
+ loadingMessage: M,
1306
+ menuStyle: P,
1307
+ name: k,
1308
+ noOptionsMessage: V,
1309
+ onClose: N,
1310
+ onChange: x,
1311
+ onFilterChange: B,
1312
+ onOpen: E,
1313
+ onScroll: F,
1314
+ onScrollBottom: A,
1315
+ placeholder: q,
1316
+ prepend: D,
2864
1317
  repositionMode: T,
2865
- showSelectedValuesFirst: _,
2866
- tabConfirmsNewValue: K,
2867
- virtualization: $
2868
- }, z);
2869
- var J = (0, r.useMemo)((function() {
1318
+ showSelectedValuesFirst: H,
1319
+ tabConfirmsNewValue: $,
1320
+ virtualization: K
1321
+ }, W);
1322
+ var Q = (0, r.useMemo)((function() {
2870
1323
  return {
2871
1324
  defaultValues: f
2872
1325
  };
2873
1326
  }), [ f ]);
2874
- var Q = (0, r.useMemo)((function() {
1327
+ var Y = (0, r.useMemo)((function() {
2875
1328
  return {
2876
- values: H
1329
+ values: z
2877
1330
  };
2878
- }), [ H ]);
2879
- var Y = (0, r.useMemo)((function() {
2880
- return W ? Q : J;
2881
- }), [ J, W, Q ]);
2882
- var Z = {
2883
- filter: y,
2884
- selectAllAppearance: F,
2885
- showSelectedValuesFirst: _,
2886
- virtualization: $
1331
+ }), [ z ]);
1332
+ var Z = (0, r.useMemo)((function() {
1333
+ return U ? Y : Q;
1334
+ }), [ Q, U, Y ]);
1335
+ var ee = {
1336
+ filter: g,
1337
+ selectAllAppearance: _,
1338
+ showSelectedValuesFirst: H,
1339
+ virtualization: K
2887
1340
  };
2888
1341
  if (l) {
2889
1342
 
2890
- return t().createElement(Kn, Kr({
1343
+ return t().createElement(R, Ue({
2891
1344
  "data-test": "multiselect"
2892
- }, Y, Z, G));
1345
+ }, Z, ee, J));
2893
1346
  }
2894
1347
 
2895
- return t().createElement(Fr, Kr({
1348
+ return t().createElement(Ke, Ue({
2896
1349
  "data-test": "multiselect"
2897
- }, Y, G));
1350
+ }, Z, J));
2898
1351
  }
2899
1352
  // TODO: SUI-3402, this can be removed when ControlGroup no longer needs to inspect componentType
2900
- Zr.componentType = "Multiselect";
2901
- Zr.Option = M;
2902
- Zr.Heading = u.Heading;
2903
- Zr.Divider = u.Divider;
2904
- Zr.propTypes = Jr;
2905
- /* harmony default export */ const et = Zr;
1353
+ on.componentType = "Multiselect";
1354
+ on.Option = h;
1355
+ on.Heading = u.Heading;
1356
+ on.Divider = u.Divider;
1357
+ on.propTypes = nn;
1358
+ /* harmony default export */ const an = on;
2906
1359
  // CONCATENATED MODULE: ./src/Multiselect/index.ts
2907
1360
  module.exports = n;
2908
1361
  /******/})();