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