@splunk/visualizations 26.0.0 → 26.1.0

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