@splunk/react-ui 4.20.0 → 4.21.1

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