@splunk/visualizations 26.0.0 → 26.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/Area.config.js +103 -19
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +646 -243
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +105 -21
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +653 -237
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +95 -21
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +635 -229
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +66 -15
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +589 -211
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +104 -19
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +666 -239
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +83 -18
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +444 -156
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +101 -19
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +792 -322
  28. package/Events.js.map +1 -1
  29. package/FillerGauge.config.js +97 -28
  30. package/FillerGauge.config.js.map +1 -1
  31. package/FillerGauge.js +786 -390
  32. package/FillerGauge.js.map +1 -1
  33. package/Image.config.js +63 -19
  34. package/Image.config.js.map +1 -1
  35. package/Image.js +439 -164
  36. package/Image.js.map +1 -1
  37. package/Line.config.js +107 -23
  38. package/Line.config.js.map +1 -1
  39. package/Line.js +841 -456
  40. package/Line.js.map +1 -1
  41. package/LinkGraph.config.js +73 -23
  42. package/LinkGraph.config.js.map +1 -1
  43. package/LinkGraph.js +653 -230
  44. package/LinkGraph.js.map +1 -1
  45. package/MIGRATION.md +1082 -0
  46. package/Map.config.js +244 -99
  47. package/Map.config.js.map +1 -1
  48. package/Map.js +1223 -612
  49. package/Map.js.map +1 -1
  50. package/Markdown.config.js +71 -21
  51. package/Markdown.config.js.map +1 -1
  52. package/Markdown.js +477 -202
  53. package/Markdown.js.map +1 -1
  54. package/MarkerGauge.config.js +80 -22
  55. package/MarkerGauge.config.js.map +1 -1
  56. package/MarkerGauge.js +819 -418
  57. package/MarkerGauge.js.map +1 -1
  58. package/ParallelCoordinates.config.js +73 -19
  59. package/ParallelCoordinates.config.js.map +1 -1
  60. package/ParallelCoordinates.js +870 -491
  61. package/ParallelCoordinates.js.map +1 -1
  62. package/Pie.config.js +76 -23
  63. package/Pie.config.js.map +1 -1
  64. package/Pie.js +643 -233
  65. package/Pie.js.map +1 -1
  66. package/Punchcard.config.js +82 -30
  67. package/Punchcard.config.js.map +1 -1
  68. package/Punchcard.js +863 -387
  69. package/Punchcard.js.map +1 -1
  70. package/Rectangle.config.js +86 -20
  71. package/Rectangle.config.js.map +1 -1
  72. package/Rectangle.js +449 -159
  73. package/Rectangle.js.map +1 -1
  74. package/Sankey.config.js +85 -23
  75. package/Sankey.config.js.map +1 -1
  76. package/Sankey.js +895 -349
  77. package/Sankey.js.map +1 -1
  78. package/Scatter.config.js +97 -23
  79. package/Scatter.config.js.map +1 -1
  80. package/Scatter.js +639 -234
  81. package/Scatter.js.map +1 -1
  82. package/SingleValue.config.js +95 -25
  83. package/SingleValue.config.js.map +1 -1
  84. package/SingleValue.js +1198 -656
  85. package/SingleValue.js.map +1 -1
  86. package/SingleValueBasic.js +287 -226
  87. package/SingleValueBasic.js.map +1 -1
  88. package/SingleValueIcon.config.js +93 -23
  89. package/SingleValueIcon.config.js.map +1 -1
  90. package/SingleValueIcon.js +991 -522
  91. package/SingleValueIcon.js.map +1 -1
  92. package/SingleValueRadial.config.js +100 -27
  93. package/SingleValueRadial.config.js.map +1 -1
  94. package/SingleValueRadial.js +1185 -624
  95. package/SingleValueRadial.js.map +1 -1
  96. package/SparkLine.js +127 -68
  97. package/SparkLine.js.map +1 -1
  98. package/Table.config.js +74 -21
  99. package/Table.config.js.map +1 -1
  100. package/Table.js +827 -329
  101. package/Table.js.map +1 -1
  102. package/common/Charting.js +152 -69
  103. package/common/Charting.js.map +1 -1
  104. package/common/ChartingApi.js +25 -14
  105. package/common/ChartingApi.js.map +1 -1
  106. package/common/DocExampleWithVizSandbox.js +530 -0
  107. package/common/DocExampleWithVizSandbox.js.map +1 -0
  108. package/common/EventsDoc.js +139 -104
  109. package/common/EventsDoc.js.map +1 -1
  110. package/common/GaugeMajorTicks.js +79 -69
  111. package/common/GaugeMajorTicks.js.map +1 -1
  112. package/common/GaugeValueMarker.js +54 -45
  113. package/common/GaugeValueMarker.js.map +1 -1
  114. package/common/OptionsDoc.js +178 -87
  115. package/common/OptionsDoc.js.map +1 -1
  116. package/common/OverviewDoc.js +530 -68
  117. package/common/OverviewDoc.js.map +1 -1
  118. package/common/SplunkVisualization.js +47 -20
  119. package/common/SplunkVisualization.js.map +1 -1
  120. package/common/SplunkVisualizationApi.js +15 -9
  121. package/common/SplunkVisualizationApi.js.map +1 -1
  122. package/common/ThemesDoc.js +57 -44
  123. package/common/ThemesDoc.js.map +1 -1
  124. package/common/chartingUtils.js +52 -20
  125. package/common/chartingUtils.js.map +1 -1
  126. package/common/docUtils.js +139 -7
  127. package/common/docUtils.js.map +1 -1
  128. package/common/gaugeUtils.js +185 -102
  129. package/common/gaugeUtils.js.map +1 -1
  130. package/common/shapeUtils.js +28 -16
  131. package/common/shapeUtils.js.map +1 -1
  132. package/common/utils/configUtils.js +50 -15
  133. package/common/utils/configUtils.js.map +1 -1
  134. package/common/utils/dataUtils.js +8 -3
  135. package/common/utils/dataUtils.js.map +1 -1
  136. package/common/utils/hocUtils.js +4 -2
  137. package/common/utils/hocUtils.js.map +1 -1
  138. package/common/utils/layoutUtils.js +2 -1
  139. package/common/utils/layoutUtils.js.map +1 -1
  140. package/common/utils/mapUtils.js +288 -128
  141. package/common/utils/mapUtils.js.map +1 -1
  142. package/common/utils/singleValueUtils.js +242 -197
  143. package/common/utils/singleValueUtils.js.map +1 -1
  144. package/common/utils/testHelper.js +10 -1
  145. package/common/utils/testHelper.js.map +1 -1
  146. package/common/utils/trellisUtils.js +62 -1
  147. package/common/utils/trellisUtils.js.map +1 -1
  148. package/common/utils/urlUtils.js +3 -1
  149. package/common/utils/urlUtils.js.map +1 -1
  150. package/common/withDashboardViz.js +389 -192
  151. package/common/withDashboardViz.js.map +1 -1
  152. package/package.json +18 -26
package/Image.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -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 = 220);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 221);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -136,11 +136,17 @@ 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 {
@@ -153,11 +159,11 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
153
159
  componentId: "sc-1yhgpod-0"
154
160
  })(["position:relative;background-color:", "};"], function (props) {
155
161
  return (0, 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
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
169
  width: (0, style_1.toPx)(width)
@@ -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": "26.0.0 - 2f7458907",
205
+ "data-splunk-visualization-version": "26.1.1 - b6df0a015",
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,6 +259,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
247
259
  }
248
260
  });
249
261
  };
262
+
250
263
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
251
264
 
252
265
  /***/ }),
@@ -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);
298
+
278
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__(221);
304
+
305
+ var config_1 = __webpack_require__(222);
306
+
282
307
  exports.config = config_1.default;
283
- var withDashboardViz_1 = __webpack_require__(36);
284
- var ImageApi_1 = __webpack_require__(222);
308
+
309
+ var withDashboardViz_1 = __webpack_require__(37);
310
+
311
+ var ImageApi_1 = __webpack_require__(223);
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 {
@@ -297,19 +325,25 @@ var Container = styled_components_1.default.div.attrs(function () {
297
325
  }, function (props) {
298
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
  }
343
+
311
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",
@@ -317,10 +351,12 @@ var StyledImage = styled_components_1.default.img.withConfig({
317
351
  })(["display:block;", ";"], function (props) {
318
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"]);
357
+ title = _a.title,
358
+ otherOptions = __rest(_a, ["visualizationApiRef", "title"]);
359
+
324
360
  var options = (0, lodash_1.chain)(otherOptions).pick(validOptions).value();
325
361
  return {
326
362
  options: options,
@@ -328,16 +364,17 @@ var computeVizProps = function computeVizProps(_a) {
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: {
@@ -377,6 +414,7 @@ var ImageVisualization = function ImageVisualization(_ref) {
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]),
@@ -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
677
  var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
613
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,6 +692,7 @@ 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
697
  return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
631
698
  return {
@@ -634,6 +701,7 @@ function generatePrecisionValues(numPrecisionValues) {
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
- /***/ 220:
734
+ /***/ 221:
664
735
  /***/ (function(module, exports, __webpack_require__) {
665
736
 
666
737
  "use strict";
@@ -669,6 +740,7 @@ module.exports = require("@splunk/visualization-context/FeatureFlagContext");
669
740
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
670
741
  if (k2 === undefined) k2 = k;
671
742
  var desc = Object.getOwnPropertyDescriptor(m, k);
743
+
672
744
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
673
745
  desc = {
674
746
  enumerable: true,
@@ -677,22 +749,28 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
677
749
  }
678
750
  };
679
751
  }
752
+
680
753
  Object.defineProperty(o, k2, desc);
681
754
  } : function (o, m, k, k2) {
682
755
  if (k2 === undefined) k2 = k;
683
756
  o[k2] = m[k];
684
757
  });
758
+
685
759
  var __exportStar = this && this.__exportStar || function (m, exports) {
686
760
  for (var p in m) {
687
761
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
688
762
  }
689
763
  };
764
+
690
765
  Object.defineProperty(exports, "__esModule", {
691
766
  value: true
692
767
  });
693
768
  exports.default = void 0;
769
+
694
770
  __exportStar(__webpack_require__(153), exports);
771
+
695
772
  var Image_1 = __webpack_require__(153);
773
+
696
774
  Object.defineProperty(exports, "default", {
697
775
  enumerable: true,
698
776
  get: function get() {
@@ -702,7 +780,7 @@ Object.defineProperty(exports, "default", {
702
780
 
703
781
  /***/ }),
704
782
 
705
- /***/ 221:
783
+ /***/ 222:
706
784
  /***/ (function(module, exports, __webpack_require__) {
707
785
 
708
786
  "use strict";
@@ -711,15 +789,20 @@ Object.defineProperty(exports, "default", {
711
789
  Object.defineProperty(exports, "__esModule", {
712
790
  value: true
713
791
  });
792
+
714
793
  var i18n_1 = __webpack_require__(2);
794
+
715
795
  var visualization_icons_1 = __webpack_require__(52);
796
+
716
797
  var VizBehavior_1 = __webpack_require__(6);
717
- var VizCategory_1 = __webpack_require__(35);
798
+
799
+ var VizCategory_1 = __webpack_require__(36);
800
+
718
801
  var configUtils_1 = __webpack_require__(20);
802
+
719
803
  var dataContract = {
720
804
  requiredDataSources: [],
721
- optionalDataSources: [
722
- // 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
723
806
  // {
724
807
  // name: 'annotation',
725
808
  // description: 'DataSource that populate event annotations',
@@ -763,16 +846,19 @@ var themes = {};
763
846
  /**
764
847
  * visualization configuration
765
848
  */
849
+
766
850
  var config = {
767
851
  /**
768
852
  * unique viz key
769
853
  */
770
854
  key: 'splunk.image',
855
+
771
856
  /**
772
857
  * viz name
773
858
  */
774
859
  name: (0, i18n_1._)('Image'),
775
860
  category: VizCategory_1.VizCategory.MISC,
861
+
776
862
  /**
777
863
  * viz icon
778
864
  */
@@ -794,37 +880,47 @@ exports.default = (0, configUtils_1.enhanceConfig)(config);
794
880
 
795
881
  /***/ }),
796
882
 
797
- /***/ 222:
883
+ /***/ 223:
798
884
  /***/ (function(module, exports, __webpack_require__) {
799
885
 
800
886
  "use strict";
801
887
 
802
888
 
803
889
  var _classCallCheck = __webpack_require__(9);
890
+
804
891
  var _createClass = __webpack_require__(18);
892
+
805
893
  Object.defineProperty(exports, "__esModule", {
806
894
  value: true
807
895
  });
896
+
808
897
  var lodash_1 = __webpack_require__(3);
898
+
809
899
  var RemoteImage_1 = __webpack_require__(154);
810
900
  /**
811
901
  * Image Api
812
902
  */
903
+
904
+
813
905
  var ImageApi = /*#__PURE__*/function () {
814
906
  function ImageApi(viz) {
815
907
  _classCallCheck(this, ImageApi);
908
+
816
909
  this.viz = viz;
817
910
  }
818
911
  /**
819
912
  * put focus on the visualization
820
913
  */
821
914
  // eslint-disable-next-line class-methods-use-this
915
+
916
+
822
917
  _createClass(ImageApi, [{
823
918
  key: "focus",
824
919
  value: function focus() {}
825
920
  /**
826
921
  * return snapshot of that includes inlined image
827
922
  */
923
+
828
924
  }, {
829
925
  key: "snapshot",
830
926
  value: function snapshot() {
@@ -837,8 +933,10 @@ var ImageApi = /*#__PURE__*/function () {
837
933
  };
838
934
  }
839
935
  }]);
936
+
840
937
  return ImageApi;
841
938
  }();
939
+
842
940
  exports.default = ImageApi;
843
941
 
844
942
  /***/ }),
@@ -895,11 +993,17 @@ Object.defineProperty(exports, "__esModule", {
895
993
  value: true
896
994
  });
897
995
  exports.shouldShowIconPlaceholder = void 0;
996
+
898
997
  var React = __webpack_require__(1);
998
+
899
999
  var T = __webpack_require__(0);
1000
+
900
1001
  var lodash_1 = __webpack_require__(3);
1002
+
901
1003
  var i18n_1 = __webpack_require__(2);
1004
+
902
1005
  var Message_1 = __webpack_require__(10);
1006
+
903
1007
  var FixedSizeContainer_1 = __webpack_require__(13);
904
1008
  /**
905
1009
  * @method shouldShowIconPlaceholder
@@ -907,6 +1011,8 @@ var FixedSizeContainer_1 = __webpack_require__(13);
907
1011
  * @param {boolean} loading
908
1012
  * @returns {boolean}
909
1013
  */
1014
+
1015
+
910
1016
  var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
911
1017
  var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
912
1018
  var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
@@ -915,6 +1021,7 @@ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources)
915
1021
  var noFields = fields === undefined;
916
1022
  return loading || noData || noFields;
917
1023
  };
1024
+
918
1025
  exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
919
1026
  var propTypes = {
920
1027
  icon: T.func,
@@ -929,11 +1036,13 @@ var propTypes = {
929
1036
  * @param {IconPlaceholderProps} props
930
1037
  * @returns {React.ReactElement}
931
1038
  */
1039
+
932
1040
  var IconPlaceholder = function IconPlaceholder(props) {
933
1041
  var width = props.width,
934
- height = props.height,
935
- icon = props.icon,
936
- iconColor = props.iconColor;
1042
+ height = props.height,
1043
+ icon = props.icon,
1044
+ iconColor = props.iconColor;
1045
+
937
1046
  if (icon) {
938
1047
  return React.createElement(icon, {
939
1048
  style: {
@@ -945,9 +1054,11 @@ var IconPlaceholder = function IconPlaceholder(props) {
945
1054
  transform: 'translate(-50%, -50%)'
946
1055
  },
947
1056
  width: '50%',
948
- height: '50%'
1057
+ height: '50%',
1058
+ 'data-test': 'icon-placeholder'
949
1059
  });
950
1060
  }
1061
+
951
1062
  return React.createElement(Message_1.default, {
952
1063
  width: width,
953
1064
  height: height,
@@ -955,6 +1066,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
955
1066
  message: (0, i18n_1._)('No DataSource Connected')
956
1067
  });
957
1068
  };
1069
+
958
1070
  IconPlaceholder.propTypes = propTypes;
959
1071
  IconPlaceholder.defaultProps = {
960
1072
  width: '100%',
@@ -971,21 +1083,27 @@ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
971
1083
 
972
1084
 
973
1085
  var _defineProperty = __webpack_require__(7);
1086
+
974
1087
  Object.defineProperty(exports, "__esModule", {
975
1088
  value: true
976
1089
  });
977
1090
  exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1091
+
978
1092
  var T = __webpack_require__(0);
1093
+
979
1094
  var lodash_1 = __webpack_require__(3);
980
- var DataSource_1 = __webpack_require__(43);
1095
+
1096
+ var DataSource_1 = __webpack_require__(34);
1097
+
981
1098
  exports.SortParamsPropTypes = T.shape({
982
1099
  currentSortKey: T.string,
983
1100
  currentSortDir: T.oneOf(DataSource_1.validSortDirs),
984
1101
  onSort: T.func
985
1102
  });
1103
+
986
1104
  var getSortingParams = function getSortingParams(_ref) {
987
1105
  var requestParams = _ref.requestParams,
988
- onRequestParamsChange = _ref.onRequestParamsChange;
1106
+ onRequestParamsChange = _ref.onRequestParamsChange;
989
1107
  var currentSortKey;
990
1108
  var currentSortDir;
991
1109
  var nextSortDirMap = {
@@ -994,15 +1112,18 @@ var getSortingParams = function getSortingParams(_ref) {
994
1112
  none: 'asc'
995
1113
  };
996
1114
  var onSort;
1115
+
997
1116
  if (typeof onRequestParamsChange === 'function') {
998
1117
  if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
999
1118
  currentSortKey = Object.keys(requestParams.sort).shift();
1000
1119
  currentSortDir = requestParams.sort[currentSortKey];
1001
- }
1002
- // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1120
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1121
+
1122
+
1003
1123
  onSort = function onSort(e, _ref2) {
1004
1124
  var sortKey = _ref2.sortKey,
1005
- sortDir = _ref2.sortDir;
1125
+ sortDir = _ref2.sortDir;
1126
+
1006
1127
  if (typeof sortKey === 'string') {
1007
1128
  var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1008
1129
  onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
@@ -1014,12 +1135,14 @@ var getSortingParams = function getSortingParams(_ref) {
1014
1135
  }
1015
1136
  };
1016
1137
  }
1138
+
1017
1139
  return {
1018
1140
  currentSortKey: currentSortKey,
1019
1141
  currentSortDir: currentSortDir,
1020
1142
  onSort: onSort
1021
1143
  };
1022
1144
  };
1145
+
1023
1146
  exports.getSortingParams = getSortingParams;
1024
1147
 
1025
1148
  /***/ }),
@@ -1030,43 +1153,69 @@ exports.getSortingParams = getSortingParams;
1030
1153
  "use strict";
1031
1154
 
1032
1155
 
1156
+ Object.defineProperty(exports, "__esModule", {
1157
+ value: true
1158
+ });
1159
+ exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
1160
+ exports.validSortDirs = ['asc', 'desc', 'none'];
1161
+ exports.validSegmentationModes = ['none', 'inner'];
1162
+ exports.validOutputModes = ['json_cols', 'json'];
1163
+
1164
+ /***/ }),
1165
+
1166
+ /***/ 35:
1167
+ /***/ (function(module, exports, __webpack_require__) {
1168
+
1169
+ "use strict";
1170
+
1171
+
1033
1172
  Object.defineProperty(exports, "__esModule", {
1034
1173
  value: true
1035
1174
  });
1036
1175
  exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1176
+
1037
1177
  var T = __webpack_require__(0);
1178
+
1038
1179
  var lodash_1 = __webpack_require__(3);
1180
+
1039
1181
  exports.PaginatorParamsPropTypes = T.shape({
1040
1182
  isPaging: T.bool,
1041
1183
  current: T.number,
1042
1184
  totalPages: T.number,
1043
1185
  onChange: T.func
1044
1186
  });
1187
+
1045
1188
  var getPaginationParams = function getPaginationParams(_ref) {
1046
1189
  var requestParams = _ref.requestParams,
1047
- meta = _ref.meta,
1048
- onRequestParamsChange = _ref.onRequestParamsChange;
1190
+ meta = _ref.meta,
1191
+ onRequestParamsChange = _ref.onRequestParamsChange;
1049
1192
  var totalCount = meta && meta.totalCount || 0;
1050
1193
  var offset = requestParams && requestParams.offset || 0;
1051
1194
  var count = requestParams && requestParams.count;
1052
1195
  var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1053
1196
  var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1054
1197
  var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
1198
+
1055
1199
  var onChangeHandler = function onChangeHandler(e, _ref2) {
1056
1200
  var page = _ref2.page,
1057
- countArg = _ref2.count;
1201
+ countArg = _ref2.count;
1058
1202
  var newParams = (0, lodash_1.cloneDeep)(requestParams);
1203
+
1059
1204
  if (typeof countArg === 'number') {
1060
1205
  newParams.count = countArg;
1061
1206
  newParams.offset = 0;
1062
1207
  }
1208
+
1063
1209
  var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
1210
+
1064
1211
  if (typeof page === 'number' && page > 0) {
1065
1212
  newParams.count = pageCount;
1066
1213
  newParams.offset = (page - 1) * pageCount;
1067
1214
  }
1215
+
1068
1216
  onRequestParamsChange(newParams);
1069
1217
  };
1218
+
1070
1219
  return {
1071
1220
  isPaging: isPaging,
1072
1221
  current: current,
@@ -1074,11 +1223,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
1074
1223
  onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
1075
1224
  };
1076
1225
  };
1226
+
1077
1227
  exports.getPaginationParams = getPaginationParams;
1078
1228
 
1079
1229
  /***/ }),
1080
1230
 
1081
- /***/ 35:
1231
+ /***/ 36:
1082
1232
  /***/ (function(module, exports, __webpack_require__) {
1083
1233
 
1084
1234
  "use strict";
@@ -1089,6 +1239,7 @@ Object.defineProperty(exports, "__esModule", {
1089
1239
  });
1090
1240
  exports.VizCategory = void 0;
1091
1241
  var VizCategory;
1242
+
1092
1243
  (function (VizCategory) {
1093
1244
  VizCategory["SINGLE_VALUE"] = "Single Value";
1094
1245
  VizCategory["TRENDS"] = "Trends";
@@ -1106,67 +1257,96 @@ var VizCategory;
1106
1257
 
1107
1258
  /***/ }),
1108
1259
 
1109
- /***/ 36:
1260
+ /***/ 37:
1110
1261
  /***/ (function(module, exports, __webpack_require__) {
1111
1262
 
1112
1263
  "use strict";
1113
1264
 
1114
1265
 
1115
1266
  var _slicedToArray = __webpack_require__(17);
1267
+
1116
1268
  Object.defineProperty(exports, "__esModule", {
1117
1269
  value: true
1118
1270
  });
1271
+
1119
1272
  var React = __webpack_require__(1);
1273
+
1120
1274
  var lodash_1 = __webpack_require__(3);
1121
- var getSettingsFromThemedProps_1 = __webpack_require__(37);
1275
+
1276
+ var getSettingsFromThemedProps_1 = __webpack_require__(38);
1277
+
1122
1278
  var Options_1 = __webpack_require__(30);
1123
- var SanitizeProps_1 = __webpack_require__(38);
1279
+
1280
+ var SanitizeProps_1 = __webpack_require__(39);
1281
+
1124
1282
  var TimezoneContext_1 = __webpack_require__(26);
1125
- var moment_1 = __webpack_require__(39);
1283
+
1284
+ var moment_1 = __webpack_require__(40);
1285
+
1126
1286
  var FeatureFlagContext_1 = __webpack_require__(21);
1287
+
1127
1288
  var styled_components_1 = __webpack_require__(4);
1289
+
1128
1290
  var hocUtils_1 = __webpack_require__(27);
1291
+
1129
1292
  var JSONSchemaUtils_1 = __webpack_require__(28);
1130
- var async_dynamic_options_evaluator_1 = __webpack_require__(40);
1293
+
1294
+ var async_dynamic_options_evaluator_1 = __webpack_require__(41);
1295
+
1131
1296
  var id_1 = __webpack_require__(25);
1132
- var SplunkVisualization_1 = __webpack_require__(41);
1297
+
1298
+ var SplunkVisualization_1 = __webpack_require__(42);
1299
+
1133
1300
  var VizBehavior_1 = __webpack_require__(6);
1301
+
1134
1302
  var getSorting_1 = __webpack_require__(33);
1135
- var getPagination_1 = __webpack_require__(34);
1303
+
1304
+ var getPagination_1 = __webpack_require__(35);
1305
+
1136
1306
  var useDeepMemo_1 = __webpack_require__(44);
1307
+
1137
1308
  var MissingPropsMessage_1 = __webpack_require__(45);
1309
+
1138
1310
  var withEditModeCover_1 = __webpack_require__(46);
1311
+
1139
1312
  var withPlaceholder_1 = __webpack_require__(47);
1140
1313
  /**
1141
1314
  * hoc that wraps a pure react visualization in a Dashboard visualization
1142
1315
  * @param {DashboardVizOpts} opts
1143
1316
  * @returns {HOC}
1144
1317
  */
1318
+
1319
+
1145
1320
  var withDashboardViz = function withDashboardViz(opts) {
1146
1321
  var ReactViz = opts.ReactViz,
1147
- vizConfig = opts.vizConfig,
1148
- _opts$computeVizProps = opts.computeVizProps,
1149
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1150
- disableEditModeCover = opts.disableEditModeCover,
1151
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1322
+ vizConfig = opts.vizConfig,
1323
+ _opts$computeVizProps = opts.computeVizProps,
1324
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1325
+ disableEditModeCover = opts.disableEditModeCover,
1326
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1327
+
1152
1328
  var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
1153
1329
  var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
1330
+
1154
1331
  var DashboardViz = function DashboardViz(props) {
1155
1332
  var _a;
1333
+
1156
1334
  var mode = props.mode,
1157
- hasEventHandlers = props.hasEventHandlers,
1158
- dataSources = props.dataSources,
1159
- options = props.options,
1160
- _props$context = props.context,
1161
- context = _props$context === void 0 ? {} : _props$context,
1162
- width = props.width,
1163
- height = props.height,
1164
- onComputedProps = props.onComputedProps,
1165
- onEventTrigger = props.onEventTrigger,
1166
- theme = props.theme,
1167
- onRequestParamsChange = props.onRequestParamsChange;
1335
+ hasEventHandlers = props.hasEventHandlers,
1336
+ dataSources = props.dataSources,
1337
+ options = props.options,
1338
+ _props$context = props.context,
1339
+ context = _props$context === void 0 ? {} : _props$context,
1340
+ width = props.width,
1341
+ height = props.height,
1342
+ onComputedProps = props.onComputedProps,
1343
+ onEventTrigger = props.onEventTrigger,
1344
+ theme = props.theme,
1345
+ onRequestParamsChange = props.onRequestParamsChange;
1346
+
1168
1347
  var _React$useContext = React.useContext(TimezoneContext_1.default),
1169
- serializedTimezone = _React$useContext.serializedTimezone;
1348
+ serializedTimezone = _React$useContext.serializedTimezone;
1349
+
1170
1350
  if (serializedTimezone) {
1171
1351
  /*
1172
1352
  @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
@@ -1180,38 +1360,51 @@ var withDashboardViz = function withDashboardViz(opts) {
1180
1360
  moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1181
1361
  }
1182
1362
  }
1363
+
1183
1364
  var themeFunc = function themeFunc(themeVar) {
1184
1365
  var _a, _b;
1366
+
1185
1367
  return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1186
1368
  };
1369
+
1187
1370
  var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1371
+
1188
1372
  var _ref = (0, getSettingsFromThemedProps_1.default)({
1189
- theme: theme
1190
- }),
1191
- currentThemeFamily = _ref.family,
1192
- currentThemeColorScheme = _ref.colorScheme,
1193
- currentThemeDensity = _ref.density;
1373
+ theme: theme
1374
+ }),
1375
+ currentThemeFamily = _ref.family,
1376
+ currentThemeColorScheme = _ref.colorScheme,
1377
+ currentThemeDensity = _ref.density;
1378
+
1194
1379
  var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1380
+
1195
1381
  var _React$useState = React.useState({}),
1196
- _React$useState2 = _slicedToArray(_React$useState, 2),
1197
- evaluatedOptionsAsync = _React$useState2[0],
1198
- setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1382
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1383
+ evaluatedOptionsAsync = _React$useState2[0],
1384
+ setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1385
+
1386
+
1199
1387
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
1388
+
1200
1389
  var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
1201
- _React$useState4 = _slicedToArray(_React$useState3, 1),
1202
- visualizationID = _React$useState4[0];
1390
+ _React$useState4 = _slicedToArray(_React$useState3, 1),
1391
+ visualizationID = _React$useState4[0];
1392
+
1203
1393
  var _React$useState5 = React.useState({}),
1204
- _React$useState6 = _slicedToArray(_React$useState5, 2),
1205
- dataSourcesInState = _React$useState6[0],
1206
- setDataSourcesInState = _React$useState6[1];
1394
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
1395
+ dataSourcesInState = _React$useState6[0],
1396
+ setDataSourcesInState = _React$useState6[1];
1397
+
1207
1398
  var _React$useState7 = React.useState(),
1208
- _React$useState8 = _slicedToArray(_React$useState7, 2),
1209
- dataFramesInState = _React$useState8[0],
1210
- setDataFramesInState = _React$useState8[1];
1399
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
1400
+ dataFramesInState = _React$useState8[0],
1401
+ setDataFramesInState = _React$useState8[1];
1402
+
1211
1403
  var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
1212
- _React$useState10 = _slicedToArray(_React$useState9, 2),
1213
- useAsyncEvaluatedOptions = _React$useState10[0],
1214
- setUseAsyncEvaluatedOptions = _React$useState10[1];
1404
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
1405
+ useAsyncEvaluatedOptions = _React$useState10[0],
1406
+ setUseAsyncEvaluatedOptions = _React$useState10[1];
1407
+
1215
1408
  var isMounted = React.useRef(true);
1216
1409
  evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
1217
1410
  try {
@@ -1236,11 +1429,13 @@ var withDashboardViz = function withDashboardViz(opts) {
1236
1429
  });
1237
1430
  } else {
1238
1431
  var dataFrames = dataFramesInState;
1432
+
1239
1433
  if (dataSources !== dataSourcesInState) {
1240
1434
  setDataSourcesInState(dataSources);
1241
1435
  dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
1242
1436
  setDataFramesInState(dataFrames);
1243
1437
  }
1438
+
1244
1439
  return Options_1.Options.evaluate({
1245
1440
  context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
1246
1441
  options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
@@ -1251,21 +1446,24 @@ var withDashboardViz = function withDashboardViz(opts) {
1251
1446
  console.error("unexpected error evaluating options: ".concat(e.message));
1252
1447
  return {};
1253
1448
  }
1449
+
1254
1450
  return {};
1255
1451
  }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
1256
- var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
1257
- // trellis specific backgroundColor update for onComputedProps
1452
+ var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
1258
1453
  // 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
1259
1454
  // onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
1455
+
1260
1456
  var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
1261
1457
  var clonedEvaluatedOptions = evaluatedOptionsToUse;
1458
+
1262
1459
  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) {
1263
1460
  clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
1264
1461
  backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
1265
1462
  });
1266
- }
1267
- // useEffect hook needs to be initialized before any early returns
1463
+ } // useEffect hook needs to be initialized before any early returns
1268
1464
  // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1465
+
1466
+
1269
1467
  React.useEffect(function () {
1270
1468
  onComputedProps(clonedEvaluatedOptions);
1271
1469
  });
@@ -1275,53 +1473,68 @@ var withDashboardViz = function withDashboardViz(opts) {
1275
1473
  isMounted.current = false;
1276
1474
  async_dynamic_options_evaluator_1.default.reset(visualizationID);
1277
1475
  }
1278
- };
1279
- // eslint-disable-next-line react-hooks/exhaustive-deps
1280
- }, []);
1281
- // present warning message if any required props are missing
1476
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
1477
+ }, []); // present warning message if any required props are missing
1478
+
1282
1479
  var _vizConfig$requiredPr = vizConfig.requiredProps,
1283
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1284
- supports = vizConfig.supports;
1480
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1481
+ supports = vizConfig.supports;
1285
1482
  var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
1483
+
1286
1484
  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
1287
1485
  ) {
1288
- return React.createElement(MissingPropsMessage_1.default, {
1289
- "data-test": "missing-props-message",
1290
- width: width,
1291
- height: height,
1292
- missingProps: missing,
1293
- backgroundColor: bgColorFromTheme
1294
- });
1295
- }
1296
- // events
1486
+ return React.createElement(MissingPropsMessage_1.default, {
1487
+ "data-test": "missing-props-message",
1488
+ width: width,
1489
+ height: height,
1490
+ missingProps: missing,
1491
+ backgroundColor: bgColorFromTheme
1492
+ });
1493
+ } // events
1494
+
1495
+
1297
1496
  var eventCallbackProps = {};
1497
+
1298
1498
  if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1299
1499
  var supportedEvents = vizConfig.events;
1300
1500
  Object.keys(supportedEvents).forEach(function (eventName) {
1301
- var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
1302
- eventCallbackProps[eventCallbackPropName] = null;
1303
- // todo: refactor single value and single value icon to send payload from viz
1501
+ var _supportedEvents$even = supportedEvents[eventName],
1502
+ parentKeys = _supportedEvents$even.parentKeys,
1503
+ payloadKeys = _supportedEvents$even.payloadKeys;
1504
+ var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName)); // todo: refactor single value and single value icon to send payload from viz
1304
1505
  // then remove these lines
1305
- var payloadKeys = supportedEvents[eventName].payloadKeys;
1506
+
1306
1507
  var payload = {};
1508
+
1307
1509
  if (Array.isArray(payloadKeys) && payloadKeys.length) {
1308
1510
  payloadKeys.forEach(function (p) {
1309
1511
  payload[p] = evaluatedOptionsToUse[p];
1310
1512
  });
1311
1513
  }
1514
+
1312
1515
  eventCallbackProps[eventCallbackPropName] = function (ev) {
1313
1516
  if (ev && ev.payload) {
1314
1517
  payload = ev.payload;
1315
1518
  }
1519
+
1316
1520
  return onEventTrigger({
1317
1521
  originalEvent: ev,
1318
1522
  payload: payload,
1319
1523
  type: eventName
1320
1524
  });
1321
1525
  };
1526
+
1527
+ if (parentKeys) {
1528
+ for (var i = parentKeys.length - 1; i >= 0; i -= 1) {
1529
+ var newObject = {};
1530
+ newObject[parentKeys[i]] = eventCallbackProps[eventCallbackPropName];
1531
+ eventCallbackProps[eventCallbackPropName] = newObject;
1532
+ }
1533
+ }
1322
1534
  });
1323
- }
1324
- // compute pure viz props which are not from options
1535
+ } // compute pure viz props which are not from options
1536
+
1537
+
1325
1538
  var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
1326
1539
  themeFunc: themeFunc
1327
1540
  }));
@@ -1339,15 +1552,19 @@ var withDashboardViz = function withDashboardViz(opts) {
1339
1552
  * In future, we could automatically detect which all datasources are being used
1340
1553
  * and bind those magically to pagination/sorting behavior.
1341
1554
  */
1555
+
1342
1556
  var dataSourceMetadata = {};
1343
1557
  var OptionKey = 'paginateDataSourceKey';
1344
1558
  var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
1559
+
1345
1560
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
1346
1561
  var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1347
1562
  var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
1563
+
1348
1564
  var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1349
1565
  return onRequestParamsChange(paginateDataSourceKey, payload);
1350
1566
  };
1567
+
1351
1568
  var sortParams = (0, getSorting_1.getSortingParams)({
1352
1569
  requestParams: requestParams,
1353
1570
  meta: meta,
@@ -1362,115 +1579,132 @@ var withDashboardViz = function withDashboardViz(opts) {
1362
1579
  sortParams: sortParams,
1363
1580
  paginatorParams: paginatorParams
1364
1581
  };
1365
- }
1366
- // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1582
+ } // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1583
+
1584
+
1367
1585
  if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
1368
1586
  return null;
1369
1587
  }
1588
+
1370
1589
  return React.createElement(SanitizedReactViz, Object.assign({
1371
1590
  mode: mode,
1372
1591
  width: width,
1373
1592
  height: height
1374
1593
  }, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
1375
1594
  };
1595
+
1376
1596
  DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1377
1597
  DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1378
1598
  // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1379
1599
  theme: {}
1380
- });
1381
- // attach viz config
1382
- DashboardViz.config = vizConfig;
1383
- // @ts-ignore: TODO fix sc upgrade TS issues
1600
+ }); // attach viz config
1601
+
1602
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1603
+
1384
1604
  return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
1385
1605
  };
1606
+
1386
1607
  exports.default = withDashboardViz;
1387
1608
 
1388
1609
  /***/ }),
1389
1610
 
1390
- /***/ 37:
1611
+ /***/ 38:
1391
1612
  /***/ (function(module, exports) {
1392
1613
 
1393
1614
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1394
1615
 
1395
1616
  /***/ }),
1396
1617
 
1397
- /***/ 38:
1618
+ /***/ 39:
1398
1619
  /***/ (function(module, exports) {
1399
1620
 
1400
1621
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1401
1622
 
1402
1623
  /***/ }),
1403
1624
 
1404
- /***/ 39:
1625
+ /***/ 4:
1405
1626
  /***/ (function(module, exports) {
1406
1627
 
1407
- module.exports = require("@splunk/moment");
1628
+ module.exports = require("styled-components");
1408
1629
 
1409
1630
  /***/ }),
1410
1631
 
1411
- /***/ 4:
1632
+ /***/ 40:
1412
1633
  /***/ (function(module, exports) {
1413
1634
 
1414
- module.exports = require("styled-components");
1635
+ module.exports = require("@splunk/moment");
1415
1636
 
1416
1637
  /***/ }),
1417
1638
 
1418
- /***/ 40:
1639
+ /***/ 41:
1419
1640
  /***/ (function(module, exports) {
1420
1641
 
1421
1642
  module.exports = require("@splunk/async-dynamic-options-evaluator");
1422
1643
 
1423
1644
  /***/ }),
1424
1645
 
1425
- /***/ 41:
1646
+ /***/ 42:
1426
1647
  /***/ (function(module, exports, __webpack_require__) {
1427
1648
 
1428
1649
  "use strict";
1429
1650
 
1430
1651
 
1431
1652
  var _classCallCheck = __webpack_require__(9);
1653
+
1432
1654
  Object.defineProperty(exports, "__esModule", {
1433
1655
  value: true
1434
1656
  });
1435
1657
  exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1436
1658
  /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1659
+
1437
1660
  var T = __webpack_require__(0);
1661
+
1438
1662
  var lodash_1 = __webpack_require__(3);
1439
- var VizActionHandler_1 = __webpack_require__(42);
1440
- // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1663
+
1664
+ var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1665
+
1666
+
1441
1667
  exports.INITIAL_WIDTH = 250;
1442
1668
  exports.INITIAL_HEIGHT = 250;
1443
1669
  /**
1444
1670
  * A Splunk visualization
1445
1671
  */
1672
+
1446
1673
  var SplunkVisualization = function SplunkVisualization() {
1447
1674
  _classCallCheck(this, SplunkVisualization);
1448
1675
  };
1676
+
1449
1677
  SplunkVisualization.propTypes = {
1450
1678
  /**
1451
1679
  * display mode
1452
1680
  */
1453
1681
  mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1682
+
1454
1683
  /**
1455
1684
  * width in pixel or string, defaults to 100%
1456
1685
  */
1457
1686
  width: T.oneOfType([T.string, T.number]).isRequired,
1687
+
1458
1688
  /**
1459
1689
  * height in pixel or string
1460
1690
  */
1461
1691
  height: T.oneOfType([T.string, T.number]).isRequired,
1692
+
1462
1693
  /**
1463
1694
  * visualization context used for dynamic option evaluation
1464
1695
  */
1465
1696
  context: T.object,
1697
+
1466
1698
  /**
1467
1699
  * visualization formatting options
1468
1700
  */
1469
1701
  options: T.object,
1702
+
1470
1703
  /**
1471
1704
  * A callback to update formatting options
1472
1705
  */
1473
1706
  onOptionsChange: T.func,
1707
+
1474
1708
  /**
1475
1709
  * datasource state which include data and request params, object key indicate the datasource type.
1476
1710
  */
@@ -1479,6 +1713,7 @@ SplunkVisualization.propTypes = {
1479
1713
  * current request params
1480
1714
  */
1481
1715
  requestParams: T.object,
1716
+
1482
1717
  /**
1483
1718
  * current dataset
1484
1719
  */
@@ -1486,6 +1721,7 @@ SplunkVisualization.propTypes = {
1486
1721
  fields: T.array,
1487
1722
  columns: T.array
1488
1723
  }),
1724
+
1489
1725
  /**
1490
1726
  * error
1491
1727
  */
@@ -1493,29 +1729,35 @@ SplunkVisualization.propTypes = {
1493
1729
  level: T.string,
1494
1730
  message: T.string
1495
1731
  }),
1732
+
1496
1733
  /**
1497
1734
  * meta data that came with the dataset
1498
1735
  */
1499
1736
  meta: T.object
1500
1737
  })),
1738
+
1501
1739
  /**
1502
1740
  * A callback to trigger event
1503
1741
  */
1504
1742
  onEventTrigger: T.func,
1743
+
1505
1744
  /**
1506
1745
  * Inform viz if there are handlers listening to events
1507
1746
  */
1508
1747
  hasEventHandlers: T.bool,
1748
+
1509
1749
  /**
1510
1750
  * A callback to communicate computed props to a consumer
1511
1751
  */
1512
1752
  onComputedProps: T.func,
1753
+
1513
1754
  /**
1514
1755
  * A callback to obtain visualization api
1515
1756
  */
1516
1757
  vizActionHandlerRef: T.func,
1517
1758
  loading: T.bool,
1518
1759
  theme: T.object,
1760
+
1519
1761
  /**
1520
1762
  * A callback to request new data with updated request params
1521
1763
  */
@@ -1524,6 +1766,7 @@ SplunkVisualization.propTypes = {
1524
1766
  /**
1525
1767
  *
1526
1768
  */
1769
+
1527
1770
  SplunkVisualization.defaultProps = {
1528
1771
  // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1529
1772
  width: '100%',
@@ -1552,26 +1795,29 @@ exports.default = SplunkVisualization;
1552
1795
 
1553
1796
  /***/ }),
1554
1797
 
1555
- /***/ 42:
1798
+ /***/ 43:
1556
1799
  /***/ (function(module, exports, __webpack_require__) {
1557
1800
 
1558
1801
  "use strict";
1559
1802
 
1560
1803
 
1561
1804
  var _classCallCheck = __webpack_require__(9);
1805
+
1562
1806
  var _createClass = __webpack_require__(18);
1807
+
1563
1808
  Object.defineProperty(exports, "__esModule", {
1564
1809
  value: true
1565
1810
  });
1566
1811
  exports.DefaultVizActionHandler = void 0;
1812
+
1567
1813
  var DefaultVizActionHandler = /*#__PURE__*/function () {
1568
1814
  function DefaultVizActionHandler() {
1569
1815
  _classCallCheck(this, DefaultVizActionHandler);
1570
1816
  }
1817
+
1571
1818
  _createClass(DefaultVizActionHandler, [{
1572
1819
  key: "focus",
1573
- value: function focus() {
1574
- // noop
1820
+ value: function focus() {// noop
1575
1821
  }
1576
1822
  }, {
1577
1823
  key: "snapshot",
@@ -1579,23 +1825,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
1579
1825
  return null; // noop
1580
1826
  }
1581
1827
  }]);
1828
+
1582
1829
  return DefaultVizActionHandler;
1583
1830
  }();
1584
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
1585
-
1586
- /***/ }),
1587
-
1588
- /***/ 43:
1589
- /***/ (function(module, exports, __webpack_require__) {
1590
-
1591
- "use strict";
1592
1831
 
1593
-
1594
- Object.defineProperty(exports, "__esModule", {
1595
- value: true
1596
- });
1597
- exports.validSortDirs = void 0;
1598
- exports.validSortDirs = ['asc', 'desc', 'none'];
1832
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1599
1833
 
1600
1834
  /***/ }),
1601
1835
 
@@ -1609,7 +1843,9 @@ Object.defineProperty(exports, "__esModule", {
1609
1843
  value: true
1610
1844
  });
1611
1845
  exports.useDeepMemo = void 0;
1846
+
1612
1847
  var react_1 = __webpack_require__(1);
1848
+
1613
1849
  var lodash_1 = __webpack_require__(3);
1614
1850
  /**
1615
1851
  * This hook evaluates and stores the result of a passed function and only
@@ -1624,16 +1860,21 @@ var lodash_1 = __webpack_require__(3);
1624
1860
  * @param fn the function to be executed and
1625
1861
  * @param dependencies an array of dependencies
1626
1862
  */
1863
+
1864
+
1627
1865
  var useDeepMemo = function useDeepMemo(fn, dependencies) {
1628
1866
  var ref = (0, react_1.useRef)();
1867
+
1629
1868
  if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
1630
1869
  ref.current = {
1631
1870
  dependencies: dependencies,
1632
1871
  value: fn()
1633
1872
  };
1634
1873
  }
1874
+
1635
1875
  return ref.current.value;
1636
1876
  };
1877
+
1637
1878
  exports.useDeepMemo = useDeepMemo;
1638
1879
 
1639
1880
  /***/ }),
@@ -1648,19 +1889,27 @@ Object.defineProperty(exports, "__esModule", {
1648
1889
  value: true
1649
1890
  });
1650
1891
  exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1892
+
1651
1893
  var React = __webpack_require__(1);
1894
+
1652
1895
  var T = __webpack_require__(0);
1896
+
1653
1897
  var i18n_1 = __webpack_require__(2);
1898
+
1654
1899
  var Message_1 = __webpack_require__(10);
1900
+
1655
1901
  var FixedSizeContainer_1 = __webpack_require__(13);
1656
1902
  /**
1657
1903
  * @method isMissing
1658
1904
  * @param {any} v
1659
1905
  * @returns {boolean} true if the input value === null or undefined
1660
1906
  */
1907
+
1908
+
1661
1909
  var isMissing = function isMissing(v) {
1662
1910
  return v === null || v === undefined;
1663
1911
  };
1912
+
1664
1913
  exports.isMissing = isMissing;
1665
1914
  /**
1666
1915
  * @method misskingKeys
@@ -1668,11 +1917,13 @@ exports.isMissing = isMissing;
1668
1917
  * @param {object} target
1669
1918
  * @returns {string[]} the keys of missing required props
1670
1919
  */
1920
+
1671
1921
  var missingKeys = function missingKeys(keys, target) {
1672
1922
  return keys.filter(function (k) {
1673
1923
  return (0, exports.isMissing)(target[k]);
1674
1924
  });
1675
1925
  };
1926
+
1676
1927
  exports.missingKeys = missingKeys;
1677
1928
  var propTypes = {
1678
1929
  width: T.oneOfType([T.string, T.number]),
@@ -1686,10 +1937,11 @@ var propTypes = {
1686
1937
  * @param {MissingPropsProps} props
1687
1938
  * @returns {React.ReactElement}
1688
1939
  */
1940
+
1689
1941
  var MissingPropsMessage = function MissingPropsMessage(props) {
1690
1942
  var width = props.width,
1691
- height = props.height,
1692
- missingProps = props.missingProps;
1943
+ height = props.height,
1944
+ missingProps = props.missingProps;
1693
1945
  return React.createElement(Message_1.default, {
1694
1946
  "data-test": "message",
1695
1947
  width: width,
@@ -1697,6 +1949,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
1697
1949
  message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
1698
1950
  });
1699
1951
  };
1952
+
1700
1953
  exports.MissingPropsMessage = MissingPropsMessage;
1701
1954
  exports.MissingPropsMessage.propTypes = propTypes;
1702
1955
  exports.MissingPropsMessage.defaultProps = {
@@ -1716,15 +1969,19 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage)
1716
1969
  Object.defineProperty(exports, "__esModule", {
1717
1970
  value: true
1718
1971
  });
1972
+
1719
1973
  var React = __webpack_require__(1);
1974
+
1720
1975
  var styled_components_1 = __webpack_require__(4);
1976
+
1721
1977
  var hocUtils_1 = __webpack_require__(15);
1978
+
1722
1979
  var Cover = styled_components_1.default.div.withConfig({
1723
1980
  displayName: "withEditModeCover__Cover",
1724
1981
  componentId: "sc-1gsbnxb-0"
1725
1982
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1726
1983
  var Blocker = styled_components_1.default.div.attrs({
1727
- 'data-splunk-visualization-version': "26.0.0 - 2f7458907"
1984
+ 'data-splunk-visualization-version': "26.1.1 - b6df0a015"
1728
1985
  }).withConfig({
1729
1986
  displayName: "withEditModeCover__Blocker",
1730
1987
  componentId: "sc-1gsbnxb-1"
@@ -1735,6 +1992,7 @@ var Blocker = styled_components_1.default.div.attrs({
1735
1992
  * @param {ExtendedDashViz} Visualization
1736
1993
  * @returns {ExtendedDashViz} Wrapper
1737
1994
  */
1995
+
1738
1996
  var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1739
1997
  var Wrapper = function Wrapper(props) {
1740
1998
  var mode = props.mode;
@@ -1743,12 +2001,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
1743
2001
  "data-test": "edit-mode-cover"
1744
2002
  }));
1745
2003
  };
2004
+
1746
2005
  (0, hocUtils_1.extendStaticWrapperProps)({
1747
2006
  Wrapper: Wrapper,
1748
2007
  Visualization: Visualization
1749
2008
  });
1750
2009
  return Wrapper;
1751
2010
  };
2011
+
1752
2012
  exports.default = withEditModeCover;
1753
2013
 
1754
2014
  /***/ }),
@@ -1762,27 +2022,37 @@ exports.default = withEditModeCover;
1762
2022
  Object.defineProperty(exports, "__esModule", {
1763
2023
  value: true
1764
2024
  });
2025
+
1765
2026
  var React = __webpack_require__(1);
2027
+
1766
2028
  var colorUtils_1 = __webpack_require__(12);
2029
+
1767
2030
  var variables_1 = __webpack_require__(11);
2031
+
1768
2032
  var IconPlaceholder_1 = __webpack_require__(32);
2033
+
1769
2034
  var VizBehavior_1 = __webpack_require__(6);
2035
+
1770
2036
  var hocUtils_1 = __webpack_require__(15);
2037
+
1771
2038
  var withPlaceholder = function withPlaceholder(Visualization) {
1772
2039
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
1773
2040
  var config = Visualization.config;
1774
2041
  var themes = config.themes;
2042
+
1775
2043
  var Wrapper = function Wrapper(props) {
1776
2044
  var _a, _b;
2045
+
1777
2046
  var dataSources = props.dataSources,
1778
- loading = props.loading,
1779
- options = props.options,
1780
- height = props.height,
1781
- width = props.width;
2047
+ loading = props.loading,
2048
+ options = props.options,
2049
+ height = props.height,
2050
+ width = props.width;
1782
2051
  var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
1783
2052
  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);
1784
2053
  var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
1785
2054
  var iconColor = variables_1.default.contentColorActive(props);
2055
+
1786
2056
  if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
1787
2057
  return React.createElement(IconPlaceholder_1.default, {
1788
2058
  "data-test": "icon-placeholder",
@@ -1793,14 +2063,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
1793
2063
  iconColor: iconColor
1794
2064
  });
1795
2065
  }
2066
+
1796
2067
  return React.createElement(Visualization, Object.assign({}, props));
1797
2068
  };
2069
+
1798
2070
  (0, hocUtils_1.extendStaticWrapperProps)({
1799
2071
  Wrapper: Wrapper,
1800
2072
  Visualization: Visualization
1801
2073
  });
1802
2074
  return Wrapper;
1803
2075
  };
2076
+
1804
2077
  exports.default = withPlaceholder;
1805
2078
 
1806
2079
  /***/ }),
@@ -1823,6 +2096,7 @@ Object.defineProperty(exports, "__esModule", {
1823
2096
  });
1824
2097
  exports.VizBehavior = void 0;
1825
2098
  var VizBehavior;
2099
+
1826
2100
  (function (VizBehavior) {
1827
2101
  /**
1828
2102
  * Dynamic Options Behavior.
@@ -1842,6 +2116,7 @@ var VizBehavior;
1842
2116
  * missing.
1843
2117
  * @type {string}
1844
2118
  */
2119
+
1845
2120
  VizBehavior["PLACEHOLDER"] = "placeholder";
1846
2121
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
1847
2122
  VizBehavior["TRELLIS"] = "trellis";