@splunk/react-ui 4.40.0 → 4.42.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 (88) hide show
  1. package/ButtonGroup.js +1 -3
  2. package/CHANGELOG.md +43 -0
  3. package/Calendar.js +548 -744
  4. package/Date.js +158 -161
  5. package/Dropdown.js +33 -32
  6. package/FormRows.js +93 -97
  7. package/Layer.js +115 -97
  8. package/MIGRATION.mdx +24 -3
  9. package/Menu.js +10 -9
  10. package/MessageBar.js +5 -5
  11. package/Multiselect.js +1498 -1599
  12. package/Number.js +51 -48
  13. package/Popover.js +481 -479
  14. package/RadioBar.js +19 -15
  15. package/Resize.js +61 -61
  16. package/ResultsMenu.js +1208 -1028
  17. package/Scroll.js +482 -475
  18. package/Select.js +949 -1030
  19. package/Slider.js +346 -300
  20. package/SlidingPanels.js +166 -148
  21. package/TabBar.js +187 -172
  22. package/TabLayout.js +8 -8
  23. package/Table.js +1518 -1432
  24. package/Text.js +29 -17
  25. package/TextArea.js +37 -37
  26. package/Tooltip.js +300 -207
  27. package/TransitionOpen.js +44 -65
  28. package/package.json +4 -4
  29. package/types/src/ButtonGroup/ButtonGroup.d.ts +0 -4
  30. package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -1
  31. package/types/src/Calendar/Calendar.d.ts +28 -30
  32. package/types/src/Calendar/MonthHeader.d.ts +12 -22
  33. package/types/src/Color/Color.d.ts +2 -2
  34. package/types/src/Date/Date.d.ts +18 -19
  35. package/types/src/Dropdown/Dropdown.d.ts +2 -1
  36. package/types/src/File/File.d.ts +1 -1
  37. package/types/src/FormRows/FormRows.d.ts +5 -60
  38. package/types/src/FormRows/Row.d.ts +1 -1
  39. package/types/src/Layer/Layer.d.ts +2 -1
  40. package/types/src/Link/Link.d.ts +5 -0
  41. package/types/src/Link/index.d.ts +1 -0
  42. package/types/src/Menu/Item.d.ts +1 -1
  43. package/types/src/Menu/Menu.d.ts +1 -1
  44. package/types/src/Multiselect/Option.d.ts +1 -1
  45. package/types/src/Number/Number.d.ts +10 -2
  46. package/types/src/Popover/Popover.d.ts +1 -4
  47. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  48. package/types/src/Resize/Resize.d.ts +0 -11
  49. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  50. package/types/src/ResultsMenu/VirtualizedResultsMenu/injectVirtualizedItem.d.ts +2 -0
  51. package/types/src/Scroll/Inner.d.ts +17 -19
  52. package/types/src/Search/Option.d.ts +1 -1
  53. package/types/src/Select/Option.d.ts +5 -1
  54. package/types/src/Select/OptionBase.d.ts +41 -23
  55. package/types/src/Select/SelectAllOption.d.ts +6 -2
  56. package/types/src/Select/SelectBase.d.ts +8 -34
  57. package/types/src/Slider/Slider.d.ts +7 -16
  58. package/types/src/SlidingPanels/SlidingPanels.d.ts +4 -3
  59. package/types/src/TabBar/TabBar.d.ts +10 -2
  60. package/types/src/TabBar/TabBarContext.d.ts +1 -0
  61. package/types/src/TabBar/docs/examples/IconsAbove.d.ts +2 -0
  62. package/types/src/TabBar/docs/examples/IconsLeft.d.ts +2 -0
  63. package/types/src/TabBar/docs/examples/VerticalIconsAbove.d.ts +2 -0
  64. package/types/src/TabBar/docs/examples/VerticalIconsLeft.d.ts +2 -0
  65. package/types/src/TabLayout/TabLayout.d.ts +4 -2
  66. package/types/src/Table/ExpandButton.d.ts +8 -0
  67. package/types/src/Table/HeadDropdownCell.d.ts +2 -0
  68. package/types/src/Table/HeadInner.d.ts +5 -1
  69. package/types/src/Table/Row.d.ts +8 -4
  70. package/types/src/Table/Table.d.ts +0 -2
  71. package/types/src/Table/docs/examples/Complex.d.ts +14 -3
  72. package/types/src/Text/Text.d.ts +2 -2
  73. package/types/src/TextArea/TextArea.d.ts +2 -2
  74. package/types/src/Tooltip/Tooltip.d.ts +38 -5
  75. package/types/src/Tooltip/docs/examples/CustomProps.d.ts +2 -0
  76. package/types/src/Tooltip/docs/examples/Toggletip.d.ts +2 -0
  77. package/types/src/Typography/Typography.d.ts +4 -2
  78. package/types/src/useControlled/useControlled.d.ts +5 -4
  79. package/useControlled.js +37 -15
  80. package/usePrevious.js +62 -30
  81. package/useRovingFocus.js +5 -4
  82. package/types/src/TabBar/docs/examples/IconsInline.d.ts +0 -2
  83. package/types/src/TabBar/docs/examples/IconsSmall.d.ts +0 -2
  84. package/types/src/TabBar/docs/examples/VerticalSmallIcons.d.ts +0 -2
  85. package/types/src/Table/docs/examples/prisma/Complex.d.ts +0 -48
  86. package/types/src/Table/icons/ExpansionRow.d.ts +0 -6
  87. package/types/src/Tooltip/docs/examples/CustomContent.d.ts +0 -2
  88. /package/types/src/Table/docs/examples/{prisma/RowActions.d.ts → RowActions.d.ts} +0 -0
package/Multiselect.js CHANGED
@@ -3,13 +3,16 @@
3
3
  /******/ "use strict";
4
4
  /******/ var e = {
5
5
  /***/ 2907:
6
- /***/ (e, t, n) => {
6
+ /***/ (e, t, r) => {
7
7
  // EXPORTS
8
- n.d(t, {
9
- default: () => /* reexport */ a
8
+ r.d(t, {
9
+ default: () => /* reexport */ i
10
10
  });
11
11
  // EXTERNAL MODULE: external "react"
12
- var r = n(9497);
12
+ var n = r(9497);
13
+ // EXTERNAL MODULE: external "lodash/has"
14
+ var o = r(5919);
15
+ var a = r.n(o);
13
16
  // CONCATENATED MODULE: ./src/useControlled/useControlled.tsx
14
17
  /**
15
18
  * This is a private component not intended for use outside @splunk/react-ui
@@ -21,22 +24,26 @@
21
24
  *
22
25
  * Return the controlled state of the component.
23
26
  */
24
- function o(e) {
25
- var t = e.defaultValue, n = e.value, o = e.componentName, a = o === void 0 ? "this component" : o, l = e.defaultValuePropName, i = l === void 0 ? "defaultValue" : l, u = e.valuePropName, c = u === void 0 ? "value" : u;
26
- var s = (0, r.useRef)(n != null);
27
- var f = (0, r.useRef)(t);
28
- (0, r.useEffect)((function() {
27
+ function l(e) {
28
+ var t = e.componentProps, r = e.componentName, o = r === void 0 ? "this component" : r, l = e.defaultValuePropName, i = l === void 0 ? "defaultValue" : l, u = e.valuePropName, c = u === void 0 ? "value" : u;
29
+ var s = (0, n.useRef)(a()(t, c));
30
+ var f = (0, n.useRef)(t[i]);
31
+ (0, n.useEffect)((function() {
29
32
  if (false) {}
30
- }), [ a, t, i, c ]);
31
- (0, r.useEffect)((function() {
33
+ }), [ o, t, i, c ]);
34
+ (0, n.useEffect)((function() {
32
35
  if (false) {}
33
36
  if (false) {}
34
- }), [ a, t, i, n, c ]);
37
+ }), [ o, t, i, c ]);
35
38
  return s.current;
36
39
  }
37
- /* harmony default export */ const a = o;
40
+ /* harmony default export */ const i = l;
38
41
  } // CONCATENATED MODULE: ./src/useControlled/index.ts
39
42
  /***/ ,
43
+ /***/ 5919:
44
+ /***/ e => {
45
+ e.exports = require("lodash/has");
46
+ /***/ },
40
47
  /***/ 9497:
41
48
  /***/ e => {
42
49
  e.exports = require("react");
@@ -48,21 +55,21 @@
48
55
  /******/ var t = {};
49
56
  /******/
50
57
  /******/ // The require function
51
- /******/ function n(r) {
58
+ /******/ function r(n) {
52
59
  /******/ // Check if module is in cache
53
- /******/ var o = t[r];
60
+ /******/ var o = t[n];
54
61
  /******/ if (o !== undefined) {
55
62
  /******/ return o.exports;
56
63
  /******/ }
57
64
  /******/ // Create a new module (and put it into the cache)
58
- /******/ var a = t[r] = {
65
+ /******/ var a = t[n] = {
59
66
  /******/ // no module.id needed
60
67
  /******/ // no module.loaded needed
61
68
  /******/ exports: {}
62
69
  /******/ };
63
70
  /******/
64
71
  /******/ // Execute the module function
65
- /******/ e[r](a, a.exports, n);
72
+ /******/ e[n](a, a.exports, r);
66
73
  /******/
67
74
  /******/ // Return the exports of the module
68
75
  /******/ return a.exports;
@@ -72,12 +79,12 @@
72
79
  /******/ /* webpack/runtime/compat get default export */
73
80
  /******/ (() => {
74
81
  /******/ // getDefaultExport function for compatibility with non-harmony modules
75
- /******/ n.n = e => {
82
+ /******/ r.n = e => {
76
83
  /******/ var t = e && e.__esModule ?
77
84
  /******/ () => e["default"]
78
85
  /******/ : () => e
79
86
  /******/;
80
- n.d(t, {
87
+ r.d(t, {
81
88
  a: t
82
89
  });
83
90
  /******/ return t;
@@ -87,12 +94,12 @@
87
94
  /******/ /* webpack/runtime/define property getters */
88
95
  /******/ (() => {
89
96
  /******/ // define getter functions for harmony exports
90
- /******/ n.d = (e, t) => {
91
- /******/ for (var r in t) {
92
- /******/ if (n.o(t, r) && !n.o(e, r)) {
93
- /******/ Object.defineProperty(e, r, {
97
+ /******/ r.d = (e, t) => {
98
+ /******/ for (var n in t) {
99
+ /******/ if (r.o(t, n) && !r.o(e, n)) {
100
+ /******/ Object.defineProperty(e, n, {
94
101
  enumerable: true,
95
- get: t[r]
102
+ get: t[n]
96
103
  });
97
104
  /******/ }
98
105
  /******/ }
@@ -101,14 +108,14 @@
101
108
  /******/
102
109
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
103
110
  /******/ (() => {
104
- /******/ n.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
111
+ /******/ r.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
105
112
  /******/;
106
113
  })();
107
114
  /******/
108
115
  /******/ /* webpack/runtime/make namespace object */
109
116
  /******/ (() => {
110
117
  /******/ // define __esModule on exports
111
- /******/ n.r = e => {
118
+ /******/ r.r = e => {
112
119
  /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
113
120
  /******/ Object.defineProperty(e, Symbol.toStringTag, {
114
121
  value: "Module"
@@ -120,30 +127,30 @@
120
127
  /******/ };
121
128
  /******/ })();
122
129
  /******/
123
- /************************************************************************/ var r = {};
130
+ /************************************************************************/ var n = {};
124
131
  // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
125
132
  (() => {
126
133
  // ESM COMPAT FLAG
127
- n.r(r);
134
+ r.r(n);
128
135
  // EXPORTS
129
- n.d(r, {
136
+ r.d(n, {
130
137
  Divider: () => /* reexport */ f.Divider,
131
138
  Heading: () => /* reexport */ f.Heading,
132
- Option: () => /* reexport */ Z,
133
- default: () => /* reexport */ Dr
139
+ Option: () => /* reexport */ W,
140
+ default: () => /* reexport */ Rn
134
141
  });
135
142
  // EXTERNAL MODULE: external "react"
136
- var e = n(9497);
137
- var t = n.n(e);
143
+ var e = r(9497);
144
+ var t = r.n(e);
138
145
  // CONCATENATED MODULE: external "prop-types"
139
146
  const o = require("prop-types");
140
- var a = n.n(o);
141
- // CONCATENATED MODULE: external "lodash/has"
142
- const l = require("lodash/has");
143
- var i = n.n(l);
147
+ var a = r.n(o);
148
+ // EXTERNAL MODULE: external "lodash/has"
149
+ var l = r(5919);
150
+ var i = r.n(l);
144
151
  // CONCATENATED MODULE: external "lodash/omit"
145
152
  const u = require("lodash/omit");
146
- var c = n.n(u);
153
+ var c = r.n(u);
147
154
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
148
155
  const s = require("@splunk/ui-utils/i18n");
149
156
  // CONCATENATED MODULE: external "@splunk/react-ui/Menu"
@@ -160,130 +167,87 @@
160
167
  function d() {
161
168
  return d = Object.assign ? Object.assign.bind() : function(e) {
162
169
  for (var t = 1; t < arguments.length; t++) {
163
- var n = arguments[t];
164
- for (var r in n) {
165
- ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
170
+ var r = arguments[t];
171
+ for (var n in r) {
172
+ ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
166
173
  }
167
174
  }
168
175
  return e;
169
176
  }, d.apply(null, arguments);
170
177
  }
171
178
  function v(e, t) {
172
- if (null == e) return {};
173
- var n, r, o = b(e, t);
179
+ var r = Object.keys(e);
174
180
  if (Object.getOwnPropertySymbols) {
175
- var a = Object.getOwnPropertySymbols(e);
176
- for (r = 0; r < a.length; r++) {
177
- n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
178
- }
179
- }
180
- return o;
181
- }
182
- function b(e, t) {
183
- if (null == e) return {};
184
- var n = {};
185
- for (var r in e) {
186
- if ({}.hasOwnProperty.call(e, r)) {
187
- if (t.includes(r)) continue;
188
- n[r] = e[r];
189
- }
181
+ var n = Object.getOwnPropertySymbols(e);
182
+ t && (n = n.filter((function(t) {
183
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
184
+ }))), r.push.apply(r, n);
190
185
  }
191
- return n;
192
- }
193
- function y(e, t) {
194
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
186
+ return r;
195
187
  }
196
- function m(e, t) {
197
- for (var n = 0; n < t.length; n++) {
198
- var r = t[n];
199
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
200
- Object.defineProperty(e, I(r.key), r);
188
+ function b(e) {
189
+ for (var t = 1; t < arguments.length; t++) {
190
+ var r = null != arguments[t] ? arguments[t] : {};
191
+ t % 2 ? v(Object(r), !0).forEach((function(t) {
192
+ y(e, t, r[t]);
193
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : v(Object(r)).forEach((function(t) {
194
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
195
+ }));
201
196
  }
202
- }
203
- function h(e, t, n) {
204
- return t && m(e.prototype, t), n && m(e, n), Object.defineProperty(e, "prototype", {
205
- writable: !1
206
- }), e;
207
- }
208
- function g(e, t) {
209
- if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
210
- e.prototype = Object.create(t && t.prototype, {
211
- constructor: {
212
- value: e,
213
- writable: !0,
214
- configurable: !0
215
- }
216
- }), Object.defineProperty(e, "prototype", {
217
- writable: !1
218
- }), t && O(e, t);
219
- }
220
- function O(e, t) {
221
- return O = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
222
- return e.__proto__ = t, e;
223
- }, O(e, t);
224
- }
225
- function w(e) {
226
- var t = k();
227
- return function() {
228
- var n, r = x(e);
229
- if (t) {
230
- var o = x(this).constructor;
231
- n = Reflect.construct(r, arguments, o);
232
- } else n = r.apply(this, arguments);
233
- return C(this, n);
234
- };
235
- }
236
- function C(e, t) {
237
- if (t && ("object" == p(t) || "function" == typeof t)) return t;
238
- if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
239
- return S(e);
240
- }
241
- function S(e) {
242
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
243
197
  return e;
244
198
  }
245
- function k() {
246
- try {
247
- var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
248
- } catch (e) {}
249
- return (k = function t() {
250
- return !!e;
251
- })();
252
- }
253
- function x(e) {
254
- return x = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
255
- return e.__proto__ || Object.getPrototypeOf(e);
256
- }, x(e);
257
- }
258
- function j(e, t, n) {
259
- return (t = I(t)) in e ? Object.defineProperty(e, t, {
260
- value: n,
199
+ function y(e, t, r) {
200
+ return (t = m(t)) in e ? Object.defineProperty(e, t, {
201
+ value: r,
261
202
  enumerable: !0,
262
203
  configurable: !0,
263
204
  writable: !0
264
- }) : e[t] = n, e;
205
+ }) : e[t] = r, e;
265
206
  }
266
- function I(e) {
267
- var t = P(e, "string");
207
+ function m(e) {
208
+ var t = h(e, "string");
268
209
  return "symbol" == p(t) ? t : t + "";
269
210
  }
270
- function P(e, t) {
211
+ function h(e, t) {
271
212
  if ("object" != p(e) || !e) return e;
272
- var n = e[Symbol.toPrimitive];
273
- if (void 0 !== n) {
274
- var r = n.call(e, t || "default");
275
- if ("object" != p(r)) return r;
213
+ var r = e[Symbol.toPrimitive];
214
+ if (void 0 !== r) {
215
+ var n = r.call(e, t || "default");
216
+ if ("object" != p(n)) return n;
276
217
  throw new TypeError("@@toPrimitive must return a primitive value.");
277
218
  }
278
219
  return ("string" === t ? String : Number)(e);
279
220
  }
280
- var E = {
221
+ function g(e, t) {
222
+ if (null == e) return {};
223
+ var r, n, o = O(e, t);
224
+ if (Object.getOwnPropertySymbols) {
225
+ var a = Object.getOwnPropertySymbols(e);
226
+ for (n = 0; n < a.length; n++) {
227
+ r = a[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
228
+ }
229
+ }
230
+ return o;
231
+ }
232
+ function O(e, t) {
233
+ if (null == e) return {};
234
+ var r = {};
235
+ for (var n in e) {
236
+ if ({}.hasOwnProperty.call(e, n)) {
237
+ if (t.includes(n)) continue;
238
+ r[n] = e[n];
239
+ }
240
+ }
241
+ return r;
242
+ }
243
+ var w = {
281
244
  /** @private */
282
245
  active: a().bool,
283
246
  children: a().node,
284
247
  description: a().string,
285
248
  descriptionPosition: a().oneOf([ "right", "bottom" ]),
286
249
  disabled: a().bool,
250
+ elementRef: a().oneOfType([ a().func, a().object ]),
287
251
  hidden: a().bool,
288
252
  icon: a().node,
289
253
  label: a().string.isRequired,
@@ -304,144 +268,136 @@
304
268
  truncate: a().bool,
305
269
  value: a().oneOfType([ a().string, a().number, a().bool ]).isRequired
306
270
  };
307
- var M = {
308
- descriptionPosition: "bottom",
309
- disabled: false,
310
- multiple: false,
311
- role: "option",
312
- selected: false,
313
- truncate: false
271
+ /**
272
+ * An option within a `Multiselect`.
273
+ */ function S(r) {
274
+ var n = r.children, o = r.descriptionPosition, a = o === void 0 ? "bottom" : o, l = r.disabled, i = r.elementRef, u = r.icon, c = r.label, s = r.multiple, p = r.onClick, v = r.role, y = v === void 0 ? "option" : v, m = r.value, h = g(r, [ "children", "descriptionPosition", "disabled", "elementRef", "icon", "label", "multiple", "onClick", "role", "value" ]);
275
+ // @docs-props-type OptionPropsBase
276
+ var O = (0, e.useCallback)((function(e) {
277
+ if (!l) {
278
+ p === null || p === void 0 ? void 0 : p(e, {
279
+ value: m
280
+ });
281
+ }
282
+ }), [ l, p, m ]);
283
+ var w = m.toString();
284
+ var S = b({
285
+ descriptionPosition: a,
286
+ disabled: l
287
+ }, h);
288
+
289
+ return t().createElement(f.Item, d({
290
+ "data-test-value": m,
291
+ "data-test": "option",
292
+ elementRef: i
293
+ }, S, {
294
+ selectable: true,
295
+ selectableAppearance: s ? "checkbox" : "checkmark",
296
+ startAdornment: u,
297
+ onClick: O,
298
+ role: y,
299
+ value: w
300
+ }), n || c);
301
+ }
302
+ S.propTypes = w;
303
+ S.type = f.Item;
304
+ // For components to distinguish if their children are Options or Headings/Dividers
305
+ /* harmony default export */ const C = S;
306
+ // CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
307
+ // A utility that attempts to move an element into view by scrolling it's derived parent.
308
+ var k = function e(t) {
309
+ if (!t) {
310
+ return;
311
+ }
312
+ var r = t.offsetParent;
313
+ if (!r) {
314
+ return;
315
+ }
316
+ // Below the bottom of the container.
317
+ if (r.scrollTop + r.clientHeight < t.offsetTop + t.clientHeight) {
318
+ r.scrollTop = t.offsetTop + t.clientHeight - r.clientHeight;
319
+ // Above the top of the container.
320
+ } else if (r.scrollTop > t.offsetTop) {
321
+ r.scrollTop = t.offsetTop;
322
+ }
314
323
  };
324
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
315
325
  /**
316
- * An option within a `Multiselect`. This inherits from
317
- * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
318
- * so any elements passed to it must also be pure.
319
- */ var A = function(e) {
320
- g(r, e);
321
- var n = w(r);
322
- function r() {
323
- var e;
324
- y(this, r);
325
- for (var t = arguments.length, o = new Array(t), a = 0; a < t; a++) {
326
- o[a] = arguments[a];
327
- }
328
- e = n.call.apply(n, [ this ].concat(o));
329
- j(S(e), "c", null);
330
- j(S(e), "handleClick", (function(t) {
331
- var n = e.props, r = n.onClick, o = n.value, a = n.disabled;
332
- if (!a) {
333
- r === null || r === void 0 ? void 0 : r(t, {
334
- value: o
335
- });
336
- }
337
- }));
338
- j(S(e), "handleMount", (function(t) {
339
- e.c = t;
340
- }));
341
- return e;
326
+ * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
327
+ *
328
+ * @param ref - The React callback or object ref. Can be `null` or `undefined`.
329
+ * @param current - The new value of the ref.
330
+ */
331
+ function x(e, t) {
332
+ if (e) {
333
+ if (typeof e === "function") {
334
+ e(t);
335
+ } else {
336
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
337
+ // the intention here is to signal "we will take care of setting 'current', not you".
338
+ e.current = t;
339
+ // eslint-disable-line no-param-reassign
340
+ }
342
341
  }
343
- // @docs-props-type OptionPropsBase
344
- h(r, [ {
345
- key: "scrollIntoViewIfNeeded",
346
- // eslint-disable-next-line react/no-unused-class-component-methods
347
- value: function e() {
348
- var t;
349
- (t = this.c) === null || t === void 0 ? void 0 : t.scrollIntoViewIfNeeded();
350
- }
351
- /**
352
- * Place focus on the button.
353
- */
354
- // eslint-disable-next-line react/no-unused-class-component-methods
355
- }, {
356
- key: "focus",
357
- value: function e() {
358
- var t;
359
- (t = this.c) === null || t === void 0 ? void 0 : t.focus();
360
- }
361
- }, {
362
- key: "render",
363
- value: function e() {
364
- var n = this.props, r = n.value, o = n.children, a = n.label, l = n.multiple, i = n.role, u = n.icon, c = v(n, [ "value", "children", "label", "multiple", "role", "icon" ]);
365
- var s = r.toString();
366
-
367
- return t().createElement(f.Item, d({
368
- "data-test-value": r,
369
- "data-test": "option",
370
- ref: this.handleMount
371
- }, c, {
372
- selectable: true,
373
- selectableAppearance: l ? "checkbox" : "checkmark",
374
- onClick: this.handleClick,
375
- role: i,
376
- value: s,
377
- startAdornment: u
378
- }), o || a);
379
- }
380
- } ]);
381
- return r;
382
- }(e.PureComponent);
383
- j(A, "propTypes", E);
384
- j(A, "defaultProps", M);
385
- j(A, "type", f.Item);
386
- /* harmony default export */ const _ = A;
342
+ }
387
343
  // CONCATENATED MODULE: ./src/Multiselect/Option.tsx
388
- function R(e) {
344
+ function j(e) {
389
345
  "@babel/helpers - typeof";
390
- return R = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
346
+ return j = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
391
347
  return typeof e;
392
348
  } : function(e) {
393
349
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
394
- }, R(e);
350
+ }, j(e);
395
351
  }
396
- function V() {
397
- return V = Object.assign ? Object.assign.bind() : function(e) {
352
+ function P() {
353
+ return P = Object.assign ? Object.assign.bind() : function(e) {
398
354
  for (var t = 1; t < arguments.length; t++) {
399
- var n = arguments[t];
400
- for (var r in n) {
401
- ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
355
+ var r = arguments[t];
356
+ for (var n in r) {
357
+ ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
402
358
  }
403
359
  }
404
360
  return e;
405
- }, V.apply(null, arguments);
361
+ }, P.apply(null, arguments);
406
362
  }
407
- function T(e, t) {
363
+ function E(e, t) {
408
364
  if (null == e) return {};
409
- var n, r, o = B(e, t);
365
+ var r, n, o = I(e, t);
410
366
  if (Object.getOwnPropertySymbols) {
411
367
  var a = Object.getOwnPropertySymbols(e);
412
- for (r = 0; r < a.length; r++) {
413
- n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
368
+ for (n = 0; n < a.length; n++) {
369
+ r = a[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
414
370
  }
415
371
  }
416
372
  return o;
417
373
  }
418
- function B(e, t) {
374
+ function I(e, t) {
419
375
  if (null == e) return {};
420
- var n = {};
421
- for (var r in e) {
422
- if ({}.hasOwnProperty.call(e, r)) {
423
- if (t.includes(r)) continue;
424
- n[r] = e[r];
376
+ var r = {};
377
+ for (var n in e) {
378
+ if ({}.hasOwnProperty.call(e, n)) {
379
+ if (t.includes(n)) continue;
380
+ r[n] = e[n];
425
381
  }
426
382
  }
427
- return n;
383
+ return r;
428
384
  }
429
- function q(e, t) {
385
+ function R(e, t) {
430
386
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
431
387
  }
432
- function N(e, t) {
433
- for (var n = 0; n < t.length; n++) {
434
- var r = t[n];
435
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
436
- Object.defineProperty(e, G(r.key), r);
388
+ function M(e, t) {
389
+ for (var r = 0; r < t.length; r++) {
390
+ var n = t[r];
391
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
392
+ Object.defineProperty(e, F(n.key), n);
437
393
  }
438
394
  }
439
- function D(e, t, n) {
440
- return t && N(e.prototype, t), n && N(e, n), Object.defineProperty(e, "prototype", {
395
+ function T(e, t, r) {
396
+ return t && M(e.prototype, t), r && M(e, r), Object.defineProperty(e, "prototype", {
441
397
  writable: !1
442
398
  }), e;
443
399
  }
444
- function L(e, t) {
400
+ function _(e, t) {
445
401
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
446
402
  e.prototype = Object.create(t && t.prototype, {
447
403
  constructor: {
@@ -451,69 +407,69 @@
451
407
  }
452
408
  }), Object.defineProperty(e, "prototype", {
453
409
  writable: !1
454
- }), t && F(e, t);
410
+ }), t && A(e, t);
455
411
  }
456
- function F(e, t) {
457
- return F = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
412
+ function A(e, t) {
413
+ return A = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
458
414
  return e.__proto__ = t, e;
459
- }, F(e, t);
415
+ }, A(e, t);
460
416
  }
461
- function K(e) {
462
- var t = z();
417
+ function B(e) {
418
+ var t = D();
463
419
  return function() {
464
- var n, r = W(e);
420
+ var r, n = N(e);
465
421
  if (t) {
466
- var o = W(this).constructor;
467
- n = Reflect.construct(r, arguments, o);
468
- } else n = r.apply(this, arguments);
469
- return H(this, n);
422
+ var o = N(this).constructor;
423
+ r = Reflect.construct(n, arguments, o);
424
+ } else r = n.apply(this, arguments);
425
+ return q(this, r);
470
426
  };
471
427
  }
472
- function H(e, t) {
473
- if (t && ("object" == R(t) || "function" == typeof t)) return t;
428
+ function q(e, t) {
429
+ if (t && ("object" == j(t) || "function" == typeof t)) return t;
474
430
  if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
475
- return $(e);
431
+ return V(e);
476
432
  }
477
- function $(e) {
433
+ function V(e) {
478
434
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
479
435
  return e;
480
436
  }
481
- function z() {
437
+ function D() {
482
438
  try {
483
439
  var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
484
440
  } catch (e) {}
485
- return (z = function t() {
441
+ return (D = function t() {
486
442
  return !!e;
487
443
  })();
488
444
  }
489
- function W(e) {
490
- return W = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
445
+ function N(e) {
446
+ return N = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
491
447
  return e.__proto__ || Object.getPrototypeOf(e);
492
- }, W(e);
448
+ }, N(e);
493
449
  }
494
- function U(e, t, n) {
495
- return (t = G(t)) in e ? Object.defineProperty(e, t, {
496
- value: n,
450
+ function L(e, t, r) {
451
+ return (t = F(t)) in e ? Object.defineProperty(e, t, {
452
+ value: r,
497
453
  enumerable: !0,
498
454
  configurable: !0,
499
455
  writable: !0
500
- }) : e[t] = n, e;
501
- }
502
- function G(e) {
503
- var t = J(e, "string");
504
- return "symbol" == R(t) ? t : t + "";
505
- }
506
- function J(e, t) {
507
- if ("object" != R(e) || !e) return e;
508
- var n = e[Symbol.toPrimitive];
509
- if (void 0 !== n) {
510
- var r = n.call(e, t || "default");
511
- if ("object" != R(r)) return r;
456
+ }) : e[t] = r, e;
457
+ }
458
+ function F(e) {
459
+ var t = K(e, "string");
460
+ return "symbol" == j(t) ? t : t + "";
461
+ }
462
+ function K(e, t) {
463
+ if ("object" != j(e) || !e) return e;
464
+ var r = e[Symbol.toPrimitive];
465
+ if (void 0 !== r) {
466
+ var n = r.call(e, t || "default");
467
+ if ("object" != j(n)) return n;
512
468
  throw new TypeError("@@toPrimitive must return a primitive value.");
513
469
  }
514
470
  return ("string" === t ? String : Number)(e);
515
471
  }
516
- var X = {
472
+ var H = {
517
473
  /** @private */
518
474
  active: a().bool,
519
475
  children: a().node,
@@ -543,7 +499,7 @@
543
499
  truncate: a().bool,
544
500
  value: a().oneOfType([ a().string, a().number, a().bool ]).isRequired
545
501
  };
546
- var Q = {
502
+ var $ = {
547
503
  compact: false,
548
504
  descriptionPosition: "bottom",
549
505
  disabled: false,
@@ -554,29 +510,28 @@
554
510
  * An option within a `Multiselect`. This inherits from
555
511
  * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
556
512
  * so any elements passed to it must also be pure.
557
- */ var Y = function(e) {
558
- L(r, e);
559
- var n = K(r);
560
- function r() {
513
+ */ var z = function(e) {
514
+ _(n, e);
515
+ var r = B(n);
516
+ function n() {
561
517
  var e;
562
- q(this, r);
563
- for (var t = arguments.length, o = new Array(t), a = 0; a < t; a++) {
564
- o[a] = arguments[a];
565
- }
566
- e = n.call.apply(n, [ this ].concat(o));
567
- U($(e), "c", null);
568
- U($(e), "handleMount", (function(t) {
569
- e.c = t;
518
+ R(this, n);
519
+ for (var o = arguments.length, a = new Array(o), l = 0; l < o; l++) {
520
+ a[l] = arguments[l];
521
+ }
522
+ e = r.call.apply(r, [ this ].concat(a));
523
+ L(V(e), "optionBaseRef", t().createRef());
524
+ L(V(e), "handleMount", (function(t) {
525
+ x(e.optionBaseRef, t);
570
526
  }));
571
527
  return e;
572
528
  }
573
529
  // @docs-props-type OptionPropsBase
574
- D(r, [ {
530
+ T(n, [ {
575
531
  key: "scrollIntoViewIfNeeded",
576
532
  // eslint-disable-next-line react/no-unused-class-component-methods
577
533
  value: function e() {
578
- var t;
579
- (t = this.c) === null || t === void 0 ? void 0 : t.scrollIntoViewIfNeeded();
534
+ k(this.optionBaseRef.current);
580
535
  }
581
536
  /**
582
537
  * Place focus on the button.
@@ -585,106 +540,109 @@
585
540
  }, {
586
541
  key: "focus",
587
542
  value: function e() {
588
- var t;
589
- (t = this.c) === null || t === void 0 ? void 0 : t.focus();
543
+ var t, r;
544
+ (t = this.optionBaseRef) === null || t === void 0 ? void 0 : (r = t.current) === null || r === void 0 ? void 0 : r.focus();
590
545
  }
591
546
  }, {
592
547
  key: "render",
593
548
  value: function e() {
594
- var n = this.props, r = n.compact, o = T(n, [ "compact" ]);
549
+ var r = this.props, n = r.compact, o = E(r, [ "compact" ]);
595
550
 
596
- return t().createElement(_, V({}, o, {
597
- multiple: r,
598
- ref: this.handleMount
551
+ return t().createElement(C, P({}, o, {
552
+ elementRef: this.handleMount,
553
+ multiple: n
599
554
  }), this.props.children || this.props.label);
600
555
  }
601
556
  } ]);
602
- return r;
557
+ return n;
603
558
  }(e.PureComponent);
604
- U(Y, "propTypes", X);
605
- U(Y, "defaultProps", Q);
606
- /* harmony default export */ const Z = Y;
559
+ L(z, "propTypes", H);
560
+ L(z, "defaultProps", $);
561
+ /* harmony default export */ const W = z;
607
562
  // CONCATENATED MODULE: external "lodash/castArray"
608
- const ee = require("lodash/castArray");
609
- var te = n.n(ee);
563
+ const U = require("lodash/castArray");
564
+ var G = r.n(U);
610
565
  // CONCATENATED MODULE: external "lodash/find"
611
- const ne = require("lodash/find");
612
- var re = n.n(ne);
566
+ const J = require("lodash/find");
567
+ var X = r.n(J);
613
568
  // CONCATENATED MODULE: external "lodash/forEachRight"
614
- const oe = require("lodash/forEachRight");
615
- var ae = n.n(oe);
569
+ const Q = require("lodash/forEachRight");
570
+ var Y = r.n(Q);
616
571
  // CONCATENATED MODULE: external "lodash/includes"
617
- const le = require("lodash/includes");
618
- var ie = n.n(le);
572
+ const Z = require("lodash/includes");
573
+ var ee = r.n(Z);
619
574
  // CONCATENATED MODULE: external "lodash/memoize"
620
- const ue = require("lodash/memoize");
621
- var ce = n.n(ue);
575
+ const te = require("lodash/memoize");
576
+ var re = r.n(te);
622
577
  // CONCATENATED MODULE: external "lodash/pick"
623
- const se = require("lodash/pick");
624
- var fe = n.n(se);
578
+ const ne = require("lodash/pick");
579
+ var oe = r.n(ne);
625
580
  // CONCATENATED MODULE: external "lodash/uniq"
626
- const pe = require("lodash/uniq");
627
- var de = n.n(pe);
581
+ const ae = require("lodash/uniq");
582
+ var le = r.n(ae);
628
583
  // CONCATENATED MODULE: external "lodash/without"
629
- const ve = require("lodash/without");
630
- var be = n.n(ve);
584
+ const ie = require("lodash/without");
585
+ var ue = r.n(ie);
631
586
  // CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
632
- const ye = require("@splunk/react-ui/Dropdown");
633
- var me = n.n(ye);
587
+ const ce = require("@splunk/react-ui/Dropdown");
588
+ var se = r.n(ce);
634
589
  // CONCATENATED MODULE: external "@splunk/react-ui/Link"
635
- const he = require("@splunk/react-ui/Link");
636
- var ge = n.n(he);
590
+ const fe = require("@splunk/react-ui/Link");
591
+ var pe = r.n(fe);
637
592
  // CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
638
- const Oe = require("@splunk/react-ui/ResultsMenu");
639
- var we = n.n(Oe);
593
+ const de = require("@splunk/react-ui/ResultsMenu");
594
+ var ve = r.n(de);
640
595
  // CONCATENATED MODULE: external "@splunk/react-ui/Text"
641
- const Ce = require("@splunk/react-ui/Text");
642
- var Se = n.n(Ce);
596
+ const be = require("@splunk/react-ui/Text");
597
+ var ye = r.n(be);
598
+ // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
599
+ const me = require("@splunk/react-ui/ScreenReaderContent");
600
+ var he = r.n(me);
643
601
  // CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
644
- const ke = require("@splunk/react-ui/usePrevious");
645
- var xe = n.n(ke);
602
+ const ge = require("@splunk/react-ui/usePrevious");
603
+ var Oe = r.n(ge);
646
604
  // CONCATENATED MODULE: external "@splunk/ui-utils/filter"
647
- const je = require("@splunk/ui-utils/filter");
605
+ const we = require("@splunk/ui-utils/filter");
648
606
  // CONCATENATED MODULE: external "@splunk/ui-utils/id"
649
- const Ie = require("@splunk/ui-utils/id");
607
+ const Se = require("@splunk/ui-utils/id");
650
608
  // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
651
- const Pe = require("@splunk/ui-utils/keyboard");
609
+ const Ce = require("@splunk/ui-utils/keyboard");
652
610
  // CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
653
- const Ee = require("@splunk/react-icons/CaretSmallDown");
654
- var Me = n.n(Ee);
611
+ const ke = require("@splunk/react-icons/CaretSmallDown");
612
+ var xe = r.n(ke);
655
613
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Caret"
656
- const Ae = require("@splunk/react-icons/enterprise/Caret");
657
- var _e = n.n(Ae);
614
+ const je = require("@splunk/react-icons/enterprise/Caret");
615
+ var Pe = r.n(je);
658
616
  // CONCATENATED MODULE: external "@splunk/themes"
659
- const Re = require("@splunk/themes");
617
+ const Ee = require("@splunk/themes");
660
618
  // CONCATENATED MODULE: ./src/Select/icons/CaretSmallDown.tsx
661
- var Ve = function e() {
662
- var n = (0, Re.useSplunkTheme)(), r = n.isEnterprise;
663
- var o = r ? t().createElement(_e(), {
619
+ var Ie = function e() {
620
+ var r = (0, Ee.useSplunkTheme)(), n = r.isEnterprise;
621
+ var o = n ? t().createElement(Pe(), {
664
622
  screenReaderText: null,
665
623
  hideDefaultTooltip: true,
666
624
  size: .5
667
- }) : t().createElement(Me(), null);
625
+ }) : t().createElement(xe(), null);
668
626
  return o;
669
627
  };
670
- /* harmony default export */ const Te = Ve;
628
+ /* harmony default export */ const Re = Ie;
671
629
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Search"
672
- const Be = require("@splunk/react-icons/enterprise/Search");
673
- var qe = n.n(Be);
630
+ const Me = require("@splunk/react-icons/enterprise/Search");
631
+ var Te = r.n(Me);
674
632
  // CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
675
- const Ne = require("@splunk/react-icons/Magnifier");
676
- var De = n.n(Ne);
633
+ const _e = require("@splunk/react-icons/Magnifier");
634
+ var Ae = r.n(_e);
677
635
  // CONCATENATED MODULE: ./src/Select/icons/Search.tsx
678
- var Le = function e() {
679
- var n = (0, Re.useSplunkTheme)(), r = n.isEnterprise, o = n.isCompact;
636
+ var Be = function e() {
637
+ var r = (0, Ee.useSplunkTheme)(), n = r.isEnterprise, o = r.isCompact;
680
638
  var a = (0, s._)("Search");
681
639
  var l = o ? "20px" : "24px";
682
- var i = r ? t().createElement(qe(), {
640
+ var i = n ? t().createElement(Te(), {
683
641
  role: "presentation",
684
642
  size: "16px",
685
643
  screenReaderText: a,
686
644
  hideDefaultTooltip: true
687
- }) : t().createElement(De(), {
645
+ }) : t().createElement(Ae(), {
688
646
  role: "presentation",
689
647
  "aria-label": a,
690
648
  width: l,
@@ -692,9 +650,9 @@
692
650
  });
693
651
  return i;
694
652
  };
695
- /* harmony default export */ const Fe = Le;
653
+ /* harmony default export */ const qe = Be;
696
654
  // CONCATENATED MODULE: ./src/Select/SelectAllOption.tsx
697
- var Ke = {
655
+ var Ve = {
698
656
  active: a().bool,
699
657
  changedToggle: a().bool,
700
658
  elementRef: a().oneOfType([ a().func, a().object ]),
@@ -704,13 +662,14 @@
704
662
  selected: a().oneOf([ false, true, "some" ]),
705
663
  totalCount: a().number
706
664
  };
707
- var He = t().forwardRef((function(e, n) {
708
- var r = e.active, o = e.id, a = e.onClick, l = e.selectAllLabel, i = e.totalCount, u = e.changedToggle, c = e.selected;
665
+ function De(e) {
666
+ var r = e.active, n = e.elementRef, o = e.id, a = e.onClick, l = e.selectAllLabel, i = e.totalCount, u = e.changedToggle, c = e.selected;
709
667
  // When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
710
668
  var s = u ? " (".concat(i === null || i === void 0 ? void 0 : i.toString(), ")") : "";
711
669
 
712
- return t().createElement(_, {
670
+ return t().createElement(C, {
713
671
  active: r,
672
+ elementRef: n,
714
673
  "aria-keyshortcuts": "Control+A",
715
674
  "data-test": "select-all",
716
675
  description: "".concat(s, " Ctrl-a"),
@@ -720,23 +679,22 @@
720
679
  label: l,
721
680
  multiple: true,
722
681
  onClick: a,
723
- ref: n,
724
682
  role: "menuitemcheckbox",
725
683
  selected: c,
726
684
  tabIndex: -1,
727
685
  value: "selectAll"
728
686
  });
729
- }));
730
- He.propTypes = Ke;
731
- /* harmony default export */ const $e = He;
687
+ }
688
+ De.propTypes = Ve;
689
+ /* harmony default export */ const Ne = De;
732
690
  // CONCATENATED MODULE: external "styled-components"
733
- const ze = require("styled-components");
734
- var We = n.n(ze);
691
+ const Le = require("styled-components");
692
+ var Fe = r.n(Le);
735
693
  // CONCATENATED MODULE: external "@splunk/react-ui/Button"
736
- const Ue = require("@splunk/react-ui/Button");
737
- var Ge = n.n(Ue);
694
+ const Ke = require("@splunk/react-ui/Button");
695
+ var He = r.n(Ke);
738
696
  // CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
739
- var Je = We()(Ge()).withConfig({
697
+ var $e = Fe()(He()).withConfig({
740
698
  displayName: "SelectBaseStyles__StyledButton",
741
699
  componentId: "sc-16cj7sk-0"
742
700
  })([ "&[data-inline]{width:", ";}", "" ], (function(e) {
@@ -746,103 +704,103 @@
746
704
  var t = e.$multiple;
747
705
  return !t && "flex-grow: 0;";
748
706
  }));
749
- var Xe = We().span.withConfig({
707
+ var ze = Fe().span.withConfig({
750
708
  displayName: "SelectBaseStyles__StyledLinkIcon",
751
709
  componentId: "sc-16cj7sk-1"
752
710
  })([ "padding-right:2px;" ]);
753
- var Qe = We().span.withConfig({
711
+ var We = Fe().span.withConfig({
754
712
  displayName: "SelectBaseStyles__StyledLinkCaret",
755
713
  componentId: "sc-16cj7sk-2"
756
714
  })([ "padding-left:2px;" ]);
757
- var Ye = We().div.withConfig({
715
+ var Ue = Fe().div.withConfig({
758
716
  displayName: "SelectBaseStyles__StyledFilter",
759
717
  componentId: "sc-16cj7sk-3"
760
- })([ "padding:", ";min-width:160px;" ], (0, Re.pick)({
718
+ })([ "padding:", ";min-width:160px;" ], (0, Ee.pick)({
761
719
  enterprise: "8px",
762
720
  prisma: "10px 16px"
763
721
  }));
764
- var Ze = We().span.withConfig({
722
+ var Ge = Fe().span.withConfig({
765
723
  displayName: "SelectBaseStyles__StyledSearchIconWrapper",
766
724
  componentId: "sc-16cj7sk-4"
767
- })([ "color:", ";pointer-events:none;padding:", ";" ], (0, Re.pick)({
725
+ })([ "color:", ";pointer-events:none;padding:", ";" ], (0, Ee.pick)({
768
726
  enterprise: {
769
- light: Re.variables.gray60,
770
- dark: Re.variables.white
727
+ light: Ee.variables.gray60,
728
+ dark: Ee.variables.white
771
729
  },
772
- prisma: Re.variables.contentColorMuted
773
- }), (0, Re.pick)({
730
+ prisma: Ee.variables.contentColorMuted
731
+ }), (0, Ee.pick)({
774
732
  comfortable: "0 8px",
775
733
  compact: "0 6px"
776
734
  }));
777
- var et = We().span.withConfig({
735
+ var Je = Fe().span.withConfig({
778
736
  displayName: "SelectBaseStyles__StyledCount",
779
737
  componentId: "sc-16cj7sk-5"
780
- })([ "padding-right:", ";" ], Re.variables.spacingXSmall);
781
- var tt = We()(ge()).withConfig({
738
+ })([ "padding-right:", ";" ], Ee.variables.spacingXSmall);
739
+ var Xe = Fe()(pe()).withConfig({
782
740
  displayName: "SelectBaseStyles__StyledControlsLink",
783
741
  componentId: "sc-16cj7sk-6"
784
742
  })([ "margin-right:20px;", ";" ], (function(e) {
785
743
  var t = e.$disabled;
786
- return t && (0, ze.css)([ "color:", ";" ], Re.variables.contentColorDisabled);
744
+ return t && (0, Le.css)([ "color:", ";" ], Ee.variables.contentColorDisabled);
787
745
  }));
788
- var nt = We().div.withConfig({
746
+ var Qe = Fe().div.withConfig({
789
747
  displayName: "SelectBaseStyles__StyledToggleAllControls",
790
748
  componentId: "sc-16cj7sk-7"
791
- })([ "padding:", ";", "" ], (0, Re.pick)({
749
+ })([ "padding:", ";", "" ], (0, Ee.pick)({
792
750
  enterprise: "5px 8px",
793
751
  prisma: "10px 16px"
794
- }), (0, Re.pickVariant)("$placement", {
752
+ }), (0, Ee.pickVariant)("$placement", {
795
753
  above: {
796
- enterprise: (0, ze.css)([ "border-top:", ";" ], Re.variables.border),
797
- prisma: (0, ze.css)([ "border-top:1px solid ", ";" ], Re.variables.neutral200)
754
+ enterprise: (0, Le.css)([ "border-top:", ";" ], Ee.variables.border),
755
+ prisma: (0, Le.css)([ "border-top:1px solid ", ";" ], Ee.variables.neutral200)
798
756
  },
799
757
  below: {
800
- enterprise: (0, ze.css)([ "border-bottom:", ";" ], Re.variables.border),
801
- prisma: (0, ze.css)([ "border-bottom:1px solid ", ";" ], Re.variables.neutral200)
758
+ enterprise: (0, Le.css)([ "border-bottom:", ";" ], Ee.variables.border),
759
+ prisma: (0, Le.css)([ "border-bottom:1px solid ", ";" ], Ee.variables.neutral200)
802
760
  }
803
761
  }));
804
762
  // EXTERNAL MODULE: ./src/useControlled/index.ts + 1 modules
805
- var rt = n(2907);
763
+ var Ye = r(2907);
806
764
  // CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
807
765
  // A utility for matching keyboard characters to list values
808
- var ot = function e(t, n) {
809
- return t ? t.label.charAt(n).toLowerCase() : "";
766
+ var Ze = function e(t, r) {
767
+ return t ? t.label.charAt(r).toLowerCase() : "";
810
768
  };
811
- var at = function e(t, n) {
769
+ var et = function e(t, r) {
812
770
  if (!t.length) {
813
771
  return t;
814
772
  }
815
- var r = null;
773
+ var n = null;
816
774
  var o = false;
817
775
  var a = t.filter((function(e) {
818
- var t = ot(e, n.index);
819
- if (t === n.value) {
776
+ var t = Ze(e, r.index);
777
+ if (t === r.value) {
820
778
  o = true;
821
779
  return true;
822
780
  }
823
781
  // If we haven't found a match yet, keep track of the next closest match.
824
782
  // Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
825
783
  if (!o) {
826
- var a = ot(r, n.index);
784
+ var a = Ze(n, r.index);
827
785
  if (!a) {
828
- r = e;
829
- } else if (t > n.value) {
830
- if (a < n.value) {
831
- r = e;
786
+ n = e;
787
+ } else if (t > r.value) {
788
+ if (a < r.value) {
789
+ n = e;
832
790
  } else if (a > t) {
833
- r = e;
791
+ n = e;
834
792
  }
835
793
  } else if (t > a) {
836
- r = e;
794
+ n = e;
837
795
  }
838
796
  }
839
797
  return false;
840
798
  }));
841
- return a.length === 0 && r ? [ r ] : a;
799
+ return a.length === 0 && n ? [ n ] : a;
842
800
  };
843
801
  // CONCATENATED MODULE: ./src/utils/ssrDocument.ts
844
802
  /* eslint-disable @typescript-eslint/no-empty-function */
845
- var lt = {
803
+ var tt = {
846
804
  body: {
847
805
  appendChild: function e() {
848
806
  return [];
@@ -896,14 +854,14 @@
896
854
  search: ""
897
855
  }
898
856
  };
899
- function it() {
900
- var e = typeof document !== "undefined" ? document : lt;
857
+ function rt() {
858
+ var e = typeof document !== "undefined" ? document : tt;
901
859
  return e;
902
860
  }
903
861
  // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
904
862
  /* eslint-disable @typescript-eslint/no-empty-function */
905
- var ut = {
906
- document: lt,
863
+ var nt = {
864
+ document: tt,
907
865
  navigator: {
908
866
  userAgent: ""
909
867
  },
@@ -957,69 +915,69 @@
957
915
  clearTimeout(t);
958
916
  }
959
917
  };
960
- function ct() {
961
- var e = typeof window !== "undefined" ? window : ut;
918
+ function ot() {
919
+ var e = typeof window !== "undefined" ? window : nt;
962
920
  return e;
963
921
  }
964
922
  // CONCATENATED MODULE: ./src/Select/SelectBase.tsx
965
- function st(e) {
966
- return dt(e) || pt(e) || mt(e) || ft();
923
+ function at(e) {
924
+ return ut(e) || it(e) || pt(e) || lt();
967
925
  }
968
- function ft() {
926
+ function lt() {
969
927
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
970
928
  }
971
- function pt(e) {
929
+ function it(e) {
972
930
  if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
973
931
  }
974
- function dt(e) {
975
- if (Array.isArray(e)) return ht(e);
932
+ function ut(e) {
933
+ if (Array.isArray(e)) return dt(e);
976
934
  }
977
- function vt() {
978
- return vt = Object.assign ? Object.assign.bind() : function(e) {
935
+ function ct() {
936
+ return ct = Object.assign ? Object.assign.bind() : function(e) {
979
937
  for (var t = 1; t < arguments.length; t++) {
980
- var n = arguments[t];
981
- for (var r in n) {
982
- ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
938
+ var r = arguments[t];
939
+ for (var n in r) {
940
+ ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
983
941
  }
984
942
  }
985
943
  return e;
986
- }, vt.apply(null, arguments);
944
+ }, ct.apply(null, arguments);
987
945
  }
988
- function bt(e, t) {
989
- return Ot(e) || gt(e, t) || mt(e, t) || yt();
946
+ function st(e, t) {
947
+ return bt(e) || vt(e, t) || pt(e, t) || ft();
990
948
  }
991
- function yt() {
949
+ function ft() {
992
950
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
993
951
  }
994
- function mt(e, t) {
952
+ function pt(e, t) {
995
953
  if (e) {
996
- if ("string" == typeof e) return ht(e, t);
997
- var n = {}.toString.call(e).slice(8, -1);
998
- return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ht(e, t) : void 0;
954
+ if ("string" == typeof e) return dt(e, t);
955
+ var r = {}.toString.call(e).slice(8, -1);
956
+ 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) ? dt(e, t) : void 0;
999
957
  }
1000
958
  }
1001
- function ht(e, t) {
959
+ function dt(e, t) {
1002
960
  (null == t || t > e.length) && (t = e.length);
1003
- for (var n = 0, r = Array(t); n < t; n++) {
1004
- r[n] = e[n];
961
+ for (var r = 0, n = Array(t); r < t; r++) {
962
+ n[r] = e[r];
1005
963
  }
1006
- return r;
964
+ return n;
1007
965
  }
1008
- function gt(e, t) {
1009
- var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
1010
- if (null != n) {
1011
- var r, o, a, l, i = [], u = !0, c = !1;
966
+ function vt(e, t) {
967
+ var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
968
+ if (null != r) {
969
+ var n, o, a, l, i = [], u = !0, c = !1;
1012
970
  try {
1013
- if (a = (n = n.call(e)).next, 0 === t) {
1014
- if (Object(n) !== n) return;
971
+ if (a = (r = r.call(e)).next, 0 === t) {
972
+ if (Object(r) !== r) return;
1015
973
  u = !1;
1016
- } else for (;!(u = (r = a.call(n)).done) && (i.push(r.value), i.length !== t); u = !0) {
974
+ } else for (;!(u = (n = a.call(r)).done) && (i.push(n.value), i.length !== t); u = !0) {
1017
975
  }
1018
976
  } catch (e) {
1019
977
  c = !0, o = e;
1020
978
  } finally {
1021
979
  try {
1022
- if (!u && null != n["return"] && (l = n["return"](), Object(l) !== l)) return;
980
+ if (!u && null != r["return"] && (l = r["return"](), Object(l) !== l)) return;
1023
981
  } finally {
1024
982
  if (c) throw o;
1025
983
  }
@@ -1027,83 +985,83 @@
1027
985
  return i;
1028
986
  }
1029
987
  }
1030
- function Ot(e) {
988
+ function bt(e) {
1031
989
  if (Array.isArray(e)) return e;
1032
990
  }
1033
- function wt(e, t) {
991
+ function yt(e, t) {
1034
992
  if (null == e) return {};
1035
- var n, r, o = Ct(e, t);
993
+ var r, n, o = mt(e, t);
1036
994
  if (Object.getOwnPropertySymbols) {
1037
995
  var a = Object.getOwnPropertySymbols(e);
1038
- for (r = 0; r < a.length; r++) {
1039
- n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
996
+ for (n = 0; n < a.length; n++) {
997
+ r = a[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
1040
998
  }
1041
999
  }
1042
1000
  return o;
1043
1001
  }
1044
- function Ct(e, t) {
1002
+ function mt(e, t) {
1045
1003
  if (null == e) return {};
1046
- var n = {};
1047
- for (var r in e) {
1048
- if ({}.hasOwnProperty.call(e, r)) {
1049
- if (t.includes(r)) continue;
1050
- n[r] = e[r];
1004
+ var r = {};
1005
+ for (var n in e) {
1006
+ if ({}.hasOwnProperty.call(e, n)) {
1007
+ if (t.includes(n)) continue;
1008
+ r[n] = e[n];
1051
1009
  }
1052
1010
  }
1053
- return n;
1011
+ return r;
1054
1012
  }
1055
- function St(e) {
1013
+ function ht(e) {
1056
1014
  "@babel/helpers - typeof";
1057
- return St = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
1015
+ return ht = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
1058
1016
  return typeof e;
1059
1017
  } : function(e) {
1060
1018
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1061
- }, St(e);
1019
+ }, ht(e);
1062
1020
  }
1063
- function kt(e, t) {
1064
- var n = Object.keys(e);
1021
+ function gt(e, t) {
1022
+ var r = Object.keys(e);
1065
1023
  if (Object.getOwnPropertySymbols) {
1066
- var r = Object.getOwnPropertySymbols(e);
1067
- t && (r = r.filter((function(t) {
1024
+ var n = Object.getOwnPropertySymbols(e);
1025
+ t && (n = n.filter((function(t) {
1068
1026
  return Object.getOwnPropertyDescriptor(e, t).enumerable;
1069
- }))), n.push.apply(n, r);
1027
+ }))), r.push.apply(r, n);
1070
1028
  }
1071
- return n;
1029
+ return r;
1072
1030
  }
1073
- function xt(e) {
1031
+ function Ot(e) {
1074
1032
  for (var t = 1; t < arguments.length; t++) {
1075
- var n = null != arguments[t] ? arguments[t] : {};
1076
- t % 2 ? kt(Object(n), !0).forEach((function(t) {
1077
- jt(e, t, n[t]);
1078
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : kt(Object(n)).forEach((function(t) {
1079
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
1033
+ var r = null != arguments[t] ? arguments[t] : {};
1034
+ t % 2 ? gt(Object(r), !0).forEach((function(t) {
1035
+ wt(e, t, r[t]);
1036
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : gt(Object(r)).forEach((function(t) {
1037
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
1080
1038
  }));
1081
1039
  }
1082
1040
  return e;
1083
1041
  }
1084
- function jt(e, t, n) {
1085
- return (t = It(t)) in e ? Object.defineProperty(e, t, {
1086
- value: n,
1042
+ function wt(e, t, r) {
1043
+ return (t = St(t)) in e ? Object.defineProperty(e, t, {
1044
+ value: r,
1087
1045
  enumerable: !0,
1088
1046
  configurable: !0,
1089
1047
  writable: !0
1090
- }) : e[t] = n, e;
1091
- }
1092
- function It(e) {
1093
- var t = Pt(e, "string");
1094
- return "symbol" == St(t) ? t : t + "";
1095
- }
1096
- function Pt(e, t) {
1097
- if ("object" != St(e) || !e) return e;
1098
- var n = e[Symbol.toPrimitive];
1099
- if (void 0 !== n) {
1100
- var r = n.call(e, t || "default");
1101
- if ("object" != St(r)) return r;
1048
+ }) : e[t] = r, e;
1049
+ }
1050
+ function St(e) {
1051
+ var t = Ct(e, "string");
1052
+ return "symbol" == ht(t) ? t : t + "";
1053
+ }
1054
+ function Ct(e, t) {
1055
+ if ("object" != ht(e) || !e) return e;
1056
+ var r = e[Symbol.toPrimitive];
1057
+ if (void 0 !== r) {
1058
+ var n = r.call(e, t || "default");
1059
+ if ("object" != ht(n)) return n;
1102
1060
  throw new TypeError("@@toPrimitive must return a primitive value.");
1103
1061
  }
1104
1062
  return ("string" === t ? String : Number)(e);
1105
1063
  }
1106
- var Et = {
1064
+ var kt = {
1107
1065
  allowKeyMatching: a().bool,
1108
1066
  allowNewValues: a().bool,
1109
1067
  animateLoading: a().bool,
@@ -1152,322 +1110,110 @@
1152
1110
  /** @private. */
1153
1111
  virtualization: a().number
1154
1112
  };
1155
- var Mt = ce()((function(e) {
1113
+ var xt = re()((function(e) {
1156
1114
  return [ e ];
1157
1115
  }));
1158
1116
  // preserve separate widths for single vs. multi mode
1159
- var At = ce()((function(e) {
1160
- var t = e.anchorWidth, n = e.isMultiple, r = e.maxHeight, o = e.menuStyle;
1161
- return n ? xt({
1117
+ var jt = re()((function(e) {
1118
+ var t = e.anchorWidth, r = e.isMultiple, n = e.maxHeight, o = e.menuStyle;
1119
+ return r ? Ot({
1162
1120
  width: Math.max(t !== null && t !== void 0 ? t : 0, 200),
1163
- maxHeight: r
1164
- }, o) : xt({
1121
+ maxHeight: n
1122
+ }, o) : Ot({
1165
1123
  minWidth: t !== null && t !== void 0 ? t : undefined,
1166
1124
  maxWidth: Math.max(t !== null && t !== void 0 ? t : 0, 300),
1167
- maxHeight: r
1125
+ maxHeight: n
1168
1126
  }, o);
1169
1127
  }));
1170
- var _t = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
1171
- function Rt(e) {
1128
+ var Pt = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
1129
+ function Et(e) {
1172
1130
  return e && i()(e.props, "value");
1173
1131
  }
1174
- function Vt(e, t) {
1175
- return "".concat(St(e), "-").concat(e, "-").concat(t);
1132
+ function It(e, t) {
1133
+ return "".concat(ht(e), "-").concat(e, "-").concat(t);
1176
1134
  }
1177
- var Tt = [ "append", "error", "prepend" ];
1178
- var Bt = (0, s._)("No matches");
1179
- var qt = (0, s._)("Select...");
1180
- var Nt = function e(n) {
1181
- var r = n.activeItemId, o = n.filterKeyword, a = n.hasChildren, l = n.inputId, i = n.inputRef, u = n.menuListboxId, c = n.multiple, f = n.onClearAll, p = n.onSelectAll, d = n.onTextBlur, v = n.onTextChange, b = n.onTextFocus, y = n.onTextKeyDown, m = n.optionSelection, h = n.placement, g = n.selectAllAppearance, O = n.textHasFocus;
1182
- var w = (0, s._)("Select all options".concat(m.current === "all" ? " disabled" : ""));
1183
- var C = (0, s._)("Clear all options".concat(m.current === "none" ? " disabled" : ""));
1135
+ var Rt = [ "append", "error", "prepend" ];
1136
+ var Mt = (0, s._)("No matches");
1137
+ var Tt = (0, s._)("Select...");
1138
+ var _t = function e(r) {
1139
+ var n = r.activeItemId, o = r.filterA11yId, a = r.filterKeyword, l = r.hasChildren, i = r.inputId, u = r.inputRef, c = r.menuListboxId, f = r.multiple, p = r.onClearAll, d = r.onSelectAll, v = r.onTextBlur, b = r.onTextChange, y = r.onTextFocus, m = r.onTextKeyDown, h = r.optionSelection, g = r.placement, O = r.selectAllAppearance, w = r.textHasFocus;
1140
+ var S = (0, s._)("Select all options".concat(h.current === "all" ? " disabled" : ""));
1141
+ var C = (0, s._)("Clear all options".concat(h.current === "none" ? " disabled" : ""));
1184
1142
  // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
1185
- var S = t().createElement(nt, {
1186
- $placement: h,
1143
+ var k = t().createElement(Qe, {
1144
+ $placement: g,
1187
1145
  key: "selectAll"
1188
- }, t().createElement(tt, {
1189
- $disabled: m.current === "all",
1190
- "aria-label": w,
1191
- onClick: p,
1146
+ }, t().createElement(Xe, {
1147
+ $disabled: h.current === "all",
1148
+ "aria-label": S,
1149
+ onClick: d,
1192
1150
  "data-test": "select-all"
1193
- }, o ? (0, s._)("Select all Matches") : (0, s._)("Select all")), t().createElement(tt, {
1194
- $disabled: m.current === "none",
1151
+ }, a ? (0, s._)("Select all Matches") : (0, s._)("Select all")), t().createElement(Xe, {
1152
+ $disabled: h.current === "none",
1195
1153
  "aria-label": C,
1196
- onClick: f,
1154
+ onClick: p,
1197
1155
  "data-test": "clear-all"
1198
- }, o ? (0, s._)("Clear all Matches") : (0, s._)("Clear all")));
1156
+ }, a ? (0, s._)("Clear all Matches") : (0, s._)("Clear all")));
1199
1157
 
1200
1158
  return t().createElement("div", {
1201
1159
  key: "controls"
1202
- }, t().createElement(Ye, {
1160
+ }, o && t().createElement(he(), {
1161
+ id: o
1162
+ }, (0, s._)("Type to filter")), t().createElement(Ue, {
1203
1163
  key: "filter",
1204
1164
  "data-test": "filter"
1205
- }, t().createElement(Se(), {
1206
- value: o,
1165
+ }, t().createElement(ye(), {
1166
+ value: a,
1207
1167
  autoCapitalize: "off",
1208
1168
  autoComplete: "off",
1209
1169
  autoCorrect: "off",
1210
1170
  spellCheck: false,
1211
- onChange: v,
1212
- onKeyDown: y,
1213
- onFocus: b,
1214
- onBlur: d,
1171
+ onChange: b,
1172
+ onKeyDown: m,
1173
+ onFocus: y,
1174
+ onBlur: v,
1215
1175
  placeholder: (0, s._)("filter"),
1216
1176
  role: "combobox",
1217
1177
  "aria-expanded": "true",
1218
- "aria-controls": u,
1219
- "aria-owns": a ? r : undefined,
1178
+ "aria-controls": c,
1179
+ "aria-owns": l ? n : undefined,
1220
1180
  "aria-label": (0, s._)("Filter"),
1221
1181
  "aria-autocomplete": "list",
1222
- "aria-activedescendant": O && a ? r : undefined,
1223
- inputRef: i,
1224
- inputId: l,
1182
+ "aria-activedescendant": w && l ? n : undefined,
1183
+ inputRef: u,
1184
+ inputId: i,
1225
1185
  canClear: true,
1226
- startAdornment: t().createElement(Ze, null, t().createElement(Fe, null))
1227
- })), c && a && g === "buttongroup" && S);
1228
- };
1229
- var Dt = false;
1230
- var Lt = function n(r) {
1231
- var o = r.activeIndex, a = r.activeItemId, l = r.allowKeyMatching, i = r.allowNewValues, u = r.availableMatchOptions, c = r.availableOptionCount, p = r.children, d = r.currentValues, v = r.filter, b = r.filterKeyword, y = r.firstSelectedOptionIndex, m = r.isLoadingOptions, h = r.multiple, g = r.newTopValues, O = r.onActiveOptionMount, w = r.onClearAll, C = r.onClick, S = r.onKeyDown, k = r.onOptionMount, x = r.onScrollBottom, j = r.onSelectAll, I = r.optionSelection, P = r.selectAllAppearance, E = r.selectedOptionCount, M = r.setActiveValue, A = r.setAvailableMatchOptions, R = r.setAvailableOptionCount, V = r.setDisplayedValues, T = r.setFirstSelectedOptionIndex, B = r.setOptionSelection, q = r.setSelectedOptionCount, N = r.textHasFocus, D = r.toggle;
1232
- R(0);
1233
- T(undefined);
1234
- q(0);
1235
- M(undefined);
1236
- A([]);
1237
- var L;
1238
- var F = 0;
1239
- var K = false;
1240
- // used to avoid overwriting the selected item ref in multiple mode
1241
- var H;
1242
- var $ = e.Children.toArray(p).reduce((function(n, r, o) {
1243
- // ignore Headings and Dividers
1244
- if (!Rt(r)) {
1245
- n.push(r);
1246
- return n;
1247
- }
1248
- var a = r.props, i = a.disabled, c = a.hidden, s = a.label, p = a.value;
1249
- // Find out if the search string exactly matches a value
1250
- if (p === b) {
1251
- L = true;
1252
- }
1253
- var y = d && d.indexOf(p) >= 0;
1254
- var O = !!y && !i && !H;
1255
- var w = l && !h && !v && !m && !x;
1256
- var j = Vt(p, s);
1257
- var I = -1;
1258
- if (w && !i && !c) {
1259
- u.current.push({
1260
- label: s,
1261
- value: p
1262
- });
1263
- I = u.current.length - 1;
1264
- }
1265
- // Format the Menu.Item
1266
- var P = (0, e.cloneElement)(r, {
1267
- key: r.key || o,
1268
- onClick: C,
1269
- onKeyDown: w ? function(e) {
1270
- return S(e, I);
1271
- } : undefined,
1272
- selected: y,
1273
- multiple: h,
1274
- role: "option",
1275
- ref: function e(t) {
1276
- return k(t, j, O);
1277
- }
1278
- });
1279
- if (O) {
1280
- H = true;
1281
- }
1282
- if (g && g.indexOf(p) >= 0) {
1283
- if (F === 0) {
1284
- n.splice(F, 0, t().createElement(f.Divider, {
1285
- key: "topDivider"
1286
- }));
1287
- K = true;
1288
- }
1289
- n.splice(F, 0, P);
1290
- F += 1;
1291
- } else {
1292
- n.push(P);
1293
- }
1294
- return n;
1295
- }), []);
1296
- // In multiple mode, add missing items
1297
- if (h) {
1298
- ae()(d, (function(e) {
1299
- var n = re()($, (function(t) {
1300
- return Rt(t) && t.props && t.props.value === e;
1301
- }));
1302
- if (!n) {
1303
- if (e === b) {
1304
- L = true;
1305
- }
1306
- var r = g && g.indexOf(e) >= 0;
1307
- var o = g.length;
1308
- if (F === 0) {
1309
- $.splice(0, 0, t().createElement(f.Divider, {
1310
- key: "topDivider"
1311
- }));
1312
- F += 1;
1313
- K = true;
1314
- }
1315
- $.splice(r ? 0 : o + 1, 0, t().createElement(_, {
1316
- label: String(e),
1317
- value: e,
1318
- key: "missing-value-".concat(e),
1319
- onClick: C,
1320
- multiple: h,
1321
- selected: true
1322
- }));
1323
- if (r) {
1324
- F += 1;
1325
- }
1326
- }
1327
- }));
1328
- }
1329
- var z = v === "controlled";
1330
- // Filter the items
1331
- var W = (0, je.stringToKeywords)(b);
1332
- $ = z ? $ : $.filter((function(e) {
1333
- if (Rt(e)) {
1334
- return (0, je.testPhrase)(e.props.label, W);
1335
- }
1336
- return true;
1337
- // Keep all headers and non-interactive options
1338
- })).map((function(t) {
1339
- if (!Rt(t)) {
1340
- return t;
1341
- }
1342
- // highlight matched text
1343
- var n = W && (0, je.keywordLocations)(t.props.label, W);
1344
-
1345
- return (0, e.cloneElement)(t, {
1346
- matchRanges: n || undefined
1347
- });
1348
- }));
1349
- // Add the option to add the new value
1350
- if (i && !L && b) {
1351
- var U = K ? F + 1 : F;
1352
- $.splice(U, 0, t().createElement(_, {
1353
- label: "".concat(b, " (new value)"),
1354
- value: b,
1355
- key: "newValue",
1356
- multiple: h,
1357
- onClick: C
1358
- }));
1359
- }
1360
- // When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
1361
- var G = P === "checkbox" && h && $.length > 1 ? 1 : 0;
1362
- var J = true;
1363
- // Highlight the selected Items and remove hidden
1364
- $ = $.reduce((function(t, n) {
1365
- // ignore Dividers & Headings
1366
- if (!Rt(n)) {
1367
- t.push(n);
1368
- return t;
1369
- }
1370
- // Ignore any hidden items
1371
- if (n.props && n.props.hidden) {
1372
- return t;
1373
- }
1374
- if (n.props.selected && !n.props.disabled && y.current == null) {
1375
- T(c.current);
1376
- }
1377
- var r = G === o;
1378
- G += 1;
1379
- R(c.current + 1);
1380
- q(E.current + (n.props.selected ? 1 : 0));
1381
- if (n.key !== "newValue" && !n.props.disabled && !n.props.selected) {
1382
- J = false;
1383
- }
1384
- if (!r || !N) {
1385
- t.push(n);
1386
- return t;
1387
- }
1388
- if (!n.props.disabled) {
1389
- M(n.props.value);
1390
- }
1391
- var l = (0, e.cloneElement)(n, {
1392
- active: r,
1393
- id: a,
1394
- ref: O
1395
- });
1396
- t.push(l);
1397
- return t;
1398
- }), []);
1399
- B(E.current === 0 && "none" || J && "all" || "some");
1400
- // add select all option
1401
- if (P === "checkbox" && h && c.current > 0) {
1402
- var X;
1403
- if (I.current === "all") {
1404
- if (b === "") {
1405
- X = (0, s._)("Clear all");
1406
- } else {
1407
- X = (0, s._)("Clear all matches");
1408
- }
1409
- } else if (b === "") {
1410
- X = (0, s._)("Select all");
1411
- } else {
1412
- X = (0, s._)("Select all matches");
1413
- }
1414
- if (o === 0 && N) {
1415
- M("selectAll");
1416
- }
1417
- $.unshift( t().createElement($e, {
1418
- active: o === 0,
1419
- changedToggle: !!D,
1420
- id: o === 0 ? a : undefined,
1421
- onClick: I.current === "all" ? w : j,
1422
- selectAllLabel: X,
1423
- selected: I.current === "all" || I.current !== "none" && "some",
1424
- totalCount: d.length,
1425
- tabIndex: -1,
1426
- ref: O
1427
- }), t().createElement(f.Divider, {
1428
- key: "selectAllDivider"
1429
- }));
1430
- }
1431
- V($.reduce((function(e, t) {
1432
- if (Rt(t)) {
1433
- e.push(t.props.value);
1434
- }
1435
- return e;
1436
- }), []));
1437
- Dt = $.some((function(e) {
1438
- return Rt(e);
1439
- }));
1440
- // eslint-disable-next-line react/jsx-no-useless-fragment
1441
-
1442
- return t().createElement(t().Fragment, null, $);
1186
+ startAdornment: t().createElement(Ge, null, t().createElement(qe, null))
1187
+ })), f && l && O === "buttongroup" && k);
1443
1188
  };
1444
- var Ft = function e(t) {
1445
- var n = t.prefixLabel, r = t.label, o = t.suffixLabel;
1446
- var a = r;
1447
- if (n) {
1448
- a = [ "".concat(n, ": ") ].concat(a);
1189
+ var At = false;
1190
+ var Bt = function e(t) {
1191
+ var r = t.prefixLabel, n = t.label, o = t.suffixLabel;
1192
+ var a = n;
1193
+ if (r) {
1194
+ a = [ "".concat(r, ": ") ].concat(a);
1449
1195
  }
1450
1196
  if (o) {
1451
- a = te()(a).concat(" ".concat(o));
1197
+ a = G()(a).concat(" ".concat(o));
1452
1198
  }
1453
1199
  return a;
1454
1200
  };
1455
- function Kt(n) {
1456
- var r = n.appearance, o = n.append, a = n.children, l = n.currentValues, i = l === void 0 ? [] : l, u = n.describedBy, c = n.disabled, f = n.elementRef, p = n.error, d = n.inline, v = n.labelText, b = n.labelledBy, y = n.multiple, m = n.onClick, h = n.placeholder, g = n.prefixLabel, O = n.prepend, w = n.required, C = n.suffixLabel, S = n.toggle, k = n.toggleContent, x = wt(n, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent" ]);
1201
+ function qt(r) {
1202
+ var n = r.appearance, o = r.append, a = r.children, l = r.currentValues, i = l === void 0 ? [] : l, u = r.describedBy, c = r.disabled, f = r.elementRef, p = r.error, d = r.inline, v = r.labelText, b = r.labelledBy, y = r.multiple, m = r.onClick, h = r.placeholder, g = r.prefixLabel, O = r.prepend, w = r.required, S = r.suffixLabel, C = r.toggle, k = r.toggleContent, x = yt(r, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent" ]);
1457
1203
  var j;
1458
- var I;
1459
- var P = [];
1204
+ var P;
1205
+ var E = [];
1460
1206
  // Generate buttonLabels
1461
- var E = e.Children.toArray(a);
1462
- var M = i.reduce((function(e, t, n, r) {
1463
- var o = re()(E, (function(e) {
1464
- return Rt(e) && e.props.value === t;
1207
+ var I = e.Children.toArray(a);
1208
+ var R = i.reduce((function(e, t, r, n) {
1209
+ var o = X()(I, (function(e) {
1210
+ return Et(e) && e.props.value === t;
1465
1211
  }));
1466
1212
  if (o) {
1467
1213
  var a = o.props, l = a.children, u = a.icon, c = a.label;
1468
1214
  var f = k !== "optionLabel" && l ? l : c;
1469
1215
  e.push(f);
1470
- P.push(c);
1216
+ E.push(c);
1471
1217
  // if not in multiple mode, add the icon
1472
1218
  if (!y && i.length === 1) {
1473
1219
  j = u;
@@ -1475,45 +1221,46 @@
1475
1221
  } else if (y) {
1476
1222
  // only add values that don't match an option in "multiple" mode to preserve old behaviour
1477
1223
  e.push(t);
1478
- P.push(t.toString());
1224
+ E.push(t.toString());
1479
1225
  }
1480
- if (n < r.length - 1) {
1226
+ if (r < n.length - 1) {
1481
1227
  e.push((0, s._)(", "));
1482
- P.push((0, s._)(", "));
1228
+ E.push((0, s._)(", "));
1483
1229
  }
1484
1230
  return e;
1485
1231
  }), []);
1486
- I = M;
1232
+ P = R;
1487
1233
  // only apply prefix / suffix if the label is not empty
1488
- if (I.length > 0) {
1234
+ if (P.length > 0) {
1489
1235
  // If there's more than one item selected, read out the selected total
1490
1236
  // rather than reading out each selected item
1491
- P = Ft({
1237
+ E = Bt({
1492
1238
  prefixLabel: g,
1493
- label: I.length > 1 ? [ "".concat(i.length, " items selected") ] : P,
1494
- suffixLabel: C
1239
+ label: P.length > 1 ? [ "".concat(i.length, " items selected") ] : E,
1240
+ suffixLabel: S
1495
1241
  });
1496
- I = Ft({
1242
+ P = Bt({
1497
1243
  prefixLabel: g,
1498
- label: I,
1499
- suffixLabel: C
1244
+ label: P,
1245
+ suffixLabel: S
1500
1246
  });
1501
1247
  }
1502
1248
  // single <Select> behaviour is to show the placeholder if all parts of the label
1503
1249
  // are empty strings so we replicate this behaviour here
1504
- if (I.length === 0 || !y && I.every((function(e) {
1250
+ if (P.length === 0 || !y && P.every((function(e) {
1505
1251
  return e === "";
1506
1252
  }))) {
1507
- I = Mt(h);
1508
- P = I;
1253
+ P = xt(h);
1254
+ E = P;
1509
1255
  }
1510
- var A = xt({
1256
+ var M = Object.keys(x).includes("aria-labelledby");
1257
+ var T = Ot({
1511
1258
  "aria-describedby": u,
1512
- "aria-label": "".concat(v ? "".concat(v, ", ") : "").concat(P.join("")),
1259
+ "aria-label": b || M ? undefined : "".concat(v ? "".concat(v, ", ") : "").concat(E.join("")),
1260
+ // aria-labelledby takes precedence over aria-label, so existence of both is redundant
1513
1261
  "aria-labelledby": b,
1514
- // aria-labelledby takes precedence over aria-label if exists
1515
1262
  "aria-required": w,
1516
- "data-select-appearance": r,
1263
+ "data-select-appearance": n,
1517
1264
  append: o,
1518
1265
  prepend: O,
1519
1266
  onClick: m,
@@ -1523,568 +1270,738 @@
1523
1270
  error: p
1524
1271
  }, x);
1525
1272
  if (y) {
1526
- A["data-test-values"] = JSON.stringify(i);
1273
+ T["data-test-values"] = JSON.stringify(i);
1527
1274
  } else {
1528
- var _ = bt(i, 1), R = _[0];
1529
- A["data-test-value"] = R;
1275
+ var _ = st(i, 1), A = _[0];
1276
+ T["data-test-value"] = A;
1530
1277
  }
1531
- if (S) {
1278
+ if (C) {
1532
1279
 
1533
- return (0, e.cloneElement)(S, A);
1280
+ return (0, e.cloneElement)(C, T);
1534
1281
  }
1535
- if (r === "link") {
1282
+ if (n === "link") {
1536
1283
 
1537
- return t().createElement(ge(), vt({}, A, {
1284
+ return t().createElement(pe(), ct({}, T, {
1538
1285
  "data-select-appearance": "link"
1539
- }), !!j && t().createElement(Xe, null, j), I || h, t().createElement(Qe, null, t().createElement(Te, null)));
1286
+ }), !!j && t().createElement(ze, null, j), P || h, t().createElement(We, null, t().createElement(Re, null)));
1540
1287
  }
1541
1288
 
1542
- return t().createElement(Je, vt({}, A, {
1289
+ return t().createElement($e, ct({}, T, {
1543
1290
  $multiple: y,
1544
- appearance: r,
1545
- label: I,
1291
+ appearance: n,
1292
+ label: P,
1546
1293
  error: p,
1547
1294
  icon: j,
1548
1295
  inline: d,
1549
1296
  isMenu: true,
1550
1297
  onClick: m
1551
- }, fe()(x, Tt)), !!i.length && y && t().createElement(et, {
1298
+ }, oe()(x, Rt)), !!i.length && y && t().createElement(Je, {
1552
1299
  "data-role": "count"
1553
1300
  }, "(", i.length, ")"));
1554
1301
  }
1555
- Kt[ye.legacyRefMode] = true;
1556
- function Ht(n) {
1557
- var r;
1558
- var o = n.allowKeyMatching, a = o === void 0 ? true : o, l = n.animateLoading, i = n.appearance, u = i === void 0 ? "toggle" : i, c = n.append, s = n.allowNewValues, f = n.children, p = n.defaultPlacement, d = p === void 0 ? "vertical" : p, v = n.defaultValues, b = n.describedBy, y = n.disabled, m = n.elementRef, h = n.error, g = n.filter, O = n.footerMessage, w = n.inline, C = n.inputId, S = n.inputRef, k = n.isLoadingOptions, x = n.labelledBy, j = n.labelText, I = n.loadingMessage, P = n.menuStyle, E = P === void 0 ? {} : P, M = n.multiple, A = n.name, _ = n.noOptionsMessage, R = _ === void 0 ? Bt : _, V = n.onChange, T = n.onScroll, B = n.onScrollBottom, q = n.onFilterChange, N = n.onClick, D = n.onClose, L = n.onOpen, F = n.required, K = n.placeholder, H = K === void 0 ? qt : K, $ = n.prefixLabel, z = n.prepend, W = n.repositionMode, U = W === void 0 ? "flip" : W, G = n.selectAllAppearance, J = G === void 0 ? "buttongroup" : G, X = n.showSelectedValuesFirst, Q = n.suffixLabel, Y = n.tabConfirmsNewValue, Z = n.values, ee = n.virtualization, te = n.toggle, ne = n.toggleContent, oe = ne === void 0 ? "optionChildren" : ne, ae = wt(n, [ "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" ]);
1302
+ qt[ce.legacyRefMode] = true;
1303
+ function Vt(r) {
1304
+ var n = r.allowKeyMatching, o = n === void 0 ? true : n, a = r.animateLoading, l = r.appearance, i = l === void 0 ? "toggle" : l, u = r.append, c = r.allowNewValues, p = r.children, d = r.defaultPlacement, v = d === void 0 ? "vertical" : d, b = r.defaultValues, y = r.describedBy, m = r.disabled, h = r.elementRef, g = r.error, O = r.filter, w = r.footerMessage, S = r.inline, x = r.inputId, j = r.inputRef, P = r.isLoadingOptions, E = r.labelledBy, I = r.labelText, R = r.loadingMessage, M = r.menuStyle, T = M === void 0 ? {} : M, _ = r.multiple, A = r.name, B = r.noOptionsMessage, q = B === void 0 ? Mt : B, V = r.onChange, D = r.onScroll, N = r.onScrollBottom, L = r.onFilterChange, F = r.onClick, K = r.onClose, H = r.onOpen, $ = r.required, z = r.placeholder, W = z === void 0 ? Tt : z, U = r.prefixLabel, G = r.prepend, J = r.repositionMode, Q = J === void 0 ? "flip" : J, Z = r.selectAllAppearance, te = Z === void 0 ? "buttongroup" : Z, re = r.showSelectedValuesFirst, ne = r.suffixLabel, oe = r.tabConfirmsNewValue, ae = r.values, ie = r.virtualization, ce = r.toggle, fe = r.toggleContent, pe = fe === void 0 ? "optionChildren" : fe, be = yt(r, [ "allowKeyMatching", "animateLoading", "appearance", "append", "allowNewValues", "children", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "labelText", "loadingMessage", "menuStyle", "multiple", "name", "noOptionsMessage", "onChange", "onScroll", "onScrollBottom", "onFilterChange", "onClick", "onClose", "onOpen", "required", "placeholder", "prefixLabel", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "suffixLabel", "tabConfirmsNewValue", "values", "virtualization", "toggle", "toggleContent" ]);
1559
1305
  // @docs-props-type SelectBasePropsBase
1560
- var le = (0, rt["default"])({
1561
- value: Z,
1562
- defaultValue: v,
1563
- componentName: "SelectBase"
1306
+ var ye = (0, Ye["default"])({
1307
+ componentName: "SelectBase",
1308
+ /* eslint-disable-next-line prefer-rest-params */
1309
+ componentProps: arguments[0],
1310
+ // see SUI-7028
1311
+ defaultValuePropName: "defaultValues",
1312
+ valuePropName: "values"
1564
1313
  });
1565
1314
  // states
1566
- var ue = (0, e.useState)((function() {
1315
+ var me = (0, e.useState)((function() {
1567
1316
  return {
1568
- activeItemId: (0, Ie.createDOMID)("active-item"),
1569
- menuListboxId: (0, Ie.createDOMID)("menu-listbox")
1317
+ activeItemId: (0, Se.createDOMID)("active-item"),
1318
+ menuListboxId: (0, Se.createDOMID)("menu-listbox")
1570
1319
  };
1571
- })), ce = bt(ue, 1), se = ce[0], fe = se.activeItemId, pe = se.menuListboxId;
1572
- var ve = (0, e.useState)(0), ye = bt(ve, 2), he = ye[0], ge = ye[1];
1573
- var Ce = (0, e.useState)(""), Se = bt(Ce, 2), ke = Se[0], je = Se[1];
1574
- var Ee = (0, e.useState)(false), Me = bt(Ee, 2), Ae = Me[0], _e = Me[1];
1575
- var Re = (0, e.useState)(false), Ve = bt(Re, 2), Te = Ve[0], Be = Ve[1];
1576
- var qe = (0, e.useState)([]), Ne = bt(qe, 2), De = Ne[0], Le = Ne[1];
1577
- var Fe = (0, e.useState)(v || []), Ke = bt(Fe, 2), He = Ke[0], $e = Ke[1];
1320
+ })), he = st(me, 1), ge = he[0], ke = ge.activeItemId, xe = ge.menuListboxId;
1321
+ var je = (0, e.useState)(0), Pe = st(je, 2), Ee = Pe[0], Ie = Pe[1];
1322
+ var Re = (0, e.useState)(""), Me = st(Re, 2), Te = Me[0], _e = Me[1];
1323
+ var Ae = (0, e.useState)(false), Be = st(Ae, 2), qe = Be[0], Ve = Be[1];
1324
+ var De = (0, e.useState)(false), Le = st(De, 2), Fe = Le[0], Ke = Le[1];
1325
+ var He = (0, e.useState)([]), $e = st(He, 2), ze = $e[0], We = $e[1];
1326
+ var Ue = (0, e.useState)(b || []), Ge = st(Ue, 2), Je = Ge[0], Xe = Ge[1];
1578
1327
  // previous state
1579
- var ze = xe()(he);
1328
+ var Qe = Oe()(Ee);
1580
1329
  // refs
1581
- var We = (0, e.useRef)(null);
1582
- var Ue = (0, e.useRef)(null);
1583
- var Ge = (0, e.useRef)(null);
1584
- var Je = (0, e.useRef)([]);
1585
- var Xe = (0, e.useRef)([]);
1586
- var Qe = (0, e.useRef)(ze);
1587
- var Ye = (0, e.useRef)();
1588
- var Ze = (0, e.useRef)({});
1589
- var et = (0, e.useRef)(0);
1590
- var tt = (0, e.useRef)([]);
1591
- var nt = (0, e.useRef)(null);
1592
- var ot = (0, e.useRef)();
1593
- var lt = (0, e.useRef)(0);
1594
- var it = (0, e.useRef)("none");
1595
- // setters for refs used in subcomponents
1596
- var ut = function e(t) {
1597
- et.current = t;
1598
- };
1599
- var ft = function e(t) {
1600
- ot.current = t;
1601
- };
1602
- var pt = function e(t) {
1603
- lt.current = t;
1604
- };
1605
- var dt = function e(t) {
1606
- Ye.current = t;
1607
- };
1608
- var yt = function e(t) {
1609
- Xe.current = t;
1610
- };
1611
- var mt = function e(t) {
1612
- it.current = t;
1613
- };
1614
- var ht = function e(t) {
1615
- tt.current = t;
1616
- };
1330
+ var Ze = (0, e.useRef)(null);
1331
+ var tt = (0, e.useRef)(null);
1332
+ var rt = (0, e.useRef)(null);
1333
+ var nt = (0, e.useRef)([]);
1334
+ var lt = (0, e.useRef)([]);
1335
+ var it = (0, e.useRef)(Qe);
1336
+ var ut = (0, e.useRef)();
1337
+ var ft = (0, e.useRef)({});
1338
+ var pt = (0, e.useRef)(0);
1339
+ var dt = (0, e.useRef)([]);
1340
+ var vt = (0, e.useRef)(null);
1341
+ var bt = (0, e.useRef)();
1342
+ var mt = (0, e.useRef)(0);
1343
+ var ht = (0, e.useRef)("none");
1344
+ var gt = (0, e.useState)(O ? (0, Se.createDOMID)("filter") : undefined), Ot = st(gt, 1), wt = Ot[0];
1617
1345
  (0, e.useEffect)((function() {
1618
1346
  if (false) {}
1619
- }), [ u, c, h, z ]);
1620
- var gt = (0, e.useCallback)((function() {
1621
- var e = le ? Z : He;
1622
- return M || e == null ? e : e.slice(0, 1);
1623
- }), [ le, M, Z, He ]);
1624
- var Ot = (0, e.useCallback)((function() {
1347
+ }), [ i, u, g, G ]);
1348
+ var St = (0, e.useCallback)((function() {
1349
+ var e = ye ? ae : Je;
1350
+ return _ || e == null ? e : e.slice(0, 1);
1351
+ }), [ ye, _, ae, Je ]);
1352
+ var Ct = (0, e.useCallback)((function() {
1625
1353
  var e;
1626
1354
  // in non-multiple mode, don't move values to the top of the list
1627
- return M && X !== "never" ? (e = gt()) !== null && e !== void 0 ? e : [] : [];
1628
- }), [ gt, M, X ]);
1629
- var Ct = (0, e.useCallback)((function(e) {
1630
- var t = ke;
1631
- _e(true);
1632
- Le(Ot());
1355
+ return _ && re !== "never" ? (e = St()) !== null && e !== void 0 ? e : [] : [];
1356
+ }), [ St, _, re ]);
1357
+ var kt = (0, e.useCallback)((function(e) {
1358
+ var t = Te;
1359
+ Ve(true);
1360
+ We(Ct());
1633
1361
  // SUI-3234: preserve existing behavior difference between <Select> and <Multiselect.Compact>
1634
- if (M) {
1635
- je("");
1362
+ if (_) {
1363
+ _e("");
1636
1364
  }
1637
- if (t !== ke) {
1638
- q === null || q === void 0 ? void 0 : q(e, {
1639
- keyword: ke
1365
+ if (t !== Te) {
1366
+ L === null || L === void 0 ? void 0 : L(e, {
1367
+ keyword: Te
1640
1368
  });
1641
1369
  }
1642
- }), [ ke, Ot, M, q ]);
1370
+ }), [ Te, Ct, _, L ]);
1643
1371
  (0, e.useEffect)((function() {
1644
- if (Ae) {
1645
- L === null || L === void 0 ? void 0 : L();
1646
- if (nt.current && !g) {
1647
- nt.current.focus();
1372
+ if (qe) {
1373
+ H === null || H === void 0 ? void 0 : H();
1374
+ if (vt.current && !O) {
1375
+ vt.current.focus();
1648
1376
  } else {
1649
1377
  var e;
1650
- ge((e = ot.current) !== null && e !== void 0 ? e : 0);
1378
+ Ie((e = bt.current) !== null && e !== void 0 ? e : 0);
1651
1379
  }
1652
1380
  }
1653
- }), [ L, Ae, De, ke, g ]);
1654
- var St = (0, e.useCallback)((function() {
1655
- _e(false);
1656
- ge(0);
1657
- Qe.current = null;
1658
- D === null || D === void 0 ? void 0 : D();
1659
- }), [ D ]);
1660
- var kt = (0, e.useCallback)((function(e, t) {
1661
- var n;
1662
- var r = (n = gt()) !== null && n !== void 0 ? n : [];
1663
- var o = r.indexOf(t);
1381
+ }), [ H, qe, ze, Te, O ]);
1382
+ var xt = (0, e.useCallback)((function() {
1383
+ Ve(false);
1384
+ Ie(0);
1385
+ it.current = null;
1386
+ K === null || K === void 0 ? void 0 : K();
1387
+ }), [ K ]);
1388
+ var Rt = (0, e.useCallback)((function(e, t) {
1389
+ var r;
1390
+ var n = (r = St()) !== null && r !== void 0 ? r : [];
1391
+ var o = n.indexOf(t);
1664
1392
  var a;
1665
- if (M) {
1393
+ if (_) {
1666
1394
  if (o >= 0) {
1667
- a = [].concat(st(r.slice(0, o)), st(r.slice(o + 1)));
1395
+ a = [].concat(at(n.slice(0, o)), at(n.slice(o + 1)));
1668
1396
  } else {
1669
- a = r.concat([ t ]);
1397
+ a = n.concat([ t ]);
1670
1398
  }
1671
1399
  } else {
1672
1400
  // non-multiple mode must always have a value
1673
1401
  a = [ t ];
1674
1402
  }
1675
- var l = !le;
1403
+ var l = !ye;
1676
1404
  if (l) {
1677
- $e(a);
1405
+ Xe(a);
1678
1406
  }
1679
- if (M) {
1407
+ if (_) {
1680
1408
  // in uncontrolled multiple mode, keep the menu open
1681
1409
  if (l) {
1682
- _e(true);
1410
+ Ve(true);
1683
1411
  }
1684
1412
  } else {
1685
1413
  var i;
1686
1414
  // non-multiple mode only supports a single selection
1687
1415
  // so close the menu once a selection is made
1688
- St({
1416
+ xt({
1689
1417
  reason: "contentClick"
1690
1418
  });
1691
- (i = We.current) === null || i === void 0 ? void 0 : i.focus();
1419
+ (i = Ze.current) === null || i === void 0 ? void 0 : i.focus();
1692
1420
  }
1693
1421
  V === null || V === void 0 ? void 0 : V(e, {
1694
1422
  values: a,
1695
1423
  name: A,
1696
1424
  reason: "valueToggle"
1697
1425
  });
1698
- }), [ gt, St, le, M, A, V ]);
1699
- var xt = function e() {
1700
- Ue.current = null;
1701
- Je.current = [];
1702
- if (Ge.current) {
1703
- clearTimeout(Ge.current);
1426
+ }), [ St, xt, ye, _, A, V ]);
1427
+ var Bt = function e() {
1428
+ tt.current = null;
1429
+ nt.current = [];
1430
+ if (rt.current) {
1431
+ clearTimeout(rt.current);
1704
1432
  }
1705
1433
  };
1706
- var jt = (0, e.useCallback)((function(e) {
1707
- var n;
1434
+ var Vt = (0, e.useCallback)((function(e) {
1435
+ var r;
1708
1436
  // this doesn't make sense if we can't select multiple values
1709
- if (!M) {
1437
+ if (!_) {
1710
1438
  return;
1711
1439
  }
1712
- var r = (n = gt()) !== null && n !== void 0 ? n : [];
1713
- var o = de()(r.concat(tt.current));
1714
- o = t().Children.toArray(f).filter((function(e) {
1715
- return Rt(e) && ie()(o, e.props.value) && (!e.props.disabled || ie()(r, e.props.value));
1440
+ var n = (r = St()) !== null && r !== void 0 ? r : [];
1441
+ var o = le()(n.concat(dt.current));
1442
+ o = t().Children.toArray(p).filter((function(e) {
1443
+ return Et(e) && ee()(o, e.props.value) && (!e.props.disabled || ee()(n, e.props.value));
1716
1444
  })).map((function(e) {
1717
1445
  return e.props.value;
1718
1446
  }));
1719
- if (!le) {
1720
- $e(o);
1447
+ if (!ye) {
1448
+ Xe(o);
1721
1449
  }
1722
1450
  V === null || V === void 0 ? void 0 : V(e, {
1723
1451
  values: o,
1724
1452
  name: A,
1725
1453
  reason: "selectAll"
1726
1454
  });
1727
- }), [ f, gt, le, M, A, V ]);
1728
- var It = (0, e.useCallback)((function(e) {
1729
- var n;
1455
+ }), [ p, St, ye, _, A, V ]);
1456
+ var Dt = (0, e.useCallback)((function(e) {
1457
+ var r;
1730
1458
  // this doesn't make sense if we can't select multiple values
1731
- if (!M) {
1459
+ if (!_) {
1732
1460
  return;
1733
1461
  }
1734
- var r = (n = gt()) !== null && n !== void 0 ? n : [];
1735
- var o = be().apply(void 0, [ r ].concat(st(tt.current)));
1462
+ var n = (r = St()) !== null && r !== void 0 ? r : [];
1463
+ var o = ue().apply(void 0, [ n ].concat(at(dt.current)));
1736
1464
  // this will unselect all selected values unless those values are disabled or hidden by the filter
1737
- var a = t().Children.toArray(f).filter((function(e) {
1738
- return Rt(e) && (ie()(r, e.props.value) && e.props.disabled || ie()(o, e.props.value));
1465
+ var a = t().Children.toArray(p).filter((function(e) {
1466
+ return Et(e) && (ee()(n, e.props.value) && e.props.disabled || ee()(o, e.props.value));
1739
1467
  })).map((function(e) {
1740
1468
  return e.props.value;
1741
1469
  }));
1742
- if (!le) {
1743
- $e(a);
1470
+ if (!ye) {
1471
+ Xe(a);
1744
1472
  }
1745
1473
  V === null || V === void 0 ? void 0 : V(e, {
1746
1474
  values: a,
1747
1475
  name: A,
1748
1476
  reason: "clearAll"
1749
1477
  });
1750
- }), [ f, gt, le, M, A, V ]);
1751
- var Pt = (0, e.useCallback)((function(e) {
1752
- if (Ae && !k) {
1753
- B === null || B === void 0 ? void 0 : B(e);
1754
- }
1755
- }), [ Ae, k, B ]);
1756
- var Et = (0, e.useCallback)((function(t) {
1757
- var n = (0, Pe.keycode)(t.nativeEvent);
1758
- if (n === "tab") {
1759
- if (Y && Ye.current && et.current <= 1) {
1478
+ }), [ p, St, ye, _, A, V ]);
1479
+ var Nt = (0, e.useCallback)((function(e) {
1480
+ if (qe && !P) {
1481
+ N === null || N === void 0 ? void 0 : N(e);
1482
+ }
1483
+ }), [ qe, P, N ]);
1484
+ var Lt = (0, e.useCallback)((function(t) {
1485
+ var r = (0, Ce.keycode)(t.nativeEvent);
1486
+ if (r === "tab") {
1487
+ if (oe && ut.current && pt.current <= 1) {
1760
1488
  t.preventDefault();
1761
- kt(t, Ye.current);
1489
+ Rt(t, ut.current);
1762
1490
  }
1763
1491
  }
1764
1492
  if (t.shiftKey || t.metaKey || t.ctrlKey) {
1765
- if (n === "a" && (t.ctrlKey || t.metaKey)) {
1493
+ if (r === "a" && (t.ctrlKey || t.metaKey)) {
1766
1494
  // handle control + A
1767
- if (it.current === "all") {
1768
- It(t);
1495
+ if (ht.current === "all") {
1496
+ Dt(t);
1769
1497
  } else {
1770
- jt(t);
1498
+ Vt(t);
1771
1499
  }
1772
1500
  }
1773
1501
  return;
1774
1502
  }
1775
- if (n === "down") {
1503
+ if (r === "down") {
1776
1504
  t.preventDefault();
1777
- ge(Math.min(he + 1, J === "checkbox" ? et.current : et.current - 1));
1778
- if (f && B) {
1779
- var r;
1780
- var o = e.Children.toArray(f).length - (2 + ((r = gt()) !== null && r !== void 0 ? r : []).length);
1781
- if (he === o) {
1782
- Pt(t);
1505
+ Ie(Math.min(Ee + 1, te === "checkbox" ? pt.current : pt.current - 1));
1506
+ if (p && N) {
1507
+ var n;
1508
+ var o = e.Children.toArray(p).length - (2 + ((n = St()) !== null && n !== void 0 ? n : []).length);
1509
+ if (Ee === o) {
1510
+ Nt(t);
1783
1511
  }
1784
1512
  }
1785
1513
  }
1786
- if (n === "up") {
1514
+ if (r === "up") {
1787
1515
  t.preventDefault();
1788
- ge(Math.max(he - 1, 0));
1516
+ Ie(Math.max(Ee - 1, 0));
1789
1517
  }
1790
- if (n === "enter" && Ye.current && Ae) {
1791
- if (Ye.current === "selectAll") {
1792
- if (it.current === "all") {
1793
- It(t);
1518
+ if (r === "enter" && ut.current && qe) {
1519
+ if (ut.current === "selectAll") {
1520
+ if (ht.current === "all") {
1521
+ Dt(t);
1794
1522
  } else {
1795
- jt(t);
1523
+ Vt(t);
1796
1524
  }
1797
1525
  } else {
1798
1526
  t.preventDefault();
1799
- kt(t, Ye.current);
1527
+ Rt(t, ut.current);
1800
1528
  }
1801
1529
  }
1802
- }), [ he, f, gt, It, Pt, jt, B, Ae, J, Y, kt ]);
1803
- var Mt = (0, e.useCallback)((function(e, t) {
1804
- var n = t.value;
1530
+ }), [ Ee, p, St, Dt, Nt, Vt, N, qe, te, oe, Rt ]);
1531
+ var Ft = (0, e.useCallback)((function(e, t) {
1532
+ var r = t.value;
1805
1533
  e.preventDefault();
1806
- if (!Ae) {
1534
+ if (!qe) {
1807
1535
  return;
1808
1536
  }
1809
- kt(e, n);
1810
- }), [ Ae, kt ]);
1811
- var Tt = (0, e.useCallback)((function(e, t) {
1812
- var n = e.nativeEvent.key;
1537
+ Rt(e, r);
1538
+ }), [ qe, Rt ]);
1539
+ var Kt = (0, e.useCallback)((function(e, t) {
1540
+ var r = e.nativeEvent.key;
1813
1541
  // Checking for a single character to avoid complications from double-byte languages and emojis.
1814
- if (n.length === 1) {
1815
- var r = [];
1542
+ if (r.length === 1) {
1543
+ var n = [];
1816
1544
  var o = {
1817
1545
  index: 0,
1818
- value: n
1546
+ value: r
1819
1547
  };
1820
- if (!Ue.current) {
1821
- if (n === " ") {
1822
- xt();
1548
+ if (!tt.current) {
1549
+ if (r === " ") {
1550
+ Bt();
1823
1551
  return;
1824
1552
  }
1825
- r = at(Xe.current, o);
1826
- } else if (Je.current.length > 1) {
1827
- o.index = Ue.current.index + 1;
1828
- r = at(Je.current, o);
1553
+ n = et(lt.current, o);
1554
+ } else if (nt.current.length > 1) {
1555
+ o.index = tt.current.index + 1;
1556
+ n = et(nt.current, o);
1829
1557
  }
1830
- if (r.length) {
1831
- var a = 0;
1558
+ if (n.length) {
1559
+ var a;
1560
+ var l = 0;
1832
1561
  // If the active option is a first character match, cycle to the next matching option.
1833
- if (o.index === 0 && r.length > 1) {
1834
- var l = r.indexOf(Xe.current[t]);
1835
- if (l >= 0) {
1836
- a = l === r.length - 1 ? 0 : l + 1;
1562
+ if (o.index === 0 && n.length > 1) {
1563
+ var i = n.indexOf(lt.current[t]);
1564
+ if (i >= 0) {
1565
+ l = i === n.length - 1 ? 0 : i + 1;
1837
1566
  }
1838
1567
  }
1839
- var i = r[a];
1840
- var u = i.value, c = i.label;
1841
- var s = Ze.current[Vt(u, c)];
1842
- if (s != null) {
1843
- var f;
1844
- (f = s.focus) === null || f === void 0 ? void 0 : f.call(s);
1845
- }
1568
+ var u = n[l];
1569
+ var c = u.value, s = u.label;
1570
+ var f = ft.current[It(c, s)];
1571
+ f === null || f === void 0 ? void 0 : (a = f.focus) === null || a === void 0 ? void 0 : a.call(f);
1846
1572
  }
1847
- Je.current = r;
1848
- Ue.current = o;
1849
- if (Ge.current) {
1850
- clearTimeout(Ge.current);
1573
+ nt.current = n;
1574
+ tt.current = o;
1575
+ if (rt.current) {
1576
+ clearTimeout(rt.current);
1851
1577
  }
1852
- Ge.current = setTimeout(xt, 500);
1578
+ rt.current = setTimeout(Bt, 500);
1853
1579
  e.preventDefault();
1854
1580
  e.stopPropagation();
1855
1581
  }
1856
1582
  }), []);
1857
- var Ft = (0, e.useCallback)((function(e, t) {
1858
- var n = t.value;
1859
- je(n);
1860
- _e(true);
1861
- ge(0);
1862
- q === null || q === void 0 ? void 0 : q(e, {
1863
- keyword: n
1583
+ var Ht = (0, e.useCallback)((function(e, t) {
1584
+ var r = t.value;
1585
+ _e(r);
1586
+ Ve(true);
1587
+ Ie(0);
1588
+ L === null || L === void 0 ? void 0 : L(e, {
1589
+ keyword: r
1864
1590
  });
1865
- }), [ q ]);
1866
- var Ht = (0, e.useCallback)((function() {
1867
- Be(true);
1868
- }), []);
1591
+ }), [ L ]);
1869
1592
  var $t = (0, e.useCallback)((function() {
1870
- Be(false);
1593
+ Ke(true);
1594
+ }), []);
1595
+ var zt = (0, e.useCallback)((function() {
1596
+ Ke(false);
1871
1597
  }), []);
1872
- var zt = (0, e.useCallback)((function(e) {
1873
- if (Qe.current !== he) {
1874
- e === null || e === void 0 ? void 0 : e.scrollIntoViewIfNeeded();
1598
+ var Wt = (0, e.useCallback)((function(e) {
1599
+ if (it.current !== Ee) {
1600
+ k(e);
1875
1601
  }
1876
- }), [ he ]);
1877
- var Wt = (0, e.useCallback)((function(e, t, n) {
1878
- if (n) {
1879
- nt.current = e;
1602
+ }), [ Ee ]);
1603
+ var Ut = (0, e.useCallback)((function(e, t, r) {
1604
+ if (r) {
1605
+ vt.current = e;
1880
1606
  }
1881
1607
  if (e == null) {
1882
- delete Ze.current[t];
1608
+ delete ft.current[t];
1883
1609
  } else {
1884
- Ze.current[t] = e;
1610
+ ft.current[t] = e;
1885
1611
  }
1886
- }), []);
1887
- var Ut = (0, e.useCallback)((function(e) {
1888
- We.current = e;
1889
- }), [ We ]);
1890
- var Gt = (r = gt()) !== null && r !== void 0 ? r : [];
1891
- var Jt = e.Children.toArray(f);
1892
- var Xt = Gt.some((function(e) {
1893
- var t = re()(Jt, (function(t) {
1894
- return Rt(t) && t.props.value === e;
1612
+ }), [ ft ]);
1613
+ var Gt = (0, e.useCallback)((function(e) {
1614
+ Ze.current = e;
1615
+ }), [ Ze ]);
1616
+ var Jt = (0, e.useMemo)((function() {
1617
+ var e;
1618
+ return (e = St()) !== null && e !== void 0 ? e : [];
1619
+ }), [ St ]);
1620
+ var Xt = e.Children.toArray(p);
1621
+ var Qt = Jt.some((function(e) {
1622
+ var t = X()(Xt, (function(t) {
1623
+ return Et(t) && t.props.value === e;
1895
1624
  }));
1896
1625
  return t && !t.props.disabled;
1897
1626
  }));
1898
- var Qt = X === "immediately" ? Ot() : De;
1899
- var Yt = {
1900
- activeIndex: he,
1901
- activeItemId: fe,
1902
- allowKeyMatching: a,
1903
- allowNewValues: s,
1904
- availableMatchOptions: Xe,
1905
- availableOptionCount: et,
1906
- children: f,
1907
- currentValues: Gt,
1908
- filter: g,
1909
- filterKeyword: ke,
1910
- firstSelectedOptionIndex: ot,
1911
- isLoadingOptions: k,
1912
- multiple: M,
1913
- newTopValues: Qt,
1914
- onActiveOptionMount: zt,
1915
- onClick: Mt,
1916
- onClearAll: It,
1917
- onKeyDown: Tt,
1918
- onOptionMount: Wt,
1919
- onScrollBottom: B,
1920
- onSelectAll: jt,
1921
- optionSelection: it,
1922
- selectAllAppearance: J,
1923
- selectedOptionCount: lt,
1924
- setActiveValue: dt,
1925
- setAvailableMatchOptions: yt,
1926
- setAvailableOptionCount: ut,
1927
- setDisplayedValues: ht,
1928
- setFirstSelectedOptionIndex: ft,
1929
- setOptionSelection: mt,
1930
- setSelectedOptionCount: pt,
1931
- textHasFocus: Te,
1932
- toggle: te
1933
- };
1934
- var Zt = function e(n) {
1935
- var r = n.anchorWidth, o = n.maxHeight, a = n.placement;
1936
- var i = At({
1937
- anchorWidth: r,
1938
- isMultiple: M,
1627
+ var Yt = re === "immediately" ? Ct() : ze;
1628
+ var Zt = (0, e.useMemo)((function() {
1629
+ pt.current = 0;
1630
+ bt.current = undefined;
1631
+ mt.current = 0;
1632
+ ut.current = undefined;
1633
+ lt.current = [];
1634
+ var r = function e(t, r) {
1635
+ return function(e) {
1636
+ return Ut(e, t, r);
1637
+ };
1638
+ };
1639
+ var n;
1640
+ var a = 0;
1641
+ var l = false;
1642
+ // used to avoid overwriting the selected item ref in multiple mode
1643
+ var i;
1644
+ var u = e.Children.toArray(p).reduce((function(u, c, s) {
1645
+ // ignore Headings and Dividers
1646
+ if (!Et(c)) {
1647
+ u.push(c);
1648
+ return u;
1649
+ }
1650
+ var p = c.props, d = p.disabled, v = p.hidden, b = p.label, y = p.value;
1651
+ // Find out if the search string exactly matches a value
1652
+ if (y === Te) {
1653
+ n = true;
1654
+ }
1655
+ var m = Jt && Jt.indexOf(y) >= 0;
1656
+ var h = !!m && !d && !i;
1657
+ var g = o && !_ && !O && !P && !N;
1658
+ var w = It(y, b);
1659
+ var S = -1;
1660
+ if (g && !d && !v) {
1661
+ lt.current.push({
1662
+ label: b,
1663
+ value: y
1664
+ });
1665
+ S = lt.current.length - 1;
1666
+ }
1667
+ // Format the Menu.Item
1668
+ var C = (0, e.cloneElement)(c, {
1669
+ elementRef: r(w, h),
1670
+ key: c.key || s,
1671
+ onClick: Ft,
1672
+ onKeyDown: g ? function(e) {
1673
+ return Kt(e, S);
1674
+ } : undefined,
1675
+ selected: m,
1676
+ multiple: _,
1677
+ role: "option"
1678
+ });
1679
+ if (h) {
1680
+ i = true;
1681
+ }
1682
+ if (Yt && Yt.indexOf(y) >= 0) {
1683
+ if (a === 0) {
1684
+ u.splice(a, 0, t().createElement(f.Divider, {
1685
+ key: "topDivider"
1686
+ }));
1687
+ l = true;
1688
+ }
1689
+ u.splice(a, 0, C);
1690
+ a += 1;
1691
+ } else {
1692
+ u.push(C);
1693
+ }
1694
+ return u;
1695
+ }), []);
1696
+ // In multiple mode, add missing items
1697
+ if (_) {
1698
+ Y()(Jt, (function(e) {
1699
+ var o = X()(u, (function(t) {
1700
+ return Et(t) && t.props && t.props.value === e;
1701
+ }));
1702
+ if (!o) {
1703
+ if (e === Te) {
1704
+ n = true;
1705
+ }
1706
+ var i = Yt && Yt.indexOf(e) >= 0;
1707
+ var c = Yt.length;
1708
+ if (a === 0) {
1709
+ u.splice(0, 0, t().createElement(f.Divider, {
1710
+ key: "topDivider"
1711
+ }));
1712
+ a += 1;
1713
+ l = true;
1714
+ }
1715
+ var s = String(e);
1716
+ var p = It(e, s);
1717
+ u.splice(i ? 0 : c + 1, 0, t().createElement(C, {
1718
+ elementRef: r(p),
1719
+ label: s,
1720
+ value: e,
1721
+ key: "missing-value-".concat(e),
1722
+ onClick: Ft,
1723
+ multiple: _,
1724
+ selected: true
1725
+ }));
1726
+ if (i) {
1727
+ a += 1;
1728
+ }
1729
+ }
1730
+ }));
1731
+ }
1732
+ var d = O === "controlled";
1733
+ // Filter the items
1734
+ var v = (0, we.stringToKeywords)(Te);
1735
+ u = d ? u : u.filter((function(e) {
1736
+ if (Et(e)) {
1737
+ return (0, we.testPhrase)(e.props.label, v);
1738
+ }
1739
+ return true;
1740
+ // Keep all headers and non-interactive options
1741
+ })).map((function(t) {
1742
+ if (!Et(t)) {
1743
+ return t;
1744
+ }
1745
+ // highlight matched text
1746
+ var r = v && (0, we.keywordLocations)(t.props.label, v);
1747
+
1748
+ return (0, e.cloneElement)(t, {
1749
+ matchRanges: r || undefined
1750
+ });
1751
+ }));
1752
+ // Add the option to add the new value
1753
+ if (c && !n && Te) {
1754
+ var b = l ? a + 1 : a;
1755
+ var y = "".concat(Te, " (new value)");
1756
+ var m = It(Te, y);
1757
+ u.splice(b, 0, t().createElement(C, {
1758
+ elementRef: r(m),
1759
+ label: y,
1760
+ value: Te,
1761
+ key: "newValue",
1762
+ multiple: _,
1763
+ onClick: Ft
1764
+ }));
1765
+ }
1766
+ // When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
1767
+ var h = te === "checkbox" && _ && u.length > 1 ? 1 : 0;
1768
+ var g = true;
1769
+ // Highlight the selected Items and remove hidden
1770
+ u = u.reduce((function(t, r) {
1771
+ // ignore Dividers & Headings
1772
+ if (!Et(r)) {
1773
+ t.push(r);
1774
+ return t;
1775
+ }
1776
+ // Ignore any hidden items
1777
+ if (r.props && r.props.hidden) {
1778
+ return t;
1779
+ }
1780
+ if (r.props.selected && !r.props.disabled && bt.current == null) {
1781
+ bt.current = pt.current;
1782
+ }
1783
+ var n = h === Ee;
1784
+ h += 1;
1785
+ pt.current += 1;
1786
+ mt.current += r.props.selected ? 1 : 0;
1787
+ if (r.key !== "newValue" && !r.props.disabled && !r.props.selected) {
1788
+ g = false;
1789
+ }
1790
+ if (!n || !Fe) {
1791
+ t.push(r);
1792
+ return t;
1793
+ }
1794
+ if (!r.props.disabled) {
1795
+ ut.current = r.props.value;
1796
+ }
1797
+ var o = (0, e.cloneElement)(r, {
1798
+ active: n,
1799
+ elementRef: Wt,
1800
+ id: ke
1801
+ });
1802
+ t.push(o);
1803
+ return t;
1804
+ }), []);
1805
+ ht.current = mt.current === 0 && "none" || g && "all" || "some";
1806
+ // add select all option
1807
+ if (te === "checkbox" && _ && pt.current > 0) {
1808
+ var w;
1809
+ if (ht.current === "all") {
1810
+ if (Te === "") {
1811
+ w = (0, s._)("Clear all");
1812
+ } else {
1813
+ w = (0, s._)("Clear all matches");
1814
+ }
1815
+ } else if (Te === "") {
1816
+ w = (0, s._)("Select all");
1817
+ } else {
1818
+ w = (0, s._)("Select all matches");
1819
+ }
1820
+ if (Ee === 0 && Fe) {
1821
+ ut.current = "selectAll";
1822
+ }
1823
+ u.unshift( t().createElement(Ne, {
1824
+ key: "select-all-option",
1825
+ active: Ee === 0,
1826
+ changedToggle: !!ce,
1827
+ elementRef: Wt,
1828
+ id: Ee === 0 ? ke : undefined,
1829
+ onClick: ht.current === "all" ? Dt : Vt,
1830
+ selectAllLabel: w,
1831
+ selected: ht.current === "all" || ht.current !== "none" && "some",
1832
+ totalCount: Jt.length,
1833
+ tabIndex: -1
1834
+ }), t().createElement(f.Divider, {
1835
+ key: "selectAllDivider"
1836
+ }));
1837
+ }
1838
+ dt.current = u.reduce((function(e, t) {
1839
+ if (Et(t)) {
1840
+ e.push(t.props.value);
1841
+ }
1842
+ return e;
1843
+ }), []);
1844
+ At = u.some((function(e) {
1845
+ return Et(e);
1846
+ }));
1847
+ return u;
1848
+ }), [ Ee, ke, o, c, p, Jt, O, Te, Wt, Dt, Ft, Kt, Ut, Vt, P, _, Yt, N, te, Fe, ce ]);
1849
+ var er = function e(r) {
1850
+ var n = r.anchorWidth, o = r.maxHeight, l = r.placement;
1851
+ var i = jt({
1852
+ anchorWidth: n,
1853
+ isMultiple: _,
1939
1854
  maxHeight: o,
1940
- menuStyle: E
1855
+ menuStyle: T
1941
1856
  });
1942
- var u = Gt.length > 0 && !Xt && !g ? 0 : undefined;
1857
+ var u = Jt.length > 0 && !Qt && !O ? 0 : undefined;
1943
1858
  var c = {
1944
- "aria-multiselectable": M || undefined,
1945
- childrenStart: !!g && t().createElement(Nt, {
1946
- activeItemId: fe,
1947
- filterKeyword: ke,
1948
- hasChildren: Dt,
1949
- inputId: C,
1950
- inputRef: S,
1951
- menuListboxId: pe,
1952
- multiple: M,
1953
- onClearAll: It,
1954
- onSelectAll: jt,
1955
- onTextBlur: $t,
1956
- onTextChange: Ft,
1957
- onTextFocus: Ht,
1958
- onTextKeyDown: Et,
1959
- optionSelection: it,
1960
- placement: a,
1961
- selectAllAppearance: J,
1962
- textHasFocus: Te
1859
+ "aria-multiselectable": _ || undefined,
1860
+ childrenStart: !!O && t().createElement(_t, {
1861
+ activeItemId: ke,
1862
+ filterA11yId: wt,
1863
+ filterKeyword: Te,
1864
+ hasChildren: At,
1865
+ inputId: x,
1866
+ inputRef: j,
1867
+ menuListboxId: xe,
1868
+ multiple: _,
1869
+ onClearAll: Dt,
1870
+ onSelectAll: Vt,
1871
+ onTextBlur: zt,
1872
+ onTextChange: Ht,
1873
+ onTextFocus: $t,
1874
+ onTextKeyDown: Lt,
1875
+ optionSelection: ht,
1876
+ placement: l,
1877
+ selectAllAppearance: te,
1878
+ textHasFocus: Fe
1963
1879
  }),
1964
- focusMode: g ? "never" : undefined,
1965
- isLoading: k,
1966
- menuId: pe,
1967
- onScrollBottom: B ? Pt : undefined,
1968
- placement: a !== null && a !== void 0 ? a : undefined,
1969
- noOptionsMessage: R,
1970
- footerMessage: O,
1971
- animateLoading: l,
1972
- loadingMessage: I,
1973
- onScroll: T,
1880
+ focusMode: O ? "never" : undefined,
1881
+ isLoading: P,
1882
+ menuId: xe,
1883
+ onScrollBottom: N ? Nt : undefined,
1884
+ placement: l !== null && l !== void 0 ? l : undefined,
1885
+ noOptionsMessage: q,
1886
+ footerMessage: w,
1887
+ animateLoading: a,
1888
+ loadingMessage: R,
1889
+ onScroll: D,
1974
1890
  style: i,
1975
1891
  tabIndex: u
1976
1892
  };
1977
- if (ee) {
1893
+ if (ie) {
1978
1894
 
1979
- return t().createElement(Oe.VirtualizedResultsMenu, vt({
1980
- virtualization: ee
1981
- }, c), t().createElement(Lt, Yt));
1895
+ return t().createElement(de.VirtualizedResultsMenu, ct({
1896
+ virtualization: ie
1897
+ }, c), Zt);
1982
1898
  }
1983
1899
 
1984
- return t().createElement(we(), c, t().createElement(Lt, Yt));
1900
+ return t().createElement(ve(), c, Zt);
1985
1901
  };
1986
1902
 
1987
- return t().createElement(me(), {
1988
- closeReasons: _t,
1989
- inputId: C,
1990
- toggle: t().createElement(Kt, vt({
1991
- appearance: u,
1992
- append: c,
1993
- currentValues: gt(),
1994
- "data-test": M ? "multiselect" : "select",
1995
- describedBy: b,
1996
- disabled: y,
1997
- elementRef: m,
1998
- error: h,
1999
- inline: w,
2000
- labelText: j,
2001
- labelledBy: x,
2002
- multiple: M,
2003
- onClick: N,
2004
- placeholder: H,
2005
- prefixLabel: $,
2006
- prepend: z,
2007
- required: F,
2008
- suffixLabel: Q,
2009
- toggle: te,
2010
- toggleContent: oe
2011
- }, ae), f),
2012
- onRequestOpen: Ct,
2013
- onRequestClose: St,
2014
- open: Ae,
1903
+ return t().createElement(se(), {
1904
+ closeReasons: Pt,
1905
+ inputId: x,
1906
+ "aria-labelledby": wt,
1907
+ toggle: t().createElement(qt, ct({
1908
+ appearance: i,
1909
+ append: u,
1910
+ currentValues: St(),
1911
+ "data-test": _ ? "multiselect" : "select",
1912
+ describedBy: y,
1913
+ disabled: m,
1914
+ elementRef: h,
1915
+ error: g,
1916
+ inline: S,
1917
+ labelText: I,
1918
+ labelledBy: E,
1919
+ multiple: _,
1920
+ onClick: F,
1921
+ placeholder: W,
1922
+ prefixLabel: U,
1923
+ prepend: G,
1924
+ required: $,
1925
+ suffixLabel: ne,
1926
+ toggle: ce,
1927
+ toggleContent: pe
1928
+ }, be), p),
1929
+ onRequestOpen: kt,
1930
+ onRequestClose: xt,
1931
+ open: qe,
2015
1932
  openWithArrowKeys: true,
2016
- repositionMode: U,
2017
- defaultPlacement: g ? d : undefined,
2018
- canCoverAnchor: ct().innerHeight < 500,
2019
- ref: Ut,
1933
+ repositionMode: Q,
1934
+ defaultPlacement: O ? v : undefined,
1935
+ canCoverAnchor: ot().innerHeight < 500,
1936
+ ref: Gt,
2020
1937
  retainFocus: false,
2021
- takeFocus: Gt.length === 0 || Gt.length > 0 && !Xt || !!g
2022
- }, Zt);
2023
- }
2024
- Ht.propTypes = Et;
2025
- Ht.componentType = "SelectBase";
2026
- Ht.Option = _;
2027
- Ht.Divider = f.Divider;
2028
- Ht.Heading = f.Heading;
2029
- /* harmony default export */ const $t = Ht;
1938
+ takeFocus: Jt.length === 0 || Jt.length > 0 && !Qt || !!O
1939
+ }, er);
1940
+ }
1941
+ Vt.propTypes = kt;
1942
+ Vt.componentType = "SelectBase";
1943
+ Vt.Option = C;
1944
+ Vt.Divider = f.Divider;
1945
+ Vt.Heading = f.Heading;
1946
+ /* harmony default export */ const Dt = Vt;
2030
1947
  // CONCATENATED MODULE: ./src/Multiselect/Compact.tsx
2031
- function zt(e) {
1948
+ function Nt(e) {
2032
1949
  "@babel/helpers - typeof";
2033
- return zt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
1950
+ return Nt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
2034
1951
  return typeof e;
2035
1952
  } : function(e) {
2036
1953
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2037
- }, zt(e);
1954
+ }, Nt(e);
2038
1955
  }
2039
- function Wt() {
2040
- return Wt = Object.assign ? Object.assign.bind() : function(e) {
1956
+ function Lt() {
1957
+ return Lt = Object.assign ? Object.assign.bind() : function(e) {
2041
1958
  for (var t = 1; t < arguments.length; t++) {
2042
- var n = arguments[t];
2043
- for (var r in n) {
2044
- ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
1959
+ var r = arguments[t];
1960
+ for (var n in r) {
1961
+ ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
2045
1962
  }
2046
1963
  }
2047
1964
  return e;
2048
- }, Wt.apply(null, arguments);
1965
+ }, Lt.apply(null, arguments);
2049
1966
  }
2050
- function Ut(e, t) {
1967
+ function Ft(e, t) {
2051
1968
  if (null == e) return {};
2052
- var n, r, o = Gt(e, t);
1969
+ var r, n, o = Kt(e, t);
2053
1970
  if (Object.getOwnPropertySymbols) {
2054
1971
  var a = Object.getOwnPropertySymbols(e);
2055
- for (r = 0; r < a.length; r++) {
2056
- n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
1972
+ for (n = 0; n < a.length; n++) {
1973
+ r = a[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
2057
1974
  }
2058
1975
  }
2059
1976
  return o;
2060
1977
  }
2061
- function Gt(e, t) {
1978
+ function Kt(e, t) {
2062
1979
  if (null == e) return {};
2063
- var n = {};
2064
- for (var r in e) {
2065
- if ({}.hasOwnProperty.call(e, r)) {
2066
- if (t.includes(r)) continue;
2067
- n[r] = e[r];
1980
+ var r = {};
1981
+ for (var n in e) {
1982
+ if ({}.hasOwnProperty.call(e, n)) {
1983
+ if (t.includes(n)) continue;
1984
+ r[n] = e[n];
2068
1985
  }
2069
1986
  }
2070
- return n;
1987
+ return r;
2071
1988
  }
2072
- function Jt(e, t) {
1989
+ function Ht(e, t) {
2073
1990
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
2074
1991
  }
2075
- function Xt(e, t) {
2076
- for (var n = 0; n < t.length; n++) {
2077
- var r = t[n];
2078
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
2079
- Object.defineProperty(e, ln(r.key), r);
1992
+ function $t(e, t) {
1993
+ for (var r = 0; r < t.length; r++) {
1994
+ var n = t[r];
1995
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
1996
+ Object.defineProperty(e, er(n.key), n);
2080
1997
  }
2081
1998
  }
2082
- function Qt(e, t, n) {
2083
- return t && Xt(e.prototype, t), n && Xt(e, n), Object.defineProperty(e, "prototype", {
1999
+ function zt(e, t, r) {
2000
+ return t && $t(e.prototype, t), r && $t(e, r), Object.defineProperty(e, "prototype", {
2084
2001
  writable: !1
2085
2002
  }), e;
2086
2003
  }
2087
- function Yt(e, t) {
2004
+ function Wt(e, t) {
2088
2005
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
2089
2006
  e.prototype = Object.create(t && t.prototype, {
2090
2007
  constructor: {
@@ -2094,69 +2011,69 @@
2094
2011
  }
2095
2012
  }), Object.defineProperty(e, "prototype", {
2096
2013
  writable: !1
2097
- }), t && Zt(e, t);
2014
+ }), t && Ut(e, t);
2098
2015
  }
2099
- function Zt(e, t) {
2100
- return Zt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
2016
+ function Ut(e, t) {
2017
+ return Ut = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
2101
2018
  return e.__proto__ = t, e;
2102
- }, Zt(e, t);
2019
+ }, Ut(e, t);
2103
2020
  }
2104
- function en(e) {
2105
- var t = rn();
2021
+ function Gt(e) {
2022
+ var t = Qt();
2106
2023
  return function() {
2107
- var n, r = on(e);
2024
+ var r, n = Yt(e);
2108
2025
  if (t) {
2109
- var o = on(this).constructor;
2110
- n = Reflect.construct(r, arguments, o);
2111
- } else n = r.apply(this, arguments);
2112
- return tn(this, n);
2026
+ var o = Yt(this).constructor;
2027
+ r = Reflect.construct(n, arguments, o);
2028
+ } else r = n.apply(this, arguments);
2029
+ return Jt(this, r);
2113
2030
  };
2114
2031
  }
2115
- function tn(e, t) {
2116
- if (t && ("object" == zt(t) || "function" == typeof t)) return t;
2032
+ function Jt(e, t) {
2033
+ if (t && ("object" == Nt(t) || "function" == typeof t)) return t;
2117
2034
  if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
2118
- return nn(e);
2035
+ return Xt(e);
2119
2036
  }
2120
- function nn(e) {
2037
+ function Xt(e) {
2121
2038
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2122
2039
  return e;
2123
2040
  }
2124
- function rn() {
2041
+ function Qt() {
2125
2042
  try {
2126
2043
  var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
2127
2044
  } catch (e) {}
2128
- return (rn = function t() {
2045
+ return (Qt = function t() {
2129
2046
  return !!e;
2130
2047
  })();
2131
2048
  }
2132
- function on(e) {
2133
- return on = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
2049
+ function Yt(e) {
2050
+ return Yt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
2134
2051
  return e.__proto__ || Object.getPrototypeOf(e);
2135
- }, on(e);
2052
+ }, Yt(e);
2136
2053
  }
2137
- function an(e, t, n) {
2138
- return (t = ln(t)) in e ? Object.defineProperty(e, t, {
2139
- value: n,
2054
+ function Zt(e, t, r) {
2055
+ return (t = er(t)) in e ? Object.defineProperty(e, t, {
2056
+ value: r,
2140
2057
  enumerable: !0,
2141
2058
  configurable: !0,
2142
2059
  writable: !0
2143
- }) : e[t] = n, e;
2144
- }
2145
- function ln(e) {
2146
- var t = un(e, "string");
2147
- return "symbol" == zt(t) ? t : t + "";
2148
- }
2149
- function un(e, t) {
2150
- if ("object" != zt(e) || !e) return e;
2151
- var n = e[Symbol.toPrimitive];
2152
- if (void 0 !== n) {
2153
- var r = n.call(e, t || "default");
2154
- if ("object" != zt(r)) return r;
2060
+ }) : e[t] = r, e;
2061
+ }
2062
+ function er(e) {
2063
+ var t = tr(e, "string");
2064
+ return "symbol" == Nt(t) ? t : t + "";
2065
+ }
2066
+ function tr(e, t) {
2067
+ if ("object" != Nt(e) || !e) return e;
2068
+ var r = e[Symbol.toPrimitive];
2069
+ if (void 0 !== r) {
2070
+ var n = r.call(e, t || "default");
2071
+ if ("object" != Nt(n)) return n;
2155
2072
  throw new TypeError("@@toPrimitive must return a primitive value.");
2156
2073
  }
2157
2074
  return ("string" === t ? String : Number)(e);
2158
2075
  }
2159
- var cn = {
2076
+ var rr = {
2160
2077
  allowNewValues: a().bool,
2161
2078
  animateLoading: a().bool,
2162
2079
  children: a().node,
@@ -2193,7 +2110,7 @@
2193
2110
  /** @private */
2194
2111
  virtualization: a().number
2195
2112
  };
2196
- var sn = {
2113
+ var nr = {
2197
2114
  allowNewValues: false,
2198
2115
  animateLoading: false,
2199
2116
  defaultPlacement: "vertical",
@@ -2207,18 +2124,18 @@
2207
2124
  tabConfirmsNewValue: false
2208
2125
  };
2209
2126
  // TS: not typed controlled/uncontrolled, handled by Multiselect wrapper component
2210
- var fn = function(n) {
2211
- Yt(o, n);
2212
- var r = en(o);
2127
+ var or = function(r) {
2128
+ Wt(o, r);
2129
+ var n = Gt(o);
2213
2130
  function o() {
2214
- Jt(this, o);
2215
- return r.apply(this, arguments);
2131
+ Ht(this, o);
2132
+ return n.apply(this, arguments);
2216
2133
  }
2217
- Qt(o, [ {
2134
+ zt(o, [ {
2218
2135
  key: "render",
2219
2136
  // @docs-props-type CompactPropsBase
2220
- value: function n() {
2221
- var r = this.props, o = r.defaultValues, a = r.children, l = r.controlledFilter, i = r.filter, u = r.values, c = Ut(r, [ "defaultValues", "children", "controlledFilter", "filter", "values" ]);
2137
+ value: function r() {
2138
+ var n = this.props, o = n.defaultValues, a = n.children, l = n.controlledFilter, i = n.filter, u = n.values, c = Ft(n, [ "defaultValues", "children", "controlledFilter", "filter", "values" ]);
2222
2139
  var s = true;
2223
2140
  if (i != null) {
2224
2141
  s = i;
@@ -2228,9 +2145,13 @@
2228
2145
  }
2229
2146
  var f = {
2230
2147
  children: e.Children.toArray(a).map((function(e) {
2231
- if (Rt(e)) {
2148
+ if (Et(e)) {
2149
+ var r;
2150
+ var n = (r = e.key) !== null && r !== void 0 ? r : "".concat(e.props.label, "-").concat(e.props.value);
2232
2151
 
2233
- return t().createElement(_, Wt({}, e.props, {
2152
+ return t().createElement(C, Lt({
2153
+ key: n
2154
+ }, e.props, {
2234
2155
  multiple: true
2235
2156
  }));
2236
2157
  }
@@ -2245,253 +2166,231 @@
2245
2166
  f.values = u;
2246
2167
  }
2247
2168
 
2248
- return t().createElement($t, Wt({}, c, f, {
2169
+ return t().createElement(Dt, Lt({}, c, f, {
2249
2170
  multiple: true
2250
2171
  }));
2251
2172
  }
2252
2173
  } ]);
2253
2174
  return o;
2254
2175
  }(e.Component);
2255
- an(fn, "propTypes", cn);
2256
- an(fn, "defaultProps", sn);
2257
- an(fn, "Option", Z);
2258
- an(fn, "Divider", f.Divider);
2259
- an(fn, "Heading", f.Heading);
2260
- /* harmony default export */ const pn = fn;
2176
+ Zt(or, "propTypes", rr);
2177
+ Zt(or, "defaultProps", nr);
2178
+ Zt(or, "Option", W);
2179
+ Zt(or, "Divider", f.Divider);
2180
+ Zt(or, "Heading", f.Heading);
2181
+ /* harmony default export */ const ar = or;
2261
2182
  // CONCATENATED MODULE: external "lodash/defer"
2262
- const dn = require("lodash/defer");
2263
- var vn = n.n(dn);
2183
+ const lr = require("lodash/defer");
2184
+ var ir = r.n(lr);
2264
2185
  // CONCATENATED MODULE: external "lodash/extend"
2265
- const bn = require("lodash/extend");
2266
- var yn = n.n(bn);
2186
+ const ur = require("lodash/extend");
2187
+ var cr = r.n(ur);
2267
2188
  // CONCATENATED MODULE: external "lodash/get"
2268
- const mn = require("lodash/get");
2269
- var hn = n.n(mn);
2189
+ const sr = require("lodash/get");
2190
+ var fr = r.n(sr);
2270
2191
  // CONCATENATED MODULE: external "lodash/isString"
2271
- const gn = require("lodash/isString");
2272
- var On = n.n(gn);
2192
+ const pr = require("lodash/isString");
2193
+ var dr = r.n(pr);
2273
2194
  // CONCATENATED MODULE: external "lodash/isUndefined"
2274
- const wn = require("lodash/isUndefined");
2275
- var Cn = n.n(wn);
2195
+ const vr = require("lodash/isUndefined");
2196
+ var br = r.n(vr);
2276
2197
  // CONCATENATED MODULE: external "lodash/keys"
2277
- const Sn = require("lodash/keys");
2278
- var kn = n.n(Sn);
2198
+ const yr = require("lodash/keys");
2199
+ var mr = r.n(yr);
2279
2200
  // CONCATENATED MODULE: external "lodash/last"
2280
- const xn = require("lodash/last");
2281
- var jn = n.n(xn);
2201
+ const hr = require("lodash/last");
2202
+ var gr = r.n(hr);
2282
2203
  // CONCATENATED MODULE: external "lodash/pickBy"
2283
- const In = require("lodash/pickBy");
2284
- var Pn = n.n(In);
2204
+ const Or = require("lodash/pickBy");
2205
+ var wr = r.n(Or);
2285
2206
  // CONCATENATED MODULE: external "@splunk/react-ui/Chip"
2286
- const En = require("@splunk/react-ui/Chip");
2287
- var Mn = n.n(En);
2207
+ const Sr = require("@splunk/react-ui/Chip");
2208
+ var Cr = r.n(Sr);
2288
2209
  // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
2289
- const An = require("@splunk/react-ui/Popover");
2290
- var _n = n.n(An);
2291
- // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
2292
- const Rn = require("@splunk/react-ui/ScreenReaderContent");
2293
- var Vn = n.n(Rn);
2210
+ const kr = require("@splunk/react-ui/Popover");
2211
+ var xr = r.n(kr);
2294
2212
  // CONCATENATED MODULE: external "@splunk/ui-utils/format"
2295
- const Tn = require("@splunk/ui-utils/format");
2213
+ const jr = require("@splunk/ui-utils/format");
2296
2214
  // CONCATENATED MODULE: external "@splunk/react-ui/Box"
2297
- const Bn = require("@splunk/react-ui/Box");
2298
- var qn = n.n(Bn);
2215
+ const Pr = require("@splunk/react-ui/Box");
2216
+ var Er = r.n(Pr);
2299
2217
  // CONCATENATED MODULE: ./src/Multiselect/NormalStyles.ts
2300
- var Nn = We()(qn()).withConfig({
2218
+ var Ir = Fe()(Er()).withConfig({
2301
2219
  displayName: "NormalStyles__StyledBox",
2302
2220
  componentId: "sc-1uwwpco-0"
2303
- })([ "border-radius:", ";align-items:", ";flex-wrap:wrap;min-height:", ";max-height:300px;overflow-y:auto;border:1px solid ", ";padding:", ";", " ", " ", " ", " ", " &[data-inline]{width:400px;}[data-inline='true'] + &{margin-left:", "}" ], Re.variables.borderRadius, (0,
2304
- Re.pick)({
2221
+ })([ "border-radius:", ";align-items:", ";flex-wrap:wrap;min-height:", ";max-height:300px;overflow-y:auto;border:1px solid ", ";padding:", ";", " ", " ", " ", " ", " &[data-inline]{width:400px;}[data-inline='true'] + &{margin-left:", "}" ], Ee.variables.borderRadius, (0,
2222
+ Ee.pick)({
2305
2223
  enterprise: "flex-start",
2306
2224
  prisma: "center"
2307
- }), Re.variables.inputHeight, (0, Re.pick)({
2225
+ }), Ee.variables.inputHeight, (0, Ee.pick)({
2308
2226
  enterprise: {
2309
- light: Re.variables.gray60,
2310
- dark: Re.variables.borderColor
2227
+ light: Ee.variables.gray60,
2228
+ dark: Ee.variables.borderColor
2311
2229
  },
2312
- prisma: Re.variables.interactiveColorBorder
2313
- }), (0, Re.pick)({
2230
+ prisma: Ee.variables.interactiveColorBorder
2231
+ }), (0, Ee.pick)({
2314
2232
  enterprise: "2px 0 0 2px",
2315
2233
  prisma: "2px"
2316
- }), (0, Re.pick)({
2234
+ }), (0, Ee.pick)({
2317
2235
  enterprise: {
2318
- light: (0, ze.css)([ "background-color:", ";" ], Re.variables.white),
2319
- dark: (0, ze.css)([ "background-color:", ";" ], Re.variables.gray22)
2236
+ light: (0, Le.css)([ "background-color:", ";" ], Ee.variables.white),
2237
+ dark: (0, Le.css)([ "background-color:", ";" ], Ee.variables.gray22)
2320
2238
  }
2321
2239
  }), (function(e) {
2322
2240
  var t = e.$hasfocus;
2323
- return t && (0, Re.pick)({
2324
- enterprise: (0, ze.css)([ "box-shadow:", ";" ], Re.variables.focusShadow),
2325
- prisma: (0, ze.css)([ "border-color:", ";" ], Re.variables.focusColor)
2241
+ return t && (0, Ee.pick)({
2242
+ enterprise: (0, Le.css)([ "box-shadow:", ";" ], Ee.variables.focusShadow),
2243
+ prisma: (0, Le.css)([ "border-color:", ";" ], Ee.variables.focusColor)
2326
2244
  });
2327
2245
  }), (function(e) {
2328
2246
  var t = e.$error;
2329
- return t && (0, ze.css)([ "border-color:", ";color:", ";" ], Re.variables.accentColorNegative, Re.variables.accentColorNegative);
2247
+ return t && (0, Le.css)([ "border-color:", ";color:", ";" ], Ee.variables.accentColorNegative, Ee.variables.accentColorNegative);
2330
2248
  }), (function(e) {
2331
- var t = e.$disabled, n = e.$hasfocus;
2332
- return t ? (0, Re.pick)({
2249
+ var t = e.$disabled, r = e.$hasfocus;
2250
+ return t ? (0, Ee.pick)({
2333
2251
  enterprise: {
2334
- light: (0, ze.css)([ "background-color:", ";border-color:", ";cursor:not-allowed;" ], Re.variables.gray96, Re.variables.gray92),
2335
- dark: (0, ze.css)([ "background-color:", ";border-color:", ";cursor:not-allowed;" ], Re.variables.gray22, Re.variables.gray30)
2252
+ light: (0, Le.css)([ "background-color:", ";border-color:", ";cursor:not-allowed;" ], Ee.variables.gray96, Ee.variables.gray92),
2253
+ dark: (0, Le.css)([ "background-color:", ";border-color:", ";cursor:not-allowed;" ], Ee.variables.gray22, Ee.variables.gray30)
2336
2254
  },
2337
- prisma: (0, ze.css)([ "border-color:", ";cursor:not-allowed;" ], Re.variables.interactiveColorBorderDisabled)
2338
- }) : !n && (0, ze.css)([ "&:hover{border-color:", ";}" ], (0, Re.pick)({
2339
- enterprise: Re.variables.borderColor,
2340
- prisma: Re.variables.interactiveColorBorderHover
2255
+ prisma: (0, Le.css)([ "border-color:", ";cursor:not-allowed;" ], Ee.variables.interactiveColorBorderDisabled)
2256
+ }) : !r && (0, Le.css)([ "&:hover{border-color:", ";}" ], (0, Ee.pick)({
2257
+ enterprise: Ee.variables.borderColor,
2258
+ prisma: Ee.variables.interactiveColorBorderHover
2341
2259
  }));
2342
2260
  }), (function(e) {
2343
2261
  var t = e.$popoverOpen;
2344
- return t && (0, ze.css)([ "position:relative;z-index:calc(", " - 2);" ], Re.variables.zindexFixedNavbar);
2345
- }), Re.variables.spacingSmall);
2346
- var Dn = We().span.withConfig({
2262
+ return t && (0, Le.css)([ "position:relative;z-index:calc(", " - 2);" ], Ee.variables.zindexFixedNavbar);
2263
+ }), Ee.variables.spacingSmall);
2264
+ var Rr = Fe().span.withConfig({
2347
2265
  displayName: "NormalStyles__StyledButtonsWrapper",
2348
2266
  componentId: "sc-1uwwpco-1"
2349
2267
  })([ "display:contents;" ]);
2350
- var Ln = We().input.withConfig({
2268
+ var Mr = Fe().input.withConfig({
2351
2269
  displayName: "NormalStyles__StyledInput",
2352
2270
  componentId: "sc-1uwwpco-2"
2353
- })([ "", ";flex:1 0 auto;max-width:100%;line-height:12px;", "" ], Re.mixins.reset("block"), (0,
2354
- Re.pick)({
2271
+ })([ "", ";flex:1 0 auto;max-width:100%;line-height:12px;", "" ], Ee.mixins.reset("block"), (0,
2272
+ Ee.pick)({
2355
2273
  enterprise: {
2356
- comfortable: (0, ze.css)([ "padding:", ";" ], Re.variables.spacingXSmall),
2357
- compact: (0, ze.css)([ "padding:3px;" ])
2274
+ comfortable: (0, Le.css)([ "padding:", ";" ], Ee.variables.spacingXSmall),
2275
+ compact: (0, Le.css)([ "padding:3px;" ])
2358
2276
  },
2359
2277
  prisma: {
2360
- comfortable: (0, ze.css)([ "padding:7px 10px;" ]),
2361
- compact: (0, ze.css)([ "padding:3px;" ])
2278
+ comfortable: (0, Le.css)([ "padding:7px 10px;" ]),
2279
+ compact: (0, Le.css)([ "padding:3px;" ])
2362
2280
  }
2363
2281
  }));
2364
- var Fn = We().div.withConfig({
2282
+ var Tr = Fe().div.withConfig({
2365
2283
  displayName: "NormalStyles__StyledOverlay",
2366
2284
  componentId: "sc-1uwwpco-3"
2367
2285
  })([ "", "" ], (function(e) {
2368
2286
  var t = e.$popoveropen;
2369
- return t && (0, ze.css)([ "position:fixed;top:0;left:0;width:100%;height:100%;z-index:calc(", " - 2);" ], Re.variables.zindexFixedNavbar);
2287
+ return t && (0, Le.css)([ "position:fixed;top:0;left:0;width:100%;height:100%;z-index:calc(", " - 2);" ], Ee.variables.zindexFixedNavbar);
2370
2288
  }));
2371
- // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
2372
- /**
2373
- * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
2374
- *
2375
- * @param ref - The React callback or object ref. Can be `null` or `undefined`.
2376
- * @param current - The new value of the ref.
2377
- */
2378
- function Kn(e, t) {
2379
- if (e) {
2380
- if (typeof e === "function") {
2381
- e(t);
2382
- } else {
2383
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
2384
- // the intention here is to signal "we will take care of setting 'current', not you".
2385
- e.current = t;
2386
- // eslint-disable-line no-param-reassign
2387
- }
2388
- }
2389
- }
2390
2289
  // CONCATENATED MODULE: ./src/Multiselect/Normal.tsx
2391
- function Hn(e) {
2290
+ function _r(e) {
2392
2291
  "@babel/helpers - typeof";
2393
- return Hn = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
2292
+ return _r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
2394
2293
  return typeof e;
2395
2294
  } : function(e) {
2396
2295
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2397
- }, Hn(e);
2296
+ }, _r(e);
2398
2297
  }
2399
- function $n(e) {
2400
- return Gn(e) || Un(e) || Wn(e) || zn();
2298
+ function Ar(e) {
2299
+ return Dr(e) || Vr(e) || qr(e) || Br();
2401
2300
  }
2402
- function zn() {
2301
+ function Br() {
2403
2302
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2404
2303
  }
2405
- function Wn(e, t) {
2304
+ function qr(e, t) {
2406
2305
  if (e) {
2407
- if ("string" == typeof e) return Jn(e, t);
2408
- var n = {}.toString.call(e).slice(8, -1);
2409
- return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Jn(e, t) : void 0;
2306
+ if ("string" == typeof e) return Nr(e, t);
2307
+ var r = {}.toString.call(e).slice(8, -1);
2308
+ 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) ? Nr(e, t) : void 0;
2410
2309
  }
2411
2310
  }
2412
- function Un(e) {
2311
+ function Vr(e) {
2413
2312
  if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
2414
2313
  }
2415
- function Gn(e) {
2416
- if (Array.isArray(e)) return Jn(e);
2314
+ function Dr(e) {
2315
+ if (Array.isArray(e)) return Nr(e);
2417
2316
  }
2418
- function Jn(e, t) {
2317
+ function Nr(e, t) {
2419
2318
  (null == t || t > e.length) && (t = e.length);
2420
- for (var n = 0, r = Array(t); n < t; n++) {
2421
- r[n] = e[n];
2319
+ for (var r = 0, n = Array(t); r < t; r++) {
2320
+ n[r] = e[r];
2422
2321
  }
2423
- return r;
2322
+ return n;
2424
2323
  }
2425
- function Xn(e, t) {
2426
- var n = Object.keys(e);
2324
+ function Lr(e, t) {
2325
+ var r = Object.keys(e);
2427
2326
  if (Object.getOwnPropertySymbols) {
2428
- var r = Object.getOwnPropertySymbols(e);
2429
- t && (r = r.filter((function(t) {
2327
+ var n = Object.getOwnPropertySymbols(e);
2328
+ t && (n = n.filter((function(t) {
2430
2329
  return Object.getOwnPropertyDescriptor(e, t).enumerable;
2431
- }))), n.push.apply(n, r);
2330
+ }))), r.push.apply(r, n);
2432
2331
  }
2433
- return n;
2332
+ return r;
2434
2333
  }
2435
- function Qn(e) {
2334
+ function Fr(e) {
2436
2335
  for (var t = 1; t < arguments.length; t++) {
2437
- var n = null != arguments[t] ? arguments[t] : {};
2438
- t % 2 ? Xn(Object(n), !0).forEach((function(t) {
2439
- fr(e, t, n[t]);
2440
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Xn(Object(n)).forEach((function(t) {
2441
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
2336
+ var r = null != arguments[t] ? arguments[t] : {};
2337
+ t % 2 ? Lr(Object(r), !0).forEach((function(t) {
2338
+ tn(e, t, r[t]);
2339
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Lr(Object(r)).forEach((function(t) {
2340
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
2442
2341
  }));
2443
2342
  }
2444
2343
  return e;
2445
2344
  }
2446
- function Yn(e, t) {
2345
+ function Kr(e, t) {
2447
2346
  if (null == e) return {};
2448
- var n, r, o = Zn(e, t);
2347
+ var r, n, o = Hr(e, t);
2449
2348
  if (Object.getOwnPropertySymbols) {
2450
2349
  var a = Object.getOwnPropertySymbols(e);
2451
- for (r = 0; r < a.length; r++) {
2452
- n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
2350
+ for (n = 0; n < a.length; n++) {
2351
+ r = a[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
2453
2352
  }
2454
2353
  }
2455
2354
  return o;
2456
2355
  }
2457
- function Zn(e, t) {
2356
+ function Hr(e, t) {
2458
2357
  if (null == e) return {};
2459
- var n = {};
2460
- for (var r in e) {
2461
- if ({}.hasOwnProperty.call(e, r)) {
2462
- if (t.includes(r)) continue;
2463
- n[r] = e[r];
2358
+ var r = {};
2359
+ for (var n in e) {
2360
+ if ({}.hasOwnProperty.call(e, n)) {
2361
+ if (t.includes(n)) continue;
2362
+ r[n] = e[n];
2464
2363
  }
2465
2364
  }
2466
- return n;
2365
+ return r;
2467
2366
  }
2468
- function er() {
2469
- return er = Object.assign ? Object.assign.bind() : function(e) {
2367
+ function $r() {
2368
+ return $r = Object.assign ? Object.assign.bind() : function(e) {
2470
2369
  for (var t = 1; t < arguments.length; t++) {
2471
- var n = arguments[t];
2472
- for (var r in n) {
2473
- ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
2370
+ var r = arguments[t];
2371
+ for (var n in r) {
2372
+ ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
2474
2373
  }
2475
2374
  }
2476
2375
  return e;
2477
- }, er.apply(null, arguments);
2376
+ }, $r.apply(null, arguments);
2478
2377
  }
2479
- function tr(e, t) {
2378
+ function zr(e, t) {
2480
2379
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
2481
2380
  }
2482
- function nr(e, t) {
2483
- for (var n = 0; n < t.length; n++) {
2484
- var r = t[n];
2485
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
2486
- Object.defineProperty(e, pr(r.key), r);
2381
+ function Wr(e, t) {
2382
+ for (var r = 0; r < t.length; r++) {
2383
+ var n = t[r];
2384
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
2385
+ Object.defineProperty(e, rn(n.key), n);
2487
2386
  }
2488
2387
  }
2489
- function rr(e, t, n) {
2490
- return t && nr(e.prototype, t), n && nr(e, n), Object.defineProperty(e, "prototype", {
2388
+ function Ur(e, t, r) {
2389
+ return t && Wr(e.prototype, t), r && Wr(e, r), Object.defineProperty(e, "prototype", {
2491
2390
  writable: !1
2492
2391
  }), e;
2493
2392
  }
2494
- function or(e, t) {
2393
+ function Gr(e, t) {
2495
2394
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
2496
2395
  e.prototype = Object.create(t && t.prototype, {
2497
2396
  constructor: {
@@ -2501,69 +2400,69 @@
2501
2400
  }
2502
2401
  }), Object.defineProperty(e, "prototype", {
2503
2402
  writable: !1
2504
- }), t && ar(e, t);
2403
+ }), t && Jr(e, t);
2505
2404
  }
2506
- function ar(e, t) {
2507
- return ar = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
2405
+ function Jr(e, t) {
2406
+ return Jr = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
2508
2407
  return e.__proto__ = t, e;
2509
- }, ar(e, t);
2408
+ }, Jr(e, t);
2510
2409
  }
2511
- function lr(e) {
2512
- var t = cr();
2410
+ function Xr(e) {
2411
+ var t = Zr();
2513
2412
  return function() {
2514
- var n, r = sr(e);
2413
+ var r, n = en(e);
2515
2414
  if (t) {
2516
- var o = sr(this).constructor;
2517
- n = Reflect.construct(r, arguments, o);
2518
- } else n = r.apply(this, arguments);
2519
- return ir(this, n);
2415
+ var o = en(this).constructor;
2416
+ r = Reflect.construct(n, arguments, o);
2417
+ } else r = n.apply(this, arguments);
2418
+ return Qr(this, r);
2520
2419
  };
2521
2420
  }
2522
- function ir(e, t) {
2523
- if (t && ("object" == Hn(t) || "function" == typeof t)) return t;
2421
+ function Qr(e, t) {
2422
+ if (t && ("object" == _r(t) || "function" == typeof t)) return t;
2524
2423
  if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
2525
- return ur(e);
2424
+ return Yr(e);
2526
2425
  }
2527
- function ur(e) {
2426
+ function Yr(e) {
2528
2427
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2529
2428
  return e;
2530
2429
  }
2531
- function cr() {
2430
+ function Zr() {
2532
2431
  try {
2533
2432
  var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
2534
2433
  } catch (e) {}
2535
- return (cr = function t() {
2434
+ return (Zr = function t() {
2536
2435
  return !!e;
2537
2436
  })();
2538
2437
  }
2539
- function sr(e) {
2540
- return sr = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
2438
+ function en(e) {
2439
+ return en = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
2541
2440
  return e.__proto__ || Object.getPrototypeOf(e);
2542
- }, sr(e);
2441
+ }, en(e);
2543
2442
  }
2544
- function fr(e, t, n) {
2545
- return (t = pr(t)) in e ? Object.defineProperty(e, t, {
2546
- value: n,
2443
+ function tn(e, t, r) {
2444
+ return (t = rn(t)) in e ? Object.defineProperty(e, t, {
2445
+ value: r,
2547
2446
  enumerable: !0,
2548
2447
  configurable: !0,
2549
2448
  writable: !0
2550
- }) : e[t] = n, e;
2551
- }
2552
- function pr(e) {
2553
- var t = dr(e, "string");
2554
- return "symbol" == Hn(t) ? t : t + "";
2555
- }
2556
- function dr(e, t) {
2557
- if ("object" != Hn(e) || !e) return e;
2558
- var n = e[Symbol.toPrimitive];
2559
- if (void 0 !== n) {
2560
- var r = n.call(e, t || "default");
2561
- if ("object" != Hn(r)) return r;
2449
+ }) : e[t] = r, e;
2450
+ }
2451
+ function rn(e) {
2452
+ var t = nn(e, "string");
2453
+ return "symbol" == _r(t) ? t : t + "";
2454
+ }
2455
+ function nn(e, t) {
2456
+ if ("object" != _r(e) || !e) return e;
2457
+ var r = e[Symbol.toPrimitive];
2458
+ if (void 0 !== r) {
2459
+ var n = r.call(e, t || "default");
2460
+ if ("object" != _r(n)) return n;
2562
2461
  throw new TypeError("@@toPrimitive must return a primitive value.");
2563
2462
  }
2564
2463
  return ("string" === t ? String : Number)(e);
2565
2464
  }
2566
- var vr = {
2465
+ var on = {
2567
2466
  allowNewValues: a().bool,
2568
2467
  animateLoading: a().bool,
2569
2468
  children: a().node,
@@ -2598,7 +2497,7 @@
2598
2497
  useClickawayOverlay: a().bool,
2599
2498
  values: a().array
2600
2499
  };
2601
- var br = {
2500
+ var an = {
2602
2501
  allowNewValues: false,
2603
2502
  animateLoading: false,
2604
2503
  defaultPlacement: "vertical",
@@ -2611,38 +2510,38 @@
2611
2510
  tabConfirmsNewValue: false,
2612
2511
  useClickawayOverlay: false
2613
2512
  };
2614
- var yr = ce()((function(e) {
2513
+ var ln = re()((function(e) {
2615
2514
  return {
2616
2515
  flexBasis: e,
2617
2516
  width: e
2618
2517
  };
2619
2518
  }));
2620
- var mr = ce()((function(e) {
2621
- var t = e.anchorWidth, n = e.maxHeight, r = e.menuStyle;
2622
- return yn()({
2623
- maxHeight: n,
2519
+ var un = re()((function(e) {
2520
+ var t = e.anchorWidth, r = e.maxHeight, n = e.menuStyle;
2521
+ return cr()({
2522
+ maxHeight: r,
2624
2523
  overflow: "auto",
2625
2524
  width: Math.max(t !== null && t !== void 0 ? t : 0, 200)
2626
- }, r);
2525
+ }, n);
2627
2526
  }));
2628
2527
  // TS: not typed controlled/uncontrolled, handled by Multiselect wrapper component
2629
- var hr = function(n) {
2630
- or(o, n);
2631
- var r = lr(o);
2528
+ var cn = function(r) {
2529
+ Gr(o, r);
2530
+ var n = Xr(o);
2632
2531
  // @docs-props-type NormalPropsBase
2633
- function o(n) {
2532
+ function o(r) {
2634
2533
  var a;
2635
- tr(this, o);
2636
- a = r.call(this, n);
2637
- fr(ur(a), "activeItemId", void 0);
2638
- fr(ur(a), "activeValue", void 0);
2639
- fr(ur(a), "availableOptionCount", void 0);
2640
- fr(ur(a), "children", void 0);
2641
- fr(ur(a), "controlledExternally", void 0);
2642
- fr(ur(a), "input", null);
2643
- fr(ur(a), "popoverId", void 0);
2644
- fr(ur(a), "previousActiveIndex", null);
2645
- fr(ur(a), "handleClick", (function() {
2534
+ zr(this, o);
2535
+ a = n.call(this, r);
2536
+ tn(Yr(a), "activeItemId", void 0);
2537
+ tn(Yr(a), "activeValue", void 0);
2538
+ tn(Yr(a), "availableOptionCount", void 0);
2539
+ tn(Yr(a), "children", void 0);
2540
+ tn(Yr(a), "controlledExternally", void 0);
2541
+ tn(Yr(a), "input", null);
2542
+ tn(Yr(a), "popoverId", void 0);
2543
+ tn(Yr(a), "previousActiveIndex", null);
2544
+ tn(Yr(a), "handleClick", (function() {
2646
2545
  if (a.state.hasFocus) {
2647
2546
  a.open({
2648
2547
  resetFilterKeyword: false
@@ -2652,14 +2551,14 @@
2652
2551
  (e = a.input) === null || e === void 0 ? void 0 : e.focus();
2653
2552
  }
2654
2553
  }));
2655
- fr(ur(a), "handleRequestRemove", (function(e, t) {
2656
- var n = t.value;
2657
- vn()((function() {
2658
- return a.removeValue(e, n);
2554
+ tn(Yr(a), "handleRequestRemove", (function(e, t) {
2555
+ var r = t.value;
2556
+ ir()((function() {
2557
+ return a.removeValue(e, r);
2659
2558
  }));
2660
2559
  // allow the event to bubble before removing.
2661
2560
  }));
2662
- fr(ur(a), "open", (function(e) {
2561
+ tn(Yr(a), "open", (function(e) {
2663
2562
  var t = e.resetFilterKeyword;
2664
2563
  a.setState((function(e) {
2665
2564
  return {
@@ -2672,10 +2571,10 @@
2672
2571
  (e = (t = a.props).onOpen) === null || e === void 0 ? void 0 : e.call(t);
2673
2572
  }));
2674
2573
  }));
2675
- fr(ur(a), "handleInputFocus", (function(e) {
2574
+ tn(Yr(a), "handleInputFocus", (function(e) {
2676
2575
  if (a.state.filterKeyword !== "") {
2677
- var t, n;
2678
- (t = (n = a.props).onFilterChange) === null || t === void 0 ? void 0 : t.call(n, e, {
2576
+ var t, r;
2577
+ (t = (r = a.props).onFilterChange) === null || t === void 0 ? void 0 : t.call(r, e, {
2679
2578
  keyword: ""
2680
2579
  });
2681
2580
  }
@@ -2683,12 +2582,12 @@
2683
2582
  resetFilterKeyword: true
2684
2583
  });
2685
2584
  }));
2686
- fr(ur(a), "handleInputKeyDown", (function(t) {
2687
- var n, r;
2585
+ tn(Yr(a), "handleInputKeyDown", (function(t) {
2586
+ var r, n;
2688
2587
  var o = a.props, l = o.children, i = o.onScrollBottom, u = o.tabConfirmsNewValue;
2689
- var c = (0, Pe.keycode)(t.nativeEvent);
2588
+ var c = (0, Ce.keycode)(t.nativeEvent);
2690
2589
  if (c === "tab" && a.state.open) {
2691
- if (u && !Cn()(a.activeValue) && a.availableOptionCount <= 1) {
2590
+ if (u && !br()(a.activeValue) && a.availableOptionCount <= 1) {
2692
2591
  var s;
2693
2592
  t.preventDefault();
2694
2593
  a.addValue(t, a.activeValue);
@@ -2751,54 +2650,54 @@
2751
2650
  });
2752
2651
  }
2753
2652
  }
2754
- if (c === "enter" && !Cn()(a.activeValue) && a.state.open) {
2653
+ if (c === "enter" && !br()(a.activeValue) && a.state.open) {
2755
2654
  a.addValue(t, a.activeValue);
2756
2655
  }
2757
- if (c === "backspace" && ((n = a.input) === null || n === void 0 ? void 0 : n.value) === "" && ((r = a.getCurrentValues()) === null || r === void 0 ? void 0 : r.length)) {
2758
- a.removeValue(t, jn()(a.getCurrentValues()));
2656
+ if (c === "backspace" && ((r = a.input) === null || r === void 0 ? void 0 : r.value) === "" && ((n = a.getCurrentValues()) === null || n === void 0 ? void 0 : n.length)) {
2657
+ a.removeValue(t, gr()(a.getCurrentValues()));
2759
2658
  }
2760
2659
  }));
2761
- fr(ur(a), "handleInputChange", (function(e) {
2762
- var t, n;
2660
+ tn(Yr(a), "handleInputChange", (function(e) {
2661
+ var t, r;
2763
2662
  a.setState({
2764
2663
  filterKeyword: e.target.value,
2765
2664
  open: true,
2766
2665
  activeIndex: 0
2767
2666
  });
2768
- (t = (n = a.props).onFilterChange) === null || t === void 0 ? void 0 : t.call(n, e, {
2667
+ (t = (r = a.props).onFilterChange) === null || t === void 0 ? void 0 : t.call(r, e, {
2769
2668
  keyword: e.target.value
2770
2669
  });
2771
2670
  }));
2772
- fr(ur(a), "handleMenuOptionClick", (function(e, t) {
2773
- var n;
2774
- var r = t.value;
2671
+ tn(Yr(a), "handleMenuOptionClick", (function(e, t) {
2672
+ var r;
2673
+ var n = t.value;
2775
2674
  e.stopPropagation();
2776
- a.addValue(e, r);
2777
- (n = a.input) === null || n === void 0 ? void 0 : n.focus();
2675
+ a.addValue(e, n);
2676
+ (r = a.input) === null || r === void 0 ? void 0 : r.focus();
2778
2677
  }));
2779
- fr(ur(a), "handleInputBlur", (function(e) {
2678
+ tn(Yr(a), "handleInputBlur", (function(e) {
2780
2679
  var t = document.getElementById(a.popoverId);
2781
- var n = e.relatedTarget || document.activeElement;
2680
+ var r = e.relatedTarget || document.activeElement;
2782
2681
  // IE11 doesn't support relatedTarget but sets activeElement
2783
- var r = t && n && t.contains(n);
2682
+ var n = t && r && t.contains(r);
2784
2683
  // TS: target as Node is an unsafe assumption
2785
2684
  a.setState((function(e) {
2786
2685
  return {
2787
- filterKeyword: r ? e.filterKeyword : "",
2686
+ filterKeyword: n ? e.filterKeyword : "",
2788
2687
  hasFocus: false
2789
2688
  };
2790
2689
  }));
2791
- if (!r) {
2690
+ if (!n) {
2792
2691
  var o, l;
2793
2692
  (o = (l = a.props).onFilterChange) === null || o === void 0 ? void 0 : o.call(l, e, {
2794
2693
  keyword: ""
2795
2694
  });
2796
2695
  }
2797
2696
  }));
2798
- fr(ur(a), "handleRequestClose", (function(e) {
2697
+ tn(Yr(a), "handleRequestClose", (function(e) {
2799
2698
  var t;
2800
- var n = e.reason, r = e.event;
2801
- if (n === "escapeKey" || n === "offScreen" || n === "clickAway" && r !== undefined && !((t = a.state.el) === null || t === void 0 ? void 0 : t.contains(r.target))) {
2699
+ var r = e.reason, n = e.event;
2700
+ if (r === "escapeKey" || r === "offScreen" || r === "clickAway" && n !== undefined && !((t = a.state.el) === null || t === void 0 ? void 0 : t.contains(n.target))) {
2802
2701
  a.setState({
2803
2702
  open: false
2804
2703
  }, (function() {
@@ -2807,68 +2706,68 @@
2807
2706
  (e = (t = a.props).onClose) === null || e === void 0 ? void 0 : e.call(t);
2808
2707
  }));
2809
2708
  }
2810
- if (n === "escapeKey") {
2709
+ if (r === "escapeKey") {
2811
2710
  var o;
2812
2711
  (o = a.input) === null || o === void 0 ? void 0 : o.focus();
2813
2712
  }
2814
2713
  }));
2815
- fr(ur(a), "handleScrollBottom", (function(e) {
2714
+ tn(Yr(a), "handleScrollBottom", (function(e) {
2816
2715
  if (a.state.open && !a.props.isLoadingOptions) {
2817
- var t, n;
2818
- (t = (n = a.props).onScrollBottom) === null || t === void 0 ? void 0 : t.call(n, e);
2716
+ var t, r;
2717
+ (t = (r = a.props).onScrollBottom) === null || t === void 0 ? void 0 : t.call(r, e);
2819
2718
  a.setState({
2820
2719
  loadingMoreMessage: "".concat(a.availableOptionCount, " options, loading more options")
2821
2720
  });
2822
2721
  }
2823
2722
  }));
2824
- fr(ur(a), "handleMount", (function(e) {
2723
+ tn(Yr(a), "handleMount", (function(e) {
2825
2724
  a.setState({
2826
2725
  el: e
2827
2726
  });
2828
- Kn(a.props.elementRef, e);
2727
+ x(a.props.elementRef, e);
2829
2728
  }));
2830
- fr(ur(a), "handleInputMount", (function(e) {
2729
+ tn(Yr(a), "handleInputMount", (function(e) {
2831
2730
  a.input = e;
2832
- Kn(a.props.inputRef, e);
2731
+ x(a.props.inputRef, e);
2833
2732
  }));
2834
- fr(ur(a), "handleActiveOptionMount", (function(e) {
2733
+ tn(Yr(a), "handleActiveOptionMount", (function(e) {
2835
2734
  if (a.previousActiveIndex !== a.state.activeIndex) {
2836
2735
  e === null || e === void 0 ? void 0 : e.scrollIntoViewIfNeeded();
2837
2736
  }
2838
2737
  }));
2839
- fr(ur(a), "renderMenu", (function(e) {
2840
- var n = e.anchorWidth, r = e.maxHeight, o = e.placement;
2841
- var l = mr({
2842
- anchorWidth: n,
2843
- maxHeight: r,
2738
+ tn(Yr(a), "renderMenu", (function(e) {
2739
+ var r = e.anchorWidth, n = e.maxHeight, o = e.placement;
2740
+ var l = un({
2741
+ anchorWidth: r,
2742
+ maxHeight: n,
2844
2743
  menuStyle: a.props.menuStyle
2845
2744
  });
2846
2745
 
2847
- return t().createElement(we(), er({
2746
+ return t().createElement(ve(), $r({
2848
2747
  focusMode: "never",
2849
2748
  placement: o !== null && o !== void 0 ? o : undefined,
2850
2749
  isLoading: a.props.isLoadingOptions,
2851
2750
  onScrollBottom: a.props.onScrollBottom ? a.handleScrollBottom : undefined
2852
- }, fe()(a.props, "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll"), {
2751
+ }, oe()(a.props, "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll"), {
2853
2752
  style: l
2854
2753
  }), a.children);
2855
2754
  }));
2856
- fr(ur(a), "getSelectedItemsContent", (function(e) {
2755
+ tn(Yr(a), "getSelectedItemsContent", (function(e) {
2857
2756
  return e.map((function(e) {
2858
- var n = e;
2757
+ var r = e;
2859
2758
  // TS: faking props here
2860
- var r = n.props;
2861
- if (r != null) {
2862
- var o = r.children, a = r.label, l = r.value;
2759
+ var n = r.props;
2760
+ if (n != null) {
2761
+ var o = n.children, a = n.label, l = n.value;
2863
2762
 
2864
2763
  return t().createElement("span", {
2865
2764
  key: l.toString()
2866
- }, o || a, (0, Tn.sprintf)((0, s._)(" selected")));
2765
+ }, o || a, (0, jr.sprintf)((0, s._)(" selected")));
2867
2766
  }
2868
2767
 
2869
2768
  return t().createElement("span", {
2870
- key: (0, Ie.createGUID)()
2871
- }, t().createElement(t().Fragment, null, n, (0, Tn.sprintf)((0, s._)(" selected"))));
2769
+ key: (0, Se.createGUID)()
2770
+ }, t().createElement(t().Fragment, null, r, (0, jr.sprintf)((0, s._)(" selected"))));
2872
2771
  }));
2873
2772
  }));
2874
2773
  a.state = {
@@ -2877,24 +2776,24 @@
2877
2776
  filterKeyword: "",
2878
2777
  hasFocus: false,
2879
2778
  open: false,
2880
- values: n.defaultValues || [],
2779
+ values: r.defaultValues || [],
2881
2780
  loadingMoreMessage: ""
2882
2781
  };
2883
2782
  a.availableOptionCount = 0;
2884
2783
  a.children = [];
2885
- a.controlledExternally = i()(n, "values");
2886
- a.activeItemId = (0, Ie.createDOMID)("active-item");
2887
- a.popoverId = (0, Ie.createDOMID)("popover");
2784
+ a.controlledExternally = i()(r, "values");
2785
+ a.activeItemId = (0, Se.createDOMID)("active-item");
2786
+ a.popoverId = (0, Se.createDOMID)("popover");
2888
2787
  if (false) {}
2889
2788
  if (false) {}
2890
2789
  return a;
2891
2790
  }
2892
- rr(o, [ {
2791
+ Ur(o, [ {
2893
2792
  key: "componentDidUpdate",
2894
- value: function e(t, n) {
2793
+ value: function e(t, r) {
2895
2794
  if (false) {}
2896
2795
  if (false) {}
2897
- this.previousActiveIndex = n.activeIndex;
2796
+ this.previousActiveIndex = r.activeIndex;
2898
2797
  if (this.isControlled() && t.values !== this.props.values) {
2899
2798
  // eslint-disable-next-line react/no-did-update-set-state
2900
2799
  this.setState({
@@ -2926,12 +2825,12 @@
2926
2825
  }
2927
2826
  }, {
2928
2827
  key: "addValue",
2929
- value: function e(t, n) {
2930
- var r, o, a;
2828
+ value: function e(t, r) {
2829
+ var n, o, a;
2931
2830
  if (!this.state.open) {
2932
2831
  return;
2933
2832
  }
2934
- var l = ((r = this.getCurrentValues()) !== null && r !== void 0 ? r : []).concat([ n ]);
2833
+ var l = ((n = this.getCurrentValues()) !== null && n !== void 0 ? n : []).concat([ r ]);
2935
2834
  var i = this.props.name;
2936
2835
  if (!this.isControlled()) {
2937
2836
  this.setState({
@@ -2948,39 +2847,39 @@
2948
2847
  }
2949
2848
  }, {
2950
2849
  key: "removeValue",
2951
- value: function e(t, n) {
2952
- var r, o;
2953
- var a = be()(this.getCurrentValues(), n);
2850
+ value: function e(t, r) {
2851
+ var n, o;
2852
+ var a = ue()(this.getCurrentValues(), r);
2954
2853
  var l = this.props.name;
2955
2854
  if (!this.isControlled()) {
2956
2855
  this.setState({
2957
2856
  values: a
2958
2857
  });
2959
2858
  }
2960
- (r = (o = this.props).onChange) === null || r === void 0 ? void 0 : r.call(o, t, {
2859
+ (n = (o = this.props).onChange) === null || n === void 0 ? void 0 : n.call(o, t, {
2961
2860
  values: a,
2962
2861
  name: l
2963
2862
  });
2964
2863
  }
2965
2864
  }, {
2966
2865
  key: "renderButtons",
2967
- value: function e(n) {
2968
- var r = this;
2866
+ value: function e(r) {
2867
+ var n = this;
2969
2868
  // selectedItems may contain items or unmatched values at this point
2970
- return n.map((function(e) {
2971
- var n = e;
2869
+ return r.map((function(e) {
2870
+ var r = e;
2972
2871
  // TS: faking props here
2973
- var o = n.props;
2872
+ var o = r.props;
2974
2873
  if (o != null) {
2975
2874
  var a = o.children, l = o.icon, i = o.label, u = o.selectedAppearance, c = o.selectedBackgroundColor, s = o.selectedForegroundColor, f = o.value;
2976
2875
 
2977
- return t().createElement(Mn(), {
2876
+ return t().createElement(Cr(), {
2978
2877
  "aria-selected": true,
2979
- disabled: r.props.disabled,
2878
+ disabled: n.props.disabled,
2980
2879
  icon: l,
2981
2880
  key: f.toString(),
2982
2881
  "data-test": "selected-option",
2983
- onRequestRemove: r.handleRequestRemove,
2882
+ onRequestRemove: n.handleRequestRemove,
2984
2883
  role: "option",
2985
2884
  value: f,
2986
2885
  appearance: u,
@@ -2989,63 +2888,63 @@
2989
2888
  }, a || i);
2990
2889
  }
2991
2890
 
2992
- return t().createElement(Mn(), {
2891
+ return t().createElement(Cr(), {
2993
2892
  "aria-selected": true,
2994
- disabled: r.props.disabled,
2995
- key: (0, Ie.createGUID)(),
2893
+ disabled: n.props.disabled,
2894
+ key: (0, Se.createGUID)(),
2996
2895
  "data-test": "selected-option",
2997
- onRequestRemove: r.handleRequestRemove,
2896
+ onRequestRemove: n.handleRequestRemove,
2998
2897
  role: "option",
2999
- value: n
3000
- }, t().createElement(t().Fragment, null, n));
2898
+ value: r
2899
+ }, t().createElement(t().Fragment, null, r));
3001
2900
  }));
3002
2901
  }
3003
2902
  // eslint-disable-next-line react/no-unused-class-component-methods
3004
2903
  }, {
3005
2904
  key: "render",
3006
- value: function n() {
3007
- var r, o = this;
3008
- var a = this.props, l = a.allowNewValues, u = a.children, f = a.controlledFilter, p = a.defaultPlacement, d = a.describedBy, v = a.disabled, b = a.error, y = a.inline, m = a.inputId, h = a.labelledBy, g = a.placeholder, O = a.required, w = a.repositionMode, C = a.useClickawayOverlay, S = Yn(a, [ "allowNewValues", "children", "controlledFilter", "defaultPlacement", "describedBy", "disabled", "error", "inline", "inputId", "labelledBy", "placeholder", "required", "repositionMode", "useClickawayOverlay" ]);
3009
- var k = Qn(Qn({}, Pn()(S, (function(e, t) {
2905
+ value: function r() {
2906
+ var n, o = this;
2907
+ var a = this.props, l = a.allowNewValues, u = a.children, f = a.controlledFilter, p = a.defaultPlacement, d = a.describedBy, v = a.disabled, b = a.error, y = a.inline, m = a.inputId, h = a.labelledBy, g = a.placeholder, O = a.required, w = a.repositionMode, S = a.useClickawayOverlay, C = Kr(a, [ "allowNewValues", "children", "controlledFilter", "defaultPlacement", "describedBy", "disabled", "error", "inline", "inputId", "labelledBy", "placeholder", "required", "repositionMode", "useClickawayOverlay" ]);
2908
+ var k = Fr(Fr({}, wr()(C, (function(e, t) {
3010
2909
  return t === "role" || t.indexOf("aria-") === 0;
3011
2910
  }))), {}, {
3012
2911
  "aria-describedby": d,
3013
2912
  "aria-labelledby": h,
3014
2913
  "aria-invalid": b || undefined
3015
2914
  });
3016
- var x = Qn({}, Pn()(S, (function(e, t) {
2915
+ var x = Fr({}, wr()(C, (function(e, t) {
3017
2916
  return t === "aria-label" || t === "aria-describedby";
3018
2917
  })));
3019
- var j = (r = this.getCurrentValues()) !== null && r !== void 0 ? r : [];
3020
- var I = j.slice(0);
3021
- var P = j.indexOf(this.state.filterKeyword) >= 0;
2918
+ var j = (n = this.getCurrentValues()) !== null && n !== void 0 ? n : [];
2919
+ var P = j.slice(0);
2920
+ var E = j.indexOf(this.state.filterKeyword) >= 0;
3022
2921
  // Map Options to selected values
3023
2922
  if (j && j.length) {
3024
2923
  e.Children.toArray(u).filter(e.isValidElement).filter((function(e) {
3025
- return e.type === Z;
2924
+ return e.type === W;
3026
2925
  })).forEach((function(e) {
3027
- if (e.type === Z) {
2926
+ if (e.type === W) {
3028
2927
  var t = j.indexOf(e.props.value);
3029
2928
  if (t !== -1) {
3030
- I[t] = e;
2929
+ P[t] = e;
3031
2930
  }
3032
2931
  }
3033
2932
  }));
3034
2933
  }
3035
2934
  // Filter the items
3036
- var E = (0, je.stringToKeywords)(this.state.filterKeyword);
3037
- var M = f ? e.Children.toArray(u) : e.Children.toArray(u).filter((function(e) {
3038
- if (hn()(e, [ "props", "label" ], false)) {
3039
- return (0, je.testPhrase)(e.props.label, E);
2935
+ var I = (0, we.stringToKeywords)(this.state.filterKeyword);
2936
+ var R = f ? e.Children.toArray(u) : e.Children.toArray(u).filter((function(e) {
2937
+ if (fr()(e, [ "props", "label" ], false)) {
2938
+ return (0, we.testPhrase)(e.props.label, I);
3040
2939
  }
3041
2940
  return true;
3042
2941
  // Keep all headers and non-interactive options
3043
2942
  }));
3044
2943
  this.availableOptionCount = 0;
3045
2944
  this.activeValue = undefined;
3046
- this.children = e.Children.map(M, (function(t, n) {
3047
- var r = t.props;
3048
- if (!r || !i()(r, "value")) {
2945
+ this.children = e.Children.map(R, (function(t, r) {
2946
+ var n = t.props;
2947
+ if (!n || !i()(n, "value")) {
3049
2948
  // ignore Headings and Dividers
3050
2949
  return t;
3051
2950
  }
@@ -3053,7 +2952,7 @@
3053
2952
  var l = a.props, u = l.children, c = l.label, s = l.matchRanges, p = l.value;
3054
2953
  // find out if the search string exactly matches a value
3055
2954
  if (p === o.state.filterKeyword) {
3056
- P = true;
2955
+ E = true;
3057
2956
  }
3058
2957
  // remove items that are already selected
3059
2958
  var d = j.indexOf(p);
@@ -3061,12 +2960,12 @@
3061
2960
  return null;
3062
2961
  }
3063
2962
  // highlight matched text
3064
- var v = u === undefined || On()(u);
3065
- var b = v && !f && !s && E && (0, je.keywordLocations)(c, E);
2963
+ var v = u === undefined || dr()(u);
2964
+ var b = v && !f && !s && I && (0, we.keywordLocations)(c, I);
3066
2965
  // clone item
3067
2966
  var y = (0, e.cloneElement)(a, {
3068
2967
  // eslint-disable-next-line react/no-array-index-key
3069
- key: n,
2968
+ key: r,
3070
2969
  onClick: o.handleMenuOptionClick,
3071
2970
  matchRanges: v && (s || b) || undefined
3072
2971
  });
@@ -3075,8 +2974,8 @@
3075
2974
  return e !== null;
3076
2975
  }));
3077
2976
  // Add the option to add the new value
3078
- if (l && !P && this.state.filterKeyword) {
3079
- this.children.unshift( t().createElement(Z, {
2977
+ if (l && !E && this.state.filterKeyword) {
2978
+ this.children.unshift( t().createElement(W, {
3080
2979
  label: "".concat(this.state.filterKeyword),
3081
2980
  description: (0, s._)("(New value)"),
3082
2981
  descriptionPosition: "right",
@@ -3088,22 +2987,22 @@
3088
2987
  if (this.state.open) {
3089
2988
  // highlight the selected Item
3090
2989
  this.children = e.Children.map(this.children, (function(t) {
3091
- var n = t.props;
3092
- if (!n || !i()(n, "value")) {
2990
+ var r = t.props;
2991
+ if (!r || !i()(r, "value")) {
3093
2992
  // ignore Headings and Dividers
3094
2993
  return t;
3095
2994
  }
3096
- var r = t;
3097
- var a = r.props, l = a.disabled, u = a.value;
2995
+ var n = t;
2996
+ var a = n.props, l = a.disabled, u = a.value;
3098
2997
  var c = o.availableOptionCount === o.state.activeIndex;
3099
2998
  o.availableOptionCount += 1;
3100
2999
  if (!c) {
3101
- return r;
3000
+ return n;
3102
3001
  }
3103
3002
  if (!l) {
3104
3003
  o.activeValue = u;
3105
3004
  }
3106
- var s = (0, e.cloneElement)(r, {
3005
+ var s = (0, e.cloneElement)(n, {
3107
3006
  active: c,
3108
3007
  id: o.activeItemId,
3109
3008
  ref: o.handleActiveOptionMount
@@ -3111,14 +3010,14 @@
3111
3010
  return s;
3112
3011
  }));
3113
3012
  }
3114
- var A = yr("".concat(this.state.filterKeyword.length * .8, "em"));
3013
+ var M = ln("".concat(this.state.filterKeyword.length * .8, "em"));
3115
3014
 
3116
- return t().createElement(t().Fragment, null, t().createElement(Nn, er({
3015
+ return t().createElement(t().Fragment, null, t().createElement(Ir, $r({
3117
3016
  key: "control",
3118
3017
  "data-test-values": JSON.stringify(j),
3119
3018
  inline: y,
3120
3019
  $hasfocus: this.state.hasFocus
3121
- }, c().apply(void 0, [ S, "animateLoading", "controlledFilter", "defaultValues", "footerMessage", "inputRef", "isLoadingOptions", "labelledBy", "menuStyle", "noOptionsMessage", "onChange", "onFilterChange", "onScroll", "onScrollBottom", "onClose", "onOpen", "values", "useClickawayOverlay" ].concat($n(kn()(k)))), {
3020
+ }, c().apply(void 0, [ C, "animateLoading", "controlledFilter", "defaultValues", "footerMessage", "inputRef", "isLoadingOptions", "labelledBy", "menuStyle", "noOptionsMessage", "onChange", "onFilterChange", "onScroll", "onScrollBottom", "onClose", "onOpen", "values", "useClickawayOverlay" ].concat(Ar(mr()(k)))), {
3122
3021
  onClick: v ? undefined : this.handleClick,
3123
3022
  $disabled: v,
3124
3023
  $error: b,
@@ -3129,11 +3028,11 @@
3129
3028
  role: "group",
3130
3029
  "aria-disabled": v || undefined,
3131
3030
  "aria-labelledby": h
3132
- }, x), t().createElement(Dn, {
3031
+ }, x), t().createElement(Rr, {
3133
3032
  role: "listbox",
3134
3033
  "aria-invalid": b,
3135
3034
  "aria-multiselectable": "true"
3136
- }, this.renderButtons(I)), !v && t().createElement(Ln, er({
3035
+ }, this.renderButtons(P)), !v && t().createElement(Mr, $r({
3137
3036
  role: "combobox",
3138
3037
  "data-test": "textbox",
3139
3038
  id: m,
@@ -3147,7 +3046,7 @@
3147
3046
  autoComplete: "off",
3148
3047
  autoCorrect: "off",
3149
3048
  spellCheck: false,
3150
- style: A,
3049
+ style: M,
3151
3050
  placeholder: j.length ? "" : g,
3152
3051
  required: O,
3153
3052
  "aria-activedescendant": this.state.open && this.availableOptionCount > 0 ? this.activeItemId : undefined,
@@ -3156,7 +3055,7 @@
3156
3055
  "aria-owns": this.state.open ? this.popoverId : undefined,
3157
3056
  "aria-expanded": this.state.open,
3158
3057
  "aria-haspopup": true
3159
- }, k)), t().createElement(_n(), {
3058
+ }, k)), t().createElement(xr(), {
3160
3059
  open: this.state.open && !!this.state.el,
3161
3060
  autoCloseWhenOffScreen: true,
3162
3061
  anchor: this.state.el,
@@ -3165,63 +3064,63 @@
3165
3064
  defaultPlacement: p,
3166
3065
  repositionMode: w,
3167
3066
  id: this.popoverId
3168
- }, this.renderMenu)), t().createElement(Vn(), {
3067
+ }, this.renderMenu)), t().createElement(he(), {
3169
3068
  role: "status",
3170
3069
  "aria-relevant": "text"
3171
- }, this.state.loadingMoreMessage), C && this.state.open ? t().createElement(Fn, {
3070
+ }, this.state.loadingMoreMessage), S && this.state.open ? t().createElement(Tr, {
3172
3071
  key: "overlay",
3173
3072
  $popoveropen: this.state.open,
3174
3073
  "data-test": "overlay"
3175
- }) : null, t().createElement(Vn(), {
3074
+ }) : null, t().createElement(he(), {
3176
3075
  role: "alert",
3177
3076
  "aria-relevant": "additions"
3178
- }, this.getSelectedItemsContent(I)));
3077
+ }, this.getSelectedItemsContent(P)));
3179
3078
  }
3180
3079
  } ]);
3181
3080
  return o;
3182
3081
  }(e.Component);
3183
- fr(hr, "propTypes", vr);
3184
- fr(hr, "defaultProps", br);
3185
- fr(hr, "Option", Z);
3186
- fr(hr, "Divider", f.Divider);
3187
- fr(hr, "Heading", f.Heading);
3188
- /* harmony default export */ const gr = hr;
3082
+ tn(cn, "propTypes", on);
3083
+ tn(cn, "defaultProps", an);
3084
+ tn(cn, "Option", W);
3085
+ tn(cn, "Divider", f.Divider);
3086
+ tn(cn, "Heading", f.Heading);
3087
+ /* harmony default export */ const sn = cn;
3189
3088
  // CONCATENATED MODULE: ./src/Multiselect/Multiselect.tsx
3190
- function Or(e) {
3089
+ function fn(e) {
3191
3090
  "@babel/helpers - typeof";
3192
- return Or = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
3091
+ return fn = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
3193
3092
  return typeof e;
3194
3093
  } : function(e) {
3195
3094
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
3196
- }, Or(e);
3095
+ }, fn(e);
3197
3096
  }
3198
- function wr() {
3199
- return wr = Object.assign ? Object.assign.bind() : function(e) {
3097
+ function pn() {
3098
+ return pn = Object.assign ? Object.assign.bind() : function(e) {
3200
3099
  for (var t = 1; t < arguments.length; t++) {
3201
- var n = arguments[t];
3202
- for (var r in n) {
3203
- ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
3100
+ var r = arguments[t];
3101
+ for (var n in r) {
3102
+ ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
3204
3103
  }
3205
3104
  }
3206
3105
  return e;
3207
- }, wr.apply(null, arguments);
3106
+ }, pn.apply(null, arguments);
3208
3107
  }
3209
- function Cr(e, t) {
3108
+ function dn(e, t) {
3210
3109
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
3211
3110
  }
3212
- function Sr(e, t) {
3213
- for (var n = 0; n < t.length; n++) {
3214
- var r = t[n];
3215
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
3216
- Object.defineProperty(e, Rr(r.key), r);
3111
+ function vn(e, t) {
3112
+ for (var r = 0; r < t.length; r++) {
3113
+ var n = t[r];
3114
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
3115
+ Object.defineProperty(e, kn(n.key), n);
3217
3116
  }
3218
3117
  }
3219
- function kr(e, t, n) {
3220
- return t && Sr(e.prototype, t), n && Sr(e, n), Object.defineProperty(e, "prototype", {
3118
+ function bn(e, t, r) {
3119
+ return t && vn(e.prototype, t), r && vn(e, r), Object.defineProperty(e, "prototype", {
3221
3120
  writable: !1
3222
3121
  }), e;
3223
3122
  }
3224
- function xr(e, t) {
3123
+ function yn(e, t) {
3225
3124
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
3226
3125
  e.prototype = Object.create(t && t.prototype, {
3227
3126
  constructor: {
@@ -3231,71 +3130,71 @@
3231
3130
  }
3232
3131
  }), Object.defineProperty(e, "prototype", {
3233
3132
  writable: !1
3234
- }), t && jr(e, t);
3133
+ }), t && mn(e, t);
3235
3134
  }
3236
- function jr(e, t) {
3237
- return jr = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
3135
+ function mn(e, t) {
3136
+ return mn = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
3238
3137
  return e.__proto__ = t, e;
3239
- }, jr(e, t);
3138
+ }, mn(e, t);
3240
3139
  }
3241
- function Ir(e) {
3242
- var t = Mr();
3140
+ function hn(e) {
3141
+ var t = wn();
3243
3142
  return function() {
3244
- var n, r = Ar(e);
3143
+ var r, n = Sn(e);
3245
3144
  if (t) {
3246
- var o = Ar(this).constructor;
3247
- n = Reflect.construct(r, arguments, o);
3248
- } else n = r.apply(this, arguments);
3249
- return Pr(this, n);
3145
+ var o = Sn(this).constructor;
3146
+ r = Reflect.construct(n, arguments, o);
3147
+ } else r = n.apply(this, arguments);
3148
+ return gn(this, r);
3250
3149
  };
3251
3150
  }
3252
- function Pr(e, t) {
3253
- if (t && ("object" == Or(t) || "function" == typeof t)) return t;
3151
+ function gn(e, t) {
3152
+ if (t && ("object" == fn(t) || "function" == typeof t)) return t;
3254
3153
  if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
3255
- return Er(e);
3154
+ return On(e);
3256
3155
  }
3257
- function Er(e) {
3156
+ function On(e) {
3258
3157
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
3259
3158
  return e;
3260
3159
  }
3261
- function Mr() {
3160
+ function wn() {
3262
3161
  try {
3263
3162
  var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
3264
3163
  } catch (e) {}
3265
- return (Mr = function t() {
3164
+ return (wn = function t() {
3266
3165
  return !!e;
3267
3166
  })();
3268
3167
  }
3269
- function Ar(e) {
3270
- return Ar = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
3168
+ function Sn(e) {
3169
+ return Sn = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
3271
3170
  return e.__proto__ || Object.getPrototypeOf(e);
3272
- }, Ar(e);
3171
+ }, Sn(e);
3273
3172
  }
3274
- function _r(e, t, n) {
3275
- return (t = Rr(t)) in e ? Object.defineProperty(e, t, {
3276
- value: n,
3173
+ function Cn(e, t, r) {
3174
+ return (t = kn(t)) in e ? Object.defineProperty(e, t, {
3175
+ value: r,
3277
3176
  enumerable: !0,
3278
3177
  configurable: !0,
3279
3178
  writable: !0
3280
- }) : e[t] = n, e;
3281
- }
3282
- function Rr(e) {
3283
- var t = Vr(e, "string");
3284
- return "symbol" == Or(t) ? t : t + "";
3285
- }
3286
- function Vr(e, t) {
3287
- if ("object" != Or(e) || !e) return e;
3288
- var n = e[Symbol.toPrimitive];
3289
- if (void 0 !== n) {
3290
- var r = n.call(e, t || "default");
3291
- if ("object" != Or(r)) return r;
3179
+ }) : e[t] = r, e;
3180
+ }
3181
+ function kn(e) {
3182
+ var t = xn(e, "string");
3183
+ return "symbol" == fn(t) ? t : t + "";
3184
+ }
3185
+ function xn(e, t) {
3186
+ if ("object" != fn(e) || !e) return e;
3187
+ var r = e[Symbol.toPrimitive];
3188
+ if (void 0 !== r) {
3189
+ var n = r.call(e, t || "default");
3190
+ if ("object" != fn(n)) return n;
3292
3191
  throw new TypeError("@@toPrimitive must return a primitive value.");
3293
3192
  }
3294
3193
  return ("string" === t ? String : Number)(e);
3295
3194
  }
3296
3195
  /** @public */
3297
3196
  /** @public */
3298
- /** @public */ var Tr = {
3197
+ /** @public */ var jn = {
3299
3198
  allowNewValues: a().bool,
3300
3199
  animateLoading: a().bool,
3301
3200
  children: a().node,
@@ -3334,7 +3233,7 @@
3334
3233
  /** @private */
3335
3234
  virtualization: a().number
3336
3235
  };
3337
- var Br = {
3236
+ var Pn = {
3338
3237
  allowNewValues: false,
3339
3238
  animateLoading: false,
3340
3239
  compact: false,
@@ -3349,45 +3248,45 @@
3349
3248
  tabConfirmsNewValue: false,
3350
3249
  useClickawayOverlay: false
3351
3250
  };
3352
- function qr(e) {
3251
+ function En(e) {
3353
3252
  return (e === null || e === void 0 ? void 0 : e.compact) === true;
3354
3253
  }
3355
- var Nr = function(e) {
3356
- xr(r, e);
3357
- var n = Ir(r);
3358
- function r() {
3359
- Cr(this, r);
3360
- return n.apply(this, arguments);
3254
+ var In = function(e) {
3255
+ yn(n, e);
3256
+ var r = hn(n);
3257
+ function n() {
3258
+ dn(this, n);
3259
+ return r.apply(this, arguments);
3361
3260
  }
3362
- kr(r, [ {
3261
+ bn(n, [ {
3363
3262
  key: "render",
3364
3263
  // @docs-props-type MultiselectPropsBase
3365
3264
  // TODO: SUI-3402, this can be removed when ControlGroup no longer needs to inspect componentType
3366
3265
  value: function e() {
3367
- if (qr(this.props)) {
3266
+ if (En(this.props)) {
3368
3267
 
3369
- return t().createElement(pn, wr({
3268
+ return t().createElement(ar, pn({
3370
3269
  "data-test": "multiselect"
3371
3270
  }, c()(this.props, "compact")));
3372
3271
  }
3373
3272
  if (false) {}
3374
3273
  if (false) {}
3375
3274
 
3376
- return t().createElement(gr, wr({
3275
+ return t().createElement(sn, pn({
3377
3276
  "data-test": "multiselect"
3378
3277
  }, c()(this.props, "compact")));
3379
3278
  }
3380
3279
  } ]);
3381
- return r;
3280
+ return n;
3382
3281
  }(e.Component);
3383
- _r(Nr, "propTypes", Tr);
3384
- _r(Nr, "defaultProps", Br);
3385
- _r(Nr, "componentType", "Multiselect");
3386
- _r(Nr, "Option", Z);
3387
- _r(Nr, "Heading", f.Heading);
3388
- _r(Nr, "Divider", f.Divider);
3389
- /* harmony default export */ const Dr = Nr;
3282
+ Cn(In, "propTypes", jn);
3283
+ Cn(In, "defaultProps", Pn);
3284
+ Cn(In, "componentType", "Multiselect");
3285
+ Cn(In, "Option", W);
3286
+ Cn(In, "Heading", f.Heading);
3287
+ Cn(In, "Divider", f.Divider);
3288
+ /* harmony default export */ const Rn = In;
3390
3289
  }) // CONCATENATED MODULE: ./src/Multiselect/index.ts
3391
3290
  ();
3392
- module.exports = r;
3291
+ module.exports = n;
3393
3292
  /******/})();