@splunk/react-ui 4.33.0 → 4.35.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/Breadcrumbs.js +20 -29
- package/Button.js +20 -23
- package/ButtonGroup.js +20 -23
- package/ButtonSimple.js +33 -34
- package/CHANGELOG.md +56 -1
- package/Card.js +129 -113
- package/Chip.js +75 -82
- package/CollapsiblePanel.js +281 -264
- package/Color.js +103 -93
- package/ComboBox.js +3 -2
- package/Concertina.js +139 -138
- package/ControlGroup.js +43 -39
- package/DualListbox.js +8 -11
- package/File.js +25 -30
- package/FormRows.js +53 -53
- package/Image.js +13 -13
- package/JSONTree.js +87 -85
- package/List.js +9 -13
- package/MIGRATION.mdx +100 -0
- package/Markdown.js +12 -12
- package/Menu.js +492 -699
- package/Message.js +192 -194
- package/MessageBar.js +104 -104
- package/Modal.js +2 -2
- package/Monogram.js +140 -94
- package/Multiselect.js +45 -49
- package/Paginator.js +8 -8
- package/Popover.js +53 -54
- package/Progress.js +45 -46
- package/RadioBar.js +117 -115
- package/RadioList.js +8 -5
- package/ResultsMenu.js +272 -279
- package/Search.js +197 -199
- package/Select.js +86 -84
- package/Slider.js +9 -9
- package/SplitButton.js +1 -4
- package/StaticContent.js +1 -1
- package/StepBar.js +92 -88
- package/Switch.js +217 -211
- package/TabBar.js +13 -5
- package/Table.js +714 -717
- package/Text.js +94 -83
- package/TextArea.js +162 -163
- package/Tooltip.js +1 -1
- package/package.json +8 -8
- package/stubs-splunkui.d.ts +11 -0
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +0 -1
- package/types/src/Breadcrumbs/Item.d.ts +0 -1
- package/types/src/Card/Card.d.ts +3 -1
- package/types/src/Card/Header.d.ts +22 -5
- package/types/src/Chip/Chip.d.ts +2 -4
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +5 -0
- package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +1 -3
- package/types/src/Color/Color.d.ts +5 -5
- package/types/src/ComboBox/Option.d.ts +0 -1
- package/types/src/List/List.d.ts +2 -4
- package/types/src/Menu/Heading.d.ts +1 -1
- package/types/src/Menu/Item.d.ts +10 -5
- package/types/src/Menu/Menu.d.ts +18 -26
- package/types/src/Menu/MenuContext.d.ts +3 -2
- package/types/src/Menu/docs/examples/Dimmed.d.ts +2 -0
- package/types/src/Monogram/Monogram.d.ts +5 -6
- package/types/src/Multiselect/Option.d.ts +0 -1
- package/types/src/Progress/Progress.d.ts +4 -1
- package/types/src/RadioBar/Option.d.ts +4 -1
- package/types/src/RadioBar/RadioBar.d.ts +6 -4
- package/types/src/RadioBar/docs/examples/MenuBar.d.ts +2 -0
- package/types/src/ResultsMenu/ResultsMenu.d.ts +13 -28
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +3 -5
- package/types/src/Search/Option.d.ts +19 -6
- package/types/src/Search/docs/examples/OptionsLinks.d.ts +2 -0
- package/types/src/Select/Option.d.ts +0 -1
- package/types/src/Select/OptionBase.d.ts +2 -3
- package/types/src/Select/Select.d.ts +2 -2
- package/types/src/Select/SelectBase.d.ts +2 -2
- package/types/src/Table/Body.d.ts +0 -4
- package/types/src/Table/DragHandle.d.ts +1 -2
- package/types/src/Text/Text.d.ts +2 -0
- package/useRovingFocus.js +26 -40
- package/types/src/Select/docs/examples/prisma/Appearance.d.ts +0 -14
package/JSONTree.js
CHANGED
|
@@ -168,10 +168,10 @@
|
|
|
168
168
|
N(r);
|
|
169
169
|
v === null || v === void 0 ? void 0 : v(r, n);
|
|
170
170
|
};
|
|
171
|
-
var
|
|
171
|
+
var U = function e(n) {
|
|
172
172
|
j === null || j === void 0 ? void 0 : j(n, r);
|
|
173
173
|
};
|
|
174
|
-
var
|
|
174
|
+
var B = function e(r) {
|
|
175
175
|
var n;
|
|
176
176
|
r.stopPropagation();
|
|
177
177
|
F === null || F === void 0 ? void 0 : (n = F.current) === null || n === void 0 ? void 0 : n.focus();
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
onClick: function e(r) {
|
|
211
211
|
var n, t;
|
|
212
212
|
J(!_, r);
|
|
213
|
-
|
|
213
|
+
U(r);
|
|
214
214
|
(n = (t = S.props).onClick) === null || n === void 0 ? void 0 : n.call(t, r);
|
|
215
215
|
},
|
|
216
216
|
"aria-expanded": _
|
|
@@ -221,7 +221,7 @@
|
|
|
221
221
|
ref: M,
|
|
222
222
|
tabIndex: q,
|
|
223
223
|
onBlur: H,
|
|
224
|
-
onFocus:
|
|
224
|
+
onFocus: B,
|
|
225
225
|
onKeyDown: z,
|
|
226
226
|
role: "treeitem",
|
|
227
227
|
"aria-labelledby": u,
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
ref: F,
|
|
231
231
|
tabIndex: -1,
|
|
232
232
|
onFocus: X,
|
|
233
|
-
onClick:
|
|
233
|
+
onClick: U
|
|
234
234
|
}, o().createElement(s, null, a), W(), !_ && l), _ && o().createElement(o().Fragment, null, o().createElement(y, {
|
|
235
235
|
role: "group",
|
|
236
236
|
$defaultIndent: C
|
|
@@ -398,7 +398,7 @@
|
|
|
398
398
|
function J(e) {
|
|
399
399
|
return _(e, "0");
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function U(e) {
|
|
402
402
|
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "0";
|
|
403
403
|
var n = _(e, r);
|
|
404
404
|
var t = r;
|
|
@@ -417,11 +417,11 @@
|
|
|
417
417
|
}
|
|
418
418
|
// continue to find its last child recursively
|
|
419
419
|
t = "".concat(t, "-0");
|
|
420
|
-
return
|
|
420
|
+
return U(e, t);
|
|
421
421
|
}
|
|
422
422
|
// CONCATENATED MODULE: ./src/Tree/Tree.tsx
|
|
423
|
-
function
|
|
424
|
-
|
|
423
|
+
function B() {
|
|
424
|
+
B = Object.assign || function(e) {
|
|
425
425
|
for (var r = 1; r < arguments.length; r++) {
|
|
426
426
|
var n = arguments[r];
|
|
427
427
|
for (var t in n) {
|
|
@@ -432,7 +432,7 @@
|
|
|
432
432
|
}
|
|
433
433
|
return e;
|
|
434
434
|
};
|
|
435
|
-
return
|
|
435
|
+
return B.apply(this, arguments);
|
|
436
436
|
}
|
|
437
437
|
function H(e, r) {
|
|
438
438
|
return Q(e) || G(e, r) || z(e, r) || X();
|
|
@@ -555,7 +555,7 @@
|
|
|
555
555
|
|
|
556
556
|
case "end":
|
|
557
557
|
r.preventDefault();
|
|
558
|
-
v(
|
|
558
|
+
v(U(s));
|
|
559
559
|
break;
|
|
560
560
|
|
|
561
561
|
default:
|
|
@@ -589,7 +589,7 @@
|
|
|
589
589
|
itemPaths: s,
|
|
590
590
|
focusedItemId: d
|
|
591
591
|
}
|
|
592
|
-
}, o().createElement(y,
|
|
592
|
+
}, o().createElement(y, B({
|
|
593
593
|
role: "tree",
|
|
594
594
|
$defaultIndent: a
|
|
595
595
|
}, i), r));
|
|
@@ -705,7 +705,7 @@
|
|
|
705
705
|
n.r(t);
|
|
706
706
|
// EXPORTS
|
|
707
707
|
n.d(t, {
|
|
708
|
-
default: () => /* reexport */
|
|
708
|
+
default: () => /* reexport */ ke
|
|
709
709
|
});
|
|
710
710
|
// EXTERNAL MODULE: external "react"
|
|
711
711
|
var e = n(9497);
|
|
@@ -722,9 +722,9 @@
|
|
|
722
722
|
// EXTERNAL MODULE: external "@splunk/themes"
|
|
723
723
|
var f = n(3563);
|
|
724
724
|
// CONCATENATED MODULE: ./src/JSONTree/JSONTreeStyles.ts
|
|
725
|
-
var d = (0, u.css)([ "", ";", "
|
|
725
|
+
var d = (0, u.css)([ "", ";", ";" ], f.mixins.reset("block"), f.mixins.typography({
|
|
726
726
|
family: "monospace"
|
|
727
|
-
})
|
|
727
|
+
}));
|
|
728
728
|
var v = c().code.withConfig({
|
|
729
729
|
displayName: "JSONTreeStyles__StyledScrollCode",
|
|
730
730
|
componentId: "vrdt21-0"
|
|
@@ -916,8 +916,8 @@
|
|
|
916
916
|
const $ = require("@splunk/react-ui/Clickable");
|
|
917
917
|
var J = n.n($);
|
|
918
918
|
// CONCATENATED MODULE: external "@splunk/react-ui/Tooltip"
|
|
919
|
-
const
|
|
920
|
-
var
|
|
919
|
+
const U = require("@splunk/react-ui/Tooltip");
|
|
920
|
+
var B = n.n(U);
|
|
921
921
|
// CONCATENATED MODULE: ./src/JSONTree/JSONTreeItemStyles.ts
|
|
922
922
|
var H = {
|
|
923
923
|
string: f.variables.syntaxTeal,
|
|
@@ -928,43 +928,45 @@
|
|
|
928
928
|
};
|
|
929
929
|
var X = (0, u.css)([ "word-break:break-word;word-wrap:break-word;" ]);
|
|
930
930
|
var z = (0, u.css)([ "white-space:nowrap;" ]);
|
|
931
|
-
var W =
|
|
932
|
-
displayName: "JSONTreeItemStyles__StyledValue",
|
|
933
|
-
componentId: "o558h3-0"
|
|
934
|
-
})([ "color:", ";", ";" ], (function(e) {
|
|
931
|
+
var W = (0, u.css)([ "color:", ";", ";" ], (function(e) {
|
|
935
932
|
var r = e.valueType;
|
|
936
933
|
return H[r];
|
|
937
934
|
}), (function(e) {
|
|
938
935
|
var r = e.overflowType;
|
|
939
936
|
return r === "wrap" ? X : z;
|
|
940
937
|
}));
|
|
941
|
-
var G = c()
|
|
938
|
+
var G = c().span.withConfig({
|
|
939
|
+
displayName: "JSONTreeItemStyles__StyledValue",
|
|
940
|
+
componentId: "o558h3-0"
|
|
941
|
+
})([ "", "" ], W);
|
|
942
|
+
var Q = c()(J()).withConfig({
|
|
942
943
|
displayName: "JSONTreeItemStyles__StyledValueInteractiveClickable",
|
|
943
944
|
componentId: "o558h3-1"
|
|
944
|
-
})([ "font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], f.variables.focusColor, (0,
|
|
945
|
+
})([ "", " font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], W, f.variables.focusColor, (0,
|
|
945
946
|
f.pick)({
|
|
946
947
|
enterprise: f.variables.backgroundColorHover,
|
|
947
948
|
prisma: f.variables.interactiveColorOverlayHover
|
|
948
949
|
}));
|
|
949
|
-
var
|
|
950
|
-
displayName: "JSONTreeItemStyles__StyledProperty",
|
|
951
|
-
componentId: "o558h3-2"
|
|
952
|
-
})([ "font-weight:bold;color:", ";" ], (0, f.pick)({
|
|
950
|
+
var Y = (0, u.css)([ "font-weight:bold;color:", ";" ], (0, f.pick)({
|
|
953
951
|
enterprise: {
|
|
954
952
|
dark: "#ec9f98",
|
|
955
953
|
light: f.variables.syntaxRed
|
|
956
954
|
},
|
|
957
955
|
prisma: f.variables.syntaxRed
|
|
958
956
|
}));
|
|
959
|
-
var
|
|
957
|
+
var Z = c().span.withConfig({
|
|
958
|
+
displayName: "JSONTreeItemStyles__StyledProperty",
|
|
959
|
+
componentId: "o558h3-2"
|
|
960
|
+
})([ "", "" ], Y);
|
|
961
|
+
var ee = c()(J()).withConfig({
|
|
960
962
|
displayName: "JSONTreeItemStyles__StyledPropertyInteractiveClickable",
|
|
961
963
|
componentId: "o558h3-3"
|
|
962
|
-
})([ "font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], f.variables.focusColor, (0,
|
|
964
|
+
})([ "", " font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], Y, f.variables.focusColor, (0,
|
|
963
965
|
f.pick)({
|
|
964
966
|
enterprise: f.variables.backgroundColorHover,
|
|
965
967
|
prisma: f.variables.interactiveColorOverlayHover
|
|
966
968
|
}));
|
|
967
|
-
var
|
|
969
|
+
var re = c()(J()).withConfig({
|
|
968
970
|
displayName: "JSONTreeItemStyles__StyledExpandLinkClickable",
|
|
969
971
|
componentId: "o558h3-4"
|
|
970
972
|
})([ "cursor:pointer;color:", ";font-family:inherit;&:hover{background-color:", ";text-decoration:none;}&:focus{box-shadow:", ";&:active{box-shadow:none;}}", "" ], (0,
|
|
@@ -980,52 +982,52 @@
|
|
|
980
982
|
}), f.variables.focusShadowInset, (0, f.pick)({
|
|
981
983
|
prisma: (0, u.css)([ "border-radius:", ";" ], f.variables.borderRadius)
|
|
982
984
|
}));
|
|
983
|
-
var
|
|
985
|
+
var ne = c()(B()).withConfig({
|
|
984
986
|
displayName: "JSONTreeItemStyles__StyledTooltip",
|
|
985
987
|
componentId: "o558h3-5"
|
|
986
988
|
})([ "font-family:", ";" ], f.variables.monoFontFamily);
|
|
987
989
|
// CONCATENATED MODULE: ./src/JSONTree/renderTreeItems.tsx
|
|
988
|
-
function
|
|
990
|
+
function te(e) {
|
|
989
991
|
"@babel/helpers - typeof";
|
|
990
992
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
991
|
-
|
|
993
|
+
te = function e(r) {
|
|
992
994
|
return typeof r;
|
|
993
995
|
};
|
|
994
996
|
} else {
|
|
995
|
-
|
|
997
|
+
te = function e(r) {
|
|
996
998
|
return r && typeof Symbol === "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
|
|
997
999
|
};
|
|
998
1000
|
}
|
|
999
|
-
return
|
|
1001
|
+
return te(e);
|
|
1000
1002
|
}
|
|
1001
|
-
function
|
|
1002
|
-
return
|
|
1003
|
+
function oe(e) {
|
|
1004
|
+
return ue(e) || le(e) || ie(e) || ae();
|
|
1003
1005
|
}
|
|
1004
|
-
function
|
|
1006
|
+
function ae() {
|
|
1005
1007
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1006
1008
|
}
|
|
1007
|
-
function
|
|
1009
|
+
function ie(e, r) {
|
|
1008
1010
|
if (!e) return;
|
|
1009
|
-
if (typeof e === "string") return
|
|
1011
|
+
if (typeof e === "string") return ce(e, r);
|
|
1010
1012
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
1011
1013
|
if (n === "Object" && e.constructor) n = e.constructor.name;
|
|
1012
1014
|
if (n === "Map" || n === "Set") return Array.from(e);
|
|
1013
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
1015
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ce(e, r);
|
|
1014
1016
|
}
|
|
1015
|
-
function
|
|
1017
|
+
function le(e) {
|
|
1016
1018
|
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
|
|
1017
1019
|
}
|
|
1018
|
-
function
|
|
1019
|
-
if (Array.isArray(e)) return
|
|
1020
|
+
function ue(e) {
|
|
1021
|
+
if (Array.isArray(e)) return ce(e);
|
|
1020
1022
|
}
|
|
1021
|
-
function
|
|
1023
|
+
function ce(e, r) {
|
|
1022
1024
|
if (r == null || r > e.length) r = e.length;
|
|
1023
1025
|
for (var n = 0, t = new Array(r); n < r; n++) {
|
|
1024
1026
|
t[n] = e[n];
|
|
1025
1027
|
}
|
|
1026
1028
|
return t;
|
|
1027
1029
|
}
|
|
1028
|
-
function
|
|
1030
|
+
function fe(n) {
|
|
1029
1031
|
var t = n.defaultOpen, o = t === void 0 ? false : t, a = n.expandChildren, i = a === void 0 ? false : a, u = n.expandChildrenOnShiftKey, c = u === void 0 ? false : u, f = n.indent, d = f === void 0 ? 4 : f, v = n.indentLevel, s = v === void 0 ? 1 : v, p = n.obj, b = n.onClickKey, h = n.onClickValue, S = n.overflow, k = S === void 0 ? "scroll" : S, x = n.path, I = x === void 0 ? [] : x, P = n.shift, R = n.updateShift;
|
|
1030
1032
|
var K = y()(Array(s), j()(" ", d));
|
|
1031
1033
|
var _;
|
|
@@ -1049,7 +1051,7 @@
|
|
|
1049
1051
|
var q = function e(r, n) {
|
|
1050
1052
|
var t, o;
|
|
1051
1053
|
// When rendering a single value key is not present, here we prevent `[undefined]` in path
|
|
1052
|
-
var a = n !== undefined ? [].concat(
|
|
1054
|
+
var a = n !== undefined ? [].concat(oe(I), [ n ]) : oe(I);
|
|
1053
1055
|
var i = ".".concat(a.join("."));
|
|
1054
1056
|
(t = N) === null || t === void 0 ? void 0 : (o = t.current) === null || o === void 0 ? void 0 : o.focus();
|
|
1055
1057
|
b === null || b === void 0 ? void 0 : b(r, {
|
|
@@ -1060,7 +1062,7 @@
|
|
|
1060
1062
|
var V = function e(r, n) {
|
|
1061
1063
|
var t, o;
|
|
1062
1064
|
// When rendering a single value key is not present, here we prevent `[undefined]` in path
|
|
1063
|
-
var a = n !== undefined ? [].concat(
|
|
1065
|
+
var a = n !== undefined ? [].concat(oe(I), [ n ]) : oe(I);
|
|
1064
1066
|
var i = ".".concat(a.join("."));
|
|
1065
1067
|
(t = _) === null || t === void 0 ? void 0 : (o = t.current) === null || o === void 0 ? void 0 : o.focus();
|
|
1066
1068
|
h === null || h === void 0 ? void 0 : h(r, {
|
|
@@ -1088,7 +1090,7 @@
|
|
|
1088
1090
|
var i = o ? "[-]" : "[+]";
|
|
1089
1091
|
var l = o ? (0, E._)("Collapse all") : (0, E._)("Shift click to expand all");
|
|
1090
1092
|
var u = (0, e.useRef)(null);
|
|
1091
|
-
var f = r().createElement(
|
|
1093
|
+
var f = r().createElement(re, {
|
|
1092
1094
|
elementRef: u,
|
|
1093
1095
|
tabIndex: -1,
|
|
1094
1096
|
onClick: function e(r) {
|
|
@@ -1099,7 +1101,7 @@
|
|
|
1099
1101
|
}, " ", i, " ");
|
|
1100
1102
|
if (c && a) {
|
|
1101
1103
|
return {
|
|
1102
|
-
expandLink: r().createElement(
|
|
1104
|
+
expandLink: r().createElement(ne, {
|
|
1103
1105
|
contentRelationship: "description",
|
|
1104
1106
|
openDelay: "secondary",
|
|
1105
1107
|
defaultPlacement: "above",
|
|
@@ -1131,7 +1133,7 @@
|
|
|
1131
1133
|
// isObject is true for arrays
|
|
1132
1134
|
u = m()(o) ? "[]" : "{}";
|
|
1133
1135
|
} else {
|
|
1134
|
-
u =
|
|
1136
|
+
u = fe({
|
|
1135
1137
|
defaultOpen: i === true,
|
|
1136
1138
|
expandChildren: i,
|
|
1137
1139
|
expandChildrenOnShiftKey: c,
|
|
@@ -1139,7 +1141,7 @@
|
|
|
1139
1141
|
onClickValue: h,
|
|
1140
1142
|
overflow: k,
|
|
1141
1143
|
obj: o,
|
|
1142
|
-
path: a !== undefined ? [].concat(
|
|
1144
|
+
path: a !== undefined ? [].concat(oe(I), [ a ]) : oe(I),
|
|
1143
1145
|
indentLevel: s + 1,
|
|
1144
1146
|
shift: P,
|
|
1145
1147
|
updateShift: R
|
|
@@ -1147,10 +1149,10 @@
|
|
|
1147
1149
|
}
|
|
1148
1150
|
if (l()(u) || w()(u)) {
|
|
1149
1151
|
var d = o === null ? "null" : // TS: bigint, function, symbol are prevented by JSONElement type
|
|
1150
|
-
|
|
1152
|
+
te(o);
|
|
1151
1153
|
if (h) {
|
|
1152
1154
|
return {
|
|
1153
|
-
representation: r().createElement(
|
|
1155
|
+
representation: r().createElement(Q, {
|
|
1154
1156
|
elementRef: f,
|
|
1155
1157
|
valueType: d,
|
|
1156
1158
|
overflowType: k,
|
|
@@ -1167,7 +1169,7 @@
|
|
|
1167
1169
|
};
|
|
1168
1170
|
}
|
|
1169
1171
|
return {
|
|
1170
|
-
representation: r().createElement(
|
|
1172
|
+
representation: r().createElement(G, {
|
|
1171
1173
|
valueType: d,
|
|
1172
1174
|
overflowType: k
|
|
1173
1175
|
}, u)
|
|
@@ -1177,11 +1179,11 @@
|
|
|
1177
1179
|
representation: u
|
|
1178
1180
|
};
|
|
1179
1181
|
};
|
|
1180
|
-
var
|
|
1182
|
+
var U = function n(t) {
|
|
1181
1183
|
var o = (0, e.useRef)(null);
|
|
1182
1184
|
if (b) {
|
|
1183
1185
|
return {
|
|
1184
|
-
propertyElement: r().createElement("span", null, r().createElement(
|
|
1186
|
+
propertyElement: r().createElement("span", null, r().createElement(ee, {
|
|
1185
1187
|
elementRef: o,
|
|
1186
1188
|
tabIndex: -1,
|
|
1187
1189
|
onClick: function e(r) {
|
|
@@ -1196,11 +1198,11 @@
|
|
|
1196
1198
|
};
|
|
1197
1199
|
}
|
|
1198
1200
|
return {
|
|
1199
|
-
propertyElement: r().createElement("span", null, r().createElement(
|
|
1201
|
+
propertyElement: r().createElement("span", null, r().createElement(Z, null, t), ":", " ")
|
|
1200
1202
|
};
|
|
1201
1203
|
};
|
|
1202
1204
|
if (O()(p) && !g()(p) || m()(p) && p.length > 0) {
|
|
1203
|
-
var
|
|
1205
|
+
var B = C()(p).map((function(e, n, t) {
|
|
1204
1206
|
var o = p[e];
|
|
1205
1207
|
// TS: should be safe based on (recursive) JSONElement type
|
|
1206
1208
|
var a = m()(p) ? parseInt(e, 10) : e;
|
|
@@ -1209,7 +1211,7 @@
|
|
|
1209
1211
|
key: a,
|
|
1210
1212
|
value: o
|
|
1211
1213
|
}), u = l.representation, c = l.clickableValRef;
|
|
1212
|
-
var f = !m()(p) ?
|
|
1214
|
+
var f = !m()(p) ? U(a) : {
|
|
1213
1215
|
propertyElement: undefined,
|
|
1214
1216
|
clickableKeyRef: undefined
|
|
1215
1217
|
}, d = f.propertyElement, v = f.clickableKeyRef;
|
|
@@ -1247,10 +1249,10 @@
|
|
|
1247
1249
|
value: p,
|
|
1248
1250
|
index: 0,
|
|
1249
1251
|
renderExpandLink: $,
|
|
1250
|
-
representation:
|
|
1252
|
+
representation: B
|
|
1251
1253
|
});
|
|
1252
1254
|
}
|
|
1253
|
-
return
|
|
1255
|
+
return B;
|
|
1254
1256
|
}
|
|
1255
1257
|
// edge case: a single number/string/boolean being rendered (still valid JSON)
|
|
1256
1258
|
var X = J({
|
|
@@ -1264,8 +1266,8 @@
|
|
|
1264
1266
|
});
|
|
1265
1267
|
}
|
|
1266
1268
|
// CONCATENATED MODULE: ./src/JSONTree/JSONTree.tsx
|
|
1267
|
-
function
|
|
1268
|
-
|
|
1269
|
+
function de() {
|
|
1270
|
+
de = Object.assign || function(e) {
|
|
1269
1271
|
for (var r = 1; r < arguments.length; r++) {
|
|
1270
1272
|
var n = arguments[r];
|
|
1271
1273
|
for (var t in n) {
|
|
@@ -1276,30 +1278,30 @@
|
|
|
1276
1278
|
}
|
|
1277
1279
|
return e;
|
|
1278
1280
|
};
|
|
1279
|
-
return
|
|
1281
|
+
return de.apply(this, arguments);
|
|
1280
1282
|
}
|
|
1281
|
-
function
|
|
1282
|
-
return
|
|
1283
|
+
function ve(e, r) {
|
|
1284
|
+
return me(e) || be(e, r) || pe(e, r) || se();
|
|
1283
1285
|
}
|
|
1284
|
-
function
|
|
1286
|
+
function se() {
|
|
1285
1287
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1286
1288
|
}
|
|
1287
|
-
function
|
|
1289
|
+
function pe(e, r) {
|
|
1288
1290
|
if (!e) return;
|
|
1289
|
-
if (typeof e === "string") return
|
|
1291
|
+
if (typeof e === "string") return ye(e, r);
|
|
1290
1292
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
1291
1293
|
if (n === "Object" && e.constructor) n = e.constructor.name;
|
|
1292
1294
|
if (n === "Map" || n === "Set") return Array.from(e);
|
|
1293
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
1295
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ye(e, r);
|
|
1294
1296
|
}
|
|
1295
|
-
function
|
|
1297
|
+
function ye(e, r) {
|
|
1296
1298
|
if (r == null || r > e.length) r = e.length;
|
|
1297
1299
|
for (var n = 0, t = new Array(r); n < r; n++) {
|
|
1298
1300
|
t[n] = e[n];
|
|
1299
1301
|
}
|
|
1300
1302
|
return t;
|
|
1301
1303
|
}
|
|
1302
|
-
function
|
|
1304
|
+
function be(e, r) {
|
|
1303
1305
|
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
|
|
1304
1306
|
var n = [];
|
|
1305
1307
|
var t = true;
|
|
@@ -1322,12 +1324,12 @@
|
|
|
1322
1324
|
}
|
|
1323
1325
|
return n;
|
|
1324
1326
|
}
|
|
1325
|
-
function
|
|
1327
|
+
function me(e) {
|
|
1326
1328
|
if (Array.isArray(e)) return e;
|
|
1327
1329
|
}
|
|
1328
|
-
function
|
|
1330
|
+
function he(e, r) {
|
|
1329
1331
|
if (e == null) return {};
|
|
1330
|
-
var n =
|
|
1332
|
+
var n = ge(e, r);
|
|
1331
1333
|
var t, o;
|
|
1332
1334
|
if (Object.getOwnPropertySymbols) {
|
|
1333
1335
|
var a = Object.getOwnPropertySymbols(e);
|
|
@@ -1340,7 +1342,7 @@
|
|
|
1340
1342
|
}
|
|
1341
1343
|
return n;
|
|
1342
1344
|
}
|
|
1343
|
-
function
|
|
1345
|
+
function ge(e, r) {
|
|
1344
1346
|
if (e == null) return {};
|
|
1345
1347
|
var n = {};
|
|
1346
1348
|
var t = Object.keys(e);
|
|
@@ -1352,7 +1354,7 @@
|
|
|
1352
1354
|
}
|
|
1353
1355
|
return n;
|
|
1354
1356
|
}
|
|
1355
|
-
var
|
|
1357
|
+
var Se = {
|
|
1356
1358
|
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
1357
1359
|
expandChildren: a().oneOfType([ a().bool, a().oneOf([ "withShiftModifier" ]) ]),
|
|
1358
1360
|
indent: a().number,
|
|
@@ -1364,24 +1366,24 @@
|
|
|
1364
1366
|
};
|
|
1365
1367
|
/**
|
|
1366
1368
|
* Used to visualize a JSON string.
|
|
1367
|
-
*/ function
|
|
1368
|
-
var t = n.elementRef, o = n.expandChildren, a = o === void 0 ? false : o, i = n.indent, u = i === void 0 ? 4 : i, c = n.json, f = n.onClickKey, d = n.onClickValue, p = n.overflow, y = p === void 0 ? "scroll" : p, b = n.expandChildrenOnShiftKey, m = b === void 0 ? false : b, h =
|
|
1369
|
+
*/ function we(n) {
|
|
1370
|
+
var t = n.elementRef, o = n.expandChildren, a = o === void 0 ? false : o, i = n.indent, u = i === void 0 ? 4 : i, c = n.json, f = n.onClickKey, d = n.onClickValue, p = n.overflow, y = p === void 0 ? "scroll" : p, b = n.expandChildrenOnShiftKey, m = b === void 0 ? false : b, h = he(n, [ "elementRef", "expandChildren", "indent", "json", "onClickKey", "onClickValue", "overflow", "expandChildrenOnShiftKey" ]);
|
|
1369
1371
|
// @docs-props-type JSONTreePropsBase
|
|
1370
1372
|
var g = l()(c) ? JSON.parse(c) : c;
|
|
1371
1373
|
var S = y === "wrap" ? s : v;
|
|
1372
|
-
var w = (0, e.useState)(undefined), k =
|
|
1374
|
+
var w = (0, e.useState)(undefined), k = ve(w, 2), O = k[0], x = k[1];
|
|
1373
1375
|
var C = function e(r) {
|
|
1374
1376
|
x(r);
|
|
1375
1377
|
};
|
|
1376
1378
|
|
|
1377
|
-
return r().createElement(S,
|
|
1379
|
+
return r().createElement(S, de({
|
|
1378
1380
|
"data-language": "language-json",
|
|
1379
1381
|
"data-test": "json-tree",
|
|
1380
1382
|
ref: t,
|
|
1381
1383
|
role: "tree"
|
|
1382
1384
|
}, h), r().createElement(A["default"], {
|
|
1383
1385
|
defaultIndent: false
|
|
1384
|
-
},
|
|
1386
|
+
}, fe({
|
|
1385
1387
|
defaultOpen: true,
|
|
1386
1388
|
expandChildren: a,
|
|
1387
1389
|
expandChildrenOnShiftKey: m,
|
|
@@ -1394,8 +1396,8 @@
|
|
|
1394
1396
|
updateShift: C
|
|
1395
1397
|
})));
|
|
1396
1398
|
}
|
|
1397
|
-
|
|
1398
|
-
/* harmony default export */ const
|
|
1399
|
+
we.propTypes = Se;
|
|
1400
|
+
/* harmony default export */ const ke = we;
|
|
1399
1401
|
}) // CONCATENATED MODULE: ./src/JSONTree/index.ts
|
|
1400
1402
|
();
|
|
1401
1403
|
module.exports = t;
|
package/List.js
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
64
|
Item: () => /* reexport */ v,
|
|
65
|
-
default: () => /* reexport */
|
|
65
|
+
default: () => /* reexport */ S
|
|
66
66
|
});
|
|
67
67
|
// CONCATENATED MODULE: external "react"
|
|
68
68
|
const r = require("react");
|
|
@@ -194,26 +194,22 @@
|
|
|
194
194
|
ordered: i().bool,
|
|
195
195
|
type: i().oneOf([ "disc", "decimal", "lower-alpha", "upper-alpha" ])
|
|
196
196
|
};
|
|
197
|
-
|
|
198
|
-
type
|
|
199
|
-
};
|
|
200
|
-
function S(e) {
|
|
201
|
-
var t = e.children, r = e.elementRef, o = e.type, i = e.ordered, l = O(e, [ "children", "elementRef", "type", "ordered" ]);
|
|
197
|
+
function j(e) {
|
|
198
|
+
var t = e.children, r = e.elementRef, o = e.type, i = o === void 0 ? "disc" : o, l = e.ordered, a = O(e, [ "children", "elementRef", "type", "ordered" ]);
|
|
202
199
|
// @docs-props-type ListPropsBase
|
|
203
200
|
// Default prop value is "disc", we cannot determine if user or defaultProps is setting the value
|
|
204
201
|
if (false) {}
|
|
205
202
|
|
|
206
203
|
return n().createElement(f, b({
|
|
207
|
-
as:
|
|
204
|
+
as: l || i !== "disc" ? "ol" : "ul",
|
|
208
205
|
"data-test": "list",
|
|
209
206
|
ref: r,
|
|
210
|
-
$listStyleType:
|
|
211
|
-
},
|
|
207
|
+
$listStyleType: l ? "decimal" : i
|
|
208
|
+
}, a), t);
|
|
212
209
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
S
|
|
216
|
-
/* harmony default export */ const P = S;
|
|
210
|
+
j.propTypes = g;
|
|
211
|
+
j.Item = v;
|
|
212
|
+
/* harmony default export */ const S = j;
|
|
217
213
|
// CONCATENATED MODULE: ./src/List/index.ts
|
|
218
214
|
module.exports = t;
|
|
219
215
|
/******/})();
|
package/MIGRATION.mdx
CHANGED
|
@@ -5,6 +5,88 @@ import Table from '@splunk/react-ui/Table';
|
|
|
5
5
|
|
|
6
6
|
This document lists migration guidance for new features and breaking changes.
|
|
7
7
|
|
|
8
|
+
## 4.35.0
|
|
9
|
+
|
|
10
|
+
### Deprecated `Menu`'s `retainFocus` prop
|
|
11
|
+
|
|
12
|
+
#### Change
|
|
13
|
+
|
|
14
|
+
`Menu`'s `retainFocus` prop is deprecated and will be removed in the next major version.
|
|
15
|
+
|
|
16
|
+
#### Context
|
|
17
|
+
|
|
18
|
+
To provide more control over the focus behavior of `Menu`, including the option to opt out of focus management, a new `focusMode` prop has been introduced with the following values:
|
|
19
|
+
- `never`: The menu will never take focus, and the active menu item will not have a focus-like appearance.
|
|
20
|
+
- `normal`: Opts out of focus management. The menu and its children follow the normal focus order of DOM without any interference (no loop, no arrow keys, multiple tab stops).
|
|
21
|
+
- `roving` (original `retainFocus={false}`): Does not retain focus inside the menu. There is one tab stop of menu. Uses up/down arrow keys to navigate and loop inside the menu.
|
|
22
|
+
|
|
23
|
+
The original `retainFocus={true}` is no longer supported due to its poor user experience and accessibility issues:
|
|
24
|
+
* If the Menu is used standalone, it traps the tab navigation within the Menu, preventing the user from accessing the next element via keyboard navigation.
|
|
25
|
+
* If the Menu is used in a `Dropdown`, it creates multiple tab stops, making navigation inefficient.
|
|
26
|
+
|
|
27
|
+
#### Migration steps
|
|
28
|
+
|
|
29
|
+
* Replace `retainFocus={false}` with `focusMode="roving"`.
|
|
30
|
+
* If `retainFocus={true}` was used, replace it with `focusMode="roving"`. Additionally, convert the corresponding tests with multiple tabs to use arrow key navigation.
|
|
31
|
+
|
|
32
|
+
## 4.34.0
|
|
33
|
+
|
|
34
|
+
### Deprecated `Select`'s `appearance` values of `"flat"`, `"pill"`, and `"toggle"`
|
|
35
|
+
|
|
36
|
+
#### Change
|
|
37
|
+
|
|
38
|
+
`Select`'s `appearance` prop's `"flat"`, `"pill"`, and `"toggle"` values are deprecated and will be removed in the next major version.
|
|
39
|
+
|
|
40
|
+
#### Context
|
|
41
|
+
|
|
42
|
+
The `"pill"` value for `appearance` was only supported in Enterprise theme, and the `"flat"` and `"toggle"` values were only supported in the Prisma theme.
|
|
43
|
+
|
|
44
|
+
As part of our effort to unify behaviors and APIs across themes, we are deprecating these appearances.
|
|
45
|
+
|
|
46
|
+
#### Migration steps
|
|
47
|
+
|
|
48
|
+
For Enterprise themes:
|
|
49
|
+
* the `"pill"` value can be replaced with `"subtle"` with no other changes.
|
|
50
|
+
|
|
51
|
+
For Prisma themes:
|
|
52
|
+
* the `"flat"` appearance can be replaced by `"secondary"` or `"subtle"` depending on the context in which it appears.
|
|
53
|
+
* the `"toggle"` appearance can be replaced with `"default"`.
|
|
54
|
+
|
|
55
|
+
### Improved `Card.Header` accessibility when rendering actions
|
|
56
|
+
|
|
57
|
+
#### Change
|
|
58
|
+
|
|
59
|
+
* New `actions` prop to render card actions.
|
|
60
|
+
* Default to rendering the container element as an `article` tag instead of a `div`.
|
|
61
|
+
* New `tag` prop to control the HTML tag used for `Card`'s container element.
|
|
62
|
+
|
|
63
|
+
#### Context
|
|
64
|
+
|
|
65
|
+
Cards rendered the `secondaryActions` button with the same label -- "Actions".
|
|
66
|
+
This would create an ambiguous label (especially when multiple cards are rendered) which may be confusing non-visual users.
|
|
67
|
+
|
|
68
|
+
The new `actions` prop provides full control over the rendering of the actions to make sure the secondary actions button name can be made unique and not ambiguous for assistive technology users.
|
|
69
|
+
|
|
70
|
+
Cards used a `div` as the container element which did not provide any semantic grouping of the content.
|
|
71
|
+
The new `article` container element provides semantic clarity, improves accessibility, and future-proofs the code, as it clearly denotes self-contained, independently distributable content, which `div` does not.
|
|
72
|
+
|
|
73
|
+
[MDN - Article Role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/article_role)
|
|
74
|
+
|
|
75
|
+
#### Migration steps
|
|
76
|
+
|
|
77
|
+
* Update `Card` to use the new `actions` prop instead of `secondaryActions` and add an unambiguous label for each action:
|
|
78
|
+
|
|
79
|
+
```jsx
|
|
80
|
+
<Card.Header title="My widget" actions={() => <>}>
|
|
81
|
+
<HeaderActions>
|
|
82
|
+
<Button icon={<Star/>} aria-label="Favorite My widget" />
|
|
83
|
+
<Dropdown toggle={<ActionsSecondaryToggle content="More actions for My widget" />}>
|
|
84
|
+
{actionsSecondaryMenuOne}
|
|
85
|
+
</Dropdown>
|
|
86
|
+
</HeaderActions>
|
|
87
|
+
</Card.Header>
|
|
88
|
+
```
|
|
89
|
+
|
|
8
90
|
## 4.33.0
|
|
9
91
|
|
|
10
92
|
### Deprecated `Button`'s `appearance` values of `"flat"`, `"pill"`, and `"toggle"`
|
|
@@ -28,6 +110,24 @@ For Prisma themes:
|
|
|
28
110
|
* the `"flat"` appearance can be replaced by `"secondary"` or `"subtle"` depending on the context in which it appears.
|
|
29
111
|
* the `"toggle"` appearance can be replaced with `"default"`.
|
|
30
112
|
|
|
113
|
+
### Deprecated `CollapsiblePanel`'s `titleWithActions` prop
|
|
114
|
+
|
|
115
|
+
#### Change
|
|
116
|
+
|
|
117
|
+
`CollapsiblePanel`'s `titleWithActions` prop has been deprecated and will be removed in the next major version.
|
|
118
|
+
|
|
119
|
+
#### Context
|
|
120
|
+
|
|
121
|
+
Previously, `titleWithActions` prop allowed for customized interactive elements to be added directly to the `title` prop.
|
|
122
|
+
Now, a new `actions` prop is introduced to reserve the `title` prop for text only. The `actions` prop should contain all customized
|
|
123
|
+
interactive actions that were previously placed in the `title` prop. This ensures that the controls are not read as part of the label,
|
|
124
|
+
while still providing the necessary interactivity.
|
|
125
|
+
|
|
126
|
+
#### Migration steps
|
|
127
|
+
|
|
128
|
+
Remove `CollapsiblePanel`'s `titleWithActions` prop. Extract the actions/interactive elements from the `title` prop
|
|
129
|
+
and move them to the new `actions` prop.
|
|
130
|
+
|
|
31
131
|
## 4.30.0
|
|
32
132
|
|
|
33
133
|
### Deprecated `NavigationProvider`'s `prefix` prop
|