@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/Rectangle.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
  */
@@ -130,11 +130,14 @@ Object.defineProperty(exports, "__esModule", {
130
130
  value: true
131
131
  });
132
132
  exports.getDynamicFillColorEditor = void 0;
133
+
133
134
  var i18n_1 = __webpack_require__(2);
135
+
134
136
  var configUtils_1 = __webpack_require__(22);
137
+
135
138
  var getDynamicFillColorEditor = function getDynamicFillColorEditor(_ref) {
136
139
  var defaultContext = _ref.defaultContext,
137
- defaultPalettesConfig = _ref.defaultPalettesConfig;
140
+ defaultPalettesConfig = _ref.defaultPalettesConfig;
138
141
  return {
139
142
  label: (0, i18n_1._)('Fill'),
140
143
  option: 'fillColor',
@@ -168,6 +171,7 @@ var getDynamicFillColorEditor = function getDynamicFillColorEditor(_ref) {
168
171
  }
169
172
  };
170
173
  };
174
+
171
175
  exports.getDynamicFillColorEditor = getDynamicFillColorEditor;
172
176
 
173
177
  /***/ }),
@@ -182,11 +186,14 @@ Object.defineProperty(exports, "__esModule", {
182
186
  value: true
183
187
  });
184
188
  exports.getDynamicStrokeColorEditor = void 0;
189
+
185
190
  var i18n_1 = __webpack_require__(2);
191
+
186
192
  var configUtils_1 = __webpack_require__(22);
193
+
187
194
  var getDynamicStrokeColorEditor = function getDynamicStrokeColorEditor(_ref) {
188
195
  var defaultContext = _ref.defaultContext,
189
- defaultPalettesConfig = _ref.defaultPalettesConfig;
196
+ defaultPalettesConfig = _ref.defaultPalettesConfig;
190
197
  return {
191
198
  label: (0, i18n_1._)('Stroke'),
192
199
  option: 'strokeColor',
@@ -220,6 +227,7 @@ var getDynamicStrokeColorEditor = function getDynamicStrokeColorEditor(_ref) {
220
227
  }
221
228
  };
222
229
  };
230
+
223
231
  exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
224
232
 
225
233
  /***/ }),
@@ -233,8 +241,11 @@ exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
233
241
  Object.defineProperty(exports, "__esModule", {
234
242
  value: true
235
243
  });
244
+
236
245
  var i18n_1 = __webpack_require__(2);
246
+
237
247
  var configUtils_1 = __webpack_require__(22);
248
+
238
249
  var StaticFillColorEditor = {
239
250
  label: (0, i18n_1._)('Fill'),
240
251
  option: 'fillColor',
@@ -257,8 +268,11 @@ exports.default = StaticFillColorEditor;
257
268
  Object.defineProperty(exports, "__esModule", {
258
269
  value: true
259
270
  });
271
+
260
272
  var i18n_1 = __webpack_require__(2);
273
+
261
274
  var configUtils_1 = __webpack_require__(22);
275
+
262
276
  var StaticStrokeColorEditor = {
263
277
  label: (0, i18n_1._)('Stroke'),
264
278
  option: 'strokeColor',
@@ -279,17 +293,25 @@ exports.default = StaticStrokeColorEditor;
279
293
 
280
294
 
281
295
  var _taggedTemplateLiteral = __webpack_require__(59);
296
+
282
297
  var _templateObject;
298
+
283
299
  Object.defineProperty(exports, "__esModule", {
284
300
  value: true
285
301
  });
286
302
  exports.getStyledShape = exports.mapToOldKey = void 0;
303
+
287
304
  var lodash_1 = __webpack_require__(3);
305
+
288
306
  var styled_components_1 = __webpack_require__(4);
307
+
289
308
  var pick_1 = __webpack_require__(23);
309
+
290
310
  var variables_1 = __webpack_require__(11);
291
- var propUtils_1 = __webpack_require__(29);
292
- // map for new options names to old option names
311
+
312
+ var propUtils_1 = __webpack_require__(29); // map for new options names to old option names
313
+
314
+
293
315
  var shapeOptionsMapping = {
294
316
  fillColor: 'fill',
295
317
  strokeColor: 'stroke',
@@ -302,17 +324,20 @@ var shapeOptionsMapping = {
302
324
  * @param {Object} options
303
325
  * @returns {Object}
304
326
  */
327
+
305
328
  var mapToOldKey = function mapToOldKey(options) {
306
329
  return (0, lodash_1.mapKeys)(options, function (val, key) {
307
330
  return shapeOptionsMapping[key] ? shapeOptionsMapping[key] : key;
308
331
  });
309
332
  };
333
+
310
334
  exports.mapToOldKey = mapToOldKey;
311
335
  /**
312
336
  * Helper method to get styled component for ellipse or rectangle
313
337
  * @method mapToOldKey
314
338
  * @param {Shape} shape
315
339
  */
340
+
316
341
  var getStyledShape = function getStyledShape(shape) {
317
342
  return (0, styled_components_1.default)(shape)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fill: ", ";\n stroke: ", ";\n cursor: ", ";\n"])), function (props) {
318
343
  return props.fill && (0, propUtils_1.formatColor)(props.fill) || (0, pick_1.default)({
@@ -334,6 +359,7 @@ var getStyledShape = function getStyledShape(shape) {
334
359
  return props.onClick ? 'pointer' : 'inherit';
335
360
  });
336
361
  };
362
+
337
363
  exports.getStyledShape = getStyledShape;
338
364
 
339
365
  /***/ }),
@@ -354,11 +380,17 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
354
380
  Object.defineProperty(exports, "__esModule", {
355
381
  value: true
356
382
  });
383
+
357
384
  var React = __webpack_require__(1);
385
+
358
386
  var styled_components_1 = __webpack_require__(4);
387
+
359
388
  var SizeAwareWrapper_1 = __webpack_require__(19);
389
+
360
390
  var style_1 = __webpack_require__(14);
391
+
361
392
  var colorUtils_1 = __webpack_require__(12);
393
+
362
394
  var Item = styled_components_1.default.div.attrs(function (_ref) {
363
395
  var width = _ref.width;
364
396
  return {
@@ -371,11 +403,11 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
371
403
  componentId: "sc-1yhgpod-0"
372
404
  })(["position:relative;background-color:", "};"], function (props) {
373
405
  return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
374
- });
375
- // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
406
+ }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
407
+
376
408
  var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
377
409
  var width = _ref2.width,
378
- height = _ref2.height;
410
+ height = _ref2.height;
379
411
  return {
380
412
  style: Object.assign(Object.assign({}, width && {
381
413
  width: (0, style_1.toPx)(width)
@@ -397,11 +429,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
397
429
  displayName: "FixedSizeContainer__FixSizeItemContent",
398
430
  componentId: "sc-1yhgpod-3"
399
431
  })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
432
+
400
433
  var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
401
434
  var FixedSizeContainer = function FixedSizeContainer(props) {
402
435
  var width = props.width,
403
- height = props.height,
404
- backgroundColor = props.backgroundColor;
436
+ height = props.height,
437
+ backgroundColor = props.backgroundColor;
438
+
405
439
  if (!height) {
406
440
  return React.createElement(Item, {
407
441
  "data-test": "item",
@@ -409,24 +443,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
409
443
  backgroundColor: backgroundColor
410
444
  }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
411
445
  }
446
+
412
447
  return React.createElement(FixSizeItem, {
413
448
  "data-test": "fix-size-item",
414
- "data-splunk-visualization-version": "26.0.0 - 2f7458907",
449
+ "data-splunk-visualization-version": "26.1.1 - b6df0a015",
415
450
  width: width,
416
451
  height: height,
417
452
  backgroundColor: backgroundColor
418
453
  }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
419
454
  var newWidth = _ref3.width,
420
- newHeight = _ref3.height;
455
+ newHeight = _ref3.height;
421
456
  return React.createElement(Viz, Object.assign({}, props, {
422
457
  width: newWidth,
423
458
  height: newHeight
424
459
  }));
425
460
  })));
426
461
  };
462
+
427
463
  FixedSizeContainer.displayName = 'withFixedSizeContainer';
428
464
  return FixedSizeContainer;
429
465
  };
466
+
430
467
  exports.default = withFixedSizeContainer;
431
468
 
432
469
  /***/ }),
@@ -454,9 +491,10 @@ exports.extendStaticWrapperProps = void 0;
454
491
  * @param {DashboardVizType} props.Wrapper
455
492
  * @param {DashboardVizType} props.Visualization
456
493
  */
494
+
457
495
  var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
458
496
  var Wrapper = _ref.Wrapper,
459
- Visualization = _ref.Visualization;
497
+ Visualization = _ref.Visualization;
460
498
  var extendProperties = ['propTypes', 'defaultProps', 'config'];
461
499
  extendProperties.forEach(function (prop) {
462
500
  if (Visualization[prop]) {
@@ -465,6 +503,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
465
503
  }
466
504
  });
467
505
  };
506
+
468
507
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
469
508
 
470
509
  /***/ }),
@@ -476,7 +515,7 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
476
515
 
477
516
  /***/ }),
478
517
 
479
- /***/ 165:
518
+ /***/ 166:
480
519
  /***/ (function(module, exports, __webpack_require__) {
481
520
 
482
521
  "use strict";
@@ -484,26 +523,38 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
484
523
 
485
524
  var __rest = this && this.__rest || function (s, e) {
486
525
  var t = {};
526
+
487
527
  for (var p in s) {
488
528
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
489
529
  }
530
+
490
531
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
491
532
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
492
533
  }
493
534
  return t;
494
535
  };
536
+
495
537
  Object.defineProperty(exports, "__esModule", {
496
538
  value: true
497
539
  });
498
540
  exports.config = exports.computeVizProps = void 0;
541
+
499
542
  var React = __webpack_require__(1);
543
+
500
544
  var styled_components_1 = __webpack_require__(4);
545
+
501
546
  var lodash_1 = __webpack_require__(3);
547
+
502
548
  var T = __webpack_require__(0);
503
- var withDashboardViz_1 = __webpack_require__(36);
549
+
550
+ var withDashboardViz_1 = __webpack_require__(37);
551
+
504
552
  var config_1 = __webpack_require__(456);
553
+
505
554
  exports.config = config_1.default;
555
+
506
556
  var shapeUtils_1 = __webpack_require__(118);
557
+
507
558
  var SVGContainer = styled_components_1.default.svg.withConfig({
508
559
  displayName: "Rectangle__SVGContainer",
509
560
  componentId: "iwvil2-0"
@@ -520,14 +571,16 @@ var propTypes = {
520
571
  onRectangleClick: T.func
521
572
  };
522
573
  var RectangleShape = (0, shapeUtils_1.getStyledShape)('rect');
574
+
523
575
  var RectangleViz = function RectangleViz(props) {
524
576
  var width = props.width,
525
- height = props.height,
526
- options = props.options,
527
- onRectangleClick = props.onRectangleClick;
577
+ height = props.height,
578
+ options = props.options,
579
+ onRectangleClick = props.onRectangleClick;
528
580
  var strokeWidth = options.strokeWidth;
529
581
  var rx = options.rx,
530
- ry = options.ry; // If either radius value is NaN/undefined, sets value to 0.
582
+ ry = options.ry; // If either radius value is NaN/undefined, sets value to 0.
583
+
531
584
  rx = rx || 0;
532
585
  ry = ry || 0;
533
586
  return React.createElement(SVGContainer, {
@@ -544,10 +597,13 @@ var RectangleViz = function RectangleViz(props) {
544
597
  onClick: onRectangleClick
545
598
  })));
546
599
  };
600
+
547
601
  var validOptions = Object.keys(config_1.default.optionsSchema);
602
+
548
603
  var computeVizProps = function computeVizProps(props) {
549
604
  var dataSources = props.dataSources,
550
- otherOptions = __rest(props, ["dataSources"]);
605
+ otherOptions = __rest(props, ["dataSources"]);
606
+
551
607
  var computedProps = {
552
608
  dataSources: dataSources,
553
609
  options: null
@@ -555,6 +611,7 @@ var computeVizProps = function computeVizProps(props) {
555
611
  computedProps.options = (0, lodash_1.chain)(otherOptions).pick(validOptions).thru(shapeUtils_1.mapToOldKey).value();
556
612
  return computedProps;
557
613
  };
614
+
558
615
  exports.computeVizProps = computeVizProps;
559
616
  RectangleViz.propTypes = propTypes;
560
617
  RectangleViz.defaultProps = {
@@ -605,24 +662,33 @@ module.exports = require("@splunk/ui-utils/i18n");
605
662
 
606
663
 
607
664
  var _toConsumableArray = __webpack_require__(8);
665
+
608
666
  var _defineProperty = __webpack_require__(7);
667
+
609
668
  var __rest = this && this.__rest || function (s, e) {
610
669
  var t = {};
670
+
611
671
  for (var p in s) {
612
672
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
613
673
  }
674
+
614
675
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
615
676
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
616
677
  }
617
678
  return t;
618
679
  };
680
+
619
681
  Object.defineProperty(exports, "__esModule", {
620
682
  value: true
621
683
  });
622
684
  exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
685
+
623
686
  var lodash_1 = __webpack_require__(3);
687
+
624
688
  var schemaUtils_1 = __webpack_require__(16);
689
+
625
690
  var VizBehavior_1 = __webpack_require__(6);
691
+
626
692
  var dynamicOptionsDSLType = {
627
693
  type: 'string',
628
694
  pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
@@ -632,20 +698,22 @@ var dynamicOptionsDSLType = {
632
698
  * @param optionsSchema a visualization's options schema
633
699
  * @returns an updated options schema that additionally allows strings starting with > for each option
634
700
  */
701
+
635
702
  function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
636
703
  var enhancedOptionsSchema = {};
637
704
  Object.keys(optionsSchema).forEach(function (key) {
638
705
  var _a = optionsSchema[key],
639
- title = _a.title,
640
- description = _a.description,
641
- readOnly = _a.readOnly,
642
- writeOnly = _a.writeOnly,
643
- examples = _a.examples,
644
- defaultValue = _a.default,
645
- type = _a.type,
646
- properties = _a.properties,
647
- patternProperties = _a.patternProperties,
648
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
706
+ title = _a.title,
707
+ description = _a.description,
708
+ readOnly = _a.readOnly,
709
+ writeOnly = _a.writeOnly,
710
+ examples = _a.examples,
711
+ defaultValue = _a.default,
712
+ type = _a.type,
713
+ properties = _a.properties,
714
+ patternProperties = _a.patternProperties,
715
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
716
+
649
717
  var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
650
718
  title: title
651
719
  }), description !== undefined && {
@@ -659,12 +727,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
659
727
  }), defaultValue !== undefined && {
660
728
  default: defaultValue
661
729
  });
730
+
662
731
  if (type === 'object') {
663
732
  enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
664
733
  type: type
665
734
  }), properties && {
666
735
  properties: enhanceOptionsSchemaWithDynamicOptions(properties)
667
736
  });
737
+
668
738
  if (patternProperties) {
669
739
  var enhancedPatternProperties = {};
670
740
  Object.keys(patternProperties).forEach(function (opt) {
@@ -682,6 +752,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
682
752
  });
683
753
  return enhancedOptionsSchema;
684
754
  }
755
+
685
756
  exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
686
757
  /**
687
758
  * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
@@ -690,11 +761,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
690
761
  * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
691
762
  * and containing `open: false` for all editor panels in editorConfig
692
763
  */
764
+
693
765
  function enhanceConfig(vizConfig) {
694
766
  var enhancedConfig = Object.assign({}, vizConfig);
767
+
695
768
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
696
769
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
697
770
  }
771
+
698
772
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
699
773
  return Object.assign(Object.assign({}, config), {
700
774
  open: config.open || false
@@ -702,6 +776,7 @@ function enhanceConfig(vizConfig) {
702
776
  });
703
777
  return enhancedConfig;
704
778
  }
779
+
705
780
  exports.enhanceConfig = enhanceConfig;
706
781
  /**
707
782
  * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
@@ -709,6 +784,7 @@ exports.enhanceConfig = enhanceConfig;
709
784
  * @param vizConfig a Visualization Config
710
785
  * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
711
786
  */
787
+
712
788
  function uncollapseEditorConfig(vizConfig) {
713
789
  var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
714
790
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
@@ -718,13 +794,16 @@ function uncollapseEditorConfig(vizConfig) {
718
794
  });
719
795
  return editorPanelUncollapsedConfig;
720
796
  }
797
+
721
798
  exports.uncollapseEditorConfig = uncollapseEditorConfig;
799
+
722
800
  function isDynamicOption(option) {
723
801
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
724
802
  }
725
- exports.isDynamicOption = isDynamicOption;
726
- // private helpers to improve readability of getInitialPreset
803
+
804
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
727
805
  // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
806
+
728
807
  /**
729
808
  * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
730
809
  * 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
@@ -733,6 +812,7 @@ exports.isDynamicOption = isDynamicOption;
733
812
  *
734
813
  * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
735
814
  */
815
+
736
816
  function hasCompatibleContexts(vizContext, presetContext) {
737
817
  var presetContextKeys = Object.keys(presetContext);
738
818
  return presetContextKeys.every(function (contextKey) {
@@ -742,6 +822,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
742
822
  /**
743
823
  * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
744
824
  */
825
+
826
+
745
827
  function hasCompatibleOptions(vizOptions, presetOptions) {
746
828
  var presetOptionKeys = Object.keys(presetOptions);
747
829
  return presetOptionKeys.every(function (optionKey) {
@@ -756,18 +838,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
756
838
  * @param {Object} vizOptions - the current vizOptions definition
757
839
  * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
758
840
  */
841
+
842
+
759
843
  function getInitialPreset(vizContext, vizOptions, presets) {
760
844
  return presets.find(function (preset) {
761
845
  var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
762
846
  var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
763
847
  var presetContextKeys = Object.keys(presetContext);
764
- var presetOptionKeys = Object.keys(presetOptions);
765
- // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
848
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
766
849
  // if not, then the preset is invalid in config.ts
850
+
767
851
  if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
768
852
  return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
769
853
  });
770
854
  }
855
+
771
856
  exports.getInitialPreset = getInitialPreset;
772
857
  /**
773
858
  * generates number precision values for a Select editor
@@ -775,6 +860,7 @@ exports.getInitialPreset = getInitialPreset;
775
860
  * @param {Number} numPrecisionValues - number of integer precision values to generate
776
861
  * @returns {{ label: string; value; string }[]} array of { label, value } tuples
777
862
  */
863
+
778
864
  function generatePrecisionValues(numPrecisionValues) {
779
865
  return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
780
866
  return {
@@ -783,6 +869,7 @@ function generatePrecisionValues(numPrecisionValues) {
783
869
  };
784
870
  });
785
871
  }
872
+
786
873
  exports.generatePrecisionValues = generatePrecisionValues;
787
874
  /**
788
875
  * insert layout in layout array, return a new layout array instead of updating the original
@@ -792,12 +879,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
792
879
  * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
793
880
  * @returns {EditorLayoutConfig[][]} new editor layout with insertion
794
881
  */
882
+
795
883
  var insertLayout = function insertLayout(layout, index) {
796
884
  for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
797
885
  layoutItems[_key - 2] = arguments[_key];
798
886
  }
887
+
799
888
  return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
800
889
  };
890
+
801
891
  exports.insertLayout = insertLayout;
802
892
 
803
893
  /***/ }),
@@ -882,11 +972,17 @@ Object.defineProperty(exports, "__esModule", {
882
972
  value: true
883
973
  });
884
974
  exports.shouldShowIconPlaceholder = void 0;
975
+
885
976
  var React = __webpack_require__(1);
977
+
886
978
  var T = __webpack_require__(0);
979
+
887
980
  var lodash_1 = __webpack_require__(3);
981
+
888
982
  var i18n_1 = __webpack_require__(2);
983
+
889
984
  var Message_1 = __webpack_require__(10);
985
+
890
986
  var FixedSizeContainer_1 = __webpack_require__(13);
891
987
  /**
892
988
  * @method shouldShowIconPlaceholder
@@ -894,6 +990,8 @@ var FixedSizeContainer_1 = __webpack_require__(13);
894
990
  * @param {boolean} loading
895
991
  * @returns {boolean}
896
992
  */
993
+
994
+
897
995
  var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
898
996
  var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
899
997
  var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
@@ -902,6 +1000,7 @@ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources)
902
1000
  var noFields = fields === undefined;
903
1001
  return loading || noData || noFields;
904
1002
  };
1003
+
905
1004
  exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
906
1005
  var propTypes = {
907
1006
  icon: T.func,
@@ -916,11 +1015,13 @@ var propTypes = {
916
1015
  * @param {IconPlaceholderProps} props
917
1016
  * @returns {React.ReactElement}
918
1017
  */
1018
+
919
1019
  var IconPlaceholder = function IconPlaceholder(props) {
920
1020
  var width = props.width,
921
- height = props.height,
922
- icon = props.icon,
923
- iconColor = props.iconColor;
1021
+ height = props.height,
1022
+ icon = props.icon,
1023
+ iconColor = props.iconColor;
1024
+
924
1025
  if (icon) {
925
1026
  return React.createElement(icon, {
926
1027
  style: {
@@ -932,9 +1033,11 @@ var IconPlaceholder = function IconPlaceholder(props) {
932
1033
  transform: 'translate(-50%, -50%)'
933
1034
  },
934
1035
  width: '50%',
935
- height: '50%'
1036
+ height: '50%',
1037
+ 'data-test': 'icon-placeholder'
936
1038
  });
937
1039
  }
1040
+
938
1041
  return React.createElement(Message_1.default, {
939
1042
  width: width,
940
1043
  height: height,
@@ -942,6 +1045,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
942
1045
  message: (0, i18n_1._)('No DataSource Connected')
943
1046
  });
944
1047
  };
1048
+
945
1049
  IconPlaceholder.propTypes = propTypes;
946
1050
  IconPlaceholder.defaultProps = {
947
1051
  width: '100%',
@@ -958,21 +1062,27 @@ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
958
1062
 
959
1063
 
960
1064
  var _defineProperty = __webpack_require__(7);
1065
+
961
1066
  Object.defineProperty(exports, "__esModule", {
962
1067
  value: true
963
1068
  });
964
1069
  exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1070
+
965
1071
  var T = __webpack_require__(0);
1072
+
966
1073
  var lodash_1 = __webpack_require__(3);
967
- var DataSource_1 = __webpack_require__(43);
1074
+
1075
+ var DataSource_1 = __webpack_require__(34);
1076
+
968
1077
  exports.SortParamsPropTypes = T.shape({
969
1078
  currentSortKey: T.string,
970
1079
  currentSortDir: T.oneOf(DataSource_1.validSortDirs),
971
1080
  onSort: T.func
972
1081
  });
1082
+
973
1083
  var getSortingParams = function getSortingParams(_ref) {
974
1084
  var requestParams = _ref.requestParams,
975
- onRequestParamsChange = _ref.onRequestParamsChange;
1085
+ onRequestParamsChange = _ref.onRequestParamsChange;
976
1086
  var currentSortKey;
977
1087
  var currentSortDir;
978
1088
  var nextSortDirMap = {
@@ -981,15 +1091,18 @@ var getSortingParams = function getSortingParams(_ref) {
981
1091
  none: 'asc'
982
1092
  };
983
1093
  var onSort;
1094
+
984
1095
  if (typeof onRequestParamsChange === 'function') {
985
1096
  if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
986
1097
  currentSortKey = Object.keys(requestParams.sort).shift();
987
1098
  currentSortDir = requestParams.sort[currentSortKey];
988
- }
989
- // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1099
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1100
+
1101
+
990
1102
  onSort = function onSort(e, _ref2) {
991
1103
  var sortKey = _ref2.sortKey,
992
- sortDir = _ref2.sortDir;
1104
+ sortDir = _ref2.sortDir;
1105
+
993
1106
  if (typeof sortKey === 'string') {
994
1107
  var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
995
1108
  onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
@@ -1001,12 +1114,14 @@ var getSortingParams = function getSortingParams(_ref) {
1001
1114
  }
1002
1115
  };
1003
1116
  }
1117
+
1004
1118
  return {
1005
1119
  currentSortKey: currentSortKey,
1006
1120
  currentSortDir: currentSortDir,
1007
1121
  onSort: onSort
1008
1122
  };
1009
1123
  };
1124
+
1010
1125
  exports.getSortingParams = getSortingParams;
1011
1126
 
1012
1127
  /***/ }),
@@ -1017,43 +1132,69 @@ exports.getSortingParams = getSortingParams;
1017
1132
  "use strict";
1018
1133
 
1019
1134
 
1135
+ Object.defineProperty(exports, "__esModule", {
1136
+ value: true
1137
+ });
1138
+ exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
1139
+ exports.validSortDirs = ['asc', 'desc', 'none'];
1140
+ exports.validSegmentationModes = ['none', 'inner'];
1141
+ exports.validOutputModes = ['json_cols', 'json'];
1142
+
1143
+ /***/ }),
1144
+
1145
+ /***/ 35:
1146
+ /***/ (function(module, exports, __webpack_require__) {
1147
+
1148
+ "use strict";
1149
+
1150
+
1020
1151
  Object.defineProperty(exports, "__esModule", {
1021
1152
  value: true
1022
1153
  });
1023
1154
  exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1155
+
1024
1156
  var T = __webpack_require__(0);
1157
+
1025
1158
  var lodash_1 = __webpack_require__(3);
1159
+
1026
1160
  exports.PaginatorParamsPropTypes = T.shape({
1027
1161
  isPaging: T.bool,
1028
1162
  current: T.number,
1029
1163
  totalPages: T.number,
1030
1164
  onChange: T.func
1031
1165
  });
1166
+
1032
1167
  var getPaginationParams = function getPaginationParams(_ref) {
1033
1168
  var requestParams = _ref.requestParams,
1034
- meta = _ref.meta,
1035
- onRequestParamsChange = _ref.onRequestParamsChange;
1169
+ meta = _ref.meta,
1170
+ onRequestParamsChange = _ref.onRequestParamsChange;
1036
1171
  var totalCount = meta && meta.totalCount || 0;
1037
1172
  var offset = requestParams && requestParams.offset || 0;
1038
1173
  var count = requestParams && requestParams.count;
1039
1174
  var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1040
1175
  var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1041
1176
  var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
1177
+
1042
1178
  var onChangeHandler = function onChangeHandler(e, _ref2) {
1043
1179
  var page = _ref2.page,
1044
- countArg = _ref2.count;
1180
+ countArg = _ref2.count;
1045
1181
  var newParams = (0, lodash_1.cloneDeep)(requestParams);
1182
+
1046
1183
  if (typeof countArg === 'number') {
1047
1184
  newParams.count = countArg;
1048
1185
  newParams.offset = 0;
1049
1186
  }
1187
+
1050
1188
  var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
1189
+
1051
1190
  if (typeof page === 'number' && page > 0) {
1052
1191
  newParams.count = pageCount;
1053
1192
  newParams.offset = (page - 1) * pageCount;
1054
1193
  }
1194
+
1055
1195
  onRequestParamsChange(newParams);
1056
1196
  };
1197
+
1057
1198
  return {
1058
1199
  isPaging: isPaging,
1059
1200
  current: current,
@@ -1061,11 +1202,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
1061
1202
  onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
1062
1203
  };
1063
1204
  };
1205
+
1064
1206
  exports.getPaginationParams = getPaginationParams;
1065
1207
 
1066
1208
  /***/ }),
1067
1209
 
1068
- /***/ 35:
1210
+ /***/ 36:
1069
1211
  /***/ (function(module, exports, __webpack_require__) {
1070
1212
 
1071
1213
  "use strict";
@@ -1076,6 +1218,7 @@ Object.defineProperty(exports, "__esModule", {
1076
1218
  });
1077
1219
  exports.VizCategory = void 0;
1078
1220
  var VizCategory;
1221
+
1079
1222
  (function (VizCategory) {
1080
1223
  VizCategory["SINGLE_VALUE"] = "Single Value";
1081
1224
  VizCategory["TRENDS"] = "Trends";
@@ -1093,67 +1236,96 @@ var VizCategory;
1093
1236
 
1094
1237
  /***/ }),
1095
1238
 
1096
- /***/ 36:
1239
+ /***/ 37:
1097
1240
  /***/ (function(module, exports, __webpack_require__) {
1098
1241
 
1099
1242
  "use strict";
1100
1243
 
1101
1244
 
1102
1245
  var _slicedToArray = __webpack_require__(17);
1246
+
1103
1247
  Object.defineProperty(exports, "__esModule", {
1104
1248
  value: true
1105
1249
  });
1250
+
1106
1251
  var React = __webpack_require__(1);
1252
+
1107
1253
  var lodash_1 = __webpack_require__(3);
1108
- var getSettingsFromThemedProps_1 = __webpack_require__(37);
1254
+
1255
+ var getSettingsFromThemedProps_1 = __webpack_require__(38);
1256
+
1109
1257
  var Options_1 = __webpack_require__(30);
1110
- var SanitizeProps_1 = __webpack_require__(38);
1258
+
1259
+ var SanitizeProps_1 = __webpack_require__(39);
1260
+
1111
1261
  var TimezoneContext_1 = __webpack_require__(26);
1112
- var moment_1 = __webpack_require__(39);
1262
+
1263
+ var moment_1 = __webpack_require__(40);
1264
+
1113
1265
  var FeatureFlagContext_1 = __webpack_require__(21);
1266
+
1114
1267
  var styled_components_1 = __webpack_require__(4);
1268
+
1115
1269
  var hocUtils_1 = __webpack_require__(27);
1270
+
1116
1271
  var JSONSchemaUtils_1 = __webpack_require__(28);
1117
- var async_dynamic_options_evaluator_1 = __webpack_require__(40);
1272
+
1273
+ var async_dynamic_options_evaluator_1 = __webpack_require__(41);
1274
+
1118
1275
  var id_1 = __webpack_require__(25);
1119
- var SplunkVisualization_1 = __webpack_require__(41);
1276
+
1277
+ var SplunkVisualization_1 = __webpack_require__(42);
1278
+
1120
1279
  var VizBehavior_1 = __webpack_require__(6);
1280
+
1121
1281
  var getSorting_1 = __webpack_require__(33);
1122
- var getPagination_1 = __webpack_require__(34);
1282
+
1283
+ var getPagination_1 = __webpack_require__(35);
1284
+
1123
1285
  var useDeepMemo_1 = __webpack_require__(44);
1286
+
1124
1287
  var MissingPropsMessage_1 = __webpack_require__(45);
1288
+
1125
1289
  var withEditModeCover_1 = __webpack_require__(46);
1290
+
1126
1291
  var withPlaceholder_1 = __webpack_require__(47);
1127
1292
  /**
1128
1293
  * hoc that wraps a pure react visualization in a Dashboard visualization
1129
1294
  * @param {DashboardVizOpts} opts
1130
1295
  * @returns {HOC}
1131
1296
  */
1297
+
1298
+
1132
1299
  var withDashboardViz = function withDashboardViz(opts) {
1133
1300
  var ReactViz = opts.ReactViz,
1134
- vizConfig = opts.vizConfig,
1135
- _opts$computeVizProps = opts.computeVizProps,
1136
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1137
- disableEditModeCover = opts.disableEditModeCover,
1138
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1301
+ vizConfig = opts.vizConfig,
1302
+ _opts$computeVizProps = opts.computeVizProps,
1303
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1304
+ disableEditModeCover = opts.disableEditModeCover,
1305
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1306
+
1139
1307
  var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
1140
1308
  var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
1309
+
1141
1310
  var DashboardViz = function DashboardViz(props) {
1142
1311
  var _a;
1312
+
1143
1313
  var mode = props.mode,
1144
- hasEventHandlers = props.hasEventHandlers,
1145
- dataSources = props.dataSources,
1146
- options = props.options,
1147
- _props$context = props.context,
1148
- context = _props$context === void 0 ? {} : _props$context,
1149
- width = props.width,
1150
- height = props.height,
1151
- onComputedProps = props.onComputedProps,
1152
- onEventTrigger = props.onEventTrigger,
1153
- theme = props.theme,
1154
- onRequestParamsChange = props.onRequestParamsChange;
1314
+ hasEventHandlers = props.hasEventHandlers,
1315
+ dataSources = props.dataSources,
1316
+ options = props.options,
1317
+ _props$context = props.context,
1318
+ context = _props$context === void 0 ? {} : _props$context,
1319
+ width = props.width,
1320
+ height = props.height,
1321
+ onComputedProps = props.onComputedProps,
1322
+ onEventTrigger = props.onEventTrigger,
1323
+ theme = props.theme,
1324
+ onRequestParamsChange = props.onRequestParamsChange;
1325
+
1155
1326
  var _React$useContext = React.useContext(TimezoneContext_1.default),
1156
- serializedTimezone = _React$useContext.serializedTimezone;
1327
+ serializedTimezone = _React$useContext.serializedTimezone;
1328
+
1157
1329
  if (serializedTimezone) {
1158
1330
  /*
1159
1331
  @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
@@ -1167,38 +1339,51 @@ var withDashboardViz = function withDashboardViz(opts) {
1167
1339
  moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1168
1340
  }
1169
1341
  }
1342
+
1170
1343
  var themeFunc = function themeFunc(themeVar) {
1171
1344
  var _a, _b;
1345
+
1172
1346
  return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1173
1347
  };
1348
+
1174
1349
  var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1350
+
1175
1351
  var _ref = (0, getSettingsFromThemedProps_1.default)({
1176
- theme: theme
1177
- }),
1178
- currentThemeFamily = _ref.family,
1179
- currentThemeColorScheme = _ref.colorScheme,
1180
- currentThemeDensity = _ref.density;
1352
+ theme: theme
1353
+ }),
1354
+ currentThemeFamily = _ref.family,
1355
+ currentThemeColorScheme = _ref.colorScheme,
1356
+ currentThemeDensity = _ref.density;
1357
+
1181
1358
  var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1359
+
1182
1360
  var _React$useState = React.useState({}),
1183
- _React$useState2 = _slicedToArray(_React$useState, 2),
1184
- evaluatedOptionsAsync = _React$useState2[0],
1185
- setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1361
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1362
+ evaluatedOptionsAsync = _React$useState2[0],
1363
+ setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1364
+
1365
+
1186
1366
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
1367
+
1187
1368
  var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
1188
- _React$useState4 = _slicedToArray(_React$useState3, 1),
1189
- visualizationID = _React$useState4[0];
1369
+ _React$useState4 = _slicedToArray(_React$useState3, 1),
1370
+ visualizationID = _React$useState4[0];
1371
+
1190
1372
  var _React$useState5 = React.useState({}),
1191
- _React$useState6 = _slicedToArray(_React$useState5, 2),
1192
- dataSourcesInState = _React$useState6[0],
1193
- setDataSourcesInState = _React$useState6[1];
1373
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
1374
+ dataSourcesInState = _React$useState6[0],
1375
+ setDataSourcesInState = _React$useState6[1];
1376
+
1194
1377
  var _React$useState7 = React.useState(),
1195
- _React$useState8 = _slicedToArray(_React$useState7, 2),
1196
- dataFramesInState = _React$useState8[0],
1197
- setDataFramesInState = _React$useState8[1];
1378
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
1379
+ dataFramesInState = _React$useState8[0],
1380
+ setDataFramesInState = _React$useState8[1];
1381
+
1198
1382
  var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
1199
- _React$useState10 = _slicedToArray(_React$useState9, 2),
1200
- useAsyncEvaluatedOptions = _React$useState10[0],
1201
- setUseAsyncEvaluatedOptions = _React$useState10[1];
1383
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
1384
+ useAsyncEvaluatedOptions = _React$useState10[0],
1385
+ setUseAsyncEvaluatedOptions = _React$useState10[1];
1386
+
1202
1387
  var isMounted = React.useRef(true);
1203
1388
  evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
1204
1389
  try {
@@ -1223,11 +1408,13 @@ var withDashboardViz = function withDashboardViz(opts) {
1223
1408
  });
1224
1409
  } else {
1225
1410
  var dataFrames = dataFramesInState;
1411
+
1226
1412
  if (dataSources !== dataSourcesInState) {
1227
1413
  setDataSourcesInState(dataSources);
1228
1414
  dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
1229
1415
  setDataFramesInState(dataFrames);
1230
1416
  }
1417
+
1231
1418
  return Options_1.Options.evaluate({
1232
1419
  context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
1233
1420
  options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
@@ -1238,21 +1425,24 @@ var withDashboardViz = function withDashboardViz(opts) {
1238
1425
  console.error("unexpected error evaluating options: ".concat(e.message));
1239
1426
  return {};
1240
1427
  }
1428
+
1241
1429
  return {};
1242
1430
  }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
1243
- var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
1244
- // trellis specific backgroundColor update for onComputedProps
1431
+ var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
1245
1432
  // 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
1246
1433
  // onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
1434
+
1247
1435
  var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
1248
1436
  var clonedEvaluatedOptions = evaluatedOptionsToUse;
1437
+
1249
1438
  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) {
1250
1439
  clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
1251
1440
  backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
1252
1441
  });
1253
- }
1254
- // useEffect hook needs to be initialized before any early returns
1442
+ } // useEffect hook needs to be initialized before any early returns
1255
1443
  // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1444
+
1445
+
1256
1446
  React.useEffect(function () {
1257
1447
  onComputedProps(clonedEvaluatedOptions);
1258
1448
  });
@@ -1262,53 +1452,68 @@ var withDashboardViz = function withDashboardViz(opts) {
1262
1452
  isMounted.current = false;
1263
1453
  async_dynamic_options_evaluator_1.default.reset(visualizationID);
1264
1454
  }
1265
- };
1266
- // eslint-disable-next-line react-hooks/exhaustive-deps
1267
- }, []);
1268
- // present warning message if any required props are missing
1455
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
1456
+ }, []); // present warning message if any required props are missing
1457
+
1269
1458
  var _vizConfig$requiredPr = vizConfig.requiredProps,
1270
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1271
- supports = vizConfig.supports;
1459
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1460
+ supports = vizConfig.supports;
1272
1461
  var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
1462
+
1273
1463
  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
1274
1464
  ) {
1275
- return React.createElement(MissingPropsMessage_1.default, {
1276
- "data-test": "missing-props-message",
1277
- width: width,
1278
- height: height,
1279
- missingProps: missing,
1280
- backgroundColor: bgColorFromTheme
1281
- });
1282
- }
1283
- // events
1465
+ return React.createElement(MissingPropsMessage_1.default, {
1466
+ "data-test": "missing-props-message",
1467
+ width: width,
1468
+ height: height,
1469
+ missingProps: missing,
1470
+ backgroundColor: bgColorFromTheme
1471
+ });
1472
+ } // events
1473
+
1474
+
1284
1475
  var eventCallbackProps = {};
1476
+
1285
1477
  if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1286
1478
  var supportedEvents = vizConfig.events;
1287
1479
  Object.keys(supportedEvents).forEach(function (eventName) {
1288
- var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
1289
- eventCallbackProps[eventCallbackPropName] = null;
1290
- // todo: refactor single value and single value icon to send payload from viz
1480
+ var _supportedEvents$even = supportedEvents[eventName],
1481
+ parentKeys = _supportedEvents$even.parentKeys,
1482
+ payloadKeys = _supportedEvents$even.payloadKeys;
1483
+ var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName)); // todo: refactor single value and single value icon to send payload from viz
1291
1484
  // then remove these lines
1292
- var payloadKeys = supportedEvents[eventName].payloadKeys;
1485
+
1293
1486
  var payload = {};
1487
+
1294
1488
  if (Array.isArray(payloadKeys) && payloadKeys.length) {
1295
1489
  payloadKeys.forEach(function (p) {
1296
1490
  payload[p] = evaluatedOptionsToUse[p];
1297
1491
  });
1298
1492
  }
1493
+
1299
1494
  eventCallbackProps[eventCallbackPropName] = function (ev) {
1300
1495
  if (ev && ev.payload) {
1301
1496
  payload = ev.payload;
1302
1497
  }
1498
+
1303
1499
  return onEventTrigger({
1304
1500
  originalEvent: ev,
1305
1501
  payload: payload,
1306
1502
  type: eventName
1307
1503
  });
1308
1504
  };
1505
+
1506
+ if (parentKeys) {
1507
+ for (var i = parentKeys.length - 1; i >= 0; i -= 1) {
1508
+ var newObject = {};
1509
+ newObject[parentKeys[i]] = eventCallbackProps[eventCallbackPropName];
1510
+ eventCallbackProps[eventCallbackPropName] = newObject;
1511
+ }
1512
+ }
1309
1513
  });
1310
- }
1311
- // compute pure viz props which are not from options
1514
+ } // compute pure viz props which are not from options
1515
+
1516
+
1312
1517
  var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
1313
1518
  themeFunc: themeFunc
1314
1519
  }));
@@ -1326,15 +1531,19 @@ var withDashboardViz = function withDashboardViz(opts) {
1326
1531
  * In future, we could automatically detect which all datasources are being used
1327
1532
  * and bind those magically to pagination/sorting behavior.
1328
1533
  */
1534
+
1329
1535
  var dataSourceMetadata = {};
1330
1536
  var OptionKey = 'paginateDataSourceKey';
1331
1537
  var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
1538
+
1332
1539
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
1333
1540
  var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1334
1541
  var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
1542
+
1335
1543
  var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1336
1544
  return onRequestParamsChange(paginateDataSourceKey, payload);
1337
1545
  };
1546
+
1338
1547
  var sortParams = (0, getSorting_1.getSortingParams)({
1339
1548
  requestParams: requestParams,
1340
1549
  meta: meta,
@@ -1349,115 +1558,132 @@ var withDashboardViz = function withDashboardViz(opts) {
1349
1558
  sortParams: sortParams,
1350
1559
  paginatorParams: paginatorParams
1351
1560
  };
1352
- }
1353
- // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1561
+ } // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1562
+
1563
+
1354
1564
  if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
1355
1565
  return null;
1356
1566
  }
1567
+
1357
1568
  return React.createElement(SanitizedReactViz, Object.assign({
1358
1569
  mode: mode,
1359
1570
  width: width,
1360
1571
  height: height
1361
1572
  }, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
1362
1573
  };
1574
+
1363
1575
  DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1364
1576
  DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1365
1577
  // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1366
1578
  theme: {}
1367
- });
1368
- // attach viz config
1369
- DashboardViz.config = vizConfig;
1370
- // @ts-ignore: TODO fix sc upgrade TS issues
1579
+ }); // attach viz config
1580
+
1581
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1582
+
1371
1583
  return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
1372
1584
  };
1585
+
1373
1586
  exports.default = withDashboardViz;
1374
1587
 
1375
1588
  /***/ }),
1376
1589
 
1377
- /***/ 37:
1590
+ /***/ 38:
1378
1591
  /***/ (function(module, exports) {
1379
1592
 
1380
1593
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1381
1594
 
1382
1595
  /***/ }),
1383
1596
 
1384
- /***/ 38:
1597
+ /***/ 39:
1385
1598
  /***/ (function(module, exports) {
1386
1599
 
1387
1600
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1388
1601
 
1389
1602
  /***/ }),
1390
1603
 
1391
- /***/ 39:
1604
+ /***/ 4:
1392
1605
  /***/ (function(module, exports) {
1393
1606
 
1394
- module.exports = require("@splunk/moment");
1607
+ module.exports = require("styled-components");
1395
1608
 
1396
1609
  /***/ }),
1397
1610
 
1398
- /***/ 4:
1611
+ /***/ 40:
1399
1612
  /***/ (function(module, exports) {
1400
1613
 
1401
- module.exports = require("styled-components");
1614
+ module.exports = require("@splunk/moment");
1402
1615
 
1403
1616
  /***/ }),
1404
1617
 
1405
- /***/ 40:
1618
+ /***/ 41:
1406
1619
  /***/ (function(module, exports) {
1407
1620
 
1408
1621
  module.exports = require("@splunk/async-dynamic-options-evaluator");
1409
1622
 
1410
1623
  /***/ }),
1411
1624
 
1412
- /***/ 41:
1625
+ /***/ 42:
1413
1626
  /***/ (function(module, exports, __webpack_require__) {
1414
1627
 
1415
1628
  "use strict";
1416
1629
 
1417
1630
 
1418
1631
  var _classCallCheck = __webpack_require__(9);
1632
+
1419
1633
  Object.defineProperty(exports, "__esModule", {
1420
1634
  value: true
1421
1635
  });
1422
1636
  exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1423
1637
  /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1638
+
1424
1639
  var T = __webpack_require__(0);
1640
+
1425
1641
  var lodash_1 = __webpack_require__(3);
1426
- var VizActionHandler_1 = __webpack_require__(42);
1427
- // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1642
+
1643
+ var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1644
+
1645
+
1428
1646
  exports.INITIAL_WIDTH = 250;
1429
1647
  exports.INITIAL_HEIGHT = 250;
1430
1648
  /**
1431
1649
  * A Splunk visualization
1432
1650
  */
1651
+
1433
1652
  var SplunkVisualization = function SplunkVisualization() {
1434
1653
  _classCallCheck(this, SplunkVisualization);
1435
1654
  };
1655
+
1436
1656
  SplunkVisualization.propTypes = {
1437
1657
  /**
1438
1658
  * display mode
1439
1659
  */
1440
1660
  mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1661
+
1441
1662
  /**
1442
1663
  * width in pixel or string, defaults to 100%
1443
1664
  */
1444
1665
  width: T.oneOfType([T.string, T.number]).isRequired,
1666
+
1445
1667
  /**
1446
1668
  * height in pixel or string
1447
1669
  */
1448
1670
  height: T.oneOfType([T.string, T.number]).isRequired,
1671
+
1449
1672
  /**
1450
1673
  * visualization context used for dynamic option evaluation
1451
1674
  */
1452
1675
  context: T.object,
1676
+
1453
1677
  /**
1454
1678
  * visualization formatting options
1455
1679
  */
1456
1680
  options: T.object,
1681
+
1457
1682
  /**
1458
1683
  * A callback to update formatting options
1459
1684
  */
1460
1685
  onOptionsChange: T.func,
1686
+
1461
1687
  /**
1462
1688
  * datasource state which include data and request params, object key indicate the datasource type.
1463
1689
  */
@@ -1466,6 +1692,7 @@ SplunkVisualization.propTypes = {
1466
1692
  * current request params
1467
1693
  */
1468
1694
  requestParams: T.object,
1695
+
1469
1696
  /**
1470
1697
  * current dataset
1471
1698
  */
@@ -1473,6 +1700,7 @@ SplunkVisualization.propTypes = {
1473
1700
  fields: T.array,
1474
1701
  columns: T.array
1475
1702
  }),
1703
+
1476
1704
  /**
1477
1705
  * error
1478
1706
  */
@@ -1480,29 +1708,35 @@ SplunkVisualization.propTypes = {
1480
1708
  level: T.string,
1481
1709
  message: T.string
1482
1710
  }),
1711
+
1483
1712
  /**
1484
1713
  * meta data that came with the dataset
1485
1714
  */
1486
1715
  meta: T.object
1487
1716
  })),
1717
+
1488
1718
  /**
1489
1719
  * A callback to trigger event
1490
1720
  */
1491
1721
  onEventTrigger: T.func,
1722
+
1492
1723
  /**
1493
1724
  * Inform viz if there are handlers listening to events
1494
1725
  */
1495
1726
  hasEventHandlers: T.bool,
1727
+
1496
1728
  /**
1497
1729
  * A callback to communicate computed props to a consumer
1498
1730
  */
1499
1731
  onComputedProps: T.func,
1732
+
1500
1733
  /**
1501
1734
  * A callback to obtain visualization api
1502
1735
  */
1503
1736
  vizActionHandlerRef: T.func,
1504
1737
  loading: T.bool,
1505
1738
  theme: T.object,
1739
+
1506
1740
  /**
1507
1741
  * A callback to request new data with updated request params
1508
1742
  */
@@ -1511,6 +1745,7 @@ SplunkVisualization.propTypes = {
1511
1745
  /**
1512
1746
  *
1513
1747
  */
1748
+
1514
1749
  SplunkVisualization.defaultProps = {
1515
1750
  // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1516
1751
  width: '100%',
@@ -1539,26 +1774,29 @@ exports.default = SplunkVisualization;
1539
1774
 
1540
1775
  /***/ }),
1541
1776
 
1542
- /***/ 42:
1777
+ /***/ 43:
1543
1778
  /***/ (function(module, exports, __webpack_require__) {
1544
1779
 
1545
1780
  "use strict";
1546
1781
 
1547
1782
 
1548
1783
  var _classCallCheck = __webpack_require__(9);
1784
+
1549
1785
  var _createClass = __webpack_require__(18);
1786
+
1550
1787
  Object.defineProperty(exports, "__esModule", {
1551
1788
  value: true
1552
1789
  });
1553
1790
  exports.DefaultVizActionHandler = void 0;
1791
+
1554
1792
  var DefaultVizActionHandler = /*#__PURE__*/function () {
1555
1793
  function DefaultVizActionHandler() {
1556
1794
  _classCallCheck(this, DefaultVizActionHandler);
1557
1795
  }
1796
+
1558
1797
  _createClass(DefaultVizActionHandler, [{
1559
1798
  key: "focus",
1560
- value: function focus() {
1561
- // noop
1799
+ value: function focus() {// noop
1562
1800
  }
1563
1801
  }, {
1564
1802
  key: "snapshot",
@@ -1566,23 +1804,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
1566
1804
  return null; // noop
1567
1805
  }
1568
1806
  }]);
1807
+
1569
1808
  return DefaultVizActionHandler;
1570
1809
  }();
1571
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
1572
1810
 
1573
- /***/ }),
1574
-
1575
- /***/ 43:
1576
- /***/ (function(module, exports, __webpack_require__) {
1577
-
1578
- "use strict";
1579
-
1580
-
1581
- Object.defineProperty(exports, "__esModule", {
1582
- value: true
1583
- });
1584
- exports.validSortDirs = void 0;
1585
- exports.validSortDirs = ['asc', 'desc', 'none'];
1811
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1586
1812
 
1587
1813
  /***/ }),
1588
1814
 
@@ -1596,7 +1822,9 @@ Object.defineProperty(exports, "__esModule", {
1596
1822
  value: true
1597
1823
  });
1598
1824
  exports.useDeepMemo = void 0;
1825
+
1599
1826
  var react_1 = __webpack_require__(1);
1827
+
1600
1828
  var lodash_1 = __webpack_require__(3);
1601
1829
  /**
1602
1830
  * This hook evaluates and stores the result of a passed function and only
@@ -1611,16 +1839,21 @@ var lodash_1 = __webpack_require__(3);
1611
1839
  * @param fn the function to be executed and
1612
1840
  * @param dependencies an array of dependencies
1613
1841
  */
1842
+
1843
+
1614
1844
  var useDeepMemo = function useDeepMemo(fn, dependencies) {
1615
1845
  var ref = (0, react_1.useRef)();
1846
+
1616
1847
  if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
1617
1848
  ref.current = {
1618
1849
  dependencies: dependencies,
1619
1850
  value: fn()
1620
1851
  };
1621
1852
  }
1853
+
1622
1854
  return ref.current.value;
1623
1855
  };
1856
+
1624
1857
  exports.useDeepMemo = useDeepMemo;
1625
1858
 
1626
1859
  /***/ }),
@@ -1635,19 +1868,27 @@ Object.defineProperty(exports, "__esModule", {
1635
1868
  value: true
1636
1869
  });
1637
1870
  exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1871
+
1638
1872
  var React = __webpack_require__(1);
1873
+
1639
1874
  var T = __webpack_require__(0);
1875
+
1640
1876
  var i18n_1 = __webpack_require__(2);
1877
+
1641
1878
  var Message_1 = __webpack_require__(10);
1879
+
1642
1880
  var FixedSizeContainer_1 = __webpack_require__(13);
1643
1881
  /**
1644
1882
  * @method isMissing
1645
1883
  * @param {any} v
1646
1884
  * @returns {boolean} true if the input value === null or undefined
1647
1885
  */
1886
+
1887
+
1648
1888
  var isMissing = function isMissing(v) {
1649
1889
  return v === null || v === undefined;
1650
1890
  };
1891
+
1651
1892
  exports.isMissing = isMissing;
1652
1893
  /**
1653
1894
  * @method misskingKeys
@@ -1655,11 +1896,13 @@ exports.isMissing = isMissing;
1655
1896
  * @param {object} target
1656
1897
  * @returns {string[]} the keys of missing required props
1657
1898
  */
1899
+
1658
1900
  var missingKeys = function missingKeys(keys, target) {
1659
1901
  return keys.filter(function (k) {
1660
1902
  return (0, exports.isMissing)(target[k]);
1661
1903
  });
1662
1904
  };
1905
+
1663
1906
  exports.missingKeys = missingKeys;
1664
1907
  var propTypes = {
1665
1908
  width: T.oneOfType([T.string, T.number]),
@@ -1673,10 +1916,11 @@ var propTypes = {
1673
1916
  * @param {MissingPropsProps} props
1674
1917
  * @returns {React.ReactElement}
1675
1918
  */
1919
+
1676
1920
  var MissingPropsMessage = function MissingPropsMessage(props) {
1677
1921
  var width = props.width,
1678
- height = props.height,
1679
- missingProps = props.missingProps;
1922
+ height = props.height,
1923
+ missingProps = props.missingProps;
1680
1924
  return React.createElement(Message_1.default, {
1681
1925
  "data-test": "message",
1682
1926
  width: width,
@@ -1684,6 +1928,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
1684
1928
  message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
1685
1929
  });
1686
1930
  };
1931
+
1687
1932
  exports.MissingPropsMessage = MissingPropsMessage;
1688
1933
  exports.MissingPropsMessage.propTypes = propTypes;
1689
1934
  exports.MissingPropsMessage.defaultProps = {
@@ -1703,6 +1948,7 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage)
1703
1948
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1704
1949
  if (k2 === undefined) k2 = k;
1705
1950
  var desc = Object.getOwnPropertyDescriptor(m, k);
1951
+
1706
1952
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1707
1953
  desc = {
1708
1954
  enumerable: true,
@@ -1711,22 +1957,28 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
1711
1957
  }
1712
1958
  };
1713
1959
  }
1960
+
1714
1961
  Object.defineProperty(o, k2, desc);
1715
1962
  } : function (o, m, k, k2) {
1716
1963
  if (k2 === undefined) k2 = k;
1717
1964
  o[k2] = m[k];
1718
1965
  });
1966
+
1719
1967
  var __exportStar = this && this.__exportStar || function (m, exports) {
1720
1968
  for (var p in m) {
1721
1969
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1722
1970
  }
1723
1971
  };
1972
+
1724
1973
  Object.defineProperty(exports, "__esModule", {
1725
1974
  value: true
1726
1975
  });
1727
1976
  exports.default = void 0;
1728
- __exportStar(__webpack_require__(165), exports);
1729
- var Rectangle_1 = __webpack_require__(165);
1977
+
1978
+ __exportStar(__webpack_require__(166), exports);
1979
+
1980
+ var Rectangle_1 = __webpack_require__(166);
1981
+
1730
1982
  Object.defineProperty(exports, "default", {
1731
1983
  enumerable: true,
1732
1984
  get: function get() {
@@ -1746,18 +1998,31 @@ Object.defineProperty(exports, "__esModule", {
1746
1998
  value: true
1747
1999
  });
1748
2000
  exports.optionsSchema = void 0;
2001
+
1749
2002
  var visualization_icons_1 = __webpack_require__(52);
2003
+
1750
2004
  var schemaUtils_1 = __webpack_require__(16);
2005
+
1751
2006
  var i18n_1 = __webpack_require__(2);
2007
+
1752
2008
  var PresetPalettes_1 = __webpack_require__(61);
2009
+
1753
2010
  var themes_1 = __webpack_require__(60);
2011
+
1754
2012
  var VizBehavior_1 = __webpack_require__(6);
1755
- var VizCategory_1 = __webpack_require__(35);
2013
+
2014
+ var VizCategory_1 = __webpack_require__(36);
2015
+
1756
2016
  var configUtils_1 = __webpack_require__(20);
2017
+
1757
2018
  var DynamicFillColorEditor_1 = __webpack_require__(114);
2019
+
1758
2020
  var DynamicStrokeColorEditor_1 = __webpack_require__(115);
2021
+
1759
2022
  var StaticFillColorEditor_1 = __webpack_require__(116);
2023
+
1760
2024
  var StaticStrokeColorEditor_1 = __webpack_require__(117);
2025
+
1761
2026
  var dataContract = {
1762
2027
  requiredDataSources: [],
1763
2028
  optionalDataSources: [{
@@ -1973,7 +2238,7 @@ var editorConfig = [{
1973
2238
  presets: presets,
1974
2239
  value: function value(_ref) {
1975
2240
  var context = _ref.context,
1976
- options = _ref.options;
2241
+ options = _ref.options;
1977
2242
  var initialPreset = (0, configUtils_1.getInitialPreset)(context, options, presets);
1978
2243
  return initialPreset && initialPreset.label || null;
1979
2244
  }
@@ -2032,16 +2297,19 @@ var editorConfig = [{
2032
2297
  /**
2033
2298
  * visualization configuration
2034
2299
  */
2300
+
2035
2301
  var config = {
2036
2302
  /**
2037
2303
  * unique viz key
2038
2304
  */
2039
2305
  key: 'splunk.rectangle',
2306
+
2040
2307
  /**
2041
2308
  * viz name
2042
2309
  */
2043
2310
  name: (0, i18n_1._)('Rectangle'),
2044
2311
  category: VizCategory_1.VizCategory.SHAPES,
2312
+
2045
2313
  /**
2046
2314
  * viz icon
2047
2315
  */
@@ -2073,15 +2341,19 @@ exports.default = (0, configUtils_1.enhanceConfig)(config);
2073
2341
  Object.defineProperty(exports, "__esModule", {
2074
2342
  value: true
2075
2343
  });
2344
+
2076
2345
  var React = __webpack_require__(1);
2346
+
2077
2347
  var styled_components_1 = __webpack_require__(4);
2348
+
2078
2349
  var hocUtils_1 = __webpack_require__(15);
2350
+
2079
2351
  var Cover = styled_components_1.default.div.withConfig({
2080
2352
  displayName: "withEditModeCover__Cover",
2081
2353
  componentId: "sc-1gsbnxb-0"
2082
2354
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
2083
2355
  var Blocker = styled_components_1.default.div.attrs({
2084
- 'data-splunk-visualization-version': "26.0.0 - 2f7458907"
2356
+ 'data-splunk-visualization-version': "26.1.1 - b6df0a015"
2085
2357
  }).withConfig({
2086
2358
  displayName: "withEditModeCover__Blocker",
2087
2359
  componentId: "sc-1gsbnxb-1"
@@ -2092,6 +2364,7 @@ var Blocker = styled_components_1.default.div.attrs({
2092
2364
  * @param {ExtendedDashViz} Visualization
2093
2365
  * @returns {ExtendedDashViz} Wrapper
2094
2366
  */
2367
+
2095
2368
  var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
2096
2369
  var Wrapper = function Wrapper(props) {
2097
2370
  var mode = props.mode;
@@ -2100,12 +2373,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
2100
2373
  "data-test": "edit-mode-cover"
2101
2374
  }));
2102
2375
  };
2376
+
2103
2377
  (0, hocUtils_1.extendStaticWrapperProps)({
2104
2378
  Wrapper: Wrapper,
2105
2379
  Visualization: Visualization
2106
2380
  });
2107
2381
  return Wrapper;
2108
2382
  };
2383
+
2109
2384
  exports.default = withEditModeCover;
2110
2385
 
2111
2386
  /***/ }),
@@ -2119,27 +2394,37 @@ exports.default = withEditModeCover;
2119
2394
  Object.defineProperty(exports, "__esModule", {
2120
2395
  value: true
2121
2396
  });
2397
+
2122
2398
  var React = __webpack_require__(1);
2399
+
2123
2400
  var colorUtils_1 = __webpack_require__(12);
2401
+
2124
2402
  var variables_1 = __webpack_require__(11);
2403
+
2125
2404
  var IconPlaceholder_1 = __webpack_require__(32);
2405
+
2126
2406
  var VizBehavior_1 = __webpack_require__(6);
2407
+
2127
2408
  var hocUtils_1 = __webpack_require__(15);
2409
+
2128
2410
  var withPlaceholder = function withPlaceholder(Visualization) {
2129
2411
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
2130
2412
  var config = Visualization.config;
2131
2413
  var themes = config.themes;
2414
+
2132
2415
  var Wrapper = function Wrapper(props) {
2133
2416
  var _a, _b;
2417
+
2134
2418
  var dataSources = props.dataSources,
2135
- loading = props.loading,
2136
- options = props.options,
2137
- height = props.height,
2138
- width = props.width;
2419
+ loading = props.loading,
2420
+ options = props.options,
2421
+ height = props.height,
2422
+ width = props.width;
2139
2423
  var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
2140
2424
  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);
2141
2425
  var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
2142
2426
  var iconColor = variables_1.default.contentColorActive(props);
2427
+
2143
2428
  if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
2144
2429
  return React.createElement(IconPlaceholder_1.default, {
2145
2430
  "data-test": "icon-placeholder",
@@ -2150,14 +2435,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
2150
2435
  iconColor: iconColor
2151
2436
  });
2152
2437
  }
2438
+
2153
2439
  return React.createElement(Visualization, Object.assign({}, props));
2154
2440
  };
2441
+
2155
2442
  (0, hocUtils_1.extendStaticWrapperProps)({
2156
2443
  Wrapper: Wrapper,
2157
2444
  Visualization: Visualization
2158
2445
  });
2159
2446
  return Wrapper;
2160
2447
  };
2448
+
2161
2449
  exports.default = withPlaceholder;
2162
2450
 
2163
2451
  /***/ }),
@@ -2187,6 +2475,7 @@ Object.defineProperty(exports, "__esModule", {
2187
2475
  });
2188
2476
  exports.VizBehavior = void 0;
2189
2477
  var VizBehavior;
2478
+
2190
2479
  (function (VizBehavior) {
2191
2480
  /**
2192
2481
  * Dynamic Options Behavior.
@@ -2206,6 +2495,7 @@ var VizBehavior;
2206
2495
  * missing.
2207
2496
  * @type {string}
2208
2497
  */
2498
+
2209
2499
  VizBehavior["PLACEHOLDER"] = "placeholder";
2210
2500
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
2211
2501
  VizBehavior["TRELLIS"] = "trellis";