@splunk/visualizations 25.0.1 → 25.2.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 (200) hide show
  1. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Background_Color_Red.png +0 -0
  2. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Basic.png +0 -0
  3. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_Simulated_Instance.png +0 -0
  4. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_for_Numeric_Field_Simulated_Instance.png +0 -0
  5. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Dark.png +0 -0
  6. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Light.png +0 -0
  7. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_custom_base_layer_tile_server.png +0 -0
  8. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Background_color_cyan.png +0 -0
  9. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_after_default.png +0 -0
  10. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_before.png +0 -0
  11. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Background_Color_white_Under_Label_and_Unit_specified.png +0 -0
  12. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Major_Value_is_null.png +0 -0
  13. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_after_default.png +0 -0
  14. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_before.png +0 -0
  15. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
  16. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
  17. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
  18. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
  19. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
  20. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
  21. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Events_Editor.png +0 -0
  22. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
  23. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
  24. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
  25. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
  26. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
  27. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
  28. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
  29. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
  30. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
  31. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
  32. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
  33. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
  34. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
  35. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
  36. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
  37. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
  38. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
  39. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Background_Color_Light_Blue.png +0 -0
  40. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Basic_Events.png +0 -0
  41. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Event_Actions.png +0 -0
  42. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Actions.png +0 -0
  43. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary.png +0 -0
  44. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary_Simulated_Instance.png +0 -0
  45. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields.png +0 -0
  46. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields_with_Highlight.png +0 -0
  47. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Show_Placeholder.png +0 -0
  48. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Height.png +0 -0
  49. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Percentage_50.png +0 -0
  50. package/.loki/reference/chrome_docker_Visualizations_Events_Events_With_Options.png +0 -0
  51. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_ES.png +0 -0
  52. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_after.png +0 -0
  53. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_before.png +0 -0
  54. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_After.png +0 -0
  55. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_Before.png +0 -0
  56. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_After.png +0 -0
  57. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_Before.png +0 -0
  58. package/Area.config.js +146 -157
  59. package/Area.config.js.map +1 -1
  60. package/Area.js +459 -545
  61. package/Area.js.map +1 -1
  62. package/Bar.config.js +148 -153
  63. package/Bar.config.js.map +1 -1
  64. package/Bar.js +468 -548
  65. package/Bar.js.map +1 -1
  66. package/Bubble.config.js +143 -123
  67. package/Bubble.config.js.map +1 -1
  68. package/Bubble.js +475 -530
  69. package/Bubble.js.map +1 -1
  70. package/ChoroplethSvg.config.js +87 -81
  71. package/ChoroplethSvg.config.js.map +1 -1
  72. package/ChoroplethSvg.js +352 -422
  73. package/ChoroplethSvg.js.map +1 -1
  74. package/Column.config.js +144 -151
  75. package/Column.config.js.map +1 -1
  76. package/Column.js +463 -546
  77. package/Column.js.map +1 -1
  78. package/Ellipse.config.js +86 -80
  79. package/Ellipse.config.js.map +1 -1
  80. package/Ellipse.js +319 -389
  81. package/Ellipse.js.map +1 -1
  82. package/Events.config.js +668 -0
  83. package/Events.config.js.map +1 -0
  84. package/Events.js +3116 -0
  85. package/Events.js.map +1 -0
  86. package/FillerGauge.config.js +94 -87
  87. package/FillerGauge.config.js.map +1 -1
  88. package/FillerGauge.js +352 -415
  89. package/FillerGauge.js.map +1 -1
  90. package/Image.config.js +74 -74
  91. package/Image.config.js.map +1 -1
  92. package/Image.js +713 -801
  93. package/Image.js.map +1 -1
  94. package/Line.config.js +145 -142
  95. package/Line.config.js.map +1 -1
  96. package/Line.js +471 -538
  97. package/Line.js.map +1 -1
  98. package/LinkGraph.config.js +120 -113
  99. package/LinkGraph.config.js.map +1 -1
  100. package/LinkGraph.js +24563 -717
  101. package/LinkGraph.js.map +1 -1
  102. package/Map.config.js +107 -100
  103. package/Map.config.js.map +1 -1
  104. package/Map.js +2358 -2465
  105. package/Map.js.map +1 -1
  106. package/Markdown.config.js +112 -112
  107. package/Markdown.config.js.map +1 -1
  108. package/Markdown.js +844 -918
  109. package/Markdown.js.map +1 -1
  110. package/MarkerGauge.config.js +185 -186
  111. package/MarkerGauge.config.js.map +1 -1
  112. package/MarkerGauge.js +1274 -1363
  113. package/MarkerGauge.js.map +1 -1
  114. package/ParallelCoordinates.config.js +137 -137
  115. package/ParallelCoordinates.config.js.map +1 -1
  116. package/ParallelCoordinates.js +732 -923
  117. package/ParallelCoordinates.js.map +1 -1
  118. package/Pie.config.js +132 -132
  119. package/Pie.config.js.map +1 -1
  120. package/Pie.js +1193 -1281
  121. package/Pie.js.map +1 -1
  122. package/Punchcard.config.js +138 -138
  123. package/Punchcard.config.js.map +1 -1
  124. package/Punchcard.js +2723 -2923
  125. package/Punchcard.js.map +1 -1
  126. package/Rectangle.config.js +267 -260
  127. package/Rectangle.config.js.map +1 -1
  128. package/Rectangle.js +1107 -1188
  129. package/Rectangle.js.map +1 -1
  130. package/Sankey.config.js +149 -142
  131. package/Sankey.config.js.map +1 -1
  132. package/Sankey.js +2613 -2808
  133. package/Sankey.js.map +1 -1
  134. package/Scatter.config.js +144 -123
  135. package/Scatter.config.js.map +1 -1
  136. package/Scatter.js +1820 -1889
  137. package/Scatter.js.map +1 -1
  138. package/SingleValue.config.js +121 -114
  139. package/SingleValue.config.js.map +1 -1
  140. package/SingleValue.js +2554 -2635
  141. package/SingleValue.js.map +1 -1
  142. package/SingleValueBasic.js +34 -34
  143. package/SingleValueBasic.js.map +1 -1
  144. package/SingleValueIcon.config.js +129 -120
  145. package/SingleValueIcon.config.js.map +1 -1
  146. package/SingleValueIcon.js +994 -1212
  147. package/SingleValueIcon.js.map +1 -1
  148. package/SingleValueRadial.config.js +216 -178
  149. package/SingleValueRadial.config.js.map +1 -1
  150. package/SingleValueRadial.js +2235 -2316
  151. package/SingleValueRadial.js.map +1 -1
  152. package/Table.config.js +150 -151
  153. package/Table.config.js.map +1 -1
  154. package/Table.js +2446 -2525
  155. package/Table.js.map +1 -1
  156. package/common/Charting.js +11 -11
  157. package/common/Charting.js.map +1 -1
  158. package/common/ChartingApi.js +2 -2
  159. package/common/ChartingApi.js.map +1 -1
  160. package/common/EventsDoc.js +25 -18
  161. package/common/EventsDoc.js.map +1 -1
  162. package/common/GaugeMajorTicks.js +10 -10
  163. package/common/GaugeMajorTicks.js.map +1 -1
  164. package/common/GaugeValueMarker.js +10 -10
  165. package/common/GaugeValueMarker.js.map +1 -1
  166. package/common/OptionsDoc.js +57 -357
  167. package/common/OptionsDoc.js.map +1 -1
  168. package/common/OverviewDoc.js +22 -22
  169. package/common/OverviewDoc.js.map +1 -1
  170. package/common/SplunkVisualization.js +4 -4
  171. package/common/SplunkVisualization.js.map +1 -1
  172. package/common/SplunkVisualizationApi.js +2 -2
  173. package/common/SplunkVisualizationApi.js.map +1 -1
  174. package/common/ThemesDoc.js +21 -21
  175. package/common/ThemesDoc.js.map +1 -1
  176. package/common/chartingUtils.js +4 -4
  177. package/common/chartingUtils.js.map +1 -1
  178. package/common/docUtils.js +4 -4
  179. package/common/docUtils.js.map +1 -1
  180. package/common/gaugeUtils.js +13 -13
  181. package/common/gaugeUtils.js.map +1 -1
  182. package/common/shapeUtils.js +8 -8
  183. package/common/shapeUtils.js.map +1 -1
  184. package/common/utils/configUtils.js +17 -18
  185. package/common/utils/configUtils.js.map +1 -1
  186. package/common/utils/{JSONSchemaUtils.js → dataUtils.js} +24 -25
  187. package/common/utils/dataUtils.js.map +1 -0
  188. package/common/utils/hocUtils.js +5 -85
  189. package/common/utils/hocUtils.js.map +1 -1
  190. package/common/utils/mapUtils.js +198 -0
  191. package/common/utils/mapUtils.js.map +1 -0
  192. package/common/utils/singleValueUtils.js +15 -12
  193. package/common/utils/singleValueUtils.js.map +1 -1
  194. package/common/utils/testHelper.js +8 -8
  195. package/common/utils/testHelper.js.map +1 -1
  196. package/common/withDashboardViz.js +120 -207
  197. package/common/withDashboardViz.js.map +1 -1
  198. package/package.json +16 -14
  199. package/.loki/reference/chrome_docker_PureVisualizations_SvgChoroplethDynamic_SVG_Of_Size_Greater_Than_2_MB_Render.png +0 -0
  200. package/common/utils/JSONSchemaUtils.js.map +0 -1
package/Image.js CHANGED
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 178);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 196);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -109,25 +109,122 @@ module.exports = require("react");
109
109
  /***/ 10:
110
110
  /***/ (function(module, exports) {
111
111
 
112
- module.exports = require("@splunk/themes/variables");
112
+ module.exports = require("@splunk/visualizations-shared/Message");
113
113
 
114
114
  /***/ }),
115
115
 
116
116
  /***/ 11:
117
117
  /***/ (function(module, exports) {
118
118
 
119
- module.exports = require("@splunk/visualizations-shared/Message");
119
+ module.exports = require("@babel/runtime/helpers/classCallCheck");
120
120
 
121
121
  /***/ }),
122
122
 
123
123
  /***/ 12:
124
124
  /***/ (function(module, exports) {
125
125
 
126
- module.exports = require("@babel/runtime/helpers/classCallCheck");
126
+ module.exports = require("@splunk/visualizations-shared/colorUtils");
127
+
128
+ /***/ }),
129
+
130
+ /***/ 13:
131
+ /***/ (function(module, exports, __webpack_require__) {
132
+
133
+ "use strict";
134
+
135
+
136
+ Object.defineProperty(exports, "__esModule", {
137
+ value: true
138
+ });
139
+
140
+ var React = __webpack_require__(1);
141
+
142
+ var styled_components_1 = __webpack_require__(4);
143
+
144
+ var SizeAwareWrapper_1 = __webpack_require__(20);
145
+
146
+ var style_1 = __webpack_require__(15);
147
+
148
+ var colorUtils_1 = __webpack_require__(12);
149
+
150
+ var Item = styled_components_1.default.div.attrs(function (_ref) {
151
+ var width = _ref.width;
152
+ return {
153
+ style: {
154
+ width: style_1.toPx(width)
155
+ }
156
+ };
157
+ }).withConfig({
158
+ displayName: "FixedSizeContainer__Item",
159
+ componentId: "sc-1yhgpod-0"
160
+ })(["position:relative;background-color:", "};"], function (props) {
161
+ return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
162
+ }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
163
+
164
+ var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
165
+ var width = _ref2.width,
166
+ height = _ref2.height;
167
+ return {
168
+ style: Object.assign(Object.assign({}, width && {
169
+ width: style_1.toPx(width)
170
+ }), height && {
171
+ height: style_1.toPx(height)
172
+ })
173
+ };
174
+ }).withConfig({
175
+ displayName: "FixedSizeContainer__FixSizeItem",
176
+ componentId: "sc-1yhgpod-1"
177
+ })(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
178
+ return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
179
+ });
180
+ var ItemContent = styled_components_1.default.div.withConfig({
181
+ displayName: "FixedSizeContainer__ItemContent",
182
+ componentId: "sc-1yhgpod-2"
183
+ })(["position:relative;min-height:100px;width:100%;"]);
184
+ var FixSizeItemContent = styled_components_1.default.div.withConfig({
185
+ displayName: "FixedSizeContainer__FixSizeItemContent",
186
+ componentId: "sc-1yhgpod-3"
187
+ })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
188
+
189
+ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
190
+ var FixedSizeContainer = function FixedSizeContainer(props) {
191
+ var width = props.width,
192
+ height = props.height,
193
+ backgroundColor = props.backgroundColor;
194
+
195
+ if (!height) {
196
+ return React.createElement(Item, {
197
+ "data-test": "item",
198
+ width: width,
199
+ backgroundColor: backgroundColor
200
+ }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
201
+ }
202
+
203
+ return React.createElement(FixSizeItem, {
204
+ "data-test": "fix-size-item",
205
+ "data-splunk-visualization-version": "25.2.0 - 4373c5a66",
206
+ width: width,
207
+ height: height,
208
+ backgroundColor: backgroundColor
209
+ }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
210
+ var newWidth = _ref3.width,
211
+ newHeight = _ref3.height;
212
+ return React.createElement(Viz, Object.assign({}, props, {
213
+ width: newWidth,
214
+ height: newHeight
215
+ }));
216
+ })));
217
+ };
218
+
219
+ FixedSizeContainer.displayName = 'withFixedSizeContainer';
220
+ return FixedSizeContainer;
221
+ };
222
+
223
+ exports.default = withFixedSizeContainer;
127
224
 
128
225
  /***/ }),
129
226
 
130
- /***/ 124:
227
+ /***/ 135:
131
228
  /***/ (function(module, exports, __webpack_require__) {
132
229
 
133
230
  "use strict";
@@ -151,27 +248,27 @@ Object.defineProperty(exports, "__esModule", {
151
248
  });
152
249
  exports.config = exports.themes = exports.toImageDimensions = exports.shouldShowPlaceholder = void 0;
153
250
 
154
- var lodash_1 = __webpack_require__(2);
251
+ var lodash_1 = __webpack_require__(3);
155
252
 
156
253
  var React = __webpack_require__(1);
157
254
 
158
- var i18n_1 = __webpack_require__(3);
255
+ var i18n_1 = __webpack_require__(2);
159
256
 
160
257
  var style_1 = __webpack_require__(15);
161
258
 
162
- var RemoteImage_1 = __webpack_require__(125);
259
+ var RemoteImage_1 = __webpack_require__(136);
163
260
 
164
261
  var styled_components_1 = __webpack_require__(4);
165
262
 
166
263
  var T = __webpack_require__(0);
167
264
 
168
- var config_1 = __webpack_require__(179);
265
+ var config_1 = __webpack_require__(197);
169
266
 
170
267
  exports.config = config_1.default;
171
268
 
172
- var withDashboardViz_1 = __webpack_require__(30);
269
+ var withDashboardViz_1 = __webpack_require__(32);
173
270
 
174
- var ImageApi_1 = __webpack_require__(180);
271
+ var ImageApi_1 = __webpack_require__(198);
175
272
 
176
273
  var useEffect = React.useEffect,
177
274
  useRef = React.useRef;
@@ -308,20 +405,13 @@ exports.default = Image;
308
405
 
309
406
  /***/ }),
310
407
 
311
- /***/ 125:
408
+ /***/ 136:
312
409
  /***/ (function(module, exports) {
313
410
 
314
411
  module.exports = require("@splunk/visualizations-shared/RemoteImage");
315
412
 
316
413
  /***/ }),
317
414
 
318
- /***/ 13:
319
- /***/ (function(module, exports) {
320
-
321
- module.exports = require("@splunk/visualizations-shared/colorUtils");
322
-
323
- /***/ }),
324
-
325
415
  /***/ 14:
326
416
  /***/ (function(module, exports, __webpack_require__) {
327
417
 
@@ -331,91 +421,27 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
331
421
  Object.defineProperty(exports, "__esModule", {
332
422
  value: true
333
423
  });
424
+ exports.extendStaticWrapperProps = void 0;
425
+ /**
426
+ * @method extendStaticWrapperProps
427
+ * @param {Object} props
428
+ * @param {DashboardVizType} props.Wrapper
429
+ * @param {DashboardVizType} props.Visualization
430
+ */
334
431
 
335
- var React = __webpack_require__(1);
336
-
337
- var styled_components_1 = __webpack_require__(4);
338
-
339
- var SizeAwareWrapper_1 = __webpack_require__(18);
340
-
341
- var style_1 = __webpack_require__(15);
342
-
343
- var colorUtils_1 = __webpack_require__(13);
344
-
345
- var Item = styled_components_1.default.div.attrs(function (_ref) {
346
- var width = _ref.width;
347
- return {
348
- style: {
349
- width: style_1.toPx(width)
350
- }
351
- };
352
- }).withConfig({
353
- displayName: "FixedSizeContainer__Item",
354
- componentId: "sc-1yhgpod-0"
355
- })(["position:relative;background-color:", "};"], function (props) {
356
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
357
- }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
358
-
359
- var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
360
- var width = _ref2.width,
361
- height = _ref2.height;
362
- return {
363
- style: Object.assign(Object.assign({}, width && {
364
- width: style_1.toPx(width)
365
- }), height && {
366
- height: style_1.toPx(height)
367
- })
368
- };
369
- }).withConfig({
370
- displayName: "FixedSizeContainer__FixSizeItem",
371
- componentId: "sc-1yhgpod-1"
372
- })(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
373
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
374
- });
375
- var ItemContent = styled_components_1.default.div.withConfig({
376
- displayName: "FixedSizeContainer__ItemContent",
377
- componentId: "sc-1yhgpod-2"
378
- })(["position:relative;min-height:100px;width:100%;"]);
379
- var FixSizeItemContent = styled_components_1.default.div.withConfig({
380
- displayName: "FixedSizeContainer__FixSizeItemContent",
381
- componentId: "sc-1yhgpod-3"
382
- })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
383
-
384
- var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
385
- var FixedSizeContainer = function FixedSizeContainer(props) {
386
- var width = props.width,
387
- height = props.height,
388
- backgroundColor = props.backgroundColor;
389
-
390
- if (!height) {
391
- return React.createElement(Item, {
392
- "data-test": "item",
393
- width: width,
394
- backgroundColor: backgroundColor
395
- }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
432
+ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
433
+ var Wrapper = _ref.Wrapper,
434
+ Visualization = _ref.Visualization;
435
+ var extendProperties = ['propTypes', 'defaultProps', 'config'];
436
+ extendProperties.forEach(function (prop) {
437
+ if (Visualization[prop]) {
438
+ // eslint-disable-next-line no-param-reassign
439
+ Wrapper[prop] = Visualization[prop];
396
440
  }
397
-
398
- return React.createElement(FixSizeItem, {
399
- "data-test": "fix-size-item",
400
- "data-splunk-visualization-version": "25.0.1 - de10ad954",
401
- width: width,
402
- height: height,
403
- backgroundColor: backgroundColor
404
- }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
405
- var newWidth = _ref3.width,
406
- newHeight = _ref3.height;
407
- return React.createElement(Viz, Object.assign({}, props, {
408
- width: newWidth,
409
- height: newHeight
410
- }));
411
- })));
412
- };
413
-
414
- FixedSizeContainer.displayName = 'withFixedSizeContainer';
415
- return FixedSizeContainer;
441
+ });
416
442
  };
417
443
 
418
- exports.default = withFixedSizeContainer;
444
+ exports.extendStaticWrapperProps = extendStaticWrapperProps;
419
445
 
420
446
  /***/ }),
421
447
 
@@ -434,77 +460,314 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
434
460
  /***/ }),
435
461
 
436
462
  /***/ 17:
437
- /***/ (function(module, exports) {
438
-
439
- module.exports = require("@babel/runtime/helpers/createClass");
440
-
441
- /***/ }),
442
-
443
- /***/ 178:
444
463
  /***/ (function(module, exports, __webpack_require__) {
445
464
 
446
465
  "use strict";
447
466
 
448
467
 
449
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
450
- if (k2 === undefined) k2 = k;
451
- Object.defineProperty(o, k2, {
452
- enumerable: true,
453
- get: function get() {
454
- return m[k];
455
- }
456
- });
457
- } : function (o, m, k, k2) {
458
- if (k2 === undefined) k2 = k;
459
- o[k2] = m[k];
460
- });
461
-
462
- var __exportStar = this && this.__exportStar || function (m, exports) {
463
- for (var p in m) {
464
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
465
- }
466
- };
467
-
468
- Object.defineProperty(exports, "__esModule", {
469
- value: true
470
- });
471
- exports.default = void 0;
468
+ var _toConsumableArray = __webpack_require__(8);
472
469
 
473
- __exportStar(__webpack_require__(124), exports);
470
+ var _defineProperty = __webpack_require__(7);
474
471
 
475
- var Image_1 = __webpack_require__(124);
472
+ var __rest = this && this.__rest || function (s, e) {
473
+ var t = {};
476
474
 
477
- Object.defineProperty(exports, "default", {
478
- enumerable: true,
479
- get: function get() {
480
- return Image_1.default;
475
+ for (var p in s) {
476
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
481
477
  }
482
- });
483
-
484
- /***/ }),
485
-
486
- /***/ 179:
487
- /***/ (function(module, exports, __webpack_require__) {
488
-
489
- "use strict";
490
478
 
479
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
480
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
481
+ }
482
+ return t;
483
+ };
491
484
 
492
485
  Object.defineProperty(exports, "__esModule", {
493
486
  value: true
494
487
  });
488
+ exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
495
489
 
496
- var i18n_1 = __webpack_require__(3);
497
-
498
- var visualization_icons_1 = __webpack_require__(46);
490
+ var lodash_1 = __webpack_require__(3);
499
491
 
500
- var VizBehavior_1 = __webpack_require__(5);
501
-
502
- var VizCategory_1 = __webpack_require__(29);
492
+ var schemaUtils_1 = __webpack_require__(16);
503
493
 
504
- var configUtils_1 = __webpack_require__(6);
494
+ var VizBehavior_1 = __webpack_require__(6);
505
495
 
506
- var dataContract = {
507
- requiredDataSources: [],
496
+ var dynamicOptionsDSLType = {
497
+ type: 'string',
498
+ pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
499
+ };
500
+ /**
501
+ * Helper function to extend an options schema with dynamic options DSL
502
+ * @param optionsSchema a visualization's options schema
503
+ * @returns an updated options schema that additionally allows strings starting with > for each option
504
+ */
505
+
506
+ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
507
+ var enhancedOptionsSchema = {};
508
+ Object.keys(optionsSchema).forEach(function (key) {
509
+ var _a = optionsSchema[key],
510
+ title = _a.title,
511
+ description = _a.description,
512
+ readOnly = _a.readOnly,
513
+ writeOnly = _a.writeOnly,
514
+ examples = _a.examples,
515
+ defaultValue = _a.default,
516
+ type = _a.type,
517
+ properties = _a.properties,
518
+ patternProperties = _a.patternProperties,
519
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
520
+
521
+ var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
522
+ title: title
523
+ }), description !== undefined && {
524
+ description: description
525
+ }), readOnly !== undefined && {
526
+ readOnly: readOnly
527
+ }), writeOnly !== undefined && {
528
+ writeOnly: writeOnly
529
+ }), examples !== undefined && {
530
+ examples: examples
531
+ }), defaultValue !== undefined && {
532
+ default: defaultValue
533
+ });
534
+
535
+ if (type === 'object') {
536
+ enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
537
+ type: type
538
+ }), properties && {
539
+ properties: enhanceOptionsSchemaWithDynamicOptions(properties)
540
+ });
541
+
542
+ if (patternProperties) {
543
+ var enhancedPatternProperties = {};
544
+ Object.keys(patternProperties).forEach(function (opt) {
545
+ enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
546
+ });
547
+ enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
548
+ }
549
+ } else {
550
+ enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
551
+ anyOf: [Object.assign(Object.assign({}, type !== undefined && {
552
+ type: type
553
+ }), remainingSchemaEntry), dynamicOptionsDSLType]
554
+ });
555
+ }
556
+ });
557
+ return enhancedOptionsSchema;
558
+ }
559
+
560
+ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
561
+ /**
562
+ * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
563
+ * this function also collapse all editor panels
564
+ * @param vizConfig a Visualization Config
565
+ * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
566
+ * and containing `open: false` for all editor panels in editorConfig
567
+ */
568
+
569
+ function enhanceConfig(vizConfig) {
570
+ var enhancedConfig = vizConfig;
571
+
572
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
573
+ enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
574
+ }
575
+
576
+ enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
577
+ return Object.assign(Object.assign({}, config), {
578
+ open: false
579
+ });
580
+ });
581
+ return enhancedConfig;
582
+ }
583
+
584
+ exports.enhanceConfig = enhanceConfig;
585
+ /**
586
+ * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
587
+ * Created for editor unit tests
588
+ * @param vizConfig a Visualization Config
589
+ * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
590
+ */
591
+
592
+ function uncollapseEditorConfig(vizConfig) {
593
+ var editorPanelUncollapsedConfig = vizConfig;
594
+ editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
595
+ return Object.assign(Object.assign({}, config), {
596
+ open: true
597
+ });
598
+ });
599
+ return editorPanelUncollapsedConfig;
600
+ }
601
+
602
+ exports.uncollapseEditorConfig = uncollapseEditorConfig;
603
+
604
+ function isDynamicOption(option) {
605
+ return option && typeof option === 'string' && option.trim().startsWith('>') || false;
606
+ }
607
+
608
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
609
+ // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
610
+
611
+ /**
612
+ * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
613
+ * 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
614
+ * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
615
+ * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up
616
+ *
617
+ * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
618
+ */
619
+
620
+ function hasCompatibleContexts(vizContext, presetContext) {
621
+ var presetContextKeys = Object.keys(presetContext);
622
+ return presetContextKeys.every(function (contextKey) {
623
+ return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
624
+ });
625
+ }
626
+ /**
627
+ * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
628
+ */
629
+
630
+
631
+ function hasCompatibleOptions(vizOptions, presetOptions) {
632
+ var presetOptionKeys = Object.keys(presetOptions);
633
+ return presetOptionKeys.every(function (optionKey) {
634
+ return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
635
+ });
636
+ }
637
+ /**
638
+ * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
639
+ * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
640
+ *
641
+ * @param {Object} vizContext - the current vizContext definition
642
+ * @param {Object} vizOptions - the current vizOptions definition
643
+ * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
644
+ */
645
+
646
+
647
+ function getInitialPreset(vizContext, vizOptions, presets) {
648
+ return presets.find(function (preset) {
649
+ var presetContext = lodash_1.get(preset, ['value', 'context'], {});
650
+ var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
651
+ var presetContextKeys = Object.keys(presetContext);
652
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
653
+ // if not, then the preset is invalid in config.ts
654
+
655
+ if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
656
+ return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
657
+ });
658
+ }
659
+
660
+ exports.getInitialPreset = getInitialPreset;
661
+ /**
662
+ * generates number precision values for a Select editor
663
+ *
664
+ * @param {Number} numPrecisionValues - number of integer precision values to generate
665
+ * @returns {{ label: string; value; string }[]} array of { label, value } tuples
666
+ */
667
+
668
+ function generatePrecisionValues(numPrecisionValues) {
669
+ return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
670
+ return {
671
+ label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
672
+ value: i
673
+ };
674
+ });
675
+ }
676
+
677
+ exports.generatePrecisionValues = generatePrecisionValues;
678
+ /**
679
+ * insert layout in layout array, return a new layout array instead of updating the original
680
+ *
681
+ * @param {EditorLayoutConfig[][]} layout - editor layout
682
+ * @param {Number} index - the index to insert layout item(s)
683
+ * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
684
+ * @returns {EditorLayoutConfig[][]} new editor layout with insertion
685
+ */
686
+
687
+ var insertLayout = function insertLayout(layout, index) {
688
+ for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
689
+ layoutItems[_key - 2] = arguments[_key];
690
+ }
691
+
692
+ return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
693
+ };
694
+
695
+ exports.insertLayout = insertLayout;
696
+
697
+ /***/ }),
698
+
699
+ /***/ 19:
700
+ /***/ (function(module, exports) {
701
+
702
+ module.exports = require("@babel/runtime/helpers/createClass");
703
+
704
+ /***/ }),
705
+
706
+ /***/ 196:
707
+ /***/ (function(module, exports, __webpack_require__) {
708
+
709
+ "use strict";
710
+
711
+
712
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
713
+ if (k2 === undefined) k2 = k;
714
+ Object.defineProperty(o, k2, {
715
+ enumerable: true,
716
+ get: function get() {
717
+ return m[k];
718
+ }
719
+ });
720
+ } : function (o, m, k, k2) {
721
+ if (k2 === undefined) k2 = k;
722
+ o[k2] = m[k];
723
+ });
724
+
725
+ var __exportStar = this && this.__exportStar || function (m, exports) {
726
+ for (var p in m) {
727
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
728
+ }
729
+ };
730
+
731
+ Object.defineProperty(exports, "__esModule", {
732
+ value: true
733
+ });
734
+ exports.default = void 0;
735
+
736
+ __exportStar(__webpack_require__(135), exports);
737
+
738
+ var Image_1 = __webpack_require__(135);
739
+
740
+ Object.defineProperty(exports, "default", {
741
+ enumerable: true,
742
+ get: function get() {
743
+ return Image_1.default;
744
+ }
745
+ });
746
+
747
+ /***/ }),
748
+
749
+ /***/ 197:
750
+ /***/ (function(module, exports, __webpack_require__) {
751
+
752
+ "use strict";
753
+
754
+
755
+ Object.defineProperty(exports, "__esModule", {
756
+ value: true
757
+ });
758
+
759
+ var i18n_1 = __webpack_require__(2);
760
+
761
+ var visualization_icons_1 = __webpack_require__(47);
762
+
763
+ var VizBehavior_1 = __webpack_require__(6);
764
+
765
+ var VizCategory_1 = __webpack_require__(31);
766
+
767
+ var configUtils_1 = __webpack_require__(17);
768
+
769
+ var dataContract = {
770
+ requiredDataSources: [],
508
771
  optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
509
772
  // {
510
773
  // name: 'annotation',
@@ -584,30 +847,23 @@ exports.default = configUtils_1.enhanceConfig(config);
584
847
 
585
848
  /***/ }),
586
849
 
587
- /***/ 18:
588
- /***/ (function(module, exports) {
589
-
590
- module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
591
-
592
- /***/ }),
593
-
594
- /***/ 180:
850
+ /***/ 198:
595
851
  /***/ (function(module, exports, __webpack_require__) {
596
852
 
597
853
  "use strict";
598
854
 
599
855
 
600
- var _classCallCheck = __webpack_require__(12);
856
+ var _classCallCheck = __webpack_require__(11);
601
857
 
602
- var _createClass = __webpack_require__(17);
858
+ var _createClass = __webpack_require__(19);
603
859
 
604
860
  Object.defineProperty(exports, "__esModule", {
605
861
  value: true
606
862
  });
607
863
 
608
- var lodash_1 = __webpack_require__(2);
864
+ var lodash_1 = __webpack_require__(3);
609
865
 
610
- var RemoteImage_1 = __webpack_require__(125);
866
+ var RemoteImage_1 = __webpack_require__(136);
611
867
  /**
612
868
  * Image Api
613
869
  */
@@ -655,59 +911,39 @@ exports.default = ImageApi;
655
911
  /***/ 2:
656
912
  /***/ (function(module, exports) {
657
913
 
658
- module.exports = require("lodash");
659
-
660
- /***/ }),
661
-
662
- /***/ 21:
663
- /***/ (function(module, exports) {
664
-
665
- module.exports = require("@splunk/visualization-context/TimezoneContext");
914
+ module.exports = require("@splunk/ui-utils/i18n");
666
915
 
667
916
  /***/ }),
668
917
 
669
- /***/ 24:
670
- /***/ (function(module, exports, __webpack_require__) {
671
-
672
- "use strict";
673
-
674
-
675
- Object.defineProperty(exports, "__esModule", {
676
- value: true
677
- });
678
- exports.pickFieldFromJSONSchema = void 0;
679
-
680
- var lodash_1 = __webpack_require__(2);
918
+ /***/ 20:
919
+ /***/ (function(module, exports) {
681
920
 
682
- var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
683
- var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
684
- return Object.keys(optionsSchema).reduce(function (accum, k) {
685
- if (lodash_1.has(optionsSchema[k], fieldName)) {
686
- accum[k] = optionsSchema[k][fieldName];
687
- } else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
688
- var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
921
+ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
689
922
 
690
- if (!lodash_1.isEmpty(nestedSchema)) {
691
- accum[k] = nestedSchema;
692
- }
693
- }
923
+ /***/ }),
694
924
 
695
- return accum;
696
- }, {});
697
- };
925
+ /***/ 23:
926
+ /***/ (function(module, exports) {
698
927
 
699
- exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
928
+ module.exports = require("@splunk/visualization-context/TimezoneContext");
700
929
 
701
930
  /***/ }),
702
931
 
703
932
  /***/ 25:
704
933
  /***/ (function(module, exports) {
705
934
 
706
- module.exports = require("@babel/runtime/helpers/typeof");
935
+ module.exports = require("@splunk/visualizations-shared/hocUtils");
707
936
 
708
937
  /***/ }),
709
938
 
710
939
  /***/ 26:
940
+ /***/ (function(module, exports) {
941
+
942
+ module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
943
+
944
+ /***/ }),
945
+
946
+ /***/ 27:
711
947
  /***/ (function(module, exports, __webpack_require__) {
712
948
 
713
949
  "use strict";
@@ -722,13 +958,13 @@ var React = __webpack_require__(1);
722
958
 
723
959
  var T = __webpack_require__(0);
724
960
 
725
- var lodash_1 = __webpack_require__(2);
961
+ var lodash_1 = __webpack_require__(3);
726
962
 
727
- var i18n_1 = __webpack_require__(3);
963
+ var i18n_1 = __webpack_require__(2);
728
964
 
729
- var Message_1 = __webpack_require__(11);
965
+ var Message_1 = __webpack_require__(10);
730
966
 
731
- var FixedSizeContainer_1 = __webpack_require__(14);
967
+ var FixedSizeContainer_1 = __webpack_require__(13);
732
968
  /**
733
969
  * @method shouldShowIconPlaceholder
734
970
  * @param {object} dataSources
@@ -799,7 +1035,7 @@ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
799
1035
 
800
1036
  /***/ }),
801
1037
 
802
- /***/ 27:
1038
+ /***/ 28:
803
1039
  /***/ (function(module, exports, __webpack_require__) {
804
1040
 
805
1041
  "use strict";
@@ -814,9 +1050,9 @@ exports.getSortingParams = exports.SortParamsPropTypes = void 0;
814
1050
 
815
1051
  var T = __webpack_require__(0);
816
1052
 
817
- var lodash_1 = __webpack_require__(2);
1053
+ var lodash_1 = __webpack_require__(3);
818
1054
 
819
- var DataSource_1 = __webpack_require__(37);
1055
+ var DataSource_1 = __webpack_require__(39);
820
1056
 
821
1057
  exports.SortParamsPropTypes = T.shape({
822
1058
  currentSortKey: T.string,
@@ -870,7 +1106,7 @@ exports.getSortingParams = getSortingParams;
870
1106
 
871
1107
  /***/ }),
872
1108
 
873
- /***/ 28:
1109
+ /***/ 29:
874
1110
  /***/ (function(module, exports, __webpack_require__) {
875
1111
 
876
1112
  "use strict";
@@ -883,7 +1119,7 @@ exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
883
1119
 
884
1120
  var T = __webpack_require__(0);
885
1121
 
886
- var lodash_1 = __webpack_require__(2);
1122
+ var lodash_1 = __webpack_require__(3);
887
1123
 
888
1124
  exports.PaginatorParamsPropTypes = T.shape({
889
1125
  isPaging: T.bool,
@@ -935,7 +1171,14 @@ exports.getPaginationParams = getPaginationParams;
935
1171
 
936
1172
  /***/ }),
937
1173
 
938
- /***/ 29:
1174
+ /***/ 3:
1175
+ /***/ (function(module, exports) {
1176
+
1177
+ module.exports = require("lodash");
1178
+
1179
+ /***/ }),
1180
+
1181
+ /***/ 31:
939
1182
  /***/ (function(module, exports, __webpack_require__) {
940
1183
 
941
1184
  "use strict";
@@ -964,14 +1207,7 @@ var VizCategory;
964
1207
 
965
1208
  /***/ }),
966
1209
 
967
- /***/ 3:
968
- /***/ (function(module, exports) {
969
-
970
- module.exports = require("@splunk/ui-utils/i18n");
971
-
972
- /***/ }),
973
-
974
- /***/ 30:
1210
+ /***/ 32:
975
1211
  /***/ (function(module, exports, __webpack_require__) {
976
1212
 
977
1213
  "use strict";
@@ -983,39 +1219,39 @@ Object.defineProperty(exports, "__esModule", {
983
1219
 
984
1220
  var React = __webpack_require__(1);
985
1221
 
986
- var lodash_1 = __webpack_require__(2);
1222
+ var lodash_1 = __webpack_require__(3);
987
1223
 
988
- var getSettingsFromThemedProps_1 = __webpack_require__(31);
1224
+ var getSettingsFromThemedProps_1 = __webpack_require__(33);
989
1225
 
990
- var Options_1 = __webpack_require__(32);
1226
+ var Options_1 = __webpack_require__(34);
991
1227
 
992
- var SanitizeProps_1 = __webpack_require__(33);
1228
+ var SanitizeProps_1 = __webpack_require__(35);
993
1229
 
994
- var TimezoneContext_1 = __webpack_require__(21);
1230
+ var TimezoneContext_1 = __webpack_require__(23);
995
1231
 
996
- var moment_1 = __webpack_require__(34);
1232
+ var moment_1 = __webpack_require__(36);
997
1233
 
998
1234
  var styled_components_1 = __webpack_require__(4);
999
1235
 
1000
- var SplunkVisualization_1 = __webpack_require__(35);
1236
+ var hocUtils_1 = __webpack_require__(25);
1001
1237
 
1002
- var VizBehavior_1 = __webpack_require__(5);
1238
+ var JSONSchemaUtils_1 = __webpack_require__(26);
1003
1239
 
1004
- var getSorting_1 = __webpack_require__(27);
1240
+ var SplunkVisualization_1 = __webpack_require__(37);
1005
1241
 
1006
- var getPagination_1 = __webpack_require__(28);
1242
+ var VizBehavior_1 = __webpack_require__(6);
1007
1243
 
1008
- var useDeepMemo_1 = __webpack_require__(38);
1244
+ var getSorting_1 = __webpack_require__(28);
1009
1245
 
1010
- var JSONSchemaUtils_1 = __webpack_require__(24);
1246
+ var getPagination_1 = __webpack_require__(29);
1011
1247
 
1012
- var MissingPropsMessage_1 = __webpack_require__(39);
1248
+ var useDeepMemo_1 = __webpack_require__(40);
1013
1249
 
1014
- var withEditModeCover_1 = __webpack_require__(40);
1250
+ var MissingPropsMessage_1 = __webpack_require__(41);
1015
1251
 
1016
- var withPlaceholder_1 = __webpack_require__(42);
1252
+ var withEditModeCover_1 = __webpack_require__(42);
1017
1253
 
1018
- var hocUtils_1 = __webpack_require__(8);
1254
+ var withPlaceholder_1 = __webpack_require__(43);
1019
1255
  /**
1020
1256
  * hoc that wraps a pure react visualization in a Dashboard visualization
1021
1257
  * @param {DashboardVizOpts} opts
@@ -1217,41 +1453,41 @@ exports.default = withDashboardViz;
1217
1453
 
1218
1454
  /***/ }),
1219
1455
 
1220
- /***/ 31:
1456
+ /***/ 33:
1221
1457
  /***/ (function(module, exports) {
1222
1458
 
1223
1459
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1224
1460
 
1225
1461
  /***/ }),
1226
1462
 
1227
- /***/ 32:
1463
+ /***/ 34:
1228
1464
  /***/ (function(module, exports) {
1229
1465
 
1230
1466
  module.exports = require("@splunk/visualization-encoding/Options");
1231
1467
 
1232
1468
  /***/ }),
1233
1469
 
1234
- /***/ 33:
1470
+ /***/ 35:
1235
1471
  /***/ (function(module, exports) {
1236
1472
 
1237
1473
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1238
1474
 
1239
1475
  /***/ }),
1240
1476
 
1241
- /***/ 34:
1477
+ /***/ 36:
1242
1478
  /***/ (function(module, exports) {
1243
1479
 
1244
1480
  module.exports = require("@splunk/moment");
1245
1481
 
1246
1482
  /***/ }),
1247
1483
 
1248
- /***/ 35:
1484
+ /***/ 37:
1249
1485
  /***/ (function(module, exports, __webpack_require__) {
1250
1486
 
1251
1487
  "use strict";
1252
1488
 
1253
1489
 
1254
- var _classCallCheck = __webpack_require__(12);
1490
+ var _classCallCheck = __webpack_require__(11);
1255
1491
 
1256
1492
  Object.defineProperty(exports, "__esModule", {
1257
1493
  value: true
@@ -1261,9 +1497,9 @@ exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1261
1497
 
1262
1498
  var T = __webpack_require__(0);
1263
1499
 
1264
- var lodash_1 = __webpack_require__(2);
1500
+ var lodash_1 = __webpack_require__(3);
1265
1501
 
1266
- var VizActionHandler_1 = __webpack_require__(36); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1502
+ var VizActionHandler_1 = __webpack_require__(38); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1267
1503
 
1268
1504
 
1269
1505
  exports.INITIAL_WIDTH = 250;
@@ -1397,15 +1633,15 @@ exports.default = SplunkVisualization;
1397
1633
 
1398
1634
  /***/ }),
1399
1635
 
1400
- /***/ 36:
1636
+ /***/ 38:
1401
1637
  /***/ (function(module, exports, __webpack_require__) {
1402
1638
 
1403
1639
  "use strict";
1404
1640
 
1405
1641
 
1406
- var _classCallCheck = __webpack_require__(12);
1642
+ var _classCallCheck = __webpack_require__(11);
1407
1643
 
1408
- var _createClass = __webpack_require__(17);
1644
+ var _createClass = __webpack_require__(19);
1409
1645
 
1410
1646
  Object.defineProperty(exports, "__esModule", {
1411
1647
  value: true
@@ -1420,230 +1656,22 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
1420
1656
  _createClass(DefaultVizActionHandler, [{
1421
1657
  key: "focus",
1422
1658
  value: function focus() {// noop
1423
- }
1424
- }, {
1425
- key: "snapshot",
1426
- value: function snapshot() {
1427
- return null; // noop
1428
- }
1429
- }]);
1430
-
1431
- return DefaultVizActionHandler;
1432
- }();
1433
-
1434
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
1435
-
1436
- /***/ }),
1437
-
1438
- /***/ 37:
1439
- /***/ (function(module, exports, __webpack_require__) {
1440
-
1441
- "use strict";
1442
-
1443
-
1444
- Object.defineProperty(exports, "__esModule", {
1445
- value: true
1446
- });
1447
- exports.validSortDirs = void 0;
1448
- exports.validSortDirs = ['asc', 'desc', 'none'];
1449
-
1450
- /***/ }),
1451
-
1452
- /***/ 38:
1453
- /***/ (function(module, exports, __webpack_require__) {
1454
-
1455
- "use strict";
1456
-
1457
-
1458
- Object.defineProperty(exports, "__esModule", {
1459
- value: true
1460
- });
1461
- exports.useDeepMemo = void 0;
1462
-
1463
- var react_1 = __webpack_require__(1);
1464
-
1465
- var lodash_1 = __webpack_require__(2);
1466
- /**
1467
- * This hook evaluates and stores the result of a passed function and only
1468
- * re-evaluates the function when passed dependencies change.
1469
- *
1470
- * It is different from the internal React useMemo in the following aspects:
1471
- * - it only stores the last evaluated result
1472
- * - it uses a deep equality check to determine if dependencies have changed
1473
- *
1474
- * Inspired by apollo-client's useDeepMemo
1475
- *
1476
- * @param fn the function to be executed and
1477
- * @param dependencies an array of dependencies
1478
- */
1479
-
1480
-
1481
- var useDeepMemo = function useDeepMemo(fn, dependencies) {
1482
- var ref = react_1.useRef();
1483
-
1484
- if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
1485
- ref.current = {
1486
- dependencies: dependencies,
1487
- value: fn()
1488
- };
1489
- }
1490
-
1491
- return ref.current.value;
1492
- };
1493
-
1494
- exports.useDeepMemo = useDeepMemo;
1495
-
1496
- /***/ }),
1497
-
1498
- /***/ 39:
1499
- /***/ (function(module, exports, __webpack_require__) {
1500
-
1501
- "use strict";
1502
-
1503
-
1504
- Object.defineProperty(exports, "__esModule", {
1505
- value: true
1506
- });
1507
- exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1508
-
1509
- var React = __webpack_require__(1);
1510
-
1511
- var T = __webpack_require__(0);
1512
-
1513
- var i18n_1 = __webpack_require__(3);
1514
-
1515
- var Message_1 = __webpack_require__(11);
1516
-
1517
- var FixedSizeContainer_1 = __webpack_require__(14);
1518
- /**
1519
- * @method isMissing
1520
- * @param {any} v
1521
- * @returns {boolean} true if the input value === null or undefined
1522
- */
1523
-
1524
-
1525
- var isMissing = function isMissing(v) {
1526
- return v === null || v === undefined;
1527
- };
1528
-
1529
- exports.isMissing = isMissing;
1530
- /**
1531
- * @method misskingKeys
1532
- * @param {string[]} keys
1533
- * @param {object} target
1534
- * @returns {string[]} the keys of missing required props
1535
- */
1536
-
1537
- var missingKeys = function missingKeys(keys, target) {
1538
- return keys.filter(function (k) {
1539
- return exports.isMissing(target[k]);
1540
- });
1541
- };
1542
-
1543
- exports.missingKeys = missingKeys;
1544
- var propTypes = {
1545
- width: T.oneOfType([T.string, T.number]),
1546
- height: T.oneOfType([T.string, T.number]),
1547
- // eslint-disable-next-line react/no-unused-prop-types
1548
- backgroundColor: T.string,
1549
- missingProps: T.arrayOf(T.string)
1550
- };
1551
- /**
1552
- * @method MissingPropsMessage
1553
- * @param {MissingPropsProps} props
1554
- * @returns {React.ReactElement}
1555
- */
1556
-
1557
- var MissingPropsMessage = function MissingPropsMessage(props) {
1558
- var width = props.width,
1559
- height = props.height,
1560
- missingProps = props.missingProps;
1561
- return React.createElement(Message_1.default, {
1562
- "data-test": "message",
1563
- width: width,
1564
- height: height,
1565
- message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
1566
- });
1567
- };
1568
-
1569
- exports.MissingPropsMessage = MissingPropsMessage;
1570
- exports.MissingPropsMessage.propTypes = propTypes;
1571
- exports.MissingPropsMessage.defaultProps = {
1572
- width: '100%',
1573
- height: 250
1574
- };
1575
- exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
1576
-
1577
- /***/ }),
1578
-
1579
- /***/ 4:
1580
- /***/ (function(module, exports) {
1581
-
1582
- module.exports = require("styled-components");
1583
-
1584
- /***/ }),
1585
-
1586
- /***/ 40:
1587
- /***/ (function(module, exports, __webpack_require__) {
1588
-
1589
- "use strict";
1590
-
1591
-
1592
- Object.defineProperty(exports, "__esModule", {
1593
- value: true
1594
- });
1595
-
1596
- var React = __webpack_require__(1);
1597
-
1598
- var styled_components_1 = __webpack_require__(4);
1599
-
1600
- var hocUtils_1 = __webpack_require__(8);
1601
-
1602
- var Cover = styled_components_1.default.div.withConfig({
1603
- displayName: "withEditModeCover__Cover",
1604
- componentId: "sc-1gsbnxb-0"
1605
- })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1606
- var Blocker = styled_components_1.default.div.attrs({
1607
- 'data-splunk-visualization-version': "25.0.1 - de10ad954"
1608
- }).withConfig({
1609
- displayName: "withEditModeCover__Blocker",
1610
- componentId: "sc-1gsbnxb-1"
1611
- })(["position:relative;width:100%;height:100%;"]);
1612
- /**
1613
- * HOC that renders a cover layer in edit mode
1614
- * @method withEditModeCover
1615
- * @param {ExtendedDashViz} Visualization
1616
- * @returns {ExtendedDashViz} Wrapper
1617
- */
1618
-
1619
- var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1620
- var Wrapper = function Wrapper(props) {
1621
- var mode = props.mode;
1622
- var showEditCover = mode === 'edit' && !disableEditModeCover;
1623
- return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
1624
- "data-test": "edit-mode-cover"
1625
- }));
1626
- };
1627
-
1628
- hocUtils_1.extendStaticWrapperProps({
1629
- Wrapper: Wrapper,
1630
- Visualization: Visualization
1631
- });
1632
- return Wrapper;
1633
- };
1634
-
1635
- exports.default = withEditModeCover;
1636
-
1637
- /***/ }),
1659
+ }
1660
+ }, {
1661
+ key: "snapshot",
1662
+ value: function snapshot() {
1663
+ return null; // noop
1664
+ }
1665
+ }]);
1638
1666
 
1639
- /***/ 41:
1640
- /***/ (function(module, exports) {
1667
+ return DefaultVizActionHandler;
1668
+ }();
1641
1669
 
1642
- module.exports = require("@splunk/visualizations-shared/mapUtils");
1670
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1643
1671
 
1644
1672
  /***/ }),
1645
1673
 
1646
- /***/ 42:
1674
+ /***/ 39:
1647
1675
  /***/ (function(module, exports, __webpack_require__) {
1648
1676
 
1649
1677
  "use strict";
@@ -1652,70 +1680,19 @@ module.exports = require("@splunk/visualizations-shared/mapUtils");
1652
1680
  Object.defineProperty(exports, "__esModule", {
1653
1681
  value: true
1654
1682
  });
1655
-
1656
- var React = __webpack_require__(1);
1657
-
1658
- var colorUtils_1 = __webpack_require__(13);
1659
-
1660
- var variables_1 = __webpack_require__(10);
1661
-
1662
- var IconPlaceholder_1 = __webpack_require__(26);
1663
-
1664
- var VizBehavior_1 = __webpack_require__(5);
1665
-
1666
- var hocUtils_1 = __webpack_require__(8);
1667
-
1668
- var withPlaceholder = function withPlaceholder(Visualization) {
1669
- var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
1670
- var config = Visualization.config;
1671
- var themes = config.themes;
1672
-
1673
- var Wrapper = function Wrapper(props) {
1674
- var _a, _b;
1675
-
1676
- var dataSources = props.dataSources,
1677
- loading = props.loading,
1678
- options = props.options,
1679
- height = props.height,
1680
- width = props.width;
1681
- var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
1682
- var bgColorFromTheme = 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);
1683
- var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
1684
- var iconColor = variables_1.default.contentColorActive(props);
1685
-
1686
- if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
1687
- return React.createElement(IconPlaceholder_1.default, {
1688
- "data-test": "icon-placeholder",
1689
- icon: icon,
1690
- width: width,
1691
- height: height,
1692
- backgroundColor: bgColorFromTheme,
1693
- iconColor: iconColor
1694
- });
1695
- }
1696
-
1697
- return React.createElement(Visualization, Object.assign({}, props));
1698
- };
1699
-
1700
- hocUtils_1.extendStaticWrapperProps({
1701
- Wrapper: Wrapper,
1702
- Visualization: Visualization
1703
- });
1704
- return Wrapper;
1705
- };
1706
-
1707
- exports.default = withPlaceholder;
1683
+ exports.validSortDirs = void 0;
1684
+ exports.validSortDirs = ['asc', 'desc', 'none'];
1708
1685
 
1709
1686
  /***/ }),
1710
1687
 
1711
- /***/ 46:
1688
+ /***/ 4:
1712
1689
  /***/ (function(module, exports) {
1713
1690
 
1714
- module.exports = require("@splunk/visualization-icons");
1691
+ module.exports = require("styled-components");
1715
1692
 
1716
1693
  /***/ }),
1717
1694
 
1718
- /***/ 5:
1695
+ /***/ 40:
1719
1696
  /***/ (function(module, exports, __webpack_require__) {
1720
1697
 
1721
1698
  "use strict";
@@ -1724,370 +1701,305 @@ module.exports = require("@splunk/visualization-icons");
1724
1701
  Object.defineProperty(exports, "__esModule", {
1725
1702
  value: true
1726
1703
  });
1727
- exports.VizBehavior = void 0;
1728
- var VizBehavior;
1704
+ exports.useDeepMemo = void 0;
1729
1705
 
1730
- (function (VizBehavior) {
1731
- /**
1732
- * Dynamic Options Behavior.
1733
- * This allows visualization options to be powered by data
1734
- *
1735
- * **Example**
1736
- *
1737
- * sparklineValues: ">primary|seriesByIndex(0)"
1738
- * would configure sparklineValues with an array of data points
1739
- * coming from the first series in the primary datasource
1740
- *
1741
- */
1742
- VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
1743
- VizBehavior["EVENTS"] = "events";
1744
- /**
1745
- * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
1746
- * missing.
1747
- * @type {string}
1748
- */
1706
+ var react_1 = __webpack_require__(1);
1749
1707
 
1750
- VizBehavior["PLACEHOLDER"] = "placeholder";
1751
- VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
1752
- })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
1708
+ var lodash_1 = __webpack_require__(3);
1709
+ /**
1710
+ * This hook evaluates and stores the result of a passed function and only
1711
+ * re-evaluates the function when passed dependencies change.
1712
+ *
1713
+ * It is different from the internal React useMemo in the following aspects:
1714
+ * - it only stores the last evaluated result
1715
+ * - it uses a deep equality check to determine if dependencies have changed
1716
+ *
1717
+ * Inspired by apollo-client's useDeepMemo
1718
+ *
1719
+ * @param fn the function to be executed and
1720
+ * @param dependencies an array of dependencies
1721
+ */
1753
1722
 
1754
- /***/ }),
1755
1723
 
1756
- /***/ 6:
1757
- /***/ (function(module, exports, __webpack_require__) {
1724
+ var useDeepMemo = function useDeepMemo(fn, dependencies) {
1725
+ var ref = react_1.useRef();
1758
1726
 
1759
- "use strict";
1727
+ if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
1728
+ ref.current = {
1729
+ dependencies: dependencies,
1730
+ value: fn()
1731
+ };
1732
+ }
1760
1733
 
1734
+ return ref.current.value;
1735
+ };
1761
1736
 
1762
- var _toConsumableArray = __webpack_require__(9);
1737
+ exports.useDeepMemo = useDeepMemo;
1763
1738
 
1764
- var _defineProperty = __webpack_require__(7);
1739
+ /***/ }),
1765
1740
 
1766
- var __rest = this && this.__rest || function (s, e) {
1767
- var t = {};
1741
+ /***/ 41:
1742
+ /***/ (function(module, exports, __webpack_require__) {
1768
1743
 
1769
- for (var p in s) {
1770
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1771
- }
1744
+ "use strict";
1772
1745
 
1773
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1774
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1775
- }
1776
- return t;
1777
- };
1778
1746
 
1779
1747
  Object.defineProperty(exports, "__esModule", {
1780
1748
  value: true
1781
1749
  });
1782
- exports.insertLayout = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.isDynamicOption = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
1750
+ exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1783
1751
 
1784
- var lodash_1 = __webpack_require__(2);
1752
+ var React = __webpack_require__(1);
1785
1753
 
1786
- var schemaUtils_1 = __webpack_require__(16);
1754
+ var T = __webpack_require__(0);
1787
1755
 
1788
- var VizBehavior_1 = __webpack_require__(5);
1756
+ var i18n_1 = __webpack_require__(2);
1789
1757
 
1790
- var dynamicOptionsDSLType = {
1791
- type: 'string',
1792
- pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
1793
- };
1758
+ var Message_1 = __webpack_require__(10);
1759
+
1760
+ var FixedSizeContainer_1 = __webpack_require__(13);
1794
1761
  /**
1795
- * Helper function to extend an options schema with dynamic options DSL
1796
- * @param optionsSchema a visualization's options schema
1797
- * @returns an updated options schema that additionally allows strings starting with > for each option
1762
+ * @method isMissing
1763
+ * @param {any} v
1764
+ * @returns {boolean} true if the input value === null or undefined
1798
1765
  */
1799
1766
 
1800
- function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
1801
- var enhancedOptionsSchema = {};
1802
- Object.keys(optionsSchema).forEach(function (key) {
1803
- var _a = optionsSchema[key],
1804
- title = _a.title,
1805
- description = _a.description,
1806
- readOnly = _a.readOnly,
1807
- writeOnly = _a.writeOnly,
1808
- examples = _a.examples,
1809
- defaultValue = _a.default,
1810
- type = _a.type,
1811
- properties = _a.properties,
1812
- patternProperties = _a.patternProperties,
1813
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
1814
1767
 
1815
- var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
1816
- title: title
1817
- }), description !== undefined && {
1818
- description: description
1819
- }), readOnly !== undefined && {
1820
- readOnly: readOnly
1821
- }), writeOnly !== undefined && {
1822
- writeOnly: writeOnly
1823
- }), examples !== undefined && {
1824
- examples: examples
1825
- }), defaultValue !== undefined && {
1826
- default: defaultValue
1827
- });
1768
+ var isMissing = function isMissing(v) {
1769
+ return v === null || v === undefined;
1770
+ };
1828
1771
 
1829
- if (type === 'object') {
1830
- enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
1831
- type: type
1832
- }), properties && {
1833
- properties: enhanceOptionsSchemaWithDynamicOptions(properties)
1834
- });
1772
+ exports.isMissing = isMissing;
1773
+ /**
1774
+ * @method misskingKeys
1775
+ * @param {string[]} keys
1776
+ * @param {object} target
1777
+ * @returns {string[]} the keys of missing required props
1778
+ */
1835
1779
 
1836
- if (patternProperties) {
1837
- var enhancedPatternProperties = {};
1838
- Object.keys(patternProperties).forEach(function (opt) {
1839
- enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
1840
- });
1841
- enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
1842
- }
1843
- } else {
1844
- enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
1845
- anyOf: [Object.assign(Object.assign({}, type !== undefined && {
1846
- type: type
1847
- }), remainingSchemaEntry), dynamicOptionsDSLType]
1848
- });
1849
- }
1780
+ var missingKeys = function missingKeys(keys, target) {
1781
+ return keys.filter(function (k) {
1782
+ return exports.isMissing(target[k]);
1850
1783
  });
1851
- return enhancedOptionsSchema;
1852
- }
1784
+ };
1853
1785
 
1854
- exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
1786
+ exports.missingKeys = missingKeys;
1787
+ var propTypes = {
1788
+ width: T.oneOfType([T.string, T.number]),
1789
+ height: T.oneOfType([T.string, T.number]),
1790
+ // eslint-disable-next-line react/no-unused-prop-types
1791
+ backgroundColor: T.string,
1792
+ missingProps: T.arrayOf(T.string)
1793
+ };
1855
1794
  /**
1856
- * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
1857
- * this function also collapse all editor panels
1858
- * @param vizConfig a Visualization Config
1859
- * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
1860
- * and containing `open: false` for all editor panels in editorConfig
1795
+ * @method MissingPropsMessage
1796
+ * @param {MissingPropsProps} props
1797
+ * @returns {React.ReactElement}
1861
1798
  */
1862
1799
 
1863
- function enhanceConfig(vizConfig) {
1864
- var enhancedConfig = vizConfig;
1800
+ var MissingPropsMessage = function MissingPropsMessage(props) {
1801
+ var width = props.width,
1802
+ height = props.height,
1803
+ missingProps = props.missingProps;
1804
+ return React.createElement(Message_1.default, {
1805
+ "data-test": "message",
1806
+ width: width,
1807
+ height: height,
1808
+ message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
1809
+ });
1810
+ };
1811
+
1812
+ exports.MissingPropsMessage = MissingPropsMessage;
1813
+ exports.MissingPropsMessage.propTypes = propTypes;
1814
+ exports.MissingPropsMessage.defaultProps = {
1815
+ width: '100%',
1816
+ height: 250
1817
+ };
1818
+ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
1819
+
1820
+ /***/ }),
1821
+
1822
+ /***/ 42:
1823
+ /***/ (function(module, exports, __webpack_require__) {
1824
+
1825
+ "use strict";
1865
1826
 
1866
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
1867
- enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
1868
- }
1869
1827
 
1870
- enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
1871
- return Object.assign(Object.assign({}, config), {
1872
- open: false
1873
- });
1874
- });
1875
- return enhancedConfig;
1876
- }
1828
+ Object.defineProperty(exports, "__esModule", {
1829
+ value: true
1830
+ });
1877
1831
 
1878
- exports.enhanceConfig = enhanceConfig;
1832
+ var React = __webpack_require__(1);
1833
+
1834
+ var styled_components_1 = __webpack_require__(4);
1835
+
1836
+ var hocUtils_1 = __webpack_require__(14);
1837
+
1838
+ var Cover = styled_components_1.default.div.withConfig({
1839
+ displayName: "withEditModeCover__Cover",
1840
+ componentId: "sc-1gsbnxb-0"
1841
+ })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1842
+ var Blocker = styled_components_1.default.div.attrs({
1843
+ 'data-splunk-visualization-version': "25.2.0 - 4373c5a66"
1844
+ }).withConfig({
1845
+ displayName: "withEditModeCover__Blocker",
1846
+ componentId: "sc-1gsbnxb-1"
1847
+ })(["position:relative;width:100%;height:100%;"]);
1879
1848
  /**
1880
- * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
1881
- * Created for editor unit tests
1882
- * @param vizConfig a Visualization Config
1883
- * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
1849
+ * HOC that renders a cover layer in edit mode
1850
+ * @method withEditModeCover
1851
+ * @param {ExtendedDashViz} Visualization
1852
+ * @returns {ExtendedDashViz} Wrapper
1884
1853
  */
1885
1854
 
1886
- function uncollapseEditorConfig(vizConfig) {
1887
- var editorPanelUncollapsedConfig = vizConfig;
1888
- editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
1889
- return Object.assign(Object.assign({}, config), {
1890
- open: true
1891
- });
1855
+ var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1856
+ var Wrapper = function Wrapper(props) {
1857
+ var mode = props.mode;
1858
+ var showEditCover = mode === 'edit' && !disableEditModeCover;
1859
+ return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
1860
+ "data-test": "edit-mode-cover"
1861
+ }));
1862
+ };
1863
+
1864
+ hocUtils_1.extendStaticWrapperProps({
1865
+ Wrapper: Wrapper,
1866
+ Visualization: Visualization
1892
1867
  });
1893
- return editorPanelUncollapsedConfig;
1894
- }
1868
+ return Wrapper;
1869
+ };
1895
1870
 
1896
- exports.uncollapseEditorConfig = uncollapseEditorConfig;
1871
+ exports.default = withEditModeCover;
1897
1872
 
1898
- function isDynamicOption(option) {
1899
- return option && typeof option === 'string' && option.trim().startsWith('>') || false;
1900
- }
1873
+ /***/ }),
1901
1874
 
1902
- exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
1903
- // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
1875
+ /***/ 43:
1876
+ /***/ (function(module, exports, __webpack_require__) {
1904
1877
 
1905
- /**
1906
- * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
1907
- * 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
1908
- * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
1909
- * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up
1910
- *
1911
- * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
1912
- */
1878
+ "use strict";
1913
1879
 
1914
- function hasCompatibleContexts(vizContext, presetContext) {
1915
- var presetContextKeys = Object.keys(presetContext);
1916
- return presetContextKeys.every(function (contextKey) {
1917
- return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
1918
- });
1919
- }
1920
- /**
1921
- * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
1922
- */
1923
1880
 
1881
+ Object.defineProperty(exports, "__esModule", {
1882
+ value: true
1883
+ });
1924
1884
 
1925
- function hasCompatibleOptions(vizOptions, presetOptions) {
1926
- var presetOptionKeys = Object.keys(presetOptions);
1927
- return presetOptionKeys.every(function (optionKey) {
1928
- return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
1929
- });
1930
- }
1931
- /**
1932
- * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
1933
- * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
1934
- *
1935
- * @param {Object} vizContext - the current vizContext definition
1936
- * @param {Object} vizOptions - the current vizOptions definition
1937
- * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
1938
- */
1885
+ var React = __webpack_require__(1);
1939
1886
 
1887
+ var colorUtils_1 = __webpack_require__(12);
1940
1888
 
1941
- function getInitialPreset(vizContext, vizOptions, presets) {
1942
- return presets.find(function (preset) {
1943
- var presetContext = lodash_1.get(preset, ['value', 'context'], {});
1944
- var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
1945
- var presetContextKeys = Object.keys(presetContext);
1946
- var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
1947
- // if not, then the preset is invalid in config.ts
1889
+ var variables_1 = __webpack_require__(9);
1948
1890
 
1949
- if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
1950
- return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
1951
- });
1952
- }
1891
+ var IconPlaceholder_1 = __webpack_require__(27);
1953
1892
 
1954
- exports.getInitialPreset = getInitialPreset;
1955
- /**
1956
- * generates number precision values for a Select editor
1957
- *
1958
- * @param {Number} numPrecisionValues - number of integer precision values to generate
1959
- * @returns {{ label: string; value; string }[]} array of { label, value } tuples
1960
- */
1893
+ var VizBehavior_1 = __webpack_require__(6);
1961
1894
 
1962
- function generatePrecisionValues(numPrecisionValues) {
1963
- return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
1964
- return {
1965
- label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
1966
- value: i
1967
- };
1968
- });
1969
- }
1895
+ var hocUtils_1 = __webpack_require__(14);
1970
1896
 
1971
- exports.generatePrecisionValues = generatePrecisionValues;
1972
- /**
1973
- * insert layout in layout array, return a new layout array instead of updating the original
1974
- *
1975
- * @param {EditorLayoutConfig[][]} layout - editor layout
1976
- * @param {Number} index - the index to insert layout item(s)
1977
- * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
1978
- * @returns {EditorLayoutConfig[][]} new editor layout with insertion
1979
- */
1897
+ var withPlaceholder = function withPlaceholder(Visualization) {
1898
+ var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
1899
+ var config = Visualization.config;
1900
+ var themes = config.themes;
1980
1901
 
1981
- var insertLayout = function insertLayout(layout, index) {
1982
- for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1983
- layoutItems[_key - 2] = arguments[_key];
1984
- }
1902
+ var Wrapper = function Wrapper(props) {
1903
+ var _a, _b;
1985
1904
 
1986
- return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
1905
+ var dataSources = props.dataSources,
1906
+ loading = props.loading,
1907
+ options = props.options,
1908
+ height = props.height,
1909
+ width = props.width;
1910
+ var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
1911
+ var bgColorFromTheme = 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);
1912
+ var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
1913
+ var iconColor = variables_1.default.contentColorActive(props);
1914
+
1915
+ if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
1916
+ return React.createElement(IconPlaceholder_1.default, {
1917
+ "data-test": "icon-placeholder",
1918
+ icon: icon,
1919
+ width: width,
1920
+ height: height,
1921
+ backgroundColor: bgColorFromTheme,
1922
+ iconColor: iconColor
1923
+ });
1924
+ }
1925
+
1926
+ return React.createElement(Visualization, Object.assign({}, props));
1927
+ };
1928
+
1929
+ hocUtils_1.extendStaticWrapperProps({
1930
+ Wrapper: Wrapper,
1931
+ Visualization: Visualization
1932
+ });
1933
+ return Wrapper;
1987
1934
  };
1988
1935
 
1989
- exports.insertLayout = insertLayout;
1936
+ exports.default = withPlaceholder;
1990
1937
 
1991
1938
  /***/ }),
1992
1939
 
1993
- /***/ 7:
1940
+ /***/ 47:
1994
1941
  /***/ (function(module, exports) {
1995
1942
 
1996
- module.exports = require("@babel/runtime/helpers/defineProperty");
1943
+ module.exports = require("@splunk/visualization-icons");
1997
1944
 
1998
1945
  /***/ }),
1999
1946
 
2000
- /***/ 8:
1947
+ /***/ 6:
2001
1948
  /***/ (function(module, exports, __webpack_require__) {
2002
1949
 
2003
1950
  "use strict";
2004
1951
 
2005
1952
 
2006
- var _typeof = __webpack_require__(25);
2007
-
2008
1953
  Object.defineProperty(exports, "__esModule", {
2009
1954
  value: true
2010
1955
  });
2011
- exports.deepMergeWithArrayPrimitiveOverrides = exports.extendStaticWrapperProps = void 0;
2012
-
2013
- var lodash_1 = __webpack_require__(2);
2014
-
2015
- var mapUtils_1 = __webpack_require__(41);
2016
- /**
2017
- * @method extendStaticWrapperProps
2018
- * @param {Object} props
2019
- * @param {DashboardVizType} props.Wrapper
2020
- * @param {DashboardVizType} props.Visualization
2021
- */
1956
+ exports.VizBehavior = void 0;
1957
+ var VizBehavior;
2022
1958
 
1959
+ (function (VizBehavior) {
1960
+ /**
1961
+ * Dynamic Options Behavior.
1962
+ * This allows visualization options to be powered by data
1963
+ *
1964
+ * **Example**
1965
+ *
1966
+ * sparklineValues: ">primary|seriesByIndex(0)"
1967
+ * would configure sparklineValues with an array of data points
1968
+ * coming from the first series in the primary datasource
1969
+ *
1970
+ */
1971
+ VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
1972
+ VizBehavior["EVENTS"] = "events";
1973
+ /**
1974
+ * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
1975
+ * missing.
1976
+ * @type {string}
1977
+ */
2023
1978
 
2024
- var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
2025
- var Wrapper = _ref.Wrapper,
2026
- Visualization = _ref.Visualization;
2027
- var extendProperties = ['propTypes', 'defaultProps', 'config'];
2028
- extendProperties.forEach(function (prop) {
2029
- if (Visualization[prop]) {
2030
- // eslint-disable-next-line no-param-reassign
2031
- Wrapper[prop] = Visualization[prop];
2032
- }
2033
- });
2034
- };
1979
+ VizBehavior["PLACEHOLDER"] = "placeholder";
1980
+ VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
1981
+ })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
2035
1982
 
2036
- exports.extendStaticWrapperProps = extendStaticWrapperProps;
2037
- /**
2038
- * helper to deeply merge objects while preserving arrays in earlier source objects
2039
- * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object
2040
- * this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).
2041
- * Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair
2042
- * will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.
2043
- *
2044
- * @method deepMergeWithArrayPrimitiveOverrides
2045
- * @param {Object} initial - target object to merge values into
2046
- * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones
2047
- *
2048
- * @returns {Object}
2049
- */
1983
+ /***/ }),
2050
1984
 
2051
- var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveOverrides(initial) {
2052
- var clone = lodash_1.cloneDeep(initial);
1985
+ /***/ 7:
1986
+ /***/ (function(module, exports) {
2053
1987
 
2054
- for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2055
- sources[_key - 1] = arguments[_key];
2056
- }
1988
+ module.exports = require("@babel/runtime/helpers/defineProperty");
2057
1989
 
2058
- sources.forEach(function (sourceToApply) {
2059
- Object.keys(sourceToApply).forEach(function (sourceKey) {
2060
- if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {
2061
- clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
2062
- }
1990
+ /***/ }),
2063
1991
 
2064
- if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
2065
- clone[sourceKey] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey], sourceToApply[sourceKey]);
2066
- } else if (Array.isArray(clone[sourceKey]) && _typeof(clone[sourceKey][0]) === 'object' && !Array.isArray(clone[sourceKey][0])) {
2067
- // If option is an array of objects
2068
- for (var i = 0; i < clone[sourceKey].length; i += 1) {
2069
- if (_typeof(clone[sourceKey][i]) === 'object') {
2070
- var closestMatchIdx = mapUtils_1.findClosestMatchFromDefaultList(sourceToApply[sourceKey], clone[sourceKey][i]);
2071
-
2072
- if (closestMatchIdx > -1) {
2073
- clone[sourceKey][i] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey][i], sourceToApply[sourceKey][closestMatchIdx]);
2074
- }
2075
- }
2076
- }
2077
- }
2078
- });
2079
- });
2080
- return clone;
2081
- };
1992
+ /***/ 8:
1993
+ /***/ (function(module, exports) {
2082
1994
 
2083
- exports.deepMergeWithArrayPrimitiveOverrides = deepMergeWithArrayPrimitiveOverrides;
1995
+ module.exports = require("@babel/runtime/helpers/toConsumableArray");
2084
1996
 
2085
1997
  /***/ }),
2086
1998
 
2087
1999
  /***/ 9:
2088
2000
  /***/ (function(module, exports) {
2089
2001
 
2090
- module.exports = require("@babel/runtime/helpers/toConsumableArray");
2002
+ module.exports = require("@splunk/themes/variables");
2091
2003
 
2092
2004
  /***/ })
2093
2005