@splunk/react-ui 4.21.0 → 4.22.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 +425 -325
- package/Anchor.js +147 -117
- package/Animation.js +142 -94
- package/AnimationToggle.js +197 -193
- package/Box.js +145 -118
- package/Breadcrumbs.js +288 -206
- package/Button.js +488 -465
- package/ButtonGroup.js +160 -128
- package/ButtonSimple.js +543 -462
- package/CHANGELOG.md +24 -3
- package/Calendar.js +1111 -1001
- package/Card.js +771 -598
- package/CardLayout.js +205 -147
- package/Chip.js +509 -488
- package/Clickable.js +414 -352
- package/CloseButton.js +165 -142
- package/Code.js +1807 -2084
- package/CollapsiblePanel.js +586 -519
- package/Color.js +1068 -1068
- package/ColumnLayout.js +402 -363
- package/ComboBox.js +903 -794
- package/Concertina.js +997 -802
- package/ControlGroup.js +687 -594
- package/Date.js +567 -547
- package/DefinitionList.js +308 -234
- package/Divider.js +149 -118
- package/Dropdown.js +459 -416
- package/DualListbox.js +1479 -1541
- package/EventListener.js +94 -97
- package/File.js +1051 -969
- package/FormRows.js +883 -696
- package/Heading.js +216 -193
- package/Image.js +446 -402
- package/JSONTree.js +690 -551
- package/Layer.js +437 -410
- package/Link.js +336 -255
- package/List.js +213 -161
- package/Markdown.js +509 -487
- package/Menu.js +1104 -1056
- package/Message.js +475 -441
- package/MessageBar.js +387 -373
- package/Modal.js +810 -634
- package/ModalLayer.js +326 -243
- package/Monogram.js +308 -276
- package/Multiselect.js +3564 -3364
- package/Number.js +729 -687
- package/Paginator.js +510 -449
- package/Paragraph.js +145 -112
- package/Popover.js +1459 -1432
- package/Progress.js +301 -246
- package/RadioBar.js +634 -527
- package/RadioList.js +483 -444
- package/Resize.js +530 -489
- package/ResultsMenu.js +479 -455
- package/ScreenReaderContent.js +142 -111
- package/Scroll.js +595 -456
- package/ScrollContainerContext.js +197 -206
- package/Search.js +756 -650
- package/Select.js +2446 -2345
- package/SidePanel.js +390 -284
- package/Slider.js +680 -676
- package/SlidingPanels.js +639 -503
- package/SplitButton.js +464 -367
- package/StaticContent.js +161 -133
- package/StepBar.js +386 -358
- package/Switch.js +710 -640
- package/TabBar.js +741 -680
- package/TabLayout.js +406 -322
- package/Table.js +4974 -4616
- package/Text.js +1170 -1138
- package/TextArea.js +1102 -1090
- package/Tooltip.js +624 -581
- package/TransitionOpen.js +489 -422
- package/Typography.js +176 -153
- package/WaitSpinner.js +230 -206
- package/package.json +7 -7
- package/types/src/Color/Color.d.ts +0 -1
- package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
- package/types/src/JSONTree/TreeNode.d.ts +5 -0
- package/types/src/RadioBar/RadioBar.d.ts +1 -0
- package/types/src/ResultsMenu/ResultsMenu.d.ts +0 -2
- package/types/src/Select/docs/examples/Icons.d.ts +1 -9
- package/types/src/Slider/Slider.d.ts +1 -0
- package/types/src/TabBar/Tab.d.ts +10 -1
- package/types/src/TabBar/TabBar.d.ts +4 -2
- package/types/src/Table/Head.d.ts +7 -3
- package/types/src/Table/Table.d.ts +3 -2
- package/types/src/Table/TableContext.d.ts +2 -0
- package/useForceUpdate.js +112 -82
- package/useKeyPress.js +74 -71
- package/usePrevious.js +65 -65
- package/useRovingFocus.js +122 -138
package/Menu.js
CHANGED
|
@@ -1,1082 +1,1130 @@
|
|
|
1
|
-
/******/ (() => {
|
|
2
|
-
|
|
3
|
-
/******/
|
|
4
|
-
/******/
|
|
5
|
-
/******/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/******/
|
|
9
|
-
/******/
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
/******/
|
|
27
|
-
/******/
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/
|
|
38
|
-
/******/
|
|
39
|
-
/******/
|
|
40
|
-
/******/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/******/
|
|
44
|
-
/******/
|
|
45
|
-
/******/
|
|
46
|
-
/******/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
1
|
+
/******/ (() => {
|
|
2
|
+
// webpackBootstrap
|
|
3
|
+
/******/ "use strict";
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var e = {};
|
|
6
|
+
/******/
|
|
7
|
+
/************************************************************************/
|
|
8
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
9
|
+
/******/ (() => {
|
|
10
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
+
/******/ e.n = t => {
|
|
12
|
+
/******/ var r = t && t.__esModule ?
|
|
13
|
+
/******/ () => t["default"]
|
|
14
|
+
/******/ : () => t
|
|
15
|
+
/******/;
|
|
16
|
+
e.d(r, {
|
|
17
|
+
a: r
|
|
18
|
+
});
|
|
19
|
+
/******/ return r;
|
|
20
|
+
/******/ };
|
|
21
|
+
/******/ })();
|
|
22
|
+
/******/
|
|
23
|
+
/******/ /* webpack/runtime/define property getters */
|
|
24
|
+
/******/ (() => {
|
|
25
|
+
/******/ // define getter functions for harmony exports
|
|
26
|
+
/******/ e.d = (t, r) => {
|
|
27
|
+
/******/ for (var n in r) {
|
|
28
|
+
/******/ if (e.o(r, n) && !e.o(t, n)) {
|
|
29
|
+
/******/ Object.defineProperty(t, n, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: r[n]
|
|
32
|
+
});
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ }
|
|
35
|
+
/******/ };
|
|
36
|
+
/******/ })();
|
|
37
|
+
/******/
|
|
38
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
|
+
/******/ (() => {
|
|
40
|
+
/******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
41
|
+
/******/;
|
|
42
|
+
})();
|
|
43
|
+
/******/
|
|
44
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
45
|
+
/******/ (() => {
|
|
46
|
+
/******/ // define __esModule on exports
|
|
47
|
+
/******/ e.r = e => {
|
|
48
|
+
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
49
|
+
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
50
|
+
value: "Module"
|
|
51
|
+
});
|
|
52
|
+
/******/ }
|
|
53
|
+
/******/ Object.defineProperty(e, "__esModule", {
|
|
54
|
+
value: true
|
|
55
|
+
});
|
|
56
|
+
/******/ };
|
|
57
|
+
/******/ })();
|
|
58
|
+
/******/
|
|
59
|
+
/************************************************************************/ var t = {};
|
|
60
|
+
// ESM COMPAT FLAG
|
|
61
|
+
e.r(t);
|
|
62
|
+
// EXPORTS
|
|
63
|
+
e.d(t, {
|
|
64
|
+
Divider: () => /* reexport */ x,
|
|
65
|
+
Heading: () => /* reexport */ H,
|
|
66
|
+
Item: () => /* reexport */ ze,
|
|
67
|
+
MenuContext: () => /* reexport */ h,
|
|
68
|
+
default: () => /* reexport */ rt
|
|
69
|
+
});
|
|
70
|
+
// CONCATENATED MODULE: external "react"
|
|
71
|
+
const r = require("react");
|
|
72
|
+
var n = e.n(r);
|
|
73
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
74
|
+
const i = require("prop-types");
|
|
75
|
+
var o = e.n(i);
|
|
76
|
+
// CONCATENATED MODULE: external "lodash/omit"
|
|
77
|
+
const a = require("lodash/omit");
|
|
78
|
+
var l = e.n(a);
|
|
79
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Popover"
|
|
80
|
+
const s = require("@splunk/react-ui/Popover");
|
|
81
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/focus"
|
|
82
|
+
const c = require("@splunk/ui-utils/focus");
|
|
83
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
84
|
+
const p = require("@splunk/ui-utils/keyboard");
|
|
85
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/useForceUpdate"
|
|
86
|
+
const u = require("@splunk/react-ui/useForceUpdate");
|
|
87
|
+
var d = e.n(u);
|
|
88
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
89
|
+
const f = require("styled-components");
|
|
90
|
+
var v = e.n(f);
|
|
91
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
92
|
+
const b = require("@splunk/themes");
|
|
93
|
+
// CONCATENATED MODULE: ./src/Menu/DividerStyles.ts
|
|
94
|
+
var m = v().div.withConfig({
|
|
95
|
+
displayName: "DividerStyles__Styled",
|
|
96
|
+
componentId: "l3zfh3-0"
|
|
97
|
+
})([ "border-top:1px solid ", ";", "" ], (0, b.pick)({
|
|
98
|
+
enterprise: b.variables.borderColor,
|
|
99
|
+
prisma: b.variables.neutral200
|
|
100
|
+
}), (0, b.pick)({
|
|
101
|
+
prisma: {
|
|
102
|
+
comfortable: (0, f.css)([ "margin:8px 0;" ]),
|
|
103
|
+
compact: (0, f.css)([ "margin:6px 0;" ])
|
|
104
|
+
}
|
|
105
|
+
}));
|
|
106
|
+
// CONCATENATED MODULE: ./src/Menu/MenuContext.tsx
|
|
107
|
+
var h = (0, r.createContext)({
|
|
108
|
+
role: "menu"
|
|
109
|
+
});
|
|
110
|
+
// CONCATENATED MODULE: ./src/Menu/Divider.tsx
|
|
111
|
+
function y() {
|
|
112
|
+
y = Object.assign || function(e) {
|
|
113
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
114
|
+
var r = arguments[t];
|
|
115
|
+
for (var n in r) {
|
|
116
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
117
|
+
e[n] = r[n];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return e;
|
|
122
|
+
};
|
|
123
|
+
return y.apply(this, arguments);
|
|
124
|
+
}
|
|
125
|
+
var g = {};
|
|
126
|
+
/**
|
|
115
127
|
* A non-interactive menu item used to visually separate groups of items in the menu.
|
|
116
|
-
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
var
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
function
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
128
|
+
*/ function k(e) {
|
|
129
|
+
var t = y({}, e);
|
|
130
|
+
// @docs-props-type DividerPropsBase
|
|
131
|
+
var i = (0, r.useContext)(h), o = i.role;
|
|
132
|
+
|
|
133
|
+
return n().createElement(m, y({
|
|
134
|
+
"aria-hidden": o === "listbox",
|
|
135
|
+
"data-test": "divider",
|
|
136
|
+
role: "separator"
|
|
137
|
+
}, t));
|
|
138
|
+
}
|
|
139
|
+
k.propTypes = g;
|
|
140
|
+
/* Remove the item if it is the first item after filtering */ k.filterFirst = true;
|
|
141
|
+
/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ k.filterConsecutive = true;
|
|
142
|
+
/* Remove the item if it is the last item after filtering. */ k.filterLast = true;
|
|
143
|
+
/* Tag the item as Divider */ k.as = "Divider";
|
|
144
|
+
/* harmony default export */ const x = k;
|
|
145
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Heading"
|
|
146
|
+
const w = require("@splunk/react-ui/Heading");
|
|
147
|
+
var S = e.n(w);
|
|
148
|
+
// CONCATENATED MODULE: external "@splunk/themes/useSplunkTheme"
|
|
149
|
+
const O = require("@splunk/themes/useSplunkTheme");
|
|
150
|
+
var C = e.n(O);
|
|
151
|
+
// CONCATENATED MODULE: ./src/Menu/HeadingStyles.ts
|
|
152
|
+
var I = v().div.withConfig({
|
|
153
|
+
displayName: "HeadingStyles__Styled",
|
|
154
|
+
componentId: "mcd2ws-0"
|
|
155
|
+
})([ "", " border-top:1px solid transparent;padding:", ";&:not(:first-child){", ";}" ], b.mixins.reset("block"), (0,
|
|
156
|
+
b.pick)({
|
|
157
|
+
enterprise: (0, f.css)([ "", " ", " 6px" ], b.variables.spacingQuarter, b.variables.spacingHalf),
|
|
158
|
+
prisma: {
|
|
159
|
+
comfortable: "13px 16px 10px 16px",
|
|
160
|
+
compact: "9px 16px 6px 16px"
|
|
161
|
+
}
|
|
162
|
+
}), (0, b.pick)({
|
|
163
|
+
enterprise: (0, f.css)([ "border-top:", ";" ], b.variables.border),
|
|
164
|
+
prisma: {
|
|
165
|
+
comfortable: (0, f.css)([ "border-top:1px solid ", ";margin-top:6px;padding-top:19px;" ], b.variables.neutral200),
|
|
166
|
+
compact: (0, f.css)([ "border-top:1px solid ", ";margin-top:6px;padding-top:15px;" ], b.variables.neutral200)
|
|
167
|
+
}
|
|
168
|
+
}));
|
|
169
|
+
var P = v().h5.withConfig({
|
|
170
|
+
displayName: "HeadingStyles__PrismaSectionTitle",
|
|
171
|
+
componentId: "mcd2ws-1"
|
|
172
|
+
})([ "", " font-size:", ";line-height:", ";font-weight:", ";letter-spacing:0.02em;" ], b.mixins.reset("block"), b.variables.fontSizeSmall, b.variables.lineHeight, b.variables.fontWeightBold);
|
|
173
|
+
// CONCATENATED MODULE: ./src/Menu/Heading.tsx
|
|
174
|
+
function _(e, t) {
|
|
175
|
+
var r = Object.keys(e);
|
|
176
|
+
if (Object.getOwnPropertySymbols) {
|
|
177
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
178
|
+
if (t) n = n.filter((function(t) {
|
|
179
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
180
|
+
}));
|
|
181
|
+
r.push.apply(r, n);
|
|
182
|
+
}
|
|
183
|
+
return r;
|
|
184
|
+
}
|
|
185
|
+
function j(e) {
|
|
186
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
187
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
188
|
+
if (t % 2) {
|
|
189
|
+
_(Object(r), true).forEach((function(t) {
|
|
190
|
+
E(e, t, r[t]);
|
|
191
|
+
}));
|
|
192
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
193
|
+
Object.defineProperties(e, Object.getOwnPropertyDescriptors(r));
|
|
194
|
+
} else {
|
|
195
|
+
_(Object(r)).forEach((function(t) {
|
|
196
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return e;
|
|
201
|
+
}
|
|
202
|
+
function E(e, t, r) {
|
|
203
|
+
if (t in e) {
|
|
204
|
+
Object.defineProperty(e, t, {
|
|
205
|
+
value: r,
|
|
206
|
+
enumerable: true,
|
|
207
|
+
configurable: true,
|
|
208
|
+
writable: true
|
|
209
|
+
});
|
|
210
|
+
} else {
|
|
211
|
+
e[t] = r;
|
|
212
|
+
}
|
|
213
|
+
return e;
|
|
214
|
+
}
|
|
215
|
+
function T() {
|
|
216
|
+
T = Object.assign || function(e) {
|
|
217
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
218
|
+
var r = arguments[t];
|
|
219
|
+
for (var n in r) {
|
|
220
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
221
|
+
e[n] = r[n];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return e;
|
|
226
|
+
};
|
|
227
|
+
return T.apply(this, arguments);
|
|
228
|
+
}
|
|
229
|
+
function D(e, t) {
|
|
230
|
+
if (e == null) return {};
|
|
231
|
+
var r = R(e, t);
|
|
232
|
+
var n, i;
|
|
233
|
+
if (Object.getOwnPropertySymbols) {
|
|
234
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
235
|
+
for (i = 0; i < o.length; i++) {
|
|
236
|
+
n = o[i];
|
|
237
|
+
if (t.indexOf(n) >= 0) continue;
|
|
238
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
239
|
+
r[n] = e[n];
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return r;
|
|
243
|
+
}
|
|
244
|
+
function R(e, t) {
|
|
245
|
+
if (e == null) return {};
|
|
246
|
+
var r = {};
|
|
247
|
+
var n = Object.keys(e);
|
|
248
|
+
var i, o;
|
|
249
|
+
for (o = 0; o < n.length; o++) {
|
|
250
|
+
i = n[o];
|
|
251
|
+
if (t.indexOf(i) >= 0) continue;
|
|
252
|
+
r[i] = e[i];
|
|
253
|
+
}
|
|
254
|
+
return r;
|
|
255
|
+
}
|
|
256
|
+
var q = {
|
|
257
|
+
children: o().node,
|
|
258
|
+
title: o().bool,
|
|
259
|
+
outerStyle: o().object
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
205
262
|
* A non-interactive `Menu` item used to separate and label groups of `Menu` items.
|
|
206
|
-
*/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
var
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
var
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
var
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}));
|
|
282
|
-
var
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
})(["", ";display:block;"],
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
})
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}));
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}), (0,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}))
|
|
313
|
-
var
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}), (
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}),
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
})
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}, themes_namespaceObject.variables.focusShadowInset, (0,themes_namespaceObject.pick)({
|
|
361
|
-
prisma: (0,external_styled_components_namespaceObject.css)(["background:", ";"], themes_namespaceObject.variables.interactiveColorOverlayHover)
|
|
362
|
-
}), (0,themes_namespaceObject.pick)({
|
|
363
|
-
prisma: (0,external_styled_components_namespaceObject.css)(["&:active{background:", ";}"], themes_namespaceObject.variables.interactiveColorOverlayActive)
|
|
364
|
-
}), function (_ref5) {
|
|
365
|
-
var $selected = _ref5.$selected;
|
|
366
|
-
return $selected && (0,themes_namespaceObject.pick)({
|
|
367
|
-
prisma: (0,external_styled_components_namespaceObject.css)(["background:", ";&:active{background:", ";}"], themes_namespaceObject.variables.interactiveColorOverlaySelected, themes_namespaceObject.mixins.overlayColors(themes_namespaceObject.variables.interactiveColorOverlaySelected, themes_namespaceObject.variables.interactiveColorOverlayActive))
|
|
368
|
-
});
|
|
369
|
-
}, (0,themes_namespaceObject.pick)({
|
|
370
|
-
enterprise: {
|
|
371
|
-
light: themes_namespaceObject.variables.gray45,
|
|
372
|
-
dark: themes_namespaceObject.variables.contentColorDisabled
|
|
373
|
-
},
|
|
374
|
-
prisma: themes_namespaceObject.variables.contentColorDisabled
|
|
375
|
-
}),
|
|
376
|
-
/* sc-sel */
|
|
377
|
-
StyledItemDescriptionBottom,
|
|
378
|
-
/* sc-sel */
|
|
379
|
-
StyledItemDescriptionRight,
|
|
380
|
-
/* sc-sel */
|
|
381
|
-
StyledItemSelectedIcon, (0,themes_namespaceObject.pick)({
|
|
382
|
-
prisma: themes_namespaceObject.variables.contentColorDisabled,
|
|
383
|
-
enterprise: themes_namespaceObject.variables.gray80
|
|
384
|
-
}), (0,themes_namespaceObject.pick)({
|
|
385
|
-
prisma: (0,external_styled_components_namespaceObject.css)(["& > * > ", "{color:", ";}"],
|
|
386
|
-
/* sc-sel */
|
|
387
|
-
StyledItemIcon, themes_namespaceObject.variables.contentColorDisabled)
|
|
388
|
-
}), function (_ref6) {
|
|
389
|
-
var $selected = _ref6.$selected;
|
|
390
|
-
return $selected && (0,themes_namespaceObject.pick)({
|
|
391
|
-
prisma: (0,external_styled_components_namespaceObject.css)(["", "{color:", ";}"],
|
|
263
|
+
*/ function N(e) {
|
|
264
|
+
var t = e.children, i = e.title, o = e.outerStyle, a = D(e, [ "children", "title", "outerStyle" ]);
|
|
265
|
+
var l = (0, r.useContext)(h), s = l.role;
|
|
266
|
+
var c = C()(), p = c.family;
|
|
267
|
+
var u = p === "prisma" ? n().createElement(P, T({
|
|
268
|
+
as: i ? "h4" : "h5",
|
|
269
|
+
style: o,
|
|
270
|
+
"data-test": "heading"
|
|
271
|
+
}, a), t) : n().createElement(S(), T({
|
|
272
|
+
style: j(j({}, o), {}, {
|
|
273
|
+
margin: 0
|
|
274
|
+
}),
|
|
275
|
+
level: i ? 4 : "ss",
|
|
276
|
+
"data-test": "heading"
|
|
277
|
+
}, a), t);
|
|
278
|
+
// headings are not supported in role="listbox"
|
|
279
|
+
// this causes Firefox to incorrectly read the total number
|
|
280
|
+
// of items in the list if it contains a heading or divider
|
|
281
|
+
// so we set them to aria-hidden to prevent that
|
|
282
|
+
|
|
283
|
+
return n().createElement(I, {
|
|
284
|
+
"aria-hidden": s === "listbox"
|
|
285
|
+
}, u);
|
|
286
|
+
}
|
|
287
|
+
N.propTypes = q;
|
|
288
|
+
/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ N.filterConsecutive = true;
|
|
289
|
+
/* Remove the item if it is the last item after filtering. */ N.filterLast = true;
|
|
290
|
+
/* Tag the item as a Heading */ N.as = "Heading";
|
|
291
|
+
/* harmony default export */ const H = N;
|
|
292
|
+
// CONCATENATED MODULE: external "lodash/isString"
|
|
293
|
+
const F = require("lodash/isString");
|
|
294
|
+
var $ = e.n(F);
|
|
295
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
|
|
296
|
+
const A = require("@splunk/react-icons/ChevronRight");
|
|
297
|
+
var M = e.n(A);
|
|
298
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/Checkmark"
|
|
299
|
+
const K = require("@splunk/react-icons/Checkmark");
|
|
300
|
+
var z = e.n(K);
|
|
301
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Check"
|
|
302
|
+
const L = require("@splunk/react-icons/enterprise/Check");
|
|
303
|
+
var W = e.n(L);
|
|
304
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
|
|
305
|
+
const B = require("@splunk/react-icons/enterprise/ChevronRight");
|
|
306
|
+
var G = e.n(B);
|
|
307
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
308
|
+
const U = require("@splunk/react-ui/Clickable");
|
|
309
|
+
var V = e.n(U);
|
|
310
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Switch"
|
|
311
|
+
const Q = require("@splunk/react-ui/Switch");
|
|
312
|
+
var Y = e.n(Q);
|
|
313
|
+
// CONCATENATED MODULE: ./src/Menu/ItemStyles.ts
|
|
314
|
+
var J = (0, f.css)([ "color:", ";font-size:", ";line-height:", ";overflow:inherit;white-space:inherit;text-overflow:inherit;" ], (0,
|
|
315
|
+
b.pick)({
|
|
316
|
+
prisma: b.variables.contentColorDefault,
|
|
317
|
+
enterprise: b.variables.textGray
|
|
318
|
+
}), b.variables.fontSizeSmall, (0, b.pick)({
|
|
319
|
+
prisma: "16px"
|
|
320
|
+
}));
|
|
321
|
+
var X = v().span.withConfig({
|
|
322
|
+
displayName: "ItemStyles__StyledItemDescriptionBottom",
|
|
323
|
+
componentId: "sc-4kc053-0"
|
|
324
|
+
})([ "", ";display:block;" ], J);
|
|
325
|
+
var Z = v().span.withConfig({
|
|
326
|
+
displayName: "ItemStyles__StyledItemDescriptionRight",
|
|
327
|
+
componentId: "sc-4kc053-1"
|
|
328
|
+
})([ "", ";float:right;padding-left:", ";max-width:50%;text-align:right;box-sizing:border-box;" ], J, b.variables.spacing);
|
|
329
|
+
var ee = v().div.withConfig({
|
|
330
|
+
displayName: "ItemStyles__StyledItemSelectedIcon",
|
|
331
|
+
componentId: "sc-4kc053-2"
|
|
332
|
+
})([ "position:absolute;", " color:", ";" ], (0, b.pick)({
|
|
333
|
+
prisma: (0, f.css)([ "right:16px;" ]),
|
|
334
|
+
enterprise: (0, f.css)([ "top:5px;right:3px;left:8px;" ])
|
|
335
|
+
}), (0, b.pick)({
|
|
336
|
+
prisma: b.variables.contentColorActive,
|
|
337
|
+
enterprise: b.variables.accentColorL10
|
|
338
|
+
}));
|
|
339
|
+
var te = v().span.withConfig({
|
|
340
|
+
displayName: "ItemStyles__StyledItemIcon",
|
|
341
|
+
componentId: "sc-4kc053-3"
|
|
342
|
+
})([ "flex:0 0 auto;padding-right:", ";min-width:10px;display:inline-block;text-align:center;vertical-align:", ";", "" ], (0,
|
|
343
|
+
b.pick)({
|
|
344
|
+
prisma: "8px",
|
|
345
|
+
enterprise: "3px"
|
|
346
|
+
}), (0, b.pick)({
|
|
347
|
+
prisma: "initial",
|
|
348
|
+
enterprise: "middle"
|
|
349
|
+
}), (0, b.pick)({
|
|
350
|
+
prisma: (0, f.css)([ "color:", ";display:inline-flex;align-items:center;min-width:20px;min-height:20px;& > svg{width:20px;height:20px;}" ], b.variables.contentColorMuted),
|
|
351
|
+
enterprise: (0, f.css)([ "transform:translateY(-1px);" ])
|
|
352
|
+
}));
|
|
353
|
+
var re = v()(V()).withConfig({
|
|
354
|
+
displayName: "ItemStyles__StyledClickable",
|
|
355
|
+
componentId: "sc-4kc053-4"
|
|
356
|
+
})([ "display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;padding:", ";", " ", " ", " &:not([disabled]){&:hover{background:", ";", "}&:focus{outline:0;box-shadow:", ";", "}", " ", "}&[disabled]{color:", ";cursor:not-allowed;", ",", "{color:inherit;}", "{cursor:not-allowed;color:", ";}", "}", "" ], (0,
|
|
357
|
+
b.pick)({
|
|
358
|
+
prisma: b.variables.contentColorActive,
|
|
359
|
+
enterprise: {
|
|
360
|
+
dark: b.variables.gray96,
|
|
361
|
+
light: b.variables.gray22
|
|
362
|
+
}
|
|
363
|
+
}), (0, b.pick)({
|
|
364
|
+
prisma: {
|
|
365
|
+
comfortable: "10px 16px",
|
|
366
|
+
compact: "6px 16px"
|
|
367
|
+
},
|
|
368
|
+
enterprise: "6px 10px"
|
|
369
|
+
}), (function(e) {
|
|
370
|
+
var t = e.$isSelectable, r = e.$selectableAppearance;
|
|
371
|
+
return t && (0, b.pick)({
|
|
372
|
+
prisma: (0, f.css)([ "padding-right:44px;", "" ], (function() {
|
|
373
|
+
return r === "checkbox" && "padding-left: 42px;";
|
|
374
|
+
})),
|
|
375
|
+
enterprise: (0, f.css)([ "padding-right:10px;padding-left:", ";" ], (function() {
|
|
376
|
+
return r === "checkbox" ? "32px" : "28px";
|
|
377
|
+
}))
|
|
378
|
+
});
|
|
379
|
+
}), (function(e) {
|
|
380
|
+
var t = e.$active, r = e.$preventFocus;
|
|
381
|
+
return t && !r && (0, f.css)([ "box-shadow:", ";" ], b.variables.focusShadowInset);
|
|
382
|
+
}), (function(e) {
|
|
383
|
+
var t = e.$active;
|
|
384
|
+
return t && (0, f.css)([ "background:", ";font-weight:", ";" ], (0, b.pick)({
|
|
385
|
+
enterprise: {
|
|
386
|
+
light: b.variables.gray92,
|
|
387
|
+
dark: b.variables.gray22
|
|
388
|
+
},
|
|
389
|
+
prisma: b.variables.neutral100
|
|
390
|
+
}), b.variables.fontWeightBold);
|
|
391
|
+
}), (0, b.pick)({
|
|
392
|
+
prisma: b.variables.interactiveColorOverlayHover,
|
|
393
|
+
enterprise: b.variables.backgroundColorHover
|
|
394
|
+
}), (function(e) {
|
|
395
|
+
var t = e.$selected;
|
|
396
|
+
return t && (0, b.pick)({
|
|
397
|
+
prisma: (0, f.css)([ "background:", ";" ], b.mixins.overlayColors(b.variables.interactiveColorOverlaySelected, b.variables.interactiveColorOverlayHover))
|
|
398
|
+
});
|
|
399
|
+
}), b.variables.focusShadowInset, (0, b.pick)({
|
|
400
|
+
prisma: (0, f.css)([ "background:", ";" ], b.variables.interactiveColorOverlayHover)
|
|
401
|
+
}), (0, b.pick)({
|
|
402
|
+
prisma: (0, f.css)([ "&:active{background:", ";}" ], b.variables.interactiveColorOverlayActive)
|
|
403
|
+
}), (function(e) {
|
|
404
|
+
var t = e.$selected;
|
|
405
|
+
return t && (0, b.pick)({
|
|
406
|
+
prisma: (0, f.css)([ "background:", ";&:active{background:", ";}" ], b.variables.interactiveColorOverlaySelected, b.mixins.overlayColors(b.variables.interactiveColorOverlaySelected, b.variables.interactiveColorOverlayActive))
|
|
407
|
+
});
|
|
408
|
+
}), (0, b.pick)({
|
|
409
|
+
enterprise: {
|
|
410
|
+
light: b.variables.gray45,
|
|
411
|
+
dark: b.variables.contentColorDisabled
|
|
412
|
+
},
|
|
413
|
+
prisma: b.variables.contentColorDisabled
|
|
414
|
+
}),
|
|
415
|
+
/* sc-sel */
|
|
416
|
+
X,
|
|
392
417
|
/* sc-sel */
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
}), (
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
})
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
})
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
});
|
|
427
|
-
var
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
})(["
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
})
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
var
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
418
|
+
Z,
|
|
419
|
+
/* sc-sel */
|
|
420
|
+
ee, (0, b.pick)({
|
|
421
|
+
prisma: b.variables.contentColorDisabled,
|
|
422
|
+
enterprise: b.variables.gray80
|
|
423
|
+
}), (0, b.pick)({
|
|
424
|
+
prisma: (0, f.css)([ "& > * > ", "{color:", ";}" ],
|
|
425
|
+
/* sc-sel */
|
|
426
|
+
te, b.variables.contentColorDisabled)
|
|
427
|
+
}), (function(e) {
|
|
428
|
+
var t = e.$selected;
|
|
429
|
+
return t && (0, b.pick)({
|
|
430
|
+
prisma: (0, f.css)([ "", "{color:", ";}" ],
|
|
431
|
+
/* sc-sel */
|
|
432
|
+
te, b.variables.contentColorActive)
|
|
433
|
+
});
|
|
434
|
+
}));
|
|
435
|
+
var ne = v()(Y()).withConfig({
|
|
436
|
+
displayName: "ItemStyles__StyledSwitch",
|
|
437
|
+
componentId: "sc-4kc053-5"
|
|
438
|
+
})([ "position:absolute;left:", ";top:", ";" ], (0, b.pick)({
|
|
439
|
+
prisma: "16px",
|
|
440
|
+
enterprise: "8px"
|
|
441
|
+
}), (0, b.pick)({
|
|
442
|
+
prisma: "0px",
|
|
443
|
+
enterprise: {
|
|
444
|
+
comfortable: "-1px",
|
|
445
|
+
compact: "2px"
|
|
446
|
+
}
|
|
447
|
+
}));
|
|
448
|
+
var ie = v().span.withConfig({
|
|
449
|
+
displayName: "ItemStyles__StyledInnerWrapper",
|
|
450
|
+
componentId: "sc-4kc053-6"
|
|
451
|
+
})([ "display:flex;align-items:flex-start;" ]);
|
|
452
|
+
var oe = v().span.withConfig({
|
|
453
|
+
displayName: "ItemStyles__StyledTitleAndDescriptionWrapper",
|
|
454
|
+
componentId: "sc-4kc053-7"
|
|
455
|
+
})([ "max-width:100%;width:100%;align-self:center;word-break:break-word;white-space:normal;", "" ], (function(e) {
|
|
456
|
+
var t = e.$truncate;
|
|
457
|
+
return t && (0, f.css)([ "white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ]);
|
|
458
|
+
}));
|
|
459
|
+
var ae = v().div.withConfig({
|
|
460
|
+
displayName: "ItemStyles__StyledLabel",
|
|
461
|
+
componentId: "sc-4kc053-8"
|
|
462
|
+
})([ "overflow:inherit;white-space:inherit;text-overflow:inherit;max-width:100%;min-height:20px;", "" ], (function(e) {
|
|
463
|
+
var t = e.$truncate;
|
|
464
|
+
return t && (0, f.css)([ "display:block;clear:both;" ]);
|
|
465
|
+
}));
|
|
466
|
+
var le = v().span.withConfig({
|
|
467
|
+
displayName: "ItemStyles__StyledMatch",
|
|
468
|
+
componentId: "sc-4kc053-9"
|
|
469
|
+
})([ "border-bottom:1px solid ", ";" ], (0, b.pick)({
|
|
470
|
+
prisma: b.variables.contentColorActive,
|
|
471
|
+
enterprise: {
|
|
472
|
+
dark: b.variables.gray96,
|
|
473
|
+
light: b.variables.gray45
|
|
474
|
+
}
|
|
475
|
+
}));
|
|
476
|
+
var se = v().span.withConfig({
|
|
477
|
+
displayName: "ItemStyles__StyledSubmenu",
|
|
478
|
+
componentId: "sc-4kc053-10"
|
|
479
|
+
})([ "float:right;padding-left:", ";color:", ";", "" ], b.variables.spacingSmall, (0,
|
|
480
|
+
b.pick)({
|
|
481
|
+
prisma: "inherit",
|
|
482
|
+
enterprise: b.variables.textGray
|
|
483
|
+
}), (0, b.pick)({
|
|
484
|
+
prisma: (0, f.css)([ "& > svg{width:20px;height:20px;}" ])
|
|
485
|
+
}));
|
|
486
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRight"
|
|
487
|
+
const ce = require("@splunk/react-icons/ArrowSquareTopRight");
|
|
488
|
+
var pe = e.n(ce);
|
|
489
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/External"
|
|
490
|
+
const ue = require("@splunk/react-icons/enterprise/External");
|
|
491
|
+
var de = e.n(ue);
|
|
492
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
493
|
+
const fe = require("@splunk/ui-utils/i18n");
|
|
494
|
+
// CONCATENATED MODULE: ./src/Menu/icons/External.tsx
|
|
495
|
+
var ve = (0, fe._)("Open externally");
|
|
496
|
+
var be = (0, f.css)([ "width:0.8em;height:0.8em;vertical-align:baseline;" ]);
|
|
497
|
+
var me = v()(de()).withConfig({
|
|
498
|
+
displayName: "External__StyledEnterprise",
|
|
499
|
+
componentId: "sc-1turs2s-0"
|
|
500
|
+
})([ "", " margin:0 0 0 3px;" ], be);
|
|
501
|
+
var he = v()(pe()).withConfig({
|
|
502
|
+
displayName: "External__StyledPrisma",
|
|
503
|
+
componentId: "sc-1turs2s-1"
|
|
504
|
+
})([ "", " margin:0 0 0 4px;" ], be);
|
|
505
|
+
function ye() {
|
|
506
|
+
var e = (0, b.useSplunkTheme)(), t = e.isEnterprise, r = e.isCompact;
|
|
507
|
+
var i = r ? "20px" : "24px";
|
|
508
|
+
return t ? n().createElement(me, {
|
|
509
|
+
screenReaderText: ve
|
|
510
|
+
}) : n().createElement(he, {
|
|
511
|
+
"aria-label": ve,
|
|
512
|
+
height: i,
|
|
513
|
+
width: i
|
|
514
|
+
}, n().createElement("title", null, ve));
|
|
515
|
+
}
|
|
516
|
+
/* harmony default export */ const ge = ye;
|
|
517
|
+
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
518
|
+
/**
|
|
491
519
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
492
520
|
*
|
|
493
521
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
494
522
|
* @param current - The new value of the ref.
|
|
495
523
|
*/
|
|
496
|
-
function
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
524
|
+
function ke(e, t) {
|
|
525
|
+
if (e) {
|
|
526
|
+
if (typeof e === "function") {
|
|
527
|
+
e(t);
|
|
528
|
+
} else {
|
|
529
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
530
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
531
|
+
e.current = t;
|
|
532
|
+
// eslint-disable-line no-param-reassign
|
|
533
|
+
}
|
|
534
|
+
}
|
|
504
535
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
var
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
function Item_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Item_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
537
|
-
|
|
538
|
-
function Item_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
539
|
-
|
|
540
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
541
|
-
|
|
542
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
543
|
-
|
|
544
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
545
|
-
|
|
546
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
547
|
-
|
|
548
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
549
|
-
|
|
550
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
551
|
-
|
|
552
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
553
|
-
|
|
554
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
555
|
-
|
|
556
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
557
|
-
|
|
558
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
559
|
-
|
|
560
|
-
function Item_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
var Item_propTypes = {
|
|
576
|
-
active: (external_prop_types_default()).bool,
|
|
577
|
-
children: (external_prop_types_default()).node,
|
|
578
|
-
description: (external_prop_types_default()).string,
|
|
579
|
-
descriptionPosition: external_prop_types_default().oneOf(['right', 'bottom']),
|
|
580
|
-
disabled: (external_prop_types_default()).bool,
|
|
581
|
-
elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
582
|
-
hasSubmenu: (external_prop_types_default()).bool,
|
|
583
|
-
icon: (external_prop_types_default()).node,
|
|
584
|
-
|
|
585
|
-
/** @private. The internal key of the tab */
|
|
586
|
-
itemKey: (external_prop_types_default()).number,
|
|
587
|
-
matchRanges: external_prop_types_default().arrayOf(external_prop_types_default().shape({
|
|
588
|
-
start: (external_prop_types_default()).number.isRequired,
|
|
589
|
-
end: (external_prop_types_default()).number.isRequired
|
|
590
|
-
})),
|
|
591
|
-
onClick: (external_prop_types_default()).func,
|
|
592
|
-
|
|
593
|
-
/** @private */
|
|
594
|
-
onFocus: (external_prop_types_default()).func,
|
|
595
|
-
openInNewContext: (external_prop_types_default()).bool,
|
|
596
|
-
|
|
597
|
-
/** @private */
|
|
598
|
-
preventFocus: (external_prop_types_default()).bool,
|
|
599
|
-
role: external_prop_types_default().oneOf(['menuitem', 'menuitemradio', 'menuitemcheckbox', 'listboxitem', 'option']),
|
|
600
|
-
selectable: (external_prop_types_default()).bool,
|
|
601
|
-
selectableAppearance: external_prop_types_default().oneOf(['checkmark', 'checkbox']),
|
|
602
|
-
selected: (external_prop_types_default()).bool,
|
|
603
|
-
|
|
604
|
-
/** @private */
|
|
605
|
-
splunkTheme: (external_prop_types_default()).object,
|
|
606
|
-
to: (external_prop_types_default()).string,
|
|
607
|
-
truncate: (external_prop_types_default()).bool
|
|
608
|
-
};
|
|
609
|
-
var defaultProps = {
|
|
610
|
-
active: false,
|
|
611
|
-
descriptionPosition: 'bottom',
|
|
612
|
-
disabled: false,
|
|
613
|
-
hasSubmenu: false,
|
|
614
|
-
openInNewContext: false,
|
|
615
|
-
preventFocus: false,
|
|
616
|
-
selectable: false,
|
|
617
|
-
selectableAppearance: 'checkmark',
|
|
618
|
-
selected: false,
|
|
619
|
-
truncate: false
|
|
620
|
-
};
|
|
621
|
-
|
|
622
|
-
var Item = /*#__PURE__*/function (_Component) {
|
|
623
|
-
_inherits(Item, _Component);
|
|
624
|
-
|
|
625
|
-
var _super = _createSuper(Item);
|
|
626
|
-
|
|
627
|
-
_createClass(Item, null, [{
|
|
628
|
-
key: "validateProps",
|
|
629
|
-
// @docs-props-type ItemPropsBase
|
|
630
|
-
value: function validateProps(props) {
|
|
631
|
-
if (false) {}
|
|
536
|
+
// CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
|
|
537
|
+
// A utility that attempts to move an element into view by scrolling it's derived parent.
|
|
538
|
+
var xe = function e(t) {
|
|
539
|
+
if (!t) {
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
var r = t.offsetParent;
|
|
543
|
+
if (!r) {
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
// Below the bottom of the container.
|
|
547
|
+
if (r.scrollTop + r.clientHeight < t.offsetTop + t.clientHeight) {
|
|
548
|
+
r.scrollTop = t.offsetTop + t.clientHeight - r.clientHeight;
|
|
549
|
+
// Above the top of the container.
|
|
550
|
+
} else if (r.scrollTop > t.offsetTop) {
|
|
551
|
+
r.scrollTop = t.offsetTop;
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
// CONCATENATED MODULE: ./src/Menu/Item.tsx
|
|
555
|
+
function we(e) {
|
|
556
|
+
"@babel/helpers - typeof";
|
|
557
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
558
|
+
we = function e(t) {
|
|
559
|
+
return typeof t;
|
|
560
|
+
};
|
|
561
|
+
} else {
|
|
562
|
+
we = function e(t) {
|
|
563
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
return we(e);
|
|
632
567
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
onFocus = _this$props.onFocus,
|
|
647
|
-
itemKey = _this$props.itemKey;
|
|
648
|
-
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e, {
|
|
649
|
-
itemKey: itemKey
|
|
650
|
-
});
|
|
651
|
-
});
|
|
652
|
-
|
|
653
|
-
Item_defineProperty(_assertThisInitialized(_this), "handleMount", function (el) {
|
|
654
|
-
_this.el = el;
|
|
655
|
-
updateReactRef(_this.props.elementRef, el);
|
|
656
|
-
});
|
|
657
|
-
|
|
658
|
-
Item.validateProps(props);
|
|
659
|
-
return _this;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
_createClass(Item, [{
|
|
663
|
-
key: "componentDidUpdate",
|
|
664
|
-
value: function componentDidUpdate() {
|
|
665
|
-
Item.validateProps(this.props);
|
|
568
|
+
function Se() {
|
|
569
|
+
Se = Object.assign || function(e) {
|
|
570
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
571
|
+
var r = arguments[t];
|
|
572
|
+
for (var n in r) {
|
|
573
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
574
|
+
e[n] = r[n];
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
return e;
|
|
579
|
+
};
|
|
580
|
+
return Se.apply(this, arguments);
|
|
666
581
|
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
582
|
+
function Oe(e, t) {
|
|
583
|
+
if (e == null) return {};
|
|
584
|
+
var r = Ce(e, t);
|
|
585
|
+
var n, i;
|
|
586
|
+
if (Object.getOwnPropertySymbols) {
|
|
587
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
588
|
+
for (i = 0; i < o.length; i++) {
|
|
589
|
+
n = o[i];
|
|
590
|
+
if (t.indexOf(n) >= 0) continue;
|
|
591
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
592
|
+
r[n] = e[n];
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return r;
|
|
673
596
|
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
597
|
+
function Ce(e, t) {
|
|
598
|
+
if (e == null) return {};
|
|
599
|
+
var r = {};
|
|
600
|
+
var n = Object.keys(e);
|
|
601
|
+
var i, o;
|
|
602
|
+
for (o = 0; o < n.length; o++) {
|
|
603
|
+
i = n[o];
|
|
604
|
+
if (t.indexOf(i) >= 0) continue;
|
|
605
|
+
r[i] = e[i];
|
|
606
|
+
}
|
|
607
|
+
return r;
|
|
678
608
|
}
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
var _this$props2 = this.props,
|
|
683
|
-
children = _this$props2.children,
|
|
684
|
-
matchRanges = _this$props2.matchRanges;
|
|
685
|
-
|
|
686
|
-
if (!matchRanges || !isString_default()(children)) {
|
|
687
|
-
return children;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
var segments = []; // before first match. May be empty string.
|
|
691
|
-
|
|
692
|
-
segments.push(children.substring(0, matchRanges[0].start));
|
|
693
|
-
matchRanges.forEach(function (match, index) {
|
|
694
|
-
segments.push(
|
|
695
|
-
/*#__PURE__*/
|
|
696
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
697
|
-
external_react_default().createElement(StyledMatch, {
|
|
698
|
-
key: index,
|
|
699
|
-
"data-test": "match"
|
|
700
|
-
}, children.substring(match.start, match.end)));
|
|
701
|
-
|
|
702
|
-
if (index < matchRanges.length - 1) {
|
|
703
|
-
segments.push(children.substring(match.end, matchRanges[index + 1].start));
|
|
704
|
-
} else {
|
|
705
|
-
segments.push(children.substring(match.end, children.length));
|
|
609
|
+
function Ie(e, t) {
|
|
610
|
+
if (!(e instanceof t)) {
|
|
611
|
+
throw new TypeError("Cannot call a class as a function");
|
|
706
612
|
}
|
|
707
|
-
});
|
|
708
|
-
return segments;
|
|
709
613
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
selectableAppearance = _this$props3.selectableAppearance,
|
|
719
|
-
selected = _this$props3.selected,
|
|
720
|
-
icon = _this$props3.icon,
|
|
721
|
-
description = _this$props3.description,
|
|
722
|
-
disabled = _this$props3.disabled,
|
|
723
|
-
onClick = _this$props3.onClick,
|
|
724
|
-
preventFocus = _this$props3.preventFocus,
|
|
725
|
-
role = _this$props3.role,
|
|
726
|
-
splunkTheme = _this$props3.splunkTheme,
|
|
727
|
-
to = _this$props3.to,
|
|
728
|
-
truncate = _this$props3.truncate,
|
|
729
|
-
descriptionPosition = _this$props3.descriptionPosition,
|
|
730
|
-
openInNewContext = _this$props3.openInNewContext,
|
|
731
|
-
otherProps = Item_objectWithoutProperties(_this$props3, ["active", "children", "hasSubmenu", "selectable", "selectableAppearance", "selected", "icon", "description", "disabled", "onClick", "preventFocus", "role", "splunkTheme", "to", "truncate", "descriptionPosition", "openInNewContext"]);
|
|
732
|
-
|
|
733
|
-
var isEnterprise = splunkTheme.isEnterprise,
|
|
734
|
-
isPrisma = splunkTheme.isPrisma;
|
|
735
|
-
var isSelectable = selectable || selected;
|
|
736
|
-
var defaultRole = {
|
|
737
|
-
nonselectable: 'menuitem',
|
|
738
|
-
checkmark: 'menuitemradio',
|
|
739
|
-
checkbox: 'menuitemcheckbox'
|
|
740
|
-
}[isSelectable ? selectableAppearance : 'nonselectable']; // aria-checked updates only with checkmark appearance for now SUI-2578
|
|
741
|
-
|
|
742
|
-
var ariaProps = {
|
|
743
|
-
'aria-haspopup': hasSubmenu ? true : undefined,
|
|
744
|
-
'aria-checked': selectableAppearance === 'checkmark' && selected ? true : undefined
|
|
745
|
-
};
|
|
746
|
-
var selectablePosition = isPrisma ? 'right' : 'left';
|
|
747
|
-
var descriptionRight = description && descriptionPosition === 'right' && selectablePosition !== 'right';
|
|
748
|
-
var descriptionBottom = description && !descriptionRight;
|
|
749
|
-
var selectableCheckmark = selected && selectableAppearance === 'checkmark' && /*#__PURE__*/external_react_default().createElement(StyledItemSelectedIcon, null, isPrisma ? /*#__PURE__*/external_react_default().createElement((Checkmark_default()), {
|
|
750
|
-
inline: true,
|
|
751
|
-
height: "16",
|
|
752
|
-
width: "16"
|
|
753
|
-
}) : /*#__PURE__*/external_react_default().createElement((Check_default()), {
|
|
754
|
-
hideDefaultTooltip: true,
|
|
755
|
-
inline: true,
|
|
756
|
-
screenReaderText: null,
|
|
757
|
-
size: 0.85
|
|
758
|
-
}));
|
|
759
|
-
return /*#__PURE__*/external_react_default().createElement(StyledClickable, Item_extends({
|
|
760
|
-
$isSelectable: isSelectable,
|
|
761
|
-
$selectableAppearance: selectableAppearance,
|
|
762
|
-
$selected: selected,
|
|
763
|
-
$active: active,
|
|
764
|
-
$preventFocus: preventFocus,
|
|
765
|
-
"data-test-selected": isSelectable ? selected : null,
|
|
766
|
-
"data-test": "item",
|
|
767
|
-
"data-has-icon": !!icon,
|
|
768
|
-
disabled: disabled,
|
|
769
|
-
onClick: onClick,
|
|
770
|
-
onFocus: this.handleFocus,
|
|
771
|
-
onMouseDown: function onMouseDown(e) {
|
|
772
|
-
if (preventFocus) {
|
|
773
|
-
e.preventDefault();
|
|
774
|
-
}
|
|
775
|
-
},
|
|
776
|
-
role: role || defaultRole,
|
|
777
|
-
to: to,
|
|
778
|
-
title: truncate && isString_default()(children) ? children : undefined,
|
|
779
|
-
openInNewContext: openInNewContext
|
|
780
|
-
}, ariaProps, omit_default()(otherProps, 'onFocus'), {
|
|
781
|
-
elementRef: this.handleMount
|
|
782
|
-
}), selectablePosition === 'left' && selectableCheckmark, selectable && selectableAppearance === 'checkbox' && /*#__PURE__*/external_react_default().createElement(StyledSwitch, {
|
|
783
|
-
interactive: false,
|
|
784
|
-
selected: selected,
|
|
785
|
-
selectedLabel: "Selected",
|
|
786
|
-
value: "menu-item"
|
|
787
|
-
}), hasSubmenu && /*#__PURE__*/external_react_default().createElement(StyledSubmenu, null, isEnterprise ? /*#__PURE__*/external_react_default().createElement((ChevronRight_default()), {
|
|
788
|
-
hideDefaultTooltip: true,
|
|
789
|
-
screenReaderText: null
|
|
790
|
-
}) : /*#__PURE__*/external_react_default().createElement((CaretSmallRight_default()), {
|
|
791
|
-
height: "24",
|
|
792
|
-
width: "24"
|
|
793
|
-
})), descriptionRight && /*#__PURE__*/external_react_default().createElement(StyledItemDescriptionRight, {
|
|
794
|
-
"data-test": "description"
|
|
795
|
-
}, description), /*#__PURE__*/external_react_default().createElement(StyledInnerWrapper, null, icon && /*#__PURE__*/external_react_default().createElement(StyledItemIcon, null, icon), /*#__PURE__*/external_react_default().createElement(StyledTitleAndDescriptionWrapper, {
|
|
796
|
-
$truncate: truncate
|
|
797
|
-
}, /*#__PURE__*/external_react_default().createElement(StyledLabel, {
|
|
798
|
-
$truncate: truncate,
|
|
799
|
-
"data-test": "label"
|
|
800
|
-
}, this.renderLabel(), openInNewContext && /*#__PURE__*/external_react_default().createElement(icons_External, null)), descriptionBottom && /*#__PURE__*/external_react_default().createElement(StyledItemDescriptionBottom, {
|
|
801
|
-
"data-test": "description"
|
|
802
|
-
}, description)), selectablePosition === 'right' && selectableCheckmark));
|
|
614
|
+
function Pe(e, t) {
|
|
615
|
+
for (var r = 0; r < t.length; r++) {
|
|
616
|
+
var n = t[r];
|
|
617
|
+
n.enumerable = n.enumerable || false;
|
|
618
|
+
n.configurable = true;
|
|
619
|
+
if ("value" in n) n.writable = true;
|
|
620
|
+
Object.defineProperty(e, n.key, n);
|
|
621
|
+
}
|
|
803
622
|
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
Item_defineProperty(Item, "propTypes", Item_propTypes);
|
|
810
|
-
|
|
811
|
-
Item_defineProperty(Item, "defaultProps", defaultProps);
|
|
812
|
-
|
|
813
|
-
Item_defineProperty(Item, "as", void 0);
|
|
814
|
-
|
|
815
|
-
var ItemWithThemeBase = (0,themes_namespaceObject.withSplunkTheme)(Item);
|
|
816
|
-
var ItemWithTheme = ItemWithThemeBase;
|
|
817
|
-
ItemWithTheme.propTypes = Item.propTypes;
|
|
818
|
-
ItemWithTheme.as = 'Item';
|
|
819
|
-
/* harmony default export */ const Menu_Item = (ItemWithTheme);
|
|
820
|
-
;// CONCATENATED MODULE: external "@splunk/react-ui/Scroll"
|
|
821
|
-
const Scroll_namespaceObject = require("@splunk/react-ui/Scroll");
|
|
822
|
-
var Scroll_default = /*#__PURE__*/__webpack_require__.n(Scroll_namespaceObject);
|
|
823
|
-
;// CONCATENATED MODULE: ./src/Menu/MenuStyles.ts
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
var adjacentSiblingStyles = (0,external_styled_components_namespaceObject.css)(["border-top:1px solid ", ";"], (0,themes_namespaceObject.pick)({
|
|
828
|
-
enterprise: themes_namespaceObject.variables.gray60,
|
|
829
|
-
prisma: themes_namespaceObject.variables.neutral200
|
|
830
|
-
}));
|
|
831
|
-
var MenuStyles_Styled = external_styled_components_default().div.withConfig({
|
|
832
|
-
displayName: "MenuStyles__Styled",
|
|
833
|
-
componentId: "sc-1olffp9-0"
|
|
834
|
-
})(["", ";background-color:", ";border-radius:", ";min-width:60px;overflow:auto;position:relative;", " &:focus{outline:0;box-shadow:", ";", "}& + &{", "}"], themes_namespaceObject.mixins.reset('block'), (0,themes_namespaceObject.pick)({
|
|
835
|
-
enterprise: themes_namespaceObject.variables.backgroundColor,
|
|
836
|
-
prisma: themes_namespaceObject.variables.backgroundColorPopup
|
|
837
|
-
}), themes_namespaceObject.variables.borderRadius, (0,themes_namespaceObject.pick)({
|
|
838
|
-
prisma: (0,external_styled_components_namespaceObject.css)(["padding:8px 0;"])
|
|
839
|
-
}), themes_namespaceObject.variables.focusShadowInset, (0,themes_namespaceObject.pick)({
|
|
840
|
-
prisma: (0,external_styled_components_namespaceObject.css)(["background:", ";"], themes_namespaceObject.variables.interactiveColorOverlayHover)
|
|
841
|
-
}), adjacentSiblingStyles);
|
|
842
|
-
var StyledScroll = external_styled_components_default()(MenuStyles_Styled.withComponent((Scroll_default()))).withConfig({
|
|
843
|
-
displayName: "MenuStyles__StyledScroll",
|
|
844
|
-
componentId: "sc-1olffp9-1"
|
|
845
|
-
})(["", " + &,& + ", "{", "}"],
|
|
846
|
-
/* sc-sel */
|
|
847
|
-
MenuStyles_Styled,
|
|
848
|
-
/* sc-sel */
|
|
849
|
-
MenuStyles_Styled, adjacentSiblingStyles);
|
|
850
|
-
|
|
851
|
-
;// CONCATENATED MODULE: ./src/utils/navigateList.ts
|
|
852
|
-
// A utility for keyboard navigation of lists
|
|
853
|
-
function getNextListItem(refs, currentIndex, nextIndex) {
|
|
854
|
-
for (var i = 0; i < refs.length; i += 1) {
|
|
855
|
-
var _refs$pointer$current;
|
|
856
|
-
|
|
857
|
-
var pointer = (i + nextIndex) % refs.length;
|
|
858
|
-
|
|
859
|
-
if (((_refs$pointer$current = refs[pointer].current) === null || _refs$pointer$current === void 0 ? void 0 : _refs$pointer$current.props.disabled) !== true) {
|
|
860
|
-
return refs[pointer];
|
|
623
|
+
function _e(e, t, r) {
|
|
624
|
+
if (t) Pe(e.prototype, t);
|
|
625
|
+
if (r) Pe(e, r);
|
|
626
|
+
return e;
|
|
861
627
|
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
628
|
+
function je(e, t) {
|
|
629
|
+
if (typeof t !== "function" && t !== null) {
|
|
630
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
631
|
+
}
|
|
632
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
633
|
+
constructor: {
|
|
634
|
+
value: e,
|
|
635
|
+
writable: true,
|
|
636
|
+
configurable: true
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
if (t) Ee(e, t);
|
|
640
|
+
}
|
|
641
|
+
function Ee(e, t) {
|
|
642
|
+
Ee = Object.setPrototypeOf || function e(t, r) {
|
|
643
|
+
t.__proto__ = r;
|
|
644
|
+
return t;
|
|
645
|
+
};
|
|
646
|
+
return Ee(e, t);
|
|
647
|
+
}
|
|
648
|
+
function Te(e) {
|
|
649
|
+
var t = qe();
|
|
650
|
+
return function r() {
|
|
651
|
+
var n = Ne(e), i;
|
|
652
|
+
if (t) {
|
|
653
|
+
var o = Ne(this).constructor;
|
|
654
|
+
i = Reflect.construct(n, arguments, o);
|
|
655
|
+
} else {
|
|
656
|
+
i = n.apply(this, arguments);
|
|
657
|
+
}
|
|
658
|
+
return De(this, i);
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
function De(e, t) {
|
|
662
|
+
if (t && (we(t) === "object" || typeof t === "function")) {
|
|
663
|
+
return t;
|
|
664
|
+
}
|
|
665
|
+
return Re(e);
|
|
875
666
|
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
;// CONCATENATED MODULE: ./src/Menu/Menu.tsx
|
|
883
|
-
function Menu_extends() { Menu_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Menu_extends.apply(this, arguments); }
|
|
884
|
-
|
|
885
|
-
function Menu_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Menu_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
886
|
-
|
|
887
|
-
function Menu_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
var Menu_propTypes = {
|
|
904
|
-
children: (external_prop_types_default()).node,
|
|
905
|
-
|
|
906
|
-
/** @private */
|
|
907
|
-
controlledExternally: (external_prop_types_default()).bool,
|
|
908
|
-
elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
909
|
-
retainFocus: (external_prop_types_default()).bool,
|
|
910
|
-
stopScrollPropagation: (external_prop_types_default()).bool
|
|
911
|
-
};
|
|
912
|
-
var Menu_defaultProps = {
|
|
913
|
-
stopScrollPropagation: false
|
|
914
|
-
};
|
|
915
|
-
|
|
916
|
-
function Menu(_ref) {
|
|
917
|
-
var children = _ref.children,
|
|
918
|
-
controlledExternally = _ref.controlledExternally,
|
|
919
|
-
elementRef = _ref.elementRef,
|
|
920
|
-
retainFocusProp = _ref.retainFocus,
|
|
921
|
-
stopScrollPropagation = _ref.stopScrollPropagation,
|
|
922
|
-
otherProps = Menu_objectWithoutProperties(_ref, ["children", "controlledExternally", "elementRef", "retainFocus", "stopScrollPropagation"]);
|
|
923
|
-
|
|
924
|
-
// @docs-props-type MenuPropsBase
|
|
925
|
-
var _useContext = (0,external_react_namespaceObject.useContext)(MenuContext),
|
|
926
|
-
_useContext$role = _useContext.role,
|
|
927
|
-
role = _useContext$role === void 0 ? 'menu' : _useContext$role;
|
|
928
|
-
|
|
929
|
-
var _useContext2 = (0,external_react_namespaceObject.useContext)(Popover_namespaceObject.PopoverContext),
|
|
930
|
-
retainFocusFromContext = _useContext2.retainFocus;
|
|
931
|
-
|
|
932
|
-
var forceUpdate = useForceUpdate_default()();
|
|
933
|
-
var retainFocus = true;
|
|
934
|
-
|
|
935
|
-
if (retainFocusProp != null) {
|
|
936
|
-
retainFocus = retainFocusProp;
|
|
937
|
-
} else if (retainFocusFromContext != null) {
|
|
938
|
-
retainFocus = retainFocusFromContext;
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
var focusedItemKeyRef = external_react_default().useRef(0);
|
|
942
|
-
var itemRefs = [];
|
|
943
|
-
var itemKeyCounter = 0;
|
|
944
|
-
var firstEnabledItemKey;
|
|
945
|
-
var focusedItemKeyIsDisabled = false;
|
|
946
|
-
var hasSelectedItems = false;
|
|
947
|
-
var hasSelectedEnabledItems = false;
|
|
948
|
-
|
|
949
|
-
var handleKeyDown = function handleKeyDown(e) {
|
|
950
|
-
// SUI-2734: keeping this active even if controlledExternally is set
|
|
951
|
-
// because Firefox + Voiceover (and possibly other a11y tools)
|
|
952
|
-
// can still set focus on the Menu items and this avoids the
|
|
953
|
-
// whole page scrolling when that happens
|
|
954
|
-
var key = (0,keyboard_namespaceObject.keycode)(e.nativeEvent);
|
|
955
|
-
var focusedItemKey = focusedItemKeyRef.current;
|
|
956
|
-
var itemToFocusRef; // the "retainFocus" checks here mimic the prior tab key functionality
|
|
957
|
-
|
|
958
|
-
if (key === 'down' || retainFocus && (0,focus_namespaceObject.isTabKey)(e)) {
|
|
959
|
-
itemToFocusRef = getNextListItem(itemRefs, focusedItemKey, focusedItemKey + 1);
|
|
960
|
-
} else if (key === 'up' || retainFocus && (0,focus_namespaceObject.isTabKey)(e) && e.shiftKey) {
|
|
961
|
-
itemToFocusRef = getPrevListItem(itemRefs, focusedItemKey, focusedItemKey - 1);
|
|
962
|
-
} else if (key === 'home') {
|
|
963
|
-
itemToFocusRef = getNextListItem(itemRefs, focusedItemKey, 0);
|
|
964
|
-
} else if (key === 'end') {
|
|
965
|
-
itemToFocusRef = getPrevListItem(itemRefs, focusedItemKey, itemRefs.length - 1);
|
|
667
|
+
function Re(e) {
|
|
668
|
+
if (e === void 0) {
|
|
669
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
670
|
+
}
|
|
671
|
+
return e;
|
|
966
672
|
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
673
|
+
function qe() {
|
|
674
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
675
|
+
if (Reflect.construct.sham) return false;
|
|
676
|
+
if (typeof Proxy === "function") return true;
|
|
677
|
+
try {
|
|
678
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
679
|
+
return true;
|
|
680
|
+
} catch (e) {
|
|
681
|
+
return false;
|
|
682
|
+
}
|
|
973
683
|
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
if (itemKey != null) {
|
|
980
|
-
focusedItemKeyRef.current = itemKey;
|
|
684
|
+
function Ne(e) {
|
|
685
|
+
Ne = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
686
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
687
|
+
};
|
|
688
|
+
return Ne(e);
|
|
981
689
|
}
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
690
|
+
function He(e, t, r) {
|
|
691
|
+
if (t in e) {
|
|
692
|
+
Object.defineProperty(e, t, {
|
|
693
|
+
value: r,
|
|
694
|
+
enumerable: true,
|
|
695
|
+
configurable: true,
|
|
696
|
+
writable: true
|
|
697
|
+
});
|
|
698
|
+
} else {
|
|
699
|
+
e[t] = r;
|
|
700
|
+
}
|
|
701
|
+
return e;
|
|
702
|
+
}
|
|
703
|
+
var Fe = {
|
|
704
|
+
active: o().bool,
|
|
705
|
+
children: o().node,
|
|
706
|
+
description: o().string,
|
|
707
|
+
descriptionPosition: o().oneOf([ "right", "bottom" ]),
|
|
708
|
+
disabled: o().bool,
|
|
709
|
+
elementRef: o().oneOfType([ o().func, o().object ]),
|
|
710
|
+
hasSubmenu: o().bool,
|
|
711
|
+
icon: o().node,
|
|
712
|
+
/** @private. The internal key of the tab */
|
|
713
|
+
itemKey: o().number,
|
|
714
|
+
matchRanges: o().arrayOf(o().shape({
|
|
715
|
+
start: o().number.isRequired,
|
|
716
|
+
end: o().number.isRequired
|
|
717
|
+
})),
|
|
718
|
+
onClick: o().func,
|
|
719
|
+
/** @private */
|
|
720
|
+
onFocus: o().func,
|
|
721
|
+
openInNewContext: o().bool,
|
|
722
|
+
/** @private */
|
|
723
|
+
preventFocus: o().bool,
|
|
724
|
+
role: o().oneOf([ "menuitem", "menuitemradio", "menuitemcheckbox", "listboxitem", "option" ]),
|
|
725
|
+
selectable: o().bool,
|
|
726
|
+
selectableAppearance: o().oneOf([ "checkmark", "checkbox" ]),
|
|
727
|
+
selected: o().bool,
|
|
728
|
+
/** @private */
|
|
729
|
+
splunkTheme: o().object,
|
|
730
|
+
to: o().string,
|
|
731
|
+
truncate: o().bool
|
|
732
|
+
};
|
|
733
|
+
var $e = {
|
|
734
|
+
active: false,
|
|
735
|
+
descriptionPosition: "bottom",
|
|
736
|
+
disabled: false,
|
|
737
|
+
hasSubmenu: false,
|
|
738
|
+
openInNewContext: false,
|
|
739
|
+
preventFocus: false,
|
|
740
|
+
selectable: false,
|
|
741
|
+
selectableAppearance: "checkmark",
|
|
742
|
+
selected: false,
|
|
743
|
+
truncate: false
|
|
744
|
+
};
|
|
745
|
+
var Ae = function(e) {
|
|
746
|
+
je(r, e);
|
|
747
|
+
var t = Te(r);
|
|
748
|
+
_e(r, null, [ {
|
|
749
|
+
key: "validateProps",
|
|
750
|
+
// @docs-props-type ItemPropsBase
|
|
751
|
+
value: function e(t) {
|
|
752
|
+
if (false) {}
|
|
753
|
+
}
|
|
754
|
+
} ]);
|
|
755
|
+
function r(e) {
|
|
756
|
+
var n;
|
|
757
|
+
Ie(this, r);
|
|
758
|
+
n = t.call(this, e);
|
|
759
|
+
He(Re(n), "el", null);
|
|
760
|
+
He(Re(n), "handleFocus", (function(e) {
|
|
761
|
+
var t = n.props, r = t.onFocus, i = t.itemKey;
|
|
762
|
+
r === null || r === void 0 ? void 0 : r(e, {
|
|
763
|
+
itemKey: i
|
|
764
|
+
});
|
|
765
|
+
}));
|
|
766
|
+
He(Re(n), "handleMount", (function(e) {
|
|
767
|
+
n.el = e;
|
|
768
|
+
ke(n.props.elementRef, e);
|
|
769
|
+
}));
|
|
770
|
+
r.validateProps(e);
|
|
771
|
+
return n;
|
|
772
|
+
}
|
|
773
|
+
_e(r, [ {
|
|
774
|
+
key: "componentDidUpdate",
|
|
775
|
+
value: function e() {
|
|
776
|
+
r.validateProps(this.props);
|
|
777
|
+
}
|
|
778
|
+
}, {
|
|
779
|
+
key: "focus",
|
|
780
|
+
value: function e() {
|
|
781
|
+
var t;
|
|
782
|
+
(t = this.el) === null || t === void 0 ? void 0 : t.focus();
|
|
783
|
+
}
|
|
784
|
+
}, {
|
|
785
|
+
key: "scrollIntoViewIfNeeded",
|
|
786
|
+
value: function e() {
|
|
787
|
+
xe(this.el);
|
|
788
|
+
}
|
|
789
|
+
}, {
|
|
790
|
+
key: "renderLabel",
|
|
791
|
+
value: function e() {
|
|
792
|
+
var t = this.props, r = t.children, i = t.matchRanges;
|
|
793
|
+
if (!i || !$()(r)) {
|
|
794
|
+
return r;
|
|
795
|
+
}
|
|
796
|
+
var o = [];
|
|
797
|
+
// before first match. May be empty string.
|
|
798
|
+
o.push(r.substring(0, i[0].start));
|
|
799
|
+
i.forEach((function(e, t) {
|
|
800
|
+
o.push(
|
|
801
|
+
|
|
802
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
803
|
+
n().createElement(le, {
|
|
804
|
+
key: t,
|
|
805
|
+
"data-test": "match"
|
|
806
|
+
}, r.substring(e.start, e.end)));
|
|
807
|
+
if (t < i.length - 1) {
|
|
808
|
+
o.push(r.substring(e.end, i[t + 1].start));
|
|
809
|
+
} else {
|
|
810
|
+
o.push(r.substring(e.end, r.length));
|
|
811
|
+
}
|
|
812
|
+
}));
|
|
813
|
+
return o;
|
|
814
|
+
}
|
|
815
|
+
}, {
|
|
816
|
+
key: "render",
|
|
817
|
+
value: function e() {
|
|
818
|
+
var t = this.props, r = t.active, i = t.children, o = t.hasSubmenu, a = t.selectable, s = t.selectableAppearance, c = t.selected, p = t.icon, u = t.description, d = t.disabled, f = t.onClick, v = t.preventFocus, b = t.role, m = t.splunkTheme, h = t.to, y = t.truncate, g = t.descriptionPosition, k = t.openInNewContext, x = Oe(t, [ "active", "children", "hasSubmenu", "selectable", "selectableAppearance", "selected", "icon", "description", "disabled", "onClick", "preventFocus", "role", "splunkTheme", "to", "truncate", "descriptionPosition", "openInNewContext" ]);
|
|
819
|
+
var w = m.isEnterprise, S = m.isPrisma;
|
|
820
|
+
var O = a || c;
|
|
821
|
+
var C = {
|
|
822
|
+
nonselectable: "menuitem",
|
|
823
|
+
checkmark: "menuitemradio",
|
|
824
|
+
checkbox: "menuitemcheckbox"
|
|
825
|
+
}[O ? s : "nonselectable"];
|
|
826
|
+
// aria-checked updates only with checkmark appearance for now SUI-2578
|
|
827
|
+
var I = {
|
|
828
|
+
"aria-haspopup": o ? true : undefined,
|
|
829
|
+
"aria-checked": s === "checkmark" && c ? true : undefined
|
|
830
|
+
};
|
|
831
|
+
var P = S ? "right" : "left";
|
|
832
|
+
var _ = u && g === "right" && P !== "right";
|
|
833
|
+
var j = u && !_;
|
|
834
|
+
var E = c && s === "checkmark" && n().createElement(ee, null, S ? n().createElement(z(), {
|
|
835
|
+
inline: true,
|
|
836
|
+
height: "16",
|
|
837
|
+
width: "16"
|
|
838
|
+
}) : n().createElement(W(), {
|
|
839
|
+
hideDefaultTooltip: true,
|
|
840
|
+
inline: true,
|
|
841
|
+
screenReaderText: null,
|
|
842
|
+
size: .85
|
|
843
|
+
}));
|
|
844
|
+
|
|
845
|
+
return n().createElement(re, Se({
|
|
846
|
+
$isSelectable: O,
|
|
847
|
+
$selectableAppearance: s,
|
|
848
|
+
$selected: c,
|
|
849
|
+
$active: r,
|
|
850
|
+
$preventFocus: v,
|
|
851
|
+
"data-test-selected": O ? c : null,
|
|
852
|
+
"data-test": "item",
|
|
853
|
+
"data-has-icon": !!p,
|
|
854
|
+
disabled: d,
|
|
855
|
+
onClick: f,
|
|
856
|
+
onFocus: this.handleFocus,
|
|
857
|
+
onMouseDown: function e(t) {
|
|
858
|
+
if (v) {
|
|
859
|
+
t.preventDefault();
|
|
860
|
+
}
|
|
861
|
+
},
|
|
862
|
+
role: b || C,
|
|
863
|
+
to: h,
|
|
864
|
+
title: y && $()(i) ? i : undefined,
|
|
865
|
+
openInNewContext: k
|
|
866
|
+
}, I, l()(x, "onFocus"), {
|
|
867
|
+
elementRef: this.handleMount
|
|
868
|
+
}), P === "left" && E, a && s === "checkbox" && n().createElement(ne, {
|
|
869
|
+
interactive: false,
|
|
870
|
+
selected: c,
|
|
871
|
+
selectedLabel: "Selected",
|
|
872
|
+
value: "menu-item"
|
|
873
|
+
}), o && n().createElement(se, null, w ? n().createElement(G(), {
|
|
874
|
+
hideDefaultTooltip: true,
|
|
875
|
+
screenReaderText: null
|
|
876
|
+
}) : n().createElement(M(), null)), _ && n().createElement(Z, {
|
|
877
|
+
"data-test": "description"
|
|
878
|
+
}, u), n().createElement(ie, null, p && n().createElement(te, null, p), n().createElement(oe, {
|
|
879
|
+
$truncate: y
|
|
880
|
+
}, n().createElement(ae, {
|
|
881
|
+
$truncate: y,
|
|
882
|
+
"data-test": "label"
|
|
883
|
+
}, this.renderLabel(), k && n().createElement(ge, null)), j && n().createElement(X, {
|
|
884
|
+
"data-test": "description"
|
|
885
|
+
}, u)), P === "right" && E));
|
|
886
|
+
}
|
|
887
|
+
} ]);
|
|
888
|
+
return r;
|
|
889
|
+
}(r.Component);
|
|
890
|
+
He(Ae, "propTypes", Fe);
|
|
891
|
+
He(Ae, "defaultProps", $e);
|
|
892
|
+
He(Ae, "as", void 0);
|
|
893
|
+
var Me = (0, b.withSplunkTheme)(Ae);
|
|
894
|
+
var Ke = Me;
|
|
895
|
+
Ke.propTypes = Ae.propTypes;
|
|
896
|
+
Ke.as = "Item";
|
|
897
|
+
/* harmony default export */ const ze = Ke;
|
|
898
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Scroll"
|
|
899
|
+
const Le = require("@splunk/react-ui/Scroll");
|
|
900
|
+
var We = e.n(Le);
|
|
901
|
+
// CONCATENATED MODULE: ./src/Menu/MenuStyles.ts
|
|
902
|
+
var Be = (0, f.css)([ "border-top:1px solid ", ";" ], (0, b.pick)({
|
|
903
|
+
enterprise: b.variables.gray60,
|
|
904
|
+
prisma: b.variables.neutral200
|
|
905
|
+
}));
|
|
906
|
+
var Ge = v().div.withConfig({
|
|
907
|
+
displayName: "MenuStyles__Styled",
|
|
908
|
+
componentId: "sc-1olffp9-0"
|
|
909
|
+
})([ "", ";background-color:", ";border-radius:", ";min-width:60px;overflow:auto;position:relative;", " &:focus{outline:0;box-shadow:", ";", "}& + &{", "}" ], b.mixins.reset("block"), (0,
|
|
910
|
+
b.pick)({
|
|
911
|
+
enterprise: b.variables.backgroundColor,
|
|
912
|
+
prisma: b.variables.backgroundColorPopup
|
|
913
|
+
}), b.variables.borderRadius, (0, b.pick)({
|
|
914
|
+
prisma: (0, f.css)([ "padding:8px 0;" ])
|
|
915
|
+
}), b.variables.focusShadowInset, (0, b.pick)({
|
|
916
|
+
prisma: (0, f.css)([ "background:", ";" ], b.variables.interactiveColorOverlayHover)
|
|
917
|
+
}), Be);
|
|
918
|
+
var Ue = v()(Ge.withComponent(We())).withConfig({
|
|
919
|
+
displayName: "MenuStyles__StyledScroll",
|
|
920
|
+
componentId: "sc-1olffp9-1"
|
|
921
|
+
})([ "", " + &,& + ", "{", "}" ],
|
|
922
|
+
/* sc-sel */
|
|
923
|
+
Ge,
|
|
924
|
+
/* sc-sel */
|
|
925
|
+
Ge, Be);
|
|
926
|
+
// CONCATENATED MODULE: ./src/utils/navigateList.ts
|
|
927
|
+
// A utility for keyboard navigation of lists
|
|
928
|
+
function Ve(e, t, r) {
|
|
929
|
+
for (var n = 0; n < e.length; n += 1) {
|
|
930
|
+
var i;
|
|
931
|
+
var o = (n + r) % e.length;
|
|
932
|
+
if (((i = e[o].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
|
|
933
|
+
return e[o];
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
return e[t];
|
|
937
|
+
}
|
|
938
|
+
function Qe(e, t, r) {
|
|
939
|
+
for (var n = e.length; n > 0; n -= 1) {
|
|
940
|
+
var i;
|
|
941
|
+
var o = (n + r) % e.length;
|
|
942
|
+
if (((i = e[o].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
|
|
943
|
+
return e[o];
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
return e[t];
|
|
947
|
+
}
|
|
948
|
+
// CONCATENATED MODULE: ./src/Menu/Menu.tsx
|
|
949
|
+
function Ye() {
|
|
950
|
+
Ye = Object.assign || function(e) {
|
|
951
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
952
|
+
var r = arguments[t];
|
|
953
|
+
for (var n in r) {
|
|
954
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
955
|
+
e[n] = r[n];
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
return e;
|
|
960
|
+
};
|
|
961
|
+
return Ye.apply(this, arguments);
|
|
962
|
+
}
|
|
963
|
+
function Je(e, t) {
|
|
964
|
+
if (e == null) return {};
|
|
965
|
+
var r = Xe(e, t);
|
|
966
|
+
var n, i;
|
|
967
|
+
if (Object.getOwnPropertySymbols) {
|
|
968
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
969
|
+
for (i = 0; i < o.length; i++) {
|
|
970
|
+
n = o[i];
|
|
971
|
+
if (t.indexOf(n) >= 0) continue;
|
|
972
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
973
|
+
r[n] = e[n];
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
return r;
|
|
977
|
+
}
|
|
978
|
+
function Xe(e, t) {
|
|
979
|
+
if (e == null) return {};
|
|
980
|
+
var r = {};
|
|
981
|
+
var n = Object.keys(e);
|
|
982
|
+
var i, o;
|
|
983
|
+
for (o = 0; o < n.length; o++) {
|
|
984
|
+
i = n[o];
|
|
985
|
+
if (t.indexOf(i) >= 0) continue;
|
|
986
|
+
r[i] = e[i];
|
|
987
|
+
}
|
|
988
|
+
return r;
|
|
989
|
+
}
|
|
990
|
+
var Ze = {
|
|
991
|
+
children: o().node,
|
|
992
|
+
/** @private */
|
|
993
|
+
controlledExternally: o().bool,
|
|
994
|
+
elementRef: o().oneOfType([ o().func, o().object ]),
|
|
995
|
+
retainFocus: o().bool,
|
|
996
|
+
stopScrollPropagation: o().bool
|
|
997
|
+
};
|
|
998
|
+
var et = {
|
|
999
|
+
stopScrollPropagation: false
|
|
1000
|
+
};
|
|
1001
|
+
function tt(e) {
|
|
1002
|
+
var t = e.children, i = e.controlledExternally, o = e.elementRef, a = e.retainFocus, u = e.stopScrollPropagation, f = Je(e, [ "children", "controlledExternally", "elementRef", "retainFocus", "stopScrollPropagation" ]);
|
|
1003
|
+
// @docs-props-type MenuPropsBase
|
|
1004
|
+
var v = (0, r.useContext)(h), b = v.role, m = b === void 0 ? "menu" : b;
|
|
1005
|
+
var y = (0, r.useContext)(s.PopoverContext), g = y.retainFocus;
|
|
1006
|
+
var k = d()();
|
|
1007
|
+
var x = true;
|
|
1008
|
+
if (a != null) {
|
|
1009
|
+
x = a;
|
|
1010
|
+
} else if (g != null) {
|
|
1011
|
+
x = g;
|
|
1012
|
+
}
|
|
1013
|
+
var w = n().useRef(0);
|
|
1014
|
+
var S = [];
|
|
1015
|
+
var O = 0;
|
|
1016
|
+
var C;
|
|
1017
|
+
var I = false;
|
|
1018
|
+
var P = false;
|
|
1019
|
+
var _ = false;
|
|
1020
|
+
var j = function e(t) {
|
|
1021
|
+
// SUI-2734: keeping this active even if controlledExternally is set
|
|
1022
|
+
// because Firefox + Voiceover (and possibly other a11y tools)
|
|
1023
|
+
// can still set focus on the Menu items and this avoids the
|
|
1024
|
+
// whole page scrolling when that happens
|
|
1025
|
+
var r = (0, p.keycode)(t.nativeEvent);
|
|
1026
|
+
var n = w.current;
|
|
1027
|
+
var i;
|
|
1028
|
+
// the "retainFocus" checks here mimic the prior tab key functionality
|
|
1029
|
+
if (r === "down" || x && (0, c.isTabKey)(t)) {
|
|
1030
|
+
i = Ve(S, n, n + 1);
|
|
1031
|
+
} else if (r === "up" || x && (0, c.isTabKey)(t) && t.shiftKey) {
|
|
1032
|
+
i = Qe(S, n, n - 1);
|
|
1033
|
+
} else if (r === "home") {
|
|
1034
|
+
i = Ve(S, n, 0);
|
|
1035
|
+
} else if (r === "end") {
|
|
1036
|
+
i = Qe(S, n, S.length - 1);
|
|
1037
|
+
}
|
|
1038
|
+
if (i != null) {
|
|
1039
|
+
var o, a;
|
|
1040
|
+
(o = i.current) === null || o === void 0 ? void 0 : (a = o.focus) === null || a === void 0 ? void 0 : a.call(o);
|
|
1041
|
+
t.preventDefault();
|
|
1042
|
+
}
|
|
1043
|
+
};
|
|
1044
|
+
var E = (0, r.useCallback)((function(e, t) {
|
|
1045
|
+
var r = t.itemKey;
|
|
1046
|
+
if (r != null) {
|
|
1047
|
+
w.current = r;
|
|
1048
|
+
}
|
|
1049
|
+
}), []);
|
|
1050
|
+
var T = r.Children.toArray(t).filter(r.isValidElement).reduce((function(e, t, r, o) {
|
|
1051
|
+
/* Filter out initial Dividers
|
|
985
1052
|
* Requires reduce() over filter() because a Heading may have been
|
|
986
1053
|
* before the Divider.
|
|
987
1054
|
*/
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1055
|
+
if (t.type.as === "Divider" && e.length === 0) {
|
|
1056
|
+
return e;
|
|
1057
|
+
}
|
|
1058
|
+
// Filter out consecutive Dividers and Headings
|
|
1059
|
+
// If Divider is next to Heading then it will remove both Heading and Divider unless Heading has title prop set to it
|
|
1060
|
+
if ((t.type.as === "Heading" || t.type.as === "Divider") && !t.props.title && t.type.filterConsecutive && o.length > r + 1) {
|
|
1061
|
+
var a = o[r + 1];
|
|
1062
|
+
if (a.type.as === "Heading" || a.type.as === "Divider") {
|
|
1063
|
+
return e;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
// Filter out last Dividers and Headings
|
|
1067
|
+
if ((t.type.as === "Divider" || t.type.as === "Heading") && r === o.length - 1) {
|
|
1068
|
+
return e;
|
|
1069
|
+
}
|
|
1070
|
+
// the filterConsecutive check filters out Headings and Dividers whether styled or not
|
|
1071
|
+
// the typeof check prevents props from being applied to HTML elements
|
|
1072
|
+
// such as the zero-height scroll bottom div in <ResultsMenu>
|
|
1073
|
+
if (!(t.type.as === "Divider" || t.type.as === "Heading") && typeof t.type !== "string") {
|
|
1074
|
+
var l = n().createRef();
|
|
1075
|
+
S.push(l);
|
|
1076
|
+
if (C == null && (!("disabled" in t.props) || !t.props.disabled)) {
|
|
1077
|
+
C = O;
|
|
1078
|
+
}
|
|
1079
|
+
if (w.current === O && "disabled" in t.props && t.props.disabled) {
|
|
1080
|
+
I = true;
|
|
1081
|
+
}
|
|
1082
|
+
if ("selected" in t.props && t.props.selected) {
|
|
1083
|
+
P = true;
|
|
1084
|
+
if ("disabled" in t.props && !t.props.disabled) {
|
|
1085
|
+
_ = true;
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
var s = !i && w.current === O ? undefined : -1;
|
|
1089
|
+
e.push( n().cloneElement(t, {
|
|
1090
|
+
itemKey: O,
|
|
1091
|
+
onFocus: E,
|
|
1092
|
+
preventFocus: i,
|
|
1093
|
+
ref: function e(r) {
|
|
1094
|
+
ke(t.ref, r);
|
|
1095
|
+
ke(l, r);
|
|
1096
|
+
},
|
|
1097
|
+
tabIndex: s
|
|
1098
|
+
}));
|
|
1099
|
+
O += 1;
|
|
1100
|
+
return e;
|
|
1101
|
+
}
|
|
1102
|
+
e.push(t);
|
|
1103
|
+
return e;
|
|
1104
|
+
}), []);
|
|
1105
|
+
if (C !== w.current && (!P || _) && I && C != null) {
|
|
1106
|
+
w.current = C;
|
|
1107
|
+
k();
|
|
1028
1108
|
}
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
}));
|
|
1042
|
-
itemKeyCounter += 1;
|
|
1043
|
-
return acc;
|
|
1109
|
+
var D = {
|
|
1110
|
+
"data-test": "menu",
|
|
1111
|
+
onKeyDown: j,
|
|
1112
|
+
role: m,
|
|
1113
|
+
tabIndex: C == null && !i ? 0 : undefined
|
|
1114
|
+
};
|
|
1115
|
+
return u ? n().createElement(Ue, Ye({}, D, {
|
|
1116
|
+
elementRef: o,
|
|
1117
|
+
stopScrollPropagation: true
|
|
1118
|
+
}, l()(f, "tagName")), T) : n().createElement(Ge, Ye({}, D, {
|
|
1119
|
+
ref: o
|
|
1120
|
+
}, f), T);
|
|
1044
1121
|
}
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
var sharedProps = {
|
|
1056
|
-
'data-test': 'menu',
|
|
1057
|
-
onKeyDown: handleKeyDown,
|
|
1058
|
-
role: role,
|
|
1059
|
-
tabIndex: firstEnabledItemKey == null && !controlledExternally ? 0 : undefined
|
|
1060
|
-
};
|
|
1061
|
-
return stopScrollPropagation ? /*#__PURE__*/external_react_default().createElement(StyledScroll, Menu_extends({}, sharedProps, {
|
|
1062
|
-
elementRef: elementRef,
|
|
1063
|
-
stopScrollPropagation: true
|
|
1064
|
-
}, omit_default()(otherProps, 'tagName')), childrenCleaned) : /*#__PURE__*/external_react_default().createElement(MenuStyles_Styled, Menu_extends({}, sharedProps, {
|
|
1065
|
-
ref: elementRef
|
|
1066
|
-
}, otherProps), childrenCleaned);
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
Menu.propTypes = Menu_propTypes;
|
|
1070
|
-
Menu.defaultProps = Menu_defaultProps;
|
|
1071
|
-
Menu.Item = Menu_Item;
|
|
1072
|
-
Menu.Divider = Menu_Divider;
|
|
1073
|
-
Menu.Heading = Menu_Heading;
|
|
1074
|
-
/* harmony default export */ const Menu_Menu = (Menu);
|
|
1075
|
-
|
|
1076
|
-
;// CONCATENATED MODULE: ./src/Menu/index.ts
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
module.exports = __webpack_exports__;
|
|
1081
|
-
/******/ })()
|
|
1082
|
-
;
|
|
1122
|
+
tt.propTypes = Ze;
|
|
1123
|
+
tt.defaultProps = et;
|
|
1124
|
+
tt.Item = ze;
|
|
1125
|
+
tt.Divider = x;
|
|
1126
|
+
tt.Heading = H;
|
|
1127
|
+
/* harmony default export */ const rt = tt;
|
|
1128
|
+
// CONCATENATED MODULE: ./src/Menu/index.ts
|
|
1129
|
+
module.exports = t;
|
|
1130
|
+
/******/})();
|