@splunk/react-ui 5.3.0 → 5.4.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/Accordion.js +31 -31
- package/Avatar.js +13 -13
- package/Breadcrumbs.js +66 -63
- package/ButtonSimple.js +52 -52
- package/CHANGELOG.md +16 -0
- package/CardLayout.js +39 -36
- package/Clickable.js +5 -6
- package/Code.js +424 -528
- package/CollapsiblePanel.js +1 -1
- package/Color.js +903 -1025
- package/DefinitionList.js +1 -1
- package/FormRows.js +13 -11
- package/JSONTree.js +682 -1408
- package/Link.js +5 -5
- package/Markdown.js +9 -5
- package/Menu.js +72 -67
- package/Multiselect.js +2692 -2780
- package/Popover.js +201 -196
- package/Resize.js +11 -8
- package/ResultsMenu.js +913 -1030
- package/ScreenReaderContent.js +86 -130
- package/Scroll.js +366 -425
- package/Select.js +1741 -1832
- package/Slider.js +1 -1
- package/SlidingPanels.js +129 -127
- package/StepBar.js +123 -97
- package/Switch.js +115 -111
- package/TabBar.js +10 -10
- package/Table.js +1239 -1240
- package/TextArea.js +596 -684
- package/Tree.js +638 -682
- package/package.json +11 -11
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +1 -5
- package/types/src/Breadcrumbs/BreadcrumbsContext.d.ts +7 -0
- package/types/src/Breadcrumbs/Item.d.ts +1 -1
- package/types/src/ButtonSimple/mixin.d.ts +1 -1
- package/types/src/JSONTree/JSONTreeItem.d.ts +1 -1
- package/types/src/JSONTree/renderTreeItems.d.ts +1 -1
- package/types/src/Modal/ModalContext.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +2 -2
- package/types/src/Multiselect/Normal.d.ts +2 -2
- package/types/src/Number/utils.d.ts +1 -1
- package/types/src/Popover/getPlacement.d.ts +1 -1
- package/types/src/RadioList/Option.d.ts +1 -1
- package/types/src/RadioList/RadioListContext.d.ts +1 -1
- package/types/src/StepBar/StepBar.d.ts +4 -1
- package/types/src/StepBar/StepBarContext.d.ts +1 -0
- package/types/src/StepBar/docs/examples/Vertical.d.ts +6 -0
- package/types/src/Switch/Switch.d.ts +7 -1
- package/types/src/TabBar/Tab.d.ts +3 -1
- package/types/src/TabBar/docs/examples/Icons.d.ts +4 -0
- package/types/src/TabBar/docs/examples/Tooltips.d.ts +3 -0
- package/types/src/TabLayout/Panel.d.ts +2 -0
- package/types/src/Table/Head.d.ts +1 -1
- package/types/src/Table/Row.d.ts +1 -1
- package/types/src/Table/Table.d.ts +1 -0
- package/types/src/Tree/TreeContext.d.ts +1 -1
- package/useControlled.js +61 -97
- package/usePrevious.js +30 -62
- package/useResizeObserver.js +95 -127
package/Popover.js
CHANGED
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
|
-
PopoverContext: () => /* reexport */
|
|
65
|
-
PopoverMenuContext: () => /* reexport */
|
|
66
|
-
PopoverProvider: () => /* reexport */
|
|
67
|
-
default: () => /* reexport */
|
|
64
|
+
PopoverContext: () => /* reexport */ de,
|
|
65
|
+
PopoverMenuContext: () => /* reexport */ pt,
|
|
66
|
+
PopoverProvider: () => /* reexport */ me,
|
|
67
|
+
default: () => /* reexport */ st
|
|
68
68
|
});
|
|
69
69
|
// CONCATENATED MODULE: external "react"
|
|
70
70
|
const r = require("react");
|
|
@@ -442,16 +442,19 @@
|
|
|
442
442
|
const U = require("@splunk/themes");
|
|
443
443
|
// CONCATENATED MODULE: ./src/Popover/PopoverStyles.ts
|
|
444
444
|
var G = 8;
|
|
445
|
-
|
|
445
|
+
// this works around SUI-7977 and SUI-8062 by insetting the arrow into the box
|
|
446
|
+
// such that a 1px gap does not appear between the arrow and the box when the Popover is resized or zoomed
|
|
447
|
+
var J = 1;
|
|
448
|
+
var Q = Y()(X.animated.div).withConfig({
|
|
446
449
|
displayName: "PopoverStyles__Styled",
|
|
447
450
|
componentId: "sc-1nahsvw-0"
|
|
448
451
|
})([ "position:fixed;z-index:", ";left:-300%;top:-300%;" ], U.variables.zindexPopover);
|
|
449
452
|
// These hex codes are the inverted values of variables.backgroundColorPopup which are not exposed as tokens
|
|
450
|
-
var
|
|
453
|
+
var Z = (0, B.css)([ "", "" ], (0, U.pick)({
|
|
451
454
|
light: "#27292e",
|
|
452
455
|
dark: U.variables.white
|
|
453
456
|
}));
|
|
454
|
-
var
|
|
457
|
+
var ee = Y().div.withConfig({
|
|
455
458
|
displayName: "PopoverStyles__StyledBox",
|
|
456
459
|
componentId: "sc-1nahsvw-1"
|
|
457
460
|
})([ "", ";", ";", ";" ], U.mixins.reset("block"), (function(e) {
|
|
@@ -461,55 +464,55 @@
|
|
|
461
464
|
var t = e.$appearance, r = e.$boxPadding;
|
|
462
465
|
return t !== "none" && (0, B.css)([ "padding:", "px;" ], r);
|
|
463
466
|
}));
|
|
464
|
-
var
|
|
467
|
+
var te = Y().div.withConfig({
|
|
465
468
|
displayName: "PopoverStyles__StyledContent",
|
|
466
469
|
componentId: "sc-1nahsvw-2"
|
|
467
470
|
})([ "border-radius:", ";background-color:", ";color:", ";", "" ], U.variables.borderRadius, (0,
|
|
468
471
|
U.pickVariant)("$appearance", {
|
|
469
472
|
normal: U.variables.backgroundColorPopup,
|
|
470
|
-
inverted:
|
|
473
|
+
inverted: Z
|
|
471
474
|
}), (0, U.pickVariant)("$appearance", {
|
|
472
475
|
normal: U.variables.contentColorDefault,
|
|
473
476
|
inverted: U.variables.contentColorInverted
|
|
474
477
|
}), (0, U.pickVariant)("$appearance", {
|
|
475
478
|
normal: (0, B.css)([ "box-shadow:", ";" ], U.variables.overlayShadow)
|
|
476
479
|
}));
|
|
477
|
-
var
|
|
480
|
+
var re = Y().div.withConfig({
|
|
478
481
|
displayName: "PopoverStyles__StyledArrow",
|
|
479
482
|
componentId: "sc-1nahsvw-3"
|
|
480
|
-
})([ "width:0;height:0;border-left:", "px solid transparent;border-right:", "px solid transparent;position:absolute;border-bottom-width:", "px;border-bottom-style:solid;", ";" ], G, G, G, (function(e) {
|
|
483
|
+
})([ "width:0;height:0;border-left:calc(", "px + ", "px) solid transparent;border-right:calc(", "px + ", "px) solid transparent;position:absolute;border-bottom-width:calc(", "px + ", "px);border-bottom-style:solid;", ";" ], G, J, G, J, G, J, (function(e) {
|
|
481
484
|
var t = e.$appearance;
|
|
482
485
|
return t !== "none" && (0, B.css)([ "border-bottom-color:", ";" ], (0, U.pickVariant)("$appearance", {
|
|
483
486
|
normal: U.variables.backgroundColorPopup,
|
|
484
|
-
inverted:
|
|
487
|
+
inverted: Z
|
|
485
488
|
}));
|
|
486
489
|
}));
|
|
487
|
-
var
|
|
490
|
+
var ne = Y().svg.withConfig({
|
|
488
491
|
displayName: "PopoverStyles__StyledHitArea",
|
|
489
492
|
componentId: "sc-1nahsvw-4"
|
|
490
493
|
})([ "position:fixed;pointer-events:none;path{pointer-events:auto;stroke-width:0;stroke:transparent;fill:transparent;}" ]);
|
|
491
494
|
// CONCATENATED MODULE: ./src/Popover/PopoverHitArea.tsx
|
|
492
|
-
function
|
|
493
|
-
return
|
|
495
|
+
function oe(e, t) {
|
|
496
|
+
return ue(e) || ce(e, t) || ie(e, t) || ae();
|
|
494
497
|
}
|
|
495
|
-
function
|
|
498
|
+
function ae() {
|
|
496
499
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
497
500
|
}
|
|
498
|
-
function
|
|
501
|
+
function ie(e, t) {
|
|
499
502
|
if (e) {
|
|
500
|
-
if ("string" == typeof e) return
|
|
503
|
+
if ("string" == typeof e) return le(e, t);
|
|
501
504
|
var r = {}.toString.call(e).slice(8, -1);
|
|
502
|
-
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) ?
|
|
505
|
+
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) ? le(e, t) : void 0;
|
|
503
506
|
}
|
|
504
507
|
}
|
|
505
|
-
function
|
|
508
|
+
function le(e, t) {
|
|
506
509
|
(null == t || t > e.length) && (t = e.length);
|
|
507
510
|
for (var r = 0, n = Array(t); r < t; r++) {
|
|
508
511
|
n[r] = e[r];
|
|
509
512
|
}
|
|
510
513
|
return n;
|
|
511
514
|
}
|
|
512
|
-
function
|
|
515
|
+
function ce(e, t) {
|
|
513
516
|
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
514
517
|
if (null != r) {
|
|
515
518
|
var n, o, a, i, l = [], c = !0, u = !1;
|
|
@@ -531,15 +534,15 @@
|
|
|
531
534
|
return l;
|
|
532
535
|
}
|
|
533
536
|
}
|
|
534
|
-
function
|
|
537
|
+
function ue(e) {
|
|
535
538
|
if (Array.isArray(e)) return e;
|
|
536
539
|
}
|
|
537
|
-
var
|
|
540
|
+
var fe = {
|
|
538
541
|
anchorRect: O().object,
|
|
539
542
|
popoverEl: O().object,
|
|
540
543
|
popoverPlacement: O().oneOf([ "above", "below", "left", "right", "misaligned" ])
|
|
541
544
|
};
|
|
542
|
-
var
|
|
545
|
+
var se = function e(t) {
|
|
543
546
|
var r = t.anchorRect, n = t.popoverEl, o = t.popoverPlacement;
|
|
544
547
|
if (r != null && n != null && o != null) {
|
|
545
548
|
var a = n.getBoundingClientRect();
|
|
@@ -599,12 +602,12 @@
|
|
|
599
602
|
hitAreaStyle: {}
|
|
600
603
|
};
|
|
601
604
|
};
|
|
602
|
-
var
|
|
605
|
+
var pe = n().forwardRef((function(e, t) {
|
|
603
606
|
var o = e.anchorRect, a = e.popoverEl, i = e.popoverPlacement;
|
|
604
|
-
var l = (0, r.useState)(null), c =
|
|
605
|
-
var s = (0, r.useState)({}), p =
|
|
607
|
+
var l = (0, r.useState)(null), c = oe(l, 2), u = c[0], f = c[1];
|
|
608
|
+
var s = (0, r.useState)({}), p = oe(s, 2), v = p[0], d = p[1];
|
|
606
609
|
(0, r.useEffect)((function() {
|
|
607
|
-
var e =
|
|
610
|
+
var e = se({
|
|
608
611
|
anchorRect: o,
|
|
609
612
|
popoverEl: a,
|
|
610
613
|
popoverPlacement: i
|
|
@@ -614,7 +617,7 @@
|
|
|
614
617
|
}), [ o, a, i ]);
|
|
615
618
|
if (u != null) {
|
|
616
619
|
|
|
617
|
-
return n().createElement(
|
|
620
|
+
return n().createElement(ne, {
|
|
618
621
|
"data-test": "popover-hit-area",
|
|
619
622
|
style: v
|
|
620
623
|
}, n().createElement("path", {
|
|
@@ -624,11 +627,11 @@
|
|
|
624
627
|
}
|
|
625
628
|
return null;
|
|
626
629
|
}));
|
|
627
|
-
|
|
628
|
-
/* harmony default export */ const
|
|
630
|
+
pe.propTypes = fe;
|
|
631
|
+
/* harmony default export */ const ve = pe;
|
|
629
632
|
// CONCATENATED MODULE: ./src/Popover/PopoverProvider.tsx
|
|
630
|
-
var
|
|
631
|
-
var
|
|
633
|
+
var de = (0, r.createContext)({});
|
|
634
|
+
var he = {
|
|
632
635
|
/** @private */
|
|
633
636
|
allowPropagation: O().bool,
|
|
634
637
|
children: O().node,
|
|
@@ -636,7 +639,7 @@
|
|
|
636
639
|
};
|
|
637
640
|
/**
|
|
638
641
|
* Provides a method for controlling certain `Popover` props in components that use `Popover`.
|
|
639
|
-
*/ var
|
|
642
|
+
*/ var me = function e(t) {
|
|
640
643
|
var o = t.allowPropagation, a = t.children, i = t.hideArrow;
|
|
641
644
|
var l = (0, r.useMemo)((function() {
|
|
642
645
|
return {
|
|
@@ -645,14 +648,14 @@
|
|
|
645
648
|
};
|
|
646
649
|
}), [ o, i ]);
|
|
647
650
|
|
|
648
|
-
return n().createElement(
|
|
651
|
+
return n().createElement(de.Provider, {
|
|
649
652
|
value: l
|
|
650
653
|
}, a);
|
|
651
654
|
};
|
|
652
|
-
|
|
655
|
+
me.propTypes = he;
|
|
653
656
|
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
654
657
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
655
|
-
var
|
|
658
|
+
var be = {
|
|
656
659
|
body: {
|
|
657
660
|
appendChild: function e() {
|
|
658
661
|
return [];
|
|
@@ -706,16 +709,16 @@
|
|
|
706
709
|
search: ""
|
|
707
710
|
}
|
|
708
711
|
};
|
|
709
|
-
function
|
|
710
|
-
var e = typeof document !== "undefined" ? document :
|
|
712
|
+
function ge() {
|
|
713
|
+
var e = typeof document !== "undefined" ? document : be;
|
|
711
714
|
return e;
|
|
712
715
|
}
|
|
713
|
-
var
|
|
714
|
-
/* harmony default export */ const
|
|
716
|
+
var ye = ge();
|
|
717
|
+
/* harmony default export */ const we = /* unused pure expression or super */ null && ye;
|
|
715
718
|
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
716
719
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
717
|
-
var
|
|
718
|
-
document:
|
|
720
|
+
var Pe = {
|
|
721
|
+
document: be,
|
|
719
722
|
navigator: {
|
|
720
723
|
userAgent: ""
|
|
721
724
|
},
|
|
@@ -769,22 +772,22 @@
|
|
|
769
772
|
clearTimeout(t);
|
|
770
773
|
}
|
|
771
774
|
};
|
|
772
|
-
function
|
|
773
|
-
var e = typeof window !== "undefined" ? window :
|
|
775
|
+
function Se() {
|
|
776
|
+
var e = typeof window !== "undefined" ? window : Pe;
|
|
774
777
|
return e;
|
|
775
778
|
}
|
|
776
|
-
var
|
|
777
|
-
/* harmony default export */ const
|
|
779
|
+
var Oe = Se();
|
|
780
|
+
/* harmony default export */ const Ce = /* unused pure expression or super */ null && Oe;
|
|
778
781
|
// CONCATENATED MODULE: ./src/utils/getBoundingClientRect.ts
|
|
779
|
-
function
|
|
782
|
+
function Ee(e) {
|
|
780
783
|
"@babel/helpers - typeof";
|
|
781
|
-
return
|
|
784
|
+
return Ee = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
782
785
|
return typeof e;
|
|
783
786
|
} : function(e) {
|
|
784
787
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
785
|
-
},
|
|
788
|
+
}, Ee(e);
|
|
786
789
|
}
|
|
787
|
-
function
|
|
790
|
+
function je(e, t) {
|
|
788
791
|
var r = Object.keys(e);
|
|
789
792
|
if (Object.getOwnPropertySymbols) {
|
|
790
793
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -794,46 +797,46 @@
|
|
|
794
797
|
}
|
|
795
798
|
return r;
|
|
796
799
|
}
|
|
797
|
-
function
|
|
800
|
+
function xe(e) {
|
|
798
801
|
for (var t = 1; t < arguments.length; t++) {
|
|
799
802
|
var r = null != arguments[t] ? arguments[t] : {};
|
|
800
|
-
t % 2 ?
|
|
801
|
-
|
|
802
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
803
|
+
t % 2 ? je(Object(r), !0).forEach((function(t) {
|
|
804
|
+
ke(e, t, r[t]);
|
|
805
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : je(Object(r)).forEach((function(t) {
|
|
803
806
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
804
807
|
}));
|
|
805
808
|
}
|
|
806
809
|
return e;
|
|
807
810
|
}
|
|
808
|
-
function
|
|
809
|
-
return (t =
|
|
811
|
+
function ke(e, t, r) {
|
|
812
|
+
return (t = Ae(t)) in e ? Object.defineProperty(e, t, {
|
|
810
813
|
value: r,
|
|
811
814
|
enumerable: !0,
|
|
812
815
|
configurable: !0,
|
|
813
816
|
writable: !0
|
|
814
817
|
}) : e[t] = r, e;
|
|
815
818
|
}
|
|
816
|
-
function
|
|
817
|
-
var t =
|
|
818
|
-
return "symbol" ==
|
|
819
|
+
function Ae(e) {
|
|
820
|
+
var t = Te(e, "string");
|
|
821
|
+
return "symbol" == Ee(t) ? t : t + "";
|
|
819
822
|
}
|
|
820
|
-
function
|
|
821
|
-
if ("object" !=
|
|
823
|
+
function Te(e, t) {
|
|
824
|
+
if ("object" != Ee(e) || !e) return e;
|
|
822
825
|
var r = e[Symbol.toPrimitive];
|
|
823
826
|
if (void 0 !== r) {
|
|
824
827
|
var n = r.call(e, t || "default");
|
|
825
|
-
if ("object" !=
|
|
828
|
+
if ("object" != Ee(n)) return n;
|
|
826
829
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
827
830
|
}
|
|
828
831
|
return ("string" === t ? String : Number)(e);
|
|
829
832
|
}
|
|
830
833
|
// Checks if browser is Safari
|
|
831
|
-
function
|
|
834
|
+
function Re() {
|
|
832
835
|
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
833
836
|
}
|
|
834
837
|
// Formats return value to DOMRect
|
|
835
|
-
function
|
|
836
|
-
return
|
|
838
|
+
function Me(e) {
|
|
839
|
+
return xe(xe({}, e), {}, {
|
|
837
840
|
top: e.y,
|
|
838
841
|
left: e.x,
|
|
839
842
|
right: e.x + e.width,
|
|
@@ -847,18 +850,18 @@
|
|
|
847
850
|
* @param {boolean} offsets - Use when position of element relative to the layout viewport offsets are needed for Safari.
|
|
848
851
|
* @returns {Omit<DOMRect, 'toJSON'>}
|
|
849
852
|
* @public
|
|
850
|
-
*/ function
|
|
853
|
+
*/ function We(e, t) {
|
|
851
854
|
var r, n;
|
|
852
855
|
var o = e.getBoundingClientRect();
|
|
853
|
-
var a =
|
|
856
|
+
var a = Re();
|
|
854
857
|
if (!t || !a) {
|
|
855
858
|
return o;
|
|
856
859
|
}
|
|
857
|
-
var i =
|
|
860
|
+
var i = Se();
|
|
858
861
|
var l = o.left + (((r = i.visualViewport) === null || r === void 0 ? void 0 : r.offsetLeft) || 0);
|
|
859
862
|
var c = o.top + (((n = i.visualViewport) === null || n === void 0 ? void 0 : n.offsetTop) || 0);
|
|
860
863
|
var u = o.width, f = o.height;
|
|
861
|
-
return
|
|
864
|
+
return Me({
|
|
862
865
|
width: u,
|
|
863
866
|
height: f,
|
|
864
867
|
x: l,
|
|
@@ -872,7 +875,7 @@
|
|
|
872
875
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
873
876
|
* @param current - The new value of the ref.
|
|
874
877
|
*/
|
|
875
|
-
function
|
|
878
|
+
function qe(e, t) {
|
|
876
879
|
if (e) {
|
|
877
880
|
if (typeof e === "function") {
|
|
878
881
|
e(t);
|
|
@@ -885,36 +888,36 @@
|
|
|
885
888
|
}
|
|
886
889
|
}
|
|
887
890
|
// CONCATENATED MODULE: ./src/utils/useDeprecate.tsx
|
|
888
|
-
var
|
|
889
|
-
var
|
|
891
|
+
var He = "is deprecated and will be removed in the next major version.";
|
|
892
|
+
var Ie = function e(t) {
|
|
890
893
|
var r = t.additionalMessage, n = r === void 0 ? "" : r, o = t.componentName;
|
|
891
894
|
useEffect((function() {
|
|
892
895
|
if (false) {}
|
|
893
896
|
}), [ n, o ]);
|
|
894
897
|
};
|
|
895
|
-
var
|
|
898
|
+
var Ne = function e(t) {
|
|
896
899
|
var r = t.additionalMessage, n = r === void 0 ? "" : r, o = t.componentName, a = t.propName, i = t.propValue;
|
|
897
900
|
useEffect((function() {
|
|
898
901
|
if (false) {}
|
|
899
902
|
}), [ n, o, a, i ]);
|
|
900
903
|
};
|
|
901
|
-
var
|
|
904
|
+
var Le = function e(t) {
|
|
902
905
|
var n = t.additionalMessage, o = n === void 0 ? "" : n, a = t.componentName, i = t.deprecatedPropValue, l = t.propName, c = t.propValue;
|
|
903
906
|
(0, r.useEffect)((function() {
|
|
904
907
|
if (false) {}
|
|
905
908
|
}), [ o, a, l, c, i ]);
|
|
906
909
|
};
|
|
907
910
|
// CONCATENATED MODULE: ./src/Popover/Popover.tsx
|
|
908
|
-
function
|
|
911
|
+
function De(e) {
|
|
909
912
|
"@babel/helpers - typeof";
|
|
910
|
-
return
|
|
913
|
+
return De = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
911
914
|
return typeof e;
|
|
912
915
|
} : function(e) {
|
|
913
916
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
914
|
-
},
|
|
917
|
+
}, De(e);
|
|
915
918
|
}
|
|
916
|
-
function
|
|
917
|
-
return
|
|
919
|
+
function Fe() {
|
|
920
|
+
return Fe = Object.assign ? Object.assign.bind() : function(e) {
|
|
918
921
|
for (var t = 1; t < arguments.length; t++) {
|
|
919
922
|
var r = arguments[t];
|
|
920
923
|
for (var n in r) {
|
|
@@ -922,9 +925,9 @@
|
|
|
922
925
|
}
|
|
923
926
|
}
|
|
924
927
|
return e;
|
|
925
|
-
},
|
|
928
|
+
}, Fe.apply(null, arguments);
|
|
926
929
|
}
|
|
927
|
-
function
|
|
930
|
+
function $e(e, t) {
|
|
928
931
|
var r = Object.keys(e);
|
|
929
932
|
if (Object.getOwnPropertySymbols) {
|
|
930
933
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -934,60 +937,60 @@
|
|
|
934
937
|
}
|
|
935
938
|
return r;
|
|
936
939
|
}
|
|
937
|
-
function
|
|
940
|
+
function _e(e) {
|
|
938
941
|
for (var t = 1; t < arguments.length; t++) {
|
|
939
942
|
var r = null != arguments[t] ? arguments[t] : {};
|
|
940
|
-
t % 2 ?
|
|
941
|
-
|
|
942
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
943
|
+
t % 2 ? $e(Object(r), !0).forEach((function(t) {
|
|
944
|
+
Ve(e, t, r[t]);
|
|
945
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : $e(Object(r)).forEach((function(t) {
|
|
943
946
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
944
947
|
}));
|
|
945
948
|
}
|
|
946
949
|
return e;
|
|
947
950
|
}
|
|
948
|
-
function
|
|
949
|
-
return (t =
|
|
951
|
+
function Ve(e, t, r) {
|
|
952
|
+
return (t = ze(t)) in e ? Object.defineProperty(e, t, {
|
|
950
953
|
value: r,
|
|
951
954
|
enumerable: !0,
|
|
952
955
|
configurable: !0,
|
|
953
956
|
writable: !0
|
|
954
957
|
}) : e[t] = r, e;
|
|
955
958
|
}
|
|
956
|
-
function
|
|
957
|
-
var t =
|
|
958
|
-
return "symbol" ==
|
|
959
|
+
function ze(e) {
|
|
960
|
+
var t = Ke(e, "string");
|
|
961
|
+
return "symbol" == De(t) ? t : t + "";
|
|
959
962
|
}
|
|
960
|
-
function
|
|
961
|
-
if ("object" !=
|
|
963
|
+
function Ke(e, t) {
|
|
964
|
+
if ("object" != De(e) || !e) return e;
|
|
962
965
|
var r = e[Symbol.toPrimitive];
|
|
963
966
|
if (void 0 !== r) {
|
|
964
967
|
var n = r.call(e, t || "default");
|
|
965
|
-
if ("object" !=
|
|
968
|
+
if ("object" != De(n)) return n;
|
|
966
969
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
967
970
|
}
|
|
968
971
|
return ("string" === t ? String : Number)(e);
|
|
969
972
|
}
|
|
970
|
-
function
|
|
971
|
-
return
|
|
973
|
+
function Xe(e, t) {
|
|
974
|
+
return Je(e) || Ge(e, t) || Ye(e, t) || Be();
|
|
972
975
|
}
|
|
973
|
-
function
|
|
976
|
+
function Be() {
|
|
974
977
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
975
978
|
}
|
|
976
|
-
function
|
|
979
|
+
function Ye(e, t) {
|
|
977
980
|
if (e) {
|
|
978
|
-
if ("string" == typeof e) return
|
|
981
|
+
if ("string" == typeof e) return Ue(e, t);
|
|
979
982
|
var r = {}.toString.call(e).slice(8, -1);
|
|
980
|
-
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) ?
|
|
983
|
+
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) ? Ue(e, t) : void 0;
|
|
981
984
|
}
|
|
982
985
|
}
|
|
983
|
-
function
|
|
986
|
+
function Ue(e, t) {
|
|
984
987
|
(null == t || t > e.length) && (t = e.length);
|
|
985
988
|
for (var r = 0, n = Array(t); r < t; r++) {
|
|
986
989
|
n[r] = e[r];
|
|
987
990
|
}
|
|
988
991
|
return n;
|
|
989
992
|
}
|
|
990
|
-
function
|
|
993
|
+
function Ge(e, t) {
|
|
991
994
|
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
992
995
|
if (null != r) {
|
|
993
996
|
var n, o, a, i, l = [], c = !0, u = !1;
|
|
@@ -1009,12 +1012,12 @@
|
|
|
1009
1012
|
return l;
|
|
1010
1013
|
}
|
|
1011
1014
|
}
|
|
1012
|
-
function
|
|
1015
|
+
function Je(e) {
|
|
1013
1016
|
if (Array.isArray(e)) return e;
|
|
1014
1017
|
}
|
|
1015
|
-
function
|
|
1018
|
+
function Qe(e, t) {
|
|
1016
1019
|
if (null == e) return {};
|
|
1017
|
-
var r, n, o =
|
|
1020
|
+
var r, n, o = Ze(e, t);
|
|
1018
1021
|
if (Object.getOwnPropertySymbols) {
|
|
1019
1022
|
var a = Object.getOwnPropertySymbols(e);
|
|
1020
1023
|
for (n = 0; n < a.length; n++) {
|
|
@@ -1023,7 +1026,7 @@
|
|
|
1023
1026
|
}
|
|
1024
1027
|
return o;
|
|
1025
1028
|
}
|
|
1026
|
-
function
|
|
1029
|
+
function Ze(e, t) {
|
|
1027
1030
|
if (null == e) return {};
|
|
1028
1031
|
var r = {};
|
|
1029
1032
|
for (var n in e) {
|
|
@@ -1038,8 +1041,8 @@
|
|
|
1038
1041
|
/** @public */
|
|
1039
1042
|
/** @public */
|
|
1040
1043
|
/** @public */
|
|
1041
|
-
/** @public */ var
|
|
1042
|
-
var
|
|
1044
|
+
/** @public */ var et = [ "clickAway", "escapeKey", "offScreen", "tabKey" ];
|
|
1045
|
+
var tt = {
|
|
1043
1046
|
align: O().oneOf([ "center", "edge", "end" ]),
|
|
1044
1047
|
anchor: O().object,
|
|
1045
1048
|
animation: O().bool,
|
|
@@ -1048,7 +1051,7 @@
|
|
|
1048
1051
|
autoCloseWhenOffScreen: O().bool,
|
|
1049
1052
|
canCoverAnchor: O().bool,
|
|
1050
1053
|
children: O().oneOfType([ O().node, O().func ]),
|
|
1051
|
-
closeReasons: O().arrayOf(O().oneOf(
|
|
1054
|
+
closeReasons: O().arrayOf(O().oneOf(et)),
|
|
1052
1055
|
defaultPlacement: O().oneOf([ "above", "below", "left", "right", "vertical", "horizontal" ]),
|
|
1053
1056
|
elementRef: O().oneOfType([ O().func, O().object ]),
|
|
1054
1057
|
id: O().string,
|
|
@@ -1066,11 +1069,11 @@
|
|
|
1066
1069
|
takeFocus: O().bool,
|
|
1067
1070
|
splunkTheme: O().object
|
|
1068
1071
|
};
|
|
1069
|
-
var
|
|
1072
|
+
var rt = {
|
|
1070
1073
|
passive: false,
|
|
1071
1074
|
capture: true
|
|
1072
1075
|
};
|
|
1073
|
-
function
|
|
1076
|
+
function nt(e, t) {
|
|
1074
1077
|
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
1075
1078
|
return !!e && !!t && u()(e, (function(e, n) {
|
|
1076
1079
|
if (h()(e)) {
|
|
@@ -1079,7 +1082,7 @@
|
|
|
1079
1082
|
return t[n] === e;
|
|
1080
1083
|
}));
|
|
1081
1084
|
}
|
|
1082
|
-
function
|
|
1085
|
+
function ot(e) {
|
|
1083
1086
|
var t = e.anchorPos, r = e.borderRadius, n = e.placement, o = e.outerContainerStyle, i = e.outerContainerEl;
|
|
1084
1087
|
if (n === "misaligned") {
|
|
1085
1088
|
return [ {
|
|
@@ -1104,22 +1107,22 @@
|
|
|
1104
1107
|
var m = a()(h, d, v);
|
|
1105
1108
|
var b = {
|
|
1106
1109
|
left: {
|
|
1107
|
-
translateX: G / 2,
|
|
1110
|
+
translateX: (G + J) / 2,
|
|
1108
1111
|
translateY: p,
|
|
1109
1112
|
rotate: 90
|
|
1110
1113
|
},
|
|
1111
1114
|
right: {
|
|
1112
|
-
translateX: -G / 2,
|
|
1115
|
+
translateX: -(G + J) / 2,
|
|
1113
1116
|
translateY: p,
|
|
1114
1117
|
rotate: -90
|
|
1115
1118
|
},
|
|
1116
1119
|
above: {
|
|
1117
|
-
translateX: m,
|
|
1120
|
+
translateX: m - J / 2,
|
|
1118
1121
|
translateY: 0,
|
|
1119
1122
|
rotate: 180
|
|
1120
1123
|
},
|
|
1121
1124
|
below: {
|
|
1122
|
-
translateX: m,
|
|
1125
|
+
translateX: m - J / 2,
|
|
1123
1126
|
translateY: 0,
|
|
1124
1127
|
rotate: 0
|
|
1125
1128
|
}
|
|
@@ -1140,12 +1143,12 @@
|
|
|
1140
1143
|
above: "left",
|
|
1141
1144
|
below: "left"
|
|
1142
1145
|
};
|
|
1143
|
-
l[w[n]] = "50%";
|
|
1146
|
+
l[w[n]] = "calc(50% - ".concat(J, "px/2)");
|
|
1144
1147
|
return [ l, g ];
|
|
1145
1148
|
}
|
|
1146
|
-
function
|
|
1149
|
+
function at(e) {
|
|
1147
1150
|
var t = e.anchorEl, r = e.offsets, n = r === void 0 ? false : r, o = e.pointTo;
|
|
1148
|
-
var a =
|
|
1151
|
+
var a = We(t, n);
|
|
1149
1152
|
var i = {
|
|
1150
1153
|
// these are rounded to avoid causing visual regressions
|
|
1151
1154
|
// they were previously clientWidth and clientHeight which were already rounded
|
|
@@ -1166,11 +1169,11 @@
|
|
|
1166
1169
|
i.center = c ? i.top : a.top + (i.bottom - a.top) / 2;
|
|
1167
1170
|
return i;
|
|
1168
1171
|
}
|
|
1169
|
-
function
|
|
1172
|
+
function it(e) {
|
|
1170
1173
|
return e !== window && e !== window.document;
|
|
1171
1174
|
}
|
|
1172
|
-
function
|
|
1173
|
-
var r =
|
|
1175
|
+
function lt(e, t) {
|
|
1176
|
+
var r = Se();
|
|
1174
1177
|
if (e.top < 0 || e.top > r.innerHeight || e.left < 0 || e.left > r.innerWidth) {
|
|
1175
1178
|
return true;
|
|
1176
1179
|
}
|
|
@@ -1181,29 +1184,29 @@
|
|
|
1181
1184
|
}
|
|
1182
1185
|
return false;
|
|
1183
1186
|
}
|
|
1184
|
-
function
|
|
1187
|
+
function ct(e, t) {
|
|
1185
1188
|
// this accomodates the arrow height
|
|
1186
1189
|
// and provides some spacing between the end of the Popover and the edge of the window
|
|
1187
1190
|
var r = G * 2;
|
|
1188
1191
|
return t !== "none" && e != null && h()(e) ? e - r : e || null;
|
|
1189
1192
|
}
|
|
1190
|
-
var
|
|
1193
|
+
var ut = {};
|
|
1191
1194
|
/**
|
|
1192
1195
|
* `Popover` is used to create layovers such as dropdowns, contextual menus, or tooltips. Use
|
|
1193
1196
|
* this only when the other components don't provide sufficient functionality or control. A controlled
|
|
1194
1197
|
* `Dropdown` covers use cases where you might consider using `Popover` directly.
|
|
1195
|
-
*/ function
|
|
1198
|
+
*/ function ft(e) {
|
|
1196
1199
|
var t, o;
|
|
1197
|
-
var a = e.align, i = a === void 0 ? "center" : a, c = e.anchor, u = e.animation, f = u === void 0 ? true : u, s = e.animationConfig, p = s === void 0 ?
|
|
1200
|
+
var a = e.align, i = a === void 0 ? "center" : a, c = e.anchor, u = e.animation, f = u === void 0 ? true : u, s = e.animationConfig, p = s === void 0 ? ut : s, d = e.appearance, h = d === void 0 ? "normal" : d, m = e.autoCloseWhenOffScreen, g = m === void 0 ? true : m, w = e.canCoverAnchor, S = e.children, O = e.closeReasons, E = O === void 0 ? et : O, x = e.defaultPlacement, A = x === void 0 ? "below" : x, R = e.elementRef, q = e.hideArrow, H = e.hitAreaRef, I = e.id, N = e.onRequestClose, L = e.open, D = e.outerRef, F = e.pointTo, $ = e.repositionMode, _ = $ === void 0 ? "flip" : $, V = e.retainFocus, z = V === void 0 ? true : V, X = e.takeFocus, B = e.toggleId, Y = Qe(e, [ "align", "anchor", "animation", "animationConfig", "appearance", "autoCloseWhenOffScreen", "canCoverAnchor", "children", "closeReasons", "defaultPlacement", "elementRef", "hideArrow", "hitAreaRef", "id", "onRequestClose", "open", "outerRef", "pointTo", "repositionMode", "retainFocus", "takeFocus", "toggleId" ]);
|
|
1198
1201
|
// @docs-props-type PopoverPropsBase
|
|
1199
|
-
|
|
1202
|
+
Le({
|
|
1200
1203
|
componentName: "Popover",
|
|
1201
1204
|
deprecatedPropValue: "inverted",
|
|
1202
1205
|
propName: "appearance",
|
|
1203
1206
|
propValue: h
|
|
1204
1207
|
});
|
|
1205
|
-
var U = (0, r.useState)(L),
|
|
1206
|
-
var oe = (0, r.useState)(false), ae =
|
|
1208
|
+
var U = (0, r.useState)(L), J = Xe(U, 2), Z = J[0], ne = J[1];
|
|
1209
|
+
var oe = (0, r.useState)(false), ae = Xe(oe, 2), ie = ae[0], le = ae[1];
|
|
1207
1210
|
if (L !== ie) {
|
|
1208
1211
|
// formerly implemented by componentWillReceiveProps
|
|
1209
1212
|
// we can't use prevOpen here since that's a ref behind the scenes
|
|
@@ -1215,8 +1218,8 @@
|
|
|
1215
1218
|
}
|
|
1216
1219
|
// this is a single state object because all these properties
|
|
1217
1220
|
// are updated at the same time by setPlacement
|
|
1218
|
-
var ce = (0, r.useState)({}), ue =
|
|
1219
|
-
var
|
|
1221
|
+
var ce = (0, r.useState)({}), ue = Xe(ce, 2), fe = ue[0], se = ue[1];
|
|
1222
|
+
var pe = (0, r.useRef)(true);
|
|
1220
1223
|
var he = (0, r.useRef)(false);
|
|
1221
1224
|
var me = (0, r.useRef)(null);
|
|
1222
1225
|
var be = (0, r.useRef)(null);
|
|
@@ -1225,8 +1228,8 @@
|
|
|
1225
1228
|
anchorHeight: ((t = fe.anchorPos) === null || t === void 0 ? void 0 : t.height) || null,
|
|
1226
1229
|
anchorWidth: ((o = fe.anchorPos) === null || o === void 0 ? void 0 : o.width) || null,
|
|
1227
1230
|
placement: fe.placement || null,
|
|
1228
|
-
maxHeight:
|
|
1229
|
-
maxWidth:
|
|
1231
|
+
maxHeight: ct(fe.maxHeight, h),
|
|
1232
|
+
maxWidth: ct(fe.maxWidth, h),
|
|
1230
1233
|
toggleId: B
|
|
1231
1234
|
};
|
|
1232
1235
|
var we = (0, r.useMemo)((function() {
|
|
@@ -1236,11 +1239,11 @@
|
|
|
1236
1239
|
opacity: 1
|
|
1237
1240
|
};
|
|
1238
1241
|
}), [ f, L ]);
|
|
1239
|
-
var
|
|
1240
|
-
var Oe = L ||
|
|
1241
|
-
var Ce = (0, r.useContext)(T()) ||
|
|
1242
|
-
var Ee = Ce !==
|
|
1243
|
-
var je = (0, r.useContext)(
|
|
1242
|
+
var Pe = Se();
|
|
1243
|
+
var Oe = L || Z;
|
|
1244
|
+
var Ce = (0, r.useContext)(T()) || Pe;
|
|
1245
|
+
var Ee = Ce !== Pe;
|
|
1246
|
+
var je = (0, r.useContext)(de), xe = je.allowPropagation, ke = je.hideArrow;
|
|
1244
1247
|
var Ae = q !== null && q !== void 0 ? q : ke;
|
|
1245
1248
|
(0, r.useEffect)((function() {
|
|
1246
1249
|
if (false) {}
|
|
@@ -1251,7 +1254,7 @@
|
|
|
1251
1254
|
}
|
|
1252
1255
|
}), [ E, L, N ]);
|
|
1253
1256
|
var Re = (0, r.useCallback)((function(e, t) {
|
|
1254
|
-
var r =
|
|
1257
|
+
var r = lt(e, t);
|
|
1255
1258
|
if (r) {
|
|
1256
1259
|
Te({
|
|
1257
1260
|
reason: "offScreen"
|
|
@@ -1259,13 +1262,13 @@
|
|
|
1259
1262
|
}
|
|
1260
1263
|
return r;
|
|
1261
1264
|
}), [ Te ]);
|
|
1262
|
-
var Me = M()(),
|
|
1263
|
-
var Ie = parseInt(
|
|
1264
|
-
var
|
|
1265
|
+
var Me = M()(), We = Me.borderRadius, He = Me.spacingXSmall;
|
|
1266
|
+
var Ie = parseInt(We, 10);
|
|
1267
|
+
var Ne = parseInt(He, 10);
|
|
1265
1268
|
// this is intentionally smaller when the arrow is hidden to address SUI-5452
|
|
1266
|
-
var
|
|
1267
|
-
//
|
|
1268
|
-
var
|
|
1269
|
+
var De = Ae ? Ne : G;
|
|
1270
|
+
// use caution when calling this directly - prefer setPlacement (the throttled version) instead
|
|
1271
|
+
var $e = (0, r.useCallback)((function(e) {
|
|
1269
1272
|
se((function(t) {
|
|
1270
1273
|
var r, n;
|
|
1271
1274
|
// If these conditions are not met, we cannot set the popover.
|
|
@@ -1275,16 +1278,16 @@
|
|
|
1275
1278
|
// }
|
|
1276
1279
|
return t;
|
|
1277
1280
|
}
|
|
1278
|
-
var o =
|
|
1281
|
+
var o = at({
|
|
1279
1282
|
anchorEl: c,
|
|
1280
1283
|
pointTo: F
|
|
1281
1284
|
});
|
|
1282
|
-
var a =
|
|
1285
|
+
var a = at({
|
|
1283
1286
|
anchorEl: c,
|
|
1284
1287
|
offsets: true,
|
|
1285
1288
|
pointTo: F
|
|
1286
1289
|
});
|
|
1287
|
-
var l =
|
|
1290
|
+
var l = it(Ce) ? at({
|
|
1288
1291
|
anchorEl: Ce,
|
|
1289
1292
|
pointTo: F
|
|
1290
1293
|
}) : undefined;
|
|
@@ -1301,27 +1304,27 @@
|
|
|
1301
1304
|
defaultPlacement: A,
|
|
1302
1305
|
repositionMode: _,
|
|
1303
1306
|
outerContainerEl: ge.current,
|
|
1304
|
-
padding:
|
|
1305
|
-
windowWidth:
|
|
1306
|
-
windowHeight:
|
|
1307
|
+
padding: De,
|
|
1308
|
+
windowWidth: Pe.innerWidth,
|
|
1309
|
+
windowHeight: Pe.innerHeight
|
|
1307
1310
|
}), f = u.placement, s = u.outerContainerStyle, p = u.maxHeight, v = u.maxWidth;
|
|
1308
|
-
var d =
|
|
1311
|
+
var d = nt(a, t.anchorPos) && nt(s, t.outerContainerStyle) && f === t.placement && p === t.maxHeight && v === t.maxWidth;
|
|
1309
1312
|
var h = true;
|
|
1310
1313
|
var m = {};
|
|
1311
1314
|
var b;
|
|
1312
1315
|
if (me.current) {
|
|
1313
|
-
var P =
|
|
1316
|
+
var P = ot({
|
|
1314
1317
|
anchorPos: a,
|
|
1315
1318
|
borderRadius: Ie,
|
|
1316
1319
|
outerContainerStyle: s,
|
|
1317
1320
|
placement: f,
|
|
1318
1321
|
outerContainerEl: ge.current
|
|
1319
1322
|
});
|
|
1320
|
-
var S =
|
|
1323
|
+
var S = Xe(P, 2);
|
|
1321
1324
|
m = S[0];
|
|
1322
1325
|
b = S[1];
|
|
1323
1326
|
}
|
|
1324
|
-
h =
|
|
1327
|
+
h = nt(y()(m, "transform"), y()(t.arrowStyle, "transform")) && nt((r = b) !== null && r !== void 0 ? r : {}, (n = t.arrowStyleTransformMeta) !== null && n !== void 0 ? n : {});
|
|
1325
1328
|
// If none of the position data has changed, do not set state.
|
|
1326
1329
|
if (d && h) {
|
|
1327
1330
|
return t;
|
|
@@ -1336,27 +1339,29 @@
|
|
|
1336
1339
|
maxWidth: v
|
|
1337
1340
|
};
|
|
1338
1341
|
}));
|
|
1339
|
-
}), [ i, c, g, Ie,
|
|
1342
|
+
}), [ i, c, g, Ie, De, w, Re, A, L, F, _, Ce, Pe.innerHeight, Pe.innerWidth ]);
|
|
1340
1343
|
// these are useMemo rather than useCallback so that ESLint can correctly analyze the dependencies
|
|
1341
1344
|
// see https://github.com/facebook/react/issues/19240#issuecomment-652945246
|
|
1342
1345
|
var Ve = (0, r.useMemo)((function() {
|
|
1343
|
-
return P()(
|
|
1344
|
-
}), [
|
|
1346
|
+
return P()($e.bind(null, true), 0);
|
|
1347
|
+
}), [ $e ]);
|
|
1345
1348
|
var ze = (0, r.useMemo)((function() {
|
|
1346
|
-
return P()(
|
|
1347
|
-
}), [
|
|
1348
|
-
var
|
|
1349
|
-
return P()(
|
|
1349
|
+
return P()($e.bind(null, true), 0);
|
|
1350
|
+
}), [ $e ]);
|
|
1351
|
+
var Ke = (0, r.useMemo)((function() {
|
|
1352
|
+
return P()($e, 0, {
|
|
1350
1353
|
leading: false
|
|
1351
1354
|
});
|
|
1352
|
-
}), [
|
|
1355
|
+
}), [ $e ]);
|
|
1353
1356
|
// this needs to run on every render - equivalent to componentDidUpdate
|
|
1354
|
-
(0, r.
|
|
1357
|
+
(0, r.useLayoutEffect)((function() {
|
|
1355
1358
|
if (!be.current) {
|
|
1356
1359
|
return;
|
|
1357
1360
|
}
|
|
1358
|
-
if (L ||
|
|
1359
|
-
|
|
1361
|
+
if (L || Z) {
|
|
1362
|
+
// SUI-8062: using the unthrottled version of setPlacement() here because to avoid a flash of incorrect placement
|
|
1363
|
+
// we're doing this inside useLayoutEffect() so we're depending on React to batch these updates together
|
|
1364
|
+
$e();
|
|
1360
1365
|
}
|
|
1361
1366
|
}));
|
|
1362
1367
|
(0, r.useEffect)((function() {
|
|
@@ -1368,12 +1373,12 @@
|
|
|
1368
1373
|
(0, r.useEffect)((function() {
|
|
1369
1374
|
// we need to set this to true on every mount because React.StrictMode will call the effect twice
|
|
1370
1375
|
// and we need to ensure that allowAnimationUpdates is true while the component is mounted
|
|
1371
|
-
|
|
1376
|
+
pe.current = true;
|
|
1372
1377
|
return function() {
|
|
1373
|
-
|
|
1378
|
+
Ke.cancel();
|
|
1374
1379
|
Ve.cancel();
|
|
1375
1380
|
ze.cancel();
|
|
1376
|
-
|
|
1381
|
+
pe.current = false;
|
|
1377
1382
|
};
|
|
1378
1383
|
// no dependencies here since this is equivalent to componentDidMount and componentWillUnmount
|
|
1379
1384
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1384,23 +1389,23 @@
|
|
|
1384
1389
|
target: Ce,
|
|
1385
1390
|
eventType: "scroll",
|
|
1386
1391
|
listener: Ve,
|
|
1387
|
-
options:
|
|
1392
|
+
options: rt,
|
|
1388
1393
|
key: "eventListener"
|
|
1389
1394
|
}), n().createElement(j(), {
|
|
1390
|
-
target:
|
|
1395
|
+
target: Pe,
|
|
1391
1396
|
eventType: "resize",
|
|
1392
|
-
listener:
|
|
1397
|
+
listener: Ke,
|
|
1393
1398
|
key: "eventListenerOnWindowResize"
|
|
1394
1399
|
}), n().createElement(j(), {
|
|
1395
|
-
target:
|
|
1400
|
+
target: Pe,
|
|
1396
1401
|
eventType: "scroll",
|
|
1397
1402
|
listener: ze,
|
|
1398
|
-
options:
|
|
1403
|
+
options: rt,
|
|
1399
1404
|
key: "eventListenerOnWindowScroll"
|
|
1400
1405
|
})) : null;
|
|
1401
1406
|
var Ye = (0, r.useCallback)((function() {
|
|
1402
1407
|
// checking allowAnimationUpdates avoids trying to update state after the component has been unmounted - see SUI-3666
|
|
1403
|
-
if (
|
|
1408
|
+
if (pe.current) {
|
|
1404
1409
|
ne(false);
|
|
1405
1410
|
}
|
|
1406
1411
|
}), []);
|
|
@@ -1409,13 +1414,13 @@
|
|
|
1409
1414
|
if (e && X) {
|
|
1410
1415
|
l()(W.takeFocus, e);
|
|
1411
1416
|
}
|
|
1412
|
-
|
|
1417
|
+
qe(R, e);
|
|
1413
1418
|
}), [ R, X ]);
|
|
1414
1419
|
var Ge = (0, r.useCallback)((function(e) {
|
|
1415
1420
|
ge.current = e;
|
|
1416
|
-
|
|
1421
|
+
qe(D, e);
|
|
1417
1422
|
}), [ D ]);
|
|
1418
|
-
var
|
|
1423
|
+
var Je = (0, r.useCallback)((function(e) {
|
|
1419
1424
|
if (be.current) {
|
|
1420
1425
|
if (z) {
|
|
1421
1426
|
(0, W.handleTab)(be.current, e);
|
|
@@ -1433,25 +1438,25 @@
|
|
|
1433
1438
|
}
|
|
1434
1439
|
}
|
|
1435
1440
|
}), [ Te, z ]);
|
|
1436
|
-
var
|
|
1441
|
+
var Ze = (0, r.useCallback)((function(e) {
|
|
1437
1442
|
if (!xe) {
|
|
1438
1443
|
e.stopPropagation();
|
|
1439
1444
|
}
|
|
1440
1445
|
}), [ xe ]);
|
|
1441
|
-
var
|
|
1446
|
+
var tt = (0, r.useMemo)((function() {
|
|
1442
1447
|
return {
|
|
1443
1448
|
opacity: f ? 0 : 1
|
|
1444
1449
|
};
|
|
1445
1450
|
}), [ f ]);
|
|
1446
1451
|
var ft = (0, r.useMemo)((function() {
|
|
1447
|
-
return
|
|
1452
|
+
return _e({
|
|
1448
1453
|
tension: 300,
|
|
1449
1454
|
friction: 20,
|
|
1450
1455
|
clamp: true
|
|
1451
1456
|
}, p);
|
|
1452
1457
|
}), [ p ]);
|
|
1453
1458
|
var st = (0, C.useAnimation)({
|
|
1454
|
-
from:
|
|
1459
|
+
from: tt,
|
|
1455
1460
|
to: we,
|
|
1456
1461
|
// Setting clamp to true will stop animating at the point it hit's it's goal value.
|
|
1457
1462
|
// This will prevent click through while animating out (SUI-6618).
|
|
@@ -1459,7 +1464,7 @@
|
|
|
1459
1464
|
onRest: Ye
|
|
1460
1465
|
});
|
|
1461
1466
|
var pt = (0, r.useMemo)((function() {
|
|
1462
|
-
return
|
|
1467
|
+
return _e(_e({}, fe.outerContainerStyle), st);
|
|
1463
1468
|
}), [ fe.outerContainerStyle, st ]);
|
|
1464
1469
|
var vt = (0, r.useMemo)((function() {
|
|
1465
1470
|
return v()(E === null || E === void 0 ? void 0 : E.filter((function(e) {
|
|
@@ -1473,39 +1478,39 @@
|
|
|
1473
1478
|
open: Oe,
|
|
1474
1479
|
onRequestClose: Te,
|
|
1475
1480
|
key: "Layer"
|
|
1476
|
-
}, Oe && be.current && H && n().createElement(
|
|
1481
|
+
}, Oe && be.current && H && n().createElement(ve, {
|
|
1477
1482
|
anchorRect: fe.anchorPos,
|
|
1478
1483
|
popoverEl: be.current,
|
|
1479
1484
|
popoverPlacement: fe.placement,
|
|
1480
1485
|
ref: H
|
|
1481
|
-
}), Oe && n().createElement(
|
|
1486
|
+
}), Oe && n().createElement(Q, {
|
|
1482
1487
|
"data-test": "outer-popover",
|
|
1483
1488
|
style: pt,
|
|
1484
1489
|
ref: Ge
|
|
1485
|
-
}, n().createElement(
|
|
1490
|
+
}, n().createElement(ee, Fe({
|
|
1486
1491
|
$appearance: h,
|
|
1487
|
-
$boxPadding:
|
|
1492
|
+
$boxPadding: De,
|
|
1488
1493
|
$open: L,
|
|
1489
1494
|
"data-test": "popover",
|
|
1490
1495
|
ref: Ue,
|
|
1491
1496
|
id: I,
|
|
1492
|
-
onKeyDown:
|
|
1493
|
-
}, Y), n().createElement(n().Fragment, null, h === "none" && dt, h !== "none" && !Ae && n().createElement(
|
|
1497
|
+
onKeyDown: Je
|
|
1498
|
+
}, Y), n().createElement(n().Fragment, null, h === "none" && dt, h !== "none" && !Ae && n().createElement(re, {
|
|
1494
1499
|
"data-test": "popover-arrow",
|
|
1495
1500
|
$appearance: h,
|
|
1496
|
-
onClick:
|
|
1501
|
+
onClick: Ze,
|
|
1497
1502
|
ref: me,
|
|
1498
1503
|
style: fe.arrowStyle
|
|
1499
|
-
}), h !== "none" && n().createElement(
|
|
1504
|
+
}), h !== "none" && n().createElement(te, {
|
|
1500
1505
|
$appearance: h,
|
|
1501
|
-
onClick:
|
|
1506
|
+
onClick: Ze
|
|
1502
1507
|
}, dt))))));
|
|
1503
1508
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
/* harmony default export */ const
|
|
1509
|
+
ft.propTypes = tt;
|
|
1510
|
+
ft.possibleCloseReasons = et;
|
|
1511
|
+
/* harmony default export */ const st = ft;
|
|
1507
1512
|
// CONCATENATED MODULE: ./src/Popover/PopoverMenuContext.tsx
|
|
1508
|
-
var
|
|
1513
|
+
var pt = (0, r.createContext)({});
|
|
1509
1514
|
// CONCATENATED MODULE: ./src/Popover/index.ts
|
|
1510
1515
|
module.exports = t;
|
|
1511
1516
|
/******/})();
|