@splunk/react-ui 5.4.0 → 5.6.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 (89) hide show
  1. package/AnchorMenu.d.ts +2 -0
  2. package/AnchorMenu.js +286 -0
  3. package/Badge.d.ts +2 -0
  4. package/Badge.js +154 -0
  5. package/CHANGELOG.md +42 -0
  6. package/Code.js +1097 -500
  7. package/Color.js +142 -141
  8. package/ComboBox.js +6 -5
  9. package/Link.js +74 -44
  10. package/MIGRATION.md +32 -1
  11. package/Menu.js +41 -43
  12. package/Multiselect.js +615 -2156
  13. package/Number.js +3 -3
  14. package/PhoneNumber.d.ts +2 -0
  15. package/PhoneNumber.js +769 -0
  16. package/Popover.js +73 -75
  17. package/RadioList.js +166 -151
  18. package/ResultsMenu.js +27 -29
  19. package/Select.js +179 -1768
  20. package/SelectBase.d.ts +2 -0
  21. package/SelectBase.js +1714 -0
  22. package/Slider.js +358 -302
  23. package/SlidingPanels.js +55 -62
  24. package/Switch.js +42 -27
  25. package/TabBar.js +295 -294
  26. package/TabLayout.js +14 -14
  27. package/Table.js +1087 -1040
  28. package/TransitionOpen.js +65 -58
  29. package/cypress/support/commands.ts +40 -0
  30. package/cypress/support/component.ts +1 -1
  31. package/cypress/support/index.d.ts +22 -0
  32. package/docker-compose.yml +99 -52
  33. package/package.json +9 -5
  34. package/stubs-splunkui.d.ts +0 -86
  35. package/test-runner-jest.config.js +1 -0
  36. package/types/src/AnchorMenu/AnchorMenu.d.ts +36 -0
  37. package/types/src/AnchorMenu/AnchorMenuContext.d.ts +6 -0
  38. package/types/src/AnchorMenu/Item.d.ts +35 -0
  39. package/types/src/AnchorMenu/docs/examples/Basic.d.ts +6 -0
  40. package/types/src/AnchorMenu/index.d.ts +3 -0
  41. package/types/src/Badge/Badge.d.ts +29 -0
  42. package/types/src/Badge/docs/examples/Basic.d.ts +5 -0
  43. package/types/src/Badge/docs/examples/Count.d.ts +6 -0
  44. package/types/src/Badge/docs/examples/CustomColors.d.ts +8 -0
  45. package/types/src/Badge/docs/examples/Icon.d.ts +6 -0
  46. package/types/src/Badge/index.d.ts +2 -0
  47. package/types/src/Code/Code.d.ts +4 -3
  48. package/types/src/Code/index.d.ts +1 -0
  49. package/types/src/Link/Link.d.ts +4 -0
  50. package/types/src/Link/LinkContext.d.ts +14 -0
  51. package/types/src/Link/docs/examples/Visited.d.ts +7 -0
  52. package/types/src/Link/index.d.ts +1 -0
  53. package/types/src/Menu/Item.d.ts +1 -1
  54. package/types/src/Multiselect/Compact.d.ts +8 -1
  55. package/types/src/Multiselect/Multiselect.d.ts +8 -1
  56. package/types/src/PhoneNumber/PhoneNumber.d.ts +139 -0
  57. package/types/src/PhoneNumber/docs/examples/Controlled.d.ts +7 -0
  58. package/types/src/PhoneNumber/docs/examples/DefaultCountry.d.ts +7 -0
  59. package/types/src/PhoneNumber/docs/examples/Disabled.d.ts +6 -0
  60. package/types/src/PhoneNumber/docs/examples/Error.d.ts +6 -0
  61. package/types/src/PhoneNumber/docs/examples/Inline.d.ts +7 -0
  62. package/types/src/PhoneNumber/docs/examples/Uncontrolled.d.ts +7 -0
  63. package/types/src/PhoneNumber/index.d.ts +2 -0
  64. package/types/src/PhoneNumber/utils.d.ts +47 -0
  65. package/types/src/RadioList/Option.d.ts +6 -1
  66. package/types/src/RadioList/docs/examples/Description.d.ts +6 -0
  67. package/types/src/Select/Option.d.ts +8 -3
  68. package/types/src/Select/Select.d.ts +1 -1
  69. package/types/src/{Select → SelectBase}/OptionBase.d.ts +8 -2
  70. package/types/src/{Select → SelectBase}/SelectBase.d.ts +11 -2
  71. package/types/src/SelectBase/index.d.ts +2 -0
  72. package/types/src/Slider/Slider.d.ts +7 -1
  73. package/types/src/Switch/Switch.d.ts +4 -1
  74. package/types/src/Table/Body.d.ts +6 -1
  75. package/types/src/Table/Cell.d.ts +5 -1
  76. package/types/src/Table/Head.d.ts +6 -2
  77. package/types/src/Table/HeadCell.d.ts +5 -1
  78. package/types/src/Table/Row.d.ts +5 -1
  79. package/types/src/Table/Table.d.ts +20 -1
  80. package/types/src/Table/TableContext.d.ts +1 -0
  81. package/types/src/Table/docs/examples/HorizontalOverflowScroll.d.ts +8 -0
  82. package/types/src/Table/docs/examples/PinActionColumn.d.ts +7 -0
  83. package/types/src/TransitionOpen/TransitionOpen.d.ts +3 -1
  84. package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -0
  85. package/types/src/useRovingFocus/useRovingFocus.d.ts +8 -1
  86. package/usePrevious.d.ts +2 -0
  87. package/useResizeObserver.js +59 -92
  88. package/useRovingFocus.js +96 -41
  89. /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;
1030
- }
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
- }
1040
- 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);
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]);
1509
95
  }
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
96
  }
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
- }));
97
+ return e;
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,
@@ -1840,6 +251,8 @@
1840
251
  isLoadingOptions: i().bool,
1841
252
  labelledBy: i().string,
1842
253
  loadingMessage: i().node,
254
+ /** @private. */
255
+ maxLabelItems: i().number,
1843
256
  menuStyle: i().object,
1844
257
  name: i().string,
1845
258
  noOptionsMessage: i().node,
@@ -1860,173 +273,217 @@
1860
273
  virtualization: i().number
1861
274
  };
1862
275
  // 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" ]);
276
+ var x = {};
277
+ var V = (0, d._)("No matches");
278
+ var N = (0, d._)("Select...");
279
+ function B(e) {
280
+ 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 ? x : B, E = e.name, F = e.noOptionsMessage, I = F === void 0 ? V : F, A = 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
281
  // @docs-props-type CompactPropsBase
1869
- Bn({
282
+ C({
1870
283
  componentName: "Multiselect",
1871
284
  deprecatedPropValue: "buttongroup",
1872
285
  propName: "selectAllAppearance",
1873
- propValue: T
286
+ propValue: W
1874
287
  });
1875
- var W = true;
1876
- if (b != null) {
1877
- W = b;
288
+ var Z = true;
289
+ if (g != null) {
290
+ Z = g;
1878
291
  if (false) {}
1879
292
  } else {
1880
- W = i ? "controlled" : true;
293
+ Z = i ? "controlled" : true;
1881
294
  }
1882
- var U = {
1883
- children: r.Children.toArray(l).map((function(e) {
1884
- if (hn(e)) {
1885
- var n;
1886
- var r = (n = e.key) !== null && n !== void 0 ? n : "".concat(e.props.label, "-").concat(e.props.value);
1887
-
1888
- return t().createElement(C, Nn({
1889
- key: r
1890
- }, e.props, {
1891
- multiple: true
1892
- }));
1893
- }
1894
- return e;
1895
- })),
1896
- filter: W
1897
- };
1898
- if (s != null) {
1899
- U.defaultValues = s;
295
+ var ee = (0, r.useMemo)((function() {
296
+ return {
297
+ children: r.Children.toArray(l).map((function(e) {
298
+ if ((0, f.isOption)(e)) {
299
+ var n;
300
+ var r = (n = e.key) !== null && n !== void 0 ? n : "".concat(e.props.label, "-").concat(e.props.value);
301
+
302
+ return t().createElement(f.Option, M({
303
+ key: r
304
+ }, e.props, {
305
+ multiple: true
306
+ }));
307
+ }
308
+ return e;
309
+ })),
310
+ filter: Z
311
+ };
312
+ }), [ l, Z ]);
313
+ if (c != null) {
314
+ ee.defaultValues = c;
1900
315
  }
1901
- if (H != null) {
1902
- U.values = H;
316
+ if (J != null) {
317
+ ee.values = J;
1903
318
  }
1904
319
 
1905
- return t().createElement(Mn, Nn({
320
+ return t().createElement(p(), M({
1906
321
  allowNewValues: n,
1907
322
  animateLoading: o,
1908
323
  append: a,
1909
324
  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, {
325
+ disabled: v,
326
+ defaultPlacement: s,
327
+ elementRef: b,
328
+ error: m,
329
+ footerMessage: y,
330
+ inline: h,
331
+ inputId: O,
332
+ inputRef: w,
333
+ isLoadingOptions: S,
334
+ labelledBy: k,
335
+ loadingMessage: j,
336
+ menuStyle: R,
337
+ name: E,
338
+ noOptionsMessage: I,
339
+ onChange: A,
340
+ onClose: q,
341
+ onFilterChange: D,
342
+ onOpen: L,
343
+ onScroll: T,
344
+ onScrollBottom: _,
345
+ placeholder: $,
346
+ prepend: z,
347
+ repositionMode: K,
348
+ selectAllAppearance: W,
349
+ showSelectedValuesFirst: G,
350
+ tabConfirmsNewValue: X,
351
+ virtualization: Q
352
+ }, Y, ee, {
1938
353
  multiple: true
1939
354
  }));
1940
355
  }
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;
356
+ B.propTypes = j;
357
+ B.Option = h;
358
+ B.Divider = u.Divider;
359
+ B.Heading = u.Heading;
360
+ /* harmony default export */ const R = B;
1946
361
  // CONCATENATED MODULE: external "lodash/defer"
1947
- const Hn = require("lodash/defer");
1948
- var $n = e.n(Hn);
362
+ const E = require("lodash/defer");
363
+ var F = e.n(E);
1949
364
  // CONCATENATED MODULE: external "lodash/get"
1950
- const zn = require("lodash/get");
1951
- var Wn = e.n(zn);
365
+ const I = require("lodash/get");
366
+ var A = e.n(I);
1952
367
  // CONCATENATED MODULE: external "lodash/isString"
1953
- const Un = require("lodash/isString");
1954
- var Xn = e.n(Un);
368
+ const q = require("lodash/isString");
369
+ var D = e.n(q);
1955
370
  // CONCATENATED MODULE: external "lodash/keys"
1956
- const Gn = require("lodash/keys");
1957
- var Jn = e.n(Gn);
371
+ const L = require("lodash/keys");
372
+ var T = e.n(L);
1958
373
  // CONCATENATED MODULE: external "lodash/last"
1959
- const Qn = require("lodash/last");
1960
- var Yn = e.n(Qn);
374
+ const _ = require("lodash/last");
375
+ var H = e.n(_);
376
+ // CONCATENATED MODULE: external "lodash/memoize"
377
+ const $ = require("lodash/memoize");
378
+ var z = e.n($);
1961
379
  // CONCATENATED MODULE: external "lodash/omit"
1962
- const Zn = require("lodash/omit");
1963
- var er = e.n(Zn);
380
+ const K = require("lodash/omit");
381
+ var W = e.n(K);
1964
382
  // CONCATENATED MODULE: external "lodash/pickBy"
1965
- const nr = require("lodash/pickBy");
1966
- var rr = e.n(nr);
383
+ const U = require("lodash/pickBy");
384
+ var G = e.n(U);
385
+ // CONCATENATED MODULE: external "lodash/without"
386
+ const X = require("lodash/without");
387
+ var J = e.n(X);
1967
388
  // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
1968
- const tr = require("@splunk/react-ui/Popover");
1969
- var or = e.n(tr);
389
+ const Q = require("@splunk/react-ui/Popover");
390
+ var Y = e.n(Q);
391
+ // CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
392
+ const Z = require("@splunk/react-ui/ResultsMenu");
393
+ var ee = e.n(Z);
394
+ // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
395
+ const ne = require("@splunk/react-ui/ScreenReaderContent");
396
+ var re = e.n(ne);
397
+ // CONCATENATED MODULE: external "@splunk/ui-utils/filter"
398
+ const te = require("@splunk/ui-utils/filter");
1970
399
  // CONCATENATED MODULE: external "@splunk/ui-utils/format"
1971
- const ar = require("@splunk/ui-utils/format");
400
+ const oe = require("@splunk/ui-utils/format");
401
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
402
+ const ae = require("@splunk/ui-utils/id");
403
+ // CONCATENATED MODULE: external "@splunk/ui-utils/scroll"
404
+ const le = require("@splunk/ui-utils/scroll");
405
+ // CONCATENATED MODULE: external "styled-components"
406
+ const ie = require("styled-components");
407
+ var ue = e.n(ie);
1972
408
  // CONCATENATED MODULE: external "@splunk/react-ui/Box"
1973
- const lr = require("@splunk/react-ui/Box");
1974
- var ir = e.n(lr);
409
+ const se = require("@splunk/react-ui/Box");
410
+ var ce = e.n(se);
1975
411
  // CONCATENATED MODULE: external "@splunk/react-ui/Chip"
1976
- const ur = require("@splunk/react-ui/Chip");
1977
- var cr = e.n(ur);
412
+ const de = require("@splunk/react-ui/Chip");
413
+ var fe = e.n(de);
414
+ // CONCATENATED MODULE: external "@splunk/themes"
415
+ const pe = require("@splunk/themes");
1978
416
  // CONCATENATED MODULE: ./src/Multiselect/NormalStyles.ts
1979
- var sr = ke()(ir()).withConfig({
417
+ var ve = ue()(ce()).withConfig({
1980
418
  displayName: "NormalStyles__StyledBox",
1981
419
  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) {
420
+ })([ "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
421
  var n = e.$append;
1984
- return n && (0, Ce.css)([ "border-start-end-radius:0;border-end-end-radius:0;border-inline-end:none;" ]);
422
+ return n && (0, ie.css)([ "border-start-end-radius:0;border-end-end-radius:0;border-inline-end:none;" ]);
1985
423
  }), (function(e) {
1986
424
  var n = e.$prepend;
1987
- return n && (0, Ce.css)([ "border-start-start-radius:0;border-end-start-radius:0;" ]);
425
+ return n && (0, ie.css)([ "border-start-start-radius:0;border-end-start-radius:0;" ]);
1988
426
  }), (function(e) {
1989
427
  var n = e.$hasFocus;
1990
- return n && (0, Ce.css)([ "box-shadow:", ";" ], Me.variables.focusShadow);
428
+ return n && (0, ie.css)([ "box-shadow:", ";" ], pe.variables.focusShadow);
1991
429
  }), (function(e) {
1992
430
  var n = e.$error;
1993
- return n && (0, Ce.css)([ "border-color:", ";&:hover:not([disabled]){border-color:", ";}" ], Me.variables.interactiveColorAccentError, Me.variables.interactiveColorAccentErrorStrong);
431
+ return n && (0, ie.css)([ "border-color:", ";&:hover:not([disabled]){border-color:", ";}" ], pe.variables.interactiveColorAccentError, pe.variables.interactiveColorAccentErrorStrong);
1994
432
  }), (function(e) {
1995
433
  var n = e.$disabled;
1996
- return n && (0, Ce.css)([ "border-color:", ";background-color:", ";cursor:not-allowed;" ], Me.variables.interactiveColorBorderDisabled, Me.variables.interactiveColorBackgroundDisabled);
434
+ return n && (0, ie.css)([ "border-color:", ";background-color:", ";cursor:not-allowed;" ], pe.variables.interactiveColorBorderDisabled, pe.variables.interactiveColorBackgroundDisabled);
1997
435
  }), (function(e) {
1998
436
  var n = e.$disabled, r = e.$hasFocus;
1999
- return !n && !r && (0, Ce.css)([ "&:hover{border-color:", ";}" ], Me.variables.interactiveColorBorderHover);
437
+ return !n && !r && (0, ie.css)([ "&:hover{border-color:", ";}" ], pe.variables.interactiveColorBorderHover);
2000
438
  }), (function(e) {
2001
439
  var n = e.$popoverOpen;
2002
- return n && (0, Ce.css)([ "position:relative;z-index:calc(", " - 2);" ], Me.variables.zindexFixedNavbar);
440
+ return n && (0, ie.css)([ "position:relative;z-index:calc(", " - 2);" ], pe.variables.zindexFixedNavbar);
2003
441
  }));
2004
- var dr = ke().span.withConfig({
442
+ var be = ue().span.withConfig({
2005
443
  displayName: "NormalStyles__StyledButtonsWrapper",
2006
444
  componentId: "sc-1uwwpco-1"
2007
445
  })([ "display:contents;" ]);
2008
- var fr = ke().input.withConfig({
446
+ var me = ue().input.withConfig({
2009
447
  displayName: "NormalStyles__StyledInput",
2010
448
  componentId: "sc-1uwwpco-2"
2011
- })([ "", ";flex:1 0 auto;max-width:100%;" ], Me.mixins.reset("block"));
2012
- var pr = ke()(cr()).withConfig({
449
+ })([ "", ";flex:1 0 auto;max-width:100%;" ], pe.mixins.reset("block"));
450
+ var ge = ue()(fe()).withConfig({
2013
451
  displayName: "NormalStyles__StyledChip",
2014
452
  componentId: "sc-1uwwpco-3"
2015
453
  })([ "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);
454
+ pe.pick)({
455
+ compact: (0, ie.css)([ "padding-block:2px;" ])
456
+ }), pe.variables.focusShadowInset);
457
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
458
+ /**
459
+ * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
460
+ *
461
+ * @param ref - The React callback or object ref. Can be `null` or `undefined`.
462
+ * @param current - The new value of the ref.
463
+ */
464
+ function ye(e, n) {
465
+ if (e) {
466
+ if (typeof e === "function") {
467
+ e(n);
468
+ } else {
469
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
470
+ // the intention here is to signal "we will take care of setting 'current', not you".
471
+ e.current = n;
472
+ // eslint-disable-line no-param-reassign
473
+ }
474
+ }
475
+ }
2019
476
  // CONCATENATED MODULE: ./src/Multiselect/Normal.tsx
2020
- function vr(e) {
477
+ function he(e) {
2021
478
  "@babel/helpers - typeof";
2022
- return vr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
479
+ return he = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
2023
480
  return typeof e;
2024
481
  } : function(e) {
2025
482
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2026
- }, vr(e);
483
+ }, he(e);
2027
484
  }
2028
- function br() {
2029
- return br = Object.assign ? Object.assign.bind() : function(e) {
485
+ function Oe() {
486
+ return Oe = Object.assign ? Object.assign.bind() : function(e) {
2030
487
  for (var n = 1; n < arguments.length; n++) {
2031
488
  var r = arguments[n];
2032
489
  for (var t in r) {
@@ -2034,44 +491,44 @@
2034
491
  }
2035
492
  }
2036
493
  return e;
2037
- }, br.apply(null, arguments);
494
+ }, Oe.apply(null, arguments);
2038
495
  }
2039
- function mr(e) {
2040
- return hr(e) || gr(e) || wr(e) || yr();
496
+ function we(e) {
497
+ return Me(e) || Ce(e) || je(e) || Se();
2041
498
  }
2042
- function yr() {
499
+ function Se() {
2043
500
  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
501
  }
2045
- function gr(e) {
502
+ function Ce(e) {
2046
503
  if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
2047
504
  }
2048
- function hr(e) {
2049
- if (Array.isArray(e)) return Cr(e);
505
+ function Me(e) {
506
+ if (Array.isArray(e)) return xe(e);
2050
507
  }
2051
- function Or(e, n) {
2052
- return jr(e) || kr(e, n) || wr(e, n) || Sr();
508
+ function Pe(e, n) {
509
+ return Ne(e) || Ve(e, n) || je(e, n) || ke();
2053
510
  }
2054
- function Sr() {
511
+ function ke() {
2055
512
  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
513
  }
2057
- function wr(e, n) {
514
+ function je(e, n) {
2058
515
  if (e) {
2059
- if ("string" == typeof e) return Cr(e, n);
516
+ if ("string" == typeof e) return xe(e, n);
2060
517
  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;
518
+ 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) ? xe(e, n) : void 0;
2062
519
  }
2063
520
  }
2064
- function Cr(e, n) {
521
+ function xe(e, n) {
2065
522
  (null == n || n > e.length) && (n = e.length);
2066
523
  for (var r = 0, t = Array(n); r < n; r++) {
2067
524
  t[r] = e[r];
2068
525
  }
2069
526
  return t;
2070
527
  }
2071
- function kr(e, n) {
528
+ function Ve(e, n) {
2072
529
  var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
2073
530
  if (null != r) {
2074
- var t, o, a, l, i = [], u = !0, c = !1;
531
+ var t, o, a, l, i = [], u = !0, s = !1;
2075
532
  try {
2076
533
  if (a = (r = r.call(e)).next, 0 === n) {
2077
534
  if (Object(r) !== r) return;
@@ -2079,23 +536,23 @@
2079
536
  } else for (;!(u = (t = a.call(r)).done) && (i.push(t.value), i.length !== n); u = !0) {
2080
537
  }
2081
538
  } catch (e) {
2082
- c = !0, o = e;
539
+ s = !0, o = e;
2083
540
  } finally {
2084
541
  try {
2085
542
  if (!u && null != r["return"] && (l = r["return"](), Object(l) !== l)) return;
2086
543
  } finally {
2087
- if (c) throw o;
544
+ if (s) throw o;
2088
545
  }
2089
546
  }
2090
547
  return i;
2091
548
  }
2092
549
  }
2093
- function jr(e) {
550
+ function Ne(e) {
2094
551
  if (Array.isArray(e)) return e;
2095
552
  }
2096
- function xr(e, n) {
553
+ function Be(e, n) {
2097
554
  if (null == e) return {};
2098
- var r, t, o = Pr(e, n);
555
+ var r, t, o = Re(e, n);
2099
556
  if (Object.getOwnPropertySymbols) {
2100
557
  var a = Object.getOwnPropertySymbols(e);
2101
558
  for (t = 0; t < a.length; t++) {
@@ -2104,7 +561,7 @@
2104
561
  }
2105
562
  return o;
2106
563
  }
2107
- function Pr(e, n) {
564
+ function Re(e, n) {
2108
565
  if (null == e) return {};
2109
566
  var r = {};
2110
567
  for (var t in e) {
@@ -2115,7 +572,7 @@
2115
572
  }
2116
573
  return r;
2117
574
  }
2118
- function Er(e, n) {
575
+ function Ee(e, n) {
2119
576
  var r = Object.keys(e);
2120
577
  if (Object.getOwnPropertySymbols) {
2121
578
  var t = Object.getOwnPropertySymbols(e);
@@ -2125,40 +582,40 @@
2125
582
  }
2126
583
  return r;
2127
584
  }
2128
- function Mr(e) {
585
+ function Fe(e) {
2129
586
  for (var n = 1; n < arguments.length; n++) {
2130
587
  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) {
588
+ n % 2 ? Ee(Object(r), !0).forEach((function(n) {
589
+ Ie(e, n, r[n]);
590
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ee(Object(r)).forEach((function(n) {
2134
591
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
2135
592
  }));
2136
593
  }
2137
594
  return e;
2138
595
  }
2139
- function Rr(e, n, r) {
2140
- return (n = Ar(n)) in e ? Object.defineProperty(e, n, {
596
+ function Ie(e, n, r) {
597
+ return (n = Ae(n)) in e ? Object.defineProperty(e, n, {
2141
598
  value: r,
2142
599
  enumerable: !0,
2143
600
  configurable: !0,
2144
601
  writable: !0
2145
602
  }) : e[n] = r, e;
2146
603
  }
2147
- function Ar(e) {
2148
- var n = Ir(e, "string");
2149
- return "symbol" == vr(n) ? n : n + "";
604
+ function Ae(e) {
605
+ var n = qe(e, "string");
606
+ return "symbol" == he(n) ? n : n + "";
2150
607
  }
2151
- function Ir(e, n) {
2152
- if ("object" != vr(e) || !e) return e;
608
+ function qe(e, n) {
609
+ if ("object" != he(e) || !e) return e;
2153
610
  var r = e[Symbol.toPrimitive];
2154
611
  if (void 0 !== r) {
2155
612
  var t = r.call(e, n || "default");
2156
- if ("object" != vr(t)) return t;
613
+ if ("object" != he(t)) return t;
2157
614
  throw new TypeError("@@toPrimitive must return a primitive value.");
2158
615
  }
2159
616
  return ("string" === n ? String : Number)(e);
2160
617
  }
2161
- var Br = {
618
+ var De = {
2162
619
  allowNewValues: i().bool,
2163
620
  animateLoading: i().bool,
2164
621
  append: i().bool,
@@ -2194,29 +651,29 @@
2194
651
  tabConfirmsNewValue: i().bool,
2195
652
  values: i().array
2196
653
  };
2197
- var Nr = T()((function(e) {
654
+ var Le = z()((function(e) {
2198
655
  return {
2199
656
  flexBasis: e,
2200
657
  width: e
2201
658
  };
2202
659
  }));
2203
660
  // export for testing purpose
2204
- var Vr = T()((function(e) {
661
+ var Te = z()((function(e) {
2205
662
  var n = e.anchorWidth, r = n === void 0 ? 0 : n, t = e.maxHeight, o = e.menuStyle;
2206
- return Mr({
663
+ return Fe({
2207
664
  maxHeight: t,
2208
665
  overflow: "auto",
2209
666
  width: Math.max(r, 200)
2210
667
  }, o || {});
2211
668
  }));
2212
669
  // 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" ]);
670
+ var _e = {};
671
+ var He = (0, d._)("No matches");
672
+ var $e = (0, d._)("Select...");
673
+ function ze(e) {
674
+ 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, x = e.name, V = e.noOptionsMessage, N = V === void 0 ? He : V, B = e.onChange, R = e.onClose, E = e.onFilterChange, I = 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
675
  // @docs-props-type NormalPropsBase
2219
- var W = s()({
676
+ var ne = c()({
2220
677
  componentName: "Multiselect",
2221
678
  /* eslint-disable-next-line prefer-rest-params */
2222
679
  componentProps: arguments[0],
@@ -2225,254 +682,254 @@
2225
682
  valuePropName: "values"
2226
683
  });
2227
684
  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() {
685
+ var ie = (0, r.useState)(0), ue = Pe(ie, 2), se = ue[0], ce = ue[1];
686
+ var de = (0, r.useState)(null), fe = Pe(de, 2), pe = fe[0], he = fe[1];
687
+ var Se = (0, r.useState)(""), Ce = Pe(Se, 2), Me = Ce[0], ke = Ce[1];
688
+ var je = (0, r.useState)(false), xe = Pe(je, 2), Ve = xe[0], Ne = xe[1];
689
+ var Re = (0, r.useState)(false), Ee = Pe(Re, 2), Ie = Ee[0], Ae = Ee[1];
690
+ var qe = (0, r.useState)(p || []), De = Pe(qe, 2), ze = De[0], Ke = De[1];
691
+ var We = (0, r.useState)(""), Ue = Pe(We, 2), Ge = Ue[0], Xe = Ue[1];
692
+ var Je = ne && Q ? Q : ze;
693
+ var Qe = Je.slice(0);
694
+ var Ye = Je.indexOf(Me) >= 0;
695
+ var Ze = (0, r.useRef)(null);
696
+ var en = (0, r.useRef)(null);
697
+ var nn = (0, r.useRef)(undefined);
698
+ var rn = (0, r.useRef)(0);
699
+ var tn = (0, r.useState)((function() {
2243
700
  return {
2244
- activeItemId: (0, ce.createDOMID)("active-item"),
2245
- popoverId: (0, ce.createDOMID)("popover")
701
+ activeItemId: (0, ae.createDOMID)("active-item"),
702
+ popoverId: (0, ae.createDOMID)("popover")
2246
703
  };
2247
- })), Ne = Or(Be, 1), Ve = Ne[0], De = Ve.activeItemId, Le = Ve.popoverId;
704
+ })), on = Pe(tn, 1), an = on[0], ln = an.activeItemId, un = an.popoverId;
2248
705
  (0, r.useEffect)((function() {
2249
- if (W) {
2250
- le("");
2251
- J(0);
706
+ if (ne) {
707
+ ke("");
708
+ ce(0);
2252
709
  }
2253
- }), [ H, W ]);
710
+ }), [ Q, ne ]);
2254
711
  // 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
712
  (0, r.useEffect)((function() {
2256
- Re.current = G;
2257
- }), [ G ]);
2258
- var qe = (0, r.useCallback)((function(e) {
713
+ en.current = se;
714
+ }), [ se ]);
715
+ var sn = (0, r.useCallback)((function(e) {
2259
716
  var n = e.resetFilterKeyword;
2260
- if (!me) {
2261
- le((function(e) {
717
+ if (!Ie) {
718
+ ke((function(e) {
2262
719
  return n ? "" : e;
2263
720
  }));
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({
721
+ Ne(true);
722
+ Ae(true);
723
+ L === null || L === void 0 ? void 0 : L();
724
+ }
725
+ }), [ Ie, L ]);
726
+ var cn = (0, r.useCallback)((function() {
727
+ if (Ve) {
728
+ sn({
2272
729
  resetFilterKeyword: false
2273
730
  });
2274
731
  } else {
2275
732
  var e;
2276
- (e = Me.current) === null || e === void 0 ? void 0 : e.focus();
733
+ (e = Ze.current) === null || e === void 0 ? void 0 : e.focus();
2277
734
  }
2278
- }), [ fe, qe ]);
2279
- var Fe = (0, r.useCallback)((function(e, n) {
2280
- if (!me) {
735
+ }), [ Ve, sn ]);
736
+ var dn = (0, r.useCallback)((function(e, n) {
737
+ if (!Ie) {
2281
738
  return;
2282
739
  }
2283
- var r = (xe || []).concat([ n ]);
2284
- if (!W) {
2285
- Se(r);
2286
- J(0);
2287
- ye(true);
2288
- le("");
740
+ var r = (Je || []).concat([ n ]);
741
+ if (!ne) {
742
+ Ke(r);
743
+ ce(0);
744
+ Ae(true);
745
+ ke("");
2289
746
  }
2290
- A === null || A === void 0 ? void 0 : A(e, {
747
+ B === null || B === void 0 ? void 0 : B(e, {
2291
748
  values: r,
2292
- name: P
749
+ name: x
2293
750
  });
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);
751
+ }), [ Ie, Je, ne, B, x ]);
752
+ var fn = (0, r.useCallback)((function(e, n) {
753
+ var r = J()(Je, n);
754
+ if (!ne) {
755
+ Ke(r);
2299
756
  }
2300
- A === null || A === void 0 ? void 0 : A(e, {
757
+ B === null || B === void 0 ? void 0 : B(e, {
2301
758
  values: r,
2302
- name: P
759
+ name: x
2303
760
  });
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) {
761
+ }), [ Je, ne, x, B ]);
762
+ var pn = (0, r.useCallback)((function(e) {
763
+ if (Ie && !C) {
764
+ q === null || q === void 0 ? void 0 : q(e);
765
+ Xe("".concat(rn.current, " options, loading more options"));
766
+ }
767
+ }), [ Ie, C, q ]);
768
+ var vn = (0, r.useCallback)((function(e, n) {
2312
769
  var r = n.value;
2313
- $n()((function() {
2314
- return _e(e, r);
770
+ F()((function() {
771
+ return fn(e, r);
2315
772
  }));
2316
- }), [ _e ]);
2317
- var $e = (0, r.useCallback)((function(e) {
2318
- if (ae !== "") {
2319
- B === null || B === void 0 ? void 0 : B(e, {
773
+ }), [ fn ]);
774
+ var bn = (0, r.useCallback)((function(e) {
775
+ if (Me !== "") {
776
+ E === null || E === void 0 ? void 0 : E(e, {
2320
777
  keyword: ""
2321
778
  });
2322
779
  }
2323
- qe({
780
+ sn({
2324
781
  resetFilterKeyword: true
2325
782
  });
2326
- }), [ ae, B, qe ]);
2327
- var ze = (0, r.useCallback)((function(e) {
783
+ }), [ Me, E, sn ]);
784
+ var mn = (0, r.useCallback)((function(e) {
2328
785
  var n;
2329
786
  var t = e.key;
2330
- if (t === "Tab" && me) {
2331
- if (K && Ae.current !== undefined && Ie.current <= 1) {
787
+ if (t === "Tab" && Ie) {
788
+ if (X && nn.current !== undefined && rn.current <= 1) {
2332
789
  var o;
2333
790
  e.preventDefault();
2334
- Fe(e, Ae.current);
2335
- (o = Me.current) === null || o === void 0 ? void 0 : o.focus();
791
+ dn(e, nn.current);
792
+ (o = Ze.current) === null || o === void 0 ? void 0 : o.focus();
2336
793
  } else {
2337
- ye(false);
794
+ Ae(false);
2338
795
  }
2339
796
  }
2340
797
  if (e.shiftKey || e.metaKey || e.ctrlKey) {
2341
798
  return;
2342
799
  }
2343
- if (t === "End" && me) {
800
+ if (t === "End" && Ie) {
2344
801
  e.preventDefault();
2345
- J(Ie.current - 1);
802
+ ce(rn.current - 1);
2346
803
  }
2347
- if (t === "Home" && me) {
804
+ if (t === "Home" && Ie) {
2348
805
  e.preventDefault();
2349
- J(0);
806
+ ce(0);
2350
807
  }
2351
808
  if (t === "ArrowDown") {
2352
809
  e.preventDefault();
2353
- if (me) {
2354
- J((function(e) {
2355
- return Math.min(e + 1, Ie.current - 1);
810
+ if (Ie) {
811
+ ce((function(e) {
812
+ return Math.min(e + 1, rn.current - 1);
2356
813
  }));
2357
814
  } else {
2358
- J(0);
2359
- ye(true);
815
+ ce(0);
816
+ Ae(true);
2360
817
  }
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);
818
+ if (i && q) {
819
+ var a = r.Children.toArray(i).length - (2 + ((Je === null || Je === void 0 ? void 0 : Je.length) || 0));
820
+ if (se === a) {
821
+ pn(e);
2365
822
  }
2366
823
  }
2367
824
  }
2368
825
  if (t === "ArrowUp") {
2369
826
  e.preventDefault();
2370
- if (me) {
2371
- J((function(e) {
827
+ if (Ie) {
828
+ ce((function(e) {
2372
829
  return Math.max(e - 1, 0);
2373
830
  }));
2374
831
  } else {
2375
- J(0);
2376
- ye(true);
832
+ ce(0);
833
+ Ae(true);
2377
834
  }
2378
835
  }
2379
- if (t === "Enter" && Ae.current !== undefined && me) {
2380
- Fe(e, Ae.current);
836
+ if (t === "Enter" && nn.current !== undefined && Ie) {
837
+ dn(e, nn.current);
2381
838
  }
2382
- if (t === "Backspace" && ((n = Me.current) === null || n === void 0 ? void 0 : n.value) === "" && xe.length) {
2383
- _e(e, Yn()(xe));
839
+ if (t === "Backspace" && ((n = Ze.current) === null || n === void 0 ? void 0 : n.value) === "" && Je.length) {
840
+ fn(e, H()(Je));
2384
841
  }
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, {
842
+ }), [ Ie, Je, X, dn, i, q, se, pn, fn ]);
843
+ var gn = (0, r.useCallback)((function(e) {
844
+ ke(e.target.value);
845
+ Ae(true);
846
+ ce(0);
847
+ E === null || E === void 0 ? void 0 : E(e, {
2391
848
  keyword: e.target.value
2392
849
  });
2393
- }), [ B ]);
2394
- var Ue = (0, r.useCallback)((function(e, n) {
850
+ }), [ E ]);
851
+ var yn = (0, r.useCallback)((function(e, n) {
2395
852
  var r;
2396
853
  var t = n.value;
2397
854
  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);
855
+ dn(e, t);
856
+ (r = Ze.current) === null || r === void 0 ? void 0 : r.focus();
857
+ }), [ dn ]);
858
+ var hn = (0, r.useCallback)((function(e) {
859
+ var n = document.getElementById(un);
2403
860
  var r = e.relatedTarget || document.activeElement;
2404
861
  // IE11 doesn't support relatedTarget but sets activeElement
2405
862
  var t = n && r && n.contains(r);
2406
863
  // TS: target as Node is an unsafe assumption
2407
- le(t ? ae : "");
2408
- pe(false);
864
+ ke(t ? Me : "");
865
+ Ne(false);
2409
866
  if (!t) {
2410
- B === null || B === void 0 ? void 0 : B(e, {
867
+ E === null || E === void 0 ? void 0 : E(e, {
2411
868
  keyword: ""
2412
869
  });
2413
870
  }
2414
- }), [ ae, B, Le ]);
2415
- var Je = (0, r.useCallback)((function(e) {
871
+ }), [ Me, E, un ]);
872
+ var On = (0, r.useCallback)((function(e) {
2416
873
  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();
874
+ if (n === "escapeKey" || n === "offScreen" || n === "clickAway" && r !== undefined && !(pe === null || pe === void 0 ? void 0 : pe.contains(r.target))) {
875
+ Ae(false);
876
+ en.current = null;
877
+ R === null || R === void 0 ? void 0 : R();
2421
878
  }
2422
879
  if (n === "escapeKey") {
2423
880
  var t;
2424
- (t = Me.current) === null || t === void 0 ? void 0 : t.focus();
881
+ (t = Ze.current) === null || t === void 0 ? void 0 : t.focus();
2425
882
  }
2426
- }), [ Z, I ]);
2427
- var Qe = (0, r.useCallback)((function(e) {
2428
- ee(e);
2429
- Xe(m, e);
883
+ }), [ pe, R ]);
884
+ var wn = (0, r.useCallback)((function(e) {
885
+ he(e);
886
+ ye(m, e);
2430
887
  }), [ m ]);
2431
- var Ye = (0, r.useCallback)((function(e) {
2432
- Me.current = e;
2433
- Xe(S, e);
888
+ var Sn = (0, r.useCallback)((function(e) {
889
+ Ze.current = e;
890
+ ye(S, e);
2434
891
  }), [ S ]);
2435
- var Ze = (0, r.useCallback)((function(e) {
2436
- if (Re.current !== G) {
2437
- (0, se.scrollIntoViewIfNeeded)(e);
892
+ var Cn = (0, r.useCallback)((function(e) {
893
+ if (en.current !== se) {
894
+ (0, le.scrollIntoViewIfNeeded)(e);
2438
895
  }
2439
- }), [ G ]);
2440
- var en = (0, r.useCallback)((function(e) {
896
+ }), [ se ]);
897
+ var Mn = (0, r.useCallback)((function(e) {
2441
898
  // selectedOptions may contain items or unmatched values at this point
2442
899
  return e.map((function(e) {
2443
900
  var n = e;
2444
901
  // TS: faking props here
2445
902
  var r = n.props;
2446
903
  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;
904
+ var o = r.children, a = r.icon, l = r.label, i = r.selectedAppearance, u = r.selectedBackgroundColor, s = r.selectedForegroundColor, c = r.value;
2448
905
 
2449
- return t().createElement(pr, {
906
+ return t().createElement(ge, {
2450
907
  "aria-selected": true,
2451
908
  disabled: b,
2452
909
  icon: a,
2453
- key: s.toString(),
910
+ key: c.toString(),
2454
911
  "data-test": "selected-option",
2455
- onRequestRemove: He,
912
+ onRequestRemove: vn,
2456
913
  role: "option",
2457
- value: s,
914
+ value: c,
2458
915
  appearance: i,
2459
916
  backgroundColor: u,
2460
- foregroundColor: c
917
+ foregroundColor: s
2461
918
  }, o || l);
2462
919
  }
2463
920
 
2464
- return t().createElement(pr, {
921
+ return t().createElement(ge, {
2465
922
  "aria-selected": true,
2466
923
  disabled: b,
2467
- key: (0, ce.createGUID)(),
924
+ key: (0, ae.createGUID)(),
2468
925
  "data-test": "selected-option",
2469
- onRequestRemove: He,
926
+ onRequestRemove: vn,
2470
927
  role: "option",
2471
928
  value: n
2472
929
  }, n);
2473
930
  }));
2474
- }), [ b, He ]);
2475
- var nn = function e(n) {
931
+ }), [ b, vn ]);
932
+ var Pn = function e(n) {
2476
933
  return n.map((function(e) {
2477
934
  var n = e;
2478
935
  // TS: faking props here
@@ -2481,82 +938,82 @@
2481
938
 
2482
939
  return t().createElement("span", {
2483
940
  key: r.value.toString()
2484
- }, r.children || r.label, (0, ar.sprintf)((0, d._)(" selected")));
941
+ }, r.children || r.label, (0, oe.sprintf)((0, d._)(" selected")));
2485
942
  }
2486
943
 
2487
944
  return t().createElement("span", {
2488
- key: (0, ce.createGUID)()
2489
- }, t().createElement(t().Fragment, null, n, (0, ar.sprintf)((0, d._)(" selected"))));
945
+ key: (0, ae.createGUID)()
946
+ }, t().createElement(t().Fragment, null, n, (0, oe.sprintf)((0, d._)(" selected"))));
2490
947
  }));
2491
948
  };
2492
949
  // Map Options to selected values
2493
- if (xe && xe.length) {
950
+ if (Je && Je.length) {
2494
951
  r.Children.toArray(i).filter(r.isValidElement).filter((function(e) {
2495
- return e.type === M;
952
+ return e.type === h;
2496
953
  })).forEach((function(e) {
2497
- if (e.type === M) {
2498
- var n = xe.indexOf(e.props.value);
954
+ if (e.type === h) {
955
+ var n = Je.indexOf(e.props.value);
2499
956
  if (n !== -1) {
2500
- Pe[n] = e;
957
+ Qe[n] = e;
2501
958
  }
2502
959
  }
2503
960
  }));
2504
961
  }
2505
962
  // 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);
963
+ var kn = (0, te.stringToKeywords)(Me);
964
+ var jn = u ? r.Children.toArray(i) : r.Children.toArray(i).filter((function(e) {
965
+ if (A()(e, [ "props", "label" ], false)) {
966
+ return (0, te.testPhrase)(e.props.label, kn);
2510
967
  }
2511
968
  return true;
2512
969
  // Keep all headers and non-interactive options
2513
970
  }));
2514
- Ie.current = 0;
2515
- Ae.current = undefined;
2516
- var on = r.Children.map(tn, (function(e, n) {
971
+ rn.current = 0;
972
+ nn.current = undefined;
973
+ var xn = r.Children.map(jn, (function(e, n) {
2517
974
  var t = e.props;
2518
975
  if (!t || !a()(t, "value")) {
2519
976
  // ignore Headings and Dividers
2520
977
  return e;
2521
978
  }
2522
979
  var o = e;
2523
- var l = o.props, i = l.children, c = l.label, s = l.matchRanges, d = l.value;
980
+ var l = o.props, i = l.children, s = l.label, c = l.matchRanges, d = l.value;
2524
981
  // find out if the search string exactly matches a value
2525
- if (d === ae) {
2526
- Ee = true;
982
+ if (d === Me) {
983
+ Ye = true;
2527
984
  }
2528
985
  // remove items that are already selected
2529
- var f = xe.indexOf(d);
986
+ var f = Je.indexOf(d);
2530
987
  if (f >= 0) {
2531
988
  return null;
2532
989
  }
2533
990
  // highlight matched text
2534
- var p = i === undefined || Xn()(i);
2535
- var v = p && !u && !s && rn && (0, ue.keywordLocations)(c, rn);
991
+ var p = i === undefined || D()(i);
992
+ var v = p && !u && !c && kn && (0, te.keywordLocations)(s, kn);
2536
993
  // clone item
2537
994
  var b = (0, r.cloneElement)(o, {
2538
995
  // eslint-disable-next-line react/no-array-index-key
2539
996
  key: n,
2540
- onClick: Ue,
2541
- matchRanges: p && (s || v) || undefined
997
+ onClick: yn,
998
+ matchRanges: p && (c || v) || undefined
2542
999
  });
2543
1000
  return b;
2544
1001
  })).filter((function(e) {
2545
1002
  return e !== null;
2546
1003
  })) || [];
2547
1004
  // Add the option to add the new value
2548
- if (n && !Ee && ae) {
2549
- on.unshift( t().createElement(M, {
2550
- label: "".concat(ae),
1005
+ if (n && !Ye && Me) {
1006
+ xn.unshift( t().createElement(h, {
1007
+ label: "".concat(Me),
2551
1008
  description: (0, d._)("(New value)"),
2552
1009
  descriptionPosition: "right",
2553
- value: ae,
1010
+ value: Me,
2554
1011
  key: "newValue",
2555
- onClick: Ue
1012
+ onClick: yn
2556
1013
  }));
2557
1014
  }
2558
1015
  // highlight the selected Item
2559
- var an = r.Children.map(on, (function(e) {
1016
+ var Vn = r.Children.map(xn, (function(e) {
2560
1017
  var n = e.props;
2561
1018
  if (!n || !a()(n, "value")) {
2562
1019
  // ignore Headings and Dividers
@@ -2564,136 +1021,136 @@
2564
1021
  }
2565
1022
  var t = e;
2566
1023
  var o = t.props, l = o.disabled, i = o.value;
2567
- var u = Ie.current === G;
2568
- Ie.current += 1;
1024
+ var u = rn.current === se;
1025
+ rn.current += 1;
2569
1026
  if (!u) {
2570
1027
  return t;
2571
1028
  }
2572
1029
  if (!l) {
2573
- Ae.current = i;
1030
+ nn.current = i;
2574
1031
  }
2575
- var c = (0, r.cloneElement)(t, {
1032
+ var s = (0, r.cloneElement)(t, {
2576
1033
  active: u,
2577
- id: De,
1034
+ id: ln,
2578
1035
  elementRef: function e(n) {
2579
- Ze(n);
2580
- Xe(t.props.elementRef, n);
1036
+ Cn(n);
1037
+ ye(t.props.elementRef, n);
2581
1038
  }
2582
1039
  });
2583
- return c;
1040
+ return s;
2584
1041
  }));
2585
- var ln = function e(n) {
1042
+ var Nn = function e(n) {
2586
1043
  var r = n.anchorWidth, a = n.maxHeight, l = n.placement;
2587
- var i = Vr({
1044
+ var i = Te({
2588
1045
  anchorWidth: r,
2589
1046
  maxHeight: a,
2590
- menuStyle: x
1047
+ menuStyle: j
2591
1048
  });
2592
1049
 
2593
- return t().createElement(ne(), {
1050
+ return t().createElement(ee(), {
2594
1051
  focusMode: "never",
2595
1052
  placement: l !== null && l !== void 0 ? l : undefined,
2596
- isLoading: w,
2597
- onScrollBottom: V ? Ke : undefined,
2598
- noOptionsMessage: R,
2599
- footerMessage: g,
1053
+ isLoading: C,
1054
+ onScrollBottom: q ? pn : undefined,
1055
+ noOptionsMessage: N,
1056
+ footerMessage: y,
2600
1057
  animateLoading: o,
2601
- loadingMessage: k,
2602
- onScroll: N,
1058
+ loadingMessage: P,
1059
+ onScroll: I,
2603
1060
  style: i
2604
- }, an);
1061
+ }, Vn);
2605
1062
  };
2606
- var un = Nr("".concat(ae.length * .8, "em"));
2607
- var cn = Mr(Mr({}, rr()($, (function(e, n) {
1063
+ var Bn = Le("".concat(Me.length * .8, "em"));
1064
+ var Rn = Fe(Fe({}, G()(Z, (function(e, n) {
2608
1065
  return n === "role" || n.indexOf("aria-") === 0;
2609
1066
  }))), {}, {
2610
1067
  "aria-describedby": v,
2611
- "aria-labelledby": C,
2612
- "aria-invalid": y || undefined
1068
+ "aria-labelledby": M,
1069
+ "aria-invalid": g || undefined
2613
1070
  });
2614
- var sn = Mr({}, rr()($, (function(e, n) {
1071
+ var En = Fe({}, G()(Z, (function(e, n) {
2615
1072
  return n === "aria-label" || n === "aria-describedby";
2616
1073
  })));
2617
1074
 
2618
- return t().createElement(t().Fragment, null, t().createElement(sr, br({
1075
+ return t().createElement(t().Fragment, null, t().createElement(ve, Oe({
2619
1076
  key: "control",
2620
1077
  $append: l,
2621
- "data-test-values": JSON.stringify(xe),
1078
+ "data-test-values": JSON.stringify(Je),
2622
1079
  "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,
1080
+ inline: O,
1081
+ $hasFocus: Ve
1082
+ }, W().apply(void 0, [ Z ].concat(we(T()(Rn)))), {
1083
+ onClick: b ? undefined : cn,
2627
1084
  $disabled: b,
2628
- $error: y,
2629
- "data-test-popover-id": Le,
2630
- $popoverOpen: me,
2631
- $prepend: T,
1085
+ $error: g,
1086
+ "data-test-popover-id": un,
1087
+ $popoverOpen: Ie,
1088
+ $prepend: z,
2632
1089
  flex: true,
2633
- elementRef: Qe,
1090
+ elementRef: wn,
2634
1091
  role: "group",
2635
1092
  "aria-disabled": b || undefined,
2636
- "aria-labelledby": C
2637
- }, sn), t().createElement(dr, {
1093
+ "aria-labelledby": M
1094
+ }, En), t().createElement(be, {
2638
1095
  role: "listbox",
2639
- "aria-invalid": y,
1096
+ "aria-invalid": g,
2640
1097
  "aria-multiselectable": "true"
2641
- }, en(Pe)), !b && t().createElement(fr, br({
1098
+ }, Mn(Qe)), !b && t().createElement(me, Oe({
2642
1099
  role: "combobox",
2643
1100
  "data-test": "textbox",
2644
- id: O,
2645
- ref: Ye,
2646
- onBlur: Ge,
2647
- onFocus: $e,
2648
- onChange: We,
2649
- onKeyDown: ze,
2650
- value: ae,
1101
+ id: w,
1102
+ ref: Sn,
1103
+ onBlur: hn,
1104
+ onFocus: bn,
1105
+ onChange: gn,
1106
+ onKeyDown: mn,
1107
+ value: Me,
2651
1108
  autoCapitalize: "off",
2652
1109
  autoComplete: "off",
2653
1110
  autoCorrect: "off",
2654
1111
  spellCheck: false,
2655
- style: un,
2656
- placeholder: xe.length ? "" : q,
2657
- required: F,
2658
- "aria-activedescendant": me && Ie.current > 0 ? De : undefined,
1112
+ style: Bn,
1113
+ placeholder: Je.length ? "" : $,
1114
+ required: K,
1115
+ "aria-activedescendant": Ie && rn.current > 0 ? ln : undefined,
2659
1116
  "aria-autocomplete": "list",
2660
- "aria-controls": me ? Le : undefined,
2661
- "aria-owns": me ? Le : undefined,
2662
- "aria-expanded": me,
1117
+ "aria-controls": Ie ? un : undefined,
1118
+ "aria-owns": Ie ? un : undefined,
1119
+ "aria-expanded": Ie,
2663
1120
  "aria-haspopup": true
2664
- }, cn)), t().createElement(or(), {
2665
- open: me && !!Z,
1121
+ }, Rn)), t().createElement(Y(), {
1122
+ open: Ie && !!pe,
2666
1123
  autoCloseWhenOffScreen: true,
2667
- anchor: Z,
2668
- onRequestClose: Je,
1124
+ anchor: pe,
1125
+ onRequestClose: On,
2669
1126
  canCoverAnchor: false,
2670
1127
  defaultPlacement: f,
2671
- repositionMode: _,
2672
- id: Le
2673
- }, ln)), t().createElement(te(), {
1128
+ repositionMode: U,
1129
+ id: un
1130
+ }, Nn)), t().createElement(re(), {
2674
1131
  role: "status",
2675
1132
  "aria-relevant": "text"
2676
- }, ke), t().createElement(te(), {
1133
+ }, Ge), t().createElement(re(), {
2677
1134
  role: "alert",
2678
1135
  "aria-relevant": "additions"
2679
- }, nn(Pe)));
1136
+ }, Pn(Qe)));
2680
1137
  }
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;
1138
+ ze.propTypes = De;
1139
+ ze.Option = h;
1140
+ ze.Divider = u.Divider;
1141
+ ze.Heading = u.Heading;
1142
+ /* harmony default export */ const Ke = ze;
2686
1143
  // CONCATENATED MODULE: ./src/Multiselect/Multiselect.tsx
2687
- function _r(e) {
1144
+ function We(e) {
2688
1145
  "@babel/helpers - typeof";
2689
- return _r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
1146
+ return We = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
2690
1147
  return typeof e;
2691
1148
  } : function(e) {
2692
1149
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2693
- }, _r(e);
1150
+ }, We(e);
2694
1151
  }
2695
- function Kr() {
2696
- return Kr = Object.assign ? Object.assign.bind() : function(e) {
1152
+ function Ue() {
1153
+ return Ue = Object.assign ? Object.assign.bind() : function(e) {
2697
1154
  for (var n = 1; n < arguments.length; n++) {
2698
1155
  var r = arguments[n];
2699
1156
  for (var t in r) {
@@ -2701,9 +1158,9 @@
2701
1158
  }
2702
1159
  }
2703
1160
  return e;
2704
- }, Kr.apply(null, arguments);
1161
+ }, Ue.apply(null, arguments);
2705
1162
  }
2706
- function Hr(e, n) {
1163
+ function Ge(e, n) {
2707
1164
  var r = Object.keys(e);
2708
1165
  if (Object.getOwnPropertySymbols) {
2709
1166
  var t = Object.getOwnPropertySymbols(e);
@@ -2713,42 +1170,42 @@
2713
1170
  }
2714
1171
  return r;
2715
1172
  }
2716
- function $r(e) {
1173
+ function Xe(e) {
2717
1174
  for (var n = 1; n < arguments.length; n++) {
2718
1175
  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) {
1176
+ n % 2 ? Ge(Object(r), !0).forEach((function(n) {
1177
+ Je(e, n, r[n]);
1178
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ge(Object(r)).forEach((function(n) {
2722
1179
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
2723
1180
  }));
2724
1181
  }
2725
1182
  return e;
2726
1183
  }
2727
- function zr(e, n, r) {
2728
- return (n = Wr(n)) in e ? Object.defineProperty(e, n, {
1184
+ function Je(e, n, r) {
1185
+ return (n = Qe(n)) in e ? Object.defineProperty(e, n, {
2729
1186
  value: r,
2730
1187
  enumerable: !0,
2731
1188
  configurable: !0,
2732
1189
  writable: !0
2733
1190
  }) : e[n] = r, e;
2734
1191
  }
2735
- function Wr(e) {
2736
- var n = Ur(e, "string");
2737
- return "symbol" == _r(n) ? n : n + "";
1192
+ function Qe(e) {
1193
+ var n = Ye(e, "string");
1194
+ return "symbol" == We(n) ? n : n + "";
2738
1195
  }
2739
- function Ur(e, n) {
2740
- if ("object" != _r(e) || !e) return e;
1196
+ function Ye(e, n) {
1197
+ if ("object" != We(e) || !e) return e;
2741
1198
  var r = e[Symbol.toPrimitive];
2742
1199
  if (void 0 !== r) {
2743
1200
  var t = r.call(e, n || "default");
2744
- if ("object" != _r(t)) return t;
1201
+ if ("object" != We(t)) return t;
2745
1202
  throw new TypeError("@@toPrimitive must return a primitive value.");
2746
1203
  }
2747
1204
  return ("string" === n ? String : Number)(e);
2748
1205
  }
2749
- function Xr(e, n) {
1206
+ function Ze(e, n) {
2750
1207
  if (null == e) return {};
2751
- var r, t, o = Gr(e, n);
1208
+ var r, t, o = en(e, n);
2752
1209
  if (Object.getOwnPropertySymbols) {
2753
1210
  var a = Object.getOwnPropertySymbols(e);
2754
1211
  for (t = 0; t < a.length; t++) {
@@ -2757,7 +1214,7 @@
2757
1214
  }
2758
1215
  return o;
2759
1216
  }
2760
- function Gr(e, n) {
1217
+ function en(e, n) {
2761
1218
  if (null == e) return {};
2762
1219
  var r = {};
2763
1220
  for (var t in e) {
@@ -2770,7 +1227,7 @@
2770
1227
  }
2771
1228
  /** @public */
2772
1229
  /** @public */
2773
- /** @public */ var Jr = {
1230
+ /** @public */ var nn = {
2774
1231
  allowNewValues: i().bool,
2775
1232
  animateLoading: i().bool,
2776
1233
  append: i().bool,
@@ -2791,6 +1248,8 @@
2791
1248
  isLoadingOptions: i().bool,
2792
1249
  labelledBy: i().string,
2793
1250
  loadingMessage: i().node,
1251
+ /** @private. */
1252
+ maxLabelItems: i().number,
2794
1253
  menuStyle: i().object,
2795
1254
  name: i().string,
2796
1255
  noOptionsMessage: i().node,
@@ -2810,12 +1269,12 @@
2810
1269
  /** @private */
2811
1270
  virtualization: i().number
2812
1271
  };
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" ]);
1272
+ var rn = (0, d._)("No matches");
1273
+ var tn = (0, d._)("Select...");
1274
+ function on(e) {
1275
+ 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, x = j === void 0 ? rn : j, V = e.onChange, N = e.onClose, B = e.onFilterChange, E = e.onOpen, F = e.onScroll, I = e.onScrollBottom, A = e.placeholder, q = A === void 0 ? tn : A, 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
1276
  // @docs-props-type MultiselectPropsBase
2818
- var W = s()({
1277
+ var U = c()({
2819
1278
  componentName: "Multiselect",
2820
1279
  /* eslint-disable-next-line prefer-rest-params */
2821
1280
  componentProps: arguments[0],
@@ -2823,16 +1282,16 @@
2823
1282
  defaultValuePropName: "defaultValues",
2824
1283
  valuePropName: "values"
2825
1284
  });
2826
- /* eslint-disable-next-line prefer-rest-params */ var U = arguments[0];
1285
+ /* eslint-disable-next-line prefer-rest-params */ var G = arguments[0];
2827
1286
  (0, r.useEffect)((function() {
2828
1287
  if (l !== true) {
2829
1288
  if (false) {}
2830
1289
  if (false) {}
2831
1290
  }
2832
- }), [ l, U ]);
1291
+ }), [ l, G ]);
2833
1292
  // Compact uses Button, which defaults `inline` to true, explicitly pass a boolean to prevent the underlying Button from applying its default.
2834
1293
  var X = !!h;
2835
- var G = $r({
1294
+ var J = Xe({
2836
1295
  allowNewValues: n,
2837
1296
  animateLoading: o,
2838
1297
  append: a,
@@ -2843,66 +1302,66 @@
2843
1302
  disabled: v,
2844
1303
  elementRef: b,
2845
1304
  error: m,
2846
- footerMessage: g,
1305
+ footerMessage: y,
2847
1306
  inline: X,
2848
1307
  inputId: O,
2849
- inputRef: S,
2850
- isLoadingOptions: w,
1308
+ inputRef: w,
1309
+ isLoadingOptions: S,
2851
1310
  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,
1311
+ loadingMessage: M,
1312
+ menuStyle: P,
1313
+ name: k,
1314
+ noOptionsMessage: x,
1315
+ onClose: N,
1316
+ onChange: V,
1317
+ onFilterChange: B,
1318
+ onOpen: E,
1319
+ onScroll: F,
1320
+ onScrollBottom: I,
1321
+ placeholder: q,
1322
+ prepend: D,
2864
1323
  repositionMode: T,
2865
- showSelectedValuesFirst: _,
2866
- tabConfirmsNewValue: K,
2867
- virtualization: $
2868
- }, z);
2869
- var J = (0, r.useMemo)((function() {
1324
+ showSelectedValuesFirst: H,
1325
+ tabConfirmsNewValue: $,
1326
+ virtualization: K
1327
+ }, W);
1328
+ var Q = (0, r.useMemo)((function() {
2870
1329
  return {
2871
1330
  defaultValues: f
2872
1331
  };
2873
1332
  }), [ f ]);
2874
- var Q = (0, r.useMemo)((function() {
1333
+ var Y = (0, r.useMemo)((function() {
2875
1334
  return {
2876
- values: H
1335
+ values: z
2877
1336
  };
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: $
1337
+ }), [ z ]);
1338
+ var Z = (0, r.useMemo)((function() {
1339
+ return U ? Y : Q;
1340
+ }), [ Q, U, Y ]);
1341
+ var ee = {
1342
+ filter: g,
1343
+ selectAllAppearance: _,
1344
+ showSelectedValuesFirst: H,
1345
+ virtualization: K
2887
1346
  };
2888
1347
  if (l) {
2889
1348
 
2890
- return t().createElement(Kn, Kr({
1349
+ return t().createElement(R, Ue({
2891
1350
  "data-test": "multiselect"
2892
- }, Y, Z, G));
1351
+ }, Z, ee, J));
2893
1352
  }
2894
1353
 
2895
- return t().createElement(Fr, Kr({
1354
+ return t().createElement(Ke, Ue({
2896
1355
  "data-test": "multiselect"
2897
- }, Y, G));
1356
+ }, Z, J));
2898
1357
  }
2899
1358
  // 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;
1359
+ on.componentType = "Multiselect";
1360
+ on.Option = h;
1361
+ on.Heading = u.Heading;
1362
+ on.Divider = u.Divider;
1363
+ on.propTypes = nn;
1364
+ /* harmony default export */ const an = on;
2906
1365
  // CONCATENATED MODULE: ./src/Multiselect/index.ts
2907
1366
  module.exports = n;
2908
1367
  /******/})();