@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/Ellipse.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 = 200);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 201);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ([
@@ -133,6 +133,7 @@ Object.defineProperty(exports, "__esModule", {
133
133
  });
134
134
  exports.VizBehavior = void 0;
135
135
  var VizBehavior;
136
+
136
137
  (function (VizBehavior) {
137
138
  /**
138
139
  * Dynamic Options Behavior.
@@ -152,6 +153,7 @@ var VizBehavior;
152
153
  * missing.
153
154
  * @type {string}
154
155
  */
156
+
155
157
  VizBehavior["PLACEHOLDER"] = "placeholder";
156
158
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
157
159
  VizBehavior["TRELLIS"] = "trellis";
@@ -203,11 +205,17 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
203
205
  Object.defineProperty(exports, "__esModule", {
204
206
  value: true
205
207
  });
208
+
206
209
  var React = __webpack_require__(1);
210
+
207
211
  var styled_components_1 = __webpack_require__(4);
212
+
208
213
  var SizeAwareWrapper_1 = __webpack_require__(19);
214
+
209
215
  var style_1 = __webpack_require__(14);
216
+
210
217
  var colorUtils_1 = __webpack_require__(12);
218
+
211
219
  var Item = styled_components_1.default.div.attrs(function (_ref) {
212
220
  var width = _ref.width;
213
221
  return {
@@ -220,11 +228,11 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
220
228
  componentId: "sc-1yhgpod-0"
221
229
  })(["position:relative;background-color:", "};"], function (props) {
222
230
  return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
223
- });
224
- // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
231
+ }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
232
+
225
233
  var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
226
234
  var width = _ref2.width,
227
- height = _ref2.height;
235
+ height = _ref2.height;
228
236
  return {
229
237
  style: Object.assign(Object.assign({}, width && {
230
238
  width: (0, style_1.toPx)(width)
@@ -246,11 +254,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
246
254
  displayName: "FixedSizeContainer__FixSizeItemContent",
247
255
  componentId: "sc-1yhgpod-3"
248
256
  })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
257
+
249
258
  var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
250
259
  var FixedSizeContainer = function FixedSizeContainer(props) {
251
260
  var width = props.width,
252
- height = props.height,
253
- backgroundColor = props.backgroundColor;
261
+ height = props.height,
262
+ backgroundColor = props.backgroundColor;
263
+
254
264
  if (!height) {
255
265
  return React.createElement(Item, {
256
266
  "data-test": "item",
@@ -258,24 +268,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
258
268
  backgroundColor: backgroundColor
259
269
  }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
260
270
  }
271
+
261
272
  return React.createElement(FixSizeItem, {
262
273
  "data-test": "fix-size-item",
263
- "data-splunk-visualization-version": "26.0.0 - 2f7458907",
274
+ "data-splunk-visualization-version": "26.1.1 - b6df0a015",
264
275
  width: width,
265
276
  height: height,
266
277
  backgroundColor: backgroundColor
267
278
  }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
268
279
  var newWidth = _ref3.width,
269
- newHeight = _ref3.height;
280
+ newHeight = _ref3.height;
270
281
  return React.createElement(Viz, Object.assign({}, props, {
271
282
  width: newWidth,
272
283
  height: newHeight
273
284
  }));
274
285
  })));
275
286
  };
287
+
276
288
  FixedSizeContainer.displayName = 'withFixedSizeContainer';
277
289
  return FixedSizeContainer;
278
290
  };
291
+
279
292
  exports.default = withFixedSizeContainer;
280
293
 
281
294
  /***/ }),
@@ -301,9 +314,10 @@ exports.extendStaticWrapperProps = void 0;
301
314
  * @param {DashboardVizType} props.Wrapper
302
315
  * @param {DashboardVizType} props.Visualization
303
316
  */
317
+
304
318
  var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
305
319
  var Wrapper = _ref.Wrapper,
306
- Visualization = _ref.Visualization;
320
+ Visualization = _ref.Visualization;
307
321
  var extendProperties = ['propTypes', 'defaultProps', 'config'];
308
322
  extendProperties.forEach(function (prop) {
309
323
  if (Visualization[prop]) {
@@ -312,6 +326,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
312
326
  }
313
327
  });
314
328
  };
329
+
315
330
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
316
331
 
317
332
  /***/ }),
@@ -346,24 +361,33 @@ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
346
361
 
347
362
 
348
363
  var _toConsumableArray = __webpack_require__(8);
364
+
349
365
  var _defineProperty = __webpack_require__(7);
366
+
350
367
  var __rest = this && this.__rest || function (s, e) {
351
368
  var t = {};
369
+
352
370
  for (var p in s) {
353
371
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
354
372
  }
373
+
355
374
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
356
375
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
357
376
  }
358
377
  return t;
359
378
  };
379
+
360
380
  Object.defineProperty(exports, "__esModule", {
361
381
  value: true
362
382
  });
363
383
  exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
384
+
364
385
  var lodash_1 = __webpack_require__(3);
386
+
365
387
  var schemaUtils_1 = __webpack_require__(16);
388
+
366
389
  var VizBehavior_1 = __webpack_require__(6);
390
+
367
391
  var dynamicOptionsDSLType = {
368
392
  type: 'string',
369
393
  pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
@@ -373,20 +397,22 @@ var dynamicOptionsDSLType = {
373
397
  * @param optionsSchema a visualization's options schema
374
398
  * @returns an updated options schema that additionally allows strings starting with > for each option
375
399
  */
400
+
376
401
  function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
377
402
  var enhancedOptionsSchema = {};
378
403
  Object.keys(optionsSchema).forEach(function (key) {
379
404
  var _a = optionsSchema[key],
380
- title = _a.title,
381
- description = _a.description,
382
- readOnly = _a.readOnly,
383
- writeOnly = _a.writeOnly,
384
- examples = _a.examples,
385
- defaultValue = _a.default,
386
- type = _a.type,
387
- properties = _a.properties,
388
- patternProperties = _a.patternProperties,
389
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
405
+ title = _a.title,
406
+ description = _a.description,
407
+ readOnly = _a.readOnly,
408
+ writeOnly = _a.writeOnly,
409
+ examples = _a.examples,
410
+ defaultValue = _a.default,
411
+ type = _a.type,
412
+ properties = _a.properties,
413
+ patternProperties = _a.patternProperties,
414
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
415
+
390
416
  var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
391
417
  title: title
392
418
  }), description !== undefined && {
@@ -400,12 +426,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
400
426
  }), defaultValue !== undefined && {
401
427
  default: defaultValue
402
428
  });
429
+
403
430
  if (type === 'object') {
404
431
  enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
405
432
  type: type
406
433
  }), properties && {
407
434
  properties: enhanceOptionsSchemaWithDynamicOptions(properties)
408
435
  });
436
+
409
437
  if (patternProperties) {
410
438
  var enhancedPatternProperties = {};
411
439
  Object.keys(patternProperties).forEach(function (opt) {
@@ -423,6 +451,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
423
451
  });
424
452
  return enhancedOptionsSchema;
425
453
  }
454
+
426
455
  exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
427
456
  /**
428
457
  * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
@@ -431,11 +460,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
431
460
  * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
432
461
  * and containing `open: false` for all editor panels in editorConfig
433
462
  */
463
+
434
464
  function enhanceConfig(vizConfig) {
435
465
  var enhancedConfig = Object.assign({}, vizConfig);
466
+
436
467
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
437
468
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
438
469
  }
470
+
439
471
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
440
472
  return Object.assign(Object.assign({}, config), {
441
473
  open: config.open || false
@@ -443,6 +475,7 @@ function enhanceConfig(vizConfig) {
443
475
  });
444
476
  return enhancedConfig;
445
477
  }
478
+
446
479
  exports.enhanceConfig = enhanceConfig;
447
480
  /**
448
481
  * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
@@ -450,6 +483,7 @@ exports.enhanceConfig = enhanceConfig;
450
483
  * @param vizConfig a Visualization Config
451
484
  * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
452
485
  */
486
+
453
487
  function uncollapseEditorConfig(vizConfig) {
454
488
  var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
455
489
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
@@ -459,13 +493,16 @@ function uncollapseEditorConfig(vizConfig) {
459
493
  });
460
494
  return editorPanelUncollapsedConfig;
461
495
  }
496
+
462
497
  exports.uncollapseEditorConfig = uncollapseEditorConfig;
498
+
463
499
  function isDynamicOption(option) {
464
500
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
465
501
  }
466
- exports.isDynamicOption = isDynamicOption;
467
- // private helpers to improve readability of getInitialPreset
502
+
503
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
468
504
  // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
505
+
469
506
  /**
470
507
  * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
471
508
  * 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
@@ -474,6 +511,7 @@ exports.isDynamicOption = isDynamicOption;
474
511
  *
475
512
  * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
476
513
  */
514
+
477
515
  function hasCompatibleContexts(vizContext, presetContext) {
478
516
  var presetContextKeys = Object.keys(presetContext);
479
517
  return presetContextKeys.every(function (contextKey) {
@@ -483,6 +521,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
483
521
  /**
484
522
  * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
485
523
  */
524
+
525
+
486
526
  function hasCompatibleOptions(vizOptions, presetOptions) {
487
527
  var presetOptionKeys = Object.keys(presetOptions);
488
528
  return presetOptionKeys.every(function (optionKey) {
@@ -497,18 +537,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
497
537
  * @param {Object} vizOptions - the current vizOptions definition
498
538
  * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
499
539
  */
540
+
541
+
500
542
  function getInitialPreset(vizContext, vizOptions, presets) {
501
543
  return presets.find(function (preset) {
502
544
  var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
503
545
  var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
504
546
  var presetContextKeys = Object.keys(presetContext);
505
- var presetOptionKeys = Object.keys(presetOptions);
506
- // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
547
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
507
548
  // if not, then the preset is invalid in config.ts
549
+
508
550
  if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
509
551
  return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
510
552
  });
511
553
  }
554
+
512
555
  exports.getInitialPreset = getInitialPreset;
513
556
  /**
514
557
  * generates number precision values for a Select editor
@@ -516,6 +559,7 @@ exports.getInitialPreset = getInitialPreset;
516
559
  * @param {Number} numPrecisionValues - number of integer precision values to generate
517
560
  * @returns {{ label: string; value; string }[]} array of { label, value } tuples
518
561
  */
562
+
519
563
  function generatePrecisionValues(numPrecisionValues) {
520
564
  return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
521
565
  return {
@@ -524,6 +568,7 @@ function generatePrecisionValues(numPrecisionValues) {
524
568
  };
525
569
  });
526
570
  }
571
+
527
572
  exports.generatePrecisionValues = generatePrecisionValues;
528
573
  /**
529
574
  * insert layout in layout array, return a new layout array instead of updating the original
@@ -533,12 +578,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
533
578
  * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
534
579
  * @returns {EditorLayoutConfig[][]} new editor layout with insertion
535
580
  */
581
+
536
582
  var insertLayout = function insertLayout(layout, index) {
537
583
  for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
538
584
  layoutItems[_key - 2] = arguments[_key];
539
585
  }
586
+
540
587
  return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
541
588
  };
589
+
542
590
  exports.insertLayout = insertLayout;
543
591
 
544
592
  /***/ }),
@@ -608,11 +656,17 @@ Object.defineProperty(exports, "__esModule", {
608
656
  value: true
609
657
  });
610
658
  exports.shouldShowIconPlaceholder = void 0;
659
+
611
660
  var React = __webpack_require__(1);
661
+
612
662
  var T = __webpack_require__(0);
663
+
613
664
  var lodash_1 = __webpack_require__(3);
665
+
614
666
  var i18n_1 = __webpack_require__(2);
667
+
615
668
  var Message_1 = __webpack_require__(10);
669
+
616
670
  var FixedSizeContainer_1 = __webpack_require__(13);
617
671
  /**
618
672
  * @method shouldShowIconPlaceholder
@@ -620,6 +674,8 @@ var FixedSizeContainer_1 = __webpack_require__(13);
620
674
  * @param {boolean} loading
621
675
  * @returns {boolean}
622
676
  */
677
+
678
+
623
679
  var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
624
680
  var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
625
681
  var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
@@ -628,6 +684,7 @@ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources)
628
684
  var noFields = fields === undefined;
629
685
  return loading || noData || noFields;
630
686
  };
687
+
631
688
  exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
632
689
  var propTypes = {
633
690
  icon: T.func,
@@ -642,11 +699,13 @@ var propTypes = {
642
699
  * @param {IconPlaceholderProps} props
643
700
  * @returns {React.ReactElement}
644
701
  */
702
+
645
703
  var IconPlaceholder = function IconPlaceholder(props) {
646
704
  var width = props.width,
647
- height = props.height,
648
- icon = props.icon,
649
- iconColor = props.iconColor;
705
+ height = props.height,
706
+ icon = props.icon,
707
+ iconColor = props.iconColor;
708
+
650
709
  if (icon) {
651
710
  return React.createElement(icon, {
652
711
  style: {
@@ -658,9 +717,11 @@ var IconPlaceholder = function IconPlaceholder(props) {
658
717
  transform: 'translate(-50%, -50%)'
659
718
  },
660
719
  width: '50%',
661
- height: '50%'
720
+ height: '50%',
721
+ 'data-test': 'icon-placeholder'
662
722
  });
663
723
  }
724
+
664
725
  return React.createElement(Message_1.default, {
665
726
  width: width,
666
727
  height: height,
@@ -668,6 +729,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
668
729
  message: (0, i18n_1._)('No DataSource Connected')
669
730
  });
670
731
  };
732
+
671
733
  IconPlaceholder.propTypes = propTypes;
672
734
  IconPlaceholder.defaultProps = {
673
735
  width: '100%',
@@ -683,21 +745,27 @@ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
683
745
 
684
746
 
685
747
  var _defineProperty = __webpack_require__(7);
748
+
686
749
  Object.defineProperty(exports, "__esModule", {
687
750
  value: true
688
751
  });
689
752
  exports.getSortingParams = exports.SortParamsPropTypes = void 0;
753
+
690
754
  var T = __webpack_require__(0);
755
+
691
756
  var lodash_1 = __webpack_require__(3);
692
- var DataSource_1 = __webpack_require__(43);
757
+
758
+ var DataSource_1 = __webpack_require__(34);
759
+
693
760
  exports.SortParamsPropTypes = T.shape({
694
761
  currentSortKey: T.string,
695
762
  currentSortDir: T.oneOf(DataSource_1.validSortDirs),
696
763
  onSort: T.func
697
764
  });
765
+
698
766
  var getSortingParams = function getSortingParams(_ref) {
699
767
  var requestParams = _ref.requestParams,
700
- onRequestParamsChange = _ref.onRequestParamsChange;
768
+ onRequestParamsChange = _ref.onRequestParamsChange;
701
769
  var currentSortKey;
702
770
  var currentSortDir;
703
771
  var nextSortDirMap = {
@@ -706,15 +774,18 @@ var getSortingParams = function getSortingParams(_ref) {
706
774
  none: 'asc'
707
775
  };
708
776
  var onSort;
777
+
709
778
  if (typeof onRequestParamsChange === 'function') {
710
779
  if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
711
780
  currentSortKey = Object.keys(requestParams.sort).shift();
712
781
  currentSortDir = requestParams.sort[currentSortKey];
713
- }
714
- // undid memoization since there is a dependency on requestParams, which is a deeply nested object
782
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
783
+
784
+
715
785
  onSort = function onSort(e, _ref2) {
716
786
  var sortKey = _ref2.sortKey,
717
- sortDir = _ref2.sortDir;
787
+ sortDir = _ref2.sortDir;
788
+
718
789
  if (typeof sortKey === 'string') {
719
790
  var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
720
791
  onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
@@ -726,12 +797,14 @@ var getSortingParams = function getSortingParams(_ref) {
726
797
  }
727
798
  };
728
799
  }
800
+
729
801
  return {
730
802
  currentSortKey: currentSortKey,
731
803
  currentSortDir: currentSortDir,
732
804
  onSort: onSort
733
805
  };
734
806
  };
807
+
735
808
  exports.getSortingParams = getSortingParams;
736
809
 
737
810
  /***/ }),
@@ -741,43 +814,68 @@ exports.getSortingParams = getSortingParams;
741
814
  "use strict";
742
815
 
743
816
 
817
+ Object.defineProperty(exports, "__esModule", {
818
+ value: true
819
+ });
820
+ exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
821
+ exports.validSortDirs = ['asc', 'desc', 'none'];
822
+ exports.validSegmentationModes = ['none', 'inner'];
823
+ exports.validOutputModes = ['json_cols', 'json'];
824
+
825
+ /***/ }),
826
+ /* 35 */
827
+ /***/ (function(module, exports, __webpack_require__) {
828
+
829
+ "use strict";
830
+
831
+
744
832
  Object.defineProperty(exports, "__esModule", {
745
833
  value: true
746
834
  });
747
835
  exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
836
+
748
837
  var T = __webpack_require__(0);
838
+
749
839
  var lodash_1 = __webpack_require__(3);
840
+
750
841
  exports.PaginatorParamsPropTypes = T.shape({
751
842
  isPaging: T.bool,
752
843
  current: T.number,
753
844
  totalPages: T.number,
754
845
  onChange: T.func
755
846
  });
847
+
756
848
  var getPaginationParams = function getPaginationParams(_ref) {
757
849
  var requestParams = _ref.requestParams,
758
- meta = _ref.meta,
759
- onRequestParamsChange = _ref.onRequestParamsChange;
850
+ meta = _ref.meta,
851
+ onRequestParamsChange = _ref.onRequestParamsChange;
760
852
  var totalCount = meta && meta.totalCount || 0;
761
853
  var offset = requestParams && requestParams.offset || 0;
762
854
  var count = requestParams && requestParams.count;
763
855
  var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
764
856
  var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
765
857
  var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
858
+
766
859
  var onChangeHandler = function onChangeHandler(e, _ref2) {
767
860
  var page = _ref2.page,
768
- countArg = _ref2.count;
861
+ countArg = _ref2.count;
769
862
  var newParams = (0, lodash_1.cloneDeep)(requestParams);
863
+
770
864
  if (typeof countArg === 'number') {
771
865
  newParams.count = countArg;
772
866
  newParams.offset = 0;
773
867
  }
868
+
774
869
  var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
870
+
775
871
  if (typeof page === 'number' && page > 0) {
776
872
  newParams.count = pageCount;
777
873
  newParams.offset = (page - 1) * pageCount;
778
874
  }
875
+
779
876
  onRequestParamsChange(newParams);
780
877
  };
878
+
781
879
  return {
782
880
  isPaging: isPaging,
783
881
  current: current,
@@ -785,10 +883,11 @@ var getPaginationParams = function getPaginationParams(_ref) {
785
883
  onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
786
884
  };
787
885
  };
886
+
788
887
  exports.getPaginationParams = getPaginationParams;
789
888
 
790
889
  /***/ }),
791
- /* 35 */
890
+ /* 36 */
792
891
  /***/ (function(module, exports, __webpack_require__) {
793
892
 
794
893
  "use strict";
@@ -799,6 +898,7 @@ Object.defineProperty(exports, "__esModule", {
799
898
  });
800
899
  exports.VizCategory = void 0;
801
900
  var VizCategory;
901
+
802
902
  (function (VizCategory) {
803
903
  VizCategory["SINGLE_VALUE"] = "Single Value";
804
904
  VizCategory["TRENDS"] = "Trends";
@@ -815,67 +915,96 @@ var VizCategory;
815
915
  })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
816
916
 
817
917
  /***/ }),
818
- /* 36 */
918
+ /* 37 */
819
919
  /***/ (function(module, exports, __webpack_require__) {
820
920
 
821
921
  "use strict";
822
922
 
823
923
 
824
924
  var _slicedToArray = __webpack_require__(17);
925
+
825
926
  Object.defineProperty(exports, "__esModule", {
826
927
  value: true
827
928
  });
929
+
828
930
  var React = __webpack_require__(1);
931
+
829
932
  var lodash_1 = __webpack_require__(3);
830
- var getSettingsFromThemedProps_1 = __webpack_require__(37);
933
+
934
+ var getSettingsFromThemedProps_1 = __webpack_require__(38);
935
+
831
936
  var Options_1 = __webpack_require__(30);
832
- var SanitizeProps_1 = __webpack_require__(38);
937
+
938
+ var SanitizeProps_1 = __webpack_require__(39);
939
+
833
940
  var TimezoneContext_1 = __webpack_require__(26);
834
- var moment_1 = __webpack_require__(39);
941
+
942
+ var moment_1 = __webpack_require__(40);
943
+
835
944
  var FeatureFlagContext_1 = __webpack_require__(21);
945
+
836
946
  var styled_components_1 = __webpack_require__(4);
947
+
837
948
  var hocUtils_1 = __webpack_require__(27);
949
+
838
950
  var JSONSchemaUtils_1 = __webpack_require__(28);
839
- var async_dynamic_options_evaluator_1 = __webpack_require__(40);
951
+
952
+ var async_dynamic_options_evaluator_1 = __webpack_require__(41);
953
+
840
954
  var id_1 = __webpack_require__(25);
841
- var SplunkVisualization_1 = __webpack_require__(41);
955
+
956
+ var SplunkVisualization_1 = __webpack_require__(42);
957
+
842
958
  var VizBehavior_1 = __webpack_require__(6);
959
+
843
960
  var getSorting_1 = __webpack_require__(33);
844
- var getPagination_1 = __webpack_require__(34);
961
+
962
+ var getPagination_1 = __webpack_require__(35);
963
+
845
964
  var useDeepMemo_1 = __webpack_require__(44);
965
+
846
966
  var MissingPropsMessage_1 = __webpack_require__(45);
967
+
847
968
  var withEditModeCover_1 = __webpack_require__(46);
969
+
848
970
  var withPlaceholder_1 = __webpack_require__(47);
849
971
  /**
850
972
  * hoc that wraps a pure react visualization in a Dashboard visualization
851
973
  * @param {DashboardVizOpts} opts
852
974
  * @returns {HOC}
853
975
  */
976
+
977
+
854
978
  var withDashboardViz = function withDashboardViz(opts) {
855
979
  var ReactViz = opts.ReactViz,
856
- vizConfig = opts.vizConfig,
857
- _opts$computeVizProps = opts.computeVizProps,
858
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
859
- disableEditModeCover = opts.disableEditModeCover,
860
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
980
+ vizConfig = opts.vizConfig,
981
+ _opts$computeVizProps = opts.computeVizProps,
982
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
983
+ disableEditModeCover = opts.disableEditModeCover,
984
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
985
+
861
986
  var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
862
987
  var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
988
+
863
989
  var DashboardViz = function DashboardViz(props) {
864
990
  var _a;
991
+
865
992
  var mode = props.mode,
866
- hasEventHandlers = props.hasEventHandlers,
867
- dataSources = props.dataSources,
868
- options = props.options,
869
- _props$context = props.context,
870
- context = _props$context === void 0 ? {} : _props$context,
871
- width = props.width,
872
- height = props.height,
873
- onComputedProps = props.onComputedProps,
874
- onEventTrigger = props.onEventTrigger,
875
- theme = props.theme,
876
- onRequestParamsChange = props.onRequestParamsChange;
993
+ hasEventHandlers = props.hasEventHandlers,
994
+ dataSources = props.dataSources,
995
+ options = props.options,
996
+ _props$context = props.context,
997
+ context = _props$context === void 0 ? {} : _props$context,
998
+ width = props.width,
999
+ height = props.height,
1000
+ onComputedProps = props.onComputedProps,
1001
+ onEventTrigger = props.onEventTrigger,
1002
+ theme = props.theme,
1003
+ onRequestParamsChange = props.onRequestParamsChange;
1004
+
877
1005
  var _React$useContext = React.useContext(TimezoneContext_1.default),
878
- serializedTimezone = _React$useContext.serializedTimezone;
1006
+ serializedTimezone = _React$useContext.serializedTimezone;
1007
+
879
1008
  if (serializedTimezone) {
880
1009
  /*
881
1010
  @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
@@ -889,38 +1018,51 @@ var withDashboardViz = function withDashboardViz(opts) {
889
1018
  moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
890
1019
  }
891
1020
  }
1021
+
892
1022
  var themeFunc = function themeFunc(themeVar) {
893
1023
  var _a, _b;
1024
+
894
1025
  return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
895
1026
  };
1027
+
896
1028
  var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1029
+
897
1030
  var _ref = (0, getSettingsFromThemedProps_1.default)({
898
- theme: theme
899
- }),
900
- currentThemeFamily = _ref.family,
901
- currentThemeColorScheme = _ref.colorScheme,
902
- currentThemeDensity = _ref.density;
1031
+ theme: theme
1032
+ }),
1033
+ currentThemeFamily = _ref.family,
1034
+ currentThemeColorScheme = _ref.colorScheme,
1035
+ currentThemeDensity = _ref.density;
1036
+
903
1037
  var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1038
+
904
1039
  var _React$useState = React.useState({}),
905
- _React$useState2 = _slicedToArray(_React$useState, 2),
906
- evaluatedOptionsAsync = _React$useState2[0],
907
- setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1040
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1041
+ evaluatedOptionsAsync = _React$useState2[0],
1042
+ setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1043
+
1044
+
908
1045
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
1046
+
909
1047
  var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
910
- _React$useState4 = _slicedToArray(_React$useState3, 1),
911
- visualizationID = _React$useState4[0];
1048
+ _React$useState4 = _slicedToArray(_React$useState3, 1),
1049
+ visualizationID = _React$useState4[0];
1050
+
912
1051
  var _React$useState5 = React.useState({}),
913
- _React$useState6 = _slicedToArray(_React$useState5, 2),
914
- dataSourcesInState = _React$useState6[0],
915
- setDataSourcesInState = _React$useState6[1];
1052
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
1053
+ dataSourcesInState = _React$useState6[0],
1054
+ setDataSourcesInState = _React$useState6[1];
1055
+
916
1056
  var _React$useState7 = React.useState(),
917
- _React$useState8 = _slicedToArray(_React$useState7, 2),
918
- dataFramesInState = _React$useState8[0],
919
- setDataFramesInState = _React$useState8[1];
1057
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
1058
+ dataFramesInState = _React$useState8[0],
1059
+ setDataFramesInState = _React$useState8[1];
1060
+
920
1061
  var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
921
- _React$useState10 = _slicedToArray(_React$useState9, 2),
922
- useAsyncEvaluatedOptions = _React$useState10[0],
923
- setUseAsyncEvaluatedOptions = _React$useState10[1];
1062
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
1063
+ useAsyncEvaluatedOptions = _React$useState10[0],
1064
+ setUseAsyncEvaluatedOptions = _React$useState10[1];
1065
+
924
1066
  var isMounted = React.useRef(true);
925
1067
  evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
926
1068
  try {
@@ -945,11 +1087,13 @@ var withDashboardViz = function withDashboardViz(opts) {
945
1087
  });
946
1088
  } else {
947
1089
  var dataFrames = dataFramesInState;
1090
+
948
1091
  if (dataSources !== dataSourcesInState) {
949
1092
  setDataSourcesInState(dataSources);
950
1093
  dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
951
1094
  setDataFramesInState(dataFrames);
952
1095
  }
1096
+
953
1097
  return Options_1.Options.evaluate({
954
1098
  context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
955
1099
  options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
@@ -960,21 +1104,24 @@ var withDashboardViz = function withDashboardViz(opts) {
960
1104
  console.error("unexpected error evaluating options: ".concat(e.message));
961
1105
  return {};
962
1106
  }
1107
+
963
1108
  return {};
964
1109
  }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
965
- var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
966
- // trellis specific backgroundColor update for onComputedProps
1110
+ var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
967
1111
  // 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
968
1112
  // onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
1113
+
969
1114
  var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
970
1115
  var clonedEvaluatedOptions = evaluatedOptionsToUse;
1116
+
971
1117
  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) {
972
1118
  clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
973
1119
  backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
974
1120
  });
975
- }
976
- // useEffect hook needs to be initialized before any early returns
1121
+ } // useEffect hook needs to be initialized before any early returns
977
1122
  // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1123
+
1124
+
978
1125
  React.useEffect(function () {
979
1126
  onComputedProps(clonedEvaluatedOptions);
980
1127
  });
@@ -984,53 +1131,68 @@ var withDashboardViz = function withDashboardViz(opts) {
984
1131
  isMounted.current = false;
985
1132
  async_dynamic_options_evaluator_1.default.reset(visualizationID);
986
1133
  }
987
- };
988
- // eslint-disable-next-line react-hooks/exhaustive-deps
989
- }, []);
990
- // present warning message if any required props are missing
1134
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
1135
+ }, []); // present warning message if any required props are missing
1136
+
991
1137
  var _vizConfig$requiredPr = vizConfig.requiredProps,
992
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
993
- supports = vizConfig.supports;
1138
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1139
+ supports = vizConfig.supports;
994
1140
  var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
1141
+
995
1142
  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
996
1143
  ) {
997
- return React.createElement(MissingPropsMessage_1.default, {
998
- "data-test": "missing-props-message",
999
- width: width,
1000
- height: height,
1001
- missingProps: missing,
1002
- backgroundColor: bgColorFromTheme
1003
- });
1004
- }
1005
- // events
1144
+ return React.createElement(MissingPropsMessage_1.default, {
1145
+ "data-test": "missing-props-message",
1146
+ width: width,
1147
+ height: height,
1148
+ missingProps: missing,
1149
+ backgroundColor: bgColorFromTheme
1150
+ });
1151
+ } // events
1152
+
1153
+
1006
1154
  var eventCallbackProps = {};
1155
+
1007
1156
  if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1008
1157
  var supportedEvents = vizConfig.events;
1009
1158
  Object.keys(supportedEvents).forEach(function (eventName) {
1010
- var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
1011
- eventCallbackProps[eventCallbackPropName] = null;
1012
- // todo: refactor single value and single value icon to send payload from viz
1159
+ var _supportedEvents$even = supportedEvents[eventName],
1160
+ parentKeys = _supportedEvents$even.parentKeys,
1161
+ payloadKeys = _supportedEvents$even.payloadKeys;
1162
+ var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName)); // todo: refactor single value and single value icon to send payload from viz
1013
1163
  // then remove these lines
1014
- var payloadKeys = supportedEvents[eventName].payloadKeys;
1164
+
1015
1165
  var payload = {};
1166
+
1016
1167
  if (Array.isArray(payloadKeys) && payloadKeys.length) {
1017
1168
  payloadKeys.forEach(function (p) {
1018
1169
  payload[p] = evaluatedOptionsToUse[p];
1019
1170
  });
1020
1171
  }
1172
+
1021
1173
  eventCallbackProps[eventCallbackPropName] = function (ev) {
1022
1174
  if (ev && ev.payload) {
1023
1175
  payload = ev.payload;
1024
1176
  }
1177
+
1025
1178
  return onEventTrigger({
1026
1179
  originalEvent: ev,
1027
1180
  payload: payload,
1028
1181
  type: eventName
1029
1182
  });
1030
1183
  };
1184
+
1185
+ if (parentKeys) {
1186
+ for (var i = parentKeys.length - 1; i >= 0; i -= 1) {
1187
+ var newObject = {};
1188
+ newObject[parentKeys[i]] = eventCallbackProps[eventCallbackPropName];
1189
+ eventCallbackProps[eventCallbackPropName] = newObject;
1190
+ }
1191
+ }
1031
1192
  });
1032
- }
1033
- // compute pure viz props which are not from options
1193
+ } // compute pure viz props which are not from options
1194
+
1195
+
1034
1196
  var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
1035
1197
  themeFunc: themeFunc
1036
1198
  }));
@@ -1048,15 +1210,19 @@ var withDashboardViz = function withDashboardViz(opts) {
1048
1210
  * In future, we could automatically detect which all datasources are being used
1049
1211
  * and bind those magically to pagination/sorting behavior.
1050
1212
  */
1213
+
1051
1214
  var dataSourceMetadata = {};
1052
1215
  var OptionKey = 'paginateDataSourceKey';
1053
1216
  var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
1217
+
1054
1218
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
1055
1219
  var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1056
1220
  var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
1221
+
1057
1222
  var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1058
1223
  return onRequestParamsChange(paginateDataSourceKey, payload);
1059
1224
  };
1225
+
1060
1226
  var sortParams = (0, getSorting_1.getSortingParams)({
1061
1227
  requestParams: requestParams,
1062
1228
  meta: meta,
@@ -1071,103 +1237,120 @@ var withDashboardViz = function withDashboardViz(opts) {
1071
1237
  sortParams: sortParams,
1072
1238
  paginatorParams: paginatorParams
1073
1239
  };
1074
- }
1075
- // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1240
+ } // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1241
+
1242
+
1076
1243
  if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
1077
1244
  return null;
1078
1245
  }
1246
+
1079
1247
  return React.createElement(SanitizedReactViz, Object.assign({
1080
1248
  mode: mode,
1081
1249
  width: width,
1082
1250
  height: height
1083
1251
  }, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
1084
1252
  };
1253
+
1085
1254
  DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1086
1255
  DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1087
1256
  // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1088
1257
  theme: {}
1089
- });
1090
- // attach viz config
1091
- DashboardViz.config = vizConfig;
1092
- // @ts-ignore: TODO fix sc upgrade TS issues
1258
+ }); // attach viz config
1259
+
1260
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1261
+
1093
1262
  return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
1094
1263
  };
1264
+
1095
1265
  exports.default = withDashboardViz;
1096
1266
 
1097
1267
  /***/ }),
1098
- /* 37 */
1268
+ /* 38 */
1099
1269
  /***/ (function(module, exports) {
1100
1270
 
1101
1271
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1102
1272
 
1103
1273
  /***/ }),
1104
- /* 38 */
1274
+ /* 39 */
1105
1275
  /***/ (function(module, exports) {
1106
1276
 
1107
1277
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1108
1278
 
1109
1279
  /***/ }),
1110
- /* 39 */
1280
+ /* 40 */
1111
1281
  /***/ (function(module, exports) {
1112
1282
 
1113
1283
  module.exports = require("@splunk/moment");
1114
1284
 
1115
1285
  /***/ }),
1116
- /* 40 */
1286
+ /* 41 */
1117
1287
  /***/ (function(module, exports) {
1118
1288
 
1119
1289
  module.exports = require("@splunk/async-dynamic-options-evaluator");
1120
1290
 
1121
1291
  /***/ }),
1122
- /* 41 */
1292
+ /* 42 */
1123
1293
  /***/ (function(module, exports, __webpack_require__) {
1124
1294
 
1125
1295
  "use strict";
1126
1296
 
1127
1297
 
1128
1298
  var _classCallCheck = __webpack_require__(9);
1299
+
1129
1300
  Object.defineProperty(exports, "__esModule", {
1130
1301
  value: true
1131
1302
  });
1132
1303
  exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1133
1304
  /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1305
+
1134
1306
  var T = __webpack_require__(0);
1307
+
1135
1308
  var lodash_1 = __webpack_require__(3);
1136
- var VizActionHandler_1 = __webpack_require__(42);
1137
- // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1309
+
1310
+ var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1311
+
1312
+
1138
1313
  exports.INITIAL_WIDTH = 250;
1139
1314
  exports.INITIAL_HEIGHT = 250;
1140
1315
  /**
1141
1316
  * A Splunk visualization
1142
1317
  */
1318
+
1143
1319
  var SplunkVisualization = function SplunkVisualization() {
1144
1320
  _classCallCheck(this, SplunkVisualization);
1145
1321
  };
1322
+
1146
1323
  SplunkVisualization.propTypes = {
1147
1324
  /**
1148
1325
  * display mode
1149
1326
  */
1150
1327
  mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1328
+
1151
1329
  /**
1152
1330
  * width in pixel or string, defaults to 100%
1153
1331
  */
1154
1332
  width: T.oneOfType([T.string, T.number]).isRequired,
1333
+
1155
1334
  /**
1156
1335
  * height in pixel or string
1157
1336
  */
1158
1337
  height: T.oneOfType([T.string, T.number]).isRequired,
1338
+
1159
1339
  /**
1160
1340
  * visualization context used for dynamic option evaluation
1161
1341
  */
1162
1342
  context: T.object,
1343
+
1163
1344
  /**
1164
1345
  * visualization formatting options
1165
1346
  */
1166
1347
  options: T.object,
1348
+
1167
1349
  /**
1168
1350
  * A callback to update formatting options
1169
1351
  */
1170
1352
  onOptionsChange: T.func,
1353
+
1171
1354
  /**
1172
1355
  * datasource state which include data and request params, object key indicate the datasource type.
1173
1356
  */
@@ -1176,6 +1359,7 @@ SplunkVisualization.propTypes = {
1176
1359
  * current request params
1177
1360
  */
1178
1361
  requestParams: T.object,
1362
+
1179
1363
  /**
1180
1364
  * current dataset
1181
1365
  */
@@ -1183,6 +1367,7 @@ SplunkVisualization.propTypes = {
1183
1367
  fields: T.array,
1184
1368
  columns: T.array
1185
1369
  }),
1370
+
1186
1371
  /**
1187
1372
  * error
1188
1373
  */
@@ -1190,29 +1375,35 @@ SplunkVisualization.propTypes = {
1190
1375
  level: T.string,
1191
1376
  message: T.string
1192
1377
  }),
1378
+
1193
1379
  /**
1194
1380
  * meta data that came with the dataset
1195
1381
  */
1196
1382
  meta: T.object
1197
1383
  })),
1384
+
1198
1385
  /**
1199
1386
  * A callback to trigger event
1200
1387
  */
1201
1388
  onEventTrigger: T.func,
1389
+
1202
1390
  /**
1203
1391
  * Inform viz if there are handlers listening to events
1204
1392
  */
1205
1393
  hasEventHandlers: T.bool,
1394
+
1206
1395
  /**
1207
1396
  * A callback to communicate computed props to a consumer
1208
1397
  */
1209
1398
  onComputedProps: T.func,
1399
+
1210
1400
  /**
1211
1401
  * A callback to obtain visualization api
1212
1402
  */
1213
1403
  vizActionHandlerRef: T.func,
1214
1404
  loading: T.bool,
1215
1405
  theme: T.object,
1406
+
1216
1407
  /**
1217
1408
  * A callback to request new data with updated request params
1218
1409
  */
@@ -1221,6 +1412,7 @@ SplunkVisualization.propTypes = {
1221
1412
  /**
1222
1413
  *
1223
1414
  */
1415
+
1224
1416
  SplunkVisualization.defaultProps = {
1225
1417
  // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1226
1418
  width: '100%',
@@ -1248,26 +1440,29 @@ SplunkVisualization.defaultProps = {
1248
1440
  exports.default = SplunkVisualization;
1249
1441
 
1250
1442
  /***/ }),
1251
- /* 42 */
1443
+ /* 43 */
1252
1444
  /***/ (function(module, exports, __webpack_require__) {
1253
1445
 
1254
1446
  "use strict";
1255
1447
 
1256
1448
 
1257
1449
  var _classCallCheck = __webpack_require__(9);
1450
+
1258
1451
  var _createClass = __webpack_require__(18);
1452
+
1259
1453
  Object.defineProperty(exports, "__esModule", {
1260
1454
  value: true
1261
1455
  });
1262
1456
  exports.DefaultVizActionHandler = void 0;
1457
+
1263
1458
  var DefaultVizActionHandler = /*#__PURE__*/function () {
1264
1459
  function DefaultVizActionHandler() {
1265
1460
  _classCallCheck(this, DefaultVizActionHandler);
1266
1461
  }
1462
+
1267
1463
  _createClass(DefaultVizActionHandler, [{
1268
1464
  key: "focus",
1269
- value: function focus() {
1270
- // noop
1465
+ value: function focus() {// noop
1271
1466
  }
1272
1467
  }, {
1273
1468
  key: "snapshot",
@@ -1275,22 +1470,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
1275
1470
  return null; // noop
1276
1471
  }
1277
1472
  }]);
1473
+
1278
1474
  return DefaultVizActionHandler;
1279
1475
  }();
1280
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
1281
-
1282
- /***/ }),
1283
- /* 43 */
1284
- /***/ (function(module, exports, __webpack_require__) {
1285
1476
 
1286
- "use strict";
1287
-
1288
-
1289
- Object.defineProperty(exports, "__esModule", {
1290
- value: true
1291
- });
1292
- exports.validSortDirs = void 0;
1293
- exports.validSortDirs = ['asc', 'desc', 'none'];
1477
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1294
1478
 
1295
1479
  /***/ }),
1296
1480
  /* 44 */
@@ -1303,7 +1487,9 @@ Object.defineProperty(exports, "__esModule", {
1303
1487
  value: true
1304
1488
  });
1305
1489
  exports.useDeepMemo = void 0;
1490
+
1306
1491
  var react_1 = __webpack_require__(1);
1492
+
1307
1493
  var lodash_1 = __webpack_require__(3);
1308
1494
  /**
1309
1495
  * This hook evaluates and stores the result of a passed function and only
@@ -1318,16 +1504,21 @@ var lodash_1 = __webpack_require__(3);
1318
1504
  * @param fn the function to be executed and
1319
1505
  * @param dependencies an array of dependencies
1320
1506
  */
1507
+
1508
+
1321
1509
  var useDeepMemo = function useDeepMemo(fn, dependencies) {
1322
1510
  var ref = (0, react_1.useRef)();
1511
+
1323
1512
  if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
1324
1513
  ref.current = {
1325
1514
  dependencies: dependencies,
1326
1515
  value: fn()
1327
1516
  };
1328
1517
  }
1518
+
1329
1519
  return ref.current.value;
1330
1520
  };
1521
+
1331
1522
  exports.useDeepMemo = useDeepMemo;
1332
1523
 
1333
1524
  /***/ }),
@@ -1341,19 +1532,27 @@ Object.defineProperty(exports, "__esModule", {
1341
1532
  value: true
1342
1533
  });
1343
1534
  exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1535
+
1344
1536
  var React = __webpack_require__(1);
1537
+
1345
1538
  var T = __webpack_require__(0);
1539
+
1346
1540
  var i18n_1 = __webpack_require__(2);
1541
+
1347
1542
  var Message_1 = __webpack_require__(10);
1543
+
1348
1544
  var FixedSizeContainer_1 = __webpack_require__(13);
1349
1545
  /**
1350
1546
  * @method isMissing
1351
1547
  * @param {any} v
1352
1548
  * @returns {boolean} true if the input value === null or undefined
1353
1549
  */
1550
+
1551
+
1354
1552
  var isMissing = function isMissing(v) {
1355
1553
  return v === null || v === undefined;
1356
1554
  };
1555
+
1357
1556
  exports.isMissing = isMissing;
1358
1557
  /**
1359
1558
  * @method misskingKeys
@@ -1361,11 +1560,13 @@ exports.isMissing = isMissing;
1361
1560
  * @param {object} target
1362
1561
  * @returns {string[]} the keys of missing required props
1363
1562
  */
1563
+
1364
1564
  var missingKeys = function missingKeys(keys, target) {
1365
1565
  return keys.filter(function (k) {
1366
1566
  return (0, exports.isMissing)(target[k]);
1367
1567
  });
1368
1568
  };
1569
+
1369
1570
  exports.missingKeys = missingKeys;
1370
1571
  var propTypes = {
1371
1572
  width: T.oneOfType([T.string, T.number]),
@@ -1379,10 +1580,11 @@ var propTypes = {
1379
1580
  * @param {MissingPropsProps} props
1380
1581
  * @returns {React.ReactElement}
1381
1582
  */
1583
+
1382
1584
  var MissingPropsMessage = function MissingPropsMessage(props) {
1383
1585
  var width = props.width,
1384
- height = props.height,
1385
- missingProps = props.missingProps;
1586
+ height = props.height,
1587
+ missingProps = props.missingProps;
1386
1588
  return React.createElement(Message_1.default, {
1387
1589
  "data-test": "message",
1388
1590
  width: width,
@@ -1390,6 +1592,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
1390
1592
  message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
1391
1593
  });
1392
1594
  };
1595
+
1393
1596
  exports.MissingPropsMessage = MissingPropsMessage;
1394
1597
  exports.MissingPropsMessage.propTypes = propTypes;
1395
1598
  exports.MissingPropsMessage.defaultProps = {
@@ -1408,15 +1611,19 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage)
1408
1611
  Object.defineProperty(exports, "__esModule", {
1409
1612
  value: true
1410
1613
  });
1614
+
1411
1615
  var React = __webpack_require__(1);
1616
+
1412
1617
  var styled_components_1 = __webpack_require__(4);
1618
+
1413
1619
  var hocUtils_1 = __webpack_require__(15);
1620
+
1414
1621
  var Cover = styled_components_1.default.div.withConfig({
1415
1622
  displayName: "withEditModeCover__Cover",
1416
1623
  componentId: "sc-1gsbnxb-0"
1417
1624
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1418
1625
  var Blocker = styled_components_1.default.div.attrs({
1419
- 'data-splunk-visualization-version': "26.0.0 - 2f7458907"
1626
+ 'data-splunk-visualization-version': "26.1.1 - b6df0a015"
1420
1627
  }).withConfig({
1421
1628
  displayName: "withEditModeCover__Blocker",
1422
1629
  componentId: "sc-1gsbnxb-1"
@@ -1427,6 +1634,7 @@ var Blocker = styled_components_1.default.div.attrs({
1427
1634
  * @param {ExtendedDashViz} Visualization
1428
1635
  * @returns {ExtendedDashViz} Wrapper
1429
1636
  */
1637
+
1430
1638
  var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1431
1639
  var Wrapper = function Wrapper(props) {
1432
1640
  var mode = props.mode;
@@ -1435,12 +1643,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
1435
1643
  "data-test": "edit-mode-cover"
1436
1644
  }));
1437
1645
  };
1646
+
1438
1647
  (0, hocUtils_1.extendStaticWrapperProps)({
1439
1648
  Wrapper: Wrapper,
1440
1649
  Visualization: Visualization
1441
1650
  });
1442
1651
  return Wrapper;
1443
1652
  };
1653
+
1444
1654
  exports.default = withEditModeCover;
1445
1655
 
1446
1656
  /***/ }),
@@ -1453,27 +1663,37 @@ exports.default = withEditModeCover;
1453
1663
  Object.defineProperty(exports, "__esModule", {
1454
1664
  value: true
1455
1665
  });
1666
+
1456
1667
  var React = __webpack_require__(1);
1668
+
1457
1669
  var colorUtils_1 = __webpack_require__(12);
1670
+
1458
1671
  var variables_1 = __webpack_require__(11);
1672
+
1459
1673
  var IconPlaceholder_1 = __webpack_require__(32);
1674
+
1460
1675
  var VizBehavior_1 = __webpack_require__(6);
1676
+
1461
1677
  var hocUtils_1 = __webpack_require__(15);
1678
+
1462
1679
  var withPlaceholder = function withPlaceholder(Visualization) {
1463
1680
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
1464
1681
  var config = Visualization.config;
1465
1682
  var themes = config.themes;
1683
+
1466
1684
  var Wrapper = function Wrapper(props) {
1467
1685
  var _a, _b;
1686
+
1468
1687
  var dataSources = props.dataSources,
1469
- loading = props.loading,
1470
- options = props.options,
1471
- height = props.height,
1472
- width = props.width;
1688
+ loading = props.loading,
1689
+ options = props.options,
1690
+ height = props.height,
1691
+ width = props.width;
1473
1692
  var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
1474
1693
  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);
1475
1694
  var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
1476
1695
  var iconColor = variables_1.default.contentColorActive(props);
1696
+
1477
1697
  if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
1478
1698
  return React.createElement(IconPlaceholder_1.default, {
1479
1699
  "data-test": "icon-placeholder",
@@ -1484,14 +1704,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
1484
1704
  iconColor: iconColor
1485
1705
  });
1486
1706
  }
1707
+
1487
1708
  return React.createElement(Visualization, Object.assign({}, props));
1488
1709
  };
1710
+
1489
1711
  (0, hocUtils_1.extendStaticWrapperProps)({
1490
1712
  Wrapper: Wrapper,
1491
1713
  Visualization: Visualization
1492
1714
  });
1493
1715
  return Wrapper;
1494
1716
  };
1717
+
1495
1718
  exports.default = withPlaceholder;
1496
1719
 
1497
1720
  /***/ }),
@@ -1581,11 +1804,14 @@ Object.defineProperty(exports, "__esModule", {
1581
1804
  value: true
1582
1805
  });
1583
1806
  exports.getDynamicFillColorEditor = void 0;
1807
+
1584
1808
  var i18n_1 = __webpack_require__(2);
1809
+
1585
1810
  var configUtils_1 = __webpack_require__(22);
1811
+
1586
1812
  var getDynamicFillColorEditor = function getDynamicFillColorEditor(_ref) {
1587
1813
  var defaultContext = _ref.defaultContext,
1588
- defaultPalettesConfig = _ref.defaultPalettesConfig;
1814
+ defaultPalettesConfig = _ref.defaultPalettesConfig;
1589
1815
  return {
1590
1816
  label: (0, i18n_1._)('Fill'),
1591
1817
  option: 'fillColor',
@@ -1619,6 +1845,7 @@ var getDynamicFillColorEditor = function getDynamicFillColorEditor(_ref) {
1619
1845
  }
1620
1846
  };
1621
1847
  };
1848
+
1622
1849
  exports.getDynamicFillColorEditor = getDynamicFillColorEditor;
1623
1850
 
1624
1851
  /***/ }),
@@ -1632,11 +1859,14 @@ Object.defineProperty(exports, "__esModule", {
1632
1859
  value: true
1633
1860
  });
1634
1861
  exports.getDynamicStrokeColorEditor = void 0;
1862
+
1635
1863
  var i18n_1 = __webpack_require__(2);
1864
+
1636
1865
  var configUtils_1 = __webpack_require__(22);
1866
+
1637
1867
  var getDynamicStrokeColorEditor = function getDynamicStrokeColorEditor(_ref) {
1638
1868
  var defaultContext = _ref.defaultContext,
1639
- defaultPalettesConfig = _ref.defaultPalettesConfig;
1869
+ defaultPalettesConfig = _ref.defaultPalettesConfig;
1640
1870
  return {
1641
1871
  label: (0, i18n_1._)('Stroke'),
1642
1872
  option: 'strokeColor',
@@ -1670,6 +1900,7 @@ var getDynamicStrokeColorEditor = function getDynamicStrokeColorEditor(_ref) {
1670
1900
  }
1671
1901
  };
1672
1902
  };
1903
+
1673
1904
  exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
1674
1905
 
1675
1906
  /***/ }),
@@ -1682,8 +1913,11 @@ exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
1682
1913
  Object.defineProperty(exports, "__esModule", {
1683
1914
  value: true
1684
1915
  });
1916
+
1685
1917
  var i18n_1 = __webpack_require__(2);
1918
+
1686
1919
  var configUtils_1 = __webpack_require__(22);
1920
+
1687
1921
  var StaticFillColorEditor = {
1688
1922
  label: (0, i18n_1._)('Fill'),
1689
1923
  option: 'fillColor',
@@ -1705,8 +1939,11 @@ exports.default = StaticFillColorEditor;
1705
1939
  Object.defineProperty(exports, "__esModule", {
1706
1940
  value: true
1707
1941
  });
1942
+
1708
1943
  var i18n_1 = __webpack_require__(2);
1944
+
1709
1945
  var configUtils_1 = __webpack_require__(22);
1946
+
1710
1947
  var StaticStrokeColorEditor = {
1711
1948
  label: (0, i18n_1._)('Stroke'),
1712
1949
  option: 'strokeColor',
@@ -1726,17 +1963,25 @@ exports.default = StaticStrokeColorEditor;
1726
1963
 
1727
1964
 
1728
1965
  var _taggedTemplateLiteral = __webpack_require__(59);
1966
+
1729
1967
  var _templateObject;
1968
+
1730
1969
  Object.defineProperty(exports, "__esModule", {
1731
1970
  value: true
1732
1971
  });
1733
1972
  exports.getStyledShape = exports.mapToOldKey = void 0;
1973
+
1734
1974
  var lodash_1 = __webpack_require__(3);
1975
+
1735
1976
  var styled_components_1 = __webpack_require__(4);
1977
+
1736
1978
  var pick_1 = __webpack_require__(23);
1979
+
1737
1980
  var variables_1 = __webpack_require__(11);
1738
- var propUtils_1 = __webpack_require__(29);
1739
- // map for new options names to old option names
1981
+
1982
+ var propUtils_1 = __webpack_require__(29); // map for new options names to old option names
1983
+
1984
+
1740
1985
  var shapeOptionsMapping = {
1741
1986
  fillColor: 'fill',
1742
1987
  strokeColor: 'stroke',
@@ -1749,17 +1994,20 @@ var shapeOptionsMapping = {
1749
1994
  * @param {Object} options
1750
1995
  * @returns {Object}
1751
1996
  */
1997
+
1752
1998
  var mapToOldKey = function mapToOldKey(options) {
1753
1999
  return (0, lodash_1.mapKeys)(options, function (val, key) {
1754
2000
  return shapeOptionsMapping[key] ? shapeOptionsMapping[key] : key;
1755
2001
  });
1756
2002
  };
2003
+
1757
2004
  exports.mapToOldKey = mapToOldKey;
1758
2005
  /**
1759
2006
  * Helper method to get styled component for ellipse or rectangle
1760
2007
  * @method mapToOldKey
1761
2008
  * @param {Shape} shape
1762
2009
  */
2010
+
1763
2011
  var getStyledShape = function getStyledShape(shape) {
1764
2012
  return (0, styled_components_1.default)(shape)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fill: ", ";\n stroke: ", ";\n cursor: ", ";\n"])), function (props) {
1765
2013
  return props.fill && (0, propUtils_1.formatColor)(props.fill) || (0, pick_1.default)({
@@ -1781,6 +2029,7 @@ var getStyledShape = function getStyledShape(shape) {
1781
2029
  return props.onClick ? 'pointer' : 'inherit';
1782
2030
  });
1783
2031
  };
2032
+
1784
2033
  exports.getStyledShape = getStyledShape;
1785
2034
 
1786
2035
  /***/ }),
@@ -1822,26 +2071,38 @@ exports.getStyledShape = getStyledShape;
1822
2071
 
1823
2072
  var __rest = this && this.__rest || function (s, e) {
1824
2073
  var t = {};
2074
+
1825
2075
  for (var p in s) {
1826
2076
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1827
2077
  }
2078
+
1828
2079
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1829
2080
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1830
2081
  }
1831
2082
  return t;
1832
2083
  };
2084
+
1833
2085
  Object.defineProperty(exports, "__esModule", {
1834
2086
  value: true
1835
2087
  });
1836
2088
  exports.config = exports.themes = void 0;
2089
+
1837
2090
  var React = __webpack_require__(1);
2091
+
1838
2092
  var lodash_1 = __webpack_require__(3);
2093
+
1839
2094
  var styled_components_1 = __webpack_require__(4);
2095
+
1840
2096
  var T = __webpack_require__(0);
1841
- var config_1 = __webpack_require__(201);
2097
+
2098
+ var config_1 = __webpack_require__(202);
2099
+
1842
2100
  exports.config = config_1.default;
1843
- var withDashboardViz_1 = __webpack_require__(36);
2101
+
2102
+ var withDashboardViz_1 = __webpack_require__(37);
2103
+
1844
2104
  var shapeUtils_1 = __webpack_require__(118);
2105
+
1845
2106
  var validOptions = Object.keys(config_1.default.optionsSchema);
1846
2107
  var SVGContainer = styled_components_1.default.svg.withConfig({
1847
2108
  displayName: "Ellipse__SVGContainer",
@@ -1852,11 +2113,12 @@ var SVGContainer = styled_components_1.default.svg.withConfig({
1852
2113
  return props.height;
1853
2114
  });
1854
2115
  var EllipseShape = (0, shapeUtils_1.getStyledShape)('ellipse');
2116
+
1855
2117
  var EllipseVisualization = function EllipseVisualization(_ref) {
1856
2118
  var height = _ref.height,
1857
- width = _ref.width,
1858
- onEllipseClick = _ref.onEllipseClick,
1859
- options = _ref.options;
2119
+ width = _ref.width,
2120
+ onEllipseClick = _ref.onEllipseClick,
2121
+ options = _ref.options;
1860
2122
  return React.createElement(SVGContainer, {
1861
2123
  width: width,
1862
2124
  height: height
@@ -1870,10 +2132,12 @@ var EllipseVisualization = function EllipseVisualization(_ref) {
1870
2132
  onClick: onEllipseClick
1871
2133
  })));
1872
2134
  };
2135
+
1873
2136
  var computeVizProps = function computeVizProps(_a) {
1874
2137
  var width = _a.width,
1875
- height = _a.height,
1876
- options = __rest(_a, ["width", "height"]);
2138
+ height = _a.height,
2139
+ options = __rest(_a, ["width", "height"]);
2140
+
1877
2141
  var computedProps = {
1878
2142
  width: width,
1879
2143
  height: height
@@ -1881,6 +2145,7 @@ var computeVizProps = function computeVizProps(_a) {
1881
2145
  computedProps.options = (0, lodash_1.chain)(options).pick(validOptions).thru(shapeUtils_1.mapToOldKey).value();
1882
2146
  return computedProps;
1883
2147
  };
2148
+
1884
2149
  var propTypes = {
1885
2150
  width: T.oneOfType([T.string, T.number]),
1886
2151
  height: T.oneOfType([T.string, T.number]),
@@ -1955,7 +2220,8 @@ exports.default = Ellipse;
1955
2220
  /* 197 */,
1956
2221
  /* 198 */,
1957
2222
  /* 199 */,
1958
- /* 200 */
2223
+ /* 200 */,
2224
+ /* 201 */
1959
2225
  /***/ (function(module, exports, __webpack_require__) {
1960
2226
 
1961
2227
  "use strict";
@@ -1964,6 +2230,7 @@ exports.default = Ellipse;
1964
2230
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1965
2231
  if (k2 === undefined) k2 = k;
1966
2232
  var desc = Object.getOwnPropertyDescriptor(m, k);
2233
+
1967
2234
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1968
2235
  desc = {
1969
2236
  enumerable: true,
@@ -1972,22 +2239,28 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
1972
2239
  }
1973
2240
  };
1974
2241
  }
2242
+
1975
2243
  Object.defineProperty(o, k2, desc);
1976
2244
  } : function (o, m, k, k2) {
1977
2245
  if (k2 === undefined) k2 = k;
1978
2246
  o[k2] = m[k];
1979
2247
  });
2248
+
1980
2249
  var __exportStar = this && this.__exportStar || function (m, exports) {
1981
2250
  for (var p in m) {
1982
2251
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1983
2252
  }
1984
2253
  };
2254
+
1985
2255
  Object.defineProperty(exports, "__esModule", {
1986
2256
  value: true
1987
2257
  });
1988
2258
  exports.default = void 0;
2259
+
1989
2260
  __exportStar(__webpack_require__(149), exports);
2261
+
1990
2262
  var Ellipse_1 = __webpack_require__(149);
2263
+
1991
2264
  Object.defineProperty(exports, "default", {
1992
2265
  enumerable: true,
1993
2266
  get: function get() {
@@ -1996,7 +2269,7 @@ Object.defineProperty(exports, "default", {
1996
2269
  });
1997
2270
 
1998
2271
  /***/ }),
1999
- /* 201 */
2272
+ /* 202 */
2000
2273
  /***/ (function(module, exports, __webpack_require__) {
2001
2274
 
2002
2275
  "use strict";
@@ -2005,17 +2278,29 @@ Object.defineProperty(exports, "default", {
2005
2278
  Object.defineProperty(exports, "__esModule", {
2006
2279
  value: true
2007
2280
  });
2281
+
2008
2282
  var i18n_1 = __webpack_require__(2);
2283
+
2009
2284
  var PresetPalettes_1 = __webpack_require__(61);
2285
+
2010
2286
  var pick_1 = __webpack_require__(23);
2287
+
2011
2288
  var variables_1 = __webpack_require__(11);
2289
+
2012
2290
  var VizBehavior_1 = __webpack_require__(6);
2013
- var VizCategory_1 = __webpack_require__(35);
2291
+
2292
+ var VizCategory_1 = __webpack_require__(36);
2293
+
2014
2294
  var configUtils_1 = __webpack_require__(20);
2295
+
2015
2296
  var DynamicFillColorEditor_1 = __webpack_require__(114);
2297
+
2016
2298
  var DynamicStrokeColorEditor_1 = __webpack_require__(115);
2299
+
2017
2300
  var StaticFillColorEditor_1 = __webpack_require__(116);
2301
+
2018
2302
  var StaticStrokeColorEditor_1 = __webpack_require__(117);
2303
+
2019
2304
  var dataContract = {
2020
2305
  requiredDataSources: [],
2021
2306
  optionalDataSources: [{
@@ -2215,7 +2500,7 @@ var editorConfig = [{
2215
2500
  presets: presets,
2216
2501
  value: function value(_ref) {
2217
2502
  var context = _ref.context,
2218
- options = _ref.options;
2503
+ options = _ref.options;
2219
2504
  var initialPreset = (0, configUtils_1.getInitialPreset)(context, options, presets);
2220
2505
  return initialPreset && initialPreset.label || null;
2221
2506
  }
@@ -2267,16 +2552,19 @@ var editorConfig = [{
2267
2552
  /**
2268
2553
  * visualization configuration
2269
2554
  */
2555
+
2270
2556
  var config = {
2271
2557
  /**
2272
2558
  * unique viz key
2273
2559
  */
2274
2560
  key: 'splunk.ellipse',
2561
+
2275
2562
  /**
2276
2563
  * viz name
2277
2564
  */
2278
2565
  name: (0, i18n_1._)('Ellipse'),
2279
2566
  category: VizCategory_1.VizCategory.SHAPES,
2567
+
2280
2568
  /**
2281
2569
  * viz icon
2282
2570
  */