@splunk/react-ui 5.2.0 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +31 -31
- package/Avatar.js +64 -59
- package/Box.js +2 -1
- package/Breadcrumbs.js +66 -63
- package/ButtonSimple.js +52 -52
- package/CHANGELOG.md +47 -0
- package/Calendar.js +8 -4
- package/CardLayout.js +39 -36
- package/Checkbox.d.ts +2 -0
- package/Checkbox.js +350 -0
- package/Clickable.js +5 -6
- package/Code.js +451 -536
- package/CollapsiblePanel.js +184 -210
- package/Color.js +903 -1023
- package/ControlGroup.js +2 -1
- package/Date.js +123 -119
- package/DefinitionList.js +100 -77
- package/Dropdown.js +2 -2
- package/DualListbox.js +409 -353
- package/File.js +102 -99
- package/FormRows.js +13 -11
- package/JSONTree.js +679 -1391
- package/Link.js +7 -7
- package/MIGRATION.md +27 -0
- package/Markdown.js +171 -156
- package/Menu.js +107 -100
- package/Modal.js +3 -3
- package/Multiselect.js +2698 -2767
- package/Paginator.js +2 -1
- package/Popover.js +201 -196
- package/Resize.js +11 -8
- package/ResultsMenu.js +913 -1029
- package/ScreenReaderContent.js +86 -130
- package/Scroll.js +366 -424
- package/Search.js +131 -127
- package/Select.js +1741 -1831
- package/Slider.js +1 -1
- package/SlidingPanels.js +129 -127
- package/StepBar.js +123 -97
- package/Switch.js +214 -242
- package/TabBar.js +10 -10
- package/Table.js +1255 -1248
- package/Text.js +180 -206
- package/TextArea.js +596 -675
- package/Tooltip.js +144 -139
- package/Tree.js +638 -682
- package/package.json +15 -16
- package/tsconfig.check-docs.json +8 -0
- package/types/src/Avatar/docs/examples/Basic.d.ts +1 -1
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +1 -5
- package/types/src/Breadcrumbs/BreadcrumbsContext.d.ts +7 -0
- package/types/src/Breadcrumbs/Item.d.ts +1 -1
- package/types/src/ButtonSimple/mixin.d.ts +1 -1
- package/types/src/Checkbox/Checkbox.d.ts +90 -0
- package/types/src/Checkbox/docs/examples/Basic.d.ts +7 -0
- package/types/src/Checkbox/docs/examples/Disabled.d.ts +6 -0
- package/types/src/Checkbox/docs/examples/Error.d.ts +6 -0
- package/types/src/Checkbox/docs/examples/Uncontrolled.d.ts +7 -0
- package/types/src/Checkbox/index.d.ts +2 -0
- package/types/src/Code/Code.d.ts +4 -1
- package/types/src/Code/LineHighlights.d.ts +1 -0
- package/types/src/Code/LineNumbers.d.ts +2 -1
- package/types/src/Code/docs/examples/CustomizeContainer.d.ts +7 -0
- package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +3 -3
- package/types/src/Date/Date.d.ts +7 -1
- package/types/src/DefinitionList/DefinitionList.d.ts +7 -2
- package/types/src/DefinitionList/DefinitionListContext.d.ts +1 -1
- package/types/src/DefinitionList/docs/examples/StackedLayout.d.ts +6 -0
- package/types/src/DualListbox/DualListbox.d.ts +1 -1
- package/types/src/DualListbox/Label.d.ts +7 -7
- package/types/src/DualListbox/Listbox.d.ts +2 -2
- package/types/src/DualListbox/ListboxContext.d.ts +1 -1
- package/types/src/File/File.d.ts +7 -1
- package/types/src/JSONTree/JSONTreeItem.d.ts +5 -3
- package/types/src/JSONTree/renderTreeItems.d.ts +3 -2
- package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +2 -1
- package/types/src/Menu/docs/examples/Dimmed.d.ts +1 -1
- package/types/src/Menu/docs/examples/Disabled.d.ts +1 -0
- package/types/src/Modal/ModalContext.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +9 -3
- package/types/src/Multiselect/Multiselect.d.ts +7 -1
- package/types/src/Multiselect/Normal.d.ts +9 -3
- package/types/src/Number/utils.d.ts +1 -1
- package/types/src/Popover/getPlacement.d.ts +1 -1
- package/types/src/RadioList/Option.d.ts +1 -1
- package/types/src/RadioList/RadioListContext.d.ts +1 -1
- package/types/src/Search/Search.d.ts +5 -1
- package/types/src/StepBar/StepBar.d.ts +4 -1
- package/types/src/StepBar/StepBarContext.d.ts +1 -0
- package/types/src/StepBar/docs/examples/Vertical.d.ts +6 -0
- package/types/src/Switch/Switch.d.ts +13 -1
- package/types/src/Switch/docs/examples/Basic.d.ts +2 -10
- package/types/src/Switch/docs/examples/Disabled.d.ts +2 -9
- package/types/src/TabBar/Tab.d.ts +3 -1
- package/types/src/TabBar/docs/examples/Icons.d.ts +4 -0
- package/types/src/TabBar/docs/examples/Tooltips.d.ts +3 -0
- package/types/src/TabLayout/Panel.d.ts +2 -0
- package/types/src/Table/ExpandButton.d.ts +1 -1
- package/types/src/Table/Head.d.ts +1 -1
- package/types/src/Table/Row.d.ts +1 -1
- package/types/src/Table/Table.d.ts +1 -0
- package/types/src/Tooltip/Tooltip.d.ts +14 -1
- package/types/src/Tree/TreeContext.d.ts +1 -1
- package/useControlled.js +61 -97
- package/usePrevious.js +30 -62
- package/useResizeObserver.js +95 -127
- package/NonInteractiveCheckbox.js +0 -101
- package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +0 -12
- package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +0 -22
- package/types/src/NonInteractiveCheckbox/index.d.ts +0 -1
- package/types/src/Switch/docs/examples/Error.d.ts +0 -6
- package/types/src/Text/IconOutlinedHide.d.ts +0 -3
- package/types/src/Text/IconOutlinedView.d.ts +0 -3
- /package/cypress/{tsconfig.cypress.json → tsconfig.check-cypress.json} +0 -0
package/ResultsMenu.js
CHANGED
|
@@ -1,151 +1,34 @@
|
|
|
1
1
|
/******/ (() => {
|
|
2
2
|
// webpackBootstrap
|
|
3
3
|
/******/ "use strict";
|
|
4
|
-
/******/
|
|
5
|
-
|
|
6
|
-
/***/ (e, r, n) => {
|
|
7
|
-
// EXPORTS
|
|
8
|
-
n.d(r, {
|
|
9
|
-
default: () => /* reexport */ b
|
|
10
|
-
});
|
|
11
|
-
// EXTERNAL MODULE: external "react"
|
|
12
|
-
var t = n(9497);
|
|
13
|
-
var o = n.n(t);
|
|
14
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
15
|
-
var a = n(23);
|
|
16
|
-
var i = n.n(a);
|
|
17
|
-
// EXTERNAL MODULE: external "styled-components"
|
|
18
|
-
var l = n(232);
|
|
19
|
-
var u = n.n(l);
|
|
20
|
-
// EXTERNAL MODULE: external "@splunk/themes"
|
|
21
|
-
var c = n(3563);
|
|
22
|
-
// CONCATENATED MODULE: ./src/ScreenReaderContent/ScreenReaderContentStyles.ts
|
|
23
|
-
var s = u().span.withConfig({
|
|
24
|
-
displayName: "ScreenReaderContentStyles__Styled",
|
|
25
|
-
componentId: "sc-1lnohwp-0"
|
|
26
|
-
})([ "", ";" ], c.mixins.screenReaderContent());
|
|
27
|
-
// CONCATENATED MODULE: ./src/ScreenReaderContent/ScreenReaderContent.tsx
|
|
28
|
-
function f() {
|
|
29
|
-
return f = Object.assign ? Object.assign.bind() : function(e) {
|
|
30
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
31
|
-
var n = arguments[r];
|
|
32
|
-
for (var t in n) {
|
|
33
|
-
({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return e;
|
|
37
|
-
}, f.apply(null, arguments);
|
|
38
|
-
}
|
|
39
|
-
function v(e, r) {
|
|
40
|
-
if (null == e) return {};
|
|
41
|
-
var n, t, o = d(e, r);
|
|
42
|
-
if (Object.getOwnPropertySymbols) {
|
|
43
|
-
var a = Object.getOwnPropertySymbols(e);
|
|
44
|
-
for (t = 0; t < a.length; t++) {
|
|
45
|
-
n = a[t], -1 === r.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return o;
|
|
49
|
-
}
|
|
50
|
-
function d(e, r) {
|
|
51
|
-
if (null == e) return {};
|
|
52
|
-
var n = {};
|
|
53
|
-
for (var t in e) {
|
|
54
|
-
if ({}.hasOwnProperty.call(e, t)) {
|
|
55
|
-
if (-1 !== r.indexOf(t)) continue;
|
|
56
|
-
n[t] = e[t];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return n;
|
|
60
|
-
}
|
|
61
|
-
var m = {
|
|
62
|
-
children: i().node.isRequired,
|
|
63
|
-
elementRef: i().oneOfType([ i().func, i().object ])
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* The screen reader text is used to wrap content that
|
|
67
|
-
* is only accessible through screen readers.
|
|
68
|
-
*/ function p(e) {
|
|
69
|
-
var r = e.children, n = e.elementRef, t = v(e, [ "children", "elementRef" ]);
|
|
70
|
-
// @docs-props-type ScreenReaderContentPropsBase
|
|
71
|
-
|
|
72
|
-
return o().createElement(s, f({
|
|
73
|
-
"data-test": "screen-reader-content",
|
|
74
|
-
ref: n
|
|
75
|
-
}, t), r);
|
|
76
|
-
}
|
|
77
|
-
p.propTypes = m;
|
|
78
|
-
/* harmony default export */ const b = p;
|
|
79
|
-
} // CONCATENATED MODULE: ./src/ScreenReaderContent/index.ts
|
|
80
|
-
/***/ ,
|
|
81
|
-
/***/ 3563:
|
|
82
|
-
/***/ e => {
|
|
83
|
-
e.exports = require("@splunk/themes");
|
|
84
|
-
/***/ },
|
|
85
|
-
/***/ 23:
|
|
86
|
-
/***/ e => {
|
|
87
|
-
e.exports = require("prop-types");
|
|
88
|
-
/***/ },
|
|
89
|
-
/***/ 9497:
|
|
90
|
-
/***/ e => {
|
|
91
|
-
e.exports = require("react");
|
|
92
|
-
/***/ },
|
|
93
|
-
/***/ 232:
|
|
94
|
-
/***/ e => {
|
|
95
|
-
e.exports = require("styled-components");
|
|
96
|
-
/***/
|
|
97
|
-
/******/ }
|
|
98
|
-
};
|
|
99
|
-
/************************************************************************/
|
|
100
|
-
/******/ // The module cache
|
|
101
|
-
/******/ var r = {};
|
|
102
|
-
/******/
|
|
103
|
-
/******/ // The require function
|
|
104
|
-
/******/ function n(t) {
|
|
105
|
-
/******/ // Check if module is in cache
|
|
106
|
-
/******/ var o = r[t];
|
|
107
|
-
/******/ if (o !== undefined) {
|
|
108
|
-
/******/ return o.exports;
|
|
109
|
-
/******/ }
|
|
110
|
-
/******/ // Create a new module (and put it into the cache)
|
|
111
|
-
/******/ var a = r[t] = {
|
|
112
|
-
/******/ // no module.id needed
|
|
113
|
-
/******/ // no module.loaded needed
|
|
114
|
-
/******/ exports: {}
|
|
115
|
-
/******/ };
|
|
116
|
-
/******/
|
|
117
|
-
/******/ // Execute the module function
|
|
118
|
-
/******/ e[t](a, a.exports, n);
|
|
119
|
-
/******/
|
|
120
|
-
/******/ // Return the exports of the module
|
|
121
|
-
/******/ return a.exports;
|
|
122
|
-
/******/ }
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var e = {};
|
|
123
6
|
/******/
|
|
124
7
|
/************************************************************************/
|
|
125
8
|
/******/ /* webpack/runtime/compat get default export */
|
|
126
9
|
/******/ (() => {
|
|
127
10
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
128
|
-
/******/
|
|
129
|
-
/******/ var
|
|
130
|
-
/******/ () =>
|
|
131
|
-
/******/ : () =>
|
|
11
|
+
/******/ e.n = r => {
|
|
12
|
+
/******/ var n = r && r.__esModule ?
|
|
13
|
+
/******/ () => r["default"]
|
|
14
|
+
/******/ : () => r
|
|
132
15
|
/******/;
|
|
133
|
-
|
|
134
|
-
a:
|
|
16
|
+
e.d(n, {
|
|
17
|
+
a: n
|
|
135
18
|
});
|
|
136
|
-
/******/ return
|
|
19
|
+
/******/ return n;
|
|
137
20
|
/******/ };
|
|
138
21
|
/******/ })();
|
|
139
22
|
/******/
|
|
140
23
|
/******/ /* webpack/runtime/define property getters */
|
|
141
24
|
/******/ (() => {
|
|
142
25
|
/******/ // define getter functions for harmony exports
|
|
143
|
-
/******/
|
|
144
|
-
/******/ for (var t in
|
|
145
|
-
/******/ if (
|
|
146
|
-
/******/ Object.defineProperty(
|
|
26
|
+
/******/ e.d = (r, n) => {
|
|
27
|
+
/******/ for (var t in n) {
|
|
28
|
+
/******/ if (e.o(n, t) && !e.o(r, t)) {
|
|
29
|
+
/******/ Object.defineProperty(r, t, {
|
|
147
30
|
enumerable: true,
|
|
148
|
-
get:
|
|
31
|
+
get: n[t]
|
|
149
32
|
});
|
|
150
33
|
/******/ }
|
|
151
34
|
/******/ }
|
|
@@ -154,14 +37,14 @@
|
|
|
154
37
|
/******/
|
|
155
38
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
156
39
|
/******/ (() => {
|
|
157
|
-
/******/
|
|
40
|
+
/******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
|
|
158
41
|
/******/;
|
|
159
42
|
})();
|
|
160
43
|
/******/
|
|
161
44
|
/******/ /* webpack/runtime/make namespace object */
|
|
162
45
|
/******/ (() => {
|
|
163
46
|
/******/ // define __esModule on exports
|
|
164
|
-
/******/
|
|
47
|
+
/******/ e.r = e => {
|
|
165
48
|
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
166
49
|
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
167
50
|
value: "Module"
|
|
@@ -173,332 +56,331 @@
|
|
|
173
56
|
/******/ };
|
|
174
57
|
/******/ })();
|
|
175
58
|
/******/
|
|
176
|
-
/************************************************************************/ var
|
|
177
|
-
//
|
|
178
|
-
(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
/**
|
|
59
|
+
/************************************************************************/ var r = {};
|
|
60
|
+
// ESM COMPAT FLAG
|
|
61
|
+
e.r(r);
|
|
62
|
+
// EXPORTS
|
|
63
|
+
e.d(r, {
|
|
64
|
+
VirtualizedResultsMenu: () => /* reexport */ Re,
|
|
65
|
+
default: () => /* reexport */ B
|
|
66
|
+
});
|
|
67
|
+
// CONCATENATED MODULE: external "react"
|
|
68
|
+
const n = require("react");
|
|
69
|
+
var t = e.n(n);
|
|
70
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
71
|
+
const o = require("prop-types");
|
|
72
|
+
var a = e.n(o);
|
|
73
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Divider"
|
|
74
|
+
const i = require("@splunk/react-ui/Divider");
|
|
75
|
+
var u = e.n(i);
|
|
76
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
|
|
77
|
+
const l = require("@splunk/react-ui/Menu");
|
|
78
|
+
var c = e.n(l);
|
|
79
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
80
|
+
const s = require("@splunk/react-ui/ScreenReaderContent");
|
|
81
|
+
var f = e.n(s);
|
|
82
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
83
|
+
const d = require("@splunk/ui-utils/i18n");
|
|
84
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
85
|
+
const v = require("styled-components");
|
|
86
|
+
var m = e.n(v);
|
|
87
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/WaitSpinner"
|
|
88
|
+
const b = require("@splunk/react-ui/WaitSpinner");
|
|
89
|
+
var p = e.n(b);
|
|
90
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
91
|
+
const y = require("@splunk/themes");
|
|
92
|
+
// CONCATENATED MODULE: ./src/ResultsMenu/ResultsMenuStyles.ts
|
|
93
|
+
var g = m()(c()).withConfig({
|
|
94
|
+
displayName: "ResultsMenuStyles__StyledMenu",
|
|
95
|
+
componentId: "avbhl8-0"
|
|
96
|
+
})([ "overflow:auto;flex-direction:column;" ]);
|
|
97
|
+
var h = m().div.withConfig({
|
|
98
|
+
displayName: "ResultsMenuStyles__Styled",
|
|
99
|
+
componentId: "avbhl8-1"
|
|
100
|
+
})([ "", ";flex-direction:column;max-height:calc(100vh - 20px);border-radius:", ";background-color:", ";& > ", ":not(:first-child){border-start-start-radius:0;border-start-end-radius:0;}& > ", ":not(:last-child){border-end-start-radius:0;border-end-end-radius:0;}" ], y.mixins.reset("flex"), y.variables.borderRadius, y.variables.backgroundColorPopup, g, g);
|
|
101
|
+
var S = m().div.withConfig({
|
|
102
|
+
displayName: "ResultsMenuStyles__StyledFooter",
|
|
103
|
+
componentId: "avbhl8-2"
|
|
104
|
+
})([ "padding:", " ", ";color:", ";" ], y.variables.spacingSmall, y.variables.spacingLarge, y.variables.contentColorDefault);
|
|
105
|
+
var E = m().li.withConfig({
|
|
106
|
+
displayName: "ResultsMenuStyles__StyledLoading",
|
|
107
|
+
componentId: "avbhl8-3"
|
|
108
|
+
})([ "", ";padding:", " ", ";gap:", ";" ], y.mixins.reset("flex"), y.variables.spacingSmall, y.variables.spacingLarge, y.variables.spacingXSmall);
|
|
109
|
+
var O = m()(c().Item).withConfig({
|
|
110
|
+
displayName: "ResultsMenuStyles__StyledNoOptions",
|
|
111
|
+
componentId: "avbhl8-4"
|
|
112
|
+
})([ "&[disabled],&[aria-disabled='true']{color:", ";}" ], y.variables.contentColorDefault);
|
|
113
|
+
var M = m()(p()).withConfig({
|
|
114
|
+
displayName: "ResultsMenuStyles__StyledWait",
|
|
115
|
+
componentId: "avbhl8-5"
|
|
116
|
+
})([ "flex:0 0 auto;" ]);
|
|
117
|
+
var w = m().div.withConfig({
|
|
118
|
+
displayName: "ResultsMenuStyles__StyledLoadingMessage",
|
|
119
|
+
componentId: "avbhl8-6"
|
|
120
|
+
})([ "flex:1 0 0;color:", ";" ], y.variables.contentColorDefault);
|
|
121
|
+
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
122
|
+
/**
|
|
241
123
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
242
124
|
*
|
|
243
125
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
244
126
|
* @param current - The new value of the ref.
|
|
245
127
|
*/
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
128
|
+
function C(e, r) {
|
|
129
|
+
if (e) {
|
|
130
|
+
if (typeof e === "function") {
|
|
131
|
+
e(r);
|
|
132
|
+
} else {
|
|
133
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
134
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
135
|
+
e.current = r;
|
|
254
136
|
// eslint-disable-line no-param-reassign
|
|
255
|
-
|
|
256
|
-
}
|
|
137
|
+
}
|
|
257
138
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
139
|
+
}
|
|
140
|
+
// CONCATENATED MODULE: ./src/ResultsMenu/ResultsMenu.tsx
|
|
141
|
+
function k() {
|
|
142
|
+
return k = Object.assign ? Object.assign.bind() : function(e) {
|
|
143
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
144
|
+
var n = arguments[r];
|
|
145
|
+
for (var t in n) {
|
|
146
|
+
({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
266
147
|
}
|
|
267
|
-
return e;
|
|
268
|
-
}, C.apply(null, arguments);
|
|
269
|
-
}
|
|
270
|
-
function j(e, r) {
|
|
271
|
-
return P(e) || I(e, r) || R(e, r) || x();
|
|
272
|
-
}
|
|
273
|
-
function x() {
|
|
274
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
275
|
-
}
|
|
276
|
-
function R(e, r) {
|
|
277
|
-
if (e) {
|
|
278
|
-
if ("string" == typeof e) return k(e, r);
|
|
279
|
-
var n = {}.toString.call(e).slice(8, -1);
|
|
280
|
-
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? k(e, r) : void 0;
|
|
281
148
|
}
|
|
149
|
+
return e;
|
|
150
|
+
}, k.apply(null, arguments);
|
|
151
|
+
}
|
|
152
|
+
function j(e, r) {
|
|
153
|
+
return A(e) || x(e, r) || R(e, r) || I();
|
|
154
|
+
}
|
|
155
|
+
function I() {
|
|
156
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
157
|
+
}
|
|
158
|
+
function R(e, r) {
|
|
159
|
+
if (e) {
|
|
160
|
+
if ("string" == typeof e) return P(e, r);
|
|
161
|
+
var n = {}.toString.call(e).slice(8, -1);
|
|
162
|
+
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? P(e, r) : void 0;
|
|
282
163
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return t;
|
|
164
|
+
}
|
|
165
|
+
function P(e, r) {
|
|
166
|
+
(null == r || r > e.length) && (r = e.length);
|
|
167
|
+
for (var n = 0, t = Array(r); n < r; n++) {
|
|
168
|
+
t[n] = e[n];
|
|
289
169
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
170
|
+
return t;
|
|
171
|
+
}
|
|
172
|
+
function x(e, r) {
|
|
173
|
+
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
174
|
+
if (null != n) {
|
|
175
|
+
var t, o, a, i, u = [], l = !0, c = !1;
|
|
176
|
+
try {
|
|
177
|
+
if (a = (n = n.call(e)).next, 0 === r) {
|
|
178
|
+
if (Object(n) !== n) return;
|
|
179
|
+
l = !1;
|
|
180
|
+
} else for (;!(l = (t = a.call(n)).done) && (u.push(t.value), u.length !== r); l = !0) {
|
|
181
|
+
}
|
|
182
|
+
} catch (e) {
|
|
183
|
+
c = !0, o = e;
|
|
184
|
+
} finally {
|
|
294
185
|
try {
|
|
295
|
-
if (
|
|
296
|
-
if (Object(n) !== n) return;
|
|
297
|
-
u = !1;
|
|
298
|
-
} else for (;!(u = (t = a.call(n)).done) && (l.push(t.value), l.length !== r); u = !0) {
|
|
299
|
-
}
|
|
300
|
-
} catch (e) {
|
|
301
|
-
c = !0, o = e;
|
|
186
|
+
if (!l && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
|
|
302
187
|
} finally {
|
|
303
|
-
|
|
304
|
-
if (!u && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
|
|
305
|
-
} finally {
|
|
306
|
-
if (c) throw o;
|
|
307
|
-
}
|
|
188
|
+
if (c) throw o;
|
|
308
189
|
}
|
|
309
|
-
return l;
|
|
310
190
|
}
|
|
191
|
+
return u;
|
|
311
192
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
193
|
+
}
|
|
194
|
+
function A(e) {
|
|
195
|
+
if (Array.isArray(e)) return e;
|
|
196
|
+
}
|
|
197
|
+
function T(e, r) {
|
|
198
|
+
if (null == e) return {};
|
|
199
|
+
var n, t, o = L(e, r);
|
|
200
|
+
if (Object.getOwnPropertySymbols) {
|
|
201
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
202
|
+
for (t = 0; t < a.length; t++) {
|
|
203
|
+
n = a[t], -1 === r.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
|
|
323
204
|
}
|
|
324
|
-
return o;
|
|
325
205
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
206
|
+
return o;
|
|
207
|
+
}
|
|
208
|
+
function L(e, r) {
|
|
209
|
+
if (null == e) return {};
|
|
210
|
+
var n = {};
|
|
211
|
+
for (var t in e) {
|
|
212
|
+
if ({}.hasOwnProperty.call(e, t)) {
|
|
213
|
+
if (-1 !== r.indexOf(t)) continue;
|
|
214
|
+
n[t] = e[t];
|
|
334
215
|
}
|
|
335
|
-
return n;
|
|
336
216
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
I === null || I === void 0 ? void 0 : I(e);
|
|
402
|
-
}), [ ye, Q, I, P ]);
|
|
403
|
-
var he = (0, e.useCallback)((function() {
|
|
404
|
-
var r = e.Children.count(a);
|
|
405
|
-
// If menu is full length, load more items.
|
|
406
|
-
if (be()) {
|
|
407
|
-
ye(null);
|
|
408
|
-
}
|
|
409
|
-
// Avoid triggering this logic if this.state.childrenCount is null
|
|
410
|
-
// because that's not a real change in the number of children
|
|
411
|
-
// and thus we want to avoid resetting the value of scrollBottomTriggered
|
|
412
|
-
if (z != null && r !== z) {
|
|
413
|
-
ne(r - (z !== null && z !== void 0 ? z : 0));
|
|
414
|
-
se(false);
|
|
415
|
-
}
|
|
416
|
-
if (r !== z) {
|
|
417
|
-
V(r);
|
|
418
|
-
}
|
|
419
|
-
}), [ be, a, z, ye ]);
|
|
420
|
-
(0, e.useEffect)((function() {
|
|
421
|
-
if (!$ || !Q) {
|
|
422
|
-
return;
|
|
423
|
-
}
|
|
424
|
-
// If onScrollBottom is defined, determine if it should be triggered.
|
|
425
|
-
if (P && a) {
|
|
426
|
-
he();
|
|
217
|
+
return n;
|
|
218
|
+
}
|
|
219
|
+
var _ = {
|
|
220
|
+
animateLoading: a().bool,
|
|
221
|
+
children: a().node,
|
|
222
|
+
childrenStart: a().node,
|
|
223
|
+
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
224
|
+
focusMode: a().oneOf([ "roving", "normal", "never" ]),
|
|
225
|
+
footerMessage: a().node,
|
|
226
|
+
isLoading: a().bool,
|
|
227
|
+
loadingMessage: a().node,
|
|
228
|
+
menuId: a().string,
|
|
229
|
+
noOptionsMessage: a().node,
|
|
230
|
+
onScroll: a().func,
|
|
231
|
+
onScrollBottom: a().func,
|
|
232
|
+
placement: a().string
|
|
233
|
+
};
|
|
234
|
+
var q = (0, d._)("Loading...");
|
|
235
|
+
var D = (0, d._)("No matches");
|
|
236
|
+
// The remaining amount of pixels when scrolled from bottom of menu to trigger onScrollBottom().
|
|
237
|
+
var N = 400;
|
|
238
|
+
var H = 28;
|
|
239
|
+
function F(e) {
|
|
240
|
+
var r = e.animateLoading, o = e["aria-multiselectable"], a = e.children, i = e.childrenStart, c = e.elementRef, s = e.focusMode, d = e.footerMessage, v = e.isLoading, m = e.labelledBy, b = e.loadingMessage, p = b === void 0 ? q : b, y = e.menuId, I = e.noOptionsMessage, R = I === void 0 ? D : I, P = e.onScroll, x = e.onScrollBottom, A = e.placement, L = e.style, _ = e.tabIndex, F = T(e, [ "animateLoading", "aria-multiselectable", "children", "childrenStart", "elementRef", "focusMode", "footerMessage", "isLoading", "labelledBy", "loadingMessage", "menuId", "noOptionsMessage", "onScroll", "onScrollBottom", "placement", "style", "tabIndex" ]);
|
|
241
|
+
// @docs-props-type ResultsMenuPropsBase
|
|
242
|
+
var B = (0, n.useState)(undefined), U = j(B, 2), z = U[0], V = U[1];
|
|
243
|
+
var K = (0, n.useState)(null), W = j(K, 2), $ = W[0], G = W[1];
|
|
244
|
+
var X = (0, n.useState)(null), J = j(X, 2), Q = J[0], Y = J[1];
|
|
245
|
+
var Z = (0, n.useState)(0), ee = j(Z, 2), re = ee[0], ne = ee[1];
|
|
246
|
+
var te = (0, n.useState)(0), oe = j(te, 2), ae = oe[0], ie = oe[1];
|
|
247
|
+
var ue = (0, n.useState)(false), le = j(ue, 2), ce = le[0], se = le[1];
|
|
248
|
+
var fe = (0, n.useCallback)((function(e) {
|
|
249
|
+
Y(e);
|
|
250
|
+
}), []);
|
|
251
|
+
var de = (0, n.useCallback)((function(e) {
|
|
252
|
+
G(e);
|
|
253
|
+
C(c, e);
|
|
254
|
+
}), [ c ]);
|
|
255
|
+
var ve = (0, n.useCallback)((function() {
|
|
256
|
+
ie(document.documentElement.scrollTop);
|
|
257
|
+
}), []);
|
|
258
|
+
var me = (0, n.useCallback)((function() {
|
|
259
|
+
ie(document.documentElement.scrollTop);
|
|
260
|
+
}), []);
|
|
261
|
+
var be = (0, n.useCallback)((function(e) {
|
|
262
|
+
// Safety net to ensure window doesn't scroll if menu is scrolled pass the numberOfItemsLoaded at high velocity.
|
|
263
|
+
e.stopPropagation();
|
|
264
|
+
document.documentElement.scrollTop = ae;
|
|
265
|
+
}), [ ae ]);
|
|
266
|
+
var pe = (0, n.useCallback)((function() {
|
|
267
|
+
return !!Q && Q.scrollHeight === Q.offsetHeight;
|
|
268
|
+
}), [ Q ]);
|
|
269
|
+
var ye = (0, n.useCallback)((function(e) {
|
|
270
|
+
if (!ce) {
|
|
271
|
+
se(true);
|
|
272
|
+
x === null || x === void 0 ? void 0 : x(e);
|
|
273
|
+
}
|
|
274
|
+
}), [ ce, x ]);
|
|
275
|
+
var ge = (0, n.useCallback)((function(e) {
|
|
276
|
+
if (x && e.target && Q) {
|
|
277
|
+
var r = Q.scrollHeight - Q.offsetHeight - N;
|
|
278
|
+
// Adding 1 due to border of menu item.
|
|
279
|
+
if (Q.scrollTop + 1 >= r) {
|
|
280
|
+
ye(e);
|
|
427
281
|
}
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
282
|
+
}
|
|
283
|
+
P === null || P === void 0 ? void 0 : P(e);
|
|
284
|
+
}), [ ye, Q, P, x ]);
|
|
285
|
+
var he = (0, n.useCallback)((function() {
|
|
286
|
+
var e = n.Children.count(a);
|
|
287
|
+
// If menu is full length, load more items.
|
|
288
|
+
if (pe()) {
|
|
289
|
+
ye(null);
|
|
290
|
+
}
|
|
291
|
+
// Avoid triggering this logic if this.state.childrenCount is null
|
|
292
|
+
// because that's not a real change in the number of children
|
|
293
|
+
// and thus we want to avoid resetting the value of scrollBottomTriggered
|
|
294
|
+
if (z != null && e !== z) {
|
|
295
|
+
ne(e - (z !== null && z !== void 0 ? z : 0));
|
|
296
|
+
se(false);
|
|
297
|
+
}
|
|
298
|
+
if (e !== z) {
|
|
299
|
+
V(e);
|
|
300
|
+
}
|
|
301
|
+
}), [ pe, a, z, ye ]);
|
|
302
|
+
(0, n.useEffect)((function() {
|
|
303
|
+
if (!$ || !Q) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
// If onScrollBottom is defined, determine if it should be triggered.
|
|
307
|
+
if (x && a) {
|
|
308
|
+
he();
|
|
309
|
+
}
|
|
310
|
+
}), [ $, Q, a, x, he ]);
|
|
311
|
+
// Assumption: that you cannot be filtered if you are a result
|
|
312
|
+
var Se = n.Children.toArray(a).filter(n.isValidElement).some((function(e) {
|
|
313
|
+
var r = e.type;
|
|
314
|
+
return !(r.as === "Divider" && r.filterFirst || (r.as === "Divider" || r.as === "Heading") && (r.filterLast || r.filterConsecutive));
|
|
315
|
+
}));
|
|
316
|
+
var Ee = pe();
|
|
317
|
+
var Oe = (0, n.useMemo)((function() {
|
|
318
|
+
return {
|
|
319
|
+
height: ce ? re * H : 0
|
|
320
|
+
};
|
|
321
|
+
}), [ ce, re ]);
|
|
322
|
+
var Me = !Se && !!R && !v;
|
|
323
|
+
var we = (0, n.useCallback)((function() {
|
|
324
|
+
return {
|
|
325
|
+
role: "listbox",
|
|
326
|
+
preventFocus: s === "never"
|
|
327
|
+
};
|
|
328
|
+
}), [ s ]);
|
|
329
|
+
var Ce = (0, n.useCallback)((function() {
|
|
330
|
+
var e = !!n.Children.toArray(a).length;
|
|
331
|
+
return d && e && t().createElement(t().Fragment, null, A !== "above" && t().createElement(u(), null), t().createElement(S, {
|
|
332
|
+
"data-test": "footer-message",
|
|
333
|
+
key: "footer"
|
|
334
|
+
}, d), A === "above" && t().createElement(u(), null));
|
|
335
|
+
}), [ d, a, A ]);
|
|
336
|
+
|
|
337
|
+
return t().createElement(h, k({
|
|
338
|
+
"data-test": "results-menu",
|
|
339
|
+
key: "wrapper",
|
|
340
|
+
ref: de,
|
|
341
|
+
onWheel: x ? be : undefined,
|
|
342
|
+
onMouseEnter: x ? ve : undefined,
|
|
343
|
+
onMouseLeave: x ? me : undefined
|
|
344
|
+
}, F, {
|
|
345
|
+
style: L
|
|
346
|
+
}), A !== "above" && i, A === "above" && Ce(), t().createElement(l.MenuContext.Provider, {
|
|
347
|
+
value: we()
|
|
348
|
+
}, t().createElement(g, {
|
|
349
|
+
"aria-multiselectable": o,
|
|
350
|
+
"aria-labelledby": m,
|
|
351
|
+
elementRef: fe,
|
|
352
|
+
focusMode: s,
|
|
353
|
+
id: y,
|
|
354
|
+
key: "menu",
|
|
355
|
+
onScroll: ge,
|
|
356
|
+
stopScrollPropagation: true,
|
|
357
|
+
tabIndex: _
|
|
358
|
+
}, Me && t().createElement(O, {
|
|
359
|
+
"data-test": "no-results-message",
|
|
360
|
+
disabled: true
|
|
361
|
+
}, R), a, x && !Ee &&
|
|
362
|
+
|
|
363
|
+
// Bottom spacer fills in the space of new items being loaded by using the minimum possible height x menuItems.
|
|
364
|
+
t().createElement("div", {
|
|
365
|
+
"data-test": "results-menu-bottom-spacer",
|
|
366
|
+
style: Oe
|
|
367
|
+
}), v && t().createElement(E, null, r && t().createElement(M, null), t().createElement(w, null, p)))), t().createElement(f(), {
|
|
368
|
+
"aria-live": "polite"
|
|
369
|
+
}, Me && R), A !== "above" && Ce(), A === "above" && i);
|
|
370
|
+
}
|
|
371
|
+
F.propTypes = _;
|
|
372
|
+
/* harmony default export */ const B = F;
|
|
373
|
+
// CONCATENATED MODULE: external "lodash/omit"
|
|
374
|
+
const U = require("lodash/omit");
|
|
375
|
+
var z = e.n(U);
|
|
376
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/focus"
|
|
377
|
+
const V = require("@splunk/ui-utils/focus");
|
|
378
|
+
// CONCATENATED MODULE: ./src/ResultsMenu/VirtualizedResultsMenu/groupChildren.ts
|
|
379
|
+
// Cheap(er than processing potentially thousands of array elements) memoization
|
|
380
|
+
var K = {
|
|
381
|
+
result: []
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
502
384
|
* Given component children, restructure them into an array of arrays, each of length `groupSize`.
|
|
503
385
|
*
|
|
504
386
|
* The last array is not guaranteed to be full, it will have a length in the range `[1, groupSize]`
|
|
@@ -512,262 +394,264 @@
|
|
|
512
394
|
* @param {number} groupSize The size of each group to be created
|
|
513
395
|
* @returns A 2d array where each inner-array is a group of size `groupSize` of children
|
|
514
396
|
* and the order of the `children` received equals the order of the flattened result
|
|
515
|
-
*/
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
397
|
+
*/ var W = function e(r, t) {
|
|
398
|
+
if (K.children === r && K.groupSize === t) {
|
|
399
|
+
return K.result;
|
|
400
|
+
}
|
|
401
|
+
K.children = r;
|
|
402
|
+
K.groupSize = t;
|
|
403
|
+
if (t <= 1) {
|
|
404
|
+
if (false) {}
|
|
405
|
+
// don't break in non-__DEV__ and return one big group
|
|
406
|
+
K.result = [ n.Children.toArray(r) ];
|
|
407
|
+
} else {
|
|
408
|
+
K.result = n.Children.toArray(r).reduce((function(e, r, n) {
|
|
409
|
+
var o = Math.floor(n / t);
|
|
410
|
+
if (!Array.isArray(e[o])) {
|
|
411
|
+
// eslint-disable-next-line no-param-reassign
|
|
412
|
+
e[o] = [];
|
|
413
|
+
}
|
|
414
|
+
e[o].push(r);
|
|
415
|
+
return e;
|
|
416
|
+
}), []);
|
|
417
|
+
}
|
|
418
|
+
return K.result;
|
|
419
|
+
};
|
|
420
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
421
|
+
const $ = require("@splunk/ui-utils/id");
|
|
422
|
+
// CONCATENATED MODULE: ./src/ResultsMenu/VirtualizedResultsMenu/VirtualizedItem.ts
|
|
423
|
+
// This wrapper should only be used with Menu.Item/derivatives thereof, so omitting Heading/Divider is fine
|
|
424
|
+
var G = {
|
|
425
|
+
children: a().node,
|
|
426
|
+
onMount: a().func.isRequired,
|
|
427
|
+
onUnmount: a().func.isRequired
|
|
428
|
+
};
|
|
429
|
+
/** @private Used by `VirtualizedResultsMenu` */ var X = t().forwardRef((function(e, r) {
|
|
430
|
+
var t = e.children, o = e.onMount, a = e.onUnmount;
|
|
431
|
+
// @docs-props-type VirtualizedItemPropsBase
|
|
432
|
+
var i = (0, n.useRef)(null);
|
|
433
|
+
(0, n.useEffect)((function() {
|
|
434
|
+
var e = i.current;
|
|
435
|
+
if (e) {
|
|
436
|
+
o(e);
|
|
535
437
|
}
|
|
536
|
-
return
|
|
537
|
-
};
|
|
538
|
-
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
539
|
-
const W = require("@splunk/ui-utils/id");
|
|
540
|
-
// CONCATENATED MODULE: ./src/ResultsMenu/VirtualizedResultsMenu/VirtualizedItem.ts
|
|
541
|
-
// This wrapper should only be used with Menu.Item/derivatives thereof, so omitting Heading/Divider is fine
|
|
542
|
-
var $ = {
|
|
543
|
-
children: a().node,
|
|
544
|
-
onMount: a().func.isRequired,
|
|
545
|
-
onUnmount: a().func.isRequired
|
|
546
|
-
};
|
|
547
|
-
/** @private Used by `VirtualizedResultsMenu` */ var G = r().forwardRef((function(r, n) {
|
|
548
|
-
var t = r.children, o = r.onMount, a = r.onUnmount;
|
|
549
|
-
var i = (0, e.useRef)(null);
|
|
550
|
-
(0, e.useEffect)((function() {
|
|
551
|
-
var e = i.current;
|
|
438
|
+
return function() {
|
|
552
439
|
if (e) {
|
|
553
|
-
|
|
440
|
+
a(e);
|
|
554
441
|
}
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
442
|
+
};
|
|
443
|
+
}), [ o, a ]);
|
|
444
|
+
var u = n.Children.only(t);
|
|
445
|
+
if (!u) {
|
|
446
|
+
if (false) {}
|
|
447
|
+
return null;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
return (0, n.cloneElement)(u, {
|
|
451
|
+
elementRef: function e(n) {
|
|
452
|
+
i.current = n;
|
|
453
|
+
C(r, n);
|
|
565
454
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
});
|
|
573
|
-
}));
|
|
574
|
-
G.propTypes = $;
|
|
575
|
-
G.as = "Item";
|
|
576
|
-
// CONCATENATED MODULE: ./src/ResultsMenu/VirtualizedResultsMenu/injectVirtualizedItem.tsx
|
|
577
|
-
/**
|
|
455
|
+
});
|
|
456
|
+
}));
|
|
457
|
+
X.propTypes = G;
|
|
458
|
+
X.as = "Item";
|
|
459
|
+
// CONCATENATED MODULE: ./src/ResultsMenu/VirtualizedResultsMenu/injectVirtualizedItem.tsx
|
|
460
|
+
/**
|
|
578
461
|
* Find the index of an array element which is nearest to targetIndex and is a Menu.Item component
|
|
579
462
|
* @param {Array} elements An array to search
|
|
580
463
|
* @param {Number} targetIndex The target index. This is the ideal value to return.
|
|
581
464
|
* @returns The index in the array of the nearest `Menu.Item` component to `targetIndex`, or -1 if no element is a `Menu.Item` component
|
|
582
465
|
*/
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
466
|
+
var J = function e(r, n) {
|
|
467
|
+
var t = -1;
|
|
468
|
+
var o = -1;
|
|
469
|
+
r.forEach((function(e, r) {
|
|
470
|
+
var a = Math.abs(n - r);
|
|
471
|
+
if (t >= 0 && t < a) {
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
if (e.type !== l.Divider && e.type !== l.Heading) {
|
|
475
|
+
t = a;
|
|
476
|
+
o = r;
|
|
477
|
+
}
|
|
478
|
+
}));
|
|
479
|
+
return o;
|
|
480
|
+
};
|
|
481
|
+
/**
|
|
599
482
|
* @private Keep the injection of `VirtualizedItem` DRY. Will always replace the middle-most non-divider/heading
|
|
600
483
|
* with a VirtualizedItem instance.
|
|
601
484
|
* - If `trackFirstElement` the **FIRST** non-divider/heading item will also be replaced.
|
|
602
485
|
* - If `trackLastElement` the **LAST** non-divider/heading item will also be replaced.
|
|
603
|
-
*/
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}
|
|
608
|
-
var u = X(n, Math.floor(n.length / 2));
|
|
609
|
-
var c = i && X(n, 0);
|
|
610
|
-
var s = l && X(n, n.length - 1);
|
|
611
|
-
return n.map((function(e, n) {
|
|
612
|
-
if (n === u || n === c || n === s) {
|
|
613
|
-
|
|
614
|
-
return r().createElement(G, {
|
|
615
|
-
key: (0, W.createGUID)(),
|
|
616
|
-
onMount: t,
|
|
617
|
-
onUnmount: o
|
|
618
|
-
}, e);
|
|
619
|
-
}
|
|
620
|
-
return e;
|
|
621
|
-
}));
|
|
622
|
-
};
|
|
623
|
-
// CONCATENATED MODULE: ./src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.tsx
|
|
624
|
-
function Q(e) {
|
|
625
|
-
"@babel/helpers - typeof";
|
|
626
|
-
return Q = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
627
|
-
return typeof e;
|
|
628
|
-
} : function(e) {
|
|
629
|
-
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
630
|
-
}, Q(e);
|
|
631
|
-
}
|
|
632
|
-
function Y() {
|
|
633
|
-
return Y = Object.assign ? Object.assign.bind() : function(e) {
|
|
634
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
635
|
-
var n = arguments[r];
|
|
636
|
-
for (var t in n) {
|
|
637
|
-
({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
return e;
|
|
641
|
-
}, Y.apply(null, arguments);
|
|
486
|
+
*/ var Q = function e(r, n, o) {
|
|
487
|
+
var a = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, i = a.trackFirstElement, u = a.trackLastElement;
|
|
488
|
+
if (!Array.isArray(r)) {
|
|
489
|
+
return [];
|
|
642
490
|
}
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
function
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
}
|
|
655
|
-
function te(e, r) {
|
|
656
|
-
return ue(e) || le(e, r) || ae(e, r) || oe();
|
|
657
|
-
}
|
|
658
|
-
function oe() {
|
|
659
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
660
|
-
}
|
|
661
|
-
function ae(e, r) {
|
|
662
|
-
if (e) {
|
|
663
|
-
if ("string" == typeof e) return ie(e, r);
|
|
664
|
-
var n = {}.toString.call(e).slice(8, -1);
|
|
665
|
-
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ie(e, r) : void 0;
|
|
491
|
+
var l = J(r, Math.floor(r.length / 2));
|
|
492
|
+
var c = i && J(r, 0);
|
|
493
|
+
var s = u && J(r, r.length - 1);
|
|
494
|
+
return r.map((function(e, r) {
|
|
495
|
+
if (r === l || r === c || r === s) {
|
|
496
|
+
|
|
497
|
+
return t().createElement(X, {
|
|
498
|
+
key: (0, $.createGUID)(),
|
|
499
|
+
onMount: n,
|
|
500
|
+
onUnmount: o
|
|
501
|
+
}, e);
|
|
666
502
|
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
function
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
}
|
|
685
|
-
} catch (e) {
|
|
686
|
-
c = !0, o = e;
|
|
687
|
-
} finally {
|
|
688
|
-
try {
|
|
689
|
-
if (!u && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
|
|
690
|
-
} finally {
|
|
691
|
-
if (c) throw o;
|
|
692
|
-
}
|
|
503
|
+
return e;
|
|
504
|
+
}));
|
|
505
|
+
};
|
|
506
|
+
// CONCATENATED MODULE: ./src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.tsx
|
|
507
|
+
function Y(e) {
|
|
508
|
+
"@babel/helpers - typeof";
|
|
509
|
+
return Y = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
510
|
+
return typeof e;
|
|
511
|
+
} : function(e) {
|
|
512
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
513
|
+
}, Y(e);
|
|
514
|
+
}
|
|
515
|
+
function Z() {
|
|
516
|
+
return Z = Object.assign ? Object.assign.bind() : function(e) {
|
|
517
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
518
|
+
var n = arguments[r];
|
|
519
|
+
for (var t in n) {
|
|
520
|
+
({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
693
521
|
}
|
|
694
|
-
return l;
|
|
695
522
|
}
|
|
523
|
+
return e;
|
|
524
|
+
}, Z.apply(null, arguments);
|
|
525
|
+
}
|
|
526
|
+
function ee(e) {
|
|
527
|
+
return te(e) || ne(e) || ie(e) || re();
|
|
528
|
+
}
|
|
529
|
+
function re() {
|
|
530
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
531
|
+
}
|
|
532
|
+
function ne(e) {
|
|
533
|
+
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
534
|
+
}
|
|
535
|
+
function te(e) {
|
|
536
|
+
if (Array.isArray(e)) return ue(e);
|
|
537
|
+
}
|
|
538
|
+
function oe(e, r) {
|
|
539
|
+
return ce(e) || le(e, r) || ie(e, r) || ae();
|
|
540
|
+
}
|
|
541
|
+
function ae() {
|
|
542
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
543
|
+
}
|
|
544
|
+
function ie(e, r) {
|
|
545
|
+
if (e) {
|
|
546
|
+
if ("string" == typeof e) return ue(e, r);
|
|
547
|
+
var n = {}.toString.call(e).slice(8, -1);
|
|
548
|
+
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ue(e, r) : void 0;
|
|
696
549
|
}
|
|
697
|
-
|
|
698
|
-
|
|
550
|
+
}
|
|
551
|
+
function ue(e, r) {
|
|
552
|
+
(null == r || r > e.length) && (r = e.length);
|
|
553
|
+
for (var n = 0, t = Array(r); n < r; n++) {
|
|
554
|
+
t[n] = e[n];
|
|
699
555
|
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
556
|
+
return t;
|
|
557
|
+
}
|
|
558
|
+
function le(e, r) {
|
|
559
|
+
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
560
|
+
if (null != n) {
|
|
561
|
+
var t, o, a, i, u = [], l = !0, c = !1;
|
|
562
|
+
try {
|
|
563
|
+
if (a = (n = n.call(e)).next, 0 === r) {
|
|
564
|
+
if (Object(n) !== n) return;
|
|
565
|
+
l = !1;
|
|
566
|
+
} else for (;!(l = (t = a.call(n)).done) && (u.push(t.value), u.length !== r); l = !0) {
|
|
707
567
|
}
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
if ({}.hasOwnProperty.call(e, t)) {
|
|
716
|
-
if (-1 !== r.indexOf(t)) continue;
|
|
717
|
-
n[t] = e[t];
|
|
568
|
+
} catch (e) {
|
|
569
|
+
c = !0, o = e;
|
|
570
|
+
} finally {
|
|
571
|
+
try {
|
|
572
|
+
if (!l && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
|
|
573
|
+
} finally {
|
|
574
|
+
if (c) throw o;
|
|
718
575
|
}
|
|
719
576
|
}
|
|
720
|
-
return
|
|
577
|
+
return u;
|
|
721
578
|
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
579
|
+
}
|
|
580
|
+
function ce(e) {
|
|
581
|
+
if (Array.isArray(e)) return e;
|
|
582
|
+
}
|
|
583
|
+
function se(e, r) {
|
|
584
|
+
if (null == e) return {};
|
|
585
|
+
var n, t, o = fe(e, r);
|
|
586
|
+
if (Object.getOwnPropertySymbols) {
|
|
587
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
588
|
+
for (t = 0; t < a.length; t++) {
|
|
589
|
+
n = a[t], -1 === r.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
|
|
729
590
|
}
|
|
730
|
-
return n;
|
|
731
591
|
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
592
|
+
return o;
|
|
593
|
+
}
|
|
594
|
+
function fe(e, r) {
|
|
595
|
+
if (null == e) return {};
|
|
596
|
+
var n = {};
|
|
597
|
+
for (var t in e) {
|
|
598
|
+
if ({}.hasOwnProperty.call(e, t)) {
|
|
599
|
+
if (-1 !== r.indexOf(t)) continue;
|
|
600
|
+
n[t] = e[t];
|
|
740
601
|
}
|
|
741
|
-
return e;
|
|
742
602
|
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
603
|
+
return n;
|
|
604
|
+
}
|
|
605
|
+
function de(e, r) {
|
|
606
|
+
var n = Object.keys(e);
|
|
607
|
+
if (Object.getOwnPropertySymbols) {
|
|
608
|
+
var t = Object.getOwnPropertySymbols(e);
|
|
609
|
+
r && (t = t.filter((function(r) {
|
|
610
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
611
|
+
}))), n.push.apply(n, t);
|
|
750
612
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
613
|
+
return n;
|
|
614
|
+
}
|
|
615
|
+
function ve(e) {
|
|
616
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
617
|
+
var n = null != arguments[r] ? arguments[r] : {};
|
|
618
|
+
r % 2 ? de(Object(n), !0).forEach((function(r) {
|
|
619
|
+
me(e, r, n[r]);
|
|
620
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : de(Object(n)).forEach((function(r) {
|
|
621
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
622
|
+
}));
|
|
754
623
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
624
|
+
return e;
|
|
625
|
+
}
|
|
626
|
+
function me(e, r, n) {
|
|
627
|
+
return (r = be(r)) in e ? Object.defineProperty(e, r, {
|
|
628
|
+
value: n,
|
|
629
|
+
enumerable: !0,
|
|
630
|
+
configurable: !0,
|
|
631
|
+
writable: !0
|
|
632
|
+
}) : e[r] = n, e;
|
|
633
|
+
}
|
|
634
|
+
function be(e) {
|
|
635
|
+
var r = pe(e, "string");
|
|
636
|
+
return "symbol" == Y(r) ? r : r + "";
|
|
637
|
+
}
|
|
638
|
+
function pe(e, r) {
|
|
639
|
+
if ("object" != Y(e) || !e) return e;
|
|
640
|
+
var n = e[Symbol.toPrimitive];
|
|
641
|
+
if (void 0 !== n) {
|
|
642
|
+
var t = n.call(e, r || "default");
|
|
643
|
+
if ("object" != Y(t)) return t;
|
|
644
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
764
645
|
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
var ye =
|
|
770
|
-
|
|
646
|
+
return ("string" === r ? String : Number)(e);
|
|
647
|
+
}
|
|
648
|
+
// eslint-disable-next-line no-relative-imports-of-published -- TODO(SUI-8190): VirtualizedResultsMenu wraps ResultsMenu, using external import creates circular dependency
|
|
649
|
+
// TODO(SUI-5920): add transitions to this component in React 18
|
|
650
|
+
var ye = ve(ve({}, z()(_, "onDownKeyPress", "onEndKeyPress", "onHomeKeyPress", "onUpKeyPress")), {}, {
|
|
651
|
+
virtualization: a().number
|
|
652
|
+
});
|
|
653
|
+
var ge = [];
|
|
654
|
+
/**
|
|
771
655
|
* A wrapper for `ResultsMenu` which virtualizes the `children`. The received `children` array will be split into **"panes"** each with `virtualization` entries
|
|
772
656
|
* and, at any given time, 3 or fewer of these panes will be rendered in the DOM.
|
|
773
657
|
*
|
|
@@ -785,396 +669,396 @@
|
|
|
785
669
|
* @throws in `__DEV__` when `virtualization` is too small as compared to the menu height (`virtualization` must be greater than the number of visible items in the rendered menu)
|
|
786
670
|
* @throws in `__DEV__` when `virtualization` is less than or equal to 1 (`virtualization` must be ≥ 2)
|
|
787
671
|
* @throws in `__DEV__` when `virtualization` is changed during the lifecycle of the `VirtualizedResultsMenu` component
|
|
788
|
-
*/
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
672
|
+
*/ function he(e) {
|
|
673
|
+
var r = e.virtualization, o = r === void 0 ? 2 : r, a = e.elementRef, i = e.children, u = e.focusMode, l = u === void 0 ? "normal" : u, c = se(e, [ "virtualization", "elementRef", "children", "focusMode" ]);
|
|
674
|
+
// @docs-props-type VirtualizedResultsMenuPropsBase
|
|
675
|
+
var s = (0, n.useRef)(o);
|
|
676
|
+
// If a user tries to set virtualization to a value smaller than the number of options
|
|
677
|
+
// visible at a given moment then the menu will flicker endlessly. This state is set in
|
|
678
|
+
// the IntersectionObserver to fix the issue, but in `__DEV__` an error is thrown.
|
|
679
|
+
var f = (0, n.useState)(o), d = oe(f, 2), v = d[0], m = d[1];
|
|
796
680
|
// these refs keep track of whether we need to focus the first/last
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
}
|
|
681
|
+
// element after the next render
|
|
682
|
+
var b = (0, n.useRef)(false);
|
|
683
|
+
var p = (0, n.useRef)(false);
|
|
684
|
+
var y = (0, n.useRef)(i);
|
|
685
|
+
// this code makes the "Home" and "End" keys work by injecting
|
|
686
|
+
// an elementRef callback function into the first and last item
|
|
687
|
+
// that will attempt to focus the first/last item if appropriate
|
|
688
|
+
// we need to do this because if we call focus() right after changePane()
|
|
689
|
+
// the new pane won't be in the DOM yet, so the wrong element will end up focused
|
|
690
|
+
(0, n.useMemo)((function() {
|
|
691
|
+
var e = n.Children.toArray(i);
|
|
692
|
+
var r = J(e, 0);
|
|
693
|
+
var t = J(e, e.length - 1);
|
|
694
|
+
y.current = e.map((function(e, o) {
|
|
695
|
+
var a = e;
|
|
696
|
+
if (o === r) {
|
|
697
|
+
a = (0, n.isValidElement)(e) ? (0, n.cloneElement)(e, {
|
|
698
|
+
elementRef: function e(r) {
|
|
699
|
+
if (b === null || b === void 0 ? void 0 : b.current) {
|
|
700
|
+
b.current = false;
|
|
701
|
+
r === null || r === void 0 ? void 0 : r.focus();
|
|
819
702
|
}
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
703
|
+
}
|
|
704
|
+
}) : e;
|
|
705
|
+
} else if (o === t) {
|
|
706
|
+
a = (0, n.isValidElement)(e) ? (0, n.cloneElement)(e, {
|
|
707
|
+
elementRef: function e(r) {
|
|
708
|
+
if (p === null || p === void 0 ? void 0 : p.current) {
|
|
709
|
+
p.current = false;
|
|
710
|
+
r === null || r === void 0 ? void 0 : r.focus();
|
|
828
711
|
}
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
})
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
712
|
+
}
|
|
713
|
+
}) : e;
|
|
714
|
+
}
|
|
715
|
+
return a;
|
|
716
|
+
}));
|
|
717
|
+
}), [ i ]);
|
|
718
|
+
var g = y.current;
|
|
719
|
+
(0, n.useEffect)((function() {
|
|
720
|
+
if (false) {}
|
|
721
|
+
}), [ o ]);
|
|
722
|
+
// `useRef` will recompute its initial value every render cycle.
|
|
723
|
+
// To avoid the array processing we can provide an initialization function to useState and init the ref with the result
|
|
724
|
+
var h = (0, n.useState)((function() {
|
|
725
|
+
return W(g, v);
|
|
726
|
+
})), S = oe(h, 1), E = S[0];
|
|
843
727
|
// NOSONAR
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
728
|
+
// `windowPanes` is an array of arrays, each of length `virtualization`. Each "pane" is just a subset of
|
|
729
|
+
// `children` which will be rendered in a chunk, and at most 3 of these panes will render at any given time.
|
|
730
|
+
var O = (0, n.useRef)(E);
|
|
731
|
+
var M = (0, n.useRef)(0);
|
|
732
|
+
var w = (0, n.useRef)(null);
|
|
733
|
+
// An IntersectionObserver is used to detect when pane changes are needed.
|
|
734
|
+
// When loadPrevPaneRef or loadNextPaneRef entries intersect the menu, the currentPaneId will be updated.
|
|
735
|
+
var k = (0, n.useRef)();
|
|
736
|
+
var j = (0, n.useRef)(ge);
|
|
737
|
+
var I = (0, n.useRef)(ge);
|
|
738
|
+
var R = (0, n.useCallback)((function() {
|
|
739
|
+
var e;
|
|
740
|
+
var r = O.current, n = r === void 0 ? [] : r;
|
|
741
|
+
var t = M.current;
|
|
742
|
+
/**
|
|
859
743
|
* create onMount for an child of the menu which will be used to trigger pane
|
|
860
744
|
* changes upon intersection with the menu's visible bounds
|
|
861
|
-
*/
|
|
862
|
-
|
|
863
|
-
var n;
|
|
864
|
-
if (!e) {
|
|
865
|
-
return;
|
|
866
|
-
}
|
|
867
|
-
r.current.push(e);
|
|
868
|
-
(n = j.current) === null || n === void 0 ? void 0 : n.observe(e);
|
|
869
|
-
};
|
|
870
|
-
};
|
|
871
|
-
/**
|
|
872
|
-
* onUnmount to cleanup the operations of `onVirtualizeMount`
|
|
873
|
-
*/ var a = function e(r) {
|
|
745
|
+
*/ var o = function e(r) {
|
|
746
|
+
return function(e) {
|
|
874
747
|
var n;
|
|
875
|
-
if (!
|
|
748
|
+
if (!e) {
|
|
876
749
|
return;
|
|
877
750
|
}
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
R.current.splice(t, 1);
|
|
881
|
-
}
|
|
882
|
-
var o = x.current.indexOf(r);
|
|
883
|
-
if (o) {
|
|
884
|
-
x.current.splice(o, 1);
|
|
885
|
-
}
|
|
886
|
-
(n = j.current) === null || n === void 0 ? void 0 : n.unobserve(r);
|
|
751
|
+
r.current.push(e);
|
|
752
|
+
(n = k.current) === null || n === void 0 ? void 0 : n.observe(e);
|
|
887
753
|
};
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
var I = (0, e.useState)(k), P = te(I, 2), T = P[0], A = P[1];
|
|
895
|
-
var L = (0, e.useCallback)((function(e) {
|
|
896
|
-
var r = w.current;
|
|
897
|
-
w.current = Math.max(0, Math.min(e, O.current.length - 1));
|
|
898
|
-
if (r === w.current) {
|
|
899
|
-
// no change in current pane
|
|
754
|
+
};
|
|
755
|
+
/**
|
|
756
|
+
* onUnmount to cleanup the operations of `onVirtualizeMount`
|
|
757
|
+
*/ var a = function e(r) {
|
|
758
|
+
var n;
|
|
759
|
+
if (!r) {
|
|
900
760
|
return;
|
|
901
761
|
}
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
var _ = (0, e.useCallback)((function(e) {
|
|
906
|
-
var r;
|
|
907
|
-
M(a, e);
|
|
908
|
-
C.current = e;
|
|
909
|
-
// This is overly defensive and could probably be removed
|
|
910
|
-
(r = j.current) === null || r === void 0 ? void 0 : r.disconnect();
|
|
911
|
-
if (!e) {
|
|
912
|
-
return;
|
|
762
|
+
var t = I.current.indexOf(r);
|
|
763
|
+
if (t >= 0) {
|
|
764
|
+
I.current.splice(t, 1);
|
|
913
765
|
}
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
766
|
+
var o = j.current.indexOf(r);
|
|
767
|
+
if (o) {
|
|
768
|
+
j.current.splice(o, 1);
|
|
769
|
+
}
|
|
770
|
+
(n = k.current) === null || n === void 0 ? void 0 : n.unobserve(r);
|
|
771
|
+
};
|
|
772
|
+
return [].concat(ee(Q(n[t - 1], o(I), a, {
|
|
773
|
+
trackFirstElement: true
|
|
774
|
+
})), ee((e = n[t]) !== null && e !== void 0 ? e : []), ee(Q(n[t + 1], o(j), a, {
|
|
775
|
+
trackLastElement: true
|
|
776
|
+
})));
|
|
777
|
+
}), []);
|
|
778
|
+
var P = (0, n.useState)(R), x = oe(P, 2), A = x[0], T = x[1];
|
|
779
|
+
var L = (0, n.useCallback)((function(e) {
|
|
780
|
+
var r = M.current;
|
|
781
|
+
M.current = Math.max(0, Math.min(e, O.current.length - 1));
|
|
782
|
+
if (r === M.current) {
|
|
783
|
+
// no change in current pane
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
T(R);
|
|
787
|
+
}), [ R ]);
|
|
788
|
+
// Link an IntersectionObserver instance with the menu children to be observed
|
|
789
|
+
var _ = (0, n.useCallback)((function(e) {
|
|
790
|
+
var r;
|
|
791
|
+
C(a, e);
|
|
792
|
+
w.current = e;
|
|
793
|
+
// This is overly defensive and could probably be removed
|
|
794
|
+
(r = k.current) === null || r === void 0 ? void 0 : r.disconnect();
|
|
795
|
+
if (!e) {
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
I.current = [];
|
|
799
|
+
j.current = [];
|
|
800
|
+
// Run the observation flow
|
|
801
|
+
k.current = new IntersectionObserver((function(r) {
|
|
802
|
+
var n;
|
|
803
|
+
var t = M.current;
|
|
804
|
+
var o = e.firstElementChild;
|
|
805
|
+
if (!!o && o.scrollHeight < e.clientHeight) {
|
|
806
|
+
var a;
|
|
807
|
+
// If the first element doesn't require a scrollbar then it's likely a filter input
|
|
808
|
+
o = (a = o) === null || a === void 0 ? void 0 : a.nextElementSibling;
|
|
809
|
+
}
|
|
810
|
+
if (((n = o) === null || n === void 0 ? void 0 : n.scrollTop) === 0 && t === 0 && O.current.length > 1 && r.some((function(e) {
|
|
811
|
+
return e.isIntersecting;
|
|
812
|
+
}))) {
|
|
813
|
+
// The menu hasn't scrolled, is on pane 0, and already has an intersection, the `virtualization` prop is too small
|
|
814
|
+
m((function(e) {
|
|
815
|
+
return e + 10;
|
|
949
816
|
}));
|
|
950
|
-
|
|
951
|
-
root: e
|
|
952
|
-
});
|
|
953
|
-
}), [ a, L ]);
|
|
954
|
-
var q = (0, e.useCallback)((function(e) {
|
|
955
|
-
var r = C.current;
|
|
956
|
-
if (!r) {
|
|
817
|
+
if (false) {}
|
|
957
818
|
return;
|
|
958
819
|
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
var o;
|
|
965
|
-
// if the first pane is already rendered, find the first element and focus it
|
|
966
|
-
var a = (0, z.getSortedTabbableElements)(r, {
|
|
967
|
-
ignoreTabIndex: true
|
|
968
|
-
});
|
|
969
|
-
var i = a[0];
|
|
970
|
-
i === null || i === void 0 ? void 0 : (o = i.focus) === null || o === void 0 ? void 0 : o.call(i);
|
|
971
|
-
} else {
|
|
972
|
-
// if it's not rendered, set up focusing it after the next render
|
|
973
|
-
p.current = true;
|
|
974
|
-
// then call changePane() to trigger the render
|
|
975
|
-
L(0);
|
|
820
|
+
var i = false;
|
|
821
|
+
r.forEach((function(e) {
|
|
822
|
+
if (i || !e.isIntersecting) {
|
|
823
|
+
// don't process if the pane changed or the entry isn't intersecting
|
|
824
|
+
return;
|
|
976
825
|
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
var c;
|
|
984
|
-
// if the last pane is already rendered, find the first element and focus it
|
|
985
|
-
var s = (0, z.getSortedTabbableElements)(r, {
|
|
986
|
-
ignoreTabIndex: true
|
|
987
|
-
});
|
|
988
|
-
var f = s[s.length - 1];
|
|
989
|
-
f === null || f === void 0 ? void 0 : (c = f.focus) === null || c === void 0 ? void 0 : c.call(f);
|
|
990
|
-
} else {
|
|
991
|
-
// if it's not rendered, set up focusing it after the next render
|
|
992
|
-
b.current = true;
|
|
993
|
-
// then call changePane() to trigger the render
|
|
994
|
-
L(l);
|
|
826
|
+
if (I.current.includes(e.target)) {
|
|
827
|
+
i = true;
|
|
828
|
+
L(t - 1);
|
|
829
|
+
} else if (j.current.includes(e.target)) {
|
|
830
|
+
i = true;
|
|
831
|
+
L(t + 1);
|
|
995
832
|
}
|
|
996
|
-
return;
|
|
997
|
-
}
|
|
998
|
-
var v = (0, z.getSortedTabbableElements)(r, {
|
|
999
|
-
ignoreTabIndex: true
|
|
1000
|
-
});
|
|
1001
|
-
var d = (e === null || e === void 0 ? void 0 : e.target) instanceof Element ? e.target : null;
|
|
1002
|
-
var m = r === null || r === void 0 ? void 0 : r.querySelector(":focus");
|
|
1003
|
-
var y = d || m;
|
|
1004
|
-
var g = y ? v.indexOf(y) : -1;
|
|
1005
|
-
(0, z.handleFocus)(n, v, g, {
|
|
1006
|
-
enableLoop: false,
|
|
1007
|
-
// VirtualizedResultsMenu does not support looping focus
|
|
1008
|
-
orientation: "vertical",
|
|
1009
|
-
enableTab: false,
|
|
1010
|
-
enableHomeEnd: false
|
|
1011
|
-
});
|
|
1012
|
-
}), [ L ]);
|
|
1013
|
-
(0, e.useEffect)((function() {
|
|
1014
|
-
m((function(e) {
|
|
1015
|
-
if (false) {}
|
|
1016
|
-
return o;
|
|
1017
833
|
}));
|
|
1018
|
-
}),
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
(
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
834
|
+
}), {
|
|
835
|
+
root: e
|
|
836
|
+
});
|
|
837
|
+
}), [ a, L ]);
|
|
838
|
+
var q = (0, n.useCallback)((function(e) {
|
|
839
|
+
var r = w.current;
|
|
840
|
+
if (!r) {
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
e.preventDefault();
|
|
844
|
+
var n = e.key;
|
|
845
|
+
if (n === "Home") {
|
|
846
|
+
var t = M.current === 0;
|
|
847
|
+
if (t) {
|
|
848
|
+
var o;
|
|
849
|
+
// if the first pane is already rendered, find the first element and focus it
|
|
850
|
+
var a = (0, V.getSortedTabbableElements)(r, {
|
|
851
|
+
ignoreTabIndex: true
|
|
852
|
+
});
|
|
853
|
+
var i = a[0];
|
|
854
|
+
i === null || i === void 0 ? void 0 : (o = i.focus) === null || o === void 0 ? void 0 : o.call(i);
|
|
855
|
+
} else {
|
|
856
|
+
// if it's not rendered, set up focusing it after the next render
|
|
857
|
+
b.current = true;
|
|
858
|
+
// then call changePane() to trigger the render
|
|
859
|
+
L(0);
|
|
1036
860
|
}
|
|
1037
|
-
return
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
var u = O.current.length - 1;
|
|
864
|
+
if (n === "End") {
|
|
865
|
+
var l = M.current === u;
|
|
866
|
+
if (l) {
|
|
867
|
+
var c;
|
|
868
|
+
// if the last pane is already rendered, find the first element and focus it
|
|
869
|
+
var s = (0, V.getSortedTabbableElements)(r, {
|
|
870
|
+
ignoreTabIndex: true
|
|
871
|
+
});
|
|
872
|
+
var f = s[s.length - 1];
|
|
873
|
+
f === null || f === void 0 ? void 0 : (c = f.focus) === null || c === void 0 ? void 0 : c.call(f);
|
|
874
|
+
} else {
|
|
875
|
+
// if it's not rendered, set up focusing it after the next render
|
|
876
|
+
p.current = true;
|
|
877
|
+
// then call changePane() to trigger the render
|
|
878
|
+
L(u);
|
|
1054
879
|
}
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
882
|
+
var d = (0, V.getSortedTabbableElements)(r, {
|
|
883
|
+
ignoreTabIndex: true
|
|
884
|
+
});
|
|
885
|
+
var v = (e === null || e === void 0 ? void 0 : e.target) instanceof Element ? e.target : null;
|
|
886
|
+
var m = r === null || r === void 0 ? void 0 : r.querySelector(":focus");
|
|
887
|
+
var y = v || m;
|
|
888
|
+
var g = y ? d.indexOf(y) : -1;
|
|
889
|
+
(0, V.handleFocus)(n, d, g, {
|
|
890
|
+
enableLoop: false,
|
|
891
|
+
// VirtualizedResultsMenu does not support looping focus
|
|
892
|
+
orientation: "vertical",
|
|
893
|
+
enableTab: false,
|
|
894
|
+
enableHomeEnd: false
|
|
895
|
+
});
|
|
896
|
+
}), [ L ]);
|
|
897
|
+
(0, n.useEffect)((function() {
|
|
898
|
+
m((function(e) {
|
|
899
|
+
if (false) {}
|
|
900
|
+
return o;
|
|
901
|
+
}));
|
|
902
|
+
}), [ o ]);
|
|
903
|
+
(0, n.useEffect)((function() {
|
|
904
|
+
O.current = W(g, v);
|
|
905
|
+
T(R);
|
|
906
|
+
}), [ g, v, R ]);
|
|
907
|
+
(0, n.useEffect)((function() {
|
|
908
|
+
return function() {
|
|
909
|
+
var e;
|
|
910
|
+
return (e = k.current) === null || e === void 0 ? void 0 : e.disconnect();
|
|
911
|
+
};
|
|
912
|
+
}), []);
|
|
913
|
+
(0, n.useEffect)((function() {
|
|
914
|
+
if (l === "never") {
|
|
915
|
+
return undefined;
|
|
916
|
+
}
|
|
917
|
+
var e = w.current;
|
|
918
|
+
if (e) {
|
|
919
|
+
e.addEventListener("keydown", q);
|
|
920
|
+
}
|
|
921
|
+
return function() {
|
|
922
|
+
e === null || e === void 0 ? void 0 : e.removeEventListener("keydown", q);
|
|
923
|
+
};
|
|
924
|
+
}), [ q, l ]);
|
|
925
|
+
|
|
926
|
+
return t().createElement(B, Z({
|
|
927
|
+
elementRef: _,
|
|
928
|
+
focusMode: l
|
|
929
|
+
}, c), A);
|
|
930
|
+
}
|
|
931
|
+
he.propTypes = ye;
|
|
932
|
+
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
933
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
934
|
+
var Se = {
|
|
935
|
+
body: {
|
|
936
|
+
appendChild: function e() {
|
|
1066
937
|
return [];
|
|
1067
|
-
},
|
|
1068
|
-
getElementById: function e() {
|
|
1069
|
-
return null;
|
|
1070
|
-
},
|
|
1071
|
-
createEvent: function e() {
|
|
1072
|
-
return {
|
|
1073
|
-
initEvent: function e() {}
|
|
1074
|
-
};
|
|
1075
|
-
},
|
|
1076
|
-
createElement: function e() {
|
|
1077
|
-
return {
|
|
1078
|
-
children: [],
|
|
1079
|
-
childNodes: [],
|
|
1080
|
-
style: {},
|
|
1081
|
-
setAttribute: function e() {},
|
|
1082
|
-
getElementsByTagName: function e() {
|
|
1083
|
-
return [];
|
|
1084
|
-
}
|
|
1085
|
-
};
|
|
1086
|
-
},
|
|
1087
|
-
createElementNS: function e() {
|
|
1088
|
-
return {};
|
|
1089
|
-
},
|
|
1090
|
-
importNode: function e() {
|
|
1091
|
-
return null;
|
|
1092
|
-
},
|
|
1093
|
-
location: {
|
|
1094
|
-
hash: "",
|
|
1095
|
-
host: "",
|
|
1096
|
-
hostname: "",
|
|
1097
|
-
href: "",
|
|
1098
|
-
origin: "",
|
|
1099
|
-
pathname: "",
|
|
1100
|
-
protocol: "",
|
|
1101
|
-
search: ""
|
|
1102
938
|
}
|
|
1103
|
-
}
|
|
1104
|
-
function
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
},
|
|
1133
|
-
CustomEvent: function e() {
|
|
1134
|
-
return this;
|
|
1135
|
-
},
|
|
1136
|
-
addEventListener: function e() {},
|
|
1137
|
-
removeEventListener: function e() {},
|
|
1138
|
-
getComputedStyle: function e() {
|
|
1139
|
-
return {
|
|
1140
|
-
getPropertyValue: function e() {
|
|
1141
|
-
return "";
|
|
1142
|
-
}
|
|
1143
|
-
};
|
|
1144
|
-
},
|
|
1145
|
-
Image: function e() {},
|
|
1146
|
-
Date: function e() {},
|
|
1147
|
-
screen: {},
|
|
1148
|
-
setTimeout: function e() {},
|
|
1149
|
-
clearTimeout: function e() {},
|
|
1150
|
-
matchMedia: function e() {
|
|
1151
|
-
return {};
|
|
1152
|
-
},
|
|
1153
|
-
requestAnimationFrame: function e(r) {
|
|
1154
|
-
if (typeof setTimeout === "undefined") {
|
|
1155
|
-
r();
|
|
1156
|
-
return null;
|
|
939
|
+
},
|
|
940
|
+
addEventListener: function e() {},
|
|
941
|
+
removeEventListener: function e() {},
|
|
942
|
+
activeElement: {
|
|
943
|
+
blur: function e() {},
|
|
944
|
+
nodeName: ""
|
|
945
|
+
},
|
|
946
|
+
querySelector: function e() {
|
|
947
|
+
return null;
|
|
948
|
+
},
|
|
949
|
+
querySelectorAll: function e() {
|
|
950
|
+
return [];
|
|
951
|
+
},
|
|
952
|
+
getElementById: function e() {
|
|
953
|
+
return null;
|
|
954
|
+
},
|
|
955
|
+
createEvent: function e() {
|
|
956
|
+
return {
|
|
957
|
+
initEvent: function e() {}
|
|
958
|
+
};
|
|
959
|
+
},
|
|
960
|
+
createElement: function e() {
|
|
961
|
+
return {
|
|
962
|
+
children: [],
|
|
963
|
+
childNodes: [],
|
|
964
|
+
style: {},
|
|
965
|
+
setAttribute: function e() {},
|
|
966
|
+
getElementsByTagName: function e() {
|
|
967
|
+
return [];
|
|
1157
968
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
969
|
+
};
|
|
970
|
+
},
|
|
971
|
+
createElementNS: function e() {
|
|
972
|
+
return {};
|
|
973
|
+
},
|
|
974
|
+
importNode: function e() {
|
|
975
|
+
return null;
|
|
976
|
+
},
|
|
977
|
+
location: {
|
|
978
|
+
hash: "",
|
|
979
|
+
host: "",
|
|
980
|
+
hostname: "",
|
|
981
|
+
href: "",
|
|
982
|
+
origin: "",
|
|
983
|
+
pathname: "",
|
|
984
|
+
protocol: "",
|
|
985
|
+
search: ""
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
function Ee() {
|
|
989
|
+
var e = typeof document !== "undefined" ? document : Se;
|
|
990
|
+
return e;
|
|
991
|
+
}
|
|
992
|
+
var Oe = Ee();
|
|
993
|
+
/* harmony default export */ const Me = /* unused pure expression or super */ null && Oe;
|
|
994
|
+
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
995
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
996
|
+
var we = {
|
|
997
|
+
document: Se,
|
|
998
|
+
navigator: {
|
|
999
|
+
userAgent: ""
|
|
1000
|
+
},
|
|
1001
|
+
location: {
|
|
1002
|
+
hash: "",
|
|
1003
|
+
host: "",
|
|
1004
|
+
hostname: "",
|
|
1005
|
+
href: "",
|
|
1006
|
+
origin: "",
|
|
1007
|
+
pathname: "",
|
|
1008
|
+
protocol: "",
|
|
1009
|
+
search: ""
|
|
1010
|
+
},
|
|
1011
|
+
history: {
|
|
1012
|
+
replaceState: function e() {},
|
|
1013
|
+
pushState: function e() {},
|
|
1014
|
+
go: function e() {},
|
|
1015
|
+
back: function e() {}
|
|
1016
|
+
},
|
|
1017
|
+
CustomEvent: function e() {
|
|
1018
|
+
return this;
|
|
1019
|
+
},
|
|
1020
|
+
addEventListener: function e() {},
|
|
1021
|
+
removeEventListener: function e() {},
|
|
1022
|
+
getComputedStyle: function e() {
|
|
1023
|
+
return {
|
|
1024
|
+
getPropertyValue: function e() {
|
|
1025
|
+
return "";
|
|
1163
1026
|
}
|
|
1164
|
-
|
|
1027
|
+
};
|
|
1028
|
+
},
|
|
1029
|
+
Image: function e() {},
|
|
1030
|
+
Date: function e() {},
|
|
1031
|
+
screen: {},
|
|
1032
|
+
setTimeout: function e() {},
|
|
1033
|
+
clearTimeout: function e() {},
|
|
1034
|
+
matchMedia: function e() {
|
|
1035
|
+
return {};
|
|
1036
|
+
},
|
|
1037
|
+
requestAnimationFrame: function e(r) {
|
|
1038
|
+
if (typeof setTimeout === "undefined") {
|
|
1039
|
+
r();
|
|
1040
|
+
return null;
|
|
1165
1041
|
}
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1042
|
+
return setTimeout(r, 0);
|
|
1043
|
+
},
|
|
1044
|
+
cancelAnimationFrame: function e(r) {
|
|
1045
|
+
if (typeof setTimeout === "undefined") {
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
clearTimeout(r);
|
|
1170
1049
|
}
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1050
|
+
};
|
|
1051
|
+
function Ce() {
|
|
1052
|
+
var e = typeof window !== "undefined" ? window : we;
|
|
1053
|
+
return e;
|
|
1054
|
+
}
|
|
1055
|
+
var ke = Ce();
|
|
1056
|
+
/* harmony default export */ const je = /* unused pure expression or super */ null && ke;
|
|
1057
|
+
// CONCATENATED MODULE: ./src/ResultsMenu/VirtualizedResultsMenu/index.ts
|
|
1058
|
+
// eslint-disable-next-line no-relative-imports-of-published -- TODO(SUI-8190): VirtualizedResultsMenu wraps ResultsMenu, using external import creates circular dependency
|
|
1059
|
+
// In environments without IntersectionObserver support this should just export ResultsMenu
|
|
1060
|
+
var Ie = "IntersectionObserver" in Ce() ? he : B;
|
|
1061
|
+
/* harmony default export */ const Re = Ie;
|
|
1062
|
+
// CONCATENATED MODULE: ./src/ResultsMenu/index.ts
|
|
1063
|
+
module.exports = r;
|
|
1180
1064
|
/******/})();
|