@splunk/visualizations 25.13.1 → 26.1.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 (150) hide show
  1. package/Area.config.js +318 -234
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +1131 -766
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +317 -233
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +1007 -594
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +234 -160
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +912 -509
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +80 -29
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +691 -319
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +308 -223
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +1011 -587
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +127 -62
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +576 -286
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +111 -29
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +998 -527
  28. package/Events.js.map +1 -1
  29. package/FillerGauge.config.js +142 -73
  30. package/FillerGauge.config.js.map +1 -1
  31. package/FillerGauge.js +962 -572
  32. package/FillerGauge.js.map +1 -1
  33. package/Image.config.js +70 -26
  34. package/Image.config.js.map +1 -1
  35. package/Image.js +524 -253
  36. package/Image.js.map +1 -1
  37. package/Line.config.js +326 -242
  38. package/Line.config.js.map +1 -1
  39. package/Line.js +1022 -606
  40. package/Line.js.map +1 -1
  41. package/LinkGraph.config.js +99 -49
  42. package/LinkGraph.config.js.map +1 -1
  43. package/LinkGraph.js +1184 -762
  44. package/LinkGraph.js.map +1 -1
  45. package/MIGRATION.md +1082 -0
  46. package/Map.config.js +311 -167
  47. package/Map.config.js.map +1 -1
  48. package/Map.js +1479 -873
  49. package/Map.js.map +1 -1
  50. package/Markdown.config.js +93 -43
  51. package/Markdown.config.js.map +1 -1
  52. package/Markdown.js +603 -332
  53. package/Markdown.js.map +1 -1
  54. package/MarkerGauge.config.js +163 -105
  55. package/MarkerGauge.config.js.map +1 -1
  56. package/MarkerGauge.js +1025 -628
  57. package/MarkerGauge.js.map +1 -1
  58. package/ParallelCoordinates.config.js +95 -41
  59. package/ParallelCoordinates.config.js.map +1 -1
  60. package/ParallelCoordinates.js +993 -622
  61. package/ParallelCoordinates.js.map +1 -1
  62. package/Pie.config.js +99 -46
  63. package/Pie.config.js.map +1 -1
  64. package/Pie.js +847 -442
  65. package/Pie.js.map +1 -1
  66. package/Punchcard.config.js +114 -62
  67. package/Punchcard.config.js.map +1 -1
  68. package/Punchcard.js +1097 -633
  69. package/Punchcard.js.map +1 -1
  70. package/Rectangle.config.js +131 -65
  71. package/Rectangle.config.js.map +1 -1
  72. package/Rectangle.js +580 -288
  73. package/Rectangle.js.map +1 -1
  74. package/Sankey.config.js +103 -41
  75. package/Sankey.config.js.map +1 -1
  76. package/Sankey.js +1128 -586
  77. package/Sankey.js.map +1 -1
  78. package/Scatter.config.js +231 -157
  79. package/Scatter.config.js.map +1 -1
  80. package/Scatter.js +904 -504
  81. package/Scatter.js.map +1 -1
  82. package/SingleValue.config.js +212 -142
  83. package/SingleValue.config.js.map +1 -1
  84. package/SingleValue.js +1506 -956
  85. package/SingleValue.js.map +1 -1
  86. package/SingleValueBasic.js +294 -233
  87. package/SingleValueBasic.js.map +1 -1
  88. package/SingleValueIcon.config.js +208 -138
  89. package/SingleValueIcon.config.js.map +1 -1
  90. package/SingleValueIcon.js +1375 -914
  91. package/SingleValueIcon.js.map +1 -1
  92. package/SingleValueRadial.config.js +252 -137
  93. package/SingleValueRadial.config.js.map +1 -1
  94. package/SingleValueRadial.js +2194 -1069
  95. package/SingleValueRadial.js.map +1 -1
  96. package/SparkLine.js +172 -83
  97. package/SparkLine.js.map +1 -1
  98. package/Table.config.js +123 -70
  99. package/Table.config.js.map +1 -1
  100. package/Table.js +1094 -590
  101. package/Table.js.map +1 -1
  102. package/common/Charting.js +147 -75
  103. package/common/Charting.js.map +1 -1
  104. package/common/ChartingApi.js +18 -7
  105. package/common/ChartingApi.js.map +1 -1
  106. package/common/EventsDoc.js +91 -36
  107. package/common/EventsDoc.js.map +1 -1
  108. package/common/GaugeMajorTicks.js +70 -60
  109. package/common/GaugeMajorTicks.js.map +1 -1
  110. package/common/GaugeValueMarker.js +45 -36
  111. package/common/GaugeValueMarker.js.map +1 -1
  112. package/common/OptionsDoc.js +177 -86
  113. package/common/OptionsDoc.js.map +1 -1
  114. package/common/OverviewDoc.js +65 -32
  115. package/common/OverviewDoc.js.map +1 -1
  116. package/common/SplunkVisualization.js +34 -7
  117. package/common/SplunkVisualization.js.map +1 -1
  118. package/common/SplunkVisualizationApi.js +10 -4
  119. package/common/SplunkVisualizationApi.js.map +1 -1
  120. package/common/ThemesDoc.js +41 -28
  121. package/common/ThemesDoc.js.map +1 -1
  122. package/common/chartingUtils.js +56 -24
  123. package/common/chartingUtils.js.map +1 -1
  124. package/common/docUtils.js +15 -5
  125. package/common/docUtils.js.map +1 -1
  126. package/common/gaugeUtils.js +238 -155
  127. package/common/gaugeUtils.js.map +1 -1
  128. package/common/shapeUtils.js +34 -16
  129. package/common/shapeUtils.js.map +1 -1
  130. package/common/utils/configUtils.js +59 -23
  131. package/common/utils/configUtils.js.map +1 -1
  132. package/common/utils/dataUtils.js +9 -4
  133. package/common/utils/dataUtils.js.map +1 -1
  134. package/common/utils/hocUtils.js +5 -3
  135. package/common/utils/hocUtils.js.map +1 -1
  136. package/common/utils/layoutUtils.js +3 -2
  137. package/common/utils/layoutUtils.js.map +1 -1
  138. package/common/utils/mapUtils.js +370 -206
  139. package/common/utils/mapUtils.js.map +1 -1
  140. package/common/utils/singleValueUtils.js +243 -198
  141. package/common/utils/singleValueUtils.js.map +1 -1
  142. package/common/utils/testHelper.js +36 -9
  143. package/common/utils/testHelper.js.map +1 -1
  144. package/common/utils/trellisUtils.js +87 -26
  145. package/common/utils/trellisUtils.js.map +1 -1
  146. package/common/utils/urlUtils.js +4 -2
  147. package/common/utils/urlUtils.js.map +1 -1
  148. package/common/withDashboardViz.js +375 -193
  149. package/common/withDashboardViz.js.map +1 -1
  150. package/package.json +25 -27
package/Image.js CHANGED
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 217);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 220);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -136,40 +136,46 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
136
136
  Object.defineProperty(exports, "__esModule", {
137
137
  value: true
138
138
  });
139
+
139
140
  var React = __webpack_require__(1);
141
+
140
142
  var styled_components_1 = __webpack_require__(4);
143
+
141
144
  var SizeAwareWrapper_1 = __webpack_require__(19);
145
+
142
146
  var style_1 = __webpack_require__(14);
147
+
143
148
  var colorUtils_1 = __webpack_require__(12);
149
+
144
150
  var Item = styled_components_1.default.div.attrs(function (_ref) {
145
151
  var width = _ref.width;
146
152
  return {
147
153
  style: {
148
- width: style_1.toPx(width)
154
+ width: (0, style_1.toPx)(width)
149
155
  }
150
156
  };
151
157
  }).withConfig({
152
158
  displayName: "FixedSizeContainer__Item",
153
159
  componentId: "sc-1yhgpod-0"
154
160
  })(["position:relative;background-color:", "};"], function (props) {
155
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
156
- });
157
- // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
161
+ return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
162
+ }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
163
+
158
164
  var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
159
165
  var width = _ref2.width,
160
- height = _ref2.height;
166
+ height = _ref2.height;
161
167
  return {
162
168
  style: Object.assign(Object.assign({}, width && {
163
- width: style_1.toPx(width)
169
+ width: (0, style_1.toPx)(width)
164
170
  }), height && {
165
- height: style_1.toPx(height)
171
+ height: (0, style_1.toPx)(height)
166
172
  })
167
173
  };
168
174
  }).withConfig({
169
175
  displayName: "FixedSizeContainer__FixSizeItem",
170
176
  componentId: "sc-1yhgpod-1"
171
177
  })(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
172
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
178
+ return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
173
179
  });
174
180
  var ItemContent = styled_components_1.default.div.withConfig({
175
181
  displayName: "FixedSizeContainer__ItemContent",
@@ -179,11 +185,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
179
185
  displayName: "FixedSizeContainer__FixSizeItemContent",
180
186
  componentId: "sc-1yhgpod-3"
181
187
  })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
188
+
182
189
  var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
183
190
  var FixedSizeContainer = function FixedSizeContainer(props) {
184
191
  var width = props.width,
185
- height = props.height,
186
- backgroundColor = props.backgroundColor;
192
+ height = props.height,
193
+ backgroundColor = props.backgroundColor;
194
+
187
195
  if (!height) {
188
196
  return React.createElement(Item, {
189
197
  "data-test": "item",
@@ -191,24 +199,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
191
199
  backgroundColor: backgroundColor
192
200
  }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
193
201
  }
202
+
194
203
  return React.createElement(FixSizeItem, {
195
204
  "data-test": "fix-size-item",
196
- "data-splunk-visualization-version": "25.13.1 - ea48ec41e",
205
+ "data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
197
206
  width: width,
198
207
  height: height,
199
208
  backgroundColor: backgroundColor
200
209
  }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
201
210
  var newWidth = _ref3.width,
202
- newHeight = _ref3.height;
211
+ newHeight = _ref3.height;
203
212
  return React.createElement(Viz, Object.assign({}, props, {
204
213
  width: newWidth,
205
214
  height: newHeight
206
215
  }));
207
216
  })));
208
217
  };
218
+
209
219
  FixedSizeContainer.displayName = 'withFixedSizeContainer';
210
220
  return FixedSizeContainer;
211
221
  };
222
+
212
223
  exports.default = withFixedSizeContainer;
213
224
 
214
225
  /***/ }),
@@ -236,9 +247,10 @@ exports.extendStaticWrapperProps = void 0;
236
247
  * @param {DashboardVizType} props.Wrapper
237
248
  * @param {DashboardVizType} props.Visualization
238
249
  */
250
+
239
251
  var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
240
252
  var Wrapper = _ref.Wrapper,
241
- Visualization = _ref.Visualization;
253
+ Visualization = _ref.Visualization;
242
254
  var extendProperties = ['propTypes', 'defaultProps', 'config'];
243
255
  extendProperties.forEach(function (prop) {
244
256
  if (Visualization[prop]) {
@@ -247,11 +259,12 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
247
259
  }
248
260
  });
249
261
  };
262
+
250
263
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
251
264
 
252
265
  /***/ }),
253
266
 
254
- /***/ 150:
267
+ /***/ 153:
255
268
  /***/ (function(module, exports, __webpack_require__) {
256
269
 
257
270
  "use strict";
@@ -259,31 +272,46 @@ exports.extendStaticWrapperProps = extendStaticWrapperProps;
259
272
 
260
273
  var __rest = this && this.__rest || function (s, e) {
261
274
  var t = {};
275
+
262
276
  for (var p in s) {
263
277
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
264
278
  }
279
+
265
280
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
266
281
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
267
282
  }
268
283
  return t;
269
284
  };
285
+
270
286
  Object.defineProperty(exports, "__esModule", {
271
287
  value: true
272
288
  });
273
289
  exports.config = exports.themes = exports.toImageDimensions = exports.shouldShowPlaceholder = void 0;
290
+
274
291
  var lodash_1 = __webpack_require__(3);
292
+
275
293
  var React = __webpack_require__(1);
294
+
276
295
  var i18n_1 = __webpack_require__(2);
296
+
277
297
  var style_1 = __webpack_require__(14);
278
- var RemoteImage_1 = __webpack_require__(151);
298
+
299
+ var RemoteImage_1 = __webpack_require__(154);
300
+
279
301
  var styled_components_1 = __webpack_require__(4);
302
+
280
303
  var T = __webpack_require__(0);
281
- var config_1 = __webpack_require__(218);
304
+
305
+ var config_1 = __webpack_require__(221);
306
+
282
307
  exports.config = config_1.default;
283
- var withDashboardViz_1 = __webpack_require__(36);
284
- var ImageApi_1 = __webpack_require__(219);
308
+
309
+ var withDashboardViz_1 = __webpack_require__(37);
310
+
311
+ var ImageApi_1 = __webpack_require__(222);
312
+
285
313
  var useEffect = React.useEffect,
286
- useRef = React.useRef;
314
+ useRef = React.useRef;
287
315
  var validOptions = Object.keys(config_1.default.optionsSchema);
288
316
  var Container = styled_components_1.default.div.attrs(function () {
289
317
  return {
@@ -295,49 +323,58 @@ var Container = styled_components_1.default.div.attrs(function () {
295
323
  })(["position:relative;box-sizing:border-box;display:flex;justify-content:center;align-items:center;cursor:", ";", ";"], function (props) {
296
324
  return props.onClick ? 'pointer' : 'inherit';
297
325
  }, function (props) {
298
- return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
326
+ return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
299
327
  });
328
+
300
329
  var shouldShowPlaceholder = function shouldShowPlaceholder(dataSources, loading, options) {
301
330
  if (options.src) {
302
331
  return false;
303
332
  }
333
+
304
334
  return true;
305
335
  };
336
+
306
337
  exports.shouldShowPlaceholder = shouldShowPlaceholder;
338
+
307
339
  var toImageDimensions = function toImageDimensions(props) {
308
340
  if (props.shouldPreserveAspectRatio) {
309
341
  return "\n max-width: 100%;\n max-height: 100%;\n width: auto;\n height: auto;\n ";
310
342
  }
311
- return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
343
+
344
+ return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
312
345
  };
346
+
313
347
  exports.toImageDimensions = toImageDimensions;
314
348
  var StyledImage = styled_components_1.default.img.withConfig({
315
349
  displayName: "Image__StyledImage",
316
350
  componentId: "kplb09-1"
317
351
  })(["display:block;", ";"], function (props) {
318
- return exports.toImageDimensions(props);
352
+ return (0, exports.toImageDimensions)(props);
319
353
  });
354
+
320
355
  var computeVizProps = function computeVizProps(_a) {
321
356
  var visualizationApiRef = _a.visualizationApiRef,
322
- title = _a.title,
323
- otherOptions = __rest(_a, ["visualizationApiRef", "title"]);
324
- var options = lodash_1.chain(otherOptions).pick(validOptions).value();
357
+ title = _a.title,
358
+ otherOptions = __rest(_a, ["visualizationApiRef", "title"]);
359
+
360
+ var options = (0, lodash_1.chain)(otherOptions).pick(validOptions).value();
325
361
  return {
326
362
  options: options,
327
363
  title: title,
328
364
  visualizationApiRef: visualizationApiRef
329
365
  };
330
366
  };
367
+
331
368
  var ImageVisualization = function ImageVisualization(_ref) {
332
369
  var height = _ref.height,
333
- width = _ref.width,
334
- _ref$title = _ref.title,
335
- title = _ref$title === void 0 ? '' : _ref$title,
336
- visualizationApiRef = _ref.visualizationApiRef,
337
- options = _ref.options,
338
- onImageClick = _ref.onImageClick;
370
+ width = _ref.width,
371
+ _ref$title = _ref.title,
372
+ title = _ref$title === void 0 ? '' : _ref$title,
373
+ visualizationApiRef = _ref.visualizationApiRef,
374
+ options = _ref.options,
375
+ onImageClick = _ref.onImageClick;
339
376
  var src = options.src,
340
- preserveAspectRatio = options.preserveAspectRatio;
377
+ preserveAspectRatio = options.preserveAspectRatio;
341
378
  var remoteImage = useRef(null);
342
379
  var api = useRef(new ImageApi_1.default({
343
380
  options: {
@@ -346,7 +383,7 @@ var ImageVisualization = function ImageVisualization(_ref) {
346
383
  },
347
384
  remoteImage: remoteImage
348
385
  }));
349
- var isRemote = RemoteImage_1.isRemoteImage(src);
386
+ var isRemote = (0, RemoteImage_1.isRemoteImage)(src);
350
387
  useEffect(function () {
351
388
  visualizationApiRef(api.current);
352
389
  return function () {
@@ -370,13 +407,14 @@ var ImageVisualization = function ImageVisualization(_ref) {
370
407
  shouldPreserveAspectRatio: preserveAspectRatio,
371
408
  width: width,
372
409
  height: height,
373
- alt: i18n_1._(title),
410
+ alt: (0, i18n_1._)(title),
374
411
  onError: function onError(e) {
375
- e.target.alt = i18n_1._('Image not found');
412
+ e.target.alt = (0, i18n_1._)('Image not found');
376
413
  },
377
414
  referrerPolicy: "no-referrer"
378
415
  }));
379
416
  };
417
+
380
418
  var propTypes = {
381
419
  width: T.oneOfType([T.string, T.number]),
382
420
  height: T.oneOfType([T.string, T.number]),
@@ -395,7 +433,7 @@ var defaultProps = {
395
433
  };
396
434
  ImageVisualization.propTypes = propTypes;
397
435
  ImageVisualization.defaultProps = defaultProps;
398
- var Image = withDashboardViz_1.default({
436
+ var Image = (0, withDashboardViz_1.default)({
399
437
  ReactViz: ImageVisualization,
400
438
  vizConfig: config_1.default,
401
439
  useIconPlaceholder: exports.shouldShowPlaceholder,
@@ -407,7 +445,7 @@ exports.default = Image;
407
445
 
408
446
  /***/ }),
409
447
 
410
- /***/ 151:
448
+ /***/ 154:
411
449
  /***/ (function(module, exports) {
412
450
 
413
451
  module.exports = require("@splunk/visualizations-shared/RemoteImage");
@@ -456,24 +494,33 @@ module.exports = require("@splunk/ui-utils/i18n");
456
494
 
457
495
 
458
496
  var _toConsumableArray = __webpack_require__(8);
497
+
459
498
  var _defineProperty = __webpack_require__(7);
499
+
460
500
  var __rest = this && this.__rest || function (s, e) {
461
501
  var t = {};
502
+
462
503
  for (var p in s) {
463
504
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
464
505
  }
506
+
465
507
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
466
508
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
467
509
  }
468
510
  return t;
469
511
  };
512
+
470
513
  Object.defineProperty(exports, "__esModule", {
471
514
  value: true
472
515
  });
473
516
  exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
517
+
474
518
  var lodash_1 = __webpack_require__(3);
519
+
475
520
  var schemaUtils_1 = __webpack_require__(16);
521
+
476
522
  var VizBehavior_1 = __webpack_require__(6);
523
+
477
524
  var dynamicOptionsDSLType = {
478
525
  type: 'string',
479
526
  pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
@@ -483,20 +530,22 @@ var dynamicOptionsDSLType = {
483
530
  * @param optionsSchema a visualization's options schema
484
531
  * @returns an updated options schema that additionally allows strings starting with > for each option
485
532
  */
533
+
486
534
  function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
487
535
  var enhancedOptionsSchema = {};
488
536
  Object.keys(optionsSchema).forEach(function (key) {
489
537
  var _a = optionsSchema[key],
490
- title = _a.title,
491
- description = _a.description,
492
- readOnly = _a.readOnly,
493
- writeOnly = _a.writeOnly,
494
- examples = _a.examples,
495
- defaultValue = _a.default,
496
- type = _a.type,
497
- properties = _a.properties,
498
- patternProperties = _a.patternProperties,
499
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
538
+ title = _a.title,
539
+ description = _a.description,
540
+ readOnly = _a.readOnly,
541
+ writeOnly = _a.writeOnly,
542
+ examples = _a.examples,
543
+ defaultValue = _a.default,
544
+ type = _a.type,
545
+ properties = _a.properties,
546
+ patternProperties = _a.patternProperties,
547
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
548
+
500
549
  var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
501
550
  title: title
502
551
  }), description !== undefined && {
@@ -510,12 +559,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
510
559
  }), defaultValue !== undefined && {
511
560
  default: defaultValue
512
561
  });
562
+
513
563
  if (type === 'object') {
514
564
  enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
515
565
  type: type
516
566
  }), properties && {
517
567
  properties: enhanceOptionsSchemaWithDynamicOptions(properties)
518
568
  });
569
+
519
570
  if (patternProperties) {
520
571
  var enhancedPatternProperties = {};
521
572
  Object.keys(patternProperties).forEach(function (opt) {
@@ -533,6 +584,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
533
584
  });
534
585
  return enhancedOptionsSchema;
535
586
  }
587
+
536
588
  exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
537
589
  /**
538
590
  * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
@@ -541,11 +593,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
541
593
  * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
542
594
  * and containing `open: false` for all editor panels in editorConfig
543
595
  */
596
+
544
597
  function enhanceConfig(vizConfig) {
545
598
  var enhancedConfig = Object.assign({}, vizConfig);
599
+
546
600
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
547
601
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
548
602
  }
603
+
549
604
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
550
605
  return Object.assign(Object.assign({}, config), {
551
606
  open: config.open || false
@@ -553,6 +608,7 @@ function enhanceConfig(vizConfig) {
553
608
  });
554
609
  return enhancedConfig;
555
610
  }
611
+
556
612
  exports.enhanceConfig = enhanceConfig;
557
613
  /**
558
614
  * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
@@ -560,6 +616,7 @@ exports.enhanceConfig = enhanceConfig;
560
616
  * @param vizConfig a Visualization Config
561
617
  * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
562
618
  */
619
+
563
620
  function uncollapseEditorConfig(vizConfig) {
564
621
  var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
565
622
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
@@ -569,13 +626,16 @@ function uncollapseEditorConfig(vizConfig) {
569
626
  });
570
627
  return editorPanelUncollapsedConfig;
571
628
  }
629
+
572
630
  exports.uncollapseEditorConfig = uncollapseEditorConfig;
631
+
573
632
  function isDynamicOption(option) {
574
633
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
575
634
  }
576
- exports.isDynamicOption = isDynamicOption;
577
- // private helpers to improve readability of getInitialPreset
635
+
636
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
578
637
  // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
638
+
579
639
  /**
580
640
  * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
581
641
  * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset
@@ -584,6 +644,7 @@ exports.isDynamicOption = isDynamicOption;
584
644
  *
585
645
  * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
586
646
  */
647
+
587
648
  function hasCompatibleContexts(vizContext, presetContext) {
588
649
  var presetContextKeys = Object.keys(presetContext);
589
650
  return presetContextKeys.every(function (contextKey) {
@@ -593,6 +654,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
593
654
  /**
594
655
  * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
595
656
  */
657
+
658
+
596
659
  function hasCompatibleOptions(vizOptions, presetOptions) {
597
660
  var presetOptionKeys = Object.keys(presetOptions);
598
661
  return presetOptionKeys.every(function (optionKey) {
@@ -607,18 +670,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
607
670
  * @param {Object} vizOptions - the current vizOptions definition
608
671
  * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
609
672
  */
673
+
674
+
610
675
  function getInitialPreset(vizContext, vizOptions, presets) {
611
676
  return presets.find(function (preset) {
612
- var presetContext = lodash_1.get(preset, ['value', 'context'], {});
613
- var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
677
+ var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
678
+ var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
614
679
  var presetContextKeys = Object.keys(presetContext);
615
- var presetOptionKeys = Object.keys(presetOptions);
616
- // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
680
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
617
681
  // if not, then the preset is invalid in config.ts
682
+
618
683
  if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
619
684
  return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
620
685
  });
621
686
  }
687
+
622
688
  exports.getInitialPreset = getInitialPreset;
623
689
  /**
624
690
  * generates number precision values for a Select editor
@@ -626,14 +692,16 @@ exports.getInitialPreset = getInitialPreset;
626
692
  * @param {Number} numPrecisionValues - number of integer precision values to generate
627
693
  * @returns {{ label: string; value; string }[]} array of { label, value } tuples
628
694
  */
695
+
629
696
  function generatePrecisionValues(numPrecisionValues) {
630
- return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
697
+ return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
631
698
  return {
632
699
  label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
633
700
  value: i
634
701
  };
635
702
  });
636
703
  }
704
+
637
705
  exports.generatePrecisionValues = generatePrecisionValues;
638
706
  /**
639
707
  * insert layout in layout array, return a new layout array instead of updating the original
@@ -643,12 +711,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
643
711
  * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
644
712
  * @returns {EditorLayoutConfig[][]} new editor layout with insertion
645
713
  */
714
+
646
715
  var insertLayout = function insertLayout(layout, index) {
647
716
  for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
648
717
  layoutItems[_key - 2] = arguments[_key];
649
718
  }
719
+
650
720
  return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
651
721
  };
722
+
652
723
  exports.insertLayout = insertLayout;
653
724
 
654
725
  /***/ }),
@@ -660,7 +731,7 @@ module.exports = require("@splunk/visualization-context/FeatureFlagContext");
660
731
 
661
732
  /***/ }),
662
733
 
663
- /***/ 217:
734
+ /***/ 220:
664
735
  /***/ (function(module, exports, __webpack_require__) {
665
736
 
666
737
  "use strict";
@@ -668,27 +739,38 @@ module.exports = require("@splunk/visualization-context/FeatureFlagContext");
668
739
 
669
740
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
670
741
  if (k2 === undefined) k2 = k;
671
- Object.defineProperty(o, k2, {
672
- enumerable: true,
673
- get: function get() {
674
- return m[k];
675
- }
676
- });
742
+ var desc = Object.getOwnPropertyDescriptor(m, k);
743
+
744
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
745
+ desc = {
746
+ enumerable: true,
747
+ get: function get() {
748
+ return m[k];
749
+ }
750
+ };
751
+ }
752
+
753
+ Object.defineProperty(o, k2, desc);
677
754
  } : function (o, m, k, k2) {
678
755
  if (k2 === undefined) k2 = k;
679
756
  o[k2] = m[k];
680
757
  });
758
+
681
759
  var __exportStar = this && this.__exportStar || function (m, exports) {
682
760
  for (var p in m) {
683
761
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
684
762
  }
685
763
  };
764
+
686
765
  Object.defineProperty(exports, "__esModule", {
687
766
  value: true
688
767
  });
689
768
  exports.default = void 0;
690
- __exportStar(__webpack_require__(150), exports);
691
- var Image_1 = __webpack_require__(150);
769
+
770
+ __exportStar(__webpack_require__(153), exports);
771
+
772
+ var Image_1 = __webpack_require__(153);
773
+
692
774
  Object.defineProperty(exports, "default", {
693
775
  enumerable: true,
694
776
  get: function get() {
@@ -698,7 +780,7 @@ Object.defineProperty(exports, "default", {
698
780
 
699
781
  /***/ }),
700
782
 
701
- /***/ 218:
783
+ /***/ 221:
702
784
  /***/ (function(module, exports, __webpack_require__) {
703
785
 
704
786
  "use strict";
@@ -707,15 +789,20 @@ Object.defineProperty(exports, "default", {
707
789
  Object.defineProperty(exports, "__esModule", {
708
790
  value: true
709
791
  });
792
+
710
793
  var i18n_1 = __webpack_require__(2);
794
+
711
795
  var visualization_icons_1 = __webpack_require__(52);
796
+
712
797
  var VizBehavior_1 = __webpack_require__(6);
713
- var VizCategory_1 = __webpack_require__(35);
798
+
799
+ var VizCategory_1 = __webpack_require__(36);
800
+
714
801
  var configUtils_1 = __webpack_require__(20);
802
+
715
803
  var dataContract = {
716
804
  requiredDataSources: [],
717
- optionalDataSources: [
718
- // Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
805
+ optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
719
806
  // {
720
807
  // name: 'annotation',
721
808
  // description: 'DataSource that populate event annotations',
@@ -740,13 +827,13 @@ var optionsSchema = {
740
827
  }
741
828
  };
742
829
  var editorConfig = [{
743
- label: i18n_1._('Image content'),
830
+ label: (0, i18n_1._)('Image content'),
744
831
  layout: [[{
745
- label: i18n_1._('Image file'),
832
+ label: (0, i18n_1._)('Image file'),
746
833
  option: 'src',
747
834
  editor: 'editor.image'
748
835
  }], [{
749
- label: i18n_1._('Preserve aspect ratio'),
836
+ label: (0, i18n_1._)('Preserve aspect ratio'),
750
837
  option: 'preserveAspectRatio',
751
838
  editor: 'editor.checkbox',
752
839
  showEditor: function showEditor(_ref) {
@@ -759,16 +846,19 @@ var themes = {};
759
846
  /**
760
847
  * visualization configuration
761
848
  */
849
+
762
850
  var config = {
763
851
  /**
764
852
  * unique viz key
765
853
  */
766
854
  key: 'splunk.image',
855
+
767
856
  /**
768
857
  * viz name
769
858
  */
770
- name: i18n_1._('Image'),
859
+ name: (0, i18n_1._)('Image'),
771
860
  category: VizCategory_1.VizCategory.MISC,
861
+
772
862
  /**
773
863
  * viz icon
774
864
  */
@@ -786,55 +876,67 @@ var config = {
786
876
  }
787
877
  }
788
878
  };
789
- exports.default = configUtils_1.enhanceConfig(config);
879
+ exports.default = (0, configUtils_1.enhanceConfig)(config);
790
880
 
791
881
  /***/ }),
792
882
 
793
- /***/ 219:
883
+ /***/ 222:
794
884
  /***/ (function(module, exports, __webpack_require__) {
795
885
 
796
886
  "use strict";
797
887
 
798
888
 
799
889
  var _classCallCheck = __webpack_require__(9);
890
+
800
891
  var _createClass = __webpack_require__(18);
892
+
801
893
  Object.defineProperty(exports, "__esModule", {
802
894
  value: true
803
895
  });
896
+
804
897
  var lodash_1 = __webpack_require__(3);
805
- var RemoteImage_1 = __webpack_require__(151);
898
+
899
+ var RemoteImage_1 = __webpack_require__(154);
806
900
  /**
807
901
  * Image Api
808
902
  */
903
+
904
+
809
905
  var ImageApi = /*#__PURE__*/function () {
810
906
  function ImageApi(viz) {
811
907
  _classCallCheck(this, ImageApi);
908
+
812
909
  this.viz = viz;
813
910
  }
814
911
  /**
815
912
  * put focus on the visualization
816
913
  */
817
914
  // eslint-disable-next-line class-methods-use-this
915
+
916
+
818
917
  _createClass(ImageApi, [{
819
918
  key: "focus",
820
919
  value: function focus() {}
821
920
  /**
822
921
  * return snapshot of that includes inlined image
823
922
  */
923
+
824
924
  }, {
825
925
  key: "snapshot",
826
926
  value: function snapshot() {
827
- var srcFromOptions = lodash_1.get(this.viz.options, 'src', '');
828
- var isRemote = RemoteImage_1.isRemoteImage(srcFromOptions);
927
+ var srcFromOptions = (0, lodash_1.get)(this.viz.options, 'src', '');
928
+ var isRemote = (0, RemoteImage_1.isRemoteImage)(srcFromOptions);
829
929
  return {
830
930
  options: Object.assign(Object.assign({}, this.viz.options), {
831
- src: isRemote && this.viz.remoteImage ? lodash_1.get(this.viz.remoteImage, ['current', 'state', 'imageDataURI'], '') : srcFromOptions
931
+ src: isRemote && this.viz.remoteImage ? (0, lodash_1.get)(this.viz.remoteImage, ['current', 'state', 'imageDataURI'], '') : srcFromOptions
832
932
  })
833
933
  };
834
934
  }
835
935
  }]);
936
+
836
937
  return ImageApi;
837
938
  }();
939
+
838
940
  exports.default = ImageApi;
839
941
 
840
942
  /***/ }),
@@ -842,28 +944,28 @@ exports.default = ImageApi;
842
944
  /***/ 25:
843
945
  /***/ (function(module, exports) {
844
946
 
845
- module.exports = require("@splunk/visualization-context/TimezoneContext");
947
+ module.exports = require("@splunk/ui-utils/id");
846
948
 
847
949
  /***/ }),
848
950
 
849
951
  /***/ 26:
850
952
  /***/ (function(module, exports) {
851
953
 
852
- module.exports = require("@splunk/visualizations-shared/hocUtils");
954
+ module.exports = require("@splunk/visualization-context/TimezoneContext");
853
955
 
854
956
  /***/ }),
855
957
 
856
958
  /***/ 27:
857
959
  /***/ (function(module, exports) {
858
960
 
859
- module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
961
+ module.exports = require("@splunk/visualizations-shared/hocUtils");
860
962
 
861
963
  /***/ }),
862
964
 
863
- /***/ 29:
965
+ /***/ 28:
864
966
  /***/ (function(module, exports) {
865
967
 
866
- module.exports = require("@splunk/visualization-encoding/Options");
968
+ module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
867
969
 
868
970
  /***/ }),
869
971
 
@@ -874,7 +976,14 @@ module.exports = require("lodash");
874
976
 
875
977
  /***/ }),
876
978
 
877
- /***/ 31:
979
+ /***/ 30:
980
+ /***/ (function(module, exports) {
981
+
982
+ module.exports = require("@splunk/visualization-encoding/Options");
983
+
984
+ /***/ }),
985
+
986
+ /***/ 32:
878
987
  /***/ (function(module, exports, __webpack_require__) {
879
988
 
880
989
  "use strict";
@@ -884,11 +993,17 @@ Object.defineProperty(exports, "__esModule", {
884
993
  value: true
885
994
  });
886
995
  exports.shouldShowIconPlaceholder = void 0;
996
+
887
997
  var React = __webpack_require__(1);
998
+
888
999
  var T = __webpack_require__(0);
1000
+
889
1001
  var lodash_1 = __webpack_require__(3);
1002
+
890
1003
  var i18n_1 = __webpack_require__(2);
1004
+
891
1005
  var Message_1 = __webpack_require__(10);
1006
+
892
1007
  var FixedSizeContainer_1 = __webpack_require__(13);
893
1008
  /**
894
1009
  * @method shouldShowIconPlaceholder
@@ -896,14 +1011,17 @@ var FixedSizeContainer_1 = __webpack_require__(13);
896
1011
  * @param {boolean} loading
897
1012
  * @returns {boolean}
898
1013
  */
1014
+
1015
+
899
1016
  var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
900
1017
  var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
901
- var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
1018
+ var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
902
1019
  var noData = data === undefined;
903
- var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
1020
+ var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields[0]', undefined);
904
1021
  var noFields = fields === undefined;
905
1022
  return loading || noData || noFields;
906
1023
  };
1024
+
907
1025
  exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
908
1026
  var propTypes = {
909
1027
  icon: T.func,
@@ -918,11 +1036,13 @@ var propTypes = {
918
1036
  * @param {IconPlaceholderProps} props
919
1037
  * @returns {React.ReactElement}
920
1038
  */
1039
+
921
1040
  var IconPlaceholder = function IconPlaceholder(props) {
922
1041
  var width = props.width,
923
- height = props.height,
924
- icon = props.icon,
925
- iconColor = props.iconColor;
1042
+ height = props.height,
1043
+ icon = props.icon,
1044
+ iconColor = props.iconColor;
1045
+
926
1046
  if (icon) {
927
1047
  return React.createElement(icon, {
928
1048
  style: {
@@ -937,26 +1057,21 @@ var IconPlaceholder = function IconPlaceholder(props) {
937
1057
  height: '50%'
938
1058
  });
939
1059
  }
1060
+
940
1061
  return React.createElement(Message_1.default, {
941
1062
  width: width,
942
1063
  height: height,
943
1064
  level: "warning",
944
- message: i18n_1._('No DataSource Connected')
1065
+ message: (0, i18n_1._)('No DataSource Connected')
945
1066
  });
946
1067
  };
1068
+
947
1069
  IconPlaceholder.propTypes = propTypes;
948
1070
  IconPlaceholder.defaultProps = {
949
1071
  width: '100%',
950
1072
  height: 250
951
1073
  };
952
- exports.default = FixedSizeContainer_1.default(IconPlaceholder);
953
-
954
- /***/ }),
955
-
956
- /***/ 32:
957
- /***/ (function(module, exports) {
958
-
959
- module.exports = require("@splunk/ui-utils/id");
1074
+ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
960
1075
 
961
1076
  /***/ }),
962
1077
 
@@ -967,21 +1082,27 @@ module.exports = require("@splunk/ui-utils/id");
967
1082
 
968
1083
 
969
1084
  var _defineProperty = __webpack_require__(7);
1085
+
970
1086
  Object.defineProperty(exports, "__esModule", {
971
1087
  value: true
972
1088
  });
973
1089
  exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1090
+
974
1091
  var T = __webpack_require__(0);
1092
+
975
1093
  var lodash_1 = __webpack_require__(3);
976
- var DataSource_1 = __webpack_require__(43);
1094
+
1095
+ var DataSource_1 = __webpack_require__(34);
1096
+
977
1097
  exports.SortParamsPropTypes = T.shape({
978
1098
  currentSortKey: T.string,
979
1099
  currentSortDir: T.oneOf(DataSource_1.validSortDirs),
980
1100
  onSort: T.func
981
1101
  });
1102
+
982
1103
  var getSortingParams = function getSortingParams(_ref) {
983
1104
  var requestParams = _ref.requestParams,
984
- onRequestParamsChange = _ref.onRequestParamsChange;
1105
+ onRequestParamsChange = _ref.onRequestParamsChange;
985
1106
  var currentSortKey;
986
1107
  var currentSortDir;
987
1108
  var nextSortDirMap = {
@@ -990,17 +1111,20 @@ var getSortingParams = function getSortingParams(_ref) {
990
1111
  none: 'asc'
991
1112
  };
992
1113
  var onSort;
1114
+
993
1115
  if (typeof onRequestParamsChange === 'function') {
994
- if (requestParams && lodash_1.has(requestParams, 'sort')) {
1116
+ if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
995
1117
  currentSortKey = Object.keys(requestParams.sort).shift();
996
1118
  currentSortDir = requestParams.sort[currentSortKey];
997
- }
998
- // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1119
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1120
+
1121
+
999
1122
  onSort = function onSort(e, _ref2) {
1000
1123
  var sortKey = _ref2.sortKey,
1001
- sortDir = _ref2.sortDir;
1124
+ sortDir = _ref2.sortDir;
1125
+
1002
1126
  if (typeof sortKey === 'string') {
1003
- var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1127
+ var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1004
1128
  onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
1005
1129
  offset: 0,
1006
1130
  sort: _defineProperty({}, sortKey, nextSortDir)
@@ -1010,12 +1134,14 @@ var getSortingParams = function getSortingParams(_ref) {
1010
1134
  }
1011
1135
  };
1012
1136
  }
1137
+
1013
1138
  return {
1014
1139
  currentSortKey: currentSortKey,
1015
1140
  currentSortDir: currentSortDir,
1016
1141
  onSort: onSort
1017
1142
  };
1018
1143
  };
1144
+
1019
1145
  exports.getSortingParams = getSortingParams;
1020
1146
 
1021
1147
  /***/ }),
@@ -1026,43 +1152,69 @@ exports.getSortingParams = getSortingParams;
1026
1152
  "use strict";
1027
1153
 
1028
1154
 
1155
+ Object.defineProperty(exports, "__esModule", {
1156
+ value: true
1157
+ });
1158
+ exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
1159
+ exports.validSortDirs = ['asc', 'desc', 'none'];
1160
+ exports.validSegmentationModes = ['none', 'inner'];
1161
+ exports.validOutputModes = ['json_cols', 'json'];
1162
+
1163
+ /***/ }),
1164
+
1165
+ /***/ 35:
1166
+ /***/ (function(module, exports, __webpack_require__) {
1167
+
1168
+ "use strict";
1169
+
1170
+
1029
1171
  Object.defineProperty(exports, "__esModule", {
1030
1172
  value: true
1031
1173
  });
1032
1174
  exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1175
+
1033
1176
  var T = __webpack_require__(0);
1177
+
1034
1178
  var lodash_1 = __webpack_require__(3);
1179
+
1035
1180
  exports.PaginatorParamsPropTypes = T.shape({
1036
1181
  isPaging: T.bool,
1037
1182
  current: T.number,
1038
1183
  totalPages: T.number,
1039
1184
  onChange: T.func
1040
1185
  });
1186
+
1041
1187
  var getPaginationParams = function getPaginationParams(_ref) {
1042
1188
  var requestParams = _ref.requestParams,
1043
- meta = _ref.meta,
1044
- onRequestParamsChange = _ref.onRequestParamsChange;
1189
+ meta = _ref.meta,
1190
+ onRequestParamsChange = _ref.onRequestParamsChange;
1045
1191
  var totalCount = meta && meta.totalCount || 0;
1046
1192
  var offset = requestParams && requestParams.offset || 0;
1047
1193
  var count = requestParams && requestParams.count;
1048
1194
  var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1049
1195
  var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1050
1196
  var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
1197
+
1051
1198
  var onChangeHandler = function onChangeHandler(e, _ref2) {
1052
1199
  var page = _ref2.page,
1053
- countArg = _ref2.count;
1054
- var newParams = lodash_1.cloneDeep(requestParams);
1200
+ countArg = _ref2.count;
1201
+ var newParams = (0, lodash_1.cloneDeep)(requestParams);
1202
+
1055
1203
  if (typeof countArg === 'number') {
1056
1204
  newParams.count = countArg;
1057
1205
  newParams.offset = 0;
1058
1206
  }
1207
+
1059
1208
  var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
1209
+
1060
1210
  if (typeof page === 'number' && page > 0) {
1061
1211
  newParams.count = pageCount;
1062
1212
  newParams.offset = (page - 1) * pageCount;
1063
1213
  }
1214
+
1064
1215
  onRequestParamsChange(newParams);
1065
1216
  };
1217
+
1066
1218
  return {
1067
1219
  isPaging: isPaging,
1068
1220
  current: current,
@@ -1070,11 +1222,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
1070
1222
  onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
1071
1223
  };
1072
1224
  };
1225
+
1073
1226
  exports.getPaginationParams = getPaginationParams;
1074
1227
 
1075
1228
  /***/ }),
1076
1229
 
1077
- /***/ 35:
1230
+ /***/ 36:
1078
1231
  /***/ (function(module, exports, __webpack_require__) {
1079
1232
 
1080
1233
  "use strict";
@@ -1085,6 +1238,7 @@ Object.defineProperty(exports, "__esModule", {
1085
1238
  });
1086
1239
  exports.VizCategory = void 0;
1087
1240
  var VizCategory;
1241
+
1088
1242
  (function (VizCategory) {
1089
1243
  VizCategory["SINGLE_VALUE"] = "Single Value";
1090
1244
  VizCategory["TRENDS"] = "Trends";
@@ -1102,67 +1256,96 @@ var VizCategory;
1102
1256
 
1103
1257
  /***/ }),
1104
1258
 
1105
- /***/ 36:
1259
+ /***/ 37:
1106
1260
  /***/ (function(module, exports, __webpack_require__) {
1107
1261
 
1108
1262
  "use strict";
1109
1263
 
1110
1264
 
1111
1265
  var _slicedToArray = __webpack_require__(17);
1266
+
1112
1267
  Object.defineProperty(exports, "__esModule", {
1113
1268
  value: true
1114
1269
  });
1270
+
1115
1271
  var React = __webpack_require__(1);
1272
+
1116
1273
  var lodash_1 = __webpack_require__(3);
1117
- var getSettingsFromThemedProps_1 = __webpack_require__(37);
1118
- var Options_1 = __webpack_require__(29);
1119
- var SanitizeProps_1 = __webpack_require__(38);
1120
- var TimezoneContext_1 = __webpack_require__(25);
1121
- var moment_1 = __webpack_require__(39);
1274
+
1275
+ var getSettingsFromThemedProps_1 = __webpack_require__(38);
1276
+
1277
+ var Options_1 = __webpack_require__(30);
1278
+
1279
+ var SanitizeProps_1 = __webpack_require__(39);
1280
+
1281
+ var TimezoneContext_1 = __webpack_require__(26);
1282
+
1283
+ var moment_1 = __webpack_require__(40);
1284
+
1122
1285
  var FeatureFlagContext_1 = __webpack_require__(21);
1286
+
1123
1287
  var styled_components_1 = __webpack_require__(4);
1124
- var hocUtils_1 = __webpack_require__(26);
1125
- var JSONSchemaUtils_1 = __webpack_require__(27);
1126
- var async_dynamic_options_evaluator_1 = __webpack_require__(40);
1127
- var id_1 = __webpack_require__(32);
1128
- var SplunkVisualization_1 = __webpack_require__(41);
1288
+
1289
+ var hocUtils_1 = __webpack_require__(27);
1290
+
1291
+ var JSONSchemaUtils_1 = __webpack_require__(28);
1292
+
1293
+ var async_dynamic_options_evaluator_1 = __webpack_require__(41);
1294
+
1295
+ var id_1 = __webpack_require__(25);
1296
+
1297
+ var SplunkVisualization_1 = __webpack_require__(42);
1298
+
1129
1299
  var VizBehavior_1 = __webpack_require__(6);
1300
+
1130
1301
  var getSorting_1 = __webpack_require__(33);
1131
- var getPagination_1 = __webpack_require__(34);
1302
+
1303
+ var getPagination_1 = __webpack_require__(35);
1304
+
1132
1305
  var useDeepMemo_1 = __webpack_require__(44);
1306
+
1133
1307
  var MissingPropsMessage_1 = __webpack_require__(45);
1308
+
1134
1309
  var withEditModeCover_1 = __webpack_require__(46);
1310
+
1135
1311
  var withPlaceholder_1 = __webpack_require__(47);
1136
1312
  /**
1137
1313
  * hoc that wraps a pure react visualization in a Dashboard visualization
1138
1314
  * @param {DashboardVizOpts} opts
1139
1315
  * @returns {HOC}
1140
1316
  */
1317
+
1318
+
1141
1319
  var withDashboardViz = function withDashboardViz(opts) {
1142
1320
  var ReactViz = opts.ReactViz,
1143
- vizConfig = opts.vizConfig,
1144
- _opts$computeVizProps = opts.computeVizProps,
1145
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1146
- disableEditModeCover = opts.disableEditModeCover,
1147
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1148
- var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
1149
- var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
1321
+ vizConfig = opts.vizConfig,
1322
+ _opts$computeVizProps = opts.computeVizProps,
1323
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1324
+ disableEditModeCover = opts.disableEditModeCover,
1325
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1326
+
1327
+ var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
1328
+ var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
1329
+
1150
1330
  var DashboardViz = function DashboardViz(props) {
1151
1331
  var _a;
1332
+
1152
1333
  var mode = props.mode,
1153
- hasEventHandlers = props.hasEventHandlers,
1154
- dataSources = props.dataSources,
1155
- options = props.options,
1156
- _props$context = props.context,
1157
- context = _props$context === void 0 ? {} : _props$context,
1158
- width = props.width,
1159
- height = props.height,
1160
- onComputedProps = props.onComputedProps,
1161
- onEventTrigger = props.onEventTrigger,
1162
- theme = props.theme,
1163
- onRequestParamsChange = props.onRequestParamsChange;
1334
+ hasEventHandlers = props.hasEventHandlers,
1335
+ dataSources = props.dataSources,
1336
+ options = props.options,
1337
+ _props$context = props.context,
1338
+ context = _props$context === void 0 ? {} : _props$context,
1339
+ width = props.width,
1340
+ height = props.height,
1341
+ onComputedProps = props.onComputedProps,
1342
+ onEventTrigger = props.onEventTrigger,
1343
+ theme = props.theme,
1344
+ onRequestParamsChange = props.onRequestParamsChange;
1345
+
1164
1346
  var _React$useContext = React.useContext(TimezoneContext_1.default),
1165
- serializedTimezone = _React$useContext.serializedTimezone;
1347
+ serializedTimezone = _React$useContext.serializedTimezone;
1348
+
1166
1349
  if (serializedTimezone) {
1167
1350
  /*
1168
1351
  @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
@@ -1176,44 +1359,58 @@ var withDashboardViz = function withDashboardViz(opts) {
1176
1359
  moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1177
1360
  }
1178
1361
  }
1362
+
1179
1363
  var themeFunc = function themeFunc(themeVar) {
1180
1364
  var _a, _b;
1365
+
1181
1366
  return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1182
1367
  };
1368
+
1183
1369
  var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1184
- var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
1185
- theme: theme
1186
- }),
1187
- currentThemeFamily = _getSettingsFromTheme.family,
1188
- currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
1189
- currentThemeDensity = _getSettingsFromTheme.density;
1370
+
1371
+ var _ref = (0, getSettingsFromThemedProps_1.default)({
1372
+ theme: theme
1373
+ }),
1374
+ currentThemeFamily = _ref.family,
1375
+ currentThemeColorScheme = _ref.colorScheme,
1376
+ currentThemeDensity = _ref.density;
1377
+
1190
1378
  var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1379
+
1191
1380
  var _React$useState = React.useState({}),
1192
- _React$useState2 = _slicedToArray(_React$useState, 2),
1193
- evaluatedOptionsAsync = _React$useState2[0],
1194
- setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1381
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1382
+ evaluatedOptionsAsync = _React$useState2[0],
1383
+ setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1384
+
1385
+
1195
1386
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
1196
- var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat(id_1.createGUID())),
1197
- _React$useState4 = _slicedToArray(_React$useState3, 1),
1198
- visualizationID = _React$useState4[0];
1387
+
1388
+ var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
1389
+ _React$useState4 = _slicedToArray(_React$useState3, 1),
1390
+ visualizationID = _React$useState4[0];
1391
+
1199
1392
  var _React$useState5 = React.useState({}),
1200
- _React$useState6 = _slicedToArray(_React$useState5, 2),
1201
- dataSourcesInState = _React$useState6[0],
1202
- setDataSourcesInState = _React$useState6[1];
1393
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
1394
+ dataSourcesInState = _React$useState6[0],
1395
+ setDataSourcesInState = _React$useState6[1];
1396
+
1203
1397
  var _React$useState7 = React.useState(),
1204
- _React$useState8 = _slicedToArray(_React$useState7, 2),
1205
- dataFramesInState = _React$useState8[0],
1206
- setDataFramesInState = _React$useState8[1];
1207
- var _React$useState9 = React.useState(Boolean(featureFlagContext && featureFlagContext.visualizations_useWebWorkersForDSL && typeof Worker !== 'undefined')),
1208
- _React$useState10 = _slicedToArray(_React$useState9, 2),
1209
- useAsyncEvaluatedOptions = _React$useState10[0],
1210
- setUseAsyncEvaluatedOptions = _React$useState10[1];
1211
- evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
1398
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
1399
+ dataFramesInState = _React$useState8[0],
1400
+ setDataFramesInState = _React$useState8[1];
1401
+
1402
+ var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
1403
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
1404
+ useAsyncEvaluatedOptions = _React$useState10[0],
1405
+ setUseAsyncEvaluatedOptions = _React$useState10[1];
1406
+
1407
+ var isMounted = React.useRef(true);
1408
+ evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
1212
1409
  try {
1213
1410
  if (useAsyncEvaluatedOptions) {
1214
1411
  var optionsToEvaluate = {
1215
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1216
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1412
+ context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
1413
+ options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
1217
1414
  };
1218
1415
  var asyncDynamicOptionsEvaluatorParams = {
1219
1416
  visualizationID: visualizationID,
@@ -1224,21 +1421,23 @@ var withDashboardViz = function withDashboardViz(opts) {
1224
1421
  };
1225
1422
  async_dynamic_options_evaluator_1.default.evaluate(asyncDynamicOptionsEvaluatorParams).then(function (results) {
1226
1423
  setEvaluatedOptionsAsync(results.results);
1227
- }).catch(function (e) {
1228
- // eslint-disable-next-line no-console
1229
- console.error("unexpected error evaluating options - async: ".concat(e.message));
1230
- setUseAsyncEvaluatedOptions(false);
1424
+ }).catch(function () {
1425
+ if (isMounted.current) {
1426
+ setUseAsyncEvaluatedOptions(false);
1427
+ }
1231
1428
  });
1232
1429
  } else {
1233
1430
  var dataFrames = dataFramesInState;
1431
+
1234
1432
  if (dataSources !== dataSourcesInState) {
1235
1433
  setDataSourcesInState(dataSources);
1236
1434
  dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
1237
1435
  setDataFramesInState(dataFrames);
1238
1436
  }
1437
+
1239
1438
  return Options_1.Options.evaluate({
1240
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1241
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1439
+ context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
1440
+ options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
1242
1441
  }, dataSources, themeFunc, dataFrames);
1243
1442
  }
1244
1443
  } catch (e) {
@@ -1246,67 +1445,76 @@ var withDashboardViz = function withDashboardViz(opts) {
1246
1445
  console.error("unexpected error evaluating options: ".concat(e.message));
1247
1446
  return {};
1248
1447
  }
1448
+
1249
1449
  return {};
1250
1450
  }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
1251
- var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
1252
- // trellis specific backgroundColor update for onComputedProps
1451
+ var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
1253
1452
  // if trellis is enabled following these three criteria - 1) trellis feature flag is enabled 2) vizConfig supports array has 'trellis' 3) option 'splitByLayout' is set to 'trellis
1254
1453
  // onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
1454
+
1255
1455
  var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
1256
1456
  var clonedEvaluatedOptions = evaluatedOptionsToUse;
1457
+
1257
1458
  if (isTrellisFeatureFlagOn && ((_a = vizConfig === null || vizConfig === void 0 ? void 0 : vizConfig.supports) === null || _a === void 0 ? void 0 : _a.includes(VizBehavior_1.VizBehavior.TRELLIS)) && (clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.splitByLayout) === VizBehavior_1.VizBehavior.TRELLIS) {
1258
1459
  clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
1259
1460
  backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
1260
1461
  });
1261
- }
1262
- // useEffect hook needs to be initialized before any early returns
1462
+ } // useEffect hook needs to be initialized before any early returns
1263
1463
  // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1464
+
1465
+
1264
1466
  React.useEffect(function () {
1265
1467
  onComputedProps(clonedEvaluatedOptions);
1266
1468
  });
1267
1469
  React.useEffect(function () {
1268
1470
  return function () {
1269
1471
  if (useAsyncEvaluatedOptions) {
1472
+ isMounted.current = false;
1270
1473
  async_dynamic_options_evaluator_1.default.reset(visualizationID);
1271
1474
  }
1272
- };
1273
- // eslint-disable-next-line react-hooks/exhaustive-deps
1274
- }, []);
1275
- // present warning message if any required props are missing
1475
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
1476
+ }, []); // present warning message if any required props are missing
1477
+
1276
1478
  var _vizConfig$requiredPr = vizConfig.requiredProps,
1277
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1278
- supports = vizConfig.supports;
1279
- var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptionsToUse);
1479
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1480
+ supports = vizConfig.supports;
1481
+ var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
1482
+
1280
1483
  if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && vizConfig.key !== 'splunk.singlevalue' // For SV missing props msg is not displayed if required props majorValue is missing, instead this will be handled from the component, instead handled within component
1281
1484
  ) {
1282
- return React.createElement(MissingPropsMessage_1.default, {
1283
- "data-test": "missing-props-message",
1284
- width: width,
1285
- height: height,
1286
- missingProps: missing,
1287
- backgroundColor: bgColorFromTheme
1288
- });
1289
- }
1290
- // events
1485
+ return React.createElement(MissingPropsMessage_1.default, {
1486
+ "data-test": "missing-props-message",
1487
+ width: width,
1488
+ height: height,
1489
+ missingProps: missing,
1490
+ backgroundColor: bgColorFromTheme
1491
+ });
1492
+ } // events
1493
+
1494
+
1291
1495
  var eventCallbackProps = {};
1496
+
1292
1497
  if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1293
1498
  var supportedEvents = vizConfig.events;
1294
1499
  Object.keys(supportedEvents).forEach(function (eventName) {
1295
- var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
1296
- eventCallbackProps[eventCallbackPropName] = null;
1297
- // todo: refactor single value and single value icon to send payload from viz
1500
+ var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
1501
+ eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
1298
1502
  // then remove these lines
1503
+
1299
1504
  var payloadKeys = supportedEvents[eventName].payloadKeys;
1300
1505
  var payload = {};
1506
+
1301
1507
  if (Array.isArray(payloadKeys) && payloadKeys.length) {
1302
1508
  payloadKeys.forEach(function (p) {
1303
1509
  payload[p] = evaluatedOptionsToUse[p];
1304
1510
  });
1305
1511
  }
1512
+
1306
1513
  eventCallbackProps[eventCallbackPropName] = function (ev) {
1307
1514
  if (ev && ev.payload) {
1308
1515
  payload = ev.payload;
1309
1516
  }
1517
+
1310
1518
  return onEventTrigger({
1311
1519
  originalEvent: ev,
1312
1520
  payload: payload,
@@ -1314,8 +1522,9 @@ var withDashboardViz = function withDashboardViz(opts) {
1314
1522
  });
1315
1523
  };
1316
1524
  });
1317
- }
1318
- // compute pure viz props which are not from options
1525
+ } // compute pure viz props which are not from options
1526
+
1527
+
1319
1528
  var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
1320
1529
  themeFunc: themeFunc
1321
1530
  }));
@@ -1333,21 +1542,25 @@ var withDashboardViz = function withDashboardViz(opts) {
1333
1542
  * In future, we could automatically detect which all datasources are being used
1334
1543
  * and bind those magically to pagination/sorting behavior.
1335
1544
  */
1545
+
1336
1546
  var dataSourceMetadata = {};
1337
1547
  var OptionKey = 'paginateDataSourceKey';
1338
- var paginateDataSourceKey = lodash_1.has(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
1339
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
1340
- var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1341
- var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
1548
+ var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
1549
+
1550
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
1551
+ var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1552
+ var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
1553
+
1342
1554
  var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1343
1555
  return onRequestParamsChange(paginateDataSourceKey, payload);
1344
1556
  };
1345
- var sortParams = getSorting_1.getSortingParams({
1557
+
1558
+ var sortParams = (0, getSorting_1.getSortingParams)({
1346
1559
  requestParams: requestParams,
1347
1560
  meta: meta,
1348
1561
  onRequestParamsChange: handleRequestParamsChange
1349
1562
  });
1350
- var paginatorParams = getPagination_1.getPaginationParams({
1563
+ var paginatorParams = (0, getPagination_1.getPaginationParams)({
1351
1564
  requestParams: requestParams,
1352
1565
  meta: meta,
1353
1566
  onRequestParamsChange: handleRequestParamsChange
@@ -1356,115 +1569,132 @@ var withDashboardViz = function withDashboardViz(opts) {
1356
1569
  sortParams: sortParams,
1357
1570
  paginatorParams: paginatorParams
1358
1571
  };
1359
- }
1360
- // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1572
+ } // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1573
+
1574
+
1361
1575
  if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
1362
1576
  return null;
1363
1577
  }
1578
+
1364
1579
  return React.createElement(SanitizedReactViz, Object.assign({
1365
1580
  mode: mode,
1366
1581
  width: width,
1367
1582
  height: height
1368
1583
  }, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
1369
1584
  };
1585
+
1370
1586
  DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1371
1587
  DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1372
1588
  // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1373
1589
  theme: {}
1374
- });
1375
- // attach viz config
1376
- DashboardViz.config = vizConfig;
1377
- // @ts-ignore: TODO fix sc upgrade TS issues
1378
- return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
1590
+ }); // attach viz config
1591
+
1592
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1593
+
1594
+ return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
1379
1595
  };
1596
+
1380
1597
  exports.default = withDashboardViz;
1381
1598
 
1382
1599
  /***/ }),
1383
1600
 
1384
- /***/ 37:
1601
+ /***/ 38:
1385
1602
  /***/ (function(module, exports) {
1386
1603
 
1387
1604
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1388
1605
 
1389
1606
  /***/ }),
1390
1607
 
1391
- /***/ 38:
1608
+ /***/ 39:
1392
1609
  /***/ (function(module, exports) {
1393
1610
 
1394
1611
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1395
1612
 
1396
1613
  /***/ }),
1397
1614
 
1398
- /***/ 39:
1615
+ /***/ 4:
1399
1616
  /***/ (function(module, exports) {
1400
1617
 
1401
- module.exports = require("@splunk/moment");
1618
+ module.exports = require("styled-components");
1402
1619
 
1403
1620
  /***/ }),
1404
1621
 
1405
- /***/ 4:
1622
+ /***/ 40:
1406
1623
  /***/ (function(module, exports) {
1407
1624
 
1408
- module.exports = require("styled-components");
1625
+ module.exports = require("@splunk/moment");
1409
1626
 
1410
1627
  /***/ }),
1411
1628
 
1412
- /***/ 40:
1629
+ /***/ 41:
1413
1630
  /***/ (function(module, exports) {
1414
1631
 
1415
1632
  module.exports = require("@splunk/async-dynamic-options-evaluator");
1416
1633
 
1417
1634
  /***/ }),
1418
1635
 
1419
- /***/ 41:
1636
+ /***/ 42:
1420
1637
  /***/ (function(module, exports, __webpack_require__) {
1421
1638
 
1422
1639
  "use strict";
1423
1640
 
1424
1641
 
1425
1642
  var _classCallCheck = __webpack_require__(9);
1643
+
1426
1644
  Object.defineProperty(exports, "__esModule", {
1427
1645
  value: true
1428
1646
  });
1429
1647
  exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1430
1648
  /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1649
+
1431
1650
  var T = __webpack_require__(0);
1651
+
1432
1652
  var lodash_1 = __webpack_require__(3);
1433
- var VizActionHandler_1 = __webpack_require__(42);
1434
- // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1653
+
1654
+ var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1655
+
1656
+
1435
1657
  exports.INITIAL_WIDTH = 250;
1436
1658
  exports.INITIAL_HEIGHT = 250;
1437
1659
  /**
1438
1660
  * A Splunk visualization
1439
1661
  */
1662
+
1440
1663
  var SplunkVisualization = function SplunkVisualization() {
1441
1664
  _classCallCheck(this, SplunkVisualization);
1442
1665
  };
1666
+
1443
1667
  SplunkVisualization.propTypes = {
1444
1668
  /**
1445
1669
  * display mode
1446
1670
  */
1447
1671
  mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1672
+
1448
1673
  /**
1449
1674
  * width in pixel or string, defaults to 100%
1450
1675
  */
1451
1676
  width: T.oneOfType([T.string, T.number]).isRequired,
1677
+
1452
1678
  /**
1453
1679
  * height in pixel or string
1454
1680
  */
1455
1681
  height: T.oneOfType([T.string, T.number]).isRequired,
1682
+
1456
1683
  /**
1457
1684
  * visualization context used for dynamic option evaluation
1458
1685
  */
1459
1686
  context: T.object,
1687
+
1460
1688
  /**
1461
1689
  * visualization formatting options
1462
1690
  */
1463
1691
  options: T.object,
1692
+
1464
1693
  /**
1465
1694
  * A callback to update formatting options
1466
1695
  */
1467
1696
  onOptionsChange: T.func,
1697
+
1468
1698
  /**
1469
1699
  * datasource state which include data and request params, object key indicate the datasource type.
1470
1700
  */
@@ -1473,6 +1703,7 @@ SplunkVisualization.propTypes = {
1473
1703
  * current request params
1474
1704
  */
1475
1705
  requestParams: T.object,
1706
+
1476
1707
  /**
1477
1708
  * current dataset
1478
1709
  */
@@ -1480,6 +1711,7 @@ SplunkVisualization.propTypes = {
1480
1711
  fields: T.array,
1481
1712
  columns: T.array
1482
1713
  }),
1714
+
1483
1715
  /**
1484
1716
  * error
1485
1717
  */
@@ -1487,29 +1719,35 @@ SplunkVisualization.propTypes = {
1487
1719
  level: T.string,
1488
1720
  message: T.string
1489
1721
  }),
1722
+
1490
1723
  /**
1491
1724
  * meta data that came with the dataset
1492
1725
  */
1493
1726
  meta: T.object
1494
1727
  })),
1728
+
1495
1729
  /**
1496
1730
  * A callback to trigger event
1497
1731
  */
1498
1732
  onEventTrigger: T.func,
1733
+
1499
1734
  /**
1500
1735
  * Inform viz if there are handlers listening to events
1501
1736
  */
1502
1737
  hasEventHandlers: T.bool,
1738
+
1503
1739
  /**
1504
1740
  * A callback to communicate computed props to a consumer
1505
1741
  */
1506
1742
  onComputedProps: T.func,
1743
+
1507
1744
  /**
1508
1745
  * A callback to obtain visualization api
1509
1746
  */
1510
1747
  vizActionHandlerRef: T.func,
1511
1748
  loading: T.bool,
1512
1749
  theme: T.object,
1750
+
1513
1751
  /**
1514
1752
  * A callback to request new data with updated request params
1515
1753
  */
@@ -1518,6 +1756,7 @@ SplunkVisualization.propTypes = {
1518
1756
  /**
1519
1757
  *
1520
1758
  */
1759
+
1521
1760
  SplunkVisualization.defaultProps = {
1522
1761
  // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1523
1762
  width: '100%',
@@ -1546,26 +1785,29 @@ exports.default = SplunkVisualization;
1546
1785
 
1547
1786
  /***/ }),
1548
1787
 
1549
- /***/ 42:
1788
+ /***/ 43:
1550
1789
  /***/ (function(module, exports, __webpack_require__) {
1551
1790
 
1552
1791
  "use strict";
1553
1792
 
1554
1793
 
1555
1794
  var _classCallCheck = __webpack_require__(9);
1795
+
1556
1796
  var _createClass = __webpack_require__(18);
1797
+
1557
1798
  Object.defineProperty(exports, "__esModule", {
1558
1799
  value: true
1559
1800
  });
1560
1801
  exports.DefaultVizActionHandler = void 0;
1802
+
1561
1803
  var DefaultVizActionHandler = /*#__PURE__*/function () {
1562
1804
  function DefaultVizActionHandler() {
1563
1805
  _classCallCheck(this, DefaultVizActionHandler);
1564
1806
  }
1807
+
1565
1808
  _createClass(DefaultVizActionHandler, [{
1566
1809
  key: "focus",
1567
- value: function focus() {
1568
- // noop
1810
+ value: function focus() {// noop
1569
1811
  }
1570
1812
  }, {
1571
1813
  key: "snapshot",
@@ -1573,23 +1815,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
1573
1815
  return null; // noop
1574
1816
  }
1575
1817
  }]);
1818
+
1576
1819
  return DefaultVizActionHandler;
1577
1820
  }();
1578
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
1579
-
1580
- /***/ }),
1581
-
1582
- /***/ 43:
1583
- /***/ (function(module, exports, __webpack_require__) {
1584
1821
 
1585
- "use strict";
1586
-
1587
-
1588
- Object.defineProperty(exports, "__esModule", {
1589
- value: true
1590
- });
1591
- exports.validSortDirs = void 0;
1592
- exports.validSortDirs = ['asc', 'desc', 'none'];
1822
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1593
1823
 
1594
1824
  /***/ }),
1595
1825
 
@@ -1603,7 +1833,9 @@ Object.defineProperty(exports, "__esModule", {
1603
1833
  value: true
1604
1834
  });
1605
1835
  exports.useDeepMemo = void 0;
1836
+
1606
1837
  var react_1 = __webpack_require__(1);
1838
+
1607
1839
  var lodash_1 = __webpack_require__(3);
1608
1840
  /**
1609
1841
  * This hook evaluates and stores the result of a passed function and only
@@ -1618,16 +1850,21 @@ var lodash_1 = __webpack_require__(3);
1618
1850
  * @param fn the function to be executed and
1619
1851
  * @param dependencies an array of dependencies
1620
1852
  */
1853
+
1854
+
1621
1855
  var useDeepMemo = function useDeepMemo(fn, dependencies) {
1622
- var ref = react_1.useRef();
1623
- if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
1856
+ var ref = (0, react_1.useRef)();
1857
+
1858
+ if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
1624
1859
  ref.current = {
1625
1860
  dependencies: dependencies,
1626
1861
  value: fn()
1627
1862
  };
1628
1863
  }
1864
+
1629
1865
  return ref.current.value;
1630
1866
  };
1867
+
1631
1868
  exports.useDeepMemo = useDeepMemo;
1632
1869
 
1633
1870
  /***/ }),
@@ -1642,19 +1879,27 @@ Object.defineProperty(exports, "__esModule", {
1642
1879
  value: true
1643
1880
  });
1644
1881
  exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1882
+
1645
1883
  var React = __webpack_require__(1);
1884
+
1646
1885
  var T = __webpack_require__(0);
1886
+
1647
1887
  var i18n_1 = __webpack_require__(2);
1888
+
1648
1889
  var Message_1 = __webpack_require__(10);
1890
+
1649
1891
  var FixedSizeContainer_1 = __webpack_require__(13);
1650
1892
  /**
1651
1893
  * @method isMissing
1652
1894
  * @param {any} v
1653
1895
  * @returns {boolean} true if the input value === null or undefined
1654
1896
  */
1897
+
1898
+
1655
1899
  var isMissing = function isMissing(v) {
1656
1900
  return v === null || v === undefined;
1657
1901
  };
1902
+
1658
1903
  exports.isMissing = isMissing;
1659
1904
  /**
1660
1905
  * @method misskingKeys
@@ -1662,11 +1907,13 @@ exports.isMissing = isMissing;
1662
1907
  * @param {object} target
1663
1908
  * @returns {string[]} the keys of missing required props
1664
1909
  */
1910
+
1665
1911
  var missingKeys = function missingKeys(keys, target) {
1666
1912
  return keys.filter(function (k) {
1667
- return exports.isMissing(target[k]);
1913
+ return (0, exports.isMissing)(target[k]);
1668
1914
  });
1669
1915
  };
1916
+
1670
1917
  exports.missingKeys = missingKeys;
1671
1918
  var propTypes = {
1672
1919
  width: T.oneOfType([T.string, T.number]),
@@ -1680,24 +1927,26 @@ var propTypes = {
1680
1927
  * @param {MissingPropsProps} props
1681
1928
  * @returns {React.ReactElement}
1682
1929
  */
1930
+
1683
1931
  var MissingPropsMessage = function MissingPropsMessage(props) {
1684
1932
  var width = props.width,
1685
- height = props.height,
1686
- missingProps = props.missingProps;
1933
+ height = props.height,
1934
+ missingProps = props.missingProps;
1687
1935
  return React.createElement(Message_1.default, {
1688
1936
  "data-test": "message",
1689
1937
  width: width,
1690
1938
  height: height,
1691
- message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
1939
+ message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
1692
1940
  });
1693
1941
  };
1942
+
1694
1943
  exports.MissingPropsMessage = MissingPropsMessage;
1695
1944
  exports.MissingPropsMessage.propTypes = propTypes;
1696
1945
  exports.MissingPropsMessage.defaultProps = {
1697
1946
  width: '100%',
1698
1947
  height: 250
1699
1948
  };
1700
- exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
1949
+ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage);
1701
1950
 
1702
1951
  /***/ }),
1703
1952
 
@@ -1710,15 +1959,19 @@ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
1710
1959
  Object.defineProperty(exports, "__esModule", {
1711
1960
  value: true
1712
1961
  });
1962
+
1713
1963
  var React = __webpack_require__(1);
1964
+
1714
1965
  var styled_components_1 = __webpack_require__(4);
1966
+
1715
1967
  var hocUtils_1 = __webpack_require__(15);
1968
+
1716
1969
  var Cover = styled_components_1.default.div.withConfig({
1717
1970
  displayName: "withEditModeCover__Cover",
1718
1971
  componentId: "sc-1gsbnxb-0"
1719
1972
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1720
1973
  var Blocker = styled_components_1.default.div.attrs({
1721
- 'data-splunk-visualization-version': "25.13.1 - ea48ec41e"
1974
+ 'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
1722
1975
  }).withConfig({
1723
1976
  displayName: "withEditModeCover__Blocker",
1724
1977
  componentId: "sc-1gsbnxb-1"
@@ -1729,6 +1982,7 @@ var Blocker = styled_components_1.default.div.attrs({
1729
1982
  * @param {ExtendedDashViz} Visualization
1730
1983
  * @returns {ExtendedDashViz} Wrapper
1731
1984
  */
1985
+
1732
1986
  var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1733
1987
  var Wrapper = function Wrapper(props) {
1734
1988
  var mode = props.mode;
@@ -1737,12 +1991,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
1737
1991
  "data-test": "edit-mode-cover"
1738
1992
  }));
1739
1993
  };
1740
- hocUtils_1.extendStaticWrapperProps({
1994
+
1995
+ (0, hocUtils_1.extendStaticWrapperProps)({
1741
1996
  Wrapper: Wrapper,
1742
1997
  Visualization: Visualization
1743
1998
  });
1744
1999
  return Wrapper;
1745
2000
  };
2001
+
1746
2002
  exports.default = withEditModeCover;
1747
2003
 
1748
2004
  /***/ }),
@@ -1756,27 +2012,37 @@ exports.default = withEditModeCover;
1756
2012
  Object.defineProperty(exports, "__esModule", {
1757
2013
  value: true
1758
2014
  });
2015
+
1759
2016
  var React = __webpack_require__(1);
2017
+
1760
2018
  var colorUtils_1 = __webpack_require__(12);
2019
+
1761
2020
  var variables_1 = __webpack_require__(11);
1762
- var IconPlaceholder_1 = __webpack_require__(31);
2021
+
2022
+ var IconPlaceholder_1 = __webpack_require__(32);
2023
+
1763
2024
  var VizBehavior_1 = __webpack_require__(6);
2025
+
1764
2026
  var hocUtils_1 = __webpack_require__(15);
2027
+
1765
2028
  var withPlaceholder = function withPlaceholder(Visualization) {
1766
2029
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
1767
2030
  var config = Visualization.config;
1768
2031
  var themes = config.themes;
2032
+
1769
2033
  var Wrapper = function Wrapper(props) {
1770
2034
  var _a, _b;
2035
+
1771
2036
  var dataSources = props.dataSources,
1772
- loading = props.loading,
1773
- options = props.options,
1774
- height = props.height,
1775
- width = props.width;
2037
+ loading = props.loading,
2038
+ options = props.options,
2039
+ height = props.height,
2040
+ width = props.width;
1776
2041
  var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
1777
- var bgColorFromTheme = colorUtils_1.isColor(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
2042
+ var bgColorFromTheme = (0, colorUtils_1.isColor)(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
1778
2043
  var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
1779
2044
  var iconColor = variables_1.default.contentColorActive(props);
2045
+
1780
2046
  if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
1781
2047
  return React.createElement(IconPlaceholder_1.default, {
1782
2048
  "data-test": "icon-placeholder",
@@ -1787,14 +2053,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
1787
2053
  iconColor: iconColor
1788
2054
  });
1789
2055
  }
2056
+
1790
2057
  return React.createElement(Visualization, Object.assign({}, props));
1791
2058
  };
1792
- hocUtils_1.extendStaticWrapperProps({
2059
+
2060
+ (0, hocUtils_1.extendStaticWrapperProps)({
1793
2061
  Wrapper: Wrapper,
1794
2062
  Visualization: Visualization
1795
2063
  });
1796
2064
  return Wrapper;
1797
2065
  };
2066
+
1798
2067
  exports.default = withPlaceholder;
1799
2068
 
1800
2069
  /***/ }),
@@ -1817,6 +2086,7 @@ Object.defineProperty(exports, "__esModule", {
1817
2086
  });
1818
2087
  exports.VizBehavior = void 0;
1819
2088
  var VizBehavior;
2089
+
1820
2090
  (function (VizBehavior) {
1821
2091
  /**
1822
2092
  * Dynamic Options Behavior.
@@ -1836,6 +2106,7 @@ var VizBehavior;
1836
2106
  * missing.
1837
2107
  * @type {string}
1838
2108
  */
2109
+
1839
2110
  VizBehavior["PLACEHOLDER"] = "placeholder";
1840
2111
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
1841
2112
  VizBehavior["TRELLIS"] = "trellis";