@splunk/visualizations 25.13.1 → 26.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +318 -234
- package/Area.config.js.map +1 -1
- package/Area.js +1131 -766
- package/Area.js.map +1 -1
- package/Bar.config.js +317 -233
- package/Bar.config.js.map +1 -1
- package/Bar.js +1007 -594
- package/Bar.js.map +1 -1
- package/Bubble.config.js +234 -160
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +912 -509
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +80 -29
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +691 -319
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +308 -223
- package/Column.config.js.map +1 -1
- package/Column.js +1011 -587
- package/Column.js.map +1 -1
- package/Ellipse.config.js +127 -62
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +576 -286
- package/Ellipse.js.map +1 -1
- package/Events.config.js +111 -29
- package/Events.config.js.map +1 -1
- package/Events.js +998 -527
- package/Events.js.map +1 -1
- package/FillerGauge.config.js +142 -73
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +962 -572
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +70 -26
- package/Image.config.js.map +1 -1
- package/Image.js +524 -253
- package/Image.js.map +1 -1
- package/Line.config.js +326 -242
- package/Line.config.js.map +1 -1
- package/Line.js +1022 -606
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +99 -49
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +1184 -762
- package/LinkGraph.js.map +1 -1
- package/MIGRATION.md +1082 -0
- package/Map.config.js +311 -167
- package/Map.config.js.map +1 -1
- package/Map.js +1479 -873
- package/Map.js.map +1 -1
- package/Markdown.config.js +93 -43
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +603 -332
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +163 -105
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +1025 -628
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +95 -41
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +993 -622
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +99 -46
- package/Pie.config.js.map +1 -1
- package/Pie.js +847 -442
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +114 -62
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +1097 -633
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +131 -65
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +580 -288
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +103 -41
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +1128 -586
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +231 -157
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +904 -504
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +212 -142
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +1506 -956
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +294 -233
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +208 -138
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +1375 -914
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +252 -137
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +2194 -1069
- package/SingleValueRadial.js.map +1 -1
- package/SparkLine.js +172 -83
- package/SparkLine.js.map +1 -1
- package/Table.config.js +123 -70
- package/Table.config.js.map +1 -1
- package/Table.js +1094 -590
- package/Table.js.map +1 -1
- package/common/Charting.js +147 -75
- package/common/Charting.js.map +1 -1
- package/common/ChartingApi.js +18 -7
- package/common/ChartingApi.js.map +1 -1
- package/common/EventsDoc.js +91 -36
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +70 -60
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +45 -36
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +177 -86
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js +65 -32
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.js +34 -7
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +10 -4
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemesDoc.js +41 -28
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +56 -24
- package/common/chartingUtils.js.map +1 -1
- package/common/docUtils.js +15 -5
- package/common/docUtils.js.map +1 -1
- package/common/gaugeUtils.js +238 -155
- package/common/gaugeUtils.js.map +1 -1
- package/common/shapeUtils.js +34 -16
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/configUtils.js +59 -23
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/dataUtils.js +9 -4
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/hocUtils.js +5 -3
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/layoutUtils.js +3 -2
- package/common/utils/layoutUtils.js.map +1 -1
- package/common/utils/mapUtils.js +370 -206
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +243 -198
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +36 -9
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +87 -26
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +4 -2
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +375 -193
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +25 -27
|
@@ -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 = 75);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ([
|
|
@@ -179,55 +179,69 @@ module.exports = require("@splunk/visualizations-shared/style");
|
|
|
179
179
|
|
|
180
180
|
/***/ }),
|
|
181
181
|
/* 22 */,
|
|
182
|
-
/* 23
|
|
182
|
+
/* 23 */,
|
|
183
|
+
/* 24 */
|
|
183
184
|
/***/ (function(module, exports, __webpack_require__) {
|
|
184
185
|
|
|
185
186
|
"use strict";
|
|
186
187
|
|
|
187
188
|
|
|
188
189
|
var _classCallCheck = __webpack_require__(4);
|
|
190
|
+
|
|
189
191
|
Object.defineProperty(exports, "__esModule", {
|
|
190
192
|
value: true
|
|
191
193
|
});
|
|
192
194
|
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
193
195
|
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
196
|
+
|
|
194
197
|
var T = __webpack_require__(1);
|
|
198
|
+
|
|
195
199
|
var lodash_1 = __webpack_require__(3);
|
|
196
|
-
|
|
197
|
-
// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
200
|
+
|
|
201
|
+
var VizActionHandler_1 = __webpack_require__(25); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
202
|
+
|
|
203
|
+
|
|
198
204
|
exports.INITIAL_WIDTH = 250;
|
|
199
205
|
exports.INITIAL_HEIGHT = 250;
|
|
200
206
|
/**
|
|
201
207
|
* A Splunk visualization
|
|
202
208
|
*/
|
|
209
|
+
|
|
203
210
|
var SplunkVisualization = function SplunkVisualization() {
|
|
204
211
|
_classCallCheck(this, SplunkVisualization);
|
|
205
212
|
};
|
|
213
|
+
|
|
206
214
|
SplunkVisualization.propTypes = {
|
|
207
215
|
/**
|
|
208
216
|
* display mode
|
|
209
217
|
*/
|
|
210
218
|
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
219
|
+
|
|
211
220
|
/**
|
|
212
221
|
* width in pixel or string, defaults to 100%
|
|
213
222
|
*/
|
|
214
223
|
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
224
|
+
|
|
215
225
|
/**
|
|
216
226
|
* height in pixel or string
|
|
217
227
|
*/
|
|
218
228
|
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
229
|
+
|
|
219
230
|
/**
|
|
220
231
|
* visualization context used for dynamic option evaluation
|
|
221
232
|
*/
|
|
222
233
|
context: T.object,
|
|
234
|
+
|
|
223
235
|
/**
|
|
224
236
|
* visualization formatting options
|
|
225
237
|
*/
|
|
226
238
|
options: T.object,
|
|
239
|
+
|
|
227
240
|
/**
|
|
228
241
|
* A callback to update formatting options
|
|
229
242
|
*/
|
|
230
243
|
onOptionsChange: T.func,
|
|
244
|
+
|
|
231
245
|
/**
|
|
232
246
|
* datasource state which include data and request params, object key indicate the datasource type.
|
|
233
247
|
*/
|
|
@@ -236,6 +250,7 @@ SplunkVisualization.propTypes = {
|
|
|
236
250
|
* current request params
|
|
237
251
|
*/
|
|
238
252
|
requestParams: T.object,
|
|
253
|
+
|
|
239
254
|
/**
|
|
240
255
|
* current dataset
|
|
241
256
|
*/
|
|
@@ -243,6 +258,7 @@ SplunkVisualization.propTypes = {
|
|
|
243
258
|
fields: T.array,
|
|
244
259
|
columns: T.array
|
|
245
260
|
}),
|
|
261
|
+
|
|
246
262
|
/**
|
|
247
263
|
* error
|
|
248
264
|
*/
|
|
@@ -250,29 +266,35 @@ SplunkVisualization.propTypes = {
|
|
|
250
266
|
level: T.string,
|
|
251
267
|
message: T.string
|
|
252
268
|
}),
|
|
269
|
+
|
|
253
270
|
/**
|
|
254
271
|
* meta data that came with the dataset
|
|
255
272
|
*/
|
|
256
273
|
meta: T.object
|
|
257
274
|
})),
|
|
275
|
+
|
|
258
276
|
/**
|
|
259
277
|
* A callback to trigger event
|
|
260
278
|
*/
|
|
261
279
|
onEventTrigger: T.func,
|
|
280
|
+
|
|
262
281
|
/**
|
|
263
282
|
* Inform viz if there are handlers listening to events
|
|
264
283
|
*/
|
|
265
284
|
hasEventHandlers: T.bool,
|
|
285
|
+
|
|
266
286
|
/**
|
|
267
287
|
* A callback to communicate computed props to a consumer
|
|
268
288
|
*/
|
|
269
289
|
onComputedProps: T.func,
|
|
290
|
+
|
|
270
291
|
/**
|
|
271
292
|
* A callback to obtain visualization api
|
|
272
293
|
*/
|
|
273
294
|
vizActionHandlerRef: T.func,
|
|
274
295
|
loading: T.bool,
|
|
275
296
|
theme: T.object,
|
|
297
|
+
|
|
276
298
|
/**
|
|
277
299
|
* A callback to request new data with updated request params
|
|
278
300
|
*/
|
|
@@ -281,6 +303,7 @@ SplunkVisualization.propTypes = {
|
|
|
281
303
|
/**
|
|
282
304
|
*
|
|
283
305
|
*/
|
|
306
|
+
|
|
284
307
|
SplunkVisualization.defaultProps = {
|
|
285
308
|
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
286
309
|
width: '100%',
|
|
@@ -308,26 +331,29 @@ SplunkVisualization.defaultProps = {
|
|
|
308
331
|
exports.default = SplunkVisualization;
|
|
309
332
|
|
|
310
333
|
/***/ }),
|
|
311
|
-
/*
|
|
334
|
+
/* 25 */
|
|
312
335
|
/***/ (function(module, exports, __webpack_require__) {
|
|
313
336
|
|
|
314
337
|
"use strict";
|
|
315
338
|
|
|
316
339
|
|
|
317
340
|
var _classCallCheck = __webpack_require__(4);
|
|
341
|
+
|
|
318
342
|
var _createClass = __webpack_require__(6);
|
|
343
|
+
|
|
319
344
|
Object.defineProperty(exports, "__esModule", {
|
|
320
345
|
value: true
|
|
321
346
|
});
|
|
322
347
|
exports.DefaultVizActionHandler = void 0;
|
|
348
|
+
|
|
323
349
|
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
324
350
|
function DefaultVizActionHandler() {
|
|
325
351
|
_classCallCheck(this, DefaultVizActionHandler);
|
|
326
352
|
}
|
|
353
|
+
|
|
327
354
|
_createClass(DefaultVizActionHandler, [{
|
|
328
355
|
key: "focus",
|
|
329
|
-
value: function focus() {
|
|
330
|
-
// noop
|
|
356
|
+
value: function focus() {// noop
|
|
331
357
|
}
|
|
332
358
|
}, {
|
|
333
359
|
key: "snapshot",
|
|
@@ -335,22 +361,24 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
|
335
361
|
return null; // noop
|
|
336
362
|
}
|
|
337
363
|
}]);
|
|
364
|
+
|
|
338
365
|
return DefaultVizActionHandler;
|
|
339
366
|
}();
|
|
367
|
+
|
|
340
368
|
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
341
369
|
|
|
342
370
|
/***/ }),
|
|
343
|
-
/*
|
|
344
|
-
/*
|
|
371
|
+
/* 26 */,
|
|
372
|
+
/* 27 */
|
|
345
373
|
/***/ (function(module, exports) {
|
|
346
374
|
|
|
347
375
|
module.exports = require("@splunk/themes/variables");
|
|
348
376
|
|
|
349
377
|
/***/ }),
|
|
350
|
-
/* 27 */,
|
|
351
378
|
/* 28 */,
|
|
352
379
|
/* 29 */,
|
|
353
|
-
/* 30
|
|
380
|
+
/* 30 */,
|
|
381
|
+
/* 31 */
|
|
354
382
|
/***/ (function(module, exports, __webpack_require__) {
|
|
355
383
|
|
|
356
384
|
"use strict";
|
|
@@ -361,6 +389,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
361
389
|
});
|
|
362
390
|
exports.VizBehavior = void 0;
|
|
363
391
|
var VizBehavior;
|
|
392
|
+
|
|
364
393
|
(function (VizBehavior) {
|
|
365
394
|
/**
|
|
366
395
|
* Dynamic Options Behavior.
|
|
@@ -380,13 +409,14 @@ var VizBehavior;
|
|
|
380
409
|
* missing.
|
|
381
410
|
* @type {string}
|
|
382
411
|
*/
|
|
412
|
+
|
|
383
413
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
384
414
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
385
415
|
VizBehavior["TRELLIS"] = "trellis";
|
|
386
416
|
})(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
|
|
387
417
|
|
|
388
418
|
/***/ }),
|
|
389
|
-
/*
|
|
419
|
+
/* 32 */
|
|
390
420
|
/***/ (function(module, exports, __webpack_require__) {
|
|
391
421
|
|
|
392
422
|
"use strict";
|
|
@@ -395,40 +425,46 @@ var VizBehavior;
|
|
|
395
425
|
Object.defineProperty(exports, "__esModule", {
|
|
396
426
|
value: true
|
|
397
427
|
});
|
|
428
|
+
|
|
398
429
|
var React = __webpack_require__(0);
|
|
430
|
+
|
|
399
431
|
var styled_components_1 = __webpack_require__(2);
|
|
400
|
-
|
|
432
|
+
|
|
433
|
+
var SizeAwareWrapper_1 = __webpack_require__(90);
|
|
434
|
+
|
|
401
435
|
var style_1 = __webpack_require__(21);
|
|
436
|
+
|
|
402
437
|
var colorUtils_1 = __webpack_require__(14);
|
|
438
|
+
|
|
403
439
|
var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
404
440
|
var width = _ref.width;
|
|
405
441
|
return {
|
|
406
442
|
style: {
|
|
407
|
-
width: style_1.toPx(width)
|
|
443
|
+
width: (0, style_1.toPx)(width)
|
|
408
444
|
}
|
|
409
445
|
};
|
|
410
446
|
}).withConfig({
|
|
411
447
|
displayName: "FixedSizeContainer__Item",
|
|
412
448
|
componentId: "sc-1yhgpod-0"
|
|
413
449
|
})(["position:relative;background-color:", "};"], function (props) {
|
|
414
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
415
|
-
});
|
|
416
|
-
|
|
450
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
451
|
+
}); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
|
|
452
|
+
|
|
417
453
|
var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
|
|
418
454
|
var width = _ref2.width,
|
|
419
|
-
|
|
455
|
+
height = _ref2.height;
|
|
420
456
|
return {
|
|
421
457
|
style: Object.assign(Object.assign({}, width && {
|
|
422
|
-
width: style_1.toPx(width)
|
|
458
|
+
width: (0, style_1.toPx)(width)
|
|
423
459
|
}), height && {
|
|
424
|
-
height: style_1.toPx(height)
|
|
460
|
+
height: (0, style_1.toPx)(height)
|
|
425
461
|
})
|
|
426
462
|
};
|
|
427
463
|
}).withConfig({
|
|
428
464
|
displayName: "FixedSizeContainer__FixSizeItem",
|
|
429
465
|
componentId: "sc-1yhgpod-1"
|
|
430
466
|
})(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
|
|
431
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
467
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
432
468
|
});
|
|
433
469
|
var ItemContent = styled_components_1.default.div.withConfig({
|
|
434
470
|
displayName: "FixedSizeContainer__ItemContent",
|
|
@@ -438,11 +474,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
|
|
|
438
474
|
displayName: "FixedSizeContainer__FixSizeItemContent",
|
|
439
475
|
componentId: "sc-1yhgpod-3"
|
|
440
476
|
})(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
|
|
477
|
+
|
|
441
478
|
var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
442
479
|
var FixedSizeContainer = function FixedSizeContainer(props) {
|
|
443
480
|
var width = props.width,
|
|
444
|
-
|
|
445
|
-
|
|
481
|
+
height = props.height,
|
|
482
|
+
backgroundColor = props.backgroundColor;
|
|
483
|
+
|
|
446
484
|
if (!height) {
|
|
447
485
|
return React.createElement(Item, {
|
|
448
486
|
"data-test": "item",
|
|
@@ -450,28 +488,31 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
450
488
|
backgroundColor: backgroundColor
|
|
451
489
|
}, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
|
|
452
490
|
}
|
|
491
|
+
|
|
453
492
|
return React.createElement(FixSizeItem, {
|
|
454
493
|
"data-test": "fix-size-item",
|
|
455
|
-
"data-splunk-visualization-version": "
|
|
494
|
+
"data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
|
|
456
495
|
width: width,
|
|
457
496
|
height: height,
|
|
458
497
|
backgroundColor: backgroundColor
|
|
459
498
|
}, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
|
|
460
499
|
var newWidth = _ref3.width,
|
|
461
|
-
|
|
500
|
+
newHeight = _ref3.height;
|
|
462
501
|
return React.createElement(Viz, Object.assign({}, props, {
|
|
463
502
|
width: newWidth,
|
|
464
503
|
height: newHeight
|
|
465
504
|
}));
|
|
466
505
|
})));
|
|
467
506
|
};
|
|
507
|
+
|
|
468
508
|
FixedSizeContainer.displayName = 'withFixedSizeContainer';
|
|
469
509
|
return FixedSizeContainer;
|
|
470
510
|
};
|
|
511
|
+
|
|
471
512
|
exports.default = withFixedSizeContainer;
|
|
472
513
|
|
|
473
514
|
/***/ }),
|
|
474
|
-
/*
|
|
515
|
+
/* 33 */
|
|
475
516
|
/***/ (function(module, exports, __webpack_require__) {
|
|
476
517
|
|
|
477
518
|
"use strict";
|
|
@@ -487,9 +528,10 @@ exports.extendStaticWrapperProps = void 0;
|
|
|
487
528
|
* @param {DashboardVizType} props.Wrapper
|
|
488
529
|
* @param {DashboardVizType} props.Visualization
|
|
489
530
|
*/
|
|
531
|
+
|
|
490
532
|
var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
491
533
|
var Wrapper = _ref.Wrapper,
|
|
492
|
-
|
|
534
|
+
Visualization = _ref.Visualization;
|
|
493
535
|
var extendProperties = ['propTypes', 'defaultProps', 'config'];
|
|
494
536
|
extendProperties.forEach(function (prop) {
|
|
495
537
|
if (Visualization[prop]) {
|
|
@@ -498,10 +540,10 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
498
540
|
}
|
|
499
541
|
});
|
|
500
542
|
};
|
|
543
|
+
|
|
501
544
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
502
545
|
|
|
503
546
|
/***/ }),
|
|
504
|
-
/* 33 */,
|
|
505
547
|
/* 34 */,
|
|
506
548
|
/* 35 */,
|
|
507
549
|
/* 36 */,
|
|
@@ -542,67 +584,97 @@ exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
|
542
584
|
/* 71 */,
|
|
543
585
|
/* 72 */,
|
|
544
586
|
/* 73 */,
|
|
545
|
-
/* 74
|
|
587
|
+
/* 74 */,
|
|
588
|
+
/* 75 */
|
|
546
589
|
/***/ (function(module, exports, __webpack_require__) {
|
|
547
590
|
|
|
548
591
|
"use strict";
|
|
549
592
|
|
|
550
593
|
|
|
551
594
|
var _slicedToArray = __webpack_require__(10);
|
|
595
|
+
|
|
552
596
|
Object.defineProperty(exports, "__esModule", {
|
|
553
597
|
value: true
|
|
554
598
|
});
|
|
599
|
+
|
|
555
600
|
var React = __webpack_require__(0);
|
|
601
|
+
|
|
556
602
|
var lodash_1 = __webpack_require__(3);
|
|
557
|
-
|
|
558
|
-
var
|
|
559
|
-
|
|
603
|
+
|
|
604
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(76);
|
|
605
|
+
|
|
606
|
+
var Options_1 = __webpack_require__(77);
|
|
607
|
+
|
|
608
|
+
var SanitizeProps_1 = __webpack_require__(78);
|
|
609
|
+
|
|
560
610
|
var TimezoneContext_1 = __webpack_require__(20);
|
|
561
|
-
|
|
562
|
-
var
|
|
611
|
+
|
|
612
|
+
var moment_1 = __webpack_require__(79);
|
|
613
|
+
|
|
614
|
+
var FeatureFlagContext_1 = __webpack_require__(80);
|
|
615
|
+
|
|
563
616
|
var styled_components_1 = __webpack_require__(2);
|
|
564
|
-
|
|
565
|
-
var
|
|
566
|
-
|
|
567
|
-
var
|
|
568
|
-
|
|
569
|
-
var
|
|
570
|
-
|
|
571
|
-
var
|
|
572
|
-
|
|
573
|
-
var
|
|
574
|
-
|
|
575
|
-
var
|
|
617
|
+
|
|
618
|
+
var hocUtils_1 = __webpack_require__(81);
|
|
619
|
+
|
|
620
|
+
var JSONSchemaUtils_1 = __webpack_require__(82);
|
|
621
|
+
|
|
622
|
+
var async_dynamic_options_evaluator_1 = __webpack_require__(83);
|
|
623
|
+
|
|
624
|
+
var id_1 = __webpack_require__(84);
|
|
625
|
+
|
|
626
|
+
var SplunkVisualization_1 = __webpack_require__(24);
|
|
627
|
+
|
|
628
|
+
var VizBehavior_1 = __webpack_require__(31);
|
|
629
|
+
|
|
630
|
+
var getSorting_1 = __webpack_require__(85);
|
|
631
|
+
|
|
632
|
+
var getPagination_1 = __webpack_require__(87);
|
|
633
|
+
|
|
634
|
+
var useDeepMemo_1 = __webpack_require__(88);
|
|
635
|
+
|
|
636
|
+
var MissingPropsMessage_1 = __webpack_require__(89);
|
|
637
|
+
|
|
638
|
+
var withEditModeCover_1 = __webpack_require__(91);
|
|
639
|
+
|
|
640
|
+
var withPlaceholder_1 = __webpack_require__(92);
|
|
576
641
|
/**
|
|
577
642
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
578
643
|
* @param {DashboardVizOpts} opts
|
|
579
644
|
* @returns {HOC}
|
|
580
645
|
*/
|
|
646
|
+
|
|
647
|
+
|
|
581
648
|
var withDashboardViz = function withDashboardViz(opts) {
|
|
582
649
|
var ReactViz = opts.ReactViz,
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
var
|
|
650
|
+
vizConfig = opts.vizConfig,
|
|
651
|
+
_opts$computeVizProps = opts.computeVizProps,
|
|
652
|
+
computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
|
|
653
|
+
disableEditModeCover = opts.disableEditModeCover,
|
|
654
|
+
useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
|
|
655
|
+
|
|
656
|
+
var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
|
|
657
|
+
var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
|
|
658
|
+
|
|
590
659
|
var DashboardViz = function DashboardViz(props) {
|
|
591
660
|
var _a;
|
|
661
|
+
|
|
592
662
|
var mode = props.mode,
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
663
|
+
hasEventHandlers = props.hasEventHandlers,
|
|
664
|
+
dataSources = props.dataSources,
|
|
665
|
+
options = props.options,
|
|
666
|
+
_props$context = props.context,
|
|
667
|
+
context = _props$context === void 0 ? {} : _props$context,
|
|
668
|
+
width = props.width,
|
|
669
|
+
height = props.height,
|
|
670
|
+
onComputedProps = props.onComputedProps,
|
|
671
|
+
onEventTrigger = props.onEventTrigger,
|
|
672
|
+
theme = props.theme,
|
|
673
|
+
onRequestParamsChange = props.onRequestParamsChange;
|
|
674
|
+
|
|
604
675
|
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
605
|
-
|
|
676
|
+
serializedTimezone = _React$useContext.serializedTimezone;
|
|
677
|
+
|
|
606
678
|
if (serializedTimezone) {
|
|
607
679
|
/*
|
|
608
680
|
@splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
|
|
@@ -616,44 +688,58 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
616
688
|
moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
|
|
617
689
|
}
|
|
618
690
|
}
|
|
691
|
+
|
|
619
692
|
var themeFunc = function themeFunc(themeVar) {
|
|
620
693
|
var _a, _b;
|
|
694
|
+
|
|
621
695
|
return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
|
|
622
696
|
};
|
|
697
|
+
|
|
623
698
|
var bgColorFromTheme = themeFunc('defaultBackgroundColor');
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
699
|
+
|
|
700
|
+
var _ref = (0, getSettingsFromThemedProps_1.default)({
|
|
701
|
+
theme: theme
|
|
702
|
+
}),
|
|
703
|
+
currentThemeFamily = _ref.family,
|
|
704
|
+
currentThemeColorScheme = _ref.colorScheme,
|
|
705
|
+
currentThemeDensity = _ref.density;
|
|
706
|
+
|
|
630
707
|
var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
|
|
708
|
+
|
|
631
709
|
var _React$useState = React.useState({}),
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
710
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
711
|
+
evaluatedOptionsAsync = _React$useState2[0],
|
|
712
|
+
setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
|
|
713
|
+
|
|
714
|
+
|
|
635
715
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
716
|
+
|
|
717
|
+
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
|
|
718
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
719
|
+
visualizationID = _React$useState4[0];
|
|
720
|
+
|
|
639
721
|
var _React$useState5 = React.useState({}),
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
722
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
723
|
+
dataSourcesInState = _React$useState6[0],
|
|
724
|
+
setDataSourcesInState = _React$useState6[1];
|
|
725
|
+
|
|
643
726
|
var _React$useState7 = React.useState(),
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
727
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
728
|
+
dataFramesInState = _React$useState8[0],
|
|
729
|
+
setDataFramesInState = _React$useState8[1];
|
|
730
|
+
|
|
731
|
+
var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
|
|
732
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
733
|
+
useAsyncEvaluatedOptions = _React$useState10[0],
|
|
734
|
+
setUseAsyncEvaluatedOptions = _React$useState10[1];
|
|
735
|
+
|
|
736
|
+
var isMounted = React.useRef(true);
|
|
737
|
+
evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
|
|
652
738
|
try {
|
|
653
739
|
if (useAsyncEvaluatedOptions) {
|
|
654
740
|
var optionsToEvaluate = {
|
|
655
|
-
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
656
|
-
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
741
|
+
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
742
|
+
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
657
743
|
};
|
|
658
744
|
var asyncDynamicOptionsEvaluatorParams = {
|
|
659
745
|
visualizationID: visualizationID,
|
|
@@ -664,21 +750,23 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
664
750
|
};
|
|
665
751
|
async_dynamic_options_evaluator_1.default.evaluate(asyncDynamicOptionsEvaluatorParams).then(function (results) {
|
|
666
752
|
setEvaluatedOptionsAsync(results.results);
|
|
667
|
-
}).catch(function (
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
753
|
+
}).catch(function () {
|
|
754
|
+
if (isMounted.current) {
|
|
755
|
+
setUseAsyncEvaluatedOptions(false);
|
|
756
|
+
}
|
|
671
757
|
});
|
|
672
758
|
} else {
|
|
673
759
|
var dataFrames = dataFramesInState;
|
|
760
|
+
|
|
674
761
|
if (dataSources !== dataSourcesInState) {
|
|
675
762
|
setDataSourcesInState(dataSources);
|
|
676
763
|
dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
|
|
677
764
|
setDataFramesInState(dataFrames);
|
|
678
765
|
}
|
|
766
|
+
|
|
679
767
|
return Options_1.Options.evaluate({
|
|
680
|
-
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
681
|
-
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
768
|
+
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
769
|
+
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
682
770
|
}, dataSources, themeFunc, dataFrames);
|
|
683
771
|
}
|
|
684
772
|
} catch (e) {
|
|
@@ -686,67 +774,76 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
686
774
|
console.error("unexpected error evaluating options: ".concat(e.message));
|
|
687
775
|
return {};
|
|
688
776
|
}
|
|
777
|
+
|
|
689
778
|
return {};
|
|
690
779
|
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
|
|
691
|
-
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
692
|
-
// trellis specific backgroundColor update for onComputedProps
|
|
780
|
+
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
|
|
693
781
|
// if trellis is enabled following these three criteria - 1) trellis feature flag is enabled 2) vizConfig supports array has 'trellis' 3) option 'splitByLayout' is set to 'trellis
|
|
694
782
|
// onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
|
|
783
|
+
|
|
695
784
|
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
696
785
|
var clonedEvaluatedOptions = evaluatedOptionsToUse;
|
|
786
|
+
|
|
697
787
|
if (isTrellisFeatureFlagOn && ((_a = vizConfig === null || vizConfig === void 0 ? void 0 : vizConfig.supports) === null || _a === void 0 ? void 0 : _a.includes(VizBehavior_1.VizBehavior.TRELLIS)) && (clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.splitByLayout) === VizBehavior_1.VizBehavior.TRELLIS) {
|
|
698
788
|
clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
|
|
699
789
|
backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
700
790
|
});
|
|
701
|
-
}
|
|
702
|
-
// useEffect hook needs to be initialized before any early returns
|
|
791
|
+
} // useEffect hook needs to be initialized before any early returns
|
|
703
792
|
// this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
|
|
793
|
+
|
|
794
|
+
|
|
704
795
|
React.useEffect(function () {
|
|
705
796
|
onComputedProps(clonedEvaluatedOptions);
|
|
706
797
|
});
|
|
707
798
|
React.useEffect(function () {
|
|
708
799
|
return function () {
|
|
709
800
|
if (useAsyncEvaluatedOptions) {
|
|
801
|
+
isMounted.current = false;
|
|
710
802
|
async_dynamic_options_evaluator_1.default.reset(visualizationID);
|
|
711
803
|
}
|
|
712
|
-
};
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
// present warning message if any required props are missing
|
|
804
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
805
|
+
}, []); // present warning message if any required props are missing
|
|
806
|
+
|
|
716
807
|
var _vizConfig$requiredPr = vizConfig.requiredProps,
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptionsToUse);
|
|
808
|
+
requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
|
|
809
|
+
supports = vizConfig.supports;
|
|
810
|
+
var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
|
|
811
|
+
|
|
720
812
|
if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && vizConfig.key !== 'splunk.singlevalue' // For SV missing props msg is not displayed if required props majorValue is missing, instead this will be handled from the component, instead handled within component
|
|
721
813
|
) {
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
814
|
+
return React.createElement(MissingPropsMessage_1.default, {
|
|
815
|
+
"data-test": "missing-props-message",
|
|
816
|
+
width: width,
|
|
817
|
+
height: height,
|
|
818
|
+
missingProps: missing,
|
|
819
|
+
backgroundColor: bgColorFromTheme
|
|
820
|
+
});
|
|
821
|
+
} // events
|
|
822
|
+
|
|
823
|
+
|
|
731
824
|
var eventCallbackProps = {};
|
|
825
|
+
|
|
732
826
|
if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
|
|
733
827
|
var supportedEvents = vizConfig.events;
|
|
734
828
|
Object.keys(supportedEvents).forEach(function (eventName) {
|
|
735
|
-
var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
|
|
736
|
-
eventCallbackProps[eventCallbackPropName] = null;
|
|
737
|
-
// todo: refactor single value and single value icon to send payload from viz
|
|
829
|
+
var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
|
|
830
|
+
eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
|
|
738
831
|
// then remove these lines
|
|
832
|
+
|
|
739
833
|
var payloadKeys = supportedEvents[eventName].payloadKeys;
|
|
740
834
|
var payload = {};
|
|
835
|
+
|
|
741
836
|
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
742
837
|
payloadKeys.forEach(function (p) {
|
|
743
838
|
payload[p] = evaluatedOptionsToUse[p];
|
|
744
839
|
});
|
|
745
840
|
}
|
|
841
|
+
|
|
746
842
|
eventCallbackProps[eventCallbackPropName] = function (ev) {
|
|
747
843
|
if (ev && ev.payload) {
|
|
748
844
|
payload = ev.payload;
|
|
749
845
|
}
|
|
846
|
+
|
|
750
847
|
return onEventTrigger({
|
|
751
848
|
originalEvent: ev,
|
|
752
849
|
payload: payload,
|
|
@@ -754,8 +851,9 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
754
851
|
});
|
|
755
852
|
};
|
|
756
853
|
});
|
|
757
|
-
}
|
|
758
|
-
|
|
854
|
+
} // compute pure viz props which are not from options
|
|
855
|
+
|
|
856
|
+
|
|
759
857
|
var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
760
858
|
themeFunc: themeFunc
|
|
761
859
|
}));
|
|
@@ -773,21 +871,25 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
773
871
|
* In future, we could automatically detect which all datasources are being used
|
|
774
872
|
* and bind those magically to pagination/sorting behavior.
|
|
775
873
|
*/
|
|
874
|
+
|
|
776
875
|
var dataSourceMetadata = {};
|
|
777
876
|
var OptionKey = 'paginateDataSourceKey';
|
|
778
|
-
var paginateDataSourceKey = lodash_1.has(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
var
|
|
877
|
+
var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
878
|
+
|
|
879
|
+
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
|
|
880
|
+
var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
881
|
+
var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
882
|
+
|
|
782
883
|
var handleRequestParamsChange = function handleRequestParamsChange(payload) {
|
|
783
884
|
return onRequestParamsChange(paginateDataSourceKey, payload);
|
|
784
885
|
};
|
|
785
|
-
|
|
886
|
+
|
|
887
|
+
var sortParams = (0, getSorting_1.getSortingParams)({
|
|
786
888
|
requestParams: requestParams,
|
|
787
889
|
meta: meta,
|
|
788
890
|
onRequestParamsChange: handleRequestParamsChange
|
|
789
891
|
});
|
|
790
|
-
var paginatorParams = getPagination_1.getPaginationParams({
|
|
892
|
+
var paginatorParams = (0, getPagination_1.getPaginationParams)({
|
|
791
893
|
requestParams: requestParams,
|
|
792
894
|
meta: meta,
|
|
793
895
|
onRequestParamsChange: handleRequestParamsChange
|
|
@@ -796,106 +898,116 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
796
898
|
sortParams: sortParams,
|
|
797
899
|
paginatorParams: paginatorParams
|
|
798
900
|
};
|
|
799
|
-
}
|
|
800
|
-
|
|
901
|
+
} // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
|
|
902
|
+
|
|
903
|
+
|
|
801
904
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
802
905
|
return null;
|
|
803
906
|
}
|
|
907
|
+
|
|
804
908
|
return React.createElement(SanitizedReactViz, Object.assign({
|
|
805
909
|
mode: mode,
|
|
806
910
|
width: width,
|
|
807
911
|
height: height
|
|
808
912
|
}, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
|
|
809
913
|
};
|
|
914
|
+
|
|
810
915
|
DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
|
|
811
916
|
DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
|
|
812
917
|
// using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
|
|
813
918
|
theme: {}
|
|
814
|
-
});
|
|
815
|
-
|
|
816
|
-
DashboardViz.config = vizConfig;
|
|
817
|
-
|
|
818
|
-
return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
919
|
+
}); // attach viz config
|
|
920
|
+
|
|
921
|
+
DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
|
|
922
|
+
|
|
923
|
+
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
819
924
|
};
|
|
925
|
+
|
|
820
926
|
exports.default = withDashboardViz;
|
|
821
927
|
|
|
822
928
|
/***/ }),
|
|
823
|
-
/*
|
|
929
|
+
/* 76 */
|
|
824
930
|
/***/ (function(module, exports) {
|
|
825
931
|
|
|
826
932
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
827
933
|
|
|
828
934
|
/***/ }),
|
|
829
|
-
/*
|
|
935
|
+
/* 77 */
|
|
830
936
|
/***/ (function(module, exports) {
|
|
831
937
|
|
|
832
938
|
module.exports = require("@splunk/visualization-encoding/Options");
|
|
833
939
|
|
|
834
940
|
/***/ }),
|
|
835
|
-
/*
|
|
941
|
+
/* 78 */
|
|
836
942
|
/***/ (function(module, exports) {
|
|
837
943
|
|
|
838
944
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
839
945
|
|
|
840
946
|
/***/ }),
|
|
841
|
-
/*
|
|
947
|
+
/* 79 */
|
|
842
948
|
/***/ (function(module, exports) {
|
|
843
949
|
|
|
844
950
|
module.exports = require("@splunk/moment");
|
|
845
951
|
|
|
846
952
|
/***/ }),
|
|
847
|
-
/*
|
|
953
|
+
/* 80 */
|
|
848
954
|
/***/ (function(module, exports) {
|
|
849
955
|
|
|
850
956
|
module.exports = require("@splunk/visualization-context/FeatureFlagContext");
|
|
851
957
|
|
|
852
958
|
/***/ }),
|
|
853
|
-
/*
|
|
959
|
+
/* 81 */
|
|
854
960
|
/***/ (function(module, exports) {
|
|
855
961
|
|
|
856
962
|
module.exports = require("@splunk/visualizations-shared/hocUtils");
|
|
857
963
|
|
|
858
964
|
/***/ }),
|
|
859
|
-
/*
|
|
965
|
+
/* 82 */
|
|
860
966
|
/***/ (function(module, exports) {
|
|
861
967
|
|
|
862
968
|
module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
|
|
863
969
|
|
|
864
970
|
/***/ }),
|
|
865
|
-
/*
|
|
971
|
+
/* 83 */
|
|
866
972
|
/***/ (function(module, exports) {
|
|
867
973
|
|
|
868
974
|
module.exports = require("@splunk/async-dynamic-options-evaluator");
|
|
869
975
|
|
|
870
976
|
/***/ }),
|
|
871
|
-
/*
|
|
977
|
+
/* 84 */
|
|
872
978
|
/***/ (function(module, exports) {
|
|
873
979
|
|
|
874
980
|
module.exports = require("@splunk/ui-utils/id");
|
|
875
981
|
|
|
876
982
|
/***/ }),
|
|
877
|
-
/*
|
|
983
|
+
/* 85 */
|
|
878
984
|
/***/ (function(module, exports, __webpack_require__) {
|
|
879
985
|
|
|
880
986
|
"use strict";
|
|
881
987
|
|
|
882
988
|
|
|
883
989
|
var _defineProperty = __webpack_require__(8);
|
|
990
|
+
|
|
884
991
|
Object.defineProperty(exports, "__esModule", {
|
|
885
992
|
value: true
|
|
886
993
|
});
|
|
887
994
|
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
995
|
+
|
|
888
996
|
var T = __webpack_require__(1);
|
|
997
|
+
|
|
889
998
|
var lodash_1 = __webpack_require__(3);
|
|
890
|
-
|
|
999
|
+
|
|
1000
|
+
var DataSource_1 = __webpack_require__(86);
|
|
1001
|
+
|
|
891
1002
|
exports.SortParamsPropTypes = T.shape({
|
|
892
1003
|
currentSortKey: T.string,
|
|
893
1004
|
currentSortDir: T.oneOf(DataSource_1.validSortDirs),
|
|
894
1005
|
onSort: T.func
|
|
895
1006
|
});
|
|
1007
|
+
|
|
896
1008
|
var getSortingParams = function getSortingParams(_ref) {
|
|
897
1009
|
var requestParams = _ref.requestParams,
|
|
898
|
-
|
|
1010
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
899
1011
|
var currentSortKey;
|
|
900
1012
|
var currentSortDir;
|
|
901
1013
|
var nextSortDirMap = {
|
|
@@ -904,17 +1016,20 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
904
1016
|
none: 'asc'
|
|
905
1017
|
};
|
|
906
1018
|
var onSort;
|
|
1019
|
+
|
|
907
1020
|
if (typeof onRequestParamsChange === 'function') {
|
|
908
|
-
if (requestParams && lodash_1.has(requestParams, 'sort')) {
|
|
1021
|
+
if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
|
|
909
1022
|
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
910
1023
|
currentSortDir = requestParams.sort[currentSortKey];
|
|
911
|
-
}
|
|
912
|
-
|
|
1024
|
+
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
1025
|
+
|
|
1026
|
+
|
|
913
1027
|
onSort = function onSort(e, _ref2) {
|
|
914
1028
|
var sortKey = _ref2.sortKey,
|
|
915
|
-
|
|
1029
|
+
sortDir = _ref2.sortDir;
|
|
1030
|
+
|
|
916
1031
|
if (typeof sortKey === 'string') {
|
|
917
|
-
var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
1032
|
+
var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
918
1033
|
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
919
1034
|
offset: 0,
|
|
920
1035
|
sort: _defineProperty({}, sortKey, nextSortDir)
|
|
@@ -924,16 +1039,18 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
924
1039
|
}
|
|
925
1040
|
};
|
|
926
1041
|
}
|
|
1042
|
+
|
|
927
1043
|
return {
|
|
928
1044
|
currentSortKey: currentSortKey,
|
|
929
1045
|
currentSortDir: currentSortDir,
|
|
930
1046
|
onSort: onSort
|
|
931
1047
|
};
|
|
932
1048
|
};
|
|
1049
|
+
|
|
933
1050
|
exports.getSortingParams = getSortingParams;
|
|
934
1051
|
|
|
935
1052
|
/***/ }),
|
|
936
|
-
/*
|
|
1053
|
+
/* 86 */
|
|
937
1054
|
/***/ (function(module, exports, __webpack_require__) {
|
|
938
1055
|
|
|
939
1056
|
"use strict";
|
|
@@ -942,11 +1059,13 @@ exports.getSortingParams = getSortingParams;
|
|
|
942
1059
|
Object.defineProperty(exports, "__esModule", {
|
|
943
1060
|
value: true
|
|
944
1061
|
});
|
|
945
|
-
exports.validSortDirs = void 0;
|
|
1062
|
+
exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
|
|
946
1063
|
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1064
|
+
exports.validSegmentationModes = ['none', 'inner'];
|
|
1065
|
+
exports.validOutputModes = ['json_cols', 'json'];
|
|
947
1066
|
|
|
948
1067
|
/***/ }),
|
|
949
|
-
/*
|
|
1068
|
+
/* 87 */
|
|
950
1069
|
/***/ (function(module, exports, __webpack_require__) {
|
|
951
1070
|
|
|
952
1071
|
"use strict";
|
|
@@ -956,39 +1075,49 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
956
1075
|
value: true
|
|
957
1076
|
});
|
|
958
1077
|
exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
1078
|
+
|
|
959
1079
|
var T = __webpack_require__(1);
|
|
1080
|
+
|
|
960
1081
|
var lodash_1 = __webpack_require__(3);
|
|
1082
|
+
|
|
961
1083
|
exports.PaginatorParamsPropTypes = T.shape({
|
|
962
1084
|
isPaging: T.bool,
|
|
963
1085
|
current: T.number,
|
|
964
1086
|
totalPages: T.number,
|
|
965
1087
|
onChange: T.func
|
|
966
1088
|
});
|
|
1089
|
+
|
|
967
1090
|
var getPaginationParams = function getPaginationParams(_ref) {
|
|
968
1091
|
var requestParams = _ref.requestParams,
|
|
969
|
-
|
|
970
|
-
|
|
1092
|
+
meta = _ref.meta,
|
|
1093
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
971
1094
|
var totalCount = meta && meta.totalCount || 0;
|
|
972
1095
|
var offset = requestParams && requestParams.offset || 0;
|
|
973
1096
|
var count = requestParams && requestParams.count;
|
|
974
1097
|
var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
975
1098
|
var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
976
1099
|
var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
|
|
1100
|
+
|
|
977
1101
|
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
978
1102
|
var page = _ref2.page,
|
|
979
|
-
|
|
980
|
-
var newParams = lodash_1.cloneDeep(requestParams);
|
|
1103
|
+
countArg = _ref2.count;
|
|
1104
|
+
var newParams = (0, lodash_1.cloneDeep)(requestParams);
|
|
1105
|
+
|
|
981
1106
|
if (typeof countArg === 'number') {
|
|
982
1107
|
newParams.count = countArg;
|
|
983
1108
|
newParams.offset = 0;
|
|
984
1109
|
}
|
|
1110
|
+
|
|
985
1111
|
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
1112
|
+
|
|
986
1113
|
if (typeof page === 'number' && page > 0) {
|
|
987
1114
|
newParams.count = pageCount;
|
|
988
1115
|
newParams.offset = (page - 1) * pageCount;
|
|
989
1116
|
}
|
|
1117
|
+
|
|
990
1118
|
onRequestParamsChange(newParams);
|
|
991
1119
|
};
|
|
1120
|
+
|
|
992
1121
|
return {
|
|
993
1122
|
isPaging: isPaging,
|
|
994
1123
|
current: current,
|
|
@@ -996,10 +1125,11 @@ var getPaginationParams = function getPaginationParams(_ref) {
|
|
|
996
1125
|
onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
|
|
997
1126
|
};
|
|
998
1127
|
};
|
|
1128
|
+
|
|
999
1129
|
exports.getPaginationParams = getPaginationParams;
|
|
1000
1130
|
|
|
1001
1131
|
/***/ }),
|
|
1002
|
-
/*
|
|
1132
|
+
/* 88 */
|
|
1003
1133
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1004
1134
|
|
|
1005
1135
|
"use strict";
|
|
@@ -1009,7 +1139,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1009
1139
|
value: true
|
|
1010
1140
|
});
|
|
1011
1141
|
exports.useDeepMemo = void 0;
|
|
1142
|
+
|
|
1012
1143
|
var react_1 = __webpack_require__(0);
|
|
1144
|
+
|
|
1013
1145
|
var lodash_1 = __webpack_require__(3);
|
|
1014
1146
|
/**
|
|
1015
1147
|
* This hook evaluates and stores the result of a passed function and only
|
|
@@ -1024,20 +1156,25 @@ var lodash_1 = __webpack_require__(3);
|
|
|
1024
1156
|
* @param fn the function to be executed and
|
|
1025
1157
|
* @param dependencies an array of dependencies
|
|
1026
1158
|
*/
|
|
1159
|
+
|
|
1160
|
+
|
|
1027
1161
|
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
1028
|
-
var ref = react_1.useRef();
|
|
1029
|
-
|
|
1162
|
+
var ref = (0, react_1.useRef)();
|
|
1163
|
+
|
|
1164
|
+
if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
|
|
1030
1165
|
ref.current = {
|
|
1031
1166
|
dependencies: dependencies,
|
|
1032
1167
|
value: fn()
|
|
1033
1168
|
};
|
|
1034
1169
|
}
|
|
1170
|
+
|
|
1035
1171
|
return ref.current.value;
|
|
1036
1172
|
};
|
|
1173
|
+
|
|
1037
1174
|
exports.useDeepMemo = useDeepMemo;
|
|
1038
1175
|
|
|
1039
1176
|
/***/ }),
|
|
1040
|
-
/*
|
|
1177
|
+
/* 89 */
|
|
1041
1178
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1042
1179
|
|
|
1043
1180
|
"use strict";
|
|
@@ -1047,19 +1184,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1047
1184
|
value: true
|
|
1048
1185
|
});
|
|
1049
1186
|
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
1187
|
+
|
|
1050
1188
|
var React = __webpack_require__(0);
|
|
1189
|
+
|
|
1051
1190
|
var T = __webpack_require__(1);
|
|
1191
|
+
|
|
1052
1192
|
var i18n_1 = __webpack_require__(7);
|
|
1193
|
+
|
|
1053
1194
|
var Message_1 = __webpack_require__(18);
|
|
1054
|
-
|
|
1195
|
+
|
|
1196
|
+
var FixedSizeContainer_1 = __webpack_require__(32);
|
|
1055
1197
|
/**
|
|
1056
1198
|
* @method isMissing
|
|
1057
1199
|
* @param {any} v
|
|
1058
1200
|
* @returns {boolean} true if the input value === null or undefined
|
|
1059
1201
|
*/
|
|
1202
|
+
|
|
1203
|
+
|
|
1060
1204
|
var isMissing = function isMissing(v) {
|
|
1061
1205
|
return v === null || v === undefined;
|
|
1062
1206
|
};
|
|
1207
|
+
|
|
1063
1208
|
exports.isMissing = isMissing;
|
|
1064
1209
|
/**
|
|
1065
1210
|
* @method misskingKeys
|
|
@@ -1067,11 +1212,13 @@ exports.isMissing = isMissing;
|
|
|
1067
1212
|
* @param {object} target
|
|
1068
1213
|
* @returns {string[]} the keys of missing required props
|
|
1069
1214
|
*/
|
|
1215
|
+
|
|
1070
1216
|
var missingKeys = function missingKeys(keys, target) {
|
|
1071
1217
|
return keys.filter(function (k) {
|
|
1072
|
-
return exports.isMissing(target[k]);
|
|
1218
|
+
return (0, exports.isMissing)(target[k]);
|
|
1073
1219
|
});
|
|
1074
1220
|
};
|
|
1221
|
+
|
|
1075
1222
|
exports.missingKeys = missingKeys;
|
|
1076
1223
|
var propTypes = {
|
|
1077
1224
|
width: T.oneOfType([T.string, T.number]),
|
|
@@ -1085,33 +1232,35 @@ var propTypes = {
|
|
|
1085
1232
|
* @param {MissingPropsProps} props
|
|
1086
1233
|
* @returns {React.ReactElement}
|
|
1087
1234
|
*/
|
|
1235
|
+
|
|
1088
1236
|
var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
1089
1237
|
var width = props.width,
|
|
1090
|
-
|
|
1091
|
-
|
|
1238
|
+
height = props.height,
|
|
1239
|
+
missingProps = props.missingProps;
|
|
1092
1240
|
return React.createElement(Message_1.default, {
|
|
1093
1241
|
"data-test": "message",
|
|
1094
1242
|
width: width,
|
|
1095
1243
|
height: height,
|
|
1096
|
-
message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
|
|
1244
|
+
message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
|
|
1097
1245
|
});
|
|
1098
1246
|
};
|
|
1247
|
+
|
|
1099
1248
|
exports.MissingPropsMessage = MissingPropsMessage;
|
|
1100
1249
|
exports.MissingPropsMessage.propTypes = propTypes;
|
|
1101
1250
|
exports.MissingPropsMessage.defaultProps = {
|
|
1102
1251
|
width: '100%',
|
|
1103
1252
|
height: 250
|
|
1104
1253
|
};
|
|
1105
|
-
exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
1254
|
+
exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage);
|
|
1106
1255
|
|
|
1107
1256
|
/***/ }),
|
|
1108
|
-
/*
|
|
1257
|
+
/* 90 */
|
|
1109
1258
|
/***/ (function(module, exports) {
|
|
1110
1259
|
|
|
1111
1260
|
module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
|
|
1112
1261
|
|
|
1113
1262
|
/***/ }),
|
|
1114
|
-
/*
|
|
1263
|
+
/* 91 */
|
|
1115
1264
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1116
1265
|
|
|
1117
1266
|
"use strict";
|
|
@@ -1120,15 +1269,19 @@ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
|
|
|
1120
1269
|
Object.defineProperty(exports, "__esModule", {
|
|
1121
1270
|
value: true
|
|
1122
1271
|
});
|
|
1272
|
+
|
|
1123
1273
|
var React = __webpack_require__(0);
|
|
1274
|
+
|
|
1124
1275
|
var styled_components_1 = __webpack_require__(2);
|
|
1125
|
-
|
|
1276
|
+
|
|
1277
|
+
var hocUtils_1 = __webpack_require__(33);
|
|
1278
|
+
|
|
1126
1279
|
var Cover = styled_components_1.default.div.withConfig({
|
|
1127
1280
|
displayName: "withEditModeCover__Cover",
|
|
1128
1281
|
componentId: "sc-1gsbnxb-0"
|
|
1129
1282
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1130
1283
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1131
|
-
'data-splunk-visualization-version': "
|
|
1284
|
+
'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
|
|
1132
1285
|
}).withConfig({
|
|
1133
1286
|
displayName: "withEditModeCover__Blocker",
|
|
1134
1287
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -1139,6 +1292,7 @@ var Blocker = styled_components_1.default.div.attrs({
|
|
|
1139
1292
|
* @param {ExtendedDashViz} Visualization
|
|
1140
1293
|
* @returns {ExtendedDashViz} Wrapper
|
|
1141
1294
|
*/
|
|
1295
|
+
|
|
1142
1296
|
var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
|
|
1143
1297
|
var Wrapper = function Wrapper(props) {
|
|
1144
1298
|
var mode = props.mode;
|
|
@@ -1147,16 +1301,18 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
|
|
|
1147
1301
|
"data-test": "edit-mode-cover"
|
|
1148
1302
|
}));
|
|
1149
1303
|
};
|
|
1150
|
-
|
|
1304
|
+
|
|
1305
|
+
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
1151
1306
|
Wrapper: Wrapper,
|
|
1152
1307
|
Visualization: Visualization
|
|
1153
1308
|
});
|
|
1154
1309
|
return Wrapper;
|
|
1155
1310
|
};
|
|
1311
|
+
|
|
1156
1312
|
exports.default = withEditModeCover;
|
|
1157
1313
|
|
|
1158
1314
|
/***/ }),
|
|
1159
|
-
/*
|
|
1315
|
+
/* 92 */
|
|
1160
1316
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1161
1317
|
|
|
1162
1318
|
"use strict";
|
|
@@ -1165,27 +1321,37 @@ exports.default = withEditModeCover;
|
|
|
1165
1321
|
Object.defineProperty(exports, "__esModule", {
|
|
1166
1322
|
value: true
|
|
1167
1323
|
});
|
|
1324
|
+
|
|
1168
1325
|
var React = __webpack_require__(0);
|
|
1326
|
+
|
|
1169
1327
|
var colorUtils_1 = __webpack_require__(14);
|
|
1170
|
-
|
|
1171
|
-
var
|
|
1172
|
-
|
|
1173
|
-
var
|
|
1328
|
+
|
|
1329
|
+
var variables_1 = __webpack_require__(27);
|
|
1330
|
+
|
|
1331
|
+
var IconPlaceholder_1 = __webpack_require__(93);
|
|
1332
|
+
|
|
1333
|
+
var VizBehavior_1 = __webpack_require__(31);
|
|
1334
|
+
|
|
1335
|
+
var hocUtils_1 = __webpack_require__(33);
|
|
1336
|
+
|
|
1174
1337
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
1175
1338
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
1176
1339
|
var config = Visualization.config;
|
|
1177
1340
|
var themes = config.themes;
|
|
1341
|
+
|
|
1178
1342
|
var Wrapper = function Wrapper(props) {
|
|
1179
1343
|
var _a, _b;
|
|
1344
|
+
|
|
1180
1345
|
var dataSources = props.dataSources,
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1346
|
+
loading = props.loading,
|
|
1347
|
+
options = props.options,
|
|
1348
|
+
height = props.height,
|
|
1349
|
+
width = props.width;
|
|
1185
1350
|
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
1186
|
-
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);
|
|
1351
|
+
var bgColorFromTheme = (0, colorUtils_1.isColor)(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
|
|
1187
1352
|
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
1188
1353
|
var iconColor = variables_1.default.contentColorActive(props);
|
|
1354
|
+
|
|
1189
1355
|
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
1190
1356
|
return React.createElement(IconPlaceholder_1.default, {
|
|
1191
1357
|
"data-test": "icon-placeholder",
|
|
@@ -1196,18 +1362,21 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
1196
1362
|
iconColor: iconColor
|
|
1197
1363
|
});
|
|
1198
1364
|
}
|
|
1365
|
+
|
|
1199
1366
|
return React.createElement(Visualization, Object.assign({}, props));
|
|
1200
1367
|
};
|
|
1201
|
-
|
|
1368
|
+
|
|
1369
|
+
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
1202
1370
|
Wrapper: Wrapper,
|
|
1203
1371
|
Visualization: Visualization
|
|
1204
1372
|
});
|
|
1205
1373
|
return Wrapper;
|
|
1206
1374
|
};
|
|
1375
|
+
|
|
1207
1376
|
exports.default = withPlaceholder;
|
|
1208
1377
|
|
|
1209
1378
|
/***/ }),
|
|
1210
|
-
/*
|
|
1379
|
+
/* 93 */
|
|
1211
1380
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1212
1381
|
|
|
1213
1382
|
"use strict";
|
|
@@ -1217,26 +1386,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1217
1386
|
value: true
|
|
1218
1387
|
});
|
|
1219
1388
|
exports.shouldShowIconPlaceholder = void 0;
|
|
1389
|
+
|
|
1220
1390
|
var React = __webpack_require__(0);
|
|
1391
|
+
|
|
1221
1392
|
var T = __webpack_require__(1);
|
|
1393
|
+
|
|
1222
1394
|
var lodash_1 = __webpack_require__(3);
|
|
1395
|
+
|
|
1223
1396
|
var i18n_1 = __webpack_require__(7);
|
|
1397
|
+
|
|
1224
1398
|
var Message_1 = __webpack_require__(18);
|
|
1225
|
-
|
|
1399
|
+
|
|
1400
|
+
var FixedSizeContainer_1 = __webpack_require__(32);
|
|
1226
1401
|
/**
|
|
1227
1402
|
* @method shouldShowIconPlaceholder
|
|
1228
1403
|
* @param {object} dataSources
|
|
1229
1404
|
* @param {boolean} loading
|
|
1230
1405
|
* @returns {boolean}
|
|
1231
1406
|
*/
|
|
1407
|
+
|
|
1408
|
+
|
|
1232
1409
|
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
1233
1410
|
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1234
|
-
var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
|
|
1411
|
+
var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
|
|
1235
1412
|
var noData = data === undefined;
|
|
1236
|
-
var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
|
|
1413
|
+
var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields[0]', undefined);
|
|
1237
1414
|
var noFields = fields === undefined;
|
|
1238
1415
|
return loading || noData || noFields;
|
|
1239
1416
|
};
|
|
1417
|
+
|
|
1240
1418
|
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
1241
1419
|
var propTypes = {
|
|
1242
1420
|
icon: T.func,
|
|
@@ -1251,11 +1429,13 @@ var propTypes = {
|
|
|
1251
1429
|
* @param {IconPlaceholderProps} props
|
|
1252
1430
|
* @returns {React.ReactElement}
|
|
1253
1431
|
*/
|
|
1432
|
+
|
|
1254
1433
|
var IconPlaceholder = function IconPlaceholder(props) {
|
|
1255
1434
|
var width = props.width,
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1435
|
+
height = props.height,
|
|
1436
|
+
icon = props.icon,
|
|
1437
|
+
iconColor = props.iconColor;
|
|
1438
|
+
|
|
1259
1439
|
if (icon) {
|
|
1260
1440
|
return React.createElement(icon, {
|
|
1261
1441
|
style: {
|
|
@@ -1270,19 +1450,21 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
1270
1450
|
height: '50%'
|
|
1271
1451
|
});
|
|
1272
1452
|
}
|
|
1453
|
+
|
|
1273
1454
|
return React.createElement(Message_1.default, {
|
|
1274
1455
|
width: width,
|
|
1275
1456
|
height: height,
|
|
1276
1457
|
level: "warning",
|
|
1277
|
-
message: i18n_1._('No DataSource Connected')
|
|
1458
|
+
message: (0, i18n_1._)('No DataSource Connected')
|
|
1278
1459
|
});
|
|
1279
1460
|
};
|
|
1461
|
+
|
|
1280
1462
|
IconPlaceholder.propTypes = propTypes;
|
|
1281
1463
|
IconPlaceholder.defaultProps = {
|
|
1282
1464
|
width: '100%',
|
|
1283
1465
|
height: 250
|
|
1284
1466
|
};
|
|
1285
|
-
exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
1467
|
+
exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
|
|
1286
1468
|
|
|
1287
1469
|
/***/ })
|
|
1288
1470
|
/******/ ]);
|