@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/Markdown.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
  */
@@ -157,11 +157,17 @@ module.exports = require("@splunk/react-ui/Heading");
157
157
  Object.defineProperty(exports, "__esModule", {
158
158
  value: true
159
159
  });
160
+
160
161
  var React = __webpack_require__(1);
162
+
161
163
  var styled_components_1 = __webpack_require__(4);
164
+
162
165
  var SizeAwareWrapper_1 = __webpack_require__(19);
166
+
163
167
  var style_1 = __webpack_require__(14);
168
+
164
169
  var colorUtils_1 = __webpack_require__(12);
170
+
165
171
  var Item = styled_components_1.default.div.attrs(function (_ref) {
166
172
  var width = _ref.width;
167
173
  return {
@@ -174,11 +180,11 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
174
180
  componentId: "sc-1yhgpod-0"
175
181
  })(["position:relative;background-color:", "};"], function (props) {
176
182
  return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
177
- });
178
- // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
183
+ }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
184
+
179
185
  var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
180
186
  var width = _ref2.width,
181
- height = _ref2.height;
187
+ height = _ref2.height;
182
188
  return {
183
189
  style: Object.assign(Object.assign({}, width && {
184
190
  width: (0, style_1.toPx)(width)
@@ -200,11 +206,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
200
206
  displayName: "FixedSizeContainer__FixSizeItemContent",
201
207
  componentId: "sc-1yhgpod-3"
202
208
  })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
209
+
203
210
  var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
204
211
  var FixedSizeContainer = function FixedSizeContainer(props) {
205
212
  var width = props.width,
206
- height = props.height,
207
- backgroundColor = props.backgroundColor;
213
+ height = props.height,
214
+ backgroundColor = props.backgroundColor;
215
+
208
216
  if (!height) {
209
217
  return React.createElement(Item, {
210
218
  "data-test": "item",
@@ -212,24 +220,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
212
220
  backgroundColor: backgroundColor
213
221
  }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
214
222
  }
223
+
215
224
  return React.createElement(FixSizeItem, {
216
225
  "data-test": "fix-size-item",
217
- "data-splunk-visualization-version": "26.0.0 - 2f7458907",
226
+ "data-splunk-visualization-version": "26.1.1 - b6df0a015",
218
227
  width: width,
219
228
  height: height,
220
229
  backgroundColor: backgroundColor
221
230
  }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
222
231
  var newWidth = _ref3.width,
223
- newHeight = _ref3.height;
232
+ newHeight = _ref3.height;
224
233
  return React.createElement(Viz, Object.assign({}, props, {
225
234
  width: newWidth,
226
235
  height: newHeight
227
236
  }));
228
237
  })));
229
238
  };
239
+
230
240
  FixedSizeContainer.displayName = 'withFixedSizeContainer';
231
241
  return FixedSizeContainer;
232
242
  };
243
+
233
244
  exports.default = withFixedSizeContainer;
234
245
 
235
246
  /***/ }),
@@ -257,9 +268,10 @@ exports.extendStaticWrapperProps = void 0;
257
268
  * @param {DashboardVizType} props.Wrapper
258
269
  * @param {DashboardVizType} props.Visualization
259
270
  */
271
+
260
272
  var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
261
273
  var Wrapper = _ref.Wrapper,
262
- Visualization = _ref.Visualization;
274
+ Visualization = _ref.Visualization;
263
275
  var extendProperties = ['propTypes', 'defaultProps', 'config'];
264
276
  extendProperties.forEach(function (prop) {
265
277
  if (Visualization[prop]) {
@@ -268,6 +280,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
268
280
  }
269
281
  });
270
282
  };
283
+
271
284
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
272
285
 
273
286
  /***/ }),
@@ -279,34 +292,51 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
279
292
 
280
293
  /***/ }),
281
294
 
282
- /***/ 161:
295
+ /***/ 162:
283
296
  /***/ (function(module, exports, __webpack_require__) {
284
297
 
285
298
  "use strict";
286
299
 
287
300
 
288
301
  var _taggedTemplateLiteral = __webpack_require__(59);
302
+
289
303
  var _templateObject;
304
+
290
305
  Object.defineProperty(exports, "__esModule", {
291
306
  value: true
292
307
  });
293
308
  exports.getFontMap = exports.config = exports.themes = exports.computeVizProps = exports.FONT_SIZES = void 0;
309
+
294
310
  var lodash_1 = __webpack_require__(3);
295
- var types_1 = __webpack_require__(94);
311
+
312
+ var types_1 = __webpack_require__(83);
313
+
296
314
  var React = __webpack_require__(1);
315
+
297
316
  var style_1 = __webpack_require__(14);
317
+
298
318
  var Markdown_1 = __webpack_require__(122);
319
+
299
320
  var styled_components_1 = __webpack_require__(4);
321
+
300
322
  var T = __webpack_require__(0);
323
+
301
324
  var themes_1 = __webpack_require__(60);
325
+
302
326
  var Heading_1 = __webpack_require__(125);
327
+
303
328
  var Paragraph_1 = __webpack_require__(110);
329
+
304
330
  var List_1 = __webpack_require__(424);
331
+
305
332
  var Code_1 = __webpack_require__(425);
306
- var withDashboardViz_1 = __webpack_require__(36);
333
+
334
+ var withDashboardViz_1 = __webpack_require__(37);
335
+
307
336
  var config_1 = __webpack_require__(426);
308
- exports.config = config_1.default;
309
- // map of valid font sizes with elements' respective pixel sizes
337
+
338
+ exports.config = config_1.default; // map of valid font sizes with elements' respective pixel sizes
339
+
310
340
  exports.FONT_SIZES = {
311
341
  extraSmall: {
312
342
  h1: 18,
@@ -338,12 +368,12 @@ exports.FONT_SIZES = {
338
368
  h3: 24,
339
369
  p: 18
340
370
  }
341
- };
342
- // startsWithHeader is a prop that can be
371
+ }; // startsWithHeader is a prop that can be
343
372
  // falsy if the markdown text begins with text
344
373
  // or the number of heading level;
345
374
  // casting heading level below 4 to 4
346
375
  // because ReactMarkdown supports heading level 1-4
376
+
347
377
  var MarkdownContainer = styled_components_1.default.div.withConfig({
348
378
  displayName: "Markdown__MarkdownContainer",
349
379
  componentId: "zd3qkg-0"
@@ -390,31 +420,37 @@ var CodeInlineContainer = styled_components_1.default.code.withConfig({
390
420
  dark: themes_1.variables.gray22
391
421
  },
392
422
  prisma: themes_1.variables.neutral200
393
- }));
394
- // retrieves the font map associated with a valid `fontSize` value. If the fontSize
423
+ })); // retrieves the font map associated with a valid `fontSize` value. If the fontSize
395
424
  // passed is invalid (does not exist in FONT_SIZES), the `default` value is used.
425
+
396
426
  var getFontMap = function getFontMap(fontSize) {
397
427
  var font = fontSize;
428
+
398
429
  if (!exports.FONT_SIZES[fontSize] && fontSize !== 'custom') {
399
430
  console.error("'".concat(fontSize, "' is not a valid value for Markdown's fontSize option. Using the 'default' font size."));
400
431
  font = 'default';
401
432
  }
433
+
402
434
  return exports.FONT_SIZES[font];
403
435
  };
436
+
404
437
  exports.getFontMap = getFontMap;
438
+
405
439
  var handleLinkClick = function handleLinkClick(e) {
406
440
  return e.stopPropagation();
407
441
  };
442
+
408
443
  var StyledA = styled_components_1.default.a.withConfig({
409
444
  displayName: "Markdown__StyledA",
410
445
  componentId: "zd3qkg-3"
411
- })(["text-decoration:underlined;"]);
412
- // returns renderers customized with the appropriate font sizes given the provided `fontSize` value.
446
+ })(["text-decoration:underlined;"]); // returns renderers customized with the appropriate font sizes given the provided `fontSize` value.
447
+
413
448
  var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize, customFontSize) {
414
449
  // defaults to customFontSize of 14px if value is invalid
415
450
  var cleanedCustomFontSize = (0, types_1.isNumber)(customFontSize) ? customFontSize : 14;
416
451
  var isCustomFontSize = fontSize === 'custom';
417
452
  /* eslint-disable react/display-name, react/prop-types */
453
+
418
454
  var fontMap = isCustomFontSize ? {
419
455
  h1: cleanedCustomFontSize * 2.0,
420
456
  h2: cleanedCustomFontSize * 1.5,
@@ -433,7 +469,7 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
433
469
  },
434
470
  headingRenderer: function headingRenderer(_ref3) {
435
471
  var children = _ref3.children,
436
- level = _ref3.level;
472
+ level = _ref3.level;
437
473
  return React.createElement(Heading_1.default, {
438
474
  level: level,
439
475
  style: Object.assign({
@@ -444,7 +480,7 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
444
480
  },
445
481
  itemRenderer: function itemRenderer(_ref4) {
446
482
  var children = _ref4.children,
447
- nodeKey = _ref4.nodeKey;
483
+ nodeKey = _ref4.nodeKey;
448
484
  return React.createElement(List_1.default.Item, {
449
485
  style: Object.assign({
450
486
  fontSize: fontMap.p,
@@ -455,8 +491,8 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
455
491
  },
456
492
  codeBlockRenderer: function codeBlockRenderer(_ref5) {
457
493
  var language = _ref5.language,
458
- literal = _ref5.literal,
459
- nodeKey = _ref5.nodeKey;
494
+ literal = _ref5.literal,
495
+ nodeKey = _ref5.nodeKey;
460
496
  return React.createElement(CodeBlockContainer, {
461
497
  fontSize: fontMap.p
462
498
  }, React.createElement(Code_1.default, {
@@ -475,7 +511,7 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
475
511
  },
476
512
  linkRenderer: function linkRenderer(_ref7) {
477
513
  var href = _ref7.href,
478
- children = _ref7.children;
514
+ children = _ref7.children;
479
515
  return React.createElement(StyledA, {
480
516
  href: href,
481
517
  onClick: handleLinkClick
@@ -483,25 +519,30 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
483
519
  }
484
520
  };
485
521
  };
522
+
486
523
  var MarkdownVisualization = function MarkdownVisualization(_ref8) {
487
524
  var height = _ref8.height,
488
- width = _ref8.width,
489
- markdown = _ref8.markdown,
490
- backgroundColor = _ref8.backgroundColor,
491
- fontColor = _ref8.fontColor,
492
- fontFamily = _ref8.fontFamily,
493
- fontSize = _ref8.fontSize,
494
- customFontSize = _ref8.customFontSize,
495
- rotation = _ref8.rotation,
496
- hasEventHandlers = _ref8.hasEventHandlers,
497
- onMarkdownClick = _ref8.onMarkdownClick;
525
+ width = _ref8.width,
526
+ markdown = _ref8.markdown,
527
+ backgroundColor = _ref8.backgroundColor,
528
+ fontColor = _ref8.fontColor,
529
+ fontFamily = _ref8.fontFamily,
530
+ fontSize = _ref8.fontSize,
531
+ customFontSize = _ref8.customFontSize,
532
+ rotation = _ref8.rotation,
533
+ hasEventHandlers = _ref8.hasEventHandlers,
534
+ onMarkdownClick = _ref8.onMarkdownClick;
535
+
498
536
  var _a;
537
+
499
538
  var _ref9 = (0, themes_1.useSplunkTheme)(),
500
- defaultFontFamily = _ref9.fontFamily; // font-family style for non-code content - default font family appended to custom option value as fallback
539
+ defaultFontFamily = _ref9.fontFamily; // font-family style for non-code content - default font family appended to custom option value as fallback
540
+
541
+
501
542
  var markdownContentFontFamilyStyle = {
502
543
  fontFamily: "".concat(fontFamily, ", ").concat(defaultFontFamily)
503
- };
504
- // because DSL evaluation is not guaranteed to return string data if `markdown` is powered by DSL, we do a typecast here
544
+ }; // because DSL evaluation is not guaranteed to return string data if `markdown` is powered by DSL, we do a typecast here
545
+
505
546
  var stringifiedMarkdown = "".concat(markdown);
506
547
  var renderersForFontSize = getMarkdownRenderer(markdownContentFontFamilyStyle, fontSize, customFontSize);
507
548
  return React.createElement(MarkdownContainer, {
@@ -523,6 +564,7 @@ var MarkdownVisualization = function MarkdownVisualization(_ref8) {
523
564
  onClick: onMarkdownClick
524
565
  })));
525
566
  };
567
+
526
568
  var propTypes = {
527
569
  width: T.oneOfType([T.string, T.number]),
528
570
  height: T.oneOfType([T.string, T.number]),
@@ -551,9 +593,11 @@ var defaultProps = {
551
593
  };
552
594
  MarkdownVisualization.propTypes = propTypes;
553
595
  MarkdownVisualization.defaultProps = defaultProps;
596
+
554
597
  var computeVizProps = function computeVizProps(props) {
555
598
  return props;
556
599
  };
600
+
557
601
  exports.computeVizProps = computeVizProps;
558
602
  var Markdown = (0, withDashboardViz_1.default)({
559
603
  ReactViz: MarkdownVisualization,
@@ -601,24 +645,33 @@ module.exports = require("@splunk/ui-utils/i18n");
601
645
 
602
646
 
603
647
  var _toConsumableArray = __webpack_require__(8);
648
+
604
649
  var _defineProperty = __webpack_require__(7);
650
+
605
651
  var __rest = this && this.__rest || function (s, e) {
606
652
  var t = {};
653
+
607
654
  for (var p in s) {
608
655
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
609
656
  }
657
+
610
658
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
611
659
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
612
660
  }
613
661
  return t;
614
662
  };
663
+
615
664
  Object.defineProperty(exports, "__esModule", {
616
665
  value: true
617
666
  });
618
667
  exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
668
+
619
669
  var lodash_1 = __webpack_require__(3);
670
+
620
671
  var schemaUtils_1 = __webpack_require__(16);
672
+
621
673
  var VizBehavior_1 = __webpack_require__(6);
674
+
622
675
  var dynamicOptionsDSLType = {
623
676
  type: 'string',
624
677
  pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
@@ -628,20 +681,22 @@ var dynamicOptionsDSLType = {
628
681
  * @param optionsSchema a visualization's options schema
629
682
  * @returns an updated options schema that additionally allows strings starting with > for each option
630
683
  */
684
+
631
685
  function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
632
686
  var enhancedOptionsSchema = {};
633
687
  Object.keys(optionsSchema).forEach(function (key) {
634
688
  var _a = optionsSchema[key],
635
- title = _a.title,
636
- description = _a.description,
637
- readOnly = _a.readOnly,
638
- writeOnly = _a.writeOnly,
639
- examples = _a.examples,
640
- defaultValue = _a.default,
641
- type = _a.type,
642
- properties = _a.properties,
643
- patternProperties = _a.patternProperties,
644
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
689
+ title = _a.title,
690
+ description = _a.description,
691
+ readOnly = _a.readOnly,
692
+ writeOnly = _a.writeOnly,
693
+ examples = _a.examples,
694
+ defaultValue = _a.default,
695
+ type = _a.type,
696
+ properties = _a.properties,
697
+ patternProperties = _a.patternProperties,
698
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
699
+
645
700
  var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
646
701
  title: title
647
702
  }), description !== undefined && {
@@ -655,12 +710,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
655
710
  }), defaultValue !== undefined && {
656
711
  default: defaultValue
657
712
  });
713
+
658
714
  if (type === 'object') {
659
715
  enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
660
716
  type: type
661
717
  }), properties && {
662
718
  properties: enhanceOptionsSchemaWithDynamicOptions(properties)
663
719
  });
720
+
664
721
  if (patternProperties) {
665
722
  var enhancedPatternProperties = {};
666
723
  Object.keys(patternProperties).forEach(function (opt) {
@@ -678,6 +735,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
678
735
  });
679
736
  return enhancedOptionsSchema;
680
737
  }
738
+
681
739
  exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
682
740
  /**
683
741
  * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
@@ -686,11 +744,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
686
744
  * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
687
745
  * and containing `open: false` for all editor panels in editorConfig
688
746
  */
747
+
689
748
  function enhanceConfig(vizConfig) {
690
749
  var enhancedConfig = Object.assign({}, vizConfig);
750
+
691
751
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
692
752
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
693
753
  }
754
+
694
755
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
695
756
  return Object.assign(Object.assign({}, config), {
696
757
  open: config.open || false
@@ -698,6 +759,7 @@ function enhanceConfig(vizConfig) {
698
759
  });
699
760
  return enhancedConfig;
700
761
  }
762
+
701
763
  exports.enhanceConfig = enhanceConfig;
702
764
  /**
703
765
  * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
@@ -705,6 +767,7 @@ exports.enhanceConfig = enhanceConfig;
705
767
  * @param vizConfig a Visualization Config
706
768
  * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
707
769
  */
770
+
708
771
  function uncollapseEditorConfig(vizConfig) {
709
772
  var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
710
773
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
@@ -714,13 +777,16 @@ function uncollapseEditorConfig(vizConfig) {
714
777
  });
715
778
  return editorPanelUncollapsedConfig;
716
779
  }
780
+
717
781
  exports.uncollapseEditorConfig = uncollapseEditorConfig;
782
+
718
783
  function isDynamicOption(option) {
719
784
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
720
785
  }
721
- exports.isDynamicOption = isDynamicOption;
722
- // private helpers to improve readability of getInitialPreset
786
+
787
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
723
788
  // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
789
+
724
790
  /**
725
791
  * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
726
792
  * 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
@@ -729,6 +795,7 @@ exports.isDynamicOption = isDynamicOption;
729
795
  *
730
796
  * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
731
797
  */
798
+
732
799
  function hasCompatibleContexts(vizContext, presetContext) {
733
800
  var presetContextKeys = Object.keys(presetContext);
734
801
  return presetContextKeys.every(function (contextKey) {
@@ -738,6 +805,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
738
805
  /**
739
806
  * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
740
807
  */
808
+
809
+
741
810
  function hasCompatibleOptions(vizOptions, presetOptions) {
742
811
  var presetOptionKeys = Object.keys(presetOptions);
743
812
  return presetOptionKeys.every(function (optionKey) {
@@ -752,18 +821,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
752
821
  * @param {Object} vizOptions - the current vizOptions definition
753
822
  * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
754
823
  */
824
+
825
+
755
826
  function getInitialPreset(vizContext, vizOptions, presets) {
756
827
  return presets.find(function (preset) {
757
828
  var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
758
829
  var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
759
830
  var presetContextKeys = Object.keys(presetContext);
760
- var presetOptionKeys = Object.keys(presetOptions);
761
- // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
831
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
762
832
  // if not, then the preset is invalid in config.ts
833
+
763
834
  if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
764
835
  return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
765
836
  });
766
837
  }
838
+
767
839
  exports.getInitialPreset = getInitialPreset;
768
840
  /**
769
841
  * generates number precision values for a Select editor
@@ -771,6 +843,7 @@ exports.getInitialPreset = getInitialPreset;
771
843
  * @param {Number} numPrecisionValues - number of integer precision values to generate
772
844
  * @returns {{ label: string; value; string }[]} array of { label, value } tuples
773
845
  */
846
+
774
847
  function generatePrecisionValues(numPrecisionValues) {
775
848
  return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
776
849
  return {
@@ -779,6 +852,7 @@ function generatePrecisionValues(numPrecisionValues) {
779
852
  };
780
853
  });
781
854
  }
855
+
782
856
  exports.generatePrecisionValues = generatePrecisionValues;
783
857
  /**
784
858
  * insert layout in layout array, return a new layout array instead of updating the original
@@ -788,12 +862,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
788
862
  * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
789
863
  * @returns {EditorLayoutConfig[][]} new editor layout with insertion
790
864
  */
865
+
791
866
  var insertLayout = function insertLayout(layout, index) {
792
867
  for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
793
868
  layoutItems[_key - 2] = arguments[_key];
794
869
  }
870
+
795
871
  return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
796
872
  };
873
+
797
874
  exports.insertLayout = insertLayout;
798
875
 
799
876
  /***/ }),
@@ -857,11 +934,17 @@ Object.defineProperty(exports, "__esModule", {
857
934
  value: true
858
935
  });
859
936
  exports.shouldShowIconPlaceholder = void 0;
937
+
860
938
  var React = __webpack_require__(1);
939
+
861
940
  var T = __webpack_require__(0);
941
+
862
942
  var lodash_1 = __webpack_require__(3);
943
+
863
944
  var i18n_1 = __webpack_require__(2);
945
+
864
946
  var Message_1 = __webpack_require__(10);
947
+
865
948
  var FixedSizeContainer_1 = __webpack_require__(13);
866
949
  /**
867
950
  * @method shouldShowIconPlaceholder
@@ -869,6 +952,8 @@ var FixedSizeContainer_1 = __webpack_require__(13);
869
952
  * @param {boolean} loading
870
953
  * @returns {boolean}
871
954
  */
955
+
956
+
872
957
  var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
873
958
  var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
874
959
  var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
@@ -877,6 +962,7 @@ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources)
877
962
  var noFields = fields === undefined;
878
963
  return loading || noData || noFields;
879
964
  };
965
+
880
966
  exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
881
967
  var propTypes = {
882
968
  icon: T.func,
@@ -891,11 +977,13 @@ var propTypes = {
891
977
  * @param {IconPlaceholderProps} props
892
978
  * @returns {React.ReactElement}
893
979
  */
980
+
894
981
  var IconPlaceholder = function IconPlaceholder(props) {
895
982
  var width = props.width,
896
- height = props.height,
897
- icon = props.icon,
898
- iconColor = props.iconColor;
983
+ height = props.height,
984
+ icon = props.icon,
985
+ iconColor = props.iconColor;
986
+
899
987
  if (icon) {
900
988
  return React.createElement(icon, {
901
989
  style: {
@@ -907,9 +995,11 @@ var IconPlaceholder = function IconPlaceholder(props) {
907
995
  transform: 'translate(-50%, -50%)'
908
996
  },
909
997
  width: '50%',
910
- height: '50%'
998
+ height: '50%',
999
+ 'data-test': 'icon-placeholder'
911
1000
  });
912
1001
  }
1002
+
913
1003
  return React.createElement(Message_1.default, {
914
1004
  width: width,
915
1005
  height: height,
@@ -917,6 +1007,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
917
1007
  message: (0, i18n_1._)('No DataSource Connected')
918
1008
  });
919
1009
  };
1010
+
920
1011
  IconPlaceholder.propTypes = propTypes;
921
1012
  IconPlaceholder.defaultProps = {
922
1013
  width: '100%',
@@ -933,21 +1024,27 @@ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
933
1024
 
934
1025
 
935
1026
  var _defineProperty = __webpack_require__(7);
1027
+
936
1028
  Object.defineProperty(exports, "__esModule", {
937
1029
  value: true
938
1030
  });
939
1031
  exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1032
+
940
1033
  var T = __webpack_require__(0);
1034
+
941
1035
  var lodash_1 = __webpack_require__(3);
942
- var DataSource_1 = __webpack_require__(43);
1036
+
1037
+ var DataSource_1 = __webpack_require__(34);
1038
+
943
1039
  exports.SortParamsPropTypes = T.shape({
944
1040
  currentSortKey: T.string,
945
1041
  currentSortDir: T.oneOf(DataSource_1.validSortDirs),
946
1042
  onSort: T.func
947
1043
  });
1044
+
948
1045
  var getSortingParams = function getSortingParams(_ref) {
949
1046
  var requestParams = _ref.requestParams,
950
- onRequestParamsChange = _ref.onRequestParamsChange;
1047
+ onRequestParamsChange = _ref.onRequestParamsChange;
951
1048
  var currentSortKey;
952
1049
  var currentSortDir;
953
1050
  var nextSortDirMap = {
@@ -956,15 +1053,18 @@ var getSortingParams = function getSortingParams(_ref) {
956
1053
  none: 'asc'
957
1054
  };
958
1055
  var onSort;
1056
+
959
1057
  if (typeof onRequestParamsChange === 'function') {
960
1058
  if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
961
1059
  currentSortKey = Object.keys(requestParams.sort).shift();
962
1060
  currentSortDir = requestParams.sort[currentSortKey];
963
- }
964
- // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1061
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1062
+
1063
+
965
1064
  onSort = function onSort(e, _ref2) {
966
1065
  var sortKey = _ref2.sortKey,
967
- sortDir = _ref2.sortDir;
1066
+ sortDir = _ref2.sortDir;
1067
+
968
1068
  if (typeof sortKey === 'string') {
969
1069
  var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
970
1070
  onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
@@ -976,12 +1076,14 @@ var getSortingParams = function getSortingParams(_ref) {
976
1076
  }
977
1077
  };
978
1078
  }
1079
+
979
1080
  return {
980
1081
  currentSortKey: currentSortKey,
981
1082
  currentSortDir: currentSortDir,
982
1083
  onSort: onSort
983
1084
  };
984
1085
  };
1086
+
985
1087
  exports.getSortingParams = getSortingParams;
986
1088
 
987
1089
  /***/ }),
@@ -992,43 +1094,69 @@ exports.getSortingParams = getSortingParams;
992
1094
  "use strict";
993
1095
 
994
1096
 
1097
+ Object.defineProperty(exports, "__esModule", {
1098
+ value: true
1099
+ });
1100
+ exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
1101
+ exports.validSortDirs = ['asc', 'desc', 'none'];
1102
+ exports.validSegmentationModes = ['none', 'inner'];
1103
+ exports.validOutputModes = ['json_cols', 'json'];
1104
+
1105
+ /***/ }),
1106
+
1107
+ /***/ 35:
1108
+ /***/ (function(module, exports, __webpack_require__) {
1109
+
1110
+ "use strict";
1111
+
1112
+
995
1113
  Object.defineProperty(exports, "__esModule", {
996
1114
  value: true
997
1115
  });
998
1116
  exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1117
+
999
1118
  var T = __webpack_require__(0);
1119
+
1000
1120
  var lodash_1 = __webpack_require__(3);
1121
+
1001
1122
  exports.PaginatorParamsPropTypes = T.shape({
1002
1123
  isPaging: T.bool,
1003
1124
  current: T.number,
1004
1125
  totalPages: T.number,
1005
1126
  onChange: T.func
1006
1127
  });
1128
+
1007
1129
  var getPaginationParams = function getPaginationParams(_ref) {
1008
1130
  var requestParams = _ref.requestParams,
1009
- meta = _ref.meta,
1010
- onRequestParamsChange = _ref.onRequestParamsChange;
1131
+ meta = _ref.meta,
1132
+ onRequestParamsChange = _ref.onRequestParamsChange;
1011
1133
  var totalCount = meta && meta.totalCount || 0;
1012
1134
  var offset = requestParams && requestParams.offset || 0;
1013
1135
  var count = requestParams && requestParams.count;
1014
1136
  var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1015
1137
  var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1016
1138
  var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
1139
+
1017
1140
  var onChangeHandler = function onChangeHandler(e, _ref2) {
1018
1141
  var page = _ref2.page,
1019
- countArg = _ref2.count;
1142
+ countArg = _ref2.count;
1020
1143
  var newParams = (0, lodash_1.cloneDeep)(requestParams);
1144
+
1021
1145
  if (typeof countArg === 'number') {
1022
1146
  newParams.count = countArg;
1023
1147
  newParams.offset = 0;
1024
1148
  }
1149
+
1025
1150
  var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
1151
+
1026
1152
  if (typeof page === 'number' && page > 0) {
1027
1153
  newParams.count = pageCount;
1028
1154
  newParams.offset = (page - 1) * pageCount;
1029
1155
  }
1156
+
1030
1157
  onRequestParamsChange(newParams);
1031
1158
  };
1159
+
1032
1160
  return {
1033
1161
  isPaging: isPaging,
1034
1162
  current: current,
@@ -1036,11 +1164,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
1036
1164
  onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
1037
1165
  };
1038
1166
  };
1167
+
1039
1168
  exports.getPaginationParams = getPaginationParams;
1040
1169
 
1041
1170
  /***/ }),
1042
1171
 
1043
- /***/ 35:
1172
+ /***/ 36:
1044
1173
  /***/ (function(module, exports, __webpack_require__) {
1045
1174
 
1046
1175
  "use strict";
@@ -1051,6 +1180,7 @@ Object.defineProperty(exports, "__esModule", {
1051
1180
  });
1052
1181
  exports.VizCategory = void 0;
1053
1182
  var VizCategory;
1183
+
1054
1184
  (function (VizCategory) {
1055
1185
  VizCategory["SINGLE_VALUE"] = "Single Value";
1056
1186
  VizCategory["TRENDS"] = "Trends";
@@ -1068,67 +1198,96 @@ var VizCategory;
1068
1198
 
1069
1199
  /***/ }),
1070
1200
 
1071
- /***/ 36:
1201
+ /***/ 37:
1072
1202
  /***/ (function(module, exports, __webpack_require__) {
1073
1203
 
1074
1204
  "use strict";
1075
1205
 
1076
1206
 
1077
1207
  var _slicedToArray = __webpack_require__(17);
1208
+
1078
1209
  Object.defineProperty(exports, "__esModule", {
1079
1210
  value: true
1080
1211
  });
1212
+
1081
1213
  var React = __webpack_require__(1);
1214
+
1082
1215
  var lodash_1 = __webpack_require__(3);
1083
- var getSettingsFromThemedProps_1 = __webpack_require__(37);
1216
+
1217
+ var getSettingsFromThemedProps_1 = __webpack_require__(38);
1218
+
1084
1219
  var Options_1 = __webpack_require__(30);
1085
- var SanitizeProps_1 = __webpack_require__(38);
1220
+
1221
+ var SanitizeProps_1 = __webpack_require__(39);
1222
+
1086
1223
  var TimezoneContext_1 = __webpack_require__(26);
1087
- var moment_1 = __webpack_require__(39);
1224
+
1225
+ var moment_1 = __webpack_require__(40);
1226
+
1088
1227
  var FeatureFlagContext_1 = __webpack_require__(21);
1228
+
1089
1229
  var styled_components_1 = __webpack_require__(4);
1230
+
1090
1231
  var hocUtils_1 = __webpack_require__(27);
1232
+
1091
1233
  var JSONSchemaUtils_1 = __webpack_require__(28);
1092
- var async_dynamic_options_evaluator_1 = __webpack_require__(40);
1234
+
1235
+ var async_dynamic_options_evaluator_1 = __webpack_require__(41);
1236
+
1093
1237
  var id_1 = __webpack_require__(25);
1094
- var SplunkVisualization_1 = __webpack_require__(41);
1238
+
1239
+ var SplunkVisualization_1 = __webpack_require__(42);
1240
+
1095
1241
  var VizBehavior_1 = __webpack_require__(6);
1242
+
1096
1243
  var getSorting_1 = __webpack_require__(33);
1097
- var getPagination_1 = __webpack_require__(34);
1244
+
1245
+ var getPagination_1 = __webpack_require__(35);
1246
+
1098
1247
  var useDeepMemo_1 = __webpack_require__(44);
1248
+
1099
1249
  var MissingPropsMessage_1 = __webpack_require__(45);
1250
+
1100
1251
  var withEditModeCover_1 = __webpack_require__(46);
1252
+
1101
1253
  var withPlaceholder_1 = __webpack_require__(47);
1102
1254
  /**
1103
1255
  * hoc that wraps a pure react visualization in a Dashboard visualization
1104
1256
  * @param {DashboardVizOpts} opts
1105
1257
  * @returns {HOC}
1106
1258
  */
1259
+
1260
+
1107
1261
  var withDashboardViz = function withDashboardViz(opts) {
1108
1262
  var ReactViz = opts.ReactViz,
1109
- vizConfig = opts.vizConfig,
1110
- _opts$computeVizProps = opts.computeVizProps,
1111
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1112
- disableEditModeCover = opts.disableEditModeCover,
1113
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1263
+ vizConfig = opts.vizConfig,
1264
+ _opts$computeVizProps = opts.computeVizProps,
1265
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1266
+ disableEditModeCover = opts.disableEditModeCover,
1267
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1268
+
1114
1269
  var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
1115
1270
  var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
1271
+
1116
1272
  var DashboardViz = function DashboardViz(props) {
1117
1273
  var _a;
1274
+
1118
1275
  var mode = props.mode,
1119
- hasEventHandlers = props.hasEventHandlers,
1120
- dataSources = props.dataSources,
1121
- options = props.options,
1122
- _props$context = props.context,
1123
- context = _props$context === void 0 ? {} : _props$context,
1124
- width = props.width,
1125
- height = props.height,
1126
- onComputedProps = props.onComputedProps,
1127
- onEventTrigger = props.onEventTrigger,
1128
- theme = props.theme,
1129
- onRequestParamsChange = props.onRequestParamsChange;
1276
+ hasEventHandlers = props.hasEventHandlers,
1277
+ dataSources = props.dataSources,
1278
+ options = props.options,
1279
+ _props$context = props.context,
1280
+ context = _props$context === void 0 ? {} : _props$context,
1281
+ width = props.width,
1282
+ height = props.height,
1283
+ onComputedProps = props.onComputedProps,
1284
+ onEventTrigger = props.onEventTrigger,
1285
+ theme = props.theme,
1286
+ onRequestParamsChange = props.onRequestParamsChange;
1287
+
1130
1288
  var _React$useContext = React.useContext(TimezoneContext_1.default),
1131
- serializedTimezone = _React$useContext.serializedTimezone;
1289
+ serializedTimezone = _React$useContext.serializedTimezone;
1290
+
1132
1291
  if (serializedTimezone) {
1133
1292
  /*
1134
1293
  @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
@@ -1142,38 +1301,51 @@ var withDashboardViz = function withDashboardViz(opts) {
1142
1301
  moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1143
1302
  }
1144
1303
  }
1304
+
1145
1305
  var themeFunc = function themeFunc(themeVar) {
1146
1306
  var _a, _b;
1307
+
1147
1308
  return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1148
1309
  };
1310
+
1149
1311
  var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1312
+
1150
1313
  var _ref = (0, getSettingsFromThemedProps_1.default)({
1151
- theme: theme
1152
- }),
1153
- currentThemeFamily = _ref.family,
1154
- currentThemeColorScheme = _ref.colorScheme,
1155
- currentThemeDensity = _ref.density;
1314
+ theme: theme
1315
+ }),
1316
+ currentThemeFamily = _ref.family,
1317
+ currentThemeColorScheme = _ref.colorScheme,
1318
+ currentThemeDensity = _ref.density;
1319
+
1156
1320
  var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1321
+
1157
1322
  var _React$useState = React.useState({}),
1158
- _React$useState2 = _slicedToArray(_React$useState, 2),
1159
- evaluatedOptionsAsync = _React$useState2[0],
1160
- setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1323
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1324
+ evaluatedOptionsAsync = _React$useState2[0],
1325
+ setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1326
+
1327
+
1161
1328
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
1329
+
1162
1330
  var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
1163
- _React$useState4 = _slicedToArray(_React$useState3, 1),
1164
- visualizationID = _React$useState4[0];
1331
+ _React$useState4 = _slicedToArray(_React$useState3, 1),
1332
+ visualizationID = _React$useState4[0];
1333
+
1165
1334
  var _React$useState5 = React.useState({}),
1166
- _React$useState6 = _slicedToArray(_React$useState5, 2),
1167
- dataSourcesInState = _React$useState6[0],
1168
- setDataSourcesInState = _React$useState6[1];
1335
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
1336
+ dataSourcesInState = _React$useState6[0],
1337
+ setDataSourcesInState = _React$useState6[1];
1338
+
1169
1339
  var _React$useState7 = React.useState(),
1170
- _React$useState8 = _slicedToArray(_React$useState7, 2),
1171
- dataFramesInState = _React$useState8[0],
1172
- setDataFramesInState = _React$useState8[1];
1340
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
1341
+ dataFramesInState = _React$useState8[0],
1342
+ setDataFramesInState = _React$useState8[1];
1343
+
1173
1344
  var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
1174
- _React$useState10 = _slicedToArray(_React$useState9, 2),
1175
- useAsyncEvaluatedOptions = _React$useState10[0],
1176
- setUseAsyncEvaluatedOptions = _React$useState10[1];
1345
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
1346
+ useAsyncEvaluatedOptions = _React$useState10[0],
1347
+ setUseAsyncEvaluatedOptions = _React$useState10[1];
1348
+
1177
1349
  var isMounted = React.useRef(true);
1178
1350
  evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
1179
1351
  try {
@@ -1198,11 +1370,13 @@ var withDashboardViz = function withDashboardViz(opts) {
1198
1370
  });
1199
1371
  } else {
1200
1372
  var dataFrames = dataFramesInState;
1373
+
1201
1374
  if (dataSources !== dataSourcesInState) {
1202
1375
  setDataSourcesInState(dataSources);
1203
1376
  dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
1204
1377
  setDataFramesInState(dataFrames);
1205
1378
  }
1379
+
1206
1380
  return Options_1.Options.evaluate({
1207
1381
  context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
1208
1382
  options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
@@ -1213,21 +1387,24 @@ var withDashboardViz = function withDashboardViz(opts) {
1213
1387
  console.error("unexpected error evaluating options: ".concat(e.message));
1214
1388
  return {};
1215
1389
  }
1390
+
1216
1391
  return {};
1217
1392
  }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
1218
- var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
1219
- // trellis specific backgroundColor update for onComputedProps
1393
+ var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
1220
1394
  // 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
1221
1395
  // onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
1396
+
1222
1397
  var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
1223
1398
  var clonedEvaluatedOptions = evaluatedOptionsToUse;
1399
+
1224
1400
  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) {
1225
1401
  clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
1226
1402
  backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
1227
1403
  });
1228
- }
1229
- // useEffect hook needs to be initialized before any early returns
1404
+ } // useEffect hook needs to be initialized before any early returns
1230
1405
  // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1406
+
1407
+
1231
1408
  React.useEffect(function () {
1232
1409
  onComputedProps(clonedEvaluatedOptions);
1233
1410
  });
@@ -1237,53 +1414,68 @@ var withDashboardViz = function withDashboardViz(opts) {
1237
1414
  isMounted.current = false;
1238
1415
  async_dynamic_options_evaluator_1.default.reset(visualizationID);
1239
1416
  }
1240
- };
1241
- // eslint-disable-next-line react-hooks/exhaustive-deps
1242
- }, []);
1243
- // present warning message if any required props are missing
1417
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
1418
+ }, []); // present warning message if any required props are missing
1419
+
1244
1420
  var _vizConfig$requiredPr = vizConfig.requiredProps,
1245
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1246
- supports = vizConfig.supports;
1421
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1422
+ supports = vizConfig.supports;
1247
1423
  var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
1424
+
1248
1425
  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
1249
1426
  ) {
1250
- return React.createElement(MissingPropsMessage_1.default, {
1251
- "data-test": "missing-props-message",
1252
- width: width,
1253
- height: height,
1254
- missingProps: missing,
1255
- backgroundColor: bgColorFromTheme
1256
- });
1257
- }
1258
- // events
1427
+ return React.createElement(MissingPropsMessage_1.default, {
1428
+ "data-test": "missing-props-message",
1429
+ width: width,
1430
+ height: height,
1431
+ missingProps: missing,
1432
+ backgroundColor: bgColorFromTheme
1433
+ });
1434
+ } // events
1435
+
1436
+
1259
1437
  var eventCallbackProps = {};
1438
+
1260
1439
  if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1261
1440
  var supportedEvents = vizConfig.events;
1262
1441
  Object.keys(supportedEvents).forEach(function (eventName) {
1263
- var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
1264
- eventCallbackProps[eventCallbackPropName] = null;
1265
- // todo: refactor single value and single value icon to send payload from viz
1442
+ var _supportedEvents$even = supportedEvents[eventName],
1443
+ parentKeys = _supportedEvents$even.parentKeys,
1444
+ payloadKeys = _supportedEvents$even.payloadKeys;
1445
+ var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName)); // todo: refactor single value and single value icon to send payload from viz
1266
1446
  // then remove these lines
1267
- var payloadKeys = supportedEvents[eventName].payloadKeys;
1447
+
1268
1448
  var payload = {};
1449
+
1269
1450
  if (Array.isArray(payloadKeys) && payloadKeys.length) {
1270
1451
  payloadKeys.forEach(function (p) {
1271
1452
  payload[p] = evaluatedOptionsToUse[p];
1272
1453
  });
1273
1454
  }
1455
+
1274
1456
  eventCallbackProps[eventCallbackPropName] = function (ev) {
1275
1457
  if (ev && ev.payload) {
1276
1458
  payload = ev.payload;
1277
1459
  }
1460
+
1278
1461
  return onEventTrigger({
1279
1462
  originalEvent: ev,
1280
1463
  payload: payload,
1281
1464
  type: eventName
1282
1465
  });
1283
1466
  };
1467
+
1468
+ if (parentKeys) {
1469
+ for (var i = parentKeys.length - 1; i >= 0; i -= 1) {
1470
+ var newObject = {};
1471
+ newObject[parentKeys[i]] = eventCallbackProps[eventCallbackPropName];
1472
+ eventCallbackProps[eventCallbackPropName] = newObject;
1473
+ }
1474
+ }
1284
1475
  });
1285
- }
1286
- // compute pure viz props which are not from options
1476
+ } // compute pure viz props which are not from options
1477
+
1478
+
1287
1479
  var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
1288
1480
  themeFunc: themeFunc
1289
1481
  }));
@@ -1301,15 +1493,19 @@ var withDashboardViz = function withDashboardViz(opts) {
1301
1493
  * In future, we could automatically detect which all datasources are being used
1302
1494
  * and bind those magically to pagination/sorting behavior.
1303
1495
  */
1496
+
1304
1497
  var dataSourceMetadata = {};
1305
1498
  var OptionKey = 'paginateDataSourceKey';
1306
1499
  var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
1500
+
1307
1501
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
1308
1502
  var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1309
1503
  var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
1504
+
1310
1505
  var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1311
1506
  return onRequestParamsChange(paginateDataSourceKey, payload);
1312
1507
  };
1508
+
1313
1509
  var sortParams = (0, getSorting_1.getSortingParams)({
1314
1510
  requestParams: requestParams,
1315
1511
  meta: meta,
@@ -1324,115 +1520,132 @@ var withDashboardViz = function withDashboardViz(opts) {
1324
1520
  sortParams: sortParams,
1325
1521
  paginatorParams: paginatorParams
1326
1522
  };
1327
- }
1328
- // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1523
+ } // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1524
+
1525
+
1329
1526
  if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
1330
1527
  return null;
1331
1528
  }
1529
+
1332
1530
  return React.createElement(SanitizedReactViz, Object.assign({
1333
1531
  mode: mode,
1334
1532
  width: width,
1335
1533
  height: height
1336
1534
  }, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
1337
1535
  };
1536
+
1338
1537
  DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1339
1538
  DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1340
1539
  // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1341
1540
  theme: {}
1342
- });
1343
- // attach viz config
1344
- DashboardViz.config = vizConfig;
1345
- // @ts-ignore: TODO fix sc upgrade TS issues
1541
+ }); // attach viz config
1542
+
1543
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1544
+
1346
1545
  return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
1347
1546
  };
1547
+
1348
1548
  exports.default = withDashboardViz;
1349
1549
 
1350
1550
  /***/ }),
1351
1551
 
1352
- /***/ 37:
1552
+ /***/ 38:
1353
1553
  /***/ (function(module, exports) {
1354
1554
 
1355
1555
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1356
1556
 
1357
1557
  /***/ }),
1358
1558
 
1359
- /***/ 38:
1559
+ /***/ 39:
1360
1560
  /***/ (function(module, exports) {
1361
1561
 
1362
1562
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1363
1563
 
1364
1564
  /***/ }),
1365
1565
 
1366
- /***/ 39:
1566
+ /***/ 4:
1367
1567
  /***/ (function(module, exports) {
1368
1568
 
1369
- module.exports = require("@splunk/moment");
1569
+ module.exports = require("styled-components");
1370
1570
 
1371
1571
  /***/ }),
1372
1572
 
1373
- /***/ 4:
1573
+ /***/ 40:
1374
1574
  /***/ (function(module, exports) {
1375
1575
 
1376
- module.exports = require("styled-components");
1576
+ module.exports = require("@splunk/moment");
1377
1577
 
1378
1578
  /***/ }),
1379
1579
 
1380
- /***/ 40:
1580
+ /***/ 41:
1381
1581
  /***/ (function(module, exports) {
1382
1582
 
1383
1583
  module.exports = require("@splunk/async-dynamic-options-evaluator");
1384
1584
 
1385
1585
  /***/ }),
1386
1586
 
1387
- /***/ 41:
1587
+ /***/ 42:
1388
1588
  /***/ (function(module, exports, __webpack_require__) {
1389
1589
 
1390
1590
  "use strict";
1391
1591
 
1392
1592
 
1393
1593
  var _classCallCheck = __webpack_require__(9);
1594
+
1394
1595
  Object.defineProperty(exports, "__esModule", {
1395
1596
  value: true
1396
1597
  });
1397
1598
  exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1398
1599
  /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1600
+
1399
1601
  var T = __webpack_require__(0);
1602
+
1400
1603
  var lodash_1 = __webpack_require__(3);
1401
- var VizActionHandler_1 = __webpack_require__(42);
1402
- // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1604
+
1605
+ var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1606
+
1607
+
1403
1608
  exports.INITIAL_WIDTH = 250;
1404
1609
  exports.INITIAL_HEIGHT = 250;
1405
1610
  /**
1406
1611
  * A Splunk visualization
1407
1612
  */
1613
+
1408
1614
  var SplunkVisualization = function SplunkVisualization() {
1409
1615
  _classCallCheck(this, SplunkVisualization);
1410
1616
  };
1617
+
1411
1618
  SplunkVisualization.propTypes = {
1412
1619
  /**
1413
1620
  * display mode
1414
1621
  */
1415
1622
  mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1623
+
1416
1624
  /**
1417
1625
  * width in pixel or string, defaults to 100%
1418
1626
  */
1419
1627
  width: T.oneOfType([T.string, T.number]).isRequired,
1628
+
1420
1629
  /**
1421
1630
  * height in pixel or string
1422
1631
  */
1423
1632
  height: T.oneOfType([T.string, T.number]).isRequired,
1633
+
1424
1634
  /**
1425
1635
  * visualization context used for dynamic option evaluation
1426
1636
  */
1427
1637
  context: T.object,
1638
+
1428
1639
  /**
1429
1640
  * visualization formatting options
1430
1641
  */
1431
1642
  options: T.object,
1643
+
1432
1644
  /**
1433
1645
  * A callback to update formatting options
1434
1646
  */
1435
1647
  onOptionsChange: T.func,
1648
+
1436
1649
  /**
1437
1650
  * datasource state which include data and request params, object key indicate the datasource type.
1438
1651
  */
@@ -1441,6 +1654,7 @@ SplunkVisualization.propTypes = {
1441
1654
  * current request params
1442
1655
  */
1443
1656
  requestParams: T.object,
1657
+
1444
1658
  /**
1445
1659
  * current dataset
1446
1660
  */
@@ -1448,6 +1662,7 @@ SplunkVisualization.propTypes = {
1448
1662
  fields: T.array,
1449
1663
  columns: T.array
1450
1664
  }),
1665
+
1451
1666
  /**
1452
1667
  * error
1453
1668
  */
@@ -1455,29 +1670,35 @@ SplunkVisualization.propTypes = {
1455
1670
  level: T.string,
1456
1671
  message: T.string
1457
1672
  }),
1673
+
1458
1674
  /**
1459
1675
  * meta data that came with the dataset
1460
1676
  */
1461
1677
  meta: T.object
1462
1678
  })),
1679
+
1463
1680
  /**
1464
1681
  * A callback to trigger event
1465
1682
  */
1466
1683
  onEventTrigger: T.func,
1684
+
1467
1685
  /**
1468
1686
  * Inform viz if there are handlers listening to events
1469
1687
  */
1470
1688
  hasEventHandlers: T.bool,
1689
+
1471
1690
  /**
1472
1691
  * A callback to communicate computed props to a consumer
1473
1692
  */
1474
1693
  onComputedProps: T.func,
1694
+
1475
1695
  /**
1476
1696
  * A callback to obtain visualization api
1477
1697
  */
1478
1698
  vizActionHandlerRef: T.func,
1479
1699
  loading: T.bool,
1480
1700
  theme: T.object,
1701
+
1481
1702
  /**
1482
1703
  * A callback to request new data with updated request params
1483
1704
  */
@@ -1486,6 +1707,7 @@ SplunkVisualization.propTypes = {
1486
1707
  /**
1487
1708
  *
1488
1709
  */
1710
+
1489
1711
  SplunkVisualization.defaultProps = {
1490
1712
  // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1491
1713
  width: '100%',
@@ -1514,39 +1736,6 @@ exports.default = SplunkVisualization;
1514
1736
 
1515
1737
  /***/ }),
1516
1738
 
1517
- /***/ 42:
1518
- /***/ (function(module, exports, __webpack_require__) {
1519
-
1520
- "use strict";
1521
-
1522
-
1523
- var _classCallCheck = __webpack_require__(9);
1524
- var _createClass = __webpack_require__(18);
1525
- Object.defineProperty(exports, "__esModule", {
1526
- value: true
1527
- });
1528
- exports.DefaultVizActionHandler = void 0;
1529
- var DefaultVizActionHandler = /*#__PURE__*/function () {
1530
- function DefaultVizActionHandler() {
1531
- _classCallCheck(this, DefaultVizActionHandler);
1532
- }
1533
- _createClass(DefaultVizActionHandler, [{
1534
- key: "focus",
1535
- value: function focus() {
1536
- // noop
1537
- }
1538
- }, {
1539
- key: "snapshot",
1540
- value: function snapshot() {
1541
- return null; // noop
1542
- }
1543
- }]);
1544
- return DefaultVizActionHandler;
1545
- }();
1546
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
1547
-
1548
- /***/ }),
1549
-
1550
1739
  /***/ 423:
1551
1740
  /***/ (function(module, exports, __webpack_require__) {
1552
1741
 
@@ -1556,6 +1745,7 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1556
1745
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1557
1746
  if (k2 === undefined) k2 = k;
1558
1747
  var desc = Object.getOwnPropertyDescriptor(m, k);
1748
+
1559
1749
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1560
1750
  desc = {
1561
1751
  enumerable: true,
@@ -1564,22 +1754,28 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
1564
1754
  }
1565
1755
  };
1566
1756
  }
1757
+
1567
1758
  Object.defineProperty(o, k2, desc);
1568
1759
  } : function (o, m, k, k2) {
1569
1760
  if (k2 === undefined) k2 = k;
1570
1761
  o[k2] = m[k];
1571
1762
  });
1763
+
1572
1764
  var __exportStar = this && this.__exportStar || function (m, exports) {
1573
1765
  for (var p in m) {
1574
1766
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1575
1767
  }
1576
1768
  };
1769
+
1577
1770
  Object.defineProperty(exports, "__esModule", {
1578
1771
  value: true
1579
1772
  });
1580
1773
  exports.default = void 0;
1581
- __exportStar(__webpack_require__(161), exports);
1582
- var Markdown_1 = __webpack_require__(161);
1774
+
1775
+ __exportStar(__webpack_require__(162), exports);
1776
+
1777
+ var Markdown_1 = __webpack_require__(162);
1778
+
1583
1779
  Object.defineProperty(exports, "default", {
1584
1780
  enumerable: true,
1585
1781
  get: function get() {
@@ -1610,21 +1806,29 @@ module.exports = require("@splunk/react-ui/Code");
1610
1806
 
1611
1807
 
1612
1808
  var _toConsumableArray = __webpack_require__(8);
1809
+
1613
1810
  Object.defineProperty(exports, "__esModule", {
1614
1811
  value: true
1615
1812
  });
1813
+
1616
1814
  var themes_1 = __webpack_require__(60);
1815
+
1617
1816
  var i18n_1 = __webpack_require__(2);
1817
+
1618
1818
  var schemaUtils_1 = __webpack_require__(16);
1819
+
1619
1820
  var VizBehavior_1 = __webpack_require__(6);
1620
- var VizCategory_1 = __webpack_require__(35);
1821
+
1822
+ var VizCategory_1 = __webpack_require__(36);
1823
+
1621
1824
  var configUtils_1 = __webpack_require__(20);
1825
+
1622
1826
  var BackgroundColor_1 = __webpack_require__(53);
1827
+
1623
1828
  var FONT_OPTIONS = new Set(['extraSmall', 'small', 'default', 'large', 'extraLarge']);
1624
1829
  var dataContract = {
1625
1830
  requiredDataSources: [],
1626
- optionalDataSources: [
1627
- // Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
1831
+ optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
1628
1832
  // {
1629
1833
  // name: 'annotation',
1630
1834
  // description: 'DataSource that populate event annotations',
@@ -1785,16 +1989,19 @@ var editorConfig = [{
1785
1989
  /**
1786
1990
  * visualization configuration
1787
1991
  */
1992
+
1788
1993
  var config = {
1789
1994
  /**
1790
1995
  * unique viz key
1791
1996
  */
1792
1997
  key: 'splunk.markdown',
1998
+
1793
1999
  /**
1794
2000
  * viz name
1795
2001
  */
1796
2002
  name: (0, i18n_1._)('Markdown'),
1797
2003
  category: VizCategory_1.VizCategory.COMPARISONS,
2004
+
1798
2005
  /**
1799
2006
  * viz icon
1800
2007
  */
@@ -1822,11 +2029,35 @@ exports.default = (0, configUtils_1.enhanceConfig)(config);
1822
2029
  "use strict";
1823
2030
 
1824
2031
 
2032
+ var _classCallCheck = __webpack_require__(9);
2033
+
2034
+ var _createClass = __webpack_require__(18);
2035
+
1825
2036
  Object.defineProperty(exports, "__esModule", {
1826
2037
  value: true
1827
2038
  });
1828
- exports.validSortDirs = void 0;
1829
- exports.validSortDirs = ['asc', 'desc', 'none'];
2039
+ exports.DefaultVizActionHandler = void 0;
2040
+
2041
+ var DefaultVizActionHandler = /*#__PURE__*/function () {
2042
+ function DefaultVizActionHandler() {
2043
+ _classCallCheck(this, DefaultVizActionHandler);
2044
+ }
2045
+
2046
+ _createClass(DefaultVizActionHandler, [{
2047
+ key: "focus",
2048
+ value: function focus() {// noop
2049
+ }
2050
+ }, {
2051
+ key: "snapshot",
2052
+ value: function snapshot() {
2053
+ return null; // noop
2054
+ }
2055
+ }]);
2056
+
2057
+ return DefaultVizActionHandler;
2058
+ }();
2059
+
2060
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1830
2061
 
1831
2062
  /***/ }),
1832
2063
 
@@ -1840,7 +2071,9 @@ Object.defineProperty(exports, "__esModule", {
1840
2071
  value: true
1841
2072
  });
1842
2073
  exports.useDeepMemo = void 0;
2074
+
1843
2075
  var react_1 = __webpack_require__(1);
2076
+
1844
2077
  var lodash_1 = __webpack_require__(3);
1845
2078
  /**
1846
2079
  * This hook evaluates and stores the result of a passed function and only
@@ -1855,16 +2088,21 @@ var lodash_1 = __webpack_require__(3);
1855
2088
  * @param fn the function to be executed and
1856
2089
  * @param dependencies an array of dependencies
1857
2090
  */
2091
+
2092
+
1858
2093
  var useDeepMemo = function useDeepMemo(fn, dependencies) {
1859
2094
  var ref = (0, react_1.useRef)();
2095
+
1860
2096
  if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
1861
2097
  ref.current = {
1862
2098
  dependencies: dependencies,
1863
2099
  value: fn()
1864
2100
  };
1865
2101
  }
2102
+
1866
2103
  return ref.current.value;
1867
2104
  };
2105
+
1868
2106
  exports.useDeepMemo = useDeepMemo;
1869
2107
 
1870
2108
  /***/ }),
@@ -1879,19 +2117,27 @@ Object.defineProperty(exports, "__esModule", {
1879
2117
  value: true
1880
2118
  });
1881
2119
  exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
2120
+
1882
2121
  var React = __webpack_require__(1);
2122
+
1883
2123
  var T = __webpack_require__(0);
2124
+
1884
2125
  var i18n_1 = __webpack_require__(2);
2126
+
1885
2127
  var Message_1 = __webpack_require__(10);
2128
+
1886
2129
  var FixedSizeContainer_1 = __webpack_require__(13);
1887
2130
  /**
1888
2131
  * @method isMissing
1889
2132
  * @param {any} v
1890
2133
  * @returns {boolean} true if the input value === null or undefined
1891
2134
  */
2135
+
2136
+
1892
2137
  var isMissing = function isMissing(v) {
1893
2138
  return v === null || v === undefined;
1894
2139
  };
2140
+
1895
2141
  exports.isMissing = isMissing;
1896
2142
  /**
1897
2143
  * @method misskingKeys
@@ -1899,11 +2145,13 @@ exports.isMissing = isMissing;
1899
2145
  * @param {object} target
1900
2146
  * @returns {string[]} the keys of missing required props
1901
2147
  */
2148
+
1902
2149
  var missingKeys = function missingKeys(keys, target) {
1903
2150
  return keys.filter(function (k) {
1904
2151
  return (0, exports.isMissing)(target[k]);
1905
2152
  });
1906
2153
  };
2154
+
1907
2155
  exports.missingKeys = missingKeys;
1908
2156
  var propTypes = {
1909
2157
  width: T.oneOfType([T.string, T.number]),
@@ -1917,10 +2165,11 @@ var propTypes = {
1917
2165
  * @param {MissingPropsProps} props
1918
2166
  * @returns {React.ReactElement}
1919
2167
  */
2168
+
1920
2169
  var MissingPropsMessage = function MissingPropsMessage(props) {
1921
2170
  var width = props.width,
1922
- height = props.height,
1923
- missingProps = props.missingProps;
2171
+ height = props.height,
2172
+ missingProps = props.missingProps;
1924
2173
  return React.createElement(Message_1.default, {
1925
2174
  "data-test": "message",
1926
2175
  width: width,
@@ -1928,6 +2177,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
1928
2177
  message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
1929
2178
  });
1930
2179
  };
2180
+
1931
2181
  exports.MissingPropsMessage = MissingPropsMessage;
1932
2182
  exports.MissingPropsMessage.propTypes = propTypes;
1933
2183
  exports.MissingPropsMessage.defaultProps = {
@@ -1947,15 +2197,19 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage)
1947
2197
  Object.defineProperty(exports, "__esModule", {
1948
2198
  value: true
1949
2199
  });
2200
+
1950
2201
  var React = __webpack_require__(1);
2202
+
1951
2203
  var styled_components_1 = __webpack_require__(4);
2204
+
1952
2205
  var hocUtils_1 = __webpack_require__(15);
2206
+
1953
2207
  var Cover = styled_components_1.default.div.withConfig({
1954
2208
  displayName: "withEditModeCover__Cover",
1955
2209
  componentId: "sc-1gsbnxb-0"
1956
2210
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1957
2211
  var Blocker = styled_components_1.default.div.attrs({
1958
- 'data-splunk-visualization-version': "26.0.0 - 2f7458907"
2212
+ 'data-splunk-visualization-version': "26.1.1 - b6df0a015"
1959
2213
  }).withConfig({
1960
2214
  displayName: "withEditModeCover__Blocker",
1961
2215
  componentId: "sc-1gsbnxb-1"
@@ -1966,6 +2220,7 @@ var Blocker = styled_components_1.default.div.attrs({
1966
2220
  * @param {ExtendedDashViz} Visualization
1967
2221
  * @returns {ExtendedDashViz} Wrapper
1968
2222
  */
2223
+
1969
2224
  var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1970
2225
  var Wrapper = function Wrapper(props) {
1971
2226
  var mode = props.mode;
@@ -1974,12 +2229,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
1974
2229
  "data-test": "edit-mode-cover"
1975
2230
  }));
1976
2231
  };
2232
+
1977
2233
  (0, hocUtils_1.extendStaticWrapperProps)({
1978
2234
  Wrapper: Wrapper,
1979
2235
  Visualization: Visualization
1980
2236
  });
1981
2237
  return Wrapper;
1982
2238
  };
2239
+
1983
2240
  exports.default = withEditModeCover;
1984
2241
 
1985
2242
  /***/ }),
@@ -1993,27 +2250,37 @@ exports.default = withEditModeCover;
1993
2250
  Object.defineProperty(exports, "__esModule", {
1994
2251
  value: true
1995
2252
  });
2253
+
1996
2254
  var React = __webpack_require__(1);
2255
+
1997
2256
  var colorUtils_1 = __webpack_require__(12);
2257
+
1998
2258
  var variables_1 = __webpack_require__(11);
2259
+
1999
2260
  var IconPlaceholder_1 = __webpack_require__(32);
2261
+
2000
2262
  var VizBehavior_1 = __webpack_require__(6);
2263
+
2001
2264
  var hocUtils_1 = __webpack_require__(15);
2265
+
2002
2266
  var withPlaceholder = function withPlaceholder(Visualization) {
2003
2267
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
2004
2268
  var config = Visualization.config;
2005
2269
  var themes = config.themes;
2270
+
2006
2271
  var Wrapper = function Wrapper(props) {
2007
2272
  var _a, _b;
2273
+
2008
2274
  var dataSources = props.dataSources,
2009
- loading = props.loading,
2010
- options = props.options,
2011
- height = props.height,
2012
- width = props.width;
2275
+ loading = props.loading,
2276
+ options = props.options,
2277
+ height = props.height,
2278
+ width = props.width;
2013
2279
  var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
2014
2280
  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);
2015
2281
  var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
2016
2282
  var iconColor = variables_1.default.contentColorActive(props);
2283
+
2017
2284
  if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
2018
2285
  return React.createElement(IconPlaceholder_1.default, {
2019
2286
  "data-test": "icon-placeholder",
@@ -2024,14 +2291,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
2024
2291
  iconColor: iconColor
2025
2292
  });
2026
2293
  }
2294
+
2027
2295
  return React.createElement(Visualization, Object.assign({}, props));
2028
2296
  };
2297
+
2029
2298
  (0, hocUtils_1.extendStaticWrapperProps)({
2030
2299
  Wrapper: Wrapper,
2031
2300
  Visualization: Visualization
2032
2301
  });
2033
2302
  return Wrapper;
2034
2303
  };
2304
+
2035
2305
  exports.default = withPlaceholder;
2036
2306
 
2037
2307
  /***/ }),
@@ -2045,11 +2315,13 @@ exports.default = withPlaceholder;
2045
2315
  Object.defineProperty(exports, "__esModule", {
2046
2316
  value: true
2047
2317
  });
2318
+
2048
2319
  var i18n_1 = __webpack_require__(2);
2320
+
2049
2321
  var background = function background(_ref) {
2050
2322
  var label = _ref.label,
2051
- themes = _ref.themes,
2052
- labelPosition = _ref.labelPosition;
2323
+ themes = _ref.themes,
2324
+ labelPosition = _ref.labelPosition;
2053
2325
  return [{
2054
2326
  label: (0, i18n_1._)(label || 'Background'),
2055
2327
  option: 'backgroundColor',
@@ -2060,6 +2332,7 @@ var background = function background(_ref) {
2060
2332
  }
2061
2333
  }];
2062
2334
  };
2335
+
2063
2336
  exports.default = background;
2064
2337
 
2065
2338
  /***/ }),
@@ -2082,6 +2355,7 @@ Object.defineProperty(exports, "__esModule", {
2082
2355
  });
2083
2356
  exports.VizBehavior = void 0;
2084
2357
  var VizBehavior;
2358
+
2085
2359
  (function (VizBehavior) {
2086
2360
  /**
2087
2361
  * Dynamic Options Behavior.
@@ -2101,6 +2375,7 @@ var VizBehavior;
2101
2375
  * missing.
2102
2376
  * @type {string}
2103
2377
  */
2378
+
2104
2379
  VizBehavior["PLACEHOLDER"] = "placeholder";
2105
2380
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
2106
2381
  VizBehavior["TRELLIS"] = "trellis";
@@ -2129,17 +2404,17 @@ module.exports = require("@babel/runtime/helpers/toConsumableArray");
2129
2404
 
2130
2405
  /***/ }),
2131
2406
 
2132
- /***/ 9:
2407
+ /***/ 83:
2133
2408
  /***/ (function(module, exports) {
2134
2409
 
2135
- module.exports = require("@babel/runtime/helpers/classCallCheck");
2410
+ module.exports = require("@splunk/visualization-encoding/utils/types");
2136
2411
 
2137
2412
  /***/ }),
2138
2413
 
2139
- /***/ 94:
2414
+ /***/ 9:
2140
2415
  /***/ (function(module, exports) {
2141
2416
 
2142
- module.exports = require("@splunk/visualization-encoding/utils/types");
2417
+ module.exports = require("@babel/runtime/helpers/classCallCheck");
2143
2418
 
2144
2419
  /***/ })
2145
2420