@splunk/react-ui 5.0.0-beta.5 → 5.0.0-rc.2
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/ButtonSimple.js +92 -168
- package/{CHANGELOG.v5.mdx → CHANGELOG.v5.md} +43 -0
- package/Calendar.js +148 -151
- package/Card.js +139 -139
- package/Code.js +197 -167
- package/CollapsiblePanel.js +172 -164
- package/Color.js +584 -506
- package/ComboBox.js +51 -51
- package/ControlGroup.js +132 -127
- package/Date.js +137 -150
- package/Dropdown.js +97 -96
- package/DualListbox.js +468 -469
- package/FetchOptions.d.ts +2 -2
- package/FormRows.js +158 -157
- package/JSONTree.js +354 -360
- package/{MIGRATION.mdx → MIGRATION.md} +13 -43
- package/{MIGRATION.v5.mdx → MIGRATION.v5.md} +67 -1
- package/Markdown.js +3 -4
- package/Menu.js +194 -195
- package/Modal.js +18 -18
- package/ModalLayer.js +171 -217
- package/Multiselect.js +785 -778
- package/Number.js +103 -102
- package/Popover.js +48 -46
- package/RadioBar.js +144 -146
- package/Resize.js +149 -151
- package/ResultsMenu.js +112 -114
- package/Search.js +49 -49
- package/Select.js +455 -457
- package/Slider.js +328 -331
- package/Switch.js +251 -178
- package/TabBar.js +277 -280
- package/Table.js +1212 -1178
- package/Text.js +45 -46
- package/Tooltip.js +192 -189
- package/Tree.js +177 -188
- package/package.json +10 -9
- package/types/src/Code/Code.d.ts +1 -1
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
- package/types/src/Dropdown/Dropdown.d.ts +5 -2
- package/types/src/Layer/Layer.d.ts +2 -1
- package/types/src/Layer/index.d.ts +1 -0
- package/types/src/ModalLayer/ModalLayer.d.ts +16 -21
- package/types/src/Number/Number.d.ts +1 -1
- package/types/src/Popover/Popover.d.ts +5 -2
- 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/useRovingFocus.js +20 -23
- package/types/src/fixtures/FetchOptions.d.ts +0 -76
package/Multiselect.js
CHANGED
|
@@ -136,8 +136,8 @@
|
|
|
136
136
|
r.d(t, {
|
|
137
137
|
Divider: () => /* reexport */ u.Divider,
|
|
138
138
|
Heading: () => /* reexport */ u.Heading,
|
|
139
|
-
Option: () => /* reexport */
|
|
140
|
-
default: () => /* reexport */
|
|
139
|
+
Option: () => /* reexport */ E,
|
|
140
|
+
default: () => /* reexport */ Hr
|
|
141
141
|
});
|
|
142
142
|
// EXTERNAL MODULE: external "react"
|
|
143
143
|
var e = r(9497);
|
|
@@ -197,18 +197,18 @@
|
|
|
197
197
|
return e;
|
|
198
198
|
}
|
|
199
199
|
function m(e, n, r) {
|
|
200
|
-
return (n =
|
|
200
|
+
return (n = g(n)) in e ? Object.defineProperty(e, n, {
|
|
201
201
|
value: r,
|
|
202
202
|
enumerable: !0,
|
|
203
203
|
configurable: !0,
|
|
204
204
|
writable: !0
|
|
205
205
|
}) : e[n] = r, e;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
var n =
|
|
207
|
+
function g(e) {
|
|
208
|
+
var n = y(e, "string");
|
|
209
209
|
return "symbol" == f(n) ? n : n + "";
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function y(e, n) {
|
|
212
212
|
if ("object" != f(e) || !e) return e;
|
|
213
213
|
var r = e[Symbol.toPrimitive];
|
|
214
214
|
if (void 0 !== r) {
|
|
@@ -270,27 +270,27 @@
|
|
|
270
270
|
};
|
|
271
271
|
/**
|
|
272
272
|
* An option within a `Multiselect`.
|
|
273
|
-
*/ function
|
|
274
|
-
var t = r.children, o = r.descriptionPosition, l = o === void 0 ? "bottom" : o, a = r.disabled, i = r.elementRef, c = r.icon, s = r.label, d = r.multiple, f = r.onClick, v = r.role, m = v === void 0 ? "option" : v,
|
|
273
|
+
*/ function w(r) {
|
|
274
|
+
var t = r.children, o = r.descriptionPosition, l = o === void 0 ? "bottom" : o, a = r.disabled, i = r.elementRef, c = r.icon, s = r.label, d = r.multiple, f = r.onClick, v = r.role, m = v === void 0 ? "option" : v, g = r.value, y = h(r, [ "children", "descriptionPosition", "disabled", "elementRef", "icon", "label", "multiple", "onClick", "role", "value" ]);
|
|
275
275
|
// @docs-props-type OptionPropsBase
|
|
276
276
|
var O = (0, e.useCallback)((function(e) {
|
|
277
277
|
if (!a) {
|
|
278
278
|
f === null || f === void 0 ? void 0 : f(e, {
|
|
279
|
-
value:
|
|
279
|
+
value: g
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
|
-
}), [ a, f,
|
|
283
|
-
var S =
|
|
284
|
-
var
|
|
282
|
+
}), [ a, f, g ]);
|
|
283
|
+
var S = g.toString();
|
|
284
|
+
var w = b({
|
|
285
285
|
descriptionPosition: l,
|
|
286
286
|
disabled: a ? "disabled" : undefined
|
|
287
|
-
},
|
|
287
|
+
}, y);
|
|
288
288
|
|
|
289
289
|
return n().createElement(u.Item, p({
|
|
290
|
-
"data-test-value":
|
|
290
|
+
"data-test-value": g,
|
|
291
291
|
"data-test": "option",
|
|
292
292
|
elementRef: i
|
|
293
|
-
},
|
|
293
|
+
}, w, {
|
|
294
294
|
selectable: true,
|
|
295
295
|
selectableAppearance: d ? "checkbox" : "checkmark",
|
|
296
296
|
startAdornment: c,
|
|
@@ -299,10 +299,10 @@
|
|
|
299
299
|
value: S
|
|
300
300
|
}), t || s);
|
|
301
301
|
}
|
|
302
|
-
|
|
303
|
-
|
|
302
|
+
w.propTypes = S;
|
|
303
|
+
w.type = u.Item;
|
|
304
304
|
// For components to distinguish if their children are Options or Headings/Dividers
|
|
305
|
-
/* harmony default export */ const
|
|
305
|
+
/* harmony default export */ const C = w;
|
|
306
306
|
// CONCATENATED MODULE: ./src/Multiselect/Option.tsx
|
|
307
307
|
function k() {
|
|
308
308
|
return k = Object.assign ? Object.assign.bind() : function(e) {
|
|
@@ -370,13 +370,13 @@
|
|
|
370
370
|
};
|
|
371
371
|
/**
|
|
372
372
|
* An option within a `Multiselect`.
|
|
373
|
-
*/ function
|
|
374
|
-
var r = e.compact, t = e.children, o = e.description, l = e.descriptionPosition, a = l === void 0 ? "bottom" : l, i = e.disabled, u = e.elementRef, c = e.hidden, s = e.icon, d = e.label, f = e.matchRanges, p = e.role, v = e.selected, b = e.truncate, m = e.value,
|
|
373
|
+
*/ function M(e) {
|
|
374
|
+
var r = e.compact, t = e.children, o = e.description, l = e.descriptionPosition, a = l === void 0 ? "bottom" : l, i = e.disabled, u = e.elementRef, c = e.hidden, s = e.icon, d = e.label, f = e.matchRanges, p = e.role, v = e.selected, b = e.truncate, m = e.value, g = x(e, [ "compact", "children", "description", "descriptionPosition", "disabled", "elementRef", "hidden", "icon", "label", "matchRanges", "role", "selected", "truncate", "value" ]);
|
|
375
375
|
// @docs-props-type OptionPropsBase
|
|
376
376
|
// selectedAppearance, selectedBackgroundColor, and selectedForegroundColor are not used directly by the Option component.
|
|
377
377
|
// They are consumed by the parent component (Multiselect-Normal) to render the Chip, so they are not included in the above prop list.
|
|
378
378
|
|
|
379
|
-
return n().createElement(
|
|
379
|
+
return n().createElement(C, k({
|
|
380
380
|
description: o,
|
|
381
381
|
descriptionPosition: a,
|
|
382
382
|
disabled: i,
|
|
@@ -389,15 +389,15 @@
|
|
|
389
389
|
selected: v,
|
|
390
390
|
truncate: b,
|
|
391
391
|
value: m
|
|
392
|
-
},
|
|
392
|
+
}, g, {
|
|
393
393
|
multiple: r
|
|
394
394
|
}), t || d);
|
|
395
395
|
}
|
|
396
|
-
|
|
397
|
-
/* harmony default export */ const
|
|
396
|
+
M.propTypes = P;
|
|
397
|
+
/* harmony default export */ const E = M;
|
|
398
398
|
// CONCATENATED MODULE: external "lodash/castArray"
|
|
399
|
-
const
|
|
400
|
-
var A = r.n(
|
|
399
|
+
const R = require("lodash/castArray");
|
|
400
|
+
var A = r.n(R);
|
|
401
401
|
// CONCATENATED MODULE: external "lodash/find"
|
|
402
402
|
const I = require("lodash/find");
|
|
403
403
|
var B = r.n(I);
|
|
@@ -408,8 +408,8 @@
|
|
|
408
408
|
const N = require("lodash/includes");
|
|
409
409
|
var V = r.n(N);
|
|
410
410
|
// CONCATENATED MODULE: external "lodash/memoize"
|
|
411
|
-
const
|
|
412
|
-
var
|
|
411
|
+
const D = require("lodash/memoize");
|
|
412
|
+
var q = r.n(D);
|
|
413
413
|
// CONCATENATED MODULE: external "lodash/pick"
|
|
414
414
|
const F = require("lodash/pick");
|
|
415
415
|
var _ = r.n(F);
|
|
@@ -421,10 +421,10 @@
|
|
|
421
421
|
var $ = r.n(z);
|
|
422
422
|
// CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
|
|
423
423
|
const W = require("@splunk/react-icons/CaretSmallDown");
|
|
424
|
-
var
|
|
424
|
+
var U = r.n(W);
|
|
425
425
|
// CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
|
|
426
|
-
const
|
|
427
|
-
var G = r.n(
|
|
426
|
+
const X = require("@splunk/react-icons/Magnifier");
|
|
427
|
+
var G = r.n(X);
|
|
428
428
|
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
429
429
|
const J = require("@splunk/react-ui/Dropdown");
|
|
430
430
|
var Q = r.n(J);
|
|
@@ -447,10 +447,8 @@
|
|
|
447
447
|
const ue = require("@splunk/ui-utils/filter");
|
|
448
448
|
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
449
449
|
const ce = require("@splunk/ui-utils/id");
|
|
450
|
-
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
451
|
-
const se = require("@splunk/ui-utils/keyboard");
|
|
452
450
|
// CONCATENATED MODULE: ./src/Select/SelectAllOption.tsx
|
|
453
|
-
var
|
|
451
|
+
var se = {
|
|
454
452
|
active: l().bool,
|
|
455
453
|
changedToggle: l().bool,
|
|
456
454
|
elementRef: l().oneOfType([ l().func, l().object ]),
|
|
@@ -460,12 +458,12 @@
|
|
|
460
458
|
selected: l().oneOfType([ l().bool, l().oneOf([ "some" ]) ]),
|
|
461
459
|
totalCount: l().number
|
|
462
460
|
};
|
|
463
|
-
function
|
|
461
|
+
function de(e) {
|
|
464
462
|
var r = e.active, t = e.elementRef, o = e.id, l = e.onClick, a = e.selectAllLabel, i = e.totalCount, u = e.changedToggle, c = e.selected;
|
|
465
463
|
// When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
|
|
466
464
|
var s = u ? " (".concat(i === null || i === void 0 ? void 0 : i.toString(), ")") : "";
|
|
467
465
|
|
|
468
|
-
return n().createElement(
|
|
466
|
+
return n().createElement(C, {
|
|
469
467
|
active: r,
|
|
470
468
|
elementRef: t,
|
|
471
469
|
"aria-keyshortcuts": "Control+A",
|
|
@@ -483,21 +481,21 @@
|
|
|
483
481
|
value: "selectAll"
|
|
484
482
|
});
|
|
485
483
|
}
|
|
486
|
-
|
|
487
|
-
/* harmony default export */ const
|
|
484
|
+
de.propTypes = se;
|
|
485
|
+
/* harmony default export */ const fe = de;
|
|
488
486
|
// CONCATENATED MODULE: external "styled-components"
|
|
489
|
-
const
|
|
490
|
-
var
|
|
487
|
+
const pe = require("styled-components");
|
|
488
|
+
var ve = r.n(pe);
|
|
491
489
|
// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
492
|
-
const
|
|
493
|
-
var
|
|
490
|
+
const be = require("@splunk/react-ui/Button");
|
|
491
|
+
var me = r.n(be);
|
|
494
492
|
// CONCATENATED MODULE: external "@splunk/react-ui/Divider"
|
|
495
493
|
const ge = require("@splunk/react-ui/Divider");
|
|
496
|
-
var
|
|
494
|
+
var ye = r.n(ge);
|
|
497
495
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
498
|
-
const
|
|
496
|
+
const he = require("@splunk/themes");
|
|
499
497
|
// CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
|
|
500
|
-
var
|
|
498
|
+
var Oe = ve()(me()).withConfig({
|
|
501
499
|
displayName: "SelectBaseStyles__StyledButton",
|
|
502
500
|
componentId: "sc-16cj7sk-0"
|
|
503
501
|
})([ "&[data-inline]{width:", ";}", "" ], (function(e) {
|
|
@@ -507,52 +505,52 @@
|
|
|
507
505
|
var n = e.$multiple;
|
|
508
506
|
return !n && "flex-grow: 0;";
|
|
509
507
|
}));
|
|
510
|
-
var
|
|
508
|
+
var Se = ve().span.withConfig({
|
|
511
509
|
displayName: "SelectBaseStyles__StyledLinkIcon",
|
|
512
510
|
componentId: "sc-16cj7sk-1"
|
|
513
|
-
})([ "padding-right:", ";" ],
|
|
514
|
-
var we =
|
|
511
|
+
})([ "padding-right:", ";" ], he.variables.spacingXSmall);
|
|
512
|
+
var we = ve().span.withConfig({
|
|
515
513
|
displayName: "SelectBaseStyles__StyledLinkCaret",
|
|
516
514
|
componentId: "sc-16cj7sk-2"
|
|
517
|
-
})([ "padding-left:", ";" ],
|
|
518
|
-
var
|
|
515
|
+
})([ "padding-left:", ";" ], he.variables.spacingXSmall);
|
|
516
|
+
var Ce = ve().div.withConfig({
|
|
519
517
|
displayName: "SelectBaseStyles__StyledFilter",
|
|
520
518
|
componentId: "sc-16cj7sk-3"
|
|
521
|
-
})([ "padding:", " ", " ", ";min-width:160px;" ],
|
|
522
|
-
var
|
|
519
|
+
})([ "padding:", " ", " ", ";min-width:160px;" ], he.variables.spacingLarge, he.variables.spacingLarge, he.variables.spacingSmall);
|
|
520
|
+
var ke = ve().span.withConfig({
|
|
523
521
|
displayName: "SelectBaseStyles__StyledCount",
|
|
524
522
|
componentId: "sc-16cj7sk-4"
|
|
525
|
-
})([ "padding-right:", ";" ],
|
|
526
|
-
var
|
|
523
|
+
})([ "padding-right:", ";" ], he.variables.spacingXSmall);
|
|
524
|
+
var xe = ve()(Z()).withConfig({
|
|
527
525
|
displayName: "SelectBaseStyles__StyledControlsLink",
|
|
528
526
|
componentId: "sc-16cj7sk-5"
|
|
529
527
|
})([ "", ";" ], (function(e) {
|
|
530
528
|
var n = e.$disabled;
|
|
531
|
-
return n && (0,
|
|
529
|
+
return n && (0, pe.css)([ "color:", ";" ], he.variables.contentColorDisabled);
|
|
532
530
|
}));
|
|
533
|
-
var
|
|
531
|
+
var je = ve().div.withConfig({
|
|
534
532
|
displayName: "SelectBaseStyles__StyledToggleAllControls",
|
|
535
533
|
componentId: "sc-16cj7sk-6"
|
|
536
|
-
})([ "", ";gap:", ";padding:", " ", " ", ";" ],
|
|
537
|
-
var
|
|
534
|
+
})([ "", ";gap:", ";padding:", " ", " ", ";" ], he.mixins.reset("flex"), he.variables.spacingMedium, he.variables.spacingXSmall, he.variables.spacingLarge, he.variables.spacingSmall);
|
|
535
|
+
var Pe = ve()(ye()).withConfig({
|
|
538
536
|
displayName: "SelectBaseStyles__StyledControlsDivider",
|
|
539
537
|
componentId: "sc-16cj7sk-7"
|
|
540
|
-
})([ "border-color:", ";" ],
|
|
538
|
+
})([ "border-color:", ";" ], he.variables.borderColor);
|
|
541
539
|
// EXTERNAL MODULE: ./src/useControlled/index.ts + 1 modules
|
|
542
|
-
var
|
|
540
|
+
var Me = r(2907);
|
|
543
541
|
// CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
|
|
544
542
|
// A utility for matching keyboard characters to list values
|
|
545
|
-
var
|
|
543
|
+
var Ee = function e(n, r) {
|
|
546
544
|
return n ? n.label.charAt(r).toLowerCase() : "";
|
|
547
545
|
};
|
|
548
|
-
var
|
|
546
|
+
var Re = function e(n, r) {
|
|
549
547
|
if (!n.length) {
|
|
550
548
|
return n;
|
|
551
549
|
}
|
|
552
550
|
var t = null;
|
|
553
551
|
var o = false;
|
|
554
552
|
var l = n.filter((function(e) {
|
|
555
|
-
var n =
|
|
553
|
+
var n = Ee(e, r.index);
|
|
556
554
|
if (n === r.value) {
|
|
557
555
|
o = true;
|
|
558
556
|
return true;
|
|
@@ -560,7 +558,7 @@
|
|
|
560
558
|
// If we haven't found a match yet, keep track of the next closest match.
|
|
561
559
|
// Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
|
|
562
560
|
if (!o) {
|
|
563
|
-
var l =
|
|
561
|
+
var l = Ee(t, r.index);
|
|
564
562
|
if (!l) {
|
|
565
563
|
t = e;
|
|
566
564
|
} else if (n > r.value) {
|
|
@@ -579,7 +577,7 @@
|
|
|
579
577
|
};
|
|
580
578
|
// CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
|
|
581
579
|
// A utility that attempts to move an element into view by scrolling it's derived parent.
|
|
582
|
-
var
|
|
580
|
+
var Ae = function e(n) {
|
|
583
581
|
if (!n) {
|
|
584
582
|
return;
|
|
585
583
|
}
|
|
@@ -597,7 +595,7 @@
|
|
|
597
595
|
};
|
|
598
596
|
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
599
597
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
600
|
-
var
|
|
598
|
+
var Ie = {
|
|
601
599
|
body: {
|
|
602
600
|
appendChild: function e() {
|
|
603
601
|
return [];
|
|
@@ -651,16 +649,16 @@
|
|
|
651
649
|
search: ""
|
|
652
650
|
}
|
|
653
651
|
};
|
|
654
|
-
function
|
|
655
|
-
var e = typeof document !== "undefined" ? document :
|
|
652
|
+
function Be() {
|
|
653
|
+
var e = typeof document !== "undefined" ? document : Ie;
|
|
656
654
|
return e;
|
|
657
655
|
}
|
|
658
|
-
var
|
|
659
|
-
/* harmony default export */ const
|
|
656
|
+
var Te = Be();
|
|
657
|
+
/* harmony default export */ const Le = /* unused pure expression or super */ null && Te;
|
|
660
658
|
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
661
659
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
662
|
-
var
|
|
663
|
-
document:
|
|
660
|
+
var Ne = {
|
|
661
|
+
document: Ie,
|
|
664
662
|
navigator: {
|
|
665
663
|
userAgent: ""
|
|
666
664
|
},
|
|
@@ -714,12 +712,12 @@
|
|
|
714
712
|
clearTimeout(n);
|
|
715
713
|
}
|
|
716
714
|
};
|
|
717
|
-
function
|
|
718
|
-
var e = typeof window !== "undefined" ? window :
|
|
715
|
+
function Ve() {
|
|
716
|
+
var e = typeof window !== "undefined" ? window : Ne;
|
|
719
717
|
return e;
|
|
720
718
|
}
|
|
721
|
-
var De =
|
|
722
|
-
/* harmony default export */ const
|
|
719
|
+
var De = Ve();
|
|
720
|
+
/* harmony default export */ const qe = /* unused pure expression or super */ null && De;
|
|
723
721
|
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
724
722
|
/**
|
|
725
723
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
@@ -727,7 +725,7 @@
|
|
|
727
725
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
728
726
|
* @param current - The new value of the ref.
|
|
729
727
|
*/
|
|
730
|
-
function
|
|
728
|
+
function Fe(e, n) {
|
|
731
729
|
if (e) {
|
|
732
730
|
if (typeof e === "function") {
|
|
733
731
|
e(n);
|
|
@@ -740,20 +738,20 @@
|
|
|
740
738
|
}
|
|
741
739
|
}
|
|
742
740
|
// CONCATENATED MODULE: ./src/Select/SelectBase.tsx
|
|
743
|
-
function
|
|
744
|
-
return
|
|
741
|
+
function _e(e) {
|
|
742
|
+
return ze(e) || Ke(e) || Xe(e) || He();
|
|
745
743
|
}
|
|
746
|
-
function
|
|
744
|
+
function He() {
|
|
747
745
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
748
746
|
}
|
|
749
|
-
function
|
|
747
|
+
function Ke(e) {
|
|
750
748
|
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
751
749
|
}
|
|
752
|
-
function
|
|
753
|
-
if (Array.isArray(e)) return
|
|
750
|
+
function ze(e) {
|
|
751
|
+
if (Array.isArray(e)) return Ge(e);
|
|
754
752
|
}
|
|
755
|
-
function
|
|
756
|
-
return
|
|
753
|
+
function $e() {
|
|
754
|
+
return $e = Object.assign ? Object.assign.bind() : function(e) {
|
|
757
755
|
for (var n = 1; n < arguments.length; n++) {
|
|
758
756
|
var r = arguments[n];
|
|
759
757
|
for (var t in r) {
|
|
@@ -761,29 +759,29 @@
|
|
|
761
759
|
}
|
|
762
760
|
}
|
|
763
761
|
return e;
|
|
764
|
-
},
|
|
762
|
+
}, $e.apply(null, arguments);
|
|
765
763
|
}
|
|
766
|
-
function
|
|
767
|
-
return
|
|
764
|
+
function We(e, n) {
|
|
765
|
+
return Qe(e) || Je(e, n) || Xe(e, n) || Ue();
|
|
768
766
|
}
|
|
769
767
|
function Ue() {
|
|
770
768
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
771
769
|
}
|
|
772
|
-
function
|
|
770
|
+
function Xe(e, n) {
|
|
773
771
|
if (e) {
|
|
774
|
-
if ("string" == typeof e) return
|
|
772
|
+
if ("string" == typeof e) return Ge(e, n);
|
|
775
773
|
var r = {}.toString.call(e).slice(8, -1);
|
|
776
|
-
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) ?
|
|
774
|
+
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) ? Ge(e, n) : void 0;
|
|
777
775
|
}
|
|
778
776
|
}
|
|
779
|
-
function
|
|
777
|
+
function Ge(e, n) {
|
|
780
778
|
(null == n || n > e.length) && (n = e.length);
|
|
781
779
|
for (var r = 0, t = Array(n); r < n; r++) {
|
|
782
780
|
t[r] = e[r];
|
|
783
781
|
}
|
|
784
782
|
return t;
|
|
785
783
|
}
|
|
786
|
-
function
|
|
784
|
+
function Je(e, n) {
|
|
787
785
|
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
788
786
|
if (null != r) {
|
|
789
787
|
var t, o, l, a, i = [], u = !0, c = !1;
|
|
@@ -805,12 +803,12 @@
|
|
|
805
803
|
return i;
|
|
806
804
|
}
|
|
807
805
|
}
|
|
808
|
-
function
|
|
806
|
+
function Qe(e) {
|
|
809
807
|
if (Array.isArray(e)) return e;
|
|
810
808
|
}
|
|
811
|
-
function
|
|
809
|
+
function Ye(e, n) {
|
|
812
810
|
if (null == e) return {};
|
|
813
|
-
var r, t, o =
|
|
811
|
+
var r, t, o = Ze(e, n);
|
|
814
812
|
if (Object.getOwnPropertySymbols) {
|
|
815
813
|
var l = Object.getOwnPropertySymbols(e);
|
|
816
814
|
for (t = 0; t < l.length; t++) {
|
|
@@ -819,7 +817,7 @@
|
|
|
819
817
|
}
|
|
820
818
|
return o;
|
|
821
819
|
}
|
|
822
|
-
function
|
|
820
|
+
function Ze(e, n) {
|
|
823
821
|
if (null == e) return {};
|
|
824
822
|
var r = {};
|
|
825
823
|
for (var t in e) {
|
|
@@ -830,15 +828,15 @@
|
|
|
830
828
|
}
|
|
831
829
|
return r;
|
|
832
830
|
}
|
|
833
|
-
function
|
|
831
|
+
function en(e) {
|
|
834
832
|
"@babel/helpers - typeof";
|
|
835
|
-
return
|
|
833
|
+
return en = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
836
834
|
return typeof e;
|
|
837
835
|
} : function(e) {
|
|
838
836
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
839
|
-
},
|
|
837
|
+
}, en(e);
|
|
840
838
|
}
|
|
841
|
-
function
|
|
839
|
+
function nn(e, n) {
|
|
842
840
|
var r = Object.keys(e);
|
|
843
841
|
if (Object.getOwnPropertySymbols) {
|
|
844
842
|
var t = Object.getOwnPropertySymbols(e);
|
|
@@ -848,40 +846,40 @@
|
|
|
848
846
|
}
|
|
849
847
|
return r;
|
|
850
848
|
}
|
|
851
|
-
function
|
|
849
|
+
function rn(e) {
|
|
852
850
|
for (var n = 1; n < arguments.length; n++) {
|
|
853
851
|
var r = null != arguments[n] ? arguments[n] : {};
|
|
854
|
-
n % 2 ?
|
|
855
|
-
|
|
856
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
852
|
+
n % 2 ? nn(Object(r), !0).forEach((function(n) {
|
|
853
|
+
tn(e, n, r[n]);
|
|
854
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : nn(Object(r)).forEach((function(n) {
|
|
857
855
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
858
856
|
}));
|
|
859
857
|
}
|
|
860
858
|
return e;
|
|
861
859
|
}
|
|
862
|
-
function
|
|
863
|
-
return (n =
|
|
860
|
+
function tn(e, n, r) {
|
|
861
|
+
return (n = on(n)) in e ? Object.defineProperty(e, n, {
|
|
864
862
|
value: r,
|
|
865
863
|
enumerable: !0,
|
|
866
864
|
configurable: !0,
|
|
867
865
|
writable: !0
|
|
868
866
|
}) : e[n] = r, e;
|
|
869
867
|
}
|
|
870
|
-
function
|
|
871
|
-
var n =
|
|
872
|
-
return "symbol" ==
|
|
868
|
+
function on(e) {
|
|
869
|
+
var n = ln(e, "string");
|
|
870
|
+
return "symbol" == en(n) ? n : n + "";
|
|
873
871
|
}
|
|
874
|
-
function
|
|
875
|
-
if ("object" !=
|
|
872
|
+
function ln(e, n) {
|
|
873
|
+
if ("object" != en(e) || !e) return e;
|
|
876
874
|
var r = e[Symbol.toPrimitive];
|
|
877
875
|
if (void 0 !== r) {
|
|
878
876
|
var t = r.call(e, n || "default");
|
|
879
|
-
if ("object" !=
|
|
877
|
+
if ("object" != en(t)) return t;
|
|
880
878
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
881
879
|
}
|
|
882
880
|
return ("string" === n ? String : Number)(e);
|
|
883
881
|
}
|
|
884
|
-
var
|
|
882
|
+
var an = {
|
|
885
883
|
allowKeyMatching: l().bool,
|
|
886
884
|
allowNewValues: l().bool,
|
|
887
885
|
animateLoading: l().bool,
|
|
@@ -930,50 +928,50 @@
|
|
|
930
928
|
/** @private. */
|
|
931
929
|
virtualization: l().number
|
|
932
930
|
};
|
|
933
|
-
var
|
|
931
|
+
var un = q()((function(e) {
|
|
934
932
|
return [ e ];
|
|
935
933
|
}));
|
|
936
934
|
// preserve separate widths for single vs. multi mode
|
|
937
|
-
var
|
|
935
|
+
var cn = q()((function(e) {
|
|
938
936
|
var n = e.anchorWidth, r = e.isMultiple, t = e.maxHeight, o = e.menuStyle;
|
|
939
|
-
return r ?
|
|
937
|
+
return r ? rn({
|
|
940
938
|
width: Math.max(n !== null && n !== void 0 ? n : 0, 200),
|
|
941
939
|
maxHeight: t
|
|
942
|
-
}, o) :
|
|
940
|
+
}, o) : rn({
|
|
943
941
|
minWidth: n !== null && n !== void 0 ? n : undefined,
|
|
944
942
|
maxWidth: Math.max(n !== null && n !== void 0 ? n : 0, 300),
|
|
945
943
|
maxHeight: t
|
|
946
944
|
}, o);
|
|
947
945
|
}));
|
|
948
|
-
var
|
|
949
|
-
function
|
|
946
|
+
var sn = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
|
|
947
|
+
function dn(e) {
|
|
950
948
|
return e && i()(e.props, "value");
|
|
951
949
|
}
|
|
952
|
-
function
|
|
953
|
-
return "".concat(
|
|
950
|
+
function fn(e, n) {
|
|
951
|
+
return "".concat(en(e), "-").concat(e, "-").concat(n);
|
|
954
952
|
}
|
|
955
|
-
var
|
|
956
|
-
var
|
|
957
|
-
var
|
|
958
|
-
var
|
|
953
|
+
var pn = [ "append", "error", "prepend" ];
|
|
954
|
+
var vn = (0, d._)("No matches");
|
|
955
|
+
var bn = (0, d._)("Select...");
|
|
956
|
+
var mn = n().createElement(G(), null);
|
|
959
957
|
var gn = function e(r) {
|
|
960
|
-
var t = r.activeItemId, o = r.filterA11yId, l = r.filterKeyword, a = r.hasChildren, i = r.inputId, u = r.inputRef, c = r.menuListboxId, s = r.multiple, f = r.onClearAll, p = r.onSelectAll, v = r.onTextBlur, b = r.onTextChange, m = r.onTextFocus,
|
|
961
|
-
var
|
|
962
|
-
var
|
|
958
|
+
var t = r.activeItemId, o = r.filterA11yId, l = r.filterKeyword, a = r.hasChildren, i = r.inputId, u = r.inputRef, c = r.menuListboxId, s = r.multiple, f = r.onClearAll, p = r.onSelectAll, v = r.onTextBlur, b = r.onTextChange, m = r.onTextFocus, g = r.onTextKeyDown, y = r.optionSelection, h = r.placement, O = r.selectAllAppearance, S = r.textHasFocus;
|
|
959
|
+
var w = (0, d._)("Select all options".concat(y.current === "all" ? " disabled" : ""));
|
|
960
|
+
var C = (0, d._)("Clear all options".concat(y.current === "none" ? " disabled" : ""));
|
|
963
961
|
// only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
|
|
964
|
-
var k = n().createElement(
|
|
962
|
+
var k = n().createElement(je, {
|
|
965
963
|
key: "selectAll"
|
|
966
|
-
}, n().createElement(
|
|
967
|
-
disabled:
|
|
964
|
+
}, n().createElement(xe, {
|
|
965
|
+
disabled: y.current === "all",
|
|
968
966
|
appearance: "standalone",
|
|
969
|
-
"aria-label":
|
|
967
|
+
"aria-label": w,
|
|
970
968
|
onClick: p,
|
|
971
969
|
"data-test": "select-all",
|
|
972
970
|
tag: "button"
|
|
973
|
-
}, l ? (0, d._)("Select all Matches") : (0, d._)("Select all")), n().createElement(
|
|
974
|
-
disabled:
|
|
971
|
+
}, l ? (0, d._)("Select all Matches") : (0, d._)("Select all")), n().createElement(xe, {
|
|
972
|
+
disabled: y.current === "none",
|
|
975
973
|
appearance: "standalone",
|
|
976
|
-
"aria-label":
|
|
974
|
+
"aria-label": C,
|
|
977
975
|
onClick: f,
|
|
978
976
|
"data-test": "clear-all",
|
|
979
977
|
tag: "button"
|
|
@@ -983,7 +981,7 @@
|
|
|
983
981
|
key: "controls"
|
|
984
982
|
}, o && n().createElement(le(), {
|
|
985
983
|
id: o
|
|
986
|
-
}, (0, d._)("Type to filter")), h === "above" && n().createElement(
|
|
984
|
+
}, (0, d._)("Type to filter")), h === "above" && n().createElement(Pe, null), n().createElement(Ce, {
|
|
987
985
|
key: "filter",
|
|
988
986
|
"data-test": "filter"
|
|
989
987
|
}, n().createElement(te(), {
|
|
@@ -993,7 +991,7 @@
|
|
|
993
991
|
autoCorrect: "off",
|
|
994
992
|
spellCheck: false,
|
|
995
993
|
onChange: b,
|
|
996
|
-
onKeyDown:
|
|
994
|
+
onKeyDown: g,
|
|
997
995
|
onFocus: m,
|
|
998
996
|
onBlur: v,
|
|
999
997
|
placeholder: (0, d._)("filter"),
|
|
@@ -1007,10 +1005,10 @@
|
|
|
1007
1005
|
inputRef: u,
|
|
1008
1006
|
inputId: i,
|
|
1009
1007
|
canClear: true,
|
|
1010
|
-
startAdornment:
|
|
1011
|
-
})), s && a && O === "buttongroup" && k, h === "below" && n().createElement(
|
|
1008
|
+
startAdornment: mn
|
|
1009
|
+
})), s && a && O === "buttongroup" && k, h === "below" && n().createElement(Pe, null));
|
|
1012
1010
|
};
|
|
1013
|
-
var
|
|
1011
|
+
var yn = function e(n) {
|
|
1014
1012
|
var r = n.prefixLabel, t = n.label, o = n.suffixLabel;
|
|
1015
1013
|
var l = t;
|
|
1016
1014
|
if (r) {
|
|
@@ -1021,71 +1019,71 @@
|
|
|
1021
1019
|
}
|
|
1022
1020
|
return l;
|
|
1023
1021
|
};
|
|
1024
|
-
var
|
|
1025
|
-
var o = r.appearance, l = o === void 0 ? "default" : o, a = r.append, i = r.children, u = r.currentValues, c = u === void 0 ? [] : u, s = r.describedBy, f = r.disabled, p = r.elementRef, v = r.error, b = r.inline, m = r.labelText,
|
|
1022
|
+
var hn = n().forwardRef((function(r, t) {
|
|
1023
|
+
var o = r.appearance, l = o === void 0 ? "default" : o, a = r.append, i = r.children, u = r.currentValues, c = u === void 0 ? [] : u, s = r.describedBy, f = r.disabled, p = r.elementRef, v = r.error, b = r.inline, m = r.labelText, g = r.labelledBy, y = r.multiple, h = r.onClick, O = r.placeholder, S = r.prefixLabel, w = r.prepend, C = r.required, k = r.suffixLabel, x = r.toggle, j = r.toggleContent, P = Ye(r, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent" ]);
|
|
1024
|
+
var M;
|
|
1026
1025
|
var E;
|
|
1027
|
-
var R;
|
|
1028
|
-
var M = [];
|
|
1026
|
+
var R = [];
|
|
1029
1027
|
// Generate buttonLabels
|
|
1030
1028
|
var A = e.Children.toArray(i);
|
|
1031
1029
|
var I = c.reduce((function(e, n, r, t) {
|
|
1032
1030
|
var o = B()(A, (function(e) {
|
|
1033
|
-
return
|
|
1031
|
+
return dn(e) && e.props.value === n;
|
|
1034
1032
|
}));
|
|
1035
1033
|
if (o) {
|
|
1036
1034
|
var l = o.props, a = l.children, i = l.icon, u = l.label;
|
|
1037
1035
|
var s = j !== "optionLabel" && a ? a : u;
|
|
1038
1036
|
e.push(s);
|
|
1039
|
-
|
|
1037
|
+
R.push(u);
|
|
1040
1038
|
// if not in multiple mode, add the icon
|
|
1041
|
-
if (!
|
|
1042
|
-
|
|
1039
|
+
if (!y && c.length === 1) {
|
|
1040
|
+
M = i;
|
|
1043
1041
|
}
|
|
1044
|
-
} else if (
|
|
1042
|
+
} else if (y) {
|
|
1045
1043
|
// only add values that don't match an option in "multiple" mode to preserve old behaviour
|
|
1046
1044
|
e.push(n);
|
|
1047
|
-
|
|
1045
|
+
R.push(n.toString());
|
|
1048
1046
|
}
|
|
1049
1047
|
if (r < t.length - 1) {
|
|
1050
1048
|
e.push((0, d._)(", "));
|
|
1051
|
-
|
|
1049
|
+
R.push((0, d._)(", "));
|
|
1052
1050
|
}
|
|
1053
1051
|
return e;
|
|
1054
1052
|
}), []);
|
|
1055
|
-
|
|
1053
|
+
E = I;
|
|
1056
1054
|
// only apply prefix / suffix if the label is not empty
|
|
1057
|
-
if (
|
|
1055
|
+
if (E.length > 0) {
|
|
1058
1056
|
// If there's more than one item selected, read out the selected total
|
|
1059
1057
|
// rather than reading out each selected item
|
|
1060
|
-
|
|
1058
|
+
R = yn({
|
|
1061
1059
|
prefixLabel: S,
|
|
1062
|
-
label:
|
|
1060
|
+
label: E.length > 1 ? [ "".concat(c.length, " items selected") ] : R,
|
|
1063
1061
|
suffixLabel: k
|
|
1064
1062
|
});
|
|
1065
|
-
|
|
1063
|
+
E = yn({
|
|
1066
1064
|
prefixLabel: S,
|
|
1067
|
-
label:
|
|
1065
|
+
label: E,
|
|
1068
1066
|
suffixLabel: k
|
|
1069
1067
|
});
|
|
1070
1068
|
}
|
|
1071
1069
|
// single <Select> behaviour is to show the placeholder if all parts of the label
|
|
1072
1070
|
// are empty strings so we replicate this behaviour here
|
|
1073
|
-
if (
|
|
1071
|
+
if (E.length === 0 || !y && E.every((function(e) {
|
|
1074
1072
|
return e === "";
|
|
1075
1073
|
}))) {
|
|
1076
|
-
|
|
1077
|
-
|
|
1074
|
+
E = un(O);
|
|
1075
|
+
R = E;
|
|
1078
1076
|
}
|
|
1079
1077
|
var T = Object.keys(P).includes("aria-labelledby");
|
|
1080
|
-
var L =
|
|
1078
|
+
var L = rn({
|
|
1081
1079
|
"aria-describedby": s,
|
|
1082
|
-
"aria-label":
|
|
1080
|
+
"aria-label": g || T ? undefined : "".concat(m ? "".concat(m, ", ") : "").concat(R.join("")),
|
|
1083
1081
|
// aria-labelledby takes precedence over aria-label, so existence of both is redundant
|
|
1084
|
-
"aria-labelledby":
|
|
1085
|
-
"aria-required":
|
|
1082
|
+
"aria-labelledby": g,
|
|
1083
|
+
"aria-required": C,
|
|
1086
1084
|
"data-select-appearance": l,
|
|
1087
1085
|
append: a,
|
|
1088
|
-
prepend:
|
|
1086
|
+
prepend: w,
|
|
1089
1087
|
onClick: h,
|
|
1090
1088
|
role: "combobox",
|
|
1091
1089
|
disabled: f ? "disabled" : undefined,
|
|
@@ -1093,10 +1091,10 @@
|
|
|
1093
1091
|
error: v,
|
|
1094
1092
|
ref: t
|
|
1095
1093
|
}, P);
|
|
1096
|
-
if (
|
|
1094
|
+
if (y) {
|
|
1097
1095
|
L["data-test-values"] = JSON.stringify(c);
|
|
1098
1096
|
} else {
|
|
1099
|
-
var N =
|
|
1097
|
+
var N = We(c, 1), V = N[0];
|
|
1100
1098
|
L["data-test-value"] = V;
|
|
1101
1099
|
}
|
|
1102
1100
|
if (x) {
|
|
@@ -1105,33 +1103,33 @@
|
|
|
1105
1103
|
}
|
|
1106
1104
|
if (l === "link") {
|
|
1107
1105
|
|
|
1108
|
-
return n().createElement(Z(),
|
|
1106
|
+
return n().createElement(Z(), $e({
|
|
1109
1107
|
tag: "button",
|
|
1110
1108
|
appearance: "standalone"
|
|
1111
1109
|
}, L, {
|
|
1112
1110
|
"data-select-appearance": "link"
|
|
1113
|
-
}), !!
|
|
1111
|
+
}), !!M && n().createElement(Se, null, M), E || O, n().createElement(we, null, n().createElement(U(), null)));
|
|
1114
1112
|
}
|
|
1115
1113
|
// Using Button's secondary appearance as Select's default appearance.
|
|
1116
|
-
var
|
|
1114
|
+
var D = l === "default" ? "secondary" : l;
|
|
1117
1115
|
|
|
1118
|
-
return n().createElement(
|
|
1119
|
-
$multiple:
|
|
1120
|
-
appearance:
|
|
1121
|
-
label:
|
|
1116
|
+
return n().createElement(Oe, $e({}, L, {
|
|
1117
|
+
$multiple: y,
|
|
1118
|
+
appearance: D,
|
|
1119
|
+
label: E,
|
|
1122
1120
|
error: v,
|
|
1123
|
-
icon:
|
|
1121
|
+
icon: M,
|
|
1124
1122
|
inline: b,
|
|
1125
1123
|
isMenu: true,
|
|
1126
1124
|
onClick: h
|
|
1127
|
-
}, _()(P,
|
|
1125
|
+
}, _()(P, pn)), !!c.length && y && n().createElement(ke, {
|
|
1128
1126
|
"data-role": "count"
|
|
1129
1127
|
}, "(", c.length, ")"));
|
|
1130
1128
|
}));
|
|
1131
|
-
function
|
|
1132
|
-
var t = r.allowKeyMatching, o = t === void 0 ? true : t, l = r.animateLoading, a = r.appearance, i = a === void 0 ? "default" : a, c = r.append, s = r.allowNewValues, f = r.children, p = r.defaultPlacement, v = p === void 0 ? "vertical" : p, b = r.defaultValues, m = r.describedBy,
|
|
1129
|
+
function On(r) {
|
|
1130
|
+
var t = r.allowKeyMatching, o = t === void 0 ? true : t, l = r.animateLoading, a = r.appearance, i = a === void 0 ? "default" : a, c = r.append, s = r.allowNewValues, f = r.children, p = r.defaultPlacement, v = p === void 0 ? "vertical" : p, b = r.defaultValues, m = r.describedBy, g = r.disabled, y = r.elementRef, h = r.error, O = r.filter, S = r.footerMessage, w = r.inline, k = r.inputId, x = r.inputRef, j = r.isLoadingOptions, P = r.labelledBy, M = r.labelText, E = r.loadingMessage, R = r.menuStyle, A = R === void 0 ? {} : R, I = r.multiple, T = r.name, N = r.noOptionsMessage, D = N === void 0 ? vn : N, q = r.onChange, F = r.onScroll, _ = r.onScrollBottom, H = r.onFilterChange, z = r.onClick, W = r.onClose, U = r.onOpen, X = r.required, G = r.placeholder, J = G === void 0 ? bn : G, Y = r.prefixLabel, Z = r.prepend, re = r.repositionMode, te = re === void 0 ? "flip" : re, oe = r.selectAllAppearance, le = oe === void 0 ? "buttongroup" : oe, ae = r.showSelectedValuesFirst, se = r.suffixLabel, de = r.tabConfirmsNewValue, pe = r.values, ve = r.virtualization, be = r.toggle, me = r.toggleContent, ge = me === void 0 ? "optionChildren" : me, ye = Ye(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" ]);
|
|
1133
1131
|
// @docs-props-type SelectBasePropsBase
|
|
1134
|
-
var
|
|
1132
|
+
var he = (0, Me["default"])({
|
|
1135
1133
|
componentName: "SelectBase",
|
|
1136
1134
|
/* eslint-disable-next-line prefer-rest-params */
|
|
1137
1135
|
componentProps: arguments[0],
|
|
@@ -1140,87 +1138,87 @@
|
|
|
1140
1138
|
valuePropName: "values"
|
|
1141
1139
|
});
|
|
1142
1140
|
// states
|
|
1143
|
-
var
|
|
1141
|
+
var Oe = (0, e.useState)((function() {
|
|
1144
1142
|
return {
|
|
1145
1143
|
activeItemId: (0, ce.createDOMID)("active-item"),
|
|
1146
1144
|
menuListboxId: (0, ce.createDOMID)("menu-listbox")
|
|
1147
1145
|
};
|
|
1148
|
-
})),
|
|
1149
|
-
var
|
|
1150
|
-
var
|
|
1151
|
-
var
|
|
1152
|
-
var
|
|
1153
|
-
var
|
|
1154
|
-
var
|
|
1146
|
+
})), Se = We(Oe, 1), we = Se[0], Ce = we.activeItemId, ke = we.menuListboxId;
|
|
1147
|
+
var xe = (0, e.useState)(0), je = We(xe, 2), Pe = je[0], Ee = je[1];
|
|
1148
|
+
var Ie = (0, e.useState)(""), Be = We(Ie, 2), Te = Be[0], Le = Be[1];
|
|
1149
|
+
var Ne = (0, e.useState)(false), De = We(Ne, 2), qe = De[0], He = De[1];
|
|
1150
|
+
var Ke = (0, e.useState)(false), ze = We(Ke, 2), Ue = ze[0], Xe = ze[1];
|
|
1151
|
+
var Ge = (0, e.useState)([]), Je = We(Ge, 2), Qe = Je[0], Ze = Je[1];
|
|
1152
|
+
var en = (0, e.useState)(b || []), nn = We(en, 2), rn = nn[0], tn = nn[1];
|
|
1155
1153
|
// previous state
|
|
1156
|
-
var
|
|
1154
|
+
var on = ie()(Pe);
|
|
1157
1155
|
// refs
|
|
1158
|
-
var
|
|
1156
|
+
var ln = (0, e.useRef)(null);
|
|
1157
|
+
var an = (0, e.useRef)(null);
|
|
1159
1158
|
var un = (0, e.useRef)(null);
|
|
1160
|
-
var
|
|
1161
|
-
var
|
|
1162
|
-
var yn = (0, e.useRef)(
|
|
1163
|
-
var
|
|
1164
|
-
var Sn = (0, e.useRef)();
|
|
1165
|
-
var Cn = (0, e.useRef)({});
|
|
1159
|
+
var pn = (0, e.useRef)([]);
|
|
1160
|
+
var mn = (0, e.useRef)([]);
|
|
1161
|
+
var yn = (0, e.useRef)(on);
|
|
1162
|
+
var On = (0, e.useRef)();
|
|
1163
|
+
var Sn = (0, e.useRef)({});
|
|
1166
1164
|
var wn = (0, e.useRef)(0);
|
|
1167
|
-
var
|
|
1168
|
-
var
|
|
1169
|
-
var
|
|
1170
|
-
var
|
|
1171
|
-
var
|
|
1172
|
-
var
|
|
1165
|
+
var Cn = (0, e.useRef)([]);
|
|
1166
|
+
var kn = (0, e.useRef)(null);
|
|
1167
|
+
var xn = (0, e.useRef)();
|
|
1168
|
+
var jn = (0, e.useRef)(0);
|
|
1169
|
+
var Pn = (0, e.useRef)("none");
|
|
1170
|
+
var Mn = (0, e.useState)(O ? (0, ce.createDOMID)("filter") : undefined), En = We(Mn, 1), Rn = En[0];
|
|
1173
1171
|
(0, e.useEffect)((function() {
|
|
1174
1172
|
if (false) {}
|
|
1175
1173
|
}), [ i, c, h, Z ]);
|
|
1176
|
-
var
|
|
1177
|
-
var e =
|
|
1174
|
+
var An = (0, e.useCallback)((function() {
|
|
1175
|
+
var e = he ? pe : rn;
|
|
1178
1176
|
return I || e == null ? e : e.slice(0, 1);
|
|
1179
|
-
}), [
|
|
1180
|
-
var
|
|
1177
|
+
}), [ he, I, pe, rn ]);
|
|
1178
|
+
var In = (0, e.useCallback)((function() {
|
|
1181
1179
|
var e;
|
|
1182
1180
|
// in non-multiple mode, don't move values to the top of the list
|
|
1183
|
-
return I && ae !== "never" ? (e =
|
|
1184
|
-
}), [
|
|
1185
|
-
var
|
|
1186
|
-
var n =
|
|
1187
|
-
|
|
1188
|
-
|
|
1181
|
+
return I && ae !== "never" ? (e = An()) !== null && e !== void 0 ? e : [] : [];
|
|
1182
|
+
}), [ An, I, ae ]);
|
|
1183
|
+
var Bn = (0, e.useCallback)((function(e) {
|
|
1184
|
+
var n = Te;
|
|
1185
|
+
He(true);
|
|
1186
|
+
Ze(In());
|
|
1189
1187
|
// SUI-3234: preserve existing behavior difference between <Select> and <Multiselect.Compact>
|
|
1190
1188
|
if (I) {
|
|
1191
|
-
|
|
1189
|
+
Le("");
|
|
1192
1190
|
}
|
|
1193
|
-
if (n !==
|
|
1191
|
+
if (n !== Te) {
|
|
1194
1192
|
H === null || H === void 0 ? void 0 : H(e, {
|
|
1195
|
-
keyword:
|
|
1193
|
+
keyword: Te
|
|
1196
1194
|
});
|
|
1197
1195
|
}
|
|
1198
|
-
}), [
|
|
1196
|
+
}), [ Te, In, I, H ]);
|
|
1199
1197
|
(0, e.useEffect)((function() {
|
|
1200
|
-
if (
|
|
1201
|
-
|
|
1202
|
-
if (
|
|
1203
|
-
|
|
1198
|
+
if (qe) {
|
|
1199
|
+
U === null || U === void 0 ? void 0 : U();
|
|
1200
|
+
if (kn.current && !O) {
|
|
1201
|
+
kn.current.focus();
|
|
1204
1202
|
} else {
|
|
1205
1203
|
var e;
|
|
1206
|
-
|
|
1204
|
+
Ee((e = xn.current) !== null && e !== void 0 ? e : 0);
|
|
1207
1205
|
}
|
|
1208
1206
|
}
|
|
1209
|
-
}), [
|
|
1210
|
-
var
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1207
|
+
}), [ U, qe, Qe, Te, O ]);
|
|
1208
|
+
var Tn = (0, e.useCallback)((function() {
|
|
1209
|
+
He(false);
|
|
1210
|
+
Ee(0);
|
|
1211
|
+
yn.current = null;
|
|
1214
1212
|
W === null || W === void 0 ? void 0 : W();
|
|
1215
1213
|
}), [ W ]);
|
|
1216
|
-
var
|
|
1214
|
+
var Ln = (0, e.useCallback)((function(e, n) {
|
|
1217
1215
|
var r;
|
|
1218
|
-
var t = (r =
|
|
1216
|
+
var t = (r = An()) !== null && r !== void 0 ? r : [];
|
|
1219
1217
|
var o = t.indexOf(n);
|
|
1220
1218
|
var l;
|
|
1221
1219
|
if (I) {
|
|
1222
1220
|
if (o >= 0) {
|
|
1223
|
-
l = [].concat(
|
|
1221
|
+
l = [].concat(_e(t.slice(0, o)), _e(t.slice(o + 1)));
|
|
1224
1222
|
} else {
|
|
1225
1223
|
l = t.concat([ n ]);
|
|
1226
1224
|
}
|
|
@@ -1228,143 +1226,143 @@
|
|
|
1228
1226
|
// non-multiple mode must always have a value
|
|
1229
1227
|
l = [ n ];
|
|
1230
1228
|
}
|
|
1231
|
-
var a = !
|
|
1229
|
+
var a = !he;
|
|
1232
1230
|
if (a) {
|
|
1233
|
-
|
|
1231
|
+
tn(l);
|
|
1234
1232
|
}
|
|
1235
1233
|
if (I) {
|
|
1236
1234
|
// in uncontrolled multiple mode, keep the menu open
|
|
1237
1235
|
if (a) {
|
|
1238
|
-
|
|
1236
|
+
He(true);
|
|
1239
1237
|
}
|
|
1240
1238
|
} else {
|
|
1241
1239
|
var i;
|
|
1242
1240
|
// non-multiple mode only supports a single selection
|
|
1243
1241
|
// so close the menu once a selection is made
|
|
1244
|
-
|
|
1242
|
+
Tn({
|
|
1245
1243
|
reason: "contentClick"
|
|
1246
1244
|
});
|
|
1247
|
-
(i =
|
|
1245
|
+
(i = ln.current) === null || i === void 0 ? void 0 : i.focus();
|
|
1248
1246
|
}
|
|
1249
|
-
|
|
1247
|
+
q === null || q === void 0 ? void 0 : q(e, {
|
|
1250
1248
|
values: l,
|
|
1251
1249
|
name: T,
|
|
1252
1250
|
reason: "valueToggle"
|
|
1253
1251
|
});
|
|
1254
|
-
}), [
|
|
1255
|
-
var
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
if (
|
|
1259
|
-
clearTimeout(
|
|
1252
|
+
}), [ An, Tn, he, I, T, q ]);
|
|
1253
|
+
var Nn = function e() {
|
|
1254
|
+
an.current = null;
|
|
1255
|
+
pn.current = [];
|
|
1256
|
+
if (un.current) {
|
|
1257
|
+
clearTimeout(un.current);
|
|
1260
1258
|
}
|
|
1261
1259
|
};
|
|
1262
|
-
var
|
|
1260
|
+
var Vn = (0, e.useCallback)((function(e) {
|
|
1263
1261
|
var r;
|
|
1264
1262
|
// this doesn't make sense if we can't select multiple values
|
|
1265
1263
|
if (!I) {
|
|
1266
1264
|
return;
|
|
1267
1265
|
}
|
|
1268
|
-
var t = (r =
|
|
1269
|
-
var o = K()(t.concat(
|
|
1266
|
+
var t = (r = An()) !== null && r !== void 0 ? r : [];
|
|
1267
|
+
var o = K()(t.concat(Cn.current));
|
|
1270
1268
|
o = n().Children.toArray(f).filter((function(e) {
|
|
1271
|
-
return
|
|
1269
|
+
return dn(e) && V()(o, e.props.value) && (!e.props.disabled || V()(t, e.props.value));
|
|
1272
1270
|
})).map((function(e) {
|
|
1273
1271
|
return e.props.value;
|
|
1274
1272
|
}));
|
|
1275
|
-
if (!
|
|
1276
|
-
|
|
1273
|
+
if (!he) {
|
|
1274
|
+
tn(o);
|
|
1277
1275
|
}
|
|
1278
|
-
|
|
1276
|
+
q === null || q === void 0 ? void 0 : q(e, {
|
|
1279
1277
|
values: o,
|
|
1280
1278
|
name: T,
|
|
1281
1279
|
reason: "selectAll"
|
|
1282
1280
|
});
|
|
1283
|
-
}), [ f,
|
|
1281
|
+
}), [ f, An, he, I, T, q ]);
|
|
1284
1282
|
var Dn = (0, e.useCallback)((function(e) {
|
|
1285
1283
|
var r;
|
|
1286
1284
|
// this doesn't make sense if we can't select multiple values
|
|
1287
1285
|
if (!I) {
|
|
1288
1286
|
return;
|
|
1289
1287
|
}
|
|
1290
|
-
var t = (r =
|
|
1291
|
-
var o = $().apply(void 0, [ t ].concat(
|
|
1288
|
+
var t = (r = An()) !== null && r !== void 0 ? r : [];
|
|
1289
|
+
var o = $().apply(void 0, [ t ].concat(_e(Cn.current)));
|
|
1292
1290
|
// this will unselect all selected values unless those values are disabled or hidden by the filter
|
|
1293
1291
|
var l = n().Children.toArray(f).filter((function(e) {
|
|
1294
|
-
return
|
|
1292
|
+
return dn(e) && (V()(t, e.props.value) && e.props.disabled || V()(o, e.props.value));
|
|
1295
1293
|
})).map((function(e) {
|
|
1296
1294
|
return e.props.value;
|
|
1297
1295
|
}));
|
|
1298
|
-
if (!
|
|
1299
|
-
|
|
1296
|
+
if (!he) {
|
|
1297
|
+
tn(l);
|
|
1300
1298
|
}
|
|
1301
|
-
|
|
1299
|
+
q === null || q === void 0 ? void 0 : q(e, {
|
|
1302
1300
|
values: l,
|
|
1303
1301
|
name: T,
|
|
1304
1302
|
reason: "clearAll"
|
|
1305
1303
|
});
|
|
1306
|
-
}), [ f,
|
|
1307
|
-
var
|
|
1308
|
-
if (
|
|
1304
|
+
}), [ f, An, he, I, T, q ]);
|
|
1305
|
+
var qn = (0, e.useCallback)((function(e) {
|
|
1306
|
+
if (qe && !j) {
|
|
1309
1307
|
_ === null || _ === void 0 ? void 0 : _(e);
|
|
1310
1308
|
}
|
|
1311
|
-
}), [
|
|
1312
|
-
var
|
|
1313
|
-
var r =
|
|
1314
|
-
if (r === "
|
|
1315
|
-
if (
|
|
1309
|
+
}), [ qe, j, _ ]);
|
|
1310
|
+
var Fn = (0, e.useCallback)((function(n) {
|
|
1311
|
+
var r = n.key;
|
|
1312
|
+
if (r === "Tab") {
|
|
1313
|
+
if (de && On.current && wn.current <= 1) {
|
|
1316
1314
|
n.preventDefault();
|
|
1317
|
-
|
|
1315
|
+
Ln(n, On.current);
|
|
1318
1316
|
}
|
|
1319
1317
|
}
|
|
1320
1318
|
if (n.shiftKey || n.metaKey || n.ctrlKey) {
|
|
1321
1319
|
if (r === "a" && (n.ctrlKey || n.metaKey)) {
|
|
1322
1320
|
// handle control + A
|
|
1323
|
-
if (
|
|
1321
|
+
if (Pn.current === "all") {
|
|
1324
1322
|
Dn(n);
|
|
1325
1323
|
} else {
|
|
1326
|
-
|
|
1324
|
+
Vn(n);
|
|
1327
1325
|
}
|
|
1328
1326
|
}
|
|
1329
1327
|
return;
|
|
1330
1328
|
}
|
|
1331
|
-
if (r === "
|
|
1329
|
+
if (r === "ArrowDown") {
|
|
1332
1330
|
n.preventDefault();
|
|
1333
|
-
|
|
1331
|
+
Ee(Math.min(Pe + 1, le === "checkbox" ? wn.current : wn.current - 1));
|
|
1334
1332
|
if (f && _) {
|
|
1335
1333
|
var t;
|
|
1336
|
-
var o = e.Children.toArray(f).length - (2 + ((t =
|
|
1337
|
-
if (
|
|
1338
|
-
|
|
1334
|
+
var o = e.Children.toArray(f).length - (2 + ((t = An()) !== null && t !== void 0 ? t : []).length);
|
|
1335
|
+
if (Pe === o) {
|
|
1336
|
+
qn(n);
|
|
1339
1337
|
}
|
|
1340
1338
|
}
|
|
1341
1339
|
}
|
|
1342
|
-
if (r === "
|
|
1340
|
+
if (r === "ArrowUp") {
|
|
1343
1341
|
n.preventDefault();
|
|
1344
|
-
|
|
1342
|
+
Ee(Math.max(Pe - 1, 0));
|
|
1345
1343
|
}
|
|
1346
|
-
if (r === "
|
|
1347
|
-
if (
|
|
1348
|
-
if (
|
|
1344
|
+
if (r === "Enter" && On.current && qe) {
|
|
1345
|
+
if (On.current === "selectAll") {
|
|
1346
|
+
if (Pn.current === "all") {
|
|
1349
1347
|
Dn(n);
|
|
1350
1348
|
} else {
|
|
1351
|
-
|
|
1349
|
+
Vn(n);
|
|
1352
1350
|
}
|
|
1353
1351
|
} else {
|
|
1354
1352
|
n.preventDefault();
|
|
1355
|
-
|
|
1353
|
+
Ln(n, On.current);
|
|
1356
1354
|
}
|
|
1357
1355
|
}
|
|
1358
|
-
}), [
|
|
1359
|
-
var
|
|
1356
|
+
}), [ Pe, f, An, Dn, qn, Vn, _, qe, le, de, Ln ]);
|
|
1357
|
+
var _n = (0, e.useCallback)((function(e, n) {
|
|
1360
1358
|
var r = n.value;
|
|
1361
1359
|
e.preventDefault();
|
|
1362
|
-
if (!
|
|
1360
|
+
if (!qe) {
|
|
1363
1361
|
return;
|
|
1364
1362
|
}
|
|
1365
|
-
|
|
1366
|
-
}), [
|
|
1367
|
-
var
|
|
1363
|
+
Ln(e, r);
|
|
1364
|
+
}), [ qe, Ln ]);
|
|
1365
|
+
var Hn = (0, e.useCallback)((function(e, n) {
|
|
1368
1366
|
var r = e.nativeEvent.key;
|
|
1369
1367
|
// Checking for a single character to avoid complications from double-byte languages and emojis.
|
|
1370
1368
|
if (r.length === 1) {
|
|
@@ -1373,93 +1371,93 @@
|
|
|
1373
1371
|
index: 0,
|
|
1374
1372
|
value: r
|
|
1375
1373
|
};
|
|
1376
|
-
if (!
|
|
1374
|
+
if (!an.current) {
|
|
1377
1375
|
if (r === " ") {
|
|
1378
|
-
|
|
1376
|
+
Nn();
|
|
1379
1377
|
return;
|
|
1380
1378
|
}
|
|
1381
|
-
t =
|
|
1382
|
-
} else if (
|
|
1383
|
-
o.index =
|
|
1384
|
-
t =
|
|
1379
|
+
t = Re(mn.current, o);
|
|
1380
|
+
} else if (pn.current.length > 1) {
|
|
1381
|
+
o.index = an.current.index + 1;
|
|
1382
|
+
t = Re(pn.current, o);
|
|
1385
1383
|
}
|
|
1386
1384
|
if (t.length) {
|
|
1387
1385
|
var l;
|
|
1388
1386
|
var a = 0;
|
|
1389
1387
|
// If the active option is a first character match, cycle to the next matching option.
|
|
1390
1388
|
if (o.index === 0 && t.length > 1) {
|
|
1391
|
-
var i = t.indexOf(
|
|
1389
|
+
var i = t.indexOf(mn.current[n]);
|
|
1392
1390
|
if (i >= 0) {
|
|
1393
1391
|
a = i === t.length - 1 ? 0 : i + 1;
|
|
1394
1392
|
}
|
|
1395
1393
|
}
|
|
1396
1394
|
var u = t[a];
|
|
1397
1395
|
var c = u.value, s = u.label;
|
|
1398
|
-
var d =
|
|
1396
|
+
var d = Sn.current[fn(c, s)];
|
|
1399
1397
|
d === null || d === void 0 ? void 0 : (l = d.focus) === null || l === void 0 ? void 0 : l.call(d);
|
|
1400
1398
|
}
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
if (
|
|
1404
|
-
clearTimeout(
|
|
1399
|
+
pn.current = t;
|
|
1400
|
+
an.current = o;
|
|
1401
|
+
if (un.current) {
|
|
1402
|
+
clearTimeout(un.current);
|
|
1405
1403
|
}
|
|
1406
|
-
|
|
1404
|
+
un.current = setTimeout(Nn, 500);
|
|
1407
1405
|
e.preventDefault();
|
|
1408
1406
|
e.stopPropagation();
|
|
1409
1407
|
}
|
|
1410
1408
|
}), []);
|
|
1411
|
-
var
|
|
1409
|
+
var Kn = (0, e.useCallback)((function(e, n) {
|
|
1412
1410
|
var r = n.value;
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1411
|
+
Le(r);
|
|
1412
|
+
He(true);
|
|
1413
|
+
Ee(0);
|
|
1416
1414
|
H === null || H === void 0 ? void 0 : H(e, {
|
|
1417
1415
|
keyword: r
|
|
1418
1416
|
});
|
|
1419
1417
|
}), [ H ]);
|
|
1420
|
-
var
|
|
1421
|
-
|
|
1418
|
+
var zn = (0, e.useCallback)((function() {
|
|
1419
|
+
Xe(true);
|
|
1422
1420
|
}), []);
|
|
1423
|
-
var
|
|
1424
|
-
|
|
1421
|
+
var $n = (0, e.useCallback)((function() {
|
|
1422
|
+
Xe(false);
|
|
1425
1423
|
}), []);
|
|
1426
|
-
var
|
|
1427
|
-
if (
|
|
1428
|
-
|
|
1424
|
+
var Wn = (0, e.useCallback)((function(e) {
|
|
1425
|
+
if (yn.current !== Pe) {
|
|
1426
|
+
Ae(e);
|
|
1429
1427
|
}
|
|
1430
|
-
}), [
|
|
1428
|
+
}), [ Pe ]);
|
|
1431
1429
|
var Un = (0, e.useCallback)((function(e, n, r) {
|
|
1432
1430
|
if (r) {
|
|
1433
|
-
|
|
1431
|
+
kn.current = e;
|
|
1434
1432
|
}
|
|
1435
1433
|
if (e == null) {
|
|
1436
|
-
delete
|
|
1434
|
+
delete Sn.current[n];
|
|
1437
1435
|
} else {
|
|
1438
|
-
|
|
1439
|
-
}
|
|
1440
|
-
}), [
|
|
1441
|
-
var
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
}), [
|
|
1445
|
-
var
|
|
1436
|
+
Sn.current[n] = e;
|
|
1437
|
+
}
|
|
1438
|
+
}), [ Sn ]);
|
|
1439
|
+
var Xn = (0, e.useCallback)((function(e) {
|
|
1440
|
+
ln.current = e;
|
|
1441
|
+
Fe(y, e);
|
|
1442
|
+
}), [ y, ln ]);
|
|
1443
|
+
var Gn = (0, e.useMemo)((function() {
|
|
1446
1444
|
var e;
|
|
1447
|
-
return (e =
|
|
1448
|
-
}), [
|
|
1449
|
-
var
|
|
1450
|
-
var
|
|
1451
|
-
var n = B()(
|
|
1452
|
-
return
|
|
1445
|
+
return (e = An()) !== null && e !== void 0 ? e : [];
|
|
1446
|
+
}), [ An ]);
|
|
1447
|
+
var Jn = e.Children.toArray(f);
|
|
1448
|
+
var Qn = Gn.some((function(e) {
|
|
1449
|
+
var n = B()(Jn, (function(n) {
|
|
1450
|
+
return dn(n) && n.props.value === e;
|
|
1453
1451
|
}));
|
|
1454
1452
|
return n && !n.props.disabled;
|
|
1455
1453
|
}));
|
|
1456
|
-
var
|
|
1457
|
-
var
|
|
1454
|
+
var Yn = ae === "immediately" ? In() : Qe;
|
|
1455
|
+
var Zn = (0, e.useMemo)((function() {
|
|
1458
1456
|
wn.current = 0;
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1457
|
+
xn.current = undefined;
|
|
1458
|
+
jn.current = 0;
|
|
1459
|
+
On.current = undefined;
|
|
1460
|
+
mn.current = [];
|
|
1463
1461
|
var r = function e(n, r) {
|
|
1464
1462
|
return function(e) {
|
|
1465
1463
|
return Un(e, n, r);
|
|
@@ -1472,68 +1470,68 @@
|
|
|
1472
1470
|
var i;
|
|
1473
1471
|
var c = e.Children.toArray(f).reduce((function(c, s, d) {
|
|
1474
1472
|
// ignore Headings and Dividers
|
|
1475
|
-
if (!
|
|
1473
|
+
if (!dn(s)) {
|
|
1476
1474
|
c.push(s);
|
|
1477
1475
|
return c;
|
|
1478
1476
|
}
|
|
1479
1477
|
var f = s.props, p = f.disabled, v = f.hidden, b = f.label, m = f.value;
|
|
1480
1478
|
// Find out if the search string exactly matches a value
|
|
1481
|
-
if (m ===
|
|
1479
|
+
if (m === Te) {
|
|
1482
1480
|
t = true;
|
|
1483
1481
|
}
|
|
1484
|
-
var
|
|
1485
|
-
var
|
|
1482
|
+
var g = Gn && Gn.indexOf(m) >= 0;
|
|
1483
|
+
var y = !!g && !p && !i;
|
|
1486
1484
|
var h = o && !I && !O && !j && !_;
|
|
1487
|
-
var S =
|
|
1488
|
-
var
|
|
1485
|
+
var S = fn(m, b);
|
|
1486
|
+
var w = -1;
|
|
1489
1487
|
if (h && !p && !v) {
|
|
1490
|
-
|
|
1488
|
+
mn.current.push({
|
|
1491
1489
|
label: b,
|
|
1492
1490
|
value: m
|
|
1493
1491
|
});
|
|
1494
|
-
|
|
1492
|
+
w = mn.current.length - 1;
|
|
1495
1493
|
}
|
|
1496
1494
|
// Format the Menu.Item
|
|
1497
|
-
var
|
|
1498
|
-
elementRef: r(S,
|
|
1495
|
+
var C = (0, e.cloneElement)(s, {
|
|
1496
|
+
elementRef: r(S, y),
|
|
1499
1497
|
key: s.key || d,
|
|
1500
|
-
onClick:
|
|
1498
|
+
onClick: _n,
|
|
1501
1499
|
onKeyDown: h ? function(e) {
|
|
1502
|
-
return
|
|
1500
|
+
return Hn(e, w);
|
|
1503
1501
|
} : undefined,
|
|
1504
|
-
selected:
|
|
1502
|
+
selected: g,
|
|
1505
1503
|
multiple: I,
|
|
1506
1504
|
role: "option"
|
|
1507
1505
|
});
|
|
1508
|
-
if (
|
|
1506
|
+
if (y) {
|
|
1509
1507
|
i = true;
|
|
1510
1508
|
}
|
|
1511
|
-
if (
|
|
1509
|
+
if (Yn && Yn.indexOf(m) >= 0) {
|
|
1512
1510
|
if (l === 0) {
|
|
1513
1511
|
c.splice(l, 0, n().createElement(u.Divider, {
|
|
1514
1512
|
key: "topDivider"
|
|
1515
1513
|
}));
|
|
1516
1514
|
a = true;
|
|
1517
1515
|
}
|
|
1518
|
-
c.splice(l, 0,
|
|
1516
|
+
c.splice(l, 0, C);
|
|
1519
1517
|
l += 1;
|
|
1520
1518
|
} else {
|
|
1521
|
-
c.push(
|
|
1519
|
+
c.push(C);
|
|
1522
1520
|
}
|
|
1523
1521
|
return c;
|
|
1524
1522
|
}), []);
|
|
1525
1523
|
// In multiple mode, add missing items
|
|
1526
1524
|
if (I) {
|
|
1527
|
-
L()(
|
|
1525
|
+
L()(Gn, (function(e) {
|
|
1528
1526
|
var o = B()(c, (function(n) {
|
|
1529
|
-
return
|
|
1527
|
+
return dn(n) && n.props && n.props.value === e;
|
|
1530
1528
|
}));
|
|
1531
1529
|
if (!o) {
|
|
1532
|
-
if (e ===
|
|
1530
|
+
if (e === Te) {
|
|
1533
1531
|
t = true;
|
|
1534
1532
|
}
|
|
1535
|
-
var i =
|
|
1536
|
-
var s =
|
|
1533
|
+
var i = Yn && Yn.indexOf(e) >= 0;
|
|
1534
|
+
var s = Yn.length;
|
|
1537
1535
|
if (l === 0) {
|
|
1538
1536
|
c.splice(0, 0, n().createElement(u.Divider, {
|
|
1539
1537
|
key: "topDivider"
|
|
@@ -1542,13 +1540,13 @@
|
|
|
1542
1540
|
a = true;
|
|
1543
1541
|
}
|
|
1544
1542
|
var d = String(e);
|
|
1545
|
-
var f =
|
|
1546
|
-
c.splice(i ? 0 : s + 1, 0, n().createElement(
|
|
1543
|
+
var f = fn(e, d);
|
|
1544
|
+
c.splice(i ? 0 : s + 1, 0, n().createElement(C, {
|
|
1547
1545
|
elementRef: r(f),
|
|
1548
1546
|
label: d,
|
|
1549
1547
|
value: e,
|
|
1550
1548
|
key: "missing-value-".concat(e),
|
|
1551
|
-
onClick:
|
|
1549
|
+
onClick: _n,
|
|
1552
1550
|
multiple: I,
|
|
1553
1551
|
selected: true
|
|
1554
1552
|
}));
|
|
@@ -1560,15 +1558,15 @@
|
|
|
1560
1558
|
}
|
|
1561
1559
|
var p = O === "controlled";
|
|
1562
1560
|
// Filter the items
|
|
1563
|
-
var v = (0, ue.stringToKeywords)(
|
|
1561
|
+
var v = (0, ue.stringToKeywords)(Te);
|
|
1564
1562
|
c = p ? c : c.filter((function(e) {
|
|
1565
|
-
if (
|
|
1563
|
+
if (dn(e)) {
|
|
1566
1564
|
return (0, ue.testPhrase)(e.props.label, v);
|
|
1567
1565
|
}
|
|
1568
1566
|
return true;
|
|
1569
1567
|
// Keep all headers and non-interactive options
|
|
1570
1568
|
})).map((function(n) {
|
|
1571
|
-
if (!
|
|
1569
|
+
if (!dn(n)) {
|
|
1572
1570
|
return n;
|
|
1573
1571
|
}
|
|
1574
1572
|
// highlight matched text
|
|
@@ -1579,26 +1577,26 @@
|
|
|
1579
1577
|
});
|
|
1580
1578
|
}));
|
|
1581
1579
|
// Add the option to add the new value
|
|
1582
|
-
if (s && !t &&
|
|
1580
|
+
if (s && !t && Te) {
|
|
1583
1581
|
var b = a ? l + 1 : l;
|
|
1584
|
-
var m = "".concat(
|
|
1585
|
-
var
|
|
1586
|
-
c.splice(b, 0, n().createElement(
|
|
1587
|
-
elementRef: r(
|
|
1582
|
+
var m = "".concat(Te, " (new value)");
|
|
1583
|
+
var g = fn(Te, m);
|
|
1584
|
+
c.splice(b, 0, n().createElement(C, {
|
|
1585
|
+
elementRef: r(g),
|
|
1588
1586
|
label: m,
|
|
1589
|
-
value:
|
|
1587
|
+
value: Te,
|
|
1590
1588
|
key: "newValue",
|
|
1591
1589
|
multiple: I,
|
|
1592
|
-
onClick:
|
|
1590
|
+
onClick: _n
|
|
1593
1591
|
}));
|
|
1594
1592
|
}
|
|
1595
1593
|
// When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
|
|
1596
|
-
var
|
|
1594
|
+
var y = le === "checkbox" && I && c.length > 1 ? 1 : 0;
|
|
1597
1595
|
var h = true;
|
|
1598
1596
|
// Highlight the selected Items and remove hidden
|
|
1599
1597
|
c = c.reduce((function(n, r) {
|
|
1600
1598
|
// ignore Dividers & Headings
|
|
1601
|
-
if (!
|
|
1599
|
+
if (!dn(r)) {
|
|
1602
1600
|
n.push(r);
|
|
1603
1601
|
return n;
|
|
1604
1602
|
}
|
|
@@ -1606,13 +1604,13 @@
|
|
|
1606
1604
|
if (r.props && r.props.hidden) {
|
|
1607
1605
|
return n;
|
|
1608
1606
|
}
|
|
1609
|
-
if (r.props.selected && !r.props.disabled &&
|
|
1610
|
-
|
|
1607
|
+
if (r.props.selected && !r.props.disabled && xn.current == null) {
|
|
1608
|
+
xn.current = wn.current;
|
|
1611
1609
|
}
|
|
1612
|
-
var t =
|
|
1613
|
-
|
|
1610
|
+
var t = y === Pe;
|
|
1611
|
+
y += 1;
|
|
1614
1612
|
wn.current += 1;
|
|
1615
|
-
|
|
1613
|
+
jn.current += r.props.selected ? 1 : 0;
|
|
1616
1614
|
if (r.key !== "newValue" && !r.props.disabled && !r.props.selected) {
|
|
1617
1615
|
h = false;
|
|
1618
1616
|
}
|
|
@@ -1621,160 +1619,160 @@
|
|
|
1621
1619
|
return n;
|
|
1622
1620
|
}
|
|
1623
1621
|
if (!r.props.disabled) {
|
|
1624
|
-
|
|
1622
|
+
On.current = r.props.value;
|
|
1625
1623
|
}
|
|
1626
1624
|
var o = (0, e.cloneElement)(r, {
|
|
1627
1625
|
active: t,
|
|
1628
|
-
elementRef:
|
|
1629
|
-
id:
|
|
1626
|
+
elementRef: Wn,
|
|
1627
|
+
id: Ce
|
|
1630
1628
|
});
|
|
1631
1629
|
n.push(o);
|
|
1632
1630
|
return n;
|
|
1633
1631
|
}), []);
|
|
1634
|
-
|
|
1632
|
+
Pn.current = jn.current === 0 && "none" || h && "all" || "some";
|
|
1635
1633
|
// add select all option
|
|
1636
1634
|
if (le === "checkbox" && I && wn.current > 0) {
|
|
1637
1635
|
var S;
|
|
1638
|
-
if (
|
|
1639
|
-
if (
|
|
1636
|
+
if (Pn.current === "all") {
|
|
1637
|
+
if (Te === "") {
|
|
1640
1638
|
S = (0, d._)("Clear all");
|
|
1641
1639
|
} else {
|
|
1642
1640
|
S = (0, d._)("Clear all matches");
|
|
1643
1641
|
}
|
|
1644
|
-
} else if (
|
|
1642
|
+
} else if (Te === "") {
|
|
1645
1643
|
S = (0, d._)("Select all");
|
|
1646
1644
|
} else {
|
|
1647
1645
|
S = (0, d._)("Select all matches");
|
|
1648
1646
|
}
|
|
1649
|
-
if (
|
|
1650
|
-
|
|
1647
|
+
if (Pe === 0 && Ue) {
|
|
1648
|
+
On.current = "selectAll";
|
|
1651
1649
|
}
|
|
1652
|
-
c.unshift( n().createElement(
|
|
1650
|
+
c.unshift( n().createElement(fe, {
|
|
1653
1651
|
key: "select-all-option",
|
|
1654
|
-
active:
|
|
1655
|
-
changedToggle: !!
|
|
1656
|
-
elementRef:
|
|
1657
|
-
id:
|
|
1658
|
-
onClick:
|
|
1652
|
+
active: Pe === 0,
|
|
1653
|
+
changedToggle: !!be,
|
|
1654
|
+
elementRef: Wn,
|
|
1655
|
+
id: Pe === 0 ? Ce : undefined,
|
|
1656
|
+
onClick: Pn.current === "all" ? Dn : Vn,
|
|
1659
1657
|
selectAllLabel: S,
|
|
1660
|
-
selected:
|
|
1661
|
-
totalCount:
|
|
1658
|
+
selected: Pn.current === "all" || Pn.current !== "none" && "some",
|
|
1659
|
+
totalCount: Gn.length,
|
|
1662
1660
|
tabIndex: -1
|
|
1663
1661
|
}), n().createElement(u.Divider, {
|
|
1664
1662
|
key: "selectAllDivider"
|
|
1665
1663
|
}));
|
|
1666
1664
|
}
|
|
1667
|
-
|
|
1668
|
-
if (
|
|
1665
|
+
Cn.current = c.reduce((function(e, n) {
|
|
1666
|
+
if (dn(n)) {
|
|
1669
1667
|
e.push(n.props.value);
|
|
1670
1668
|
}
|
|
1671
1669
|
return e;
|
|
1672
1670
|
}), []);
|
|
1673
1671
|
return c;
|
|
1674
|
-
}), [
|
|
1675
|
-
var
|
|
1672
|
+
}), [ Pe, Ce, o, s, f, Gn, O, Te, Wn, Dn, _n, Hn, Un, Vn, j, I, Yn, _, le, Ue, be ]);
|
|
1673
|
+
var er = function e(r) {
|
|
1676
1674
|
var t = r.anchorWidth, o = r.maxHeight, a = r.placement;
|
|
1677
|
-
var i =
|
|
1675
|
+
var i = cn({
|
|
1678
1676
|
anchorWidth: t,
|
|
1679
1677
|
isMultiple: I,
|
|
1680
1678
|
maxHeight: o,
|
|
1681
1679
|
menuStyle: A
|
|
1682
1680
|
});
|
|
1683
|
-
var u =
|
|
1681
|
+
var u = Gn.length > 0 && !Qn && !O ? 0 : undefined;
|
|
1684
1682
|
var c = {
|
|
1685
1683
|
"aria-multiselectable": I || undefined,
|
|
1686
1684
|
childrenStart: !!O && n().createElement(gn, {
|
|
1687
|
-
activeItemId:
|
|
1688
|
-
filterA11yId:
|
|
1689
|
-
filterKeyword:
|
|
1690
|
-
hasChildren:
|
|
1691
|
-
return
|
|
1685
|
+
activeItemId: Ce,
|
|
1686
|
+
filterA11yId: Rn,
|
|
1687
|
+
filterKeyword: Te,
|
|
1688
|
+
hasChildren: Zn.some((function(e) {
|
|
1689
|
+
return dn(e);
|
|
1692
1690
|
})),
|
|
1693
1691
|
inputId: k,
|
|
1694
1692
|
inputRef: x,
|
|
1695
|
-
menuListboxId:
|
|
1693
|
+
menuListboxId: ke,
|
|
1696
1694
|
multiple: I,
|
|
1697
1695
|
onClearAll: Dn,
|
|
1698
|
-
onSelectAll:
|
|
1699
|
-
onTextBlur:
|
|
1700
|
-
onTextChange:
|
|
1701
|
-
onTextFocus:
|
|
1702
|
-
onTextKeyDown:
|
|
1703
|
-
optionSelection:
|
|
1696
|
+
onSelectAll: Vn,
|
|
1697
|
+
onTextBlur: $n,
|
|
1698
|
+
onTextChange: Kn,
|
|
1699
|
+
onTextFocus: zn,
|
|
1700
|
+
onTextKeyDown: Fn,
|
|
1701
|
+
optionSelection: Pn,
|
|
1704
1702
|
placement: a,
|
|
1705
1703
|
selectAllAppearance: le,
|
|
1706
1704
|
textHasFocus: Ue
|
|
1707
1705
|
}),
|
|
1708
1706
|
focusMode: O ? "never" : undefined,
|
|
1709
1707
|
isLoading: j,
|
|
1710
|
-
menuId:
|
|
1711
|
-
onScrollBottom: _ ?
|
|
1708
|
+
menuId: ke,
|
|
1709
|
+
onScrollBottom: _ ? qn : undefined,
|
|
1712
1710
|
placement: a !== null && a !== void 0 ? a : undefined,
|
|
1713
|
-
noOptionsMessage:
|
|
1711
|
+
noOptionsMessage: D,
|
|
1714
1712
|
footerMessage: S,
|
|
1715
1713
|
animateLoading: l,
|
|
1716
|
-
loadingMessage:
|
|
1714
|
+
loadingMessage: E,
|
|
1717
1715
|
onScroll: F,
|
|
1718
1716
|
style: i,
|
|
1719
1717
|
tabIndex: u
|
|
1720
1718
|
};
|
|
1721
|
-
if (
|
|
1719
|
+
if (ve) {
|
|
1722
1720
|
|
|
1723
|
-
return n().createElement(ee.VirtualizedResultsMenu,
|
|
1724
|
-
virtualization:
|
|
1725
|
-
}, c),
|
|
1721
|
+
return n().createElement(ee.VirtualizedResultsMenu, $e({
|
|
1722
|
+
virtualization: ve
|
|
1723
|
+
}, c), Zn);
|
|
1726
1724
|
}
|
|
1727
1725
|
|
|
1728
|
-
return n().createElement(ne(), c,
|
|
1726
|
+
return n().createElement(ne(), c, Zn);
|
|
1729
1727
|
};
|
|
1730
|
-
var
|
|
1728
|
+
var nr = (0, e.useMemo)((function() {
|
|
1731
1729
|
|
|
1732
|
-
return n().createElement(
|
|
1730
|
+
return n().createElement(hn, $e({
|
|
1733
1731
|
appearance: i,
|
|
1734
1732
|
append: c,
|
|
1735
|
-
currentValues:
|
|
1733
|
+
currentValues: An(),
|
|
1736
1734
|
"data-test": I ? "multiselect" : "select",
|
|
1737
1735
|
describedBy: m,
|
|
1738
|
-
disabled:
|
|
1739
|
-
elementRef:
|
|
1736
|
+
disabled: g,
|
|
1737
|
+
elementRef: Xn,
|
|
1740
1738
|
error: h,
|
|
1741
|
-
inline:
|
|
1742
|
-
labelText:
|
|
1739
|
+
inline: w,
|
|
1740
|
+
labelText: M,
|
|
1743
1741
|
labelledBy: P,
|
|
1744
1742
|
multiple: I,
|
|
1745
1743
|
onClick: z,
|
|
1746
1744
|
placeholder: J,
|
|
1747
1745
|
prefixLabel: Y,
|
|
1748
1746
|
prepend: Z,
|
|
1749
|
-
required:
|
|
1750
|
-
suffixLabel:
|
|
1751
|
-
toggle:
|
|
1747
|
+
required: X,
|
|
1748
|
+
suffixLabel: se,
|
|
1749
|
+
toggle: be,
|
|
1752
1750
|
toggleContent: ge
|
|
1753
|
-
},
|
|
1754
|
-
}), [ i, c,
|
|
1751
|
+
}, ye), f);
|
|
1752
|
+
}), [ i, c, An, I, m, g, h, Xn, w, M, P, z, J, Y, Z, X, se, be, ge, ye, f ]);
|
|
1755
1753
|
|
|
1756
1754
|
return n().createElement(Q(), {
|
|
1757
|
-
closeReasons:
|
|
1755
|
+
closeReasons: sn,
|
|
1758
1756
|
inputId: k,
|
|
1759
|
-
"aria-labelledby":
|
|
1760
|
-
toggle:
|
|
1761
|
-
onRequestOpen:
|
|
1762
|
-
onRequestClose:
|
|
1763
|
-
open:
|
|
1757
|
+
"aria-labelledby": Rn,
|
|
1758
|
+
toggle: nr,
|
|
1759
|
+
onRequestOpen: Bn,
|
|
1760
|
+
onRequestClose: Tn,
|
|
1761
|
+
open: qe,
|
|
1764
1762
|
openWithArrowKeys: true,
|
|
1765
1763
|
repositionMode: te,
|
|
1766
1764
|
defaultPlacement: v,
|
|
1767
|
-
canCoverAnchor:
|
|
1765
|
+
canCoverAnchor: Ve().innerHeight < 500,
|
|
1768
1766
|
retainFocus: false,
|
|
1769
|
-
takeFocus:
|
|
1770
|
-
},
|
|
1771
|
-
}
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
/* harmony default export */ const
|
|
1767
|
+
takeFocus: Gn.length === 0 || Gn.length > 0 && !Qn || !!O
|
|
1768
|
+
}, er);
|
|
1769
|
+
}
|
|
1770
|
+
On.propTypes = an;
|
|
1771
|
+
On.componentType = "SelectBase";
|
|
1772
|
+
On.Option = C;
|
|
1773
|
+
On.Divider = u.Divider;
|
|
1774
|
+
On.Heading = u.Heading;
|
|
1775
|
+
/* harmony default export */ const Sn = On;
|
|
1778
1776
|
// CONCATENATED MODULE: ./src/Multiselect/Compact.tsx
|
|
1779
1777
|
function wn() {
|
|
1780
1778
|
return wn = Object.assign ? Object.assign.bind() : function(e) {
|
|
@@ -1787,9 +1785,9 @@
|
|
|
1787
1785
|
return e;
|
|
1788
1786
|
}, wn.apply(null, arguments);
|
|
1789
1787
|
}
|
|
1790
|
-
function
|
|
1788
|
+
function Cn(e, n) {
|
|
1791
1789
|
if (null == e) return {};
|
|
1792
|
-
var r, t, o =
|
|
1790
|
+
var r, t, o = kn(e, n);
|
|
1793
1791
|
if (Object.getOwnPropertySymbols) {
|
|
1794
1792
|
var l = Object.getOwnPropertySymbols(e);
|
|
1795
1793
|
for (t = 0; t < l.length; t++) {
|
|
@@ -1798,7 +1796,7 @@
|
|
|
1798
1796
|
}
|
|
1799
1797
|
return o;
|
|
1800
1798
|
}
|
|
1801
|
-
function
|
|
1799
|
+
function kn(e, n) {
|
|
1802
1800
|
if (null == e) return {};
|
|
1803
1801
|
var r = {};
|
|
1804
1802
|
for (var t in e) {
|
|
@@ -1809,7 +1807,7 @@
|
|
|
1809
1807
|
}
|
|
1810
1808
|
return r;
|
|
1811
1809
|
}
|
|
1812
|
-
var
|
|
1810
|
+
var xn = {
|
|
1813
1811
|
allowNewValues: l().bool,
|
|
1814
1812
|
animateLoading: l().bool,
|
|
1815
1813
|
children: l().node,
|
|
@@ -1847,11 +1845,11 @@
|
|
|
1847
1845
|
virtualization: l().number
|
|
1848
1846
|
};
|
|
1849
1847
|
// TS: not typed controlled/uncontrolled, handled by Multiselect wrapper component
|
|
1850
|
-
var
|
|
1851
|
-
var
|
|
1852
|
-
var
|
|
1853
|
-
function
|
|
1854
|
-
var t = r.allowNewValues, o = r.animateLoading, l = r.children, a = r.controlledFilter, i = r.defaultPlacement, u = i === void 0 ? "vertical" : i, c = r.defaultValues, s = r.describedBy, d = r.disabled, f = r.elementRef, p = r.error, v = r.filter, b = r.footerMessage, m = r.inline,
|
|
1848
|
+
var jn = {};
|
|
1849
|
+
var Pn = (0, d._)("No matches");
|
|
1850
|
+
var Mn = (0, d._)("Select...");
|
|
1851
|
+
function En(r) {
|
|
1852
|
+
var t = r.allowNewValues, o = r.animateLoading, l = r.children, a = r.controlledFilter, i = r.defaultPlacement, u = i === void 0 ? "vertical" : i, c = r.defaultValues, s = r.describedBy, d = r.disabled, f = r.elementRef, p = r.error, v = r.filter, b = r.footerMessage, m = r.inline, g = r.inputId, y = r.inputRef, h = r.isLoadingOptions, O = r.labelledBy, S = r.loadingMessage, w = r.menuStyle, k = w === void 0 ? jn : w, x = r.name, j = r.noOptionsMessage, P = j === void 0 ? Pn : j, M = r.onChange, E = r.onClose, R = r.onFilterChange, A = r.onOpen, I = r.onScroll, B = r.onScrollBottom, T = r.placeholder, L = T === void 0 ? Mn : T, N = r.repositionMode, V = r.selectAllAppearance, D = r.showSelectedValuesFirst, q = D === void 0 ? "nextOpen" : D, F = r.tabConfirmsNewValue, _ = r.values, H = r.virtualization, K = Cn(r, [ "allowNewValues", "animateLoading", "children", "controlledFilter", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onChange", "onClose", "onFilterChange", "onOpen", "onScroll", "onScrollBottom", "placeholder", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "tabConfirmsNewValue", "values", "virtualization" ]);
|
|
1855
1853
|
// @docs-props-type CompactPropsBase
|
|
1856
1854
|
if (false) {}
|
|
1857
1855
|
var z = true;
|
|
@@ -1863,11 +1861,11 @@
|
|
|
1863
1861
|
}
|
|
1864
1862
|
var $ = {
|
|
1865
1863
|
children: e.Children.toArray(l).map((function(e) {
|
|
1866
|
-
if (
|
|
1864
|
+
if (dn(e)) {
|
|
1867
1865
|
var r;
|
|
1868
1866
|
var t = (r = e.key) !== null && r !== void 0 ? r : "".concat(e.props.label, "-").concat(e.props.value);
|
|
1869
1867
|
|
|
1870
|
-
return n().createElement(
|
|
1868
|
+
return n().createElement(C, wn({
|
|
1871
1869
|
key: t
|
|
1872
1870
|
}, e.props, {
|
|
1873
1871
|
multiple: true
|
|
@@ -1884,7 +1882,7 @@
|
|
|
1884
1882
|
$.values = _;
|
|
1885
1883
|
}
|
|
1886
1884
|
|
|
1887
|
-
return n().createElement(
|
|
1885
|
+
return n().createElement(Sn, wn({
|
|
1888
1886
|
allowNewValues: t,
|
|
1889
1887
|
animateLoading: o,
|
|
1890
1888
|
describedBy: s,
|
|
@@ -1894,113 +1892,113 @@
|
|
|
1894
1892
|
error: p,
|
|
1895
1893
|
footerMessage: b,
|
|
1896
1894
|
inline: m,
|
|
1897
|
-
inputId:
|
|
1898
|
-
inputRef:
|
|
1895
|
+
inputId: g,
|
|
1896
|
+
inputRef: y,
|
|
1899
1897
|
isLoadingOptions: h,
|
|
1900
1898
|
labelledBy: O,
|
|
1901
1899
|
loadingMessage: S,
|
|
1902
1900
|
menuStyle: k,
|
|
1903
1901
|
name: x,
|
|
1904
1902
|
noOptionsMessage: P,
|
|
1905
|
-
onChange:
|
|
1906
|
-
onClose:
|
|
1907
|
-
onFilterChange:
|
|
1903
|
+
onChange: M,
|
|
1904
|
+
onClose: E,
|
|
1905
|
+
onFilterChange: R,
|
|
1908
1906
|
onOpen: A,
|
|
1909
1907
|
onScroll: I,
|
|
1910
1908
|
onScrollBottom: B,
|
|
1911
1909
|
placeholder: L,
|
|
1912
1910
|
repositionMode: N,
|
|
1913
1911
|
selectAllAppearance: V,
|
|
1914
|
-
showSelectedValuesFirst:
|
|
1912
|
+
showSelectedValuesFirst: q,
|
|
1915
1913
|
tabConfirmsNewValue: F,
|
|
1916
1914
|
virtualization: H
|
|
1917
1915
|
}, K, $, {
|
|
1918
1916
|
multiple: true
|
|
1919
1917
|
}));
|
|
1920
1918
|
}
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
/* harmony default export */ const
|
|
1919
|
+
En.propTypes = xn;
|
|
1920
|
+
En.Option = E;
|
|
1921
|
+
En.Divider = u.Divider;
|
|
1922
|
+
En.Heading = u.Heading;
|
|
1923
|
+
/* harmony default export */ const Rn = En;
|
|
1926
1924
|
// CONCATENATED MODULE: external "lodash/defer"
|
|
1927
|
-
const
|
|
1928
|
-
var
|
|
1925
|
+
const An = require("lodash/defer");
|
|
1926
|
+
var In = r.n(An);
|
|
1929
1927
|
// CONCATENATED MODULE: external "lodash/get"
|
|
1930
|
-
const
|
|
1931
|
-
var
|
|
1928
|
+
const Bn = require("lodash/get");
|
|
1929
|
+
var Tn = r.n(Bn);
|
|
1932
1930
|
// CONCATENATED MODULE: external "lodash/isString"
|
|
1933
|
-
const
|
|
1934
|
-
var
|
|
1931
|
+
const Ln = require("lodash/isString");
|
|
1932
|
+
var Nn = r.n(Ln);
|
|
1935
1933
|
// CONCATENATED MODULE: external "lodash/keys"
|
|
1936
|
-
const
|
|
1937
|
-
var Dn = r.n(
|
|
1934
|
+
const Vn = require("lodash/keys");
|
|
1935
|
+
var Dn = r.n(Vn);
|
|
1938
1936
|
// CONCATENATED MODULE: external "lodash/last"
|
|
1939
|
-
const
|
|
1940
|
-
var
|
|
1937
|
+
const qn = require("lodash/last");
|
|
1938
|
+
var Fn = r.n(qn);
|
|
1941
1939
|
// CONCATENATED MODULE: external "lodash/omit"
|
|
1942
|
-
const
|
|
1943
|
-
var
|
|
1940
|
+
const _n = require("lodash/omit");
|
|
1941
|
+
var Hn = r.n(_n);
|
|
1944
1942
|
// CONCATENATED MODULE: external "lodash/pickBy"
|
|
1945
|
-
const
|
|
1946
|
-
var
|
|
1943
|
+
const Kn = require("lodash/pickBy");
|
|
1944
|
+
var zn = r.n(Kn);
|
|
1947
1945
|
// CONCATENATED MODULE: external "@splunk/react-ui/Popover"
|
|
1948
|
-
const
|
|
1949
|
-
var
|
|
1946
|
+
const $n = require("@splunk/react-ui/Popover");
|
|
1947
|
+
var Wn = r.n($n);
|
|
1950
1948
|
// CONCATENATED MODULE: external "@splunk/ui-utils/format"
|
|
1951
1949
|
const Un = require("@splunk/ui-utils/format");
|
|
1952
1950
|
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
1953
|
-
const
|
|
1954
|
-
var
|
|
1951
|
+
const Xn = require("@splunk/react-ui/Box");
|
|
1952
|
+
var Gn = r.n(Xn);
|
|
1955
1953
|
// CONCATENATED MODULE: external "@splunk/react-ui/Chip"
|
|
1956
|
-
const
|
|
1957
|
-
var
|
|
1954
|
+
const Jn = require("@splunk/react-ui/Chip");
|
|
1955
|
+
var Qn = r.n(Jn);
|
|
1958
1956
|
// CONCATENATED MODULE: ./src/Multiselect/NormalStyles.ts
|
|
1959
|
-
var
|
|
1957
|
+
var Yn = ve()(Gn()).withConfig({
|
|
1960
1958
|
displayName: "NormalStyles__StyledBox",
|
|
1961
1959
|
componentId: "sc-1uwwpco-0"
|
|
1962
|
-
})([ "display:flex;align-items:center;flex-wrap:wrap;gap:", ";border-radius:", ";min-width:200px;min-height:", ";max-height:300px;overflow-y:auto;border:", " solid ", ";padding-inline:", ";background-color:", ";", " ", " ", " ", " ", " &[data-inline]{width:400px;}" ],
|
|
1960
|
+
})([ "display:flex;align-items:center;flex-wrap:wrap;gap:", ";border-radius:", ";min-width:200px;min-height:", ";max-height:300px;overflow-y:auto;border:", " solid ", ";padding-inline:", ";background-color:", ";", " ", " ", " ", " ", " &[data-inline]{width:400px;}" ], he.variables.spacingXSmall, he.variables.borderRadius, he.variables.inputHeight, he.variables.inputBorderWidth, he.variables.interactiveColorBorder, he.variables.spacingXSmall, he.variables.interactiveColorBackground, (function(e) {
|
|
1963
1961
|
var n = e.$hasFocus;
|
|
1964
|
-
return n && (0,
|
|
1962
|
+
return n && (0, pe.css)([ "box-shadow:", ";" ], he.variables.focusShadow);
|
|
1965
1963
|
}), (function(e) {
|
|
1966
1964
|
var n = e.$error;
|
|
1967
|
-
return n && (0,
|
|
1965
|
+
return n && (0, pe.css)([ "border-color:", ";&:hover:not([disabled]){border-color:", ";}" ], he.variables.interactiveColorAccentError, he.variables.interactiveColorAccentErrorStrong);
|
|
1968
1966
|
}), (function(e) {
|
|
1969
1967
|
var n = e.$disabled;
|
|
1970
|
-
return n && (0,
|
|
1968
|
+
return n && (0, pe.css)([ "border-color:", ";background-color:", ";cursor:not-allowed;" ], he.variables.interactiveColorBorderDisabled, he.variables.interactiveColorBackgroundDisabled);
|
|
1971
1969
|
}), (function(e) {
|
|
1972
1970
|
var n = e.$disabled, r = e.$hasFocus;
|
|
1973
|
-
return !n && !r && (0,
|
|
1971
|
+
return !n && !r && (0, pe.css)([ "&:hover{border-color:", ";}" ], he.variables.interactiveColorBorderHover);
|
|
1974
1972
|
}), (function(e) {
|
|
1975
1973
|
var n = e.$popoverOpen;
|
|
1976
|
-
return n && (0,
|
|
1974
|
+
return n && (0, pe.css)([ "position:relative;z-index:calc(", " - 2);" ], he.variables.zindexFixedNavbar);
|
|
1977
1975
|
}));
|
|
1978
|
-
var
|
|
1976
|
+
var Zn = ve().span.withConfig({
|
|
1979
1977
|
displayName: "NormalStyles__StyledButtonsWrapper",
|
|
1980
1978
|
componentId: "sc-1uwwpco-1"
|
|
1981
1979
|
})([ "display:contents;" ]);
|
|
1982
|
-
var
|
|
1980
|
+
var er = ve().input.withConfig({
|
|
1983
1981
|
displayName: "NormalStyles__StyledInput",
|
|
1984
1982
|
componentId: "sc-1uwwpco-2"
|
|
1985
|
-
})([ "", ";flex:1 0 auto;max-width:100%;" ],
|
|
1986
|
-
var
|
|
1983
|
+
})([ "", ";flex:1 0 auto;max-width:100%;" ], he.mixins.reset("block"));
|
|
1984
|
+
var nr = ve()(Qn()).withConfig({
|
|
1987
1985
|
displayName: "NormalStyles__StyledChip",
|
|
1988
1986
|
componentId: "sc-1uwwpco-3"
|
|
1989
1987
|
})([ "line-height:1.1429;height:auto;", ";&:not([disabled]):focus{box-shadow:", ";}" ], (0,
|
|
1990
|
-
|
|
1991
|
-
compact: (0,
|
|
1992
|
-
}),
|
|
1988
|
+
he.pick)({
|
|
1989
|
+
compact: (0, pe.css)([ "padding-block:2px;" ])
|
|
1990
|
+
}), he.variables.focusShadowInset);
|
|
1993
1991
|
// CONCATENATED MODULE: ./src/Multiselect/Normal.tsx
|
|
1994
|
-
function
|
|
1992
|
+
function rr(e) {
|
|
1995
1993
|
"@babel/helpers - typeof";
|
|
1996
|
-
return
|
|
1994
|
+
return rr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
1997
1995
|
return typeof e;
|
|
1998
1996
|
} : function(e) {
|
|
1999
1997
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2000
|
-
},
|
|
1998
|
+
}, rr(e);
|
|
2001
1999
|
}
|
|
2002
|
-
function
|
|
2003
|
-
return
|
|
2000
|
+
function tr() {
|
|
2001
|
+
return tr = Object.assign ? Object.assign.bind() : function(e) {
|
|
2004
2002
|
for (var n = 1; n < arguments.length; n++) {
|
|
2005
2003
|
var r = arguments[n];
|
|
2006
2004
|
for (var t in r) {
|
|
@@ -2008,41 +2006,41 @@
|
|
|
2008
2006
|
}
|
|
2009
2007
|
}
|
|
2010
2008
|
return e;
|
|
2011
|
-
},
|
|
2009
|
+
}, tr.apply(null, arguments);
|
|
2012
2010
|
}
|
|
2013
|
-
function
|
|
2014
|
-
return
|
|
2011
|
+
function or(e) {
|
|
2012
|
+
return ir(e) || ar(e) || sr(e) || lr();
|
|
2015
2013
|
}
|
|
2016
|
-
function
|
|
2014
|
+
function lr() {
|
|
2017
2015
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2018
2016
|
}
|
|
2019
|
-
function
|
|
2017
|
+
function ar(e) {
|
|
2020
2018
|
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
2021
2019
|
}
|
|
2022
|
-
function
|
|
2023
|
-
if (Array.isArray(e)) return
|
|
2020
|
+
function ir(e) {
|
|
2021
|
+
if (Array.isArray(e)) return dr(e);
|
|
2024
2022
|
}
|
|
2025
|
-
function
|
|
2026
|
-
return
|
|
2023
|
+
function ur(e, n) {
|
|
2024
|
+
return pr(e) || fr(e, n) || sr(e, n) || cr();
|
|
2027
2025
|
}
|
|
2028
|
-
function
|
|
2026
|
+
function cr() {
|
|
2029
2027
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2030
2028
|
}
|
|
2031
|
-
function
|
|
2029
|
+
function sr(e, n) {
|
|
2032
2030
|
if (e) {
|
|
2033
|
-
if ("string" == typeof e) return
|
|
2031
|
+
if ("string" == typeof e) return dr(e, n);
|
|
2034
2032
|
var r = {}.toString.call(e).slice(8, -1);
|
|
2035
|
-
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) ?
|
|
2033
|
+
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) ? dr(e, n) : void 0;
|
|
2036
2034
|
}
|
|
2037
2035
|
}
|
|
2038
|
-
function
|
|
2036
|
+
function dr(e, n) {
|
|
2039
2037
|
(null == n || n > e.length) && (n = e.length);
|
|
2040
2038
|
for (var r = 0, t = Array(n); r < n; r++) {
|
|
2041
2039
|
t[r] = e[r];
|
|
2042
2040
|
}
|
|
2043
2041
|
return t;
|
|
2044
2042
|
}
|
|
2045
|
-
function
|
|
2043
|
+
function fr(e, n) {
|
|
2046
2044
|
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
2047
2045
|
if (null != r) {
|
|
2048
2046
|
var t, o, l, a, i = [], u = !0, c = !1;
|
|
@@ -2064,12 +2062,12 @@
|
|
|
2064
2062
|
return i;
|
|
2065
2063
|
}
|
|
2066
2064
|
}
|
|
2067
|
-
function
|
|
2065
|
+
function pr(e) {
|
|
2068
2066
|
if (Array.isArray(e)) return e;
|
|
2069
2067
|
}
|
|
2070
|
-
function
|
|
2068
|
+
function vr(e, n) {
|
|
2071
2069
|
if (null == e) return {};
|
|
2072
|
-
var r, t, o =
|
|
2070
|
+
var r, t, o = br(e, n);
|
|
2073
2071
|
if (Object.getOwnPropertySymbols) {
|
|
2074
2072
|
var l = Object.getOwnPropertySymbols(e);
|
|
2075
2073
|
for (t = 0; t < l.length; t++) {
|
|
@@ -2078,7 +2076,7 @@
|
|
|
2078
2076
|
}
|
|
2079
2077
|
return o;
|
|
2080
2078
|
}
|
|
2081
|
-
function
|
|
2079
|
+
function br(e, n) {
|
|
2082
2080
|
if (null == e) return {};
|
|
2083
2081
|
var r = {};
|
|
2084
2082
|
for (var t in e) {
|
|
@@ -2089,7 +2087,7 @@
|
|
|
2089
2087
|
}
|
|
2090
2088
|
return r;
|
|
2091
2089
|
}
|
|
2092
|
-
function
|
|
2090
|
+
function mr(e, n) {
|
|
2093
2091
|
var r = Object.keys(e);
|
|
2094
2092
|
if (Object.getOwnPropertySymbols) {
|
|
2095
2093
|
var t = Object.getOwnPropertySymbols(e);
|
|
@@ -2102,37 +2100,37 @@
|
|
|
2102
2100
|
function gr(e) {
|
|
2103
2101
|
for (var n = 1; n < arguments.length; n++) {
|
|
2104
2102
|
var r = null != arguments[n] ? arguments[n] : {};
|
|
2105
|
-
n % 2 ?
|
|
2106
|
-
|
|
2107
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
2103
|
+
n % 2 ? mr(Object(r), !0).forEach((function(n) {
|
|
2104
|
+
yr(e, n, r[n]);
|
|
2105
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : mr(Object(r)).forEach((function(n) {
|
|
2108
2106
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
2109
2107
|
}));
|
|
2110
2108
|
}
|
|
2111
2109
|
return e;
|
|
2112
2110
|
}
|
|
2113
|
-
function
|
|
2114
|
-
return (n =
|
|
2111
|
+
function yr(e, n, r) {
|
|
2112
|
+
return (n = hr(n)) in e ? Object.defineProperty(e, n, {
|
|
2115
2113
|
value: r,
|
|
2116
2114
|
enumerable: !0,
|
|
2117
2115
|
configurable: !0,
|
|
2118
2116
|
writable: !0
|
|
2119
2117
|
}) : e[n] = r, e;
|
|
2120
2118
|
}
|
|
2121
|
-
function
|
|
2122
|
-
var n =
|
|
2123
|
-
return "symbol" ==
|
|
2119
|
+
function hr(e) {
|
|
2120
|
+
var n = Or(e, "string");
|
|
2121
|
+
return "symbol" == rr(n) ? n : n + "";
|
|
2124
2122
|
}
|
|
2125
|
-
function
|
|
2126
|
-
if ("object" !=
|
|
2123
|
+
function Or(e, n) {
|
|
2124
|
+
if ("object" != rr(e) || !e) return e;
|
|
2127
2125
|
var r = e[Symbol.toPrimitive];
|
|
2128
2126
|
if (void 0 !== r) {
|
|
2129
2127
|
var t = r.call(e, n || "default");
|
|
2130
|
-
if ("object" !=
|
|
2128
|
+
if ("object" != rr(t)) return t;
|
|
2131
2129
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2132
2130
|
}
|
|
2133
2131
|
return ("string" === n ? String : Number)(e);
|
|
2134
2132
|
}
|
|
2135
|
-
var
|
|
2133
|
+
var Sr = {
|
|
2136
2134
|
allowNewValues: l().bool,
|
|
2137
2135
|
animateLoading: l().bool,
|
|
2138
2136
|
children: l().node,
|
|
@@ -2166,14 +2164,14 @@
|
|
|
2166
2164
|
tabConfirmsNewValue: l().bool,
|
|
2167
2165
|
values: l().array
|
|
2168
2166
|
};
|
|
2169
|
-
var wr =
|
|
2167
|
+
var wr = q()((function(e) {
|
|
2170
2168
|
return {
|
|
2171
2169
|
flexBasis: e,
|
|
2172
2170
|
width: e
|
|
2173
2171
|
};
|
|
2174
2172
|
}));
|
|
2175
2173
|
// export for testing purpose
|
|
2176
|
-
var
|
|
2174
|
+
var Cr = q()((function(e) {
|
|
2177
2175
|
var n = e.anchorWidth, r = n === void 0 ? 0 : n, t = e.maxHeight, o = e.menuStyle;
|
|
2178
2176
|
return gr({
|
|
2179
2177
|
maxHeight: t,
|
|
@@ -2182,11 +2180,11 @@
|
|
|
2182
2180
|
}, o || {});
|
|
2183
2181
|
}));
|
|
2184
2182
|
// TS: not typed controlled/uncontrolled, handled by Multiselect wrapper component
|
|
2185
|
-
var
|
|
2186
|
-
var
|
|
2187
|
-
var
|
|
2188
|
-
function
|
|
2189
|
-
var t = r.allowNewValues, o = r.animateLoading, l = r.children, a = r.controlledFilter, u = r.defaultPlacement, c = u === void 0 ? "vertical" : u, f = r.defaultValues, p = r.describedBy, v = r.disabled, b = r.elementRef, m = r.error,
|
|
2183
|
+
var kr = {};
|
|
2184
|
+
var xr = (0, d._)("No matches");
|
|
2185
|
+
var jr = (0, d._)("Select...");
|
|
2186
|
+
function Pr(r) {
|
|
2187
|
+
var t = r.allowNewValues, o = r.animateLoading, l = r.children, a = r.controlledFilter, u = r.defaultPlacement, c = u === void 0 ? "vertical" : u, f = r.defaultValues, p = r.describedBy, v = r.disabled, b = r.elementRef, m = r.error, g = r.footerMessage, y = r.inline, h = r.inputId, O = r.inputRef, S = r.isLoadingOptions, w = r.labelledBy, C = r.loadingMessage, k = r.menuStyle, x = k === void 0 ? kr : k, j = r.name, P = r.noOptionsMessage, M = P === void 0 ? xr : P, R = r.onChange, A = r.onClose, I = r.onFilterChange, B = r.onScroll, T = r.onScrollBottom, L = r.onOpen, N = r.placeholder, V = N === void 0 ? jr : N, D = r.required, q = r.repositionMode, F = r.tabConfirmsNewValue, _ = r.values, H = vr(r, [ "allowNewValues", "animateLoading", "children", "controlledFilter", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onChange", "onClose", "onFilterChange", "onScroll", "onScrollBottom", "onOpen", "placeholder", "required", "repositionMode", "tabConfirmsNewValue", "values" ]);
|
|
2190
2188
|
// @docs-props-type NormalPropsBase
|
|
2191
2189
|
var K = s()({
|
|
2192
2190
|
componentName: "Multiselect",
|
|
@@ -2197,215 +2195,215 @@
|
|
|
2197
2195
|
valuePropName: "values"
|
|
2198
2196
|
});
|
|
2199
2197
|
if (false) {}
|
|
2200
|
-
var z = (0, e.useState)(0), W =
|
|
2201
|
-
var G = (0, e.useState)(null), J =
|
|
2202
|
-
var Z = (0, e.useState)(""), ee =
|
|
2203
|
-
var oe = (0, e.useState)(false), ae =
|
|
2204
|
-
var
|
|
2205
|
-
var
|
|
2206
|
-
var
|
|
2207
|
-
var
|
|
2208
|
-
var
|
|
2209
|
-
var
|
|
2198
|
+
var z = (0, e.useState)(0), W = ur(z, 2), U = W[0], X = W[1];
|
|
2199
|
+
var G = (0, e.useState)(null), J = ur(G, 2), Q = J[0], Y = J[1];
|
|
2200
|
+
var Z = (0, e.useState)(""), ee = ur(Z, 2), re = ee[0], te = ee[1];
|
|
2201
|
+
var oe = (0, e.useState)(false), ae = ur(oe, 2), ie = ae[0], se = ae[1];
|
|
2202
|
+
var de = (0, e.useState)(false), fe = ur(de, 2), pe = fe[0], ve = fe[1];
|
|
2203
|
+
var be = (0, e.useState)(f || []), me = ur(be, 2), ge = me[0], ye = me[1];
|
|
2204
|
+
var he = (0, e.useState)(""), Oe = ur(he, 2), Se = Oe[0], we = Oe[1];
|
|
2205
|
+
var Ce = K && _ ? _ : ge;
|
|
2206
|
+
var ke = Ce.slice(0);
|
|
2207
|
+
var xe = Ce.indexOf(re) >= 0;
|
|
2208
|
+
var je = (0, e.useRef)(null);
|
|
2210
2209
|
var Pe = (0, e.useRef)(null);
|
|
2211
|
-
var
|
|
2212
|
-
var
|
|
2213
|
-
var
|
|
2214
|
-
var Ae = (0, e.useState)((function() {
|
|
2210
|
+
var Me = (0, e.useRef)(undefined);
|
|
2211
|
+
var Ee = (0, e.useRef)(0);
|
|
2212
|
+
var Re = (0, e.useState)((function() {
|
|
2215
2213
|
return {
|
|
2216
2214
|
activeItemId: (0, ce.createDOMID)("active-item"),
|
|
2217
2215
|
popoverId: (0, ce.createDOMID)("popover")
|
|
2218
2216
|
};
|
|
2219
|
-
})),
|
|
2217
|
+
})), Ie = ur(Re, 1), Be = Ie[0], Te = Be.activeItemId, Le = Be.popoverId;
|
|
2220
2218
|
(0, e.useEffect)((function() {
|
|
2221
2219
|
if (K) {
|
|
2222
2220
|
te("");
|
|
2223
|
-
|
|
2221
|
+
X(0);
|
|
2224
2222
|
}
|
|
2225
2223
|
}), [ _, K ]);
|
|
2226
|
-
var
|
|
2224
|
+
var Ne = (0, e.useCallback)((function(e) {
|
|
2227
2225
|
var n = e.resetFilterKeyword;
|
|
2228
|
-
if (!
|
|
2226
|
+
if (!pe) {
|
|
2229
2227
|
te((function(e) {
|
|
2230
2228
|
return n ? "" : e;
|
|
2231
2229
|
}));
|
|
2232
|
-
|
|
2233
|
-
|
|
2230
|
+
se(true);
|
|
2231
|
+
ve(true);
|
|
2234
2232
|
L === null || L === void 0 ? void 0 : L();
|
|
2235
2233
|
}
|
|
2236
|
-
}), [
|
|
2237
|
-
var
|
|
2234
|
+
}), [ pe, L ]);
|
|
2235
|
+
var Ve = (0, e.useCallback)((function() {
|
|
2238
2236
|
if (ie) {
|
|
2239
|
-
|
|
2237
|
+
Ne({
|
|
2240
2238
|
resetFilterKeyword: false
|
|
2241
2239
|
});
|
|
2242
2240
|
} else {
|
|
2243
2241
|
var e;
|
|
2244
|
-
(e =
|
|
2242
|
+
(e = je.current) === null || e === void 0 ? void 0 : e.focus();
|
|
2245
2243
|
}
|
|
2246
|
-
}), [ ie,
|
|
2244
|
+
}), [ ie, Ne ]);
|
|
2247
2245
|
var De = (0, e.useCallback)((function(e, n) {
|
|
2248
|
-
if (!
|
|
2246
|
+
if (!pe) {
|
|
2249
2247
|
return;
|
|
2250
2248
|
}
|
|
2251
|
-
var r = (
|
|
2249
|
+
var r = (Ce || []).concat([ n ]);
|
|
2252
2250
|
if (!K) {
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2251
|
+
ye(r);
|
|
2252
|
+
X(0);
|
|
2253
|
+
ve(true);
|
|
2256
2254
|
te("");
|
|
2257
2255
|
}
|
|
2258
|
-
|
|
2256
|
+
R === null || R === void 0 ? void 0 : R(e, {
|
|
2259
2257
|
values: r,
|
|
2260
2258
|
name: j
|
|
2261
2259
|
});
|
|
2262
|
-
}), [
|
|
2263
|
-
var
|
|
2264
|
-
var r = $()(
|
|
2260
|
+
}), [ pe, Ce, K, R, j ]);
|
|
2261
|
+
var qe = (0, e.useCallback)((function(e, n) {
|
|
2262
|
+
var r = $()(Ce, n);
|
|
2265
2263
|
if (!K) {
|
|
2266
|
-
|
|
2264
|
+
ye(r);
|
|
2267
2265
|
}
|
|
2268
|
-
|
|
2266
|
+
R === null || R === void 0 ? void 0 : R(e, {
|
|
2269
2267
|
values: r,
|
|
2270
2268
|
name: j
|
|
2271
2269
|
});
|
|
2272
|
-
}), [
|
|
2273
|
-
var
|
|
2274
|
-
if (
|
|
2270
|
+
}), [ Ce, K, j, R ]);
|
|
2271
|
+
var _e = (0, e.useCallback)((function(e) {
|
|
2272
|
+
if (pe && !S) {
|
|
2275
2273
|
T === null || T === void 0 ? void 0 : T(e);
|
|
2276
|
-
we("".concat(
|
|
2274
|
+
we("".concat(Ee.current, " options, loading more options"));
|
|
2277
2275
|
}
|
|
2278
|
-
}), [
|
|
2279
|
-
var
|
|
2276
|
+
}), [ pe, S, T ]);
|
|
2277
|
+
var He = (0, e.useCallback)((function(e, n) {
|
|
2280
2278
|
var r = n.value;
|
|
2281
|
-
|
|
2282
|
-
return
|
|
2279
|
+
In()((function() {
|
|
2280
|
+
return qe(e, r);
|
|
2283
2281
|
}));
|
|
2284
|
-
}), [
|
|
2285
|
-
var
|
|
2282
|
+
}), [ qe ]);
|
|
2283
|
+
var Ke = (0, e.useCallback)((function(e) {
|
|
2286
2284
|
if (re !== "") {
|
|
2287
2285
|
I === null || I === void 0 ? void 0 : I(e, {
|
|
2288
2286
|
keyword: ""
|
|
2289
2287
|
});
|
|
2290
2288
|
}
|
|
2291
|
-
|
|
2289
|
+
Ne({
|
|
2292
2290
|
resetFilterKeyword: true
|
|
2293
2291
|
});
|
|
2294
|
-
}), [ re, I,
|
|
2295
|
-
var
|
|
2292
|
+
}), [ re, I, Ne ]);
|
|
2293
|
+
var ze = (0, e.useCallback)((function(n) {
|
|
2296
2294
|
var r;
|
|
2297
|
-
var t =
|
|
2298
|
-
if (t === "
|
|
2299
|
-
if (F &&
|
|
2295
|
+
var t = n.key;
|
|
2296
|
+
if (t === "Tab" && pe) {
|
|
2297
|
+
if (F && Me.current !== undefined && Ee.current <= 1) {
|
|
2300
2298
|
var o;
|
|
2301
2299
|
n.preventDefault();
|
|
2302
|
-
De(n,
|
|
2303
|
-
(o =
|
|
2300
|
+
De(n, Me.current);
|
|
2301
|
+
(o = je.current) === null || o === void 0 ? void 0 : o.focus();
|
|
2304
2302
|
} else {
|
|
2305
|
-
|
|
2303
|
+
ve(false);
|
|
2306
2304
|
}
|
|
2307
2305
|
}
|
|
2308
2306
|
if (n.shiftKey || n.metaKey || n.ctrlKey) {
|
|
2309
2307
|
return;
|
|
2310
2308
|
}
|
|
2311
|
-
if (t === "
|
|
2309
|
+
if (t === "End" && pe) {
|
|
2312
2310
|
n.preventDefault();
|
|
2313
|
-
|
|
2311
|
+
X(Ee.current - 1);
|
|
2314
2312
|
}
|
|
2315
|
-
if (t === "
|
|
2313
|
+
if (t === "Home" && pe) {
|
|
2316
2314
|
n.preventDefault();
|
|
2317
|
-
|
|
2315
|
+
X(0);
|
|
2318
2316
|
}
|
|
2319
|
-
if (t === "
|
|
2317
|
+
if (t === "ArrowDown") {
|
|
2320
2318
|
n.preventDefault();
|
|
2321
|
-
if (
|
|
2322
|
-
|
|
2323
|
-
return Math.min(e + 1,
|
|
2319
|
+
if (pe) {
|
|
2320
|
+
X((function(e) {
|
|
2321
|
+
return Math.min(e + 1, Ee.current - 1);
|
|
2324
2322
|
}));
|
|
2325
2323
|
} else {
|
|
2326
|
-
|
|
2327
|
-
|
|
2324
|
+
X(0);
|
|
2325
|
+
ve(true);
|
|
2328
2326
|
}
|
|
2329
2327
|
if (l && T) {
|
|
2330
|
-
var a = e.Children.toArray(l).length - (2 + ((
|
|
2331
|
-
if (
|
|
2332
|
-
|
|
2328
|
+
var a = e.Children.toArray(l).length - (2 + ((Ce === null || Ce === void 0 ? void 0 : Ce.length) || 0));
|
|
2329
|
+
if (U === a) {
|
|
2330
|
+
_e(n);
|
|
2333
2331
|
}
|
|
2334
2332
|
}
|
|
2335
2333
|
}
|
|
2336
|
-
if (t === "
|
|
2334
|
+
if (t === "ArrowUp") {
|
|
2337
2335
|
n.preventDefault();
|
|
2338
|
-
if (
|
|
2339
|
-
|
|
2336
|
+
if (pe) {
|
|
2337
|
+
X((function(e) {
|
|
2340
2338
|
return Math.max(e - 1, 0);
|
|
2341
2339
|
}));
|
|
2342
2340
|
} else {
|
|
2343
|
-
|
|
2344
|
-
|
|
2341
|
+
X(0);
|
|
2342
|
+
ve(true);
|
|
2345
2343
|
}
|
|
2346
2344
|
}
|
|
2347
|
-
if (t === "
|
|
2348
|
-
De(n,
|
|
2345
|
+
if (t === "Enter" && Me.current !== undefined && pe) {
|
|
2346
|
+
De(n, Me.current);
|
|
2349
2347
|
}
|
|
2350
|
-
if (t === "
|
|
2351
|
-
|
|
2348
|
+
if (t === "Backspace" && ((r = je.current) === null || r === void 0 ? void 0 : r.value) === "" && Ce.length) {
|
|
2349
|
+
qe(n, Fn()(Ce));
|
|
2352
2350
|
}
|
|
2353
|
-
}), [
|
|
2354
|
-
var
|
|
2351
|
+
}), [ pe, Ce, F, De, l, T, U, _e, qe ]);
|
|
2352
|
+
var $e = (0, e.useCallback)((function(e) {
|
|
2355
2353
|
te(e.target.value);
|
|
2356
|
-
|
|
2357
|
-
|
|
2354
|
+
ve(true);
|
|
2355
|
+
X(0);
|
|
2358
2356
|
I === null || I === void 0 ? void 0 : I(e, {
|
|
2359
2357
|
keyword: e.target.value
|
|
2360
2358
|
});
|
|
2361
2359
|
}), [ I ]);
|
|
2362
|
-
var
|
|
2360
|
+
var We = (0, e.useCallback)((function(e, n) {
|
|
2363
2361
|
var r;
|
|
2364
2362
|
var t = n.value;
|
|
2365
2363
|
e.stopPropagation();
|
|
2366
2364
|
De(e, t);
|
|
2367
|
-
(r =
|
|
2365
|
+
(r = je.current) === null || r === void 0 ? void 0 : r.focus();
|
|
2368
2366
|
}), [ De ]);
|
|
2369
2367
|
var Ue = (0, e.useCallback)((function(e) {
|
|
2370
|
-
var n = document.getElementById(
|
|
2368
|
+
var n = document.getElementById(Le);
|
|
2371
2369
|
var r = e.relatedTarget || document.activeElement;
|
|
2372
2370
|
// IE11 doesn't support relatedTarget but sets activeElement
|
|
2373
2371
|
var t = n && r && n.contains(r);
|
|
2374
2372
|
// TS: target as Node is an unsafe assumption
|
|
2375
2373
|
te(t ? re : "");
|
|
2376
|
-
|
|
2374
|
+
se(false);
|
|
2377
2375
|
if (!t) {
|
|
2378
2376
|
I === null || I === void 0 ? void 0 : I(e, {
|
|
2379
2377
|
keyword: ""
|
|
2380
2378
|
});
|
|
2381
2379
|
}
|
|
2382
|
-
}), [ re, I,
|
|
2383
|
-
var
|
|
2380
|
+
}), [ re, I, Le ]);
|
|
2381
|
+
var Xe = (0, e.useCallback)((function(e) {
|
|
2384
2382
|
var n = e.reason, r = e.event;
|
|
2385
2383
|
if (n === "escapeKey" || n === "offScreen" || n === "clickAway" && r !== undefined && !(Q === null || Q === void 0 ? void 0 : Q.contains(r.target))) {
|
|
2386
|
-
|
|
2387
|
-
|
|
2384
|
+
ve(false);
|
|
2385
|
+
Pe.current = null;
|
|
2388
2386
|
A === null || A === void 0 ? void 0 : A();
|
|
2389
2387
|
}
|
|
2390
2388
|
if (n === "escapeKey") {
|
|
2391
2389
|
var t;
|
|
2392
|
-
(t =
|
|
2390
|
+
(t = je.current) === null || t === void 0 ? void 0 : t.focus();
|
|
2393
2391
|
}
|
|
2394
2392
|
}), [ Q, A ]);
|
|
2395
|
-
var
|
|
2393
|
+
var Ge = (0, e.useCallback)((function(e) {
|
|
2396
2394
|
Y(e);
|
|
2397
|
-
|
|
2395
|
+
Fe(b, e);
|
|
2398
2396
|
}), [ b ]);
|
|
2399
|
-
var
|
|
2400
|
-
|
|
2401
|
-
|
|
2397
|
+
var Je = (0, e.useCallback)((function(e) {
|
|
2398
|
+
je.current = e;
|
|
2399
|
+
Fe(O, e);
|
|
2402
2400
|
}), [ O ]);
|
|
2403
|
-
var
|
|
2404
|
-
if (
|
|
2405
|
-
|
|
2401
|
+
var Qe = (0, e.useCallback)((function(e) {
|
|
2402
|
+
if (Pe.current !== U) {
|
|
2403
|
+
Ae(e);
|
|
2406
2404
|
}
|
|
2407
|
-
}), [
|
|
2408
|
-
var
|
|
2405
|
+
}), [ U ]);
|
|
2406
|
+
var Ye = (0, e.useCallback)((function(e) {
|
|
2409
2407
|
// selectedOptions may contain items or unmatched values at this point
|
|
2410
2408
|
return e.map((function(e) {
|
|
2411
2409
|
var r = e;
|
|
@@ -2414,13 +2412,13 @@
|
|
|
2414
2412
|
if (t != null) {
|
|
2415
2413
|
var o = t.children, l = t.icon, a = t.label, i = t.selectedAppearance, u = t.selectedBackgroundColor, c = t.selectedForegroundColor, s = t.value;
|
|
2416
2414
|
|
|
2417
|
-
return n().createElement(
|
|
2415
|
+
return n().createElement(nr, {
|
|
2418
2416
|
"aria-selected": true,
|
|
2419
2417
|
disabled: v,
|
|
2420
2418
|
icon: l,
|
|
2421
2419
|
key: s.toString(),
|
|
2422
2420
|
"data-test": "selected-option",
|
|
2423
|
-
onRequestRemove:
|
|
2421
|
+
onRequestRemove: He,
|
|
2424
2422
|
role: "option",
|
|
2425
2423
|
value: s,
|
|
2426
2424
|
appearance: i,
|
|
@@ -2429,18 +2427,18 @@
|
|
|
2429
2427
|
}, o || a);
|
|
2430
2428
|
}
|
|
2431
2429
|
|
|
2432
|
-
return n().createElement(
|
|
2430
|
+
return n().createElement(nr, {
|
|
2433
2431
|
"aria-selected": true,
|
|
2434
2432
|
disabled: v,
|
|
2435
2433
|
key: (0, ce.createGUID)(),
|
|
2436
2434
|
"data-test": "selected-option",
|
|
2437
|
-
onRequestRemove:
|
|
2435
|
+
onRequestRemove: He,
|
|
2438
2436
|
role: "option",
|
|
2439
2437
|
value: r
|
|
2440
2438
|
}, r);
|
|
2441
2439
|
}));
|
|
2442
|
-
}), [ v,
|
|
2443
|
-
var
|
|
2440
|
+
}), [ v, He ]);
|
|
2441
|
+
var Ze = function e(r) {
|
|
2444
2442
|
return r.map((function(e) {
|
|
2445
2443
|
var r = e;
|
|
2446
2444
|
// TS: faking props here
|
|
@@ -2458,30 +2456,30 @@
|
|
|
2458
2456
|
}));
|
|
2459
2457
|
};
|
|
2460
2458
|
// Map Options to selected values
|
|
2461
|
-
if (
|
|
2459
|
+
if (Ce && Ce.length) {
|
|
2462
2460
|
e.Children.toArray(l).filter(e.isValidElement).filter((function(e) {
|
|
2463
|
-
return e.type ===
|
|
2461
|
+
return e.type === E;
|
|
2464
2462
|
})).forEach((function(e) {
|
|
2465
|
-
if (e.type ===
|
|
2466
|
-
var n =
|
|
2463
|
+
if (e.type === E) {
|
|
2464
|
+
var n = Ce.indexOf(e.props.value);
|
|
2467
2465
|
if (n !== -1) {
|
|
2468
|
-
|
|
2466
|
+
ke[n] = e;
|
|
2469
2467
|
}
|
|
2470
2468
|
}
|
|
2471
2469
|
}));
|
|
2472
2470
|
}
|
|
2473
2471
|
// Filter the items
|
|
2474
|
-
var
|
|
2475
|
-
var
|
|
2476
|
-
if (
|
|
2477
|
-
return (0, ue.testPhrase)(e.props.label,
|
|
2472
|
+
var en = (0, ue.stringToKeywords)(re);
|
|
2473
|
+
var nn = a ? e.Children.toArray(l) : e.Children.toArray(l).filter((function(e) {
|
|
2474
|
+
if (Tn()(e, [ "props", "label" ], false)) {
|
|
2475
|
+
return (0, ue.testPhrase)(e.props.label, en);
|
|
2478
2476
|
}
|
|
2479
2477
|
return true;
|
|
2480
2478
|
// Keep all headers and non-interactive options
|
|
2481
2479
|
}));
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
var
|
|
2480
|
+
Ee.current = 0;
|
|
2481
|
+
Me.current = undefined;
|
|
2482
|
+
var rn = e.Children.map(nn, (function(n, r) {
|
|
2485
2483
|
var t = n.props;
|
|
2486
2484
|
if (!t || !i()(t, "value")) {
|
|
2487
2485
|
// ignore Headings and Dividers
|
|
@@ -2491,21 +2489,21 @@
|
|
|
2491
2489
|
var l = o.props, u = l.children, c = l.label, s = l.matchRanges, d = l.value;
|
|
2492
2490
|
// find out if the search string exactly matches a value
|
|
2493
2491
|
if (d === re) {
|
|
2494
|
-
|
|
2492
|
+
xe = true;
|
|
2495
2493
|
}
|
|
2496
2494
|
// remove items that are already selected
|
|
2497
|
-
var f =
|
|
2495
|
+
var f = Ce.indexOf(d);
|
|
2498
2496
|
if (f >= 0) {
|
|
2499
2497
|
return null;
|
|
2500
2498
|
}
|
|
2501
2499
|
// highlight matched text
|
|
2502
|
-
var p = u === undefined ||
|
|
2503
|
-
var v = p && !a && !s &&
|
|
2500
|
+
var p = u === undefined || Nn()(u);
|
|
2501
|
+
var v = p && !a && !s && en && (0, ue.keywordLocations)(c, en);
|
|
2504
2502
|
// clone item
|
|
2505
2503
|
var b = (0, e.cloneElement)(o, {
|
|
2506
2504
|
// eslint-disable-next-line react/no-array-index-key
|
|
2507
2505
|
key: r,
|
|
2508
|
-
onClick:
|
|
2506
|
+
onClick: We,
|
|
2509
2507
|
matchRanges: p && (s || v) || undefined
|
|
2510
2508
|
});
|
|
2511
2509
|
return b;
|
|
@@ -2513,18 +2511,18 @@
|
|
|
2513
2511
|
return e !== null;
|
|
2514
2512
|
})) || [];
|
|
2515
2513
|
// Add the option to add the new value
|
|
2516
|
-
if (t && !
|
|
2517
|
-
|
|
2514
|
+
if (t && !xe && re) {
|
|
2515
|
+
rn.unshift( n().createElement(E, {
|
|
2518
2516
|
label: "".concat(re),
|
|
2519
2517
|
description: (0, d._)("(New value)"),
|
|
2520
2518
|
descriptionPosition: "right",
|
|
2521
2519
|
value: re,
|
|
2522
2520
|
key: "newValue",
|
|
2523
|
-
onClick:
|
|
2521
|
+
onClick: We
|
|
2524
2522
|
}));
|
|
2525
2523
|
}
|
|
2526
2524
|
// highlight the selected Item
|
|
2527
|
-
var
|
|
2525
|
+
var tn = e.Children.map(rn, (function(n) {
|
|
2528
2526
|
var r = n.props;
|
|
2529
2527
|
if (!r || !i()(r, "value")) {
|
|
2530
2528
|
// ignore Headings and Dividers
|
|
@@ -2532,27 +2530,27 @@
|
|
|
2532
2530
|
}
|
|
2533
2531
|
var t = n;
|
|
2534
2532
|
var o = t.props, l = o.disabled, a = o.value;
|
|
2535
|
-
var u =
|
|
2536
|
-
|
|
2533
|
+
var u = Ee.current === U;
|
|
2534
|
+
Ee.current += 1;
|
|
2537
2535
|
if (!u) {
|
|
2538
2536
|
return t;
|
|
2539
2537
|
}
|
|
2540
2538
|
if (!l) {
|
|
2541
|
-
|
|
2539
|
+
Me.current = a;
|
|
2542
2540
|
}
|
|
2543
2541
|
var c = (0, e.cloneElement)(t, {
|
|
2544
2542
|
active: u,
|
|
2545
|
-
id:
|
|
2543
|
+
id: Te,
|
|
2546
2544
|
elementRef: function e(n) {
|
|
2547
|
-
|
|
2548
|
-
|
|
2545
|
+
Qe(n);
|
|
2546
|
+
Fe(t.props.elementRef, n);
|
|
2549
2547
|
}
|
|
2550
2548
|
});
|
|
2551
2549
|
return c;
|
|
2552
2550
|
}));
|
|
2553
|
-
var
|
|
2551
|
+
var on = function e(r) {
|
|
2554
2552
|
var t = r.anchorWidth, l = r.maxHeight, a = r.placement;
|
|
2555
|
-
var i =
|
|
2553
|
+
var i = Cr({
|
|
2556
2554
|
anchorWidth: t,
|
|
2557
2555
|
maxHeight: l,
|
|
2558
2556
|
menuStyle: x
|
|
@@ -2562,104 +2560,104 @@
|
|
|
2562
2560
|
focusMode: "never",
|
|
2563
2561
|
placement: a !== null && a !== void 0 ? a : undefined,
|
|
2564
2562
|
isLoading: S,
|
|
2565
|
-
onScrollBottom: T ?
|
|
2566
|
-
noOptionsMessage:
|
|
2567
|
-
footerMessage:
|
|
2563
|
+
onScrollBottom: T ? _e : undefined,
|
|
2564
|
+
noOptionsMessage: M,
|
|
2565
|
+
footerMessage: g,
|
|
2568
2566
|
animateLoading: o,
|
|
2569
|
-
loadingMessage:
|
|
2567
|
+
loadingMessage: C,
|
|
2570
2568
|
onScroll: B,
|
|
2571
2569
|
style: i
|
|
2572
|
-
},
|
|
2570
|
+
}, tn);
|
|
2573
2571
|
};
|
|
2574
|
-
var
|
|
2575
|
-
var
|
|
2572
|
+
var ln = wr("".concat(re.length * .8, "em"));
|
|
2573
|
+
var an = gr(gr({}, zn()(H, (function(e, n) {
|
|
2576
2574
|
return n === "role" || n.indexOf("aria-") === 0;
|
|
2577
2575
|
}))), {}, {
|
|
2578
2576
|
"aria-describedby": p,
|
|
2579
|
-
"aria-labelledby":
|
|
2577
|
+
"aria-labelledby": w,
|
|
2580
2578
|
"aria-invalid": m || undefined
|
|
2581
2579
|
});
|
|
2582
|
-
var
|
|
2580
|
+
var un = gr({}, zn()(H, (function(e, n) {
|
|
2583
2581
|
return n === "aria-label" || n === "aria-describedby";
|
|
2584
2582
|
})));
|
|
2585
2583
|
|
|
2586
|
-
return n().createElement(n().Fragment, null, n().createElement(
|
|
2584
|
+
return n().createElement(n().Fragment, null, n().createElement(Yn, tr({
|
|
2587
2585
|
key: "control",
|
|
2588
|
-
"data-test-values": JSON.stringify(
|
|
2586
|
+
"data-test-values": JSON.stringify(Ce),
|
|
2589
2587
|
"data-test-disabled": v ? "disabled" : undefined,
|
|
2590
|
-
inline:
|
|
2588
|
+
inline: y,
|
|
2591
2589
|
$hasFocus: ie
|
|
2592
|
-
},
|
|
2593
|
-
onClick: v ? undefined :
|
|
2590
|
+
}, Hn().apply(void 0, [ H ].concat(or(Dn()(an)))), {
|
|
2591
|
+
onClick: v ? undefined : Ve,
|
|
2594
2592
|
$disabled: v,
|
|
2595
2593
|
$error: m,
|
|
2596
|
-
"data-test-popover-id":
|
|
2597
|
-
$popoverOpen:
|
|
2594
|
+
"data-test-popover-id": Le,
|
|
2595
|
+
$popoverOpen: pe,
|
|
2598
2596
|
flex: true,
|
|
2599
|
-
elementRef:
|
|
2597
|
+
elementRef: Ge,
|
|
2600
2598
|
role: "group",
|
|
2601
2599
|
"aria-disabled": v || undefined,
|
|
2602
|
-
"aria-labelledby":
|
|
2603
|
-
},
|
|
2600
|
+
"aria-labelledby": w
|
|
2601
|
+
}, un), n().createElement(Zn, {
|
|
2604
2602
|
role: "listbox",
|
|
2605
2603
|
"aria-invalid": m,
|
|
2606
2604
|
"aria-multiselectable": "true"
|
|
2607
|
-
},
|
|
2605
|
+
}, Ye(ke)), !v && n().createElement(er, tr({
|
|
2608
2606
|
role: "combobox",
|
|
2609
2607
|
"data-test": "textbox",
|
|
2610
2608
|
id: h,
|
|
2611
|
-
ref:
|
|
2609
|
+
ref: Je,
|
|
2612
2610
|
onBlur: Ue,
|
|
2613
|
-
onFocus:
|
|
2614
|
-
onChange:
|
|
2615
|
-
onKeyDown:
|
|
2611
|
+
onFocus: Ke,
|
|
2612
|
+
onChange: $e,
|
|
2613
|
+
onKeyDown: ze,
|
|
2616
2614
|
value: re,
|
|
2617
2615
|
autoCapitalize: "off",
|
|
2618
2616
|
autoComplete: "off",
|
|
2619
2617
|
autoCorrect: "off",
|
|
2620
2618
|
spellCheck: false,
|
|
2621
|
-
style:
|
|
2622
|
-
placeholder:
|
|
2623
|
-
required:
|
|
2624
|
-
"aria-activedescendant":
|
|
2619
|
+
style: ln,
|
|
2620
|
+
placeholder: Ce.length ? "" : V,
|
|
2621
|
+
required: D,
|
|
2622
|
+
"aria-activedescendant": pe && Ee.current > 0 ? Te : undefined,
|
|
2625
2623
|
"aria-autocomplete": "list",
|
|
2626
|
-
"aria-controls":
|
|
2627
|
-
"aria-owns":
|
|
2628
|
-
"aria-expanded":
|
|
2624
|
+
"aria-controls": pe ? Le : undefined,
|
|
2625
|
+
"aria-owns": pe ? Le : undefined,
|
|
2626
|
+
"aria-expanded": pe,
|
|
2629
2627
|
"aria-haspopup": true
|
|
2630
|
-
},
|
|
2631
|
-
open:
|
|
2628
|
+
}, an)), n().createElement(Wn(), {
|
|
2629
|
+
open: pe && !!Q,
|
|
2632
2630
|
autoCloseWhenOffScreen: true,
|
|
2633
2631
|
anchor: Q,
|
|
2634
|
-
onRequestClose:
|
|
2632
|
+
onRequestClose: Xe,
|
|
2635
2633
|
canCoverAnchor: false,
|
|
2636
2634
|
defaultPlacement: c,
|
|
2637
|
-
repositionMode:
|
|
2638
|
-
id:
|
|
2639
|
-
},
|
|
2635
|
+
repositionMode: q,
|
|
2636
|
+
id: Le
|
|
2637
|
+
}, on)), n().createElement(le(), {
|
|
2640
2638
|
role: "status",
|
|
2641
2639
|
"aria-relevant": "text"
|
|
2642
|
-
},
|
|
2640
|
+
}, Se), n().createElement(le(), {
|
|
2643
2641
|
role: "alert",
|
|
2644
2642
|
"aria-relevant": "additions"
|
|
2645
|
-
},
|
|
2643
|
+
}, Ze(ke)));
|
|
2646
2644
|
}
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
/* harmony default export */ const
|
|
2645
|
+
Pr.propTypes = Sr;
|
|
2646
|
+
Pr.Option = E;
|
|
2647
|
+
Pr.Divider = u.Divider;
|
|
2648
|
+
Pr.Heading = u.Heading;
|
|
2649
|
+
/* harmony default export */ const Mr = Pr;
|
|
2652
2650
|
// CONCATENATED MODULE: ./src/Multiselect/Multiselect.tsx
|
|
2653
|
-
function
|
|
2651
|
+
function Er(e) {
|
|
2654
2652
|
"@babel/helpers - typeof";
|
|
2655
|
-
return
|
|
2653
|
+
return Er = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
2656
2654
|
return typeof e;
|
|
2657
2655
|
} : function(e) {
|
|
2658
2656
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2659
|
-
},
|
|
2657
|
+
}, Er(e);
|
|
2660
2658
|
}
|
|
2661
|
-
function
|
|
2662
|
-
return
|
|
2659
|
+
function Rr() {
|
|
2660
|
+
return Rr = Object.assign ? Object.assign.bind() : function(e) {
|
|
2663
2661
|
for (var n = 1; n < arguments.length; n++) {
|
|
2664
2662
|
var r = arguments[n];
|
|
2665
2663
|
for (var t in r) {
|
|
@@ -2667,9 +2665,9 @@
|
|
|
2667
2665
|
}
|
|
2668
2666
|
}
|
|
2669
2667
|
return e;
|
|
2670
|
-
},
|
|
2668
|
+
}, Rr.apply(null, arguments);
|
|
2671
2669
|
}
|
|
2672
|
-
function
|
|
2670
|
+
function Ar(e, n) {
|
|
2673
2671
|
var r = Object.keys(e);
|
|
2674
2672
|
if (Object.getOwnPropertySymbols) {
|
|
2675
2673
|
var t = Object.getOwnPropertySymbols(e);
|
|
@@ -2679,42 +2677,42 @@
|
|
|
2679
2677
|
}
|
|
2680
2678
|
return r;
|
|
2681
2679
|
}
|
|
2682
|
-
function
|
|
2680
|
+
function Ir(e) {
|
|
2683
2681
|
for (var n = 1; n < arguments.length; n++) {
|
|
2684
2682
|
var r = null != arguments[n] ? arguments[n] : {};
|
|
2685
|
-
n % 2 ?
|
|
2686
|
-
|
|
2687
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
2683
|
+
n % 2 ? Ar(Object(r), !0).forEach((function(n) {
|
|
2684
|
+
Br(e, n, r[n]);
|
|
2685
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ar(Object(r)).forEach((function(n) {
|
|
2688
2686
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
2689
2687
|
}));
|
|
2690
2688
|
}
|
|
2691
2689
|
return e;
|
|
2692
2690
|
}
|
|
2693
|
-
function
|
|
2694
|
-
return (n =
|
|
2691
|
+
function Br(e, n, r) {
|
|
2692
|
+
return (n = Tr(n)) in e ? Object.defineProperty(e, n, {
|
|
2695
2693
|
value: r,
|
|
2696
2694
|
enumerable: !0,
|
|
2697
2695
|
configurable: !0,
|
|
2698
2696
|
writable: !0
|
|
2699
2697
|
}) : e[n] = r, e;
|
|
2700
2698
|
}
|
|
2701
|
-
function
|
|
2702
|
-
var n =
|
|
2703
|
-
return "symbol" ==
|
|
2699
|
+
function Tr(e) {
|
|
2700
|
+
var n = Lr(e, "string");
|
|
2701
|
+
return "symbol" == Er(n) ? n : n + "";
|
|
2704
2702
|
}
|
|
2705
|
-
function
|
|
2706
|
-
if ("object" !=
|
|
2703
|
+
function Lr(e, n) {
|
|
2704
|
+
if ("object" != Er(e) || !e) return e;
|
|
2707
2705
|
var r = e[Symbol.toPrimitive];
|
|
2708
2706
|
if (void 0 !== r) {
|
|
2709
2707
|
var t = r.call(e, n || "default");
|
|
2710
|
-
if ("object" !=
|
|
2708
|
+
if ("object" != Er(t)) return t;
|
|
2711
2709
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2712
2710
|
}
|
|
2713
2711
|
return ("string" === n ? String : Number)(e);
|
|
2714
2712
|
}
|
|
2715
|
-
function
|
|
2713
|
+
function Nr(e, n) {
|
|
2716
2714
|
if (null == e) return {};
|
|
2717
|
-
var r, t, o =
|
|
2715
|
+
var r, t, o = Vr(e, n);
|
|
2718
2716
|
if (Object.getOwnPropertySymbols) {
|
|
2719
2717
|
var l = Object.getOwnPropertySymbols(e);
|
|
2720
2718
|
for (t = 0; t < l.length; t++) {
|
|
@@ -2723,7 +2721,7 @@
|
|
|
2723
2721
|
}
|
|
2724
2722
|
return o;
|
|
2725
2723
|
}
|
|
2726
|
-
function
|
|
2724
|
+
function Vr(e, n) {
|
|
2727
2725
|
if (null == e) return {};
|
|
2728
2726
|
var r = {};
|
|
2729
2727
|
for (var t in e) {
|
|
@@ -2774,10 +2772,10 @@
|
|
|
2774
2772
|
/** @private */
|
|
2775
2773
|
virtualization: l().number
|
|
2776
2774
|
};
|
|
2777
|
-
var
|
|
2778
|
-
var
|
|
2779
|
-
function
|
|
2780
|
-
var t = r.allowNewValues, o = r.animateLoading, l = r.compact, a = r.children, i = r.controlledFilter, u = r.defaultPlacement, c = u === void 0 ? "vertical" : u, d = r.defaultValues, f = r.describedBy, p = r.disabled, v = r.elementRef, b = r.error, m = r.filter,
|
|
2775
|
+
var qr = (0, d._)("No matches");
|
|
2776
|
+
var Fr = (0, d._)("Select...");
|
|
2777
|
+
function _r(r) {
|
|
2778
|
+
var t = r.allowNewValues, o = r.animateLoading, l = r.compact, a = r.children, i = r.controlledFilter, u = r.defaultPlacement, c = u === void 0 ? "vertical" : u, d = r.defaultValues, f = r.describedBy, p = r.disabled, v = r.elementRef, b = r.error, m = r.filter, g = r.footerMessage, y = r.inline, h = r.inputId, O = r.inputRef, S = r.isLoadingOptions, w = r.labelledBy, C = r.loadingMessage, k = r.menuStyle, x = r.name, j = r.noOptionsMessage, P = j === void 0 ? qr : j, M = r.onChange, E = r.onClose, R = r.onFilterChange, A = r.onOpen, I = r.onScroll, B = r.onScrollBottom, T = r.placeholder, L = T === void 0 ? Fr : T, N = r.repositionMode, V = N === void 0 ? "flip" : N, D = r.selectAllAppearance, q = r.showSelectedValuesFirst, F = r.tabConfirmsNewValue, _ = r.values, H = r.virtualization, K = Nr(r, [ "allowNewValues", "animateLoading", "compact", "children", "controlledFilter", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onChange", "onClose", "onFilterChange", "onOpen", "onScroll", "onScrollBottom", "placeholder", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "tabConfirmsNewValue", "values", "virtualization" ]);
|
|
2781
2779
|
// @docs-props-type MultiselectPropsBase
|
|
2782
2780
|
var z = s()({
|
|
2783
2781
|
componentName: "Multiselect",
|
|
@@ -2795,8 +2793,8 @@
|
|
|
2795
2793
|
}
|
|
2796
2794
|
}), [ l, $ ]);
|
|
2797
2795
|
// Compact uses Button, which defaults `inline` to true, explicitly pass a boolean to prevent the underlying Button from applying its default.
|
|
2798
|
-
var W = !!
|
|
2799
|
-
var
|
|
2796
|
+
var W = !!y;
|
|
2797
|
+
var U = Ir({
|
|
2800
2798
|
allowNewValues: t,
|
|
2801
2799
|
animateLoading: o,
|
|
2802
2800
|
children: a,
|
|
@@ -2806,57 +2804,66 @@
|
|
|
2806
2804
|
disabled: p,
|
|
2807
2805
|
elementRef: v,
|
|
2808
2806
|
error: b,
|
|
2809
|
-
footerMessage:
|
|
2807
|
+
footerMessage: g,
|
|
2810
2808
|
inline: W,
|
|
2811
2809
|
inputId: h,
|
|
2812
2810
|
inputRef: O,
|
|
2813
2811
|
isLoadingOptions: S,
|
|
2814
|
-
labelledBy:
|
|
2815
|
-
loadingMessage:
|
|
2812
|
+
labelledBy: w,
|
|
2813
|
+
loadingMessage: C,
|
|
2816
2814
|
menuStyle: k,
|
|
2817
2815
|
name: x,
|
|
2818
2816
|
noOptionsMessage: P,
|
|
2819
|
-
onClose:
|
|
2820
|
-
onChange:
|
|
2821
|
-
onFilterChange:
|
|
2817
|
+
onClose: E,
|
|
2818
|
+
onChange: M,
|
|
2819
|
+
onFilterChange: R,
|
|
2822
2820
|
onOpen: A,
|
|
2823
2821
|
onScroll: I,
|
|
2824
2822
|
onScrollBottom: B,
|
|
2825
2823
|
placeholder: L,
|
|
2826
2824
|
repositionMode: V,
|
|
2827
|
-
showSelectedValuesFirst:
|
|
2825
|
+
showSelectedValuesFirst: q,
|
|
2828
2826
|
tabConfirmsNewValue: F,
|
|
2829
2827
|
virtualization: H
|
|
2830
2828
|
}, K);
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2829
|
+
// Memoized what ends up setting defaultValues otherwise useControlled in SelectBase (in Compact/Normal components) can trigger "default props changed after render" warning even though nothing changed on subsequent renders
|
|
2830
|
+
var X = (0, e.useMemo)((function() {
|
|
2831
|
+
return {
|
|
2832
|
+
defaultValues: d
|
|
2833
|
+
};
|
|
2834
|
+
}), [ d ]);
|
|
2835
|
+
var G = (0, e.useMemo)((function() {
|
|
2836
|
+
return {
|
|
2837
|
+
values: _
|
|
2838
|
+
};
|
|
2839
|
+
}), [ _ ]);
|
|
2840
|
+
var J = (0, e.useMemo)((function() {
|
|
2841
|
+
return z ? G : X;
|
|
2842
|
+
}), [ X, z, G ]);
|
|
2843
|
+
var Q = {
|
|
2837
2844
|
filter: m,
|
|
2838
|
-
selectAllAppearance:
|
|
2839
|
-
showSelectedValuesFirst:
|
|
2845
|
+
selectAllAppearance: D,
|
|
2846
|
+
showSelectedValuesFirst: q,
|
|
2840
2847
|
virtualization: H
|
|
2841
2848
|
};
|
|
2842
2849
|
if (l) {
|
|
2843
2850
|
|
|
2844
|
-
return n().createElement(
|
|
2851
|
+
return n().createElement(Rn, Rr({
|
|
2845
2852
|
"data-test": "multiselect"
|
|
2846
|
-
},
|
|
2853
|
+
}, J, Q, U));
|
|
2847
2854
|
}
|
|
2848
2855
|
|
|
2849
|
-
return n().createElement(
|
|
2856
|
+
return n().createElement(Mr, Rr({
|
|
2850
2857
|
"data-test": "multiselect"
|
|
2851
|
-
},
|
|
2858
|
+
}, J, U));
|
|
2852
2859
|
}
|
|
2853
2860
|
// TODO: SUI-3402, this can be removed when ControlGroup no longer needs to inspect componentType
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
/* harmony default export */ const
|
|
2861
|
+
_r.componentType = "Multiselect";
|
|
2862
|
+
_r.Option = E;
|
|
2863
|
+
_r.Heading = u.Heading;
|
|
2864
|
+
_r.Divider = u.Divider;
|
|
2865
|
+
_r.propTypes = Dr;
|
|
2866
|
+
/* harmony default export */ const Hr = _r;
|
|
2860
2867
|
}) // CONCATENATED MODULE: ./src/Multiselect/index.ts
|
|
2861
2868
|
();
|
|
2862
2869
|
module.exports = t;
|