@splunk/react-ui 4.37.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 (142) 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 +208 -219
  8. package/ButtonGroup.js +41 -49
  9. package/ButtonSimple.js +264 -295
  10. package/CHANGELOG.md +50 -1
  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 +1107 -980
  20. package/ColumnLayout.js +72 -96
  21. package/ComboBox.js +267 -305
  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 +512 -530
  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 +1600 -1923
  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 +130 -94
  57. package/Scroll.js +209 -244
  58. package/Search.js +375 -384
  59. package/Select.js +1076 -1354
  60. package/SidePanel.js +122 -142
  61. package/Slider.js +192 -222
  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 +211 -236
  67. package/TabBar.js +222 -258
  68. package/TabLayout.js +114 -139
  69. package/Table.js +2017 -2180
  70. package/Text.js +401 -512
  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 +17 -17
  82. package/types/src/Button/Button.d.ts +20 -6
  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 +5 -2
  86. package/types/src/Color/Palette.d.ts +6 -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 -3
  90. package/types/src/File/File.d.ts +2 -3
  91. package/types/src/File/Retry.d.ts +1 -2
  92. package/types/src/Link/Link.d.ts +3 -4
  93. package/types/src/Menu/Item.d.ts +24 -8
  94. package/types/src/Menu/Menu.d.ts +3 -3
  95. package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
  96. package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
  97. package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
  98. package/types/src/Multiselect/Option.d.ts +2 -0
  99. package/types/src/Number/Number.d.ts +3 -3
  100. package/types/src/Popover/Popover.d.ts +3 -4
  101. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  102. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  103. package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
  104. package/types/src/Search/Option.d.ts +16 -3
  105. package/types/src/Select/Option.d.ts +3 -1
  106. package/types/src/Select/OptionBase.d.ts +7 -5
  107. package/types/src/Select/Select.d.ts +2 -2
  108. package/types/src/Select/SelectAllOption.d.ts +4 -4
  109. package/types/src/Select/SelectBase.d.ts +0 -1
  110. package/types/src/SidePanel/SidePanel.d.ts +1 -1
  111. package/types/src/Slider/Slider.d.ts +2 -3
  112. package/types/src/Slider/docs/examples/Error.d.ts +2 -0
  113. package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
  114. package/types/src/StepBar/Step.d.ts +1 -2
  115. package/types/src/TabBar/Tab.d.ts +1 -1
  116. package/types/src/TabBar/TabBar.d.ts +3 -1
  117. package/types/src/TabLayout/TabLayout.d.ts +2 -0
  118. package/types/src/Table/HeadDropdownCell.d.ts +2 -0
  119. package/types/src/Table/Table.d.ts +0 -1
  120. package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
  121. package/types/src/Text/IconOutlinedHide.d.ts +1 -2
  122. package/types/src/Text/IconOutlinedView.d.ts +1 -2
  123. package/types/src/Text/Text.d.ts +6 -4
  124. package/types/src/Text/docs/examples/Dimmed.d.ts +2 -0
  125. package/types/src/TextArea/TextArea.d.ts +2 -2
  126. package/types/src/Tooltip/Tooltip.d.ts +4 -4
  127. package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
  128. package/useForceUpdate.js +30 -32
  129. package/useKeyPress.js +1 -1
  130. package/types/src/Button/docs/examples/Selected.d.ts +0 -2
  131. package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
  132. package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
  133. package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
  134. package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
  135. package/types/src/Slider/docs/examples/prisma/Error.d.ts +0 -2
  136. package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
  137. package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
  138. package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
  139. /package/types/src/Date/docs/examples/{prisma/WithoutCalendar.d.ts → WithoutCalendar.d.ts} +0 -0
  140. /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
  141. /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
  142. /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
  },
@@ -328,16 +310,15 @@
328
310
  "data-test-value": r
329
311
  }, a, {
330
312
  onClick: this.handleClick,
331
- role: "option",
332
- "aria-selected": false
313
+ role: "option"
333
314
  }), l);
334
315
  }
335
316
  } ]);
336
317
  return n;
337
318
  }(n.PureComponent);
338
- K(U, "propTypes", N);
339
- K(U, "defaultProps", W);
340
- /* harmony default export */ const X = U;
319
+ z(Y, "propTypes", U);
320
+ z(Y, "defaultProps", X);
321
+ /* harmony default export */ const G = Y;
341
322
  // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
342
323
  /**
343
324
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
@@ -345,7 +326,7 @@
345
326
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
346
327
  * @param current - The new value of the ref.
347
328
  */
348
- function Y(e, t) {
329
+ function J(e, t) {
349
330
  if (e) {
350
331
  if (typeof e === "function") {
351
332
  e(t);
@@ -358,156 +339,137 @@
358
339
  }
359
340
  }
360
341
  // CONCATENATED MODULE: ./src/ComboBox/ComboBox.tsx
361
- function G(e) {
342
+ function Q(e) {
362
343
  "@babel/helpers - typeof";
363
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
364
- G = function e(t) {
365
- return typeof t;
366
- };
367
- } else {
368
- G = function e(t) {
369
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
370
- };
371
- }
372
- return G(e);
373
- }
374
- function J() {
375
- 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) {
376
352
  for (var t = 1; t < arguments.length; t++) {
377
353
  var n = arguments[t];
378
354
  for (var o in n) {
379
- if (Object.prototype.hasOwnProperty.call(n, o)) {
380
- e[o] = n[o];
381
- }
355
+ ({}).hasOwnProperty.call(n, o) && (e[o] = n[o]);
382
356
  }
383
357
  }
384
358
  return e;
385
- };
386
- return J.apply(this, arguments);
359
+ }, Z.apply(null, arguments);
387
360
  }
388
- function Q(e, t) {
361
+ function $(e, t) {
389
362
  var n = Object.keys(e);
390
363
  if (Object.getOwnPropertySymbols) {
391
364
  var o = Object.getOwnPropertySymbols(e);
392
- if (t) o = o.filter((function(t) {
365
+ t && (o = o.filter((function(t) {
393
366
  return Object.getOwnPropertyDescriptor(e, t).enumerable;
394
- }));
395
- n.push.apply(n, o);
367
+ }))), n.push.apply(n, o);
396
368
  }
397
369
  return n;
398
370
  }
399
- function Z(e) {
371
+ function ee(e) {
400
372
  for (var t = 1; t < arguments.length; t++) {
401
- var n = arguments[t] != null ? arguments[t] : {};
402
- if (t % 2) {
403
- Q(Object(n), true).forEach((function(t) {
404
- ce(e, t, n[t]);
405
- }));
406
- } else if (Object.getOwnPropertyDescriptors) {
407
- Object.defineProperties(e, Object.getOwnPropertyDescriptors(n));
408
- } else {
409
- Q(Object(n)).forEach((function(t) {
410
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
411
- }));
412
- }
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
+ }));
413
379
  }
414
380
  return e;
415
381
  }
416
- function $(e, t) {
417
- if (!(e instanceof t)) {
418
- throw new TypeError("Cannot call a class as a function");
419
- }
382
+ function te(e, t) {
383
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
420
384
  }
421
- function ee(e, t) {
385
+ function ne(e, t) {
422
386
  for (var n = 0; n < t.length; n++) {
423
387
  var o = t[n];
424
- o.enumerable = o.enumerable || false;
425
- o.configurable = true;
426
- if ("value" in o) o.writable = true;
427
- 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);
428
390
  }
429
391
  }
430
- function te(e, t, n) {
431
- if (t) ee(e.prototype, t);
432
- if (n) ee(e, n);
433
- 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;
434
396
  }
435
- function ne(e, t) {
436
- if (typeof t !== "function" && t !== null) {
437
- throw new TypeError("Super expression must either be null or a function");
438
- }
397
+ function re(e, t) {
398
+ if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
439
399
  e.prototype = Object.create(t && t.prototype, {
440
400
  constructor: {
441
401
  value: e,
442
- writable: true,
443
- configurable: true
402
+ writable: !0,
403
+ configurable: !0
444
404
  }
445
- });
446
- if (t) oe(e, t);
405
+ }), Object.defineProperty(e, "prototype", {
406
+ writable: !1
407
+ }), t && ie(e, t);
447
408
  }
448
- function oe(e, t) {
449
- oe = Object.setPrototypeOf || function e(t, n) {
450
- t.__proto__ = n;
451
- return t;
452
- };
453
- 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);
454
413
  }
455
- function re(e) {
456
- var t = le();
457
- return function n() {
458
- var o = ue(e), r;
414
+ function ae(e) {
415
+ var t = ce();
416
+ return function() {
417
+ var n, o = se(e);
459
418
  if (t) {
460
- var i = ue(this).constructor;
461
- r = Reflect.construct(o, arguments, i);
462
- } else {
463
- r = o.apply(this, arguments);
464
- }
465
- 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);
466
423
  };
467
424
  }
468
- function ie(e, t) {
469
- if (t && (G(t) === "object" || typeof t === "function")) {
470
- return t;
471
- }
472
- 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);
473
429
  }
474
- function ae(e) {
475
- if (e === void 0) {
476
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
477
- }
430
+ function ue(e) {
431
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
478
432
  return e;
479
433
  }
480
- function le() {
481
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
482
- if (Reflect.construct.sham) return false;
483
- if (typeof Proxy === "function") return true;
434
+ function ce() {
484
435
  try {
485
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
486
- return true;
487
- } catch (e) {
488
- 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.");
489
466
  }
467
+ return ("string" === t ? String : Number)(e);
490
468
  }
491
- function ue(e) {
492
- ue = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
493
- return t.__proto__ || Object.getPrototypeOf(t);
494
- };
495
- return ue(e);
496
- }
497
- function ce(e, t, n) {
498
- if (t in e) {
499
- Object.defineProperty(e, t, {
500
- value: n,
501
- enumerable: true,
502
- configurable: true,
503
- writable: true
504
- });
505
- } else {
506
- e[t] = n;
507
- }
508
- return e;
509
- }
510
- var se = {
469
+ /** @public */
470
+ /** @public */
471
+ /** @public */
472
+ /** @public */ var ve = {
511
473
  animateLoading: i().bool,
512
474
  append: i().bool,
513
475
  children: i().node,
@@ -543,7 +505,7 @@
543
505
  /** @private. */
544
506
  virtualization: i().number
545
507
  };
546
- var fe = {
508
+ var be = {
547
509
  animateLoading: false,
548
510
  controlledFilter: false,
549
511
  defaultPlacement: "vertical",
@@ -554,12 +516,12 @@
554
516
  menuStyle: {},
555
517
  placeholder: (0, O._)("Select...")
556
518
  };
557
- function pe(e, t) {
519
+ function ye(e, t) {
558
520
  var n = t.clientX, o = t.clientY;
559
521
  var r = e.getBoundingClientRect(), i = r.top, a = r.left, l = r.bottom, u = r.right;
560
522
  return n > a && n < u && o > i && o < l;
561
523
  }
562
- var de = f()((function(e) {
524
+ var he = p()((function(e) {
563
525
  var t = e.anchorWidth, n = e.maxHeight, o = e.menuStyle;
564
526
  return l()({
565
527
  maxHeight: n,
@@ -571,39 +533,39 @@
571
533
  * `ComboBox` allows the user to select a predefined string or enter a new value. Unlike `Select`
572
534
  * and `Multiselect`, `Option` value must always be a string and `Option` does not have a label
573
535
  * property.
574
- */ var ve = function(e) {
575
- ne(r, e);
576
- var t = re(r);
536
+ */ var me = function(e) {
537
+ re(r, e);
538
+ var t = ae(r);
577
539
  // @docs-props-type ComboBoxPropsBase
578
540
  function r(e) {
579
541
  var i;
580
- $(this, r);
542
+ te(this, r);
581
543
  i = t.call(this, e);
582
- ce(ae(i), "activeItemId", void 0);
583
- ce(ae(i), "activeValue", void 0);
584
- ce(ae(i), "availableOptionCount", 0);
585
- ce(ae(i), "controlledExternally", void 0);
586
- ce(ae(i), "focusCalledInternally", false);
587
- ce(ae(i), "options", void 0);
588
- ce(ae(i), "popoverId", void 0);
589
- ce(ae(i), "previousActiveIndex", null);
590
- ce(ae(i), "textInput", null);
591
- 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) {
592
554
  i.textInput = e;
593
- Y(i.props.inputRef, e);
555
+ J(i.props.inputRef, e);
594
556
  }));
595
- ce(ae(i), "handleAnchorMount", (function(e) {
557
+ pe(ue(i), "handleAnchorMount", (function(e) {
596
558
  i.setState({
597
559
  anchor: e
598
560
  });
599
- Y(i.props.elementRef, e);
561
+ J(i.props.elementRef, e);
600
562
  }));
601
- ce(ae(i), "handleActiveOptionMount", (function(e) {
563
+ pe(ue(i), "handleActiveOptionMount", (function(e) {
602
564
  if (i.previousActiveIndex !== i.state.activeIndex) {
603
565
  e === null || e === void 0 ? void 0 : e.scrollIntoViewIfNeeded();
604
566
  }
605
567
  }));
606
- ce(ae(i), "handleInputFocus", (function(e, t) {
568
+ pe(ue(i), "handleInputFocus", (function(e, t) {
607
569
  var n, o;
608
570
  /* SUI-930 On IE 11 this handler is essentially deferred after calling
609
571
  * this.textInput.focus(). this.focusCalledInternally enables the focus event to be ignored
@@ -614,7 +576,7 @@
614
576
  }
615
577
  (n = (o = i.props).onFocus) === null || n === void 0 ? void 0 : n.call(o, e, t);
616
578
  }));
617
- ce(ae(i), "handleChange", (function(e, t) {
579
+ pe(ue(i), "handleChange", (function(e, t) {
618
580
  var n, o;
619
581
  var r = t.value, a = t.selectedOption;
620
582
  e.stopPropagation();
@@ -637,19 +599,19 @@
637
599
  name: l
638
600
  });
639
601
  }));
640
- ce(ae(i), "handleSelectOption", (function(e, t) {
641
- i.handleChange(e, Z(Z({}, t), {}, {
602
+ pe(ue(i), "handleSelectOption", (function(e, t) {
603
+ i.handleChange(e, ee(ee({}, t), {}, {
642
604
  selectedOption: true
643
605
  }));
644
606
  i.focusCalledInternally = true;
645
607
  i.focus();
646
608
  i.close();
647
609
  }));
648
- ce(ae(i), "handleInputKeyDown", (function(e) {
610
+ pe(ue(i), "handleInputKeyDown", (function(e) {
649
611
  var t = i.props, o = t.children, r = t.onKeyDown, a = t.onScrollBottom;
650
612
  var l = i.availableOptionCount;
651
613
  var u = i.activeValue;
652
- var c = (0, S.keycode)(e.nativeEvent);
614
+ var c = (0, w.keycode)(e.nativeEvent);
653
615
  if (i.state.open) {
654
616
  switch (c) {
655
617
  case "enter":
@@ -691,38 +653,39 @@
691
653
  default:
692
654
  // do nothing
693
655
  }
694
- } 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
695
658
  c === "enter" || c === "backspace" || c === "down" || c === "up") {
696
659
  i.open();
697
660
  }
698
661
  r === null || r === void 0 ? void 0 : r(e);
699
662
  }));
700
- ce(ae(i), "handleInputClick", (function(e) {
663
+ pe(ue(i), "handleInputClick", (function(e) {
701
664
  e.stopPropagation();
702
665
  if (!i.state.open && !i.props.disabled) {
703
666
  i.open();
704
667
  }
705
668
  }));
706
- ce(ae(i), "handleRequestClose", (function(e) {
669
+ pe(ue(i), "handleRequestClose", (function(e) {
707
670
  var t = e.event, n = e.reason;
708
- 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);
709
672
  if (o) {
710
673
  i.close();
711
674
  }
712
675
  }));
713
- ce(ae(i), "handleScrollBottom", (function(e) {
676
+ pe(ue(i), "handleScrollBottom", (function(e) {
714
677
  if (i.state.open && !i.props.isLoadingOptions) {
715
678
  var t, n;
716
679
  (t = (n = i.props).onScrollBottom) === null || t === void 0 ? void 0 : t.call(n, e);
717
680
  }
718
681
  }));
719
- ce(ae(i), "prepareOptions", (function() {
682
+ pe(ue(i), "prepareOptions", (function() {
720
683
  var e = i.props, t = e.children, r = e.controlledFilter;
721
684
  var a = i.state, l = a.activeIndex, u = a.typedValue;
722
685
  var s = i.getValue();
723
- var f = n.Children.toArray(t).filter(n.isValidElement);
724
- var p = b()(f, (function(e) {
725
- 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) {
726
689
  return false;
727
690
  }
728
691
  if (e.props.label === undefined) {
@@ -733,8 +696,8 @@
733
696
  }
734
697
  return e.props.value === s;
735
698
  }));
736
- if (!p && s) {
737
- f.unshift( o().createElement(X, {
699
+ if (!f && s) {
700
+ p.unshift( o().createElement(G, {
738
701
  description: (0, O._)("(New value)"),
739
702
  descriptionPosition: "right",
740
703
  key: "currentValueOption",
@@ -742,11 +705,11 @@
742
705
  "data-test-current-value-option": s
743
706
  }));
744
707
  }
745
- // Highlight Active
708
+ // Highlight Active
746
709
  i.availableOptionCount = 0;
747
710
  i.activeValue = undefined;
748
711
  var d = (0, m.stringToKeywords)(u ? s : i.getDisplayValue());
749
- i.options = (r ? f : f.filter((function(e) {
712
+ i.options = (r ? p : p.filter((function(e) {
750
713
  if (e.props.label !== undefined) {
751
714
  return (0, m.testPhrase)(e.props.label, d);
752
715
  }
@@ -764,7 +727,7 @@
764
727
  i.availableOptionCount += 1;
765
728
  var a = e.props.label !== undefined ? e.props.label : e.props.value;
766
729
  var u = e.props.matchRanges;
767
- 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;
768
731
  if (o) {
769
732
  if (!e.props.disabled) {
770
733
  i.activeValue = e.props.value;
@@ -774,39 +737,39 @@
774
737
  ref: i.handleActiveOptionMount,
775
738
  id: i.activeItemId,
776
739
  onClick: i.handleSelectOption,
777
- matchRanges: u || f,
740
+ matchRanges: u || p,
778
741
  active: true
779
742
  });
780
743
  }
781
744
 
782
745
  return (0, n.cloneElement)(e, {
783
746
  onClick: i.handleSelectOption,
784
- matchRanges: u || f
747
+ matchRanges: u || p
785
748
  });
786
749
  }));
787
750
  }));
788
- ce(ae(i), "renderMenu", (function(e) {
751
+ pe(ue(i), "renderMenu", (function(e) {
789
752
  var t = e.anchorWidth, n = e.maxHeight;
790
753
  var r = i.props, a = r.isLoadingOptions, l = r.menuStyle, u = r.onScrollBottom, c = r.virtualization;
791
- var s = de({
754
+ var s = he({
792
755
  anchorWidth: t,
793
756
  maxHeight: n,
794
757
  menuStyle: l
795
758
  });
796
- var f = Z({
759
+ var p = ee({
797
760
  style: s,
798
761
  controlledExternally: true,
799
762
  onScrollBottom: u ? i.handleScrollBottom : undefined,
800
763
  isLoading: a
801
- }, h()(i.props, "className", "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll"));
764
+ }, b()(i.props, "className", "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll"));
802
765
  if (c) {
803
766
 
804
- return o().createElement(k.VirtualizedResultsMenu, J({
767
+ return o().createElement(j.VirtualizedResultsMenu, Z({
805
768
  virtualization: c
806
- }, f), i.options);
769
+ }, p), i.options);
807
770
  }
808
771
 
809
- return o().createElement(P(), f, i.options);
772
+ return o().createElement(C(), p, i.options);
810
773
  }));
811
774
  i.state = {
812
775
  activeIndex: 0,
@@ -823,7 +786,7 @@
823
786
  if (false) {}
824
787
  return i;
825
788
  }
826
- te(r, [ {
789
+ oe(r, [ {
827
790
  key: "componentDidUpdate",
828
791
  value: function e(t, n) {
829
792
  if (false) {}
@@ -894,7 +857,7 @@
894
857
  var l = this.getDisplayValue();
895
858
  this.prepareOptions();
896
859
 
897
- return o().createElement(x(), J({
860
+ return o().createElement(x(), Z({
898
861
  autoCapitalize: "off",
899
862
  autoComplete: "off",
900
863
  autoCorrect: "off",
@@ -916,9 +879,8 @@
916
879
  value: l,
917
880
  "aria-activedescendant": this.state.open && Array.isArray(this.options) && this.options.length > 0 ? this.activeItemId : undefined,
918
881
  "aria-expanded": i,
919
- "aria-label": (0, O._)("Value input"),
920
882
  "aria-controls": i ? this.popoverId : undefined
921
- }), o().createElement(w(), {
883
+ }), o().createElement(P(), {
922
884
  anchor: r,
923
885
  autoCloseWhenOffScreen: true,
924
886
  canCoverAnchor: false,
@@ -932,12 +894,12 @@
932
894
  } ]);
933
895
  return r;
934
896
  }(n.Component);
935
- ce(ve, "propTypes", se);
936
- ce(ve, "defaultProps", fe);
937
- ce(ve, "Option", X);
938
- ce(ve, "Divider", I.Divider);
939
- ce(ve, "Heading", I.Heading);
940
- /* 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;
941
903
  // CONCATENATED MODULE: ./src/ComboBox/index.ts
942
904
  module.exports = t;
943
905
  /******/})();