@splunk/react-ui 4.20.0 → 4.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/Accordion.js +425 -441
  2. package/Anchor.js +147 -193
  3. package/Animation.js +142 -166
  4. package/AnimationToggle.js +197 -253
  5. package/Box.js +145 -194
  6. package/Breadcrumbs.js +288 -298
  7. package/Button.js +488 -613
  8. package/ButtonGroup.js +160 -212
  9. package/ButtonSimple.js +543 -562
  10. package/CHANGELOG.md +26 -0
  11. package/Calendar.js +1107 -1195
  12. package/Card.js +771 -746
  13. package/CardLayout.js +205 -223
  14. package/Chip.js +509 -612
  15. package/Clickable.js +416 -472
  16. package/CloseButton.js +165 -250
  17. package/Code.js +1808 -2172
  18. package/Code.js.LICENSE.txt +8 -0
  19. package/CollapsiblePanel.js +586 -675
  20. package/Color.js +1066 -1297
  21. package/ColumnLayout.js +402 -465
  22. package/ComboBox.js +892 -969
  23. package/Concertina.js +998 -963
  24. package/ControlGroup.js +687 -718
  25. package/Date.js +567 -697
  26. package/DefinitionList.js +308 -310
  27. package/Divider.js +149 -194
  28. package/Dropdown.js +459 -558
  29. package/DualListbox.js +1480 -1735
  30. package/EventListener.js +94 -165
  31. package/File.js +1051 -1173
  32. package/FormRows.js +885 -880
  33. package/Heading.js +216 -263
  34. package/Image.js +446 -558
  35. package/JSONTree.js +690 -699
  36. package/Layer.js +442 -582
  37. package/Link.js +336 -361
  38. package/List.js +213 -237
  39. package/Markdown.js +510 -612
  40. package/Menu.js +1109 -1331
  41. package/Message.js +474 -629
  42. package/MessageBar.js +387 -561
  43. package/Modal.js +810 -798
  44. package/ModalLayer.js +326 -343
  45. package/Monogram.js +308 -368
  46. package/Multiselect.js +3558 -3998
  47. package/Number.js +729 -843
  48. package/Paginator.js +510 -615
  49. package/Paragraph.js +145 -188
  50. package/Popover.js +1470 -1693
  51. package/Progress.js +301 -362
  52. package/RadioBar.js +610 -651
  53. package/RadioList.js +483 -544
  54. package/Resize.js +530 -623
  55. package/ResultsMenu.js +494 -597
  56. package/ScreenReaderContent.js +142 -187
  57. package/Scroll.js +595 -598
  58. package/ScrollContainerContext.js +197 -278
  59. package/Search.js +745 -817
  60. package/Select.js +2441 -2746
  61. package/SidePanel.js +390 -392
  62. package/Slider.js +668 -825
  63. package/SlidingPanels.js +639 -645
  64. package/SplitButton.js +464 -499
  65. package/StaticContent.js +161 -217
  66. package/StepBar.js +386 -466
  67. package/Switch.js +710 -764
  68. package/TabBar.js +724 -815
  69. package/TabLayout.js +406 -438
  70. package/Table.js +4842 -5121
  71. package/Text.js +1169 -1351
  72. package/TextArea.js +1097 -1307
  73. package/Tooltip.js +624 -721
  74. package/TransitionOpen.js +489 -546
  75. package/Typography.js +176 -229
  76. package/WaitSpinner.js +230 -298
  77. package/package.json +14 -15
  78. package/stubs-splunkui.d.ts +4 -1
  79. package/types/src/ComboBox/Option.d.ts +1 -1
  80. package/types/src/Concertina/Concertina.d.ts +4 -0
  81. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  82. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  83. package/types/src/Link/Link.d.ts +7 -3
  84. package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
  85. package/types/src/Markdown/Markdown.d.ts +1 -1
  86. package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
  87. package/types/src/Menu/Item.d.ts +1 -1
  88. package/types/src/Menu/Menu.d.ts +1 -0
  89. package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
  90. package/types/src/Multiselect/Option.d.ts +1 -1
  91. package/types/src/Search/Option.d.ts +1 -1
  92. package/types/src/Select/Option.d.ts +1 -1
  93. package/types/src/Select/OptionBase.d.ts +1 -1
  94. package/types/src/fixtures/FetchOptions.d.ts +2 -8
  95. package/useForceUpdate.js +112 -146
  96. package/useKeyPress.js +74 -128
  97. package/usePrevious.js +65 -129
  98. package/useRovingFocus.js +122 -218
  99. package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
  100. /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
  101. /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/ResultsMenu.js CHANGED
@@ -1,611 +1,508 @@
1
- module.exports =
2
- /******/ (function(modules) { // webpackBootstrap
3
- /******/ // The module cache
4
- /******/ var installedModules = {};
5
- /******/
6
- /******/ // The require function
7
- /******/ function __webpack_require__(moduleId) {
8
- /******/
9
- /******/ // Check if module is in cache
10
- /******/ if(installedModules[moduleId]) {
11
- /******/ return installedModules[moduleId].exports;
12
- /******/ }
13
- /******/ // Create a new module (and put it into the cache)
14
- /******/ var module = installedModules[moduleId] = {
15
- /******/ i: moduleId,
16
- /******/ l: false,
17
- /******/ exports: {}
18
- /******/ };
19
- /******/
20
- /******/ // Execute the module function
21
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
- /******/
23
- /******/ // Flag the module as loaded
24
- /******/ module.l = true;
25
- /******/
26
- /******/ // Return the exports of the module
27
- /******/ return module.exports;
28
- /******/ }
29
- /******/
30
- /******/
31
- /******/ // expose the modules object (__webpack_modules__)
32
- /******/ __webpack_require__.m = modules;
33
- /******/
34
- /******/ // expose the module cache
35
- /******/ __webpack_require__.c = installedModules;
36
- /******/
37
- /******/ // define getter function for harmony exports
38
- /******/ __webpack_require__.d = function(exports, name, getter) {
39
- /******/ if(!__webpack_require__.o(exports, name)) {
40
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
- /******/ }
42
- /******/ };
43
- /******/
44
- /******/ // define __esModule on exports
45
- /******/ __webpack_require__.r = function(exports) {
46
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
- /******/ }
49
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
- /******/ };
51
- /******/
52
- /******/ // create a fake namespace object
53
- /******/ // mode & 1: value is a module id, require it
54
- /******/ // mode & 2: merge all properties of value into the ns
55
- /******/ // mode & 4: return value when already ns object
56
- /******/ // mode & 8|1: behave like require
57
- /******/ __webpack_require__.t = function(value, mode) {
58
- /******/ if(mode & 1) value = __webpack_require__(value);
59
- /******/ if(mode & 8) return value;
60
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
- /******/ var ns = Object.create(null);
62
- /******/ __webpack_require__.r(ns);
63
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
- /******/ return ns;
66
- /******/ };
67
- /******/
68
- /******/ // getDefaultExport function for compatibility with non-harmony modules
69
- /******/ __webpack_require__.n = function(module) {
70
- /******/ var getter = module && module.__esModule ?
71
- /******/ function getDefault() { return module['default']; } :
72
- /******/ function getModuleExports() { return module; };
73
- /******/ __webpack_require__.d(getter, 'a', getter);
74
- /******/ return getter;
75
- /******/ };
76
- /******/
77
- /******/ // Object.prototype.hasOwnProperty.call
78
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
- /******/
80
- /******/ // __webpack_public_path__
81
- /******/ __webpack_require__.p = "";
82
- /******/
83
- /******/
84
- /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 230);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 0:
91
- /***/ (function(module, exports) {
92
-
93
- module.exports = require("@splunk/themes");
94
-
95
- /***/ }),
96
-
97
- /***/ 1:
98
- /***/ (function(module, exports) {
99
-
100
- module.exports = require("prop-types");
101
-
102
- /***/ }),
103
-
104
- /***/ 10:
105
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
106
-
107
- "use strict";
108
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return updateReactRef; });
109
- /**
1
+ /******/ (() => {
2
+ // webpackBootstrap
3
+ /******/ "use strict";
4
+ /******/ // The require scope
5
+ /******/ var e = {};
6
+ /******/
7
+ /************************************************************************/
8
+ /******/ /* webpack/runtime/compat get default export */
9
+ /******/ (() => {
10
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
11
+ /******/ e.n = t => {
12
+ /******/ var 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
+ /**
110
149
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
111
150
  *
112
151
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
113
152
  * @param current - The new value of the ref.
114
153
  */
115
- function updateReactRef(ref, current) {
116
- if (ref) {
117
- if (typeof ref === 'function') {
118
- ref(current);
119
- } else {
120
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
121
- // the intention here is to signal "we will take care of setting 'current', not you".
122
- ref.current = current; // eslint-disable-line no-param-reassign
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
+ }
123
165
  }
124
- }
125
- }
126
-
127
-
128
-
129
- /***/ }),
130
-
131
- /***/ 13:
132
- /***/ (function(module, exports) {
133
-
134
- module.exports = require("@splunk/react-ui/Menu");
135
-
136
- /***/ }),
137
-
138
- /***/ 153:
139
- /***/ (function(module, exports) {
140
-
141
- module.exports = require("@splunk/ui-utils/userAgent");
142
-
143
- /***/ }),
144
-
145
- /***/ 154:
146
- /***/ (function(module, exports) {
147
-
148
- module.exports = require("@splunk/react-ui/WaitSpinner");
149
-
150
- /***/ }),
151
-
152
- /***/ 2:
153
- /***/ (function(module, exports) {
154
-
155
- module.exports = require("react");
156
-
157
- /***/ }),
158
-
159
- /***/ 230:
160
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
161
-
162
- "use strict";
163
- // ESM COMPAT FLAG
164
- __webpack_require__.r(__webpack_exports__);
165
-
166
- // EXPORTS
167
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_ResultsMenu_ResultsMenu; });
168
-
169
- // EXTERNAL MODULE: external "react"
170
- var external_react_ = __webpack_require__(2);
171
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
172
-
173
- // EXTERNAL MODULE: external "prop-types"
174
- var external_prop_types_ = __webpack_require__(1);
175
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
176
-
177
- // EXTERNAL MODULE: external "lodash/keys"
178
- var keys_ = __webpack_require__(9);
179
- var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
180
-
181
- // EXTERNAL MODULE: external "lodash/memoize"
182
- var memoize_ = __webpack_require__(40);
183
- var memoize_default = /*#__PURE__*/__webpack_require__.n(memoize_);
184
-
185
- // EXTERNAL MODULE: external "lodash/omit"
186
- var omit_ = __webpack_require__(5);
187
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
188
-
189
- // EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
190
- var i18n_ = __webpack_require__(4);
191
-
192
- // EXTERNAL MODULE: external "@splunk/ui-utils/userAgent"
193
- var userAgent_ = __webpack_require__(153);
194
-
195
- // EXTERNAL MODULE: external "@splunk/react-ui/Menu"
196
- var Menu_ = __webpack_require__(13);
197
- var Menu_default = /*#__PURE__*/__webpack_require__.n(Menu_);
198
-
199
- // EXTERNAL MODULE: external "styled-components"
200
- var external_styled_components_ = __webpack_require__(3);
201
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
202
-
203
- // EXTERNAL MODULE: external "@splunk/react-ui/WaitSpinner"
204
- var WaitSpinner_ = __webpack_require__(154);
205
- var WaitSpinner_default = /*#__PURE__*/__webpack_require__.n(WaitSpinner_);
206
-
207
- // EXTERNAL MODULE: external "@splunk/themes"
208
- var themes_ = __webpack_require__(0);
209
-
210
- // CONCATENATED MODULE: ./src/ResultsMenu/ResultsMenuStyles.ts
211
-
212
-
213
-
214
- var Styled = external_styled_components_default.a.div.withConfig({
215
- displayName: "ResultsMenuStyles__Styled",
216
- componentId: "avbhl8-0"
217
- })(["", ";flex-direction:column;max-height:calc(100vh - 20px);", ""], themes_["mixins"].reset('flex'), Object(themes_["pick"])({
218
- prisma: Object(external_styled_components_["css"])(["border-radius:", ";background-color:", ";"], themes_["variables"].borderRadius, themes_["variables"].backgroundColorPopup)
219
- }));
220
- var StyledFooter = external_styled_components_default.a.div.withConfig({
221
- displayName: "ResultsMenuStyles__StyledFooter",
222
- componentId: "avbhl8-1"
223
- })(["padding:", ";color:", ";", ""], Object(themes_["pick"])({
224
- prisma: {
225
- comfortable: '10px 16px',
226
- compact: '6px 16px'
227
- },
228
- enterprise: '6px 10px'
229
- }), Object(themes_["pick"])({
230
- prisma: themes_["variables"].contentColorMuted,
231
- enterprise: themes_["variables"].textGray
232
- }), function (_ref) {
233
- var $placement = _ref.$placement;
234
- return $placement === 'above' ? Object(themes_["pick"])({
235
- prisma: Object(external_styled_components_["css"])(["border-bottom:1px solid ", ";"], themes_["variables"].neutral200),
236
- enterprise: Object(external_styled_components_["css"])(["border-bottom:", ";"], themes_["variables"].border)
237
- }) : Object(themes_["pick"])({
238
- prisma: Object(external_styled_components_["css"])(["border-top:1px solid ", ";"], themes_["variables"].neutral200),
239
- enterprise: Object(external_styled_components_["css"])(["border-top:", ";"], themes_["variables"].border)
240
- });
241
- });
242
- var StyledLoading = external_styled_components_default.a.li.withConfig({
243
- displayName: "ResultsMenuStyles__StyledLoading",
244
- componentId: "avbhl8-2"
245
- })(["", ";padding:", ";gap:", ";"], themes_["mixins"].reset('flex'), Object(themes_["pick"])({
246
- prisma: {
247
- comfortable: '10px 16px',
248
- compact: '6px 16px'
249
- },
250
- enterprise: '6px 10px'
251
- }), themes_["variables"].spacingXSmall);
252
- var StyledWait = external_styled_components_default()(WaitSpinner_default.a).withConfig({
253
- displayName: "ResultsMenuStyles__StyledWait",
254
- componentId: "avbhl8-3"
255
- })(["flex:0 0 auto;"]);
256
- var StyledLoadingMessage = external_styled_components_default.a.div.withConfig({
257
- displayName: "ResultsMenuStyles__StyledLoadingMessage",
258
- componentId: "avbhl8-4"
259
- })(["flex:1 0 0;color:", ";"], Object(themes_["pick"])({
260
- prisma: themes_["variables"].contentColorMuted,
261
- enterprise: themes_["variables"].textGray
262
- }));
263
-
264
- // EXTERNAL MODULE: ./src/utils/updateReactRef.ts
265
- var updateReactRef = __webpack_require__(10);
266
-
267
- // CONCATENATED MODULE: ./src/ResultsMenu/ResultsMenu.tsx
268
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
269
-
270
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
271
-
272
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
273
-
274
- 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); } }
275
-
276
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
277
-
278
- 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); }
279
-
280
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
281
-
282
- 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); }; }
283
-
284
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
285
-
286
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
287
-
288
- 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; } }
289
-
290
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
291
-
292
- 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; }
293
-
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
- var propTypes = {
305
- animateLoading: external_prop_types_default.a.bool,
306
- children: external_prop_types_default.a.node,
307
-
308
- /** @private */
309
- controlledExternally: external_prop_types_default.a.bool,
310
- childrenStart: external_prop_types_default.a.node,
311
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
312
- footerMessage: external_prop_types_default.a.node,
313
- isLoading: external_prop_types_default.a.bool,
314
- loadingMessage: external_prop_types_default.a.node,
315
- maxHeight: external_prop_types_default.a.number,
316
- noOptionsMessage: external_prop_types_default.a.node,
317
- onScroll: external_prop_types_default.a.func,
318
- onScrollBottom: external_prop_types_default.a.func,
319
- placement: external_prop_types_default.a.string
320
- };
321
- var defaultProps = {
322
- animateLoading: false,
323
- isLoading: false,
324
- loadingMessage: Object(i18n_["_"])('Loading...'),
325
- noOptionsMessage: Object(i18n_["_"])('No matches')
326
- };
327
- var menuContextRole = {
328
- role: 'listbox'
329
- };
330
- var getMenuInlineStyle = memoize_default()(function (menuMaxHeight) {
331
- return {
332
- overflow: 'auto',
333
- maxHeight: menuMaxHeight || 'calc(100vh - 20px)',
334
- flexDirection: 'column'
335
- };
336
- });
337
- var getMenuBottomInlineStyle = memoize_default()(function (height) {
338
- return {
339
- height: height
340
- };
341
- });
342
-
343
- // @docs-props-type ResultsMenuPropsBase
344
- var ResultsMenu_ResultsMenu = /*#__PURE__*/function (_Component) {
345
- _inherits(ResultsMenu, _Component);
346
-
347
- var _super = _createSuper(ResultsMenu);
348
-
349
- function ResultsMenu(props) {
350
- var _this;
351
-
352
- _classCallCheck(this, ResultsMenu);
353
-
354
- _this = _super.call(this, props);
355
-
356
- _defineProperty(_assertThisInitialized(_this), "scrollBottomOffset", void 0);
357
-
358
- _defineProperty(_assertThisInitialized(_this), "itemMinHeight", void 0);
359
-
360
- _defineProperty(_assertThisInitialized(_this), "handleMenuMount", function (menuEl) {
361
- _this.setState({
362
- menuEl: menuEl
363
- });
364
- });
365
-
366
- _defineProperty(_assertThisInitialized(_this), "handleMount", function (el) {
367
- _this.setState({
368
- containerEl: el
369
- });
370
-
371
- Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el);
372
- });
373
-
374
- _defineProperty(_assertThisInitialized(_this), "handleMouseEnter", function () {
375
- _this.setState({
376
- windowTop: document.documentElement.scrollTop
377
- });
378
- });
379
-
380
- _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function () {
381
- _this.setState({
382
- windowTop: document.documentElement.scrollTop
383
- });
384
- });
385
-
386
- _defineProperty(_assertThisInitialized(_this), "handleScroll", function (e) {
387
- var _this$props$onScroll, _this$props;
388
-
389
- if (_this.props.onScrollBottom != null) {
390
- if (e.target && _this.state.menuEl) {
391
- var bottomScrollMenu = _this.state.menuEl.scrollHeight - _this.state.menuEl.offsetHeight - _this.scrollBottomOffset; // Adding 1 due to border of menu item.
392
-
393
- if (_this.state.menuEl.scrollTop + 1 >= bottomScrollMenu) {
394
- _this.handleScrollBottom(e);
395
- }
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
+ };
396
177
  }
397
- }
398
-
399
- (_this$props$onScroll = (_this$props = _this.props).onScroll) === null || _this$props$onScroll === void 0 ? void 0 : _this$props$onScroll.call(_this$props, e);
400
- });
401
-
402
- _defineProperty(_assertThisInitialized(_this), "handleWheelMenu", function (e) {
403
- // Safety net to ensure window doesn't scroll if menu is scrolled pass the numberOfItemsLoaded at high velocity.
404
- e.stopPropagation();
405
- document.documentElement.scrollTop = _this.state.windowTop;
406
- });
407
-
408
- _defineProperty(_assertThisInitialized(_this), "handleScrollBottomOnFullMenu", function () {
409
- var currentChildrenCount = external_react_["Children"].count(_this.props.children);
410
- var _this$state = _this.state,
411
- childrenCount = _this$state.childrenCount,
412
- menuMaxHeight = _this$state.menuMaxHeight; // If menu is full length, load more items.
413
-
414
- if (_this.checkFullHeight()) {
415
- _this.handleScrollBottom(null);
416
- } // avoid triggering this logic if this.state.childrenCount is null
417
- // because that's not a real change in the number of children
418
- // and thus we want to avoid resetting the value of scrollBottomTriggered
419
-
420
-
421
- if (menuMaxHeight && currentChildrenCount != null && currentChildrenCount !== childrenCount) {
422
- _this.setState({
423
- numberOfItemsLoaded: currentChildrenCount - (childrenCount !== null && childrenCount !== void 0 ? childrenCount : 0),
424
- scrollBottomTriggered: false
425
- });
426
- }
427
-
428
- if (currentChildrenCount !== childrenCount) {
429
- _this.setState({
430
- childrenCount: currentChildrenCount
431
- });
432
- }
433
- });
434
-
435
- _this.state = {
436
- containerEl: null,
437
- menuEl: null,
438
- menuMaxHeight: undefined,
439
- numberOfItemsLoaded: 0,
440
- scrollBottomTriggered: false,
441
- windowTop: 0
442
- }; // The remaining amount of pixels when scrolled from bottom of menu to trigger onScrollBottom().
443
-
444
- _this.scrollBottomOffset = 400;
445
- _this.itemMinHeight = 28;
446
- return _this;
447
- }
448
-
449
- _createClass(ResultsMenu, [{
450
- key: "componentDidUpdate",
451
- value: function componentDidUpdate() {
452
- var _this$state2 = this.state,
453
- containerEl = _this$state2.containerEl,
454
- menuEl = _this$state2.menuEl,
455
- menuMaxHeight = _this$state2.menuMaxHeight;
456
-
457
- if (!userAgent_["isIE11"] || !containerEl || !menuEl) {
458
- return;
459
- }
460
-
461
- if (this.props.maxHeight) {
462
- var otherElementsHeight = containerEl.scrollHeight - menuEl.clientHeight;
463
- var newMenuMaxHeight = this.props.maxHeight - otherElementsHeight;
464
-
465
- if (menuMaxHeight === undefined || Math.abs(menuMaxHeight - newMenuMaxHeight) > 1) {
466
- // eslint-disable-next-line react/no-did-update-set-state
467
- this.setState({
468
- menuMaxHeight: newMenuMaxHeight
469
- });
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");
470
197
  }
471
- } // If onScrollBottom is defined, determine if it should be triggered.
472
-
473
-
474
- if (this.props && this.props.onScrollBottom && this.props.children) {
475
- this.handleScrollBottomOnFullMenu();
476
- }
477
198
  }
478
- }, {
479
- key: "handleScrollBottom",
480
- value: function handleScrollBottom(e) {
481
- // Prevent multiple calls to onScrollBottom.
482
- if (!this.state.scrollBottomTriggered) {
483
- var _this$props$onScrollB, _this$props2;
484
-
485
- this.setState({
486
- scrollBottomTriggered: true
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
+ }
487
223
  });
488
- (_this$props$onScrollB = (_this$props2 = this.props).onScrollBottom) === null || _this$props$onScrollB === void 0 ? void 0 : _this$props$onScrollB.call(_this$props2, e);
489
- }
224
+ if (t) L(e, t);
490
225
  }
491
- }, {
492
- key: "checkFullHeight",
493
- value: function checkFullHeight() {
494
- var menuEl = this.state.menuEl;
495
- return menuEl && menuEl.scrollHeight === menuEl.offsetHeight;
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);
496
232
  }
497
- }, {
498
- key: "renderFooterMessage",
499
- value: function renderFooterMessage() {
500
- return this.props.footerMessage && !!external_react_["Children"].toArray(this.props.children).length && /*#__PURE__*/external_react_default.a.createElement(StyledFooter, {
501
- $placement: this.props.placement,
502
- "data-test": "footer-message",
503
- key: "footer"
504
- }, this.props.footerMessage);
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
+ };
505
245
  }
506
- }, {
507
- key: "render",
508
- value: function render() {
509
- var _this$props3 = this.props,
510
- animateLoading = _this$props3.animateLoading,
511
- children = _this$props3.children,
512
- controlledExternally = _this$props3.controlledExternally,
513
- childrenStart = _this$props3.childrenStart,
514
- isLoading = _this$props3.isLoading,
515
- loadingMessage = _this$props3.loadingMessage,
516
- noOptionsMessage = _this$props3.noOptionsMessage,
517
- onScrollBottom = _this$props3.onScrollBottom,
518
- placement = _this$props3.placement,
519
- style = _this$props3.style,
520
- tabIndex = _this$props3.tabIndex;
521
- var otherProps = omit_default()(this.props, keys_default()(ResultsMenu.propTypes));
522
- // Assumption: that you cannot be filtered if you are a result
523
- var hasResults = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).some(function (_ref) {
524
- var type = _ref.type;
525
- return !(type === Menu_["Divider"] && type.filterFirst || (type === Menu_["Divider"] || type === Menu_["Heading"]) && (type.filterLast || type.filterConsecutive));
526
- });
527
- var fullHeight = this.checkFullHeight();
528
- var menuInlineStyle = getMenuInlineStyle(this.state.menuMaxHeight);
529
- var menuBottomInlineStyle = getMenuBottomInlineStyle(this.state.scrollBottomTriggered ? this.state.numberOfItemsLoaded * this.itemMinHeight || 0 : 0);
530
- /* eslint-disable jsx-a11y/aria-role */
531
-
532
- return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({
533
- key: "wrapper",
534
- style: style,
535
- ref: this.handleMount,
536
- onWheel: onScrollBottom ? this.handleWheelMenu : undefined,
537
- onMouseEnter: onScrollBottom ? this.handleMouseEnter : undefined,
538
- onMouseLeave: onScrollBottom ? this.handleMouseLeave : undefined
539
- }, omit_default()(otherProps, 'tabIndex')), placement !== 'above' && childrenStart, placement === 'above' && this.renderFooterMessage(), /*#__PURE__*/external_react_default.a.createElement(Menu_["MenuContext"].Provider, {
540
- value: menuContextRole
541
- }, /*#__PURE__*/external_react_default.a.createElement(Menu_default.a, {
542
- key: "menu",
543
- style: menuInlineStyle,
544
- controlledExternally: controlledExternally,
545
- elementRef: this.handleMenuMount,
546
- onScroll: this.handleScroll,
547
- stopScrollPropagation: true,
548
- tabIndex: tabIndex
549
- }, !hasResults && noOptionsMessage && !isLoading && /*#__PURE__*/external_react_default.a.createElement(Menu_default.a.Item, {
550
- "data-test": "no-results-message",
551
- disabled: true
552
- }, noOptionsMessage), children, onScrollBottom && !fullHeight &&
553
- /*#__PURE__*/
554
- // Bottom spacer fills in the space of new items being loaded by using the minimum possible height x menuItems.
555
- external_react_default.a.createElement("div", {
556
- "data-test": "results-menu-bottom-spacer",
557
- style: menuBottomInlineStyle
558
- }), isLoading && /*#__PURE__*/external_react_default.a.createElement(StyledLoading, null, animateLoading && /*#__PURE__*/external_react_default.a.createElement(StyledWait, null), /*#__PURE__*/external_react_default.a.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;
559
257
  }
560
- }]);
561
-
562
- return ResultsMenu;
563
- }(external_react_["Component"]);
564
-
565
- _defineProperty(ResultsMenu_ResultsMenu, "propTypes", propTypes);
566
-
567
- _defineProperty(ResultsMenu_ResultsMenu, "defaultProps", defaultProps);
568
-
569
- /* harmony default export */ var src_ResultsMenu_ResultsMenu = (ResultsMenu_ResultsMenu);
570
- // CONCATENATED MODULE: ./src/ResultsMenu/index.ts
571
-
572
-
573
-
574
- /***/ }),
575
-
576
- /***/ 3:
577
- /***/ (function(module, exports) {
578
-
579
- module.exports = require("styled-components");
580
-
581
- /***/ }),
582
-
583
- /***/ 4:
584
- /***/ (function(module, exports) {
585
-
586
- module.exports = require("@splunk/ui-utils/i18n");
587
-
588
- /***/ }),
589
-
590
- /***/ 40:
591
- /***/ (function(module, exports) {
592
-
593
- module.exports = require("lodash/memoize");
594
-
595
- /***/ }),
596
-
597
- /***/ 5:
598
- /***/ (function(module, exports) {
599
-
600
- module.exports = require("lodash/omit");
601
-
602
- /***/ }),
603
-
604
- /***/ 9:
605
- /***/ (function(module, exports) {
606
-
607
- module.exports = require("lodash/keys");
608
-
609
- /***/ })
610
-
611
- /******/ });
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
+ /******/})();