@splunk/react-ui 5.8.0 → 5.9.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.
package/SelectBase.js CHANGED
@@ -9,26 +9,26 @@
9
9
  /******/ (() => {
10
10
  /******/ // getDefaultExport function for compatibility with non-harmony modules
11
11
  /******/ e.n = r => {
12
- /******/ var t = r && r.__esModule ?
12
+ /******/ var n = r && r.__esModule ?
13
13
  /******/ () => r["default"]
14
14
  /******/ : () => r
15
15
  /******/;
16
- e.d(t, {
17
- a: t
16
+ e.d(n, {
17
+ a: n
18
18
  });
19
- /******/ return t;
19
+ /******/ return n;
20
20
  /******/ };
21
21
  /******/ })();
22
22
  /******/
23
23
  /******/ /* webpack/runtime/define property getters */
24
24
  /******/ (() => {
25
25
  /******/ // define getter functions for harmony exports
26
- /******/ e.d = (r, t) => {
27
- /******/ for (var n in t) {
28
- /******/ if (e.o(t, n) && !e.o(r, n)) {
29
- /******/ Object.defineProperty(r, n, {
26
+ /******/ e.d = (r, n) => {
27
+ /******/ for (var t in n) {
28
+ /******/ if (e.o(n, t) && !e.o(r, t)) {
29
+ /******/ Object.defineProperty(r, t, {
30
30
  enumerable: true,
31
- get: t[n]
31
+ get: n[t]
32
32
  });
33
33
  /******/ }
34
34
  /******/ }
@@ -61,23 +61,23 @@
61
61
  e.r(r);
62
62
  // EXPORTS
63
63
  e.d(r, {
64
- Controls: () => /* reexport */ fr,
64
+ Controls: () => /* reexport */ dr,
65
65
  Divider: () => /* reexport */ w.Divider,
66
66
  Heading: () => /* reexport */ w.Heading,
67
- Option: () => /* reexport */ U,
67
+ Option: () => /* reexport */ J,
68
68
  SelectAllOption: () => /* reexport */ oe,
69
- default: () => /* reexport */ yr,
70
- isOption: () => /* reexport */ nr
69
+ default: () => /* reexport */ gr,
70
+ isOption: () => /* reexport */ lr
71
71
  });
72
72
  // CONCATENATED MODULE: external "react"
73
- const t = require("react");
74
- var n = e.n(t);
73
+ const n = require("react");
74
+ var t = e.n(n);
75
75
  // CONCATENATED MODULE: external "lodash/castArray"
76
76
  const l = require("lodash/castArray");
77
77
  var a = e.n(l);
78
78
  // CONCATENATED MODULE: external "lodash/has"
79
- const o = require("lodash/has");
80
- var i = e.n(o);
79
+ const i = require("lodash/has");
80
+ var o = e.n(i);
81
81
  // CONCATENATED MODULE: external "lodash/memoize"
82
82
  const u = require("lodash/memoize");
83
83
  var c = e.n(u);
@@ -115,101 +115,143 @@
115
115
  var L = e.n(A);
116
116
  // CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
117
117
  const I = require("@splunk/react-ui/usePrevious");
118
- var R = e.n(I);
118
+ var D = e.n(I);
119
119
  // CONCATENATED MODULE: external "@splunk/ui-utils/filter"
120
- const M = require("@splunk/ui-utils/filter");
120
+ const R = require("@splunk/ui-utils/filter");
121
121
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
122
- const T = require("@splunk/ui-utils/i18n");
122
+ const M = require("@splunk/ui-utils/i18n");
123
123
  // CONCATENATED MODULE: external "@splunk/ui-utils/id"
124
- const q = require("@splunk/ui-utils/id");
124
+ const T = require("@splunk/ui-utils/id");
125
125
  // CONCATENATED MODULE: external "@splunk/ui-utils/scroll"
126
- const D = require("@splunk/ui-utils/scroll");
127
- // CONCATENATED MODULE: ./src/SelectBase/OptionBase.tsx
126
+ const q = require("@splunk/ui-utils/scroll");
127
+ // CONCATENATED MODULE: ./src/utils/disabled.ts
128
+ /**
129
+ * Normalizes the disabled prop and returns both the boolean state and normalized string value.
130
+ * Use this function to ensure consistent handling of disabled prop across components.
131
+ *
132
+ * @param disabled - The disabled prop value
133
+ * @param defaultWhenBooleanTrue - Optional normalization override for disabled={true}
134
+ * @returns Object with isDisabled boolean|undefined and disabledValue string
135
+ *
136
+ * TODO (SUI-8600): `disabled` prop should default to 'dimmed' for data entry components
137
+ */
128
138
  function _(e) {
139
+ var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "dimmed";
140
+ if (e === "dimmed") {
141
+ return {
142
+ isDisabled: true,
143
+ disabledValue: "dimmed"
144
+ };
145
+ }
146
+ if (e === true) {
147
+ return {
148
+ isDisabled: true,
149
+ disabledValue: r
150
+ };
151
+ }
152
+ if (e === "disabled") {
153
+ return {
154
+ isDisabled: true,
155
+ disabledValue: "disabled"
156
+ };
157
+ }
158
+ if (e === false) {
159
+ return {
160
+ isDisabled: false,
161
+ disabledValue: undefined
162
+ };
163
+ }
164
+ return {
165
+ isDisabled: undefined,
166
+ disabledValue: undefined
167
+ };
168
+ }
169
+ // CONCATENATED MODULE: ./src/SelectBase/OptionBase.tsx
170
+ function B(e) {
129
171
  "@babel/helpers - typeof";
130
- return _ = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
172
+ return B = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
131
173
  return typeof e;
132
174
  } : function(e) {
133
175
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
134
- }, _(e);
176
+ }, B(e);
135
177
  }
136
- function B() {
137
- return B = Object.assign ? Object.assign.bind() : function(e) {
178
+ function V() {
179
+ return V = Object.assign ? Object.assign.bind() : function(e) {
138
180
  for (var r = 1; r < arguments.length; r++) {
139
- var t = arguments[r];
140
- for (var n in t) {
141
- ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
181
+ var n = arguments[r];
182
+ for (var t in n) {
183
+ ({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
142
184
  }
143
185
  }
144
186
  return e;
145
- }, B.apply(null, arguments);
187
+ }, V.apply(null, arguments);
146
188
  }
147
189
  function N(e, r) {
148
- var t = Object.keys(e);
190
+ var n = Object.keys(e);
149
191
  if (Object.getOwnPropertySymbols) {
150
- var n = Object.getOwnPropertySymbols(e);
151
- r && (n = n.filter((function(r) {
192
+ var t = Object.getOwnPropertySymbols(e);
193
+ r && (t = t.filter((function(r) {
152
194
  return Object.getOwnPropertyDescriptor(e, r).enumerable;
153
- }))), t.push.apply(t, n);
195
+ }))), n.push.apply(n, t);
154
196
  }
155
- return t;
197
+ return n;
156
198
  }
157
- function V(e) {
199
+ function F(e) {
158
200
  for (var r = 1; r < arguments.length; r++) {
159
- var t = null != arguments[r] ? arguments[r] : {};
160
- r % 2 ? N(Object(t), !0).forEach((function(r) {
161
- F(e, r, t[r]);
162
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : N(Object(t)).forEach((function(r) {
163
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
201
+ var n = null != arguments[r] ? arguments[r] : {};
202
+ r % 2 ? N(Object(n), !0).forEach((function(r) {
203
+ K(e, r, n[r]);
204
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : N(Object(n)).forEach((function(r) {
205
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
164
206
  }));
165
207
  }
166
208
  return e;
167
209
  }
168
- function F(e, r, t) {
169
- return (r = K(r)) in e ? Object.defineProperty(e, r, {
170
- value: t,
210
+ function K(e, r, n) {
211
+ return (r = H(r)) in e ? Object.defineProperty(e, r, {
212
+ value: n,
171
213
  enumerable: !0,
172
214
  configurable: !0,
173
215
  writable: !0
174
- }) : e[r] = t, e;
216
+ }) : e[r] = n, e;
175
217
  }
176
- function K(e) {
177
- var r = H(e, "string");
178
- return "symbol" == _(r) ? r : r + "";
218
+ function H(e) {
219
+ var r = z(e, "string");
220
+ return "symbol" == B(r) ? r : r + "";
179
221
  }
180
- function H(e, r) {
181
- if ("object" != _(e) || !e) return e;
182
- var t = e[Symbol.toPrimitive];
183
- if (void 0 !== t) {
184
- var n = t.call(e, r || "default");
185
- if ("object" != _(n)) return n;
222
+ function z(e, r) {
223
+ if ("object" != B(e) || !e) return e;
224
+ var n = e[Symbol.toPrimitive];
225
+ if (void 0 !== n) {
226
+ var t = n.call(e, r || "default");
227
+ if ("object" != B(t)) return t;
186
228
  throw new TypeError("@@toPrimitive must return a primitive value.");
187
229
  }
188
230
  return ("string" === r ? String : Number)(e);
189
231
  }
190
- function z(e, r) {
232
+ function W(e, r) {
191
233
  if (null == e) return {};
192
- var t, n, l = W(e, r);
234
+ var n, t, l = $(e, r);
193
235
  if (Object.getOwnPropertySymbols) {
194
236
  var a = Object.getOwnPropertySymbols(e);
195
- for (n = 0; n < a.length; n++) {
196
- t = a[n], -1 === r.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (l[t] = e[t]);
237
+ for (t = 0; t < a.length; t++) {
238
+ n = a[t], -1 === r.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (l[n] = e[n]);
197
239
  }
198
240
  }
199
241
  return l;
200
242
  }
201
- function W(e, r) {
243
+ function $(e, r) {
202
244
  if (null == e) return {};
203
- var t = {};
204
- for (var n in e) {
205
- if ({}.hasOwnProperty.call(e, n)) {
206
- if (-1 !== r.indexOf(n)) continue;
207
- t[n] = e[n];
245
+ var n = {};
246
+ for (var t in e) {
247
+ if ({}.hasOwnProperty.call(e, t)) {
248
+ if (-1 !== r.indexOf(t)) continue;
249
+ n[t] = e[t];
208
250
  }
209
251
  }
210
- return t;
252
+ return n;
211
253
  }
212
- var $ = {
254
+ var X = {
213
255
  /** @private */
214
256
  active: p().bool,
215
257
  children: p().node,
@@ -240,147 +282,141 @@
240
282
  };
241
283
  /**
242
284
  * An option within a `Multiselect`.
243
- */ function X(e) {
244
- var r = e.children, l = e.descriptionPosition, a = l === void 0 ? "bottom" : l, o = e.disabled, i = e.elementRef, u = e.endAdornment, c = e.icon, s = e.label, f = e.multiple, d = e.onClick, p = e.role, v = p === void 0 ? "option" : p, b = e.value, m = z(e, [ "children", "descriptionPosition", "disabled", "elementRef", "endAdornment", "icon", "label", "multiple", "onClick", "role", "value" ]);
285
+ */ function U(e) {
286
+ var r = e.children, l = e.descriptionPosition, a = l === void 0 ? "bottom" : l, i = e.disabled, o = e.elementRef, u = e.endAdornment, c = e.icon, s = e.label, f = e.multiple, d = e.onClick, p = e.role, v = p === void 0 ? "option" : p, b = e.value, m = W(e, [ "children", "descriptionPosition", "disabled", "elementRef", "endAdornment", "icon", "label", "multiple", "onClick", "role", "value" ]);
245
287
  // @docs-props-type OptionPropsBase
246
- // TODO (SUI-8600): `disabled` prop should default to 'dimmed' for data entry components
247
- var y;
248
- if (o === "dimmed") {
249
- y = "dimmed";
250
- } else if (o === true || o === "disabled") {
251
- y = "disabled";
252
- }
253
- var g = (0, t.useCallback)((function(e) {
254
- if (!y) {
288
+ var y = _(i, "disabled"), g = y.isDisabled, h = y.disabledValue;
289
+ var S = (0, n.useCallback)((function(e) {
290
+ if (!g) {
255
291
  d === null || d === void 0 ? void 0 : d(e, {
256
292
  value: b
257
293
  });
258
294
  }
259
- }), [ y, d, b ]);
260
- var h = b.toString();
261
- var S = V({
295
+ }), [ g, d, b ]);
296
+ var O = b.toString();
297
+ var C = F({
262
298
  descriptionPosition: a,
263
- disabled: y,
264
- "data-test-disabled": y
299
+ disabled: h,
300
+ "data-test-disabled": h
265
301
  }, m);
266
302
 
267
- return n().createElement(w.Item, B({
303
+ return t().createElement(w.Item, V({
268
304
  "data-test-value": b,
269
305
  "data-test": "option",
270
- elementRef: i,
306
+ elementRef: o,
271
307
  endAdornment: u
272
- }, S, {
308
+ }, C, {
273
309
  selectable: true,
274
310
  selectableAppearance: f ? "checkbox" : "checkmark",
275
311
  startAdornment: c,
276
- onClick: g,
312
+ onClick: S,
277
313
  role: v,
278
- value: h
314
+ value: O
279
315
  }), r || s);
280
316
  }
281
- X.propTypes = $;
282
- X.type = w.Item;
317
+ U.propTypes = X;
318
+ U.type = w.Item;
283
319
  // For components to distinguish if their children are Options or Headings/Dividers
284
- /* harmony default export */ const U = X;
320
+ /* harmony default export */ const J = U;
285
321
  // CONCATENATED MODULE: ./src/SelectBase/SelectAllOption.tsx
286
- function J(e) {
322
+ function G(e) {
287
323
  "@babel/helpers - typeof";
288
- return J = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
324
+ return G = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
289
325
  return typeof e;
290
326
  } : function(e) {
291
327
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
292
- }, J(e);
328
+ }, G(e);
293
329
  }
294
- function G() {
295
- return G = Object.assign ? Object.assign.bind() : function(e) {
330
+ function Q() {
331
+ return Q = Object.assign ? Object.assign.bind() : function(e) {
296
332
  for (var r = 1; r < arguments.length; r++) {
297
- var t = arguments[r];
298
- for (var n in t) {
299
- ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
333
+ var n = arguments[r];
334
+ for (var t in n) {
335
+ ({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
300
336
  }
301
337
  }
302
338
  return e;
303
- }, G.apply(null, arguments);
339
+ }, Q.apply(null, arguments);
304
340
  }
305
- function Q(e, r) {
341
+ function Y(e, r) {
306
342
  if (null == e) return {};
307
- var t, n, l = Y(e, r);
343
+ var n, t, l = Z(e, r);
308
344
  if (Object.getOwnPropertySymbols) {
309
345
  var a = Object.getOwnPropertySymbols(e);
310
- for (n = 0; n < a.length; n++) {
311
- t = a[n], -1 === r.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (l[t] = e[t]);
346
+ for (t = 0; t < a.length; t++) {
347
+ n = a[t], -1 === r.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (l[n] = e[n]);
312
348
  }
313
349
  }
314
350
  return l;
315
351
  }
316
- function Y(e, r) {
352
+ function Z(e, r) {
317
353
  if (null == e) return {};
318
- var t = {};
319
- for (var n in e) {
320
- if ({}.hasOwnProperty.call(e, n)) {
321
- if (-1 !== r.indexOf(n)) continue;
322
- t[n] = e[n];
354
+ var n = {};
355
+ for (var t in e) {
356
+ if ({}.hasOwnProperty.call(e, t)) {
357
+ if (-1 !== r.indexOf(t)) continue;
358
+ n[t] = e[t];
323
359
  }
324
360
  }
325
- return t;
361
+ return n;
326
362
  }
327
- function Z(e, r) {
328
- var t = Object.keys(e);
363
+ function ee(e, r) {
364
+ var n = Object.keys(e);
329
365
  if (Object.getOwnPropertySymbols) {
330
- var n = Object.getOwnPropertySymbols(e);
331
- r && (n = n.filter((function(r) {
366
+ var t = Object.getOwnPropertySymbols(e);
367
+ r && (t = t.filter((function(r) {
332
368
  return Object.getOwnPropertyDescriptor(e, r).enumerable;
333
- }))), t.push.apply(t, n);
369
+ }))), n.push.apply(n, t);
334
370
  }
335
- return t;
371
+ return n;
336
372
  }
337
- function ee(e) {
373
+ function re(e) {
338
374
  for (var r = 1; r < arguments.length; r++) {
339
- var t = null != arguments[r] ? arguments[r] : {};
340
- r % 2 ? Z(Object(t), !0).forEach((function(r) {
341
- re(e, r, t[r]);
342
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Z(Object(t)).forEach((function(r) {
343
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
375
+ var n = null != arguments[r] ? arguments[r] : {};
376
+ r % 2 ? ee(Object(n), !0).forEach((function(r) {
377
+ ne(e, r, n[r]);
378
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ee(Object(n)).forEach((function(r) {
379
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
344
380
  }));
345
381
  }
346
382
  return e;
347
383
  }
348
- function re(e, r, t) {
384
+ function ne(e, r, n) {
349
385
  return (r = te(r)) in e ? Object.defineProperty(e, r, {
350
- value: t,
386
+ value: n,
351
387
  enumerable: !0,
352
388
  configurable: !0,
353
389
  writable: !0
354
- }) : e[r] = t, e;
390
+ }) : e[r] = n, e;
355
391
  }
356
392
  function te(e) {
357
- var r = ne(e, "string");
358
- return "symbol" == J(r) ? r : r + "";
393
+ var r = le(e, "string");
394
+ return "symbol" == G(r) ? r : r + "";
359
395
  }
360
- function ne(e, r) {
361
- if ("object" != J(e) || !e) return e;
362
- var t = e[Symbol.toPrimitive];
363
- if (void 0 !== t) {
364
- var n = t.call(e, r || "default");
365
- if ("object" != J(n)) return n;
396
+ function le(e, r) {
397
+ if ("object" != G(e) || !e) return e;
398
+ var n = e[Symbol.toPrimitive];
399
+ if (void 0 !== n) {
400
+ var t = n.call(e, r || "default");
401
+ if ("object" != G(t)) return t;
366
402
  throw new TypeError("@@toPrimitive must return a primitive value.");
367
403
  }
368
404
  return ("string" === r ? String : Number)(e);
369
405
  }
370
- var le = ee(ee({}, U.propTypes), {}, {
406
+ var ae = re(re({}, J.propTypes), {}, {
371
407
  totalCount: p().number,
372
408
  // unlike OptionBase, there's a default value for this prop
373
409
  value: p().string
374
410
  });
375
- function ae(e) {
376
- var r = e.active, t = e.elementRef, l = e.id, a = e.label, o = e.onClick, i = e.selected, u = e.totalCount, c = e.value, s = c === void 0 ? "selectAll" : c, f = Q(e, [ "active", "elementRef", "id", "label", "onClick", "selected", "totalCount", "value" ]);
411
+ function ie(e) {
412
+ var r = e.active, n = e.elementRef, l = e.id, a = e.label, i = e.onClick, o = e.selected, u = e.totalCount, c = e.value, s = c === void 0 ? "selectAll" : c, f = Y(e, [ "active", "elementRef", "id", "label", "onClick", "selected", "totalCount", "value" ]);
377
413
  // @docs-props-type SelectAllOptionPropsBase
378
414
  // When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
379
415
  var d = u != null ? " (".concat(u === null || u === void 0 ? void 0 : u.toString(), ")") : "";
380
416
 
381
- return n().createElement(U, G({
417
+ return t().createElement(J, Q({
382
418
  active: r,
383
- elementRef: t,
419
+ elementRef: n,
384
420
  "aria-keyshortcuts": "Control+A",
385
421
  "data-test": "select-all",
386
422
  description: "".concat(d, " Ctrl-a"),
@@ -389,27 +425,27 @@
389
425
  key: "selectAll",
390
426
  multiple: true,
391
427
  label: a,
392
- onClick: o,
393
- selected: i,
428
+ onClick: i,
429
+ selected: o,
394
430
  role: "menuitemcheckbox",
395
431
  value: s
396
432
  }, f));
397
433
  }
398
- ae.propTypes = le;
399
- /* harmony default export */ const oe = ae;
434
+ ie.propTypes = ae;
435
+ /* harmony default export */ const oe = ie;
400
436
  // CONCATENATED MODULE: external "styled-components"
401
- const ie = require("styled-components");
402
- var ue = e.n(ie);
437
+ const ue = require("styled-components");
438
+ var ce = e.n(ue);
403
439
  // CONCATENATED MODULE: external "@splunk/react-ui/Button"
404
- const ce = require("@splunk/react-ui/Button");
405
- var se = e.n(ce);
440
+ const se = require("@splunk/react-ui/Button");
441
+ var fe = e.n(se);
406
442
  // CONCATENATED MODULE: external "@splunk/react-ui/Divider"
407
- const fe = require("@splunk/react-ui/Divider");
408
- var de = e.n(fe);
443
+ const de = require("@splunk/react-ui/Divider");
444
+ var pe = e.n(de);
409
445
  // CONCATENATED MODULE: external "@splunk/themes"
410
- const pe = require("@splunk/themes");
446
+ const ve = require("@splunk/themes");
411
447
  // CONCATENATED MODULE: ./src/SelectBase/SelectBaseStyles.ts
412
- var ve = ue()(se()).withConfig({
448
+ var be = ce()(fe()).withConfig({
413
449
  displayName: "SelectBaseStyles__StyledButton",
414
450
  componentId: "sc-1lmonqb-0"
415
451
  })([ "&[data-inline]{width:", ";}", "" ], (function(e) {
@@ -419,77 +455,77 @@
419
455
  var r = e.$multiple;
420
456
  return !r && "flex-grow: 0;";
421
457
  }));
422
- var be = ue().span.withConfig({
458
+ var me = ce().span.withConfig({
423
459
  displayName: "SelectBaseStyles__StyledLinkIcon",
424
460
  componentId: "sc-1lmonqb-1"
425
- })([ "padding-right:", ";" ], pe.variables.spacingXSmall);
426
- var me = ue().span.withConfig({
461
+ })([ "padding-right:", ";" ], ve.variables.spacingXSmall);
462
+ var ye = ce().span.withConfig({
427
463
  displayName: "SelectBaseStyles__StyledLinkCaret",
428
464
  componentId: "sc-1lmonqb-2"
429
- })([ "padding-left:", ";" ], pe.variables.spacingXSmall);
430
- var ye = ue().div.withConfig({
465
+ })([ "padding-left:", ";" ], ve.variables.spacingXSmall);
466
+ var ge = ce().div.withConfig({
431
467
  displayName: "SelectBaseStyles__StyledFilter",
432
468
  componentId: "sc-1lmonqb-3"
433
- })([ "padding:", " ", " ", ";min-width:160px;" ], pe.variables.spacingLarge, pe.variables.spacingLarge, pe.variables.spacingSmall);
434
- var ge = ue().span.withConfig({
469
+ })([ "padding:", " ", " ", ";min-width:160px;" ], ve.variables.spacingLarge, ve.variables.spacingLarge, ve.variables.spacingSmall);
470
+ var he = ce().span.withConfig({
435
471
  displayName: "SelectBaseStyles__StyledCount",
436
472
  componentId: "sc-1lmonqb-4"
437
- })([ "padding-right:", ";" ], pe.variables.spacingXSmall);
438
- var he = ue()(O()).withConfig({
473
+ })([ "padding-right:", ";" ], ve.variables.spacingXSmall);
474
+ var Se = ce()(O()).withConfig({
439
475
  displayName: "SelectBaseStyles__StyledControlsLink",
440
476
  componentId: "sc-1lmonqb-5"
441
477
  })([ "", ";" ], (function(e) {
442
478
  var r = e.$disabled;
443
- return r && (0, ie.css)([ "color:", ";" ], pe.variables.contentColorDisabled);
479
+ return r && (0, ue.css)([ "color:", ";" ], ve.variables.contentColorDisabled);
444
480
  }));
445
- var Se = ue().div.withConfig({
481
+ var Oe = ce().div.withConfig({
446
482
  displayName: "SelectBaseStyles__StyledToggleAllControls",
447
483
  componentId: "sc-1lmonqb-6"
448
- })([ "", ";gap:", ";padding:", " ", " ", ";" ], pe.mixins.reset("flex"), pe.variables.spacingMedium, pe.variables.spacingXSmall, pe.variables.spacingLarge, pe.variables.spacingSmall);
449
- var Oe = ue()(de()).withConfig({
484
+ })([ "", ";gap:", ";padding:", " ", " ", ";" ], ve.mixins.reset("flex"), ve.variables.spacingMedium, ve.variables.spacingXSmall, ve.variables.spacingLarge, ve.variables.spacingSmall);
485
+ var we = ce()(pe()).withConfig({
450
486
  displayName: "SelectBaseStyles__StyledControlsDivider",
451
487
  componentId: "sc-1lmonqb-7"
452
- })([ "border-color:", ";" ], pe.variables.borderColor);
488
+ })([ "border-color:", ";" ], ve.variables.borderColor);
453
489
  // CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
454
490
  // A utility for matching keyboard characters to list values
455
- var we = function e(r, t) {
456
- return r ? r.label.charAt(t).toLowerCase() : "";
491
+ var Ce = function e(r, n) {
492
+ return r ? r.label.charAt(n).toLowerCase() : "";
457
493
  };
458
- var Ce = function e(r, t) {
494
+ var ke = function e(r, n) {
459
495
  if (!r.length) {
460
496
  return r;
461
497
  }
462
- var n = null;
498
+ var t = null;
463
499
  var l = false;
464
500
  var a = r.filter((function(e) {
465
- var r = we(e, t.index);
466
- if (r === t.value) {
501
+ var r = Ce(e, n.index);
502
+ if (r === n.value) {
467
503
  l = true;
468
504
  return true;
469
505
  }
470
506
  // If we haven't found a match yet, keep track of the next closest match.
471
507
  // Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
472
508
  if (!l) {
473
- var a = we(n, t.index);
509
+ var a = Ce(t, n.index);
474
510
  if (!a) {
475
- n = e;
476
- } else if (r > t.value) {
477
- if (a < t.value) {
478
- n = e;
511
+ t = e;
512
+ } else if (r > n.value) {
513
+ if (a < n.value) {
514
+ t = e;
479
515
  } else if (a > r) {
480
- n = e;
516
+ t = e;
481
517
  }
482
518
  } else if (r > a) {
483
- n = e;
519
+ t = e;
484
520
  }
485
521
  }
486
522
  return false;
487
523
  }));
488
- return a.length === 0 && n ? [ n ] : a;
524
+ return a.length === 0 && t ? [ t ] : a;
489
525
  };
490
526
  // CONCATENATED MODULE: ./src/utils/ssrDocument.ts
491
527
  /* eslint-disable @typescript-eslint/no-empty-function */
492
- var ke = {
528
+ var xe = {
493
529
  body: {
494
530
  appendChild: function e() {
495
531
  return [];
@@ -543,16 +579,16 @@
543
579
  search: ""
544
580
  }
545
581
  };
546
- function xe() {
547
- var e = typeof document !== "undefined" ? document : ke;
582
+ function je() {
583
+ var e = typeof document !== "undefined" ? document : xe;
548
584
  return e;
549
585
  }
550
- var je = xe();
551
- /* harmony default export */ const Ee = /* unused pure expression or super */ null && je;
586
+ var Ee = je();
587
+ /* harmony default export */ const Pe = /* unused pure expression or super */ null && Ee;
552
588
  // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
553
589
  /* eslint-disable @typescript-eslint/no-empty-function */
554
- var Pe = {
555
- document: ke,
590
+ var Ae = {
591
+ document: xe,
556
592
  navigator: {
557
593
  userAgent: ""
558
594
  },
@@ -606,12 +642,12 @@
606
642
  clearTimeout(r);
607
643
  }
608
644
  };
609
- function Ae() {
610
- var e = typeof window !== "undefined" ? window : Pe;
645
+ function Le() {
646
+ var e = typeof window !== "undefined" ? window : Ae;
611
647
  return e;
612
648
  }
613
- var Le = Ae();
614
- /* harmony default export */ const Ie = /* unused pure expression or super */ null && Le;
649
+ var Ie = Le();
650
+ /* harmony default export */ const De = /* unused pure expression or super */ null && Ie;
615
651
  // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
616
652
  /**
617
653
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
@@ -633,7 +669,7 @@
633
669
  }
634
670
  // CONCATENATED MODULE: ./src/SelectBase/SelectBase.tsx
635
671
  function Me(e) {
636
- return De(e) || qe(e) || Ve(e) || Te();
672
+ return _e(e) || qe(e) || Fe(e) || Te();
637
673
  }
638
674
  function Te() {
639
675
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
@@ -641,142 +677,143 @@
641
677
  function qe(e) {
642
678
  if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
643
679
  }
644
- function De(e) {
645
- if (Array.isArray(e)) return Fe(e);
680
+ function _e(e) {
681
+ if (Array.isArray(e)) return Ke(e);
646
682
  }
647
- function _e() {
648
- return _e = Object.assign ? Object.assign.bind() : function(e) {
683
+ function Be() {
684
+ return Be = Object.assign ? Object.assign.bind() : function(e) {
649
685
  for (var r = 1; r < arguments.length; r++) {
650
- var t = arguments[r];
651
- for (var n in t) {
652
- ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
686
+ var n = arguments[r];
687
+ for (var t in n) {
688
+ ({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
653
689
  }
654
690
  }
655
691
  return e;
656
- }, _e.apply(null, arguments);
692
+ }, Be.apply(null, arguments);
657
693
  }
658
- function Be(e, r) {
659
- return He(e) || Ke(e, r) || Ve(e, r) || Ne();
694
+ function Ve(e, r) {
695
+ return ze(e) || He(e, r) || Fe(e, r) || Ne();
660
696
  }
661
697
  function Ne() {
662
698
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
663
699
  }
664
- function Ve(e, r) {
700
+ function Fe(e, r) {
665
701
  if (e) {
666
- if ("string" == typeof e) return Fe(e, r);
667
- var t = {}.toString.call(e).slice(8, -1);
668
- return "Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t ? Array.from(e) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Fe(e, r) : void 0;
702
+ if ("string" == typeof e) return Ke(e, r);
703
+ var n = {}.toString.call(e).slice(8, -1);
704
+ 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) ? Ke(e, r) : void 0;
669
705
  }
670
706
  }
671
- function Fe(e, r) {
707
+ function Ke(e, r) {
672
708
  (null == r || r > e.length) && (r = e.length);
673
- for (var t = 0, n = Array(r); t < r; t++) {
674
- n[t] = e[t];
709
+ for (var n = 0, t = Array(r); n < r; n++) {
710
+ t[n] = e[n];
675
711
  }
676
- return n;
712
+ return t;
677
713
  }
678
- function Ke(e, r) {
679
- var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
680
- if (null != t) {
681
- var n, l, a, o, i = [], u = !0, c = !1;
714
+ function He(e, r) {
715
+ var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
716
+ if (null != n) {
717
+ var t, l, a, i, o = [], u = !0, c = !1;
682
718
  try {
683
- if (a = (t = t.call(e)).next, 0 === r) {
684
- if (Object(t) !== t) return;
719
+ if (a = (n = n.call(e)).next, 0 === r) {
720
+ if (Object(n) !== n) return;
685
721
  u = !1;
686
- } else for (;!(u = (n = a.call(t)).done) && (i.push(n.value), i.length !== r); u = !0) {
722
+ } else for (;!(u = (t = a.call(n)).done) && (o.push(t.value), o.length !== r); u = !0) {
687
723
  }
688
724
  } catch (e) {
689
725
  c = !0, l = e;
690
726
  } finally {
691
727
  try {
692
- if (!u && null != t["return"] && (o = t["return"](), Object(o) !== o)) return;
728
+ if (!u && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
693
729
  } finally {
694
730
  if (c) throw l;
695
731
  }
696
732
  }
697
- return i;
733
+ return o;
698
734
  }
699
735
  }
700
- function He(e) {
736
+ function ze(e) {
701
737
  if (Array.isArray(e)) return e;
702
738
  }
703
- function ze(e, r) {
739
+ function We(e, r) {
704
740
  if (null == e) return {};
705
- var t, n, l = We(e, r);
741
+ var n, t, l = $e(e, r);
706
742
  if (Object.getOwnPropertySymbols) {
707
743
  var a = Object.getOwnPropertySymbols(e);
708
- for (n = 0; n < a.length; n++) {
709
- t = a[n], -1 === r.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (l[t] = e[t]);
744
+ for (t = 0; t < a.length; t++) {
745
+ n = a[t], -1 === r.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (l[n] = e[n]);
710
746
  }
711
747
  }
712
748
  return l;
713
749
  }
714
- function We(e, r) {
750
+ function $e(e, r) {
715
751
  if (null == e) return {};
716
- var t = {};
717
- for (var n in e) {
718
- if ({}.hasOwnProperty.call(e, n)) {
719
- if (-1 !== r.indexOf(n)) continue;
720
- t[n] = e[n];
752
+ var n = {};
753
+ for (var t in e) {
754
+ if ({}.hasOwnProperty.call(e, t)) {
755
+ if (-1 !== r.indexOf(t)) continue;
756
+ n[t] = e[t];
721
757
  }
722
758
  }
723
- return t;
759
+ return n;
724
760
  }
725
- function $e(e) {
761
+ function Xe(e) {
726
762
  "@babel/helpers - typeof";
727
- return $e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
763
+ return Xe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
728
764
  return typeof e;
729
765
  } : function(e) {
730
766
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
731
- }, $e(e);
767
+ }, Xe(e);
732
768
  }
733
- function Xe(e, r) {
734
- var t = Object.keys(e);
769
+ function Ue(e, r) {
770
+ var n = Object.keys(e);
735
771
  if (Object.getOwnPropertySymbols) {
736
- var n = Object.getOwnPropertySymbols(e);
737
- r && (n = n.filter((function(r) {
772
+ var t = Object.getOwnPropertySymbols(e);
773
+ r && (t = t.filter((function(r) {
738
774
  return Object.getOwnPropertyDescriptor(e, r).enumerable;
739
- }))), t.push.apply(t, n);
775
+ }))), n.push.apply(n, t);
740
776
  }
741
- return t;
777
+ return n;
742
778
  }
743
- function Ue(e) {
779
+ function Je(e) {
744
780
  for (var r = 1; r < arguments.length; r++) {
745
- var t = null != arguments[r] ? arguments[r] : {};
746
- r % 2 ? Xe(Object(t), !0).forEach((function(r) {
747
- Je(e, r, t[r]);
748
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Xe(Object(t)).forEach((function(r) {
749
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
781
+ var n = null != arguments[r] ? arguments[r] : {};
782
+ r % 2 ? Ue(Object(n), !0).forEach((function(r) {
783
+ Ge(e, r, n[r]);
784
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ue(Object(n)).forEach((function(r) {
785
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
750
786
  }));
751
787
  }
752
788
  return e;
753
789
  }
754
- function Je(e, r, t) {
755
- return (r = Ge(r)) in e ? Object.defineProperty(e, r, {
756
- value: t,
790
+ function Ge(e, r, n) {
791
+ return (r = Qe(r)) in e ? Object.defineProperty(e, r, {
792
+ value: n,
757
793
  enumerable: !0,
758
794
  configurable: !0,
759
795
  writable: !0
760
- }) : e[r] = t, e;
796
+ }) : e[r] = n, e;
761
797
  }
762
- function Ge(e) {
763
- var r = Qe(e, "string");
764
- return "symbol" == $e(r) ? r : r + "";
798
+ function Qe(e) {
799
+ var r = Ye(e, "string");
800
+ return "symbol" == Xe(r) ? r : r + "";
765
801
  }
766
- function Qe(e, r) {
767
- if ("object" != $e(e) || !e) return e;
768
- var t = e[Symbol.toPrimitive];
769
- if (void 0 !== t) {
770
- var n = t.call(e, r || "default");
771
- if ("object" != $e(n)) return n;
802
+ function Ye(e, r) {
803
+ if ("object" != Xe(e) || !e) return e;
804
+ var n = e[Symbol.toPrimitive];
805
+ if (void 0 !== n) {
806
+ var t = n.call(e, r || "default");
807
+ if ("object" != Xe(t)) return t;
772
808
  throw new TypeError("@@toPrimitive must return a primitive value.");
773
809
  }
774
810
  return ("string" === r ? String : Number)(e);
775
811
  }
776
- var Ye = function e(r) {
777
- return r === true || r === "dimmed" || r === "disabled";
812
+ var Ze = function e(r) {
813
+ var n = _(r, "disabled"), t = n.isDisabled;
814
+ return !!t;
778
815
  };
779
- var Ze = {
816
+ var er = {
780
817
  allowKeyMatching: p().bool,
781
818
  allowNewValues: p().bool,
782
819
  animateLoading: p().bool,
@@ -827,65 +864,65 @@
827
864
  /** @private. */
828
865
  virtualization: p().number
829
866
  };
830
- var er = c()((function(e) {
867
+ var rr = c()((function(e) {
831
868
  return [ e ];
832
869
  }));
833
870
  // preserve separate widths for single vs. multi mode
834
- var rr = c()((function(e) {
835
- var r = e.anchorWidth, t = e.isMultiple, n = e.maxHeight, l = e.menuStyle;
836
- return t ? Ue({
871
+ var nr = c()((function(e) {
872
+ var r = e.anchorWidth, n = e.isMultiple, t = e.maxHeight, l = e.menuStyle;
873
+ return n ? Je({
837
874
  width: Math.max(r !== null && r !== void 0 ? r : 0, 200),
838
- maxHeight: n
839
- }, l) : Ue({
875
+ maxHeight: t
876
+ }, l) : Je({
840
877
  minWidth: r !== null && r !== void 0 ? r : undefined,
841
878
  maxWidth: Math.max(r !== null && r !== void 0 ? r : 0, 300),
842
- maxHeight: n
879
+ maxHeight: t
843
880
  }, l);
844
881
  }));
845
882
  var tr = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
846
- function nr(e) {
847
- return e && i()(e.props, "value");
883
+ function lr(e) {
884
+ return e && o()(e.props, "value");
848
885
  }
849
- function lr(e, r) {
850
- return "".concat($e(e), "-").concat(e, "-").concat(r);
886
+ function ar(e, r) {
887
+ return "".concat(Xe(e), "-").concat(e, "-").concat(r);
851
888
  }
852
- var ar = [ "append", "error", "prepend" ];
853
- var or = (0, T._)("No matches");
854
- var ir = (0, T._)("Select...");
855
- var ur = 30;
856
- var cr = {};
857
- var sr = n().createElement(y(), null);
858
- var fr = function e(r) {
859
- var t = r.activeItemId, l = r.filterA11yId, a = r.filterKeyword, o = r.hasChildren, i = r.inputId, u = r.inputRef, c = r.menuListboxId, s = r.multiple, f = r.onClearAll, d = r.onSelectAll, p = r.onTextBlur, v = r.onTextChange, b = r.onTextFocus, m = r.onTextKeyDown, y = r.optionSelection, g = r.placement, h = r.selectAllAppearance, S = r.textHasFocus;
860
- var O = (0, T._)("Select all options".concat(y.current === "all" ? " disabled" : ""));
861
- var w = (0, T._)("Clear all options".concat(y.current === "none" ? " disabled" : ""));
889
+ var ir = [ "append", "error", "prepend" ];
890
+ var or = (0, M._)("No matches");
891
+ var ur = (0, M._)("Select...");
892
+ var cr = 30;
893
+ var sr = {};
894
+ var fr = t().createElement(y(), null);
895
+ var dr = function e(r) {
896
+ var n = r.activeItemId, l = r.filterA11yId, a = r.filterKeyword, i = r.hasChildren, o = r.inputId, u = r.inputRef, c = r.menuListboxId, s = r.multiple, f = r.onClearAll, d = r.onSelectAll, p = r.onTextBlur, v = r.onTextChange, b = r.onTextFocus, m = r.onTextKeyDown, y = r.optionSelection, g = r.placement, h = r.selectAllAppearance, S = r.textHasFocus;
897
+ var O = (0, M._)("Select all options".concat(y.current === "all" ? " disabled" : ""));
898
+ var w = (0, M._)("Clear all options".concat(y.current === "none" ? " disabled" : ""));
862
899
  // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
863
- var C = n().createElement(Se, {
900
+ var C = t().createElement(Oe, {
864
901
  key: "selectAll"
865
- }, n().createElement(he, {
902
+ }, t().createElement(Se, {
866
903
  disabled: y.current === "all",
867
904
  appearance: "standalone",
868
905
  "aria-label": O,
869
906
  onClick: d,
870
907
  "data-test": "select-all",
871
908
  tag: "button"
872
- }, a ? (0, T._)("Select all Matches") : (0, T._)("Select all")), n().createElement(he, {
909
+ }, a ? (0, M._)("Select all Matches") : (0, M._)("Select all")), t().createElement(Se, {
873
910
  disabled: y.current === "none",
874
911
  appearance: "standalone",
875
912
  "aria-label": w,
876
913
  onClick: f,
877
914
  "data-test": "clear-all",
878
915
  tag: "button"
879
- }, a ? (0, T._)("Clear all Matches") : (0, T._)("Clear all")));
916
+ }, a ? (0, M._)("Clear all Matches") : (0, M._)("Clear all")));
880
917
 
881
- return n().createElement("div", {
918
+ return t().createElement("div", {
882
919
  key: "controls"
883
- }, l && n().createElement(j(), {
920
+ }, l && t().createElement(j(), {
884
921
  id: l
885
- }, (0, T._)("Type to filter")), g === "above" && n().createElement(Oe, null), n().createElement(ye, {
922
+ }, (0, M._)("Type to filter")), g === "above" && t().createElement(we, null), t().createElement(ge, {
886
923
  key: "filter",
887
924
  "data-test": "filter"
888
- }, n().createElement(P(), {
925
+ }, t().createElement(P(), {
889
926
  value: a,
890
927
  autoCapitalize: "off",
891
928
  autoComplete: "off",
@@ -895,88 +932,88 @@
895
932
  onKeyDown: m,
896
933
  onFocus: b,
897
934
  onBlur: p,
898
- placeholder: (0, T._)("Filter"),
935
+ placeholder: (0, M._)("Filter"),
899
936
  role: "combobox",
900
937
  "aria-expanded": "true",
901
938
  "aria-controls": c,
902
- "aria-owns": S && o ? t : undefined,
903
- "aria-label": (0, T._)("Filter"),
939
+ "aria-owns": S && i ? n : undefined,
940
+ "aria-label": (0, M._)("Filter"),
904
941
  "aria-autocomplete": "list",
905
- "aria-activedescendant": S && o ? t : undefined,
942
+ "aria-activedescendant": S && i ? n : undefined,
906
943
  inputRef: u,
907
- inputId: i,
944
+ inputId: o,
908
945
  canClear: true,
909
- startAdornment: sr
910
- })), s && o && h === "buttongroup" && C, g === "below" && n().createElement(Oe, null));
946
+ startAdornment: fr
947
+ })), s && i && h === "buttongroup" && C, g === "below" && t().createElement(we, null));
911
948
  };
912
- var dr = function e(r) {
913
- var t = r.prefixLabel, n = r.label, l = r.suffixLabel;
914
- var o = n;
915
- if (t) {
916
- o = [ "".concat(t, ": ") ].concat(o);
949
+ var pr = function e(r) {
950
+ var n = r.prefixLabel, t = r.label, l = r.suffixLabel;
951
+ var i = t;
952
+ if (n) {
953
+ i = [ "".concat(n, ": ") ].concat(i);
917
954
  }
918
955
  if (l) {
919
- o = a()(o).concat(" ".concat(l));
956
+ i = a()(i).concat(" ".concat(l));
920
957
  }
921
- return o;
958
+ return i;
922
959
  };
923
- var pr = [];
924
- var vr = n().forwardRef((function(e, r) {
925
- var l = e.appearance, a = l === void 0 ? "default" : l, o = e.append, i = e.children, u = e.currentValues, c = u === void 0 ? pr : u, s = e.describedBy, d = e.disabled, p = e.elementRef, v = e.error, m = e.inline, y = e.labelText, g = e.labelledBy, h = e.multiple, S = e.onClick, w = e.placeholder, C = e.prefixLabel, k = e.prepend, x = e.required, j = e.suffixLabel, E = e.toggle, P = e.toggleContent, A = e.maxLabelItems, L = A === void 0 ? ur : A, I = ze(e, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent", "maxLabelItems" ]);
926
- var R = (0, t.useMemo)((function() {
927
- var e = t.Children.toArray(i);
960
+ var vr = [];
961
+ var br = t().forwardRef((function(e, r) {
962
+ var l = e.appearance, a = l === void 0 ? "default" : l, i = e.append, o = e.children, u = e.currentValues, c = u === void 0 ? vr : u, s = e.describedBy, d = e.disabled, p = e.elementRef, v = e.error, m = e.inline, y = e.labelText, g = e.labelledBy, h = e.multiple, S = e.onClick, w = e.placeholder, C = e.prefixLabel, k = e.prepend, x = e.required, j = e.suffixLabel, E = e.toggle, P = e.toggleContent, A = e.maxLabelItems, L = A === void 0 ? cr : A, I = We(e, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent", "maxLabelItems" ]);
963
+ var D = (0, n.useMemo)((function() {
964
+ var e = n.Children.toArray(o);
928
965
  var r = new Map;
929
- for (var n = 0; n < e.length; n += 1) {
930
- var l = e[n];
931
- if (nr(l)) {
966
+ for (var t = 0; t < e.length; t += 1) {
967
+ var l = e[t];
968
+ if (lr(l)) {
932
969
  r.set(l.props.value, l);
933
970
  }
934
971
  }
935
972
  return r;
936
- }), [ i ]);
937
- var M = (0, t.useMemo)((function() {
973
+ }), [ o ]);
974
+ var R = (0, n.useMemo)((function() {
938
975
  var e = {
939
976
  icon: null,
940
977
  label: [],
941
978
  ariaLabel: []
942
979
  };
943
980
  var r = h && c.length > L ? Math.max(1, L) : c.length;
944
- for (var t = 0; t < r; t += 1) {
945
- var n = c[t];
946
- var l = R.get(n);
981
+ for (var n = 0; n < r; n += 1) {
982
+ var t = c[n];
983
+ var l = D.get(t);
947
984
  if (l) {
948
- var a = l.props, o = a.children, i = a.icon, u = a.label;
949
- var s = P !== "optionLabel" && o ? o : u;
985
+ var a = l.props, i = a.children, o = a.icon, u = a.label;
986
+ var s = P !== "optionLabel" && i ? i : u;
950
987
  e.label.push(s);
951
988
  e.ariaLabel.push(u);
952
989
  // if not in multiple mode, add the icon
953
990
  if (!h && c.length === 1) {
954
- e.icon = i;
991
+ e.icon = o;
955
992
  }
956
993
  } else if (h) {
957
994
  // only add values that don't match an option in "multiple" mode to preserve old behaviour
958
- e.label.push(n);
959
- e.ariaLabel.push(n.toString());
995
+ e.label.push(t);
996
+ e.ariaLabel.push(t.toString());
960
997
  }
961
- if (t < r - 1) {
962
- e.label.push((0, T._)(", "));
963
- e.ariaLabel.push((0, T._)(", "));
998
+ if (n < r - 1) {
999
+ e.label.push((0, M._)(", "));
1000
+ e.ariaLabel.push((0, M._)(", "));
964
1001
  }
965
1002
  }
966
1003
  if (h && c.length > r && e.label.length) {
967
1004
  // add visual ellipsis to ensure truncation is shown
968
- e.label.push((0, T._)("..."));
1005
+ e.label.push((0, M._)("..."));
969
1006
  }
970
1007
  // only apply prefix / suffix if the label is not empty
971
1008
  if (e.label.length > 0) {
972
1009
  // If there's more than one item selected, read out the selected total
973
1010
  // rather than reading out each selected item
974
- e.ariaLabel = dr({
1011
+ e.ariaLabel = pr({
975
1012
  prefixLabel: C,
976
1013
  label: e.label.length > 1 ? [ "".concat(c.length, " items selected") ] : e.ariaLabel,
977
1014
  suffixLabel: j
978
1015
  });
979
- e.label = dr({
1016
+ e.label = pr({
980
1017
  prefixLabel: C,
981
1018
  label: e.label,
982
1019
  suffixLabel: j
@@ -987,83 +1024,77 @@
987
1024
  if (!e.label.length || !h && e.label.every((function(e) {
988
1025
  return e === "";
989
1026
  }))) {
990
- e.label = er(w);
1027
+ e.label = rr(w);
991
1028
  e.ariaLabel = e.label;
992
1029
  }
993
1030
  return e;
994
- }), [ c, L, h, R, w, C, j, P ]), q = M.label, D = M.ariaLabel, _ = M.icon;
995
- var B = "aria-labelledby" in I;
996
- // TODO (SUI-8600): `disabled` prop should default to 'dimmed' for data entry components
997
- var N;
998
- if (d === "dimmed") {
999
- N = "dimmed";
1000
- } else if (d === true || d === "disabled") {
1001
- N = "disabled";
1002
- }
1003
- var V = Ue({
1031
+ }), [ c, L, h, D, w, C, j, P ]), T = R.label, q = R.ariaLabel, B = R.icon;
1032
+ var V = "aria-labelledby" in I;
1033
+ var N = _(d, "disabled"), F = N.disabledValue;
1034
+ var K = Je({
1004
1035
  "aria-describedby": s,
1005
1036
  "aria-disabled": d === "dimmed" || undefined,
1006
- "aria-label": g || B ? undefined : "".concat(y ? "".concat(y, ", ") : "").concat(D.join("")),
1037
+ "aria-label": g || V ? undefined : "".concat(y ? "".concat(y, ", ") : "").concat(q.join("")),
1007
1038
  // aria-labelledby takes precedence over aria-label, so existence of both is redundant
1008
1039
  "aria-labelledby": g,
1009
1040
  "aria-required": x,
1010
1041
  "data-select-appearance": a,
1011
- append: o,
1042
+ append: i,
1012
1043
  prepend: k,
1013
1044
  onClick: S,
1014
1045
  role: "combobox",
1015
- disabled: a === "link" ? d === true || d === "disabled" : N,
1046
+ disabled: a === "link" ? d === true || d === "disabled" : F,
1016
1047
  elementRef: p,
1017
1048
  error: v,
1018
1049
  ref: r
1019
1050
  }, I);
1020
1051
  if (h) {
1021
- V["data-test-values"] = JSON.stringify(c);
1052
+ K["data-test-values"] = JSON.stringify(c);
1022
1053
  } else {
1023
- var F = Be(c, 1), K = F[0];
1024
- V["data-test-value"] = K;
1054
+ var H = Ve(c, 1), z = H[0];
1055
+ K["data-test-value"] = z;
1025
1056
  }
1026
- V["data-test-disabled"] = N;
1057
+ K["data-test-disabled"] = F;
1027
1058
  if (E) {
1028
1059
 
1029
- return (0, t.cloneElement)(E, V);
1060
+ return (0, n.cloneElement)(E, K);
1030
1061
  }
1031
1062
  if (a === "link") {
1032
1063
 
1033
- return n().createElement(O(), _e({
1064
+ return t().createElement(O(), Be({
1034
1065
  tag: "button",
1035
1066
  appearance: "standalone"
1036
- }, V, {
1067
+ }, K, {
1037
1068
  "data-select-appearance": "link"
1038
- }), !!_ && n().createElement(be, null, _), q || w, n().createElement(me, null, n().createElement(b(), null)));
1069
+ }), !!B && t().createElement(me, null, B), T || w, t().createElement(ye, null, t().createElement(b(), null)));
1039
1070
  }
1040
1071
  // Using Button's secondary appearance as Select's default appearance.
1041
- var H = a === "default" ? "secondary" : a;
1072
+ var W = a === "default" ? "secondary" : a;
1042
1073
 
1043
- return n().createElement(ve, _e({}, V, {
1074
+ return t().createElement(be, Be({}, K, {
1044
1075
  $multiple: h,
1045
- appearance: H,
1046
- label: q,
1076
+ appearance: W,
1077
+ label: T,
1047
1078
  error: v,
1048
- icon: _,
1079
+ icon: B,
1049
1080
  inline: m,
1050
1081
  isMenu: true,
1051
1082
  onClick: S
1052
- }, f()(I, ar)), !!c.length && h && n().createElement(ge, {
1083
+ }, f()(I, ir)), !!c.length && h && t().createElement(he, {
1053
1084
  "data-role": "count"
1054
1085
  }, "(", c.length, ")"));
1055
1086
  }));
1056
- function br(e) {
1057
- var r = e.currentValues, t = e.multiple;
1058
- if (t || !(r === null || r === void 0 ? void 0 : r.length)) {
1087
+ function mr(e) {
1088
+ var r = e.currentValues, n = e.multiple;
1089
+ if (n || !(r === null || r === void 0 ? void 0 : r.length)) {
1059
1090
  return r !== null && r !== void 0 ? r : [];
1060
1091
  }
1061
1092
  return [ r[0] ];
1062
1093
  }
1063
- function mr(e) {
1064
- var r = e.allowKeyMatching, l = r === void 0 ? true : r, a = e.animateLoading, o = e.appearance, i = o === void 0 ? "default" : o, u = e.append, c = e.allowNewValues, s = e.children, f = e.defaultPlacement, d = f === void 0 ? "vertical" : f, p = e.defaultValues, v = e.describedBy, b = e.disabled, m = e.elementRef, y = e.error, g = e.filter, S = e.footerMessage, O = e.inline, x = e.inputId, j = e.inputRef, E = e.isLoadingOptions, P = e.labelledBy, A = e.labelText, I = e.loadingMessage, _ = e.menuStyle, B = _ === void 0 ? cr : _, N = e.multiple, V = e.name, F = e.noOptionsMessage, K = F === void 0 ? or : F, H = e.onChange, z = e.onScroll, W = e.onScrollBottom, $ = e.onFilterChange, X = e.onClick, J = e.onClose, G = e.onOpen, Q = e.required, Y = e.placeholder, Z = Y === void 0 ? ir : Y, ee = e.prefixLabel, re = e.prepend, te = e.repositionMode, ne = te === void 0 ? "flip" : te, le = e.selectAllAppearance, ae = le === void 0 ? "buttongroup" : le, ie = e.showSelectedValuesFirst, ue = e.suffixLabel, ce = e.tabConfirmsNewValue, se = e.values, fe = e.virtualization, de = e.toggle, pe = e.toggleContent, ve = pe === void 0 ? "optionChildren" : pe, be = e.maxLabelItems, me = be === void 0 ? ur : be, ye = ze(e, [ "allowKeyMatching", "animateLoading", "appearance", "append", "allowNewValues", "children", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "labelText", "loadingMessage", "menuStyle", "multiple", "name", "noOptionsMessage", "onChange", "onScroll", "onScrollBottom", "onFilterChange", "onClick", "onClose", "onOpen", "required", "placeholder", "prefixLabel", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "suffixLabel", "tabConfirmsNewValue", "values", "virtualization", "toggle", "toggleContent", "maxLabelItems" ]);
1094
+ function yr(e) {
1095
+ var r = e.allowKeyMatching, l = r === void 0 ? true : r, a = e.animateLoading, i = e.appearance, o = i === void 0 ? "default" : i, u = e.append, c = e.allowNewValues, s = e.children, f = e.defaultPlacement, d = f === void 0 ? "vertical" : f, p = e.defaultValues, v = e.describedBy, b = e.disabled, m = e.elementRef, y = e.error, g = e.filter, S = e.footerMessage, O = e.inline, x = e.inputId, j = e.inputRef, E = e.isLoadingOptions, P = e.labelledBy, A = e.labelText, I = e.loadingMessage, B = e.menuStyle, V = B === void 0 ? sr : B, N = e.multiple, F = e.name, K = e.noOptionsMessage, H = K === void 0 ? or : K, z = e.onChange, W = e.onScroll, $ = e.onScrollBottom, X = e.onFilterChange, U = e.onClick, G = e.onClose, Q = e.onOpen, Y = e.required, Z = e.placeholder, ee = Z === void 0 ? ur : Z, re = e.prefixLabel, ne = e.prepend, te = e.repositionMode, le = te === void 0 ? "flip" : te, ae = e.selectAllAppearance, ie = ae === void 0 ? "buttongroup" : ae, ue = e.showSelectedValuesFirst, ce = e.suffixLabel, se = e.tabConfirmsNewValue, fe = e.values, de = e.virtualization, pe = e.toggle, ve = e.toggleContent, be = ve === void 0 ? "optionChildren" : ve, me = e.maxLabelItems, ye = me === void 0 ? cr : me, ge = We(e, [ "allowKeyMatching", "animateLoading", "appearance", "append", "allowNewValues", "children", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "labelText", "loadingMessage", "menuStyle", "multiple", "name", "noOptionsMessage", "onChange", "onScroll", "onScrollBottom", "onFilterChange", "onClick", "onClose", "onOpen", "required", "placeholder", "prefixLabel", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "suffixLabel", "tabConfirmsNewValue", "values", "virtualization", "toggle", "toggleContent", "maxLabelItems" ]);
1065
1096
  // @docs-props-type SelectBasePropsBase
1066
- var ge = L()({
1097
+ var he = L()({
1067
1098
  componentName: "SelectBase",
1068
1099
  /* eslint-disable-next-line prefer-rest-params */
1069
1100
  componentProps: arguments[0],
@@ -1072,381 +1103,408 @@
1072
1103
  valuePropName: "values"
1073
1104
  });
1074
1105
  // states
1075
- var he = (0, t.useState)((function() {
1106
+ var Se = (0, n.useState)((function() {
1076
1107
  return {
1077
- activeItemId: (0, q.createDOMID)("active-item"),
1078
- menuListboxId: (0, q.createDOMID)("menu-listbox")
1108
+ activeItemId: (0, T.createDOMID)("active-item"),
1109
+ menuListboxId: (0, T.createDOMID)("menu-listbox")
1079
1110
  };
1080
- })), Se = Be(he, 1), Oe = Se[0], we = Oe.activeItemId, ke = Oe.menuListboxId;
1081
- var xe = (0, t.useState)(0), je = Be(xe, 2), Ee = je[0], Pe = je[1];
1082
- var Le = (0, t.useState)(""), Ie = Be(Le, 2), Te = Ie[0], qe = Ie[1];
1083
- var De = (0, t.useState)(false), Ne = Be(De, 2), Ve = Ne[0], Fe = Ne[1];
1084
- var Ke = (0, t.useState)(false), He = Be(Ke, 2), We = He[0], $e = He[1];
1085
- var Xe = (0, t.useState)([]), Ue = Be(Xe, 2), Je = Ue[0], Ge = Ue[1];
1086
- var Qe = (0, t.useState)(p || []), Ze = Be(Qe, 2), er = Ze[0], ar = Ze[1];
1111
+ })), Oe = Ve(Se, 1), we = Oe[0], Ce = we.activeItemId, xe = we.menuListboxId;
1112
+ var je = (0, n.useState)(0), Ee = Ve(je, 2), Pe = Ee[0], Ae = Ee[1];
1113
+ var Ie = (0, n.useState)(""), De = Ve(Ie, 2), Te = De[0], qe = De[1];
1114
+ var _e = (0, n.useState)(false), Ne = Ve(_e, 2), Fe = Ne[0], Ke = Ne[1];
1115
+ var He = (0, n.useState)(false), ze = Ve(He, 2), $e = ze[0], Xe = ze[1];
1116
+ var Ue = (0, n.useState)([]), Je = Ve(Ue, 2), Ge = Je[0], Qe = Je[1];
1117
+ var Ye = (0, n.useState)(p || []), er = Ve(Ye, 2), rr = er[0], ir = er[1];
1087
1118
  // previous state
1088
- var sr = R()(Ee);
1119
+ var fr = D()(Pe);
1089
1120
  // refs
1090
- var dr = (0, t.useRef)(null);
1091
- var pr = (0, t.useRef)(null);
1092
- var mr = (0, t.useRef)(null);
1093
- var yr = (0, t.useRef)([]);
1094
- var gr = (0, t.useRef)([]);
1095
- var hr = (0, t.useRef)(sr);
1096
- var Sr = (0, t.useRef)();
1097
- var Or = (0, t.useRef)({});
1098
- var wr = (0, t.useRef)(0);
1099
- var Cr = (0, t.useRef)([]);
1100
- var kr = (0, t.useRef)(null);
1101
- var xr = (0, t.useRef)();
1102
- var jr = (0, t.useRef)(0);
1103
- var Er = (0, t.useRef)("none");
1104
- var Pr = (0, t.useState)(g ? (0, q.createDOMID)("filter") : undefined), Ar = Be(Pr, 1), Lr = Ar[0];
1105
- var Ir = b === true || b === "dimmed" || b === "disabled";
1106
- (0, t.useEffect)((function() {
1121
+ var pr = (0, n.useRef)(null);
1122
+ var vr = (0, n.useRef)(null);
1123
+ var yr = (0, n.useRef)(null);
1124
+ var gr = (0, n.useRef)([]);
1125
+ var hr = (0, n.useRef)([]);
1126
+ var Sr = (0, n.useRef)(fr);
1127
+ var Or = (0, n.useRef)();
1128
+ var wr = (0, n.useRef)({});
1129
+ var Cr = (0, n.useRef)(0);
1130
+ var kr = (0, n.useRef)([]);
1131
+ var xr = (0, n.useRef)(null);
1132
+ var jr = (0, n.useRef)();
1133
+ var Er = (0, n.useRef)(0);
1134
+ var Pr = (0, n.useRef)("none");
1135
+ var Ar = (0, n.useState)(g ? (0, T.createDOMID)("filter") : undefined), Lr = Ve(Ar, 1), Ir = Lr[0];
1136
+ var Dr = _(b, "disabled"), Rr = Dr.isDisabled;
1137
+ (0, n.useEffect)((function() {
1107
1138
  if (false) {}
1108
- }), [ i, u, y, re ]);
1109
- var Rr = (0, t.useMemo)((function() {
1110
- var e = n().Children.toArray(s);
1139
+ }), [ o, u, y, ne ]);
1140
+ var Mr = (0, n.useMemo)((function() {
1141
+ var e = t().Children.toArray(s);
1111
1142
  var r = new Map;
1112
- for (var t = 0; t < e.length; t += 1) {
1113
- var l = e[t];
1114
- if (nr(l)) {
1143
+ for (var n = 0; n < e.length; n += 1) {
1144
+ var l = e[n];
1145
+ if (lr(l)) {
1115
1146
  r.set(l.props.value, l);
1116
1147
  }
1117
1148
  }
1118
1149
  return [ e, r ];
1119
- }), [ s ]), Mr = Be(Rr, 2), Tr = Mr[0], qr = Mr[1];
1120
- var Dr = br({
1121
- currentValues: ge ? se : er,
1150
+ }), [ s ]), Tr = Ve(Mr, 2), qr = Tr[0], _r = Tr[1];
1151
+ var Br = mr({
1152
+ currentValues: he ? fe : rr,
1122
1153
  multiple: N
1123
1154
  });
1124
1155
  // mutable object reference to currentValues to permit idempotent callbacks
1125
- var _r = (0, t.useRef)(null);
1126
- _r.current = Dr;
1127
- var Br = (0, t.useCallback)((function() {
1156
+ var Vr = (0, n.useRef)(null);
1157
+ Vr.current = Br;
1158
+ var Nr = (0, n.useCallback)((function() {
1128
1159
  // in non-multiple mode, don't move values to the top of the list
1129
- return N && ie !== "never" ? _r.current : [];
1130
- }), [ N, ie ]);
1131
- var Nr = (0, t.useCallback)((function(e) {
1132
- if (Ir) {
1160
+ return N && ue !== "never" ? Vr.current : [];
1161
+ }), [ N, ue ]);
1162
+ var Fr = (0, n.useCallback)((function(e) {
1163
+ if (Rr) {
1133
1164
  return;
1134
1165
  }
1135
1166
  var r = Te;
1136
- Fe(true);
1137
- Ge(Br());
1167
+ Ke(true);
1168
+ Qe(Nr());
1138
1169
  // SUI-3234: preserve existing behavior difference between <Select> and <Multiselect.Compact>
1139
1170
  if (N) {
1140
1171
  qe("");
1141
1172
  }
1142
1173
  if (r !== Te) {
1143
- $ === null || $ === void 0 ? void 0 : $(e, {
1174
+ X === null || X === void 0 ? void 0 : X(e, {
1144
1175
  keyword: Te
1145
1176
  });
1146
1177
  }
1147
- }), [ Ir, Te, Br, N, $ ]);
1148
- (0, t.useEffect)((function() {
1149
- if (Ve) {
1150
- G === null || G === void 0 ? void 0 : G();
1151
- if (kr.current && !g) {
1152
- kr.current.focus();
1178
+ }), [ Rr, Te, Nr, N, X ]);
1179
+ (0, n.useEffect)((function() {
1180
+ if (Fe) {
1181
+ Q === null || Q === void 0 ? void 0 : Q();
1182
+ if (xr.current && !g) {
1183
+ xr.current.focus();
1153
1184
  } else {
1154
1185
  var e;
1155
- Pe((e = xr.current) !== null && e !== void 0 ? e : 0);
1186
+ Ae((e = jr.current) !== null && e !== void 0 ? e : 0);
1156
1187
  }
1157
1188
  }
1158
- }), [ G, Ve, Je, Te, g ]);
1159
- var Vr = (0, t.useCallback)((function() {
1160
- Fe(false);
1161
- Pe(0);
1162
- hr.current = null;
1163
- J === null || J === void 0 ? void 0 : J();
1164
- }), [ J ]);
1165
- var Fr = (0, t.useCallback)((function(e, r) {
1166
- var t = new Set(_r.current);
1167
- var n;
1189
+ }), [ Q, Fe, Ge, Te, g ]);
1190
+ var Kr = (0, n.useCallback)((function() {
1191
+ Ke(false);
1192
+ Ae(0);
1193
+ Sr.current = null;
1194
+ G === null || G === void 0 ? void 0 : G();
1195
+ }), [ G ]);
1196
+ var Hr = (0, n.useCallback)((function() {
1197
+ Kr();
1198
+ }), [ Kr ]);
1199
+ var zr = (0, n.useCallback)((function(e, r) {
1200
+ if (Rr) {
1201
+ return;
1202
+ }
1203
+ var n = new Set(Vr.current);
1204
+ var t;
1168
1205
  if (N) {
1169
- if (t.has(r)) {
1170
- t["delete"](r);
1206
+ if (n.has(r)) {
1207
+ n["delete"](r);
1171
1208
  } else {
1172
- t.add(r);
1209
+ n.add(r);
1173
1210
  }
1174
- n = Array.from(t);
1211
+ t = Array.from(n);
1175
1212
  } else {
1176
1213
  // non-multiple mode must always have a value
1177
- n = [ r ];
1214
+ t = [ r ];
1178
1215
  }
1179
- var l = !ge;
1216
+ var l = !he;
1180
1217
  if (l) {
1181
- ar(n);
1218
+ ir(t);
1182
1219
  }
1183
1220
  if (N) {
1184
1221
  // in uncontrolled multiple mode, keep the menu open
1185
1222
  if (l) {
1186
- Fe(true);
1223
+ Ke(true);
1187
1224
  }
1188
1225
  } else {
1189
1226
  var a;
1190
1227
  // non-multiple mode only supports a single selection
1191
1228
  // so close the menu once a selection is made
1192
- Vr({
1229
+ Hr({
1193
1230
  reason: "contentClick"
1194
1231
  });
1195
- (a = dr.current) === null || a === void 0 ? void 0 : a.focus();
1232
+ (a = pr.current) === null || a === void 0 ? void 0 : a.focus();
1196
1233
  }
1197
- H === null || H === void 0 ? void 0 : H(e, {
1198
- values: n,
1199
- name: V,
1234
+ z === null || z === void 0 ? void 0 : z(e, {
1235
+ values: t,
1236
+ name: F,
1200
1237
  reason: "valueToggle"
1201
1238
  });
1202
- }), [ Vr, ge, N, V, H ]);
1203
- var Kr = function e() {
1204
- pr.current = null;
1205
- yr.current = [];
1206
- if (mr.current) {
1207
- clearTimeout(mr.current);
1239
+ }), [ Hr, he, Rr, N, F, z ]);
1240
+ var Wr = function e() {
1241
+ vr.current = null;
1242
+ gr.current = [];
1243
+ if (yr.current) {
1244
+ clearTimeout(yr.current);
1208
1245
  }
1209
1246
  };
1210
- var Hr = (0, t.useCallback)((function(e) {
1247
+ var $r = (0, n.useCallback)((function(e) {
1248
+ if (Rr) {
1249
+ return;
1250
+ }
1211
1251
  // this doesn't make sense if we can't select multiple values
1212
- if (!N) {
1252
+ if (!N) {
1213
1253
  return;
1214
1254
  }
1215
- var r = _r.current;
1216
- var t = new Set(r);
1217
- var n = new Set([].concat(Me(r), Me(Cr.current)));
1255
+ var r = Vr.current;
1256
+ var n = new Set(r);
1257
+ var t = new Set([].concat(Me(r), Me(kr.current)));
1218
1258
  // to keep track of custom values we create a copy of selected values and remove
1219
1259
  // items as they are accounted for in children, leaving only custom values
1220
- var l = new Set(n);
1260
+ var l = new Set(t);
1221
1261
  var a = new Set;
1222
- Tr.forEach((function(e) {
1223
- if (nr(e)) {
1262
+ qr.forEach((function(e) {
1263
+ if (lr(e)) {
1224
1264
  // this value is being represented in children so it is not custom
1225
1265
  l["delete"](e.props.value);
1226
- var r = Ye(e.props.disabled);
1227
- if (n.has(e.props.value) && (!r || t.has(e.props.value))) {
1266
+ var r = Ze(e.props.disabled);
1267
+ if (t.has(e.props.value) && (!r || n.has(e.props.value))) {
1228
1268
  a.add(e.props.value);
1229
1269
  }
1230
1270
  }
1231
1271
  }));
1232
- var o = [].concat(Me(Array.from(l)), Me(Array.from(a)));
1233
- if (!ge) {
1234
- ar(o);
1272
+ var i = [].concat(Me(Array.from(l)), Me(Array.from(a)));
1273
+ if (!he) {
1274
+ ir(i);
1235
1275
  }
1236
- H === null || H === void 0 ? void 0 : H(e, {
1237
- values: o,
1238
- name: V,
1276
+ z === null || z === void 0 ? void 0 : z(e, {
1277
+ values: i,
1278
+ name: F,
1239
1279
  reason: "selectAll"
1240
1280
  });
1241
- }), [ Tr, ge, N, V, H ]);
1242
- var zr = (0, t.useCallback)((function(e) {
1281
+ }), [ qr, he, Rr, N, F, z ]);
1282
+ var Xr = (0, n.useCallback)((function(e) {
1283
+ if (Rr) {
1284
+ return;
1285
+ }
1243
1286
  // this doesn't make sense if we can't select multiple values
1244
- if (!N) {
1287
+ if (!N) {
1245
1288
  return;
1246
1289
  }
1247
- var r = new Set(_r.current);
1290
+ var r = new Set(Vr.current);
1248
1291
  // Preserve hidden values only when "Clear matches" semantics apply
1249
- var t = Te !== "";
1250
- var n = new Set;
1251
- if (t) {
1252
- n = new Set(_r.current);
1253
- Cr.current.forEach((function(e) {
1254
- n["delete"](e);
1292
+ var n = Te !== "";
1293
+ var t = new Set;
1294
+ if (n) {
1295
+ t = new Set(Vr.current);
1296
+ kr.current.forEach((function(e) {
1297
+ t["delete"](e);
1255
1298
  }));
1256
1299
  }
1257
1300
  var l = new Set;
1258
- for (var a = 0; a < Tr.length; a += 1) {
1259
- var o = Tr[a];
1301
+ for (var a = 0; a < qr.length; a += 1) {
1302
+ var i = qr[a];
1260
1303
  // this will unselect all selected values unless those values are disabled or hidden by the filter
1261
- if (nr(o)) {
1262
- var i = Ye(o.props.disabled);
1263
- if (r.has(o.props.value) && i || n.has(o.props.value)) {
1264
- l.add(o.props.value);
1304
+ if (lr(i)) {
1305
+ var o = Ze(i.props.disabled);
1306
+ if (r.has(i.props.value) && o || t.has(i.props.value)) {
1307
+ l.add(i.props.value);
1265
1308
  }
1266
1309
  }
1267
1310
  }
1268
1311
  var u = Array.from(l);
1269
- if (!ge) {
1270
- ar(u);
1312
+ if (!he) {
1313
+ ir(u);
1271
1314
  }
1272
- H === null || H === void 0 ? void 0 : H(e, {
1315
+ z === null || z === void 0 ? void 0 : z(e, {
1273
1316
  values: u,
1274
- name: V,
1317
+ name: F,
1275
1318
  reason: "clearAll"
1276
1319
  });
1277
- }), [ Tr, Te, ge, N, V, H ]);
1278
- var Wr = (0, t.useCallback)((function(e) {
1279
- if (Ve && !E) {
1280
- W === null || W === void 0 ? void 0 : W(e);
1320
+ }), [ qr, Te, he, Rr, N, F, z ]);
1321
+ var Ur = (0, n.useCallback)((function(e) {
1322
+ if (Fe && !E) {
1323
+ $ === null || $ === void 0 ? void 0 : $(e);
1281
1324
  }
1282
- }), [ Ve, E, W ]);
1283
- var $r = (0, t.useCallback)((function(e) {
1284
- var r = wr.current;
1285
- var n = e.key;
1286
- var l = Sr.current !== null && Sr.current !== undefined ? qr.get(Sr.current) : undefined;
1287
- var a = Ye(l === null || l === void 0 ? void 0 : l.props.disabled);
1288
- if (n === "Tab") {
1289
- if (ce && Sr.current && wr.current <= 1) {
1325
+ }), [ Fe, E, $ ]);
1326
+ var Jr = (0, n.useCallback)((function(e) {
1327
+ if (Rr) {
1328
+ return;
1329
+ }
1330
+ var r = Cr.current;
1331
+ var t = e.key;
1332
+ var l = Or.current !== null && Or.current !== undefined ? _r.get(Or.current) : undefined;
1333
+ var a = Ze(l === null || l === void 0 ? void 0 : l.props.disabled);
1334
+ if (t === "Tab") {
1335
+ if (se && Or.current && Cr.current <= 1) {
1290
1336
  if (!a) {
1291
1337
  e.preventDefault();
1292
- Fr(e, Sr.current);
1338
+ zr(e, Or.current);
1293
1339
  }
1294
1340
  }
1295
1341
  }
1296
1342
  if (e.shiftKey || e.metaKey || e.ctrlKey) {
1297
- if (n === "a" && (e.ctrlKey || e.metaKey)) {
1343
+ if (t === "a" && (e.ctrlKey || e.metaKey)) {
1298
1344
  // handle control + A
1299
- if (Er.current === "all") {
1300
- zr(e);
1345
+ if (Pr.current === "all") {
1346
+ Xr(e);
1301
1347
  } else {
1302
- Hr(e);
1348
+ $r(e);
1303
1349
  }
1304
1350
  }
1305
1351
  return;
1306
1352
  }
1307
- if (n === "ArrowDown") {
1353
+ if (t === "ArrowDown") {
1308
1354
  e.preventDefault();
1309
- var o = ae === "checkbox" ? r : r - 1;
1310
- if (o >= 0) {
1311
- Pe(Math.min(Ee + 1, o));
1355
+ var i = ie === "checkbox" ? r : r - 1;
1356
+ if (i >= 0) {
1357
+ Ae(Math.min(Pe + 1, i));
1312
1358
  }
1313
- if (s && W) {
1314
- var i = t.Children.toArray(s).length - (2 + _r.current.length);
1315
- if (Ee === i) {
1316
- Wr(e);
1359
+ if (s && $) {
1360
+ var o = n.Children.toArray(s).length - (2 + Vr.current.length);
1361
+ if (Pe === o) {
1362
+ Ur(e);
1317
1363
  }
1318
1364
  }
1319
1365
  }
1320
- if (n === "ArrowUp") {
1366
+ if (t === "ArrowUp") {
1321
1367
  e.preventDefault();
1322
- Pe(Math.max(Ee - 1, 0));
1368
+ Ae(Math.max(Pe - 1, 0));
1323
1369
  }
1324
- if (n === "Enter" && Sr.current && Ve) {
1325
- if (Sr.current === "selectAll") {
1326
- if (Er.current === "all") {
1327
- zr(e);
1370
+ if (t === "Enter" && Or.current && Fe) {
1371
+ if (Or.current === "selectAll") {
1372
+ if (Pr.current === "all") {
1373
+ Xr(e);
1328
1374
  } else {
1329
- Hr(e);
1375
+ $r(e);
1330
1376
  }
1331
1377
  } else if (!a) {
1332
1378
  e.preventDefault();
1333
- Fr(e, Sr.current);
1379
+ zr(e, Or.current);
1334
1380
  }
1335
1381
  }
1336
- }), [ Ee, s, zr, Wr, Hr, qr, W, Ve, ae, ce, Fr ]);
1337
- var Xr = (0, t.useCallback)((function(e, r) {
1338
- var t = r.value;
1382
+ }), [ Pe, s, Xr, Ur, $r, Rr, _r, $, Fe, ie, se, zr ]);
1383
+ var Gr = (0, n.useCallback)((function(e, r) {
1384
+ var n = r.value;
1385
+ if (Rr) {
1386
+ return;
1387
+ }
1339
1388
  e.preventDefault();
1340
- if (!Ve) {
1389
+ if (!Fe) {
1341
1390
  return;
1342
1391
  }
1343
- Fr(e, t);
1344
- }), [ Ve, Fr ]);
1345
- var Ur = (0, t.useCallback)((function(e, r) {
1346
- var t = e.nativeEvent.key;
1392
+ zr(e, n);
1393
+ }), [ Rr, Fe, zr ]);
1394
+ var Qr = (0, n.useCallback)((function(e, r) {
1395
+ var n = e.nativeEvent.key;
1347
1396
  // Checking for a single character to avoid complications from double-byte languages and emojis.
1348
- if (t.length === 1) {
1349
- var n = [];
1397
+ if (n.length === 1) {
1398
+ var t = [];
1350
1399
  var l = {
1351
1400
  index: 0,
1352
- value: t
1401
+ value: n
1353
1402
  };
1354
- if (!pr.current) {
1355
- if (t === " ") {
1356
- Kr();
1403
+ if (!vr.current) {
1404
+ if (n === " ") {
1405
+ Wr();
1357
1406
  return;
1358
1407
  }
1359
- n = Ce(gr.current, l);
1360
- } else if (yr.current.length > 1) {
1361
- l.index = pr.current.index + 1;
1362
- n = Ce(yr.current, l);
1408
+ t = ke(hr.current, l);
1409
+ } else if (gr.current.length > 1) {
1410
+ l.index = vr.current.index + 1;
1411
+ t = ke(gr.current, l);
1363
1412
  }
1364
- if (n.length) {
1413
+ if (t.length) {
1365
1414
  var a;
1366
- var o = 0;
1415
+ var i = 0;
1367
1416
  // If the active option is a first character match, cycle to the next matching option.
1368
- if (l.index === 0 && n.length > 1) {
1369
- var i = n.indexOf(gr.current[r]);
1370
- if (i >= 0) {
1371
- o = i === n.length - 1 ? 0 : i + 1;
1417
+ if (l.index === 0 && t.length > 1) {
1418
+ var o = t.indexOf(hr.current[r]);
1419
+ if (o >= 0) {
1420
+ i = o === t.length - 1 ? 0 : o + 1;
1372
1421
  }
1373
1422
  }
1374
- var u = n[o];
1423
+ var u = t[i];
1375
1424
  var c = u.value, s = u.label;
1376
- var f = Or.current[lr(c, s)];
1425
+ var f = wr.current[ar(c, s)];
1377
1426
  f === null || f === void 0 ? void 0 : (a = f.focus) === null || a === void 0 ? void 0 : a.call(f);
1378
1427
  }
1379
- yr.current = n;
1380
- pr.current = l;
1381
- if (mr.current) {
1382
- clearTimeout(mr.current);
1428
+ gr.current = t;
1429
+ vr.current = l;
1430
+ if (yr.current) {
1431
+ clearTimeout(yr.current);
1383
1432
  }
1384
- mr.current = setTimeout(Kr, 500);
1433
+ yr.current = setTimeout(Wr, 500);
1385
1434
  e.preventDefault();
1386
1435
  e.stopPropagation();
1387
1436
  }
1388
1437
  }), []);
1389
- var Jr = (0, t.useCallback)((function(e, r) {
1390
- var t = r.value;
1391
- qe(t);
1392
- Fe(true);
1393
- Pe(0);
1394
- $ === null || $ === void 0 ? void 0 : $(e, {
1395
- keyword: t
1438
+ var Yr = (0, n.useCallback)((function(e, r) {
1439
+ var n = r.value;
1440
+ if (Rr) {
1441
+ return;
1442
+ }
1443
+ qe(n);
1444
+ Ke(true);
1445
+ Ae(0);
1446
+ X === null || X === void 0 ? void 0 : X(e, {
1447
+ keyword: n
1396
1448
  });
1397
- }), [ $ ]);
1398
- var Gr = (0, t.useCallback)((function() {
1399
- $e(true);
1449
+ }), [ Rr, X ]);
1450
+ var Zr = (0, n.useCallback)((function() {
1451
+ Xe(true);
1400
1452
  }), []);
1401
- var Qr = (0, t.useCallback)((function() {
1402
- $e(false);
1453
+ var en = (0, n.useCallback)((function() {
1454
+ Xe(false);
1403
1455
  }), []);
1404
- var Yr = (0, t.useCallback)((function(e) {
1405
- if (hr.current !== Ee) {
1406
- (0, D.scrollIntoViewIfNeeded)(e);
1456
+ // Close when component becomes disabled/dimmed during an expanded state to prevent further selection
1457
+ (0, n.useEffect)((function() {
1458
+ if (Rr && Fe) {
1459
+ Kr();
1407
1460
  }
1408
- }), [ Ee ]);
1409
- var Zr = (0, t.useCallback)((function(e, r, t) {
1410
- if (t) {
1411
- kr.current = e;
1461
+ }), [ Rr, Fe, Kr ]);
1462
+ var rn = (0, n.useCallback)((function(e) {
1463
+ if (Sr.current !== Pe) {
1464
+ (0, q.scrollIntoViewIfNeeded)(e);
1465
+ }
1466
+ }), [ Pe ]);
1467
+ var nn = (0, n.useCallback)((function(e, r, n) {
1468
+ if (n) {
1469
+ xr.current = e;
1412
1470
  }
1413
1471
  if (e == null) {
1414
- delete Or.current[r];
1472
+ delete wr.current[r];
1415
1473
  } else {
1416
- Or.current[r] = e;
1474
+ wr.current[r] = e;
1417
1475
  }
1418
- }), [ Or ]);
1419
- var et = (0, t.useCallback)((function(e) {
1420
- dr.current = e;
1476
+ }), [ wr ]);
1477
+ var tn = (0, n.useCallback)((function(e) {
1478
+ pr.current = e;
1421
1479
  Re(m, e);
1422
- }), [ m, dr ]);
1423
- var rt = Dr.some((function(e) {
1424
- var r = qr.get(e);
1425
- var t = Ye(r === null || r === void 0 ? void 0 : r.props.disabled);
1426
- return r && !t;
1480
+ }), [ m, pr ]);
1481
+ var ln = Br.some((function(e) {
1482
+ var r = _r.get(e);
1483
+ var n = Ze(r === null || r === void 0 ? void 0 : r.props.disabled);
1484
+ return r && !n;
1427
1485
  }));
1428
- var tt = ie === "immediately" ? Br() : Je;
1429
- var nt = (0, t.useMemo)((function() {
1430
- wr.current = 0;
1431
- xr.current = undefined;
1432
- jr.current = 0;
1433
- Sr.current = undefined;
1434
- gr.current = [];
1435
- var e = function e(r, t) {
1486
+ var an = ue === "immediately" ? Nr() : Ge;
1487
+ var on = (0, n.useMemo)((function() {
1488
+ Cr.current = 0;
1489
+ jr.current = undefined;
1490
+ Er.current = 0;
1491
+ Or.current = undefined;
1492
+ hr.current = [];
1493
+ var e = function e(r, n) {
1436
1494
  return function(e) {
1437
- return Zr(e, r, t);
1495
+ return nn(e, r, n);
1438
1496
  };
1439
1497
  };
1440
1498
  var r;
1441
1499
  var a = 0;
1442
- var o = false;
1500
+ var i = false;
1443
1501
  // used to avoid overwriting the selected item ref in multiple mode
1444
- var i;
1445
- var u = new Set(Dr);
1446
- var s = new Set(tt !== null && tt !== void 0 ? tt : []);
1447
- var f = Tr.reduce((function(c, f, d) {
1502
+ var o;
1503
+ var u = new Set(Br);
1504
+ var s = new Set(an !== null && an !== void 0 ? an : []);
1505
+ var f = qr.reduce((function(c, f, d) {
1448
1506
  // ignore Headings and Dividers
1449
- if (!nr(f)) {
1507
+ if (!lr(f)) {
1450
1508
  c.push(f);
1451
1509
  return c;
1452
1510
  }
@@ -1456,38 +1514,38 @@
1456
1514
  r = true;
1457
1515
  }
1458
1516
  var h = u.has(y);
1459
- var S = !!h && v !== true && v !== "disabled" && !i;
1460
- var O = l && !N && !g && !E && !W;
1461
- var C = lr(y, m);
1517
+ var S = !!h && v !== true && v !== "disabled" && !o;
1518
+ var O = l && !N && !g && !E && !$;
1519
+ var C = ar(y, m);
1462
1520
  var k = -1;
1463
1521
  if (O && v !== true && v !== "disabled" && !b) {
1464
- gr.current.push({
1522
+ hr.current.push({
1465
1523
  label: m,
1466
1524
  value: y
1467
1525
  });
1468
- k = gr.current.length - 1;
1526
+ k = hr.current.length - 1;
1469
1527
  }
1470
1528
  // Format the Menu.Item
1471
- var x = (0, t.cloneElement)(f, {
1529
+ var x = (0, n.cloneElement)(f, {
1472
1530
  elementRef: e(C, S),
1473
1531
  key: f.key || d,
1474
- onClick: Xr,
1532
+ onClick: Gr,
1475
1533
  onKeyDown: O ? function(e) {
1476
- return Ur(e, k);
1534
+ return Qr(e, k);
1477
1535
  } : undefined,
1478
1536
  selected: h,
1479
1537
  multiple: N,
1480
1538
  role: "option"
1481
1539
  });
1482
1540
  if (S) {
1483
- i = true;
1541
+ o = true;
1484
1542
  }
1485
1543
  if (s.has(y)) {
1486
1544
  if (a === 0) {
1487
- c.splice(a, 0, n().createElement(w.Divider, {
1545
+ c.splice(a, 0, t().createElement(w.Divider, {
1488
1546
  key: "topDivider"
1489
1547
  }));
1490
- o = true;
1548
+ i = true;
1491
1549
  }
1492
1550
  c.splice(a, 0, x);
1493
1551
  a += 1;
@@ -1498,30 +1556,30 @@
1498
1556
  }), []);
1499
1557
  // In multiple mode, add missing items
1500
1558
  if (N) {
1501
- for (var d = Dr.length - 1; d >= 0; d -= 1) {
1502
- var p = Dr[d];
1503
- var v = qr.get(p);
1559
+ for (var d = Br.length - 1; d >= 0; d -= 1) {
1560
+ var p = Br[d];
1561
+ var v = _r.get(p);
1504
1562
  if (!v) {
1505
1563
  if (p === Te) {
1506
1564
  r = true;
1507
1565
  }
1508
1566
  var b = s.has(p);
1509
- var m = tt.length;
1567
+ var m = an.length;
1510
1568
  if (a === 0) {
1511
- f.splice(0, 0, n().createElement(w.Divider, {
1569
+ f.splice(0, 0, t().createElement(w.Divider, {
1512
1570
  key: "topDivider"
1513
1571
  }));
1514
1572
  a += 1;
1515
- o = true;
1573
+ i = true;
1516
1574
  }
1517
1575
  var y = String(p);
1518
- var h = lr(p, y);
1519
- f.splice(b ? 0 : m + 1, 0, n().createElement(U, {
1576
+ var h = ar(p, y);
1577
+ f.splice(b ? 0 : m + 1, 0, t().createElement(J, {
1520
1578
  elementRef: e(h),
1521
1579
  label: y,
1522
1580
  value: p,
1523
1581
  key: "missing-value-".concat(p),
1524
- onClick: Xr,
1582
+ onClick: Gr,
1525
1583
  multiple: N,
1526
1584
  selected: true
1527
1585
  }));
@@ -1533,45 +1591,45 @@
1533
1591
  }
1534
1592
  var S = g === "controlled";
1535
1593
  // Filter the items
1536
- var O = (0, M.stringToKeywords)(Te);
1594
+ var O = (0, R.stringToKeywords)(Te);
1537
1595
  f = S ? f : f.filter((function(e) {
1538
- if (nr(e)) {
1539
- return (0, M.testPhrase)(e.props.label, O);
1596
+ if (lr(e)) {
1597
+ return (0, R.testPhrase)(e.props.label, O);
1540
1598
  }
1541
1599
  return true;
1542
1600
  // Keep all headers and non-interactive options
1543
1601
  })).map((function(e) {
1544
- if (!nr(e)) {
1602
+ if (!lr(e)) {
1545
1603
  return e;
1546
1604
  }
1547
1605
  // highlight matched text
1548
- var r = O && (0, M.keywordLocations)(e.props.label, O);
1606
+ var r = O && (0, R.keywordLocations)(e.props.label, O);
1549
1607
 
1550
- return (0, t.cloneElement)(e, {
1608
+ return (0, n.cloneElement)(e, {
1551
1609
  matchRanges: r || undefined
1552
1610
  });
1553
1611
  }));
1554
1612
  // Add the option to add the new value
1555
1613
  if (c && !r && Te) {
1556
- var C = o ? a + 1 : a;
1614
+ var C = i ? a + 1 : a;
1557
1615
  var k = "".concat(Te, " (new value)");
1558
- var x = lr(Te, k);
1559
- f.splice(C, 0, n().createElement(U, {
1616
+ var x = ar(Te, k);
1617
+ f.splice(C, 0, t().createElement(J, {
1560
1618
  elementRef: e(x),
1561
1619
  label: k,
1562
1620
  value: Te,
1563
1621
  key: "newValue",
1564
1622
  multiple: N,
1565
- onClick: Xr
1623
+ onClick: Gr
1566
1624
  }));
1567
1625
  }
1568
1626
  // When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
1569
- var j = ae === "checkbox" && N && f.length > 1 ? 1 : 0;
1627
+ var j = ie === "checkbox" && N && f.length > 1 ? 1 : 0;
1570
1628
  var P = true;
1571
1629
  // Highlight the selected Items and remove hidden
1572
1630
  f = f.reduce((function(e, r) {
1573
1631
  // ignore Dividers & Headings
1574
- if (!nr(r)) {
1632
+ if (!lr(r)) {
1575
1633
  e.push(r);
1576
1634
  return e;
1577
1635
  }
@@ -1579,182 +1637,182 @@
1579
1637
  if (r.props && r.props.hidden) {
1580
1638
  return e;
1581
1639
  }
1582
- if (r.props.selected && r.props.disabled !== true && r.props.disabled !== "disabled" && xr.current == null) {
1583
- xr.current = wr.current;
1640
+ if (r.props.selected && r.props.disabled !== true && r.props.disabled !== "disabled" && jr.current == null) {
1641
+ jr.current = Cr.current;
1584
1642
  }
1585
- var n = r.props.disabled;
1586
- if (n === true || n === "disabled") {
1643
+ var t = r.props.disabled;
1644
+ if (t === true || t === "disabled") {
1587
1645
  e.push(r);
1588
1646
  return e;
1589
1647
  }
1590
- var l = j === Ee;
1648
+ var l = j === Pe;
1591
1649
  j += 1;
1592
- wr.current += 1;
1650
+ Cr.current += 1;
1593
1651
  // Dimmed Options can receive focus but are not selectable
1594
- jr.current += r.props.selected && n !== "dimmed" ? 1 : 0;
1595
- if (r.key !== "newValue" && n !== "dimmed" && !r.props.selected) {
1652
+ Er.current += r.props.selected && t !== "dimmed" ? 1 : 0;
1653
+ if (r.key !== "newValue" && t !== "dimmed" && !r.props.selected) {
1596
1654
  P = false;
1597
1655
  }
1598
- if (!l || !We) {
1656
+ if (!l || !$e) {
1599
1657
  e.push(r);
1600
1658
  return e;
1601
1659
  }
1602
- Sr.current = r.props.value;
1603
- var a = (0, t.cloneElement)(r, {
1660
+ Or.current = r.props.value;
1661
+ var a = (0, n.cloneElement)(r, {
1604
1662
  active: l,
1605
- elementRef: Yr,
1606
- id: we
1663
+ elementRef: rn,
1664
+ id: Ce
1607
1665
  });
1608
1666
  e.push(a);
1609
1667
  return e;
1610
1668
  }), []);
1611
- Er.current = jr.current === 0 && "none" || P && "all" || "some";
1669
+ Pr.current = Er.current === 0 && "none" || P && "all" || "some";
1612
1670
  // add select all option
1613
- if (ae === "checkbox" && N && wr.current > 0) {
1614
- var A = Ee === 0 && !!g;
1671
+ if (ie === "checkbox" && N && Cr.current > 0) {
1672
+ var A = Pe === 0 && !!g;
1615
1673
  var L;
1616
- if (Er.current === "all") {
1674
+ if (Pr.current === "all") {
1617
1675
  if (Te === "") {
1618
- L = (0, T._)("Clear all");
1676
+ L = (0, M._)("Clear all");
1619
1677
  } else {
1620
- L = (0, T._)("Clear all matches");
1678
+ L = (0, M._)("Clear all matches");
1621
1679
  }
1622
1680
  } else if (Te === "") {
1623
- L = (0, T._)("Select all");
1681
+ L = (0, M._)("Select all");
1624
1682
  } else {
1625
- L = (0, T._)("Select all matches");
1683
+ L = (0, M._)("Select all matches");
1626
1684
  }
1627
1685
  if (A) {
1628
- Sr.current = "selectAll";
1686
+ Or.current = "selectAll";
1629
1687
  }
1630
- f.unshift( n().createElement(oe, {
1688
+ f.unshift( t().createElement(oe, {
1631
1689
  key: "select-all-option",
1632
1690
  active: A,
1633
- elementRef: Yr,
1634
- id: A ? we : undefined,
1635
- onClick: Er.current === "all" ? zr : Hr,
1691
+ elementRef: rn,
1692
+ id: A ? Ce : undefined,
1693
+ onClick: Pr.current === "all" ? Xr : $r,
1636
1694
  label: L,
1637
- selected: Er.current === "all" || Er.current !== "none" && "some",
1638
- totalCount: !!de && Dr.length || undefined,
1695
+ selected: Pr.current === "all" || Pr.current !== "none" && "some",
1696
+ totalCount: !!pe && Br.length || undefined,
1639
1697
  tabIndex: g ? -1 : undefined
1640
- }), n().createElement(w.Divider, {
1698
+ }), t().createElement(w.Divider, {
1641
1699
  key: "selectAllDivider"
1642
1700
  }));
1643
1701
  }
1644
- Cr.current = f.reduce((function(e, r) {
1645
- if (nr(r)) {
1702
+ kr.current = f.reduce((function(e, r) {
1703
+ if (lr(r)) {
1646
1704
  e.push(r.props.value);
1647
1705
  }
1648
1706
  return e;
1649
1707
  }), []);
1650
1708
  return f;
1651
- }), [ Ee, we, l, c, Tr, qr, Dr, g, Te, Yr, zr, Xr, Ur, Zr, Hr, E, N, tt, W, ae, We, de ]);
1652
- var lt = function e(r) {
1653
- var t = r.anchorWidth, l = r.maxHeight, o = r.placement, i = r.toggleId;
1654
- var u = rr({
1655
- anchorWidth: t,
1709
+ }), [ Pe, Ce, l, c, qr, _r, Br, g, Te, rn, Xr, Gr, Qr, nn, $r, E, N, an, $, ie, $e, pe ]);
1710
+ var un = function e(r) {
1711
+ var n = r.anchorWidth, l = r.maxHeight, i = r.placement, o = r.toggleId;
1712
+ var u = nr({
1713
+ anchorWidth: n,
1656
1714
  isMultiple: N,
1657
1715
  maxHeight: l,
1658
- menuStyle: B
1716
+ menuStyle: V
1659
1717
  });
1660
- var c = Dr.length > 0 && !rt && !g ? 0 : undefined;
1718
+ var c = Br.length > 0 && !ln && !g ? 0 : undefined;
1661
1719
  var s = {
1662
1720
  "aria-multiselectable": N || undefined,
1663
- childrenStart: !!g && n().createElement(fr, {
1664
- activeItemId: we,
1665
- filterA11yId: Lr,
1721
+ childrenStart: !!g && t().createElement(dr, {
1722
+ activeItemId: Ce,
1723
+ filterA11yId: Ir,
1666
1724
  filterKeyword: Te,
1667
- hasChildren: nt.some((function(e) {
1668
- return nr(e);
1725
+ hasChildren: on.some((function(e) {
1726
+ return lr(e);
1669
1727
  })),
1670
1728
  inputId: x,
1671
1729
  inputRef: j,
1672
- menuListboxId: ke,
1730
+ menuListboxId: xe,
1673
1731
  multiple: N,
1674
- onClearAll: zr,
1675
- onSelectAll: Hr,
1676
- onTextBlur: Qr,
1677
- onTextChange: Jr,
1678
- onTextFocus: Gr,
1679
- onTextKeyDown: $r,
1680
- optionSelection: Er,
1681
- placement: o,
1682
- selectAllAppearance: ae,
1683
- textHasFocus: We
1732
+ onClearAll: Xr,
1733
+ onSelectAll: $r,
1734
+ onTextBlur: en,
1735
+ onTextChange: Yr,
1736
+ onTextFocus: Zr,
1737
+ onTextKeyDown: Jr,
1738
+ optionSelection: Pr,
1739
+ placement: i,
1740
+ selectAllAppearance: ie,
1741
+ textHasFocus: $e
1684
1742
  }),
1685
1743
  focusMode: g ? "never" : undefined,
1686
1744
  isLoading: E,
1687
- labelledBy: "".concat(Lr !== null && Lr !== void 0 ? Lr : "", " ").concat(i !== null && i !== void 0 ? i : "").trim(),
1745
+ labelledBy: "".concat(Ir !== null && Ir !== void 0 ? Ir : "", " ").concat(o !== null && o !== void 0 ? o : "").trim(),
1688
1746
  // NVDA ignores aria-labelledby attribute on popover, but reads it on menu
1689
- menuId: ke,
1690
- onScrollBottom: W ? Wr : undefined,
1691
- placement: o !== null && o !== void 0 ? o : undefined,
1692
- noOptionsMessage: K,
1747
+ menuId: xe,
1748
+ onScrollBottom: $ ? Ur : undefined,
1749
+ placement: i !== null && i !== void 0 ? i : undefined,
1750
+ noOptionsMessage: H,
1693
1751
  footerMessage: S,
1694
1752
  animateLoading: a,
1695
1753
  loadingMessage: I,
1696
- onScroll: z,
1754
+ onScroll: W,
1697
1755
  style: u,
1698
1756
  tabIndex: c
1699
1757
  };
1700
- if (fe) {
1758
+ if (de) {
1701
1759
 
1702
- return n().createElement(C.VirtualizedResultsMenu, _e({
1703
- virtualization: fe
1704
- }, s), nt);
1760
+ return t().createElement(C.VirtualizedResultsMenu, Be({
1761
+ virtualization: de
1762
+ }, s), on);
1705
1763
  }
1706
1764
 
1707
- return n().createElement(k(), s, nt);
1765
+ return t().createElement(k(), s, on);
1708
1766
  };
1709
- var at = (0, t.useMemo)((function() {
1767
+ var cn = (0, n.useMemo)((function() {
1710
1768
 
1711
- return n().createElement(vr, _e({
1712
- appearance: i,
1769
+ return t().createElement(br, Be({
1770
+ appearance: o,
1713
1771
  append: u,
1714
- currentValues: Dr,
1772
+ currentValues: Br,
1715
1773
  "data-test": N ? "multiselect" : "select",
1716
1774
  describedBy: v,
1717
1775
  disabled: b,
1718
- elementRef: et,
1776
+ elementRef: tn,
1719
1777
  error: y,
1720
1778
  inline: O,
1721
1779
  labelText: A,
1722
1780
  labelledBy: P,
1723
1781
  multiple: N,
1724
- onClick: Ir ? undefined : X,
1725
- placeholder: Z,
1726
- prefixLabel: ee,
1727
- prepend: re,
1728
- required: Q,
1729
- suffixLabel: ue,
1730
- toggle: de,
1731
- toggleContent: ve,
1732
- maxLabelItems: me
1733
- }, ye), s);
1734
- }), [ i, u, Dr, N, v, b, et, y, O, A, P, Ir, X, Z, ee, re, Q, ue, de, ve, me, ye, s ]);
1782
+ onClick: Rr ? undefined : U,
1783
+ placeholder: ee,
1784
+ prefixLabel: re,
1785
+ prepend: ne,
1786
+ required: Y,
1787
+ suffixLabel: ce,
1788
+ toggle: pe,
1789
+ toggleContent: be,
1790
+ maxLabelItems: ye
1791
+ }, ge), s);
1792
+ }), [ o, u, Br, N, v, b, tn, y, O, A, P, Rr, U, ee, re, ne, Y, ce, pe, be, ye, ge, s ]);
1735
1793
 
1736
- return n().createElement(h(), {
1794
+ return t().createElement(h(), {
1737
1795
  closeReasons: tr,
1738
1796
  inputId: x,
1739
- "aria-labelledby": Lr,
1740
- toggle: at,
1741
- onRequestOpen: Nr,
1742
- onRequestClose: Vr,
1743
- open: Ve,
1744
- openWithArrowKeys: !Ir,
1745
- repositionMode: ne,
1797
+ "aria-labelledby": Ir,
1798
+ toggle: cn,
1799
+ onRequestOpen: Fr,
1800
+ onRequestClose: Hr,
1801
+ open: Fe,
1802
+ openWithArrowKeys: !Rr,
1803
+ repositionMode: le,
1746
1804
  defaultPlacement: d,
1747
- canCoverAnchor: Ae().innerHeight < 500,
1805
+ canCoverAnchor: Le().innerHeight < 500,
1748
1806
  retainFocus: false,
1749
- takeFocus: Dr.length === 0 || Dr.length > 0 && !rt || !!g
1750
- }, lt);
1807
+ takeFocus: Br.length === 0 || Br.length > 0 && !ln || !!g
1808
+ }, un);
1751
1809
  }
1752
- mr.propTypes = Ze;
1753
- mr.componentType = "SelectBase";
1754
- mr.Option = U;
1755
- mr.Divider = w.Divider;
1756
- mr.Heading = w.Heading;
1757
- /* harmony default export */ const yr = mr;
1810
+ yr.propTypes = er;
1811
+ yr.componentType = "SelectBase";
1812
+ yr.Option = J;
1813
+ yr.Divider = w.Divider;
1814
+ yr.Heading = w.Heading;
1815
+ /* harmony default export */ const gr = yr;
1758
1816
  // CONCATENATED MODULE: ./src/SelectBase/index.ts
1759
1817
  module.exports = r;
1760
1818
  /******/})();