@splunk/react-ui 4.10.0 → 4.11.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.
Files changed (89) hide show
  1. package/Accordion.js +4 -4
  2. package/Anchor.js +2 -2
  3. package/Animation.js +2 -2
  4. package/AnimationToggle.js +2 -2
  5. package/Box.js +2 -2
  6. package/Button.js +4 -4
  7. package/ButtonGroup.js +2 -2
  8. package/ButtonSimple.js +4 -4
  9. package/CHANGELOG.md +21 -5
  10. package/Calendar.js +12 -12
  11. package/Card.js +35 -23
  12. package/CardLayout.js +2 -2
  13. package/Chip.js +4 -4
  14. package/Clickable.js +23 -8
  15. package/CloseButton.js +2 -2
  16. package/Code.js +4 -4
  17. package/CollapsiblePanel.js +4 -4
  18. package/Color.js +10 -10
  19. package/ColumnLayout.js +2 -2
  20. package/ComboBox.js +9 -5
  21. package/Concertina.js +13 -13
  22. package/ControlGroup.js +19 -9
  23. package/Date.js +6 -6
  24. package/DefinitionList.js +2 -2
  25. package/Dropdown.js +4 -4
  26. package/EventListener.js +4 -4
  27. package/File.js +14 -14
  28. package/FormRows.js +6 -6
  29. package/Heading.js +2 -2
  30. package/Image.js +8 -8
  31. package/JSONTree.js +4 -4
  32. package/Layer.js +72 -22
  33. package/Link.js +6 -6
  34. package/List.js +2 -2
  35. package/Markdown.js +14 -14
  36. package/Menu.js +32 -32
  37. package/Message.js +6 -6
  38. package/MessageBar.js +16 -9
  39. package/Modal.js +4 -4
  40. package/ModalLayer.js +2 -2
  41. package/Monogram.js +27 -15
  42. package/Multiselect.js +6 -6
  43. package/Number.js +4 -4
  44. package/Paginator.js +14 -14
  45. package/Paragraph.js +2 -2
  46. package/Popover.js +6 -6
  47. package/Progress.js +2 -2
  48. package/RadioBar.js +4 -4
  49. package/RadioList.js +2 -2
  50. package/Resize.js +4 -4
  51. package/ResultsMenu.js +20 -20
  52. package/ScreenReaderContent.js +2 -2
  53. package/Scroll.js +4 -4
  54. package/ScrollContainerContext.js +2 -2
  55. package/Search.js +6 -6
  56. package/Select.js +2 -2
  57. package/SidePanel.js +2 -2
  58. package/Slider.js +4 -4
  59. package/SlidingPanels.js +4 -4
  60. package/StaticContent.js +2 -2
  61. package/StepBar.js +2 -2
  62. package/Switch.js +4 -4
  63. package/TabBar.js +11 -11
  64. package/TabLayout.js +4 -4
  65. package/Table.js +27 -30
  66. package/Text.js +17 -10
  67. package/Tooltip.js +15 -4
  68. package/TransitionOpen.js +2 -2
  69. package/WaitSpinner.js +2 -2
  70. package/package.json +9 -6
  71. package/stubs-splunkui.d.ts +13 -0
  72. package/types/src/Card/Body.d.ts +6 -1
  73. package/types/src/Clickable/Clickable.d.ts +5 -0
  74. package/types/src/ComboBox/ComboBox.d.ts +2 -1
  75. package/types/src/ControlGroup/ControlGroup.d.ts +9 -2
  76. package/types/src/Date/Date.d.ts +3 -3
  77. package/types/src/FormRows/FormRows.d.ts +1 -1
  78. package/types/src/FormRows/Row.d.ts +1 -1
  79. package/types/src/Layer/LayerStack.d.ts +8 -2
  80. package/types/src/Monogram/Monogram.d.ts +2 -2
  81. package/types/src/Number/Number.d.ts +3 -3
  82. package/types/src/Slider/Slider.d.ts +3 -3
  83. package/types/src/Text/Text.d.ts +4 -3
  84. package/types/src/Tooltip/Tooltip.d.ts +8 -5
  85. package/types/src/fixtures/FetchOptions.d.ts +82 -2
  86. package/usePrevious.js +2 -2
  87. package/FetchOptions.js +0 -359
  88. package/types/src/FetchOptions/FetchOptions.d.ts +0 -82
  89. package/types/src/FetchOptions/index.d.ts +0 -2
@@ -2,10 +2,12 @@ import React, { Component } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { AnyTheme } from '@splunk/themes';
4
4
  import { ClassComponentProps } from '../utils/types';
5
+ /** @public */
5
6
  declare type openReasons = 'focusToggle' | 'mouseEnterPopover' | 'mouseEnterToggle';
6
- declare type closeReasons = 'blurToggle' | 'clickAway' | 'escapeKey' | 'mouseLeavePopover' | 'mouseLeaveToggle' | 'offScreen' | 'tabKey';
7
7
  /** @public */
8
- declare type TooltipRequestCloseHandler = (event: React.FocusEvent<HTMLSpanElement> | MouseEvent | null, data: {
8
+ declare type closeReasons = 'blurToggle' | 'clickAway' | 'escapeKey' | 'mouseLeavePopover' | 'mouseLeaveToggle' | 'offScreen' | 'tabKey' | 'toggleClick';
9
+ /** @public */
10
+ declare type TooltipRequestCloseHandler = (event: React.FocusEvent<HTMLSpanElement> | React.MouseEvent | MouseEvent | null, data: {
9
11
  reason: closeReasons;
10
12
  }) => void;
11
13
  /** @public */
@@ -62,7 +64,7 @@ interface TooltipPropsBase {
62
64
  *
63
65
  * @param {event} event Can be `null` depending on the reason the tooltip is closing.
64
66
  * @param {object} data
65
- * @param {string} data.reason The reason for the close request. One of the following `Tooltip.possibleCloseReasons`: `mouseLeaveToggle`, `mouseLeavePopover`, or `blurToggle`.
67
+ * @param {string} data.reason The reason for the close request.
66
68
  */
67
69
  onRequestClose?: TooltipRequestCloseHandler;
68
70
  /**
@@ -70,7 +72,7 @@ interface TooltipPropsBase {
70
72
  *
71
73
  * @param {event} event
72
74
  * @param {object} data
73
- * @param {string} data.reason The reason for the open request. One of the following `Tooltip.possibleOpenReasons`: `mouseEnterToggle`, `mouseEnterPopover`, or `focusToggle`.
75
+ * @param {string} data.reason The reason for the open request.
74
76
  */
75
77
  onRequestOpen?: TooltipRequestOpenHandler;
76
78
  /**
@@ -87,7 +89,7 @@ interface TooltipState {
87
89
  open: boolean;
88
90
  anchor: HTMLSpanElement | null;
89
91
  popoverEl: HTMLDivElement | null;
90
- lastCloseReason: null;
92
+ lastCloseReason: closeReasons | null;
91
93
  }
92
94
  /**
93
95
  * The Tooltip component wraps arbitrary content to be displayed when the target element is hovered
@@ -109,6 +111,7 @@ declare class Tooltip extends Component<TooltipProps, TooltipState> {
109
111
  private handleMouseEnterPopover;
110
112
  private handleMouseLeave;
111
113
  private handleMouseLeavePopover;
114
+ private handleClick;
112
115
  private handleFocus;
113
116
  private handleBlur;
114
117
  private handlePopoverOnRequestClose;
@@ -1,2 +1,82 @@
1
- export { default } from '@splunk/react-ui/FetchOptions';
2
- export * from '@splunk/react-ui/FetchOptions';
1
+ import 'core-js/es/promise';
2
+ declare type Movie = {
3
+ id: number;
4
+ title: string;
5
+ };
6
+ declare type MovieOption = Movie & {
7
+ matchRanges?: {
8
+ start: number;
9
+ end: number;
10
+ }[];
11
+ };
12
+ declare function isMovieOption(movie: Movie | MovieOption): movie is MovieOption;
13
+ /**
14
+ * @param fetchTimeout: number - The number of milliseconds to defer fetching of options.
15
+ * @param fetchMoreTimeout: number - The number of milliseconds to defer fetching additional options.
16
+ * @param numberOfResults: number - Then mumber of options to retrieve per fetch.
17
+ */
18
+ export default class FetchOptions {
19
+ private currentFetch;
20
+ private currentOptions;
21
+ private fetching;
22
+ private fetchMoreTimeout;
23
+ private fetchPromise?;
24
+ private fetchTimeout;
25
+ private filter?;
26
+ private firstIndex;
27
+ private lastIndex;
28
+ private list;
29
+ private numberOfResults;
30
+ private timer?;
31
+ constructor({ fetchTimeout, fetchMoreTimeout, numberOfResults }?: {
32
+ fetchTimeout?: number | undefined;
33
+ fetchMoreTimeout?: number | undefined;
34
+ numberOfResults?: number | undefined;
35
+ });
36
+ /**
37
+ * Fake fetches options from a server.
38
+ * @param filter: string - filter options.
39
+ * @param timeout: number - Number of milliseconds to defer fetch.
40
+ * @return A promise that will resolve based on the fetchTimeout value.
41
+ * Returns array of new options.
42
+ */
43
+ fetch(filter?: string, timeout?: number): Promise<MovieOption[]>;
44
+ /**
45
+ * Increases searching index for new options and runs fetch.
46
+ * @param currentOptions: array - Append options to given array.
47
+ * @return A promise that will resolve based on the fetchTimeout value.
48
+ * Returns array of new options appended to currentOptions.
49
+ */
50
+ fetchMore(currentOptions?: MovieOption[]): Promise<MovieOption[]>;
51
+ private concatAndFilter;
52
+ private filterResults;
53
+ /**
54
+ * Resets firstIndex, LastIndex, currentOptions and list to default values.
55
+ */
56
+ reset(): void;
57
+ /** Cancels pending fetch promises. */
58
+ stop(): void;
59
+ /**
60
+ * @return Option of given value;
61
+ */
62
+ getOption: (value: number) => {
63
+ id: number;
64
+ title: string;
65
+ } | undefined;
66
+ /**
67
+ * @return Options of given values;
68
+ */
69
+ getSelectedOptions: (values: number[]) => {
70
+ id: number;
71
+ title: string;
72
+ }[];
73
+ /**
74
+ * Get current length of indexes fetched.
75
+ */
76
+ getCurrentCount: () => number;
77
+ /**
78
+ * Get full count of all possible items fetched.
79
+ */
80
+ getFullCount: () => number;
81
+ }
82
+ export { isMovieOption, Movie, MovieOption };
package/usePrevious.js CHANGED
@@ -82,12 +82,12 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 181);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 177);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
- /***/ 181:
90
+ /***/ 177:
91
91
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
92
 
93
93
  "use strict";
package/FetchOptions.js DELETED
@@ -1,359 +0,0 @@
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 = 178);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 110:
91
- /***/ (function(module, exports) {
92
-
93
- module.exports = require("core-js/es/promise");
94
-
95
- /***/ }),
96
-
97
- /***/ 178:
98
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
99
-
100
- "use strict";
101
- // ESM COMPAT FLAG
102
- __webpack_require__.r(__webpack_exports__);
103
-
104
- // EXPORTS
105
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ FetchOptions_FetchOptions; });
106
- __webpack_require__.d(__webpack_exports__, "isMovieOption", function() { return /* reexport */ isMovieOption; });
107
-
108
- // EXTERNAL MODULE: external "core-js/es/promise"
109
- var promise_ = __webpack_require__(110);
110
-
111
- // EXTERNAL MODULE: external "lodash"
112
- var external_lodash_ = __webpack_require__(4);
113
-
114
- // EXTERNAL MODULE: external "@splunk/ui-utils/promise"
115
- var ui_utils_promise_ = __webpack_require__(86);
116
-
117
- // EXTERNAL MODULE: ./src/FetchOptions/movies.json
118
- var movies = __webpack_require__(57);
119
-
120
- // CONCATENATED MODULE: ./src/FetchOptions/FetchOptions.tsx
121
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
122
-
123
- 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); } }
124
-
125
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
126
-
127
- 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; }
128
-
129
-
130
-
131
-
132
-
133
-
134
- function isMovieOption(movie) {
135
- return movie.matchRanges !== undefined;
136
- }
137
- /**
138
- * @param fetchTimeout: number - The number of milliseconds to defer fetching of options.
139
- * @param fetchMoreTimeout: number - The number of milliseconds to defer fetching additional options.
140
- * @param numberOfResults: number - Then mumber of options to retrieve per fetch.
141
- */
142
-
143
-
144
- var FetchOptions_FetchOptions = /*#__PURE__*/function () {
145
- function FetchOptions() {
146
- var _this = this;
147
-
148
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
149
- _ref$fetchTimeout = _ref.fetchTimeout,
150
- fetchTimeout = _ref$fetchTimeout === void 0 ? 600 : _ref$fetchTimeout,
151
- _ref$fetchMoreTimeout = _ref.fetchMoreTimeout,
152
- fetchMoreTimeout = _ref$fetchMoreTimeout === void 0 ? 200 : _ref$fetchMoreTimeout,
153
- _ref$numberOfResults = _ref.numberOfResults,
154
- numberOfResults = _ref$numberOfResults === void 0 ? 20 : _ref$numberOfResults;
155
-
156
- _classCallCheck(this, FetchOptions);
157
-
158
- _defineProperty(this, "currentFetch", void 0);
159
-
160
- _defineProperty(this, "currentOptions", void 0);
161
-
162
- _defineProperty(this, "fetching", void 0);
163
-
164
- _defineProperty(this, "fetchMoreTimeout", void 0);
165
-
166
- _defineProperty(this, "fetchPromise", void 0);
167
-
168
- _defineProperty(this, "fetchTimeout", void 0);
169
-
170
- _defineProperty(this, "filter", void 0);
171
-
172
- _defineProperty(this, "firstIndex", void 0);
173
-
174
- _defineProperty(this, "lastIndex", void 0);
175
-
176
- _defineProperty(this, "list", void 0);
177
-
178
- _defineProperty(this, "numberOfResults", void 0);
179
-
180
- _defineProperty(this, "timer", void 0);
181
-
182
- _defineProperty(this, "concatAndFilter", function (options, filter) {
183
- var newOptions = _this.filterResults(filter).slice(_this.firstIndex, _this.lastIndex).map(function (movie) {
184
- return {
185
- title: movie.title,
186
- id: movie.id,
187
- matchRanges: filter === undefined ? undefined : [{
188
- start: 0,
189
- end: filter.length
190
- }]
191
- };
192
- });
193
-
194
- return Object(external_lodash_["concat"])(options, newOptions);
195
- });
196
-
197
- _defineProperty(this, "filterResults", function (filter) {
198
- if (filter === undefined) {
199
- return movies["a" /* movies */];
200
- }
201
-
202
- return movies["a" /* movies */].filter(function (movie) {
203
- return movie.title.toLowerCase().indexOf(filter.toLowerCase()) === 0;
204
- });
205
- });
206
-
207
- _defineProperty(this, "getOption", function (value) {
208
- return Object(external_lodash_["find"])(movies["a" /* movies */], function (movie) {
209
- return movie.id === value;
210
- });
211
- });
212
-
213
- _defineProperty(this, "getSelectedOptions", function (values) {
214
- return movies["a" /* movies */].filter(function (movie) {
215
- return !!Object(external_lodash_["find"])(values, function (value) {
216
- return movie.id === value;
217
- });
218
- });
219
- });
220
-
221
- _defineProperty(this, "getCurrentCount", function () {
222
- return _this.list.length;
223
- });
224
-
225
- _defineProperty(this, "getFullCount", function () {
226
- return _this.filter ? _this.filterResults(_this.filter || '').length : movies["a" /* movies */].length;
227
- });
228
-
229
- this.currentFetch = 0;
230
- this.currentOptions = [];
231
- this.fetching = false;
232
- this.fetchMoreTimeout = fetchMoreTimeout;
233
- this.fetchTimeout = fetchTimeout;
234
- this.filter = '';
235
- this.firstIndex = 0;
236
- this.lastIndex = 0;
237
- this.list = [];
238
- this.numberOfResults = numberOfResults;
239
- this.reset();
240
- }
241
- /**
242
- * Fake fetches options from a server.
243
- * @param filter: string - filter options.
244
- * @param timeout: number - Number of milliseconds to defer fetch.
245
- * @return A promise that will resolve based on the fetchTimeout value.
246
- * Returns array of new options.
247
- */
248
-
249
-
250
- _createClass(FetchOptions, [{
251
- key: "fetch",
252
- value: function fetch(filter) {
253
- var _this2 = this;
254
-
255
- var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.fetchTimeout;
256
-
257
- if (!this.list.length || this.filter !== filter) {
258
- this.reset();
259
- }
260
-
261
- this.filter = filter; // If currently fetching, add timeout of previous fetch to current timeout
262
-
263
- if (this.fetching) {
264
- this.currentFetch += timeout;
265
- } else {
266
- this.currentFetch = timeout;
267
- }
268
-
269
- this.fetching = true;
270
- this.fetchPromise = Object(ui_utils_promise_["makeCancelable"])(new Promise(function (resolve) {
271
- _this2.timer = setTimeout(function () {
272
- _this2.fetching = false;
273
- _this2.list = _this2.concatAndFilter(_this2.currentOptions, _this2.filter);
274
-
275
- if (_this2.timer !== undefined) {
276
- clearTimeout(_this2.timer);
277
- }
278
-
279
- return resolve(_this2.list);
280
- }, _this2.currentFetch);
281
- }));
282
- return this.fetchPromise.promise;
283
- }
284
- /**
285
- * Increases searching index for new options and runs fetch.
286
- * @param currentOptions: array - Append options to given array.
287
- * @return A promise that will resolve based on the fetchTimeout value.
288
- * Returns array of new options appended to currentOptions.
289
- */
290
-
291
- }, {
292
- key: "fetchMore",
293
- value: function fetchMore() {
294
- var currentOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
295
- this.currentOptions = currentOptions;
296
- this.firstIndex += this.numberOfResults;
297
- this.lastIndex += this.numberOfResults;
298
- return this.fetch(this.filter, this.fetchMoreTimeout);
299
- }
300
- }, {
301
- key: "reset",
302
-
303
- /**
304
- * Resets firstIndex, LastIndex, currentOptions and list to default values.
305
- */
306
- value: function reset() {
307
- this.firstIndex = 0;
308
- this.lastIndex = this.numberOfResults;
309
- this.currentOptions = [];
310
- this.list = [];
311
- }
312
- /** Cancels pending fetch promises. */
313
-
314
- }, {
315
- key: "stop",
316
- value: function stop() {
317
- var _this$fetchPromise;
318
-
319
- (_this$fetchPromise = this.fetchPromise) === null || _this$fetchPromise === void 0 ? void 0 : _this$fetchPromise.cancel();
320
- }
321
- /**
322
- * @return Option of given value;
323
- */
324
-
325
- }]);
326
-
327
- return FetchOptions;
328
- }();
329
-
330
-
331
-
332
- // CONCATENATED MODULE: ./src/FetchOptions/index.ts
333
-
334
-
335
-
336
- /***/ }),
337
-
338
- /***/ 4:
339
- /***/ (function(module, exports) {
340
-
341
- module.exports = require("lodash");
342
-
343
- /***/ }),
344
-
345
- /***/ 57:
346
- /***/ (function(module) {
347
-
348
- module.exports = JSON.parse("{\"a\":[{\"id\":1,\"title\":\"10 Cloverfield Lane\"},{\"id\":2,\"title\":\"13 Hours: The Secret Soldiers of Benghazi\"},{\"id\":3,\"title\":\"20th Century Women\"},{\"id\":4,\"title\":\"A Monster Calls\"},{\"id\":5,\"title\":\"A Street Cat Named Bob\"},{\"id\":6,\"title\":\"Alice Through the Looking Glass\"},{\"id\":7,\"title\":\"Allied\"},{\"id\":8,\"title\":\"Almost Christmas\"},{\"id\":9,\"title\":\"American Pastoral\"},{\"id\":10,\"title\":\"Arrival\"},{\"id\":11,\"title\":\"Assassin's Creed\"},{\"id\":12,\"title\":\"Bad Moms\"},{\"id\":13,\"title\":\"Bad Santa 2\"},{\"id\":14,\"title\":\"Barbershop: The Next Cut\"},{\"id\":15,\"title\":\"Batman v Superman: Dawn of Justice\"},{\"id\":16,\"title\":\"Batman: The Killing Joke\"},{\"id\":17,\"title\":\"Ben-Hur\"},{\"id\":18,\"title\":\"Billy Lynn's Long Halftime Walk\"},{\"id\":19,\"title\":\"Blair Witch\"},{\"id\":20,\"title\":\"Bleed for This\"},{\"id\":21,\"title\":\"Bobby Sands: 66 Days\"},{\"id\":22,\"title\":\"Boo! A Madea Halloween\"},{\"id\":23,\"title\":\"Boonie Bears III\"},{\"id\":24,\"title\":\"Bridget Jones's Baby\"},{\"id\":25,\"title\":\"Café Society\"},{\"id\":26,\"title\":\"Captain America: Civil War\"},{\"id\":27,\"title\":\"Central Intelligence\"},{\"id\":28,\"title\":\"Collateral Beauty\"},{\"id\":29,\"title\":\"Criminal\"},{\"id\":30,\"title\":\"Dad's Army\"},{\"id\":31,\"title\":\"Deadpool\"},{\"id\":32,\"title\":\"Deepwater Horizon\"},{\"id\":33,\"title\":\"Demolition\"},{\"id\":34,\"title\":\"Dirty Grandpa\"},{\"id\":35,\"title\":\"Doctor Strange\"},{\"id\":36,\"title\":\"Don't Breathe\"},{\"id\":37,\"title\":\"Eddie the Eagle\"},{\"id\":38,\"title\":\"Elvis & Nixon\"},{\"id\":39,\"title\":\"Everybody Wants Some!!\"},{\"id\":40,\"title\":\"Fantastic Beasts and Where to Find Them\"},{\"id\":41,\"title\":\"Fences\"},{\"id\":42,\"title\":\"Fifty Shades of Black\"},{\"id\":43,\"title\":\"Finding Dory\"},{\"id\":44,\"title\":\"Florence Foster Jenkins\"},{\"id\":45,\"title\":\"Free State of Jones\"},{\"id\":46,\"title\":\"Genius\"},{\"id\":47,\"title\":\"Ghostbusters\"},{\"id\":48,\"title\":\"God's Not Dead 2\"},{\"id\":49,\"title\":\"Gods of Egypt\"},{\"id\":50,\"title\":\"Gold\"},{\"id\":51,\"title\":\"Green Room\"},{\"id\":52,\"title\":\"Grimsby\"},{\"id\":53,\"title\":\"Hacksaw Ridge\"},{\"id\":54,\"title\":\"Hail, Caesar!\"},{\"id\":55,\"title\":\"Hands of Stone\"},{\"id\":56,\"title\":\"Hardcore Henry\"},{\"id\":57,\"title\":\"Hell or High Water\"},{\"id\":58,\"title\":\"Hidden Figures\"},{\"id\":59,\"title\":\"Hillsong: Let Hope Rise\"},{\"id\":60,\"title\":\"How to Be Single\"},{\"id\":61,\"title\":\"I'm Not Ashamed\"},{\"id\":62,\"title\":\"Ice Age: Collision Course\"},{\"id\":63,\"title\":\"Incarnate\"},{\"id\":64,\"title\":\"Independence Day: Resurgence\"},{\"id\":65,\"title\":\"Inferno\"},{\"id\":66,\"title\":\"Jack Reacher: Never Go Back\"},{\"id\":67,\"title\":\"Jane Got a Gun\"},{\"id\":68,\"title\":\"Jason Bourne\"},{\"id\":69,\"title\":\"Keanu\"},{\"id\":70,\"title\":\"Keeping Up with the Joneses\"},{\"id\":71,\"title\":\"Kevin Hart: What Now?\"},{\"id\":72,\"title\":\"Knight of Cups\"},{\"id\":73,\"title\":\"Kubo and the Two Strings\"},{\"id\":74,\"title\":\"Kung Fu Panda 3\"},{\"id\":75,\"title\":\"La La Land\"},{\"id\":76,\"title\":\"Last Days in the Desert\"},{\"id\":77,\"title\":\"Lazer Team\"},{\"id\":78,\"title\":\"Lights Out\"},{\"id\":79,\"title\":\"Lion\"},{\"id\":80,\"title\":\"Live by Night\"},{\"id\":81,\"title\":\"London Has Fallen\"},{\"id\":82,\"title\":\"Loving\"},{\"id\":83,\"title\":\"Maggie's Plan\"},{\"id\":84,\"title\":\"Man Down\"},{\"id\":85,\"title\":\"Manchester by the Sea\"},{\"id\":86,\"title\":\"Masterminds\"},{\"id\":87,\"title\":\"Max Steel\"},{\"id\":88,\"title\":\"Me Before You\"},{\"id\":89,\"title\":\"Mechanic: Resurrection\"},{\"id\":90,\"title\":\"Meet the Blacks\"},{\"id\":91,\"title\":\"Middle School: The Worst Years of My Life\"},{\"id\":92,\"title\":\"Midnight Special\"},{\"id\":93,\"title\":\"Mike and Dave Need Wedding Dates\"},{\"id\":94,\"title\":\"Miracles from Heaven\"},{\"id\":95,\"title\":\"Misconduct\"},{\"id\":96,\"title\":\"Miss Peregrine's Home for Peculiar Children\"},{\"id\":97,\"title\":\"Miss Sloane\"},{\"id\":98,\"title\":\"Moana\"},{\"id\":99,\"title\":\"Money Monster\"},{\"id\":100,\"title\":\"Monster Hunt\"},{\"id\":101,\"title\":\"Moonlight\"},{\"id\":102,\"title\":\"Morgan\"},{\"id\":103,\"title\":\"Mother's Day\"},{\"id\":104,\"title\":\"My Big Fat Greek Wedding 2\"},{\"id\":105,\"title\":\"Neighbors 2: Sorority Rising\"},{\"id\":106,\"title\":\"Nerdland\"},{\"id\":107,\"title\":\"Nerve\"},{\"id\":108,\"title\":\"Nine Lives\"},{\"id\":109,\"title\":\"Nocturnal Animals\"},{\"id\":110,\"title\":\"Norm of the North\"},{\"id\":111,\"title\":\"Now You See Me 2\"},{\"id\":112,\"title\":\"Office Christmas Party\"},{\"id\":113,\"title\":\"Ouija: Origin of Evil\"},{\"id\":114,\"title\":\"Passengers\"},{\"id\":115,\"title\":\"Patriots Day\"},{\"id\":116,\"title\":\"Pete's Dragon\"},{\"id\":117,\"title\":\"Popstar: Never Stop Never Stopping\"},{\"id\":118,\"title\":\"Pride and Prejudice and Zombies\"},{\"id\":119,\"title\":\"Queen of Katwe\"},{\"id\":120,\"title\":\"Race\"},{\"id\":121,\"title\":\"Ratchet & Clank\"},{\"id\":122,\"title\":\"Ride Along 2\"},{\"id\":123,\"title\":\"Risen\"},{\"id\":124,\"title\":\"Rogue One\"},{\"id\":125,\"title\":\"Rules Don't Apply\"},{\"id\":126,\"title\":\"Sausage Party\"},{\"id\":127,\"title\":\"Shut In\"},{\"id\":128,\"title\":\"Silence\"},{\"id\":129,\"title\":\"Sing\"},{\"id\":130,\"title\":\"Snowden\"},{\"id\":131,\"title\":\"Solace\"},{\"id\":132,\"title\":\"Star Trek Beyond\"},{\"id\":133,\"title\":\"Storks\"},{\"id\":134,\"title\":\"Suicide Squad\"},{\"id\":135,\"title\":\"Sully\"},{\"id\":136,\"title\":\"Teenage Mutant Ninja Turtles: Out of the Shadows\"},{\"id\":137,\"title\":\"The 5th Wave\"},{\"id\":138,\"title\":\"The Accountant\"},{\"id\":139,\"title\":\"The Angry Birds Movie\"},{\"id\":140,\"title\":\"The BFG\"},{\"id\":141,\"title\":\"The Birth of a Nation\"},{\"id\":142,\"title\":\"The Boss\"},{\"id\":143,\"title\":\"The Boy\"},{\"id\":144,\"title\":\"The Bronze\"},{\"id\":145,\"title\":\"The Choice\"},{\"id\":146,\"title\":\"The Comedian\"},{\"id\":147,\"title\":\"The Conjuring 2\"},{\"id\":148,\"title\":\"The Darkness\"},{\"id\":149,\"title\":\"The Disappointments Room\"},{\"id\":150,\"title\":\"The Divergent Series: Allegiant\"},{\"id\":151,\"title\":\"The Edge of Seventeen\"},{\"id\":152,\"title\":\"The Finest Hours\"},{\"id\":153,\"title\":\"The Forest\"},{\"id\":154,\"title\":\"The Founder\"},{\"id\":155,\"title\":\"The Girl on the Train\"},{\"id\":156,\"title\":\"The Huntsman: Winter's War\"},{\"id\":157,\"title\":\"The Infiltrator\"},{\"id\":158,\"title\":\"The Jungle Book\"},{\"id\":159,\"title\":\"The Legend of Tarzan\"},{\"id\":160,\"title\":\"The Light Between Oceans\"},{\"id\":161,\"title\":\"The Magnificent Seven\"},{\"id\":162,\"title\":\"The Masked Saint\"},{\"id\":163,\"title\":\"The Mermaid\"},{\"id\":164,\"title\":\"The Monkey King 2\"},{\"id\":165,\"title\":\"The Neon Demon\"},{\"id\":166,\"title\":\"The Nice Guys\"},{\"id\":167,\"title\":\"The Other Side of the Door\"},{\"id\":168,\"title\":\"The Perfect Match\"},{\"id\":169,\"title\":\"The Purge: Election Year\"},{\"id\":170,\"title\":\"The Secret Life of Pets\"},{\"id\":171,\"title\":\"The Shallows\"},{\"id\":172,\"title\":\"The Witch\"},{\"id\":173,\"title\":\"The Young Messiah\"},{\"id\":174,\"title\":\"They're Watching\"},{\"id\":175,\"title\":\"Trolls\"},{\"id\":176,\"title\":\"Voyage of Time\"},{\"id\":177,\"title\":\"War Dogs\"},{\"id\":178,\"title\":\"Warcraft\"},{\"id\":179,\"title\":\"When the Bough Breaks\"},{\"id\":180,\"title\":\"Whiskey Tango Foxtrot\"},{\"id\":181,\"title\":\"Why Him?\"},{\"id\":182,\"title\":\"X-Men: Apocalypse\"},{\"id\":183,\"title\":\"Yoga Hosers\"},{\"id\":184,\"title\":\"Your Name\"},{\"id\":185,\"title\":\"Zoolander 2\"},{\"id\":186,\"title\":\"Zootopia\"}]}");
349
-
350
- /***/ }),
351
-
352
- /***/ 86:
353
- /***/ (function(module, exports) {
354
-
355
- module.exports = require("@splunk/ui-utils/promise");
356
-
357
- /***/ })
358
-
359
- /******/ });
@@ -1,82 +0,0 @@
1
- import 'core-js/es/promise';
2
- declare type Movie = {
3
- id: number;
4
- title: string;
5
- };
6
- declare type MovieOption = Movie & {
7
- matchRanges?: {
8
- start: number;
9
- end: number;
10
- }[];
11
- };
12
- declare function isMovieOption(movie: Movie | MovieOption): movie is MovieOption;
13
- /**
14
- * @param fetchTimeout: number - The number of milliseconds to defer fetching of options.
15
- * @param fetchMoreTimeout: number - The number of milliseconds to defer fetching additional options.
16
- * @param numberOfResults: number - Then mumber of options to retrieve per fetch.
17
- */
18
- export default class FetchOptions {
19
- private currentFetch;
20
- private currentOptions;
21
- private fetching;
22
- private fetchMoreTimeout;
23
- private fetchPromise?;
24
- private fetchTimeout;
25
- private filter?;
26
- private firstIndex;
27
- private lastIndex;
28
- private list;
29
- private numberOfResults;
30
- private timer?;
31
- constructor({ fetchTimeout, fetchMoreTimeout, numberOfResults }?: {
32
- fetchTimeout?: number | undefined;
33
- fetchMoreTimeout?: number | undefined;
34
- numberOfResults?: number | undefined;
35
- });
36
- /**
37
- * Fake fetches options from a server.
38
- * @param filter: string - filter options.
39
- * @param timeout: number - Number of milliseconds to defer fetch.
40
- * @return A promise that will resolve based on the fetchTimeout value.
41
- * Returns array of new options.
42
- */
43
- fetch(filter?: string, timeout?: number): Promise<MovieOption[]>;
44
- /**
45
- * Increases searching index for new options and runs fetch.
46
- * @param currentOptions: array - Append options to given array.
47
- * @return A promise that will resolve based on the fetchTimeout value.
48
- * Returns array of new options appended to currentOptions.
49
- */
50
- fetchMore(currentOptions?: MovieOption[]): Promise<MovieOption[]>;
51
- private concatAndFilter;
52
- private filterResults;
53
- /**
54
- * Resets firstIndex, LastIndex, currentOptions and list to default values.
55
- */
56
- reset(): void;
57
- /** Cancels pending fetch promises. */
58
- stop(): void;
59
- /**
60
- * @return Option of given value;
61
- */
62
- getOption: (value: number) => {
63
- id: number;
64
- title: string;
65
- } | undefined;
66
- /**
67
- * @return Options of given values;
68
- */
69
- getSelectedOptions: (values: number[]) => {
70
- id: number;
71
- title: string;
72
- }[];
73
- /**
74
- * Get current length of indexes fetched.
75
- */
76
- getCurrentCount: () => number;
77
- /**
78
- * Get full count of all possible items fetched.
79
- */
80
- getFullCount: () => number;
81
- }
82
- export { isMovieOption, Movie, MovieOption };
@@ -1,2 +0,0 @@
1
- export { default } from './FetchOptions';
2
- export * from './FetchOptions';