@splunk/react-ui 4.44.1 → 4.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/Code.js +210 -180
- package/Concertina.js +357 -232
- package/File.js +404 -279
- package/JSONTree.js +50 -50
- package/Layer.js +149 -84
- package/Multiselect.js +437 -433
- package/Popover.js +150 -146
- package/Resize.js +234 -109
- package/ResultsMenu.js +49 -45
- package/ScrollContainerContext.js +13 -9
- package/Select.js +278 -274
- package/Slider.js +351 -226
- package/Table.js +1031 -990
- package/TextArea.js +526 -401
- package/Tree.js +43 -43
- package/package.json +4 -4
- package/types/src/Code/Code.d.ts +1 -1
- package/types/src/Table/HeadCell.d.ts +4 -0
- package/types/src/Table/HeadInner.d.ts +3 -1
- package/types/src/Tree/{TreeItem.d.ts → Item.d.ts} +3 -3
- package/types/src/Tree/Tree.d.ts +3 -4
- package/types/src/Tree/TreeContext.d.ts +1 -1
- package/types/src/Tree/index.d.ts +1 -1
package/Popover.js
CHANGED
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
PopoverContext: () => /* reexport */ z,
|
|
65
65
|
PopoverMenuContext: () => /* reexport */ Y,
|
|
66
66
|
PopoverProvider: () => /* reexport */ X,
|
|
67
|
-
default: () => /* reexport */
|
|
67
|
+
default: () => /* reexport */ yt
|
|
68
68
|
});
|
|
69
69
|
// CONCATENATED MODULE: external "react"
|
|
70
70
|
const r = require("react");
|
|
@@ -708,9 +708,11 @@
|
|
|
708
708
|
var e = typeof document !== "undefined" ? document : me;
|
|
709
709
|
return e;
|
|
710
710
|
}
|
|
711
|
+
var ye = be();
|
|
712
|
+
/* harmony default export */ const ge = /* unused pure expression or super */ null && ye;
|
|
711
713
|
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
712
714
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
713
|
-
var
|
|
715
|
+
var we = {
|
|
714
716
|
document: me,
|
|
715
717
|
navigator: {
|
|
716
718
|
userAgent: ""
|
|
@@ -765,20 +767,22 @@
|
|
|
765
767
|
clearTimeout(t);
|
|
766
768
|
}
|
|
767
769
|
};
|
|
768
|
-
function
|
|
769
|
-
var e = typeof window !== "undefined" ? window :
|
|
770
|
+
function Se() {
|
|
771
|
+
var e = typeof window !== "undefined" ? window : we;
|
|
770
772
|
return e;
|
|
771
773
|
}
|
|
774
|
+
var Oe = Se();
|
|
775
|
+
/* harmony default export */ const Pe = /* unused pure expression or super */ null && Oe;
|
|
772
776
|
// CONCATENATED MODULE: ./src/utils/getBoundingClientRect.ts
|
|
773
|
-
function
|
|
777
|
+
function Ee(e) {
|
|
774
778
|
"@babel/helpers - typeof";
|
|
775
|
-
return
|
|
779
|
+
return Ee = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
776
780
|
return typeof e;
|
|
777
781
|
} : function(e) {
|
|
778
782
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
779
|
-
},
|
|
783
|
+
}, Ee(e);
|
|
780
784
|
}
|
|
781
|
-
function
|
|
785
|
+
function Ce(e, t) {
|
|
782
786
|
var r = Object.keys(e);
|
|
783
787
|
if (Object.getOwnPropertySymbols) {
|
|
784
788
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -788,46 +792,46 @@
|
|
|
788
792
|
}
|
|
789
793
|
return r;
|
|
790
794
|
}
|
|
791
|
-
function
|
|
795
|
+
function je(e) {
|
|
792
796
|
for (var t = 1; t < arguments.length; t++) {
|
|
793
797
|
var r = null != arguments[t] ? arguments[t] : {};
|
|
794
|
-
t % 2 ?
|
|
795
|
-
|
|
796
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
798
|
+
t % 2 ? Ce(Object(r), !0).forEach((function(t) {
|
|
799
|
+
xe(e, t, r[t]);
|
|
800
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ce(Object(r)).forEach((function(t) {
|
|
797
801
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
798
802
|
}));
|
|
799
803
|
}
|
|
800
804
|
return e;
|
|
801
805
|
}
|
|
802
|
-
function
|
|
803
|
-
return (t =
|
|
806
|
+
function xe(e, t, r) {
|
|
807
|
+
return (t = ke(t)) in e ? Object.defineProperty(e, t, {
|
|
804
808
|
value: r,
|
|
805
809
|
enumerable: !0,
|
|
806
810
|
configurable: !0,
|
|
807
811
|
writable: !0
|
|
808
812
|
}) : e[t] = r, e;
|
|
809
813
|
}
|
|
810
|
-
function
|
|
811
|
-
var t =
|
|
812
|
-
return "symbol" ==
|
|
814
|
+
function ke(e) {
|
|
815
|
+
var t = Ae(e, "string");
|
|
816
|
+
return "symbol" == Ee(t) ? t : t + "";
|
|
813
817
|
}
|
|
814
|
-
function
|
|
815
|
-
if ("object" !=
|
|
818
|
+
function Ae(e, t) {
|
|
819
|
+
if ("object" != Ee(e) || !e) return e;
|
|
816
820
|
var r = e[Symbol.toPrimitive];
|
|
817
821
|
if (void 0 !== r) {
|
|
818
822
|
var n = r.call(e, t || "default");
|
|
819
|
-
if ("object" !=
|
|
823
|
+
if ("object" != Ee(n)) return n;
|
|
820
824
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
821
825
|
}
|
|
822
826
|
return ("string" === t ? String : Number)(e);
|
|
823
827
|
}
|
|
824
828
|
// Checks if browser is Safari
|
|
825
|
-
function
|
|
829
|
+
function Te() {
|
|
826
830
|
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
827
831
|
}
|
|
828
832
|
// Formats return value to DOMRect
|
|
829
|
-
function
|
|
830
|
-
return
|
|
833
|
+
function We(e) {
|
|
834
|
+
return je(je({}, e), {}, {
|
|
831
835
|
top: e.y,
|
|
832
836
|
left: e.x,
|
|
833
837
|
right: e.x + e.width,
|
|
@@ -841,18 +845,18 @@
|
|
|
841
845
|
* @param {boolean} offsets - Use when position of element relative to the layout viewport offsets are needed for Safari.
|
|
842
846
|
* @returns {Omit<DOMRect, 'toJSON'>}
|
|
843
847
|
* @public
|
|
844
|
-
*/ function
|
|
848
|
+
*/ function Me(e, t) {
|
|
845
849
|
var r, n;
|
|
846
850
|
var o = e.getBoundingClientRect();
|
|
847
|
-
var a =
|
|
851
|
+
var a = Te();
|
|
848
852
|
if (!t || !a) {
|
|
849
853
|
return o;
|
|
850
854
|
}
|
|
851
|
-
var i =
|
|
855
|
+
var i = Se();
|
|
852
856
|
var l = o.left + (((r = i.visualViewport) === null || r === void 0 ? void 0 : r.offsetLeft) || 0);
|
|
853
857
|
var c = o.top + (((n = i.visualViewport) === null || n === void 0 ? void 0 : n.offsetTop) || 0);
|
|
854
858
|
var u = o.width, f = o.height;
|
|
855
|
-
return
|
|
859
|
+
return We({
|
|
856
860
|
width: u,
|
|
857
861
|
height: f,
|
|
858
862
|
x: l,
|
|
@@ -866,7 +870,7 @@
|
|
|
866
870
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
867
871
|
* @param current - The new value of the ref.
|
|
868
872
|
*/
|
|
869
|
-
function
|
|
873
|
+
function qe(e, t) {
|
|
870
874
|
if (e) {
|
|
871
875
|
if (typeof e === "function") {
|
|
872
876
|
e(t);
|
|
@@ -879,16 +883,16 @@
|
|
|
879
883
|
}
|
|
880
884
|
}
|
|
881
885
|
// CONCATENATED MODULE: ./src/Popover/Popover.tsx
|
|
882
|
-
function
|
|
886
|
+
function Re(e) {
|
|
883
887
|
"@babel/helpers - typeof";
|
|
884
|
-
return
|
|
888
|
+
return Re = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
885
889
|
return typeof e;
|
|
886
890
|
} : function(e) {
|
|
887
891
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
888
|
-
},
|
|
892
|
+
}, Re(e);
|
|
889
893
|
}
|
|
890
|
-
function
|
|
891
|
-
return
|
|
894
|
+
function He() {
|
|
895
|
+
return He = Object.assign ? Object.assign.bind() : function(e) {
|
|
892
896
|
for (var t = 1; t < arguments.length; t++) {
|
|
893
897
|
var r = arguments[t];
|
|
894
898
|
for (var n in r) {
|
|
@@ -896,21 +900,21 @@
|
|
|
896
900
|
}
|
|
897
901
|
}
|
|
898
902
|
return e;
|
|
899
|
-
},
|
|
903
|
+
}, He.apply(null, arguments);
|
|
900
904
|
}
|
|
901
|
-
function
|
|
902
|
-
return
|
|
905
|
+
function _e(e) {
|
|
906
|
+
return Le(e) || Ie(e) || Be(e) || De();
|
|
903
907
|
}
|
|
904
|
-
function
|
|
908
|
+
function De() {
|
|
905
909
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
906
910
|
}
|
|
907
|
-
function
|
|
911
|
+
function Ie(e) {
|
|
908
912
|
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
909
913
|
}
|
|
910
|
-
function
|
|
911
|
-
if (Array.isArray(e)) return
|
|
914
|
+
function Le(e) {
|
|
915
|
+
if (Array.isArray(e)) return Ue(e);
|
|
912
916
|
}
|
|
913
|
-
function
|
|
917
|
+
function Fe(e, t) {
|
|
914
918
|
var r = Object.keys(e);
|
|
915
919
|
if (Object.getOwnPropertySymbols) {
|
|
916
920
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -920,38 +924,38 @@
|
|
|
920
924
|
}
|
|
921
925
|
return r;
|
|
922
926
|
}
|
|
923
|
-
function
|
|
927
|
+
function Ne(e) {
|
|
924
928
|
for (var t = 1; t < arguments.length; t++) {
|
|
925
929
|
var r = null != arguments[t] ? arguments[t] : {};
|
|
926
|
-
t % 2 ?
|
|
927
|
-
|
|
928
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
930
|
+
t % 2 ? Fe(Object(r), !0).forEach((function(t) {
|
|
931
|
+
ot(e, t, r[t]);
|
|
932
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Fe(Object(r)).forEach((function(t) {
|
|
929
933
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
930
934
|
}));
|
|
931
935
|
}
|
|
932
936
|
return e;
|
|
933
937
|
}
|
|
934
|
-
function
|
|
935
|
-
return
|
|
938
|
+
function $e(e, t) {
|
|
939
|
+
return Ke(e) || ze(e, t) || Be(e, t) || Ve();
|
|
936
940
|
}
|
|
937
|
-
function
|
|
941
|
+
function Ve() {
|
|
938
942
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
939
943
|
}
|
|
940
|
-
function
|
|
944
|
+
function Be(e, t) {
|
|
941
945
|
if (e) {
|
|
942
|
-
if ("string" == typeof e) return
|
|
946
|
+
if ("string" == typeof e) return Ue(e, t);
|
|
943
947
|
var r = {}.toString.call(e).slice(8, -1);
|
|
944
|
-
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) ?
|
|
948
|
+
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;
|
|
945
949
|
}
|
|
946
950
|
}
|
|
947
|
-
function
|
|
951
|
+
function Ue(e, t) {
|
|
948
952
|
(null == t || t > e.length) && (t = e.length);
|
|
949
953
|
for (var r = 0, n = Array(t); r < t; r++) {
|
|
950
954
|
n[r] = e[r];
|
|
951
955
|
}
|
|
952
956
|
return n;
|
|
953
957
|
}
|
|
954
|
-
function
|
|
958
|
+
function ze(e, t) {
|
|
955
959
|
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
956
960
|
if (null != r) {
|
|
957
961
|
var n, o, a, i, l = [], c = !0, u = !1;
|
|
@@ -973,25 +977,25 @@
|
|
|
973
977
|
return l;
|
|
974
978
|
}
|
|
975
979
|
}
|
|
976
|
-
function
|
|
980
|
+
function Ke(e) {
|
|
977
981
|
if (Array.isArray(e)) return e;
|
|
978
982
|
}
|
|
979
|
-
function
|
|
983
|
+
function Xe(e, t) {
|
|
980
984
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
981
985
|
}
|
|
982
|
-
function
|
|
986
|
+
function Ye(e, t) {
|
|
983
987
|
for (var r = 0; r < t.length; r++) {
|
|
984
988
|
var n = t[r];
|
|
985
989
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
986
|
-
Object.defineProperty(e,
|
|
990
|
+
Object.defineProperty(e, at(n.key), n);
|
|
987
991
|
}
|
|
988
992
|
}
|
|
989
|
-
function
|
|
990
|
-
return t &&
|
|
993
|
+
function Ge(e, t, r) {
|
|
994
|
+
return t && Ye(e.prototype, t), r && Ye(e, r), Object.defineProperty(e, "prototype", {
|
|
991
995
|
writable: !1
|
|
992
996
|
}), e;
|
|
993
997
|
}
|
|
994
|
-
function
|
|
998
|
+
function Je(e, t) {
|
|
995
999
|
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
996
1000
|
e.prototype = Object.create(t && t.prototype, {
|
|
997
1001
|
constructor: {
|
|
@@ -1001,64 +1005,64 @@
|
|
|
1001
1005
|
}
|
|
1002
1006
|
}), Object.defineProperty(e, "prototype", {
|
|
1003
1007
|
writable: !1
|
|
1004
|
-
}), t &&
|
|
1008
|
+
}), t && Qe(e, t);
|
|
1005
1009
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return
|
|
1010
|
+
function Qe(e, t) {
|
|
1011
|
+
return Qe = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
1008
1012
|
return e.__proto__ = t, e;
|
|
1009
|
-
},
|
|
1013
|
+
}, Qe(e, t);
|
|
1010
1014
|
}
|
|
1011
|
-
function
|
|
1012
|
-
var t =
|
|
1015
|
+
function Ze(e) {
|
|
1016
|
+
var t = rt();
|
|
1013
1017
|
return function() {
|
|
1014
|
-
var r, n =
|
|
1018
|
+
var r, n = nt(e);
|
|
1015
1019
|
if (t) {
|
|
1016
|
-
var o =
|
|
1020
|
+
var o = nt(this).constructor;
|
|
1017
1021
|
r = Reflect.construct(n, arguments, o);
|
|
1018
1022
|
} else r = n.apply(this, arguments);
|
|
1019
|
-
return
|
|
1023
|
+
return et(this, r);
|
|
1020
1024
|
};
|
|
1021
1025
|
}
|
|
1022
|
-
function
|
|
1023
|
-
if (t && ("object" ==
|
|
1026
|
+
function et(e, t) {
|
|
1027
|
+
if (t && ("object" == Re(t) || "function" == typeof t)) return t;
|
|
1024
1028
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1025
|
-
return
|
|
1029
|
+
return tt(e);
|
|
1026
1030
|
}
|
|
1027
|
-
function
|
|
1031
|
+
function tt(e) {
|
|
1028
1032
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1029
1033
|
return e;
|
|
1030
1034
|
}
|
|
1031
|
-
function
|
|
1035
|
+
function rt() {
|
|
1032
1036
|
try {
|
|
1033
1037
|
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1034
1038
|
} catch (e) {}
|
|
1035
|
-
return (
|
|
1039
|
+
return (rt = function t() {
|
|
1036
1040
|
return !!e;
|
|
1037
1041
|
})();
|
|
1038
1042
|
}
|
|
1039
|
-
function
|
|
1040
|
-
return
|
|
1043
|
+
function nt(e) {
|
|
1044
|
+
return nt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
1041
1045
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
1042
|
-
},
|
|
1046
|
+
}, nt(e);
|
|
1043
1047
|
}
|
|
1044
|
-
function
|
|
1045
|
-
return (t =
|
|
1048
|
+
function ot(e, t, r) {
|
|
1049
|
+
return (t = at(t)) in e ? Object.defineProperty(e, t, {
|
|
1046
1050
|
value: r,
|
|
1047
1051
|
enumerable: !0,
|
|
1048
1052
|
configurable: !0,
|
|
1049
1053
|
writable: !0
|
|
1050
1054
|
}) : e[t] = r, e;
|
|
1051
1055
|
}
|
|
1052
|
-
function
|
|
1053
|
-
var t =
|
|
1054
|
-
return "symbol" ==
|
|
1056
|
+
function at(e) {
|
|
1057
|
+
var t = it(e, "string");
|
|
1058
|
+
return "symbol" == Re(t) ? t : t + "";
|
|
1055
1059
|
}
|
|
1056
|
-
function
|
|
1057
|
-
if ("object" !=
|
|
1060
|
+
function it(e, t) {
|
|
1061
|
+
if ("object" != Re(e) || !e) return e;
|
|
1058
1062
|
var r = e[Symbol.toPrimitive];
|
|
1059
1063
|
if (void 0 !== r) {
|
|
1060
1064
|
var n = r.call(e, t || "default");
|
|
1061
|
-
if ("object" !=
|
|
1065
|
+
if ("object" != Re(n)) return n;
|
|
1062
1066
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1063
1067
|
}
|
|
1064
1068
|
return ("string" === t ? String : Number)(e);
|
|
@@ -1067,8 +1071,8 @@
|
|
|
1067
1071
|
/** @public */
|
|
1068
1072
|
/** @public */
|
|
1069
1073
|
/** @public */
|
|
1070
|
-
/** @public */ var
|
|
1071
|
-
var
|
|
1074
|
+
/** @public */ var lt = [ "clickAway", "escapeKey", "offScreen", "tabKey" ];
|
|
1075
|
+
var ct = {
|
|
1072
1076
|
align: a().oneOf([ "center", "edge", "theme", "end" ]),
|
|
1073
1077
|
anchor: a().object,
|
|
1074
1078
|
animation: a().bool,
|
|
@@ -1077,7 +1081,7 @@
|
|
|
1077
1081
|
autoCloseWhenOffScreen: a().bool,
|
|
1078
1082
|
canCoverAnchor: a().bool,
|
|
1079
1083
|
children: a().oneOfType([ a().node, a().func ]),
|
|
1080
|
-
closeReasons: a().arrayOf(a().oneOf(
|
|
1084
|
+
closeReasons: a().arrayOf(a().oneOf(lt)),
|
|
1081
1085
|
defaultPlacement: a().oneOf([ "above", "below", "left", "right", "vertical", "horizontal" ]),
|
|
1082
1086
|
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
1083
1087
|
id: a().string,
|
|
@@ -1095,26 +1099,26 @@
|
|
|
1095
1099
|
takeFocus: a().bool,
|
|
1096
1100
|
splunkTheme: a().object
|
|
1097
1101
|
};
|
|
1098
|
-
var
|
|
1102
|
+
var ut = {
|
|
1099
1103
|
align: "theme",
|
|
1100
1104
|
animation: true,
|
|
1101
1105
|
animationConfig: {},
|
|
1102
1106
|
appearance: "normal",
|
|
1103
1107
|
autoCloseWhenOffScreen: true,
|
|
1104
1108
|
canCoverAnchor: false,
|
|
1105
|
-
closeReasons:
|
|
1109
|
+
closeReasons: lt,
|
|
1106
1110
|
defaultPlacement: "below",
|
|
1107
1111
|
open: false,
|
|
1108
1112
|
repositionMode: "flip",
|
|
1109
1113
|
retainFocus: true,
|
|
1110
1114
|
takeFocus: false
|
|
1111
1115
|
};
|
|
1112
|
-
var
|
|
1116
|
+
var ft = {
|
|
1113
1117
|
passive: false,
|
|
1114
1118
|
capture: true
|
|
1115
1119
|
};
|
|
1116
1120
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
1117
|
-
function
|
|
1121
|
+
function st(e, t) {
|
|
1118
1122
|
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
1119
1123
|
return !!e && !!t && p()(e, (function(e, n) {
|
|
1120
1124
|
if (w()(e)) {
|
|
@@ -1123,7 +1127,7 @@
|
|
|
1123
1127
|
return t[n] === e;
|
|
1124
1128
|
}));
|
|
1125
1129
|
}
|
|
1126
|
-
function
|
|
1130
|
+
function pt(e) {
|
|
1127
1131
|
var t = e.anchorPos, r = e.placement, n = e.outerContainerStyle, o = e.outerContainerEl;
|
|
1128
1132
|
if (r === "misaligned") {
|
|
1129
1133
|
return [ {
|
|
@@ -1185,9 +1189,9 @@
|
|
|
1185
1189
|
a[y[r]] = "50%";
|
|
1186
1190
|
return [ a, m ];
|
|
1187
1191
|
}
|
|
1188
|
-
function
|
|
1192
|
+
function ht(e) {
|
|
1189
1193
|
var t = e.anchorEl, r = e.offsets, n = r === void 0 ? false : r, o = e.pointTo;
|
|
1190
|
-
var a =
|
|
1194
|
+
var a = Me(t, n);
|
|
1191
1195
|
var i = {
|
|
1192
1196
|
// these are rounded to avoid causing visual regressions
|
|
1193
1197
|
// they were previously clientWidth and clientHeight which were already rounded
|
|
@@ -1208,11 +1212,11 @@
|
|
|
1208
1212
|
i.center = c ? i.top : a.top + (i.bottom - a.top) / 2;
|
|
1209
1213
|
return i;
|
|
1210
1214
|
}
|
|
1211
|
-
function
|
|
1215
|
+
function dt(e) {
|
|
1212
1216
|
return e !== window && e !== window.document;
|
|
1213
1217
|
}
|
|
1214
|
-
function
|
|
1215
|
-
var r =
|
|
1218
|
+
function vt(e, t) {
|
|
1219
|
+
var r = Se();
|
|
1216
1220
|
if (e.top < 0 || e.top > r.innerHeight || e.left < 0 || e.left > r.innerWidth) {
|
|
1217
1221
|
return true;
|
|
1218
1222
|
}
|
|
@@ -1227,10 +1231,10 @@
|
|
|
1227
1231
|
* `Popover` is used to create layovers such as dropdowns, contextual menus, or tooltips. Use
|
|
1228
1232
|
* this only when the other components don't provide sufficient functionality or control. A controlled
|
|
1229
1233
|
* `Dropdown` covers use cases where you might consider using `Popover` directly.
|
|
1230
|
-
*/ var
|
|
1231
|
-
|
|
1232
|
-
var t =
|
|
1233
|
-
|
|
1234
|
+
*/ var mt = function(e) {
|
|
1235
|
+
Je(r, e);
|
|
1236
|
+
var t = Ze(r);
|
|
1237
|
+
Ge(r, null, [ {
|
|
1234
1238
|
key: "getDerivedStateFromProps",
|
|
1235
1239
|
// @docs-props-type PopoverPropsBase
|
|
1236
1240
|
value: function e(t, r) {
|
|
@@ -1245,16 +1249,16 @@
|
|
|
1245
1249
|
} ]);
|
|
1246
1250
|
function r(e) {
|
|
1247
1251
|
var n;
|
|
1248
|
-
|
|
1252
|
+
Xe(this, r);
|
|
1249
1253
|
n = t.call(this, e);
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
var t =
|
|
1254
|
+
ot(tt(n), "outerContainerEl", null);
|
|
1255
|
+
ot(tt(n), "innerContainerEl", null);
|
|
1256
|
+
ot(tt(n), "arrow", null);
|
|
1257
|
+
ot(tt(n), "handleScroll", void 0);
|
|
1258
|
+
ot(tt(n), "handleWindowScroll", void 0);
|
|
1259
|
+
ot(tt(n), "allowAnimationUpdates", true);
|
|
1260
|
+
ot(tt(n), "setPlacement", (function(e) {
|
|
1261
|
+
var t = Se();
|
|
1258
1262
|
n.setState((function(r) {
|
|
1259
1263
|
var o = n.props, a = o.align, i = o.anchor, l = o.autoCloseWhenOffScreen, c = o.canCoverAnchor, u = o.defaultPlacement, f = o.open, s = o.pointTo, p = o.repositionMode, h = o.splunkTheme;
|
|
1260
1264
|
var d = n.context || t;
|
|
@@ -1264,16 +1268,16 @@
|
|
|
1264
1268
|
if (false) {}
|
|
1265
1269
|
return null;
|
|
1266
1270
|
}
|
|
1267
|
-
var m =
|
|
1271
|
+
var m = ht({
|
|
1268
1272
|
anchorEl: r.anchorEl,
|
|
1269
1273
|
pointTo: s
|
|
1270
1274
|
});
|
|
1271
|
-
var b =
|
|
1275
|
+
var b = ht({
|
|
1272
1276
|
anchorEl: r.anchorEl,
|
|
1273
1277
|
offsets: true,
|
|
1274
1278
|
pointTo: s
|
|
1275
1279
|
});
|
|
1276
|
-
var y =
|
|
1280
|
+
var y = dt(d) ? ht({
|
|
1277
1281
|
anchorEl: d,
|
|
1278
1282
|
pointTo: s
|
|
1279
1283
|
}) : undefined;
|
|
@@ -1296,22 +1300,22 @@
|
|
|
1296
1300
|
windowWidth: t.innerWidth,
|
|
1297
1301
|
windowHeight: t.innerHeight
|
|
1298
1302
|
}), O = S.placement, P = S.outerContainerStyle, E = S.maxHeight, C = S.maxWidth;
|
|
1299
|
-
var x =
|
|
1303
|
+
var x = st(b, r.anchorPos) && st(P, r.outerContainerStyle) && O === r.placement && E === r.maxHeight && C === r.maxWidth;
|
|
1300
1304
|
var k = true;
|
|
1301
1305
|
var A = {};
|
|
1302
1306
|
var T;
|
|
1303
1307
|
if (n.arrow) {
|
|
1304
1308
|
var W, M;
|
|
1305
|
-
var q =
|
|
1309
|
+
var q = pt({
|
|
1306
1310
|
anchorPos: b,
|
|
1307
1311
|
outerContainerStyle: P,
|
|
1308
1312
|
placement: O,
|
|
1309
1313
|
outerContainerEl: n.outerContainerEl
|
|
1310
1314
|
});
|
|
1311
|
-
var R =
|
|
1315
|
+
var R = $e(q, 2);
|
|
1312
1316
|
A = R[0];
|
|
1313
1317
|
T = R[1];
|
|
1314
|
-
k =
|
|
1318
|
+
k = st(j()(A, "transform"), j()(r.arrowStyle, "transform")) && st((W = T) !== null && W !== void 0 ? W : {}, (M = r.arrowStyleTransformMeta) !== null && M !== void 0 ? M : {});
|
|
1315
1319
|
}
|
|
1316
1320
|
// If none of the position data has changed, do not set state.
|
|
1317
1321
|
if (x && k) {
|
|
@@ -1328,10 +1332,10 @@
|
|
|
1328
1332
|
};
|
|
1329
1333
|
}));
|
|
1330
1334
|
}));
|
|
1331
|
-
|
|
1335
|
+
ot(tt(n), "handleArrowMount", (function(e) {
|
|
1332
1336
|
n.arrow = e;
|
|
1333
1337
|
}));
|
|
1334
|
-
|
|
1338
|
+
ot(tt(n), "handleNewAnchor", (function(e) {
|
|
1335
1339
|
var t = n.props.pointTo;
|
|
1336
1340
|
var r;
|
|
1337
1341
|
if (e && !(e instanceof HTMLElement)) {
|
|
@@ -1341,7 +1345,7 @@
|
|
|
1341
1345
|
} else {
|
|
1342
1346
|
r = e !== null && e !== void 0 ? e : undefined;
|
|
1343
1347
|
}
|
|
1344
|
-
var o = r ?
|
|
1348
|
+
var o = r ? ht({
|
|
1345
1349
|
anchorEl: r,
|
|
1346
1350
|
pointTo: t
|
|
1347
1351
|
}) : undefined;
|
|
@@ -1351,18 +1355,18 @@
|
|
|
1351
1355
|
});
|
|
1352
1356
|
// eslint-disable-line react/no-unused-state
|
|
1353
1357
|
}));
|
|
1354
|
-
|
|
1358
|
+
ot(tt(n), "handleInnerContainerMount", (function(e) {
|
|
1355
1359
|
n.innerContainerEl = e;
|
|
1356
1360
|
if (e && n.props.takeFocus) {
|
|
1357
1361
|
f()(D.takeFocus, e);
|
|
1358
1362
|
}
|
|
1359
|
-
|
|
1363
|
+
qe(n.props.elementRef, e);
|
|
1360
1364
|
}));
|
|
1361
|
-
|
|
1365
|
+
ot(tt(n), "handleOuterContainerMount", (function(e) {
|
|
1362
1366
|
n.outerContainerEl = e;
|
|
1363
|
-
|
|
1367
|
+
qe(n.props.outerRef, e);
|
|
1364
1368
|
}));
|
|
1365
|
-
|
|
1369
|
+
ot(tt(n), "handleTab", (function(e) {
|
|
1366
1370
|
if (n.innerContainerEl) {
|
|
1367
1371
|
if (n.props.retainFocus) {
|
|
1368
1372
|
(0, D.handleTab)(n.innerContainerEl, e);
|
|
@@ -1380,20 +1384,20 @@
|
|
|
1380
1384
|
}
|
|
1381
1385
|
}
|
|
1382
1386
|
}));
|
|
1383
|
-
|
|
1387
|
+
ot(tt(n), "handleRequestClose", (function(e) {
|
|
1384
1388
|
if (n.props.open) {
|
|
1385
1389
|
n.requestClose(e);
|
|
1386
1390
|
}
|
|
1387
1391
|
}));
|
|
1388
|
-
|
|
1392
|
+
ot(tt(n), "handleAnimationEnd", (function() {
|
|
1389
1393
|
if (n.allowAnimationUpdates) {
|
|
1390
1394
|
n.setState({
|
|
1391
1395
|
animating: false
|
|
1392
1396
|
});
|
|
1393
1397
|
}
|
|
1394
1398
|
}));
|
|
1395
|
-
n.handleScroll = k()(n.setPlacement.bind(
|
|
1396
|
-
n.handleWindowScroll = k()(n.setPlacement.bind(
|
|
1399
|
+
n.handleScroll = k()(n.setPlacement.bind(tt(n), true), 0);
|
|
1400
|
+
n.handleWindowScroll = k()(n.setPlacement.bind(tt(n), true), 0);
|
|
1397
1401
|
n.setPlacement = k()(n.setPlacement, 0, {
|
|
1398
1402
|
leading: false
|
|
1399
1403
|
});
|
|
@@ -1403,7 +1407,7 @@
|
|
|
1403
1407
|
};
|
|
1404
1408
|
return n;
|
|
1405
1409
|
}
|
|
1406
|
-
|
|
1410
|
+
Ge(r, [ {
|
|
1407
1411
|
key: "componentDidMount",
|
|
1408
1412
|
value: function e() {
|
|
1409
1413
|
this.handleNewAnchor(this.props.anchor);
|
|
@@ -1448,7 +1452,7 @@
|
|
|
1448
1452
|
}, {
|
|
1449
1453
|
key: "autoCloseWhenOffScreen",
|
|
1450
1454
|
value: function e(t, r) {
|
|
1451
|
-
var n =
|
|
1455
|
+
var n = vt(t, r);
|
|
1452
1456
|
if (n) {
|
|
1453
1457
|
this.requestClose({
|
|
1454
1458
|
reason: "offScreen"
|
|
@@ -1493,7 +1497,7 @@
|
|
|
1493
1497
|
} : {
|
|
1494
1498
|
opacity: 1
|
|
1495
1499
|
};
|
|
1496
|
-
var W =
|
|
1500
|
+
var W = Se();
|
|
1497
1501
|
var q = p || m;
|
|
1498
1502
|
var H = this.context || W;
|
|
1499
1503
|
var _ = H !== W;
|
|
@@ -1503,7 +1507,7 @@
|
|
|
1503
1507
|
target: H,
|
|
1504
1508
|
eventType: "scroll",
|
|
1505
1509
|
listener: this.handleScroll,
|
|
1506
|
-
options:
|
|
1510
|
+
options: ft,
|
|
1507
1511
|
key: "eventListener"
|
|
1508
1512
|
}), n().createElement(M(), {
|
|
1509
1513
|
target: W,
|
|
@@ -1514,7 +1518,7 @@
|
|
|
1514
1518
|
target: W,
|
|
1515
1519
|
eventType: "scroll",
|
|
1516
1520
|
listener: this.handleWindowScroll,
|
|
1517
|
-
options:
|
|
1521
|
+
options: ft,
|
|
1518
1522
|
key: "eventListenerOnWindowScroll"
|
|
1519
1523
|
}) ] : [];
|
|
1520
1524
|
return [].concat(D, [ n().createElement(R(), {
|
|
@@ -1534,7 +1538,7 @@
|
|
|
1534
1538
|
opacity: a ? 0 : 1
|
|
1535
1539
|
},
|
|
1536
1540
|
to: A,
|
|
1537
|
-
config:
|
|
1541
|
+
config: Ne({
|
|
1538
1542
|
tension: 300,
|
|
1539
1543
|
friction: 20,
|
|
1540
1544
|
clamp: true
|
|
@@ -1547,16 +1551,16 @@
|
|
|
1547
1551
|
|
|
1548
1552
|
return n().createElement(ee, {
|
|
1549
1553
|
"data-test": "outer-popover",
|
|
1550
|
-
style:
|
|
1554
|
+
style: Ne(Ne({}, g), e),
|
|
1551
1555
|
ref: t.handleOuterContainerMount
|
|
1552
|
-
}, n().createElement(re,
|
|
1556
|
+
}, n().createElement(re, He({
|
|
1553
1557
|
$appearance: l,
|
|
1554
1558
|
$open: p,
|
|
1555
1559
|
"data-test": "popover",
|
|
1556
1560
|
ref: t.handleInnerContainerMount,
|
|
1557
1561
|
id: s,
|
|
1558
1562
|
onKeyDown: t.handleTab
|
|
1559
|
-
}, j()(t.props, [ "anchor" ].concat(
|
|
1563
|
+
}, j()(t.props, [ "anchor" ].concat(_e(E()(r.propTypes))))), n().createElement(Y.Provider, {
|
|
1560
1564
|
value: {
|
|
1561
1565
|
retainFocus: h
|
|
1562
1566
|
}
|
|
@@ -1574,12 +1578,12 @@
|
|
|
1574
1578
|
} ]);
|
|
1575
1579
|
return r;
|
|
1576
1580
|
}(r.Component);
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
var
|
|
1581
|
-
|
|
1582
|
-
/* harmony default export */ const
|
|
1581
|
+
ot(mt, "contextType", _());
|
|
1582
|
+
ot(mt, "defaultProps", ut);
|
|
1583
|
+
ot(mt, "propTypes", ct);
|
|
1584
|
+
var bt = (0, A.withSplunkTheme)(mt);
|
|
1585
|
+
bt.propTypes = mt.propTypes;
|
|
1586
|
+
/* harmony default export */ const yt = bt;
|
|
1583
1587
|
// CONCATENATED MODULE: ./src/Popover/index.ts
|
|
1584
1588
|
module.exports = t;
|
|
1585
1589
|
/******/})();
|