@splunk/visualizations 25.0.1 → 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_custom_base_layer_tile_server.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/Area.config.js +141 -152
- package/Area.config.js.map +1 -1
- package/Area.js +334 -431
- package/Area.js.map +1 -1
- package/Bar.config.js +143 -148
- package/Bar.config.js.map +1 -1
- package/Bar.js +336 -427
- package/Bar.js.map +1 -1
- package/Bubble.config.js +130 -117
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +325 -398
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +86 -80
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +305 -385
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +139 -146
- package/Column.config.js.map +1 -1
- package/Column.js +332 -425
- package/Column.js.map +1 -1
- package/Ellipse.config.js +86 -80
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +288 -368
- package/Ellipse.js.map +1 -1
- package/FillerGauge.config.js +91 -85
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +296 -376
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +74 -74
- package/Image.config.js.map +1 -1
- package/Image.js +710 -798
- package/Image.js.map +1 -1
- package/Line.config.js +139 -137
- package/Line.config.js.map +1 -1
- package/Line.js +332 -416
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +112 -112
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +320 -405
- package/LinkGraph.js.map +1 -1
- package/Map.config.js +101 -95
- package/Map.config.js.map +1 -1
- package/Map.js +472 -518
- package/Map.js.map +1 -1
- package/Markdown.config.js +113 -113
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +500 -574
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +192 -193
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +1200 -1289
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +138 -138
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +292 -376
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +133 -133
- package/Pie.config.js.map +1 -1
- package/Pie.js +496 -584
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +139 -139
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +315 -399
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +267 -260
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +499 -580
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +150 -143
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +316 -390
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +130 -117
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +547 -623
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +119 -113
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +523 -604
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +19 -19
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +128 -120
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +343 -420
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +215 -178
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +668 -749
- package/SingleValueRadial.js.map +1 -1
- package/Table.config.js +150 -151
- package/Table.config.js.map +1 -1
- package/Table.js +772 -854
- 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 -352
- 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 +17 -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,180 +414,353 @@ 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.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;
|
|
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
|
-
/***/ 178:
|
|
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
|
-
/***/ 179:
|
|
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
|
-
|
|
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: [],
|
|
508
764
|
optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
|
|
509
765
|
// {
|
|
510
766
|
// name: 'annotation',
|
|
@@ -584,30 +840,23 @@ exports.default = configUtils_1.enhanceConfig(config);
|
|
|
584
840
|
|
|
585
841
|
/***/ }),
|
|
586
842
|
|
|
587
|
-
/***/
|
|
588
|
-
/***/ (function(module, exports) {
|
|
589
|
-
|
|
590
|
-
module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
|
|
591
|
-
|
|
592
|
-
/***/ }),
|
|
593
|
-
|
|
594
|
-
/***/ 180:
|
|
843
|
+
/***/ 181:
|
|
595
844
|
/***/ (function(module, exports, __webpack_require__) {
|
|
596
845
|
|
|
597
846
|
"use strict";
|
|
598
847
|
|
|
599
848
|
|
|
600
|
-
var _classCallCheck = __webpack_require__(
|
|
849
|
+
var _classCallCheck = __webpack_require__(10);
|
|
601
850
|
|
|
602
|
-
var _createClass = __webpack_require__(
|
|
851
|
+
var _createClass = __webpack_require__(18);
|
|
603
852
|
|
|
604
853
|
Object.defineProperty(exports, "__esModule", {
|
|
605
854
|
value: true
|
|
606
855
|
});
|
|
607
856
|
|
|
608
|
-
var lodash_1 = __webpack_require__(
|
|
857
|
+
var lodash_1 = __webpack_require__(3);
|
|
609
858
|
|
|
610
|
-
var RemoteImage_1 = __webpack_require__(
|
|
859
|
+
var RemoteImage_1 = __webpack_require__(126);
|
|
611
860
|
/**
|
|
612
861
|
* Image Api
|
|
613
862
|
*/
|
|
@@ -652,62 +901,42 @@ exports.default = ImageApi;
|
|
|
652
901
|
|
|
653
902
|
/***/ }),
|
|
654
903
|
|
|
655
|
-
/***/
|
|
904
|
+
/***/ 19:
|
|
656
905
|
/***/ (function(module, exports) {
|
|
657
906
|
|
|
658
|
-
module.exports = require("
|
|
907
|
+
module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
|
|
659
908
|
|
|
660
909
|
/***/ }),
|
|
661
910
|
|
|
662
|
-
/***/
|
|
911
|
+
/***/ 2:
|
|
663
912
|
/***/ (function(module, exports) {
|
|
664
913
|
|
|
665
|
-
module.exports = require("@splunk/
|
|
666
|
-
|
|
667
|
-
/***/ }),
|
|
668
|
-
|
|
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;
|
|
914
|
+
module.exports = require("@splunk/ui-utils/i18n");
|
|
679
915
|
|
|
680
|
-
|
|
916
|
+
/***/ }),
|
|
681
917
|
|
|
682
|
-
|
|
683
|
-
|
|
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);
|
|
918
|
+
/***/ 22:
|
|
919
|
+
/***/ (function(module, exports) {
|
|
689
920
|
|
|
690
|
-
|
|
691
|
-
accum[k] = nestedSchema;
|
|
692
|
-
}
|
|
693
|
-
}
|
|
921
|
+
module.exports = require("@splunk/visualization-context/TimezoneContext");
|
|
694
922
|
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
923
|
+
/***/ }),
|
|
924
|
+
|
|
925
|
+
/***/ 24:
|
|
926
|
+
/***/ (function(module, exports) {
|
|
698
927
|
|
|
699
|
-
exports
|
|
928
|
+
module.exports = require("@splunk/visualizations-shared/hocUtils");
|
|
700
929
|
|
|
701
930
|
/***/ }),
|
|
702
931
|
|
|
703
932
|
/***/ 25:
|
|
704
933
|
/***/ (function(module, exports) {
|
|
705
934
|
|
|
706
|
-
module.exports = require("@
|
|
935
|
+
module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
|
|
707
936
|
|
|
708
937
|
/***/ }),
|
|
709
938
|
|
|
710
|
-
/***/
|
|
939
|
+
/***/ 27:
|
|
711
940
|
/***/ (function(module, exports, __webpack_require__) {
|
|
712
941
|
|
|
713
942
|
"use strict";
|
|
@@ -722,13 +951,13 @@ var React = __webpack_require__(1);
|
|
|
722
951
|
|
|
723
952
|
var T = __webpack_require__(0);
|
|
724
953
|
|
|
725
|
-
var lodash_1 = __webpack_require__(
|
|
954
|
+
var lodash_1 = __webpack_require__(3);
|
|
726
955
|
|
|
727
|
-
var i18n_1 = __webpack_require__(
|
|
956
|
+
var i18n_1 = __webpack_require__(2);
|
|
728
957
|
|
|
729
|
-
var Message_1 = __webpack_require__(
|
|
958
|
+
var Message_1 = __webpack_require__(9);
|
|
730
959
|
|
|
731
|
-
var FixedSizeContainer_1 = __webpack_require__(
|
|
960
|
+
var FixedSizeContainer_1 = __webpack_require__(12);
|
|
732
961
|
/**
|
|
733
962
|
* @method shouldShowIconPlaceholder
|
|
734
963
|
* @param {object} dataSources
|
|
@@ -799,13 +1028,13 @@ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
|
799
1028
|
|
|
800
1029
|
/***/ }),
|
|
801
1030
|
|
|
802
|
-
/***/
|
|
1031
|
+
/***/ 28:
|
|
803
1032
|
/***/ (function(module, exports, __webpack_require__) {
|
|
804
1033
|
|
|
805
1034
|
"use strict";
|
|
806
1035
|
|
|
807
1036
|
|
|
808
|
-
var _defineProperty = __webpack_require__(
|
|
1037
|
+
var _defineProperty = __webpack_require__(6);
|
|
809
1038
|
|
|
810
1039
|
Object.defineProperty(exports, "__esModule", {
|
|
811
1040
|
value: true
|
|
@@ -814,9 +1043,9 @@ exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
|
814
1043
|
|
|
815
1044
|
var T = __webpack_require__(0);
|
|
816
1045
|
|
|
817
|
-
var lodash_1 = __webpack_require__(
|
|
1046
|
+
var lodash_1 = __webpack_require__(3);
|
|
818
1047
|
|
|
819
|
-
var DataSource_1 = __webpack_require__(
|
|
1048
|
+
var DataSource_1 = __webpack_require__(38);
|
|
820
1049
|
|
|
821
1050
|
exports.SortParamsPropTypes = T.shape({
|
|
822
1051
|
currentSortKey: T.string,
|
|
@@ -870,7 +1099,7 @@ exports.getSortingParams = getSortingParams;
|
|
|
870
1099
|
|
|
871
1100
|
/***/ }),
|
|
872
1101
|
|
|
873
|
-
/***/
|
|
1102
|
+
/***/ 29:
|
|
874
1103
|
/***/ (function(module, exports, __webpack_require__) {
|
|
875
1104
|
|
|
876
1105
|
"use strict";
|
|
@@ -883,7 +1112,7 @@ exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
|
883
1112
|
|
|
884
1113
|
var T = __webpack_require__(0);
|
|
885
1114
|
|
|
886
|
-
var lodash_1 = __webpack_require__(
|
|
1115
|
+
var lodash_1 = __webpack_require__(3);
|
|
887
1116
|
|
|
888
1117
|
exports.PaginatorParamsPropTypes = T.shape({
|
|
889
1118
|
isPaging: T.bool,
|
|
@@ -935,7 +1164,14 @@ exports.getPaginationParams = getPaginationParams;
|
|
|
935
1164
|
|
|
936
1165
|
/***/ }),
|
|
937
1166
|
|
|
938
|
-
/***/
|
|
1167
|
+
/***/ 3:
|
|
1168
|
+
/***/ (function(module, exports) {
|
|
1169
|
+
|
|
1170
|
+
module.exports = require("lodash");
|
|
1171
|
+
|
|
1172
|
+
/***/ }),
|
|
1173
|
+
|
|
1174
|
+
/***/ 30:
|
|
939
1175
|
/***/ (function(module, exports, __webpack_require__) {
|
|
940
1176
|
|
|
941
1177
|
"use strict";
|
|
@@ -964,14 +1200,7 @@ var VizCategory;
|
|
|
964
1200
|
|
|
965
1201
|
/***/ }),
|
|
966
1202
|
|
|
967
|
-
/***/
|
|
968
|
-
/***/ (function(module, exports) {
|
|
969
|
-
|
|
970
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
971
|
-
|
|
972
|
-
/***/ }),
|
|
973
|
-
|
|
974
|
-
/***/ 30:
|
|
1203
|
+
/***/ 31:
|
|
975
1204
|
/***/ (function(module, exports, __webpack_require__) {
|
|
976
1205
|
|
|
977
1206
|
"use strict";
|
|
@@ -983,39 +1212,39 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
983
1212
|
|
|
984
1213
|
var React = __webpack_require__(1);
|
|
985
1214
|
|
|
986
|
-
var lodash_1 = __webpack_require__(
|
|
1215
|
+
var lodash_1 = __webpack_require__(3);
|
|
987
1216
|
|
|
988
|
-
var getSettingsFromThemedProps_1 = __webpack_require__(
|
|
1217
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(32);
|
|
989
1218
|
|
|
990
|
-
var Options_1 = __webpack_require__(
|
|
1219
|
+
var Options_1 = __webpack_require__(33);
|
|
991
1220
|
|
|
992
|
-
var SanitizeProps_1 = __webpack_require__(
|
|
1221
|
+
var SanitizeProps_1 = __webpack_require__(34);
|
|
993
1222
|
|
|
994
|
-
var TimezoneContext_1 = __webpack_require__(
|
|
1223
|
+
var TimezoneContext_1 = __webpack_require__(22);
|
|
995
1224
|
|
|
996
|
-
var moment_1 = __webpack_require__(
|
|
1225
|
+
var moment_1 = __webpack_require__(35);
|
|
997
1226
|
|
|
998
1227
|
var styled_components_1 = __webpack_require__(4);
|
|
999
1228
|
|
|
1000
|
-
var
|
|
1229
|
+
var hocUtils_1 = __webpack_require__(24);
|
|
1001
1230
|
|
|
1002
|
-
var
|
|
1231
|
+
var JSONSchemaUtils_1 = __webpack_require__(25);
|
|
1003
1232
|
|
|
1004
|
-
var
|
|
1233
|
+
var SplunkVisualization_1 = __webpack_require__(36);
|
|
1005
1234
|
|
|
1006
|
-
var
|
|
1235
|
+
var VizBehavior_1 = __webpack_require__(5);
|
|
1007
1236
|
|
|
1008
|
-
var
|
|
1237
|
+
var getSorting_1 = __webpack_require__(28);
|
|
1009
1238
|
|
|
1010
|
-
var
|
|
1239
|
+
var getPagination_1 = __webpack_require__(29);
|
|
1011
1240
|
|
|
1012
|
-
var
|
|
1241
|
+
var useDeepMemo_1 = __webpack_require__(39);
|
|
1013
1242
|
|
|
1014
|
-
var
|
|
1243
|
+
var MissingPropsMessage_1 = __webpack_require__(40);
|
|
1015
1244
|
|
|
1016
|
-
var
|
|
1245
|
+
var withEditModeCover_1 = __webpack_require__(41);
|
|
1017
1246
|
|
|
1018
|
-
var
|
|
1247
|
+
var withPlaceholder_1 = __webpack_require__(42);
|
|
1019
1248
|
/**
|
|
1020
1249
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
1021
1250
|
* @param {DashboardVizOpts} opts
|
|
@@ -1217,41 +1446,41 @@ exports.default = withDashboardViz;
|
|
|
1217
1446
|
|
|
1218
1447
|
/***/ }),
|
|
1219
1448
|
|
|
1220
|
-
/***/
|
|
1449
|
+
/***/ 32:
|
|
1221
1450
|
/***/ (function(module, exports) {
|
|
1222
1451
|
|
|
1223
1452
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
1224
1453
|
|
|
1225
1454
|
/***/ }),
|
|
1226
1455
|
|
|
1227
|
-
/***/
|
|
1456
|
+
/***/ 33:
|
|
1228
1457
|
/***/ (function(module, exports) {
|
|
1229
1458
|
|
|
1230
1459
|
module.exports = require("@splunk/visualization-encoding/Options");
|
|
1231
1460
|
|
|
1232
1461
|
/***/ }),
|
|
1233
1462
|
|
|
1234
|
-
/***/
|
|
1463
|
+
/***/ 34:
|
|
1235
1464
|
/***/ (function(module, exports) {
|
|
1236
1465
|
|
|
1237
1466
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1238
1467
|
|
|
1239
1468
|
/***/ }),
|
|
1240
1469
|
|
|
1241
|
-
/***/
|
|
1470
|
+
/***/ 35:
|
|
1242
1471
|
/***/ (function(module, exports) {
|
|
1243
1472
|
|
|
1244
1473
|
module.exports = require("@splunk/moment");
|
|
1245
1474
|
|
|
1246
1475
|
/***/ }),
|
|
1247
1476
|
|
|
1248
|
-
/***/
|
|
1477
|
+
/***/ 36:
|
|
1249
1478
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1250
1479
|
|
|
1251
1480
|
"use strict";
|
|
1252
1481
|
|
|
1253
1482
|
|
|
1254
|
-
var _classCallCheck = __webpack_require__(
|
|
1483
|
+
var _classCallCheck = __webpack_require__(10);
|
|
1255
1484
|
|
|
1256
1485
|
Object.defineProperty(exports, "__esModule", {
|
|
1257
1486
|
value: true
|
|
@@ -1261,9 +1490,9 @@ exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
|
1261
1490
|
|
|
1262
1491
|
var T = __webpack_require__(0);
|
|
1263
1492
|
|
|
1264
|
-
var lodash_1 = __webpack_require__(
|
|
1493
|
+
var lodash_1 = __webpack_require__(3);
|
|
1265
1494
|
|
|
1266
|
-
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
|
|
1267
1496
|
|
|
1268
1497
|
|
|
1269
1498
|
exports.INITIAL_WIDTH = 250;
|
|
@@ -1397,15 +1626,15 @@ exports.default = SplunkVisualization;
|
|
|
1397
1626
|
|
|
1398
1627
|
/***/ }),
|
|
1399
1628
|
|
|
1400
|
-
/***/
|
|
1629
|
+
/***/ 37:
|
|
1401
1630
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1402
1631
|
|
|
1403
1632
|
"use strict";
|
|
1404
1633
|
|
|
1405
1634
|
|
|
1406
|
-
var _classCallCheck = __webpack_require__(
|
|
1635
|
+
var _classCallCheck = __webpack_require__(10);
|
|
1407
1636
|
|
|
1408
|
-
var _createClass = __webpack_require__(
|
|
1637
|
+
var _createClass = __webpack_require__(18);
|
|
1409
1638
|
|
|
1410
1639
|
Object.defineProperty(exports, "__esModule", {
|
|
1411
1640
|
value: true
|
|
@@ -1422,228 +1651,20 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
|
1422
1651
|
value: function focus() {// noop
|
|
1423
1652
|
}
|
|
1424
1653
|
}, {
|
|
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
|
-
/***/ }),
|
|
1654
|
+
key: "snapshot",
|
|
1655
|
+
value: function snapshot() {
|
|
1656
|
+
return null; // noop
|
|
1657
|
+
}
|
|
1658
|
+
}]);
|
|
1638
1659
|
|
|
1639
|
-
|
|
1640
|
-
|
|
1660
|
+
return DefaultVizActionHandler;
|
|
1661
|
+
}();
|
|
1641
1662
|
|
|
1642
|
-
|
|
1663
|
+
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1643
1664
|
|
|
1644
1665
|
/***/ }),
|
|
1645
1666
|
|
|
1646
|
-
/***/
|
|
1667
|
+
/***/ 38:
|
|
1647
1668
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1648
1669
|
|
|
1649
1670
|
"use strict";
|
|
@@ -1652,70 +1673,65 @@ module.exports = require("@splunk/visualizations-shared/mapUtils");
|
|
|
1652
1673
|
Object.defineProperty(exports, "__esModule", {
|
|
1653
1674
|
value: true
|
|
1654
1675
|
});
|
|
1676
|
+
exports.validSortDirs = void 0;
|
|
1677
|
+
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1655
1678
|
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
var colorUtils_1 = __webpack_require__(13);
|
|
1679
|
+
/***/ }),
|
|
1659
1680
|
|
|
1660
|
-
|
|
1681
|
+
/***/ 39:
|
|
1682
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1661
1683
|
|
|
1662
|
-
|
|
1684
|
+
"use strict";
|
|
1663
1685
|
|
|
1664
|
-
var VizBehavior_1 = __webpack_require__(5);
|
|
1665
1686
|
|
|
1666
|
-
|
|
1687
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1688
|
+
value: true
|
|
1689
|
+
});
|
|
1690
|
+
exports.useDeepMemo = void 0;
|
|
1667
1691
|
|
|
1668
|
-
var
|
|
1669
|
-
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
1670
|
-
var config = Visualization.config;
|
|
1671
|
-
var themes = config.themes;
|
|
1692
|
+
var react_1 = __webpack_require__(1);
|
|
1672
1693
|
|
|
1673
|
-
|
|
1674
|
-
|
|
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
|
+
*/
|
|
1675
1708
|
|
|
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
1709
|
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
"data-test": "icon-placeholder",
|
|
1689
|
-
icon: icon,
|
|
1690
|
-
width: width,
|
|
1691
|
-
height: height,
|
|
1692
|
-
backgroundColor: bgColorFromTheme,
|
|
1693
|
-
iconColor: iconColor
|
|
1694
|
-
});
|
|
1695
|
-
}
|
|
1710
|
+
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
1711
|
+
var ref = react_1.useRef();
|
|
1696
1712
|
|
|
1697
|
-
|
|
1698
|
-
|
|
1713
|
+
if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
|
|
1714
|
+
ref.current = {
|
|
1715
|
+
dependencies: dependencies,
|
|
1716
|
+
value: fn()
|
|
1717
|
+
};
|
|
1718
|
+
}
|
|
1699
1719
|
|
|
1700
|
-
|
|
1701
|
-
Wrapper: Wrapper,
|
|
1702
|
-
Visualization: Visualization
|
|
1703
|
-
});
|
|
1704
|
-
return Wrapper;
|
|
1720
|
+
return ref.current.value;
|
|
1705
1721
|
};
|
|
1706
1722
|
|
|
1707
|
-
exports.
|
|
1723
|
+
exports.useDeepMemo = useDeepMemo;
|
|
1708
1724
|
|
|
1709
1725
|
/***/ }),
|
|
1710
1726
|
|
|
1711
|
-
/***/
|
|
1727
|
+
/***/ 4:
|
|
1712
1728
|
/***/ (function(module, exports) {
|
|
1713
1729
|
|
|
1714
|
-
module.exports = require("
|
|
1730
|
+
module.exports = require("styled-components");
|
|
1715
1731
|
|
|
1716
1732
|
/***/ }),
|
|
1717
1733
|
|
|
1718
|
-
/***/
|
|
1734
|
+
/***/ 40:
|
|
1719
1735
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1720
1736
|
|
|
1721
1737
|
"use strict";
|
|
@@ -1724,370 +1740,266 @@ module.exports = require("@splunk/visualization-icons");
|
|
|
1724
1740
|
Object.defineProperty(exports, "__esModule", {
|
|
1725
1741
|
value: true
|
|
1726
1742
|
});
|
|
1727
|
-
exports.
|
|
1728
|
-
var VizBehavior;
|
|
1729
|
-
|
|
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
|
-
*/
|
|
1749
|
-
|
|
1750
|
-
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
1751
|
-
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
1752
|
-
})(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
|
|
1753
|
-
|
|
1754
|
-
/***/ }),
|
|
1755
|
-
|
|
1756
|
-
/***/ 6:
|
|
1757
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1743
|
+
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
1758
1744
|
|
|
1759
|
-
|
|
1745
|
+
var React = __webpack_require__(1);
|
|
1760
1746
|
|
|
1747
|
+
var T = __webpack_require__(0);
|
|
1761
1748
|
|
|
1762
|
-
var
|
|
1749
|
+
var i18n_1 = __webpack_require__(2);
|
|
1763
1750
|
|
|
1764
|
-
var
|
|
1751
|
+
var Message_1 = __webpack_require__(9);
|
|
1765
1752
|
|
|
1766
|
-
var
|
|
1767
|
-
|
|
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
|
+
*/
|
|
1768
1759
|
|
|
1769
|
-
for (var p in s) {
|
|
1770
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
1771
|
-
}
|
|
1772
1760
|
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
}
|
|
1776
|
-
return t;
|
|
1761
|
+
var isMissing = function isMissing(v) {
|
|
1762
|
+
return v === null || v === undefined;
|
|
1777
1763
|
};
|
|
1778
1764
|
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
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
|
+
*/
|
|
1787
1772
|
|
|
1788
|
-
var
|
|
1773
|
+
var missingKeys = function missingKeys(keys, target) {
|
|
1774
|
+
return keys.filter(function (k) {
|
|
1775
|
+
return exports.isMissing(target[k]);
|
|
1776
|
+
});
|
|
1777
|
+
};
|
|
1789
1778
|
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
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)
|
|
1793
1786
|
};
|
|
1794
1787
|
/**
|
|
1795
|
-
*
|
|
1796
|
-
* @param
|
|
1797
|
-
* @returns
|
|
1788
|
+
* @method MissingPropsMessage
|
|
1789
|
+
* @param {MissingPropsProps} props
|
|
1790
|
+
* @returns {React.ReactElement}
|
|
1798
1791
|
*/
|
|
1799
1792
|
|
|
1800
|
-
function
|
|
1801
|
-
var
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
properties = _a.properties,
|
|
1812
|
-
patternProperties = _a.patternProperties,
|
|
1813
|
-
remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
|
|
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(', ')))
|
|
1802
|
+
});
|
|
1803
|
+
};
|
|
1814
1804
|
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
writeOnly: writeOnly
|
|
1823
|
-
}), examples !== undefined && {
|
|
1824
|
-
examples: examples
|
|
1825
|
-
}), defaultValue !== undefined && {
|
|
1826
|
-
default: defaultValue
|
|
1827
|
-
});
|
|
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);
|
|
1828
1812
|
|
|
1829
|
-
|
|
1830
|
-
enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
|
|
1831
|
-
type: type
|
|
1832
|
-
}), properties && {
|
|
1833
|
-
properties: enhanceOptionsSchemaWithDynamicOptions(properties)
|
|
1834
|
-
});
|
|
1813
|
+
/***/ }),
|
|
1835
1814
|
|
|
1836
|
-
|
|
1837
|
-
|
|
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
|
-
}
|
|
1850
|
-
});
|
|
1851
|
-
return enhancedOptionsSchema;
|
|
1852
|
-
}
|
|
1815
|
+
/***/ 41:
|
|
1816
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1853
1817
|
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
* and containing `open: false` for all editor panels in editorConfig
|
|
1861
|
-
*/
|
|
1818
|
+
"use strict";
|
|
1819
|
+
|
|
1820
|
+
|
|
1821
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1822
|
+
value: true
|
|
1823
|
+
});
|
|
1862
1824
|
|
|
1863
|
-
|
|
1864
|
-
var enhancedConfig = vizConfig;
|
|
1825
|
+
var React = __webpack_require__(1);
|
|
1865
1826
|
|
|
1866
|
-
|
|
1867
|
-
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
1868
|
-
}
|
|
1827
|
+
var styled_components_1 = __webpack_require__(4);
|
|
1869
1828
|
|
|
1870
|
-
|
|
1871
|
-
return Object.assign(Object.assign({}, config), {
|
|
1872
|
-
open: false
|
|
1873
|
-
});
|
|
1874
|
-
});
|
|
1875
|
-
return enhancedConfig;
|
|
1876
|
-
}
|
|
1829
|
+
var hocUtils_1 = __webpack_require__(13);
|
|
1877
1830
|
|
|
1878
|
-
|
|
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%;"]);
|
|
1879
1841
|
/**
|
|
1880
|
-
*
|
|
1881
|
-
*
|
|
1882
|
-
* @param
|
|
1883
|
-
* @returns
|
|
1842
|
+
* HOC that renders a cover layer in edit mode
|
|
1843
|
+
* @method withEditModeCover
|
|
1844
|
+
* @param {ExtendedDashViz} Visualization
|
|
1845
|
+
* @returns {ExtendedDashViz} Wrapper
|
|
1884
1846
|
*/
|
|
1885
1847
|
|
|
1886
|
-
function
|
|
1887
|
-
var
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
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
|
+
};
|
|
1856
|
+
|
|
1857
|
+
hocUtils_1.extendStaticWrapperProps({
|
|
1858
|
+
Wrapper: Wrapper,
|
|
1859
|
+
Visualization: Visualization
|
|
1892
1860
|
});
|
|
1893
|
-
return
|
|
1894
|
-
}
|
|
1861
|
+
return Wrapper;
|
|
1862
|
+
};
|
|
1895
1863
|
|
|
1896
|
-
exports.
|
|
1864
|
+
exports.default = withEditModeCover;
|
|
1897
1865
|
|
|
1898
|
-
|
|
1899
|
-
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
1900
|
-
}
|
|
1866
|
+
/***/ }),
|
|
1901
1867
|
|
|
1902
|
-
|
|
1903
|
-
|
|
1868
|
+
/***/ 42:
|
|
1869
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1904
1870
|
|
|
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
|
-
*/
|
|
1871
|
+
"use strict";
|
|
1913
1872
|
|
|
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
1873
|
|
|
1874
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1875
|
+
value: true
|
|
1876
|
+
});
|
|
1924
1877
|
|
|
1925
|
-
|
|
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
|
-
*/
|
|
1878
|
+
var React = __webpack_require__(1);
|
|
1939
1879
|
|
|
1880
|
+
var colorUtils_1 = __webpack_require__(11);
|
|
1940
1881
|
|
|
1941
|
-
|
|
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
|
|
1882
|
+
var variables_1 = __webpack_require__(8);
|
|
1948
1883
|
|
|
1949
|
-
|
|
1950
|
-
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
1951
|
-
});
|
|
1952
|
-
}
|
|
1884
|
+
var IconPlaceholder_1 = __webpack_require__(27);
|
|
1953
1885
|
|
|
1954
|
-
|
|
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
|
-
*/
|
|
1886
|
+
var VizBehavior_1 = __webpack_require__(5);
|
|
1961
1887
|
|
|
1962
|
-
|
|
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
|
-
}
|
|
1888
|
+
var hocUtils_1 = __webpack_require__(13);
|
|
1970
1889
|
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
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
|
-
*/
|
|
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;
|
|
1980
1894
|
|
|
1981
|
-
var
|
|
1982
|
-
|
|
1983
|
-
layoutItems[_key - 2] = arguments[_key];
|
|
1984
|
-
}
|
|
1895
|
+
var Wrapper = function Wrapper(props) {
|
|
1896
|
+
var _a, _b;
|
|
1985
1897
|
|
|
1986
|
-
|
|
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;
|
|
1987
1927
|
};
|
|
1988
1928
|
|
|
1989
|
-
exports.
|
|
1929
|
+
exports.default = withPlaceholder;
|
|
1990
1930
|
|
|
1991
1931
|
/***/ }),
|
|
1992
1932
|
|
|
1993
|
-
/***/
|
|
1933
|
+
/***/ 46:
|
|
1994
1934
|
/***/ (function(module, exports) {
|
|
1995
1935
|
|
|
1996
|
-
module.exports = require("@
|
|
1936
|
+
module.exports = require("@splunk/visualization-icons");
|
|
1997
1937
|
|
|
1998
1938
|
/***/ }),
|
|
1999
1939
|
|
|
2000
|
-
/***/
|
|
1940
|
+
/***/ 5:
|
|
2001
1941
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2002
1942
|
|
|
2003
1943
|
"use strict";
|
|
2004
1944
|
|
|
2005
1945
|
|
|
2006
|
-
var _typeof = __webpack_require__(25);
|
|
2007
|
-
|
|
2008
1946
|
Object.defineProperty(exports, "__esModule", {
|
|
2009
1947
|
value: true
|
|
2010
1948
|
});
|
|
2011
|
-
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
|
+
*/
|
|
2012
1971
|
|
|
2013
|
-
|
|
1972
|
+
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
1973
|
+
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
1974
|
+
})(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
|
|
2014
1975
|
|
|
2015
|
-
|
|
2016
|
-
/**
|
|
2017
|
-
* @method extendStaticWrapperProps
|
|
2018
|
-
* @param {Object} props
|
|
2019
|
-
* @param {DashboardVizType} props.Wrapper
|
|
2020
|
-
* @param {DashboardVizType} props.Visualization
|
|
2021
|
-
*/
|
|
1976
|
+
/***/ }),
|
|
2022
1977
|
|
|
1978
|
+
/***/ 6:
|
|
1979
|
+
/***/ (function(module, exports) {
|
|
2023
1980
|
|
|
2024
|
-
|
|
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
|
-
};
|
|
1981
|
+
module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
2035
1982
|
|
|
2036
|
-
|
|
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
|
-
|
|
2052
|
-
|
|
1985
|
+
/***/ 7:
|
|
1986
|
+
/***/ (function(module, exports) {
|
|
2053
1987
|
|
|
2054
|
-
|
|
2055
|
-
sources[_key - 1] = arguments[_key];
|
|
2056
|
-
}
|
|
1988
|
+
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
2057
1989
|
|
|
2058
|
-
|
|
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
|
-
|
|
2065
|
-
|
|
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
|
|
1995
|
+
module.exports = require("@splunk/themes/variables");
|
|
2084
1996
|
|
|
2085
1997
|
/***/ }),
|
|
2086
1998
|
|
|
2087
1999
|
/***/ 9:
|
|
2088
2000
|
/***/ (function(module, exports) {
|
|
2089
2001
|
|
|
2090
|
-
module.exports = require("@
|
|
2002
|
+
module.exports = require("@splunk/visualizations-shared/Message");
|
|
2091
2003
|
|
|
2092
2004
|
/***/ })
|
|
2093
2005
|
|