@splunk/react-ui 4.38.0 → 4.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/Accordion.js +131 -153
  2. package/Anchor.js +50 -58
  3. package/Animation.js +64 -59
  4. package/AnimationToggle.js +59 -61
  5. package/Box.js +59 -67
  6. package/Breadcrumbs.js +113 -127
  7. package/Button.js +151 -169
  8. package/ButtonGroup.js +41 -49
  9. package/ButtonSimple.js +264 -295
  10. package/CHANGELOG.md +28 -0
  11. package/Calendar.js +353 -414
  12. package/Card.js +183 -243
  13. package/CardLayout.js +86 -83
  14. package/Chip.js +104 -122
  15. package/Clickable.js +180 -198
  16. package/CloseButton.js +52 -60
  17. package/Code.js +24 -31
  18. package/CollapsiblePanel.js +172 -202
  19. package/Color.js +371 -412
  20. package/ColumnLayout.js +72 -96
  21. package/ComboBox.js +266 -303
  22. package/Concertina.js +406 -454
  23. package/ControlGroup.js +165 -194
  24. package/Date.js +116 -131
  25. package/DefinitionList.js +125 -149
  26. package/Divider.js +81 -79
  27. package/Dropdown.js +226 -237
  28. package/DualListbox.js +150 -186
  29. package/EventListener.js +4 -1
  30. package/File.js +1032 -955
  31. package/FormRows.js +281 -334
  32. package/Heading.js +27 -35
  33. package/Image.js +101 -116
  34. package/JSONTree.js +301 -344
  35. package/Layer.js +118 -126
  36. package/Link.js +141 -159
  37. package/List.js +61 -77
  38. package/MIGRATION.mdx +92 -38
  39. package/Markdown.js +288 -347
  40. package/Menu.js +506 -532
  41. package/Message.js +173 -196
  42. package/MessageBar.js +58 -66
  43. package/Modal.js +241 -290
  44. package/ModalLayer.js +130 -148
  45. package/Monogram.js +138 -138
  46. package/Multiselect.js +1589 -1902
  47. package/Number.js +159 -178
  48. package/Paginator.js +296 -335
  49. package/Paragraph.js +24 -32
  50. package/Popover.js +448 -441
  51. package/Progress.js +65 -75
  52. package/RadioBar.js +301 -303
  53. package/RadioList.js +77 -119
  54. package/Resize.js +105 -127
  55. package/ResultsMenu.js +373 -385
  56. package/ScreenReaderContent.js +50 -58
  57. package/Scroll.js +209 -244
  58. package/Search.js +379 -391
  59. package/Select.js +1077 -1345
  60. package/SidePanel.js +122 -142
  61. package/Slider.js +132 -145
  62. package/SlidingPanels.js +238 -270
  63. package/SplitButton.js +222 -245
  64. package/StaticContent.js +68 -76
  65. package/StepBar.js +206 -205
  66. package/Switch.js +176 -205
  67. package/TabBar.js +222 -258
  68. package/TabLayout.js +114 -139
  69. package/Table.js +2017 -2180
  70. package/Text.js +379 -493
  71. package/TextArea.js +411 -441
  72. package/Tooltip.js +116 -132
  73. package/TransitionOpen.js +160 -178
  74. package/Tree.js +268 -287
  75. package/Typography.js +48 -52
  76. package/WaitSpinner.js +60 -68
  77. package/cypress/support/commands.ts +9 -0
  78. package/cypress/support/index.d.ts +6 -0
  79. package/cypress/tsconfig.cypress.json +1 -0
  80. package/docker-compose.yml +0 -1
  81. package/package.json +14 -14
  82. package/types/src/Button/Button.d.ts +5 -1
  83. package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
  84. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
  85. package/types/src/Color/Color.d.ts +2 -2
  86. package/types/src/Color/Palette.d.ts +4 -2
  87. package/types/src/ComboBox/Option.d.ts +1 -1
  88. package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
  89. package/types/src/Date/Date.d.ts +2 -2
  90. package/types/src/File/File.d.ts +2 -3
  91. package/types/src/File/Retry.d.ts +1 -2
  92. package/types/src/Menu/Item.d.ts +18 -5
  93. package/types/src/Menu/Menu.d.ts +3 -3
  94. package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
  95. package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
  96. package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
  97. package/types/src/Multiselect/Option.d.ts +2 -0
  98. package/types/src/Number/Number.d.ts +3 -3
  99. package/types/src/Popover/Popover.d.ts +3 -4
  100. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  101. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  102. package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
  103. package/types/src/Search/Option.d.ts +9 -3
  104. package/types/src/Select/Option.d.ts +3 -1
  105. package/types/src/Select/OptionBase.d.ts +7 -5
  106. package/types/src/Select/Select.d.ts +1 -1
  107. package/types/src/Select/SelectAllOption.d.ts +4 -4
  108. package/types/src/SidePanel/SidePanel.d.ts +1 -1
  109. package/types/src/Slider/Slider.d.ts +2 -2
  110. package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
  111. package/types/src/StepBar/Step.d.ts +1 -2
  112. package/types/src/Switch/Switch.d.ts +0 -1
  113. package/types/src/TabBar/Tab.d.ts +1 -1
  114. package/types/src/TabBar/TabBar.d.ts +3 -1
  115. package/types/src/TabLayout/TabLayout.d.ts +2 -0
  116. package/types/src/Table/HeadDropdownCell.d.ts +2 -0
  117. package/types/src/Table/Table.d.ts +0 -1
  118. package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
  119. package/types/src/Text/IconOutlinedHide.d.ts +1 -2
  120. package/types/src/Text/IconOutlinedView.d.ts +1 -2
  121. package/types/src/Text/Text.d.ts +2 -2
  122. package/types/src/TextArea/TextArea.d.ts +2 -2
  123. package/types/src/Tooltip/Tooltip.d.ts +4 -4
  124. package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
  125. package/useForceUpdate.js +30 -32
  126. package/useKeyPress.js +1 -1
  127. package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
  128. package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
  129. package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
  130. package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
  131. package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
  132. package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
  133. package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
  134. /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
  135. /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
  136. /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/ComboBox.js CHANGED
@@ -61,10 +61,10 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- Divider: () => /* reexport */ I.Divider,
65
- Heading: () => /* reexport */ I.Heading,
66
- Option: () => /* reexport */ X,
67
- default: () => /* reexport */ he
64
+ Divider: () => /* reexport */ S.Divider,
65
+ Heading: () => /* reexport */ S.Heading,
66
+ Option: () => /* reexport */ G,
67
+ default: () => /* reexport */ ge
68
68
  });
69
69
  // CONCATENATED MODULE: external "react"
70
70
  const n = require("react");
@@ -80,16 +80,16 @@
80
80
  var c = e.n(u);
81
81
  // CONCATENATED MODULE: external "lodash/memoize"
82
82
  const s = require("lodash/memoize");
83
- var f = e.n(s);
83
+ var p = e.n(s);
84
84
  // CONCATENATED MODULE: external "lodash/omit"
85
- const p = require("lodash/omit");
86
- var d = e.n(p);
85
+ const f = require("lodash/omit");
86
+ var d = e.n(f);
87
87
  // CONCATENATED MODULE: external "lodash/pick"
88
88
  const v = require("lodash/pick");
89
- var h = e.n(v);
89
+ var b = e.n(v);
90
90
  // CONCATENATED MODULE: external "lodash/some"
91
91
  const y = require("lodash/some");
92
- var b = e.n(y);
92
+ var h = e.n(y);
93
93
  // CONCATENATED MODULE: external "@splunk/ui-utils/filter"
94
94
  const m = require("@splunk/ui-utils/filter");
95
95
  // CONCATENATED MODULE: external "@splunk/ui-utils/id"
@@ -97,168 +97,148 @@
97
97
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
98
98
  const O = require("@splunk/ui-utils/i18n");
99
99
  // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
100
- const S = require("@splunk/ui-utils/keyboard");
100
+ const w = require("@splunk/ui-utils/keyboard");
101
101
  // CONCATENATED MODULE: external "@splunk/react-ui/Menu"
102
- const I = require("@splunk/react-ui/Menu");
102
+ const S = require("@splunk/react-ui/Menu");
103
103
  // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
104
- const C = require("@splunk/react-ui/Popover");
105
- var w = e.n(C);
104
+ const I = require("@splunk/react-ui/Popover");
105
+ var P = e.n(I);
106
106
  // CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
107
- const k = require("@splunk/react-ui/ResultsMenu");
108
- var P = e.n(k);
107
+ const j = require("@splunk/react-ui/ResultsMenu");
108
+ var C = e.n(j);
109
109
  // CONCATENATED MODULE: external "@splunk/react-ui/Text"
110
- const j = require("@splunk/react-ui/Text");
111
- var x = e.n(j);
110
+ const k = require("@splunk/react-ui/Text");
111
+ var x = e.n(k);
112
112
  // CONCATENATED MODULE: ./src/ComboBox/Option.tsx
113
- function R(e) {
113
+ function E(e) {
114
114
  "@babel/helpers - typeof";
115
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
116
- R = function e(t) {
117
- return typeof t;
118
- };
119
- } else {
120
- R = function e(t) {
121
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
122
- };
123
- }
124
- return R(e);
115
+ return E = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
116
+ return typeof e;
117
+ } : function(e) {
118
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
119
+ }, E(e);
125
120
  }
126
121
  function M() {
127
- M = Object.assign || function(e) {
122
+ return M = Object.assign ? Object.assign.bind() : function(e) {
128
123
  for (var t = 1; t < arguments.length; t++) {
129
124
  var n = arguments[t];
130
125
  for (var o in n) {
131
- if (Object.prototype.hasOwnProperty.call(n, o)) {
132
- e[o] = n[o];
133
- }
126
+ ({}).hasOwnProperty.call(n, o) && (e[o] = n[o]);
134
127
  }
135
128
  }
136
129
  return e;
137
- };
138
- return M.apply(this, arguments);
130
+ }, M.apply(null, arguments);
139
131
  }
140
132
  function V(e, t) {
141
- if (e == null) return {};
142
- var n = D(e, t);
143
- var o, r;
133
+ if (null == e) return {};
134
+ var n, o, r = R(e, t);
144
135
  if (Object.getOwnPropertySymbols) {
145
136
  var i = Object.getOwnPropertySymbols(e);
146
- for (r = 0; r < i.length; r++) {
147
- o = i[r];
148
- if (t.indexOf(o) >= 0) continue;
149
- if (!Object.prototype.propertyIsEnumerable.call(e, o)) continue;
150
- n[o] = e[o];
137
+ for (o = 0; o < i.length; o++) {
138
+ n = i[o], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
151
139
  }
152
140
  }
153
- return n;
141
+ return r;
154
142
  }
155
- function D(e, t) {
156
- if (e == null) return {};
143
+ function R(e, t) {
144
+ if (null == e) return {};
157
145
  var n = {};
158
- var o = Object.keys(e);
159
- var r, i;
160
- for (i = 0; i < o.length; i++) {
161
- r = o[i];
162
- if (t.indexOf(r) >= 0) continue;
163
- n[r] = e[r];
146
+ for (var o in e) {
147
+ if ({}.hasOwnProperty.call(e, o)) {
148
+ if (t.includes(o)) continue;
149
+ n[o] = e[o];
150
+ }
164
151
  }
165
152
  return n;
166
153
  }
167
- function E(e, t) {
168
- if (!(e instanceof t)) {
169
- throw new TypeError("Cannot call a class as a function");
170
- }
154
+ function D(e, t) {
155
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
171
156
  }
172
- function _(e, t) {
157
+ function q(e, t) {
173
158
  for (var n = 0; n < t.length; n++) {
174
159
  var o = t[n];
175
- o.enumerable = o.enumerable || false;
176
- o.configurable = true;
177
- if ("value" in o) o.writable = true;
178
- Object.defineProperty(e, o.key, o);
160
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),
161
+ Object.defineProperty(e, K(o.key), o);
179
162
  }
180
163
  }
181
- function q(e, t, n) {
182
- if (t) _(e.prototype, t);
183
- if (n) _(e, n);
184
- return e;
164
+ function _(e, t, n) {
165
+ return t && q(e.prototype, t), n && q(e, n), Object.defineProperty(e, "prototype", {
166
+ writable: !1
167
+ }), e;
185
168
  }
186
- function A(e, t) {
187
- if (typeof t !== "function" && t !== null) {
188
- throw new TypeError("Super expression must either be null or a function");
189
- }
169
+ function B(e, t) {
170
+ if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
190
171
  e.prototype = Object.create(t && t.prototype, {
191
172
  constructor: {
192
173
  value: e,
193
- writable: true,
194
- configurable: true
174
+ writable: !0,
175
+ configurable: !0
195
176
  }
196
- });
197
- if (t) B(e, t);
177
+ }), Object.defineProperty(e, "prototype", {
178
+ writable: !1
179
+ }), t && T(e, t);
198
180
  }
199
- function B(e, t) {
200
- B = Object.setPrototypeOf || function e(t, n) {
201
- t.__proto__ = n;
202
- return t;
203
- };
204
- return B(e, t);
181
+ function T(e, t) {
182
+ return T = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
183
+ return e.__proto__ = t, e;
184
+ }, T(e, t);
205
185
  }
206
- function T(e) {
186
+ function A(e) {
207
187
  var t = H();
208
- return function n() {
209
- var o = z(e), r;
188
+ return function() {
189
+ var n, o = N(e);
210
190
  if (t) {
211
- var i = z(this).constructor;
212
- r = Reflect.construct(o, arguments, i);
213
- } else {
214
- r = o.apply(this, arguments);
215
- }
216
- return L(this, r);
191
+ var r = N(this).constructor;
192
+ n = Reflect.construct(o, arguments, r);
193
+ } else n = o.apply(this, arguments);
194
+ return L(this, n);
217
195
  };
218
196
  }
219
197
  function L(e, t) {
220
- if (t && (R(t) === "object" || typeof t === "function")) {
221
- return t;
222
- }
198
+ if (t && ("object" == E(t) || "function" == typeof t)) return t;
199
+ if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
223
200
  return F(e);
224
201
  }
225
202
  function F(e) {
226
- if (e === void 0) {
227
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
228
- }
203
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
229
204
  return e;
230
205
  }
231
206
  function H() {
232
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
233
- if (Reflect.construct.sham) return false;
234
- if (typeof Proxy === "function") return true;
235
207
  try {
236
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
237
- return true;
238
- } catch (e) {
239
- return false;
240
- }
241
- }
242
- function z(e) {
243
- z = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
244
- return t.__proto__ || Object.getPrototypeOf(t);
245
- };
246
- return z(e);
247
- }
248
- function K(e, t, n) {
249
- if (t in e) {
250
- Object.defineProperty(e, t, {
251
- value: n,
252
- enumerable: true,
253
- configurable: true,
254
- writable: true
255
- });
256
- } else {
257
- e[t] = n;
208
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
209
+ } catch (e) {}
210
+ return (H = function t() {
211
+ return !!e;
212
+ })();
213
+ }
214
+ function N(e) {
215
+ return N = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
216
+ return e.__proto__ || Object.getPrototypeOf(e);
217
+ }, N(e);
218
+ }
219
+ function z(e, t, n) {
220
+ return (t = K(t)) in e ? Object.defineProperty(e, t, {
221
+ value: n,
222
+ enumerable: !0,
223
+ configurable: !0,
224
+ writable: !0
225
+ }) : e[t] = n, e;
226
+ }
227
+ function K(e) {
228
+ var t = W(e, "string");
229
+ return "symbol" == E(t) ? t : t + "";
230
+ }
231
+ function W(e, t) {
232
+ if ("object" != E(e) || !e) return e;
233
+ var n = e[Symbol.toPrimitive];
234
+ if (void 0 !== n) {
235
+ var o = n.call(e, t || "default");
236
+ if ("object" != E(o)) return o;
237
+ throw new TypeError("@@toPrimitive must return a primitive value.");
258
238
  }
259
- return e;
239
+ return ("string" === t ? String : Number)(e);
260
240
  }
261
- var N = {
241
+ var U = {
262
242
  /** @private */
263
243
  active: i().bool,
264
244
  description: i().string,
@@ -275,7 +255,7 @@
275
255
  truncate: i().bool,
276
256
  value: i().string.isRequired
277
257
  };
278
- var W = {
258
+ var X = {
279
259
  active: false,
280
260
  descriptionPosition: "bottom",
281
261
  disabled: false,
@@ -285,18 +265,18 @@
285
265
  * An option within a `ComboBox`. This inherits from
286
266
  * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
287
267
  * so any elements passed to it must also be pure.
288
- */ var U = function(e) {
289
- A(n, e);
290
- var t = T(n);
268
+ */ var Y = function(e) {
269
+ B(n, e);
270
+ var t = A(n);
291
271
  function n() {
292
272
  var e;
293
- E(this, n);
273
+ D(this, n);
294
274
  for (var o = arguments.length, r = new Array(o), i = 0; i < o; i++) {
295
275
  r[i] = arguments[i];
296
276
  }
297
277
  e = t.call.apply(t, [ this ].concat(r));
298
- K(F(e), "item", null);
299
- K(F(e), "handleClick", (function(t) {
278
+ z(F(e), "item", null);
279
+ z(F(e), "handleClick", (function(t) {
300
280
  var n = e.props, o = n.disabled, r = n.onClick, i = n.value;
301
281
  if (!o) {
302
282
  r === null || r === void 0 ? void 0 : r(t, {
@@ -306,8 +286,10 @@
306
286
  }));
307
287
  return e;
308
288
  }
309
- q(n, [ {
289
+ // @docs-props-type OptionPropsBase
290
+ _(n, [ {
310
291
  key: "scrollIntoViewIfNeeded",
292
+ // eslint-disable-next-line react/no-unused-class-component-methods
311
293
  value: function e() {
312
294
  var t;
313
295
  (t = this.item) === null || t === void 0 ? void 0 : t.scrollIntoViewIfNeeded();
@@ -320,7 +302,7 @@
320
302
  var n = this.props, r = n.value, i = n.label, a = V(n, [ "value", "label" ]);
321
303
  var l = i === undefined ? r : i;
322
304
 
323
- return o().createElement(I.Item, M({
305
+ return o().createElement(S.Item, M({
324
306
  ref: function e(n) {
325
307
  t.item = n;
326
308
  },
@@ -334,9 +316,9 @@
334
316
  } ]);
335
317
  return n;
336
318
  }(n.PureComponent);
337
- K(U, "propTypes", N);
338
- K(U, "defaultProps", W);
339
- /* harmony default export */ const X = U;
319
+ z(Y, "propTypes", U);
320
+ z(Y, "defaultProps", X);
321
+ /* harmony default export */ const G = Y;
340
322
  // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
341
323
  /**
342
324
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
@@ -344,7 +326,7 @@
344
326
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
345
327
  * @param current - The new value of the ref.
346
328
  */
347
- function Y(e, t) {
329
+ function J(e, t) {
348
330
  if (e) {
349
331
  if (typeof e === "function") {
350
332
  e(t);
@@ -357,156 +339,137 @@
357
339
  }
358
340
  }
359
341
  // CONCATENATED MODULE: ./src/ComboBox/ComboBox.tsx
360
- function G(e) {
342
+ function Q(e) {
361
343
  "@babel/helpers - typeof";
362
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
363
- G = function e(t) {
364
- return typeof t;
365
- };
366
- } else {
367
- G = function e(t) {
368
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
369
- };
370
- }
371
- return G(e);
372
- }
373
- function J() {
374
- J = Object.assign || function(e) {
344
+ return Q = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
345
+ return typeof e;
346
+ } : function(e) {
347
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
348
+ }, Q(e);
349
+ }
350
+ function Z() {
351
+ return Z = Object.assign ? Object.assign.bind() : function(e) {
375
352
  for (var t = 1; t < arguments.length; t++) {
376
353
  var n = arguments[t];
377
354
  for (var o in n) {
378
- if (Object.prototype.hasOwnProperty.call(n, o)) {
379
- e[o] = n[o];
380
- }
355
+ ({}).hasOwnProperty.call(n, o) && (e[o] = n[o]);
381
356
  }
382
357
  }
383
358
  return e;
384
- };
385
- return J.apply(this, arguments);
359
+ }, Z.apply(null, arguments);
386
360
  }
387
- function Q(e, t) {
361
+ function $(e, t) {
388
362
  var n = Object.keys(e);
389
363
  if (Object.getOwnPropertySymbols) {
390
364
  var o = Object.getOwnPropertySymbols(e);
391
- if (t) o = o.filter((function(t) {
365
+ t && (o = o.filter((function(t) {
392
366
  return Object.getOwnPropertyDescriptor(e, t).enumerable;
393
- }));
394
- n.push.apply(n, o);
367
+ }))), n.push.apply(n, o);
395
368
  }
396
369
  return n;
397
370
  }
398
- function Z(e) {
371
+ function ee(e) {
399
372
  for (var t = 1; t < arguments.length; t++) {
400
- var n = arguments[t] != null ? arguments[t] : {};
401
- if (t % 2) {
402
- Q(Object(n), true).forEach((function(t) {
403
- ce(e, t, n[t]);
404
- }));
405
- } else if (Object.getOwnPropertyDescriptors) {
406
- Object.defineProperties(e, Object.getOwnPropertyDescriptors(n));
407
- } else {
408
- Q(Object(n)).forEach((function(t) {
409
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
410
- }));
411
- }
373
+ var n = null != arguments[t] ? arguments[t] : {};
374
+ t % 2 ? $(Object(n), !0).forEach((function(t) {
375
+ pe(e, t, n[t]);
376
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : $(Object(n)).forEach((function(t) {
377
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
378
+ }));
412
379
  }
413
380
  return e;
414
381
  }
415
- function $(e, t) {
416
- if (!(e instanceof t)) {
417
- throw new TypeError("Cannot call a class as a function");
418
- }
382
+ function te(e, t) {
383
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
419
384
  }
420
- function ee(e, t) {
385
+ function ne(e, t) {
421
386
  for (var n = 0; n < t.length; n++) {
422
387
  var o = t[n];
423
- o.enumerable = o.enumerable || false;
424
- o.configurable = true;
425
- if ("value" in o) o.writable = true;
426
- Object.defineProperty(e, o.key, o);
388
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),
389
+ Object.defineProperty(e, fe(o.key), o);
427
390
  }
428
391
  }
429
- function te(e, t, n) {
430
- if (t) ee(e.prototype, t);
431
- if (n) ee(e, n);
432
- return e;
392
+ function oe(e, t, n) {
393
+ return t && ne(e.prototype, t), n && ne(e, n), Object.defineProperty(e, "prototype", {
394
+ writable: !1
395
+ }), e;
433
396
  }
434
- function ne(e, t) {
435
- if (typeof t !== "function" && t !== null) {
436
- throw new TypeError("Super expression must either be null or a function");
437
- }
397
+ function re(e, t) {
398
+ if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
438
399
  e.prototype = Object.create(t && t.prototype, {
439
400
  constructor: {
440
401
  value: e,
441
- writable: true,
442
- configurable: true
402
+ writable: !0,
403
+ configurable: !0
443
404
  }
444
- });
445
- if (t) oe(e, t);
405
+ }), Object.defineProperty(e, "prototype", {
406
+ writable: !1
407
+ }), t && ie(e, t);
446
408
  }
447
- function oe(e, t) {
448
- oe = Object.setPrototypeOf || function e(t, n) {
449
- t.__proto__ = n;
450
- return t;
451
- };
452
- return oe(e, t);
409
+ function ie(e, t) {
410
+ return ie = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
411
+ return e.__proto__ = t, e;
412
+ }, ie(e, t);
453
413
  }
454
- function re(e) {
455
- var t = le();
456
- return function n() {
457
- var o = ue(e), r;
414
+ function ae(e) {
415
+ var t = ce();
416
+ return function() {
417
+ var n, o = se(e);
458
418
  if (t) {
459
- var i = ue(this).constructor;
460
- r = Reflect.construct(o, arguments, i);
461
- } else {
462
- r = o.apply(this, arguments);
463
- }
464
- return ie(this, r);
419
+ var r = se(this).constructor;
420
+ n = Reflect.construct(o, arguments, r);
421
+ } else n = o.apply(this, arguments);
422
+ return le(this, n);
465
423
  };
466
424
  }
467
- function ie(e, t) {
468
- if (t && (G(t) === "object" || typeof t === "function")) {
469
- return t;
470
- }
471
- return ae(e);
425
+ function le(e, t) {
426
+ if (t && ("object" == Q(t) || "function" == typeof t)) return t;
427
+ if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
428
+ return ue(e);
472
429
  }
473
- function ae(e) {
474
- if (e === void 0) {
475
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
476
- }
430
+ function ue(e) {
431
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
477
432
  return e;
478
433
  }
479
- function le() {
480
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
481
- if (Reflect.construct.sham) return false;
482
- if (typeof Proxy === "function") return true;
434
+ function ce() {
483
435
  try {
484
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
485
- return true;
486
- } catch (e) {
487
- return false;
436
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
437
+ } catch (e) {}
438
+ return (ce = function t() {
439
+ return !!e;
440
+ })();
441
+ }
442
+ function se(e) {
443
+ return se = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
444
+ return e.__proto__ || Object.getPrototypeOf(e);
445
+ }, se(e);
446
+ }
447
+ function pe(e, t, n) {
448
+ return (t = fe(t)) in e ? Object.defineProperty(e, t, {
449
+ value: n,
450
+ enumerable: !0,
451
+ configurable: !0,
452
+ writable: !0
453
+ }) : e[t] = n, e;
454
+ }
455
+ function fe(e) {
456
+ var t = de(e, "string");
457
+ return "symbol" == Q(t) ? t : t + "";
458
+ }
459
+ function de(e, t) {
460
+ if ("object" != Q(e) || !e) return e;
461
+ var n = e[Symbol.toPrimitive];
462
+ if (void 0 !== n) {
463
+ var o = n.call(e, t || "default");
464
+ if ("object" != Q(o)) return o;
465
+ throw new TypeError("@@toPrimitive must return a primitive value.");
488
466
  }
467
+ return ("string" === t ? String : Number)(e);
489
468
  }
490
- function ue(e) {
491
- ue = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
492
- return t.__proto__ || Object.getPrototypeOf(t);
493
- };
494
- return ue(e);
495
- }
496
- function ce(e, t, n) {
497
- if (t in e) {
498
- Object.defineProperty(e, t, {
499
- value: n,
500
- enumerable: true,
501
- configurable: true,
502
- writable: true
503
- });
504
- } else {
505
- e[t] = n;
506
- }
507
- return e;
508
- }
509
- var se = {
469
+ /** @public */
470
+ /** @public */
471
+ /** @public */
472
+ /** @public */ var ve = {
510
473
  animateLoading: i().bool,
511
474
  append: i().bool,
512
475
  children: i().node,
@@ -542,7 +505,7 @@
542
505
  /** @private. */
543
506
  virtualization: i().number
544
507
  };
545
- var fe = {
508
+ var be = {
546
509
  animateLoading: false,
547
510
  controlledFilter: false,
548
511
  defaultPlacement: "vertical",
@@ -553,12 +516,12 @@
553
516
  menuStyle: {},
554
517
  placeholder: (0, O._)("Select...")
555
518
  };
556
- function pe(e, t) {
519
+ function ye(e, t) {
557
520
  var n = t.clientX, o = t.clientY;
558
521
  var r = e.getBoundingClientRect(), i = r.top, a = r.left, l = r.bottom, u = r.right;
559
522
  return n > a && n < u && o > i && o < l;
560
523
  }
561
- var de = f()((function(e) {
524
+ var he = p()((function(e) {
562
525
  var t = e.anchorWidth, n = e.maxHeight, o = e.menuStyle;
563
526
  return l()({
564
527
  maxHeight: n,
@@ -570,39 +533,39 @@
570
533
  * `ComboBox` allows the user to select a predefined string or enter a new value. Unlike `Select`
571
534
  * and `Multiselect`, `Option` value must always be a string and `Option` does not have a label
572
535
  * property.
573
- */ var ve = function(e) {
574
- ne(r, e);
575
- var t = re(r);
536
+ */ var me = function(e) {
537
+ re(r, e);
538
+ var t = ae(r);
576
539
  // @docs-props-type ComboBoxPropsBase
577
540
  function r(e) {
578
541
  var i;
579
- $(this, r);
542
+ te(this, r);
580
543
  i = t.call(this, e);
581
- ce(ae(i), "activeItemId", void 0);
582
- ce(ae(i), "activeValue", void 0);
583
- ce(ae(i), "availableOptionCount", 0);
584
- ce(ae(i), "controlledExternally", void 0);
585
- ce(ae(i), "focusCalledInternally", false);
586
- ce(ae(i), "options", void 0);
587
- ce(ae(i), "popoverId", void 0);
588
- ce(ae(i), "previousActiveIndex", null);
589
- ce(ae(i), "textInput", null);
590
- ce(ae(i), "handleInputMount", (function(e) {
544
+ pe(ue(i), "activeItemId", void 0);
545
+ pe(ue(i), "activeValue", void 0);
546
+ pe(ue(i), "availableOptionCount", 0);
547
+ pe(ue(i), "controlledExternally", void 0);
548
+ pe(ue(i), "focusCalledInternally", false);
549
+ pe(ue(i), "options", void 0);
550
+ pe(ue(i), "popoverId", void 0);
551
+ pe(ue(i), "previousActiveIndex", null);
552
+ pe(ue(i), "textInput", null);
553
+ pe(ue(i), "handleInputMount", (function(e) {
591
554
  i.textInput = e;
592
- Y(i.props.inputRef, e);
555
+ J(i.props.inputRef, e);
593
556
  }));
594
- ce(ae(i), "handleAnchorMount", (function(e) {
557
+ pe(ue(i), "handleAnchorMount", (function(e) {
595
558
  i.setState({
596
559
  anchor: e
597
560
  });
598
- Y(i.props.elementRef, e);
561
+ J(i.props.elementRef, e);
599
562
  }));
600
- ce(ae(i), "handleActiveOptionMount", (function(e) {
563
+ pe(ue(i), "handleActiveOptionMount", (function(e) {
601
564
  if (i.previousActiveIndex !== i.state.activeIndex) {
602
565
  e === null || e === void 0 ? void 0 : e.scrollIntoViewIfNeeded();
603
566
  }
604
567
  }));
605
- ce(ae(i), "handleInputFocus", (function(e, t) {
568
+ pe(ue(i), "handleInputFocus", (function(e, t) {
606
569
  var n, o;
607
570
  /* SUI-930 On IE 11 this handler is essentially deferred after calling
608
571
  * this.textInput.focus(). this.focusCalledInternally enables the focus event to be ignored
@@ -613,7 +576,7 @@
613
576
  }
614
577
  (n = (o = i.props).onFocus) === null || n === void 0 ? void 0 : n.call(o, e, t);
615
578
  }));
616
- ce(ae(i), "handleChange", (function(e, t) {
579
+ pe(ue(i), "handleChange", (function(e, t) {
617
580
  var n, o;
618
581
  var r = t.value, a = t.selectedOption;
619
582
  e.stopPropagation();
@@ -636,19 +599,19 @@
636
599
  name: l
637
600
  });
638
601
  }));
639
- ce(ae(i), "handleSelectOption", (function(e, t) {
640
- i.handleChange(e, Z(Z({}, t), {}, {
602
+ pe(ue(i), "handleSelectOption", (function(e, t) {
603
+ i.handleChange(e, ee(ee({}, t), {}, {
641
604
  selectedOption: true
642
605
  }));
643
606
  i.focusCalledInternally = true;
644
607
  i.focus();
645
608
  i.close();
646
609
  }));
647
- ce(ae(i), "handleInputKeyDown", (function(e) {
610
+ pe(ue(i), "handleInputKeyDown", (function(e) {
648
611
  var t = i.props, o = t.children, r = t.onKeyDown, a = t.onScrollBottom;
649
612
  var l = i.availableOptionCount;
650
613
  var u = i.activeValue;
651
- var c = (0, S.keycode)(e.nativeEvent);
614
+ var c = (0, w.keycode)(e.nativeEvent);
652
615
  if (i.state.open) {
653
616
  switch (c) {
654
617
  case "enter":
@@ -690,38 +653,39 @@
690
653
  default:
691
654
  // do nothing
692
655
  }
693
- } else if ((0, S.addsCharacter)(e.nativeEvent) !== false || // Safari 9.0 returns undefined
656
+ } else if ((0, w.addsCharacter)(e.nativeEvent) !== false ||
657
+ // Safari 9.0 returns undefined
694
658
  c === "enter" || c === "backspace" || c === "down" || c === "up") {
695
659
  i.open();
696
660
  }
697
661
  r === null || r === void 0 ? void 0 : r(e);
698
662
  }));
699
- ce(ae(i), "handleInputClick", (function(e) {
663
+ pe(ue(i), "handleInputClick", (function(e) {
700
664
  e.stopPropagation();
701
665
  if (!i.state.open && !i.props.disabled) {
702
666
  i.open();
703
667
  }
704
668
  }));
705
- ce(ae(i), "handleRequestClose", (function(e) {
669
+ pe(ue(i), "handleRequestClose", (function(e) {
706
670
  var t = e.event, n = e.reason;
707
- var o = n === "offScreen" || n === "escapeKey" || n === "clickAway" && i.state.anchor && !pe(i.state.anchor, t);
671
+ var o = n === "offScreen" || n === "escapeKey" || n === "clickAway" && i.state.anchor && !ye(i.state.anchor, t);
708
672
  if (o) {
709
673
  i.close();
710
674
  }
711
675
  }));
712
- ce(ae(i), "handleScrollBottom", (function(e) {
676
+ pe(ue(i), "handleScrollBottom", (function(e) {
713
677
  if (i.state.open && !i.props.isLoadingOptions) {
714
678
  var t, n;
715
679
  (t = (n = i.props).onScrollBottom) === null || t === void 0 ? void 0 : t.call(n, e);
716
680
  }
717
681
  }));
718
- ce(ae(i), "prepareOptions", (function() {
682
+ pe(ue(i), "prepareOptions", (function() {
719
683
  var e = i.props, t = e.children, r = e.controlledFilter;
720
684
  var a = i.state, l = a.activeIndex, u = a.typedValue;
721
685
  var s = i.getValue();
722
- var f = n.Children.toArray(t).filter(n.isValidElement);
723
- var p = b()(f, (function(e) {
724
- if (e.type === I.Heading) {
686
+ var p = n.Children.toArray(t).filter(n.isValidElement);
687
+ var f = h()(p, (function(e) {
688
+ if (e.type === S.Heading) {
725
689
  return false;
726
690
  }
727
691
  if (e.props.label === undefined) {
@@ -732,8 +696,8 @@
732
696
  }
733
697
  return e.props.value === s;
734
698
  }));
735
- if (!p && s) {
736
- f.unshift( o().createElement(X, {
699
+ if (!f && s) {
700
+ p.unshift( o().createElement(G, {
737
701
  description: (0, O._)("(New value)"),
738
702
  descriptionPosition: "right",
739
703
  key: "currentValueOption",
@@ -741,11 +705,11 @@
741
705
  "data-test-current-value-option": s
742
706
  }));
743
707
  }
744
- // Highlight Active
708
+ // Highlight Active
745
709
  i.availableOptionCount = 0;
746
710
  i.activeValue = undefined;
747
711
  var d = (0, m.stringToKeywords)(u ? s : i.getDisplayValue());
748
- i.options = (r ? f : f.filter((function(e) {
712
+ i.options = (r ? p : p.filter((function(e) {
749
713
  if (e.props.label !== undefined) {
750
714
  return (0, m.testPhrase)(e.props.label, d);
751
715
  }
@@ -763,7 +727,7 @@
763
727
  i.availableOptionCount += 1;
764
728
  var a = e.props.label !== undefined ? e.props.label : e.props.value;
765
729
  var u = e.props.matchRanges;
766
- var f = !r && s && (p || t > 0) ? (0, m.keywordLocations)(a, d) || undefined : undefined;
730
+ var p = !r && s && (f || t > 0) ? (0, m.keywordLocations)(a, d) || undefined : undefined;
767
731
  if (o) {
768
732
  if (!e.props.disabled) {
769
733
  i.activeValue = e.props.value;
@@ -773,39 +737,39 @@
773
737
  ref: i.handleActiveOptionMount,
774
738
  id: i.activeItemId,
775
739
  onClick: i.handleSelectOption,
776
- matchRanges: u || f,
740
+ matchRanges: u || p,
777
741
  active: true
778
742
  });
779
743
  }
780
744
 
781
745
  return (0, n.cloneElement)(e, {
782
746
  onClick: i.handleSelectOption,
783
- matchRanges: u || f
747
+ matchRanges: u || p
784
748
  });
785
749
  }));
786
750
  }));
787
- ce(ae(i), "renderMenu", (function(e) {
751
+ pe(ue(i), "renderMenu", (function(e) {
788
752
  var t = e.anchorWidth, n = e.maxHeight;
789
753
  var r = i.props, a = r.isLoadingOptions, l = r.menuStyle, u = r.onScrollBottom, c = r.virtualization;
790
- var s = de({
754
+ var s = he({
791
755
  anchorWidth: t,
792
756
  maxHeight: n,
793
757
  menuStyle: l
794
758
  });
795
- var f = Z({
759
+ var p = ee({
796
760
  style: s,
797
761
  controlledExternally: true,
798
762
  onScrollBottom: u ? i.handleScrollBottom : undefined,
799
763
  isLoading: a
800
- }, h()(i.props, "className", "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll"));
764
+ }, b()(i.props, "className", "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll"));
801
765
  if (c) {
802
766
 
803
- return o().createElement(k.VirtualizedResultsMenu, J({
767
+ return o().createElement(j.VirtualizedResultsMenu, Z({
804
768
  virtualization: c
805
- }, f), i.options);
769
+ }, p), i.options);
806
770
  }
807
771
 
808
- return o().createElement(P(), f, i.options);
772
+ return o().createElement(C(), p, i.options);
809
773
  }));
810
774
  i.state = {
811
775
  activeIndex: 0,
@@ -822,7 +786,7 @@
822
786
  if (false) {}
823
787
  return i;
824
788
  }
825
- te(r, [ {
789
+ oe(r, [ {
826
790
  key: "componentDidUpdate",
827
791
  value: function e(t, n) {
828
792
  if (false) {}
@@ -893,7 +857,7 @@
893
857
  var l = this.getDisplayValue();
894
858
  this.prepareOptions();
895
859
 
896
- return o().createElement(x(), J({
860
+ return o().createElement(x(), Z({
897
861
  autoCapitalize: "off",
898
862
  autoComplete: "off",
899
863
  autoCorrect: "off",
@@ -915,9 +879,8 @@
915
879
  value: l,
916
880
  "aria-activedescendant": this.state.open && Array.isArray(this.options) && this.options.length > 0 ? this.activeItemId : undefined,
917
881
  "aria-expanded": i,
918
- "aria-label": (0, O._)("Value input"),
919
882
  "aria-controls": i ? this.popoverId : undefined
920
- }), o().createElement(w(), {
883
+ }), o().createElement(P(), {
921
884
  anchor: r,
922
885
  autoCloseWhenOffScreen: true,
923
886
  canCoverAnchor: false,
@@ -931,12 +894,12 @@
931
894
  } ]);
932
895
  return r;
933
896
  }(n.Component);
934
- ce(ve, "propTypes", se);
935
- ce(ve, "defaultProps", fe);
936
- ce(ve, "Option", X);
937
- ce(ve, "Divider", I.Divider);
938
- ce(ve, "Heading", I.Heading);
939
- /* harmony default export */ const he = ve;
897
+ pe(me, "propTypes", ve);
898
+ pe(me, "defaultProps", be);
899
+ pe(me, "Option", G);
900
+ pe(me, "Divider", S.Divider);
901
+ pe(me, "Heading", S.Heading);
902
+ /* harmony default export */ const ge = me;
940
903
  // CONCATENATED MODULE: ./src/ComboBox/index.ts
941
904
  module.exports = t;
942
905
  /******/})();