@splunk/react-ui 4.37.0 → 4.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Button.js +139 -132
- package/CHANGELOG.md +22 -1
- package/Color.js +1145 -977
- package/ComboBox.js +1 -2
- package/Menu.js +161 -153
- package/Multiselect.js +17 -27
- package/ScreenReaderContent.js +138 -94
- package/Search.js +45 -42
- package/Select.js +89 -99
- package/Slider.js +128 -145
- package/Switch.js +122 -118
- package/Text.js +202 -199
- package/package.json +4 -4
- package/types/src/Button/Button.d.ts +15 -5
- package/types/src/Color/Color.d.ts +3 -0
- package/types/src/Color/Palette.d.ts +4 -2
- package/types/src/Date/Date.d.ts +0 -1
- package/types/src/Link/Link.d.ts +3 -4
- package/types/src/Menu/Item.d.ts +6 -3
- package/types/src/Search/Option.d.ts +7 -0
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/Select/SelectBase.d.ts +0 -1
- package/types/src/Slider/Slider.d.ts +0 -1
- package/types/src/Slider/docs/examples/Error.d.ts +2 -0
- package/types/src/Switch/Switch.d.ts +1 -0
- package/types/src/Text/Text.d.ts +6 -4
- package/types/src/Text/docs/examples/Dimmed.d.ts +2 -0
- package/types/src/TextArea/TextArea.d.ts +2 -2
- package/types/src/Button/docs/examples/Selected.d.ts +0 -2
- package/types/src/Slider/docs/examples/prisma/Error.d.ts +0 -2
- /package/types/src/Date/docs/examples/{prisma/WithoutCalendar.d.ts → WithoutCalendar.d.ts} +0 -0
package/Menu.js
CHANGED
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
64
|
Divider: () => /* reexport */ w,
|
|
65
|
-
Heading: () => /* reexport */
|
|
66
|
-
Item: () => /* reexport */
|
|
65
|
+
Heading: () => /* reexport */ H,
|
|
66
|
+
Item: () => /* reexport */ Be,
|
|
67
67
|
MenuContext: () => /* reexport */ y,
|
|
68
|
-
default: () => /* reexport */
|
|
68
|
+
default: () => /* reexport */ at
|
|
69
69
|
});
|
|
70
70
|
// CONCATENATED MODULE: external "react"
|
|
71
71
|
const r = require("react");
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
};
|
|
260
260
|
/**
|
|
261
261
|
* A non-interactive `Menu` item used to separate and label groups of `Menu` items.
|
|
262
|
-
*/ function
|
|
262
|
+
*/ function F(e) {
|
|
263
263
|
var t = e.children, i = e.outerStyle, a = e.title, o = q(e, [ "children", "outerStyle", "title" ]);
|
|
264
264
|
var l = (0, r.useContext)(y), s = l.role;
|
|
265
265
|
var c = I()(), p = c.family;
|
|
@@ -286,11 +286,11 @@
|
|
|
286
286
|
"aria-hidden": s === "listbox"
|
|
287
287
|
}, f);
|
|
288
288
|
}
|
|
289
|
-
|
|
290
|
-
/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */
|
|
291
|
-
/* Remove the item if it is the last item after filtering. */
|
|
292
|
-
/* Tag the item as a Heading */
|
|
293
|
-
/* harmony default export */ const
|
|
289
|
+
F.propTypes = N;
|
|
290
|
+
/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ F.filterConsecutive = true;
|
|
291
|
+
/* Remove the item if it is the last item after filtering. */ F.filterLast = true;
|
|
292
|
+
/* Tag the item as a Heading */ F.as = "Heading";
|
|
293
|
+
/* harmony default export */ const H = F;
|
|
294
294
|
// CONCATENATED MODULE: external "lodash/isString"
|
|
295
295
|
const $ = require("lodash/isString");
|
|
296
296
|
var A = e.n($);
|
|
@@ -306,32 +306,37 @@
|
|
|
306
306
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
|
|
307
307
|
const G = require("@splunk/react-icons/enterprise/ChevronRight");
|
|
308
308
|
var V = e.n(G);
|
|
309
|
-
// CONCATENATED MODULE: external "@splunk/react-ui/
|
|
310
|
-
const U = require("@splunk/react-ui/
|
|
309
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
310
|
+
const U = require("@splunk/react-ui/ScreenReaderContent");
|
|
311
311
|
var X = e.n(U);
|
|
312
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
313
|
+
const Y = require("@splunk/ui-utils/i18n");
|
|
314
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
315
|
+
const J = require("@splunk/react-ui/Clickable");
|
|
316
|
+
var Q = e.n(J);
|
|
312
317
|
// CONCATENATED MODULE: external "@splunk/react-ui/Switch"
|
|
313
|
-
const
|
|
314
|
-
var
|
|
318
|
+
const Z = require("@splunk/react-ui/Switch");
|
|
319
|
+
var ee = e.n(Z);
|
|
315
320
|
// CONCATENATED MODULE: ./src/Menu/ItemStyles.ts
|
|
316
|
-
var
|
|
321
|
+
var te = (0, u.css)([ "color:", ";font-size:", ";line-height:", ";overflow:inherit;white-space:inherit;text-overflow:inherit;" ], (0,
|
|
317
322
|
b.pick)({
|
|
318
323
|
prisma: b.variables.contentColorDefault,
|
|
319
324
|
enterprise: b.variables.textGray
|
|
320
325
|
}), b.variables.fontSizeSmall, (0, b.pick)({
|
|
321
326
|
prisma: "16px"
|
|
322
327
|
}));
|
|
323
|
-
var
|
|
328
|
+
var re = f().span.withConfig({
|
|
324
329
|
displayName: "ItemStyles__StyledItemDescriptionBottom",
|
|
325
330
|
componentId: "sc-4kc053-0"
|
|
326
|
-
})([ "", ";display:block;" ],
|
|
327
|
-
var
|
|
331
|
+
})([ "", ";display:block;" ], te);
|
|
332
|
+
var ne = f().span.withConfig({
|
|
328
333
|
displayName: "ItemStyles__StyledItemDescriptionRight",
|
|
329
334
|
componentId: "sc-4kc053-1"
|
|
330
|
-
})([ "", ";float:right;", " max-width:50%;text-align:right;box-sizing:border-box;" ],
|
|
335
|
+
})([ "", ";float:right;", " max-width:50%;text-align:right;box-sizing:border-box;" ], te, (0,
|
|
331
336
|
b.pick)({
|
|
332
337
|
enterprise: (0, u.css)([ "padding-left:", ";" ], b.variables.spacingLarge)
|
|
333
338
|
}));
|
|
334
|
-
var
|
|
339
|
+
var ie = f().div.withConfig({
|
|
335
340
|
displayName: "ItemStyles__StyledItemSelectedIcon",
|
|
336
341
|
componentId: "sc-4kc053-2"
|
|
337
342
|
})([ "position:absolute;", " color:", ";" ], (0, b.pick)({
|
|
@@ -341,7 +346,7 @@
|
|
|
341
346
|
prisma: b.variables.contentColorActive,
|
|
342
347
|
enterprise: b.variables.accentColorL10
|
|
343
348
|
}));
|
|
344
|
-
var
|
|
349
|
+
var ae = f().span.withConfig({
|
|
345
350
|
displayName: "ItemStyles__StyledItemIcon",
|
|
346
351
|
componentId: "sc-4kc053-3"
|
|
347
352
|
})([ "flex:0 0 auto;padding-right:", ";min-width:10px;display:inline-block;text-align:center;vertical-align:", ";", "" ], (0,
|
|
@@ -355,7 +360,7 @@
|
|
|
355
360
|
prisma: (0, u.css)([ "color:", ";display:inline-flex;align-items:center;min-width:20px;min-height:20px;& > svg{width:20px;height:20px;}" ], b.variables.contentColorMuted),
|
|
356
361
|
enterprise: (0, u.css)([ "transform:translateY(-1px);" ])
|
|
357
362
|
}));
|
|
358
|
-
var
|
|
363
|
+
var oe = f()(Q()).withConfig({
|
|
359
364
|
displayName: "ItemStyles__StyledClickable",
|
|
360
365
|
componentId: "sc-4kc053-4"
|
|
361
366
|
})([ "display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;padding:", ";", " ", " ", " &:not([disabled],[aria-disabled='true']){&:hover{background:", ";", "}", " ", "}&:focus{outline:0;box-shadow:", ";", "}&[disabled],&[aria-disabled='true']{color:", ";cursor:not-allowed;", ",", "{color:inherit;}", "{cursor:not-allowed;color:", ";}", "}", "" ], (0,
|
|
@@ -418,26 +423,26 @@
|
|
|
418
423
|
prisma: b.variables.contentColorDisabled
|
|
419
424
|
}),
|
|
420
425
|
/* sc-sel */
|
|
421
|
-
|
|
426
|
+
re,
|
|
422
427
|
/* sc-sel */
|
|
423
|
-
|
|
428
|
+
ne,
|
|
424
429
|
/* sc-sel */
|
|
425
|
-
|
|
430
|
+
ie, (0, b.pick)({
|
|
426
431
|
prisma: b.variables.contentColorDisabled,
|
|
427
432
|
enterprise: b.variables.gray80
|
|
428
433
|
}), (0, b.pick)({
|
|
429
434
|
prisma: (0, u.css)([ "& > * > ", "{color:", ";}" ],
|
|
430
435
|
/* sc-sel */
|
|
431
|
-
|
|
436
|
+
ae, b.variables.contentColorDisabled)
|
|
432
437
|
}), (function(e) {
|
|
433
438
|
var t = e.$selected;
|
|
434
439
|
return t && (0, b.pick)({
|
|
435
440
|
prisma: (0, u.css)([ "", "{color:", ";}" ],
|
|
436
441
|
/* sc-sel */
|
|
437
|
-
|
|
442
|
+
ae, b.variables.contentColorActive)
|
|
438
443
|
});
|
|
439
444
|
}));
|
|
440
|
-
var
|
|
445
|
+
var le = f()(ee()).withConfig({
|
|
441
446
|
displayName: "ItemStyles__StyledSwitch",
|
|
442
447
|
componentId: "sc-4kc053-5"
|
|
443
448
|
})([ "position:absolute;left:", ";top:", ";" ], (0, b.pick)({
|
|
@@ -450,25 +455,25 @@
|
|
|
450
455
|
compact: "2px"
|
|
451
456
|
}
|
|
452
457
|
}));
|
|
453
|
-
var
|
|
458
|
+
var se = f().span.withConfig({
|
|
454
459
|
displayName: "ItemStyles__StyledInnerWrapper",
|
|
455
460
|
componentId: "sc-4kc053-6"
|
|
456
461
|
})([ "display:flex;align-items:flex-start;" ]);
|
|
457
|
-
var
|
|
462
|
+
var ce = f().span.withConfig({
|
|
458
463
|
displayName: "ItemStyles__StyledTitleAndDescriptionWrapper",
|
|
459
464
|
componentId: "sc-4kc053-7"
|
|
460
465
|
})([ "display:flex;flex-wrap:wrap;flex-direction:column;max-width:100%;width:100%;align-self:center;word-break:break-word;white-space:normal;", "" ], (function(e) {
|
|
461
466
|
var t = e.$truncate;
|
|
462
467
|
return t && (0, u.css)([ "white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ]);
|
|
463
468
|
}));
|
|
464
|
-
var
|
|
469
|
+
var pe = f().div.withConfig({
|
|
465
470
|
displayName: "ItemStyles__StyledLabel",
|
|
466
471
|
componentId: "sc-4kc053-8"
|
|
467
472
|
})([ "overflow:inherit;white-space:inherit;text-overflow:inherit;max-width:100%;min-height:20px;", "" ], (function(e) {
|
|
468
473
|
var t = e.$truncate;
|
|
469
474
|
return t && (0, u.css)([ "display:block;clear:both;" ]);
|
|
470
475
|
}));
|
|
471
|
-
var
|
|
476
|
+
var ue = f().span.withConfig({
|
|
472
477
|
displayName: "ItemStyles__StyledMatch",
|
|
473
478
|
componentId: "sc-4kc053-9"
|
|
474
479
|
})([ "border-bottom:1px solid ", ";" ], (0, b.pick)({
|
|
@@ -478,7 +483,7 @@
|
|
|
478
483
|
light: b.variables.gray45
|
|
479
484
|
}
|
|
480
485
|
}));
|
|
481
|
-
var
|
|
486
|
+
var fe = f().span.withConfig({
|
|
482
487
|
displayName: "ItemStyles__StyledSubmenu",
|
|
483
488
|
componentId: "sc-4kc053-10"
|
|
484
489
|
})([ "float:right;padding-left:", ";color:", ";", "" ], b.variables.spacingSmall, (0,
|
|
@@ -489,36 +494,32 @@
|
|
|
489
494
|
prisma: (0, u.css)([ "& > svg{width:20px;height:20px;}" ])
|
|
490
495
|
}));
|
|
491
496
|
// CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRight"
|
|
492
|
-
const
|
|
493
|
-
var
|
|
497
|
+
const de = require("@splunk/react-icons/ArrowSquareTopRight");
|
|
498
|
+
var ve = e.n(de);
|
|
494
499
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/External"
|
|
495
|
-
const
|
|
496
|
-
var
|
|
497
|
-
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
498
|
-
const ve = require("@splunk/ui-utils/i18n");
|
|
500
|
+
const be = require("@splunk/react-icons/enterprise/External");
|
|
501
|
+
var me = e.n(be);
|
|
499
502
|
// CONCATENATED MODULE: ./src/Menu/icons/External.tsx
|
|
500
|
-
var
|
|
501
|
-
var
|
|
502
|
-
var he = f()(de()).withConfig({
|
|
503
|
+
var he = (0, u.css)([ "width:0.8em;height:0.8em;vertical-align:baseline;" ]);
|
|
504
|
+
var ye = f()(me()).withConfig({
|
|
503
505
|
displayName: "External__StyledEnterprise",
|
|
504
506
|
componentId: "sc-1turs2s-0"
|
|
505
|
-
})([ "", " margin:0 0 0 3px;" ],
|
|
506
|
-
var
|
|
507
|
+
})([ "", " margin:0 0 0 3px;" ], he);
|
|
508
|
+
var ge = f()(ve()).withConfig({
|
|
507
509
|
displayName: "External__StyledPrisma",
|
|
508
510
|
componentId: "sc-1turs2s-1"
|
|
509
|
-
})([ "", " margin:0 0 0 4px;" ],
|
|
510
|
-
function
|
|
511
|
+
})([ "", " margin:0 0 0 4px;" ], he);
|
|
512
|
+
function ke() {
|
|
511
513
|
var e = (0, b.useSplunkTheme)(), t = e.isEnterprise, r = e.isCompact;
|
|
512
514
|
var i = r ? "20px" : "24px";
|
|
513
|
-
return t ? n().createElement(
|
|
514
|
-
screenReaderText:
|
|
515
|
-
}) : n().createElement(
|
|
516
|
-
"aria-label": be,
|
|
515
|
+
return t ? n().createElement(ye, {
|
|
516
|
+
screenReaderText: null
|
|
517
|
+
}) : n().createElement(ge, {
|
|
517
518
|
height: i,
|
|
518
519
|
width: i
|
|
519
|
-
}
|
|
520
|
+
});
|
|
520
521
|
}
|
|
521
|
-
/* harmony default export */ const
|
|
522
|
+
/* harmony default export */ const xe = ke;
|
|
522
523
|
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
523
524
|
/**
|
|
524
525
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
@@ -526,7 +527,7 @@
|
|
|
526
527
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
527
528
|
* @param current - The new value of the ref.
|
|
528
529
|
*/
|
|
529
|
-
function
|
|
530
|
+
function we(e, t) {
|
|
530
531
|
if (e) {
|
|
531
532
|
if (typeof e === "function") {
|
|
532
533
|
e(t);
|
|
@@ -540,7 +541,7 @@
|
|
|
540
541
|
}
|
|
541
542
|
// CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
|
|
542
543
|
// A utility that attempts to move an element into view by scrolling it's derived parent.
|
|
543
|
-
var
|
|
544
|
+
var Se = function e(t) {
|
|
544
545
|
if (!t) {
|
|
545
546
|
return;
|
|
546
547
|
}
|
|
@@ -557,21 +558,21 @@
|
|
|
557
558
|
}
|
|
558
559
|
};
|
|
559
560
|
// CONCATENATED MODULE: ./src/Menu/Item.tsx
|
|
560
|
-
function
|
|
561
|
+
function Oe(e) {
|
|
561
562
|
"@babel/helpers - typeof";
|
|
562
563
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
563
|
-
|
|
564
|
+
Oe = function e(t) {
|
|
564
565
|
return typeof t;
|
|
565
566
|
};
|
|
566
567
|
} else {
|
|
567
|
-
|
|
568
|
+
Oe = function e(t) {
|
|
568
569
|
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
569
570
|
};
|
|
570
571
|
}
|
|
571
|
-
return
|
|
572
|
+
return Oe(e);
|
|
572
573
|
}
|
|
573
|
-
function
|
|
574
|
-
|
|
574
|
+
function Ce() {
|
|
575
|
+
Ce = Object.assign || function(e) {
|
|
575
576
|
for (var t = 1; t < arguments.length; t++) {
|
|
576
577
|
var r = arguments[t];
|
|
577
578
|
for (var n in r) {
|
|
@@ -582,11 +583,11 @@
|
|
|
582
583
|
}
|
|
583
584
|
return e;
|
|
584
585
|
};
|
|
585
|
-
return
|
|
586
|
+
return Ce.apply(this, arguments);
|
|
586
587
|
}
|
|
587
|
-
function
|
|
588
|
+
function Ie(e, t) {
|
|
588
589
|
if (e == null) return {};
|
|
589
|
-
var r =
|
|
590
|
+
var r = Pe(e, t);
|
|
590
591
|
var n, i;
|
|
591
592
|
if (Object.getOwnPropertySymbols) {
|
|
592
593
|
var a = Object.getOwnPropertySymbols(e);
|
|
@@ -599,7 +600,7 @@
|
|
|
599
600
|
}
|
|
600
601
|
return r;
|
|
601
602
|
}
|
|
602
|
-
function
|
|
603
|
+
function Pe(e, t) {
|
|
603
604
|
if (e == null) return {};
|
|
604
605
|
var r = {};
|
|
605
606
|
var n = Object.keys(e);
|
|
@@ -611,12 +612,12 @@
|
|
|
611
612
|
}
|
|
612
613
|
return r;
|
|
613
614
|
}
|
|
614
|
-
function
|
|
615
|
+
function _e(e, t) {
|
|
615
616
|
if (!(e instanceof t)) {
|
|
616
617
|
throw new TypeError("Cannot call a class as a function");
|
|
617
618
|
}
|
|
618
619
|
}
|
|
619
|
-
function
|
|
620
|
+
function je(e, t) {
|
|
620
621
|
for (var r = 0; r < t.length; r++) {
|
|
621
622
|
var n = t[r];
|
|
622
623
|
n.enumerable = n.enumerable || false;
|
|
@@ -625,12 +626,12 @@
|
|
|
625
626
|
Object.defineProperty(e, n.key, n);
|
|
626
627
|
}
|
|
627
628
|
}
|
|
628
|
-
function
|
|
629
|
-
if (t)
|
|
630
|
-
if (r)
|
|
629
|
+
function Ee(e, t, r) {
|
|
630
|
+
if (t) je(e.prototype, t);
|
|
631
|
+
if (r) je(e, r);
|
|
631
632
|
return e;
|
|
632
633
|
}
|
|
633
|
-
function
|
|
634
|
+
function Te(e, t) {
|
|
634
635
|
if (typeof t !== "function" && t !== null) {
|
|
635
636
|
throw new TypeError("Super expression must either be null or a function");
|
|
636
637
|
}
|
|
@@ -641,17 +642,17 @@
|
|
|
641
642
|
configurable: true
|
|
642
643
|
}
|
|
643
644
|
});
|
|
644
|
-
if (t)
|
|
645
|
+
if (t) De(e, t);
|
|
645
646
|
}
|
|
646
|
-
function
|
|
647
|
-
|
|
647
|
+
function De(e, t) {
|
|
648
|
+
De = Object.setPrototypeOf || function e(t, r) {
|
|
648
649
|
t.__proto__ = r;
|
|
649
650
|
return t;
|
|
650
651
|
};
|
|
651
|
-
return
|
|
652
|
+
return De(e, t);
|
|
652
653
|
}
|
|
653
|
-
function
|
|
654
|
-
var t =
|
|
654
|
+
function qe(e) {
|
|
655
|
+
var t = Fe();
|
|
655
656
|
return function r() {
|
|
656
657
|
var n = He(e), i;
|
|
657
658
|
if (t) {
|
|
@@ -660,22 +661,22 @@
|
|
|
660
661
|
} else {
|
|
661
662
|
i = n.apply(this, arguments);
|
|
662
663
|
}
|
|
663
|
-
return
|
|
664
|
+
return Re(this, i);
|
|
664
665
|
};
|
|
665
666
|
}
|
|
666
|
-
function
|
|
667
|
-
if (t && (
|
|
667
|
+
function Re(e, t) {
|
|
668
|
+
if (t && (Oe(t) === "object" || typeof t === "function")) {
|
|
668
669
|
return t;
|
|
669
670
|
}
|
|
670
|
-
return
|
|
671
|
+
return Ne(e);
|
|
671
672
|
}
|
|
672
|
-
function
|
|
673
|
+
function Ne(e) {
|
|
673
674
|
if (e === void 0) {
|
|
674
675
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
675
676
|
}
|
|
676
677
|
return e;
|
|
677
678
|
}
|
|
678
|
-
function
|
|
679
|
+
function Fe() {
|
|
679
680
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
680
681
|
if (Reflect.construct.sham) return false;
|
|
681
682
|
if (typeof Proxy === "function") return true;
|
|
@@ -692,7 +693,7 @@
|
|
|
692
693
|
};
|
|
693
694
|
return He(e);
|
|
694
695
|
}
|
|
695
|
-
function
|
|
696
|
+
function $e(e, t, r) {
|
|
696
697
|
if (t in e) {
|
|
697
698
|
Object.defineProperty(e, t, {
|
|
698
699
|
value: r,
|
|
@@ -705,7 +706,7 @@
|
|
|
705
706
|
}
|
|
706
707
|
return e;
|
|
707
708
|
}
|
|
708
|
-
var
|
|
709
|
+
var Ae = {
|
|
709
710
|
active: a().bool,
|
|
710
711
|
children: a().node,
|
|
711
712
|
description: a().string,
|
|
@@ -723,7 +724,7 @@
|
|
|
723
724
|
onClick: a().func,
|
|
724
725
|
/** @private */
|
|
725
726
|
onFocus: a().func,
|
|
726
|
-
openInNewContext: a().bool,
|
|
727
|
+
openInNewContext: a().oneOfType([ a().bool, a().string ]),
|
|
727
728
|
/** @private */
|
|
728
729
|
preventFocus: a().bool,
|
|
729
730
|
role: a().oneOf([ "menuitem", "menuitemradio", "menuitemcheckbox", "listboxitem", "option" ]),
|
|
@@ -735,7 +736,7 @@
|
|
|
735
736
|
to: a().string,
|
|
736
737
|
truncate: a().bool
|
|
737
738
|
};
|
|
738
|
-
var
|
|
739
|
+
var Me = {
|
|
739
740
|
active: false,
|
|
740
741
|
descriptionPosition: "bottom",
|
|
741
742
|
hasSubmenu: false,
|
|
@@ -746,10 +747,11 @@
|
|
|
746
747
|
selected: false,
|
|
747
748
|
truncate: false
|
|
748
749
|
};
|
|
749
|
-
var
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
750
|
+
var Le = (0, Y._)("(Opens new window)");
|
|
751
|
+
var ze = function(e) {
|
|
752
|
+
Te(r, e);
|
|
753
|
+
var t = qe(r);
|
|
754
|
+
Ee(r, null, [ {
|
|
753
755
|
key: "validateProps",
|
|
754
756
|
// @docs-props-type ItemPropsBase
|
|
755
757
|
value: function e(t) {
|
|
@@ -758,23 +760,23 @@
|
|
|
758
760
|
} ]);
|
|
759
761
|
function r(e) {
|
|
760
762
|
var n;
|
|
761
|
-
|
|
763
|
+
_e(this, r);
|
|
762
764
|
n = t.call(this, e);
|
|
763
|
-
|
|
764
|
-
|
|
765
|
+
$e(Ne(n), "el", null);
|
|
766
|
+
$e(Ne(n), "handleFocus", (function(e) {
|
|
765
767
|
var t = n.props, r = t.onFocus, i = t.itemKey;
|
|
766
768
|
r === null || r === void 0 ? void 0 : r(e, {
|
|
767
769
|
itemKey: i
|
|
768
770
|
});
|
|
769
771
|
}));
|
|
770
|
-
|
|
772
|
+
$e(Ne(n), "handleMount", (function(e) {
|
|
771
773
|
n.el = e;
|
|
772
|
-
|
|
774
|
+
we(n.props.elementRef, e);
|
|
773
775
|
}));
|
|
774
776
|
r.validateProps(e);
|
|
775
777
|
return n;
|
|
776
778
|
}
|
|
777
|
-
|
|
779
|
+
Ee(r, [ {
|
|
778
780
|
key: "componentDidUpdate",
|
|
779
781
|
value: function e() {
|
|
780
782
|
r.validateProps(this.props);
|
|
@@ -788,7 +790,7 @@
|
|
|
788
790
|
}, {
|
|
789
791
|
key: "scrollIntoViewIfNeeded",
|
|
790
792
|
value: function e() {
|
|
791
|
-
|
|
793
|
+
Se(this.el);
|
|
792
794
|
}
|
|
793
795
|
}, {
|
|
794
796
|
key: "renderLabel",
|
|
@@ -804,7 +806,7 @@
|
|
|
804
806
|
a.push(
|
|
805
807
|
|
|
806
808
|
// eslint-disable-next-line react/no-array-index-key
|
|
807
|
-
n().createElement(
|
|
809
|
+
n().createElement(ue, {
|
|
808
810
|
key: t,
|
|
809
811
|
"data-test": "match"
|
|
810
812
|
}, r.substring(e.start, e.end)));
|
|
@@ -819,24 +821,24 @@
|
|
|
819
821
|
}, {
|
|
820
822
|
key: "render",
|
|
821
823
|
value: function e() {
|
|
822
|
-
var t = this.props, r = t.active, i = t.children, a = t.hasSubmenu, o = t.selectable, s = t.selectableAppearance, c = t.selected, p = t.icon, u = t.description, f = t.disabled, d = t.onClick, v = t.role, b = t.splunkTheme, m = t.to, h = t.truncate, y = t.descriptionPosition, g = t.openInNewContext, k =
|
|
824
|
+
var t = this.props, r = t.active, i = t.children, a = t.hasSubmenu, o = t.selectable, s = t.selectableAppearance, c = t.selected, p = t.icon, u = t.description, f = t.disabled, d = t.onClick, v = t.role, b = t.splunkTheme, m = t.to, h = t.truncate, y = t.descriptionPosition, g = t.openInNewContext, k = Ie(t, [ "active", "children", "hasSubmenu", "selectable", "selectableAppearance", "selected", "icon", "description", "disabled", "onClick", "role", "splunkTheme", "to", "truncate", "descriptionPosition", "openInNewContext" ]);
|
|
823
825
|
var x = b.isEnterprise, w = b.isPrisma;
|
|
824
826
|
var S = this.context.preventFocus;
|
|
825
827
|
var O = o || c;
|
|
826
|
-
var C = {
|
|
828
|
+
var C = v || {
|
|
827
829
|
nonselectable: "menuitem",
|
|
828
830
|
checkmark: "menuitemradio",
|
|
829
831
|
checkbox: "menuitemcheckbox"
|
|
830
832
|
}[O ? s : "nonselectable"];
|
|
831
|
-
|
|
832
|
-
var I = {
|
|
833
|
+
var I = {
|
|
833
834
|
"aria-haspopup": a ? true : undefined,
|
|
834
|
-
"aria-checked":
|
|
835
|
+
"aria-checked": C === "menuitemradio" || C === "menuitemcheckbox" ? c : undefined,
|
|
836
|
+
"aria-selected": C === "option" && c ? true : undefined
|
|
835
837
|
};
|
|
836
838
|
var P = w ? "right" : "left";
|
|
837
839
|
var _ = u && y === "right";
|
|
838
840
|
var j = u && !_;
|
|
839
|
-
var E = c && s === "checkmark" && n().createElement(
|
|
841
|
+
var E = c && s === "checkmark" && n().createElement(ie, null, w ? n().createElement(K(), {
|
|
840
842
|
inline: true,
|
|
841
843
|
height: "16",
|
|
842
844
|
width: "16"
|
|
@@ -846,8 +848,14 @@
|
|
|
846
848
|
screenReaderText: null,
|
|
847
849
|
size: .85
|
|
848
850
|
}));
|
|
851
|
+
var T = false;
|
|
852
|
+
var D;
|
|
853
|
+
if (g) {
|
|
854
|
+
T = true;
|
|
855
|
+
D = typeof g === "string" ? g : Le;
|
|
856
|
+
}
|
|
849
857
|
|
|
850
|
-
return n().createElement(
|
|
858
|
+
return n().createElement(oe, Ce({
|
|
851
859
|
$isSelectable: O,
|
|
852
860
|
$selectableAppearance: s,
|
|
853
861
|
$selected: c,
|
|
@@ -864,53 +872,53 @@
|
|
|
864
872
|
t.preventDefault();
|
|
865
873
|
}
|
|
866
874
|
},
|
|
867
|
-
role:
|
|
875
|
+
role: C,
|
|
868
876
|
tabIndex: S ? -1 : undefined,
|
|
869
877
|
to: m,
|
|
870
878
|
title: h && A()(i) ? i : undefined,
|
|
871
|
-
openInNewContext:
|
|
879
|
+
openInNewContext: T
|
|
872
880
|
}, I, l()(k, "onFocus"), {
|
|
873
881
|
elementRef: this.handleMount
|
|
874
|
-
}), o && s === "checkbox" && n().createElement(
|
|
882
|
+
}), o && s === "checkbox" && n().createElement(le, {
|
|
875
883
|
interactive: false,
|
|
876
884
|
selected: c,
|
|
877
885
|
selectedLabel: "Selected",
|
|
878
886
|
value: "menu-item"
|
|
879
|
-
}), a && n().createElement(
|
|
887
|
+
}), a && n().createElement(fe, null, x ? n().createElement(V(), {
|
|
880
888
|
hideDefaultTooltip: true,
|
|
881
889
|
screenReaderText: null
|
|
882
|
-
}) : n().createElement(L(), null)), _ && n().createElement(
|
|
890
|
+
}) : n().createElement(L(), null)), _ && n().createElement(ne, {
|
|
883
891
|
"data-test": "description"
|
|
884
|
-
}, u), n().createElement(
|
|
892
|
+
}, u), n().createElement(se, null, p && n().createElement(ae, null, p), n().createElement(ce, {
|
|
885
893
|
$truncate: h
|
|
886
|
-
}, P === "left" && E, n().createElement(
|
|
894
|
+
}, P === "left" && E, n().createElement(pe, {
|
|
887
895
|
$truncate: h,
|
|
888
896
|
"data-test": "label"
|
|
889
|
-
}, this.renderLabel(), g && n().createElement(
|
|
897
|
+
}, this.renderLabel(), g && n().createElement(n().Fragment, null, n().createElement(xe, null), n().createElement(X(), null, D))), j && n().createElement(re, {
|
|
890
898
|
"data-test": "description"
|
|
891
899
|
}, u), P === "right" && E)));
|
|
892
900
|
}
|
|
893
901
|
} ]);
|
|
894
902
|
return r;
|
|
895
903
|
}(r.Component);
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
var
|
|
901
|
-
var
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
/* harmony default export */ const
|
|
904
|
+
$e(ze, "propTypes", Ae);
|
|
905
|
+
$e(ze, "defaultProps", Me);
|
|
906
|
+
$e(ze, "as", void 0);
|
|
907
|
+
$e(ze, "contextType", y);
|
|
908
|
+
var Ke = (0, b.withSplunkTheme)(ze);
|
|
909
|
+
var We = Ke;
|
|
910
|
+
We.propTypes = ze.propTypes;
|
|
911
|
+
We.as = "Item";
|
|
912
|
+
/* harmony default export */ const Be = We;
|
|
905
913
|
// CONCATENATED MODULE: external "@splunk/react-ui/Scroll"
|
|
906
|
-
const
|
|
907
|
-
var
|
|
914
|
+
const Ge = require("@splunk/react-ui/Scroll");
|
|
915
|
+
var Ve = e.n(Ge);
|
|
908
916
|
// CONCATENATED MODULE: ./src/Menu/MenuStyles.ts
|
|
909
|
-
var
|
|
917
|
+
var Ue = (0, u.css)([ "border-top:1px solid ", ";" ], (0, b.pick)({
|
|
910
918
|
enterprise: b.variables.gray60,
|
|
911
919
|
prisma: b.variables.neutral200
|
|
912
920
|
}));
|
|
913
|
-
var
|
|
921
|
+
var Xe = (0, u.css)([ "", ";background-color:", ";border-radius:", ";min-width:60px;overflow:auto;position:relative;", " &:focus{outline:0;box-shadow:", ";", "}& + &{", "}" ], b.mixins.reset("block"), (0,
|
|
914
922
|
b.pick)({
|
|
915
923
|
enterprise: b.variables.backgroundColor,
|
|
916
924
|
prisma: b.variables.backgroundColorPopup
|
|
@@ -918,22 +926,22 @@
|
|
|
918
926
|
prisma: (0, u.css)([ "padding:8px 0;" ])
|
|
919
927
|
}), b.variables.focusShadowInset, (0, b.pick)({
|
|
920
928
|
prisma: (0, u.css)([ "background:", ";" ], b.variables.interactiveColorOverlayHover)
|
|
921
|
-
}),
|
|
922
|
-
var
|
|
929
|
+
}), Ue);
|
|
930
|
+
var Ye = f().div.withConfig({
|
|
923
931
|
displayName: "MenuStyles__Styled",
|
|
924
932
|
componentId: "sc-1olffp9-0"
|
|
925
|
-
})([ "", "" ],
|
|
926
|
-
var
|
|
933
|
+
})([ "", "" ], Xe);
|
|
934
|
+
var Je = f()(Ve()).withConfig({
|
|
927
935
|
displayName: "MenuStyles__StyledScroll",
|
|
928
936
|
componentId: "sc-1olffp9-1"
|
|
929
|
-
})([ "", " ", " + &,& + ", "{", "}" ],
|
|
937
|
+
})([ "", " ", " + &,& + ", "{", "}" ], Xe,
|
|
930
938
|
/* sc-sel */
|
|
931
|
-
|
|
939
|
+
Ye,
|
|
932
940
|
/* sc-sel */
|
|
933
|
-
|
|
941
|
+
Ye, Ue);
|
|
934
942
|
// CONCATENATED MODULE: ./src/Menu/Menu.tsx
|
|
935
|
-
function
|
|
936
|
-
|
|
943
|
+
function Qe() {
|
|
944
|
+
Qe = Object.assign || function(e) {
|
|
937
945
|
for (var t = 1; t < arguments.length; t++) {
|
|
938
946
|
var r = arguments[t];
|
|
939
947
|
for (var n in r) {
|
|
@@ -944,11 +952,11 @@
|
|
|
944
952
|
}
|
|
945
953
|
return e;
|
|
946
954
|
};
|
|
947
|
-
return
|
|
955
|
+
return Qe.apply(this, arguments);
|
|
948
956
|
}
|
|
949
|
-
function
|
|
957
|
+
function Ze(e, t) {
|
|
950
958
|
if (e == null) return {};
|
|
951
|
-
var r =
|
|
959
|
+
var r = et(e, t);
|
|
952
960
|
var n, i;
|
|
953
961
|
if (Object.getOwnPropertySymbols) {
|
|
954
962
|
var a = Object.getOwnPropertySymbols(e);
|
|
@@ -961,7 +969,7 @@
|
|
|
961
969
|
}
|
|
962
970
|
return r;
|
|
963
971
|
}
|
|
964
|
-
function
|
|
972
|
+
function et(e, t) {
|
|
965
973
|
if (e == null) return {};
|
|
966
974
|
var r = {};
|
|
967
975
|
var n = Object.keys(e);
|
|
@@ -973,7 +981,7 @@
|
|
|
973
981
|
}
|
|
974
982
|
return r;
|
|
975
983
|
}
|
|
976
|
-
var
|
|
984
|
+
var tt = {
|
|
977
985
|
children: a().node,
|
|
978
986
|
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
979
987
|
focusMode: a().oneOf([ "roving", "normal", "never" ]),
|
|
@@ -981,7 +989,7 @@
|
|
|
981
989
|
stopScrollPropagation: a().bool
|
|
982
990
|
};
|
|
983
991
|
// the default focus control for Menu: loop, verticalArrows(up/down keys), home/end keys
|
|
984
|
-
var
|
|
992
|
+
var rt = function e(t) {
|
|
985
993
|
return {
|
|
986
994
|
enableLoop: true,
|
|
987
995
|
orientation: "vertical",
|
|
@@ -989,7 +997,7 @@
|
|
|
989
997
|
enableHomeEnd: true
|
|
990
998
|
};
|
|
991
999
|
};
|
|
992
|
-
var
|
|
1000
|
+
var nt = function e(t) {
|
|
993
1001
|
var r = (0, c.keycode)(t.nativeEvent);
|
|
994
1002
|
// Handle special case for tab navigation
|
|
995
1003
|
if (r === "tab" && (0, p.isTabKey)(t)) {
|
|
@@ -997,8 +1005,8 @@
|
|
|
997
1005
|
}
|
|
998
1006
|
return r;
|
|
999
1007
|
};
|
|
1000
|
-
function
|
|
1001
|
-
var t = e.children, i = e.elementRef, a = e.focusMode, o = e.retainFocus, c = e.stopScrollPropagation, u =
|
|
1008
|
+
function it(e) {
|
|
1009
|
+
var t = e.children, i = e.elementRef, a = e.focusMode, o = e.retainFocus, c = e.stopScrollPropagation, u = Ze(e, [ "children", "elementRef", "focusMode", "retainFocus", "stopScrollPropagation" ]);
|
|
1002
1010
|
// @docs-props-type MenuPropsBase
|
|
1003
1011
|
if (false) {}
|
|
1004
1012
|
var f = (0, r.useContext)(y), d = f.role, v = d === void 0 ? "menu" : d;
|
|
@@ -1037,11 +1045,11 @@
|
|
|
1037
1045
|
}), []);
|
|
1038
1046
|
var x = (0, r.useCallback)((function(e) {
|
|
1039
1047
|
h.current = e;
|
|
1040
|
-
|
|
1048
|
+
we(i, e);
|
|
1041
1049
|
}), [ i ]);
|
|
1042
|
-
var w =
|
|
1050
|
+
var w = rt(g);
|
|
1043
1051
|
var S = (0, r.useCallback)((function(e) {
|
|
1044
|
-
var t =
|
|
1052
|
+
var t = nt(e);
|
|
1045
1053
|
var r = t === "tab" || t === "tabShift";
|
|
1046
1054
|
var n = t === "enter";
|
|
1047
1055
|
// Allow default behavior for the enter key.
|
|
@@ -1075,20 +1083,20 @@
|
|
|
1075
1083
|
onKeyDown: C,
|
|
1076
1084
|
role: v
|
|
1077
1085
|
};
|
|
1078
|
-
return c ? n().createElement(
|
|
1086
|
+
return c ? n().createElement(Je, Qe({}, I, {
|
|
1079
1087
|
elementRef: x,
|
|
1080
1088
|
stopScrollPropagation: true
|
|
1081
|
-
}, l()(u, "tagName")), k) : n().createElement(
|
|
1089
|
+
}, l()(u, "tagName")), k) : n().createElement(Ye, Qe({}, I, {
|
|
1082
1090
|
ref: x
|
|
1083
1091
|
}, u), n().createElement(y.Provider, {
|
|
1084
1092
|
value: O()
|
|
1085
1093
|
}, k));
|
|
1086
1094
|
}
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
/* harmony default export */ const
|
|
1095
|
+
it.propTypes = tt;
|
|
1096
|
+
it.Item = Be;
|
|
1097
|
+
it.Divider = w;
|
|
1098
|
+
it.Heading = H;
|
|
1099
|
+
/* harmony default export */ const at = it;
|
|
1092
1100
|
// CONCATENATED MODULE: ./src/Menu/index.ts
|
|
1093
1101
|
module.exports = t;
|
|
1094
1102
|
/******/})();
|