@splunk/react-ui 5.3.0 → 5.5.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 (114) hide show
  1. package/Accordion.js +31 -31
  2. package/Avatar.js +13 -13
  3. package/Badge.js +154 -0
  4. package/Breadcrumbs.js +66 -63
  5. package/ButtonSimple.js +52 -52
  6. package/CHANGELOG.md +43 -0
  7. package/CardLayout.js +39 -36
  8. package/Clickable.js +5 -6
  9. package/Code.js +917 -424
  10. package/CollapsiblePanel.js +1 -1
  11. package/Color.js +904 -1025
  12. package/ComboBox.js +6 -5
  13. package/DefinitionList.js +1 -1
  14. package/FormRows.js +13 -11
  15. package/JSONTree.js +682 -1408
  16. package/Link.js +74 -44
  17. package/MIGRATION.md +32 -1
  18. package/Markdown.js +9 -5
  19. package/Menu.js +100 -97
  20. package/Multiselect.js +1223 -2858
  21. package/Number.js +3 -3
  22. package/PhoneNumber.d.ts +2 -0
  23. package/PhoneNumber.js +769 -0
  24. package/Popover.js +235 -232
  25. package/RadioList.js +166 -151
  26. package/Resize.js +11 -8
  27. package/ResultsMenu.js +911 -1030
  28. package/ScreenReaderContent.js +86 -130
  29. package/Scroll.js +366 -425
  30. package/Select.js +267 -1947
  31. package/SelectBase.d.ts +2 -0
  32. package/SelectBase.js +1681 -0
  33. package/Slider.js +202 -199
  34. package/SlidingPanels.js +170 -175
  35. package/StepBar.js +123 -97
  36. package/Switch.js +137 -118
  37. package/TabBar.js +296 -295
  38. package/TabLayout.js +14 -14
  39. package/Table.js +1562 -1516
  40. package/TextArea.js +596 -684
  41. package/TransitionOpen.js +82 -74
  42. package/Tree.js +638 -682
  43. package/docker-compose.yml +99 -52
  44. package/package.json +16 -12
  45. package/stubs-splunkui.d.ts +0 -86
  46. package/test-runner-jest.config.js +1 -0
  47. package/types/src/Badge/Badge.d.ts +29 -0
  48. package/types/src/Badge/docs/examples/Basic.d.ts +5 -0
  49. package/types/src/Badge/docs/examples/Count.d.ts +6 -0
  50. package/types/src/Badge/docs/examples/CustomColors.d.ts +8 -0
  51. package/types/src/Badge/docs/examples/Icon.d.ts +6 -0
  52. package/types/src/Badge/index.d.ts +2 -0
  53. package/types/src/Breadcrumbs/Breadcrumbs.d.ts +1 -5
  54. package/types/src/Breadcrumbs/BreadcrumbsContext.d.ts +7 -0
  55. package/types/src/Breadcrumbs/Item.d.ts +1 -1
  56. package/types/src/ButtonSimple/mixin.d.ts +1 -1
  57. package/types/src/Code/Code.d.ts +4 -3
  58. package/types/src/Code/index.d.ts +1 -0
  59. package/types/src/JSONTree/JSONTreeItem.d.ts +1 -1
  60. package/types/src/JSONTree/renderTreeItems.d.ts +1 -1
  61. package/types/src/Link/Link.d.ts +4 -0
  62. package/types/src/Link/LinkContext.d.ts +14 -0
  63. package/types/src/Link/docs/examples/Visited.d.ts +7 -0
  64. package/types/src/Link/index.d.ts +1 -0
  65. package/types/src/Modal/ModalContext.d.ts +1 -1
  66. package/types/src/Multiselect/Compact.d.ts +3 -3
  67. package/types/src/Multiselect/Multiselect.d.ts +1 -1
  68. package/types/src/Multiselect/Normal.d.ts +2 -2
  69. package/types/src/Number/utils.d.ts +1 -1
  70. package/types/src/PhoneNumber/PhoneNumber.d.ts +139 -0
  71. package/types/src/PhoneNumber/docs/examples/Controlled.d.ts +7 -0
  72. package/types/src/PhoneNumber/docs/examples/DefaultCountry.d.ts +7 -0
  73. package/types/src/PhoneNumber/docs/examples/Disabled.d.ts +6 -0
  74. package/types/src/PhoneNumber/docs/examples/Error.d.ts +6 -0
  75. package/types/src/PhoneNumber/docs/examples/Inline.d.ts +7 -0
  76. package/types/src/PhoneNumber/docs/examples/Uncontrolled.d.ts +7 -0
  77. package/types/src/PhoneNumber/index.d.ts +2 -0
  78. package/types/src/PhoneNumber/utils.d.ts +47 -0
  79. package/types/src/Popover/getPlacement.d.ts +1 -1
  80. package/types/src/RadioList/Option.d.ts +7 -2
  81. package/types/src/RadioList/RadioListContext.d.ts +1 -1
  82. package/types/src/RadioList/docs/examples/Description.d.ts +6 -0
  83. package/types/src/Select/Option.d.ts +8 -3
  84. package/types/src/Select/Select.d.ts +1 -1
  85. package/types/src/{Select → SelectBase}/OptionBase.d.ts +8 -2
  86. package/types/src/{Select → SelectBase}/SelectBase.d.ts +3 -1
  87. package/types/src/SelectBase/index.d.ts +2 -0
  88. package/types/src/StepBar/StepBar.d.ts +4 -1
  89. package/types/src/StepBar/StepBarContext.d.ts +1 -0
  90. package/types/src/StepBar/docs/examples/Vertical.d.ts +6 -0
  91. package/types/src/Switch/Switch.d.ts +10 -1
  92. package/types/src/TabBar/Tab.d.ts +3 -1
  93. package/types/src/TabBar/docs/examples/Icons.d.ts +4 -0
  94. package/types/src/TabBar/docs/examples/Tooltips.d.ts +3 -0
  95. package/types/src/TabLayout/Panel.d.ts +2 -0
  96. package/types/src/Table/Body.d.ts +6 -1
  97. package/types/src/Table/Cell.d.ts +5 -1
  98. package/types/src/Table/Head.d.ts +6 -2
  99. package/types/src/Table/HeadCell.d.ts +5 -1
  100. package/types/src/Table/Row.d.ts +5 -1
  101. package/types/src/Table/Table.d.ts +21 -1
  102. package/types/src/Table/TableContext.d.ts +1 -0
  103. package/types/src/Table/docs/examples/HorizontalOverflowScroll.d.ts +8 -0
  104. package/types/src/Table/docs/examples/PinActionColumn.d.ts +7 -0
  105. package/types/src/TransitionOpen/TransitionOpen.d.ts +3 -1
  106. package/types/src/Tree/TreeContext.d.ts +1 -1
  107. package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -0
  108. package/types/src/useRovingFocus/useRovingFocus.d.ts +8 -1
  109. package/useControlled.js +61 -97
  110. package/usePrevious.d.ts +2 -0
  111. package/usePrevious.js +30 -62
  112. package/useResizeObserver.js +71 -136
  113. package/useRovingFocus.js +96 -41
  114. /package/types/src/{Select → SelectBase}/SelectAllOption.d.ts +0 -0
package/Select.js CHANGED
@@ -1,120 +1,34 @@
1
1
  /******/ (() => {
2
2
  // webpackBootstrap
3
3
  /******/ "use strict";
4
- /******/ var e = {
5
- /***/ 3639:
6
- /***/ (e, n, r) => {
7
- // EXPORTS
8
- r.d(n, {
9
- default: () => /* reexport */ s
10
- });
11
- // UNUSED EXPORTS: isAllowedType, isPrimitive
12
- // EXTERNAL MODULE: external "react"
13
- var t = r(9497);
14
- // CONCATENATED MODULE: external "lodash/isEqual"
15
- const l = require("lodash/isEqual");
16
- // EXTERNAL MODULE: external "lodash/has"
17
- var o = r(5919);
18
- var a = r.n(o);
19
- // CONCATENATED MODULE: ./src/useControlled/useControlled.tsx
20
- function i(e) {
21
- return e === null || e === undefined || typeof e === "boolean" || typeof e === "string" || typeof e === "number";
22
- }
23
- function u(e) {
24
- if (i(e)) {
25
- return true;
26
- }
27
- if (Array.isArray(e)) {
28
- return e.every(i);
29
- }
30
- return false;
31
- }
32
- /**
33
- * This is a private component not intended for use outside @splunk/react-ui
34
- *
35
- * A hook that accepts a default value (as used in an uncontrolled component)
36
- * and validates that actions that aren't valid in an uncontrolled component
37
- * such as updating the default value, combining default value with value, etc.
38
- * are not happening.
39
- *
40
- * Return the controlled state of the component.
41
- */ function c(e) {
42
- var n = e.componentProps, r = e.componentName, l = r === void 0 ? "this component" : r, o = e.defaultValuePropName, i = o === void 0 ? "defaultValue" : o, u = e.valuePropName, c = u === void 0 ? "value" : u;
43
- var s = (0, t.useRef)(a()(n, c));
44
- var f = (0, t.useRef)(n[i]);
45
- (0, t.useEffect)((function() {
46
- if (false) {}
47
- }), [ l, n, i, c ]);
48
- (0, t.useEffect)((function() {
49
- if (false) {}
50
- if (false) {}
51
- if (false) {}
52
- }), [ l, n, i, c ]);
53
- return s.current;
54
- }
55
- /* harmony default export */ const s = c;
56
- } // CONCATENATED MODULE: ./src/useControlled/index.ts
57
- /***/ ,
58
- /***/ 5919:
59
- /***/ e => {
60
- e.exports = require("lodash/has");
61
- /***/ },
62
- /***/ 9497:
63
- /***/ e => {
64
- e.exports = require("react");
65
- /***/
66
- /******/ }
67
- };
68
- /************************************************************************/
69
- /******/ // The module cache
70
- /******/ var n = {};
71
- /******/
72
- /******/ // The require function
73
- /******/ function r(t) {
74
- /******/ // Check if module is in cache
75
- /******/ var l = n[t];
76
- /******/ if (l !== undefined) {
77
- /******/ return l.exports;
78
- /******/ }
79
- /******/ // Create a new module (and put it into the cache)
80
- /******/ var o = n[t] = {
81
- /******/ // no module.id needed
82
- /******/ // no module.loaded needed
83
- /******/ exports: {}
84
- /******/ };
85
- /******/
86
- /******/ // Execute the module function
87
- /******/ e[t](o, o.exports, r);
88
- /******/
89
- /******/ // Return the exports of the module
90
- /******/ return o.exports;
91
- /******/ }
4
+ /******/ // The require scope
5
+ /******/ var e = {};
92
6
  /******/
93
7
  /************************************************************************/
94
8
  /******/ /* webpack/runtime/compat get default export */
95
9
  /******/ (() => {
96
10
  /******/ // getDefaultExport function for compatibility with non-harmony modules
97
- /******/ r.n = e => {
98
- /******/ var n = e && e.__esModule ?
99
- /******/ () => e["default"]
100
- /******/ : () => e
11
+ /******/ e.n = n => {
12
+ /******/ var o = n && n.__esModule ?
13
+ /******/ () => n["default"]
14
+ /******/ : () => n
101
15
  /******/;
102
- r.d(n, {
103
- a: n
16
+ e.d(o, {
17
+ a: o
104
18
  });
105
- /******/ return n;
19
+ /******/ return o;
106
20
  /******/ };
107
21
  /******/ })();
108
22
  /******/
109
23
  /******/ /* webpack/runtime/define property getters */
110
24
  /******/ (() => {
111
25
  /******/ // define getter functions for harmony exports
112
- /******/ r.d = (e, n) => {
113
- /******/ for (var t in n) {
114
- /******/ if (r.o(n, t) && !r.o(e, t)) {
115
- /******/ Object.defineProperty(e, t, {
26
+ /******/ e.d = (n, o) => {
27
+ /******/ for (var t in o) {
28
+ /******/ if (e.o(o, t) && !e.o(n, t)) {
29
+ /******/ Object.defineProperty(n, t, {
116
30
  enumerable: true,
117
- get: n[t]
31
+ get: o[t]
118
32
  });
119
33
  /******/ }
120
34
  /******/ }
@@ -123,14 +37,14 @@
123
37
  /******/
124
38
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
125
39
  /******/ (() => {
126
- /******/ r.o = (e, n) => Object.prototype.hasOwnProperty.call(e, n)
40
+ /******/ e.o = (e, n) => Object.prototype.hasOwnProperty.call(e, n)
127
41
  /******/;
128
42
  })();
129
43
  /******/
130
44
  /******/ /* webpack/runtime/make namespace object */
131
45
  /******/ (() => {
132
46
  /******/ // define __esModule on exports
133
- /******/ r.r = e => {
47
+ /******/ e.r = e => {
134
48
  /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
135
49
  /******/ Object.defineProperty(e, Symbol.toStringTag, {
136
50
  value: "Module"
@@ -142,1861 +56,267 @@
142
56
  /******/ };
143
57
  /******/ })();
144
58
  /******/
145
- /************************************************************************/ var t = {};
146
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
147
- (() => {
148
- // ESM COMPAT FLAG
149
- r.r(t);
150
- // EXPORTS
151
- r.d(t, {
152
- Divider: () => /* reexport */ c.Divider,
153
- Heading: () => /* reexport */ c.Heading,
154
- Option: () => /* reexport */ E,
155
- default: () => /* reexport */ Hn
156
- });
157
- // EXTERNAL MODULE: external "react"
158
- var e = r(9497);
159
- var n = r.n(e);
160
- // CONCATENATED MODULE: external "prop-types"
161
- const l = require("prop-types");
162
- var o = r.n(l);
163
- // CONCATENATED MODULE: external "@splunk/react-ui/useControlled"
164
- const a = require("@splunk/react-ui/useControlled");
165
- var i = r.n(a);
166
- // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
167
- const u = require("@splunk/ui-utils/i18n");
168
- // CONCATENATED MODULE: external "@splunk/react-ui/Menu"
169
- const c = require("@splunk/react-ui/Menu");
170
- // CONCATENATED MODULE: ./src/Select/OptionBase.tsx
171
- function s(e) {
172
- "@babel/helpers - typeof";
173
- return s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
174
- return typeof e;
175
- } : function(e) {
176
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
177
- }, s(e);
178
- }
179
- function f() {
180
- return f = Object.assign ? Object.assign.bind() : function(e) {
181
- for (var n = 1; n < arguments.length; n++) {
182
- var r = arguments[n];
183
- for (var t in r) {
184
- ({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
185
- }
186
- }
187
- return e;
188
- }, f.apply(null, arguments);
189
- }
190
- function d(e, n) {
191
- var r = Object.keys(e);
192
- if (Object.getOwnPropertySymbols) {
193
- var t = Object.getOwnPropertySymbols(e);
194
- n && (t = t.filter((function(n) {
195
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
196
- }))), r.push.apply(r, t);
197
- }
198
- return r;
199
- }
200
- function p(e) {
59
+ /************************************************************************/ var n = {};
60
+ // ESM COMPAT FLAG
61
+ e.r(n);
62
+ // EXPORTS
63
+ e.d(n, {
64
+ Divider: () => /* reexport */ i.Divider,
65
+ Heading: () => /* reexport */ i.Heading,
66
+ Option: () => /* reexport */ m,
67
+ default: () => /* reexport */ x
68
+ });
69
+ // CONCATENATED MODULE: external "react"
70
+ const o = require("react");
71
+ var t = e.n(o);
72
+ // CONCATENATED MODULE: external "prop-types"
73
+ const r = require("prop-types");
74
+ var a = e.n(r);
75
+ // CONCATENATED MODULE: external "@splunk/react-ui/SelectBase"
76
+ const i = require("@splunk/react-ui/SelectBase");
77
+ var l = e.n(i);
78
+ // CONCATENATED MODULE: external "@splunk/react-ui/useControlled"
79
+ const u = require("@splunk/react-ui/useControlled");
80
+ var c = e.n(u);
81
+ // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
82
+ const s = require("@splunk/ui-utils/i18n");
83
+ // CONCATENATED MODULE: ./src/Select/Option.tsx
84
+ function d() {
85
+ return d = Object.assign ? Object.assign.bind() : function(e) {
201
86
  for (var n = 1; n < arguments.length; n++) {
202
- var r = null != arguments[n] ? arguments[n] : {};
203
- n % 2 ? d(Object(r), !0).forEach((function(n) {
204
- v(e, n, r[n]);
205
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : d(Object(r)).forEach((function(n) {
206
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
207
- }));
208
- }
209
- return e;
210
- }
211
- function v(e, n, r) {
212
- return (n = b(n)) in e ? Object.defineProperty(e, n, {
213
- value: r,
214
- enumerable: !0,
215
- configurable: !0,
216
- writable: !0
217
- }) : e[n] = r, e;
218
- }
219
- function b(e) {
220
- var n = m(e, "string");
221
- return "symbol" == s(n) ? n : n + "";
222
- }
223
- function m(e, n) {
224
- if ("object" != s(e) || !e) return e;
225
- var r = e[Symbol.toPrimitive];
226
- if (void 0 !== r) {
227
- var t = r.call(e, n || "default");
228
- if ("object" != s(t)) return t;
229
- throw new TypeError("@@toPrimitive must return a primitive value.");
230
- }
231
- return ("string" === n ? String : Number)(e);
232
- }
233
- function y(e, n) {
234
- if (null == e) return {};
235
- var r, t, l = g(e, n);
236
- if (Object.getOwnPropertySymbols) {
237
- var o = Object.getOwnPropertySymbols(e);
238
- for (t = 0; t < o.length; t++) {
239
- r = o[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (l[r] = e[r]);
87
+ var o = arguments[n];
88
+ for (var t in o) {
89
+ ({}).hasOwnProperty.call(o, t) && (e[t] = o[t]);
240
90
  }
241
91
  }
242
- return l;
243
- }
244
- function g(e, n) {
245
- if (null == e) return {};
246
- var r = {};
247
- for (var t in e) {
248
- if ({}.hasOwnProperty.call(e, t)) {
249
- if (-1 !== n.indexOf(t)) continue;
250
- r[t] = e[t];
251
- }
252
- }
253
- return r;
254
- }
255
- var h = {
256
- /** @private */
257
- active: o().bool,
258
- children: o().node,
259
- description: o().string,
260
- descriptionPosition: o().oneOf([ "right", "bottom" ]),
261
- disabled: o().bool,
262
- elementRef: o().oneOfType([ o().func, o().object ]),
263
- hidden: o().bool,
264
- icon: o().node,
265
- label: o().string.isRequired,
266
- /**
267
- * @private Passed down from <BaseSelect>
268
- */
269
- multiple: o().bool,
270
- matchRanges: o().arrayOf(o().shape({
271
- start: o().number.isRequired,
272
- end: o().number.isRequired
273
- })),
274
- /** @private */
275
- onClick: o().func,
276
- /** @private */
277
- role: o().oneOf([ "menuitemcheckbox", "option" ]),
278
- /** @private */
279
- selected: o().oneOfType([ o().bool, o().oneOf([ "some" ]) ]),
280
- truncate: o().bool,
281
- value: o().oneOfType([ o().string, o().number, o().bool ]).isRequired
282
- };
283
- /**
284
- * An option within a `Multiselect`.
285
- */ function O(r) {
286
- var t = r.children, l = r.descriptionPosition, o = l === void 0 ? "bottom" : l, a = r.disabled, i = r.elementRef, u = r.icon, s = r.label, d = r.multiple, v = r.onClick, b = r.role, m = b === void 0 ? "option" : b, g = r.value, h = y(r, [ "children", "descriptionPosition", "disabled", "elementRef", "icon", "label", "multiple", "onClick", "role", "value" ]);
287
- // @docs-props-type OptionPropsBase
288
- var O = (0, e.useCallback)((function(e) {
289
- if (!a) {
290
- v === null || v === void 0 ? void 0 : v(e, {
291
- value: g
292
- });
293
- }
294
- }), [ a, v, g ]);
295
- var S = g.toString();
296
- var C = p({
297
- descriptionPosition: o,
298
- disabled: a ? "disabled" : undefined
299
- }, h);
300
-
301
- return n().createElement(c.Item, f({
302
- "data-test-value": g,
303
- "data-test": "option",
304
- elementRef: i
305
- }, C, {
306
- selectable: true,
307
- selectableAppearance: d ? "checkbox" : "checkmark",
308
- startAdornment: u,
309
- onClick: O,
310
- role: m,
311
- value: S
312
- }), t || s);
313
- }
314
- O.propTypes = h;
315
- O.type = c.Item;
316
- // For components to distinguish if their children are Options or Headings/Dividers
317
- /* harmony default export */ const S = O;
318
- // CONCATENATED MODULE: ./src/Select/Option.tsx
319
- function C() {
320
- return C = Object.assign ? Object.assign.bind() : function(e) {
321
- for (var n = 1; n < arguments.length; n++) {
322
- var r = arguments[n];
323
- for (var t in r) {
324
- ({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
325
- }
326
- }
327
- return e;
328
- }, C.apply(null, arguments);
329
- }
330
- function w(e, n) {
331
- if (null == e) return {};
332
- var r, t, l = k(e, n);
333
- if (Object.getOwnPropertySymbols) {
334
- var o = Object.getOwnPropertySymbols(e);
335
- for (t = 0; t < o.length; t++) {
336
- r = o[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (l[r] = e[r]);
337
- }
338
- }
339
- return l;
340
- }
341
- function k(e, n) {
342
- if (null == e) return {};
343
- var r = {};
344
- for (var t in e) {
345
- if ({}.hasOwnProperty.call(e, t)) {
346
- if (-1 !== n.indexOf(t)) continue;
347
- r[t] = e[t];
348
- }
349
- }
350
- return r;
351
- }
352
- var x = {
353
- /** @private */
354
- active: o().bool,
355
- children: o().node,
356
- description: o().string,
357
- descriptionPosition: o().oneOf([ "right", "bottom" ]),
358
- disabled: o().bool,
359
- elementRef: o().oneOfType([ o().func, o().object ]),
360
- hidden: o().bool,
361
- icon: o().node,
362
- label: o().string.isRequired,
363
- matchRanges: o().arrayOf(o().shape({
364
- start: o().number.isRequired,
365
- end: o().number.isRequired
366
- })),
367
- /** @private */
368
- onClick: o().func,
369
- /** @private */
370
- role: o().oneOf([ "menuitemcheckbox", "option" ]),
371
- /** @private */
372
- selected: o().bool,
373
- truncate: o().bool,
374
- value: o().oneOfType([ o().string, o().number, o().bool ]).isRequired
375
- };
376
- /**
92
+ return e;
93
+ }, d.apply(null, arguments);
94
+ }
95
+ function f(e, n) {
96
+ if (null == e) return {};
97
+ var o, t, r = p(e, n);
98
+ if (Object.getOwnPropertySymbols) {
99
+ var a = Object.getOwnPropertySymbols(e);
100
+ for (t = 0; t < a.length; t++) {
101
+ o = a[t], -1 === n.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (r[o] = e[o]);
102
+ }
103
+ }
104
+ return r;
105
+ }
106
+ function p(e, n) {
107
+ if (null == e) return {};
108
+ var o = {};
109
+ for (var t in e) {
110
+ if ({}.hasOwnProperty.call(e, t)) {
111
+ if (-1 !== n.indexOf(t)) continue;
112
+ o[t] = e[t];
113
+ }
114
+ }
115
+ return o;
116
+ }
117
+ var v = {
118
+ /** @private */
119
+ active: a().bool,
120
+ children: a().node,
121
+ description: a().string,
122
+ descriptionPosition: a().oneOf([ "right", "bottom" ]),
123
+ disabled: a().bool,
124
+ elementRef: a().oneOfType([ a().func, a().object ]),
125
+ /** @private */
126
+ endAdornment: a().node,
127
+ hidden: a().bool,
128
+ icon: a().node,
129
+ label: a().string.isRequired,
130
+ matchRanges: a().arrayOf(a().shape({
131
+ start: a().number.isRequired,
132
+ end: a().number.isRequired
133
+ })),
134
+ /** @private */
135
+ onClick: a().func,
136
+ /** @private */
137
+ role: a().oneOf([ "menuitemcheckbox", "option" ]),
138
+ /** @private */
139
+ selected: a().bool,
140
+ truncate: a().bool,
141
+ value: a().oneOfType([ a().string, a().number, a().bool ]).isRequired
142
+ };
143
+ /**
377
144
  * An option within a `Select`. Any elements passed to it should be memoized.
378
- */ function j(e) {
379
- var r = e.children, t = e.descriptionPosition, l = t === void 0 ? "bottom" : t, o = e.elementRef, a = e.label, i = w(e, [ "children", "descriptionPosition", "elementRef", "label" ]);
380
- // @docs-props-type OptionPropsBase
381
-
382
- return n().createElement(S, C({
383
- descriptionPosition: l,
384
- label: a
385
- }, i, {
386
- elementRef: o,
387
- multiple: false
388
- }), r || a);
389
- }
390
- var P = (0, e.memo)(j);
391
- // @ts-expect-error Need to set propTypes on OptionMemoized so that javascript propType validation will work
392
- P.propTypes = x;
393
- /* harmony default export */ const E = P;
394
- // CONCATENATED MODULE: external "lodash/castArray"
395
- const R = require("lodash/castArray");
396
- var M = r.n(R);
397
- // CONCATENATED MODULE: external "lodash/find"
398
- const A = require("lodash/find");
399
- var T = r.n(A);
400
- // CONCATENATED MODULE: external "lodash/forEachRight"
401
- const I = require("lodash/forEachRight");
402
- var q = r.n(I);
403
- // EXTERNAL MODULE: external "lodash/has"
404
- var L = r(5919);
405
- var D = r.n(L);
406
- // CONCATENATED MODULE: external "lodash/includes"
407
- const N = require("lodash/includes");
408
- var _ = r.n(N);
409
- // CONCATENATED MODULE: external "lodash/memoize"
410
- const B = require("lodash/memoize");
411
- var V = r.n(B);
412
- // CONCATENATED MODULE: external "lodash/pick"
413
- const K = require("lodash/pick");
414
- var F = r.n(K);
415
- // CONCATENATED MODULE: external "lodash/uniq"
416
- const H = require("lodash/uniq");
417
- var z = r.n(H);
418
- // CONCATENATED MODULE: external "lodash/without"
419
- const W = require("lodash/without");
420
- var $ = r.n(W);
421
- // CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
422
- const X = require("@splunk/react-icons/CaretSmallDown");
423
- var U = r.n(X);
424
- // CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
425
- const J = require("@splunk/react-icons/Magnifier");
426
- var G = r.n(J);
427
- // CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
428
- const Q = require("@splunk/react-ui/Dropdown");
429
- var Y = r.n(Q);
430
- // CONCATENATED MODULE: external "@splunk/react-ui/Link"
431
- const Z = require("@splunk/react-ui/Link");
432
- var ee = r.n(Z);
433
- // CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
434
- const ne = require("@splunk/react-ui/ResultsMenu");
435
- var re = r.n(ne);
436
- // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
437
- const te = require("@splunk/react-ui/ScreenReaderContent");
438
- var le = r.n(te);
439
- // CONCATENATED MODULE: external "@splunk/react-ui/Text"
440
- const oe = require("@splunk/react-ui/Text");
441
- var ae = r.n(oe);
442
- // CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
443
- const ie = require("@splunk/react-ui/usePrevious");
444
- var ue = r.n(ie);
445
- // CONCATENATED MODULE: external "@splunk/ui-utils/filter"
446
- const ce = require("@splunk/ui-utils/filter");
447
- // CONCATENATED MODULE: external "@splunk/ui-utils/id"
448
- const se = require("@splunk/ui-utils/id");
449
- // CONCATENATED MODULE: external "@splunk/ui-utils/scroll"
450
- const fe = require("@splunk/ui-utils/scroll");
451
- // CONCATENATED MODULE: ./src/Select/SelectAllOption.tsx
452
- function de(e) {
453
- "@babel/helpers - typeof";
454
- return de = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
455
- return typeof e;
456
- } : function(e) {
457
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
458
- }, de(e);
459
- }
460
- function pe() {
461
- return pe = Object.assign ? Object.assign.bind() : function(e) {
462
- for (var n = 1; n < arguments.length; n++) {
463
- var r = arguments[n];
464
- for (var t in r) {
465
- ({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
466
- }
467
- }
468
- return e;
469
- }, pe.apply(null, arguments);
470
- }
471
- function ve(e, n) {
472
- if (null == e) return {};
473
- var r, t, l = be(e, n);
474
- if (Object.getOwnPropertySymbols) {
475
- var o = Object.getOwnPropertySymbols(e);
476
- for (t = 0; t < o.length; t++) {
477
- r = o[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (l[r] = e[r]);
478
- }
479
- }
480
- return l;
481
- }
482
- function be(e, n) {
483
- if (null == e) return {};
484
- var r = {};
485
- for (var t in e) {
486
- if ({}.hasOwnProperty.call(e, t)) {
487
- if (-1 !== n.indexOf(t)) continue;
488
- r[t] = e[t];
489
- }
490
- }
491
- return r;
492
- }
493
- function me(e, n) {
494
- var r = Object.keys(e);
495
- if (Object.getOwnPropertySymbols) {
496
- var t = Object.getOwnPropertySymbols(e);
497
- n && (t = t.filter((function(n) {
498
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
499
- }))), r.push.apply(r, t);
500
- }
501
- return r;
502
- }
503
- function ye(e) {
145
+ */ function b(e) {
146
+ var n = e.children, o = e.descriptionPosition, r = o === void 0 ? "bottom" : o, a = e.elementRef, l = e.label, u = f(e, [ "children", "descriptionPosition", "elementRef", "label" ]);
147
+ // @docs-props-type OptionPropsBase
148
+
149
+ return t().createElement(i.Option, d({
150
+ descriptionPosition: r,
151
+ label: l
152
+ }, u, {
153
+ elementRef: a,
154
+ multiple: false
155
+ }), n || l);
156
+ }
157
+ var g = (0, o.memo)(b);
158
+ // @ts-expect-error Need to set propTypes on OptionMemoized so that javascript propType validation will work
159
+ g.propTypes = v;
160
+ /* harmony default export */ const m = g;
161
+ // CONCATENATED MODULE: ./src/utils/useDeprecate.tsx
162
+ var O = "is deprecated and will be removed in the next major version.";
163
+ var y = function e(n) {
164
+ var o = n.additionalMessage, t = o === void 0 ? "" : o, r = n.componentName;
165
+ useEffect((function() {
166
+ if (false) {}
167
+ }), [ t, r ]);
168
+ };
169
+ var h = function e(n) {
170
+ var o = n.additionalMessage, t = o === void 0 ? "" : o, r = n.componentName, a = n.propName, i = n.propValue;
171
+ useEffect((function() {
172
+ if (false) {}
173
+ }), [ t, r, a, i ]);
174
+ };
175
+ var P = function e(n) {
176
+ var t = n.additionalMessage, r = t === void 0 ? "" : t, a = n.componentName, i = n.deprecatedPropValue, l = n.propName, u = n.propValue;
177
+ (0, o.useEffect)((function() {
178
+ if (false) {}
179
+ }), [ r, a, l, u, i ]);
180
+ };
181
+ // CONCATENATED MODULE: ./src/Select/Select.tsx
182
+ function M() {
183
+ return M = Object.assign ? Object.assign.bind() : function(e) {
504
184
  for (var n = 1; n < arguments.length; n++) {
505
- var r = null != arguments[n] ? arguments[n] : {};
506
- n % 2 ? me(Object(r), !0).forEach((function(n) {
507
- ge(e, n, r[n]);
508
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : me(Object(r)).forEach((function(n) {
509
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
510
- }));
511
- }
512
- return e;
513
- }
514
- function ge(e, n, r) {
515
- return (n = he(n)) in e ? Object.defineProperty(e, n, {
516
- value: r,
517
- enumerable: !0,
518
- configurable: !0,
519
- writable: !0
520
- }) : e[n] = r, e;
521
- }
522
- function he(e) {
523
- var n = Oe(e, "string");
524
- return "symbol" == de(n) ? n : n + "";
525
- }
526
- function Oe(e, n) {
527
- if ("object" != de(e) || !e) return e;
528
- var r = e[Symbol.toPrimitive];
529
- if (void 0 !== r) {
530
- var t = r.call(e, n || "default");
531
- if ("object" != de(t)) return t;
532
- throw new TypeError("@@toPrimitive must return a primitive value.");
533
- }
534
- return ("string" === n ? String : Number)(e);
535
- }
536
- var Se = ye(ye({}, S.propTypes), {}, {
537
- totalCount: o().number,
538
- // unlike OptionBase, there's a default value for this prop
539
- value: o().string
540
- });
541
- function Ce(e) {
542
- var r = e.active, t = e.elementRef, l = e.id, o = e.label, a = e.onClick, i = e.selected, u = e.totalCount, c = e.value, s = c === void 0 ? "selectAll" : c, f = ve(e, [ "active", "elementRef", "id", "label", "onClick", "selected", "totalCount", "value" ]);
543
- // @docs-props-type SelectAllOptionPropsBase
544
- // When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
545
- var d = u != null ? " (".concat(u === null || u === void 0 ? void 0 : u.toString(), ")") : "";
546
-
547
- return n().createElement(S, pe({
548
- active: r,
549
- elementRef: t,
550
- "aria-keyshortcuts": "Control+A",
551
- "data-test": "select-all",
552
- description: "".concat(d, " Ctrl-a"),
553
- descriptionPosition: "right",
554
- id: l,
555
- key: "selectAll",
556
- multiple: true,
557
- label: o,
558
- onClick: a,
559
- selected: i,
560
- role: "menuitemcheckbox",
561
- value: s
562
- }, f));
563
- }
564
- Ce.propTypes = Se;
565
- /* harmony default export */ const we = Ce;
566
- // CONCATENATED MODULE: external "styled-components"
567
- const ke = require("styled-components");
568
- var xe = r.n(ke);
569
- // CONCATENATED MODULE: external "@splunk/react-ui/Button"
570
- const je = require("@splunk/react-ui/Button");
571
- var Pe = r.n(je);
572
- // CONCATENATED MODULE: external "@splunk/react-ui/Divider"
573
- const Ee = require("@splunk/react-ui/Divider");
574
- var Re = r.n(Ee);
575
- // CONCATENATED MODULE: external "@splunk/themes"
576
- const Me = require("@splunk/themes");
577
- // CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
578
- var Ae = xe()(Pe()).withConfig({
579
- displayName: "SelectBaseStyles__StyledButton",
580
- componentId: "sc-16cj7sk-0"
581
- })([ "&[data-inline]{width:", ";}", "" ], (function(e) {
582
- var n = e.$multiple;
583
- return n ? "400px" : "auto";
584
- }), (function(e) {
585
- var n = e.$multiple;
586
- return !n && "flex-grow: 0;";
587
- }));
588
- var Te = xe().span.withConfig({
589
- displayName: "SelectBaseStyles__StyledLinkIcon",
590
- componentId: "sc-16cj7sk-1"
591
- })([ "padding-right:", ";" ], Me.variables.spacingXSmall);
592
- var Ie = xe().span.withConfig({
593
- displayName: "SelectBaseStyles__StyledLinkCaret",
594
- componentId: "sc-16cj7sk-2"
595
- })([ "padding-left:", ";" ], Me.variables.spacingXSmall);
596
- var qe = xe().div.withConfig({
597
- displayName: "SelectBaseStyles__StyledFilter",
598
- componentId: "sc-16cj7sk-3"
599
- })([ "padding:", " ", " ", ";min-width:160px;" ], Me.variables.spacingLarge, Me.variables.spacingLarge, Me.variables.spacingSmall);
600
- var Le = xe().span.withConfig({
601
- displayName: "SelectBaseStyles__StyledCount",
602
- componentId: "sc-16cj7sk-4"
603
- })([ "padding-right:", ";" ], Me.variables.spacingXSmall);
604
- var De = xe()(ee()).withConfig({
605
- displayName: "SelectBaseStyles__StyledControlsLink",
606
- componentId: "sc-16cj7sk-5"
607
- })([ "", ";" ], (function(e) {
608
- var n = e.$disabled;
609
- return n && (0, ke.css)([ "color:", ";" ], Me.variables.contentColorDisabled);
610
- }));
611
- var Ne = xe().div.withConfig({
612
- displayName: "SelectBaseStyles__StyledToggleAllControls",
613
- componentId: "sc-16cj7sk-6"
614
- })([ "", ";gap:", ";padding:", " ", " ", ";" ], Me.mixins.reset("flex"), Me.variables.spacingMedium, Me.variables.spacingXSmall, Me.variables.spacingLarge, Me.variables.spacingSmall);
615
- var _e = xe()(Re()).withConfig({
616
- displayName: "SelectBaseStyles__StyledControlsDivider",
617
- componentId: "sc-16cj7sk-7"
618
- })([ "border-color:", ";" ], Me.variables.borderColor);
619
- // EXTERNAL MODULE: ./src/useControlled/index.ts + 2 modules
620
- var Be = r(3639);
621
- // CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
622
- // A utility for matching keyboard characters to list values
623
- var Ve = function e(n, r) {
624
- return n ? n.label.charAt(r).toLowerCase() : "";
625
- };
626
- var Ke = function e(n, r) {
627
- if (!n.length) {
628
- return n;
629
- }
630
- var t = null;
631
- var l = false;
632
- var o = n.filter((function(e) {
633
- var n = Ve(e, r.index);
634
- if (n === r.value) {
635
- l = true;
636
- return true;
185
+ var o = arguments[n];
186
+ for (var t in o) {
187
+ ({}).hasOwnProperty.call(o, t) && (e[t] = o[t]);
637
188
  }
638
- // If we haven't found a match yet, keep track of the next closest match.
639
- // Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
640
- if (!l) {
641
- var o = Ve(t, r.index);
642
- if (!o) {
643
- t = e;
644
- } else if (n > r.value) {
645
- if (o < r.value) {
646
- t = e;
647
- } else if (o > n) {
648
- t = e;
649
- }
650
- } else if (n > o) {
651
- t = e;
652
- }
653
- }
654
- return false;
655
- }));
656
- return o.length === 0 && t ? [ t ] : o;
657
- };
658
- // CONCATENATED MODULE: ./src/utils/ssrDocument.ts
659
- /* eslint-disable @typescript-eslint/no-empty-function */
660
- var Fe = {
661
- body: {
662
- appendChild: function e() {
663
- return [];
664
- }
665
- },
666
- addEventListener: function e() {},
667
- removeEventListener: function e() {},
668
- activeElement: {
669
- blur: function e() {},
670
- nodeName: ""
671
- },
672
- querySelector: function e() {
673
- return null;
674
- },
675
- querySelectorAll: function e() {
676
- return [];
677
- },
678
- getElementById: function e() {
679
- return null;
680
- },
681
- createEvent: function e() {
682
- return {
683
- initEvent: function e() {}
684
- };
685
- },
686
- createElement: function e() {
687
- return {
688
- children: [],
689
- childNodes: [],
690
- style: {},
691
- setAttribute: function e() {},
692
- getElementsByTagName: function e() {
693
- return [];
694
- }
695
- };
696
- },
697
- createElementNS: function e() {
698
- return {};
699
- },
700
- importNode: function e() {
701
- return null;
702
- },
703
- location: {
704
- hash: "",
705
- host: "",
706
- hostname: "",
707
- href: "",
708
- origin: "",
709
- pathname: "",
710
- protocol: "",
711
- search: ""
712
189
  }
713
- };
714
- function He() {
715
- var e = typeof document !== "undefined" ? document : Fe;
716
190
  return e;
717
- }
718
- var ze = He();
719
- /* harmony default export */ const We = /* unused pure expression or super */ null && ze;
720
- // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
721
- /* eslint-disable @typescript-eslint/no-empty-function */
722
- var $e = {
723
- document: Fe,
724
- navigator: {
725
- userAgent: ""
726
- },
727
- location: {
728
- hash: "",
729
- host: "",
730
- hostname: "",
731
- href: "",
732
- origin: "",
733
- pathname: "",
734
- protocol: "",
735
- search: ""
736
- },
737
- history: {
738
- replaceState: function e() {},
739
- pushState: function e() {},
740
- go: function e() {},
741
- back: function e() {}
742
- },
743
- CustomEvent: function e() {
744
- return this;
745
- },
746
- addEventListener: function e() {},
747
- removeEventListener: function e() {},
748
- getComputedStyle: function e() {
749
- return {
750
- getPropertyValue: function e() {
751
- return "";
752
- }
753
- };
754
- },
755
- Image: function e() {},
756
- Date: function e() {},
757
- screen: {},
758
- setTimeout: function e() {},
759
- clearTimeout: function e() {},
760
- matchMedia: function e() {
761
- return {};
762
- },
763
- requestAnimationFrame: function e(n) {
764
- if (typeof setTimeout === "undefined") {
765
- n();
766
- return null;
767
- }
768
- return setTimeout(n, 0);
769
- },
770
- cancelAnimationFrame: function e(n) {
771
- if (typeof setTimeout === "undefined") {
772
- return;
773
- }
774
- clearTimeout(n);
775
- }
776
- };
777
- function Xe() {
778
- var e = typeof window !== "undefined" ? window : $e;
779
- return e;
780
- }
781
- var Ue = Xe();
782
- /* harmony default export */ const Je = /* unused pure expression or super */ null && Ue;
783
- // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
784
- /**
785
- * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
786
- *
787
- * @param ref - The React callback or object ref. Can be `null` or `undefined`.
788
- * @param current - The new value of the ref.
789
- */
790
- function Ge(e, n) {
791
- if (e) {
792
- if (typeof e === "function") {
793
- e(n);
794
- } else {
795
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
796
- // the intention here is to signal "we will take care of setting 'current', not you".
797
- e.current = n;
798
- // eslint-disable-line no-param-reassign
799
- }
800
- }
801
- }
802
- // CONCATENATED MODULE: ./src/Select/SelectBase.tsx
803
- function Qe(e) {
804
- return en(e) || Ze(e) || ln(e) || Ye();
805
- }
806
- function Ye() {
807
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
808
- }
809
- function Ze(e) {
810
- if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
811
- }
812
- function en(e) {
813
- if (Array.isArray(e)) return on(e);
814
- }
815
- function nn() {
816
- return nn = Object.assign ? Object.assign.bind() : function(e) {
817
- for (var n = 1; n < arguments.length; n++) {
818
- var r = arguments[n];
819
- for (var t in r) {
820
- ({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
821
- }
822
- }
823
- return e;
824
- }, nn.apply(null, arguments);
825
- }
826
- function rn(e, n) {
827
- return un(e) || an(e, n) || ln(e, n) || tn();
828
- }
829
- function tn() {
830
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
831
- }
832
- function ln(e, n) {
833
- if (e) {
834
- if ("string" == typeof e) return on(e, n);
835
- var r = {}.toString.call(e).slice(8, -1);
836
- return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? on(e, n) : void 0;
837
- }
838
- }
839
- function on(e, n) {
840
- (null == n || n > e.length) && (n = e.length);
841
- for (var r = 0, t = Array(n); r < n; r++) {
842
- t[r] = e[r];
843
- }
844
- return t;
845
- }
846
- function an(e, n) {
847
- var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
848
- if (null != r) {
849
- var t, l, o, a, i = [], u = !0, c = !1;
850
- try {
851
- if (o = (r = r.call(e)).next, 0 === n) {
852
- if (Object(r) !== r) return;
853
- u = !1;
854
- } else for (;!(u = (t = o.call(r)).done) && (i.push(t.value), i.length !== n); u = !0) {
855
- }
856
- } catch (e) {
857
- c = !0, l = e;
858
- } finally {
859
- try {
860
- if (!u && null != r["return"] && (a = r["return"](), Object(a) !== a)) return;
861
- } finally {
862
- if (c) throw l;
863
- }
864
- }
865
- return i;
866
- }
867
- }
868
- function un(e) {
869
- if (Array.isArray(e)) return e;
870
- }
871
- function cn(e, n) {
872
- if (null == e) return {};
873
- var r, t, l = sn(e, n);
874
- if (Object.getOwnPropertySymbols) {
875
- var o = Object.getOwnPropertySymbols(e);
876
- for (t = 0; t < o.length; t++) {
877
- r = o[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (l[r] = e[r]);
878
- }
879
- }
880
- return l;
881
- }
882
- function sn(e, n) {
883
- if (null == e) return {};
884
- var r = {};
885
- for (var t in e) {
886
- if ({}.hasOwnProperty.call(e, t)) {
887
- if (-1 !== n.indexOf(t)) continue;
888
- r[t] = e[t];
889
- }
890
- }
891
- return r;
892
- }
893
- function fn(e) {
894
- "@babel/helpers - typeof";
895
- return fn = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
896
- return typeof e;
897
- } : function(e) {
898
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
899
- }, fn(e);
900
- }
901
- function dn(e, n) {
902
- var r = Object.keys(e);
903
- if (Object.getOwnPropertySymbols) {
904
- var t = Object.getOwnPropertySymbols(e);
905
- n && (t = t.filter((function(n) {
906
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
907
- }))), r.push.apply(r, t);
908
- }
909
- return r;
910
- }
911
- function pn(e) {
912
- for (var n = 1; n < arguments.length; n++) {
913
- var r = null != arguments[n] ? arguments[n] : {};
914
- n % 2 ? dn(Object(r), !0).forEach((function(n) {
915
- vn(e, n, r[n]);
916
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : dn(Object(r)).forEach((function(n) {
917
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
918
- }));
919
- }
920
- return e;
921
- }
922
- function vn(e, n, r) {
923
- return (n = bn(n)) in e ? Object.defineProperty(e, n, {
924
- value: r,
925
- enumerable: !0,
926
- configurable: !0,
927
- writable: !0
928
- }) : e[n] = r, e;
929
- }
930
- function bn(e) {
931
- var n = mn(e, "string");
932
- return "symbol" == fn(n) ? n : n + "";
933
- }
934
- function mn(e, n) {
935
- if ("object" != fn(e) || !e) return e;
936
- var r = e[Symbol.toPrimitive];
937
- if (void 0 !== r) {
938
- var t = r.call(e, n || "default");
939
- if ("object" != fn(t)) return t;
940
- throw new TypeError("@@toPrimitive must return a primitive value.");
941
- }
942
- return ("string" === n ? String : Number)(e);
943
- }
944
- var yn = {
945
- allowKeyMatching: o().bool,
946
- allowNewValues: o().bool,
947
- animateLoading: o().bool,
948
- appearance: o().oneOf([ "default", "link", "subtle" ]),
949
- append: o().bool,
950
- children: o().node,
951
- defaultPlacement: o().oneOf([ "above", "below", "vertical" ]),
952
- defaultValues: o().array,
953
- describedBy: o().string,
954
- disabled: o().bool,
955
- elementRef: o().oneOfType([ o().func, o().object ]),
956
- error: o().bool,
957
- filter: o().oneOf([ false, true, "controlled" ]),
958
- footerMessage: o().node,
959
- inline: o().bool,
960
- inputId: o().string,
961
- inputRef: o().oneOfType([ o().func, o().object ]),
962
- isLoadingOptions: o().bool,
963
- labelledBy: o().string,
964
- labelText: o().string,
965
- loadingMessage: o().node,
966
- menuStyle: o().object,
967
- multiple: o().bool,
968
- name: o().string,
969
- noOptionsMessage: o().node,
970
- onChange: o().func,
971
- onClick: o().func,
972
- onClose: o().func,
973
- onFilterChange: o().func,
974
- onOpen: o().func,
975
- onScroll: o().func,
976
- onScrollBottom: o().func,
977
- /** @private. */
978
- required: o().bool,
979
- placeholder: o().string,
980
- prefixLabel: o().string,
981
- prepend: o().bool,
982
- repositionMode: o().oneOf([ "none", "flip" ]),
983
- selectAllAppearance: o().oneOf([ "buttongroup", "checkbox", "none" ]),
984
- showSelectedValuesFirst: o().oneOf([ "nextOpen", "immediately", "never" ]),
985
- suffixLabel: o().string,
986
- tabConfirmsNewValue: o().bool,
987
- toggle: o().node,
988
- toggleContent: o().oneOf([ "optionChildren", "optionLabel" ]),
989
- values: o().array,
990
- /** @private. */
991
- virtualization: o().number
992
- };
993
- var gn = V()((function(e) {
994
- return [ e ];
995
- }));
996
- // preserve separate widths for single vs. multi mode
997
- var hn = V()((function(e) {
998
- var n = e.anchorWidth, r = e.isMultiple, t = e.maxHeight, l = e.menuStyle;
999
- return r ? pn({
1000
- width: Math.max(n !== null && n !== void 0 ? n : 0, 200),
1001
- maxHeight: t
1002
- }, l) : pn({
1003
- minWidth: n !== null && n !== void 0 ? n : undefined,
1004
- maxWidth: Math.max(n !== null && n !== void 0 ? n : 0, 300),
1005
- maxHeight: t
1006
- }, l);
1007
- }));
1008
- var On = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
1009
- function Sn(e) {
1010
- return e && D()(e.props, "value");
1011
- }
1012
- function Cn(e, n) {
1013
- return "".concat(fn(e), "-").concat(e, "-").concat(n);
1014
- }
1015
- var wn = [ "append", "error", "prepend" ];
1016
- var kn = (0, u._)("No matches");
1017
- var xn = (0, u._)("Select...");
1018
- var jn = n().createElement(G(), null);
1019
- var Pn = function e(r) {
1020
- var t = r.activeItemId, l = r.filterA11yId, o = r.filterKeyword, a = r.hasChildren, i = r.inputId, c = r.inputRef, s = r.menuListboxId, f = r.multiple, d = r.onClearAll, p = r.onSelectAll, v = r.onTextBlur, b = r.onTextChange, m = r.onTextFocus, y = r.onTextKeyDown, g = r.optionSelection, h = r.placement, O = r.selectAllAppearance, S = r.textHasFocus;
1021
- var C = (0, u._)("Select all options".concat(g.current === "all" ? " disabled" : ""));
1022
- var w = (0, u._)("Clear all options".concat(g.current === "none" ? " disabled" : ""));
1023
- // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
1024
- var k = n().createElement(Ne, {
1025
- key: "selectAll"
1026
- }, n().createElement(De, {
1027
- disabled: g.current === "all",
1028
- appearance: "standalone",
1029
- "aria-label": C,
1030
- onClick: p,
1031
- "data-test": "select-all",
1032
- tag: "button"
1033
- }, o ? (0, u._)("Select all Matches") : (0, u._)("Select all")), n().createElement(De, {
1034
- disabled: g.current === "none",
1035
- appearance: "standalone",
1036
- "aria-label": w,
1037
- onClick: d,
1038
- "data-test": "clear-all",
1039
- tag: "button"
1040
- }, o ? (0, u._)("Clear all Matches") : (0, u._)("Clear all")));
1041
-
1042
- return n().createElement("div", {
1043
- key: "controls"
1044
- }, l && n().createElement(le(), {
1045
- id: l
1046
- }, (0, u._)("Type to filter")), h === "above" && n().createElement(_e, null), n().createElement(qe, {
1047
- key: "filter",
1048
- "data-test": "filter"
1049
- }, n().createElement(ae(), {
1050
- value: o,
1051
- autoCapitalize: "off",
1052
- autoComplete: "off",
1053
- autoCorrect: "off",
1054
- spellCheck: false,
1055
- onChange: b,
1056
- onKeyDown: y,
1057
- onFocus: m,
1058
- onBlur: v,
1059
- placeholder: (0, u._)("filter"),
1060
- role: "combobox",
1061
- "aria-expanded": "true",
1062
- "aria-controls": s,
1063
- "aria-owns": S && a ? t : undefined,
1064
- "aria-label": (0, u._)("Filter"),
1065
- "aria-autocomplete": "list",
1066
- "aria-activedescendant": S && a ? t : undefined,
1067
- inputRef: c,
1068
- inputId: i,
1069
- canClear: true,
1070
- startAdornment: jn
1071
- })), f && a && O === "buttongroup" && k, h === "below" && n().createElement(_e, null));
1072
- };
1073
- var En = function e(n) {
1074
- var r = n.prefixLabel, t = n.label, l = n.suffixLabel;
1075
- var o = t;
1076
- if (r) {
1077
- o = [ "".concat(r, ": ") ].concat(o);
1078
- }
1079
- if (l) {
1080
- o = M()(o).concat(" ".concat(l));
1081
- }
1082
- return o;
1083
- };
1084
- var Rn = n().forwardRef((function(r, t) {
1085
- var l = r.appearance, o = l === void 0 ? "default" : l, a = r.append, i = r.children, c = r.currentValues, s = c === void 0 ? [] : c, f = r.describedBy, d = r.disabled, p = r.elementRef, v = r.error, b = r.inline, m = r.labelText, y = r.labelledBy, g = r.multiple, h = r.onClick, O = r.placeholder, S = r.prefixLabel, C = r.prepend, w = r.required, k = r.suffixLabel, x = r.toggle, j = r.toggleContent, P = cn(r, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent" ]);
1086
- var E;
1087
- var R;
1088
- var M = [];
1089
- // Generate buttonLabels
1090
- var A = e.Children.toArray(i);
1091
- var I = s.reduce((function(e, n, r, t) {
1092
- var l = T()(A, (function(e) {
1093
- return Sn(e) && e.props.value === n;
1094
- }));
1095
- if (l) {
1096
- var o = l.props, a = o.children, i = o.icon, c = o.label;
1097
- var f = j !== "optionLabel" && a ? a : c;
1098
- e.push(f);
1099
- M.push(c);
1100
- // if not in multiple mode, add the icon
1101
- if (!g && s.length === 1) {
1102
- E = i;
1103
- }
1104
- } else if (g) {
1105
- // only add values that don't match an option in "multiple" mode to preserve old behaviour
1106
- e.push(n);
1107
- M.push(n.toString());
1108
- }
1109
- if (r < t.length - 1) {
1110
- e.push((0, u._)(", "));
1111
- M.push((0, u._)(", "));
1112
- }
1113
- return e;
1114
- }), []);
1115
- R = I;
1116
- // only apply prefix / suffix if the label is not empty
1117
- if (R.length > 0) {
1118
- // If there's more than one item selected, read out the selected total
1119
- // rather than reading out each selected item
1120
- M = En({
1121
- prefixLabel: S,
1122
- label: R.length > 1 ? [ "".concat(s.length, " items selected") ] : M,
1123
- suffixLabel: k
1124
- });
1125
- R = En({
1126
- prefixLabel: S,
1127
- label: R,
1128
- suffixLabel: k
1129
- });
1130
- }
1131
- // single <Select> behaviour is to show the placeholder if all parts of the label
1132
- // are empty strings so we replicate this behaviour here
1133
- if (R.length === 0 || !g && R.every((function(e) {
1134
- return e === "";
1135
- }))) {
1136
- R = gn(O);
1137
- M = R;
1138
- }
1139
- var q = Object.keys(P).includes("aria-labelledby");
1140
- var L = pn({
1141
- "aria-describedby": f,
1142
- "aria-label": y || q ? undefined : "".concat(m ? "".concat(m, ", ") : "").concat(M.join("")),
1143
- // aria-labelledby takes precedence over aria-label, so existence of both is redundant
1144
- "aria-labelledby": y,
1145
- "aria-required": w,
1146
- "data-select-appearance": o,
1147
- append: a,
1148
- prepend: C,
1149
- onClick: h,
1150
- role: "combobox",
1151
- disabled: d ? "disabled" : undefined,
1152
- elementRef: p,
1153
- error: v,
1154
- ref: t
1155
- }, P);
1156
- if (g) {
1157
- L["data-test-values"] = JSON.stringify(s);
1158
- } else {
1159
- var D = rn(s, 1), N = D[0];
1160
- L["data-test-value"] = N;
1161
- }
1162
- if (x) {
1163
-
1164
- return (0, e.cloneElement)(x, L);
1165
- }
1166
- if (o === "link") {
1167
-
1168
- return n().createElement(ee(), nn({
1169
- tag: "button",
1170
- appearance: "standalone"
1171
- }, L, {
1172
- "data-select-appearance": "link"
1173
- }), !!E && n().createElement(Te, null, E), R || O, n().createElement(Ie, null, n().createElement(U(), null)));
1174
- }
1175
- // Using Button's secondary appearance as Select's default appearance.
1176
- var _ = o === "default" ? "secondary" : o;
1177
-
1178
- return n().createElement(Ae, nn({}, L, {
1179
- $multiple: g,
1180
- appearance: _,
1181
- label: R,
1182
- error: v,
1183
- icon: E,
1184
- inline: b,
1185
- isMenu: true,
1186
- onClick: h
1187
- }, F()(P, wn)), !!s.length && g && n().createElement(Le, {
1188
- "data-role": "count"
1189
- }, "(", s.length, ")"));
1190
- }));
1191
- function Mn(r) {
1192
- var t = r.allowKeyMatching, l = t === void 0 ? true : t, o = r.animateLoading, a = r.appearance, i = a === void 0 ? "default" : a, s = r.append, f = r.allowNewValues, d = r.children, p = r.defaultPlacement, v = p === void 0 ? "vertical" : p, b = r.defaultValues, m = r.describedBy, y = r.disabled, g = r.elementRef, h = r.error, O = r.filter, C = r.footerMessage, w = r.inline, k = r.inputId, x = r.inputRef, j = r.isLoadingOptions, P = r.labelledBy, E = r.labelText, R = r.loadingMessage, M = r.menuStyle, A = M === void 0 ? {} : M, I = r.multiple, L = r.name, D = r.noOptionsMessage, N = D === void 0 ? kn : D, B = r.onChange, V = r.onScroll, K = r.onScrollBottom, F = r.onFilterChange, H = r.onClick, W = r.onClose, X = r.onOpen, U = r.required, J = r.placeholder, G = J === void 0 ? xn : J, Q = r.prefixLabel, Z = r.prepend, ee = r.repositionMode, te = ee === void 0 ? "flip" : ee, le = r.selectAllAppearance, oe = le === void 0 ? "buttongroup" : le, ae = r.showSelectedValuesFirst, ie = r.suffixLabel, de = r.tabConfirmsNewValue, pe = r.values, ve = r.virtualization, be = r.toggle, me = r.toggleContent, ye = me === void 0 ? "optionChildren" : me, ge = cn(r, [ "allowKeyMatching", "animateLoading", "appearance", "append", "allowNewValues", "children", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "labelText", "loadingMessage", "menuStyle", "multiple", "name", "noOptionsMessage", "onChange", "onScroll", "onScrollBottom", "onFilterChange", "onClick", "onClose", "onOpen", "required", "placeholder", "prefixLabel", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "suffixLabel", "tabConfirmsNewValue", "values", "virtualization", "toggle", "toggleContent" ]);
1193
- // @docs-props-type SelectBasePropsBase
1194
- var he = (0, Be["default"])({
1195
- componentName: "SelectBase",
1196
- /* eslint-disable-next-line prefer-rest-params */
1197
- componentProps: arguments[0],
1198
- // see SUI-7028
1199
- defaultValuePropName: "defaultValues",
1200
- valuePropName: "values"
1201
- });
1202
- // states
1203
- var Oe = (0, e.useState)((function() {
1204
- return {
1205
- activeItemId: (0, se.createDOMID)("active-item"),
1206
- menuListboxId: (0, se.createDOMID)("menu-listbox")
1207
- };
1208
- })), Se = rn(Oe, 1), Ce = Se[0], ke = Ce.activeItemId, xe = Ce.menuListboxId;
1209
- var je = (0, e.useState)(0), Pe = rn(je, 2), Ee = Pe[0], Re = Pe[1];
1210
- var Me = (0, e.useState)(""), Ae = rn(Me, 2), Te = Ae[0], Ie = Ae[1];
1211
- var qe = (0, e.useState)(false), Le = rn(qe, 2), De = Le[0], Ne = Le[1];
1212
- var _e = (0, e.useState)(false), Ve = rn(_e, 2), Fe = Ve[0], He = Ve[1];
1213
- var ze = (0, e.useState)([]), We = rn(ze, 2), $e = We[0], Ue = We[1];
1214
- var Je = (0, e.useState)(b || []), Ye = rn(Je, 2), Ze = Ye[0], en = Ye[1];
1215
- // previous state
1216
- var tn = ue()(Ee);
1217
- // refs
1218
- var ln = (0, e.useRef)(null);
1219
- var on = (0, e.useRef)(null);
1220
- var an = (0, e.useRef)(null);
1221
- var un = (0, e.useRef)([]);
1222
- var sn = (0, e.useRef)([]);
1223
- var fn = (0, e.useRef)(tn);
1224
- var dn = (0, e.useRef)();
1225
- var pn = (0, e.useRef)({});
1226
- var vn = (0, e.useRef)(0);
1227
- var bn = (0, e.useRef)([]);
1228
- var mn = (0, e.useRef)(null);
1229
- var yn = (0, e.useRef)();
1230
- var gn = (0, e.useRef)(0);
1231
- var wn = (0, e.useRef)("none");
1232
- var jn = (0, e.useState)(O ? (0, se.createDOMID)("filter") : undefined), En = rn(jn, 1), Mn = En[0];
1233
- (0, e.useEffect)((function() {
1234
- if (false) {}
1235
- }), [ i, s, h, Z ]);
1236
- var An = (0, e.useCallback)((function() {
1237
- var e = he ? pe : Ze;
1238
- return I || e == null ? e : e.slice(0, 1);
1239
- }), [ he, I, pe, Ze ]);
1240
- var Tn = (0, e.useCallback)((function() {
1241
- var e;
1242
- // in non-multiple mode, don't move values to the top of the list
1243
- return I && ae !== "never" ? (e = An()) !== null && e !== void 0 ? e : [] : [];
1244
- }), [ An, I, ae ]);
1245
- var In = (0, e.useCallback)((function(e) {
1246
- var n = Te;
1247
- Ne(true);
1248
- Ue(Tn());
1249
- // SUI-3234: preserve existing behavior difference between <Select> and <Multiselect.Compact>
1250
- if (I) {
1251
- Ie("");
1252
- }
1253
- if (n !== Te) {
1254
- F === null || F === void 0 ? void 0 : F(e, {
1255
- keyword: Te
1256
- });
1257
- }
1258
- }), [ Te, Tn, I, F ]);
1259
- (0, e.useEffect)((function() {
1260
- if (De) {
1261
- X === null || X === void 0 ? void 0 : X();
1262
- if (mn.current && !O) {
1263
- mn.current.focus();
1264
- } else {
1265
- var e;
1266
- Re((e = yn.current) !== null && e !== void 0 ? e : 0);
1267
- }
1268
- }
1269
- }), [ X, De, $e, Te, O ]);
1270
- var qn = (0, e.useCallback)((function() {
1271
- Ne(false);
1272
- Re(0);
1273
- fn.current = null;
1274
- W === null || W === void 0 ? void 0 : W();
1275
- }), [ W ]);
1276
- var Ln = (0, e.useCallback)((function(e, n) {
1277
- var r;
1278
- var t = (r = An()) !== null && r !== void 0 ? r : [];
1279
- var l = t.indexOf(n);
1280
- var o;
1281
- if (I) {
1282
- if (l >= 0) {
1283
- o = [].concat(Qe(t.slice(0, l)), Qe(t.slice(l + 1)));
1284
- } else {
1285
- o = t.concat([ n ]);
1286
- }
1287
- } else {
1288
- // non-multiple mode must always have a value
1289
- o = [ n ];
1290
- }
1291
- var a = !he;
1292
- if (a) {
1293
- en(o);
1294
- }
1295
- if (I) {
1296
- // in uncontrolled multiple mode, keep the menu open
1297
- if (a) {
1298
- Ne(true);
1299
- }
1300
- } else {
1301
- var i;
1302
- // non-multiple mode only supports a single selection
1303
- // so close the menu once a selection is made
1304
- qn({
1305
- reason: "contentClick"
1306
- });
1307
- (i = ln.current) === null || i === void 0 ? void 0 : i.focus();
1308
- }
1309
- B === null || B === void 0 ? void 0 : B(e, {
1310
- values: o,
1311
- name: L,
1312
- reason: "valueToggle"
191
+ }, M.apply(null, arguments);
192
+ }
193
+ function j(e, n) {
194
+ if (null == e) return {};
195
+ var o, t, r = S(e, n);
196
+ if (Object.getOwnPropertySymbols) {
197
+ var a = Object.getOwnPropertySymbols(e);
198
+ for (t = 0; t < a.length; t++) {
199
+ o = a[t], -1 === n.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (r[o] = e[o]);
200
+ }
201
+ }
202
+ return r;
203
+ }
204
+ function S(e, n) {
205
+ if (null == e) return {};
206
+ var o = {};
207
+ for (var t in e) {
208
+ if ({}.hasOwnProperty.call(e, t)) {
209
+ if (-1 !== n.indexOf(t)) continue;
210
+ o[t] = e[t];
211
+ }
212
+ }
213
+ return o;
214
+ }
215
+ /** @public */
216
+ /** @public */
217
+ /** @public */ var w = {
218
+ allowKeyMatching: a().bool,
219
+ animateLoading: a().bool,
220
+ appearance: a().oneOf([ "default", "link", "subtle" ]),
221
+ append: a().bool,
222
+ children: a().node,
223
+ defaultPlacement: a().oneOf([ "above", "below", "vertical" ]),
224
+ defaultValue: a().oneOfType([ a().string, a().number, a().bool ]),
225
+ describedBy: a().string,
226
+ disabled: a().bool,
227
+ elementRef: a().oneOfType([ a().func, a().object ]),
228
+ error: a().bool,
229
+ filter: a().oneOf([ false, true, "controlled" ]),
230
+ footerMessage: a().node,
231
+ inline: a().bool,
232
+ inputId: a().string,
233
+ inputRef: a().oneOfType([ a().func, a().object ]),
234
+ isLoadingOptions: a().bool,
235
+ labelledBy: a().string,
236
+ labelText: a().string,
237
+ loadingMessage: a().node,
238
+ menuStyle: a().object,
239
+ name: a().string,
240
+ noOptionsMessage: a().node,
241
+ onChange: a().func,
242
+ onClose: a().func,
243
+ onFilterChange: a().func,
244
+ onOpen: a().func,
245
+ onScroll: a().func,
246
+ onScrollBottom: a().func,
247
+ placeholder: a().string,
248
+ prefixLabel: a().string,
249
+ prepend: a().bool,
250
+ repositionMode: a().oneOf([ "none", "flip" ]),
251
+ suffixLabel: a().string,
252
+ toggleContent: a().oneOf([ "optionChildren", "optionLabel" ]),
253
+ /** @private. */
254
+ toggle: a().node,
255
+ value: a().oneOfType([ a().string, a().number, a().bool ]),
256
+ /** @private. */
257
+ virtualization: a().number
258
+ };
259
+ var C = (0, s._)("No matches");
260
+ var R = (0, s._)("Select...");
261
+ function T(e) {
262
+ var n = e.allowKeyMatching, r = n === void 0 ? true : n, a = e.appearance, i = a === void 0 ? "default" : a, u = e.defaultPlacement, s = u === void 0 ? "vertical" : u, d = e.defaultValue, f = e.inline, p = f === void 0 ? true : f, v = e.noOptionsMessage, b = v === void 0 ? C : v, g = e.onChange, m = e.placeholder, O = m === void 0 ? R : m, y = e.toggleContent, h = y === void 0 ? "optionChildren" : y, S = e.value, w = j(e, [ "allowKeyMatching", "appearance", "defaultPlacement", "defaultValue", "inline", "noOptionsMessage", "onChange", "placeholder", "toggleContent", "value" ]);
263
+ // @docs-props-type SelectPropsBase
264
+ P({
265
+ componentName: "Select",
266
+ deprecatedPropValue: "link",
267
+ propName: "appearance",
268
+ propValue: i
269
+ });
270
+ var T = c()({
271
+ componentName: "Select",
272
+ /* eslint-disable-next-line prefer-rest-params */
273
+ componentProps: arguments[0]
274
+ });
275
+ var x = (0, o.useMemo)((function() {
276
+ // wrap defaultValue in an array once to avoid failing <SelectBase>'s defaultValues comparison check
277
+ if (d != null) {
278
+ return [ d ];
279
+ }
280
+ return [];
281
+ }), [ d ]);
282
+ // Converts the provided props into a structure suitable for SelectBase.
283
+ var q = (0, o.useMemo)((function() {
284
+ var e = T ? undefined : x;
285
+ var n = function e(n, o) {
286
+ var t = o.name, r = o.values;
287
+ g === null || g === void 0 ? void 0 : g(n, {
288
+ name: t,
289
+ value: r[0]
1313
290
  });
1314
- }), [ An, qn, he, I, L, B ]);
1315
- var Dn = function e() {
1316
- on.current = null;
1317
- un.current = [];
1318
- if (an.current) {
1319
- clearTimeout(an.current);
1320
- }
1321
291
  };
1322
- var Nn = (0, e.useCallback)((function(e) {
1323
- var r;
1324
- // this doesn't make sense if we can't select multiple values
1325
- if (!I) {
1326
- return;
1327
- }
1328
- var t = (r = An()) !== null && r !== void 0 ? r : [];
1329
- var l = z()(t.concat(bn.current));
1330
- l = n().Children.toArray(d).filter((function(e) {
1331
- return Sn(e) && _()(l, e.props.value) && (!e.props.disabled || _()(t, e.props.value));
1332
- })).map((function(e) {
1333
- return e.props.value;
1334
- }));
1335
- if (!he) {
1336
- en(l);
1337
- }
1338
- B === null || B === void 0 ? void 0 : B(e, {
1339
- values: l,
1340
- name: L,
1341
- reason: "selectAll"
1342
- });
1343
- }), [ d, An, he, I, L, B ]);
1344
- var _n = (0, e.useCallback)((function(e) {
1345
- var r;
1346
- // this doesn't make sense if we can't select multiple values
1347
- if (!I) {
1348
- return;
1349
- }
1350
- var t = (r = An()) !== null && r !== void 0 ? r : [];
1351
- var l = $().apply(void 0, [ t ].concat(Qe(bn.current)));
1352
- // this will unselect all selected values unless those values are disabled or hidden by the filter
1353
- var o = n().Children.toArray(d).filter((function(e) {
1354
- return Sn(e) && (_()(t, e.props.value) && e.props.disabled || _()(l, e.props.value));
1355
- })).map((function(e) {
1356
- return e.props.value;
1357
- }));
1358
- if (!he) {
1359
- en(o);
1360
- }
1361
- B === null || B === void 0 ? void 0 : B(e, {
1362
- values: o,
1363
- name: L,
1364
- reason: "clearAll"
1365
- });
1366
- }), [ d, An, he, I, L, B ]);
1367
- var Bn = (0, e.useCallback)((function(e) {
1368
- if (De && !j) {
1369
- K === null || K === void 0 ? void 0 : K(e);
1370
- }
1371
- }), [ De, j, K ]);
1372
- var Vn = (0, e.useCallback)((function(n) {
1373
- var r = n.key;
1374
- if (r === "Tab") {
1375
- if (de && dn.current && vn.current <= 1) {
1376
- n.preventDefault();
1377
- Ln(n, dn.current);
1378
- }
1379
- }
1380
- if (n.shiftKey || n.metaKey || n.ctrlKey) {
1381
- if (r === "a" && (n.ctrlKey || n.metaKey)) {
1382
- // handle control + A
1383
- if (wn.current === "all") {
1384
- _n(n);
1385
- } else {
1386
- Nn(n);
1387
- }
1388
- }
1389
- return;
1390
- }
1391
- if (r === "ArrowDown") {
1392
- n.preventDefault();
1393
- Re(Math.min(Ee + 1, oe === "checkbox" ? vn.current : vn.current - 1));
1394
- if (d && K) {
1395
- var t;
1396
- var l = e.Children.toArray(d).length - (2 + ((t = An()) !== null && t !== void 0 ? t : []).length);
1397
- if (Ee === l) {
1398
- Bn(n);
1399
- }
1400
- }
1401
- }
1402
- if (r === "ArrowUp") {
1403
- n.preventDefault();
1404
- Re(Math.max(Ee - 1, 0));
1405
- }
1406
- if (r === "Enter" && dn.current && De) {
1407
- if (dn.current === "selectAll") {
1408
- if (wn.current === "all") {
1409
- _n(n);
1410
- } else {
1411
- Nn(n);
1412
- }
1413
- } else {
1414
- n.preventDefault();
1415
- Ln(n, dn.current);
1416
- }
1417
- }
1418
- }), [ Ee, d, An, _n, Bn, Nn, K, De, oe, de, Ln ]);
1419
- var Kn = (0, e.useCallback)((function(e, n) {
1420
- var r = n.value;
1421
- e.preventDefault();
1422
- if (!De) {
1423
- return;
1424
- }
1425
- Ln(e, r);
1426
- }), [ De, Ln ]);
1427
- var Fn = (0, e.useCallback)((function(e, n) {
1428
- var r = e.nativeEvent.key;
1429
- // Checking for a single character to avoid complications from double-byte languages and emojis.
1430
- if (r.length === 1) {
1431
- var t = [];
1432
- var l = {
1433
- index: 0,
1434
- value: r
1435
- };
1436
- if (!on.current) {
1437
- if (r === " ") {
1438
- Dn();
1439
- return;
1440
- }
1441
- t = Ke(sn.current, l);
1442
- } else if (un.current.length > 1) {
1443
- l.index = on.current.index + 1;
1444
- t = Ke(un.current, l);
1445
- }
1446
- if (t.length) {
1447
- var o;
1448
- var a = 0;
1449
- // If the active option is a first character match, cycle to the next matching option.
1450
- if (l.index === 0 && t.length > 1) {
1451
- var i = t.indexOf(sn.current[n]);
1452
- if (i >= 0) {
1453
- a = i === t.length - 1 ? 0 : i + 1;
1454
- }
1455
- }
1456
- var u = t[a];
1457
- var c = u.value, s = u.label;
1458
- var f = pn.current[Cn(c, s)];
1459
- f === null || f === void 0 ? void 0 : (o = f.focus) === null || o === void 0 ? void 0 : o.call(f);
1460
- }
1461
- un.current = t;
1462
- on.current = l;
1463
- if (an.current) {
1464
- clearTimeout(an.current);
1465
- }
1466
- an.current = setTimeout(Dn, 500);
1467
- e.preventDefault();
1468
- e.stopPropagation();
1469
- }
1470
- }), []);
1471
- var Hn = (0, e.useCallback)((function(e, n) {
1472
- var r = n.value;
1473
- Ie(r);
1474
- Ne(true);
1475
- Re(0);
1476
- F === null || F === void 0 ? void 0 : F(e, {
1477
- keyword: r
1478
- });
1479
- }), [ F ]);
1480
- var zn = (0, e.useCallback)((function() {
1481
- He(true);
1482
- }), []);
1483
- var Wn = (0, e.useCallback)((function() {
1484
- He(false);
1485
- }), []);
1486
- var $n = (0, e.useCallback)((function(e) {
1487
- if (fn.current !== Ee) {
1488
- (0, fe.scrollIntoViewIfNeeded)(e);
1489
- }
1490
- }), [ Ee ]);
1491
- var Xn = (0, e.useCallback)((function(e, n, r) {
1492
- if (r) {
1493
- mn.current = e;
1494
- }
1495
- if (e == null) {
1496
- delete pn.current[n];
1497
- } else {
1498
- pn.current[n] = e;
1499
- }
1500
- }), [ pn ]);
1501
- var Un = (0, e.useCallback)((function(e) {
1502
- ln.current = e;
1503
- Ge(g, e);
1504
- }), [ g, ln ]);
1505
- var Jn = (0, e.useMemo)((function() {
1506
- var e;
1507
- return (e = An()) !== null && e !== void 0 ? e : [];
1508
- }), [ An ]);
1509
- var Gn = e.Children.toArray(d);
1510
- var Qn = Jn.some((function(e) {
1511
- var n = T()(Gn, (function(n) {
1512
- return Sn(n) && n.props.value === e;
1513
- }));
1514
- return n && !n.props.disabled;
1515
- }));
1516
- var Yn = ae === "immediately" ? Tn() : $e;
1517
- var Zn = (0, e.useMemo)((function() {
1518
- vn.current = 0;
1519
- yn.current = undefined;
1520
- gn.current = 0;
1521
- dn.current = undefined;
1522
- sn.current = [];
1523
- var r = function e(n, r) {
1524
- return function(e) {
1525
- return Xn(e, n, r);
1526
- };
1527
- };
1528
- var t;
1529
- var o = 0;
1530
- var a = false;
1531
- // used to avoid overwriting the selected item ref in multiple mode
1532
- var i;
1533
- var s = e.Children.toArray(d).reduce((function(u, s, f) {
1534
- // ignore Headings and Dividers
1535
- if (!Sn(s)) {
1536
- u.push(s);
1537
- return u;
1538
- }
1539
- var d = s.props, p = d.disabled, v = d.hidden, b = d.label, m = d.value;
1540
- // Find out if the search string exactly matches a value
1541
- if (m === Te) {
1542
- t = true;
1543
- }
1544
- var y = Jn && Jn.indexOf(m) >= 0;
1545
- var g = !!y && !p && !i;
1546
- var h = l && !I && !O && !j && !K;
1547
- var S = Cn(m, b);
1548
- var C = -1;
1549
- if (h && !p && !v) {
1550
- sn.current.push({
1551
- label: b,
1552
- value: m
1553
- });
1554
- C = sn.current.length - 1;
1555
- }
1556
- // Format the Menu.Item
1557
- var w = (0, e.cloneElement)(s, {
1558
- elementRef: r(S, g),
1559
- key: s.key || f,
1560
- onClick: Kn,
1561
- onKeyDown: h ? function(e) {
1562
- return Fn(e, C);
1563
- } : undefined,
1564
- selected: y,
1565
- multiple: I,
1566
- role: "option"
1567
- });
1568
- if (g) {
1569
- i = true;
1570
- }
1571
- if (Yn && Yn.indexOf(m) >= 0) {
1572
- if (o === 0) {
1573
- u.splice(o, 0, n().createElement(c.Divider, {
1574
- key: "topDivider"
1575
- }));
1576
- a = true;
1577
- }
1578
- u.splice(o, 0, w);
1579
- o += 1;
1580
- } else {
1581
- u.push(w);
1582
- }
1583
- return u;
1584
- }), []);
1585
- // In multiple mode, add missing items
1586
- if (I) {
1587
- q()(Jn, (function(e) {
1588
- var l = T()(s, (function(n) {
1589
- return Sn(n) && n.props && n.props.value === e;
1590
- }));
1591
- if (!l) {
1592
- if (e === Te) {
1593
- t = true;
1594
- }
1595
- var i = Yn && Yn.indexOf(e) >= 0;
1596
- var u = Yn.length;
1597
- if (o === 0) {
1598
- s.splice(0, 0, n().createElement(c.Divider, {
1599
- key: "topDivider"
1600
- }));
1601
- o += 1;
1602
- a = true;
1603
- }
1604
- var f = String(e);
1605
- var d = Cn(e, f);
1606
- s.splice(i ? 0 : u + 1, 0, n().createElement(S, {
1607
- elementRef: r(d),
1608
- label: f,
1609
- value: e,
1610
- key: "missing-value-".concat(e),
1611
- onClick: Kn,
1612
- multiple: I,
1613
- selected: true
1614
- }));
1615
- if (i) {
1616
- o += 1;
1617
- }
1618
- }
1619
- }));
1620
- }
1621
- var p = O === "controlled";
1622
- // Filter the items
1623
- var v = (0, ce.stringToKeywords)(Te);
1624
- s = p ? s : s.filter((function(e) {
1625
- if (Sn(e)) {
1626
- return (0, ce.testPhrase)(e.props.label, v);
1627
- }
1628
- return true;
1629
- // Keep all headers and non-interactive options
1630
- })).map((function(n) {
1631
- if (!Sn(n)) {
1632
- return n;
1633
- }
1634
- // highlight matched text
1635
- var r = v && (0, ce.keywordLocations)(n.props.label, v);
1636
-
1637
- return (0, e.cloneElement)(n, {
1638
- matchRanges: r || undefined
1639
- });
1640
- }));
1641
- // Add the option to add the new value
1642
- if (f && !t && Te) {
1643
- var b = a ? o + 1 : o;
1644
- var m = "".concat(Te, " (new value)");
1645
- var y = Cn(Te, m);
1646
- s.splice(b, 0, n().createElement(S, {
1647
- elementRef: r(y),
1648
- label: m,
1649
- value: Te,
1650
- key: "newValue",
1651
- multiple: I,
1652
- onClick: Kn
1653
- }));
1654
- }
1655
- // When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
1656
- var g = oe === "checkbox" && I && s.length > 1 ? 1 : 0;
1657
- var h = true;
1658
- // Highlight the selected Items and remove hidden
1659
- s = s.reduce((function(n, r) {
1660
- // ignore Dividers & Headings
1661
- if (!Sn(r)) {
1662
- n.push(r);
1663
- return n;
1664
- }
1665
- // Ignore any hidden items
1666
- if (r.props && r.props.hidden) {
1667
- return n;
1668
- }
1669
- if (r.props.selected && !r.props.disabled && yn.current == null) {
1670
- yn.current = vn.current;
1671
- }
1672
- var t = g === Ee;
1673
- g += 1;
1674
- vn.current += 1;
1675
- gn.current += r.props.selected ? 1 : 0;
1676
- if (r.key !== "newValue" && !r.props.disabled && !r.props.selected) {
1677
- h = false;
1678
- }
1679
- if (!t || !Fe) {
1680
- n.push(r);
1681
- return n;
1682
- }
1683
- if (!r.props.disabled) {
1684
- dn.current = r.props.value;
1685
- }
1686
- var l = (0, e.cloneElement)(r, {
1687
- active: t,
1688
- elementRef: $n,
1689
- id: ke
1690
- });
1691
- n.push(l);
1692
- return n;
1693
- }), []);
1694
- wn.current = gn.current === 0 && "none" || h && "all" || "some";
1695
- // add select all option
1696
- if (oe === "checkbox" && I && vn.current > 0) {
1697
- var C = Ee === 0 && !!O;
1698
- var w;
1699
- if (wn.current === "all") {
1700
- if (Te === "") {
1701
- w = (0, u._)("Clear all");
1702
- } else {
1703
- w = (0, u._)("Clear all matches");
1704
- }
1705
- } else if (Te === "") {
1706
- w = (0, u._)("Select all");
1707
- } else {
1708
- w = (0, u._)("Select all matches");
1709
- }
1710
- if (C) {
1711
- dn.current = "selectAll";
1712
- }
1713
- s.unshift( n().createElement(we, {
1714
- key: "select-all-option",
1715
- active: C,
1716
- elementRef: $n,
1717
- id: C ? ke : undefined,
1718
- onClick: wn.current === "all" ? _n : Nn,
1719
- label: w,
1720
- selected: wn.current === "all" || wn.current !== "none" && "some",
1721
- totalCount: !!be && Jn.length || undefined,
1722
- tabIndex: O ? -1 : undefined
1723
- }), n().createElement(c.Divider, {
1724
- key: "selectAllDivider"
1725
- }));
1726
- }
1727
- bn.current = s.reduce((function(e, n) {
1728
- if (Sn(n)) {
1729
- e.push(n.props.value);
1730
- }
1731
- return e;
1732
- }), []);
1733
- return s;
1734
- }), [ Ee, ke, l, f, d, Jn, O, Te, $n, _n, Kn, Fn, Xn, Nn, j, I, Yn, K, oe, Fe, be ]);
1735
- var er = function e(r) {
1736
- var t = r.anchorWidth, l = r.maxHeight, a = r.placement, i = r.toggleId;
1737
- var u = hn({
1738
- anchorWidth: t,
1739
- isMultiple: I,
1740
- maxHeight: l,
1741
- menuStyle: A
1742
- });
1743
- var c = Jn.length > 0 && !Qn && !O ? 0 : undefined;
1744
- var s = {
1745
- "aria-multiselectable": I || undefined,
1746
- childrenStart: !!O && n().createElement(Pn, {
1747
- activeItemId: ke,
1748
- filterA11yId: Mn,
1749
- filterKeyword: Te,
1750
- hasChildren: Zn.some((function(e) {
1751
- return Sn(e);
1752
- })),
1753
- inputId: k,
1754
- inputRef: x,
1755
- menuListboxId: xe,
1756
- multiple: I,
1757
- onClearAll: _n,
1758
- onSelectAll: Nn,
1759
- onTextBlur: Wn,
1760
- onTextChange: Hn,
1761
- onTextFocus: zn,
1762
- onTextKeyDown: Vn,
1763
- optionSelection: wn,
1764
- placement: a,
1765
- selectAllAppearance: oe,
1766
- textHasFocus: Fe
1767
- }),
1768
- focusMode: O ? "never" : undefined,
1769
- isLoading: j,
1770
- labelledBy: "".concat(Mn !== null && Mn !== void 0 ? Mn : "", " ").concat(i !== null && i !== void 0 ? i : "").trim(),
1771
- // NVDA ignores aria-labelledby attribute on popover, but reads it on menu
1772
- menuId: xe,
1773
- onScrollBottom: K ? Bn : undefined,
1774
- placement: a !== null && a !== void 0 ? a : undefined,
1775
- noOptionsMessage: N,
1776
- footerMessage: C,
1777
- animateLoading: o,
1778
- loadingMessage: R,
1779
- onScroll: V,
1780
- style: u,
1781
- tabIndex: c
1782
- };
1783
- if (ve) {
1784
-
1785
- return n().createElement(ne.VirtualizedResultsMenu, nn({
1786
- virtualization: ve
1787
- }, s), Zn);
1788
- }
1789
-
1790
- return n().createElement(re(), s, Zn);
292
+ var o = {
293
+ onChange: n
1791
294
  };
1792
- var nr = (0, e.useMemo)((function() {
1793
-
1794
- return n().createElement(Rn, nn({
1795
- appearance: i,
1796
- append: s,
1797
- currentValues: An(),
1798
- "data-test": I ? "multiselect" : "select",
1799
- describedBy: m,
1800
- disabled: y,
1801
- elementRef: Un,
1802
- error: h,
1803
- inline: w,
1804
- labelText: E,
1805
- labelledBy: P,
1806
- multiple: I,
1807
- onClick: H,
1808
- placeholder: G,
1809
- prefixLabel: Q,
1810
- prepend: Z,
1811
- required: U,
1812
- suffixLabel: ie,
1813
- toggle: be,
1814
- toggleContent: ye
1815
- }, ge), d);
1816
- }), [ i, s, An, I, m, y, h, Un, w, E, P, H, G, Q, Z, U, ie, be, ye, ge, d ]);
1817
-
1818
- return n().createElement(Y(), {
1819
- closeReasons: On,
1820
- inputId: k,
1821
- "aria-labelledby": Mn,
1822
- toggle: nr,
1823
- onRequestOpen: In,
1824
- onRequestClose: qn,
1825
- open: De,
1826
- openWithArrowKeys: true,
1827
- repositionMode: te,
1828
- defaultPlacement: v,
1829
- canCoverAnchor: Xe().innerHeight < 500,
1830
- retainFocus: false,
1831
- takeFocus: Jn.length === 0 || Jn.length > 0 && !Qn || !!O
1832
- }, er);
1833
- }
1834
- Mn.propTypes = yn;
1835
- Mn.componentType = "SelectBase";
1836
- Mn.Option = S;
1837
- Mn.Divider = c.Divider;
1838
- Mn.Heading = c.Heading;
1839
- /* harmony default export */ const An = Mn;
1840
- // CONCATENATED MODULE: ./src/utils/useDeprecate.tsx
1841
- var Tn = "is deprecated and will be removed in the next major version.";
1842
- var In = function e(n) {
1843
- var r = n.additionalMessage, t = r === void 0 ? "" : r, l = n.componentName;
1844
- useEffect((function() {
1845
- if (false) {}
1846
- }), [ t, l ]);
1847
- };
1848
- var qn = function e(n) {
1849
- var r = n.additionalMessage, t = r === void 0 ? "" : r, l = n.componentName, o = n.propName, a = n.propValue;
1850
- useEffect((function() {
1851
- if (false) {}
1852
- }), [ t, l, o, a ]);
1853
- };
1854
- var Ln = function n(r) {
1855
- var t = r.additionalMessage, l = t === void 0 ? "" : t, o = r.componentName, a = r.deprecatedPropValue, i = r.propName, u = r.propValue;
1856
- (0, e.useEffect)((function() {
1857
- if (false) {}
1858
- }), [ l, o, i, u, a ]);
1859
- };
1860
- // CONCATENATED MODULE: ./src/Select/Select.tsx
1861
- function Dn() {
1862
- return Dn = Object.assign ? Object.assign.bind() : function(e) {
1863
- for (var n = 1; n < arguments.length; n++) {
1864
- var r = arguments[n];
1865
- for (var t in r) {
1866
- ({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
1867
- }
1868
- }
1869
- return e;
1870
- }, Dn.apply(null, arguments);
1871
- }
1872
- function Nn(e, n) {
1873
- if (null == e) return {};
1874
- var r, t, l = _n(e, n);
1875
- if (Object.getOwnPropertySymbols) {
1876
- var o = Object.getOwnPropertySymbols(e);
1877
- for (t = 0; t < o.length; t++) {
1878
- r = o[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (l[r] = e[r]);
1879
- }
295
+ if (T) {
296
+ o.values = S != null ? [ S ] : [];
297
+ } else if (e != null) {
298
+ o.defaultValues = e;
1880
299
  }
1881
- return l;
1882
- }
1883
- function _n(e, n) {
1884
- if (null == e) return {};
1885
- var r = {};
1886
- for (var t in e) {
1887
- if ({}.hasOwnProperty.call(e, t)) {
1888
- if (-1 !== n.indexOf(t)) continue;
1889
- r[t] = e[t];
1890
- }
1891
- }
1892
- return r;
1893
- }
1894
- /** @public */
1895
- /** @public */
1896
- /** @public */ var Bn = {
1897
- allowKeyMatching: o().bool,
1898
- animateLoading: o().bool,
1899
- appearance: o().oneOf([ "default", "link", "subtle" ]),
1900
- append: o().bool,
1901
- children: o().node,
1902
- defaultPlacement: o().oneOf([ "above", "below", "vertical" ]),
1903
- defaultValue: o().oneOfType([ o().string, o().number, o().bool ]),
1904
- describedBy: o().string,
1905
- disabled: o().bool,
1906
- elementRef: o().oneOfType([ o().func, o().object ]),
1907
- error: o().bool,
1908
- filter: o().oneOf([ false, true, "controlled" ]),
1909
- footerMessage: o().node,
1910
- inline: o().bool,
1911
- inputId: o().string,
1912
- inputRef: o().oneOfType([ o().func, o().object ]),
1913
- isLoadingOptions: o().bool,
1914
- labelledBy: o().string,
1915
- labelText: o().string,
1916
- loadingMessage: o().node,
1917
- menuStyle: o().object,
1918
- name: o().string,
1919
- noOptionsMessage: o().node,
1920
- onChange: o().func,
1921
- onClose: o().func,
1922
- onFilterChange: o().func,
1923
- onOpen: o().func,
1924
- onScroll: o().func,
1925
- onScrollBottom: o().func,
1926
- placeholder: o().string,
1927
- prefixLabel: o().string,
1928
- prepend: o().bool,
1929
- repositionMode: o().oneOf([ "none", "flip" ]),
1930
- suffixLabel: o().string,
1931
- toggleContent: o().oneOf([ "optionChildren", "optionLabel" ]),
1932
- /** @private. */
1933
- toggle: o().node,
1934
- value: o().oneOfType([ o().string, o().number, o().bool ]),
1935
- /** @private. */
1936
- virtualization: o().number
1937
- };
1938
- var Vn = (0, u._)("No matches");
1939
- var Kn = (0, u._)("Select...");
1940
- function Fn(r) {
1941
- var t = r.allowKeyMatching, l = t === void 0 ? true : t, o = r.appearance, a = o === void 0 ? "default" : o, u = r.defaultPlacement, c = u === void 0 ? "vertical" : u, s = r.defaultValue, f = r.inline, d = f === void 0 ? true : f, p = r.noOptionsMessage, v = p === void 0 ? Vn : p, b = r.onChange, m = r.placeholder, y = m === void 0 ? Kn : m, g = r.toggleContent, h = g === void 0 ? "optionChildren" : g, O = r.value, S = Nn(r, [ "allowKeyMatching", "appearance", "defaultPlacement", "defaultValue", "inline", "noOptionsMessage", "onChange", "placeholder", "toggleContent", "value" ]);
1942
- // @docs-props-type SelectPropsBase
1943
- Ln({
1944
- componentName: "Select",
1945
- deprecatedPropValue: "link",
1946
- propName: "appearance",
1947
- propValue: a
1948
- });
1949
- var C = i()({
1950
- componentName: "Select",
1951
- /* eslint-disable-next-line prefer-rest-params */
1952
- componentProps: arguments[0]
1953
- });
1954
- var w = (0, e.useMemo)((function() {
1955
- // wrap defaultValue in an array once to avoid failing <SelectBase>'s defaultValues comparison check
1956
- if (s != null) {
1957
- return [ s ];
1958
- }
1959
- return [];
1960
- }), [ s ]);
1961
- // Converts the provided props into a structure suitable for SelectBase.
1962
- var k = (0, e.useMemo)((function() {
1963
- var e = C ? undefined : w;
1964
- var n = function e(n, r) {
1965
- var t = r.name, l = r.values;
1966
- b === null || b === void 0 ? void 0 : b(n, {
1967
- name: t,
1968
- value: l[0]
1969
- });
1970
- };
1971
- var r = {
1972
- onChange: n
1973
- };
1974
- if (C) {
1975
- r.values = O != null ? [ O ] : [];
1976
- } else if (e != null) {
1977
- r.defaultValues = e;
1978
- }
1979
- return r;
1980
- }), [ w, b, C, O ]);
1981
-
1982
- return n().createElement(An, Dn({
1983
- allowKeyMatching: l,
1984
- appearance: a,
1985
- defaultPlacement: c,
1986
- inline: d,
1987
- noOptionsMessage: v,
1988
- placeholder: y,
1989
- toggleContent: h
1990
- }, S, k, {
1991
- multiple: false
1992
- }));
1993
- }
1994
- Fn.propTypes = Bn;
1995
- Fn.Option = E;
1996
- Fn.Heading = c.Heading;
1997
- Fn.Divider = c.Divider;
1998
- /* harmony default export */ const Hn = Fn;
1999
- }) // CONCATENATED MODULE: ./src/Select/index.ts
2000
- ();
2001
- module.exports = t;
300
+ return o;
301
+ }), [ x, g, T, S ]);
302
+
303
+ return t().createElement(l(), M({
304
+ allowKeyMatching: r,
305
+ appearance: i,
306
+ defaultPlacement: s,
307
+ inline: p,
308
+ noOptionsMessage: b,
309
+ placeholder: O,
310
+ toggleContent: h
311
+ }, w, q, {
312
+ multiple: false
313
+ }));
314
+ }
315
+ T.propTypes = w;
316
+ T.Option = m;
317
+ T.Heading = i.Heading;
318
+ T.Divider = i.Divider;
319
+ /* harmony default export */ const x = T;
320
+ // CONCATENATED MODULE: ./src/Select/index.ts
321
+ module.exports = n;
2002
322
  /******/})();