@splunk/react-ui 4.21.0 → 4.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +425 -325
- package/Anchor.js +147 -117
- package/Animation.js +142 -94
- package/AnimationToggle.js +197 -193
- package/Box.js +145 -118
- package/Breadcrumbs.js +288 -206
- package/Button.js +488 -465
- package/ButtonGroup.js +160 -128
- package/ButtonSimple.js +543 -462
- package/CHANGELOG.md +7 -2
- package/Calendar.js +1111 -1001
- package/Card.js +771 -598
- package/CardLayout.js +205 -147
- package/Chip.js +509 -488
- package/Clickable.js +414 -352
- package/CloseButton.js +165 -142
- package/Code.js +1808 -2084
- package/Code.js.LICENSE.txt +8 -0
- package/CollapsiblePanel.js +586 -519
- package/Color.js +1066 -1069
- package/ColumnLayout.js +402 -363
- package/ComboBox.js +891 -794
- package/Concertina.js +997 -802
- package/ControlGroup.js +687 -594
- package/Date.js +567 -547
- package/DefinitionList.js +308 -234
- package/Divider.js +149 -118
- package/Dropdown.js +459 -416
- package/DualListbox.js +1479 -1541
- package/EventListener.js +94 -97
- package/File.js +1051 -969
- package/FormRows.js +883 -696
- package/Heading.js +216 -193
- package/Image.js +446 -402
- package/JSONTree.js +690 -551
- package/Layer.js +437 -410
- package/Link.js +336 -255
- package/List.js +213 -161
- package/Markdown.js +509 -487
- package/Menu.js +1105 -1056
- package/Message.js +475 -441
- package/MessageBar.js +387 -373
- package/Modal.js +810 -634
- package/ModalLayer.js +326 -243
- package/Monogram.js +308 -276
- package/Multiselect.js +3550 -3364
- package/Number.js +729 -687
- package/Paginator.js +510 -449
- package/Paragraph.js +145 -112
- package/Popover.js +1459 -1432
- package/Progress.js +301 -246
- package/RadioBar.js +610 -527
- package/RadioList.js +483 -444
- package/Resize.js +530 -489
- package/ResultsMenu.js +494 -455
- package/ScreenReaderContent.js +142 -111
- package/Scroll.js +595 -456
- package/ScrollContainerContext.js +197 -206
- package/Search.js +744 -650
- package/Select.js +2442 -2345
- package/SidePanel.js +390 -284
- package/Slider.js +669 -676
- package/SlidingPanels.js +639 -503
- package/SplitButton.js +464 -367
- package/StaticContent.js +161 -133
- package/StepBar.js +386 -358
- package/Switch.js +710 -640
- package/TabBar.js +726 -680
- package/TabLayout.js +406 -322
- package/Table.js +4842 -4616
- package/Text.js +1170 -1138
- package/TextArea.js +1102 -1090
- package/Tooltip.js +624 -581
- package/TransitionOpen.js +489 -422
- package/Typography.js +176 -153
- package/WaitSpinner.js +230 -206
- package/package.json +5 -5
- package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
- package/types/src/JSONTree/TreeNode.d.ts +5 -0
- package/useForceUpdate.js +112 -82
- package/useKeyPress.js +74 -71
- package/usePrevious.js +65 -65
- package/useRovingFocus.js +122 -138
package/ResultsMenu.js
CHANGED
|
@@ -1,469 +1,508 @@
|
|
|
1
|
-
/******/ (() => {
|
|
2
|
-
|
|
3
|
-
/******/
|
|
4
|
-
/******/
|
|
5
|
-
/******/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/******/
|
|
9
|
-
/******/
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
/******/
|
|
27
|
-
/******/
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/
|
|
38
|
-
/******/
|
|
39
|
-
/******/
|
|
40
|
-
/******/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/******/
|
|
44
|
-
/******/
|
|
45
|
-
/******/
|
|
46
|
-
/******/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
})(["
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}));
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
1
|
+
/******/ (() => {
|
|
2
|
+
// webpackBootstrap
|
|
3
|
+
/******/ "use strict";
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var e = {};
|
|
6
|
+
/******/
|
|
7
|
+
/************************************************************************/
|
|
8
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
9
|
+
/******/ (() => {
|
|
10
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
+
/******/ e.n = t => {
|
|
12
|
+
/******/ var o = t && t.__esModule ?
|
|
13
|
+
/******/ () => t["default"]
|
|
14
|
+
/******/ : () => t
|
|
15
|
+
/******/;
|
|
16
|
+
e.d(o, {
|
|
17
|
+
a: o
|
|
18
|
+
});
|
|
19
|
+
/******/ return o;
|
|
20
|
+
/******/ };
|
|
21
|
+
/******/ })();
|
|
22
|
+
/******/
|
|
23
|
+
/******/ /* webpack/runtime/define property getters */
|
|
24
|
+
/******/ (() => {
|
|
25
|
+
/******/ // define getter functions for harmony exports
|
|
26
|
+
/******/ e.d = (t, o) => {
|
|
27
|
+
/******/ for (var n in o) {
|
|
28
|
+
/******/ if (e.o(o, n) && !e.o(t, n)) {
|
|
29
|
+
/******/ Object.defineProperty(t, n, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: o[n]
|
|
32
|
+
});
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ }
|
|
35
|
+
/******/ };
|
|
36
|
+
/******/ })();
|
|
37
|
+
/******/
|
|
38
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
|
+
/******/ (() => {
|
|
40
|
+
/******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
41
|
+
/******/;
|
|
42
|
+
})();
|
|
43
|
+
/******/
|
|
44
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
45
|
+
/******/ (() => {
|
|
46
|
+
/******/ // define __esModule on exports
|
|
47
|
+
/******/ e.r = e => {
|
|
48
|
+
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
49
|
+
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
50
|
+
value: "Module"
|
|
51
|
+
});
|
|
52
|
+
/******/ }
|
|
53
|
+
/******/ Object.defineProperty(e, "__esModule", {
|
|
54
|
+
value: true
|
|
55
|
+
});
|
|
56
|
+
/******/ };
|
|
57
|
+
/******/ })();
|
|
58
|
+
/******/
|
|
59
|
+
/************************************************************************/ var t = {};
|
|
60
|
+
// ESM COMPAT FLAG
|
|
61
|
+
e.r(t);
|
|
62
|
+
// EXPORTS
|
|
63
|
+
e.d(t, {
|
|
64
|
+
default: () => /* reexport */ U
|
|
65
|
+
});
|
|
66
|
+
// CONCATENATED MODULE: external "react"
|
|
67
|
+
const o = require("react");
|
|
68
|
+
var n = e.n(o);
|
|
69
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
70
|
+
const r = require("prop-types");
|
|
71
|
+
var l = e.n(r);
|
|
72
|
+
// CONCATENATED MODULE: external "lodash/keys"
|
|
73
|
+
const i = require("lodash/keys");
|
|
74
|
+
var a = e.n(i);
|
|
75
|
+
// CONCATENATED MODULE: external "lodash/memoize"
|
|
76
|
+
const s = require("lodash/memoize");
|
|
77
|
+
var u = e.n(s);
|
|
78
|
+
// CONCATENATED MODULE: external "lodash/omit"
|
|
79
|
+
const c = require("lodash/omit");
|
|
80
|
+
var p = e.n(c);
|
|
81
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
82
|
+
const f = require("@splunk/ui-utils/i18n");
|
|
83
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/userAgent"
|
|
84
|
+
const d = require("@splunk/ui-utils/userAgent");
|
|
85
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
|
|
86
|
+
const m = require("@splunk/react-ui/Menu");
|
|
87
|
+
var h = e.n(m);
|
|
88
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
89
|
+
const v = require("styled-components");
|
|
90
|
+
var g = e.n(v);
|
|
91
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/WaitSpinner"
|
|
92
|
+
const b = require("@splunk/react-ui/WaitSpinner");
|
|
93
|
+
var y = e.n(b);
|
|
94
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
95
|
+
const M = require("@splunk/themes");
|
|
96
|
+
// CONCATENATED MODULE: ./src/ResultsMenu/ResultsMenuStyles.ts
|
|
97
|
+
var S = g().div.withConfig({
|
|
98
|
+
displayName: "ResultsMenuStyles__Styled",
|
|
99
|
+
componentId: "avbhl8-0"
|
|
100
|
+
})([ "", ";flex-direction:column;max-height:calc(100vh - 20px);", "" ], M.mixins.reset("flex"), (0,
|
|
101
|
+
M.pick)({
|
|
102
|
+
prisma: (0, v.css)([ "border-radius:", ";background-color:", ";" ], M.variables.borderRadius, M.variables.backgroundColorPopup)
|
|
103
|
+
}));
|
|
104
|
+
var x = g().div.withConfig({
|
|
105
|
+
displayName: "ResultsMenuStyles__StyledFooter",
|
|
106
|
+
componentId: "avbhl8-1"
|
|
107
|
+
})([ "padding:", ";color:", ";", "" ], (0, M.pick)({
|
|
108
|
+
prisma: {
|
|
109
|
+
comfortable: "10px 16px",
|
|
110
|
+
compact: "6px 16px"
|
|
111
|
+
},
|
|
112
|
+
enterprise: "6px 10px"
|
|
113
|
+
}), (0, M.pick)({
|
|
114
|
+
prisma: M.variables.contentColorMuted,
|
|
115
|
+
enterprise: M.variables.textGray
|
|
116
|
+
}), (function(e) {
|
|
117
|
+
var t = e.$placement;
|
|
118
|
+
return t === "above" ? (0, M.pick)({
|
|
119
|
+
prisma: (0, v.css)([ "border-bottom:1px solid ", ";" ], M.variables.neutral200),
|
|
120
|
+
enterprise: (0, v.css)([ "border-bottom:", ";" ], M.variables.border)
|
|
121
|
+
}) : (0, M.pick)({
|
|
122
|
+
prisma: (0, v.css)([ "border-top:1px solid ", ";" ], M.variables.neutral200),
|
|
123
|
+
enterprise: (0, v.css)([ "border-top:", ";" ], M.variables.border)
|
|
124
|
+
});
|
|
125
|
+
}));
|
|
126
|
+
var E = g().li.withConfig({
|
|
127
|
+
displayName: "ResultsMenuStyles__StyledLoading",
|
|
128
|
+
componentId: "avbhl8-2"
|
|
129
|
+
})([ "", ";padding:", ";gap:", ";" ], M.mixins.reset("flex"), (0, M.pick)({
|
|
130
|
+
prisma: {
|
|
131
|
+
comfortable: "10px 16px",
|
|
132
|
+
compact: "6px 16px"
|
|
133
|
+
},
|
|
134
|
+
enterprise: "6px 10px"
|
|
135
|
+
}), M.variables.spacingXSmall);
|
|
136
|
+
var O = g()(y()).withConfig({
|
|
137
|
+
displayName: "ResultsMenuStyles__StyledWait",
|
|
138
|
+
componentId: "avbhl8-3"
|
|
139
|
+
})([ "flex:0 0 auto;" ]);
|
|
140
|
+
var k = g().div.withConfig({
|
|
141
|
+
displayName: "ResultsMenuStyles__StyledLoadingMessage",
|
|
142
|
+
componentId: "avbhl8-4"
|
|
143
|
+
})([ "flex:1 0 0;color:", ";" ], (0, M.pick)({
|
|
144
|
+
prisma: M.variables.contentColorMuted,
|
|
145
|
+
enterprise: M.variables.textGray
|
|
146
|
+
}));
|
|
147
|
+
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
148
|
+
/**
|
|
143
149
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
144
150
|
*
|
|
145
151
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
146
152
|
* @param current - The new value of the ref.
|
|
147
153
|
*/
|
|
148
|
-
function
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
function w(e, t) {
|
|
155
|
+
if (e) {
|
|
156
|
+
if (typeof e === "function") {
|
|
157
|
+
e(t);
|
|
158
|
+
} else {
|
|
159
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
160
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
161
|
+
e.current = t;
|
|
162
|
+
// eslint-disable-line no-param-reassign
|
|
163
|
+
}
|
|
164
|
+
}
|
|
156
165
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
169
|
-
|
|
170
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
171
|
-
|
|
172
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
173
|
-
|
|
174
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
175
|
-
|
|
176
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
177
|
-
|
|
178
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
179
|
-
|
|
180
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
181
|
-
|
|
182
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
183
|
-
|
|
184
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
185
|
-
|
|
186
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
var propTypes = {
|
|
199
|
-
animateLoading: (external_prop_types_default()).bool,
|
|
200
|
-
children: (external_prop_types_default()).node,
|
|
201
|
-
|
|
202
|
-
/** @private */
|
|
203
|
-
controlledExternally: (external_prop_types_default()).bool,
|
|
204
|
-
childrenStart: (external_prop_types_default()).node,
|
|
205
|
-
elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
206
|
-
footerMessage: (external_prop_types_default()).node,
|
|
207
|
-
isLoading: (external_prop_types_default()).bool,
|
|
208
|
-
loadingMessage: (external_prop_types_default()).node,
|
|
209
|
-
maxHeight: (external_prop_types_default()).number,
|
|
210
|
-
noOptionsMessage: (external_prop_types_default()).node,
|
|
211
|
-
onScroll: (external_prop_types_default()).func,
|
|
212
|
-
onScrollBottom: (external_prop_types_default()).func,
|
|
213
|
-
placement: (external_prop_types_default()).string
|
|
214
|
-
};
|
|
215
|
-
var defaultProps = {
|
|
216
|
-
animateLoading: false,
|
|
217
|
-
isLoading: false,
|
|
218
|
-
loadingMessage: (0,i18n_namespaceObject._)('Loading...'),
|
|
219
|
-
noOptionsMessage: (0,i18n_namespaceObject._)('No matches')
|
|
220
|
-
};
|
|
221
|
-
var menuContextRole = {
|
|
222
|
-
role: 'listbox'
|
|
223
|
-
};
|
|
224
|
-
var getMenuInlineStyle = memoize_default()(function (menuMaxHeight) {
|
|
225
|
-
return {
|
|
226
|
-
overflow: 'auto',
|
|
227
|
-
maxHeight: menuMaxHeight || 'calc(100vh - 20px)',
|
|
228
|
-
flexDirection: 'column'
|
|
229
|
-
};
|
|
230
|
-
});
|
|
231
|
-
var getMenuBottomInlineStyle = memoize_default()(function (height) {
|
|
232
|
-
return {
|
|
233
|
-
height: height
|
|
234
|
-
};
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
// @docs-props-type ResultsMenuPropsBase
|
|
238
|
-
var ResultsMenu = /*#__PURE__*/function (_Component) {
|
|
239
|
-
_inherits(ResultsMenu, _Component);
|
|
240
|
-
|
|
241
|
-
var _super = _createSuper(ResultsMenu);
|
|
242
|
-
|
|
243
|
-
function ResultsMenu(props) {
|
|
244
|
-
var _this;
|
|
245
|
-
|
|
246
|
-
_classCallCheck(this, ResultsMenu);
|
|
247
|
-
|
|
248
|
-
_this = _super.call(this, props);
|
|
249
|
-
|
|
250
|
-
_defineProperty(_assertThisInitialized(_this), "scrollBottomOffset", void 0);
|
|
251
|
-
|
|
252
|
-
_defineProperty(_assertThisInitialized(_this), "itemMinHeight", void 0);
|
|
253
|
-
|
|
254
|
-
_defineProperty(_assertThisInitialized(_this), "handleMenuMount", function (menuEl) {
|
|
255
|
-
_this.setState({
|
|
256
|
-
menuEl: menuEl
|
|
257
|
-
});
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
_defineProperty(_assertThisInitialized(_this), "handleMount", function (el) {
|
|
261
|
-
_this.setState({
|
|
262
|
-
containerEl: el
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
updateReactRef(_this.props.elementRef, el);
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
_defineProperty(_assertThisInitialized(_this), "handleMouseEnter", function () {
|
|
269
|
-
_this.setState({
|
|
270
|
-
windowTop: document.documentElement.scrollTop
|
|
271
|
-
});
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
_defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function () {
|
|
275
|
-
_this.setState({
|
|
276
|
-
windowTop: document.documentElement.scrollTop
|
|
277
|
-
});
|
|
278
|
-
});
|
|
279
|
-
|
|
280
|
-
_defineProperty(_assertThisInitialized(_this), "handleScroll", function (e) {
|
|
281
|
-
var _this$props$onScroll, _this$props;
|
|
282
|
-
|
|
283
|
-
if (_this.props.onScrollBottom != null) {
|
|
284
|
-
if (e.target && _this.state.menuEl) {
|
|
285
|
-
var bottomScrollMenu = _this.state.menuEl.scrollHeight - _this.state.menuEl.offsetHeight - _this.scrollBottomOffset; // Adding 1 due to border of menu item.
|
|
286
|
-
|
|
287
|
-
if (_this.state.menuEl.scrollTop + 1 >= bottomScrollMenu) {
|
|
288
|
-
_this.handleScrollBottom(e);
|
|
289
|
-
}
|
|
166
|
+
// CONCATENATED MODULE: ./src/ResultsMenu/ResultsMenu.tsx
|
|
167
|
+
function _(e) {
|
|
168
|
+
"@babel/helpers - typeof";
|
|
169
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
170
|
+
_ = function e(t) {
|
|
171
|
+
return typeof t;
|
|
172
|
+
};
|
|
173
|
+
} else {
|
|
174
|
+
_ = function e(t) {
|
|
175
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
176
|
+
};
|
|
290
177
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
} // avoid triggering this logic if this.state.childrenCount is null
|
|
311
|
-
// because that's not a real change in the number of children
|
|
312
|
-
// and thus we want to avoid resetting the value of scrollBottomTriggered
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
if (menuMaxHeight && currentChildrenCount != null && currentChildrenCount !== childrenCount) {
|
|
316
|
-
_this.setState({
|
|
317
|
-
numberOfItemsLoaded: currentChildrenCount - (childrenCount !== null && childrenCount !== void 0 ? childrenCount : 0),
|
|
318
|
-
scrollBottomTriggered: false
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
if (currentChildrenCount !== childrenCount) {
|
|
323
|
-
_this.setState({
|
|
324
|
-
childrenCount: currentChildrenCount
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
_this.state = {
|
|
330
|
-
containerEl: null,
|
|
331
|
-
menuEl: null,
|
|
332
|
-
menuMaxHeight: undefined,
|
|
333
|
-
numberOfItemsLoaded: 0,
|
|
334
|
-
scrollBottomTriggered: false,
|
|
335
|
-
windowTop: 0
|
|
336
|
-
}; // The remaining amount of pixels when scrolled from bottom of menu to trigger onScrollBottom().
|
|
337
|
-
|
|
338
|
-
_this.scrollBottomOffset = 400;
|
|
339
|
-
_this.itemMinHeight = 28;
|
|
340
|
-
return _this;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
_createClass(ResultsMenu, [{
|
|
344
|
-
key: "componentDidUpdate",
|
|
345
|
-
value: function componentDidUpdate() {
|
|
346
|
-
var _this$state2 = this.state,
|
|
347
|
-
containerEl = _this$state2.containerEl,
|
|
348
|
-
menuEl = _this$state2.menuEl,
|
|
349
|
-
menuMaxHeight = _this$state2.menuMaxHeight;
|
|
350
|
-
|
|
351
|
-
if (!userAgent_namespaceObject.isIE11 || !containerEl || !menuEl) {
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
if (this.props.maxHeight) {
|
|
356
|
-
var otherElementsHeight = containerEl.scrollHeight - menuEl.clientHeight;
|
|
357
|
-
var newMenuMaxHeight = this.props.maxHeight - otherElementsHeight;
|
|
358
|
-
|
|
359
|
-
if (menuMaxHeight === undefined || Math.abs(menuMaxHeight - newMenuMaxHeight) > 1) {
|
|
360
|
-
// eslint-disable-next-line react/no-did-update-set-state
|
|
361
|
-
this.setState({
|
|
362
|
-
menuMaxHeight: newMenuMaxHeight
|
|
363
|
-
});
|
|
178
|
+
return _(e);
|
|
179
|
+
}
|
|
180
|
+
function H() {
|
|
181
|
+
H = Object.assign || function(e) {
|
|
182
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
183
|
+
var o = arguments[t];
|
|
184
|
+
for (var n in o) {
|
|
185
|
+
if (Object.prototype.hasOwnProperty.call(o, n)) {
|
|
186
|
+
e[n] = o[n];
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return e;
|
|
191
|
+
};
|
|
192
|
+
return H.apply(this, arguments);
|
|
193
|
+
}
|
|
194
|
+
function T(e, t) {
|
|
195
|
+
if (!(e instanceof t)) {
|
|
196
|
+
throw new TypeError("Cannot call a class as a function");
|
|
364
197
|
}
|
|
365
|
-
} // If onScrollBottom is defined, determine if it should be triggered.
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
if (this.props && this.props.onScrollBottom && this.props.children) {
|
|
369
|
-
this.handleScrollBottomOnFullMenu();
|
|
370
|
-
}
|
|
371
198
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
199
|
+
function B(e, t) {
|
|
200
|
+
for (var o = 0; o < t.length; o++) {
|
|
201
|
+
var n = t[o];
|
|
202
|
+
n.enumerable = n.enumerable || false;
|
|
203
|
+
n.configurable = true;
|
|
204
|
+
if ("value" in n) n.writable = true;
|
|
205
|
+
Object.defineProperty(e, n.key, n);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function C(e, t, o) {
|
|
209
|
+
if (t) B(e.prototype, t);
|
|
210
|
+
if (o) B(e, o);
|
|
211
|
+
return e;
|
|
212
|
+
}
|
|
213
|
+
function P(e, t) {
|
|
214
|
+
if (typeof t !== "function" && t !== null) {
|
|
215
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
216
|
+
}
|
|
217
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
218
|
+
constructor: {
|
|
219
|
+
value: e,
|
|
220
|
+
writable: true,
|
|
221
|
+
configurable: true
|
|
222
|
+
}
|
|
381
223
|
});
|
|
382
|
-
|
|
383
|
-
}
|
|
224
|
+
if (t) L(e, t);
|
|
384
225
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
226
|
+
function L(e, t) {
|
|
227
|
+
L = Object.setPrototypeOf || function e(t, o) {
|
|
228
|
+
t.__proto__ = o;
|
|
229
|
+
return t;
|
|
230
|
+
};
|
|
231
|
+
return L(e, t);
|
|
390
232
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
233
|
+
function j(e) {
|
|
234
|
+
var t = q();
|
|
235
|
+
return function o() {
|
|
236
|
+
var n = F(e), r;
|
|
237
|
+
if (t) {
|
|
238
|
+
var l = F(this).constructor;
|
|
239
|
+
r = Reflect.construct(n, arguments, l);
|
|
240
|
+
} else {
|
|
241
|
+
r = n.apply(this, arguments);
|
|
242
|
+
}
|
|
243
|
+
return R(this, r);
|
|
244
|
+
};
|
|
399
245
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
onScrollBottom = _this$props3.onScrollBottom,
|
|
412
|
-
placement = _this$props3.placement,
|
|
413
|
-
style = _this$props3.style,
|
|
414
|
-
tabIndex = _this$props3.tabIndex;
|
|
415
|
-
var otherProps = omit_default()(this.props, keys_default()(ResultsMenu.propTypes));
|
|
416
|
-
// Assumption: that you cannot be filtered if you are a result
|
|
417
|
-
var hasResults = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement).some(function (_ref) {
|
|
418
|
-
var type = _ref.type;
|
|
419
|
-
return !(type === Menu_namespaceObject.Divider && type.filterFirst || (type === Menu_namespaceObject.Divider || type === Menu_namespaceObject.Heading) && (type.filterLast || type.filterConsecutive));
|
|
420
|
-
});
|
|
421
|
-
var fullHeight = this.checkFullHeight();
|
|
422
|
-
var menuInlineStyle = getMenuInlineStyle(this.state.menuMaxHeight);
|
|
423
|
-
var menuBottomInlineStyle = getMenuBottomInlineStyle(this.state.scrollBottomTriggered ? this.state.numberOfItemsLoaded * this.itemMinHeight || 0 : 0);
|
|
424
|
-
/* eslint-disable jsx-a11y/aria-role */
|
|
425
|
-
|
|
426
|
-
return /*#__PURE__*/external_react_default().createElement(Styled, _extends({
|
|
427
|
-
key: "wrapper",
|
|
428
|
-
style: style,
|
|
429
|
-
ref: this.handleMount,
|
|
430
|
-
onWheel: onScrollBottom ? this.handleWheelMenu : undefined,
|
|
431
|
-
onMouseEnter: onScrollBottom ? this.handleMouseEnter : undefined,
|
|
432
|
-
onMouseLeave: onScrollBottom ? this.handleMouseLeave : undefined
|
|
433
|
-
}, omit_default()(otherProps, 'tabIndex')), placement !== 'above' && childrenStart, placement === 'above' && this.renderFooterMessage(), /*#__PURE__*/external_react_default().createElement(Menu_namespaceObject.MenuContext.Provider, {
|
|
434
|
-
value: menuContextRole
|
|
435
|
-
}, /*#__PURE__*/external_react_default().createElement((Menu_default()), {
|
|
436
|
-
key: "menu",
|
|
437
|
-
style: menuInlineStyle,
|
|
438
|
-
controlledExternally: controlledExternally,
|
|
439
|
-
elementRef: this.handleMenuMount,
|
|
440
|
-
onScroll: this.handleScroll,
|
|
441
|
-
stopScrollPropagation: true,
|
|
442
|
-
tabIndex: tabIndex
|
|
443
|
-
}, !hasResults && noOptionsMessage && !isLoading && /*#__PURE__*/external_react_default().createElement((Menu_default()).Item, {
|
|
444
|
-
"data-test": "no-results-message",
|
|
445
|
-
disabled: true
|
|
446
|
-
}, noOptionsMessage), children, onScrollBottom && !fullHeight &&
|
|
447
|
-
/*#__PURE__*/
|
|
448
|
-
// Bottom spacer fills in the space of new items being loaded by using the minimum possible height x menuItems.
|
|
449
|
-
external_react_default().createElement("div", {
|
|
450
|
-
"data-test": "results-menu-bottom-spacer",
|
|
451
|
-
style: menuBottomInlineStyle
|
|
452
|
-
}), isLoading && /*#__PURE__*/external_react_default().createElement(StyledLoading, null, animateLoading && /*#__PURE__*/external_react_default().createElement(StyledWait, null), /*#__PURE__*/external_react_default().createElement(StyledLoadingMessage, null, loadingMessage)))), placement !== 'above' && this.renderFooterMessage(), placement === 'above' && childrenStart);
|
|
246
|
+
function R(e, t) {
|
|
247
|
+
if (t && (_(t) === "object" || typeof t === "function")) {
|
|
248
|
+
return t;
|
|
249
|
+
}
|
|
250
|
+
return I(e);
|
|
251
|
+
}
|
|
252
|
+
function I(e) {
|
|
253
|
+
if (e === void 0) {
|
|
254
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
255
|
+
}
|
|
256
|
+
return e;
|
|
453
257
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
;
|
|
258
|
+
function q() {
|
|
259
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
260
|
+
if (Reflect.construct.sham) return false;
|
|
261
|
+
if (typeof Proxy === "function") return true;
|
|
262
|
+
try {
|
|
263
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
264
|
+
return true;
|
|
265
|
+
} catch (e) {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function F(e) {
|
|
270
|
+
F = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
271
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
272
|
+
};
|
|
273
|
+
return F(e);
|
|
274
|
+
}
|
|
275
|
+
function D(e, t, o) {
|
|
276
|
+
if (t in e) {
|
|
277
|
+
Object.defineProperty(e, t, {
|
|
278
|
+
value: o,
|
|
279
|
+
enumerable: true,
|
|
280
|
+
configurable: true,
|
|
281
|
+
writable: true
|
|
282
|
+
});
|
|
283
|
+
} else {
|
|
284
|
+
e[t] = o;
|
|
285
|
+
}
|
|
286
|
+
return e;
|
|
287
|
+
}
|
|
288
|
+
var N = {
|
|
289
|
+
animateLoading: l().bool,
|
|
290
|
+
children: l().node,
|
|
291
|
+
/** @private */
|
|
292
|
+
controlledExternally: l().bool,
|
|
293
|
+
childrenStart: l().node,
|
|
294
|
+
elementRef: l().oneOfType([ l().func, l().object ]),
|
|
295
|
+
footerMessage: l().node,
|
|
296
|
+
isLoading: l().bool,
|
|
297
|
+
loadingMessage: l().node,
|
|
298
|
+
maxHeight: l().number,
|
|
299
|
+
noOptionsMessage: l().node,
|
|
300
|
+
onScroll: l().func,
|
|
301
|
+
onScrollBottom: l().func,
|
|
302
|
+
placement: l().string
|
|
303
|
+
};
|
|
304
|
+
var W = {
|
|
305
|
+
animateLoading: false,
|
|
306
|
+
isLoading: false,
|
|
307
|
+
loadingMessage: (0, f._)("Loading..."),
|
|
308
|
+
noOptionsMessage: (0, f._)("No matches")
|
|
309
|
+
};
|
|
310
|
+
var A = {
|
|
311
|
+
role: "listbox"
|
|
312
|
+
};
|
|
313
|
+
var G = u()((function(e) {
|
|
314
|
+
return {
|
|
315
|
+
overflow: "auto",
|
|
316
|
+
maxHeight: e || "calc(100vh - 20px)",
|
|
317
|
+
flexDirection: "column"
|
|
318
|
+
};
|
|
319
|
+
}));
|
|
320
|
+
var $ = u()((function(e) {
|
|
321
|
+
return {
|
|
322
|
+
height: e
|
|
323
|
+
};
|
|
324
|
+
}));
|
|
325
|
+
// @docs-props-type ResultsMenuPropsBase
|
|
326
|
+
var z = function(e) {
|
|
327
|
+
P(r, e);
|
|
328
|
+
var t = j(r);
|
|
329
|
+
function r(e) {
|
|
330
|
+
var n;
|
|
331
|
+
T(this, r);
|
|
332
|
+
n = t.call(this, e);
|
|
333
|
+
D(I(n), "scrollBottomOffset", void 0);
|
|
334
|
+
D(I(n), "itemMinHeight", void 0);
|
|
335
|
+
D(I(n), "handleMenuMount", (function(e) {
|
|
336
|
+
n.setState({
|
|
337
|
+
menuEl: e
|
|
338
|
+
});
|
|
339
|
+
}));
|
|
340
|
+
D(I(n), "handleMount", (function(e) {
|
|
341
|
+
n.setState({
|
|
342
|
+
containerEl: e
|
|
343
|
+
});
|
|
344
|
+
w(n.props.elementRef, e);
|
|
345
|
+
}));
|
|
346
|
+
D(I(n), "handleMouseEnter", (function() {
|
|
347
|
+
n.setState({
|
|
348
|
+
windowTop: document.documentElement.scrollTop
|
|
349
|
+
});
|
|
350
|
+
}));
|
|
351
|
+
D(I(n), "handleMouseLeave", (function() {
|
|
352
|
+
n.setState({
|
|
353
|
+
windowTop: document.documentElement.scrollTop
|
|
354
|
+
});
|
|
355
|
+
}));
|
|
356
|
+
D(I(n), "handleScroll", (function(e) {
|
|
357
|
+
var t, o;
|
|
358
|
+
if (n.props.onScrollBottom != null) {
|
|
359
|
+
if (e.target && n.state.menuEl) {
|
|
360
|
+
var r = n.state.menuEl.scrollHeight - n.state.menuEl.offsetHeight - n.scrollBottomOffset;
|
|
361
|
+
// Adding 1 due to border of menu item.
|
|
362
|
+
if (n.state.menuEl.scrollTop + 1 >= r) {
|
|
363
|
+
n.handleScrollBottom(e);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
(t = (o = n.props).onScroll) === null || t === void 0 ? void 0 : t.call(o, e);
|
|
368
|
+
}));
|
|
369
|
+
D(I(n), "handleWheelMenu", (function(e) {
|
|
370
|
+
// Safety net to ensure window doesn't scroll if menu is scrolled pass the numberOfItemsLoaded at high velocity.
|
|
371
|
+
e.stopPropagation();
|
|
372
|
+
document.documentElement.scrollTop = n.state.windowTop;
|
|
373
|
+
}));
|
|
374
|
+
D(I(n), "handleScrollBottomOnFullMenu", (function() {
|
|
375
|
+
var e = o.Children.count(n.props.children);
|
|
376
|
+
var t = n.state, r = t.childrenCount, l = t.menuMaxHeight;
|
|
377
|
+
// If menu is full length, load more items.
|
|
378
|
+
if (n.checkFullHeight()) {
|
|
379
|
+
n.handleScrollBottom(null);
|
|
380
|
+
}
|
|
381
|
+
// avoid triggering this logic if this.state.childrenCount is null
|
|
382
|
+
// because that's not a real change in the number of children
|
|
383
|
+
// and thus we want to avoid resetting the value of scrollBottomTriggered
|
|
384
|
+
if (l && e != null && e !== r) {
|
|
385
|
+
n.setState({
|
|
386
|
+
numberOfItemsLoaded: e - (r !== null && r !== void 0 ? r : 0),
|
|
387
|
+
scrollBottomTriggered: false
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
if (e !== r) {
|
|
391
|
+
n.setState({
|
|
392
|
+
childrenCount: e
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
}));
|
|
396
|
+
n.state = {
|
|
397
|
+
containerEl: null,
|
|
398
|
+
menuEl: null,
|
|
399
|
+
menuMaxHeight: undefined,
|
|
400
|
+
numberOfItemsLoaded: 0,
|
|
401
|
+
scrollBottomTriggered: false,
|
|
402
|
+
windowTop: 0
|
|
403
|
+
};
|
|
404
|
+
// The remaining amount of pixels when scrolled from bottom of menu to trigger onScrollBottom().
|
|
405
|
+
n.scrollBottomOffset = 400;
|
|
406
|
+
n.itemMinHeight = 28;
|
|
407
|
+
return n;
|
|
408
|
+
}
|
|
409
|
+
C(r, [ {
|
|
410
|
+
key: "componentDidUpdate",
|
|
411
|
+
value: function e() {
|
|
412
|
+
var t = this.state, o = t.containerEl, n = t.menuEl, r = t.menuMaxHeight;
|
|
413
|
+
if (!d.isIE11 || !o || !n) {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
if (this.props.maxHeight) {
|
|
417
|
+
var l = o.scrollHeight - n.clientHeight;
|
|
418
|
+
var i = this.props.maxHeight - l;
|
|
419
|
+
if (r === undefined || Math.abs(r - i) > 1) {
|
|
420
|
+
// eslint-disable-next-line react/no-did-update-set-state
|
|
421
|
+
this.setState({
|
|
422
|
+
menuMaxHeight: i
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
// If onScrollBottom is defined, determine if it should be triggered.
|
|
427
|
+
if (this.props && this.props.onScrollBottom && this.props.children) {
|
|
428
|
+
this.handleScrollBottomOnFullMenu();
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}, {
|
|
432
|
+
key: "handleScrollBottom",
|
|
433
|
+
value: function e(t) {
|
|
434
|
+
// Prevent multiple calls to onScrollBottom.
|
|
435
|
+
if (!this.state.scrollBottomTriggered) {
|
|
436
|
+
var o, n;
|
|
437
|
+
this.setState({
|
|
438
|
+
scrollBottomTriggered: true
|
|
439
|
+
});
|
|
440
|
+
(o = (n = this.props).onScrollBottom) === null || o === void 0 ? void 0 : o.call(n, t);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}, {
|
|
444
|
+
key: "checkFullHeight",
|
|
445
|
+
value: function e() {
|
|
446
|
+
var t = this.state.menuEl;
|
|
447
|
+
return t && t.scrollHeight === t.offsetHeight;
|
|
448
|
+
}
|
|
449
|
+
}, {
|
|
450
|
+
key: "renderFooterMessage",
|
|
451
|
+
value: function e() {
|
|
452
|
+
return this.props.footerMessage && !!o.Children.toArray(this.props.children).length && n().createElement(x, {
|
|
453
|
+
$placement: this.props.placement,
|
|
454
|
+
"data-test": "footer-message",
|
|
455
|
+
key: "footer"
|
|
456
|
+
}, this.props.footerMessage);
|
|
457
|
+
}
|
|
458
|
+
}, {
|
|
459
|
+
key: "render",
|
|
460
|
+
value: function e() {
|
|
461
|
+
var t = this.props, l = t.animateLoading, i = t.children, s = t.controlledExternally, u = t.childrenStart, c = t.isLoading, f = t.loadingMessage, d = t.noOptionsMessage, v = t.onScrollBottom, g = t.placement, b = t.style, y = t.tabIndex;
|
|
462
|
+
var M = p()(this.props, a()(r.propTypes));
|
|
463
|
+
// Assumption: that you cannot be filtered if you are a result
|
|
464
|
+
var x = o.Children.toArray(i).filter(o.isValidElement).some((function(e) {
|
|
465
|
+
var t = e.type;
|
|
466
|
+
return !(t === m.Divider && t.filterFirst || (t === m.Divider || t === m.Heading) && (t.filterLast || t.filterConsecutive));
|
|
467
|
+
}));
|
|
468
|
+
var w = this.checkFullHeight();
|
|
469
|
+
var _ = G(this.state.menuMaxHeight);
|
|
470
|
+
var T = $(this.state.scrollBottomTriggered ? this.state.numberOfItemsLoaded * this.itemMinHeight || 0 : 0);
|
|
471
|
+
/* eslint-disable jsx-a11y/aria-role */
|
|
472
|
+
return n().createElement(S, H({
|
|
473
|
+
key: "wrapper",
|
|
474
|
+
style: b,
|
|
475
|
+
ref: this.handleMount,
|
|
476
|
+
onWheel: v ? this.handleWheelMenu : undefined,
|
|
477
|
+
onMouseEnter: v ? this.handleMouseEnter : undefined,
|
|
478
|
+
onMouseLeave: v ? this.handleMouseLeave : undefined
|
|
479
|
+
}, p()(M, "tabIndex")), g !== "above" && u, g === "above" && this.renderFooterMessage(), n().createElement(m.MenuContext.Provider, {
|
|
480
|
+
value: A
|
|
481
|
+
}, n().createElement(h(), {
|
|
482
|
+
key: "menu",
|
|
483
|
+
style: _,
|
|
484
|
+
controlledExternally: s,
|
|
485
|
+
elementRef: this.handleMenuMount,
|
|
486
|
+
onScroll: this.handleScroll,
|
|
487
|
+
stopScrollPropagation: true,
|
|
488
|
+
tabIndex: y
|
|
489
|
+
}, !x && d && !c && n().createElement(h().Item, {
|
|
490
|
+
"data-test": "no-results-message",
|
|
491
|
+
disabled: true
|
|
492
|
+
}, d), i, v && !w &&
|
|
493
|
+
|
|
494
|
+
// Bottom spacer fills in the space of new items being loaded by using the minimum possible height x menuItems.
|
|
495
|
+
n().createElement("div", {
|
|
496
|
+
"data-test": "results-menu-bottom-spacer",
|
|
497
|
+
style: T
|
|
498
|
+
}), c && n().createElement(E, null, l && n().createElement(O, null), n().createElement(k, null, f)))), g !== "above" && this.renderFooterMessage(), g === "above" && u);
|
|
499
|
+
}
|
|
500
|
+
} ]);
|
|
501
|
+
return r;
|
|
502
|
+
}(o.Component);
|
|
503
|
+
D(z, "propTypes", N);
|
|
504
|
+
D(z, "defaultProps", W);
|
|
505
|
+
/* harmony default export */ const U = z;
|
|
506
|
+
// CONCATENATED MODULE: ./src/ResultsMenu/index.ts
|
|
507
|
+
module.exports = t;
|
|
508
|
+
/******/})();
|