@splunk/react-ui 5.0.0-rc.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +361 -0
- package/Calendar.js +148 -151
- package/Code.js +197 -167
- package/ComboBox.js +51 -51
- package/ControlGroup.js +1 -1
- package/Date.js +145 -147
- package/Dropdown.js +28 -25
- package/DualListbox.js +468 -469
- package/FetchOptions.d.ts +2 -2
- package/{MIGRATION.mdx → MIGRATION.md} +563 -44
- package/Markdown.js +3 -4
- package/Message.js +47 -43
- package/Modal.js +18 -18
- package/ModalLayer.js +15 -11
- package/Multiselect.js +768 -755
- package/Popover.js +156 -152
- package/README.md +6 -6
- package/Resize.js +149 -151
- package/ResultsMenu.js +116 -115
- package/Select.js +461 -461
- package/Slider.js +337 -339
- package/Table.js +856 -806
- package/Tooltip.js +192 -189
- package/TransitionOpen.js +4 -1
- package/package.json +15 -14
- package/types/src/Code/Code.d.ts +1 -1
- package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
- package/types/src/Dropdown/Dropdown.d.ts +6 -2
- package/types/src/Number/Number.d.ts +1 -1
- package/types/src/Popover/Popover.d.ts +8 -1
- package/types/src/ResultsMenu/ResultsMenu.d.ts +2 -1
- package/types/src/Table/HeadCell.d.ts +6 -1
- package/types/src/Table/HeadInner.d.ts +3 -1
- package/types/src/Tooltip/Tooltip.d.ts +7 -7
- package/types/src/fixtures/useFetchOptions.d.ts +33 -0
- package/CHANGELOG.v5.mdx +0 -335
- package/MIGRATION.v5.mdx +0 -537
- package/types/src/Button/docs/examples/Truncated.d.ts +0 -3
- package/types/src/fixtures/FetchOptions.d.ts +0 -76
package/Select.js
CHANGED
|
@@ -136,8 +136,8 @@
|
|
|
136
136
|
t.d(r, {
|
|
137
137
|
Divider: () => /* reexport */ q.Divider,
|
|
138
138
|
Heading: () => /* reexport */ q.Heading,
|
|
139
|
-
Option: () => /* reexport */
|
|
140
|
-
default: () => /* reexport */
|
|
139
|
+
Option: () => /* reexport */ Sn,
|
|
140
|
+
default: () => /* reexport */ Rn
|
|
141
141
|
});
|
|
142
142
|
// EXTERNAL MODULE: external "react"
|
|
143
143
|
var e = t(9497);
|
|
@@ -179,13 +179,13 @@
|
|
|
179
179
|
var j = t.n(x);
|
|
180
180
|
// CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
|
|
181
181
|
const P = require("@splunk/react-icons/CaretSmallDown");
|
|
182
|
-
var
|
|
182
|
+
var T = t.n(P);
|
|
183
183
|
// CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
|
|
184
|
-
const
|
|
185
|
-
var
|
|
184
|
+
const E = require("@splunk/react-icons/Magnifier");
|
|
185
|
+
var R = t.n(E);
|
|
186
186
|
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
187
|
-
const
|
|
188
|
-
var
|
|
187
|
+
const A = require("@splunk/react-ui/Dropdown");
|
|
188
|
+
var M = t.n(A);
|
|
189
189
|
// CONCATENATED MODULE: external "@splunk/react-ui/Link"
|
|
190
190
|
const L = require("@splunk/react-ui/Link");
|
|
191
191
|
var I = t.n(L);
|
|
@@ -207,19 +207,17 @@
|
|
|
207
207
|
const z = require("@splunk/ui-utils/filter");
|
|
208
208
|
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
209
209
|
const W = require("@splunk/ui-utils/id");
|
|
210
|
-
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
211
|
-
const $ = require("@splunk/ui-utils/keyboard");
|
|
212
210
|
// CONCATENATED MODULE: ./src/Select/OptionBase.tsx
|
|
213
|
-
function
|
|
211
|
+
function $(e) {
|
|
214
212
|
"@babel/helpers - typeof";
|
|
215
|
-
return
|
|
213
|
+
return $ = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
216
214
|
return typeof e;
|
|
217
215
|
} : function(e) {
|
|
218
216
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
219
|
-
},
|
|
217
|
+
}, $(e);
|
|
220
218
|
}
|
|
221
|
-
function
|
|
222
|
-
return
|
|
219
|
+
function X() {
|
|
220
|
+
return X = Object.assign ? Object.assign.bind() : function(e) {
|
|
223
221
|
for (var n = 1; n < arguments.length; n++) {
|
|
224
222
|
var t = arguments[n];
|
|
225
223
|
for (var r in t) {
|
|
@@ -227,7 +225,7 @@
|
|
|
227
225
|
}
|
|
228
226
|
}
|
|
229
227
|
return e;
|
|
230
|
-
},
|
|
228
|
+
}, X.apply(null, arguments);
|
|
231
229
|
}
|
|
232
230
|
function U(e, n) {
|
|
233
231
|
var t = Object.keys(e);
|
|
@@ -239,42 +237,42 @@
|
|
|
239
237
|
}
|
|
240
238
|
return t;
|
|
241
239
|
}
|
|
242
|
-
function
|
|
240
|
+
function J(e) {
|
|
243
241
|
for (var n = 1; n < arguments.length; n++) {
|
|
244
242
|
var t = null != arguments[n] ? arguments[n] : {};
|
|
245
243
|
n % 2 ? U(Object(t), !0).forEach((function(n) {
|
|
246
|
-
|
|
244
|
+
G(e, n, t[n]);
|
|
247
245
|
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : U(Object(t)).forEach((function(n) {
|
|
248
246
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
|
|
249
247
|
}));
|
|
250
248
|
}
|
|
251
249
|
return e;
|
|
252
250
|
}
|
|
253
|
-
function
|
|
254
|
-
return (n =
|
|
251
|
+
function G(e, n, t) {
|
|
252
|
+
return (n = Q(n)) in e ? Object.defineProperty(e, n, {
|
|
255
253
|
value: t,
|
|
256
254
|
enumerable: !0,
|
|
257
255
|
configurable: !0,
|
|
258
256
|
writable: !0
|
|
259
257
|
}) : e[n] = t, e;
|
|
260
258
|
}
|
|
261
|
-
function
|
|
262
|
-
var n =
|
|
263
|
-
return "symbol" ==
|
|
259
|
+
function Q(e) {
|
|
260
|
+
var n = Y(e, "string");
|
|
261
|
+
return "symbol" == $(n) ? n : n + "";
|
|
264
262
|
}
|
|
265
|
-
function
|
|
266
|
-
if ("object" !=
|
|
263
|
+
function Y(e, n) {
|
|
264
|
+
if ("object" != $(e) || !e) return e;
|
|
267
265
|
var t = e[Symbol.toPrimitive];
|
|
268
266
|
if (void 0 !== t) {
|
|
269
267
|
var r = t.call(e, n || "default");
|
|
270
|
-
if ("object" !=
|
|
268
|
+
if ("object" != $(r)) return r;
|
|
271
269
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
272
270
|
}
|
|
273
271
|
return ("string" === n ? String : Number)(e);
|
|
274
272
|
}
|
|
275
|
-
function
|
|
273
|
+
function Z(e, n) {
|
|
276
274
|
if (null == e) return {};
|
|
277
|
-
var t, r, l =
|
|
275
|
+
var t, r, l = ee(e, n);
|
|
278
276
|
if (Object.getOwnPropertySymbols) {
|
|
279
277
|
var a = Object.getOwnPropertySymbols(e);
|
|
280
278
|
for (r = 0; r < a.length; r++) {
|
|
@@ -283,7 +281,7 @@
|
|
|
283
281
|
}
|
|
284
282
|
return l;
|
|
285
283
|
}
|
|
286
|
-
function
|
|
284
|
+
function ee(e, n) {
|
|
287
285
|
if (null == e) return {};
|
|
288
286
|
var t = {};
|
|
289
287
|
for (var r in e) {
|
|
@@ -294,7 +292,7 @@
|
|
|
294
292
|
}
|
|
295
293
|
return t;
|
|
296
294
|
}
|
|
297
|
-
var
|
|
295
|
+
var ne = {
|
|
298
296
|
/** @private */
|
|
299
297
|
active: a().bool,
|
|
300
298
|
children: a().node,
|
|
@@ -324,8 +322,8 @@
|
|
|
324
322
|
};
|
|
325
323
|
/**
|
|
326
324
|
* An option within a `Multiselect`.
|
|
327
|
-
*/ function
|
|
328
|
-
var r = t.children, l = t.descriptionPosition, a = l === void 0 ? "bottom" : l, o = t.disabled, i = t.elementRef, u = t.icon, c = t.label, s = t.multiple, f = t.onClick, d = t.role, p = d === void 0 ? "option" : d, v = t.value, b =
|
|
325
|
+
*/ function te(t) {
|
|
326
|
+
var r = t.children, l = t.descriptionPosition, a = l === void 0 ? "bottom" : l, o = t.disabled, i = t.elementRef, u = t.icon, c = t.label, s = t.multiple, f = t.onClick, d = t.role, p = d === void 0 ? "option" : d, v = t.value, b = Z(t, [ "children", "descriptionPosition", "disabled", "elementRef", "icon", "label", "multiple", "onClick", "role", "value" ]);
|
|
329
327
|
// @docs-props-type OptionPropsBase
|
|
330
328
|
var m = (0, e.useCallback)((function(e) {
|
|
331
329
|
if (!o) {
|
|
@@ -335,12 +333,12 @@
|
|
|
335
333
|
}
|
|
336
334
|
}), [ o, f, v ]);
|
|
337
335
|
var g = v.toString();
|
|
338
|
-
var y =
|
|
336
|
+
var y = J({
|
|
339
337
|
descriptionPosition: a,
|
|
340
338
|
disabled: o ? "disabled" : undefined
|
|
341
339
|
}, b);
|
|
342
340
|
|
|
343
|
-
return n().createElement(q.Item,
|
|
341
|
+
return n().createElement(q.Item, X({
|
|
344
342
|
"data-test-value": v,
|
|
345
343
|
"data-test": "option",
|
|
346
344
|
elementRef: i
|
|
@@ -353,12 +351,12 @@
|
|
|
353
351
|
value: g
|
|
354
352
|
}), r || c);
|
|
355
353
|
}
|
|
356
|
-
|
|
357
|
-
|
|
354
|
+
te.propTypes = ne;
|
|
355
|
+
te.type = q.Item;
|
|
358
356
|
// For components to distinguish if their children are Options or Headings/Dividers
|
|
359
|
-
/* harmony default export */ const
|
|
357
|
+
/* harmony default export */ const re = te;
|
|
360
358
|
// CONCATENATED MODULE: ./src/Select/SelectAllOption.tsx
|
|
361
|
-
var
|
|
359
|
+
var le = {
|
|
362
360
|
active: a().bool,
|
|
363
361
|
changedToggle: a().bool,
|
|
364
362
|
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
@@ -368,12 +366,12 @@
|
|
|
368
366
|
selected: a().oneOfType([ a().bool, a().oneOf([ "some" ]) ]),
|
|
369
367
|
totalCount: a().number
|
|
370
368
|
};
|
|
371
|
-
function
|
|
369
|
+
function ae(e) {
|
|
372
370
|
var t = e.active, r = e.elementRef, l = e.id, a = e.onClick, o = e.selectAllLabel, i = e.totalCount, u = e.changedToggle, c = e.selected;
|
|
373
371
|
// When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
|
|
374
372
|
var s = u ? " (".concat(i === null || i === void 0 ? void 0 : i.toString(), ")") : "";
|
|
375
373
|
|
|
376
|
-
return n().createElement(
|
|
374
|
+
return n().createElement(re, {
|
|
377
375
|
active: t,
|
|
378
376
|
elementRef: r,
|
|
379
377
|
"aria-keyshortcuts": "Control+A",
|
|
@@ -391,21 +389,21 @@
|
|
|
391
389
|
value: "selectAll"
|
|
392
390
|
});
|
|
393
391
|
}
|
|
394
|
-
|
|
395
|
-
/* harmony default export */ const
|
|
392
|
+
ae.propTypes = le;
|
|
393
|
+
/* harmony default export */ const oe = ae;
|
|
396
394
|
// CONCATENATED MODULE: external "styled-components"
|
|
397
|
-
const
|
|
398
|
-
var
|
|
395
|
+
const ie = require("styled-components");
|
|
396
|
+
var ue = t.n(ie);
|
|
399
397
|
// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
400
|
-
const
|
|
401
|
-
var
|
|
398
|
+
const ce = require("@splunk/react-ui/Button");
|
|
399
|
+
var se = t.n(ce);
|
|
402
400
|
// CONCATENATED MODULE: external "@splunk/react-ui/Divider"
|
|
403
|
-
const
|
|
404
|
-
var
|
|
401
|
+
const fe = require("@splunk/react-ui/Divider");
|
|
402
|
+
var de = t.n(fe);
|
|
405
403
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
406
|
-
const
|
|
404
|
+
const pe = require("@splunk/themes");
|
|
407
405
|
// CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
|
|
408
|
-
var
|
|
406
|
+
var ve = ue()(se()).withConfig({
|
|
409
407
|
displayName: "SelectBaseStyles__StyledButton",
|
|
410
408
|
componentId: "sc-16cj7sk-0"
|
|
411
409
|
})([ "&[data-inline]{width:", ";}", "" ], (function(e) {
|
|
@@ -415,52 +413,52 @@
|
|
|
415
413
|
var n = e.$multiple;
|
|
416
414
|
return !n && "flex-grow: 0;";
|
|
417
415
|
}));
|
|
418
|
-
var
|
|
416
|
+
var be = ue().span.withConfig({
|
|
419
417
|
displayName: "SelectBaseStyles__StyledLinkIcon",
|
|
420
418
|
componentId: "sc-16cj7sk-1"
|
|
421
|
-
})([ "padding-right:", ";" ],
|
|
422
|
-
var
|
|
419
|
+
})([ "padding-right:", ";" ], pe.variables.spacingXSmall);
|
|
420
|
+
var me = ue().span.withConfig({
|
|
423
421
|
displayName: "SelectBaseStyles__StyledLinkCaret",
|
|
424
422
|
componentId: "sc-16cj7sk-2"
|
|
425
|
-
})([ "padding-left:", ";" ],
|
|
426
|
-
var
|
|
423
|
+
})([ "padding-left:", ";" ], pe.variables.spacingXSmall);
|
|
424
|
+
var ge = ue().div.withConfig({
|
|
427
425
|
displayName: "SelectBaseStyles__StyledFilter",
|
|
428
426
|
componentId: "sc-16cj7sk-3"
|
|
429
|
-
})([ "padding:", " ", " ", ";min-width:160px;" ],
|
|
430
|
-
var
|
|
427
|
+
})([ "padding:", " ", " ", ";min-width:160px;" ], pe.variables.spacingLarge, pe.variables.spacingLarge, pe.variables.spacingSmall);
|
|
428
|
+
var ye = ue().span.withConfig({
|
|
431
429
|
displayName: "SelectBaseStyles__StyledCount",
|
|
432
430
|
componentId: "sc-16cj7sk-4"
|
|
433
|
-
})([ "padding-right:", ";" ],
|
|
434
|
-
var
|
|
431
|
+
})([ "padding-right:", ";" ], pe.variables.spacingXSmall);
|
|
432
|
+
var he = ue()(I()).withConfig({
|
|
435
433
|
displayName: "SelectBaseStyles__StyledControlsLink",
|
|
436
434
|
componentId: "sc-16cj7sk-5"
|
|
437
435
|
})([ "", ";" ], (function(e) {
|
|
438
436
|
var n = e.$disabled;
|
|
439
|
-
return n && (0,
|
|
437
|
+
return n && (0, ie.css)([ "color:", ";" ], pe.variables.contentColorDisabled);
|
|
440
438
|
}));
|
|
441
|
-
var
|
|
439
|
+
var Oe = ue().div.withConfig({
|
|
442
440
|
displayName: "SelectBaseStyles__StyledToggleAllControls",
|
|
443
441
|
componentId: "sc-16cj7sk-6"
|
|
444
|
-
})([ "", ";gap:", ";padding:", " ", " ", ";" ],
|
|
445
|
-
var
|
|
442
|
+
})([ "", ";gap:", ";padding:", " ", " ", ";" ], pe.mixins.reset("flex"), pe.variables.spacingMedium, pe.variables.spacingXSmall, pe.variables.spacingLarge, pe.variables.spacingSmall);
|
|
443
|
+
var Ce = ue()(de()).withConfig({
|
|
446
444
|
displayName: "SelectBaseStyles__StyledControlsDivider",
|
|
447
445
|
componentId: "sc-16cj7sk-7"
|
|
448
|
-
})([ "border-color:", ";" ],
|
|
446
|
+
})([ "border-color:", ";" ], pe.variables.borderColor);
|
|
449
447
|
// EXTERNAL MODULE: ./src/useControlled/index.ts + 1 modules
|
|
450
|
-
var
|
|
448
|
+
var Se = t(2907);
|
|
451
449
|
// CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
|
|
452
450
|
// A utility for matching keyboard characters to list values
|
|
453
|
-
var
|
|
451
|
+
var ke = function e(n, t) {
|
|
454
452
|
return n ? n.label.charAt(t).toLowerCase() : "";
|
|
455
453
|
};
|
|
456
|
-
var
|
|
454
|
+
var we = function e(n, t) {
|
|
457
455
|
if (!n.length) {
|
|
458
456
|
return n;
|
|
459
457
|
}
|
|
460
458
|
var r = null;
|
|
461
459
|
var l = false;
|
|
462
460
|
var a = n.filter((function(e) {
|
|
463
|
-
var n =
|
|
461
|
+
var n = ke(e, t.index);
|
|
464
462
|
if (n === t.value) {
|
|
465
463
|
l = true;
|
|
466
464
|
return true;
|
|
@@ -468,7 +466,7 @@
|
|
|
468
466
|
// If we haven't found a match yet, keep track of the next closest match.
|
|
469
467
|
// Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
|
|
470
468
|
if (!l) {
|
|
471
|
-
var a =
|
|
469
|
+
var a = ke(r, t.index);
|
|
472
470
|
if (!a) {
|
|
473
471
|
r = e;
|
|
474
472
|
} else if (n > t.value) {
|
|
@@ -487,7 +485,7 @@
|
|
|
487
485
|
};
|
|
488
486
|
// CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
|
|
489
487
|
// A utility that attempts to move an element into view by scrolling it's derived parent.
|
|
490
|
-
var
|
|
488
|
+
var xe = function e(n) {
|
|
491
489
|
if (!n) {
|
|
492
490
|
return;
|
|
493
491
|
}
|
|
@@ -505,7 +503,7 @@
|
|
|
505
503
|
};
|
|
506
504
|
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
507
505
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
508
|
-
var
|
|
506
|
+
var je = {
|
|
509
507
|
body: {
|
|
510
508
|
appendChild: function e() {
|
|
511
509
|
return [];
|
|
@@ -559,16 +557,16 @@
|
|
|
559
557
|
search: ""
|
|
560
558
|
}
|
|
561
559
|
};
|
|
562
|
-
function
|
|
563
|
-
var e = typeof document !== "undefined" ? document :
|
|
560
|
+
function Pe() {
|
|
561
|
+
var e = typeof document !== "undefined" ? document : je;
|
|
564
562
|
return e;
|
|
565
563
|
}
|
|
566
|
-
var
|
|
567
|
-
/* harmony default export */ const
|
|
564
|
+
var Te = Pe();
|
|
565
|
+
/* harmony default export */ const Ee = /* unused pure expression or super */ null && Te;
|
|
568
566
|
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
569
567
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
570
|
-
var
|
|
571
|
-
document:
|
|
568
|
+
var Re = {
|
|
569
|
+
document: je,
|
|
572
570
|
navigator: {
|
|
573
571
|
userAgent: ""
|
|
574
572
|
},
|
|
@@ -623,11 +621,11 @@
|
|
|
623
621
|
}
|
|
624
622
|
};
|
|
625
623
|
function Ae() {
|
|
626
|
-
var e = typeof window !== "undefined" ? window :
|
|
624
|
+
var e = typeof window !== "undefined" ? window : Re;
|
|
627
625
|
return e;
|
|
628
626
|
}
|
|
629
|
-
var
|
|
630
|
-
/* harmony default export */ const
|
|
627
|
+
var Me = Ae();
|
|
628
|
+
/* harmony default export */ const Le = /* unused pure expression or super */ null && Me;
|
|
631
629
|
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
632
630
|
/**
|
|
633
631
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
@@ -635,7 +633,7 @@
|
|
|
635
633
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
636
634
|
* @param current - The new value of the ref.
|
|
637
635
|
*/
|
|
638
|
-
function
|
|
636
|
+
function Ie(e, n) {
|
|
639
637
|
if (e) {
|
|
640
638
|
if (typeof e === "function") {
|
|
641
639
|
e(n);
|
|
@@ -648,20 +646,20 @@
|
|
|
648
646
|
}
|
|
649
647
|
}
|
|
650
648
|
// CONCATENATED MODULE: ./src/Select/SelectBase.tsx
|
|
651
|
-
function
|
|
652
|
-
return
|
|
649
|
+
function qe(e) {
|
|
650
|
+
return Be(e) || _e(e) || Fe(e) || De();
|
|
653
651
|
}
|
|
654
|
-
function
|
|
652
|
+
function De() {
|
|
655
653
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
656
654
|
}
|
|
657
|
-
function
|
|
655
|
+
function _e(e) {
|
|
658
656
|
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
659
657
|
}
|
|
660
|
-
function
|
|
661
|
-
if (Array.isArray(e)) return
|
|
658
|
+
function Be(e) {
|
|
659
|
+
if (Array.isArray(e)) return He(e);
|
|
662
660
|
}
|
|
663
|
-
function
|
|
664
|
-
return
|
|
661
|
+
function Ne() {
|
|
662
|
+
return Ne = Object.assign ? Object.assign.bind() : function(e) {
|
|
665
663
|
for (var n = 1; n < arguments.length; n++) {
|
|
666
664
|
var t = arguments[n];
|
|
667
665
|
for (var r in t) {
|
|
@@ -669,29 +667,29 @@
|
|
|
669
667
|
}
|
|
670
668
|
}
|
|
671
669
|
return e;
|
|
672
|
-
},
|
|
670
|
+
}, Ne.apply(null, arguments);
|
|
673
671
|
}
|
|
674
|
-
function
|
|
675
|
-
return
|
|
672
|
+
function Ve(e, n) {
|
|
673
|
+
return We(e) || ze(e, n) || Fe(e, n) || Ke();
|
|
676
674
|
}
|
|
677
|
-
function
|
|
675
|
+
function Ke() {
|
|
678
676
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
679
677
|
}
|
|
680
|
-
function
|
|
678
|
+
function Fe(e, n) {
|
|
681
679
|
if (e) {
|
|
682
|
-
if ("string" == typeof e) return
|
|
680
|
+
if ("string" == typeof e) return He(e, n);
|
|
683
681
|
var t = {}.toString.call(e).slice(8, -1);
|
|
684
|
-
return "Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t ? Array.from(e) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ?
|
|
682
|
+
return "Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t ? Array.from(e) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? He(e, n) : void 0;
|
|
685
683
|
}
|
|
686
684
|
}
|
|
687
|
-
function
|
|
685
|
+
function He(e, n) {
|
|
688
686
|
(null == n || n > e.length) && (n = e.length);
|
|
689
687
|
for (var t = 0, r = Array(n); t < n; t++) {
|
|
690
688
|
r[t] = e[t];
|
|
691
689
|
}
|
|
692
690
|
return r;
|
|
693
691
|
}
|
|
694
|
-
function
|
|
692
|
+
function ze(e, n) {
|
|
695
693
|
var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
696
694
|
if (null != t) {
|
|
697
695
|
var r, l, a, o, i = [], u = !0, c = !1;
|
|
@@ -713,12 +711,12 @@
|
|
|
713
711
|
return i;
|
|
714
712
|
}
|
|
715
713
|
}
|
|
716
|
-
function
|
|
714
|
+
function We(e) {
|
|
717
715
|
if (Array.isArray(e)) return e;
|
|
718
716
|
}
|
|
719
|
-
function
|
|
717
|
+
function $e(e, n) {
|
|
720
718
|
if (null == e) return {};
|
|
721
|
-
var t, r, l =
|
|
719
|
+
var t, r, l = Xe(e, n);
|
|
722
720
|
if (Object.getOwnPropertySymbols) {
|
|
723
721
|
var a = Object.getOwnPropertySymbols(e);
|
|
724
722
|
for (r = 0; r < a.length; r++) {
|
|
@@ -727,7 +725,7 @@
|
|
|
727
725
|
}
|
|
728
726
|
return l;
|
|
729
727
|
}
|
|
730
|
-
function
|
|
728
|
+
function Xe(e, n) {
|
|
731
729
|
if (null == e) return {};
|
|
732
730
|
var t = {};
|
|
733
731
|
for (var r in e) {
|
|
@@ -746,7 +744,7 @@
|
|
|
746
744
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
747
745
|
}, Ue(e);
|
|
748
746
|
}
|
|
749
|
-
function
|
|
747
|
+
function Je(e, n) {
|
|
750
748
|
var t = Object.keys(e);
|
|
751
749
|
if (Object.getOwnPropertySymbols) {
|
|
752
750
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -756,30 +754,30 @@
|
|
|
756
754
|
}
|
|
757
755
|
return t;
|
|
758
756
|
}
|
|
759
|
-
function
|
|
757
|
+
function Ge(e) {
|
|
760
758
|
for (var n = 1; n < arguments.length; n++) {
|
|
761
759
|
var t = null != arguments[n] ? arguments[n] : {};
|
|
762
|
-
n % 2 ?
|
|
763
|
-
|
|
764
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) :
|
|
760
|
+
n % 2 ? Je(Object(t), !0).forEach((function(n) {
|
|
761
|
+
Qe(e, n, t[n]);
|
|
762
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Je(Object(t)).forEach((function(n) {
|
|
765
763
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
|
|
766
764
|
}));
|
|
767
765
|
}
|
|
768
766
|
return e;
|
|
769
767
|
}
|
|
770
|
-
function
|
|
771
|
-
return (n =
|
|
768
|
+
function Qe(e, n, t) {
|
|
769
|
+
return (n = Ye(n)) in e ? Object.defineProperty(e, n, {
|
|
772
770
|
value: t,
|
|
773
771
|
enumerable: !0,
|
|
774
772
|
configurable: !0,
|
|
775
773
|
writable: !0
|
|
776
774
|
}) : e[n] = t, e;
|
|
777
775
|
}
|
|
778
|
-
function
|
|
779
|
-
var n =
|
|
776
|
+
function Ye(e) {
|
|
777
|
+
var n = Ze(e, "string");
|
|
780
778
|
return "symbol" == Ue(n) ? n : n + "";
|
|
781
779
|
}
|
|
782
|
-
function
|
|
780
|
+
function Ze(e, n) {
|
|
783
781
|
if ("object" != Ue(e) || !e) return e;
|
|
784
782
|
var t = e[Symbol.toPrimitive];
|
|
785
783
|
if (void 0 !== t) {
|
|
@@ -789,7 +787,7 @@
|
|
|
789
787
|
}
|
|
790
788
|
return ("string" === n ? String : Number)(e);
|
|
791
789
|
}
|
|
792
|
-
var
|
|
790
|
+
var en = {
|
|
793
791
|
allowKeyMatching: a().bool,
|
|
794
792
|
allowNewValues: a().bool,
|
|
795
793
|
animateLoading: a().bool,
|
|
@@ -838,47 +836,47 @@
|
|
|
838
836
|
/** @private. */
|
|
839
837
|
virtualization: a().number
|
|
840
838
|
};
|
|
841
|
-
var
|
|
839
|
+
var nn = O()((function(e) {
|
|
842
840
|
return [ e ];
|
|
843
841
|
}));
|
|
844
842
|
// preserve separate widths for single vs. multi mode
|
|
845
|
-
var
|
|
843
|
+
var tn = O()((function(e) {
|
|
846
844
|
var n = e.anchorWidth, t = e.isMultiple, r = e.maxHeight, l = e.menuStyle;
|
|
847
|
-
return t ?
|
|
845
|
+
return t ? Ge({
|
|
848
846
|
width: Math.max(n !== null && n !== void 0 ? n : 0, 200),
|
|
849
847
|
maxHeight: r
|
|
850
|
-
}, l) :
|
|
848
|
+
}, l) : Ge({
|
|
851
849
|
minWidth: n !== null && n !== void 0 ? n : undefined,
|
|
852
850
|
maxWidth: Math.max(n !== null && n !== void 0 ? n : 0, 300),
|
|
853
851
|
maxHeight: r
|
|
854
852
|
}, l);
|
|
855
853
|
}));
|
|
856
|
-
var
|
|
857
|
-
function
|
|
854
|
+
var rn = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
|
|
855
|
+
function ln(e) {
|
|
858
856
|
return e && m()(e.props, "value");
|
|
859
857
|
}
|
|
860
|
-
function
|
|
858
|
+
function an(e, n) {
|
|
861
859
|
return "".concat(Ue(e), "-").concat(e, "-").concat(n);
|
|
862
860
|
}
|
|
863
|
-
var
|
|
864
|
-
var
|
|
865
|
-
var
|
|
866
|
-
var
|
|
867
|
-
var
|
|
861
|
+
var on = [ "append", "error", "prepend" ];
|
|
862
|
+
var un = (0, u._)("No matches");
|
|
863
|
+
var cn = (0, u._)("Select...");
|
|
864
|
+
var sn = n().createElement(R(), null);
|
|
865
|
+
var fn = function e(t) {
|
|
868
866
|
var r = t.activeItemId, l = t.filterA11yId, a = t.filterKeyword, o = t.hasChildren, i = t.inputId, c = t.inputRef, s = t.menuListboxId, f = t.multiple, d = t.onClearAll, p = t.onSelectAll, v = t.onTextBlur, b = t.onTextChange, m = t.onTextFocus, g = t.onTextKeyDown, y = t.optionSelection, h = t.placement, O = t.selectAllAppearance, C = t.textHasFocus;
|
|
869
867
|
var S = (0, u._)("Select all options".concat(y.current === "all" ? " disabled" : ""));
|
|
870
868
|
var k = (0, u._)("Clear all options".concat(y.current === "none" ? " disabled" : ""));
|
|
871
869
|
// only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
|
|
872
|
-
var w = n().createElement(
|
|
870
|
+
var w = n().createElement(Oe, {
|
|
873
871
|
key: "selectAll"
|
|
874
|
-
}, n().createElement(
|
|
872
|
+
}, n().createElement(he, {
|
|
875
873
|
disabled: y.current === "all",
|
|
876
874
|
appearance: "standalone",
|
|
877
875
|
"aria-label": S,
|
|
878
876
|
onClick: p,
|
|
879
877
|
"data-test": "select-all",
|
|
880
878
|
tag: "button"
|
|
881
|
-
}, a ? (0, u._)("Select all Matches") : (0, u._)("Select all")), n().createElement(
|
|
879
|
+
}, a ? (0, u._)("Select all Matches") : (0, u._)("Select all")), n().createElement(he, {
|
|
882
880
|
disabled: y.current === "none",
|
|
883
881
|
appearance: "standalone",
|
|
884
882
|
"aria-label": k,
|
|
@@ -891,7 +889,7 @@
|
|
|
891
889
|
key: "controls"
|
|
892
890
|
}, l && n().createElement(K(), {
|
|
893
891
|
id: l
|
|
894
|
-
}, (0, u._)("Type to filter")), h === "above" && n().createElement(
|
|
892
|
+
}, (0, u._)("Type to filter")), h === "above" && n().createElement(Ce, null), n().createElement(ge, {
|
|
895
893
|
key: "filter",
|
|
896
894
|
"data-test": "filter"
|
|
897
895
|
}, n().createElement(N(), {
|
|
@@ -915,10 +913,10 @@
|
|
|
915
913
|
inputRef: c,
|
|
916
914
|
inputId: i,
|
|
917
915
|
canClear: true,
|
|
918
|
-
startAdornment:
|
|
919
|
-
})), f && o && O === "buttongroup" && w, h === "below" && n().createElement(
|
|
916
|
+
startAdornment: sn
|
|
917
|
+
})), f && o && O === "buttongroup" && w, h === "below" && n().createElement(Ce, null));
|
|
920
918
|
};
|
|
921
|
-
var
|
|
919
|
+
var dn = function e(n) {
|
|
922
920
|
var t = n.prefixLabel, r = n.label, l = n.suffixLabel;
|
|
923
921
|
var a = r;
|
|
924
922
|
if (t) {
|
|
@@ -929,25 +927,25 @@
|
|
|
929
927
|
}
|
|
930
928
|
return a;
|
|
931
929
|
};
|
|
932
|
-
var
|
|
933
|
-
var l = t.appearance, a = l === void 0 ? "default" : l, o = t.append, i = t.children, c = t.currentValues, s = c === void 0 ? [] : c, f = t.describedBy, p = t.disabled, v = t.elementRef, b = t.error, m = t.inline, g = t.labelText, y = t.labelledBy, h = t.multiple, O = t.onClick, C = t.placeholder, k = t.prefixLabel, w = t.prepend, x = t.required, j = t.suffixLabel, P = t.toggle,
|
|
934
|
-
var M;
|
|
930
|
+
var pn = n().forwardRef((function(t, r) {
|
|
931
|
+
var l = t.appearance, a = l === void 0 ? "default" : l, o = t.append, i = t.children, c = t.currentValues, s = c === void 0 ? [] : c, f = t.describedBy, p = t.disabled, v = t.elementRef, b = t.error, m = t.inline, g = t.labelText, y = t.labelledBy, h = t.multiple, O = t.onClick, C = t.placeholder, k = t.prefixLabel, w = t.prepend, x = t.required, j = t.suffixLabel, P = t.toggle, E = t.toggleContent, R = $e(t, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent" ]);
|
|
935
932
|
var A;
|
|
933
|
+
var M;
|
|
936
934
|
var L = [];
|
|
937
935
|
// Generate buttonLabels
|
|
938
936
|
var q = e.Children.toArray(i);
|
|
939
937
|
var D = s.reduce((function(e, n, t, r) {
|
|
940
938
|
var l = d()(q, (function(e) {
|
|
941
|
-
return
|
|
939
|
+
return ln(e) && e.props.value === n;
|
|
942
940
|
}));
|
|
943
941
|
if (l) {
|
|
944
942
|
var a = l.props, o = a.children, i = a.icon, c = a.label;
|
|
945
|
-
var f =
|
|
943
|
+
var f = E !== "optionLabel" && o ? o : c;
|
|
946
944
|
e.push(f);
|
|
947
945
|
L.push(c);
|
|
948
946
|
// if not in multiple mode, add the icon
|
|
949
947
|
if (!h && s.length === 1) {
|
|
950
|
-
|
|
948
|
+
A = i;
|
|
951
949
|
}
|
|
952
950
|
} else if (h) {
|
|
953
951
|
// only add values that don't match an option in "multiple" mode to preserve old behaviour
|
|
@@ -960,32 +958,32 @@
|
|
|
960
958
|
}
|
|
961
959
|
return e;
|
|
962
960
|
}), []);
|
|
963
|
-
|
|
961
|
+
M = D;
|
|
964
962
|
// only apply prefix / suffix if the label is not empty
|
|
965
|
-
if (
|
|
963
|
+
if (M.length > 0) {
|
|
966
964
|
// If there's more than one item selected, read out the selected total
|
|
967
965
|
// rather than reading out each selected item
|
|
968
|
-
L =
|
|
966
|
+
L = dn({
|
|
969
967
|
prefixLabel: k,
|
|
970
|
-
label:
|
|
968
|
+
label: M.length > 1 ? [ "".concat(s.length, " items selected") ] : L,
|
|
971
969
|
suffixLabel: j
|
|
972
970
|
});
|
|
973
|
-
|
|
971
|
+
M = dn({
|
|
974
972
|
prefixLabel: k,
|
|
975
|
-
label:
|
|
973
|
+
label: M,
|
|
976
974
|
suffixLabel: j
|
|
977
975
|
});
|
|
978
976
|
}
|
|
979
977
|
// single <Select> behaviour is to show the placeholder if all parts of the label
|
|
980
978
|
// are empty strings so we replicate this behaviour here
|
|
981
|
-
if (
|
|
979
|
+
if (M.length === 0 || !h && M.every((function(e) {
|
|
982
980
|
return e === "";
|
|
983
981
|
}))) {
|
|
984
|
-
|
|
985
|
-
L =
|
|
982
|
+
M = nn(C);
|
|
983
|
+
L = M;
|
|
986
984
|
}
|
|
987
|
-
var _ = Object.keys(
|
|
988
|
-
var B =
|
|
985
|
+
var _ = Object.keys(R).includes("aria-labelledby");
|
|
986
|
+
var B = Ge({
|
|
989
987
|
"aria-describedby": f,
|
|
990
988
|
"aria-label": y || _ ? undefined : "".concat(g ? "".concat(g, ", ") : "").concat(L.join("")),
|
|
991
989
|
// aria-labelledby takes precedence over aria-label, so existence of both is redundant
|
|
@@ -1000,11 +998,11 @@
|
|
|
1000
998
|
elementRef: v,
|
|
1001
999
|
error: b,
|
|
1002
1000
|
ref: r
|
|
1003
|
-
},
|
|
1001
|
+
}, R);
|
|
1004
1002
|
if (h) {
|
|
1005
1003
|
B["data-test-values"] = JSON.stringify(s);
|
|
1006
1004
|
} else {
|
|
1007
|
-
var N =
|
|
1005
|
+
var N = Ve(s, 1), V = N[0];
|
|
1008
1006
|
B["data-test-value"] = V;
|
|
1009
1007
|
}
|
|
1010
1008
|
if (P) {
|
|
@@ -1013,33 +1011,33 @@
|
|
|
1013
1011
|
}
|
|
1014
1012
|
if (a === "link") {
|
|
1015
1013
|
|
|
1016
|
-
return n().createElement(I(),
|
|
1014
|
+
return n().createElement(I(), Ne({
|
|
1017
1015
|
tag: "button",
|
|
1018
1016
|
appearance: "standalone"
|
|
1019
1017
|
}, B, {
|
|
1020
1018
|
"data-select-appearance": "link"
|
|
1021
|
-
}), !!
|
|
1019
|
+
}), !!A && n().createElement(be, null, A), M || C, n().createElement(me, null, n().createElement(T(), null)));
|
|
1022
1020
|
}
|
|
1023
1021
|
// Using Button's secondary appearance as Select's default appearance.
|
|
1024
1022
|
var K = a === "default" ? "secondary" : a;
|
|
1025
1023
|
|
|
1026
|
-
return n().createElement(
|
|
1024
|
+
return n().createElement(ve, Ne({}, B, {
|
|
1027
1025
|
$multiple: h,
|
|
1028
1026
|
appearance: K,
|
|
1029
|
-
label:
|
|
1027
|
+
label: M,
|
|
1030
1028
|
error: b,
|
|
1031
|
-
icon:
|
|
1029
|
+
icon: A,
|
|
1032
1030
|
inline: m,
|
|
1033
1031
|
isMenu: true,
|
|
1034
1032
|
onClick: O
|
|
1035
|
-
}, S()(
|
|
1033
|
+
}, S()(R, on)), !!s.length && h && n().createElement(ye, {
|
|
1036
1034
|
"data-role": "count"
|
|
1037
1035
|
}, "(", s.length, ")"));
|
|
1038
1036
|
}));
|
|
1039
|
-
function
|
|
1040
|
-
var r = t.allowKeyMatching, l = r === void 0 ? true : r, a = t.animateLoading, o = t.appearance, i = o === void 0 ? "default" : o, c = t.append, s = t.allowNewValues, f = t.children, p = t.defaultPlacement, b = p === void 0 ? "vertical" : p, m = t.defaultValues, g = t.describedBy, h = t.disabled, O = t.elementRef, C = t.error, S = t.filter, k = t.footerMessage, x = t.inline, P = t.inputId,
|
|
1037
|
+
function vn(t) {
|
|
1038
|
+
var r = t.allowKeyMatching, l = r === void 0 ? true : r, a = t.animateLoading, o = t.appearance, i = o === void 0 ? "default" : o, c = t.append, s = t.allowNewValues, f = t.children, p = t.defaultPlacement, b = p === void 0 ? "vertical" : p, m = t.defaultValues, g = t.describedBy, h = t.disabled, O = t.elementRef, C = t.error, S = t.filter, k = t.footerMessage, x = t.inline, P = t.inputId, T = t.inputRef, E = t.isLoadingOptions, R = t.labelledBy, A = t.labelText, L = t.loadingMessage, I = t.menuStyle, B = I === void 0 ? {} : I, N = t.multiple, V = t.name, K = t.noOptionsMessage, F = K === void 0 ? un : K, $ = t.onChange, X = t.onScroll, U = t.onScrollBottom, J = t.onFilterChange, G = t.onClick, Q = t.onClose, Y = t.onOpen, Z = t.required, ee = t.placeholder, ne = ee === void 0 ? cn : ee, te = t.prefixLabel, le = t.prepend, ae = t.repositionMode, ie = ae === void 0 ? "flip" : ae, ue = t.selectAllAppearance, ce = ue === void 0 ? "buttongroup" : ue, se = t.showSelectedValuesFirst, fe = t.suffixLabel, de = t.tabConfirmsNewValue, pe = t.values, ve = t.virtualization, be = t.toggle, me = t.toggleContent, ge = me === void 0 ? "optionChildren" : me, ye = $e(t, [ "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" ]);
|
|
1041
1039
|
// @docs-props-type SelectBasePropsBase
|
|
1042
|
-
var
|
|
1040
|
+
var he = (0, Se["default"])({
|
|
1043
1041
|
componentName: "SelectBase",
|
|
1044
1042
|
/* eslint-disable-next-line prefer-rest-params */
|
|
1045
1043
|
componentProps: arguments[0],
|
|
@@ -1048,87 +1046,87 @@
|
|
|
1048
1046
|
valuePropName: "values"
|
|
1049
1047
|
});
|
|
1050
1048
|
// states
|
|
1051
|
-
var
|
|
1049
|
+
var Oe = (0, e.useState)((function() {
|
|
1052
1050
|
return {
|
|
1053
1051
|
activeItemId: (0, W.createDOMID)("active-item"),
|
|
1054
1052
|
menuListboxId: (0, W.createDOMID)("menu-listbox")
|
|
1055
1053
|
};
|
|
1056
|
-
})),
|
|
1057
|
-
var
|
|
1058
|
-
var
|
|
1059
|
-
var
|
|
1060
|
-
var
|
|
1061
|
-
var
|
|
1062
|
-
var
|
|
1054
|
+
})), Ce = Ve(Oe, 1), ke = Ce[0], je = ke.activeItemId, Pe = ke.menuListboxId;
|
|
1055
|
+
var Te = (0, e.useState)(0), Ee = Ve(Te, 2), Re = Ee[0], Me = Ee[1];
|
|
1056
|
+
var Le = (0, e.useState)(""), De = Ve(Le, 2), _e = De[0], Be = De[1];
|
|
1057
|
+
var Ke = (0, e.useState)(false), Fe = Ve(Ke, 2), He = Fe[0], ze = Fe[1];
|
|
1058
|
+
var We = (0, e.useState)(false), Xe = Ve(We, 2), Ue = Xe[0], Je = Xe[1];
|
|
1059
|
+
var Ge = (0, e.useState)([]), Qe = Ve(Ge, 2), Ye = Qe[0], Ze = Qe[1];
|
|
1060
|
+
var en = (0, e.useState)(m || []), nn = Ve(en, 2), on = nn[0], sn = nn[1];
|
|
1063
1061
|
// previous state
|
|
1064
|
-
var
|
|
1062
|
+
var dn = H()(Re);
|
|
1065
1063
|
// refs
|
|
1066
|
-
var
|
|
1064
|
+
var vn = (0, e.useRef)(null);
|
|
1065
|
+
var bn = (0, e.useRef)(null);
|
|
1067
1066
|
var mn = (0, e.useRef)(null);
|
|
1068
|
-
var gn = (0, e.useRef)(
|
|
1067
|
+
var gn = (0, e.useRef)([]);
|
|
1069
1068
|
var yn = (0, e.useRef)([]);
|
|
1070
|
-
var hn = (0, e.useRef)(
|
|
1071
|
-
var On = (0, e.useRef)(
|
|
1072
|
-
var Cn = (0, e.useRef)();
|
|
1073
|
-
var Sn = (0, e.useRef)(
|
|
1074
|
-
var kn = (0, e.useRef)(
|
|
1075
|
-
var wn = (0, e.useRef)(
|
|
1076
|
-
var xn = (0, e.useRef)(
|
|
1077
|
-
var jn = (0, e.useRef)();
|
|
1078
|
-
var Pn = (0, e.useRef)(
|
|
1079
|
-
var
|
|
1080
|
-
var Rn = (0, e.useState)(S ? (0, W.createDOMID)("filter") : undefined), Tn = Ke(Rn, 1), Mn = Tn[0];
|
|
1069
|
+
var hn = (0, e.useRef)(dn);
|
|
1070
|
+
var On = (0, e.useRef)();
|
|
1071
|
+
var Cn = (0, e.useRef)({});
|
|
1072
|
+
var Sn = (0, e.useRef)(0);
|
|
1073
|
+
var kn = (0, e.useRef)([]);
|
|
1074
|
+
var wn = (0, e.useRef)(null);
|
|
1075
|
+
var xn = (0, e.useRef)();
|
|
1076
|
+
var jn = (0, e.useRef)(0);
|
|
1077
|
+
var Pn = (0, e.useRef)("none");
|
|
1078
|
+
var Tn = (0, e.useState)(S ? (0, W.createDOMID)("filter") : undefined), En = Ve(Tn, 1), Rn = En[0];
|
|
1081
1079
|
(0, e.useEffect)((function() {
|
|
1082
1080
|
if (false) {}
|
|
1083
|
-
}), [ i, c, C,
|
|
1081
|
+
}), [ i, c, C, le ]);
|
|
1084
1082
|
var An = (0, e.useCallback)((function() {
|
|
1085
|
-
var e =
|
|
1083
|
+
var e = he ? pe : on;
|
|
1086
1084
|
return N || e == null ? e : e.slice(0, 1);
|
|
1087
|
-
}), [
|
|
1088
|
-
var
|
|
1085
|
+
}), [ he, N, pe, on ]);
|
|
1086
|
+
var Mn = (0, e.useCallback)((function() {
|
|
1089
1087
|
var e;
|
|
1090
1088
|
// in non-multiple mode, don't move values to the top of the list
|
|
1091
|
-
return N &&
|
|
1092
|
-
}), [ An, N,
|
|
1093
|
-
var
|
|
1094
|
-
var n =
|
|
1095
|
-
|
|
1096
|
-
|
|
1089
|
+
return N && se !== "never" ? (e = An()) !== null && e !== void 0 ? e : [] : [];
|
|
1090
|
+
}), [ An, N, se ]);
|
|
1091
|
+
var Ln = (0, e.useCallback)((function(e) {
|
|
1092
|
+
var n = _e;
|
|
1093
|
+
ze(true);
|
|
1094
|
+
Ze(Mn());
|
|
1097
1095
|
// SUI-3234: preserve existing behavior difference between <Select> and <Multiselect.Compact>
|
|
1098
1096
|
if (N) {
|
|
1099
|
-
|
|
1097
|
+
Be("");
|
|
1100
1098
|
}
|
|
1101
|
-
if (n !==
|
|
1102
|
-
|
|
1103
|
-
keyword:
|
|
1099
|
+
if (n !== _e) {
|
|
1100
|
+
J === null || J === void 0 ? void 0 : J(e, {
|
|
1101
|
+
keyword: _e
|
|
1104
1102
|
});
|
|
1105
1103
|
}
|
|
1106
|
-
}), [
|
|
1104
|
+
}), [ _e, Mn, N, J ]);
|
|
1107
1105
|
(0, e.useEffect)((function() {
|
|
1108
|
-
if (
|
|
1109
|
-
|
|
1110
|
-
if (
|
|
1111
|
-
|
|
1106
|
+
if (He) {
|
|
1107
|
+
Y === null || Y === void 0 ? void 0 : Y();
|
|
1108
|
+
if (wn.current && !S) {
|
|
1109
|
+
wn.current.focus();
|
|
1112
1110
|
} else {
|
|
1113
1111
|
var e;
|
|
1114
|
-
|
|
1112
|
+
Me((e = xn.current) !== null && e !== void 0 ? e : 0);
|
|
1115
1113
|
}
|
|
1116
1114
|
}
|
|
1117
|
-
}), [
|
|
1118
|
-
var
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
}), [
|
|
1124
|
-
var
|
|
1115
|
+
}), [ Y, He, Ye, _e, S ]);
|
|
1116
|
+
var In = (0, e.useCallback)((function() {
|
|
1117
|
+
ze(false);
|
|
1118
|
+
Me(0);
|
|
1119
|
+
hn.current = null;
|
|
1120
|
+
Q === null || Q === void 0 ? void 0 : Q();
|
|
1121
|
+
}), [ Q ]);
|
|
1122
|
+
var qn = (0, e.useCallback)((function(e, n) {
|
|
1125
1123
|
var t;
|
|
1126
1124
|
var r = (t = An()) !== null && t !== void 0 ? t : [];
|
|
1127
1125
|
var l = r.indexOf(n);
|
|
1128
1126
|
var a;
|
|
1129
1127
|
if (N) {
|
|
1130
1128
|
if (l >= 0) {
|
|
1131
|
-
a = [].concat(
|
|
1129
|
+
a = [].concat(qe(r.slice(0, l)), qe(r.slice(l + 1)));
|
|
1132
1130
|
} else {
|
|
1133
1131
|
a = r.concat([ n ]);
|
|
1134
1132
|
}
|
|
@@ -1136,143 +1134,143 @@
|
|
|
1136
1134
|
// non-multiple mode must always have a value
|
|
1137
1135
|
a = [ n ];
|
|
1138
1136
|
}
|
|
1139
|
-
var o = !
|
|
1137
|
+
var o = !he;
|
|
1140
1138
|
if (o) {
|
|
1141
|
-
|
|
1139
|
+
sn(a);
|
|
1142
1140
|
}
|
|
1143
1141
|
if (N) {
|
|
1144
1142
|
// in uncontrolled multiple mode, keep the menu open
|
|
1145
1143
|
if (o) {
|
|
1146
|
-
|
|
1144
|
+
ze(true);
|
|
1147
1145
|
}
|
|
1148
1146
|
} else {
|
|
1149
1147
|
var i;
|
|
1150
1148
|
// non-multiple mode only supports a single selection
|
|
1151
1149
|
// so close the menu once a selection is made
|
|
1152
|
-
|
|
1150
|
+
In({
|
|
1153
1151
|
reason: "contentClick"
|
|
1154
1152
|
});
|
|
1155
|
-
(i =
|
|
1153
|
+
(i = vn.current) === null || i === void 0 ? void 0 : i.focus();
|
|
1156
1154
|
}
|
|
1157
|
-
|
|
1155
|
+
$ === null || $ === void 0 ? void 0 : $(e, {
|
|
1158
1156
|
values: a,
|
|
1159
1157
|
name: V,
|
|
1160
1158
|
reason: "valueToggle"
|
|
1161
1159
|
});
|
|
1162
|
-
}), [ An,
|
|
1163
|
-
var
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
if (
|
|
1167
|
-
clearTimeout(
|
|
1160
|
+
}), [ An, In, he, N, V, $ ]);
|
|
1161
|
+
var Dn = function e() {
|
|
1162
|
+
bn.current = null;
|
|
1163
|
+
gn.current = [];
|
|
1164
|
+
if (mn.current) {
|
|
1165
|
+
clearTimeout(mn.current);
|
|
1168
1166
|
}
|
|
1169
1167
|
};
|
|
1170
|
-
var
|
|
1168
|
+
var _n = (0, e.useCallback)((function(e) {
|
|
1171
1169
|
var t;
|
|
1172
1170
|
// this doesn't make sense if we can't select multiple values
|
|
1173
1171
|
if (!N) {
|
|
1174
1172
|
return;
|
|
1175
1173
|
}
|
|
1176
1174
|
var r = (t = An()) !== null && t !== void 0 ? t : [];
|
|
1177
|
-
var l = w()(r.concat(
|
|
1175
|
+
var l = w()(r.concat(kn.current));
|
|
1178
1176
|
l = n().Children.toArray(f).filter((function(e) {
|
|
1179
|
-
return
|
|
1177
|
+
return ln(e) && y()(l, e.props.value) && (!e.props.disabled || y()(r, e.props.value));
|
|
1180
1178
|
})).map((function(e) {
|
|
1181
1179
|
return e.props.value;
|
|
1182
1180
|
}));
|
|
1183
|
-
if (!
|
|
1184
|
-
|
|
1181
|
+
if (!he) {
|
|
1182
|
+
sn(l);
|
|
1185
1183
|
}
|
|
1186
|
-
|
|
1184
|
+
$ === null || $ === void 0 ? void 0 : $(e, {
|
|
1187
1185
|
values: l,
|
|
1188
1186
|
name: V,
|
|
1189
1187
|
reason: "selectAll"
|
|
1190
1188
|
});
|
|
1191
|
-
}), [ f, An,
|
|
1192
|
-
var
|
|
1189
|
+
}), [ f, An, he, N, V, $ ]);
|
|
1190
|
+
var Bn = (0, e.useCallback)((function(e) {
|
|
1193
1191
|
var t;
|
|
1194
1192
|
// this doesn't make sense if we can't select multiple values
|
|
1195
1193
|
if (!N) {
|
|
1196
1194
|
return;
|
|
1197
1195
|
}
|
|
1198
1196
|
var r = (t = An()) !== null && t !== void 0 ? t : [];
|
|
1199
|
-
var l = j().apply(void 0, [ r ].concat(
|
|
1197
|
+
var l = j().apply(void 0, [ r ].concat(qe(kn.current)));
|
|
1200
1198
|
// this will unselect all selected values unless those values are disabled or hidden by the filter
|
|
1201
1199
|
var a = n().Children.toArray(f).filter((function(e) {
|
|
1202
|
-
return
|
|
1200
|
+
return ln(e) && (y()(r, e.props.value) && e.props.disabled || y()(l, e.props.value));
|
|
1203
1201
|
})).map((function(e) {
|
|
1204
1202
|
return e.props.value;
|
|
1205
1203
|
}));
|
|
1206
|
-
if (!
|
|
1207
|
-
|
|
1204
|
+
if (!he) {
|
|
1205
|
+
sn(a);
|
|
1208
1206
|
}
|
|
1209
|
-
|
|
1207
|
+
$ === null || $ === void 0 ? void 0 : $(e, {
|
|
1210
1208
|
values: a,
|
|
1211
1209
|
name: V,
|
|
1212
1210
|
reason: "clearAll"
|
|
1213
1211
|
});
|
|
1214
|
-
}), [ f, An,
|
|
1215
|
-
var
|
|
1216
|
-
if (
|
|
1212
|
+
}), [ f, An, he, N, V, $ ]);
|
|
1213
|
+
var Nn = (0, e.useCallback)((function(e) {
|
|
1214
|
+
if (He && !E) {
|
|
1217
1215
|
U === null || U === void 0 ? void 0 : U(e);
|
|
1218
1216
|
}
|
|
1219
|
-
}), [
|
|
1220
|
-
var
|
|
1221
|
-
var t =
|
|
1222
|
-
if (t === "
|
|
1223
|
-
if (
|
|
1217
|
+
}), [ He, E, U ]);
|
|
1218
|
+
var Vn = (0, e.useCallback)((function(n) {
|
|
1219
|
+
var t = n.key;
|
|
1220
|
+
if (t === "Tab") {
|
|
1221
|
+
if (de && On.current && Sn.current <= 1) {
|
|
1224
1222
|
n.preventDefault();
|
|
1225
|
-
|
|
1223
|
+
qn(n, On.current);
|
|
1226
1224
|
}
|
|
1227
1225
|
}
|
|
1228
1226
|
if (n.shiftKey || n.metaKey || n.ctrlKey) {
|
|
1229
1227
|
if (t === "a" && (n.ctrlKey || n.metaKey)) {
|
|
1230
1228
|
// handle control + A
|
|
1231
|
-
if (
|
|
1232
|
-
Nn(n);
|
|
1233
|
-
} else {
|
|
1229
|
+
if (Pn.current === "all") {
|
|
1234
1230
|
Bn(n);
|
|
1231
|
+
} else {
|
|
1232
|
+
_n(n);
|
|
1235
1233
|
}
|
|
1236
1234
|
}
|
|
1237
1235
|
return;
|
|
1238
1236
|
}
|
|
1239
|
-
if (t === "
|
|
1237
|
+
if (t === "ArrowDown") {
|
|
1240
1238
|
n.preventDefault();
|
|
1241
|
-
|
|
1239
|
+
Me(Math.min(Re + 1, ce === "checkbox" ? Sn.current : Sn.current - 1));
|
|
1242
1240
|
if (f && U) {
|
|
1243
1241
|
var r;
|
|
1244
1242
|
var l = e.Children.toArray(f).length - (2 + ((r = An()) !== null && r !== void 0 ? r : []).length);
|
|
1245
|
-
if (
|
|
1246
|
-
|
|
1243
|
+
if (Re === l) {
|
|
1244
|
+
Nn(n);
|
|
1247
1245
|
}
|
|
1248
1246
|
}
|
|
1249
1247
|
}
|
|
1250
|
-
if (t === "
|
|
1248
|
+
if (t === "ArrowUp") {
|
|
1251
1249
|
n.preventDefault();
|
|
1252
|
-
|
|
1250
|
+
Me(Math.max(Re - 1, 0));
|
|
1253
1251
|
}
|
|
1254
|
-
if (t === "
|
|
1255
|
-
if (
|
|
1256
|
-
if (
|
|
1257
|
-
Nn(n);
|
|
1258
|
-
} else {
|
|
1252
|
+
if (t === "Enter" && On.current && He) {
|
|
1253
|
+
if (On.current === "selectAll") {
|
|
1254
|
+
if (Pn.current === "all") {
|
|
1259
1255
|
Bn(n);
|
|
1256
|
+
} else {
|
|
1257
|
+
_n(n);
|
|
1260
1258
|
}
|
|
1261
1259
|
} else {
|
|
1262
1260
|
n.preventDefault();
|
|
1263
|
-
|
|
1261
|
+
qn(n, On.current);
|
|
1264
1262
|
}
|
|
1265
1263
|
}
|
|
1266
|
-
}), [
|
|
1267
|
-
var
|
|
1264
|
+
}), [ Re, f, An, Bn, Nn, _n, U, He, ce, de, qn ]);
|
|
1265
|
+
var Kn = (0, e.useCallback)((function(e, n) {
|
|
1268
1266
|
var t = n.value;
|
|
1269
1267
|
e.preventDefault();
|
|
1270
|
-
if (!
|
|
1268
|
+
if (!He) {
|
|
1271
1269
|
return;
|
|
1272
1270
|
}
|
|
1273
|
-
|
|
1274
|
-
}), [
|
|
1275
|
-
var
|
|
1271
|
+
qn(e, t);
|
|
1272
|
+
}), [ He, qn ]);
|
|
1273
|
+
var Fn = (0, e.useCallback)((function(e, n) {
|
|
1276
1274
|
var t = e.nativeEvent.key;
|
|
1277
1275
|
// Checking for a single character to avoid complications from double-byte languages and emojis.
|
|
1278
1276
|
if (t.length === 1) {
|
|
@@ -1281,96 +1279,96 @@
|
|
|
1281
1279
|
index: 0,
|
|
1282
1280
|
value: t
|
|
1283
1281
|
};
|
|
1284
|
-
if (!
|
|
1282
|
+
if (!bn.current) {
|
|
1285
1283
|
if (t === " ") {
|
|
1286
|
-
|
|
1284
|
+
Dn();
|
|
1287
1285
|
return;
|
|
1288
1286
|
}
|
|
1289
|
-
r =
|
|
1290
|
-
} else if (
|
|
1291
|
-
l.index =
|
|
1292
|
-
r =
|
|
1287
|
+
r = we(yn.current, l);
|
|
1288
|
+
} else if (gn.current.length > 1) {
|
|
1289
|
+
l.index = bn.current.index + 1;
|
|
1290
|
+
r = we(gn.current, l);
|
|
1293
1291
|
}
|
|
1294
1292
|
if (r.length) {
|
|
1295
1293
|
var a;
|
|
1296
1294
|
var o = 0;
|
|
1297
1295
|
// If the active option is a first character match, cycle to the next matching option.
|
|
1298
1296
|
if (l.index === 0 && r.length > 1) {
|
|
1299
|
-
var i = r.indexOf(
|
|
1297
|
+
var i = r.indexOf(yn.current[n]);
|
|
1300
1298
|
if (i >= 0) {
|
|
1301
1299
|
o = i === r.length - 1 ? 0 : i + 1;
|
|
1302
1300
|
}
|
|
1303
1301
|
}
|
|
1304
1302
|
var u = r[o];
|
|
1305
1303
|
var c = u.value, s = u.label;
|
|
1306
|
-
var f =
|
|
1304
|
+
var f = Cn.current[an(c, s)];
|
|
1307
1305
|
f === null || f === void 0 ? void 0 : (a = f.focus) === null || a === void 0 ? void 0 : a.call(f);
|
|
1308
1306
|
}
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
if (
|
|
1312
|
-
clearTimeout(
|
|
1307
|
+
gn.current = r;
|
|
1308
|
+
bn.current = l;
|
|
1309
|
+
if (mn.current) {
|
|
1310
|
+
clearTimeout(mn.current);
|
|
1313
1311
|
}
|
|
1314
|
-
|
|
1312
|
+
mn.current = setTimeout(Dn, 500);
|
|
1315
1313
|
e.preventDefault();
|
|
1316
1314
|
e.stopPropagation();
|
|
1317
1315
|
}
|
|
1318
1316
|
}), []);
|
|
1319
|
-
var
|
|
1317
|
+
var Hn = (0, e.useCallback)((function(e, n) {
|
|
1320
1318
|
var t = n.value;
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1319
|
+
Be(t);
|
|
1320
|
+
ze(true);
|
|
1321
|
+
Me(0);
|
|
1322
|
+
J === null || J === void 0 ? void 0 : J(e, {
|
|
1325
1323
|
keyword: t
|
|
1326
1324
|
});
|
|
1327
|
-
}), [
|
|
1328
|
-
var
|
|
1329
|
-
|
|
1325
|
+
}), [ J ]);
|
|
1326
|
+
var zn = (0, e.useCallback)((function() {
|
|
1327
|
+
Je(true);
|
|
1330
1328
|
}), []);
|
|
1331
|
-
var
|
|
1332
|
-
|
|
1329
|
+
var Wn = (0, e.useCallback)((function() {
|
|
1330
|
+
Je(false);
|
|
1333
1331
|
}), []);
|
|
1334
|
-
var
|
|
1335
|
-
if (
|
|
1336
|
-
|
|
1332
|
+
var $n = (0, e.useCallback)((function(e) {
|
|
1333
|
+
if (hn.current !== Re) {
|
|
1334
|
+
xe(e);
|
|
1337
1335
|
}
|
|
1338
|
-
}), [
|
|
1339
|
-
var
|
|
1336
|
+
}), [ Re ]);
|
|
1337
|
+
var Xn = (0, e.useCallback)((function(e, n, t) {
|
|
1340
1338
|
if (t) {
|
|
1341
|
-
|
|
1339
|
+
wn.current = e;
|
|
1342
1340
|
}
|
|
1343
1341
|
if (e == null) {
|
|
1344
|
-
delete
|
|
1342
|
+
delete Cn.current[n];
|
|
1345
1343
|
} else {
|
|
1346
|
-
|
|
1344
|
+
Cn.current[n] = e;
|
|
1347
1345
|
}
|
|
1348
|
-
}), [
|
|
1346
|
+
}), [ Cn ]);
|
|
1349
1347
|
var Un = (0, e.useCallback)((function(e) {
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
}), [ O,
|
|
1353
|
-
var
|
|
1348
|
+
vn.current = e;
|
|
1349
|
+
Ie(O, e);
|
|
1350
|
+
}), [ O, vn ]);
|
|
1351
|
+
var Jn = (0, e.useMemo)((function() {
|
|
1354
1352
|
var e;
|
|
1355
1353
|
return (e = An()) !== null && e !== void 0 ? e : [];
|
|
1356
1354
|
}), [ An ]);
|
|
1357
|
-
var
|
|
1358
|
-
var
|
|
1359
|
-
var n = d()(
|
|
1360
|
-
return
|
|
1355
|
+
var Gn = e.Children.toArray(f);
|
|
1356
|
+
var Qn = Jn.some((function(e) {
|
|
1357
|
+
var n = d()(Gn, (function(n) {
|
|
1358
|
+
return ln(n) && n.props.value === e;
|
|
1361
1359
|
}));
|
|
1362
1360
|
return n && !n.props.disabled;
|
|
1363
1361
|
}));
|
|
1364
|
-
var
|
|
1365
|
-
var
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1362
|
+
var Yn = se === "immediately" ? Mn() : Ye;
|
|
1363
|
+
var Zn = (0, e.useMemo)((function() {
|
|
1364
|
+
Sn.current = 0;
|
|
1365
|
+
xn.current = undefined;
|
|
1366
|
+
jn.current = 0;
|
|
1367
|
+
On.current = undefined;
|
|
1368
|
+
yn.current = [];
|
|
1371
1369
|
var t = function e(n, t) {
|
|
1372
1370
|
return function(e) {
|
|
1373
|
-
return
|
|
1371
|
+
return Xn(e, n, t);
|
|
1374
1372
|
};
|
|
1375
1373
|
};
|
|
1376
1374
|
var r;
|
|
@@ -1380,34 +1378,34 @@
|
|
|
1380
1378
|
var i;
|
|
1381
1379
|
var c = e.Children.toArray(f).reduce((function(u, c, s) {
|
|
1382
1380
|
// ignore Headings and Dividers
|
|
1383
|
-
if (!
|
|
1381
|
+
if (!ln(c)) {
|
|
1384
1382
|
u.push(c);
|
|
1385
1383
|
return u;
|
|
1386
1384
|
}
|
|
1387
1385
|
var f = c.props, d = f.disabled, p = f.hidden, v = f.label, b = f.value;
|
|
1388
1386
|
// Find out if the search string exactly matches a value
|
|
1389
|
-
if (b ===
|
|
1387
|
+
if (b === _e) {
|
|
1390
1388
|
r = true;
|
|
1391
1389
|
}
|
|
1392
|
-
var m =
|
|
1390
|
+
var m = Jn && Jn.indexOf(b) >= 0;
|
|
1393
1391
|
var g = !!m && !d && !i;
|
|
1394
|
-
var y = l && !N && !S && !
|
|
1395
|
-
var h =
|
|
1392
|
+
var y = l && !N && !S && !E && !U;
|
|
1393
|
+
var h = an(b, v);
|
|
1396
1394
|
var O = -1;
|
|
1397
1395
|
if (y && !d && !p) {
|
|
1398
|
-
|
|
1396
|
+
yn.current.push({
|
|
1399
1397
|
label: v,
|
|
1400
1398
|
value: b
|
|
1401
1399
|
});
|
|
1402
|
-
O =
|
|
1400
|
+
O = yn.current.length - 1;
|
|
1403
1401
|
}
|
|
1404
1402
|
// Format the Menu.Item
|
|
1405
1403
|
var C = (0, e.cloneElement)(c, {
|
|
1406
1404
|
elementRef: t(h, g),
|
|
1407
1405
|
key: c.key || s,
|
|
1408
|
-
onClick:
|
|
1406
|
+
onClick: Kn,
|
|
1409
1407
|
onKeyDown: y ? function(e) {
|
|
1410
|
-
return
|
|
1408
|
+
return Fn(e, O);
|
|
1411
1409
|
} : undefined,
|
|
1412
1410
|
selected: m,
|
|
1413
1411
|
multiple: N,
|
|
@@ -1416,7 +1414,7 @@
|
|
|
1416
1414
|
if (g) {
|
|
1417
1415
|
i = true;
|
|
1418
1416
|
}
|
|
1419
|
-
if (
|
|
1417
|
+
if (Yn && Yn.indexOf(b) >= 0) {
|
|
1420
1418
|
if (a === 0) {
|
|
1421
1419
|
u.splice(a, 0, n().createElement(q.Divider, {
|
|
1422
1420
|
key: "topDivider"
|
|
@@ -1432,16 +1430,16 @@
|
|
|
1432
1430
|
}), []);
|
|
1433
1431
|
// In multiple mode, add missing items
|
|
1434
1432
|
if (N) {
|
|
1435
|
-
v()(
|
|
1433
|
+
v()(Jn, (function(e) {
|
|
1436
1434
|
var l = d()(c, (function(n) {
|
|
1437
|
-
return
|
|
1435
|
+
return ln(n) && n.props && n.props.value === e;
|
|
1438
1436
|
}));
|
|
1439
1437
|
if (!l) {
|
|
1440
|
-
if (e ===
|
|
1438
|
+
if (e === _e) {
|
|
1441
1439
|
r = true;
|
|
1442
1440
|
}
|
|
1443
|
-
var i =
|
|
1444
|
-
var u =
|
|
1441
|
+
var i = Yn && Yn.indexOf(e) >= 0;
|
|
1442
|
+
var u = Yn.length;
|
|
1445
1443
|
if (a === 0) {
|
|
1446
1444
|
c.splice(0, 0, n().createElement(q.Divider, {
|
|
1447
1445
|
key: "topDivider"
|
|
@@ -1450,13 +1448,13 @@
|
|
|
1450
1448
|
o = true;
|
|
1451
1449
|
}
|
|
1452
1450
|
var s = String(e);
|
|
1453
|
-
var f =
|
|
1454
|
-
c.splice(i ? 0 : u + 1, 0, n().createElement(
|
|
1451
|
+
var f = an(e, s);
|
|
1452
|
+
c.splice(i ? 0 : u + 1, 0, n().createElement(re, {
|
|
1455
1453
|
elementRef: t(f),
|
|
1456
1454
|
label: s,
|
|
1457
1455
|
value: e,
|
|
1458
1456
|
key: "missing-value-".concat(e),
|
|
1459
|
-
onClick:
|
|
1457
|
+
onClick: Kn,
|
|
1460
1458
|
multiple: N,
|
|
1461
1459
|
selected: true
|
|
1462
1460
|
}));
|
|
@@ -1468,15 +1466,15 @@
|
|
|
1468
1466
|
}
|
|
1469
1467
|
var p = S === "controlled";
|
|
1470
1468
|
// Filter the items
|
|
1471
|
-
var b = (0, z.stringToKeywords)(
|
|
1469
|
+
var b = (0, z.stringToKeywords)(_e);
|
|
1472
1470
|
c = p ? c : c.filter((function(e) {
|
|
1473
|
-
if (
|
|
1471
|
+
if (ln(e)) {
|
|
1474
1472
|
return (0, z.testPhrase)(e.props.label, b);
|
|
1475
1473
|
}
|
|
1476
1474
|
return true;
|
|
1477
1475
|
// Keep all headers and non-interactive options
|
|
1478
1476
|
})).map((function(n) {
|
|
1479
|
-
if (!
|
|
1477
|
+
if (!ln(n)) {
|
|
1480
1478
|
return n;
|
|
1481
1479
|
}
|
|
1482
1480
|
// highlight matched text
|
|
@@ -1487,26 +1485,26 @@
|
|
|
1487
1485
|
});
|
|
1488
1486
|
}));
|
|
1489
1487
|
// Add the option to add the new value
|
|
1490
|
-
if (s && !r &&
|
|
1488
|
+
if (s && !r && _e) {
|
|
1491
1489
|
var m = o ? a + 1 : a;
|
|
1492
|
-
var g = "".concat(
|
|
1493
|
-
var y =
|
|
1494
|
-
c.splice(m, 0, n().createElement(
|
|
1490
|
+
var g = "".concat(_e, " (new value)");
|
|
1491
|
+
var y = an(_e, g);
|
|
1492
|
+
c.splice(m, 0, n().createElement(re, {
|
|
1495
1493
|
elementRef: t(y),
|
|
1496
1494
|
label: g,
|
|
1497
|
-
value:
|
|
1495
|
+
value: _e,
|
|
1498
1496
|
key: "newValue",
|
|
1499
1497
|
multiple: N,
|
|
1500
|
-
onClick:
|
|
1498
|
+
onClick: Kn
|
|
1501
1499
|
}));
|
|
1502
1500
|
}
|
|
1503
1501
|
// When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
|
|
1504
|
-
var h =
|
|
1502
|
+
var h = ce === "checkbox" && N && c.length > 1 ? 1 : 0;
|
|
1505
1503
|
var O = true;
|
|
1506
1504
|
// Highlight the selected Items and remove hidden
|
|
1507
1505
|
c = c.reduce((function(n, t) {
|
|
1508
1506
|
// ignore Dividers & Headings
|
|
1509
|
-
if (!
|
|
1507
|
+
if (!ln(t)) {
|
|
1510
1508
|
n.push(t);
|
|
1511
1509
|
return n;
|
|
1512
1510
|
}
|
|
@@ -1514,13 +1512,13 @@
|
|
|
1514
1512
|
if (t.props && t.props.hidden) {
|
|
1515
1513
|
return n;
|
|
1516
1514
|
}
|
|
1517
|
-
if (t.props.selected && !t.props.disabled &&
|
|
1518
|
-
|
|
1515
|
+
if (t.props.selected && !t.props.disabled && xn.current == null) {
|
|
1516
|
+
xn.current = Sn.current;
|
|
1519
1517
|
}
|
|
1520
|
-
var r = h ===
|
|
1518
|
+
var r = h === Re;
|
|
1521
1519
|
h += 1;
|
|
1522
|
-
|
|
1523
|
-
|
|
1520
|
+
Sn.current += 1;
|
|
1521
|
+
jn.current += t.props.selected ? 1 : 0;
|
|
1524
1522
|
if (t.key !== "newValue" && !t.props.disabled && !t.props.selected) {
|
|
1525
1523
|
O = false;
|
|
1526
1524
|
}
|
|
@@ -1529,115 +1527,117 @@
|
|
|
1529
1527
|
return n;
|
|
1530
1528
|
}
|
|
1531
1529
|
if (!t.props.disabled) {
|
|
1532
|
-
|
|
1530
|
+
On.current = t.props.value;
|
|
1533
1531
|
}
|
|
1534
1532
|
var l = (0, e.cloneElement)(t, {
|
|
1535
1533
|
active: r,
|
|
1536
|
-
elementRef:
|
|
1537
|
-
id:
|
|
1534
|
+
elementRef: $n,
|
|
1535
|
+
id: je
|
|
1538
1536
|
});
|
|
1539
1537
|
n.push(l);
|
|
1540
1538
|
return n;
|
|
1541
1539
|
}), []);
|
|
1542
|
-
|
|
1540
|
+
Pn.current = jn.current === 0 && "none" || O && "all" || "some";
|
|
1543
1541
|
// add select all option
|
|
1544
|
-
if (
|
|
1542
|
+
if (ce === "checkbox" && N && Sn.current > 0) {
|
|
1545
1543
|
var C;
|
|
1546
|
-
if (
|
|
1547
|
-
if (
|
|
1544
|
+
if (Pn.current === "all") {
|
|
1545
|
+
if (_e === "") {
|
|
1548
1546
|
C = (0, u._)("Clear all");
|
|
1549
1547
|
} else {
|
|
1550
1548
|
C = (0, u._)("Clear all matches");
|
|
1551
1549
|
}
|
|
1552
|
-
} else if (
|
|
1550
|
+
} else if (_e === "") {
|
|
1553
1551
|
C = (0, u._)("Select all");
|
|
1554
1552
|
} else {
|
|
1555
1553
|
C = (0, u._)("Select all matches");
|
|
1556
1554
|
}
|
|
1557
|
-
if (
|
|
1558
|
-
|
|
1555
|
+
if (Re === 0 && Ue) {
|
|
1556
|
+
On.current = "selectAll";
|
|
1559
1557
|
}
|
|
1560
|
-
c.unshift( n().createElement(
|
|
1558
|
+
c.unshift( n().createElement(oe, {
|
|
1561
1559
|
key: "select-all-option",
|
|
1562
|
-
active:
|
|
1563
|
-
changedToggle: !!
|
|
1564
|
-
elementRef:
|
|
1565
|
-
id:
|
|
1566
|
-
onClick:
|
|
1560
|
+
active: Re === 0,
|
|
1561
|
+
changedToggle: !!be,
|
|
1562
|
+
elementRef: $n,
|
|
1563
|
+
id: Re === 0 ? je : undefined,
|
|
1564
|
+
onClick: Pn.current === "all" ? Bn : _n,
|
|
1567
1565
|
selectAllLabel: C,
|
|
1568
|
-
selected:
|
|
1569
|
-
totalCount:
|
|
1566
|
+
selected: Pn.current === "all" || Pn.current !== "none" && "some",
|
|
1567
|
+
totalCount: Jn.length,
|
|
1570
1568
|
tabIndex: -1
|
|
1571
1569
|
}), n().createElement(q.Divider, {
|
|
1572
1570
|
key: "selectAllDivider"
|
|
1573
1571
|
}));
|
|
1574
1572
|
}
|
|
1575
|
-
|
|
1576
|
-
if (
|
|
1573
|
+
kn.current = c.reduce((function(e, n) {
|
|
1574
|
+
if (ln(n)) {
|
|
1577
1575
|
e.push(n.props.value);
|
|
1578
1576
|
}
|
|
1579
1577
|
return e;
|
|
1580
1578
|
}), []);
|
|
1581
1579
|
return c;
|
|
1582
|
-
}), [
|
|
1583
|
-
var
|
|
1584
|
-
var r = t.anchorWidth, l = t.maxHeight, o = t.placement;
|
|
1585
|
-
var
|
|
1580
|
+
}), [ Re, je, l, s, f, Jn, S, _e, $n, Bn, Kn, Fn, Xn, _n, E, N, Yn, U, ce, Ue, be ]);
|
|
1581
|
+
var et = function e(t) {
|
|
1582
|
+
var r = t.anchorWidth, l = t.maxHeight, o = t.placement, i = t.toggleId;
|
|
1583
|
+
var u = tn({
|
|
1586
1584
|
anchorWidth: r,
|
|
1587
1585
|
isMultiple: N,
|
|
1588
1586
|
maxHeight: l,
|
|
1589
1587
|
menuStyle: B
|
|
1590
1588
|
});
|
|
1591
|
-
var
|
|
1592
|
-
var
|
|
1589
|
+
var c = Jn.length > 0 && !Qn && !S ? 0 : undefined;
|
|
1590
|
+
var s = {
|
|
1593
1591
|
"aria-multiselectable": N || undefined,
|
|
1594
|
-
childrenStart: !!S && n().createElement(
|
|
1595
|
-
activeItemId:
|
|
1596
|
-
filterA11yId:
|
|
1597
|
-
filterKeyword:
|
|
1598
|
-
hasChildren:
|
|
1599
|
-
return
|
|
1592
|
+
childrenStart: !!S && n().createElement(fn, {
|
|
1593
|
+
activeItemId: je,
|
|
1594
|
+
filterA11yId: Rn,
|
|
1595
|
+
filterKeyword: _e,
|
|
1596
|
+
hasChildren: Zn.some((function(e) {
|
|
1597
|
+
return ln(e);
|
|
1600
1598
|
})),
|
|
1601
1599
|
inputId: P,
|
|
1602
|
-
inputRef:
|
|
1603
|
-
menuListboxId:
|
|
1600
|
+
inputRef: T,
|
|
1601
|
+
menuListboxId: Pe,
|
|
1604
1602
|
multiple: N,
|
|
1605
|
-
onClearAll:
|
|
1606
|
-
onSelectAll:
|
|
1607
|
-
onTextBlur:
|
|
1608
|
-
onTextChange:
|
|
1609
|
-
onTextFocus:
|
|
1610
|
-
onTextKeyDown:
|
|
1611
|
-
optionSelection:
|
|
1603
|
+
onClearAll: Bn,
|
|
1604
|
+
onSelectAll: _n,
|
|
1605
|
+
onTextBlur: Wn,
|
|
1606
|
+
onTextChange: Hn,
|
|
1607
|
+
onTextFocus: zn,
|
|
1608
|
+
onTextKeyDown: Vn,
|
|
1609
|
+
optionSelection: Pn,
|
|
1612
1610
|
placement: o,
|
|
1613
|
-
selectAllAppearance:
|
|
1611
|
+
selectAllAppearance: ce,
|
|
1614
1612
|
textHasFocus: Ue
|
|
1615
1613
|
}),
|
|
1616
1614
|
focusMode: S ? "never" : undefined,
|
|
1617
|
-
isLoading:
|
|
1618
|
-
|
|
1619
|
-
|
|
1615
|
+
isLoading: E,
|
|
1616
|
+
labelledBy: "".concat(Rn !== null && Rn !== void 0 ? Rn : "", " ").concat(i !== null && i !== void 0 ? i : "").trim(),
|
|
1617
|
+
// NVDA ignores aria-labelledby attribute on popover, but reads it on menu
|
|
1618
|
+
menuId: Pe,
|
|
1619
|
+
onScrollBottom: U ? Nn : undefined,
|
|
1620
1620
|
placement: o !== null && o !== void 0 ? o : undefined,
|
|
1621
1621
|
noOptionsMessage: F,
|
|
1622
1622
|
footerMessage: k,
|
|
1623
1623
|
animateLoading: a,
|
|
1624
1624
|
loadingMessage: L,
|
|
1625
|
-
onScroll:
|
|
1626
|
-
style:
|
|
1627
|
-
tabIndex:
|
|
1625
|
+
onScroll: X,
|
|
1626
|
+
style: u,
|
|
1627
|
+
tabIndex: c
|
|
1628
1628
|
};
|
|
1629
|
-
if (
|
|
1629
|
+
if (ve) {
|
|
1630
1630
|
|
|
1631
|
-
return n().createElement(D.VirtualizedResultsMenu,
|
|
1632
|
-
virtualization:
|
|
1633
|
-
},
|
|
1631
|
+
return n().createElement(D.VirtualizedResultsMenu, Ne({
|
|
1632
|
+
virtualization: ve
|
|
1633
|
+
}, s), Zn);
|
|
1634
1634
|
}
|
|
1635
1635
|
|
|
1636
|
-
return n().createElement(_(),
|
|
1636
|
+
return n().createElement(_(), s, Zn);
|
|
1637
1637
|
};
|
|
1638
|
-
var
|
|
1638
|
+
var nt = (0, e.useMemo)((function() {
|
|
1639
1639
|
|
|
1640
|
-
return n().createElement(
|
|
1640
|
+
return n().createElement(pn, Ne({
|
|
1641
1641
|
appearance: i,
|
|
1642
1642
|
append: c,
|
|
1643
1643
|
currentValues: An(),
|
|
@@ -1647,45 +1647,45 @@
|
|
|
1647
1647
|
elementRef: Un,
|
|
1648
1648
|
error: C,
|
|
1649
1649
|
inline: x,
|
|
1650
|
-
labelText:
|
|
1651
|
-
labelledBy:
|
|
1650
|
+
labelText: A,
|
|
1651
|
+
labelledBy: R,
|
|
1652
1652
|
multiple: N,
|
|
1653
|
-
onClick:
|
|
1654
|
-
placeholder:
|
|
1655
|
-
prefixLabel:
|
|
1656
|
-
prepend:
|
|
1657
|
-
required:
|
|
1658
|
-
suffixLabel:
|
|
1659
|
-
toggle:
|
|
1660
|
-
toggleContent:
|
|
1661
|
-
},
|
|
1662
|
-
}), [ i, c, An, N, g, h, C, Un, x,
|
|
1653
|
+
onClick: G,
|
|
1654
|
+
placeholder: ne,
|
|
1655
|
+
prefixLabel: te,
|
|
1656
|
+
prepend: le,
|
|
1657
|
+
required: Z,
|
|
1658
|
+
suffixLabel: fe,
|
|
1659
|
+
toggle: be,
|
|
1660
|
+
toggleContent: ge
|
|
1661
|
+
}, ye), f);
|
|
1662
|
+
}), [ i, c, An, N, g, h, C, Un, x, A, R, G, ne, te, le, Z, fe, be, ge, ye, f ]);
|
|
1663
1663
|
|
|
1664
|
-
return n().createElement(
|
|
1665
|
-
closeReasons:
|
|
1664
|
+
return n().createElement(M(), {
|
|
1665
|
+
closeReasons: rn,
|
|
1666
1666
|
inputId: P,
|
|
1667
|
-
"aria-labelledby":
|
|
1668
|
-
toggle:
|
|
1669
|
-
onRequestOpen:
|
|
1670
|
-
onRequestClose:
|
|
1671
|
-
open:
|
|
1667
|
+
"aria-labelledby": Rn,
|
|
1668
|
+
toggle: nt,
|
|
1669
|
+
onRequestOpen: Ln,
|
|
1670
|
+
onRequestClose: In,
|
|
1671
|
+
open: He,
|
|
1672
1672
|
openWithArrowKeys: true,
|
|
1673
|
-
repositionMode:
|
|
1673
|
+
repositionMode: ie,
|
|
1674
1674
|
defaultPlacement: b,
|
|
1675
1675
|
canCoverAnchor: Ae().innerHeight < 500,
|
|
1676
1676
|
retainFocus: false,
|
|
1677
|
-
takeFocus:
|
|
1678
|
-
},
|
|
1677
|
+
takeFocus: Jn.length === 0 || Jn.length > 0 && !Qn || !!S
|
|
1678
|
+
}, et);
|
|
1679
1679
|
}
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
/* harmony default export */ const
|
|
1680
|
+
vn.propTypes = en;
|
|
1681
|
+
vn.componentType = "SelectBase";
|
|
1682
|
+
vn.Option = re;
|
|
1683
|
+
vn.Divider = q.Divider;
|
|
1684
|
+
vn.Heading = q.Heading;
|
|
1685
|
+
/* harmony default export */ const bn = vn;
|
|
1686
1686
|
// CONCATENATED MODULE: ./src/Select/Option.tsx
|
|
1687
|
-
function
|
|
1688
|
-
return
|
|
1687
|
+
function mn() {
|
|
1688
|
+
return mn = Object.assign ? Object.assign.bind() : function(e) {
|
|
1689
1689
|
for (var n = 1; n < arguments.length; n++) {
|
|
1690
1690
|
var t = arguments[n];
|
|
1691
1691
|
for (var r in t) {
|
|
@@ -1693,11 +1693,11 @@
|
|
|
1693
1693
|
}
|
|
1694
1694
|
}
|
|
1695
1695
|
return e;
|
|
1696
|
-
},
|
|
1696
|
+
}, mn.apply(null, arguments);
|
|
1697
1697
|
}
|
|
1698
|
-
function
|
|
1698
|
+
function gn(e, n) {
|
|
1699
1699
|
if (null == e) return {};
|
|
1700
|
-
var t, r, l =
|
|
1700
|
+
var t, r, l = yn(e, n);
|
|
1701
1701
|
if (Object.getOwnPropertySymbols) {
|
|
1702
1702
|
var a = Object.getOwnPropertySymbols(e);
|
|
1703
1703
|
for (r = 0; r < a.length; r++) {
|
|
@@ -1706,7 +1706,7 @@
|
|
|
1706
1706
|
}
|
|
1707
1707
|
return l;
|
|
1708
1708
|
}
|
|
1709
|
-
function
|
|
1709
|
+
function yn(e, n) {
|
|
1710
1710
|
if (null == e) return {};
|
|
1711
1711
|
var t = {};
|
|
1712
1712
|
for (var r in e) {
|
|
@@ -1717,7 +1717,7 @@
|
|
|
1717
1717
|
}
|
|
1718
1718
|
return t;
|
|
1719
1719
|
}
|
|
1720
|
-
var
|
|
1720
|
+
var hn = {
|
|
1721
1721
|
/** @private */
|
|
1722
1722
|
active: a().bool,
|
|
1723
1723
|
children: a().node,
|
|
@@ -1743,11 +1743,11 @@
|
|
|
1743
1743
|
};
|
|
1744
1744
|
/**
|
|
1745
1745
|
* An option within a `Select`. Any elements passed to it should be memoized.
|
|
1746
|
-
*/ function
|
|
1747
|
-
var t = e.children, r = e.descriptionPosition, l = r === void 0 ? "bottom" : r, a = e.elementRef, o = e.label, i =
|
|
1746
|
+
*/ function On(e) {
|
|
1747
|
+
var t = e.children, r = e.descriptionPosition, l = r === void 0 ? "bottom" : r, a = e.elementRef, o = e.label, i = gn(e, [ "children", "descriptionPosition", "elementRef", "label" ]);
|
|
1748
1748
|
// @docs-props-type OptionPropsBase
|
|
1749
1749
|
|
|
1750
|
-
return n().createElement(
|
|
1750
|
+
return n().createElement(re, mn({
|
|
1751
1751
|
descriptionPosition: l,
|
|
1752
1752
|
label: o
|
|
1753
1753
|
}, i, {
|
|
@@ -1755,13 +1755,13 @@
|
|
|
1755
1755
|
multiple: false
|
|
1756
1756
|
}), t || o);
|
|
1757
1757
|
}
|
|
1758
|
-
var
|
|
1758
|
+
var Cn = (0, e.memo)(On);
|
|
1759
1759
|
// @ts-expect-error Need to set propTypes on OptionMemoized so that javascript propType validation will work
|
|
1760
|
-
|
|
1761
|
-
/* harmony default export */ const
|
|
1760
|
+
Cn.propTypes = hn;
|
|
1761
|
+
/* harmony default export */ const Sn = Cn;
|
|
1762
1762
|
// CONCATENATED MODULE: ./src/Select/Select.tsx
|
|
1763
|
-
function
|
|
1764
|
-
return
|
|
1763
|
+
function kn() {
|
|
1764
|
+
return kn = Object.assign ? Object.assign.bind() : function(e) {
|
|
1765
1765
|
for (var n = 1; n < arguments.length; n++) {
|
|
1766
1766
|
var t = arguments[n];
|
|
1767
1767
|
for (var r in t) {
|
|
@@ -1769,11 +1769,11 @@
|
|
|
1769
1769
|
}
|
|
1770
1770
|
}
|
|
1771
1771
|
return e;
|
|
1772
|
-
},
|
|
1772
|
+
}, kn.apply(null, arguments);
|
|
1773
1773
|
}
|
|
1774
|
-
function
|
|
1774
|
+
function wn(e, n) {
|
|
1775
1775
|
if (null == e) return {};
|
|
1776
|
-
var t, r, l =
|
|
1776
|
+
var t, r, l = xn(e, n);
|
|
1777
1777
|
if (Object.getOwnPropertySymbols) {
|
|
1778
1778
|
var a = Object.getOwnPropertySymbols(e);
|
|
1779
1779
|
for (r = 0; r < a.length; r++) {
|
|
@@ -1782,7 +1782,7 @@
|
|
|
1782
1782
|
}
|
|
1783
1783
|
return l;
|
|
1784
1784
|
}
|
|
1785
|
-
function
|
|
1785
|
+
function xn(e, n) {
|
|
1786
1786
|
if (null == e) return {};
|
|
1787
1787
|
var t = {};
|
|
1788
1788
|
for (var r in e) {
|
|
@@ -1795,7 +1795,7 @@
|
|
|
1795
1795
|
}
|
|
1796
1796
|
/** @public */
|
|
1797
1797
|
/** @public */
|
|
1798
|
-
/** @public */ var
|
|
1798
|
+
/** @public */ var jn = {
|
|
1799
1799
|
allowKeyMatching: a().bool,
|
|
1800
1800
|
animateLoading: a().bool,
|
|
1801
1801
|
appearance: a().oneOf([ "default", "link", "subtle" ]),
|
|
@@ -1837,10 +1837,10 @@
|
|
|
1837
1837
|
/** @private. */
|
|
1838
1838
|
virtualization: a().number
|
|
1839
1839
|
};
|
|
1840
|
-
var
|
|
1841
|
-
var
|
|
1842
|
-
function
|
|
1843
|
-
var r = t.allowKeyMatching, l = r === void 0 ? true : r, a = t.appearance, o = a === void 0 ? "default" : a, u = t.defaultPlacement, c = u === void 0 ? "vertical" : u, s = t.defaultValue, f = t.inline, d = f === void 0 ? true : f, p = t.noOptionsMessage, v = p === void 0 ?
|
|
1840
|
+
var Pn = (0, u._)("No matches");
|
|
1841
|
+
var Tn = (0, u._)("Select...");
|
|
1842
|
+
function En(t) {
|
|
1843
|
+
var r = t.allowKeyMatching, l = r === void 0 ? true : r, a = t.appearance, o = a === void 0 ? "default" : a, u = t.defaultPlacement, c = u === void 0 ? "vertical" : u, s = t.defaultValue, f = t.inline, d = f === void 0 ? true : f, p = t.noOptionsMessage, v = p === void 0 ? Pn : p, b = t.onChange, m = t.placeholder, g = m === void 0 ? Tn : m, y = t.toggleContent, h = y === void 0 ? "optionChildren" : y, O = t.value, C = wn(t, [ "allowKeyMatching", "appearance", "defaultPlacement", "defaultValue", "inline", "noOptionsMessage", "onChange", "placeholder", "toggleContent", "value" ]);
|
|
1844
1844
|
// @docs-props-type SelectPropsBase
|
|
1845
1845
|
if (false) {}
|
|
1846
1846
|
var S = i()({
|
|
@@ -1848,7 +1848,7 @@
|
|
|
1848
1848
|
/* eslint-disable-next-line prefer-rest-params */
|
|
1849
1849
|
componentProps: arguments[0]
|
|
1850
1850
|
});
|
|
1851
|
-
// Memoized otherwise useControlled can trigger "default props changed after render" warning even though nothing changed on subsequent renders
|
|
1851
|
+
// Memoized otherwise useControlled in SelectBase can trigger "default props changed after render" warning even though nothing changed on subsequent renders
|
|
1852
1852
|
var k = (0, e.useMemo)((function() {
|
|
1853
1853
|
// wrap defaultValue in an array once to avoid failing <SelectBase>'s defaultValues comparison check
|
|
1854
1854
|
if (s != null) {
|
|
@@ -1877,7 +1877,7 @@
|
|
|
1877
1877
|
return t;
|
|
1878
1878
|
}), [ k, b, S, O ]);
|
|
1879
1879
|
|
|
1880
|
-
return n().createElement(
|
|
1880
|
+
return n().createElement(bn, kn({
|
|
1881
1881
|
allowKeyMatching: l,
|
|
1882
1882
|
appearance: o,
|
|
1883
1883
|
defaultPlacement: c,
|
|
@@ -1889,11 +1889,11 @@
|
|
|
1889
1889
|
multiple: false
|
|
1890
1890
|
}));
|
|
1891
1891
|
}
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
/* harmony default export */ const
|
|
1892
|
+
En.propTypes = jn;
|
|
1893
|
+
En.Option = Sn;
|
|
1894
|
+
En.Heading = q.Heading;
|
|
1895
|
+
En.Divider = q.Divider;
|
|
1896
|
+
/* harmony default export */ const Rn = En;
|
|
1897
1897
|
}) // CONCATENATED MODULE: ./src/Select/index.ts
|
|
1898
1898
|
();
|
|
1899
1899
|
module.exports = r;
|