@splunk/react-ui 4.21.1 → 4.22.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/ComboBox.js CHANGED
@@ -61,10 +61,10 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- Divider: () => /* reexport */ O.Divider,
65
- Heading: () => /* reexport */ O.Heading,
66
- Option: () => /* reexport */ W,
67
- default: () => /* reexport */ pe
64
+ Divider: () => /* reexport */ I.Divider,
65
+ Heading: () => /* reexport */ I.Heading,
66
+ Option: () => /* reexport */ X,
67
+ default: () => /* reexport */ he
68
68
  });
69
69
  // CONCATENATED MODULE: external "react"
70
70
  const n = require("react");
@@ -78,50 +78,53 @@
78
78
  // CONCATENATED MODULE: external "lodash/has"
79
79
  const u = require("lodash/has");
80
80
  var c = e.n(u);
81
- // CONCATENATED MODULE: external "lodash/omit"
82
- const s = require("lodash/omit");
81
+ // CONCATENATED MODULE: external "lodash/memoize"
82
+ const s = require("lodash/memoize");
83
83
  var f = e.n(s);
84
- // CONCATENATED MODULE: external "lodash/pick"
85
- const p = require("lodash/pick");
84
+ // CONCATENATED MODULE: external "lodash/omit"
85
+ const p = require("lodash/omit");
86
86
  var d = e.n(p);
87
- // CONCATENATED MODULE: external "lodash/some"
88
- const v = require("lodash/some");
87
+ // CONCATENATED MODULE: external "lodash/pick"
88
+ const v = require("lodash/pick");
89
89
  var h = e.n(v);
90
+ // CONCATENATED MODULE: external "lodash/some"
91
+ const y = require("lodash/some");
92
+ var b = e.n(y);
90
93
  // CONCATENATED MODULE: external "@splunk/ui-utils/filter"
91
- const y = require("@splunk/ui-utils/filter");
94
+ const m = require("@splunk/ui-utils/filter");
92
95
  // CONCATENATED MODULE: external "@splunk/ui-utils/id"
93
- const b = require("@splunk/ui-utils/id");
96
+ const g = require("@splunk/ui-utils/id");
94
97
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
95
- const m = require("@splunk/ui-utils/i18n");
98
+ const O = require("@splunk/ui-utils/i18n");
96
99
  // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
97
- const g = require("@splunk/ui-utils/keyboard");
100
+ const S = require("@splunk/ui-utils/keyboard");
98
101
  // CONCATENATED MODULE: external "@splunk/react-ui/Menu"
99
- const O = require("@splunk/react-ui/Menu");
102
+ const I = require("@splunk/react-ui/Menu");
100
103
  // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
101
- const I = require("@splunk/react-ui/Popover");
102
- var S = e.n(I);
103
- // CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
104
- const C = require("@splunk/react-ui/ResultsMenu");
104
+ const C = require("@splunk/react-ui/Popover");
105
105
  var w = e.n(C);
106
- // CONCATENATED MODULE: external "@splunk/react-ui/Text"
107
- const k = require("@splunk/react-ui/Text");
106
+ // CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
107
+ const k = require("@splunk/react-ui/ResultsMenu");
108
108
  var P = e.n(k);
109
+ // CONCATENATED MODULE: external "@splunk/react-ui/Text"
110
+ const j = require("@splunk/react-ui/Text");
111
+ var x = e.n(j);
109
112
  // CONCATENATED MODULE: ./src/ComboBox/Option.tsx
110
- function j(e) {
113
+ function R(e) {
111
114
  "@babel/helpers - typeof";
112
115
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
113
- j = function e(t) {
116
+ R = function e(t) {
114
117
  return typeof t;
115
118
  };
116
119
  } else {
117
- j = function e(t) {
120
+ R = function e(t) {
118
121
  return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
119
122
  };
120
123
  }
121
- return j(e);
124
+ return R(e);
122
125
  }
123
- function x() {
124
- x = Object.assign || function(e) {
126
+ function M() {
127
+ M = Object.assign || function(e) {
125
128
  for (var t = 1; t < arguments.length; t++) {
126
129
  var n = arguments[t];
127
130
  for (var o in n) {
@@ -132,11 +135,11 @@
132
135
  }
133
136
  return e;
134
137
  };
135
- return x.apply(this, arguments);
138
+ return M.apply(this, arguments);
136
139
  }
137
- function R(e, t) {
140
+ function V(e, t) {
138
141
  if (e == null) return {};
139
- var n = M(e, t);
142
+ var n = D(e, t);
140
143
  var o, r;
141
144
  if (Object.getOwnPropertySymbols) {
142
145
  var i = Object.getOwnPropertySymbols(e);
@@ -149,7 +152,7 @@
149
152
  }
150
153
  return n;
151
154
  }
152
- function M(e, t) {
155
+ function D(e, t) {
153
156
  if (e == null) return {};
154
157
  var n = {};
155
158
  var o = Object.keys(e);
@@ -161,12 +164,12 @@
161
164
  }
162
165
  return n;
163
166
  }
164
- function V(e, t) {
167
+ function E(e, t) {
165
168
  if (!(e instanceof t)) {
166
169
  throw new TypeError("Cannot call a class as a function");
167
170
  }
168
171
  }
169
- function D(e, t) {
172
+ function _(e, t) {
170
173
  for (var n = 0; n < t.length; n++) {
171
174
  var o = t[n];
172
175
  o.enumerable = o.enumerable || false;
@@ -175,12 +178,12 @@
175
178
  Object.defineProperty(e, o.key, o);
176
179
  }
177
180
  }
178
- function E(e, t, n) {
179
- if (t) D(e.prototype, t);
180
- if (n) D(e, n);
181
+ function q(e, t, n) {
182
+ if (t) _(e.prototype, t);
183
+ if (n) _(e, n);
181
184
  return e;
182
185
  }
183
- function _(e, t) {
186
+ function A(e, t) {
184
187
  if (typeof t !== "function" && t !== null) {
185
188
  throw new TypeError("Super expression must either be null or a function");
186
189
  }
@@ -191,41 +194,41 @@
191
194
  configurable: true
192
195
  }
193
196
  });
194
- if (t) q(e, t);
197
+ if (t) B(e, t);
195
198
  }
196
- function q(e, t) {
197
- q = Object.setPrototypeOf || function e(t, n) {
199
+ function B(e, t) {
200
+ B = Object.setPrototypeOf || function e(t, n) {
198
201
  t.__proto__ = n;
199
202
  return t;
200
203
  };
201
- return q(e, t);
204
+ return B(e, t);
202
205
  }
203
- function A(e) {
204
- var t = L();
206
+ function T(e) {
207
+ var t = H();
205
208
  return function n() {
206
- var o = F(e), r;
209
+ var o = K(e), r;
207
210
  if (t) {
208
- var i = F(this).constructor;
211
+ var i = K(this).constructor;
209
212
  r = Reflect.construct(o, arguments, i);
210
213
  } else {
211
214
  r = o.apply(this, arguments);
212
215
  }
213
- return B(this, r);
216
+ return L(this, r);
214
217
  };
215
218
  }
216
- function B(e, t) {
217
- if (t && (j(t) === "object" || typeof t === "function")) {
219
+ function L(e, t) {
220
+ if (t && (R(t) === "object" || typeof t === "function")) {
218
221
  return t;
219
222
  }
220
- return T(e);
223
+ return F(e);
221
224
  }
222
- function T(e) {
225
+ function F(e) {
223
226
  if (e === void 0) {
224
227
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
225
228
  }
226
229
  return e;
227
230
  }
228
- function L() {
231
+ function H() {
229
232
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
230
233
  if (Reflect.construct.sham) return false;
231
234
  if (typeof Proxy === "function") return true;
@@ -236,13 +239,13 @@
236
239
  return false;
237
240
  }
238
241
  }
239
- function F(e) {
240
- F = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
242
+ function K(e) {
243
+ K = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
241
244
  return t.__proto__ || Object.getPrototypeOf(t);
242
245
  };
243
- return F(e);
246
+ return K(e);
244
247
  }
245
- function H(e, t, n) {
248
+ function N(e, t, n) {
246
249
  if (t in e) {
247
250
  Object.defineProperty(e, t, {
248
251
  value: n,
@@ -255,7 +258,7 @@
255
258
  }
256
259
  return e;
257
260
  }
258
- var K = {
261
+ var z = {
259
262
  /** @private */
260
263
  active: i().bool,
261
264
  description: i().string,
@@ -272,7 +275,7 @@
272
275
  truncate: i().bool,
273
276
  value: i().string.isRequired
274
277
  };
275
- var N = {
278
+ var W = {
276
279
  active: false,
277
280
  descriptionPosition: "bottom",
278
281
  disabled: false,
@@ -282,18 +285,18 @@
282
285
  * An option within a `ComboBox`. This inherits from
283
286
  * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
284
287
  * so any elements passed to it must also be pure.
285
- */ var z = function(e) {
286
- _(n, e);
287
- var t = A(n);
288
+ */ var U = function(e) {
289
+ A(n, e);
290
+ var t = T(n);
288
291
  function n() {
289
292
  var e;
290
- V(this, n);
293
+ E(this, n);
291
294
  for (var o = arguments.length, r = new Array(o), i = 0; i < o; i++) {
292
295
  r[i] = arguments[i];
293
296
  }
294
297
  e = t.call.apply(t, [ this ].concat(r));
295
- H(T(e), "item", null);
296
- H(T(e), "handleClick", (function(t) {
298
+ N(F(e), "item", null);
299
+ N(F(e), "handleClick", (function(t) {
297
300
  var n = e.props, o = n.disabled, r = n.onClick, i = n.value;
298
301
  if (!o) {
299
302
  r === null || r === void 0 ? void 0 : r(t, {
@@ -303,7 +306,7 @@
303
306
  }));
304
307
  return e;
305
308
  }
306
- E(n, [ {
309
+ q(n, [ {
307
310
  key: "scrollIntoViewIfNeeded",
308
311
  value: function e() {
309
312
  var t;
@@ -314,10 +317,10 @@
314
317
  value: function e() {
315
318
  var t = this;
316
319
  // eslint-disable-next-line no-unused-vars
317
- var n = this.props, r = n.value, i = n.label, a = R(n, [ "value", "label" ]);
320
+ var n = this.props, r = n.value, i = n.label, a = V(n, [ "value", "label" ]);
318
321
  var l = i === undefined ? r : i;
319
322
 
320
- return o().createElement(O.Item, x({
323
+ return o().createElement(I.Item, M({
321
324
  ref: function e(n) {
322
325
  t.item = n;
323
326
  },
@@ -332,9 +335,9 @@
332
335
  } ]);
333
336
  return n;
334
337
  }(n.PureComponent);
335
- H(z, "propTypes", K);
336
- H(z, "defaultProps", N);
337
- /* harmony default export */ const W = z;
338
+ N(U, "propTypes", z);
339
+ N(U, "defaultProps", W);
340
+ /* harmony default export */ const X = U;
338
341
  // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
339
342
  /**
340
343
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
@@ -342,7 +345,7 @@
342
345
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
343
346
  * @param current - The new value of the ref.
344
347
  */
345
- function U(e, t) {
348
+ function Y(e, t) {
346
349
  if (e) {
347
350
  if (typeof e === "function") {
348
351
  e(t);
@@ -355,21 +358,21 @@
355
358
  }
356
359
  }
357
360
  // CONCATENATED MODULE: ./src/ComboBox/ComboBox.tsx
358
- function X(e) {
361
+ function G(e) {
359
362
  "@babel/helpers - typeof";
360
363
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
361
- X = function e(t) {
364
+ G = function e(t) {
362
365
  return typeof t;
363
366
  };
364
367
  } else {
365
- X = function e(t) {
368
+ G = function e(t) {
366
369
  return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
367
370
  };
368
371
  }
369
- return X(e);
372
+ return G(e);
370
373
  }
371
- function Y() {
372
- Y = Object.assign || function(e) {
374
+ function J() {
375
+ J = Object.assign || function(e) {
373
376
  for (var t = 1; t < arguments.length; t++) {
374
377
  var n = arguments[t];
375
378
  for (var o in n) {
@@ -380,9 +383,9 @@
380
383
  }
381
384
  return e;
382
385
  };
383
- return Y.apply(this, arguments);
386
+ return J.apply(this, arguments);
384
387
  }
385
- function G(e, t) {
388
+ function Q(e, t) {
386
389
  var n = Object.keys(e);
387
390
  if (Object.getOwnPropertySymbols) {
388
391
  var o = Object.getOwnPropertySymbols(e);
@@ -393,29 +396,29 @@
393
396
  }
394
397
  return n;
395
398
  }
396
- function J(e) {
399
+ function Z(e) {
397
400
  for (var t = 1; t < arguments.length; t++) {
398
401
  var n = arguments[t] != null ? arguments[t] : {};
399
402
  if (t % 2) {
400
- G(Object(n), true).forEach((function(t) {
401
- le(e, t, n[t]);
403
+ Q(Object(n), true).forEach((function(t) {
404
+ ce(e, t, n[t]);
402
405
  }));
403
406
  } else if (Object.getOwnPropertyDescriptors) {
404
407
  Object.defineProperties(e, Object.getOwnPropertyDescriptors(n));
405
408
  } else {
406
- G(Object(n)).forEach((function(t) {
409
+ Q(Object(n)).forEach((function(t) {
407
410
  Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
408
411
  }));
409
412
  }
410
413
  }
411
414
  return e;
412
415
  }
413
- function Q(e, t) {
416
+ function $(e, t) {
414
417
  if (!(e instanceof t)) {
415
418
  throw new TypeError("Cannot call a class as a function");
416
419
  }
417
420
  }
418
- function Z(e, t) {
421
+ function ee(e, t) {
419
422
  for (var n = 0; n < t.length; n++) {
420
423
  var o = t[n];
421
424
  o.enumerable = o.enumerable || false;
@@ -424,12 +427,12 @@
424
427
  Object.defineProperty(e, o.key, o);
425
428
  }
426
429
  }
427
- function $(e, t, n) {
428
- if (t) Z(e.prototype, t);
429
- if (n) Z(e, n);
430
+ function te(e, t, n) {
431
+ if (t) ee(e.prototype, t);
432
+ if (n) ee(e, n);
430
433
  return e;
431
434
  }
432
- function ee(e, t) {
435
+ function ne(e, t) {
433
436
  if (typeof t !== "function" && t !== null) {
434
437
  throw new TypeError("Super expression must either be null or a function");
435
438
  }
@@ -440,41 +443,41 @@
440
443
  configurable: true
441
444
  }
442
445
  });
443
- if (t) te(e, t);
446
+ if (t) oe(e, t);
444
447
  }
445
- function te(e, t) {
446
- te = Object.setPrototypeOf || function e(t, n) {
448
+ function oe(e, t) {
449
+ oe = Object.setPrototypeOf || function e(t, n) {
447
450
  t.__proto__ = n;
448
451
  return t;
449
452
  };
450
- return te(e, t);
453
+ return oe(e, t);
451
454
  }
452
- function ne(e) {
453
- var t = ie();
455
+ function re(e) {
456
+ var t = le();
454
457
  return function n() {
455
- var o = ae(e), r;
458
+ var o = ue(e), r;
456
459
  if (t) {
457
- var i = ae(this).constructor;
460
+ var i = ue(this).constructor;
458
461
  r = Reflect.construct(o, arguments, i);
459
462
  } else {
460
463
  r = o.apply(this, arguments);
461
464
  }
462
- return oe(this, r);
465
+ return ie(this, r);
463
466
  };
464
467
  }
465
- function oe(e, t) {
466
- if (t && (X(t) === "object" || typeof t === "function")) {
468
+ function ie(e, t) {
469
+ if (t && (G(t) === "object" || typeof t === "function")) {
467
470
  return t;
468
471
  }
469
- return re(e);
472
+ return ae(e);
470
473
  }
471
- function re(e) {
474
+ function ae(e) {
472
475
  if (e === void 0) {
473
476
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
474
477
  }
475
478
  return e;
476
479
  }
477
- function ie() {
480
+ function le() {
478
481
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
479
482
  if (Reflect.construct.sham) return false;
480
483
  if (typeof Proxy === "function") return true;
@@ -485,13 +488,13 @@
485
488
  return false;
486
489
  }
487
490
  }
488
- function ae(e) {
489
- ae = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
491
+ function ue(e) {
492
+ ue = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
490
493
  return t.__proto__ || Object.getPrototypeOf(t);
491
494
  };
492
- return ae(e);
495
+ return ue(e);
493
496
  }
494
- function le(e, t, n) {
497
+ function ce(e, t, n) {
495
498
  if (t in e) {
496
499
  Object.defineProperty(e, t, {
497
500
  value: n,
@@ -504,7 +507,7 @@
504
507
  }
505
508
  return e;
506
509
  }
507
- var ue = {
510
+ var se = {
508
511
  animateLoading: i().bool,
509
512
  append: i().bool,
510
513
  children: i().node,
@@ -536,7 +539,7 @@
536
539
  size: i().oneOf([ "small", "medium", "large" ]),
537
540
  value: i().string
538
541
  };
539
- var ce = {
542
+ var fe = {
540
543
  animateLoading: false,
541
544
  controlledFilter: false,
542
545
  defaultPlacement: "vertical",
@@ -545,51 +548,59 @@
545
548
  inline: false,
546
549
  isLoadingOptions: false,
547
550
  menuStyle: {},
548
- placeholder: (0, m._)("Select..."),
551
+ placeholder: (0, O._)("Select..."),
549
552
  size: "medium"
550
553
  };
551
- function se(e, t) {
554
+ function pe(e, t) {
552
555
  var n = t.clientX, o = t.clientY;
553
556
  var r = e.getBoundingClientRect(), i = r.top, a = r.left, l = r.bottom, u = r.right;
554
557
  return n > a && n < u && o > i && o < l;
555
558
  }
559
+ var de = f()((function(e) {
560
+ var t = e.anchorWidth, n = e.maxHeight, o = e.menuStyle;
561
+ return l()({
562
+ maxHeight: n,
563
+ overflow: "auto",
564
+ width: Math.max(t !== null && t !== void 0 ? t : 0, 200)
565
+ }, o);
566
+ }));
556
567
  /**
557
568
  * `ComboBox` allows the user to select a predefined string or enter a new value. Unlike `Select`
558
569
  * and `Multiselect`, `Option` value must always be a string and `Option` does not have a label
559
570
  * property.
560
- */ var fe = function(e) {
561
- ee(r, e);
562
- var t = ne(r);
571
+ */ var ve = function(e) {
572
+ ne(r, e);
573
+ var t = re(r);
563
574
  // @docs-props-type ComboBoxPropsBase
564
575
  function r(e) {
565
576
  var i;
566
- Q(this, r);
577
+ $(this, r);
567
578
  i = t.call(this, e);
568
- le(re(i), "activeItemId", void 0);
569
- le(re(i), "activeValue", void 0);
570
- le(re(i), "availableOptionCount", 0);
571
- le(re(i), "controlledExternally", void 0);
572
- le(re(i), "focusCalledInternally", false);
573
- le(re(i), "options", void 0);
574
- le(re(i), "popoverId", void 0);
575
- le(re(i), "previousActiveIndex", null);
576
- le(re(i), "textInput", null);
577
- le(re(i), "handleInputMount", (function(e) {
579
+ ce(ae(i), "activeItemId", void 0);
580
+ ce(ae(i), "activeValue", void 0);
581
+ ce(ae(i), "availableOptionCount", 0);
582
+ ce(ae(i), "controlledExternally", void 0);
583
+ ce(ae(i), "focusCalledInternally", false);
584
+ ce(ae(i), "options", void 0);
585
+ ce(ae(i), "popoverId", void 0);
586
+ ce(ae(i), "previousActiveIndex", null);
587
+ ce(ae(i), "textInput", null);
588
+ ce(ae(i), "handleInputMount", (function(e) {
578
589
  i.textInput = e;
579
- U(i.props.inputRef, e);
590
+ Y(i.props.inputRef, e);
580
591
  }));
581
- le(re(i), "handleAnchorMount", (function(e) {
592
+ ce(ae(i), "handleAnchorMount", (function(e) {
582
593
  i.setState({
583
594
  anchor: e
584
595
  });
585
- U(i.props.elementRef, e);
596
+ Y(i.props.elementRef, e);
586
597
  }));
587
- le(re(i), "handleActiveOptionMount", (function(e) {
598
+ ce(ae(i), "handleActiveOptionMount", (function(e) {
588
599
  if (i.previousActiveIndex !== i.state.activeIndex) {
589
600
  e === null || e === void 0 ? void 0 : e.scrollIntoViewIfNeeded();
590
601
  }
591
602
  }));
592
- le(re(i), "handleInputFocus", (function(e) {
603
+ ce(ae(i), "handleInputFocus", (function(e) {
593
604
  var t, n;
594
605
  /* SUI-930 On IE 11 this handler is essentially deferred after calling
595
606
  * this.textInput.focus(). this.focusCalledInternally enables the focus event to be ignored
@@ -600,7 +611,7 @@
600
611
  }
601
612
  (t = (n = i.props).onFocus) === null || t === void 0 ? void 0 : t.call(n, e);
602
613
  }));
603
- le(re(i), "handleChange", (function(e, t) {
614
+ ce(ae(i), "handleChange", (function(e, t) {
604
615
  var n, o;
605
616
  var r = t.value, a = t.selectedOption;
606
617
  var l = i.props.name;
@@ -622,19 +633,19 @@
622
633
  name: l
623
634
  });
624
635
  }));
625
- le(re(i), "handleSelectOption", (function(e, t) {
626
- i.handleChange(e, J(J({}, t), {}, {
636
+ ce(ae(i), "handleSelectOption", (function(e, t) {
637
+ i.handleChange(e, Z(Z({}, t), {}, {
627
638
  selectedOption: true
628
639
  }));
629
640
  i.focusCalledInternally = true;
630
641
  i.focus();
631
642
  i.close();
632
643
  }));
633
- le(re(i), "handleInputKeyDown", (function(e) {
644
+ ce(ae(i), "handleInputKeyDown", (function(e) {
634
645
  var t = i.props, o = t.children, r = t.onKeyDown, a = t.onScrollBottom;
635
646
  var l = i.availableOptionCount;
636
647
  var u = i.activeValue;
637
- var c = (0, g.keycode)(e.nativeEvent);
648
+ var c = (0, S.keycode)(e.nativeEvent);
638
649
  if (i.state.open) {
639
650
  switch (c) {
640
651
  case "enter":
@@ -676,67 +687,67 @@
676
687
  default:
677
688
  // do nothing
678
689
  }
679
- } else if ((0, g.addsCharacter)(e.nativeEvent) !== false || // Safari 9.0 returns undefined
690
+ } else if ((0, S.addsCharacter)(e.nativeEvent) !== false || // Safari 9.0 returns undefined
680
691
  c === "enter" || c === "backspace" || c === "down" || c === "up") {
681
692
  i.open();
682
693
  }
683
694
  r === null || r === void 0 ? void 0 : r(e);
684
695
  }));
685
- le(re(i), "handleInputClick", (function() {
696
+ ce(ae(i), "handleInputClick", (function() {
686
697
  if (!i.state.open && !i.props.disabled) {
687
698
  i.open();
688
699
  }
689
700
  }));
690
- le(re(i), "handleRequestClose", (function(e) {
701
+ ce(ae(i), "handleRequestClose", (function(e) {
691
702
  var t = e.event, n = e.reason;
692
- var o = n === "offScreen" || n === "escapeKey" || n === "clickAway" && i.state.anchor && !se(i.state.anchor, t);
703
+ var o = n === "offScreen" || n === "escapeKey" || n === "clickAway" && i.state.anchor && !pe(i.state.anchor, t);
693
704
  if (o) {
694
705
  i.close();
695
706
  }
696
707
  }));
697
- le(re(i), "handleScrollBottom", (function(e) {
708
+ ce(ae(i), "handleScrollBottom", (function(e) {
698
709
  if (i.state.open && !i.props.isLoadingOptions) {
699
710
  var t, n;
700
711
  (t = (n = i.props).onScrollBottom) === null || t === void 0 ? void 0 : t.call(n, e);
701
712
  }
702
713
  }));
703
- le(re(i), "renderMenu", (function(e) {
714
+ ce(ae(i), "renderMenu", (function(e) {
704
715
  var t = e.anchorWidth, r = e.maxHeight;
705
- var a = i.props, u = a.children, s = a.controlledFilter, f = a.isLoadingOptions, p = a.menuStyle, v = a.onScrollBottom;
706
- var b = i.state, g = b.activeIndex, I = b.typedValue;
707
- var S = i.getValue();
708
- var C = n.Children.toArray(u).filter(n.isValidElement);
709
- var k = h()(C, (function(e) {
710
- if (e.type === O.Heading) {
716
+ var a = i.props, l = a.children, u = a.controlledFilter, s = a.isLoadingOptions, f = a.menuStyle, p = a.onScrollBottom;
717
+ var d = i.state, v = d.activeIndex, y = d.typedValue;
718
+ var g = i.getValue();
719
+ var S = n.Children.toArray(l).filter(n.isValidElement);
720
+ var C = b()(S, (function(e) {
721
+ if (e.type === I.Heading) {
711
722
  return false;
712
723
  }
713
724
  if (e.props.label === undefined) {
714
- return e.props.value === S;
725
+ return e.props.value === g;
715
726
  }
716
- if (e.props.label !== undefined && I !== undefined) {
717
- return e.props.label === S;
727
+ if (e.props.label !== undefined && y !== undefined) {
728
+ return e.props.label === g;
718
729
  }
719
- return e.props.value === S;
730
+ return e.props.value === g;
720
731
  }));
721
- if (!k && S) {
722
- C.unshift( o().createElement(W, {
723
- description: (0, m._)("(New value)"),
732
+ if (!C && g) {
733
+ S.unshift( o().createElement(X, {
734
+ description: (0, O._)("(New value)"),
724
735
  descriptionPosition: "right",
725
736
  key: "currentValueOption",
726
- value: S,
727
- "data-test-current-value-option": S
737
+ value: g,
738
+ "data-test-current-value-option": g
728
739
  }));
729
740
  }
730
741
  // Highlight Active
731
742
  i.availableOptionCount = 0;
732
743
  i.activeValue = undefined;
733
- var P = (0, y.stringToKeywords)(I ? S : i.getDisplayValue());
734
- i.options = (s ? C : C.filter((function(e) {
744
+ var w = (0, m.stringToKeywords)(y ? g : i.getDisplayValue());
745
+ i.options = (u ? S : S.filter((function(e) {
735
746
  if (e.props.label !== undefined) {
736
- return (0, y.testPhrase)(e.props.label, P);
747
+ return (0, m.testPhrase)(e.props.label, w);
737
748
  }
738
749
  if (e.props.value !== undefined) {
739
- return (0, y.testPhrase)(e.props.value, P);
750
+ return (0, m.testPhrase)(e.props.value, w);
740
751
  }
741
752
  return true;
742
753
  // Keep all headers and non-interactive options
@@ -745,11 +756,11 @@
745
756
  // ignore Headings and Dividers
746
757
  return e;
747
758
  }
748
- var o = i.availableOptionCount === g;
759
+ var o = i.availableOptionCount === v;
749
760
  i.availableOptionCount += 1;
750
761
  var r = e.props.label !== undefined ? e.props.label : e.props.value;
751
762
  var a = e.props.matchRanges;
752
- var l = !s && S && (k || t > 0) ? (0, y.keywordLocations)(r, P) || undefined : undefined;
763
+ var l = !u && g && (C || t > 0) ? (0, m.keywordLocations)(r, w) || undefined : undefined;
753
764
  if (o) {
754
765
  i.activeValue = e.props.value;
755
766
 
@@ -767,17 +778,18 @@
767
778
  matchRanges: a || l
768
779
  });
769
780
  }));
781
+ var k = de({
782
+ anchorWidth: t,
783
+ maxHeight: r,
784
+ menuStyle: f
785
+ });
770
786
 
771
- return o().createElement(w(), Y({
772
- style: l()({
773
- overflow: "auto",
774
- width: Math.max(t !== null && t !== void 0 ? t : 0, 200)
775
- }, p),
787
+ return o().createElement(P(), J({
788
+ style: k,
776
789
  controlledExternally: true,
777
- maxHeight: r !== null && r !== void 0 ? r : undefined,
778
- onScrollBottom: v ? i.handleScrollBottom : undefined,
779
- isLoading: f
780
- }, d()(i.props, "className", "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll")), i.options);
790
+ onScrollBottom: p ? i.handleScrollBottom : undefined,
791
+ isLoading: s
792
+ }, h()(i.props, "className", "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll")), i.options);
781
793
  }));
782
794
  i.state = {
783
795
  activeIndex: 0,
@@ -787,13 +799,13 @@
787
799
  value: e.defaultValue || ""
788
800
  };
789
801
  i.controlledExternally = c()(e, "value");
790
- i.popoverId = (0, b.createDOMID)("popover");
791
- i.activeItemId = (0, b.createDOMID)("active-item");
802
+ i.popoverId = (0, g.createDOMID)("popover");
803
+ i.activeItemId = (0, g.createDOMID)("active-item");
792
804
  if (false) {}
793
805
  if (false) {}
794
806
  return i;
795
807
  }
796
- $(r, [ {
808
+ te(r, [ {
797
809
  key: "componentDidUpdate",
798
810
  value: function e(t, n) {
799
811
  if (false) {}
@@ -863,14 +875,14 @@
863
875
  var a = this.getValue();
864
876
  var l = this.getDisplayValue();
865
877
 
866
- return o().createElement(P(), Y({
878
+ return o().createElement(x(), J({
867
879
  autoCapitalize: "off",
868
880
  autoComplete: "off",
869
881
  autoCorrect: "off",
870
882
  spellCheck: false,
871
883
  canClear: true,
872
884
  "data-test": "combo-box"
873
- }, f()(this.props, "animateLoading", "className", "controlledFilter", "defaultValue", "footerMessage", "isLoadingOptions", "loadingMessage", "menuStyle", "noOptionsMessage", "onClose", "onOpen", "onScroll", "onScrollBottom", "spellCheck"), {
885
+ }, d()(this.props, "animateLoading", "className", "controlledFilter", "defaultValue", "footerMessage", "isLoadingOptions", "loadingMessage", "menuStyle", "noOptionsMessage", "onClose", "onOpen", "onScroll", "onScrollBottom", "spellCheck"), {
874
886
  "data-test-popover-id": this.popoverId,
875
887
  "data-test-label": l,
876
888
  "data-test-value": a,
@@ -886,9 +898,9 @@
886
898
  "aria-activedescendant": this.activeItemId,
887
899
  "aria-expanded": i,
888
900
  "aria-haspopup": true,
889
- "aria-label": (0, m._)("Value input"),
901
+ "aria-label": (0, O._)("Value input"),
890
902
  "aria-controls": i ? this.popoverId : undefined
891
- }), o().createElement(S(), {
903
+ }), o().createElement(w(), {
892
904
  anchor: r,
893
905
  autoCloseWhenOffScreen: true,
894
906
  canCoverAnchor: false,
@@ -902,12 +914,12 @@
902
914
  } ]);
903
915
  return r;
904
916
  }(n.Component);
905
- le(fe, "propTypes", ue);
906
- le(fe, "defaultProps", ce);
907
- le(fe, "Option", W);
908
- le(fe, "Divider", O.Divider);
909
- le(fe, "Heading", O.Heading);
910
- /* harmony default export */ const pe = fe;
917
+ ce(ve, "propTypes", se);
918
+ ce(ve, "defaultProps", fe);
919
+ ce(ve, "Option", X);
920
+ ce(ve, "Divider", I.Divider);
921
+ ce(ve, "Heading", I.Heading);
922
+ /* harmony default export */ const he = ve;
911
923
  // CONCATENATED MODULE: ./src/ComboBox/index.ts
912
924
  module.exports = t;
913
925
  /******/})();