@splunk/react-ui 4.32.0 → 4.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Button.js +59 -65
- package/ButtonGroup.js +20 -23
- package/ButtonSimple.js +374 -339
- package/CHANGELOG.md +54 -0
- package/Card.js +56 -44
- package/Chip.js +2 -6
- package/Clickable.js +21 -19
- package/CollapsiblePanel.js +281 -264
- package/Color.js +88 -86
- package/Concertina.js +7 -7
- package/ControlGroup.js +18 -18
- package/DualListbox.js +8 -11
- package/File.js +25 -30
- package/FormRows.js +232 -210
- package/Image.js +13 -13
- package/JSONTree.js +22 -22
- package/MIGRATION.mdx +99 -0
- package/Markdown.js +12 -12
- package/Menu.js +505 -719
- package/Message.js +205 -204
- package/MessageBar.js +104 -104
- package/Modal.js +158 -133
- package/Multiselect.js +81 -70
- 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 +256 -261
- package/Search.js +21 -24
- package/Select.js +265 -246
- package/Slider.js +9 -9
- package/SplitButton.js +1 -4
- package/StaticContent.js +1 -1
- package/StepBar.js +1 -1
- package/Switch.js +169 -171
- package/TabBar.js +14 -6
- package/Table.js +65 -67
- package/Text.js +30 -37
- package/TextArea.js +162 -163
- package/Tooltip.js +1 -1
- package/package.json +9 -9
- package/stubs-splunkui.d.ts +11 -0
- package/types/src/Button/Button.d.ts +4 -4
- package/types/src/ButtonSimple/ButtonSimple.d.ts +8 -6
- package/types/src/ButtonSimple/mixin.d.ts +2 -2
- package/types/src/Card/Card.d.ts +3 -1
- package/types/src/Card/Header.d.ts +22 -3
- package/types/src/Clickable/Clickable.d.ts +3 -2
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +5 -0
- package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +1 -3
- package/types/src/Date/Date.d.ts +2 -2
- package/types/src/Menu/Item.d.ts +3 -1
- package/types/src/Menu/Menu.d.ts +16 -21
- package/types/src/Menu/MenuContext.d.ts +3 -2
- package/types/src/Number/Number.d.ts +2 -2
- 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 +5 -22
- package/types/src/Select/Select.d.ts +8 -4
- package/types/src/Select/SelectBase.d.ts +8 -4
- package/types/src/Slider/Slider.d.ts +2 -2
- package/types/src/Table/Body.d.ts +0 -4
- package/types/src/Text/docs/examples/Basic.d.ts +1 -9
- package/types/src/Text/docs/examples/Error.d.ts +2 -10
- package/types/src/Text/docs/examples/Inline.d.ts +1 -9
- package/types/src/Text/docs/examples/Multiline.d.ts +1 -9
- package/types/src/Text/docs/examples/Password.d.ts +1 -9
- package/types/src/Text/docs/examples/Search.d.ts +1 -9
- package/useRovingFocus.js +26 -40
- package/types/src/Button/docs/examples/prisma/Basic.d.ts +0 -2
- package/types/src/Button/docs/examples/prisma/Block.d.ts +0 -2
- package/types/src/Button/docs/examples/prisma/Disabled.d.ts +0 -2
- package/types/src/Button/docs/examples/prisma/Icons.d.ts +0 -2
- package/types/src/Button/docs/examples/prisma/Menus.d.ts +0 -2
- package/types/src/Button/docs/examples/prisma/To.d.ts +0 -2
- package/types/src/Button/docs/examples/prisma/Truncated.d.ts +0 -2
- package/types/src/Select/docs/examples/prisma/Appearance.d.ts +0 -14
- /package/types/src/{Button/docs/examples/prisma → Clickable/docs/examples}/Dimmed.d.ts +0 -0
package/Menu.js
CHANGED
|
@@ -8,27 +8,27 @@
|
|
|
8
8
|
/******/ /* webpack/runtime/compat get default export */
|
|
9
9
|
/******/ (() => {
|
|
10
10
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
-
/******/ e.n =
|
|
12
|
-
/******/ var
|
|
13
|
-
/******/ () =>
|
|
14
|
-
/******/ : () =>
|
|
11
|
+
/******/ e.n = t => {
|
|
12
|
+
/******/ var r = t && t.__esModule ?
|
|
13
|
+
/******/ () => t["default"]
|
|
14
|
+
/******/ : () => t
|
|
15
15
|
/******/;
|
|
16
|
-
e.d(
|
|
17
|
-
a:
|
|
16
|
+
e.d(r, {
|
|
17
|
+
a: r
|
|
18
18
|
});
|
|
19
|
-
/******/ return
|
|
19
|
+
/******/ return r;
|
|
20
20
|
/******/ };
|
|
21
21
|
/******/ })();
|
|
22
22
|
/******/
|
|
23
23
|
/******/ /* webpack/runtime/define property getters */
|
|
24
24
|
/******/ (() => {
|
|
25
25
|
/******/ // define getter functions for harmony exports
|
|
26
|
-
/******/ e.d = (
|
|
27
|
-
/******/ for (var n in
|
|
28
|
-
/******/ if (e.o(
|
|
29
|
-
/******/ Object.defineProperty(
|
|
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
30
|
enumerable: true,
|
|
31
|
-
get:
|
|
31
|
+
get: r[n]
|
|
32
32
|
});
|
|
33
33
|
/******/ }
|
|
34
34
|
/******/ }
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
/******/
|
|
38
38
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
39
|
/******/ (() => {
|
|
40
|
-
/******/ e.o = (e,
|
|
40
|
+
/******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
41
41
|
/******/;
|
|
42
42
|
})();
|
|
43
43
|
/******/
|
|
@@ -56,20 +56,20 @@
|
|
|
56
56
|
/******/ };
|
|
57
57
|
/******/ })();
|
|
58
58
|
/******/
|
|
59
|
-
/************************************************************************/ var
|
|
59
|
+
/************************************************************************/ var t = {};
|
|
60
60
|
// ESM COMPAT FLAG
|
|
61
|
-
e.r(
|
|
61
|
+
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
|
-
e.d(
|
|
64
|
-
Divider: () => /* reexport */
|
|
63
|
+
e.d(t, {
|
|
64
|
+
Divider: () => /* reexport */ k,
|
|
65
65
|
Heading: () => /* reexport */ N,
|
|
66
|
-
Item: () => /* reexport */
|
|
67
|
-
MenuContext: () => /* reexport */
|
|
68
|
-
default: () => /* reexport */
|
|
66
|
+
Item: () => /* reexport */ Le,
|
|
67
|
+
MenuContext: () => /* reexport */ m,
|
|
68
|
+
default: () => /* reexport */ Ze
|
|
69
69
|
});
|
|
70
70
|
// CONCATENATED MODULE: external "react"
|
|
71
|
-
const
|
|
72
|
-
var n = e.n(
|
|
71
|
+
const r = require("react");
|
|
72
|
+
var n = e.n(r);
|
|
73
73
|
// CONCATENATED MODULE: external "prop-types"
|
|
74
74
|
const i = require("prop-types");
|
|
75
75
|
var a = e.n(i);
|
|
@@ -78,43 +78,42 @@
|
|
|
78
78
|
var l = e.n(o);
|
|
79
79
|
// CONCATENATED MODULE: external "@splunk/react-ui/Popover"
|
|
80
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
81
|
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
84
|
-
const
|
|
85
|
-
// CONCATENATED MODULE: external "@splunk/
|
|
86
|
-
const p = require("@splunk/
|
|
87
|
-
var f = e.n(p);
|
|
82
|
+
const c = require("@splunk/ui-utils/keyboard");
|
|
83
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/focus"
|
|
84
|
+
const p = require("@splunk/ui-utils/focus");
|
|
88
85
|
// CONCATENATED MODULE: external "styled-components"
|
|
89
|
-
const
|
|
90
|
-
var
|
|
86
|
+
const u = require("styled-components");
|
|
87
|
+
var d = e.n(u);
|
|
91
88
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
92
|
-
const
|
|
89
|
+
const f = require("@splunk/themes");
|
|
93
90
|
// CONCATENATED MODULE: ./src/Menu/DividerStyles.ts
|
|
94
|
-
var
|
|
91
|
+
var v = d().div.withConfig({
|
|
95
92
|
displayName: "DividerStyles__Styled",
|
|
96
93
|
componentId: "l3zfh3-0"
|
|
97
|
-
})([ "border-top:1px solid ", ";", "" ], (0,
|
|
98
|
-
enterprise:
|
|
99
|
-
prisma:
|
|
100
|
-
}), (0,
|
|
94
|
+
})([ "border-top:1px solid ", ";", "" ], (0, f.pick)({
|
|
95
|
+
enterprise: f.variables.borderColor,
|
|
96
|
+
prisma: f.variables.neutral200
|
|
97
|
+
}), (0, f.pick)({
|
|
101
98
|
prisma: {
|
|
102
|
-
comfortable: (0,
|
|
103
|
-
compact: (0,
|
|
99
|
+
comfortable: (0, u.css)([ "margin:8px 0;" ]),
|
|
100
|
+
compact: (0, u.css)([ "margin:6px 0;" ])
|
|
104
101
|
}
|
|
105
102
|
}));
|
|
106
103
|
// CONCATENATED MODULE: ./src/Menu/MenuContext.tsx
|
|
107
|
-
var
|
|
108
|
-
role: "menu"
|
|
104
|
+
var b = (0, r.createContext)({
|
|
105
|
+
role: "menu",
|
|
106
|
+
preventFocus: false
|
|
109
107
|
});
|
|
108
|
+
/* harmony default export */ const m = b;
|
|
110
109
|
// CONCATENATED MODULE: ./src/Menu/Divider.tsx
|
|
111
110
|
function h() {
|
|
112
111
|
h = Object.assign || function(e) {
|
|
113
|
-
for (var
|
|
114
|
-
var
|
|
115
|
-
for (var n in
|
|
116
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
117
|
-
e[n] =
|
|
112
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
113
|
+
var r = arguments[t];
|
|
114
|
+
for (var n in r) {
|
|
115
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
116
|
+
e[n] = r[n];
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
119
|
}
|
|
@@ -122,185 +121,185 @@
|
|
|
122
121
|
};
|
|
123
122
|
return h.apply(this, arguments);
|
|
124
123
|
}
|
|
125
|
-
var
|
|
124
|
+
var y = {};
|
|
126
125
|
/**
|
|
127
126
|
* A non-interactive menu item used to visually separate groups of items in the menu.
|
|
128
|
-
*/ function
|
|
129
|
-
var
|
|
127
|
+
*/ function g(e) {
|
|
128
|
+
var t = h({}, e);
|
|
130
129
|
// @docs-props-type DividerPropsBase
|
|
131
|
-
var i = (0,
|
|
130
|
+
var i = (0, r.useContext)(m), a = i.role;
|
|
132
131
|
|
|
133
|
-
return n().createElement(
|
|
132
|
+
return n().createElement(v, h({
|
|
134
133
|
"aria-hidden": a === "listbox",
|
|
135
134
|
"data-test": "divider",
|
|
136
135
|
role: "separator"
|
|
137
|
-
},
|
|
136
|
+
}, t));
|
|
138
137
|
}
|
|
139
|
-
|
|
140
|
-
/* Remove the item if it is the first item after filtering */
|
|
141
|
-
/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */
|
|
142
|
-
/* Remove the item if it is the last item after filtering. */
|
|
143
|
-
/* Tag the item as Divider */
|
|
144
|
-
/* harmony default export */ const
|
|
138
|
+
g.propTypes = y;
|
|
139
|
+
/* Remove the item if it is the first item after filtering */ g.filterFirst = true;
|
|
140
|
+
/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ g.filterConsecutive = true;
|
|
141
|
+
/* Remove the item if it is the last item after filtering. */ g.filterLast = true;
|
|
142
|
+
/* Tag the item as Divider */ g.as = "Divider";
|
|
143
|
+
/* harmony default export */ const k = g;
|
|
145
144
|
// CONCATENATED MODULE: external "@splunk/react-ui/Heading"
|
|
146
|
-
const
|
|
147
|
-
var
|
|
145
|
+
const x = require("@splunk/react-ui/Heading");
|
|
146
|
+
var w = e.n(x);
|
|
148
147
|
// CONCATENATED MODULE: external "@splunk/themes/useSplunkTheme"
|
|
149
|
-
const
|
|
150
|
-
var
|
|
148
|
+
const S = require("@splunk/themes/useSplunkTheme");
|
|
149
|
+
var O = e.n(S);
|
|
151
150
|
// CONCATENATED MODULE: ./src/Menu/HeadingStyles.ts
|
|
152
|
-
var
|
|
151
|
+
var C = d().div.withConfig({
|
|
153
152
|
displayName: "HeadingStyles__Styled",
|
|
154
153
|
componentId: "mcd2ws-0"
|
|
155
|
-
})([ "", " border-top:1px solid transparent;
|
|
156
|
-
|
|
157
|
-
enterprise: (0,
|
|
154
|
+
})([ "", " border-top:1px solid transparent;", ";&:not(:first-child){", ";}" ], f.mixins.reset("block"), (0,
|
|
155
|
+
f.pick)({
|
|
156
|
+
enterprise: (0, u.css)([ "padding:", " ", " 6px;" ], f.variables.spacingXSmall, f.variables.spacingSmall),
|
|
158
157
|
prisma: {
|
|
159
|
-
comfortable: "13px 16px 10px 16px",
|
|
160
|
-
compact: "9px 16px 6px 16px"
|
|
158
|
+
comfortable: "padding: 13px 16px 10px 16px",
|
|
159
|
+
compact: "padding: 9px 16px 6px 16px"
|
|
161
160
|
}
|
|
162
|
-
}), (0,
|
|
163
|
-
enterprise: (0,
|
|
161
|
+
}), (0, f.pick)({
|
|
162
|
+
enterprise: (0, u.css)([ "border-top:", ";" ], f.variables.border),
|
|
164
163
|
prisma: {
|
|
165
|
-
comfortable: (0,
|
|
166
|
-
compact: (0,
|
|
164
|
+
comfortable: (0, u.css)([ "border-top:1px solid ", ";margin-top:6px;padding-top:19px;" ], f.variables.neutral200),
|
|
165
|
+
compact: (0, u.css)([ "border-top:1px solid ", ";margin-top:6px;padding-top:15px;" ], f.variables.neutral200)
|
|
167
166
|
}
|
|
168
167
|
}));
|
|
169
|
-
var I =
|
|
168
|
+
var I = d().h5.withConfig({
|
|
170
169
|
displayName: "HeadingStyles__PrismaSectionTitle",
|
|
171
170
|
componentId: "mcd2ws-1"
|
|
172
|
-
})([ "", " font-size:", ";line-height:", ";font-weight:", ";letter-spacing:0.02em;" ],
|
|
171
|
+
})([ "", " font-size:", ";line-height:", ";font-weight:", ";letter-spacing:0.02em;" ], f.mixins.reset("block"), f.variables.fontSizeSmall, f.variables.lineHeight, f.variables.fontWeightBold);
|
|
173
172
|
// CONCATENATED MODULE: ./src/Menu/Heading.tsx
|
|
174
|
-
function
|
|
175
|
-
var
|
|
173
|
+
function P(e, t) {
|
|
174
|
+
var r = Object.keys(e);
|
|
176
175
|
if (Object.getOwnPropertySymbols) {
|
|
177
176
|
var n = Object.getOwnPropertySymbols(e);
|
|
178
|
-
if (
|
|
179
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
177
|
+
if (t) n = n.filter((function(t) {
|
|
178
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
180
179
|
}));
|
|
181
|
-
|
|
180
|
+
r.push.apply(r, n);
|
|
182
181
|
}
|
|
183
|
-
return
|
|
182
|
+
return r;
|
|
184
183
|
}
|
|
185
184
|
function E(e) {
|
|
186
|
-
for (var
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
189
|
-
|
|
190
|
-
_(e,
|
|
185
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
186
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
187
|
+
if (t % 2) {
|
|
188
|
+
P(Object(r), true).forEach((function(t) {
|
|
189
|
+
_(e, t, r[t]);
|
|
191
190
|
}));
|
|
192
191
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
193
|
-
Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
192
|
+
Object.defineProperties(e, Object.getOwnPropertyDescriptors(r));
|
|
194
193
|
} else {
|
|
195
|
-
|
|
196
|
-
Object.defineProperty(e,
|
|
194
|
+
P(Object(r)).forEach((function(t) {
|
|
195
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
197
196
|
}));
|
|
198
197
|
}
|
|
199
198
|
}
|
|
200
199
|
return e;
|
|
201
200
|
}
|
|
202
|
-
function _(e,
|
|
203
|
-
if (
|
|
204
|
-
Object.defineProperty(e,
|
|
205
|
-
value:
|
|
201
|
+
function _(e, t, r) {
|
|
202
|
+
if (t in e) {
|
|
203
|
+
Object.defineProperty(e, t, {
|
|
204
|
+
value: r,
|
|
206
205
|
enumerable: true,
|
|
207
206
|
configurable: true,
|
|
208
207
|
writable: true
|
|
209
208
|
});
|
|
210
209
|
} else {
|
|
211
|
-
e[
|
|
210
|
+
e[t] = r;
|
|
212
211
|
}
|
|
213
212
|
return e;
|
|
214
213
|
}
|
|
215
|
-
function
|
|
216
|
-
|
|
217
|
-
for (var
|
|
218
|
-
var
|
|
219
|
-
for (var n in
|
|
220
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
221
|
-
e[n] =
|
|
214
|
+
function j() {
|
|
215
|
+
j = Object.assign || function(e) {
|
|
216
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
217
|
+
var r = arguments[t];
|
|
218
|
+
for (var n in r) {
|
|
219
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
220
|
+
e[n] = r[n];
|
|
222
221
|
}
|
|
223
222
|
}
|
|
224
223
|
}
|
|
225
224
|
return e;
|
|
226
225
|
};
|
|
227
|
-
return
|
|
226
|
+
return j.apply(this, arguments);
|
|
228
227
|
}
|
|
229
|
-
function
|
|
228
|
+
function T(e, t) {
|
|
230
229
|
if (e == null) return {};
|
|
231
|
-
var
|
|
230
|
+
var r = D(e, t);
|
|
232
231
|
var n, i;
|
|
233
232
|
if (Object.getOwnPropertySymbols) {
|
|
234
233
|
var a = Object.getOwnPropertySymbols(e);
|
|
235
234
|
for (i = 0; i < a.length; i++) {
|
|
236
235
|
n = a[i];
|
|
237
|
-
if (
|
|
236
|
+
if (t.indexOf(n) >= 0) continue;
|
|
238
237
|
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
239
|
-
|
|
238
|
+
r[n] = e[n];
|
|
240
239
|
}
|
|
241
240
|
}
|
|
242
|
-
return
|
|
241
|
+
return r;
|
|
243
242
|
}
|
|
244
|
-
function D(e,
|
|
243
|
+
function D(e, t) {
|
|
245
244
|
if (e == null) return {};
|
|
246
|
-
var
|
|
245
|
+
var r = {};
|
|
247
246
|
var n = Object.keys(e);
|
|
248
247
|
var i, a;
|
|
249
248
|
for (a = 0; a < n.length; a++) {
|
|
250
249
|
i = n[a];
|
|
251
|
-
if (
|
|
252
|
-
|
|
250
|
+
if (t.indexOf(i) >= 0) continue;
|
|
251
|
+
r[i] = e[i];
|
|
253
252
|
}
|
|
254
|
-
return
|
|
253
|
+
return r;
|
|
255
254
|
}
|
|
256
|
-
var
|
|
255
|
+
var R = {
|
|
257
256
|
children: a().node,
|
|
258
257
|
title: a().bool,
|
|
259
258
|
outerStyle: a().object
|
|
260
259
|
};
|
|
261
260
|
/**
|
|
262
261
|
* A non-interactive `Menu` item used to separate and label groups of `Menu` items.
|
|
263
|
-
*/ function
|
|
264
|
-
var
|
|
265
|
-
var l = (0,
|
|
266
|
-
var c =
|
|
267
|
-
var
|
|
262
|
+
*/ function q(e) {
|
|
263
|
+
var t = e.children, i = e.title, a = e.outerStyle, o = T(e, [ "children", "title", "outerStyle" ]);
|
|
264
|
+
var l = (0, r.useContext)(m), s = l.role;
|
|
265
|
+
var c = O()(), p = c.family;
|
|
266
|
+
var u = p === "prisma" ? n().createElement(I, j({
|
|
268
267
|
as: i ? "h4" : "h5",
|
|
269
268
|
style: a,
|
|
270
269
|
"data-test": "heading"
|
|
271
|
-
}, o),
|
|
270
|
+
}, o), t) : n().createElement(w(), j({
|
|
272
271
|
style: E(E({}, a), {}, {
|
|
273
272
|
margin: 0
|
|
274
273
|
}),
|
|
275
274
|
level: i ? 4 : "ss",
|
|
276
275
|
"data-test": "heading"
|
|
277
|
-
}, o),
|
|
276
|
+
}, o), t);
|
|
278
277
|
// headings are not supported in role="listbox"
|
|
279
278
|
// this causes Firefox to incorrectly read the total number
|
|
280
279
|
// of items in the list if it contains a heading or divider
|
|
281
280
|
// so we set them to aria-hidden to prevent that
|
|
282
281
|
|
|
283
|
-
return n().createElement(
|
|
282
|
+
return n().createElement(C, {
|
|
284
283
|
"aria-hidden": s === "listbox"
|
|
285
|
-
},
|
|
284
|
+
}, u);
|
|
286
285
|
}
|
|
287
|
-
|
|
288
|
-
/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */
|
|
289
|
-
/* Remove the item if it is the last item after filtering. */
|
|
290
|
-
/* Tag the item as a Heading */
|
|
291
|
-
/* harmony default export */ const N =
|
|
286
|
+
q.propTypes = R;
|
|
287
|
+
/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ q.filterConsecutive = true;
|
|
288
|
+
/* Remove the item if it is the last item after filtering. */ q.filterLast = true;
|
|
289
|
+
/* Tag the item as a Heading */ q.as = "Heading";
|
|
290
|
+
/* harmony default export */ const N = q;
|
|
292
291
|
// CONCATENATED MODULE: external "lodash/isString"
|
|
293
|
-
const
|
|
294
|
-
var
|
|
292
|
+
const F = require("lodash/isString");
|
|
293
|
+
var H = e.n(F);
|
|
295
294
|
// CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
|
|
296
|
-
const
|
|
297
|
-
var
|
|
295
|
+
const $ = require("@splunk/react-icons/ChevronRight");
|
|
296
|
+
var A = e.n($);
|
|
298
297
|
// CONCATENATED MODULE: external "@splunk/react-icons/Checkmark"
|
|
299
298
|
const M = require("@splunk/react-icons/Checkmark");
|
|
300
|
-
var
|
|
299
|
+
var L = e.n(M);
|
|
301
300
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Check"
|
|
302
|
-
const
|
|
303
|
-
var
|
|
301
|
+
const z = require("@splunk/react-icons/enterprise/Check");
|
|
302
|
+
var K = e.n(z);
|
|
304
303
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
|
|
305
304
|
const W = require("@splunk/react-icons/enterprise/ChevronRight");
|
|
306
305
|
var B = e.n(W);
|
|
@@ -308,212 +307,215 @@
|
|
|
308
307
|
const G = require("@splunk/react-ui/Clickable");
|
|
309
308
|
var V = e.n(G);
|
|
310
309
|
// CONCATENATED MODULE: external "@splunk/react-ui/Switch"
|
|
311
|
-
const
|
|
312
|
-
var
|
|
310
|
+
const U = require("@splunk/react-ui/Switch");
|
|
311
|
+
var X = e.n(U);
|
|
313
312
|
// CONCATENATED MODULE: ./src/Menu/ItemStyles.ts
|
|
314
|
-
var
|
|
315
|
-
|
|
316
|
-
prisma:
|
|
317
|
-
enterprise:
|
|
318
|
-
}),
|
|
313
|
+
var Y = (0, u.css)([ "color:", ";font-size:", ";line-height:", ";overflow:inherit;white-space:inherit;text-overflow:inherit;" ], (0,
|
|
314
|
+
f.pick)({
|
|
315
|
+
prisma: f.variables.contentColorDefault,
|
|
316
|
+
enterprise: f.variables.textGray
|
|
317
|
+
}), f.variables.fontSizeSmall, (0, f.pick)({
|
|
319
318
|
prisma: "16px"
|
|
320
319
|
}));
|
|
321
|
-
var
|
|
320
|
+
var J = d().span.withConfig({
|
|
322
321
|
displayName: "ItemStyles__StyledItemDescriptionBottom",
|
|
323
322
|
componentId: "sc-4kc053-0"
|
|
324
|
-
})([ "", ";display:block;" ],
|
|
325
|
-
var
|
|
323
|
+
})([ "", ";display:block;" ], Y);
|
|
324
|
+
var Q = d().span.withConfig({
|
|
326
325
|
displayName: "ItemStyles__StyledItemDescriptionRight",
|
|
327
326
|
componentId: "sc-4kc053-1"
|
|
328
|
-
})([ "", ";float:right;
|
|
329
|
-
|
|
327
|
+
})([ "", ";float:right;", " max-width:50%;text-align:right;box-sizing:border-box;" ], Y, (0,
|
|
328
|
+
f.pick)({
|
|
329
|
+
enterprise: (0, u.css)([ "padding-left:", ";" ], f.variables.spacingLarge)
|
|
330
|
+
}));
|
|
331
|
+
var Z = d().div.withConfig({
|
|
330
332
|
displayName: "ItemStyles__StyledItemSelectedIcon",
|
|
331
333
|
componentId: "sc-4kc053-2"
|
|
332
|
-
})([ "position:absolute;", " color:", ";" ], (0,
|
|
333
|
-
prisma: (0,
|
|
334
|
-
enterprise: (0,
|
|
335
|
-
}), (0,
|
|
336
|
-
prisma:
|
|
337
|
-
enterprise:
|
|
334
|
+
})([ "position:absolute;", " color:", ";" ], (0, f.pick)({
|
|
335
|
+
prisma: (0, u.css)([ "right:16px;" ]),
|
|
336
|
+
enterprise: (0, u.css)([ "right:3px;left:8px;" ])
|
|
337
|
+
}), (0, f.pick)({
|
|
338
|
+
prisma: f.variables.contentColorActive,
|
|
339
|
+
enterprise: f.variables.accentColorL10
|
|
338
340
|
}));
|
|
339
|
-
var
|
|
341
|
+
var ee = d().span.withConfig({
|
|
340
342
|
displayName: "ItemStyles__StyledItemIcon",
|
|
341
343
|
componentId: "sc-4kc053-3"
|
|
342
344
|
})([ "flex:0 0 auto;padding-right:", ";min-width:10px;display:inline-block;text-align:center;vertical-align:", ";", "" ], (0,
|
|
343
|
-
|
|
345
|
+
f.pick)({
|
|
344
346
|
prisma: "8px",
|
|
345
347
|
enterprise: "3px"
|
|
346
|
-
}), (0,
|
|
348
|
+
}), (0, f.pick)({
|
|
347
349
|
prisma: "initial",
|
|
348
350
|
enterprise: "middle"
|
|
349
|
-
}), (0,
|
|
350
|
-
prisma: (0,
|
|
351
|
-
enterprise: (0,
|
|
351
|
+
}), (0, f.pick)({
|
|
352
|
+
prisma: (0, u.css)([ "color:", ";display:inline-flex;align-items:center;min-width:20px;min-height:20px;& > svg{width:20px;height:20px;}" ], f.variables.contentColorMuted),
|
|
353
|
+
enterprise: (0, u.css)([ "transform:translateY(-1px);" ])
|
|
352
354
|
}));
|
|
353
|
-
var te =
|
|
355
|
+
var te = d()(V()).withConfig({
|
|
354
356
|
displayName: "ItemStyles__StyledClickable",
|
|
355
357
|
componentId: "sc-4kc053-4"
|
|
356
358
|
})([ "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
|
-
|
|
358
|
-
prisma:
|
|
359
|
+
f.pick)({
|
|
360
|
+
prisma: f.variables.contentColorActive,
|
|
359
361
|
enterprise: {
|
|
360
|
-
dark:
|
|
361
|
-
light:
|
|
362
|
+
dark: f.variables.gray96,
|
|
363
|
+
light: f.variables.gray22
|
|
362
364
|
}
|
|
363
|
-
}), (0,
|
|
365
|
+
}), (0, f.pick)({
|
|
364
366
|
prisma: {
|
|
365
367
|
comfortable: "10px 16px",
|
|
366
368
|
compact: "6px 16px"
|
|
367
369
|
},
|
|
368
370
|
enterprise: "6px 10px"
|
|
369
371
|
}), (function(e) {
|
|
370
|
-
var
|
|
371
|
-
return
|
|
372
|
-
prisma: (0,
|
|
373
|
-
return
|
|
372
|
+
var t = e.$isSelectable, r = e.$selectableAppearance;
|
|
373
|
+
return t && (0, f.pick)({
|
|
374
|
+
prisma: (0, u.css)([ "padding-right:44px;", "" ], (function() {
|
|
375
|
+
return r === "checkbox" && "padding-left: 42px;";
|
|
374
376
|
})),
|
|
375
|
-
enterprise: (0,
|
|
376
|
-
return
|
|
377
|
+
enterprise: (0, u.css)([ "padding-right:10px;padding-left:", ";" ], (function() {
|
|
378
|
+
return r === "checkbox" ? "32px" : "28px";
|
|
377
379
|
}))
|
|
378
380
|
});
|
|
379
381
|
}), (function(e) {
|
|
380
|
-
var
|
|
381
|
-
return
|
|
382
|
+
var t = e.$active, r = e.$preventFocus;
|
|
383
|
+
return t && !r && (0, u.css)([ "box-shadow:", ";" ], f.variables.focusShadowInset);
|
|
382
384
|
}), (function(e) {
|
|
383
|
-
var
|
|
384
|
-
return
|
|
385
|
+
var t = e.$active;
|
|
386
|
+
return t && (0, u.css)([ "background:", ";font-weight:", ";" ], (0, f.pick)({
|
|
385
387
|
enterprise: {
|
|
386
|
-
light:
|
|
387
|
-
dark:
|
|
388
|
+
light: f.variables.gray92,
|
|
389
|
+
dark: f.variables.gray22
|
|
388
390
|
},
|
|
389
|
-
prisma:
|
|
390
|
-
}),
|
|
391
|
-
}), (0,
|
|
392
|
-
prisma:
|
|
393
|
-
enterprise:
|
|
391
|
+
prisma: f.variables.neutral100
|
|
392
|
+
}), f.variables.fontWeightBold);
|
|
393
|
+
}), (0, f.pick)({
|
|
394
|
+
prisma: f.variables.interactiveColorOverlayHover,
|
|
395
|
+
enterprise: f.variables.backgroundColorHover
|
|
394
396
|
}), (function(e) {
|
|
395
|
-
var
|
|
396
|
-
return
|
|
397
|
-
prisma: (0,
|
|
397
|
+
var t = e.$selected;
|
|
398
|
+
return t && (0, f.pick)({
|
|
399
|
+
prisma: (0, u.css)([ "background:", ";" ], f.mixins.overlayColors(f.variables.interactiveColorOverlaySelected, f.variables.interactiveColorOverlayHover))
|
|
398
400
|
});
|
|
399
|
-
}),
|
|
400
|
-
prisma: (0,
|
|
401
|
-
}), (0,
|
|
402
|
-
prisma: (0,
|
|
401
|
+
}), f.variables.focusShadowInset, (0, f.pick)({
|
|
402
|
+
prisma: (0, u.css)([ "background:", ";" ], f.variables.interactiveColorOverlayHover)
|
|
403
|
+
}), (0, f.pick)({
|
|
404
|
+
prisma: (0, u.css)([ "&:active{background:", ";}" ], f.variables.interactiveColorOverlayActive)
|
|
403
405
|
}), (function(e) {
|
|
404
|
-
var
|
|
405
|
-
return
|
|
406
|
-
prisma: (0,
|
|
406
|
+
var t = e.$selected;
|
|
407
|
+
return t && (0, f.pick)({
|
|
408
|
+
prisma: (0, u.css)([ "background:", ";&:active{background:", ";}" ], f.variables.interactiveColorOverlaySelected, f.mixins.overlayColors(f.variables.interactiveColorOverlaySelected, f.variables.interactiveColorOverlayActive))
|
|
407
409
|
});
|
|
408
|
-
}), (0,
|
|
410
|
+
}), (0, f.pick)({
|
|
409
411
|
enterprise: {
|
|
410
|
-
light:
|
|
411
|
-
dark:
|
|
412
|
+
light: f.variables.gray45,
|
|
413
|
+
dark: f.variables.contentColorDisabled
|
|
412
414
|
},
|
|
413
|
-
prisma:
|
|
415
|
+
prisma: f.variables.contentColorDisabled
|
|
414
416
|
}),
|
|
415
417
|
/* sc-sel */
|
|
416
|
-
|
|
418
|
+
J,
|
|
417
419
|
/* sc-sel */
|
|
418
|
-
|
|
420
|
+
Q,
|
|
419
421
|
/* sc-sel */
|
|
420
|
-
|
|
421
|
-
prisma:
|
|
422
|
-
enterprise:
|
|
423
|
-
}), (0,
|
|
424
|
-
prisma: (0,
|
|
422
|
+
Z, (0, f.pick)({
|
|
423
|
+
prisma: f.variables.contentColorDisabled,
|
|
424
|
+
enterprise: f.variables.gray80
|
|
425
|
+
}), (0, f.pick)({
|
|
426
|
+
prisma: (0, u.css)([ "& > * > ", "{color:", ";}" ],
|
|
425
427
|
/* sc-sel */
|
|
426
|
-
|
|
428
|
+
ee, f.variables.contentColorDisabled)
|
|
427
429
|
}), (function(e) {
|
|
428
|
-
var
|
|
429
|
-
return
|
|
430
|
-
prisma: (0,
|
|
430
|
+
var t = e.$selected;
|
|
431
|
+
return t && (0, f.pick)({
|
|
432
|
+
prisma: (0, u.css)([ "", "{color:", ";}" ],
|
|
431
433
|
/* sc-sel */
|
|
432
|
-
|
|
434
|
+
ee, f.variables.contentColorActive)
|
|
433
435
|
});
|
|
434
436
|
}));
|
|
435
|
-
var
|
|
437
|
+
var re = d()(X()).withConfig({
|
|
436
438
|
displayName: "ItemStyles__StyledSwitch",
|
|
437
439
|
componentId: "sc-4kc053-5"
|
|
438
|
-
})([ "position:absolute;left:", ";top:", ";" ], (0,
|
|
440
|
+
})([ "position:absolute;left:", ";top:", ";" ], (0, f.pick)({
|
|
439
441
|
prisma: "16px",
|
|
440
442
|
enterprise: "8px"
|
|
441
|
-
}), (0,
|
|
443
|
+
}), (0, f.pick)({
|
|
442
444
|
prisma: "0px",
|
|
443
445
|
enterprise: {
|
|
444
446
|
comfortable: "-1px",
|
|
445
447
|
compact: "2px"
|
|
446
448
|
}
|
|
447
449
|
}));
|
|
448
|
-
var
|
|
450
|
+
var ne = d().span.withConfig({
|
|
449
451
|
displayName: "ItemStyles__StyledInnerWrapper",
|
|
450
452
|
componentId: "sc-4kc053-6"
|
|
451
453
|
})([ "display:flex;align-items:flex-start;" ]);
|
|
452
|
-
var
|
|
454
|
+
var ie = d().span.withConfig({
|
|
453
455
|
displayName: "ItemStyles__StyledTitleAndDescriptionWrapper",
|
|
454
456
|
componentId: "sc-4kc053-7"
|
|
455
457
|
})([ "display:flex;flex-wrap:wrap;flex-direction:column;max-width:100%;width:100%;align-self:center;word-break:break-word;white-space:normal;", "" ], (function(e) {
|
|
456
|
-
var
|
|
457
|
-
return
|
|
458
|
+
var t = e.$truncate;
|
|
459
|
+
return t && (0, u.css)([ "white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ]);
|
|
458
460
|
}));
|
|
459
|
-
var
|
|
461
|
+
var ae = d().div.withConfig({
|
|
460
462
|
displayName: "ItemStyles__StyledLabel",
|
|
461
463
|
componentId: "sc-4kc053-8"
|
|
462
464
|
})([ "overflow:inherit;white-space:inherit;text-overflow:inherit;max-width:100%;min-height:20px;", "" ], (function(e) {
|
|
463
|
-
var
|
|
464
|
-
return
|
|
465
|
+
var t = e.$truncate;
|
|
466
|
+
return t && (0, u.css)([ "display:block;clear:both;" ]);
|
|
465
467
|
}));
|
|
466
|
-
var
|
|
468
|
+
var oe = d().span.withConfig({
|
|
467
469
|
displayName: "ItemStyles__StyledMatch",
|
|
468
470
|
componentId: "sc-4kc053-9"
|
|
469
|
-
})([ "border-bottom:1px solid ", ";" ], (0,
|
|
470
|
-
prisma:
|
|
471
|
+
})([ "border-bottom:1px solid ", ";" ], (0, f.pick)({
|
|
472
|
+
prisma: f.variables.contentColorActive,
|
|
471
473
|
enterprise: {
|
|
472
|
-
dark:
|
|
473
|
-
light:
|
|
474
|
+
dark: f.variables.gray96,
|
|
475
|
+
light: f.variables.gray45
|
|
474
476
|
}
|
|
475
477
|
}));
|
|
476
|
-
var
|
|
478
|
+
var le = d().span.withConfig({
|
|
477
479
|
displayName: "ItemStyles__StyledSubmenu",
|
|
478
480
|
componentId: "sc-4kc053-10"
|
|
479
|
-
})([ "float:right;padding-left:", ";color:", ";", "" ],
|
|
480
|
-
|
|
481
|
+
})([ "float:right;padding-left:", ";color:", ";", "" ], f.variables.spacingSmall, (0,
|
|
482
|
+
f.pick)({
|
|
481
483
|
prisma: "inherit",
|
|
482
|
-
enterprise:
|
|
483
|
-
}), (0,
|
|
484
|
-
prisma: (0,
|
|
484
|
+
enterprise: f.variables.textGray
|
|
485
|
+
}), (0, f.pick)({
|
|
486
|
+
prisma: (0, u.css)([ "& > svg{width:20px;height:20px;}" ])
|
|
485
487
|
}));
|
|
486
488
|
// CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRight"
|
|
487
|
-
const
|
|
488
|
-
var
|
|
489
|
+
const se = require("@splunk/react-icons/ArrowSquareTopRight");
|
|
490
|
+
var ce = e.n(se);
|
|
489
491
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/External"
|
|
490
492
|
const pe = require("@splunk/react-icons/enterprise/External");
|
|
491
|
-
var
|
|
493
|
+
var ue = e.n(pe);
|
|
492
494
|
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
493
495
|
const de = require("@splunk/ui-utils/i18n");
|
|
494
496
|
// CONCATENATED MODULE: ./src/Menu/icons/External.tsx
|
|
495
|
-
var
|
|
496
|
-
var
|
|
497
|
-
var
|
|
497
|
+
var fe = (0, de._)("Open externally");
|
|
498
|
+
var ve = (0, u.css)([ "width:0.8em;height:0.8em;vertical-align:baseline;" ]);
|
|
499
|
+
var be = d()(ue()).withConfig({
|
|
498
500
|
displayName: "External__StyledEnterprise",
|
|
499
501
|
componentId: "sc-1turs2s-0"
|
|
500
|
-
})([ "", " margin:0 0 0 3px;" ],
|
|
501
|
-
var
|
|
502
|
+
})([ "", " margin:0 0 0 3px;" ], ve);
|
|
503
|
+
var me = d()(ce()).withConfig({
|
|
502
504
|
displayName: "External__StyledPrisma",
|
|
503
505
|
componentId: "sc-1turs2s-1"
|
|
504
|
-
})([ "", " margin:0 0 0 4px;" ],
|
|
506
|
+
})([ "", " margin:0 0 0 4px;" ], ve);
|
|
505
507
|
function he() {
|
|
506
|
-
var e = (0,
|
|
507
|
-
var i =
|
|
508
|
-
return
|
|
509
|
-
screenReaderText:
|
|
510
|
-
}) : n().createElement(
|
|
511
|
-
"aria-label":
|
|
508
|
+
var e = (0, f.useSplunkTheme)(), t = e.isEnterprise, r = e.isCompact;
|
|
509
|
+
var i = r ? "20px" : "24px";
|
|
510
|
+
return t ? n().createElement(be, {
|
|
511
|
+
screenReaderText: fe
|
|
512
|
+
}) : n().createElement(me, {
|
|
513
|
+
"aria-label": fe,
|
|
512
514
|
height: i,
|
|
513
515
|
width: i
|
|
514
|
-
}, n().createElement("title", null,
|
|
516
|
+
}, n().createElement("title", null, fe));
|
|
515
517
|
}
|
|
516
|
-
/* harmony default export */ const
|
|
518
|
+
/* harmony default export */ const ye = he;
|
|
517
519
|
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
518
520
|
/**
|
|
519
521
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
@@ -521,146 +523,146 @@
|
|
|
521
523
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
522
524
|
* @param current - The new value of the ref.
|
|
523
525
|
*/
|
|
524
|
-
function
|
|
526
|
+
function ge(e, t) {
|
|
525
527
|
if (e) {
|
|
526
528
|
if (typeof e === "function") {
|
|
527
|
-
e(
|
|
529
|
+
e(t);
|
|
528
530
|
} else {
|
|
529
531
|
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
530
532
|
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
531
|
-
e.current =
|
|
533
|
+
e.current = t;
|
|
532
534
|
// eslint-disable-line no-param-reassign
|
|
533
535
|
}
|
|
534
536
|
}
|
|
535
537
|
}
|
|
536
538
|
// CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
|
|
537
539
|
// A utility that attempts to move an element into view by scrolling it's derived parent.
|
|
538
|
-
var
|
|
539
|
-
if (!
|
|
540
|
+
var ke = function e(t) {
|
|
541
|
+
if (!t) {
|
|
540
542
|
return;
|
|
541
543
|
}
|
|
542
|
-
var
|
|
543
|
-
if (!
|
|
544
|
+
var r = t.offsetParent;
|
|
545
|
+
if (!r) {
|
|
544
546
|
return;
|
|
545
547
|
}
|
|
546
548
|
// Below the bottom of the container.
|
|
547
|
-
if (
|
|
548
|
-
|
|
549
|
+
if (r.scrollTop + r.clientHeight < t.offsetTop + t.clientHeight) {
|
|
550
|
+
r.scrollTop = t.offsetTop + t.clientHeight - r.clientHeight;
|
|
549
551
|
// Above the top of the container.
|
|
550
|
-
} else if (
|
|
551
|
-
|
|
552
|
+
} else if (r.scrollTop > t.offsetTop) {
|
|
553
|
+
r.scrollTop = t.offsetTop;
|
|
552
554
|
}
|
|
553
555
|
};
|
|
554
556
|
// CONCATENATED MODULE: ./src/Menu/Item.tsx
|
|
555
|
-
function
|
|
557
|
+
function xe(e) {
|
|
556
558
|
"@babel/helpers - typeof";
|
|
557
559
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
558
|
-
|
|
559
|
-
return typeof
|
|
560
|
+
xe = function e(t) {
|
|
561
|
+
return typeof t;
|
|
560
562
|
};
|
|
561
563
|
} else {
|
|
562
|
-
|
|
563
|
-
return
|
|
564
|
+
xe = function e(t) {
|
|
565
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
564
566
|
};
|
|
565
567
|
}
|
|
566
|
-
return
|
|
568
|
+
return xe(e);
|
|
567
569
|
}
|
|
568
|
-
function
|
|
569
|
-
|
|
570
|
-
for (var
|
|
571
|
-
var
|
|
572
|
-
for (var n in
|
|
573
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
574
|
-
e[n] =
|
|
570
|
+
function we() {
|
|
571
|
+
we = Object.assign || function(e) {
|
|
572
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
573
|
+
var r = arguments[t];
|
|
574
|
+
for (var n in r) {
|
|
575
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
576
|
+
e[n] = r[n];
|
|
575
577
|
}
|
|
576
578
|
}
|
|
577
579
|
}
|
|
578
580
|
return e;
|
|
579
581
|
};
|
|
580
|
-
return
|
|
582
|
+
return we.apply(this, arguments);
|
|
581
583
|
}
|
|
582
|
-
function
|
|
584
|
+
function Se(e, t) {
|
|
583
585
|
if (e == null) return {};
|
|
584
|
-
var
|
|
586
|
+
var r = Oe(e, t);
|
|
585
587
|
var n, i;
|
|
586
588
|
if (Object.getOwnPropertySymbols) {
|
|
587
589
|
var a = Object.getOwnPropertySymbols(e);
|
|
588
590
|
for (i = 0; i < a.length; i++) {
|
|
589
591
|
n = a[i];
|
|
590
|
-
if (
|
|
592
|
+
if (t.indexOf(n) >= 0) continue;
|
|
591
593
|
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
592
|
-
|
|
594
|
+
r[n] = e[n];
|
|
593
595
|
}
|
|
594
596
|
}
|
|
595
|
-
return
|
|
597
|
+
return r;
|
|
596
598
|
}
|
|
597
|
-
function
|
|
599
|
+
function Oe(e, t) {
|
|
598
600
|
if (e == null) return {};
|
|
599
|
-
var
|
|
601
|
+
var r = {};
|
|
600
602
|
var n = Object.keys(e);
|
|
601
603
|
var i, a;
|
|
602
604
|
for (a = 0; a < n.length; a++) {
|
|
603
605
|
i = n[a];
|
|
604
|
-
if (
|
|
605
|
-
|
|
606
|
+
if (t.indexOf(i) >= 0) continue;
|
|
607
|
+
r[i] = e[i];
|
|
606
608
|
}
|
|
607
|
-
return
|
|
609
|
+
return r;
|
|
608
610
|
}
|
|
609
|
-
function
|
|
610
|
-
if (!(e instanceof
|
|
611
|
+
function Ce(e, t) {
|
|
612
|
+
if (!(e instanceof t)) {
|
|
611
613
|
throw new TypeError("Cannot call a class as a function");
|
|
612
614
|
}
|
|
613
615
|
}
|
|
614
|
-
function Ie(e,
|
|
615
|
-
for (var
|
|
616
|
-
var n = r
|
|
616
|
+
function Ie(e, t) {
|
|
617
|
+
for (var r = 0; r < t.length; r++) {
|
|
618
|
+
var n = t[r];
|
|
617
619
|
n.enumerable = n.enumerable || false;
|
|
618
620
|
n.configurable = true;
|
|
619
621
|
if ("value" in n) n.writable = true;
|
|
620
622
|
Object.defineProperty(e, n.key, n);
|
|
621
623
|
}
|
|
622
624
|
}
|
|
623
|
-
function
|
|
624
|
-
if (
|
|
625
|
-
if (
|
|
625
|
+
function Pe(e, t, r) {
|
|
626
|
+
if (t) Ie(e.prototype, t);
|
|
627
|
+
if (r) Ie(e, r);
|
|
626
628
|
return e;
|
|
627
629
|
}
|
|
628
|
-
function Ee(e,
|
|
629
|
-
if (typeof
|
|
630
|
+
function Ee(e, t) {
|
|
631
|
+
if (typeof t !== "function" && t !== null) {
|
|
630
632
|
throw new TypeError("Super expression must either be null or a function");
|
|
631
633
|
}
|
|
632
|
-
e.prototype = Object.create(
|
|
634
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
633
635
|
constructor: {
|
|
634
636
|
value: e,
|
|
635
637
|
writable: true,
|
|
636
638
|
configurable: true
|
|
637
639
|
}
|
|
638
640
|
});
|
|
639
|
-
if (
|
|
641
|
+
if (t) _e(e, t);
|
|
640
642
|
}
|
|
641
|
-
function _e(e,
|
|
642
|
-
_e = Object.setPrototypeOf || function e(
|
|
643
|
-
|
|
644
|
-
return
|
|
643
|
+
function _e(e, t) {
|
|
644
|
+
_e = Object.setPrototypeOf || function e(t, r) {
|
|
645
|
+
t.__proto__ = r;
|
|
646
|
+
return t;
|
|
645
647
|
};
|
|
646
|
-
return _e(e,
|
|
648
|
+
return _e(e, t);
|
|
647
649
|
}
|
|
648
|
-
function
|
|
649
|
-
var
|
|
650
|
-
return function
|
|
651
|
-
var n =
|
|
652
|
-
if (
|
|
653
|
-
var a =
|
|
650
|
+
function je(e) {
|
|
651
|
+
var t = Re();
|
|
652
|
+
return function r() {
|
|
653
|
+
var n = qe(e), i;
|
|
654
|
+
if (t) {
|
|
655
|
+
var a = qe(this).constructor;
|
|
654
656
|
i = Reflect.construct(n, arguments, a);
|
|
655
657
|
} else {
|
|
656
658
|
i = n.apply(this, arguments);
|
|
657
659
|
}
|
|
658
|
-
return
|
|
660
|
+
return Te(this, i);
|
|
659
661
|
};
|
|
660
662
|
}
|
|
661
|
-
function
|
|
662
|
-
if (
|
|
663
|
-
return
|
|
663
|
+
function Te(e, t) {
|
|
664
|
+
if (t && (xe(t) === "object" || typeof t === "function")) {
|
|
665
|
+
return t;
|
|
664
666
|
}
|
|
665
667
|
return De(e);
|
|
666
668
|
}
|
|
@@ -670,7 +672,7 @@
|
|
|
670
672
|
}
|
|
671
673
|
return e;
|
|
672
674
|
}
|
|
673
|
-
function
|
|
675
|
+
function Re() {
|
|
674
676
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
675
677
|
if (Reflect.construct.sham) return false;
|
|
676
678
|
if (typeof Proxy === "function") return true;
|
|
@@ -681,26 +683,26 @@
|
|
|
681
683
|
return false;
|
|
682
684
|
}
|
|
683
685
|
}
|
|
684
|
-
function
|
|
685
|
-
|
|
686
|
-
return
|
|
686
|
+
function qe(e) {
|
|
687
|
+
qe = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
688
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
687
689
|
};
|
|
688
|
-
return
|
|
690
|
+
return qe(e);
|
|
689
691
|
}
|
|
690
|
-
function Ne(e,
|
|
691
|
-
if (
|
|
692
|
-
Object.defineProperty(e,
|
|
693
|
-
value:
|
|
692
|
+
function Ne(e, t, r) {
|
|
693
|
+
if (t in e) {
|
|
694
|
+
Object.defineProperty(e, t, {
|
|
695
|
+
value: r,
|
|
694
696
|
enumerable: true,
|
|
695
697
|
configurable: true,
|
|
696
698
|
writable: true
|
|
697
699
|
});
|
|
698
700
|
} else {
|
|
699
|
-
e[
|
|
701
|
+
e[t] = r;
|
|
700
702
|
}
|
|
701
703
|
return e;
|
|
702
704
|
}
|
|
703
|
-
var
|
|
705
|
+
var Fe = {
|
|
704
706
|
active: a().bool,
|
|
705
707
|
children: a().node,
|
|
706
708
|
description: a().string,
|
|
@@ -730,7 +732,7 @@
|
|
|
730
732
|
to: a().string,
|
|
731
733
|
truncate: a().bool
|
|
732
734
|
};
|
|
733
|
-
var
|
|
735
|
+
var He = {
|
|
734
736
|
active: false,
|
|
735
737
|
descriptionPosition: "bottom",
|
|
736
738
|
disabled: false,
|
|
@@ -742,72 +744,72 @@
|
|
|
742
744
|
selected: false,
|
|
743
745
|
truncate: false
|
|
744
746
|
};
|
|
745
|
-
var
|
|
746
|
-
Ee(
|
|
747
|
-
var
|
|
748
|
-
|
|
747
|
+
var $e = function(e) {
|
|
748
|
+
Ee(r, e);
|
|
749
|
+
var t = je(r);
|
|
750
|
+
Pe(r, null, [ {
|
|
749
751
|
key: "validateProps",
|
|
750
752
|
// @docs-props-type ItemPropsBase
|
|
751
|
-
value: function e(
|
|
753
|
+
value: function e(t) {
|
|
752
754
|
if (false) {}
|
|
753
755
|
}
|
|
754
756
|
} ]);
|
|
755
|
-
function
|
|
757
|
+
function r(e) {
|
|
756
758
|
var n;
|
|
757
|
-
|
|
758
|
-
n =
|
|
759
|
+
Ce(this, r);
|
|
760
|
+
n = t.call(this, e);
|
|
759
761
|
Ne(De(n), "el", null);
|
|
760
762
|
Ne(De(n), "handleFocus", (function(e) {
|
|
761
|
-
var
|
|
762
|
-
|
|
763
|
+
var t = n.props, r = t.onFocus, i = t.itemKey;
|
|
764
|
+
r === null || r === void 0 ? void 0 : r(e, {
|
|
763
765
|
itemKey: i
|
|
764
766
|
});
|
|
765
767
|
}));
|
|
766
768
|
Ne(De(n), "handleMount", (function(e) {
|
|
767
769
|
n.el = e;
|
|
768
|
-
|
|
770
|
+
ge(n.props.elementRef, e);
|
|
769
771
|
}));
|
|
770
|
-
|
|
772
|
+
r.validateProps(e);
|
|
771
773
|
return n;
|
|
772
774
|
}
|
|
773
|
-
|
|
775
|
+
Pe(r, [ {
|
|
774
776
|
key: "componentDidUpdate",
|
|
775
777
|
value: function e() {
|
|
776
|
-
|
|
778
|
+
r.validateProps(this.props);
|
|
777
779
|
}
|
|
778
780
|
}, {
|
|
779
781
|
key: "focus",
|
|
780
782
|
value: function e() {
|
|
781
|
-
var
|
|
782
|
-
(
|
|
783
|
+
var t;
|
|
784
|
+
(t = this.el) === null || t === void 0 ? void 0 : t.focus();
|
|
783
785
|
}
|
|
784
786
|
}, {
|
|
785
787
|
key: "scrollIntoViewIfNeeded",
|
|
786
788
|
value: function e() {
|
|
787
|
-
|
|
789
|
+
ke(this.el);
|
|
788
790
|
}
|
|
789
791
|
}, {
|
|
790
792
|
key: "renderLabel",
|
|
791
793
|
value: function e() {
|
|
792
|
-
var
|
|
793
|
-
if (!i || !
|
|
794
|
-
return
|
|
794
|
+
var t = this.props, r = t.children, i = t.matchRanges;
|
|
795
|
+
if (!i || !H()(r)) {
|
|
796
|
+
return r;
|
|
795
797
|
}
|
|
796
798
|
var a = [];
|
|
797
799
|
// before first match. May be empty string.
|
|
798
|
-
a.push(
|
|
799
|
-
i.forEach((function(e,
|
|
800
|
+
a.push(r.substring(0, i[0].start));
|
|
801
|
+
i.forEach((function(e, t) {
|
|
800
802
|
a.push(
|
|
801
803
|
|
|
802
804
|
// eslint-disable-next-line react/no-array-index-key
|
|
803
|
-
n().createElement(
|
|
804
|
-
key:
|
|
805
|
+
n().createElement(oe, {
|
|
806
|
+
key: t,
|
|
805
807
|
"data-test": "match"
|
|
806
|
-
},
|
|
807
|
-
if (
|
|
808
|
-
a.push(
|
|
808
|
+
}, r.substring(e.start, e.end)));
|
|
809
|
+
if (t < i.length - 1) {
|
|
810
|
+
a.push(r.substring(e.end, i[t + 1].start));
|
|
809
811
|
} else {
|
|
810
|
-
a.push(
|
|
812
|
+
a.push(r.substring(e.end, r.length));
|
|
811
813
|
}
|
|
812
814
|
}));
|
|
813
815
|
return a;
|
|
@@ -815,8 +817,9 @@
|
|
|
815
817
|
}, {
|
|
816
818
|
key: "render",
|
|
817
819
|
value: function e() {
|
|
818
|
-
var
|
|
819
|
-
var
|
|
820
|
+
var t = this.props, r = t.active, i = t.children, a = t.hasSubmenu, o = t.selectable, s = t.selectableAppearance, c = t.selected, p = t.icon, u = t.description, d = t.disabled, f = t.onClick, v = t.role, b = t.splunkTheme, m = t.to, h = t.truncate, y = t.descriptionPosition, g = t.openInNewContext, k = Se(t, [ "active", "children", "hasSubmenu", "selectable", "selectableAppearance", "selected", "icon", "description", "disabled", "onClick", "role", "splunkTheme", "to", "truncate", "descriptionPosition", "openInNewContext" ]);
|
|
821
|
+
var x = b.isEnterprise, w = b.isPrisma;
|
|
822
|
+
var S = this.context.preventFocus;
|
|
820
823
|
var O = o || c;
|
|
821
824
|
var C = {
|
|
822
825
|
nonselectable: "menuitem",
|
|
@@ -824,98 +827,100 @@
|
|
|
824
827
|
checkbox: "menuitemcheckbox"
|
|
825
828
|
}[O ? s : "nonselectable"];
|
|
826
829
|
// aria-checked updates only with checkmark appearance for now SUI-2578
|
|
827
|
-
var
|
|
830
|
+
var I = {
|
|
828
831
|
"aria-haspopup": a ? true : undefined,
|
|
829
832
|
"aria-checked": s === "checkmark" && c ? true : undefined
|
|
830
833
|
};
|
|
831
|
-
var
|
|
832
|
-
var
|
|
833
|
-
var
|
|
834
|
-
var
|
|
834
|
+
var P = w ? "right" : "left";
|
|
835
|
+
var E = u && y === "right";
|
|
836
|
+
var _ = u && !E;
|
|
837
|
+
var j = c && s === "checkmark" && n().createElement(Z, null, w ? n().createElement(L(), {
|
|
835
838
|
inline: true,
|
|
836
839
|
height: "16",
|
|
837
840
|
width: "16"
|
|
838
|
-
}) : n().createElement(
|
|
841
|
+
}) : n().createElement(K(), {
|
|
839
842
|
hideDefaultTooltip: true,
|
|
840
843
|
inline: true,
|
|
841
844
|
screenReaderText: null,
|
|
842
845
|
size: .85
|
|
843
846
|
}));
|
|
844
847
|
|
|
845
|
-
return n().createElement(te,
|
|
848
|
+
return n().createElement(te, we({
|
|
846
849
|
$isSelectable: O,
|
|
847
850
|
$selectableAppearance: s,
|
|
848
851
|
$selected: c,
|
|
849
|
-
$active:
|
|
850
|
-
$preventFocus:
|
|
852
|
+
$active: r,
|
|
853
|
+
$preventFocus: S || false,
|
|
851
854
|
"data-test-selected": O ? c : null,
|
|
852
855
|
"data-test": "item",
|
|
853
|
-
"data-has-icon": !!
|
|
854
|
-
disabled:
|
|
855
|
-
onClick:
|
|
856
|
+
"data-has-icon": !!p,
|
|
857
|
+
disabled: d,
|
|
858
|
+
onClick: f,
|
|
856
859
|
onFocus: this.handleFocus,
|
|
857
|
-
onMouseDown: function e(
|
|
858
|
-
if (
|
|
859
|
-
|
|
860
|
+
onMouseDown: function e(t) {
|
|
861
|
+
if (S) {
|
|
862
|
+
t.preventDefault();
|
|
860
863
|
}
|
|
861
864
|
},
|
|
862
|
-
role:
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
865
|
+
role: v || C,
|
|
866
|
+
tabIndex: S ? -1 : undefined,
|
|
867
|
+
to: m,
|
|
868
|
+
title: h && H()(i) ? i : undefined,
|
|
869
|
+
openInNewContext: g
|
|
870
|
+
}, I, l()(k, "onFocus"), {
|
|
867
871
|
elementRef: this.handleMount
|
|
868
|
-
}), o && s === "checkbox" && n().createElement(
|
|
872
|
+
}), o && s === "checkbox" && n().createElement(re, {
|
|
869
873
|
interactive: false,
|
|
870
874
|
selected: c,
|
|
871
875
|
selectedLabel: "Selected",
|
|
872
876
|
value: "menu-item"
|
|
873
|
-
}), a && n().createElement(
|
|
877
|
+
}), a && n().createElement(le, null, x ? n().createElement(B(), {
|
|
874
878
|
hideDefaultTooltip: true,
|
|
875
879
|
screenReaderText: null
|
|
876
|
-
}) : n().createElement(
|
|
880
|
+
}) : n().createElement(A(), null)), E && n().createElement(Q, {
|
|
877
881
|
"data-test": "description"
|
|
878
|
-
},
|
|
882
|
+
}, u), n().createElement(ne, null, p && n().createElement(ee, null, p), n().createElement(ie, {
|
|
879
883
|
$truncate: h
|
|
880
|
-
},
|
|
884
|
+
}, P === "left" && j, n().createElement(ae, {
|
|
881
885
|
$truncate: h,
|
|
882
886
|
"data-test": "label"
|
|
883
|
-
}, this.renderLabel(),
|
|
887
|
+
}, this.renderLabel(), g && n().createElement(ye, null)), _ && n().createElement(J, {
|
|
884
888
|
"data-test": "description"
|
|
885
|
-
},
|
|
889
|
+
}, u), P === "right" && j)));
|
|
886
890
|
}
|
|
887
891
|
} ]);
|
|
888
|
-
return
|
|
889
|
-
}(
|
|
890
|
-
Ne(
|
|
891
|
-
Ne(
|
|
892
|
-
Ne(
|
|
893
|
-
|
|
894
|
-
var
|
|
895
|
-
Me
|
|
892
|
+
return r;
|
|
893
|
+
}(r.Component);
|
|
894
|
+
Ne($e, "propTypes", Fe);
|
|
895
|
+
Ne($e, "defaultProps", He);
|
|
896
|
+
Ne($e, "as", void 0);
|
|
897
|
+
Ne($e, "contextType", m);
|
|
898
|
+
var Ae = (0, f.withSplunkTheme)($e);
|
|
899
|
+
var Me = Ae;
|
|
900
|
+
Me.propTypes = $e.propTypes;
|
|
896
901
|
Me.as = "Item";
|
|
897
|
-
/* harmony default export */ const
|
|
902
|
+
/* harmony default export */ const Le = Me;
|
|
898
903
|
// CONCATENATED MODULE: external "@splunk/react-ui/Scroll"
|
|
899
|
-
const
|
|
900
|
-
var
|
|
904
|
+
const ze = require("@splunk/react-ui/Scroll");
|
|
905
|
+
var Ke = e.n(ze);
|
|
901
906
|
// CONCATENATED MODULE: ./src/Menu/MenuStyles.ts
|
|
902
|
-
var We = (0,
|
|
903
|
-
enterprise:
|
|
904
|
-
prisma:
|
|
907
|
+
var We = (0, u.css)([ "border-top:1px solid ", ";" ], (0, f.pick)({
|
|
908
|
+
enterprise: f.variables.gray60,
|
|
909
|
+
prisma: f.variables.neutral200
|
|
905
910
|
}));
|
|
906
|
-
var Be =
|
|
911
|
+
var Be = d().div.withConfig({
|
|
907
912
|
displayName: "MenuStyles__Styled",
|
|
908
913
|
componentId: "sc-1olffp9-0"
|
|
909
|
-
})([ "", ";background-color:", ";border-radius:", ";min-width:60px;overflow:auto;position:relative;", " &:focus{outline:0;box-shadow:", ";", "}& + &{", "}" ],
|
|
910
|
-
|
|
911
|
-
enterprise:
|
|
912
|
-
prisma:
|
|
913
|
-
}),
|
|
914
|
-
prisma: (0,
|
|
915
|
-
}),
|
|
916
|
-
prisma: (0,
|
|
914
|
+
})([ "", ";background-color:", ";border-radius:", ";min-width:60px;overflow:auto;position:relative;", " &:focus{outline:0;box-shadow:", ";", "}& + &{", "}" ], f.mixins.reset("block"), (0,
|
|
915
|
+
f.pick)({
|
|
916
|
+
enterprise: f.variables.backgroundColor,
|
|
917
|
+
prisma: f.variables.backgroundColorPopup
|
|
918
|
+
}), f.variables.borderRadius, (0, f.pick)({
|
|
919
|
+
prisma: (0, u.css)([ "padding:8px 0;" ])
|
|
920
|
+
}), f.variables.focusShadowInset, (0, f.pick)({
|
|
921
|
+
prisma: (0, u.css)([ "background:", ";" ], f.variables.interactiveColorOverlayHover)
|
|
917
922
|
}), We);
|
|
918
|
-
var Ge =
|
|
923
|
+
var Ge = d()(Be.withComponent(Ke())).withConfig({
|
|
919
924
|
displayName: "MenuStyles__StyledScroll",
|
|
920
925
|
componentId: "sc-1olffp9-1"
|
|
921
926
|
})([ "", " + &,& + ", "{", "}" ],
|
|
@@ -923,379 +928,160 @@
|
|
|
923
928
|
Be,
|
|
924
929
|
/* sc-sel */
|
|
925
930
|
Be, We);
|
|
926
|
-
// CONCATENATED MODULE: ./src/utils/navigateList.ts
|
|
927
|
-
// A utility for keyboard navigation of lists
|
|
928
|
-
function Ve(e, r, t) {
|
|
929
|
-
for (var n = 0; n < e.length; n += 1) {
|
|
930
|
-
var i;
|
|
931
|
-
var a = (n + t) % e.length;
|
|
932
|
-
if (((i = e[a].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
|
|
933
|
-
return e[a];
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
return e[r];
|
|
937
|
-
}
|
|
938
|
-
function Qe(e, r, t) {
|
|
939
|
-
for (var n = e.length; n > 0; n -= 1) {
|
|
940
|
-
var i;
|
|
941
|
-
var a = (n + t) % e.length;
|
|
942
|
-
if (((i = e[a].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
|
|
943
|
-
return e[a];
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
return e[r];
|
|
947
|
-
}
|
|
948
|
-
// CONCATENATED MODULE: ./src/utils/getMenuChildNode.tsx
|
|
949
|
-
// TODO(SUI-5919): fix the ref handling in the other components so this isn't needed
|
|
950
|
-
/**
|
|
951
|
-
* @private Get the HTML <anchor> or <button> node for a received derivative of Menu.Item
|
|
952
|
-
*/
|
|
953
|
-
var Ye = function e(r) {
|
|
954
|
-
var t, n, i, a;
|
|
955
|
-
if (r.el) {
|
|
956
|
-
return r.el;
|
|
957
|
-
// Menu.Item
|
|
958
|
-
}
|
|
959
|
-
if ((t = r.c) === null || t === void 0 ? void 0 : t.el) {
|
|
960
|
-
return r.c.el;
|
|
961
|
-
// Multiselect.Option
|
|
962
|
-
}
|
|
963
|
-
if ((n = r.c) === null || n === void 0 ? void 0 : (i = n.c) === null || i === void 0 ? void 0 : i.el) {
|
|
964
|
-
return r.c.c.el;
|
|
965
|
-
// Select.Option
|
|
966
|
-
}
|
|
967
|
-
if ((a = r.item) === null || a === void 0 ? void 0 : a.el) {
|
|
968
|
-
return r.item.el;
|
|
969
|
-
// ComboBox.Option
|
|
970
|
-
}
|
|
971
|
-
return null;
|
|
972
|
-
};
|
|
973
931
|
// CONCATENATED MODULE: ./src/Menu/Menu.tsx
|
|
974
|
-
function
|
|
975
|
-
|
|
976
|
-
for (var
|
|
977
|
-
var
|
|
978
|
-
for (var n in
|
|
979
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
980
|
-
e[n] =
|
|
932
|
+
function Ve() {
|
|
933
|
+
Ve = Object.assign || function(e) {
|
|
934
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
935
|
+
var r = arguments[t];
|
|
936
|
+
for (var n in r) {
|
|
937
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
938
|
+
e[n] = r[n];
|
|
981
939
|
}
|
|
982
940
|
}
|
|
983
941
|
}
|
|
984
942
|
return e;
|
|
985
943
|
};
|
|
986
|
-
return
|
|
987
|
-
}
|
|
988
|
-
function Xe(e, r) {
|
|
989
|
-
return nr(e) || tr(e, r) || er(e, r) || Ze();
|
|
990
|
-
}
|
|
991
|
-
function Ze() {
|
|
992
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
993
|
-
}
|
|
994
|
-
function er(e, r) {
|
|
995
|
-
if (!e) return;
|
|
996
|
-
if (typeof e === "string") return rr(e, r);
|
|
997
|
-
var t = Object.prototype.toString.call(e).slice(8, -1);
|
|
998
|
-
if (t === "Object" && e.constructor) t = e.constructor.name;
|
|
999
|
-
if (t === "Map" || t === "Set") return Array.from(e);
|
|
1000
|
-
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return rr(e, r);
|
|
944
|
+
return Ve.apply(this, arguments);
|
|
1001
945
|
}
|
|
1002
|
-
function
|
|
1003
|
-
if (r == null || r > e.length) r = e.length;
|
|
1004
|
-
for (var t = 0, n = new Array(r); t < r; t++) {
|
|
1005
|
-
n[t] = e[t];
|
|
1006
|
-
}
|
|
1007
|
-
return n;
|
|
1008
|
-
}
|
|
1009
|
-
function tr(e, r) {
|
|
1010
|
-
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
|
|
1011
|
-
var t = [];
|
|
1012
|
-
var n = true;
|
|
1013
|
-
var i = false;
|
|
1014
|
-
var a = undefined;
|
|
1015
|
-
try {
|
|
1016
|
-
for (var o = e[Symbol.iterator](), l; !(n = (l = o.next()).done); n = true) {
|
|
1017
|
-
t.push(l.value);
|
|
1018
|
-
if (r && t.length === r) break;
|
|
1019
|
-
}
|
|
1020
|
-
} catch (e) {
|
|
1021
|
-
i = true;
|
|
1022
|
-
a = e;
|
|
1023
|
-
} finally {
|
|
1024
|
-
try {
|
|
1025
|
-
if (!n && o["return"] != null) o["return"]();
|
|
1026
|
-
} finally {
|
|
1027
|
-
if (i) throw a;
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
return t;
|
|
1031
|
-
}
|
|
1032
|
-
function nr(e) {
|
|
1033
|
-
if (Array.isArray(e)) return e;
|
|
1034
|
-
}
|
|
1035
|
-
function ir(e, r) {
|
|
946
|
+
function Ue(e, t) {
|
|
1036
947
|
if (e == null) return {};
|
|
1037
|
-
var
|
|
948
|
+
var r = Xe(e, t);
|
|
1038
949
|
var n, i;
|
|
1039
950
|
if (Object.getOwnPropertySymbols) {
|
|
1040
951
|
var a = Object.getOwnPropertySymbols(e);
|
|
1041
952
|
for (i = 0; i < a.length; i++) {
|
|
1042
953
|
n = a[i];
|
|
1043
|
-
if (
|
|
954
|
+
if (t.indexOf(n) >= 0) continue;
|
|
1044
955
|
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
1045
|
-
|
|
956
|
+
r[n] = e[n];
|
|
1046
957
|
}
|
|
1047
958
|
}
|
|
1048
|
-
return
|
|
959
|
+
return r;
|
|
1049
960
|
}
|
|
1050
|
-
function
|
|
961
|
+
function Xe(e, t) {
|
|
1051
962
|
if (e == null) return {};
|
|
1052
|
-
var
|
|
963
|
+
var r = {};
|
|
1053
964
|
var n = Object.keys(e);
|
|
1054
965
|
var i, a;
|
|
1055
966
|
for (a = 0; a < n.length; a++) {
|
|
1056
967
|
i = n[a];
|
|
1057
|
-
if (
|
|
1058
|
-
|
|
968
|
+
if (t.indexOf(i) >= 0) continue;
|
|
969
|
+
r[i] = e[i];
|
|
1059
970
|
}
|
|
1060
|
-
return
|
|
971
|
+
return r;
|
|
1061
972
|
}
|
|
1062
|
-
var
|
|
973
|
+
var Ye = {
|
|
1063
974
|
children: a().node,
|
|
1064
975
|
/** @private */
|
|
1065
976
|
controlledExternally: a().bool,
|
|
1066
977
|
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
1067
|
-
/** @private */
|
|
1068
|
-
onDownKeyPress: a().func,
|
|
1069
|
-
/** @private */
|
|
1070
|
-
onEndKeyPress: a().func,
|
|
1071
|
-
/** @private */
|
|
1072
|
-
onHomeKeyPress: a().func,
|
|
1073
|
-
/** @private */
|
|
1074
|
-
onUpKeyPress: a().func,
|
|
1075
978
|
retainFocus: a().bool,
|
|
1076
|
-
stopScrollPropagation: a().bool
|
|
979
|
+
stopScrollPropagation: a().bool,
|
|
980
|
+
disableFocusControl: a().bool
|
|
1077
981
|
};
|
|
1078
|
-
|
|
1079
|
-
|
|
982
|
+
// the default focus control for Menu: loop, verticalArrows(up/down keys), home/end keys
|
|
983
|
+
var Je = function e(t) {
|
|
984
|
+
return {
|
|
985
|
+
enableLoop: true,
|
|
986
|
+
orientation: "vertical",
|
|
987
|
+
enableTab: t,
|
|
988
|
+
enableHomeEnd: true
|
|
989
|
+
};
|
|
1080
990
|
};
|
|
1081
|
-
function
|
|
1082
|
-
var
|
|
991
|
+
function Qe(e) {
|
|
992
|
+
var t = e.children, i = e.controlledExternally, a = e.elementRef, o = e.retainFocus, u = e.stopScrollPropagation, d = e.disableFocusControl, f = Ue(e, [ "children", "controlledExternally", "elementRef", "retainFocus", "stopScrollPropagation", "disableFocusControl" ]);
|
|
1083
993
|
// @docs-props-type MenuPropsBase
|
|
1084
|
-
var
|
|
1085
|
-
var
|
|
1086
|
-
var
|
|
1087
|
-
var
|
|
1088
|
-
if (
|
|
1089
|
-
|
|
1090
|
-
} else if (
|
|
1091
|
-
|
|
994
|
+
var v = (0, r.useContext)(m), b = v.role, h = b === void 0 ? "menu" : b;
|
|
995
|
+
var y = (0, r.useContext)(s.PopoverContext), g = y.retainFocus;
|
|
996
|
+
var k = (0, r.useRef)(null);
|
|
997
|
+
var x = true;
|
|
998
|
+
if (o != null) {
|
|
999
|
+
x = o;
|
|
1000
|
+
} else if (g != null) {
|
|
1001
|
+
x = g;
|
|
1092
1002
|
}
|
|
1093
|
-
var
|
|
1094
|
-
var I = [];
|
|
1095
|
-
// `VirtualizedResultsMenu` needs some special consideration regarding the focused element index so that on
|
|
1096
|
-
// keypress it won't ignore the requested focus index or element, even when it doesn't exist. `VirtualizedResultsMenu`
|
|
1097
|
-
// knows what it _will_ mount as a child of `Menu`, and upon mount that targeted child should receive focus.
|
|
1098
|
-
var j = n().useRef(null);
|
|
1099
|
-
var E = n().useRef(false);
|
|
1100
|
-
// TODO(SUI-5918): stabilize itemRefs so itemOnFocus does not churn and can access itemRefs
|
|
1101
|
-
var _ = (0, t.useRef)(I);
|
|
1102
|
-
_.current = I;
|
|
1103
|
-
var T = 0;
|
|
1104
|
-
var R;
|
|
1105
|
-
var D = false;
|
|
1106
|
-
var q = false;
|
|
1107
|
-
var K = false;
|
|
1108
|
-
var N = (0, t.useCallback)((function(e) {
|
|
1109
|
-
var r = e.e, t = e.data, n = e.userCallback, i = e.defaultCallback;
|
|
1110
|
-
var a;
|
|
1111
|
-
if (n) {
|
|
1112
|
-
var o = n(r, t);
|
|
1113
|
-
if (typeof o[0] === "number") {
|
|
1114
|
-
// userCallback returned index of the to-render element which should capture focus on mount
|
|
1115
|
-
a = {
|
|
1116
|
-
current: null
|
|
1117
|
-
};
|
|
1118
|
-
var l = Xe(o, 2);
|
|
1119
|
-
P.current = l[0];
|
|
1120
|
-
E.current = l[1];
|
|
1121
|
-
} else {
|
|
1122
|
-
// userCallback returned ref of the rendered element which should take focus
|
|
1123
|
-
var s = o;
|
|
1124
|
-
var c = Xe(s, 2);
|
|
1125
|
-
a = c[0];
|
|
1126
|
-
E.current = c[1];
|
|
1127
|
-
P.current = Math.max(0, t.itemRefs.indexOf(a));
|
|
1128
|
-
}
|
|
1129
|
-
} else {
|
|
1130
|
-
a = i();
|
|
1131
|
-
}
|
|
1132
|
-
return a;
|
|
1133
|
-
}), []);
|
|
1134
|
-
var H = function e(r) {
|
|
1135
|
-
// SUI-2734: keeping this active even if controlledExternally is set
|
|
1136
|
-
// because Firefox + Voiceover (and possibly other a11y tools)
|
|
1137
|
-
// can still set focus on the Menu items and this avoids the
|
|
1138
|
-
// whole page scrolling when that happens
|
|
1139
|
-
var t = (0, u.keycode)(r.nativeEvent);
|
|
1140
|
-
var n = P.current;
|
|
1141
|
-
var i;
|
|
1142
|
-
// the "retainFocus" checks here mimic the prior tab key functionality
|
|
1143
|
-
if (t === "down" || C && (0, c.isTabKey)(r)) {
|
|
1144
|
-
i = N({
|
|
1145
|
-
e: r,
|
|
1146
|
-
data: {
|
|
1147
|
-
itemRefs: I,
|
|
1148
|
-
focusedItemKey: n
|
|
1149
|
-
},
|
|
1150
|
-
userCallback: o,
|
|
1151
|
-
defaultCallback: function e() {
|
|
1152
|
-
return Ve(I, n, n + 1);
|
|
1153
|
-
}
|
|
1154
|
-
});
|
|
1155
|
-
} else if (t === "up" || C && (0, c.isTabKey)(r) && r.shiftKey) {
|
|
1156
|
-
i = N({
|
|
1157
|
-
e: r,
|
|
1158
|
-
data: {
|
|
1159
|
-
itemRefs: I,
|
|
1160
|
-
focusedItemKey: n
|
|
1161
|
-
},
|
|
1162
|
-
userCallback: v,
|
|
1163
|
-
defaultCallback: function e() {
|
|
1164
|
-
return Qe(I, n, n - 1);
|
|
1165
|
-
}
|
|
1166
|
-
});
|
|
1167
|
-
} else if (t === "home") {
|
|
1168
|
-
i = N({
|
|
1169
|
-
e: r,
|
|
1170
|
-
data: {
|
|
1171
|
-
itemRefs: I,
|
|
1172
|
-
focusedItemKey: n
|
|
1173
|
-
},
|
|
1174
|
-
userCallback: d,
|
|
1175
|
-
defaultCallback: function e() {
|
|
1176
|
-
return Ve(I, n, 0);
|
|
1177
|
-
}
|
|
1178
|
-
});
|
|
1179
|
-
} else if (t === "end") {
|
|
1180
|
-
i = N({
|
|
1181
|
-
e: r,
|
|
1182
|
-
data: {
|
|
1183
|
-
itemRefs: I,
|
|
1184
|
-
focusedItemKey: n
|
|
1185
|
-
},
|
|
1186
|
-
userCallback: p,
|
|
1187
|
-
defaultCallback: function e() {
|
|
1188
|
-
return Qe(I, n, I.length - 1);
|
|
1189
|
-
}
|
|
1190
|
-
});
|
|
1191
|
-
}
|
|
1192
|
-
if (i != null) {
|
|
1193
|
-
var a, l;
|
|
1194
|
-
(a = i.current) === null || a === void 0 ? void 0 : (l = a.focus) === null || l === void 0 ? void 0 : l.call(a);
|
|
1195
|
-
r.preventDefault();
|
|
1196
|
-
j.current = E.current ? null : i.current;
|
|
1197
|
-
}
|
|
1198
|
-
};
|
|
1199
|
-
var A = (0, t.useCallback)((function(e, r) {
|
|
1200
|
-
var t = r.itemKey;
|
|
1201
|
-
if (t != null) {
|
|
1202
|
-
var n;
|
|
1203
|
-
P.current = t;
|
|
1204
|
-
j.current = E.current ? null : (n = _.current[P.current]) === null || n === void 0 ? void 0 : n.current;
|
|
1205
|
-
}
|
|
1206
|
-
}), []);
|
|
1207
|
-
var F = t.Children.toArray(r).filter(t.isValidElement).reduce((function(e, r, t, a) {
|
|
1003
|
+
var w = r.Children.toArray(t).filter(r.isValidElement).reduce((function(e, t, r, n) {
|
|
1208
1004
|
/* Filter out initial Dividers
|
|
1209
1005
|
* Requires reduce() over filter() because a Heading may have been
|
|
1210
1006
|
* before the Divider.
|
|
1211
1007
|
*/
|
|
1212
|
-
if (
|
|
1008
|
+
if (t.type.as === "Divider" && e.length === 0) {
|
|
1213
1009
|
return e;
|
|
1214
1010
|
}
|
|
1215
1011
|
// Filter out consecutive Dividers and Headings
|
|
1216
1012
|
// If Divider is next to Heading then it will remove both Heading and Divider unless Heading has title prop set to it
|
|
1217
|
-
if ((
|
|
1218
|
-
var
|
|
1219
|
-
if (
|
|
1013
|
+
if ((t.type.as === "Heading" || t.type.as === "Divider") && !t.props.title && t.type.filterConsecutive && n.length > r + 1) {
|
|
1014
|
+
var i = n[r + 1];
|
|
1015
|
+
if (i.type.as === "Heading" || i.type.as === "Divider") {
|
|
1220
1016
|
return e;
|
|
1221
1017
|
}
|
|
1222
1018
|
}
|
|
1223
1019
|
// Filter out last Dividers and Headings
|
|
1224
|
-
if ((
|
|
1020
|
+
if ((t.type.as === "Divider" || t.type.as === "Heading") && r === n.length - 1) {
|
|
1225
1021
|
return e;
|
|
1226
1022
|
}
|
|
1227
|
-
|
|
1228
|
-
// the typeof check prevents props from being applied to HTML elements
|
|
1229
|
-
// such as the zero-height scroll bottom div in <ResultsMenu>
|
|
1230
|
-
if (!(r.type.as === "Divider" || r.type.as === "Heading") && typeof r.type !== "string") {
|
|
1231
|
-
var l = n().createRef();
|
|
1232
|
-
var s = I.length;
|
|
1233
|
-
I.push(l);
|
|
1234
|
-
if (R == null && (!("disabled" in r.props) || !r.props.disabled)) {
|
|
1235
|
-
R = T;
|
|
1236
|
-
}
|
|
1237
|
-
if (P.current === T && "disabled" in r.props && r.props.disabled) {
|
|
1238
|
-
D = true;
|
|
1239
|
-
}
|
|
1240
|
-
if ("selected" in r.props && r.props.selected) {
|
|
1241
|
-
q = true;
|
|
1242
|
-
if ("disabled" in r.props && !r.props.disabled) {
|
|
1243
|
-
K = true;
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
var c = !i && P.current === T ? undefined : -1;
|
|
1247
|
-
e.push( n().cloneElement(r, {
|
|
1248
|
-
itemKey: T,
|
|
1249
|
-
onFocus: A,
|
|
1250
|
-
preventFocus: i,
|
|
1251
|
-
ref: function e(t) {
|
|
1252
|
-
ke(r.ref, t);
|
|
1253
|
-
ke(l, t);
|
|
1254
|
-
if (!t) {
|
|
1255
|
-
return;
|
|
1256
|
-
}
|
|
1257
|
-
if (t === j.current) {
|
|
1258
|
-
// When using `VirtualizedResultsMenu` the ref content changes but the
|
|
1259
|
-
// count doesn't. The keyboard scrolling will break if the focus index
|
|
1260
|
-
// isn't corrected during scroll
|
|
1261
|
-
P.current = s;
|
|
1262
|
-
} else if (E.current && s === P.current) {
|
|
1263
|
-
var n;
|
|
1264
|
-
(n = Ye(t)) === null || n === void 0 ? void 0 : n.focus();
|
|
1265
|
-
E.current = false;
|
|
1266
|
-
}
|
|
1267
|
-
},
|
|
1268
|
-
tabIndex: c
|
|
1269
|
-
}));
|
|
1270
|
-
T += 1;
|
|
1271
|
-
return e;
|
|
1272
|
-
}
|
|
1273
|
-
e.push(r);
|
|
1023
|
+
e.push(t);
|
|
1274
1024
|
return e;
|
|
1275
1025
|
}), []);
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
}
|
|
1280
|
-
var
|
|
1026
|
+
var S = (0, r.useCallback)((function(e) {
|
|
1027
|
+
k.current = e;
|
|
1028
|
+
ge(a, e);
|
|
1029
|
+
}), [ a ]);
|
|
1030
|
+
var O = Je(x);
|
|
1031
|
+
var C = (0, r.useCallback)((function(e) {
|
|
1032
|
+
var t = (0, c.keycode)(e.nativeEvent);
|
|
1033
|
+
if (t === "tab" && (0, p.isTabKey)(e) && e.shiftKey) {
|
|
1034
|
+
t = "tabShift";
|
|
1035
|
+
} else if (t === "tab" && (0, p.isTabKey)(e)) {
|
|
1036
|
+
t = "tab";
|
|
1037
|
+
}
|
|
1038
|
+
var r = t === "tab" || t === "tabShift";
|
|
1039
|
+
var n = t === "enter";
|
|
1040
|
+
// Allow default behavior for the enter key.
|
|
1041
|
+
// If tab navigation is enabled, prevent default behavior for all other keys.
|
|
1042
|
+
// If tab navigation is disabled, allow default behavior for tab and tab+shift key
|
|
1043
|
+
if (!n && (O.enableTab || !r)) {
|
|
1044
|
+
e.preventDefault();
|
|
1045
|
+
}
|
|
1046
|
+
var i = k.current;
|
|
1047
|
+
var a = [];
|
|
1048
|
+
if (i) {
|
|
1049
|
+
a = (0, p.getSortedTabbableElements)(i, {
|
|
1050
|
+
ignoreTabIndex: true
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
var o = (e === null || e === void 0 ? void 0 : e.target) instanceof Element ? e.target : null;
|
|
1054
|
+
var l = i === null || i === void 0 ? void 0 : i.querySelector(":focus");
|
|
1055
|
+
var s = o || l;
|
|
1056
|
+
var u = s ? a.indexOf(s) : -1;
|
|
1057
|
+
(0, p.handleFocus)(t, a, u, O);
|
|
1058
|
+
}), [ O ]);
|
|
1059
|
+
var I = function e() {
|
|
1060
|
+
return {
|
|
1061
|
+
role: "menu",
|
|
1062
|
+
preventFocus: i
|
|
1063
|
+
};
|
|
1064
|
+
};
|
|
1065
|
+
var P = !d && !i ? C : undefined;
|
|
1066
|
+
var E = {
|
|
1281
1067
|
"data-test": "menu",
|
|
1282
|
-
onKeyDown:
|
|
1283
|
-
role:
|
|
1284
|
-
tabIndex: R == null && !i ? 0 : undefined
|
|
1068
|
+
onKeyDown: P,
|
|
1069
|
+
role: h
|
|
1285
1070
|
};
|
|
1286
|
-
return
|
|
1287
|
-
elementRef:
|
|
1071
|
+
return u ? n().createElement(Ge, Ve({}, E, {
|
|
1072
|
+
elementRef: S,
|
|
1288
1073
|
stopScrollPropagation: true
|
|
1289
|
-
}, l()(
|
|
1290
|
-
ref:
|
|
1291
|
-
},
|
|
1074
|
+
}, l()(f, "tagName")), w) : n().createElement(Be, Ve({}, E, {
|
|
1075
|
+
ref: S
|
|
1076
|
+
}, f), n().createElement(m.Provider, {
|
|
1077
|
+
value: I()
|
|
1078
|
+
}, w));
|
|
1292
1079
|
}
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
/* harmony default export */ const cr = sr;
|
|
1080
|
+
Qe.propTypes = Ye;
|
|
1081
|
+
Qe.Item = Le;
|
|
1082
|
+
Qe.Divider = k;
|
|
1083
|
+
Qe.Heading = N;
|
|
1084
|
+
/* harmony default export */ const Ze = Qe;
|
|
1299
1085
|
// CONCATENATED MODULE: ./src/Menu/index.ts
|
|
1300
|
-
module.exports =
|
|
1086
|
+
module.exports = t;
|
|
1301
1087
|
/******/})();
|