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