@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
package/SingleValueIcon.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 = 470);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -116,57 +116,6 @@ module.exports = require("@splunk/visualizations-shared/Message");
|
|
|
116
116
|
/***/ 100:
|
|
117
117
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
118
118
|
|
|
119
|
-
"use strict";
|
|
120
|
-
__webpack_require__.r(__webpack_exports__);
|
|
121
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicMajorColorEditor", function() { return getDynamicMajorColorEditor; });
|
|
122
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
123
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
|
124
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22);
|
|
125
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
var getDynamicMajorColorEditor = function getDynamicMajorColorEditor(_ref) {
|
|
129
|
-
var defaultContext = _ref.defaultContext,
|
|
130
|
-
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
131
|
-
return {
|
|
132
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
|
|
133
|
-
option: 'majorColor',
|
|
134
|
-
context: 'majorColorEditorConfig',
|
|
135
|
-
editor: 'editor.dynamicColor',
|
|
136
|
-
showEditor: function showEditor(_ref2) {
|
|
137
|
-
var options = _ref2.options;
|
|
138
|
-
return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.majorColor);
|
|
139
|
-
},
|
|
140
|
-
editorProps: {
|
|
141
|
-
labelPosition: 'top',
|
|
142
|
-
flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: major value'),
|
|
143
|
-
formatters: [{
|
|
144
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
|
|
145
|
-
value: 'rangeValue',
|
|
146
|
-
defaults: {
|
|
147
|
-
majorValue: defaultContext.majorColorConfig
|
|
148
|
-
}
|
|
149
|
-
}, {
|
|
150
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Matches'),
|
|
151
|
-
value: 'matchValue',
|
|
152
|
-
defaults: {
|
|
153
|
-
majorValue: defaultContext.majorColorMatchConfig
|
|
154
|
-
}
|
|
155
|
-
}],
|
|
156
|
-
dataSelectors: [{
|
|
157
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
|
|
158
|
-
value: 'majorValue'
|
|
159
|
-
}],
|
|
160
|
-
defaultPalettesConfig: defaultPalettesConfig
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
/***/ }),
|
|
166
|
-
|
|
167
|
-
/***/ 101:
|
|
168
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
169
|
-
|
|
170
119
|
"use strict";
|
|
171
120
|
__webpack_require__.r(__webpack_exports__);
|
|
172
121
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicTrendColorEditor", function() { return getDynamicTrendColorEditor; });
|
|
@@ -178,7 +127,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
178
127
|
|
|
179
128
|
var getDynamicTrendColorEditor = function getDynamicTrendColorEditor(_ref) {
|
|
180
129
|
var defaultContext = _ref.defaultContext,
|
|
181
|
-
|
|
130
|
+
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
182
131
|
return {
|
|
183
132
|
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend value'),
|
|
184
133
|
option: 'trendColor',
|
|
@@ -209,7 +158,7 @@ var getDynamicTrendColorEditor = function getDynamicTrendColorEditor(_ref) {
|
|
|
209
158
|
|
|
210
159
|
/***/ }),
|
|
211
160
|
|
|
212
|
-
/***/
|
|
161
|
+
/***/ 101:
|
|
213
162
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
214
163
|
|
|
215
164
|
"use strict";
|
|
@@ -223,7 +172,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
223
172
|
|
|
224
173
|
var getDynamicBackgroundColorEditor = function getDynamicBackgroundColorEditor(_ref) {
|
|
225
174
|
var defaultContext = _ref.defaultContext,
|
|
226
|
-
|
|
175
|
+
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
227
176
|
return {
|
|
228
177
|
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Background'),
|
|
229
178
|
option: 'backgroundColor',
|
|
@@ -264,7 +213,7 @@ var getDynamicBackgroundColorEditor = function getDynamicBackgroundColorEditor(_
|
|
|
264
213
|
|
|
265
214
|
/***/ }),
|
|
266
215
|
|
|
267
|
-
/***/
|
|
216
|
+
/***/ 102:
|
|
268
217
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
269
218
|
|
|
270
219
|
"use strict";
|
|
@@ -315,7 +264,7 @@ var StaticMajorAndTrendLayout = [[{
|
|
|
315
264
|
|
|
316
265
|
/***/ }),
|
|
317
266
|
|
|
318
|
-
/***/
|
|
267
|
+
/***/ 103:
|
|
319
268
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
320
269
|
|
|
321
270
|
"use strict";
|
|
@@ -339,7 +288,7 @@ var StaticMajorColorEditor = {
|
|
|
339
288
|
|
|
340
289
|
/***/ }),
|
|
341
290
|
|
|
342
|
-
/***/
|
|
291
|
+
/***/ 104:
|
|
343
292
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
344
293
|
|
|
345
294
|
"use strict";
|
|
@@ -367,7 +316,7 @@ var StaticTrendColorEditor = {
|
|
|
367
316
|
|
|
368
317
|
/***/ }),
|
|
369
318
|
|
|
370
|
-
/***/
|
|
319
|
+
/***/ 105:
|
|
371
320
|
/***/ (function(module, exports, __webpack_require__) {
|
|
372
321
|
|
|
373
322
|
"use strict";
|
|
@@ -377,13 +326,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
377
326
|
value: true
|
|
378
327
|
});
|
|
379
328
|
exports.TrellisBackgroundColorEditor = exports.TrellisEditorConfig = void 0;
|
|
329
|
+
|
|
380
330
|
var React = __webpack_require__(1);
|
|
331
|
+
|
|
381
332
|
var i18n_1 = __webpack_require__(2);
|
|
333
|
+
|
|
382
334
|
var FeatureFlagContext_1 = __webpack_require__(21);
|
|
335
|
+
|
|
383
336
|
var layoutUtils_1 = __webpack_require__(58);
|
|
384
337
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
338
|
+
|
|
339
|
+
|
|
385
340
|
exports.TrellisEditorConfig = [[{
|
|
386
|
-
label: i18n_1._('Trellis layout'),
|
|
341
|
+
label: (0, i18n_1._)('Trellis layout'),
|
|
387
342
|
option: 'splitByLayout',
|
|
388
343
|
editor: 'editor.toggle',
|
|
389
344
|
showEditor: function showEditor() {
|
|
@@ -392,7 +347,7 @@ exports.TrellisEditorConfig = [[{
|
|
|
392
347
|
return isTrellisFeatureFlagOn;
|
|
393
348
|
}
|
|
394
349
|
}], [{
|
|
395
|
-
label: i18n_1._('Split by'),
|
|
350
|
+
label: (0, i18n_1._)('Split by'),
|
|
396
351
|
option: 'trellisSplitBy',
|
|
397
352
|
editor: 'editor.trellisSplitBy',
|
|
398
353
|
editorProps: {
|
|
@@ -405,13 +360,13 @@ exports.TrellisEditorConfig = [[{
|
|
|
405
360
|
return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
|
|
406
361
|
}
|
|
407
362
|
}], [{
|
|
408
|
-
label: i18n_1._('Number of columns'),
|
|
363
|
+
label: (0, i18n_1._)('Number of columns'),
|
|
409
364
|
option: 'trellisColumns',
|
|
410
365
|
editor: 'editor.number',
|
|
411
366
|
editorProps: {
|
|
412
367
|
min: 1
|
|
413
368
|
},
|
|
414
|
-
placeholder: i18n_1._('Auto'),
|
|
369
|
+
placeholder: (0, i18n_1._)('Auto'),
|
|
415
370
|
showEditor: function showEditor(_ref2) {
|
|
416
371
|
var options = _ref2.options;
|
|
417
372
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
@@ -419,7 +374,7 @@ exports.TrellisEditorConfig = [[{
|
|
|
419
374
|
return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
|
|
420
375
|
}
|
|
421
376
|
}], [{
|
|
422
|
-
label: i18n_1._('Min column width'),
|
|
377
|
+
label: (0, i18n_1._)('Min column width'),
|
|
423
378
|
option: 'trellisMinColumnWidth',
|
|
424
379
|
editor: 'editor.number',
|
|
425
380
|
editorProps: {
|
|
@@ -432,7 +387,7 @@ exports.TrellisEditorConfig = [[{
|
|
|
432
387
|
return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
|
|
433
388
|
}
|
|
434
389
|
}, {
|
|
435
|
-
label: i18n_1._('Row height'),
|
|
390
|
+
label: (0, i18n_1._)('Row height'),
|
|
436
391
|
option: 'trellisRowHeight',
|
|
437
392
|
editor: 'editor.number',
|
|
438
393
|
editorProps: {
|
|
@@ -445,7 +400,7 @@ exports.TrellisEditorConfig = [[{
|
|
|
445
400
|
return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
|
|
446
401
|
}
|
|
447
402
|
}], [{
|
|
448
|
-
label: i18n_1._('Max number of components per page'),
|
|
403
|
+
label: (0, i18n_1._)('Max number of components per page'),
|
|
449
404
|
option: 'trellisPageCount',
|
|
450
405
|
editor: 'editor.number',
|
|
451
406
|
editorProps: {
|
|
@@ -459,7 +414,7 @@ exports.TrellisEditorConfig = [[{
|
|
|
459
414
|
}
|
|
460
415
|
}]];
|
|
461
416
|
exports.TrellisBackgroundColorEditor = {
|
|
462
|
-
label: i18n_1._('Trellis background'),
|
|
417
|
+
label: (0, i18n_1._)('Trellis background'),
|
|
463
418
|
option: 'trellisBackgroundColor',
|
|
464
419
|
editor: 'editor.color',
|
|
465
420
|
showEditor: function showEditor(_ref6) {
|
|
@@ -472,51 +427,74 @@ exports.TrellisBackgroundColorEditor = {
|
|
|
472
427
|
|
|
473
428
|
/***/ }),
|
|
474
429
|
|
|
475
|
-
/***/
|
|
430
|
+
/***/ 106:
|
|
476
431
|
/***/ (function(module, exports, __webpack_require__) {
|
|
477
432
|
|
|
478
433
|
"use strict";
|
|
479
434
|
|
|
480
435
|
|
|
481
436
|
var _slicedToArray = __webpack_require__(17);
|
|
437
|
+
|
|
482
438
|
var __rest = this && this.__rest || function (s, e) {
|
|
483
439
|
var t = {};
|
|
440
|
+
|
|
484
441
|
for (var p in s) {
|
|
485
442
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
486
443
|
}
|
|
444
|
+
|
|
487
445
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
488
446
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
489
447
|
}
|
|
490
448
|
return t;
|
|
491
449
|
};
|
|
450
|
+
|
|
492
451
|
Object.defineProperty(exports, "__esModule", {
|
|
493
452
|
value: true
|
|
494
453
|
});
|
|
454
|
+
|
|
495
455
|
var React = __webpack_require__(1);
|
|
456
|
+
|
|
496
457
|
var react_1 = __webpack_require__(1);
|
|
458
|
+
|
|
497
459
|
var lodash_1 = __webpack_require__(3);
|
|
460
|
+
|
|
498
461
|
var styled_components_1 = __webpack_require__(4);
|
|
499
|
-
|
|
462
|
+
|
|
463
|
+
var Paginator_1 = __webpack_require__(94);
|
|
464
|
+
|
|
500
465
|
var i18n_1 = __webpack_require__(2);
|
|
501
|
-
|
|
466
|
+
|
|
467
|
+
var themes_1 = __webpack_require__(60);
|
|
468
|
+
|
|
502
469
|
var useSplunkTheme_1 = __webpack_require__(57);
|
|
470
|
+
|
|
503
471
|
var FeatureFlagContext_1 = __webpack_require__(21);
|
|
472
|
+
|
|
504
473
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
474
|
+
|
|
505
475
|
var style_1 = __webpack_require__(14);
|
|
476
|
+
|
|
506
477
|
var Message_1 = __webpack_require__(10);
|
|
507
|
-
|
|
508
|
-
var
|
|
509
|
-
|
|
510
|
-
var
|
|
511
|
-
|
|
478
|
+
|
|
479
|
+
var trellisUtils_1 = __webpack_require__(84);
|
|
480
|
+
|
|
481
|
+
var hocUtils_1 = __webpack_require__(27);
|
|
482
|
+
|
|
483
|
+
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
484
|
+
|
|
485
|
+
var Options_1 = __webpack_require__(30);
|
|
486
|
+
|
|
487
|
+
var trellisUtils_2 = __webpack_require__(107);
|
|
488
|
+
|
|
512
489
|
var layoutUtils_1 = __webpack_require__(58);
|
|
490
|
+
|
|
513
491
|
var TrellisContainer = styled_components_1.default.div.withConfig({
|
|
514
492
|
displayName: "withTrellis__TrellisContainer",
|
|
515
493
|
componentId: "pjmeig-0"
|
|
516
494
|
})(["overflow:hidden;display:flex;flex-direction:column;background-color:", ";", ";> [data-test='paginator']{align-self:flex-end;margin-bottom:10px;}"], function (props) {
|
|
517
495
|
return props.backgroundColor;
|
|
518
496
|
}, function (props) {
|
|
519
|
-
return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
|
|
497
|
+
return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
|
|
520
498
|
});
|
|
521
499
|
var TrellisContainerGrid = styled_components_1.default.div.withConfig({
|
|
522
500
|
displayName: "withTrellis__TrellisContainerGrid",
|
|
@@ -530,79 +508,91 @@ var TrellisContainerGrid = styled_components_1.default.div.withConfig({
|
|
|
530
508
|
}, function (props) {
|
|
531
509
|
return "".concat(props.rowHeight, "px");
|
|
532
510
|
});
|
|
511
|
+
|
|
533
512
|
var showErrorMessage = function showErrorMessage(errorCode, width, height) {
|
|
534
513
|
if (errorCode === 'INVALID_SPLIT_BY_FIELD') {
|
|
535
514
|
return React.createElement(Message_1.default, {
|
|
536
515
|
width: width,
|
|
537
516
|
height: height,
|
|
538
|
-
message: i18n_1._('Select a valid trellis split by field'),
|
|
517
|
+
message: (0, i18n_1._)('Select a valid trellis split by field'),
|
|
539
518
|
level: "info"
|
|
540
519
|
});
|
|
541
520
|
}
|
|
521
|
+
|
|
542
522
|
if (errorCode === 'UNKNOWN_DATA_SPLIT_MODE') {
|
|
543
523
|
return React.createElement(Message_1.default, {
|
|
544
524
|
width: width,
|
|
545
525
|
height: height,
|
|
546
|
-
message: i18n_1._('Unknown data split mode'),
|
|
526
|
+
message: (0, i18n_1._)('Unknown data split mode'),
|
|
547
527
|
level: "info"
|
|
548
528
|
});
|
|
549
529
|
}
|
|
530
|
+
|
|
550
531
|
return React.createElement(Message_1.default, {
|
|
551
532
|
width: width,
|
|
552
533
|
height: height,
|
|
553
|
-
message: i18n_1._('Error render in trellis'),
|
|
534
|
+
message: (0, i18n_1._)('Error render in trellis'),
|
|
554
535
|
level: "info"
|
|
555
536
|
});
|
|
556
537
|
};
|
|
538
|
+
|
|
557
539
|
var withTrellis = function withTrellis(Viz) {
|
|
558
540
|
var VizWithTrellis = function VizWithTrellis(opts) {
|
|
559
541
|
var _opts$options = opts.options,
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
var
|
|
542
|
+
options = _opts$options === void 0 ? {} : _opts$options,
|
|
543
|
+
height = opts.height,
|
|
544
|
+
width = opts.width,
|
|
545
|
+
otherProps = __rest(opts, ["options", "height", "width"]);
|
|
546
|
+
|
|
547
|
+
var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(Viz.config.optionsSchema, 'default');
|
|
548
|
+
var mergedOptions = (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions);
|
|
566
549
|
var trellisColumns = mergedOptions.trellisColumns,
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
550
|
+
trellisPageCount = mergedOptions.trellisPageCount,
|
|
551
|
+
trellisMinColumnWidth = mergedOptions.trellisMinColumnWidth,
|
|
552
|
+
trellisRowHeight = mergedOptions.trellisRowHeight,
|
|
553
|
+
splitByLayout = mergedOptions.splitByLayout,
|
|
554
|
+
trellisSplitBy = mergedOptions.trellisSplitBy;
|
|
572
555
|
var colCount = trellisColumns > 0 ? trellisColumns : defaultOptions.trellisColumns;
|
|
573
556
|
var pageCount = +trellisPageCount > 0 ? +trellisPageCount : defaultOptions.trellisPageCount;
|
|
574
557
|
var colMinWidth = trellisMinColumnWidth > 0 ? trellisMinColumnWidth : defaultOptions.trellisMinColumnWidth;
|
|
575
558
|
var rowHeight = trellisRowHeight > 0 ? trellisRowHeight : defaultOptions.trellisRowHeight;
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
559
|
+
|
|
560
|
+
var _ref = (0, react_1.useState)(1),
|
|
561
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
562
|
+
pageNum = _ref2[0],
|
|
563
|
+
setPageNum = _ref2[1];
|
|
564
|
+
|
|
565
|
+
var _ref3 = (0, react_1.useState)(null),
|
|
566
|
+
_ref4 = _slicedToArray(_ref3, 2),
|
|
567
|
+
pagedData = _ref4[0],
|
|
568
|
+
setPagedData = _ref4[1];
|
|
569
|
+
|
|
584
570
|
var splitByKeys = [];
|
|
585
571
|
var totalPages = 0;
|
|
586
572
|
var showPaginator = false;
|
|
587
573
|
var dataSources = otherProps.dataSources;
|
|
588
574
|
var theme = {
|
|
589
|
-
splunkThemeV1: useSplunkTheme_1.default()
|
|
575
|
+
splunkThemeV1: (0, useSplunkTheme_1.default)()
|
|
590
576
|
};
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
577
|
+
|
|
578
|
+
var _ref5 = (0, themes_1.getSettingsFromThemedProps)({
|
|
579
|
+
theme: theme
|
|
580
|
+
}),
|
|
581
|
+
currentThemeFamily = _ref5.family,
|
|
582
|
+
currentThemeColorScheme = _ref5.colorScheme,
|
|
583
|
+
currentThemeDensity = _ref5.density;
|
|
584
|
+
|
|
585
|
+
var trellisBackgroundColor = (0, react_1.useMemo)(function () {
|
|
598
586
|
var themeFunc = function themeFunc(themeVar) {
|
|
599
587
|
var _a, _b;
|
|
588
|
+
|
|
600
589
|
return (_b = (_a = Viz.config.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
601
590
|
trellisBackgroundColor: mergedOptions.trellisBackgroundColor,
|
|
602
591
|
theme: theme
|
|
603
592
|
});
|
|
604
|
-
};
|
|
605
|
-
|
|
593
|
+
}; // trellisBackgroundColor option supports only static coloring and DSL option evaluation derived from the themes level only.
|
|
594
|
+
|
|
595
|
+
|
|
606
596
|
var evaluated = Options_1.Options.evaluate({
|
|
607
597
|
context: Viz.config.context,
|
|
608
598
|
options: {
|
|
@@ -611,10 +601,11 @@ var withTrellis = function withTrellis(Viz) {
|
|
|
611
601
|
}, {}, themeFunc);
|
|
612
602
|
return evaluated.trellisBackgroundColor;
|
|
613
603
|
}, [mergedOptions.trellisBackgroundColor, currentThemeFamily, currentThemeColorScheme, currentThemeDensity]);
|
|
614
|
-
var columns = lodash_1.get(dataSources, 'primary.data.columns', undefined);
|
|
615
|
-
var fields = lodash_1.get(dataSources, 'primary.data.fields', undefined);
|
|
604
|
+
var columns = (0, lodash_1.get)(dataSources, 'primary.data.columns', undefined);
|
|
605
|
+
var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields', undefined);
|
|
616
606
|
var noColumns = columns === undefined;
|
|
617
607
|
var noFields = fields === undefined;
|
|
608
|
+
|
|
618
609
|
var updateDataDisplay = function updateDataDisplay(currPage) {
|
|
619
610
|
if (!showPaginator) {
|
|
620
611
|
setPagedData(splitByKeys);
|
|
@@ -625,51 +616,61 @@ var withTrellis = function withTrellis(Viz) {
|
|
|
625
616
|
setPagedData(paged);
|
|
626
617
|
}
|
|
627
618
|
};
|
|
628
|
-
|
|
619
|
+
|
|
620
|
+
(0, react_1.useEffect)(function () {
|
|
629
621
|
setPageNum(1);
|
|
630
622
|
updateDataDisplay(1);
|
|
631
623
|
}, [pageCount, trellisSplitBy]);
|
|
632
|
-
react_1.useEffect(function () {
|
|
624
|
+
(0, react_1.useEffect)(function () {
|
|
633
625
|
updateDataDisplay(pageNum);
|
|
634
626
|
}, [columns, fields, trellisSplitBy, pageNum, splitByLayout]);
|
|
635
|
-
var handlePageChange = react_1.useCallback(function (event,
|
|
636
|
-
var page =
|
|
627
|
+
var handlePageChange = (0, react_1.useCallback)(function (event, _ref6) {
|
|
628
|
+
var page = _ref6.page;
|
|
637
629
|
setPageNum(page);
|
|
638
630
|
}, [pageNum, pagedData]);
|
|
639
631
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
640
632
|
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
633
|
+
|
|
641
634
|
if (!isTrellisFeatureFlagOn || !splitByLayout || splitByLayout !== layoutUtils_1.LAYOUT_TYPE.Trellis) {
|
|
642
635
|
return React.createElement(Viz, Object.assign({}, opts));
|
|
643
636
|
}
|
|
637
|
+
|
|
644
638
|
if (splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis) {
|
|
645
639
|
if (noColumns || noFields) {
|
|
646
640
|
return React.createElement(Message_1.default, {
|
|
647
641
|
width: width,
|
|
648
642
|
height: height,
|
|
649
|
-
message: i18n_1._('Loading'),
|
|
643
|
+
message: (0, i18n_1._)('Loading'),
|
|
650
644
|
level: "info"
|
|
651
645
|
});
|
|
652
|
-
}
|
|
653
|
-
// If no trellisSplitBy value is passed in, assign default trellisSplitBy
|
|
646
|
+
} // If no trellisSplitBy value is passed in, assign default trellisSplitBy
|
|
654
647
|
// The default value will be the first value in the individual splitBy field list or 'aggregations'
|
|
648
|
+
|
|
649
|
+
|
|
655
650
|
var currTrellisSplitBy = trellisSplitBy;
|
|
651
|
+
|
|
656
652
|
if (!trellisSplitBy || trellisSplitBy.length === 0) {
|
|
657
|
-
var splitByPossibleFields = trellisUtils_1.getAllPossibleSplitByFields(fields);
|
|
653
|
+
var splitByPossibleFields = (0, trellisUtils_1.getAllPossibleSplitByFields)(fields);
|
|
658
654
|
currTrellisSplitBy = splitByPossibleFields.fields && splitByPossibleFields.fields.length ? splitByPossibleFields.fields[0] : trellisUtils_2.AGGREGATIONS;
|
|
659
655
|
}
|
|
660
|
-
|
|
661
|
-
var
|
|
656
|
+
|
|
657
|
+
var splitMode = (0, trellisUtils_1.getTrellisDataSplitterMode)(fields);
|
|
658
|
+
var dataSplitResult = (0, trellisUtils_2.getTrellisDataSourcesBySplitMode)(splitMode, dataSources, currTrellisSplitBy);
|
|
662
659
|
var modifiedDataSourceBySplitBy = dataSplitResult === null || dataSplitResult === void 0 ? void 0 : dataSplitResult.splitDataSources;
|
|
663
660
|
var dataSplitErrorCode = dataSplitResult === null || dataSplitResult === void 0 ? void 0 : dataSplitResult.errorCode;
|
|
661
|
+
|
|
664
662
|
if (!modifiedDataSourceBySplitBy || Object.keys(modifiedDataSourceBySplitBy).length === 0 || dataSplitErrorCode) {
|
|
665
663
|
return showErrorMessage(dataSplitErrorCode, width, height);
|
|
666
664
|
}
|
|
665
|
+
|
|
667
666
|
var splitByKeysModified = modifiedDataSourceBySplitBy ? Object.keys(modifiedDataSourceBySplitBy) : [];
|
|
667
|
+
|
|
668
668
|
if (splitByKeysModified) {
|
|
669
669
|
showPaginator = splitByKeysModified.length > pageCount;
|
|
670
670
|
splitByKeys = splitByKeysModified;
|
|
671
671
|
totalPages = splitByKeysModified ? Math.ceil(splitByKeysModified.length / pageCount) : 0;
|
|
672
672
|
}
|
|
673
|
+
|
|
673
674
|
return React.createElement(TrellisContainer, {
|
|
674
675
|
height: height,
|
|
675
676
|
width: width,
|
|
@@ -684,10 +685,10 @@ var withTrellis = function withTrellis(Viz) {
|
|
|
684
685
|
className: "child",
|
|
685
686
|
"data-test": "trellis-child",
|
|
686
687
|
key: "div-child-".concat(idx.toString())
|
|
687
|
-
}, React.createElement(SizeAwareWrapper_1.default, null, function (
|
|
688
|
-
var childWidth =
|
|
689
|
-
|
|
690
|
-
|
|
688
|
+
}, React.createElement(SizeAwareWrapper_1.default, null, function (_ref7) {
|
|
689
|
+
var childWidth = _ref7.childWidth,
|
|
690
|
+
_ref7$childHeight = _ref7.childHeight,
|
|
691
|
+
childHeight = _ref7$childHeight === void 0 ? rowHeight : _ref7$childHeight;
|
|
691
692
|
return React.createElement(Viz, Object.assign({}, otherProps, {
|
|
692
693
|
trellisKey: splitByKey,
|
|
693
694
|
trellisSplitBy: currTrellisSplitBy,
|
|
@@ -705,30 +706,37 @@ var withTrellis = function withTrellis(Viz) {
|
|
|
705
706
|
totalPages: totalPages
|
|
706
707
|
}));
|
|
707
708
|
}
|
|
709
|
+
|
|
708
710
|
return null;
|
|
709
711
|
};
|
|
712
|
+
|
|
710
713
|
VizWithTrellis.propTypes = Viz.proptypes;
|
|
711
714
|
VizWithTrellis.defaultProps = Viz.defaultProps;
|
|
712
715
|
VizWithTrellis.config = Viz.config;
|
|
713
716
|
return VizWithTrellis;
|
|
714
717
|
};
|
|
718
|
+
|
|
715
719
|
exports.default = withTrellis;
|
|
716
720
|
|
|
717
721
|
/***/ }),
|
|
718
722
|
|
|
719
|
-
/***/
|
|
723
|
+
/***/ 107:
|
|
720
724
|
/***/ (function(module, exports, __webpack_require__) {
|
|
721
725
|
|
|
722
726
|
"use strict";
|
|
723
727
|
|
|
724
728
|
|
|
725
729
|
var _toConsumableArray = __webpack_require__(8);
|
|
730
|
+
|
|
726
731
|
Object.defineProperty(exports, "__esModule", {
|
|
727
732
|
value: true
|
|
728
733
|
});
|
|
729
734
|
exports.getTrellisDataSourcesBySplitMode = exports.dataSourcesSplitByModeStatsorUnknown = exports.dataSourcesSplitByModeChart = exports.dataSourcesSplitByModeTimechart = exports.dataSourcesSplitByAggregationsStats = exports.dataSourcesSplitByAggregationsTimechartAndChart = exports.dataSourcesSplitByAggregationsUnknown = exports.AGGREGATIONS = void 0;
|
|
735
|
+
|
|
730
736
|
var lodash_1 = __webpack_require__(3);
|
|
731
|
-
|
|
737
|
+
|
|
738
|
+
var trellisUtils_1 = __webpack_require__(84);
|
|
739
|
+
|
|
732
740
|
exports.AGGREGATIONS = 'aggregations';
|
|
733
741
|
/**
|
|
734
742
|
* There can be certain SPL cmds that can produce dataSource without a specific field meta info (like group_by_rank, split_by_field etc),
|
|
@@ -738,18 +746,23 @@ exports.AGGREGATIONS = 'aggregations';
|
|
|
738
746
|
* Example3:- `index = "_internal" | stats count`
|
|
739
747
|
* Example4:- `index=_internal | stats avg(count), max(count)`
|
|
740
748
|
*/
|
|
749
|
+
|
|
741
750
|
var dataSourcesSplitByAggregationsUnknown = function dataSourcesSplitByAggregationsUnknown(dataSource) {
|
|
742
751
|
var _a, _b, _c, _d;
|
|
752
|
+
|
|
743
753
|
var fields = (_b = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.fields;
|
|
744
754
|
var columns = (_d = (_c = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns;
|
|
745
755
|
var splitDataSources = null;
|
|
746
756
|
var errorCode = null;
|
|
757
|
+
|
|
747
758
|
if (fields && fields.length) {
|
|
748
759
|
splitDataSources = {};
|
|
760
|
+
|
|
749
761
|
for (var i = 0; i < fields.length; i += 1) {
|
|
750
762
|
var fieldName = fields[i].name;
|
|
763
|
+
|
|
751
764
|
if (!(fieldName === null || fieldName === void 0 ? void 0 : fieldName.startsWith('_'))) {
|
|
752
|
-
splitDataSources[fieldName] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
765
|
+
splitDataSources[fieldName] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
753
766
|
splitDataSources[fieldName].primary.data.fields = [fields[i]];
|
|
754
767
|
splitDataSources[fieldName].primary.data.columns = [columns[i]];
|
|
755
768
|
}
|
|
@@ -757,30 +770,37 @@ var dataSourcesSplitByAggregationsUnknown = function dataSourcesSplitByAggregati
|
|
|
757
770
|
} else {
|
|
758
771
|
errorCode = 'INVALID_SPLIT_BY_FIELD';
|
|
759
772
|
}
|
|
773
|
+
|
|
760
774
|
return {
|
|
761
775
|
splitDataSources: splitDataSources,
|
|
762
776
|
errorCode: errorCode
|
|
763
777
|
};
|
|
764
778
|
};
|
|
779
|
+
|
|
765
780
|
exports.dataSourcesSplitByAggregationsUnknown = dataSourcesSplitByAggregationsUnknown;
|
|
781
|
+
|
|
766
782
|
var dataSourcesSplitByAggregationsTimechartAndChart = function dataSourcesSplitByAggregationsTimechartAndChart(dataSource) {
|
|
767
783
|
var _a, _b, _c, _d;
|
|
784
|
+
|
|
768
785
|
var fields = (_b = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.fields;
|
|
769
786
|
var columns = (_d = (_c = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns;
|
|
770
787
|
var splitDataSources = null;
|
|
771
788
|
var splitByFields = [];
|
|
772
789
|
var errorCode = null;
|
|
790
|
+
|
|
773
791
|
if (typeof fields[0] !== 'string') {
|
|
774
|
-
splitByFields = trellisUtils_1.extractDataSourceAggregationKeysChart(fields);
|
|
792
|
+
splitByFields = (0, trellisUtils_1.extractDataSourceAggregationKeysChart)(fields);
|
|
775
793
|
}
|
|
794
|
+
|
|
776
795
|
if (splitByFields && splitByFields.length > 0) {
|
|
777
796
|
splitDataSources = {};
|
|
778
797
|
splitByFields.forEach(function (splitByField) {
|
|
779
|
-
splitDataSources[splitByField] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
798
|
+
splitDataSources[splitByField] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
780
799
|
splitDataSources[splitByField].primary.data.fields = [fields[0]];
|
|
781
800
|
splitDataSources[splitByField].primary.data.columns = [columns[0]];
|
|
782
801
|
fields.forEach(function (field, idx) {
|
|
783
802
|
var fieldName = field === null || field === void 0 ? void 0 : field.name;
|
|
803
|
+
|
|
784
804
|
if (fieldName !== '_time' && !(fieldName === null || fieldName === void 0 ? void 0 : fieldName.startsWith('_')) && field.data_source === splitByField) {
|
|
785
805
|
splitDataSources[splitByField].primary.data.fields.push(field);
|
|
786
806
|
splitDataSources[splitByField].primary.data.columns.push(columns[idx]);
|
|
@@ -792,10 +812,12 @@ var dataSourcesSplitByAggregationsTimechartAndChart = function dataSourcesSplitB
|
|
|
792
812
|
// example1 :- index=_internal | timechart count
|
|
793
813
|
// example2 :- index=_internal | timechart max(count) avg(count)
|
|
794
814
|
splitDataSources = {};
|
|
815
|
+
|
|
795
816
|
for (var i = 1; i < fields.length; i += 1) {
|
|
796
817
|
var fieldName = fields[i].name;
|
|
818
|
+
|
|
797
819
|
if (!(fieldName === null || fieldName === void 0 ? void 0 : fieldName.startsWith('_'))) {
|
|
798
|
-
splitDataSources[fieldName] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
820
|
+
splitDataSources[fieldName] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
799
821
|
splitDataSources[fieldName].primary.data.fields = [fields[0], fields[i]];
|
|
800
822
|
splitDataSources[fieldName].primary.data.columns = [columns[0], columns[i]];
|
|
801
823
|
}
|
|
@@ -803,31 +825,38 @@ var dataSourcesSplitByAggregationsTimechartAndChart = function dataSourcesSplitB
|
|
|
803
825
|
} else {
|
|
804
826
|
errorCode = 'INVALID_SPLIT_BY_FIELD';
|
|
805
827
|
}
|
|
828
|
+
|
|
806
829
|
return {
|
|
807
830
|
splitDataSources: splitDataSources,
|
|
808
831
|
errorCode: errorCode
|
|
809
832
|
};
|
|
810
833
|
};
|
|
834
|
+
|
|
811
835
|
exports.dataSourcesSplitByAggregationsTimechartAndChart = dataSourcesSplitByAggregationsTimechartAndChart;
|
|
836
|
+
|
|
812
837
|
var dataSourcesSplitByAggregationsStats = function dataSourcesSplitByAggregationsStats(dataSource) {
|
|
813
838
|
var _a, _b, _c, _d;
|
|
839
|
+
|
|
814
840
|
var fields = (_b = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.fields;
|
|
815
841
|
var columns = (_d = (_c = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns;
|
|
816
842
|
var splitDataSources = null;
|
|
817
843
|
var splitByFields = [];
|
|
818
844
|
var errorCode = null;
|
|
845
|
+
|
|
819
846
|
if (typeof fields[0] !== 'string') {
|
|
820
|
-
splitByFields = trellisUtils_1.extractDataSourceAggregationKeysStats(fields);
|
|
847
|
+
splitByFields = (0, trellisUtils_1.extractDataSourceAggregationKeysStats)(fields);
|
|
821
848
|
}
|
|
849
|
+
|
|
822
850
|
if (splitByFields && splitByFields.length > 0) {
|
|
823
851
|
splitDataSources = {};
|
|
824
852
|
splitByFields.forEach(function (splitByField) {
|
|
825
|
-
splitDataSources[splitByField] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
853
|
+
splitDataSources[splitByField] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
826
854
|
splitDataSources[splitByField].primary.data.fields = [fields[0]];
|
|
827
855
|
splitDataSources[splitByField].primary.data.columns = [columns[0]];
|
|
828
856
|
var idx = fields.findIndex(function (field) {
|
|
829
857
|
return field.name === splitByField;
|
|
830
858
|
});
|
|
859
|
+
|
|
831
860
|
if (idx > 0) {
|
|
832
861
|
splitDataSources[splitByField].primary.data.fields.push(fields[idx]);
|
|
833
862
|
splitDataSources[splitByField].primary.data.columns.push(columns[idx]);
|
|
@@ -836,34 +865,42 @@ var dataSourcesSplitByAggregationsStats = function dataSourcesSplitByAggregation
|
|
|
836
865
|
} else {
|
|
837
866
|
errorCode = 'INVALID_SPLIT_BY_FIELD';
|
|
838
867
|
}
|
|
868
|
+
|
|
839
869
|
return {
|
|
840
870
|
splitDataSources: splitDataSources,
|
|
841
871
|
errorCode: errorCode
|
|
842
872
|
};
|
|
843
873
|
};
|
|
874
|
+
|
|
844
875
|
exports.dataSourcesSplitByAggregationsStats = dataSourcesSplitByAggregationsStats;
|
|
876
|
+
|
|
845
877
|
var dataSourcesSplitByModeTimechart = function dataSourcesSplitByModeTimechart(dataSource, splitBy) {
|
|
846
878
|
var _a, _b, _c, _d, _e;
|
|
879
|
+
|
|
847
880
|
var fields = (_b = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.fields;
|
|
848
881
|
var columns = (_d = (_c = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns;
|
|
849
882
|
var splitDataSources = null;
|
|
850
883
|
var splitByFields = [];
|
|
851
884
|
var errorCode = null;
|
|
885
|
+
|
|
852
886
|
if (typeof fields[0] !== 'string') {
|
|
853
|
-
splitByFields = trellisUtils_1.extractSplitByFieldsChartFields(fields);
|
|
887
|
+
splitByFields = (0, trellisUtils_1.extractSplitByFieldsChartFields)(fields);
|
|
854
888
|
}
|
|
889
|
+
|
|
855
890
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
856
891
|
splitDataSources = {};
|
|
857
|
-
var dataSourceKeys = trellisUtils_1.extractDataSourceAggregationKeysChart(fields);
|
|
892
|
+
var dataSourceKeys = (0, trellisUtils_1.extractDataSourceAggregationKeysChart)(fields);
|
|
858
893
|
var valueKeys = [];
|
|
894
|
+
|
|
859
895
|
for (var i = 1; i < fields.length; i += 1) {
|
|
860
896
|
// not including internal fields
|
|
861
897
|
if (!((_e = fields[i].name) === null || _e === void 0 ? void 0 : _e.startsWith('_'))) {
|
|
862
898
|
valueKeys.push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
|
|
863
899
|
}
|
|
864
900
|
}
|
|
901
|
+
|
|
865
902
|
valueKeys.forEach(function (val) {
|
|
866
|
-
splitDataSources[val] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
903
|
+
splitDataSources[val] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
867
904
|
splitDataSources[val].primary.data.fields = [{
|
|
868
905
|
name: fields[0].name
|
|
869
906
|
}].concat(_toConsumableArray(dataSourceKeys.map(function (k) {
|
|
@@ -883,22 +920,28 @@ var dataSourcesSplitByModeTimechart = function dataSourcesSplitByModeTimechart(d
|
|
|
883
920
|
} else {
|
|
884
921
|
errorCode = 'INVALID_SPLIT_BY_FIELD';
|
|
885
922
|
}
|
|
923
|
+
|
|
886
924
|
return {
|
|
887
925
|
splitDataSources: splitDataSources,
|
|
888
926
|
errorCode: errorCode
|
|
889
927
|
};
|
|
890
928
|
};
|
|
929
|
+
|
|
891
930
|
exports.dataSourcesSplitByModeTimechart = dataSourcesSplitByModeTimechart;
|
|
931
|
+
|
|
892
932
|
var dataSourcesSplitByModeChart = function dataSourcesSplitByModeChart(dataSource, splitBy) {
|
|
893
933
|
var _a, _b, _c, _d;
|
|
934
|
+
|
|
894
935
|
var fields = (_b = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.fields;
|
|
895
936
|
var columns = (_d = (_c = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns;
|
|
896
937
|
var splitDataSources = null;
|
|
897
938
|
var splitByFields = [];
|
|
898
939
|
var errorCode = null;
|
|
940
|
+
|
|
899
941
|
if (typeof fields[0] !== 'string') {
|
|
900
|
-
splitByFields = trellisUtils_1.extractSplitByFieldsChartFields(fields);
|
|
942
|
+
splitByFields = (0, trellisUtils_1.extractSplitByFieldsChartFields)(fields);
|
|
901
943
|
}
|
|
944
|
+
|
|
902
945
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
903
946
|
splitDataSources = {};
|
|
904
947
|
var splitByFieldIdx = splitByFields.findIndex(function (f) {
|
|
@@ -907,8 +950,9 @@ var dataSourcesSplitByModeChart = function dataSourcesSplitByModeChart(dataSourc
|
|
|
907
950
|
var otherSplitBy = splitByFields.filter(function (f) {
|
|
908
951
|
return f !== splitBy;
|
|
909
952
|
});
|
|
910
|
-
var dataSourceKeys = trellisUtils_1.extractDataSourceAggregationKeysChart(fields);
|
|
953
|
+
var dataSourceKeys = (0, trellisUtils_1.extractDataSourceAggregationKeysChart)(fields);
|
|
911
954
|
var nonDataSourceAggregations = [];
|
|
955
|
+
|
|
912
956
|
if (!dataSourceKeys.length && fields[0].groupby_rank === '0' && fields.length && !fields[1].groupby_rank) {
|
|
913
957
|
/* check for another aggregation scenario where no key 'data_source' will be returned (applies for both chart and stats cmd)
|
|
914
958
|
For example :-
|
|
@@ -933,12 +977,14 @@ var dataSourcesSplitByModeChart = function dataSourcesSplitByModeChart(dataSourc
|
|
|
933
977
|
nonDataSourceAggregations.push(fields[i].name);
|
|
934
978
|
}
|
|
935
979
|
}
|
|
980
|
+
|
|
936
981
|
if (splitByFieldIdx === 0) {
|
|
937
982
|
// if splitBy is the first field, split row wise
|
|
938
|
-
var valueKeys = lodash_1.cloneDeep(columns[0]);
|
|
983
|
+
var valueKeys = (0, lodash_1.cloneDeep)(columns[0]);
|
|
939
984
|
valueKeys.forEach(function (val, idx) {
|
|
940
|
-
splitDataSources[val] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
985
|
+
splitDataSources[val] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
941
986
|
splitDataSources[val].primary.data.fields = [];
|
|
987
|
+
|
|
942
988
|
if (otherSplitBy.length) {
|
|
943
989
|
splitDataSources[val].primary.data.fields = [{
|
|
944
990
|
name: otherSplitBy[0]
|
|
@@ -1010,16 +1056,20 @@ var dataSourcesSplitByModeChart = function dataSourcesSplitByModeChart(dataSourc
|
|
|
1010
1056
|
columnValues[1] = ['1','10','100']
|
|
1011
1057
|
columnValues[2] = ['5', '50', '500']
|
|
1012
1058
|
*/
|
|
1059
|
+
|
|
1013
1060
|
var _loop = function _loop(_i) {
|
|
1014
1061
|
columnValues[0].push(fields[_i].splitby_value ? fields[_i].splitby_value : fields[_i].name);
|
|
1015
1062
|
dataSourceKeys.forEach(function (dskey, dsIndx) {
|
|
1016
1063
|
var mul = (fields.length - 1) / dataSourceKeys.length; // This line does the index calculation
|
|
1064
|
+
|
|
1017
1065
|
columnValues[dsIndx + 1].push(columns[_i + dsIndx * mul][idx]);
|
|
1018
1066
|
});
|
|
1019
1067
|
};
|
|
1068
|
+
|
|
1020
1069
|
for (var _i = 1; _i <= Math.ceil((fields.length - 1) / dataSourceKeys.length); _i += 1) {
|
|
1021
1070
|
_loop(_i);
|
|
1022
1071
|
}
|
|
1072
|
+
|
|
1023
1073
|
splitDataSources[val].primary.data.columns = columnValues;
|
|
1024
1074
|
})();
|
|
1025
1075
|
} else if (nonDataSourceAggregations.length) {
|
|
@@ -1041,11 +1091,13 @@ var dataSourcesSplitByModeChart = function dataSourcesSplitByModeChart(dataSourc
|
|
|
1041
1091
|
} else {
|
|
1042
1092
|
// split column wise
|
|
1043
1093
|
var _valueKeys = [];
|
|
1094
|
+
|
|
1044
1095
|
for (var _i2 = 1; _i2 < fields.length; _i2 += 1) {
|
|
1045
1096
|
_valueKeys.push(fields[_i2].splitby_value ? fields[_i2].splitby_value : fields[_i2].name);
|
|
1046
1097
|
}
|
|
1098
|
+
|
|
1047
1099
|
_valueKeys.forEach(function (val) {
|
|
1048
|
-
splitDataSources[val] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
1100
|
+
splitDataSources[val] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
1049
1101
|
splitDataSources[val].primary.data.fields = [{
|
|
1050
1102
|
name: otherSplitBy[0]
|
|
1051
1103
|
}].concat(_toConsumableArray(dataSourceKeys.map(function (k) {
|
|
@@ -1066,29 +1118,36 @@ var dataSourcesSplitByModeChart = function dataSourcesSplitByModeChart(dataSourc
|
|
|
1066
1118
|
} else {
|
|
1067
1119
|
errorCode = 'INVALID_SPLIT_BY_FIELD';
|
|
1068
1120
|
}
|
|
1121
|
+
|
|
1069
1122
|
return {
|
|
1070
1123
|
splitDataSources: splitDataSources,
|
|
1071
1124
|
errorCode: errorCode
|
|
1072
1125
|
};
|
|
1073
1126
|
};
|
|
1127
|
+
|
|
1074
1128
|
exports.dataSourcesSplitByModeChart = dataSourcesSplitByModeChart;
|
|
1075
1129
|
/**
|
|
1076
1130
|
* This method does datasplitting for 'stats' and generic cmds('makeresults','table' etc - categoried as 'unknown' splitMode).
|
|
1077
1131
|
* The main difference is for 'stats' cmd possible splitBy fields have 'group_by_rank' in field meta info, whereas for 'unknown' cmd it can be any fieldnames
|
|
1078
1132
|
*/
|
|
1133
|
+
|
|
1079
1134
|
var dataSourcesSplitByModeStatsorUnknown = function dataSourcesSplitByModeStatsorUnknown(dataSource, splitBy, splitMode) {
|
|
1080
1135
|
var _a, _b, _c, _d, _e, _f;
|
|
1136
|
+
|
|
1081
1137
|
var fields = (_b = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.fields;
|
|
1082
1138
|
var columns = (_d = (_c = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns;
|
|
1083
1139
|
var splitDataSources = null;
|
|
1084
1140
|
var splitByFields = [];
|
|
1085
1141
|
var errorCode = null;
|
|
1142
|
+
|
|
1086
1143
|
if (typeof fields[0] !== 'string') {
|
|
1087
|
-
splitByFields = splitMode !== trellisUtils_1.UNKNOWN ? trellisUtils_1.extractSplitByFieldsForStats(fields) : trellisUtils_1.extractSplitByFieldsForUnknown(fields);
|
|
1144
|
+
splitByFields = splitMode !== trellisUtils_1.UNKNOWN ? (0, trellisUtils_1.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_1.extractSplitByFieldsForUnknown)(fields);
|
|
1088
1145
|
}
|
|
1146
|
+
|
|
1089
1147
|
var splitByIndex = fields === null || fields === void 0 ? void 0 : fields.findIndex(function (field) {
|
|
1090
1148
|
return field === splitBy || field.name === splitBy;
|
|
1091
1149
|
});
|
|
1150
|
+
|
|
1092
1151
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
1093
1152
|
var splitByColumn = (_f = (_e = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.columns[splitByIndex];
|
|
1094
1153
|
splitDataSources = {};
|
|
@@ -1099,12 +1158,12 @@ var dataSourcesSplitByModeStatsorUnknown = function dataSourcesSplitByModeStatso
|
|
|
1099
1158
|
splitDataSources[val].push(idx);
|
|
1100
1159
|
}
|
|
1101
1160
|
});
|
|
1102
|
-
var cloneFields = lodash_1.cloneDeep(fields);
|
|
1161
|
+
var cloneFields = (0, lodash_1.cloneDeep)(fields);
|
|
1103
1162
|
cloneFields.splice(splitByIndex, 1);
|
|
1104
1163
|
var valueKeys = Object.keys(splitDataSources);
|
|
1105
1164
|
valueKeys.forEach(function (val) {
|
|
1106
|
-
var valIndices = lodash_1.cloneDeep(splitDataSources[val]);
|
|
1107
|
-
splitDataSources[val] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
1165
|
+
var valIndices = (0, lodash_1.cloneDeep)(splitDataSources[val]);
|
|
1166
|
+
splitDataSources[val] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
1108
1167
|
splitDataSources[val].primary.data.fields = cloneFields;
|
|
1109
1168
|
splitDataSources[val].primary.data.columns = [];
|
|
1110
1169
|
columns.forEach(function (col, idx) {
|
|
@@ -1119,23 +1178,27 @@ var dataSourcesSplitByModeStatsorUnknown = function dataSourcesSplitByModeStatso
|
|
|
1119
1178
|
} else {
|
|
1120
1179
|
errorCode = 'INVALID_SPLIT_BY_FIELD';
|
|
1121
1180
|
}
|
|
1181
|
+
|
|
1122
1182
|
return {
|
|
1123
1183
|
splitDataSources: splitDataSources,
|
|
1124
1184
|
errorCode: errorCode
|
|
1125
1185
|
};
|
|
1126
1186
|
};
|
|
1187
|
+
|
|
1127
1188
|
exports.dataSourcesSplitByModeStatsorUnknown = dataSourcesSplitByModeStatsorUnknown;
|
|
1189
|
+
|
|
1128
1190
|
var getTrellisDataSourcesBySplitMode = function getTrellisDataSourcesBySplitMode(splitMode, dataSources, trellisSplitBy) {
|
|
1129
1191
|
var result = null;
|
|
1192
|
+
|
|
1130
1193
|
try {
|
|
1131
1194
|
if (splitMode === trellisUtils_1.TIMECHART) {
|
|
1132
|
-
result = trellisSplitBy === exports.AGGREGATIONS ? exports.dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : exports.dataSourcesSplitByModeTimechart(dataSources, trellisSplitBy);
|
|
1195
|
+
result = trellisSplitBy === exports.AGGREGATIONS ? (0, exports.dataSourcesSplitByAggregationsTimechartAndChart)(dataSources) : (0, exports.dataSourcesSplitByModeTimechart)(dataSources, trellisSplitBy);
|
|
1133
1196
|
} else if (splitMode === trellisUtils_1.STATS) {
|
|
1134
|
-
result = trellisSplitBy === exports.AGGREGATIONS ? exports.dataSourcesSplitByAggregationsStats(dataSources) : exports.dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_1.STATS);
|
|
1197
|
+
result = trellisSplitBy === exports.AGGREGATIONS ? (0, exports.dataSourcesSplitByAggregationsStats)(dataSources) : (0, exports.dataSourcesSplitByModeStatsorUnknown)(dataSources, trellisSplitBy, trellisUtils_1.STATS);
|
|
1135
1198
|
} else if (splitMode === trellisUtils_1.CHART) {
|
|
1136
|
-
result = trellisSplitBy === exports.AGGREGATIONS ? exports.dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : exports.dataSourcesSplitByModeChart(dataSources, trellisSplitBy);
|
|
1199
|
+
result = trellisSplitBy === exports.AGGREGATIONS ? (0, exports.dataSourcesSplitByAggregationsTimechartAndChart)(dataSources) : (0, exports.dataSourcesSplitByModeChart)(dataSources, trellisSplitBy);
|
|
1137
1200
|
} else if (splitMode === trellisUtils_1.UNKNOWN) {
|
|
1138
|
-
result = trellisSplitBy === exports.AGGREGATIONS ? exports.dataSourcesSplitByAggregationsUnknown(dataSources) : exports.dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_1.UNKNOWN);
|
|
1201
|
+
result = trellisSplitBy === exports.AGGREGATIONS ? (0, exports.dataSourcesSplitByAggregationsUnknown)(dataSources) : (0, exports.dataSourcesSplitByModeStatsorUnknown)(dataSources, trellisSplitBy, trellisUtils_1.UNKNOWN);
|
|
1139
1202
|
}
|
|
1140
1203
|
} catch (ex) {
|
|
1141
1204
|
console.error('getTrellisDataSourcesBySplitMode ', ex);
|
|
@@ -1144,12 +1207,28 @@ var getTrellisDataSourcesBySplitMode = function getTrellisDataSourcesBySplitMode
|
|
|
1144
1207
|
errorCode: 'UNKNOWN'
|
|
1145
1208
|
};
|
|
1146
1209
|
}
|
|
1210
|
+
|
|
1147
1211
|
return result;
|
|
1148
1212
|
};
|
|
1213
|
+
|
|
1149
1214
|
exports.getTrellisDataSourcesBySplitMode = getTrellisDataSourcesBySplitMode;
|
|
1150
1215
|
|
|
1151
1216
|
/***/ }),
|
|
1152
1217
|
|
|
1218
|
+
/***/ 108:
|
|
1219
|
+
/***/ (function(module, exports) {
|
|
1220
|
+
|
|
1221
|
+
module.exports = require("lodash/pick");
|
|
1222
|
+
|
|
1223
|
+
/***/ }),
|
|
1224
|
+
|
|
1225
|
+
/***/ 109:
|
|
1226
|
+
/***/ (function(module, exports) {
|
|
1227
|
+
|
|
1228
|
+
module.exports = require("lodash/isEmpty");
|
|
1229
|
+
|
|
1230
|
+
/***/ }),
|
|
1231
|
+
|
|
1153
1232
|
/***/ 11:
|
|
1154
1233
|
/***/ (function(module, exports) {
|
|
1155
1234
|
|
|
@@ -1173,40 +1252,46 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
|
1173
1252
|
Object.defineProperty(exports, "__esModule", {
|
|
1174
1253
|
value: true
|
|
1175
1254
|
});
|
|
1255
|
+
|
|
1176
1256
|
var React = __webpack_require__(1);
|
|
1257
|
+
|
|
1177
1258
|
var styled_components_1 = __webpack_require__(4);
|
|
1259
|
+
|
|
1178
1260
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
1261
|
+
|
|
1179
1262
|
var style_1 = __webpack_require__(14);
|
|
1263
|
+
|
|
1180
1264
|
var colorUtils_1 = __webpack_require__(12);
|
|
1265
|
+
|
|
1181
1266
|
var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
1182
1267
|
var width = _ref.width;
|
|
1183
1268
|
return {
|
|
1184
1269
|
style: {
|
|
1185
|
-
width: style_1.toPx(width)
|
|
1270
|
+
width: (0, style_1.toPx)(width)
|
|
1186
1271
|
}
|
|
1187
1272
|
};
|
|
1188
1273
|
}).withConfig({
|
|
1189
1274
|
displayName: "FixedSizeContainer__Item",
|
|
1190
1275
|
componentId: "sc-1yhgpod-0"
|
|
1191
1276
|
})(["position:relative;background-color:", "};"], function (props) {
|
|
1192
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
1193
|
-
});
|
|
1194
|
-
|
|
1277
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
1278
|
+
}); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
|
|
1279
|
+
|
|
1195
1280
|
var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
|
|
1196
1281
|
var width = _ref2.width,
|
|
1197
|
-
|
|
1282
|
+
height = _ref2.height;
|
|
1198
1283
|
return {
|
|
1199
1284
|
style: Object.assign(Object.assign({}, width && {
|
|
1200
|
-
width: style_1.toPx(width)
|
|
1285
|
+
width: (0, style_1.toPx)(width)
|
|
1201
1286
|
}), height && {
|
|
1202
|
-
height: style_1.toPx(height)
|
|
1287
|
+
height: (0, style_1.toPx)(height)
|
|
1203
1288
|
})
|
|
1204
1289
|
};
|
|
1205
1290
|
}).withConfig({
|
|
1206
1291
|
displayName: "FixedSizeContainer__FixSizeItem",
|
|
1207
1292
|
componentId: "sc-1yhgpod-1"
|
|
1208
1293
|
})(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
|
|
1209
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
1294
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
1210
1295
|
});
|
|
1211
1296
|
var ItemContent = styled_components_1.default.div.withConfig({
|
|
1212
1297
|
displayName: "FixedSizeContainer__ItemContent",
|
|
@@ -1216,11 +1301,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
|
|
|
1216
1301
|
displayName: "FixedSizeContainer__FixSizeItemContent",
|
|
1217
1302
|
componentId: "sc-1yhgpod-3"
|
|
1218
1303
|
})(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
|
|
1304
|
+
|
|
1219
1305
|
var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
1220
1306
|
var FixedSizeContainer = function FixedSizeContainer(props) {
|
|
1221
1307
|
var width = props.width,
|
|
1222
|
-
|
|
1223
|
-
|
|
1308
|
+
height = props.height,
|
|
1309
|
+
backgroundColor = props.backgroundColor;
|
|
1310
|
+
|
|
1224
1311
|
if (!height) {
|
|
1225
1312
|
return React.createElement(Item, {
|
|
1226
1313
|
"data-test": "item",
|
|
@@ -1228,29 +1315,32 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
1228
1315
|
backgroundColor: backgroundColor
|
|
1229
1316
|
}, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
|
|
1230
1317
|
}
|
|
1318
|
+
|
|
1231
1319
|
return React.createElement(FixSizeItem, {
|
|
1232
1320
|
"data-test": "fix-size-item",
|
|
1233
|
-
"data-splunk-visualization-version": "
|
|
1321
|
+
"data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
|
|
1234
1322
|
width: width,
|
|
1235
1323
|
height: height,
|
|
1236
1324
|
backgroundColor: backgroundColor
|
|
1237
1325
|
}, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
|
|
1238
1326
|
var newWidth = _ref3.width,
|
|
1239
|
-
|
|
1327
|
+
newHeight = _ref3.height;
|
|
1240
1328
|
return React.createElement(Viz, Object.assign({}, props, {
|
|
1241
1329
|
width: newWidth,
|
|
1242
1330
|
height: newHeight
|
|
1243
1331
|
}));
|
|
1244
1332
|
})));
|
|
1245
1333
|
};
|
|
1334
|
+
|
|
1246
1335
|
FixedSizeContainer.displayName = 'withFixedSizeContainer';
|
|
1247
1336
|
return FixedSizeContainer;
|
|
1248
1337
|
};
|
|
1338
|
+
|
|
1249
1339
|
exports.default = withFixedSizeContainer;
|
|
1250
1340
|
|
|
1251
1341
|
/***/ }),
|
|
1252
1342
|
|
|
1253
|
-
/***/
|
|
1343
|
+
/***/ 135:
|
|
1254
1344
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1255
1345
|
|
|
1256
1346
|
"use strict";
|
|
@@ -1295,69 +1385,108 @@ exports.defaultContext = {
|
|
|
1295
1385
|
|
|
1296
1386
|
/***/ }),
|
|
1297
1387
|
|
|
1298
|
-
/***/
|
|
1299
|
-
/***/ (function(module,
|
|
1300
|
-
|
|
1301
|
-
module.exports = require("@splunk/visualizations-shared/style");
|
|
1302
|
-
|
|
1303
|
-
/***/ }),
|
|
1304
|
-
|
|
1305
|
-
/***/ 140:
|
|
1306
|
-
/***/ (function(module, exports) {
|
|
1307
|
-
|
|
1308
|
-
module.exports = require("@splunk/visualizations/SingleValueBasic");
|
|
1309
|
-
|
|
1310
|
-
/***/ }),
|
|
1311
|
-
|
|
1312
|
-
/***/ 15:
|
|
1313
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1388
|
+
/***/ 136:
|
|
1389
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1314
1390
|
|
|
1315
1391
|
"use strict";
|
|
1392
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1393
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicMajorColorEditor", function() { return getDynamicMajorColorEditor; });
|
|
1394
|
+
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
1395
|
+
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
|
1396
|
+
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22);
|
|
1397
|
+
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
|
|
1316
1398
|
|
|
1317
1399
|
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1400
|
+
var getDynamicMajorColorEditor = function getDynamicMajorColorEditor(_ref) {
|
|
1401
|
+
var defaultContext = _ref.defaultContext,
|
|
1402
|
+
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
1403
|
+
return {
|
|
1404
|
+
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
|
|
1405
|
+
option: 'majorColor',
|
|
1406
|
+
context: 'majorColorEditorConfig',
|
|
1407
|
+
editor: 'editor.dynamicColor',
|
|
1408
|
+
showEditor: function showEditor(_ref2) {
|
|
1409
|
+
var options = _ref2.options;
|
|
1410
|
+
return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.majorColor);
|
|
1411
|
+
},
|
|
1412
|
+
editorProps: {
|
|
1413
|
+
labelPosition: 'top',
|
|
1414
|
+
flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: major value'),
|
|
1415
|
+
formatters: [{
|
|
1416
|
+
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
|
|
1417
|
+
value: 'rangeValue',
|
|
1418
|
+
defaults: {
|
|
1419
|
+
majorValue: defaultContext.majorColorConfig
|
|
1420
|
+
}
|
|
1421
|
+
}, {
|
|
1422
|
+
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Matches'),
|
|
1423
|
+
value: 'matchValue',
|
|
1424
|
+
defaults: {
|
|
1425
|
+
majorValue: defaultContext.majorColorMatchConfig
|
|
1426
|
+
}
|
|
1427
|
+
}],
|
|
1428
|
+
dataSelectors: [{
|
|
1429
|
+
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
|
|
1430
|
+
value: 'majorValue'
|
|
1431
|
+
}],
|
|
1432
|
+
defaultPalettesConfig: defaultPalettesConfig
|
|
1433
|
+
}
|
|
1434
|
+
};
|
|
1435
|
+
};
|
|
1340
1436
|
|
|
1341
1437
|
/***/ }),
|
|
1342
1438
|
|
|
1343
|
-
/***/
|
|
1439
|
+
/***/ 14:
|
|
1344
1440
|
/***/ (function(module, exports) {
|
|
1345
1441
|
|
|
1346
|
-
module.exports = require("@splunk/visualizations-shared/
|
|
1442
|
+
module.exports = require("@splunk/visualizations-shared/style");
|
|
1347
1443
|
|
|
1348
1444
|
/***/ }),
|
|
1349
1445
|
|
|
1350
|
-
/***/
|
|
1446
|
+
/***/ 142:
|
|
1351
1447
|
/***/ (function(module, exports) {
|
|
1352
1448
|
|
|
1353
|
-
module.exports = require("@splunk/
|
|
1449
|
+
module.exports = require("@splunk/visualizations/SingleValueBasic");
|
|
1450
|
+
|
|
1451
|
+
/***/ }),
|
|
1452
|
+
|
|
1453
|
+
/***/ 15:
|
|
1454
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1455
|
+
|
|
1456
|
+
"use strict";
|
|
1457
|
+
|
|
1458
|
+
|
|
1459
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1460
|
+
value: true
|
|
1461
|
+
});
|
|
1462
|
+
exports.extendStaticWrapperProps = void 0;
|
|
1463
|
+
/**
|
|
1464
|
+
* @method extendStaticWrapperProps
|
|
1465
|
+
* @param {Object} props
|
|
1466
|
+
* @param {DashboardVizType} props.Wrapper
|
|
1467
|
+
* @param {DashboardVizType} props.Visualization
|
|
1468
|
+
*/
|
|
1469
|
+
|
|
1470
|
+
var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
1471
|
+
var Wrapper = _ref.Wrapper,
|
|
1472
|
+
Visualization = _ref.Visualization;
|
|
1473
|
+
var extendProperties = ['propTypes', 'defaultProps', 'config'];
|
|
1474
|
+
extendProperties.forEach(function (prop) {
|
|
1475
|
+
if (Visualization[prop]) {
|
|
1476
|
+
// eslint-disable-next-line no-param-reassign
|
|
1477
|
+
Wrapper[prop] = Visualization[prop];
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
};
|
|
1481
|
+
|
|
1482
|
+
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
1354
1483
|
|
|
1355
1484
|
/***/ }),
|
|
1356
1485
|
|
|
1357
|
-
/***/
|
|
1486
|
+
/***/ 16:
|
|
1358
1487
|
/***/ (function(module, exports) {
|
|
1359
1488
|
|
|
1360
|
-
module.exports = require("@splunk/
|
|
1489
|
+
module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
1361
1490
|
|
|
1362
1491
|
/***/ }),
|
|
1363
1492
|
|
|
@@ -1368,21 +1497,35 @@ module.exports = require("@babel/runtime/helpers/slicedToArray");
|
|
|
1368
1497
|
|
|
1369
1498
|
/***/ }),
|
|
1370
1499
|
|
|
1371
|
-
/***/
|
|
1500
|
+
/***/ 171:
|
|
1501
|
+
/***/ (function(module, exports) {
|
|
1502
|
+
|
|
1503
|
+
module.exports = require("@splunk/react-icons/enterprise/Activity");
|
|
1504
|
+
|
|
1505
|
+
/***/ }),
|
|
1506
|
+
|
|
1507
|
+
/***/ 172:
|
|
1508
|
+
/***/ (function(module, exports) {
|
|
1509
|
+
|
|
1510
|
+
module.exports = require("@splunk/react-icons/enterprise/Clock");
|
|
1511
|
+
|
|
1512
|
+
/***/ }),
|
|
1513
|
+
|
|
1514
|
+
/***/ 173:
|
|
1372
1515
|
/***/ (function(module, exports) {
|
|
1373
1516
|
|
|
1374
1517
|
module.exports = require("@splunk/react-icons/enterprise/Pencil");
|
|
1375
1518
|
|
|
1376
1519
|
/***/ }),
|
|
1377
1520
|
|
|
1378
|
-
/***/
|
|
1521
|
+
/***/ 174:
|
|
1379
1522
|
/***/ (function(module, exports) {
|
|
1380
1523
|
|
|
1381
1524
|
module.exports = require("@splunk/react-icons/enterprise/Star");
|
|
1382
1525
|
|
|
1383
1526
|
/***/ }),
|
|
1384
1527
|
|
|
1385
|
-
/***/
|
|
1528
|
+
/***/ 175:
|
|
1386
1529
|
/***/ (function(module, exports) {
|
|
1387
1530
|
|
|
1388
1531
|
module.exports = require("@splunk/react-icons/enterprise/Question");
|
|
@@ -1417,24 +1560,33 @@ module.exports = require("@splunk/ui-utils/i18n");
|
|
|
1417
1560
|
|
|
1418
1561
|
|
|
1419
1562
|
var _toConsumableArray = __webpack_require__(8);
|
|
1563
|
+
|
|
1420
1564
|
var _defineProperty = __webpack_require__(7);
|
|
1565
|
+
|
|
1421
1566
|
var __rest = this && this.__rest || function (s, e) {
|
|
1422
1567
|
var t = {};
|
|
1568
|
+
|
|
1423
1569
|
for (var p in s) {
|
|
1424
1570
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
1425
1571
|
}
|
|
1572
|
+
|
|
1426
1573
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1427
1574
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
1428
1575
|
}
|
|
1429
1576
|
return t;
|
|
1430
1577
|
};
|
|
1578
|
+
|
|
1431
1579
|
Object.defineProperty(exports, "__esModule", {
|
|
1432
1580
|
value: true
|
|
1433
1581
|
});
|
|
1434
1582
|
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
1583
|
+
|
|
1435
1584
|
var lodash_1 = __webpack_require__(3);
|
|
1585
|
+
|
|
1436
1586
|
var schemaUtils_1 = __webpack_require__(16);
|
|
1587
|
+
|
|
1437
1588
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1589
|
+
|
|
1438
1590
|
var dynamicOptionsDSLType = {
|
|
1439
1591
|
type: 'string',
|
|
1440
1592
|
pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
|
|
@@ -1444,20 +1596,22 @@ var dynamicOptionsDSLType = {
|
|
|
1444
1596
|
* @param optionsSchema a visualization's options schema
|
|
1445
1597
|
* @returns an updated options schema that additionally allows strings starting with > for each option
|
|
1446
1598
|
*/
|
|
1599
|
+
|
|
1447
1600
|
function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
1448
1601
|
var enhancedOptionsSchema = {};
|
|
1449
1602
|
Object.keys(optionsSchema).forEach(function (key) {
|
|
1450
1603
|
var _a = optionsSchema[key],
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1604
|
+
title = _a.title,
|
|
1605
|
+
description = _a.description,
|
|
1606
|
+
readOnly = _a.readOnly,
|
|
1607
|
+
writeOnly = _a.writeOnly,
|
|
1608
|
+
examples = _a.examples,
|
|
1609
|
+
defaultValue = _a.default,
|
|
1610
|
+
type = _a.type,
|
|
1611
|
+
properties = _a.properties,
|
|
1612
|
+
patternProperties = _a.patternProperties,
|
|
1613
|
+
remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
|
|
1614
|
+
|
|
1461
1615
|
var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
|
|
1462
1616
|
title: title
|
|
1463
1617
|
}), description !== undefined && {
|
|
@@ -1471,12 +1625,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
1471
1625
|
}), defaultValue !== undefined && {
|
|
1472
1626
|
default: defaultValue
|
|
1473
1627
|
});
|
|
1628
|
+
|
|
1474
1629
|
if (type === 'object') {
|
|
1475
1630
|
enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
|
|
1476
1631
|
type: type
|
|
1477
1632
|
}), properties && {
|
|
1478
1633
|
properties: enhanceOptionsSchemaWithDynamicOptions(properties)
|
|
1479
1634
|
});
|
|
1635
|
+
|
|
1480
1636
|
if (patternProperties) {
|
|
1481
1637
|
var enhancedPatternProperties = {};
|
|
1482
1638
|
Object.keys(patternProperties).forEach(function (opt) {
|
|
@@ -1494,6 +1650,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
1494
1650
|
});
|
|
1495
1651
|
return enhancedOptionsSchema;
|
|
1496
1652
|
}
|
|
1653
|
+
|
|
1497
1654
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
1498
1655
|
/**
|
|
1499
1656
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
@@ -1502,11 +1659,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
|
|
|
1502
1659
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
1503
1660
|
* and containing `open: false` for all editor panels in editorConfig
|
|
1504
1661
|
*/
|
|
1662
|
+
|
|
1505
1663
|
function enhanceConfig(vizConfig) {
|
|
1506
1664
|
var enhancedConfig = Object.assign({}, vizConfig);
|
|
1665
|
+
|
|
1507
1666
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
|
|
1508
1667
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
1509
1668
|
}
|
|
1669
|
+
|
|
1510
1670
|
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
1511
1671
|
return Object.assign(Object.assign({}, config), {
|
|
1512
1672
|
open: config.open || false
|
|
@@ -1514,6 +1674,7 @@ function enhanceConfig(vizConfig) {
|
|
|
1514
1674
|
});
|
|
1515
1675
|
return enhancedConfig;
|
|
1516
1676
|
}
|
|
1677
|
+
|
|
1517
1678
|
exports.enhanceConfig = enhanceConfig;
|
|
1518
1679
|
/**
|
|
1519
1680
|
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
@@ -1521,6 +1682,7 @@ exports.enhanceConfig = enhanceConfig;
|
|
|
1521
1682
|
* @param vizConfig a Visualization Config
|
|
1522
1683
|
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
1523
1684
|
*/
|
|
1685
|
+
|
|
1524
1686
|
function uncollapseEditorConfig(vizConfig) {
|
|
1525
1687
|
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
1526
1688
|
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
@@ -1530,13 +1692,16 @@ function uncollapseEditorConfig(vizConfig) {
|
|
|
1530
1692
|
});
|
|
1531
1693
|
return editorPanelUncollapsedConfig;
|
|
1532
1694
|
}
|
|
1695
|
+
|
|
1533
1696
|
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
1697
|
+
|
|
1534
1698
|
function isDynamicOption(option) {
|
|
1535
1699
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
1536
1700
|
}
|
|
1537
|
-
|
|
1538
|
-
// private helpers to improve readability of getInitialPreset
|
|
1701
|
+
|
|
1702
|
+
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
1539
1703
|
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
1704
|
+
|
|
1540
1705
|
/**
|
|
1541
1706
|
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
1542
1707
|
* 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
|
|
@@ -1545,6 +1710,7 @@ exports.isDynamicOption = isDynamicOption;
|
|
|
1545
1710
|
*
|
|
1546
1711
|
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
1547
1712
|
*/
|
|
1713
|
+
|
|
1548
1714
|
function hasCompatibleContexts(vizContext, presetContext) {
|
|
1549
1715
|
var presetContextKeys = Object.keys(presetContext);
|
|
1550
1716
|
return presetContextKeys.every(function (contextKey) {
|
|
@@ -1554,6 +1720,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
|
|
|
1554
1720
|
/**
|
|
1555
1721
|
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
1556
1722
|
*/
|
|
1723
|
+
|
|
1724
|
+
|
|
1557
1725
|
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
1558
1726
|
var presetOptionKeys = Object.keys(presetOptions);
|
|
1559
1727
|
return presetOptionKeys.every(function (optionKey) {
|
|
@@ -1568,18 +1736,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
|
1568
1736
|
* @param {Object} vizOptions - the current vizOptions definition
|
|
1569
1737
|
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
1570
1738
|
*/
|
|
1739
|
+
|
|
1740
|
+
|
|
1571
1741
|
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
1572
1742
|
return presets.find(function (preset) {
|
|
1573
|
-
var presetContext = lodash_1.get(preset, ['value', 'context'], {});
|
|
1574
|
-
var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
|
|
1743
|
+
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
1744
|
+
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
1575
1745
|
var presetContextKeys = Object.keys(presetContext);
|
|
1576
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
1577
|
-
// all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
1746
|
+
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
1578
1747
|
// if not, then the preset is invalid in config.ts
|
|
1748
|
+
|
|
1579
1749
|
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
1580
1750
|
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
1581
1751
|
});
|
|
1582
1752
|
}
|
|
1753
|
+
|
|
1583
1754
|
exports.getInitialPreset = getInitialPreset;
|
|
1584
1755
|
/**
|
|
1585
1756
|
* generates number precision values for a Select editor
|
|
@@ -1587,14 +1758,16 @@ exports.getInitialPreset = getInitialPreset;
|
|
|
1587
1758
|
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
1588
1759
|
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
1589
1760
|
*/
|
|
1761
|
+
|
|
1590
1762
|
function generatePrecisionValues(numPrecisionValues) {
|
|
1591
|
-
return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
|
|
1763
|
+
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
1592
1764
|
return {
|
|
1593
1765
|
label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
|
|
1594
1766
|
value: i
|
|
1595
1767
|
};
|
|
1596
1768
|
});
|
|
1597
1769
|
}
|
|
1770
|
+
|
|
1598
1771
|
exports.generatePrecisionValues = generatePrecisionValues;
|
|
1599
1772
|
/**
|
|
1600
1773
|
* insert layout in layout array, return a new layout array instead of updating the original
|
|
@@ -1604,12 +1777,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
|
|
|
1604
1777
|
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
1605
1778
|
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
1606
1779
|
*/
|
|
1780
|
+
|
|
1607
1781
|
var insertLayout = function insertLayout(layout, index) {
|
|
1608
1782
|
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
1609
1783
|
layoutItems[_key - 2] = arguments[_key];
|
|
1610
1784
|
}
|
|
1785
|
+
|
|
1611
1786
|
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
1612
1787
|
};
|
|
1788
|
+
|
|
1613
1789
|
exports.insertLayout = insertLayout;
|
|
1614
1790
|
|
|
1615
1791
|
/***/ }),
|
|
@@ -1674,34 +1850,47 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1674
1850
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
|
|
1675
1851
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
|
1676
1852
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
|
1677
|
-
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
1853
|
+
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31);
|
|
1678
1854
|
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__);
|
|
1679
1855
|
/* harmony import */ var _splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(54);
|
|
1680
1856
|
/* harmony import */ var _splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__);
|
|
1681
|
-
/* harmony import */ var _splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
1857
|
+
/* harmony import */ var _splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29);
|
|
1682
1858
|
/* harmony import */ var _splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__);
|
|
1683
|
-
/* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
1859
|
+
/* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(49);
|
|
1684
1860
|
/* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__);
|
|
1685
1861
|
|
|
1862
|
+
|
|
1686
1863
|
function ownKeys(object, enumerableOnly) {
|
|
1687
1864
|
var keys = Object.keys(object);
|
|
1865
|
+
|
|
1688
1866
|
if (Object.getOwnPropertySymbols) {
|
|
1689
1867
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
1690
|
-
enumerableOnly
|
|
1868
|
+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
1691
1869
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
1692
|
-
})
|
|
1870
|
+
});
|
|
1871
|
+
keys.push.apply(keys, symbols);
|
|
1693
1872
|
}
|
|
1873
|
+
|
|
1694
1874
|
return keys;
|
|
1695
1875
|
}
|
|
1876
|
+
|
|
1696
1877
|
function _objectSpread(target) {
|
|
1697
1878
|
for (var i = 1; i < arguments.length; i++) {
|
|
1698
|
-
var source =
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1879
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
1880
|
+
|
|
1881
|
+
if (i % 2) {
|
|
1882
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
1883
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]);
|
|
1884
|
+
});
|
|
1885
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
1886
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1887
|
+
} else {
|
|
1888
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
1889
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1704
1892
|
}
|
|
1893
|
+
|
|
1705
1894
|
return target;
|
|
1706
1895
|
}
|
|
1707
1896
|
|
|
@@ -1709,6 +1898,7 @@ function _objectSpread(target) {
|
|
|
1709
1898
|
|
|
1710
1899
|
|
|
1711
1900
|
|
|
1901
|
+
|
|
1712
1902
|
var DEFAULT_FONT = 12;
|
|
1713
1903
|
var DEFAULT_FONT_FAMILY = '"Splunk Platform Sans", "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans-serif';
|
|
1714
1904
|
var SVR_PADDING = {
|
|
@@ -1717,28 +1907,27 @@ var SVR_PADDING = {
|
|
|
1717
1907
|
left: 16,
|
|
1718
1908
|
right: 16
|
|
1719
1909
|
};
|
|
1720
|
-
|
|
1721
1910
|
/**
|
|
1722
1911
|
* @method shouldShowTrend
|
|
1723
1912
|
* @param {String} trendDisplay
|
|
1724
1913
|
* @returns {Bool}
|
|
1725
1914
|
*/
|
|
1915
|
+
|
|
1726
1916
|
var shouldShowTrend = function shouldShowTrend(trendDisplay) {
|
|
1727
1917
|
return trendDisplay === 'absolute' || trendDisplay === 'percent';
|
|
1728
1918
|
};
|
|
1729
|
-
|
|
1730
1919
|
/**
|
|
1731
1920
|
* @method isLoadingOrNoColumns
|
|
1732
1921
|
* @param {Object} dataSources
|
|
1733
1922
|
* @param {Boolean} loading
|
|
1734
1923
|
* @returns {Boolean} return true if loading or without columns in dataSources
|
|
1735
1924
|
*/
|
|
1925
|
+
|
|
1736
1926
|
var isLoadingOrNoColumns = function isLoadingOrNoColumns(dataSources, loading) {
|
|
1737
1927
|
var data = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(dataSources, 'primary.data.columns[0]', undefined);
|
|
1738
1928
|
var noColumns = data === undefined;
|
|
1739
1929
|
return loading || noColumns;
|
|
1740
1930
|
};
|
|
1741
|
-
|
|
1742
1931
|
/**
|
|
1743
1932
|
* Retrieve the valid formatted color
|
|
1744
1933
|
* @method getFormattedColor
|
|
@@ -1746,30 +1935,30 @@ var isLoadingOrNoColumns = function isLoadingOrNoColumns(dataSources, loading) {
|
|
|
1746
1935
|
* @param {String} defaultColor
|
|
1747
1936
|
* @returns {String} the formatted color
|
|
1748
1937
|
*/
|
|
1938
|
+
|
|
1749
1939
|
var getFormattedColor = function getFormattedColor(color, defaultColor) {
|
|
1750
1940
|
return Object(_splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__["formatColor"])(color) || Object(_splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__["formatColor"])(defaultColor);
|
|
1751
1941
|
};
|
|
1752
|
-
|
|
1753
1942
|
/**
|
|
1754
1943
|
* Determines if there is a background color
|
|
1755
1944
|
* @method hasBackground
|
|
1756
1945
|
* @param {String} backgroundColor
|
|
1757
1946
|
* @returns true for non-transparent background color
|
|
1758
1947
|
*/
|
|
1948
|
+
|
|
1759
1949
|
var hasBackground = function hasBackground(backgroundColor) {
|
|
1760
1950
|
return !!backgroundColor && backgroundColor !== 'transparent';
|
|
1761
1951
|
};
|
|
1762
|
-
|
|
1763
1952
|
/**
|
|
1764
1953
|
* @method isIdenticalColor
|
|
1765
1954
|
* @param {String} colorA
|
|
1766
1955
|
* @param {String} colorB
|
|
1767
1956
|
* @returns {Boolean}
|
|
1768
1957
|
*/
|
|
1958
|
+
|
|
1769
1959
|
var isIdenticalColor = function isIdenticalColor(colorA, colorB) {
|
|
1770
1960
|
return !!colorA && !!colorB && Object(_splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__["formatColor"])(colorA.toLowerCase()) === Object(_splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__["formatColor"])(colorB.toLowerCase());
|
|
1771
1961
|
};
|
|
1772
|
-
|
|
1773
1962
|
/*
|
|
1774
1963
|
* @method getDefaultColorWithBg
|
|
1775
1964
|
* @param {Object} props
|
|
@@ -1778,13 +1967,13 @@ var isIdenticalColor = function isIdenticalColor(colorA, colorB) {
|
|
|
1778
1967
|
* @param {String} props.defaultBlockFontColor
|
|
1779
1968
|
* @returns {String} defaultColor
|
|
1780
1969
|
*/
|
|
1970
|
+
|
|
1781
1971
|
var getDefaultColorWithBg = function getDefaultColorWithBg(_ref) {
|
|
1782
1972
|
var backgroundColor = _ref.backgroundColor,
|
|
1783
|
-
|
|
1784
|
-
|
|
1973
|
+
defaultFontColor = _ref.defaultFontColor,
|
|
1974
|
+
defaultBlockFontColor = _ref.defaultBlockFontColor;
|
|
1785
1975
|
return isIdenticalColor(backgroundColor, defaultBlockFontColor) ? defaultFontColor : defaultBlockFontColor;
|
|
1786
1976
|
};
|
|
1787
|
-
|
|
1788
1977
|
/*
|
|
1789
1978
|
* @method getMajorColor
|
|
1790
1979
|
* return formatted majorColor.
|
|
@@ -1795,15 +1984,16 @@ var getDefaultColorWithBg = function getDefaultColorWithBg(_ref) {
|
|
|
1795
1984
|
* @param {String} props.defaultBlockFontColor
|
|
1796
1985
|
* @returns {String} majorColor
|
|
1797
1986
|
*/
|
|
1987
|
+
|
|
1798
1988
|
var getMajorColor = function getMajorColor(_ref2) {
|
|
1799
1989
|
var majorColor = _ref2.majorColor,
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
// If backgroundColor is set, but no majorColor,
|
|
1990
|
+
backgroundColor = _ref2.backgroundColor,
|
|
1991
|
+
defaultFontColor = _ref2.defaultFontColor,
|
|
1992
|
+
defaultBlockFontColor = _ref2.defaultBlockFontColor; // If backgroundColor is set, but no majorColor,
|
|
1804
1993
|
// the default majorColor will turn to be defaultBlockFontColor.
|
|
1805
1994
|
// eg: major color will turn to be white in enterprise mode.
|
|
1806
1995
|
// however, if the bgColor is the same as defaultBlockFontColor, use defaultFontColor.
|
|
1996
|
+
|
|
1807
1997
|
if (hasBackground(backgroundColor) && !majorColor) {
|
|
1808
1998
|
return getDefaultColorWithBg({
|
|
1809
1999
|
backgroundColor: backgroundColor,
|
|
@@ -1811,9 +2001,9 @@ var getMajorColor = function getMajorColor(_ref2) {
|
|
|
1811
2001
|
defaultBlockFontColor: defaultBlockFontColor
|
|
1812
2002
|
});
|
|
1813
2003
|
}
|
|
2004
|
+
|
|
1814
2005
|
return getFormattedColor(majorColor, defaultFontColor);
|
|
1815
2006
|
};
|
|
1816
|
-
|
|
1817
2007
|
/**
|
|
1818
2008
|
* Get the color for the trend components
|
|
1819
2009
|
* @method getTrendColor
|
|
@@ -1826,35 +2016,41 @@ var getMajorColor = function getMajorColor(_ref2) {
|
|
|
1826
2016
|
* @param {Object} defaultColors
|
|
1827
2017
|
* @returns {String} trendColor
|
|
1828
2018
|
*/
|
|
2019
|
+
|
|
1829
2020
|
var getTrendColor = function getTrendColor(_ref3) {
|
|
1830
2021
|
var trendColor = _ref3.trendColor,
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
2022
|
+
trendValue = _ref3.trendValue,
|
|
2023
|
+
majorValue = _ref3.majorValue,
|
|
2024
|
+
customizedBgColor = _ref3.customizedBgColor,
|
|
2025
|
+
trendDisplay = _ref3.trendDisplay,
|
|
2026
|
+
defaultColors = _ref3.defaultColors;
|
|
2027
|
+
|
|
1836
2028
|
if (trendColor) {
|
|
1837
2029
|
return trendColor;
|
|
1838
2030
|
}
|
|
2031
|
+
|
|
1839
2032
|
if (Number.isNaN(Number(trendValue))) {
|
|
1840
2033
|
return undefined;
|
|
1841
2034
|
}
|
|
2035
|
+
|
|
1842
2036
|
var defaultFontColor = defaultColors.defaultFontColor,
|
|
1843
|
-
|
|
1844
|
-
|
|
2037
|
+
defaultBlockFontColor = defaultColors.defaultBlockFontColor,
|
|
2038
|
+
defaultBackgroundColor = defaultColors.defaultBackgroundColor; // if user defined a backgroundColor, the default trend color will be defaultBlockFontColor
|
|
2039
|
+
|
|
1845
2040
|
if (hasBackground(customizedBgColor) && !isIdenticalColor(customizedBgColor, defaultBackgroundColor) && !isIdenticalColor(customizedBgColor, defaultBlockFontColor)) {
|
|
1846
2041
|
return defaultBlockFontColor;
|
|
1847
|
-
}
|
|
1848
|
-
|
|
1849
|
-
// if trendDisplay is percent, and trendValue === value
|
|
2042
|
+
} // if trendDisplay is percent, and trendValue === value
|
|
1850
2043
|
// the trend percent = trendValue / (value - trendValue) will return Infinity
|
|
2044
|
+
|
|
2045
|
+
|
|
1851
2046
|
var isInvalidTrend = trendDisplay === 'percent' && trendValue === parseFloat(majorValue);
|
|
2047
|
+
|
|
1852
2048
|
if (trendValue === 0 || isInvalidTrend) {
|
|
1853
2049
|
return defaultFontColor;
|
|
1854
2050
|
}
|
|
2051
|
+
|
|
1855
2052
|
return trendValue > 0 ? _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__["DELTA_GREEN"] : _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__["DELTA_RED"];
|
|
1856
2053
|
};
|
|
1857
|
-
|
|
1858
2054
|
/**
|
|
1859
2055
|
* Computes visualization properties for display component
|
|
1860
2056
|
* @method computeColors
|
|
@@ -1867,6 +2063,7 @@ var getTrendColor = function getTrendColor(_ref3) {
|
|
|
1867
2063
|
* @returns {String} trendColor
|
|
1868
2064
|
* @returns {String} underLabelColor
|
|
1869
2065
|
*/
|
|
2066
|
+
|
|
1870
2067
|
var computeColors = function computeColors(props, defaultColors) {
|
|
1871
2068
|
var backgroundColor = getFormattedColor(props.backgroundColor, defaultColors.defaultBackgroundColor);
|
|
1872
2069
|
var backgroundEnabled = hasBackground(backgroundColor);
|
|
@@ -1883,8 +2080,8 @@ var computeColors = function computeColors(props, defaultColors) {
|
|
|
1883
2080
|
customizedBgColor: props.backgroundColor,
|
|
1884
2081
|
trendDisplay: props.trendDisplay,
|
|
1885
2082
|
defaultColors: defaultColors
|
|
1886
|
-
});
|
|
1887
|
-
|
|
2083
|
+
}); // todo: need change it to not depend on majorColor
|
|
2084
|
+
|
|
1888
2085
|
var underLabelColor = majorColor;
|
|
1889
2086
|
return {
|
|
1890
2087
|
backgroundColor: backgroundColor,
|
|
@@ -1894,7 +2091,6 @@ var computeColors = function computeColors(props, defaultColors) {
|
|
|
1894
2091
|
underLabelColor: underLabelColor
|
|
1895
2092
|
};
|
|
1896
2093
|
};
|
|
1897
|
-
|
|
1898
2094
|
/**
|
|
1899
2095
|
* Format and return the value (major/trend)
|
|
1900
2096
|
* @method computeText
|
|
@@ -1905,21 +2101,21 @@ var computeColors = function computeColors(props, defaultColors) {
|
|
|
1905
2101
|
* @param {Bool} props.shouldAbbreviateTrendValue
|
|
1906
2102
|
* @returns {Number} major or trend text
|
|
1907
2103
|
*/
|
|
2104
|
+
|
|
1908
2105
|
var computeText = function computeText(_ref4) {
|
|
1909
2106
|
var value = _ref4.value,
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
2107
|
+
numberPrecision = _ref4.numberPrecision,
|
|
2108
|
+
shouldUseThousandSeparators = _ref4.shouldUseThousandSeparators,
|
|
2109
|
+
shouldAbbreviateTrendValue = _ref4.shouldAbbreviateTrendValue;
|
|
1913
2110
|
var text = Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__["isNumerial"])(value) ? Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__["formatNumber"])(value, numberPrecision, {
|
|
1914
2111
|
useThousandSeparators: shouldUseThousandSeparators,
|
|
1915
2112
|
// todo: need update formatNumber
|
|
1916
2113
|
useTrendUnits: shouldAbbreviateTrendValue
|
|
1917
|
-
}) : value;
|
|
1918
|
-
|
|
2114
|
+
}) : value; // When text is undefined, return empty string
|
|
2115
|
+
|
|
1919
2116
|
text = text || '';
|
|
1920
2117
|
return text;
|
|
1921
2118
|
};
|
|
1922
|
-
|
|
1923
2119
|
/*
|
|
1924
2120
|
* @method getMajorText
|
|
1925
2121
|
* @param {Object} props
|
|
@@ -1928,10 +2124,11 @@ var computeText = function computeText(_ref4) {
|
|
|
1928
2124
|
* @param {Bool} props.shouldUseThousandSeparators
|
|
1929
2125
|
* @returns {String} majorText
|
|
1930
2126
|
*/
|
|
2127
|
+
|
|
1931
2128
|
var getMajorText = function getMajorText(_ref5) {
|
|
1932
2129
|
var majorValue = _ref5.majorValue,
|
|
1933
|
-
|
|
1934
|
-
|
|
2130
|
+
numberPrecision = _ref5.numberPrecision,
|
|
2131
|
+
shouldUseThousandSeparators = _ref5.shouldUseThousandSeparators;
|
|
1935
2132
|
return computeText({
|
|
1936
2133
|
value: majorValue === null ? 'N/A' : majorValue,
|
|
1937
2134
|
// if majorValue is null, use `N/A`.
|
|
@@ -1940,7 +2137,6 @@ var getMajorText = function getMajorText(_ref5) {
|
|
|
1940
2137
|
shouldAbbreviateTrendValue: false
|
|
1941
2138
|
});
|
|
1942
2139
|
};
|
|
1943
|
-
|
|
1944
2140
|
/*
|
|
1945
2141
|
* @method getTrendText
|
|
1946
2142
|
* @param {Object} props
|
|
@@ -1952,13 +2148,15 @@ var getMajorText = function getMajorText(_ref5) {
|
|
|
1952
2148
|
* @param {Bool} props.shouldAbbreviateTrendValue
|
|
1953
2149
|
* @returns {String} trendText
|
|
1954
2150
|
*/
|
|
2151
|
+
|
|
1955
2152
|
var getTrendText = function getTrendText(_ref6) {
|
|
1956
2153
|
var majorValue = _ref6.majorValue,
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
2154
|
+
trendValue = _ref6.trendValue,
|
|
2155
|
+
trendDisplay = _ref6.trendDisplay,
|
|
2156
|
+
numberPrecision = _ref6.numberPrecision,
|
|
2157
|
+
shouldUseThousandSeparators = _ref6.shouldUseThousandSeparators,
|
|
2158
|
+
shouldAbbreviateTrendValue = _ref6.shouldAbbreviateTrendValue;
|
|
2159
|
+
|
|
1962
2160
|
var compute = function compute(value) {
|
|
1963
2161
|
return computeText({
|
|
1964
2162
|
value: value,
|
|
@@ -1967,25 +2165,31 @@ var getTrendText = function getTrendText(_ref6) {
|
|
|
1967
2165
|
shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
|
|
1968
2166
|
});
|
|
1969
2167
|
};
|
|
2168
|
+
|
|
1970
2169
|
if (trendValue === '' || !Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__["isNumerial"])(trendValue)) {
|
|
1971
2170
|
return '';
|
|
1972
2171
|
}
|
|
2172
|
+
|
|
1973
2173
|
var showPercent = trendDisplay === 'percent';
|
|
2174
|
+
|
|
1974
2175
|
if (!showPercent) {
|
|
1975
2176
|
return compute(trendValue);
|
|
1976
2177
|
}
|
|
2178
|
+
|
|
1977
2179
|
var diff = Math.abs(trendValue - majorValue);
|
|
1978
2180
|
var val = Math.round(trendValue / diff * 100);
|
|
2181
|
+
|
|
1979
2182
|
if (trendValue === 0 && diff === 0) {
|
|
1980
2183
|
val = 0;
|
|
1981
2184
|
}
|
|
2185
|
+
|
|
1982
2186
|
if (!Number.isFinite(val)) {
|
|
1983
2187
|
return 'N/A';
|
|
1984
2188
|
}
|
|
2189
|
+
|
|
1985
2190
|
var text = compute(val);
|
|
1986
2191
|
return "".concat(text, "%");
|
|
1987
2192
|
};
|
|
1988
|
-
|
|
1989
2193
|
/**
|
|
1990
2194
|
* Helper to determine the font size for an element
|
|
1991
2195
|
* @method computeFontSize
|
|
@@ -1997,16 +2201,16 @@ var getTrendText = function getTrendText(_ref6) {
|
|
|
1997
2201
|
* @param {String} [fontWeight='normal'] Boldness of font
|
|
1998
2202
|
* @returns {Number} The size to use for fontSize styles
|
|
1999
2203
|
*/
|
|
2204
|
+
|
|
2000
2205
|
var computeFontSize = function computeFontSize(text, _ref7) {
|
|
2001
2206
|
var width = _ref7.width,
|
|
2002
|
-
|
|
2207
|
+
height = _ref7.height;
|
|
2003
2208
|
var fontFamily = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_FONT_FAMILY;
|
|
2004
2209
|
var fontWeight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'normal';
|
|
2005
2210
|
var widthInDefaultFont = Object(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__["computeTextSize"])(text, "".concat(fontWeight, " ").concat(DEFAULT_FONT, "px ").concat(fontFamily));
|
|
2006
2211
|
var fontSize = Math.min(width / widthInDefaultFont * DEFAULT_FONT, height / DEFAULT_FONT * DEFAULT_FONT);
|
|
2007
2212
|
return parseInt(fontSize, 10);
|
|
2008
2213
|
};
|
|
2009
|
-
|
|
2010
2214
|
/*
|
|
2011
2215
|
* @method getMajorFontSize
|
|
2012
2216
|
* @param {Object} props
|
|
@@ -2017,20 +2221,20 @@ var computeFontSize = function computeFontSize(text, _ref7) {
|
|
|
2017
2221
|
* @param {Number} props.spaceRatio
|
|
2018
2222
|
* @returns {Number} majorFontSize
|
|
2019
2223
|
*/
|
|
2224
|
+
|
|
2020
2225
|
var getMajorFontSize = function getMajorFontSize(_ref8) {
|
|
2021
2226
|
var width = _ref8.width,
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2227
|
+
height = _ref8.height,
|
|
2228
|
+
unit = _ref8.unit,
|
|
2229
|
+
majorText = _ref8.majorText,
|
|
2230
|
+
_ref8$spaceRatio = _ref8.spaceRatio,
|
|
2231
|
+
spaceRatio = _ref8$spaceRatio === void 0 ? 1 : _ref8$spaceRatio;
|
|
2027
2232
|
var majorTextCalc = unit ? "".concat(unit).concat(majorText) : majorText;
|
|
2028
2233
|
return computeFontSize(majorTextCalc, {
|
|
2029
2234
|
width: width * spaceRatio,
|
|
2030
2235
|
height: height
|
|
2031
2236
|
});
|
|
2032
2237
|
};
|
|
2033
|
-
|
|
2034
2238
|
/*
|
|
2035
2239
|
* @method getTrendFontSize
|
|
2036
2240
|
* @param {Object} props
|
|
@@ -2040,13 +2244,15 @@ var getMajorFontSize = function getMajorFontSize(_ref8) {
|
|
|
2040
2244
|
* @param {Number} props.spaceRatio
|
|
2041
2245
|
* @returns {Number} trendFontSize
|
|
2042
2246
|
*/
|
|
2247
|
+
|
|
2043
2248
|
var getTrendFontSize = function getTrendFontSize(_ref9) {
|
|
2044
2249
|
var width = _ref9.width,
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2250
|
+
height = _ref9.height,
|
|
2251
|
+
trendText = _ref9.trendText,
|
|
2252
|
+
_ref9$spaceRatio = _ref9.spaceRatio,
|
|
2253
|
+
spaceRatio = _ref9$spaceRatio === void 0 ? 1 : _ref9$spaceRatio;
|
|
2049
2254
|
var trendFontSize = 12;
|
|
2255
|
+
|
|
2050
2256
|
if (spaceRatio > 0) {
|
|
2051
2257
|
trendFontSize = computeFontSize(trendText, {
|
|
2052
2258
|
width: width * spaceRatio,
|
|
@@ -2054,18 +2260,18 @@ var getTrendFontSize = function getTrendFontSize(_ref9) {
|
|
|
2054
2260
|
});
|
|
2055
2261
|
trendFontSize = parseInt(trendFontSize, 10) * spaceRatio;
|
|
2056
2262
|
}
|
|
2263
|
+
|
|
2057
2264
|
return trendFontSize;
|
|
2058
2265
|
};
|
|
2059
|
-
|
|
2060
2266
|
/*
|
|
2061
2267
|
* The height of underLabel should no more than 12px
|
|
2062
2268
|
* @param {Number} height
|
|
2063
2269
|
* @return {Number} height || DEFAULT_FONT
|
|
2064
2270
|
*/
|
|
2271
|
+
|
|
2065
2272
|
var getUnderLabelHeight = function getUnderLabelHeight(height) {
|
|
2066
2273
|
return height > DEFAULT_FONT ? DEFAULT_FONT : height;
|
|
2067
2274
|
};
|
|
2068
|
-
|
|
2069
2275
|
/*
|
|
2070
2276
|
* @param {Object} config
|
|
2071
2277
|
* @param {String} underLabel
|
|
@@ -2073,19 +2279,18 @@ var getUnderLabelHeight = function getUnderLabelHeight(height) {
|
|
|
2073
2279
|
* @param {Number} height height of underLabel
|
|
2074
2280
|
* @param {Number} fond size of underLabel
|
|
2075
2281
|
*/
|
|
2282
|
+
|
|
2076
2283
|
var getUnderLabel = function getUnderLabel(_ref10) {
|
|
2077
2284
|
var underLabel = _ref10.underLabel,
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
return (
|
|
2081
|
-
// todo: may need truncate underLabel later
|
|
2285
|
+
width = _ref10.width,
|
|
2286
|
+
height = _ref10.height;
|
|
2287
|
+
return (// todo: may need truncate underLabel later
|
|
2082
2288
|
computeFontSize(underLabel, {
|
|
2083
2289
|
width: width,
|
|
2084
2290
|
height: height
|
|
2085
2291
|
})
|
|
2086
2292
|
);
|
|
2087
2293
|
};
|
|
2088
|
-
|
|
2089
2294
|
/**
|
|
2090
2295
|
* Compute value and font size for major and trend
|
|
2091
2296
|
* @method getMajorAndTrend
|
|
@@ -2103,18 +2308,19 @@ var getUnderLabel = function getUnderLabel(_ref10) {
|
|
|
2103
2308
|
* @param {Bool} props.shouldAbbreviateTrendValue
|
|
2104
2309
|
* @returns {Number, Number, Number, Number} Major text, trend text, major text size, trend text size
|
|
2105
2310
|
*/
|
|
2311
|
+
|
|
2106
2312
|
var getMajorAndTrend = function getMajorAndTrend(_ref11) {
|
|
2107
2313
|
var width = _ref11.width,
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2314
|
+
height = _ref11.height,
|
|
2315
|
+
majorValue = _ref11.majorValue,
|
|
2316
|
+
trendValue = _ref11.trendValue,
|
|
2317
|
+
majorFontSize = _ref11.majorFontSize,
|
|
2318
|
+
trendFontSize = _ref11.trendFontSize,
|
|
2319
|
+
trendDisplay = _ref11.trendDisplay,
|
|
2320
|
+
unit = _ref11.unit,
|
|
2321
|
+
numberPrecision = _ref11.numberPrecision,
|
|
2322
|
+
shouldUseThousandSeparators = _ref11.shouldUseThousandSeparators,
|
|
2323
|
+
shouldAbbreviateTrendValue = _ref11.shouldAbbreviateTrendValue;
|
|
2118
2324
|
var majorTextSpaceRatio = Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__["isNumerial"])(trendValue) && shouldShowTrend(trendDisplay) ? 0.6 : 1;
|
|
2119
2325
|
var textContentWidth = width * 0.9;
|
|
2120
2326
|
var textContentHeight = height * 0.9;
|
|
@@ -2151,7 +2357,6 @@ var getMajorAndTrend = function getMajorAndTrend(_ref11) {
|
|
|
2151
2357
|
trendTextFontSize: trendTextFontSize
|
|
2152
2358
|
};
|
|
2153
2359
|
};
|
|
2154
|
-
|
|
2155
2360
|
/*
|
|
2156
2361
|
* @method updateVizInSmallSpace
|
|
2157
2362
|
* @param {Object} props
|
|
@@ -2171,25 +2376,26 @@ var getMajorAndTrend = function getMajorAndTrend(_ref11) {
|
|
|
2171
2376
|
* @returns {Object} results.newMajorAndTrend
|
|
2172
2377
|
* @returns {Object} results.updatedProps
|
|
2173
2378
|
*/
|
|
2379
|
+
|
|
2174
2380
|
var updateVizInSmallSpace = function updateVizInSmallSpace(_ref12) {
|
|
2175
2381
|
var width = _ref12.width,
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2382
|
+
height = _ref12.height,
|
|
2383
|
+
toRemoveList = _ref12.toRemoveList,
|
|
2384
|
+
majorValue = _ref12.majorValue,
|
|
2385
|
+
trendValue = _ref12.trendValue,
|
|
2386
|
+
majorFontSize = _ref12.majorFontSize,
|
|
2387
|
+
trendFontSize = _ref12.trendFontSize,
|
|
2388
|
+
majorTextFontSize = _ref12.majorTextFontSize,
|
|
2389
|
+
unit = _ref12.unit,
|
|
2390
|
+
numberPrecision = _ref12.numberPrecision,
|
|
2391
|
+
shouldUseThousandSeparators = _ref12.shouldUseThousandSeparators,
|
|
2392
|
+
shouldAbbreviateTrendValue = _ref12.shouldAbbreviateTrendValue;
|
|
2187
2393
|
var removeIndex = 0;
|
|
2188
2394
|
var newProps = {}; // options need to be updated
|
|
2395
|
+
|
|
2189
2396
|
var newMajorAndTrend = {};
|
|
2190
|
-
var newTextSize = majorTextFontSize;
|
|
2397
|
+
var newTextSize = majorTextFontSize; // remove info on viz to make textFontSize >= 12px;
|
|
2191
2398
|
|
|
2192
|
-
// remove info on viz to make textFontSize >= 12px;
|
|
2193
2399
|
while (newTextSize < 12 && removeIndex < toRemoveList.length) {
|
|
2194
2400
|
var toRemove = toRemoveList[removeIndex];
|
|
2195
2401
|
newProps = _objectSpread(_objectSpread({}, newProps), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()({}, toRemove.key, toRemove.value));
|
|
@@ -2207,9 +2413,9 @@ var updateVizInSmallSpace = function updateVizInSmallSpace(_ref12) {
|
|
|
2207
2413
|
}, newProps));
|
|
2208
2414
|
newTextSize = newMajorAndTrend.majorTextFontSize;
|
|
2209
2415
|
removeIndex += 1;
|
|
2210
|
-
}
|
|
2416
|
+
} // truncate text if textFontSize is still less than 12
|
|
2417
|
+
|
|
2211
2418
|
|
|
2212
|
-
// truncate text if textFontSize is still less than 12
|
|
2213
2419
|
if (newTextSize < 12) {
|
|
2214
2420
|
var truncateValue = "".concat(majorValue.toString().slice(0, 3), "...");
|
|
2215
2421
|
newMajorAndTrend = getMajorAndTrend(_objectSpread({
|
|
@@ -2225,12 +2431,12 @@ var updateVizInSmallSpace = function updateVizInSmallSpace(_ref12) {
|
|
|
2225
2431
|
shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
|
|
2226
2432
|
}, newProps));
|
|
2227
2433
|
}
|
|
2434
|
+
|
|
2228
2435
|
return {
|
|
2229
2436
|
newMajorAndTrend: newMajorAndTrend,
|
|
2230
2437
|
updatedProps: newProps
|
|
2231
2438
|
};
|
|
2232
2439
|
};
|
|
2233
|
-
|
|
2234
2440
|
/*
|
|
2235
2441
|
* @method computeSingleValueContent
|
|
2236
2442
|
* @param {Object} props
|
|
@@ -2256,67 +2462,71 @@ var updateVizInSmallSpace = function updateVizInSmallSpace(_ref12) {
|
|
|
2256
2462
|
* @returns {String} results.majorValueTitle
|
|
2257
2463
|
* @returns {Object} results.smallVizProps
|
|
2258
2464
|
*/
|
|
2465
|
+
|
|
2259
2466
|
var computeSingleValueContent = function computeSingleValueContent(_ref13) {
|
|
2260
2467
|
var contentWidth = _ref13.contentWidth,
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2468
|
+
contentHeight = _ref13.contentHeight,
|
|
2469
|
+
containerWidth = _ref13.containerWidth,
|
|
2470
|
+
containerHeight = _ref13.containerHeight,
|
|
2471
|
+
majorValue = _ref13.majorValue,
|
|
2472
|
+
trendValue = _ref13.trendValue,
|
|
2473
|
+
majorFontSize = _ref13.majorFontSize,
|
|
2474
|
+
trendFontSize = _ref13.trendFontSize,
|
|
2475
|
+
trendDisplay = _ref13.trendDisplay,
|
|
2476
|
+
unit = _ref13.unit,
|
|
2477
|
+
numberPrecision = _ref13.numberPrecision,
|
|
2478
|
+
shouldUseThousandSeparators = _ref13.shouldUseThousandSeparators,
|
|
2479
|
+
shouldAbbreviateTrendValue = _ref13.shouldAbbreviateTrendValue,
|
|
2480
|
+
toRemoveList = _ref13.toRemoveList;
|
|
2481
|
+
|
|
2274
2482
|
var _getMajorAndTrend = getMajorAndTrend({
|
|
2483
|
+
majorValue: majorValue,
|
|
2484
|
+
trendValue: trendValue,
|
|
2485
|
+
majorFontSize: majorFontSize,
|
|
2486
|
+
trendFontSize: trendFontSize,
|
|
2487
|
+
trendDisplay: trendDisplay,
|
|
2488
|
+
width: contentWidth,
|
|
2489
|
+
height: contentHeight,
|
|
2490
|
+
unit: unit,
|
|
2491
|
+
numberPrecision: numberPrecision,
|
|
2492
|
+
shouldUseThousandSeparators: shouldUseThousandSeparators,
|
|
2493
|
+
shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
|
|
2494
|
+
}),
|
|
2495
|
+
majorText = _getMajorAndTrend.majorText,
|
|
2496
|
+
trendText = _getMajorAndTrend.trendText,
|
|
2497
|
+
majorTextFontSize = _getMajorAndTrend.majorTextFontSize,
|
|
2498
|
+
trendTextFontSize = _getMajorAndTrend.trendTextFontSize;
|
|
2499
|
+
|
|
2500
|
+
var majorValueTitle = majorText;
|
|
2501
|
+
var smallVizProps = {}; // update viz in small space
|
|
2502
|
+
// if textFontSize is less than 12, remove extra info like sparkline, trendvalue, unit
|
|
2503
|
+
// or truncate major value to make the major font size >= 12
|
|
2504
|
+
|
|
2505
|
+
if (majorTextFontSize < 12) {
|
|
2506
|
+
var _updateVizInSmallSpac = updateVizInSmallSpace({
|
|
2507
|
+
width: containerWidth,
|
|
2508
|
+
height: containerHeight,
|
|
2509
|
+
toRemoveList: toRemoveList,
|
|
2275
2510
|
majorValue: majorValue,
|
|
2276
2511
|
trendValue: trendValue,
|
|
2277
2512
|
majorFontSize: majorFontSize,
|
|
2278
2513
|
trendFontSize: trendFontSize,
|
|
2279
|
-
|
|
2280
|
-
width: contentWidth,
|
|
2281
|
-
height: contentHeight,
|
|
2514
|
+
majorTextFontSize: majorTextFontSize,
|
|
2282
2515
|
unit: unit,
|
|
2283
2516
|
numberPrecision: numberPrecision,
|
|
2284
2517
|
shouldUseThousandSeparators: shouldUseThousandSeparators,
|
|
2285
2518
|
shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
|
|
2286
2519
|
}),
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
majorTextFontSize = _getMajorAndTrend.majorTextFontSize,
|
|
2290
|
-
trendTextFontSize = _getMajorAndTrend.trendTextFontSize;
|
|
2291
|
-
var majorValueTitle = majorText;
|
|
2292
|
-
var smallVizProps = {};
|
|
2520
|
+
newMajorAndTrend = _updateVizInSmallSpac.newMajorAndTrend,
|
|
2521
|
+
updatedProps = _updateVizInSmallSpac.updatedProps;
|
|
2293
2522
|
|
|
2294
|
-
// update viz in small space
|
|
2295
|
-
// if textFontSize is less than 12, remove extra info like sparkline, trendvalue, unit
|
|
2296
|
-
// or truncate major value to make the major font size >= 12
|
|
2297
|
-
if (majorTextFontSize < 12) {
|
|
2298
|
-
var _updateVizInSmallSpac = updateVizInSmallSpace({
|
|
2299
|
-
width: containerWidth,
|
|
2300
|
-
height: containerHeight,
|
|
2301
|
-
toRemoveList: toRemoveList,
|
|
2302
|
-
majorValue: majorValue,
|
|
2303
|
-
trendValue: trendValue,
|
|
2304
|
-
majorFontSize: majorFontSize,
|
|
2305
|
-
trendFontSize: trendFontSize,
|
|
2306
|
-
majorTextFontSize: majorTextFontSize,
|
|
2307
|
-
unit: unit,
|
|
2308
|
-
numberPrecision: numberPrecision,
|
|
2309
|
-
shouldUseThousandSeparators: shouldUseThousandSeparators,
|
|
2310
|
-
shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
|
|
2311
|
-
}),
|
|
2312
|
-
newMajorAndTrend = _updateVizInSmallSpac.newMajorAndTrend,
|
|
2313
|
-
updatedProps = _updateVizInSmallSpac.updatedProps;
|
|
2314
2523
|
majorText = newMajorAndTrend.majorText;
|
|
2315
2524
|
trendText = newMajorAndTrend.trendText;
|
|
2316
2525
|
majorTextFontSize = newMajorAndTrend.majorTextFontSize;
|
|
2317
2526
|
trendTextFontSize = newMajorAndTrend.trendTextFontSize;
|
|
2318
2527
|
smallVizProps = updatedProps;
|
|
2319
2528
|
}
|
|
2529
|
+
|
|
2320
2530
|
return {
|
|
2321
2531
|
majorText: majorText,
|
|
2322
2532
|
trendText: trendText,
|
|
@@ -2328,17 +2538,17 @@ var computeSingleValueContent = function computeSingleValueContent(_ref13) {
|
|
|
2328
2538
|
};
|
|
2329
2539
|
var minimallyTruncateStringToWidth = function minimallyTruncateStringToWidth(_ref14) {
|
|
2330
2540
|
var text = _ref14.text,
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2541
|
+
_ref14$fontSize = _ref14.fontSize,
|
|
2542
|
+
fontSize = _ref14$fontSize === void 0 ? DEFAULT_FONT : _ref14$fontSize,
|
|
2543
|
+
_ref14$fontFamily = _ref14.fontFamily,
|
|
2544
|
+
fontFamily = _ref14$fontFamily === void 0 ? DEFAULT_FONT_FAMILY : _ref14$fontFamily,
|
|
2545
|
+
_ref14$fontWeight = _ref14.fontWeight,
|
|
2546
|
+
fontWeight = _ref14$fontWeight === void 0 ? 'normal' : _ref14$fontWeight,
|
|
2547
|
+
containerWidth = _ref14.containerWidth;
|
|
2338
2548
|
var textWidth = Object(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__["computeTextSize"])(text, "".concat(fontWeight, " ").concat(fontSize, "px ").concat(fontFamily));
|
|
2339
2549
|
var modifiedText = text;
|
|
2340
|
-
var ellipsesLength = Object(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__["computeTextSize"])('...', "".concat(fontWeight, " ").concat(fontSize, "px ").concat(fontFamily));
|
|
2341
|
-
|
|
2550
|
+
var ellipsesLength = Object(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__["computeTextSize"])('...', "".concat(fontWeight, " ").concat(fontSize, "px ").concat(fontFamily)); // `containerWidth - ellipsesLength > 0` condition ensures space even exists for text.
|
|
2551
|
+
|
|
2342
2552
|
if (containerWidth - ellipsesLength > 0 && textWidth > containerWidth) {
|
|
2343
2553
|
// Truncates the content such that the truncated value + ellipses fit within the allocated space for the ellipses.
|
|
2344
2554
|
// `textWidth > containerWidth - ellipsesLength` condition checks if text + ellipses exceeds container width.
|
|
@@ -2347,11 +2557,12 @@ var minimallyTruncateStringToWidth = function minimallyTruncateStringToWidth(_re
|
|
|
2347
2557
|
modifiedText = modifiedText.substring(0, modifiedText.length - 1);
|
|
2348
2558
|
textWidth = Object(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__["computeTextSize"])(modifiedText, "normal ".concat(fontSize, "px ").concat(fontFamily));
|
|
2349
2559
|
}
|
|
2560
|
+
|
|
2350
2561
|
modifiedText = "".concat(modifiedText, "...");
|
|
2351
2562
|
}
|
|
2563
|
+
|
|
2352
2564
|
return modifiedText;
|
|
2353
2565
|
};
|
|
2354
|
-
|
|
2355
2566
|
/*
|
|
2356
2567
|
* @method computeSingleValueRadialContent
|
|
2357
2568
|
* @param {Object} props
|
|
@@ -2378,44 +2589,46 @@ var minimallyTruncateStringToWidth = function minimallyTruncateStringToWidth(_re
|
|
|
2378
2589
|
* @returns {String} results.majorValueTitle
|
|
2379
2590
|
* @returns {Object} results.smallVizProps
|
|
2380
2591
|
*/
|
|
2592
|
+
|
|
2381
2593
|
var computeSingleValueRadialContent = function computeSingleValueRadialContent(_ref15) {
|
|
2382
2594
|
var contentWidth = _ref15.contentWidth,
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2595
|
+
contentHeight = _ref15.contentHeight,
|
|
2596
|
+
containerWidth = _ref15.containerWidth,
|
|
2597
|
+
containerHeight = _ref15.containerHeight,
|
|
2598
|
+
majorValue = _ref15.majorValue,
|
|
2599
|
+
trendValue = _ref15.trendValue,
|
|
2600
|
+
majorFontSize = _ref15.majorFontSize,
|
|
2601
|
+
trendFontSize = _ref15.trendFontSize,
|
|
2602
|
+
trendDisplay = _ref15.trendDisplay,
|
|
2603
|
+
unit = _ref15.unit,
|
|
2604
|
+
numberPrecision = _ref15.numberPrecision,
|
|
2605
|
+
shouldUseThousandSeparators = _ref15.shouldUseThousandSeparators,
|
|
2606
|
+
shouldAbbreviateTrendValue = _ref15.shouldAbbreviateTrendValue,
|
|
2607
|
+
smallViz = _ref15.smallViz;
|
|
2608
|
+
|
|
2396
2609
|
var _getMajorAndTrend2 = getMajorAndTrend({
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
var majorValueTitle = majorText;
|
|
2414
|
-
var smallVizProps = {};
|
|
2610
|
+
majorValue: majorValue,
|
|
2611
|
+
trendValue: trendValue,
|
|
2612
|
+
majorFontSize: majorFontSize,
|
|
2613
|
+
trendFontSize: trendFontSize,
|
|
2614
|
+
trendDisplay: trendDisplay,
|
|
2615
|
+
width: contentWidth,
|
|
2616
|
+
height: contentHeight,
|
|
2617
|
+
unit: unit,
|
|
2618
|
+
numberPrecision: numberPrecision,
|
|
2619
|
+
shouldUseThousandSeparators: shouldUseThousandSeparators,
|
|
2620
|
+
shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
|
|
2621
|
+
}),
|
|
2622
|
+
majorText = _getMajorAndTrend2.majorText,
|
|
2623
|
+
trendText = _getMajorAndTrend2.trendText,
|
|
2624
|
+
majorTextFontSize = _getMajorAndTrend2.majorTextFontSize,
|
|
2625
|
+
trendTextFontSize = _getMajorAndTrend2.trendTextFontSize;
|
|
2415
2626
|
|
|
2416
|
-
|
|
2627
|
+
var majorValueTitle = majorText;
|
|
2628
|
+
var smallVizProps = {}; // custom logic for viz in small space
|
|
2417
2629
|
// if not showing the radial graph (if `smallViz` is true), then compute truncated major value
|
|
2418
2630
|
// and font sizes
|
|
2631
|
+
|
|
2419
2632
|
if (smallViz) {
|
|
2420
2633
|
var truncateValue = minimallyTruncateStringToWidth({
|
|
2421
2634
|
text: majorValue,
|
|
@@ -2423,6 +2636,7 @@ var computeSingleValueRadialContent = function computeSingleValueRadialContent(_
|
|
|
2423
2636
|
fontSize: 12,
|
|
2424
2637
|
containerWidth: containerWidth
|
|
2425
2638
|
});
|
|
2639
|
+
|
|
2426
2640
|
var _getMajorAndTrend3 = getMajorAndTrend({
|
|
2427
2641
|
majorValue: truncateValue,
|
|
2428
2642
|
trendValue: trendValue,
|
|
@@ -2436,6 +2650,7 @@ var computeSingleValueRadialContent = function computeSingleValueRadialContent(_
|
|
|
2436
2650
|
shouldUseThousandSeparators: shouldUseThousandSeparators,
|
|
2437
2651
|
shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
|
|
2438
2652
|
});
|
|
2653
|
+
|
|
2439
2654
|
majorText = _getMajorAndTrend3.majorText;
|
|
2440
2655
|
trendText = _getMajorAndTrend3.trendText;
|
|
2441
2656
|
majorTextFontSize = _getMajorAndTrend3.majorTextFontSize;
|
|
@@ -2445,6 +2660,7 @@ var computeSingleValueRadialContent = function computeSingleValueRadialContent(_
|
|
|
2445
2660
|
unit: unit
|
|
2446
2661
|
};
|
|
2447
2662
|
}
|
|
2663
|
+
|
|
2448
2664
|
return {
|
|
2449
2665
|
majorText: majorText,
|
|
2450
2666
|
trendText: trendText,
|
|
@@ -2454,7 +2670,6 @@ var computeSingleValueRadialContent = function computeSingleValueRadialContent(_
|
|
|
2454
2670
|
smallVizProps: smallVizProps
|
|
2455
2671
|
};
|
|
2456
2672
|
};
|
|
2457
|
-
|
|
2458
2673
|
/**
|
|
2459
2674
|
* Get the colors for a graph
|
|
2460
2675
|
*
|
|
@@ -2467,21 +2682,22 @@ var computeSingleValueRadialContent = function computeSingleValueRadialContent(_
|
|
|
2467
2682
|
* @returns {Object} { background, stroke } colors
|
|
2468
2683
|
* @private
|
|
2469
2684
|
*/
|
|
2685
|
+
|
|
2470
2686
|
var getGraphColors = function getGraphColors(_ref16) {
|
|
2471
2687
|
var backgroundEnabled = _ref16.backgroundEnabled,
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2688
|
+
backgroundColor = _ref16.backgroundColor,
|
|
2689
|
+
defaultColors = _ref16.defaultColors,
|
|
2690
|
+
customColorFormatter = _ref16.customColorFormatter; // Only do custom colors in block mode
|
|
2691
|
+
|
|
2476
2692
|
if (backgroundEnabled) {
|
|
2477
2693
|
// Check if the user defined colors to use
|
|
2478
2694
|
if (backgroundColor && typeof customColorFormatter === 'function') {
|
|
2479
2695
|
return customColorFormatter(backgroundColor);
|
|
2480
2696
|
}
|
|
2481
2697
|
}
|
|
2698
|
+
|
|
2482
2699
|
return defaultColors.none;
|
|
2483
2700
|
};
|
|
2484
|
-
|
|
2485
2701
|
/**
|
|
2486
2702
|
* Adjust rgb value if it equals to 0 or 255
|
|
2487
2703
|
* @method adjustRGB
|
|
@@ -2490,16 +2706,18 @@ var getGraphColors = function getGraphColors(_ref16) {
|
|
|
2490
2706
|
* @returns {Number} adjusted rgb
|
|
2491
2707
|
* @private
|
|
2492
2708
|
*/
|
|
2709
|
+
|
|
2493
2710
|
var adjustRGB = function adjustRGB(rgb, delta) {
|
|
2494
2711
|
if (rgb === 255) {
|
|
2495
2712
|
return rgb - delta;
|
|
2496
2713
|
}
|
|
2714
|
+
|
|
2497
2715
|
if (rgb === 0) {
|
|
2498
2716
|
return rgb + delta;
|
|
2499
2717
|
}
|
|
2718
|
+
|
|
2500
2719
|
return rgb;
|
|
2501
2720
|
};
|
|
2502
|
-
|
|
2503
2721
|
/**
|
|
2504
2722
|
* Modifies colors by multiplying by a given ratio
|
|
2505
2723
|
* @method changeColor
|
|
@@ -2508,18 +2726,16 @@ var adjustRGB = function adjustRGB(rgb, delta) {
|
|
|
2508
2726
|
* @returns {String} new color
|
|
2509
2727
|
* @private
|
|
2510
2728
|
*/
|
|
2729
|
+
|
|
2511
2730
|
var changeColor = function changeColor(color, ratio) {
|
|
2512
2731
|
var hex = color.replace(/(0x|#)/, '');
|
|
2513
2732
|
var r = parseInt(hex.substr(0, 2), 16);
|
|
2514
2733
|
var g = parseInt(hex.substr(2, 2), 16);
|
|
2515
|
-
var b = parseInt(hex.substr(4, 2), 16);
|
|
2734
|
+
var b = parseInt(hex.substr(4, 2), 16); // Multiply by given ratio, make sure is between 0 and 255;
|
|
2516
2735
|
|
|
2517
|
-
// Multiply by given ratio, make sure is between 0 and 255;
|
|
2518
2736
|
var newR = Math.max(Math.min(Math.floor(r * ratio), 255), 0);
|
|
2519
2737
|
var newG = Math.max(Math.min(Math.floor(g * ratio), 255), 0);
|
|
2520
|
-
var newB = Math.max(Math.min(Math.floor(b * ratio), 255), 0);
|
|
2521
|
-
|
|
2522
|
-
// If the color is not changed
|
|
2738
|
+
var newB = Math.max(Math.min(Math.floor(b * ratio), 255), 0); // If the color is not changed
|
|
2523
2739
|
// case 1: the color is (0, 0 0)
|
|
2524
2740
|
// lighten color (80, 80, 80)
|
|
2525
2741
|
// darken color (40, 40, 40)
|
|
@@ -2528,6 +2744,7 @@ var changeColor = function changeColor(color, ratio) {
|
|
|
2528
2744
|
// darken color (175, 175, 175)
|
|
2529
2745
|
// case 3: the color is e.g. (0, 255, 0)
|
|
2530
2746
|
// new color (20, 235, 20)
|
|
2747
|
+
|
|
2531
2748
|
if (newR === r && newG === g && newB === b) {
|
|
2532
2749
|
if (newR === 0 && newG === 0 && newB === 0) {
|
|
2533
2750
|
if (ratio > 1) {
|
|
@@ -2555,9 +2772,9 @@ var changeColor = function changeColor(color, ratio) {
|
|
|
2555
2772
|
newB = adjustRGB(newB, 20);
|
|
2556
2773
|
}
|
|
2557
2774
|
}
|
|
2775
|
+
|
|
2558
2776
|
return "#".concat(newR.toString(16).padStart(2, 0)) + "".concat(newG.toString(16).padStart(2, 0)) + "".concat(newB.toString(16).padStart(2, 0));
|
|
2559
2777
|
};
|
|
2560
|
-
|
|
2561
2778
|
/**
|
|
2562
2779
|
* Lighten a given color
|
|
2563
2780
|
* @method lighten
|
|
@@ -2565,10 +2782,11 @@ var changeColor = function changeColor(color, ratio) {
|
|
|
2565
2782
|
* @returns {String}
|
|
2566
2783
|
* @private
|
|
2567
2784
|
*/
|
|
2785
|
+
|
|
2786
|
+
|
|
2568
2787
|
var lighten = function lighten(color) {
|
|
2569
2788
|
return changeColor(color, 1.3);
|
|
2570
2789
|
};
|
|
2571
|
-
|
|
2572
2790
|
/**
|
|
2573
2791
|
* Darkens a given color
|
|
2574
2792
|
* @method darken
|
|
@@ -2576,10 +2794,10 @@ var lighten = function lighten(color) {
|
|
|
2576
2794
|
* @returns {String}
|
|
2577
2795
|
* @private
|
|
2578
2796
|
*/
|
|
2797
|
+
|
|
2579
2798
|
var darken = function darken(color) {
|
|
2580
2799
|
return changeColor(color, 0.5);
|
|
2581
2800
|
};
|
|
2582
|
-
|
|
2583
2801
|
/** consistent token structure: handle callback to add value and name in event payload
|
|
2584
2802
|
* @method handleValueClickCallback
|
|
2585
2803
|
* @param {Object} ev
|
|
@@ -2588,6 +2806,7 @@ var darken = function darken(color) {
|
|
|
2588
2806
|
* @param {Number} trendValue
|
|
2589
2807
|
* @param {Function} onValueClick
|
|
2590
2808
|
*/
|
|
2809
|
+
|
|
2591
2810
|
var handleValueClickCallback = function handleValueClickCallback(ev, majorValue, majorValueField, trendValue, onValueClick) {
|
|
2592
2811
|
var trellisEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
2593
2812
|
var trellisSplityBy = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
|
|
@@ -2597,12 +2816,14 @@ var handleValueClickCallback = function handleValueClickCallback(ev, majorValue,
|
|
|
2597
2816
|
value: majorValue,
|
|
2598
2817
|
name: majorValueField
|
|
2599
2818
|
};
|
|
2819
|
+
|
|
2600
2820
|
if (trellisEnabled) {
|
|
2601
2821
|
payload = _objectSpread(_objectSpread({}, payload), {}, {
|
|
2602
2822
|
'trellis.name': trellisSplityBy,
|
|
2603
2823
|
'trellis.value': trellisKey
|
|
2604
2824
|
});
|
|
2605
2825
|
}
|
|
2826
|
+
|
|
2606
2827
|
return onValueClick(_objectSpread(_objectSpread({}, ev), {}, {
|
|
2607
2828
|
payload: payload
|
|
2608
2829
|
}));
|
|
@@ -2613,35 +2834,35 @@ var handleValueClickCallback = function handleValueClickCallback(ev, majorValue,
|
|
|
2613
2834
|
/***/ 25:
|
|
2614
2835
|
/***/ (function(module, exports) {
|
|
2615
2836
|
|
|
2616
|
-
module.exports = require("@splunk/
|
|
2837
|
+
module.exports = require("@splunk/ui-utils/id");
|
|
2617
2838
|
|
|
2618
2839
|
/***/ }),
|
|
2619
2840
|
|
|
2620
2841
|
/***/ 26:
|
|
2621
2842
|
/***/ (function(module, exports) {
|
|
2622
2843
|
|
|
2623
|
-
module.exports = require("@splunk/
|
|
2844
|
+
module.exports = require("@splunk/visualization-context/TimezoneContext");
|
|
2624
2845
|
|
|
2625
2846
|
/***/ }),
|
|
2626
2847
|
|
|
2627
2848
|
/***/ 27:
|
|
2628
2849
|
/***/ (function(module, exports) {
|
|
2629
2850
|
|
|
2630
|
-
module.exports = require("@splunk/visualizations-shared/
|
|
2851
|
+
module.exports = require("@splunk/visualizations-shared/hocUtils");
|
|
2631
2852
|
|
|
2632
2853
|
/***/ }),
|
|
2633
2854
|
|
|
2634
2855
|
/***/ 28:
|
|
2635
2856
|
/***/ (function(module, exports) {
|
|
2636
2857
|
|
|
2637
|
-
module.exports = require("@splunk/visualizations-shared/
|
|
2858
|
+
module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
|
|
2638
2859
|
|
|
2639
2860
|
/***/ }),
|
|
2640
2861
|
|
|
2641
2862
|
/***/ 29:
|
|
2642
2863
|
/***/ (function(module, exports) {
|
|
2643
2864
|
|
|
2644
|
-
module.exports = require("@splunk/
|
|
2865
|
+
module.exports = require("@splunk/visualizations-shared/propUtils");
|
|
2645
2866
|
|
|
2646
2867
|
/***/ }),
|
|
2647
2868
|
|
|
@@ -2655,11 +2876,18 @@ module.exports = require("lodash");
|
|
|
2655
2876
|
/***/ 30:
|
|
2656
2877
|
/***/ (function(module, exports) {
|
|
2657
2878
|
|
|
2658
|
-
module.exports = require("@splunk/
|
|
2879
|
+
module.exports = require("@splunk/visualization-encoding/Options");
|
|
2659
2880
|
|
|
2660
2881
|
/***/ }),
|
|
2661
2882
|
|
|
2662
2883
|
/***/ 31:
|
|
2884
|
+
/***/ (function(module, exports) {
|
|
2885
|
+
|
|
2886
|
+
module.exports = require("@splunk/visualizations-shared/numberUtils");
|
|
2887
|
+
|
|
2888
|
+
/***/ }),
|
|
2889
|
+
|
|
2890
|
+
/***/ 32:
|
|
2663
2891
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2664
2892
|
|
|
2665
2893
|
"use strict";
|
|
@@ -2669,11 +2897,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2669
2897
|
value: true
|
|
2670
2898
|
});
|
|
2671
2899
|
exports.shouldShowIconPlaceholder = void 0;
|
|
2900
|
+
|
|
2672
2901
|
var React = __webpack_require__(1);
|
|
2902
|
+
|
|
2673
2903
|
var T = __webpack_require__(0);
|
|
2904
|
+
|
|
2674
2905
|
var lodash_1 = __webpack_require__(3);
|
|
2906
|
+
|
|
2675
2907
|
var i18n_1 = __webpack_require__(2);
|
|
2908
|
+
|
|
2676
2909
|
var Message_1 = __webpack_require__(10);
|
|
2910
|
+
|
|
2677
2911
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
2678
2912
|
/**
|
|
2679
2913
|
* @method shouldShowIconPlaceholder
|
|
@@ -2681,14 +2915,17 @@ var FixedSizeContainer_1 = __webpack_require__(13);
|
|
|
2681
2915
|
* @param {boolean} loading
|
|
2682
2916
|
* @returns {boolean}
|
|
2683
2917
|
*/
|
|
2918
|
+
|
|
2919
|
+
|
|
2684
2920
|
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
2685
2921
|
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
2686
|
-
var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
|
|
2922
|
+
var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
|
|
2687
2923
|
var noData = data === undefined;
|
|
2688
|
-
var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
|
|
2924
|
+
var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields[0]', undefined);
|
|
2689
2925
|
var noFields = fields === undefined;
|
|
2690
2926
|
return loading || noData || noFields;
|
|
2691
2927
|
};
|
|
2928
|
+
|
|
2692
2929
|
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
2693
2930
|
var propTypes = {
|
|
2694
2931
|
icon: T.func,
|
|
@@ -2703,11 +2940,13 @@ var propTypes = {
|
|
|
2703
2940
|
* @param {IconPlaceholderProps} props
|
|
2704
2941
|
* @returns {React.ReactElement}
|
|
2705
2942
|
*/
|
|
2943
|
+
|
|
2706
2944
|
var IconPlaceholder = function IconPlaceholder(props) {
|
|
2707
2945
|
var width = props.width,
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2946
|
+
height = props.height,
|
|
2947
|
+
icon = props.icon,
|
|
2948
|
+
iconColor = props.iconColor;
|
|
2949
|
+
|
|
2711
2950
|
if (icon) {
|
|
2712
2951
|
return React.createElement(icon, {
|
|
2713
2952
|
style: {
|
|
@@ -2722,26 +2961,21 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
2722
2961
|
height: '50%'
|
|
2723
2962
|
});
|
|
2724
2963
|
}
|
|
2964
|
+
|
|
2725
2965
|
return React.createElement(Message_1.default, {
|
|
2726
2966
|
width: width,
|
|
2727
2967
|
height: height,
|
|
2728
2968
|
level: "warning",
|
|
2729
|
-
message: i18n_1._('No DataSource Connected')
|
|
2969
|
+
message: (0, i18n_1._)('No DataSource Connected')
|
|
2730
2970
|
});
|
|
2731
2971
|
};
|
|
2972
|
+
|
|
2732
2973
|
IconPlaceholder.propTypes = propTypes;
|
|
2733
2974
|
IconPlaceholder.defaultProps = {
|
|
2734
2975
|
width: '100%',
|
|
2735
2976
|
height: 250
|
|
2736
2977
|
};
|
|
2737
|
-
exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
2738
|
-
|
|
2739
|
-
/***/ }),
|
|
2740
|
-
|
|
2741
|
-
/***/ 32:
|
|
2742
|
-
/***/ (function(module, exports) {
|
|
2743
|
-
|
|
2744
|
-
module.exports = require("@splunk/ui-utils/id");
|
|
2978
|
+
exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
|
|
2745
2979
|
|
|
2746
2980
|
/***/ }),
|
|
2747
2981
|
|
|
@@ -2752,21 +2986,27 @@ module.exports = require("@splunk/ui-utils/id");
|
|
|
2752
2986
|
|
|
2753
2987
|
|
|
2754
2988
|
var _defineProperty = __webpack_require__(7);
|
|
2989
|
+
|
|
2755
2990
|
Object.defineProperty(exports, "__esModule", {
|
|
2756
2991
|
value: true
|
|
2757
2992
|
});
|
|
2758
2993
|
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
2994
|
+
|
|
2759
2995
|
var T = __webpack_require__(0);
|
|
2996
|
+
|
|
2760
2997
|
var lodash_1 = __webpack_require__(3);
|
|
2761
|
-
|
|
2998
|
+
|
|
2999
|
+
var DataSource_1 = __webpack_require__(34);
|
|
3000
|
+
|
|
2762
3001
|
exports.SortParamsPropTypes = T.shape({
|
|
2763
3002
|
currentSortKey: T.string,
|
|
2764
3003
|
currentSortDir: T.oneOf(DataSource_1.validSortDirs),
|
|
2765
3004
|
onSort: T.func
|
|
2766
3005
|
});
|
|
3006
|
+
|
|
2767
3007
|
var getSortingParams = function getSortingParams(_ref) {
|
|
2768
3008
|
var requestParams = _ref.requestParams,
|
|
2769
|
-
|
|
3009
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
2770
3010
|
var currentSortKey;
|
|
2771
3011
|
var currentSortDir;
|
|
2772
3012
|
var nextSortDirMap = {
|
|
@@ -2775,17 +3015,20 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
2775
3015
|
none: 'asc'
|
|
2776
3016
|
};
|
|
2777
3017
|
var onSort;
|
|
3018
|
+
|
|
2778
3019
|
if (typeof onRequestParamsChange === 'function') {
|
|
2779
|
-
if (requestParams && lodash_1.has(requestParams, 'sort')) {
|
|
3020
|
+
if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
|
|
2780
3021
|
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
2781
3022
|
currentSortDir = requestParams.sort[currentSortKey];
|
|
2782
|
-
}
|
|
2783
|
-
|
|
3023
|
+
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
3024
|
+
|
|
3025
|
+
|
|
2784
3026
|
onSort = function onSort(e, _ref2) {
|
|
2785
3027
|
var sortKey = _ref2.sortKey,
|
|
2786
|
-
|
|
3028
|
+
sortDir = _ref2.sortDir;
|
|
3029
|
+
|
|
2787
3030
|
if (typeof sortKey === 'string') {
|
|
2788
|
-
var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
3031
|
+
var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
2789
3032
|
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
2790
3033
|
offset: 0,
|
|
2791
3034
|
sort: _defineProperty({}, sortKey, nextSortDir)
|
|
@@ -2795,12 +3038,14 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
2795
3038
|
}
|
|
2796
3039
|
};
|
|
2797
3040
|
}
|
|
3041
|
+
|
|
2798
3042
|
return {
|
|
2799
3043
|
currentSortKey: currentSortKey,
|
|
2800
3044
|
currentSortDir: currentSortDir,
|
|
2801
3045
|
onSort: onSort
|
|
2802
3046
|
};
|
|
2803
3047
|
};
|
|
3048
|
+
|
|
2804
3049
|
exports.getSortingParams = getSortingParams;
|
|
2805
3050
|
|
|
2806
3051
|
/***/ }),
|
|
@@ -2811,43 +3056,69 @@ exports.getSortingParams = getSortingParams;
|
|
|
2811
3056
|
"use strict";
|
|
2812
3057
|
|
|
2813
3058
|
|
|
3059
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3060
|
+
value: true
|
|
3061
|
+
});
|
|
3062
|
+
exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
|
|
3063
|
+
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
3064
|
+
exports.validSegmentationModes = ['none', 'inner'];
|
|
3065
|
+
exports.validOutputModes = ['json_cols', 'json'];
|
|
3066
|
+
|
|
3067
|
+
/***/ }),
|
|
3068
|
+
|
|
3069
|
+
/***/ 35:
|
|
3070
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3071
|
+
|
|
3072
|
+
"use strict";
|
|
3073
|
+
|
|
3074
|
+
|
|
2814
3075
|
Object.defineProperty(exports, "__esModule", {
|
|
2815
3076
|
value: true
|
|
2816
3077
|
});
|
|
2817
3078
|
exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
3079
|
+
|
|
2818
3080
|
var T = __webpack_require__(0);
|
|
3081
|
+
|
|
2819
3082
|
var lodash_1 = __webpack_require__(3);
|
|
3083
|
+
|
|
2820
3084
|
exports.PaginatorParamsPropTypes = T.shape({
|
|
2821
3085
|
isPaging: T.bool,
|
|
2822
3086
|
current: T.number,
|
|
2823
3087
|
totalPages: T.number,
|
|
2824
3088
|
onChange: T.func
|
|
2825
3089
|
});
|
|
3090
|
+
|
|
2826
3091
|
var getPaginationParams = function getPaginationParams(_ref) {
|
|
2827
3092
|
var requestParams = _ref.requestParams,
|
|
2828
|
-
|
|
2829
|
-
|
|
3093
|
+
meta = _ref.meta,
|
|
3094
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
2830
3095
|
var totalCount = meta && meta.totalCount || 0;
|
|
2831
3096
|
var offset = requestParams && requestParams.offset || 0;
|
|
2832
3097
|
var count = requestParams && requestParams.count;
|
|
2833
3098
|
var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
2834
3099
|
var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
2835
3100
|
var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
|
|
3101
|
+
|
|
2836
3102
|
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
2837
3103
|
var page = _ref2.page,
|
|
2838
|
-
|
|
2839
|
-
var newParams = lodash_1.cloneDeep(requestParams);
|
|
3104
|
+
countArg = _ref2.count;
|
|
3105
|
+
var newParams = (0, lodash_1.cloneDeep)(requestParams);
|
|
3106
|
+
|
|
2840
3107
|
if (typeof countArg === 'number') {
|
|
2841
3108
|
newParams.count = countArg;
|
|
2842
3109
|
newParams.offset = 0;
|
|
2843
3110
|
}
|
|
3111
|
+
|
|
2844
3112
|
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
3113
|
+
|
|
2845
3114
|
if (typeof page === 'number' && page > 0) {
|
|
2846
3115
|
newParams.count = pageCount;
|
|
2847
3116
|
newParams.offset = (page - 1) * pageCount;
|
|
2848
3117
|
}
|
|
3118
|
+
|
|
2849
3119
|
onRequestParamsChange(newParams);
|
|
2850
3120
|
};
|
|
3121
|
+
|
|
2851
3122
|
return {
|
|
2852
3123
|
isPaging: isPaging,
|
|
2853
3124
|
current: current,
|
|
@@ -2855,11 +3126,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
|
|
|
2855
3126
|
onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
|
|
2856
3127
|
};
|
|
2857
3128
|
};
|
|
3129
|
+
|
|
2858
3130
|
exports.getPaginationParams = getPaginationParams;
|
|
2859
3131
|
|
|
2860
3132
|
/***/ }),
|
|
2861
3133
|
|
|
2862
|
-
/***/
|
|
3134
|
+
/***/ 36:
|
|
2863
3135
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2864
3136
|
|
|
2865
3137
|
"use strict";
|
|
@@ -2870,6 +3142,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2870
3142
|
});
|
|
2871
3143
|
exports.VizCategory = void 0;
|
|
2872
3144
|
var VizCategory;
|
|
3145
|
+
|
|
2873
3146
|
(function (VizCategory) {
|
|
2874
3147
|
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
2875
3148
|
VizCategory["TRENDS"] = "Trends";
|
|
@@ -2887,67 +3160,96 @@ var VizCategory;
|
|
|
2887
3160
|
|
|
2888
3161
|
/***/ }),
|
|
2889
3162
|
|
|
2890
|
-
/***/
|
|
3163
|
+
/***/ 37:
|
|
2891
3164
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2892
3165
|
|
|
2893
3166
|
"use strict";
|
|
2894
3167
|
|
|
2895
3168
|
|
|
2896
3169
|
var _slicedToArray = __webpack_require__(17);
|
|
3170
|
+
|
|
2897
3171
|
Object.defineProperty(exports, "__esModule", {
|
|
2898
3172
|
value: true
|
|
2899
3173
|
});
|
|
3174
|
+
|
|
2900
3175
|
var React = __webpack_require__(1);
|
|
3176
|
+
|
|
2901
3177
|
var lodash_1 = __webpack_require__(3);
|
|
2902
|
-
|
|
2903
|
-
var
|
|
2904
|
-
|
|
2905
|
-
var
|
|
2906
|
-
|
|
3178
|
+
|
|
3179
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(38);
|
|
3180
|
+
|
|
3181
|
+
var Options_1 = __webpack_require__(30);
|
|
3182
|
+
|
|
3183
|
+
var SanitizeProps_1 = __webpack_require__(39);
|
|
3184
|
+
|
|
3185
|
+
var TimezoneContext_1 = __webpack_require__(26);
|
|
3186
|
+
|
|
3187
|
+
var moment_1 = __webpack_require__(40);
|
|
3188
|
+
|
|
2907
3189
|
var FeatureFlagContext_1 = __webpack_require__(21);
|
|
3190
|
+
|
|
2908
3191
|
var styled_components_1 = __webpack_require__(4);
|
|
2909
|
-
|
|
2910
|
-
var
|
|
2911
|
-
|
|
2912
|
-
var
|
|
2913
|
-
|
|
3192
|
+
|
|
3193
|
+
var hocUtils_1 = __webpack_require__(27);
|
|
3194
|
+
|
|
3195
|
+
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
3196
|
+
|
|
3197
|
+
var async_dynamic_options_evaluator_1 = __webpack_require__(41);
|
|
3198
|
+
|
|
3199
|
+
var id_1 = __webpack_require__(25);
|
|
3200
|
+
|
|
3201
|
+
var SplunkVisualization_1 = __webpack_require__(42);
|
|
3202
|
+
|
|
2914
3203
|
var VizBehavior_1 = __webpack_require__(6);
|
|
3204
|
+
|
|
2915
3205
|
var getSorting_1 = __webpack_require__(33);
|
|
2916
|
-
|
|
3206
|
+
|
|
3207
|
+
var getPagination_1 = __webpack_require__(35);
|
|
3208
|
+
|
|
2917
3209
|
var useDeepMemo_1 = __webpack_require__(44);
|
|
3210
|
+
|
|
2918
3211
|
var MissingPropsMessage_1 = __webpack_require__(45);
|
|
3212
|
+
|
|
2919
3213
|
var withEditModeCover_1 = __webpack_require__(46);
|
|
3214
|
+
|
|
2920
3215
|
var withPlaceholder_1 = __webpack_require__(47);
|
|
2921
3216
|
/**
|
|
2922
3217
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
2923
3218
|
* @param {DashboardVizOpts} opts
|
|
2924
3219
|
* @returns {HOC}
|
|
2925
3220
|
*/
|
|
3221
|
+
|
|
3222
|
+
|
|
2926
3223
|
var withDashboardViz = function withDashboardViz(opts) {
|
|
2927
3224
|
var ReactViz = opts.ReactViz,
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
var
|
|
3225
|
+
vizConfig = opts.vizConfig,
|
|
3226
|
+
_opts$computeVizProps = opts.computeVizProps,
|
|
3227
|
+
computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
|
|
3228
|
+
disableEditModeCover = opts.disableEditModeCover,
|
|
3229
|
+
useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
|
|
3230
|
+
|
|
3231
|
+
var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
|
|
3232
|
+
var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
|
|
3233
|
+
|
|
2935
3234
|
var DashboardViz = function DashboardViz(props) {
|
|
2936
3235
|
var _a;
|
|
3236
|
+
|
|
2937
3237
|
var mode = props.mode,
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
3238
|
+
hasEventHandlers = props.hasEventHandlers,
|
|
3239
|
+
dataSources = props.dataSources,
|
|
3240
|
+
options = props.options,
|
|
3241
|
+
_props$context = props.context,
|
|
3242
|
+
context = _props$context === void 0 ? {} : _props$context,
|
|
3243
|
+
width = props.width,
|
|
3244
|
+
height = props.height,
|
|
3245
|
+
onComputedProps = props.onComputedProps,
|
|
3246
|
+
onEventTrigger = props.onEventTrigger,
|
|
3247
|
+
theme = props.theme,
|
|
3248
|
+
onRequestParamsChange = props.onRequestParamsChange;
|
|
3249
|
+
|
|
2949
3250
|
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
2950
|
-
|
|
3251
|
+
serializedTimezone = _React$useContext.serializedTimezone;
|
|
3252
|
+
|
|
2951
3253
|
if (serializedTimezone) {
|
|
2952
3254
|
/*
|
|
2953
3255
|
@splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
|
|
@@ -2961,44 +3263,58 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
2961
3263
|
moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
|
|
2962
3264
|
}
|
|
2963
3265
|
}
|
|
3266
|
+
|
|
2964
3267
|
var themeFunc = function themeFunc(themeVar) {
|
|
2965
3268
|
var _a, _b;
|
|
3269
|
+
|
|
2966
3270
|
return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
|
|
2967
3271
|
};
|
|
3272
|
+
|
|
2968
3273
|
var bgColorFromTheme = themeFunc('defaultBackgroundColor');
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
3274
|
+
|
|
3275
|
+
var _ref = (0, getSettingsFromThemedProps_1.default)({
|
|
3276
|
+
theme: theme
|
|
3277
|
+
}),
|
|
3278
|
+
currentThemeFamily = _ref.family,
|
|
3279
|
+
currentThemeColorScheme = _ref.colorScheme,
|
|
3280
|
+
currentThemeDensity = _ref.density;
|
|
3281
|
+
|
|
2975
3282
|
var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
|
|
3283
|
+
|
|
2976
3284
|
var _React$useState = React.useState({}),
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
3285
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
3286
|
+
evaluatedOptionsAsync = _React$useState2[0],
|
|
3287
|
+
setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
|
|
3288
|
+
|
|
3289
|
+
|
|
2980
3290
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
3291
|
+
|
|
3292
|
+
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
|
|
3293
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
3294
|
+
visualizationID = _React$useState4[0];
|
|
3295
|
+
|
|
2984
3296
|
var _React$useState5 = React.useState({}),
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
3297
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
3298
|
+
dataSourcesInState = _React$useState6[0],
|
|
3299
|
+
setDataSourcesInState = _React$useState6[1];
|
|
3300
|
+
|
|
2988
3301
|
var _React$useState7 = React.useState(),
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
3302
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
3303
|
+
dataFramesInState = _React$useState8[0],
|
|
3304
|
+
setDataFramesInState = _React$useState8[1];
|
|
3305
|
+
|
|
3306
|
+
var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
|
|
3307
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
3308
|
+
useAsyncEvaluatedOptions = _React$useState10[0],
|
|
3309
|
+
setUseAsyncEvaluatedOptions = _React$useState10[1];
|
|
3310
|
+
|
|
3311
|
+
var isMounted = React.useRef(true);
|
|
3312
|
+
evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
|
|
2997
3313
|
try {
|
|
2998
3314
|
if (useAsyncEvaluatedOptions) {
|
|
2999
3315
|
var optionsToEvaluate = {
|
|
3000
|
-
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
3001
|
-
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
3316
|
+
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
3317
|
+
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
3002
3318
|
};
|
|
3003
3319
|
var asyncDynamicOptionsEvaluatorParams = {
|
|
3004
3320
|
visualizationID: visualizationID,
|
|
@@ -3009,21 +3325,23 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
3009
3325
|
};
|
|
3010
3326
|
async_dynamic_options_evaluator_1.default.evaluate(asyncDynamicOptionsEvaluatorParams).then(function (results) {
|
|
3011
3327
|
setEvaluatedOptionsAsync(results.results);
|
|
3012
|
-
}).catch(function (
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3328
|
+
}).catch(function () {
|
|
3329
|
+
if (isMounted.current) {
|
|
3330
|
+
setUseAsyncEvaluatedOptions(false);
|
|
3331
|
+
}
|
|
3016
3332
|
});
|
|
3017
3333
|
} else {
|
|
3018
3334
|
var dataFrames = dataFramesInState;
|
|
3335
|
+
|
|
3019
3336
|
if (dataSources !== dataSourcesInState) {
|
|
3020
3337
|
setDataSourcesInState(dataSources);
|
|
3021
3338
|
dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
|
|
3022
3339
|
setDataFramesInState(dataFrames);
|
|
3023
3340
|
}
|
|
3341
|
+
|
|
3024
3342
|
return Options_1.Options.evaluate({
|
|
3025
|
-
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
3026
|
-
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
3343
|
+
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
3344
|
+
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
3027
3345
|
}, dataSources, themeFunc, dataFrames);
|
|
3028
3346
|
}
|
|
3029
3347
|
} catch (e) {
|
|
@@ -3031,67 +3349,76 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
3031
3349
|
console.error("unexpected error evaluating options: ".concat(e.message));
|
|
3032
3350
|
return {};
|
|
3033
3351
|
}
|
|
3352
|
+
|
|
3034
3353
|
return {};
|
|
3035
3354
|
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
|
|
3036
|
-
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
3037
|
-
// trellis specific backgroundColor update for onComputedProps
|
|
3355
|
+
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
|
|
3038
3356
|
// 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
|
|
3039
3357
|
// onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
|
|
3358
|
+
|
|
3040
3359
|
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
3041
3360
|
var clonedEvaluatedOptions = evaluatedOptionsToUse;
|
|
3361
|
+
|
|
3042
3362
|
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) {
|
|
3043
3363
|
clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
|
|
3044
3364
|
backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
3045
3365
|
});
|
|
3046
|
-
}
|
|
3047
|
-
// useEffect hook needs to be initialized before any early returns
|
|
3366
|
+
} // useEffect hook needs to be initialized before any early returns
|
|
3048
3367
|
// this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
|
|
3368
|
+
|
|
3369
|
+
|
|
3049
3370
|
React.useEffect(function () {
|
|
3050
3371
|
onComputedProps(clonedEvaluatedOptions);
|
|
3051
3372
|
});
|
|
3052
3373
|
React.useEffect(function () {
|
|
3053
3374
|
return function () {
|
|
3054
3375
|
if (useAsyncEvaluatedOptions) {
|
|
3376
|
+
isMounted.current = false;
|
|
3055
3377
|
async_dynamic_options_evaluator_1.default.reset(visualizationID);
|
|
3056
3378
|
}
|
|
3057
|
-
};
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
// present warning message if any required props are missing
|
|
3379
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3380
|
+
}, []); // present warning message if any required props are missing
|
|
3381
|
+
|
|
3061
3382
|
var _vizConfig$requiredPr = vizConfig.requiredProps,
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptionsToUse);
|
|
3383
|
+
requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
|
|
3384
|
+
supports = vizConfig.supports;
|
|
3385
|
+
var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
|
|
3386
|
+
|
|
3065
3387
|
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
|
|
3066
3388
|
) {
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3389
|
+
return React.createElement(MissingPropsMessage_1.default, {
|
|
3390
|
+
"data-test": "missing-props-message",
|
|
3391
|
+
width: width,
|
|
3392
|
+
height: height,
|
|
3393
|
+
missingProps: missing,
|
|
3394
|
+
backgroundColor: bgColorFromTheme
|
|
3395
|
+
});
|
|
3396
|
+
} // events
|
|
3397
|
+
|
|
3398
|
+
|
|
3076
3399
|
var eventCallbackProps = {};
|
|
3400
|
+
|
|
3077
3401
|
if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
|
|
3078
3402
|
var supportedEvents = vizConfig.events;
|
|
3079
3403
|
Object.keys(supportedEvents).forEach(function (eventName) {
|
|
3080
|
-
var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
|
|
3081
|
-
eventCallbackProps[eventCallbackPropName] = null;
|
|
3082
|
-
// todo: refactor single value and single value icon to send payload from viz
|
|
3404
|
+
var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
|
|
3405
|
+
eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
|
|
3083
3406
|
// then remove these lines
|
|
3407
|
+
|
|
3084
3408
|
var payloadKeys = supportedEvents[eventName].payloadKeys;
|
|
3085
3409
|
var payload = {};
|
|
3410
|
+
|
|
3086
3411
|
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
3087
3412
|
payloadKeys.forEach(function (p) {
|
|
3088
3413
|
payload[p] = evaluatedOptionsToUse[p];
|
|
3089
3414
|
});
|
|
3090
3415
|
}
|
|
3416
|
+
|
|
3091
3417
|
eventCallbackProps[eventCallbackPropName] = function (ev) {
|
|
3092
3418
|
if (ev && ev.payload) {
|
|
3093
3419
|
payload = ev.payload;
|
|
3094
3420
|
}
|
|
3421
|
+
|
|
3095
3422
|
return onEventTrigger({
|
|
3096
3423
|
originalEvent: ev,
|
|
3097
3424
|
payload: payload,
|
|
@@ -3099,8 +3426,9 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
3099
3426
|
});
|
|
3100
3427
|
};
|
|
3101
3428
|
});
|
|
3102
|
-
}
|
|
3103
|
-
|
|
3429
|
+
} // compute pure viz props which are not from options
|
|
3430
|
+
|
|
3431
|
+
|
|
3104
3432
|
var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
3105
3433
|
themeFunc: themeFunc
|
|
3106
3434
|
}));
|
|
@@ -3118,21 +3446,25 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
3118
3446
|
* In future, we could automatically detect which all datasources are being used
|
|
3119
3447
|
* and bind those magically to pagination/sorting behavior.
|
|
3120
3448
|
*/
|
|
3449
|
+
|
|
3121
3450
|
var dataSourceMetadata = {};
|
|
3122
3451
|
var OptionKey = 'paginateDataSourceKey';
|
|
3123
|
-
var paginateDataSourceKey = lodash_1.has(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
var
|
|
3452
|
+
var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
3453
|
+
|
|
3454
|
+
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
|
|
3455
|
+
var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
3456
|
+
var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
3457
|
+
|
|
3127
3458
|
var handleRequestParamsChange = function handleRequestParamsChange(payload) {
|
|
3128
3459
|
return onRequestParamsChange(paginateDataSourceKey, payload);
|
|
3129
3460
|
};
|
|
3130
|
-
|
|
3461
|
+
|
|
3462
|
+
var sortParams = (0, getSorting_1.getSortingParams)({
|
|
3131
3463
|
requestParams: requestParams,
|
|
3132
3464
|
meta: meta,
|
|
3133
3465
|
onRequestParamsChange: handleRequestParamsChange
|
|
3134
3466
|
});
|
|
3135
|
-
var paginatorParams = getPagination_1.getPaginationParams({
|
|
3467
|
+
var paginatorParams = (0, getPagination_1.getPaginationParams)({
|
|
3136
3468
|
requestParams: requestParams,
|
|
3137
3469
|
meta: meta,
|
|
3138
3470
|
onRequestParamsChange: handleRequestParamsChange
|
|
@@ -3141,115 +3473,132 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
3141
3473
|
sortParams: sortParams,
|
|
3142
3474
|
paginatorParams: paginatorParams
|
|
3143
3475
|
};
|
|
3144
|
-
}
|
|
3145
|
-
|
|
3476
|
+
} // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
|
|
3477
|
+
|
|
3478
|
+
|
|
3146
3479
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
3147
3480
|
return null;
|
|
3148
3481
|
}
|
|
3482
|
+
|
|
3149
3483
|
return React.createElement(SanitizedReactViz, Object.assign({
|
|
3150
3484
|
mode: mode,
|
|
3151
3485
|
width: width,
|
|
3152
3486
|
height: height
|
|
3153
3487
|
}, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
|
|
3154
3488
|
};
|
|
3489
|
+
|
|
3155
3490
|
DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
|
|
3156
3491
|
DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
|
|
3157
3492
|
// using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
|
|
3158
3493
|
theme: {}
|
|
3159
|
-
});
|
|
3160
|
-
|
|
3161
|
-
DashboardViz.config = vizConfig;
|
|
3162
|
-
|
|
3163
|
-
return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
3494
|
+
}); // attach viz config
|
|
3495
|
+
|
|
3496
|
+
DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
|
|
3497
|
+
|
|
3498
|
+
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
3164
3499
|
};
|
|
3500
|
+
|
|
3165
3501
|
exports.default = withDashboardViz;
|
|
3166
3502
|
|
|
3167
3503
|
/***/ }),
|
|
3168
3504
|
|
|
3169
|
-
/***/
|
|
3505
|
+
/***/ 38:
|
|
3170
3506
|
/***/ (function(module, exports) {
|
|
3171
3507
|
|
|
3172
3508
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
3173
3509
|
|
|
3174
3510
|
/***/ }),
|
|
3175
3511
|
|
|
3176
|
-
/***/
|
|
3512
|
+
/***/ 39:
|
|
3177
3513
|
/***/ (function(module, exports) {
|
|
3178
3514
|
|
|
3179
3515
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
3180
3516
|
|
|
3181
3517
|
/***/ }),
|
|
3182
3518
|
|
|
3183
|
-
/***/
|
|
3519
|
+
/***/ 4:
|
|
3184
3520
|
/***/ (function(module, exports) {
|
|
3185
3521
|
|
|
3186
|
-
module.exports = require("
|
|
3522
|
+
module.exports = require("styled-components");
|
|
3187
3523
|
|
|
3188
3524
|
/***/ }),
|
|
3189
3525
|
|
|
3190
|
-
/***/
|
|
3526
|
+
/***/ 40:
|
|
3191
3527
|
/***/ (function(module, exports) {
|
|
3192
3528
|
|
|
3193
|
-
module.exports = require("
|
|
3529
|
+
module.exports = require("@splunk/moment");
|
|
3194
3530
|
|
|
3195
3531
|
/***/ }),
|
|
3196
3532
|
|
|
3197
|
-
/***/
|
|
3533
|
+
/***/ 41:
|
|
3198
3534
|
/***/ (function(module, exports) {
|
|
3199
3535
|
|
|
3200
3536
|
module.exports = require("@splunk/async-dynamic-options-evaluator");
|
|
3201
3537
|
|
|
3202
3538
|
/***/ }),
|
|
3203
3539
|
|
|
3204
|
-
/***/
|
|
3540
|
+
/***/ 42:
|
|
3205
3541
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3206
3542
|
|
|
3207
3543
|
"use strict";
|
|
3208
3544
|
|
|
3209
3545
|
|
|
3210
3546
|
var _classCallCheck = __webpack_require__(9);
|
|
3547
|
+
|
|
3211
3548
|
Object.defineProperty(exports, "__esModule", {
|
|
3212
3549
|
value: true
|
|
3213
3550
|
});
|
|
3214
3551
|
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
3215
3552
|
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
3553
|
+
|
|
3216
3554
|
var T = __webpack_require__(0);
|
|
3555
|
+
|
|
3217
3556
|
var lodash_1 = __webpack_require__(3);
|
|
3218
|
-
|
|
3219
|
-
// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
3557
|
+
|
|
3558
|
+
var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
3559
|
+
|
|
3560
|
+
|
|
3220
3561
|
exports.INITIAL_WIDTH = 250;
|
|
3221
3562
|
exports.INITIAL_HEIGHT = 250;
|
|
3222
3563
|
/**
|
|
3223
3564
|
* A Splunk visualization
|
|
3224
3565
|
*/
|
|
3566
|
+
|
|
3225
3567
|
var SplunkVisualization = function SplunkVisualization() {
|
|
3226
3568
|
_classCallCheck(this, SplunkVisualization);
|
|
3227
3569
|
};
|
|
3570
|
+
|
|
3228
3571
|
SplunkVisualization.propTypes = {
|
|
3229
3572
|
/**
|
|
3230
3573
|
* display mode
|
|
3231
3574
|
*/
|
|
3232
3575
|
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
3576
|
+
|
|
3233
3577
|
/**
|
|
3234
3578
|
* width in pixel or string, defaults to 100%
|
|
3235
3579
|
*/
|
|
3236
3580
|
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
3581
|
+
|
|
3237
3582
|
/**
|
|
3238
3583
|
* height in pixel or string
|
|
3239
3584
|
*/
|
|
3240
3585
|
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
3586
|
+
|
|
3241
3587
|
/**
|
|
3242
3588
|
* visualization context used for dynamic option evaluation
|
|
3243
3589
|
*/
|
|
3244
3590
|
context: T.object,
|
|
3591
|
+
|
|
3245
3592
|
/**
|
|
3246
3593
|
* visualization formatting options
|
|
3247
3594
|
*/
|
|
3248
3595
|
options: T.object,
|
|
3596
|
+
|
|
3249
3597
|
/**
|
|
3250
3598
|
* A callback to update formatting options
|
|
3251
3599
|
*/
|
|
3252
3600
|
onOptionsChange: T.func,
|
|
3601
|
+
|
|
3253
3602
|
/**
|
|
3254
3603
|
* datasource state which include data and request params, object key indicate the datasource type.
|
|
3255
3604
|
*/
|
|
@@ -3258,6 +3607,7 @@ SplunkVisualization.propTypes = {
|
|
|
3258
3607
|
* current request params
|
|
3259
3608
|
*/
|
|
3260
3609
|
requestParams: T.object,
|
|
3610
|
+
|
|
3261
3611
|
/**
|
|
3262
3612
|
* current dataset
|
|
3263
3613
|
*/
|
|
@@ -3265,6 +3615,7 @@ SplunkVisualization.propTypes = {
|
|
|
3265
3615
|
fields: T.array,
|
|
3266
3616
|
columns: T.array
|
|
3267
3617
|
}),
|
|
3618
|
+
|
|
3268
3619
|
/**
|
|
3269
3620
|
* error
|
|
3270
3621
|
*/
|
|
@@ -3272,29 +3623,35 @@ SplunkVisualization.propTypes = {
|
|
|
3272
3623
|
level: T.string,
|
|
3273
3624
|
message: T.string
|
|
3274
3625
|
}),
|
|
3626
|
+
|
|
3275
3627
|
/**
|
|
3276
3628
|
* meta data that came with the dataset
|
|
3277
3629
|
*/
|
|
3278
3630
|
meta: T.object
|
|
3279
3631
|
})),
|
|
3632
|
+
|
|
3280
3633
|
/**
|
|
3281
3634
|
* A callback to trigger event
|
|
3282
3635
|
*/
|
|
3283
3636
|
onEventTrigger: T.func,
|
|
3637
|
+
|
|
3284
3638
|
/**
|
|
3285
3639
|
* Inform viz if there are handlers listening to events
|
|
3286
3640
|
*/
|
|
3287
3641
|
hasEventHandlers: T.bool,
|
|
3642
|
+
|
|
3288
3643
|
/**
|
|
3289
3644
|
* A callback to communicate computed props to a consumer
|
|
3290
3645
|
*/
|
|
3291
3646
|
onComputedProps: T.func,
|
|
3647
|
+
|
|
3292
3648
|
/**
|
|
3293
3649
|
* A callback to obtain visualization api
|
|
3294
3650
|
*/
|
|
3295
3651
|
vizActionHandlerRef: T.func,
|
|
3296
3652
|
loading: T.bool,
|
|
3297
3653
|
theme: T.object,
|
|
3654
|
+
|
|
3298
3655
|
/**
|
|
3299
3656
|
* A callback to request new data with updated request params
|
|
3300
3657
|
*/
|
|
@@ -3303,6 +3660,7 @@ SplunkVisualization.propTypes = {
|
|
|
3303
3660
|
/**
|
|
3304
3661
|
*
|
|
3305
3662
|
*/
|
|
3663
|
+
|
|
3306
3664
|
SplunkVisualization.defaultProps = {
|
|
3307
3665
|
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
3308
3666
|
width: '100%',
|
|
@@ -3331,26 +3689,29 @@ exports.default = SplunkVisualization;
|
|
|
3331
3689
|
|
|
3332
3690
|
/***/ }),
|
|
3333
3691
|
|
|
3334
|
-
/***/
|
|
3692
|
+
/***/ 43:
|
|
3335
3693
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3336
3694
|
|
|
3337
3695
|
"use strict";
|
|
3338
3696
|
|
|
3339
3697
|
|
|
3340
3698
|
var _classCallCheck = __webpack_require__(9);
|
|
3699
|
+
|
|
3341
3700
|
var _createClass = __webpack_require__(18);
|
|
3701
|
+
|
|
3342
3702
|
Object.defineProperty(exports, "__esModule", {
|
|
3343
3703
|
value: true
|
|
3344
3704
|
});
|
|
3345
3705
|
exports.DefaultVizActionHandler = void 0;
|
|
3706
|
+
|
|
3346
3707
|
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
3347
3708
|
function DefaultVizActionHandler() {
|
|
3348
3709
|
_classCallCheck(this, DefaultVizActionHandler);
|
|
3349
3710
|
}
|
|
3711
|
+
|
|
3350
3712
|
_createClass(DefaultVizActionHandler, [{
|
|
3351
3713
|
key: "focus",
|
|
3352
|
-
value: function focus() {
|
|
3353
|
-
// noop
|
|
3714
|
+
value: function focus() {// noop
|
|
3354
3715
|
}
|
|
3355
3716
|
}, {
|
|
3356
3717
|
key: "snapshot",
|
|
@@ -3358,23 +3719,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
|
3358
3719
|
return null; // noop
|
|
3359
3720
|
}
|
|
3360
3721
|
}]);
|
|
3722
|
+
|
|
3361
3723
|
return DefaultVizActionHandler;
|
|
3362
3724
|
}();
|
|
3363
|
-
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
3364
|
-
|
|
3365
|
-
/***/ }),
|
|
3366
|
-
|
|
3367
|
-
/***/ 43:
|
|
3368
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
3369
|
-
|
|
3370
|
-
"use strict";
|
|
3371
|
-
|
|
3372
3725
|
|
|
3373
|
-
|
|
3374
|
-
value: true
|
|
3375
|
-
});
|
|
3376
|
-
exports.validSortDirs = void 0;
|
|
3377
|
-
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
3726
|
+
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
3378
3727
|
|
|
3379
3728
|
/***/ }),
|
|
3380
3729
|
|
|
@@ -3388,7 +3737,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3388
3737
|
value: true
|
|
3389
3738
|
});
|
|
3390
3739
|
exports.useDeepMemo = void 0;
|
|
3740
|
+
|
|
3391
3741
|
var react_1 = __webpack_require__(1);
|
|
3742
|
+
|
|
3392
3743
|
var lodash_1 = __webpack_require__(3);
|
|
3393
3744
|
/**
|
|
3394
3745
|
* This hook evaluates and stores the result of a passed function and only
|
|
@@ -3403,16 +3754,21 @@ var lodash_1 = __webpack_require__(3);
|
|
|
3403
3754
|
* @param fn the function to be executed and
|
|
3404
3755
|
* @param dependencies an array of dependencies
|
|
3405
3756
|
*/
|
|
3757
|
+
|
|
3758
|
+
|
|
3406
3759
|
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
3407
|
-
var ref = react_1.useRef();
|
|
3408
|
-
|
|
3760
|
+
var ref = (0, react_1.useRef)();
|
|
3761
|
+
|
|
3762
|
+
if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
|
|
3409
3763
|
ref.current = {
|
|
3410
3764
|
dependencies: dependencies,
|
|
3411
3765
|
value: fn()
|
|
3412
3766
|
};
|
|
3413
3767
|
}
|
|
3768
|
+
|
|
3414
3769
|
return ref.current.value;
|
|
3415
3770
|
};
|
|
3771
|
+
|
|
3416
3772
|
exports.useDeepMemo = useDeepMemo;
|
|
3417
3773
|
|
|
3418
3774
|
/***/ }),
|
|
@@ -3427,19 +3783,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3427
3783
|
value: true
|
|
3428
3784
|
});
|
|
3429
3785
|
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
3786
|
+
|
|
3430
3787
|
var React = __webpack_require__(1);
|
|
3788
|
+
|
|
3431
3789
|
var T = __webpack_require__(0);
|
|
3790
|
+
|
|
3432
3791
|
var i18n_1 = __webpack_require__(2);
|
|
3792
|
+
|
|
3433
3793
|
var Message_1 = __webpack_require__(10);
|
|
3794
|
+
|
|
3434
3795
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
3435
3796
|
/**
|
|
3436
3797
|
* @method isMissing
|
|
3437
3798
|
* @param {any} v
|
|
3438
3799
|
* @returns {boolean} true if the input value === null or undefined
|
|
3439
3800
|
*/
|
|
3801
|
+
|
|
3802
|
+
|
|
3440
3803
|
var isMissing = function isMissing(v) {
|
|
3441
3804
|
return v === null || v === undefined;
|
|
3442
3805
|
};
|
|
3806
|
+
|
|
3443
3807
|
exports.isMissing = isMissing;
|
|
3444
3808
|
/**
|
|
3445
3809
|
* @method misskingKeys
|
|
@@ -3447,11 +3811,13 @@ exports.isMissing = isMissing;
|
|
|
3447
3811
|
* @param {object} target
|
|
3448
3812
|
* @returns {string[]} the keys of missing required props
|
|
3449
3813
|
*/
|
|
3814
|
+
|
|
3450
3815
|
var missingKeys = function missingKeys(keys, target) {
|
|
3451
3816
|
return keys.filter(function (k) {
|
|
3452
|
-
return exports.isMissing(target[k]);
|
|
3817
|
+
return (0, exports.isMissing)(target[k]);
|
|
3453
3818
|
});
|
|
3454
3819
|
};
|
|
3820
|
+
|
|
3455
3821
|
exports.missingKeys = missingKeys;
|
|
3456
3822
|
var propTypes = {
|
|
3457
3823
|
width: T.oneOfType([T.string, T.number]),
|
|
@@ -3465,74 +3831,148 @@ var propTypes = {
|
|
|
3465
3831
|
* @param {MissingPropsProps} props
|
|
3466
3832
|
* @returns {React.ReactElement}
|
|
3467
3833
|
*/
|
|
3834
|
+
|
|
3468
3835
|
var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
3469
3836
|
var width = props.width,
|
|
3470
|
-
|
|
3471
|
-
|
|
3837
|
+
height = props.height,
|
|
3838
|
+
missingProps = props.missingProps;
|
|
3472
3839
|
return React.createElement(Message_1.default, {
|
|
3473
3840
|
"data-test": "message",
|
|
3474
3841
|
width: width,
|
|
3475
3842
|
height: height,
|
|
3476
|
-
message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
|
|
3843
|
+
message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
|
|
3477
3844
|
});
|
|
3478
3845
|
};
|
|
3846
|
+
|
|
3479
3847
|
exports.MissingPropsMessage = MissingPropsMessage;
|
|
3480
3848
|
exports.MissingPropsMessage.propTypes = propTypes;
|
|
3481
3849
|
exports.MissingPropsMessage.defaultProps = {
|
|
3482
3850
|
width: '100%',
|
|
3483
3851
|
height: 250
|
|
3484
3852
|
};
|
|
3485
|
-
exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
3853
|
+
exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage);
|
|
3486
3854
|
|
|
3487
3855
|
/***/ }),
|
|
3488
3856
|
|
|
3489
3857
|
/***/ 46:
|
|
3490
3858
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3491
3859
|
|
|
3492
|
-
"use strict";
|
|
3860
|
+
"use strict";
|
|
3861
|
+
|
|
3862
|
+
|
|
3863
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3864
|
+
value: true
|
|
3865
|
+
});
|
|
3866
|
+
|
|
3867
|
+
var React = __webpack_require__(1);
|
|
3868
|
+
|
|
3869
|
+
var styled_components_1 = __webpack_require__(4);
|
|
3870
|
+
|
|
3871
|
+
var hocUtils_1 = __webpack_require__(15);
|
|
3872
|
+
|
|
3873
|
+
var Cover = styled_components_1.default.div.withConfig({
|
|
3874
|
+
displayName: "withEditModeCover__Cover",
|
|
3875
|
+
componentId: "sc-1gsbnxb-0"
|
|
3876
|
+
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
3877
|
+
var Blocker = styled_components_1.default.div.attrs({
|
|
3878
|
+
'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
|
|
3879
|
+
}).withConfig({
|
|
3880
|
+
displayName: "withEditModeCover__Blocker",
|
|
3881
|
+
componentId: "sc-1gsbnxb-1"
|
|
3882
|
+
})(["position:relative;width:100%;height:100%;"]);
|
|
3883
|
+
/**
|
|
3884
|
+
* HOC that renders a cover layer in edit mode
|
|
3885
|
+
* @method withEditModeCover
|
|
3886
|
+
* @param {ExtendedDashViz} Visualization
|
|
3887
|
+
* @returns {ExtendedDashViz} Wrapper
|
|
3888
|
+
*/
|
|
3889
|
+
|
|
3890
|
+
var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
|
|
3891
|
+
var Wrapper = function Wrapper(props) {
|
|
3892
|
+
var mode = props.mode;
|
|
3893
|
+
var showEditCover = mode === 'edit' && !disableEditModeCover;
|
|
3894
|
+
return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
|
|
3895
|
+
"data-test": "edit-mode-cover"
|
|
3896
|
+
}));
|
|
3897
|
+
};
|
|
3898
|
+
|
|
3899
|
+
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
3900
|
+
Wrapper: Wrapper,
|
|
3901
|
+
Visualization: Visualization
|
|
3902
|
+
});
|
|
3903
|
+
return Wrapper;
|
|
3904
|
+
};
|
|
3905
|
+
|
|
3906
|
+
exports.default = withEditModeCover;
|
|
3907
|
+
|
|
3908
|
+
/***/ }),
|
|
3909
|
+
|
|
3910
|
+
/***/ 47:
|
|
3911
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3912
|
+
|
|
3913
|
+
"use strict";
|
|
3914
|
+
|
|
3915
|
+
|
|
3916
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3917
|
+
value: true
|
|
3918
|
+
});
|
|
3919
|
+
|
|
3920
|
+
var React = __webpack_require__(1);
|
|
3921
|
+
|
|
3922
|
+
var colorUtils_1 = __webpack_require__(12);
|
|
3923
|
+
|
|
3924
|
+
var variables_1 = __webpack_require__(11);
|
|
3925
|
+
|
|
3926
|
+
var IconPlaceholder_1 = __webpack_require__(32);
|
|
3927
|
+
|
|
3928
|
+
var VizBehavior_1 = __webpack_require__(6);
|
|
3929
|
+
|
|
3930
|
+
var hocUtils_1 = __webpack_require__(15);
|
|
3931
|
+
|
|
3932
|
+
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
3933
|
+
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
3934
|
+
var config = Visualization.config;
|
|
3935
|
+
var themes = config.themes;
|
|
3936
|
+
|
|
3937
|
+
var Wrapper = function Wrapper(props) {
|
|
3938
|
+
var _a, _b;
|
|
3939
|
+
|
|
3940
|
+
var dataSources = props.dataSources,
|
|
3941
|
+
loading = props.loading,
|
|
3942
|
+
options = props.options,
|
|
3943
|
+
height = props.height,
|
|
3944
|
+
width = props.width;
|
|
3945
|
+
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
3946
|
+
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);
|
|
3947
|
+
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
3948
|
+
var iconColor = variables_1.default.contentColorActive(props);
|
|
3493
3949
|
|
|
3950
|
+
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
3951
|
+
return React.createElement(IconPlaceholder_1.default, {
|
|
3952
|
+
"data-test": "icon-placeholder",
|
|
3953
|
+
icon: icon,
|
|
3954
|
+
width: width,
|
|
3955
|
+
height: height,
|
|
3956
|
+
backgroundColor: bgColorFromTheme,
|
|
3957
|
+
iconColor: iconColor
|
|
3958
|
+
});
|
|
3959
|
+
}
|
|
3494
3960
|
|
|
3495
|
-
|
|
3496
|
-
value: true
|
|
3497
|
-
});
|
|
3498
|
-
var React = __webpack_require__(1);
|
|
3499
|
-
var styled_components_1 = __webpack_require__(4);
|
|
3500
|
-
var hocUtils_1 = __webpack_require__(15);
|
|
3501
|
-
var Cover = styled_components_1.default.div.withConfig({
|
|
3502
|
-
displayName: "withEditModeCover__Cover",
|
|
3503
|
-
componentId: "sc-1gsbnxb-0"
|
|
3504
|
-
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
3505
|
-
var Blocker = styled_components_1.default.div.attrs({
|
|
3506
|
-
'data-splunk-visualization-version': "25.13.1 - ea48ec41e"
|
|
3507
|
-
}).withConfig({
|
|
3508
|
-
displayName: "withEditModeCover__Blocker",
|
|
3509
|
-
componentId: "sc-1gsbnxb-1"
|
|
3510
|
-
})(["position:relative;width:100%;height:100%;"]);
|
|
3511
|
-
/**
|
|
3512
|
-
* HOC that renders a cover layer in edit mode
|
|
3513
|
-
* @method withEditModeCover
|
|
3514
|
-
* @param {ExtendedDashViz} Visualization
|
|
3515
|
-
* @returns {ExtendedDashViz} Wrapper
|
|
3516
|
-
*/
|
|
3517
|
-
var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
|
|
3518
|
-
var Wrapper = function Wrapper(props) {
|
|
3519
|
-
var mode = props.mode;
|
|
3520
|
-
var showEditCover = mode === 'edit' && !disableEditModeCover;
|
|
3521
|
-
return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
|
|
3522
|
-
"data-test": "edit-mode-cover"
|
|
3523
|
-
}));
|
|
3961
|
+
return React.createElement(Visualization, Object.assign({}, props));
|
|
3524
3962
|
};
|
|
3525
|
-
|
|
3963
|
+
|
|
3964
|
+
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
3526
3965
|
Wrapper: Wrapper,
|
|
3527
3966
|
Visualization: Visualization
|
|
3528
3967
|
});
|
|
3529
3968
|
return Wrapper;
|
|
3530
3969
|
};
|
|
3531
|
-
|
|
3970
|
+
|
|
3971
|
+
exports.default = withPlaceholder;
|
|
3532
3972
|
|
|
3533
3973
|
/***/ }),
|
|
3534
3974
|
|
|
3535
|
-
/***/
|
|
3975
|
+
/***/ 470:
|
|
3536
3976
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3537
3977
|
|
|
3538
3978
|
"use strict";
|
|
@@ -3542,28 +3982,39 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3542
3982
|
value: true
|
|
3543
3983
|
});
|
|
3544
3984
|
exports.themes = exports.computeVizProps = exports.PureSingleValueIcon = exports.config = void 0;
|
|
3985
|
+
|
|
3545
3986
|
var React = __webpack_require__(1);
|
|
3546
|
-
|
|
3547
|
-
var
|
|
3548
|
-
|
|
3549
|
-
var
|
|
3550
|
-
|
|
3551
|
-
var
|
|
3987
|
+
|
|
3988
|
+
var RemoteIcon_1 = __webpack_require__(471);
|
|
3989
|
+
|
|
3990
|
+
var iconUtils_1 = __webpack_require__(472);
|
|
3991
|
+
|
|
3992
|
+
var SingleValueIcon_1 = __webpack_require__(490);
|
|
3993
|
+
|
|
3994
|
+
var withDashboardViz_1 = __webpack_require__(37);
|
|
3995
|
+
|
|
3996
|
+
var config_1 = __webpack_require__(473);
|
|
3997
|
+
|
|
3998
|
+
var withTrellis_1 = __webpack_require__(106);
|
|
3999
|
+
|
|
3552
4000
|
exports.config = config_1.default;
|
|
3553
4001
|
exports.PureSingleValueIcon = SingleValueIcon_1.default;
|
|
4002
|
+
|
|
3554
4003
|
var computeVizProps = function computeVizProps(_ref) {
|
|
3555
4004
|
var icon = _ref.icon,
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
4005
|
+
_ref$IconComponent = _ref.IconComponent,
|
|
4006
|
+
IconComponent = _ref$IconComponent === void 0 ? null : _ref$IconComponent,
|
|
4007
|
+
themeFunc = _ref.themeFunc,
|
|
4008
|
+
trellisKey = _ref.trellisKey,
|
|
4009
|
+
trellisSplitBy = _ref.trellisSplitBy;
|
|
4010
|
+
|
|
4011
|
+
if (icon && ((0, iconUtils_1.isRemoteIcon)(icon) || (0, iconUtils_1.isDataURI)(icon))) {
|
|
3562
4012
|
// eslint-disable-next-line no-param-reassign
|
|
3563
4013
|
IconComponent = React.createElement(RemoteIcon_1.default, {
|
|
3564
4014
|
iconURL: icon
|
|
3565
4015
|
});
|
|
3566
4016
|
}
|
|
4017
|
+
|
|
3567
4018
|
return {
|
|
3568
4019
|
IconComponent: IconComponent,
|
|
3569
4020
|
defaultFontColor: themeFunc('defaultFontColor'),
|
|
@@ -3572,8 +4023,9 @@ var computeVizProps = function computeVizProps(_ref) {
|
|
|
3572
4023
|
trellisSplitBy: trellisSplitBy
|
|
3573
4024
|
};
|
|
3574
4025
|
};
|
|
4026
|
+
|
|
3575
4027
|
exports.computeVizProps = computeVizProps;
|
|
3576
|
-
var viz = withTrellis_1.default(withDashboardViz_1.default({
|
|
4028
|
+
var viz = (0, withTrellis_1.default)((0, withDashboardViz_1.default)({
|
|
3577
4029
|
ReactViz: SingleValueIcon_1.default,
|
|
3578
4030
|
vizConfig: config_1.default,
|
|
3579
4031
|
computeVizProps: exports.computeVizProps
|
|
@@ -3583,102 +4035,72 @@ exports.default = viz;
|
|
|
3583
4035
|
|
|
3584
4036
|
/***/ }),
|
|
3585
4037
|
|
|
3586
|
-
/***/
|
|
4038
|
+
/***/ 471:
|
|
3587
4039
|
/***/ (function(module, exports) {
|
|
3588
4040
|
|
|
3589
4041
|
module.exports = require("@splunk/visualizations-shared/RemoteIcon");
|
|
3590
4042
|
|
|
3591
4043
|
/***/ }),
|
|
3592
4044
|
|
|
3593
|
-
/***/
|
|
4045
|
+
/***/ 472:
|
|
3594
4046
|
/***/ (function(module, exports) {
|
|
3595
4047
|
|
|
3596
4048
|
module.exports = require("@splunk/visualizations-shared/iconUtils");
|
|
3597
4049
|
|
|
3598
4050
|
/***/ }),
|
|
3599
4051
|
|
|
3600
|
-
/***/
|
|
4052
|
+
/***/ 473:
|
|
3601
4053
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3602
4054
|
|
|
3603
4055
|
"use strict";
|
|
3604
4056
|
|
|
3605
4057
|
|
|
4058
|
+
var _toConsumableArray = __webpack_require__(8);
|
|
4059
|
+
|
|
3606
4060
|
Object.defineProperty(exports, "__esModule", {
|
|
3607
4061
|
value: true
|
|
3608
4062
|
});
|
|
3609
|
-
var React = __webpack_require__(1);
|
|
3610
|
-
var colorUtils_1 = __webpack_require__(12);
|
|
3611
|
-
var variables_1 = __webpack_require__(11);
|
|
3612
|
-
var IconPlaceholder_1 = __webpack_require__(31);
|
|
3613
|
-
var VizBehavior_1 = __webpack_require__(6);
|
|
3614
|
-
var hocUtils_1 = __webpack_require__(15);
|
|
3615
|
-
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
3616
|
-
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
3617
|
-
var config = Visualization.config;
|
|
3618
|
-
var themes = config.themes;
|
|
3619
|
-
var Wrapper = function Wrapper(props) {
|
|
3620
|
-
var _a, _b;
|
|
3621
|
-
var dataSources = props.dataSources,
|
|
3622
|
-
loading = props.loading,
|
|
3623
|
-
options = props.options,
|
|
3624
|
-
height = props.height,
|
|
3625
|
-
width = props.width;
|
|
3626
|
-
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
3627
|
-
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);
|
|
3628
|
-
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
3629
|
-
var iconColor = variables_1.default.contentColorActive(props);
|
|
3630
|
-
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
3631
|
-
return React.createElement(IconPlaceholder_1.default, {
|
|
3632
|
-
"data-test": "icon-placeholder",
|
|
3633
|
-
icon: icon,
|
|
3634
|
-
width: width,
|
|
3635
|
-
height: height,
|
|
3636
|
-
backgroundColor: bgColorFromTheme,
|
|
3637
|
-
iconColor: iconColor
|
|
3638
|
-
});
|
|
3639
|
-
}
|
|
3640
|
-
return React.createElement(Visualization, Object.assign({}, props));
|
|
3641
|
-
};
|
|
3642
|
-
hocUtils_1.extendStaticWrapperProps({
|
|
3643
|
-
Wrapper: Wrapper,
|
|
3644
|
-
Visualization: Visualization
|
|
3645
|
-
});
|
|
3646
|
-
return Wrapper;
|
|
3647
|
-
};
|
|
3648
|
-
exports.default = withPlaceholder;
|
|
3649
|
-
|
|
3650
|
-
/***/ }),
|
|
3651
4063
|
|
|
3652
|
-
|
|
3653
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
4064
|
+
var i18n_1 = __webpack_require__(2);
|
|
3654
4065
|
|
|
3655
|
-
|
|
4066
|
+
var schemaUtils_1 = __webpack_require__(16);
|
|
3656
4067
|
|
|
4068
|
+
var PresetPalettes_1 = __webpack_require__(61);
|
|
3657
4069
|
|
|
3658
|
-
var _toConsumableArray = __webpack_require__(8);
|
|
3659
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3660
|
-
value: true
|
|
3661
|
-
});
|
|
3662
|
-
var i18n_1 = __webpack_require__(2);
|
|
3663
|
-
var schemaUtils_1 = __webpack_require__(16);
|
|
3664
|
-
var PresetPalettes_1 = __webpack_require__(60);
|
|
3665
4070
|
var pick_1 = __webpack_require__(23);
|
|
4071
|
+
|
|
3666
4072
|
var variables_1 = __webpack_require__(11);
|
|
4073
|
+
|
|
3667
4074
|
var configUtils_1 = __webpack_require__(22);
|
|
3668
|
-
|
|
3669
|
-
var
|
|
3670
|
-
|
|
3671
|
-
var
|
|
3672
|
-
|
|
3673
|
-
var
|
|
3674
|
-
|
|
3675
|
-
var
|
|
3676
|
-
|
|
3677
|
-
var
|
|
4075
|
+
|
|
4076
|
+
var singleValueContext_1 = __webpack_require__(135);
|
|
4077
|
+
|
|
4078
|
+
var StaticMajorAndTrendLayout_1 = __webpack_require__(102);
|
|
4079
|
+
|
|
4080
|
+
var StaticBackgroundColorEditor_1 = __webpack_require__(91);
|
|
4081
|
+
|
|
4082
|
+
var StaticIconColorEditor_1 = __webpack_require__(474);
|
|
4083
|
+
|
|
4084
|
+
var StaticMajorColorEditor_1 = __webpack_require__(103);
|
|
4085
|
+
|
|
4086
|
+
var StaticTrendColorEditor_1 = __webpack_require__(104);
|
|
4087
|
+
|
|
4088
|
+
var DynamicMajorColorEditor_1 = __webpack_require__(136);
|
|
4089
|
+
|
|
4090
|
+
var DynamicTrendColorEditor_1 = __webpack_require__(100);
|
|
4091
|
+
|
|
4092
|
+
var DynamicBackgroundColorEditor_1 = __webpack_require__(101);
|
|
4093
|
+
|
|
4094
|
+
var TrellisEditors_1 = __webpack_require__(105);
|
|
4095
|
+
|
|
3678
4096
|
var VizBehavior_1 = __webpack_require__(6);
|
|
4097
|
+
|
|
3679
4098
|
var configUtils_2 = __webpack_require__(20);
|
|
3680
|
-
|
|
4099
|
+
|
|
4100
|
+
var VizCategory_1 = __webpack_require__(36);
|
|
4101
|
+
|
|
3681
4102
|
var layoutUtils_1 = __webpack_require__(58);
|
|
4103
|
+
|
|
3682
4104
|
var dataContract = {
|
|
3683
4105
|
requiredDataSources: [{
|
|
3684
4106
|
name: 'primary',
|
|
@@ -3770,7 +4192,7 @@ var optionsSchema = {
|
|
|
3770
4192
|
default: 'off',
|
|
3771
4193
|
description: 'Specify the layout method by which to display the visualization, which splits the data into individual visualizations based on a certain category.',
|
|
3772
4194
|
type: 'string',
|
|
3773
|
-
pattern: schemaUtils_1.getPattern([layoutUtils_1.LAYOUT_TYPE.Off, layoutUtils_1.LAYOUT_TYPE.Trellis]),
|
|
4195
|
+
pattern: (0, schemaUtils_1.getPattern)([layoutUtils_1.LAYOUT_TYPE.Off, layoutUtils_1.LAYOUT_TYPE.Trellis]),
|
|
3774
4196
|
enum: [layoutUtils_1.LAYOUT_TYPE.Off, layoutUtils_1.LAYOUT_TYPE.Trellis]
|
|
3775
4197
|
},
|
|
3776
4198
|
trendColor: {
|
|
@@ -3782,7 +4204,7 @@ var optionsSchema = {
|
|
|
3782
4204
|
trendDisplay: {
|
|
3783
4205
|
default: 'absolute',
|
|
3784
4206
|
description: 'Specify whether the trend value is displayed as a percentage or an absolute count.',
|
|
3785
|
-
pattern: schemaUtils_1.getPattern(['off', 'percent', 'absolute']),
|
|
4207
|
+
pattern: (0, schemaUtils_1.getPattern)(['off', 'percent', 'absolute']),
|
|
3786
4208
|
type: 'string'
|
|
3787
4209
|
},
|
|
3788
4210
|
trendFontSize: {
|
|
@@ -3838,7 +4260,7 @@ var optionsSchema = {
|
|
|
3838
4260
|
unitPosition: {
|
|
3839
4261
|
default: 'after',
|
|
3840
4262
|
description: 'Specify whether the unit text should appear before or after the major value.',
|
|
3841
|
-
pattern: schemaUtils_1.getPattern(['before', 'after']),
|
|
4263
|
+
pattern: (0, schemaUtils_1.getPattern)(['before', 'after']),
|
|
3842
4264
|
type: 'string'
|
|
3843
4265
|
}
|
|
3844
4266
|
};
|
|
@@ -3856,14 +4278,14 @@ var basePresetOptions = {
|
|
|
3856
4278
|
};
|
|
3857
4279
|
var presets = [{
|
|
3858
4280
|
// dummy context variables to allow for resetting of unused context states
|
|
3859
|
-
label: i18n_1._('None'),
|
|
4281
|
+
label: (0, i18n_1._)('None'),
|
|
3860
4282
|
name: 'singleValueIcon.none',
|
|
3861
4283
|
value: {
|
|
3862
4284
|
context: Object.assign({}, basePresetContext),
|
|
3863
4285
|
options: Object.assign({}, basePresetOptions)
|
|
3864
4286
|
}
|
|
3865
4287
|
}, {
|
|
3866
|
-
label: i18n_1._('Icon'),
|
|
4288
|
+
label: (0, i18n_1._)('Icon'),
|
|
3867
4289
|
name: 'singleValueIcon.icon',
|
|
3868
4290
|
value: {
|
|
3869
4291
|
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
@@ -3874,7 +4296,7 @@ var presets = [{
|
|
|
3874
4296
|
})
|
|
3875
4297
|
}
|
|
3876
4298
|
}, {
|
|
3877
|
-
label: i18n_1._('Major value'),
|
|
4299
|
+
label: (0, i18n_1._)('Major value'),
|
|
3878
4300
|
name: 'singleValueIcon.majorValue',
|
|
3879
4301
|
value: {
|
|
3880
4302
|
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
@@ -3885,7 +4307,7 @@ var presets = [{
|
|
|
3885
4307
|
})
|
|
3886
4308
|
}
|
|
3887
4309
|
}, {
|
|
3888
|
-
label: i18n_1._('Trend value'),
|
|
4310
|
+
label: (0, i18n_1._)('Trend value'),
|
|
3889
4311
|
name: 'singleValueIcon.trend',
|
|
3890
4312
|
value: {
|
|
3891
4313
|
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
@@ -3896,7 +4318,7 @@ var presets = [{
|
|
|
3896
4318
|
})
|
|
3897
4319
|
}
|
|
3898
4320
|
}, {
|
|
3899
|
-
label: i18n_1._('Icon and Major value'),
|
|
4321
|
+
label: (0, i18n_1._)('Icon and Major value'),
|
|
3900
4322
|
name: 'singleValueIcon.iconAndMajorValue',
|
|
3901
4323
|
value: {
|
|
3902
4324
|
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
@@ -3909,7 +4331,7 @@ var presets = [{
|
|
|
3909
4331
|
})
|
|
3910
4332
|
}
|
|
3911
4333
|
}, {
|
|
3912
|
-
label: i18n_1._('Background'),
|
|
4334
|
+
label: (0, i18n_1._)('Background'),
|
|
3913
4335
|
name: 'singleValueIcon.background',
|
|
3914
4336
|
value: {
|
|
3915
4337
|
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
@@ -3925,9 +4347,10 @@ var presets = [{
|
|
|
3925
4347
|
* common theme variables such as enterprise.defaultFontColor
|
|
3926
4348
|
* that are repeated in multiple viz config themes should be DRYd up.
|
|
3927
4349
|
*/
|
|
4350
|
+
|
|
3928
4351
|
var themes = {
|
|
3929
4352
|
defaultFontColor: function defaultFontColor(props) {
|
|
3930
|
-
return pick_1.default({
|
|
4353
|
+
return (0, pick_1.default)({
|
|
3931
4354
|
enterprise: {
|
|
3932
4355
|
dark: variables_1.default.textColor(props),
|
|
3933
4356
|
light: variables_1.default.gray20(props)
|
|
@@ -3936,16 +4359,16 @@ var themes = {
|
|
|
3936
4359
|
})(props);
|
|
3937
4360
|
},
|
|
3938
4361
|
defaultBlockFontColor: function defaultBlockFontColor(props) {
|
|
3939
|
-
return pick_1.default({
|
|
4362
|
+
return (0, pick_1.default)({
|
|
3940
4363
|
enterprise: variables_1.default.white(props),
|
|
3941
4364
|
prisma: variables_1.default.contentColorActive(props)
|
|
3942
4365
|
})(props);
|
|
3943
4366
|
}
|
|
3944
4367
|
};
|
|
3945
4368
|
var editorConfig = [{
|
|
3946
|
-
label: i18n_1._('Data configurations'),
|
|
4369
|
+
label: (0, i18n_1._)('Data configurations'),
|
|
3947
4370
|
layout: [[{
|
|
3948
|
-
label: i18n_1._('Value'),
|
|
4371
|
+
label: (0, i18n_1._)('Value'),
|
|
3949
4372
|
editor: 'editor.columnSelector',
|
|
3950
4373
|
option: 'majorValue',
|
|
3951
4374
|
context: 'valuesContext',
|
|
@@ -3968,24 +4391,24 @@ var editorConfig = [{
|
|
|
3968
4391
|
}
|
|
3969
4392
|
}]]
|
|
3970
4393
|
}, {
|
|
3971
|
-
label: i18n_1._('Data display'),
|
|
4394
|
+
label: (0, i18n_1._)('Data display'),
|
|
3972
4395
|
layout: [[{
|
|
3973
|
-
label: i18n_1._('Show major and trend value'),
|
|
4396
|
+
label: (0, i18n_1._)('Show major and trend value'),
|
|
3974
4397
|
option: 'showValue',
|
|
3975
4398
|
editor: 'editor.toggle'
|
|
3976
4399
|
}]].concat(_toConsumableArray(StaticMajorAndTrendLayout_1.default), [[{
|
|
3977
|
-
label: i18n_1._('Trend display'),
|
|
4400
|
+
label: (0, i18n_1._)('Trend display'),
|
|
3978
4401
|
option: 'trendDisplay',
|
|
3979
4402
|
editor: 'editor.select',
|
|
3980
4403
|
editorProps: {
|
|
3981
4404
|
values: [{
|
|
3982
|
-
label: i18n_1._('Percent'),
|
|
4405
|
+
label: (0, i18n_1._)('Percent'),
|
|
3983
4406
|
value: 'percent'
|
|
3984
4407
|
}, {
|
|
3985
|
-
label: i18n_1._('Absolute'),
|
|
4408
|
+
label: (0, i18n_1._)('Absolute'),
|
|
3986
4409
|
value: 'absolute'
|
|
3987
4410
|
}, {
|
|
3988
|
-
label: i18n_1._('Off'),
|
|
4411
|
+
label: (0, i18n_1._)('Off'),
|
|
3989
4412
|
value: 'off'
|
|
3990
4413
|
}]
|
|
3991
4414
|
},
|
|
@@ -3995,51 +4418,51 @@ var editorConfig = [{
|
|
|
3995
4418
|
}
|
|
3996
4419
|
}]], _toConsumableArray(TrellisEditors_1.TrellisEditorConfig))
|
|
3997
4420
|
}, {
|
|
3998
|
-
label: i18n_1._('Color and style'),
|
|
4421
|
+
label: (0, i18n_1._)('Color and style'),
|
|
3999
4422
|
layout: [[{
|
|
4000
|
-
label: i18n_1._('Dynamic elements'),
|
|
4423
|
+
label: (0, i18n_1._)('Dynamic elements'),
|
|
4001
4424
|
key: 'presetSelector',
|
|
4002
4425
|
editor: 'editor.presetSelector',
|
|
4003
4426
|
editorProps: {
|
|
4004
4427
|
presets: presets,
|
|
4005
4428
|
value: function value(_ref3) {
|
|
4006
4429
|
var context = _ref3.context,
|
|
4007
|
-
|
|
4008
|
-
var initialPreset = configUtils_2.getInitialPreset(context, options, presets);
|
|
4430
|
+
options = _ref3.options;
|
|
4431
|
+
var initialPreset = (0, configUtils_2.getInitialPreset)(context, options, presets);
|
|
4009
4432
|
return initialPreset && initialPreset.label || null;
|
|
4010
4433
|
}
|
|
4011
4434
|
}
|
|
4012
4435
|
}], StaticIconColorEditor_1.default, [{
|
|
4013
|
-
label: i18n_1._('Icon'),
|
|
4436
|
+
label: (0, i18n_1._)('Icon'),
|
|
4014
4437
|
option: 'iconColor',
|
|
4015
4438
|
context: 'iconColorEditorConfig',
|
|
4016
4439
|
editor: 'editor.dynamicColor',
|
|
4017
4440
|
showEditor: function showEditor(_ref4) {
|
|
4018
4441
|
var options = _ref4.options;
|
|
4019
|
-
return configUtils_1.isDynamicOption(options.iconColor);
|
|
4442
|
+
return (0, configUtils_1.isDynamicOption)(options.iconColor);
|
|
4020
4443
|
},
|
|
4021
4444
|
editorProps: {
|
|
4022
4445
|
labelPosition: 'top',
|
|
4023
4446
|
flyoutTitle: 'Dynamic coloring: icon',
|
|
4024
4447
|
formatters: [{
|
|
4025
|
-
label: i18n_1._('Ranges'),
|
|
4448
|
+
label: (0, i18n_1._)('Ranges'),
|
|
4026
4449
|
value: 'rangeValue',
|
|
4027
4450
|
defaults: {
|
|
4028
4451
|
trendValue: singleValueContext_1.defaultContext.trendColorConfig,
|
|
4029
4452
|
majorValue: singleValueContext_1.defaultContext.majorColorConfig
|
|
4030
4453
|
}
|
|
4031
4454
|
}, {
|
|
4032
|
-
label: i18n_1._('Matches'),
|
|
4455
|
+
label: (0, i18n_1._)('Matches'),
|
|
4033
4456
|
value: 'matchValue',
|
|
4034
4457
|
defaults: {
|
|
4035
4458
|
majorValue: singleValueContext_1.defaultContext.majorColorMatchConfig
|
|
4036
4459
|
}
|
|
4037
4460
|
}],
|
|
4038
4461
|
dataSelectors: [{
|
|
4039
|
-
label: i18n_1._('Major value'),
|
|
4462
|
+
label: (0, i18n_1._)('Major value'),
|
|
4040
4463
|
value: 'majorValue'
|
|
4041
4464
|
}, {
|
|
4042
|
-
label: i18n_1._('Trend'),
|
|
4465
|
+
label: (0, i18n_1._)('Trend'),
|
|
4043
4466
|
value: 'trendValue'
|
|
4044
4467
|
}],
|
|
4045
4468
|
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
@@ -4048,14 +4471,14 @@ var editorConfig = [{
|
|
|
4048
4471
|
editorProps: {
|
|
4049
4472
|
themes: themes
|
|
4050
4473
|
}
|
|
4051
|
-
})], [DynamicMajorColorEditor_1.getDynamicMajorColorEditor({
|
|
4474
|
+
})], [(0, DynamicMajorColorEditor_1.getDynamicMajorColorEditor)({
|
|
4052
4475
|
defaultContext: singleValueContext_1.defaultContext,
|
|
4053
4476
|
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
4054
4477
|
})], [Object.assign(Object.assign({}, StaticTrendColorEditor_1.default), {
|
|
4055
4478
|
editorProps: {
|
|
4056
4479
|
themes: themes
|
|
4057
4480
|
}
|
|
4058
|
-
})], [DynamicTrendColorEditor_1.getDynamicTrendColorEditor({
|
|
4481
|
+
})], [(0, DynamicTrendColorEditor_1.getDynamicTrendColorEditor)({
|
|
4059
4482
|
defaultContext: singleValueContext_1.defaultContext,
|
|
4060
4483
|
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
4061
4484
|
})], [Object.assign(Object.assign({}, StaticBackgroundColorEditor_1.default), {
|
|
@@ -4066,29 +4489,29 @@ var editorConfig = [{
|
|
|
4066
4489
|
editorProps: {
|
|
4067
4490
|
themes: themes
|
|
4068
4491
|
}
|
|
4069
|
-
})], [DynamicBackgroundColorEditor_1.getDynamicBackgroundColorEditor({
|
|
4492
|
+
})], [(0, DynamicBackgroundColorEditor_1.getDynamicBackgroundColorEditor)({
|
|
4070
4493
|
defaultContext: singleValueContext_1.defaultContext,
|
|
4071
4494
|
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
4072
4495
|
})], [{
|
|
4073
|
-
label: i18n_1._('Major value size (px)'),
|
|
4496
|
+
label: (0, i18n_1._)('Major value size (px)'),
|
|
4074
4497
|
option: 'majorFontSize',
|
|
4075
4498
|
editor: 'editor.number',
|
|
4076
4499
|
editorProps: {
|
|
4077
4500
|
min: 1
|
|
4078
4501
|
},
|
|
4079
|
-
placeholder: i18n_1._('Auto'),
|
|
4502
|
+
placeholder: (0, i18n_1._)('Auto'),
|
|
4080
4503
|
showEditor: function showEditor(_ref5) {
|
|
4081
4504
|
var options = _ref5.options;
|
|
4082
4505
|
return options.showValue || options.showValue === undefined;
|
|
4083
4506
|
}
|
|
4084
4507
|
}, {
|
|
4085
|
-
label: i18n_1._('Trend value size (px)'),
|
|
4508
|
+
label: (0, i18n_1._)('Trend value size (px)'),
|
|
4086
4509
|
option: 'trendFontSize',
|
|
4087
4510
|
editor: 'editor.number',
|
|
4088
4511
|
editorProps: {
|
|
4089
4512
|
min: 1
|
|
4090
4513
|
},
|
|
4091
|
-
placeholder: i18n_1._('Auto'),
|
|
4514
|
+
placeholder: (0, i18n_1._)('Auto'),
|
|
4092
4515
|
showEditor: function showEditor(_ref6) {
|
|
4093
4516
|
var options = _ref6.options;
|
|
4094
4517
|
return options.showValue || options.showValue === undefined;
|
|
@@ -4102,16 +4525,19 @@ var editorConfig = [{
|
|
|
4102
4525
|
/**
|
|
4103
4526
|
* visualization configuration
|
|
4104
4527
|
*/
|
|
4528
|
+
|
|
4105
4529
|
var config = {
|
|
4106
4530
|
/**
|
|
4107
4531
|
* unique viz key
|
|
4108
4532
|
*/
|
|
4109
4533
|
key: 'splunk.singlevalueicon',
|
|
4534
|
+
|
|
4110
4535
|
/**
|
|
4111
4536
|
* viz name
|
|
4112
4537
|
*/
|
|
4113
|
-
name: i18n_1._('Single value icon'),
|
|
4538
|
+
name: (0, i18n_1._)('Single value icon'),
|
|
4114
4539
|
category: VizCategory_1.VizCategory.SINGLE_VALUE,
|
|
4540
|
+
|
|
4115
4541
|
/**
|
|
4116
4542
|
* viz icon
|
|
4117
4543
|
*/
|
|
@@ -4130,11 +4556,11 @@ var config = {
|
|
|
4130
4556
|
supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.TRELLIS],
|
|
4131
4557
|
themes: themes
|
|
4132
4558
|
};
|
|
4133
|
-
exports.default = configUtils_2.enhanceConfig(config);
|
|
4559
|
+
exports.default = (0, configUtils_2.enhanceConfig)(config);
|
|
4134
4560
|
|
|
4135
4561
|
/***/ }),
|
|
4136
4562
|
|
|
4137
|
-
/***/
|
|
4563
|
+
/***/ 474:
|
|
4138
4564
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4139
4565
|
|
|
4140
4566
|
"use strict";
|
|
@@ -4143,7 +4569,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4143
4569
|
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
|
|
4144
4570
|
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
|
4145
4571
|
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
|
4146
|
-
/* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
4572
|
+
/* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(49);
|
|
4147
4573
|
/* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_2__);
|
|
4148
4574
|
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(22);
|
|
4149
4575
|
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_3__);
|
|
@@ -4176,7 +4602,14 @@ module.exports = require("@babel/runtime/helpers/extends");
|
|
|
4176
4602
|
|
|
4177
4603
|
/***/ }),
|
|
4178
4604
|
|
|
4179
|
-
/***/
|
|
4605
|
+
/***/ 49:
|
|
4606
|
+
/***/ (function(module, exports) {
|
|
4607
|
+
|
|
4608
|
+
module.exports = require("@splunk/visualizations-shared/colorConstants");
|
|
4609
|
+
|
|
4610
|
+
/***/ }),
|
|
4611
|
+
|
|
4612
|
+
/***/ 490:
|
|
4180
4613
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4181
4614
|
|
|
4182
4615
|
"use strict";
|
|
@@ -4200,11 +4633,11 @@ var external_styled_components_ = __webpack_require__(4);
|
|
|
4200
4633
|
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
4201
4634
|
|
|
4202
4635
|
// EXTERNAL MODULE: external "lodash/pick"
|
|
4203
|
-
var pick_ = __webpack_require__(
|
|
4636
|
+
var pick_ = __webpack_require__(108);
|
|
4204
4637
|
var pick_default = /*#__PURE__*/__webpack_require__.n(pick_);
|
|
4205
4638
|
|
|
4206
4639
|
// EXTERNAL MODULE: external "lodash/isEmpty"
|
|
4207
|
-
var isEmpty_ = __webpack_require__(
|
|
4640
|
+
var isEmpty_ = __webpack_require__(109);
|
|
4208
4641
|
var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty_);
|
|
4209
4642
|
|
|
4210
4643
|
// EXTERNAL MODULE: external "@splunk/visualization-context/FeatureFlagContext"
|
|
@@ -4226,10 +4659,10 @@ var Message_ = __webpack_require__(10);
|
|
|
4226
4659
|
var Message_default = /*#__PURE__*/__webpack_require__.n(Message_);
|
|
4227
4660
|
|
|
4228
4661
|
// EXTERNAL MODULE: ./src/common/components/VizStyleWrapper.jsx
|
|
4229
|
-
var VizStyleWrapper = __webpack_require__(
|
|
4662
|
+
var VizStyleWrapper = __webpack_require__(73);
|
|
4230
4663
|
|
|
4231
4664
|
// EXTERNAL MODULE: ./src/common/components/TrellisTitle.tsx
|
|
4232
|
-
var TrellisTitle = __webpack_require__(
|
|
4665
|
+
var TrellisTitle = __webpack_require__(79);
|
|
4233
4666
|
|
|
4234
4667
|
// EXTERNAL MODULE: ./src/common/utils/layoutUtils.ts
|
|
4235
4668
|
var layoutUtils = __webpack_require__(58);
|
|
@@ -4239,27 +4672,27 @@ var defineProperty_ = __webpack_require__(7);
|
|
|
4239
4672
|
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
|
|
4240
4673
|
|
|
4241
4674
|
// EXTERNAL MODULE: external "@splunk/visualizations/SingleValueBasic"
|
|
4242
|
-
var SingleValueBasic_ = __webpack_require__(
|
|
4675
|
+
var SingleValueBasic_ = __webpack_require__(142);
|
|
4243
4676
|
var SingleValueBasic_default = /*#__PURE__*/__webpack_require__.n(SingleValueBasic_);
|
|
4244
4677
|
|
|
4245
4678
|
// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Activity"
|
|
4246
|
-
var Activity_ = __webpack_require__(
|
|
4679
|
+
var Activity_ = __webpack_require__(171);
|
|
4247
4680
|
var Activity_default = /*#__PURE__*/__webpack_require__.n(Activity_);
|
|
4248
4681
|
|
|
4249
4682
|
// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Clock"
|
|
4250
|
-
var Clock_ = __webpack_require__(
|
|
4683
|
+
var Clock_ = __webpack_require__(172);
|
|
4251
4684
|
var Clock_default = /*#__PURE__*/__webpack_require__.n(Clock_);
|
|
4252
4685
|
|
|
4253
4686
|
// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Pencil"
|
|
4254
|
-
var Pencil_ = __webpack_require__(
|
|
4687
|
+
var Pencil_ = __webpack_require__(173);
|
|
4255
4688
|
var Pencil_default = /*#__PURE__*/__webpack_require__.n(Pencil_);
|
|
4256
4689
|
|
|
4257
4690
|
// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Star"
|
|
4258
|
-
var Star_ = __webpack_require__(
|
|
4691
|
+
var Star_ = __webpack_require__(174);
|
|
4259
4692
|
var Star_default = /*#__PURE__*/__webpack_require__.n(Star_);
|
|
4260
4693
|
|
|
4261
4694
|
// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Question"
|
|
4262
|
-
var Question_ = __webpack_require__(
|
|
4695
|
+
var Question_ = __webpack_require__(175);
|
|
4263
4696
|
var Question_default = /*#__PURE__*/__webpack_require__.n(Question_);
|
|
4264
4697
|
|
|
4265
4698
|
// EXTERNAL MODULE: ./src/common/utils/singleValueUtils.js
|
|
@@ -4283,34 +4716,33 @@ var iconMap = {
|
|
|
4283
4716
|
star: Star_default.a,
|
|
4284
4717
|
default: Question_default.a
|
|
4285
4718
|
};
|
|
4286
|
-
|
|
4287
4719
|
/*
|
|
4288
4720
|
* get icon from icon map
|
|
4289
4721
|
* @param {String} key
|
|
4290
4722
|
* @return {Icon} icon component from icon map
|
|
4291
4723
|
*/
|
|
4724
|
+
|
|
4292
4725
|
var getIcon = function getIcon(key) {
|
|
4293
4726
|
return iconMap[key.toLowerCase()] || iconMap.default;
|
|
4294
4727
|
};
|
|
4295
|
-
|
|
4296
4728
|
/*
|
|
4297
4729
|
* @method isValidPosition
|
|
4298
4730
|
* @param {String} iconPosition
|
|
4299
4731
|
* @returns {Bool}
|
|
4300
4732
|
*/
|
|
4733
|
+
|
|
4301
4734
|
var isValidPosition = function isValidPosition(iconPosition) {
|
|
4302
4735
|
return ICON_POSITIONS.indexOf(iconPosition) > -1;
|
|
4303
4736
|
};
|
|
4304
|
-
|
|
4305
4737
|
/*
|
|
4306
4738
|
* @method isHorizontal
|
|
4307
4739
|
* @param {String} iconPosition
|
|
4308
4740
|
* @returns {Bool}
|
|
4309
4741
|
*/
|
|
4742
|
+
|
|
4310
4743
|
var isHorizontal = function isHorizontal(iconPosition) {
|
|
4311
4744
|
return iconPosition === 'before' || iconPosition === 'after';
|
|
4312
4745
|
};
|
|
4313
|
-
|
|
4314
4746
|
/*
|
|
4315
4747
|
* @method getIconWidth
|
|
4316
4748
|
* @param {Object} props
|
|
@@ -4318,12 +4750,12 @@ var isHorizontal = function isHorizontal(iconPosition) {
|
|
|
4318
4750
|
* @param {Number} props.width
|
|
4319
4751
|
* @returns {Number} iconWidth
|
|
4320
4752
|
*/
|
|
4753
|
+
|
|
4321
4754
|
var getIconWidth = function getIconWidth(_ref) {
|
|
4322
4755
|
var showHorizontal = _ref.showHorizontal,
|
|
4323
|
-
|
|
4756
|
+
width = _ref.width;
|
|
4324
4757
|
return showHorizontal ? width * ICON_HORIZONTAL_RATIO : width * ICON_VERTICAL_RATIO;
|
|
4325
4758
|
};
|
|
4326
|
-
|
|
4327
4759
|
/*
|
|
4328
4760
|
* @method getIconHeight
|
|
4329
4761
|
* @param {Object} props
|
|
@@ -4331,12 +4763,12 @@ var getIconWidth = function getIconWidth(_ref) {
|
|
|
4331
4763
|
* @param {Number} props.height
|
|
4332
4764
|
* @returns {Number} iconHeight
|
|
4333
4765
|
*/
|
|
4766
|
+
|
|
4334
4767
|
var getIconHeight = function getIconHeight(_ref2) {
|
|
4335
4768
|
var showHorizontal = _ref2.showHorizontal,
|
|
4336
|
-
|
|
4769
|
+
height = _ref2.height;
|
|
4337
4770
|
return showHorizontal ? height : height * 0.25;
|
|
4338
4771
|
};
|
|
4339
|
-
|
|
4340
4772
|
/*
|
|
4341
4773
|
* @method getIconFontSize
|
|
4342
4774
|
* @param {Object} props
|
|
@@ -4345,13 +4777,13 @@ var getIconHeight = function getIconHeight(_ref2) {
|
|
|
4345
4777
|
* @param {Number} props.iconWidth
|
|
4346
4778
|
* @returns {Number} iconFontSize
|
|
4347
4779
|
*/
|
|
4780
|
+
|
|
4348
4781
|
var getIconFontSize = function getIconFontSize(_ref3) {
|
|
4349
4782
|
var showValue = _ref3.showValue,
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
return showValue ? majorTextFontSize * 0.
|
|
4783
|
+
majorTextFontSize = _ref3.majorTextFontSize,
|
|
4784
|
+
iconWidth = _ref3.iconWidth;
|
|
4785
|
+
return showValue ? majorTextFontSize * 0.8 : iconWidth;
|
|
4353
4786
|
};
|
|
4354
|
-
|
|
4355
4787
|
/*
|
|
4356
4788
|
* @method getSVGDimension
|
|
4357
4789
|
* @param {Object} props
|
|
@@ -4361,14 +4793,14 @@ var getIconFontSize = function getIconFontSize(_ref3) {
|
|
|
4361
4793
|
* @param {Number} props.ratio
|
|
4362
4794
|
* @returns {Number} svg icon dimension
|
|
4363
4795
|
*/
|
|
4796
|
+
|
|
4364
4797
|
var getSVGDimension = function getSVGDimension(_ref4) {
|
|
4365
4798
|
var showValue = _ref4.showValue,
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4799
|
+
containerDimension = _ref4.containerDimension,
|
|
4800
|
+
iconDimension = _ref4.iconDimension,
|
|
4801
|
+
ratio = _ref4.ratio;
|
|
4369
4802
|
return showValue ? iconDimension * ratio : containerDimension;
|
|
4370
4803
|
};
|
|
4371
|
-
|
|
4372
4804
|
/*
|
|
4373
4805
|
* @method getValuesWidth
|
|
4374
4806
|
* @param {Object} props
|
|
@@ -4376,12 +4808,12 @@ var getSVGDimension = function getSVGDimension(_ref4) {
|
|
|
4376
4808
|
* @param {Number} props.width
|
|
4377
4809
|
* @returns {Number} valuesWidth
|
|
4378
4810
|
*/
|
|
4811
|
+
|
|
4379
4812
|
var getValuesWidth = function getValuesWidth(_ref5) {
|
|
4380
4813
|
var showHorizontal = _ref5.showHorizontal,
|
|
4381
|
-
|
|
4814
|
+
width = _ref5.width;
|
|
4382
4815
|
return showHorizontal ? width * (1 - ICON_HORIZONTAL_RATIO) : width;
|
|
4383
4816
|
};
|
|
4384
|
-
|
|
4385
4817
|
/*
|
|
4386
4818
|
* @method getValuesHeight
|
|
4387
4819
|
* @param {Object} props
|
|
@@ -4390,13 +4822,13 @@ var getValuesWidth = function getValuesWidth(_ref5) {
|
|
|
4390
4822
|
* @param {Number} props.iconHeight
|
|
4391
4823
|
* @returns {Number} valuesHeight
|
|
4392
4824
|
*/
|
|
4825
|
+
|
|
4393
4826
|
var getValuesHeight = function getValuesHeight(_ref6) {
|
|
4394
4827
|
var showHorizontal = _ref6.showHorizontal,
|
|
4395
|
-
|
|
4396
|
-
|
|
4828
|
+
height = _ref6.height,
|
|
4829
|
+
iconHeight = _ref6.iconHeight;
|
|
4397
4830
|
return showHorizontal ? height : height - iconHeight;
|
|
4398
4831
|
};
|
|
4399
|
-
|
|
4400
4832
|
/*
|
|
4401
4833
|
* getIconColor
|
|
4402
4834
|
* @param {Object} props
|
|
@@ -4406,11 +4838,13 @@ var getValuesHeight = function getValuesHeight(_ref6) {
|
|
|
4406
4838
|
* @param {String} props.defaultBlockFontColor
|
|
4407
4839
|
* @returns {String} icon color
|
|
4408
4840
|
*/
|
|
4841
|
+
|
|
4409
4842
|
var iconUtils_getIconColor = function getIconColor(_ref7) {
|
|
4410
4843
|
var iconColor = _ref7.iconColor,
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4844
|
+
backgroundColor = _ref7.backgroundColor,
|
|
4845
|
+
defaultFontColor = _ref7.defaultFontColor,
|
|
4846
|
+
defaultBlockFontColor = _ref7.defaultBlockFontColor;
|
|
4847
|
+
|
|
4414
4848
|
if (Object(singleValueUtils["hasBackground"])(backgroundColor) && !iconColor) {
|
|
4415
4849
|
return Object(singleValueUtils["getDefaultColorWithBg"])({
|
|
4416
4850
|
backgroundColor: backgroundColor,
|
|
@@ -4418,6 +4852,7 @@ var iconUtils_getIconColor = function getIconColor(_ref7) {
|
|
|
4418
4852
|
defaultBlockFontColor: defaultBlockFontColor
|
|
4419
4853
|
});
|
|
4420
4854
|
}
|
|
4855
|
+
|
|
4421
4856
|
return Object(singleValueUtils["getFormattedColor"])(iconColor, defaultFontColor);
|
|
4422
4857
|
};
|
|
4423
4858
|
// CONCATENATED MODULE: ./src/SingleValueIcon/PureSingleValueIcon/IconContainer.jsx
|
|
@@ -4443,25 +4878,27 @@ var StyledIconContainer = external_styled_components_default.a.div.attrs(functio
|
|
|
4443
4878
|
}, function (props) {
|
|
4444
4879
|
return props.onClick ? 'pointer' : 'inherit';
|
|
4445
4880
|
});
|
|
4881
|
+
|
|
4446
4882
|
var IconContainer_IconContainer = function IconContainer(_ref) {
|
|
4447
4883
|
var width = _ref.width,
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4884
|
+
height = _ref.height,
|
|
4885
|
+
fontSize = _ref.fontSize,
|
|
4886
|
+
color = _ref.color,
|
|
4887
|
+
opacity = _ref.opacity,
|
|
4888
|
+
icon = _ref.icon,
|
|
4889
|
+
IconComponent = _ref.IconComponent,
|
|
4890
|
+
onIconClick = _ref.onIconClick;
|
|
4455
4891
|
var onClick = typeof onIconClick === 'function' ? onIconClick : undefined;
|
|
4892
|
+
|
|
4456
4893
|
if (IconComponent) {
|
|
4457
4894
|
return /*#__PURE__*/external_react_default.a.createElement(StyledIconContainer, {
|
|
4458
4895
|
width: width,
|
|
4459
4896
|
height: height,
|
|
4460
4897
|
onClick: onClick
|
|
4461
4898
|
}, IconComponent);
|
|
4462
|
-
}
|
|
4899
|
+
} // todo: remove it after we have proper icon provider
|
|
4900
|
+
|
|
4463
4901
|
|
|
4464
|
-
// todo: remove it after we have proper icon provider
|
|
4465
4902
|
var Icon = getIcon(icon);
|
|
4466
4903
|
return /*#__PURE__*/external_react_default.a.createElement(StyledIconContainer, {
|
|
4467
4904
|
width: width,
|
|
@@ -4472,6 +4909,7 @@ var IconContainer_IconContainer = function IconContainer(_ref) {
|
|
|
4472
4909
|
onClick: onClick
|
|
4473
4910
|
}, /*#__PURE__*/external_react_default.a.createElement(Icon, null));
|
|
4474
4911
|
};
|
|
4912
|
+
|
|
4475
4913
|
IconContainer_IconContainer.propTypes = {
|
|
4476
4914
|
width: external_prop_types_default.a.number.isRequired,
|
|
4477
4915
|
height: external_prop_types_default.a.number.isRequired,
|
|
@@ -4486,25 +4924,38 @@ IconContainer_IconContainer.propTypes = {
|
|
|
4486
4924
|
// CONCATENATED MODULE: ./src/SingleValueIcon/PureSingleValueIcon/SingleValueIconLayout.jsx
|
|
4487
4925
|
|
|
4488
4926
|
|
|
4927
|
+
|
|
4489
4928
|
function ownKeys(object, enumerableOnly) {
|
|
4490
4929
|
var keys = Object.keys(object);
|
|
4930
|
+
|
|
4491
4931
|
if (Object.getOwnPropertySymbols) {
|
|
4492
4932
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
4493
|
-
enumerableOnly
|
|
4933
|
+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
4494
4934
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
4495
|
-
})
|
|
4935
|
+
});
|
|
4936
|
+
keys.push.apply(keys, symbols);
|
|
4496
4937
|
}
|
|
4938
|
+
|
|
4497
4939
|
return keys;
|
|
4498
4940
|
}
|
|
4941
|
+
|
|
4499
4942
|
function _objectSpread(target) {
|
|
4500
4943
|
for (var i = 1; i < arguments.length; i++) {
|
|
4501
|
-
var source =
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4944
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
4945
|
+
|
|
4946
|
+
if (i % 2) {
|
|
4947
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
4948
|
+
defineProperty_default()(target, key, source[key]);
|
|
4949
|
+
});
|
|
4950
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
4951
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
4952
|
+
} else {
|
|
4953
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
4954
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
4955
|
+
});
|
|
4956
|
+
}
|
|
4507
4957
|
}
|
|
4958
|
+
|
|
4508
4959
|
return target;
|
|
4509
4960
|
}
|
|
4510
4961
|
|
|
@@ -4513,6 +4964,7 @@ function _objectSpread(target) {
|
|
|
4513
4964
|
|
|
4514
4965
|
|
|
4515
4966
|
|
|
4967
|
+
|
|
4516
4968
|
var Column = external_styled_components_default.a.div.withConfig({
|
|
4517
4969
|
displayName: "SingleValueIconLayout__Column",
|
|
4518
4970
|
componentId: "c8okr6-0"
|
|
@@ -4525,31 +4977,33 @@ var IconColumn = external_styled_components_default.a.div.withConfig({
|
|
|
4525
4977
|
displayName: "SingleValueIconLayout__IconColumn",
|
|
4526
4978
|
componentId: "c8okr6-2"
|
|
4527
4979
|
})(["display:flex;flex-direction:column;justify-content:center;height:100%;"]);
|
|
4980
|
+
|
|
4528
4981
|
var SingleValueIconLayout_SingleValueIconLayout = function SingleValueIconLayout(_ref) {
|
|
4529
4982
|
var props = extends_default()({}, _ref);
|
|
4983
|
+
|
|
4530
4984
|
var majorColor = props.majorColor,
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4985
|
+
majorText = props.majorText,
|
|
4986
|
+
majorTextFontSize = props.majorTextFontSize,
|
|
4987
|
+
majorValueTitle = props.majorValueTitle,
|
|
4988
|
+
trendColor = props.trendColor,
|
|
4989
|
+
trendText = props.trendText,
|
|
4990
|
+
trendTextFontSize = props.trendTextFontSize,
|
|
4991
|
+
showTrendIndicator = props.showTrendIndicator,
|
|
4992
|
+
unit = props.unit,
|
|
4993
|
+
unitPosition = props.unitPosition,
|
|
4994
|
+
underLabel = props.underLabel,
|
|
4995
|
+
underLabelFontSize = props.underLabelFontSize,
|
|
4996
|
+
underLabelColor = props.underLabelColor,
|
|
4997
|
+
onValueClick = props.onValueClick,
|
|
4998
|
+
iconWidth = props.iconWidth,
|
|
4999
|
+
iconHeight = props.iconHeight,
|
|
5000
|
+
icon = props.icon,
|
|
5001
|
+
iconColor = props.iconColor,
|
|
5002
|
+
iconOpacity = props.iconOpacity,
|
|
5003
|
+
iconPosition = props.iconPosition,
|
|
5004
|
+
iconFontSize = props.iconFontSize,
|
|
5005
|
+
showValue = props.showValue,
|
|
5006
|
+
svgIconComponent = props.svgIconComponent;
|
|
4553
5007
|
var iconContainer = /*#__PURE__*/external_react_default.a.createElement(PureSingleValueIcon_IconContainer, {
|
|
4554
5008
|
width: iconWidth,
|
|
4555
5009
|
height: iconHeight,
|
|
@@ -4578,13 +5032,16 @@ var SingleValueIconLayout_SingleValueIconLayout = function SingleValueIconLayout
|
|
|
4578
5032
|
}) : null;
|
|
4579
5033
|
var iconLayout = null;
|
|
4580
5034
|
var showHorizontal = isHorizontal(iconPosition);
|
|
5035
|
+
|
|
4581
5036
|
if (showHorizontal) {
|
|
4582
5037
|
iconLayout = /*#__PURE__*/external_react_default.a.createElement(IconRow, null, iconPosition === 'before' && iconContainer, singleValueBasic, iconPosition === 'after' && iconContainer);
|
|
4583
5038
|
} else {
|
|
4584
5039
|
iconLayout = /*#__PURE__*/external_react_default.a.createElement(IconColumn, null, iconPosition === 'top' && iconContainer, singleValueBasic, iconPosition === 'below' && iconContainer);
|
|
4585
5040
|
}
|
|
5041
|
+
|
|
4586
5042
|
return /*#__PURE__*/external_react_default.a.createElement(Column, null, iconLayout);
|
|
4587
5043
|
};
|
|
5044
|
+
|
|
4588
5045
|
SingleValueIconLayout_SingleValueIconLayout.propTypes = _objectSpread(_objectSpread({}, SingleValueBasic_default.a.propTypes), {}, {
|
|
4589
5046
|
iconWidth: external_prop_types_default.a.number,
|
|
4590
5047
|
iconHeight: external_prop_types_default.a.number,
|
|
@@ -4621,43 +5078,47 @@ var Container = external_styled_components_default.a.div.withConfig({
|
|
|
4621
5078
|
})(["overflow:hidden;", ";"], function (props) {
|
|
4622
5079
|
return Object(style_["toDimension"])(pick_default()(props, ['width', 'height']));
|
|
4623
5080
|
});
|
|
5081
|
+
|
|
4624
5082
|
var SingleValueIcon_SingleValueIcon = function SingleValueIcon(_ref) {
|
|
4625
5083
|
var props = extends_default()({}, _ref);
|
|
5084
|
+
|
|
4626
5085
|
var width = props.width,
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
5086
|
+
_props$height = props.height,
|
|
5087
|
+
height = _props$height === void 0 ? 250 : _props$height,
|
|
5088
|
+
style = props.style,
|
|
5089
|
+
majorFontSize = props.majorFontSize,
|
|
5090
|
+
majorValue = props.majorValue,
|
|
5091
|
+
majorValueField = props.majorValueField,
|
|
5092
|
+
trendValue = props.trendValue,
|
|
5093
|
+
trendFontSize = props.trendFontSize,
|
|
5094
|
+
unitPosition = props.unitPosition,
|
|
5095
|
+
numberPrecision = props.numberPrecision,
|
|
5096
|
+
shouldUseThousandSeparators = props.shouldUseThousandSeparators,
|
|
5097
|
+
shouldAbbreviateTrendValue = props.shouldAbbreviateTrendValue,
|
|
5098
|
+
icon = props.icon,
|
|
5099
|
+
iconOpacity = props.iconOpacity,
|
|
5100
|
+
IconComponent = props.IconComponent,
|
|
5101
|
+
noDataSources = props.noDataSources,
|
|
5102
|
+
noResult = props.noResult,
|
|
5103
|
+
onValueClick = props.onValueClick,
|
|
5104
|
+
defaultFontColor = props.defaultFontColor,
|
|
5105
|
+
defaultBlockFontColor = props.defaultBlockFontColor,
|
|
5106
|
+
splitByLayout = props.splitByLayout,
|
|
5107
|
+
_props$trellisKey = props.trellisKey,
|
|
5108
|
+
trellisKey = _props$trellisKey === void 0 ? '' : _props$trellisKey,
|
|
5109
|
+
_props$trellisSplitBy = props.trellisSplitBy,
|
|
5110
|
+
trellisSplitBy = _props$trellisSplitBy === void 0 ? '' : _props$trellisSplitBy;
|
|
4652
5111
|
var defaultColors = {
|
|
4653
5112
|
defaultBlockFontColor: defaultBlockFontColor,
|
|
4654
5113
|
defaultFontColor: defaultFontColor
|
|
4655
5114
|
};
|
|
5115
|
+
|
|
4656
5116
|
var _computeColors = Object(singleValueUtils["computeColors"])(props, defaultColors),
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
5117
|
+
backgroundColor = _computeColors.backgroundColor,
|
|
5118
|
+
majorColor = _computeColors.majorColor,
|
|
5119
|
+
trendColor = _computeColors.trendColor,
|
|
5120
|
+
underLabelColor = _computeColors.underLabelColor;
|
|
5121
|
+
|
|
4661
5122
|
var iconColor = iconUtils_getIconColor({
|
|
4662
5123
|
iconColor: props.iconColor,
|
|
4663
5124
|
backgroundColor: backgroundColor,
|
|
@@ -4670,9 +5131,11 @@ var SingleValueIcon_SingleValueIcon = function SingleValueIcon(_ref) {
|
|
|
4670
5131
|
var handleValueClick = Object(external_react_["useCallback"])(function (ev) {
|
|
4671
5132
|
return Object(singleValueUtils["handleValueClickCallback"])(ev, majorValue, majorValueField, trendValue, onValueClick, trellisEnabled, trellisSplitBy, trellisKey);
|
|
4672
5133
|
}, [onValueClick, majorValue, majorValueField, trendValue, trellisEnabled, trellisSplitBy, trellisKey]);
|
|
5134
|
+
|
|
4673
5135
|
var renderVisualization = function renderVisualization(_ref2) {
|
|
4674
5136
|
var containerWidth = _ref2.width,
|
|
4675
|
-
|
|
5137
|
+
containerHeight = _ref2.height;
|
|
5138
|
+
|
|
4676
5139
|
if ((noDataSources || noResult) && !IconComponent) {
|
|
4677
5140
|
return /*#__PURE__*/external_react_default.a.createElement(Message_default.a, {
|
|
4678
5141
|
width: containerWidth,
|
|
@@ -4681,7 +5144,9 @@ var SingleValueIcon_SingleValueIcon = function SingleValueIcon(_ref) {
|
|
|
4681
5144
|
level: "warning"
|
|
4682
5145
|
});
|
|
4683
5146
|
}
|
|
5147
|
+
|
|
4684
5148
|
var IconLayout = null;
|
|
5149
|
+
|
|
4685
5150
|
if ((noDataSources || noResult) && IconComponent) {
|
|
4686
5151
|
IconLayout = /*#__PURE__*/external_react_default.a.cloneElement(IconComponent, {
|
|
4687
5152
|
width: containerWidth,
|
|
@@ -4692,14 +5157,16 @@ var SingleValueIcon_SingleValueIcon = function SingleValueIcon(_ref) {
|
|
|
4692
5157
|
} else {
|
|
4693
5158
|
// will update later based on text size
|
|
4694
5159
|
var _props$showValue = props.showValue,
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
5160
|
+
showValue = _props$showValue === void 0 ? true : _props$showValue,
|
|
5161
|
+
trendDisplay = props.trendDisplay,
|
|
5162
|
+
unit = props.unit,
|
|
5163
|
+
underLabel = props.underLabel,
|
|
5164
|
+
iconPosition = props.iconPosition;
|
|
5165
|
+
|
|
4700
5166
|
if (!isValidPosition(iconPosition)) {
|
|
4701
5167
|
iconPosition = 'before';
|
|
4702
5168
|
}
|
|
5169
|
+
|
|
4703
5170
|
var showHorizontal = isHorizontal(iconPosition);
|
|
4704
5171
|
var iconWidth = getIconWidth({
|
|
4705
5172
|
showHorizontal: showHorizontal,
|
|
@@ -4710,26 +5177,27 @@ var SingleValueIcon_SingleValueIcon = function SingleValueIcon(_ref) {
|
|
|
4710
5177
|
height: containerHeight
|
|
4711
5178
|
});
|
|
4712
5179
|
var svgIconComponent = null;
|
|
5180
|
+
|
|
4713
5181
|
if (IconComponent) {
|
|
4714
5182
|
svgIconComponent = /*#__PURE__*/external_react_default.a.cloneElement(IconComponent, {
|
|
4715
5183
|
width: getSVGDimension({
|
|
4716
5184
|
showValue: showValue,
|
|
4717
5185
|
containerDimension: containerWidth,
|
|
4718
5186
|
iconDimension: iconWidth,
|
|
4719
|
-
ratio: 0.
|
|
5187
|
+
ratio: 0.7
|
|
4720
5188
|
}),
|
|
4721
5189
|
height: getSVGDimension({
|
|
4722
5190
|
showValue: showValue,
|
|
4723
5191
|
containerDimension: containerHeight,
|
|
4724
5192
|
iconDimension: iconHeight,
|
|
4725
|
-
ratio: 0.
|
|
5193
|
+
ratio: 0.7
|
|
4726
5194
|
}),
|
|
4727
5195
|
color: props.iconColor,
|
|
4728
5196
|
opacity: iconOpacity
|
|
4729
5197
|
});
|
|
4730
|
-
}
|
|
5198
|
+
} // calculate major and trend text and font size
|
|
5199
|
+
|
|
4731
5200
|
|
|
4732
|
-
// claculate major and trend text and font size
|
|
4733
5201
|
var contentWidth = getValuesWidth({
|
|
4734
5202
|
showHorizontal: showHorizontal,
|
|
4735
5203
|
width: containerWidth
|
|
@@ -4752,41 +5220,43 @@ var SingleValueIcon_SingleValueIcon = function SingleValueIcon(_ref) {
|
|
|
4752
5220
|
key: 'showValue',
|
|
4753
5221
|
value: false
|
|
4754
5222
|
}];
|
|
5223
|
+
|
|
4755
5224
|
var _computeSingleValueCo = Object(singleValueUtils["computeSingleValueContent"])({
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
5225
|
+
majorValue: majorValue,
|
|
5226
|
+
trendValue: trendValue,
|
|
5227
|
+
majorFontSize: majorFontSize,
|
|
5228
|
+
trendFontSize: trendFontSize,
|
|
5229
|
+
trendDisplay: trendDisplay,
|
|
5230
|
+
contentWidth: contentWidth,
|
|
5231
|
+
contentHeight: contentHeight,
|
|
5232
|
+
containerWidth: containerWidth,
|
|
5233
|
+
containerHeight: containerHeight,
|
|
5234
|
+
unit: unit,
|
|
5235
|
+
numberPrecision: numberPrecision,
|
|
5236
|
+
shouldUseThousandSeparators: shouldUseThousandSeparators,
|
|
5237
|
+
shouldAbbreviateTrendValue: shouldAbbreviateTrendValue,
|
|
5238
|
+
toRemoveList: toRemoveList
|
|
5239
|
+
}),
|
|
5240
|
+
majorText = _computeSingleValueCo.majorText,
|
|
5241
|
+
trendText = _computeSingleValueCo.trendText,
|
|
5242
|
+
majorTextFontSize = _computeSingleValueCo.majorTextFontSize,
|
|
5243
|
+
trendTextFontSize = _computeSingleValueCo.trendTextFontSize,
|
|
5244
|
+
majorValueTitle = _computeSingleValueCo.majorValueTitle,
|
|
5245
|
+
smallVizProps = _computeSingleValueCo.smallVizProps;
|
|
5246
|
+
|
|
4777
5247
|
if (!isEmpty_default()(smallVizProps)) {
|
|
4778
5248
|
showValue = smallVizProps.showValue;
|
|
4779
5249
|
trendDisplay = smallVizProps.trendDisplay;
|
|
4780
5250
|
underLabel = smallVizProps.underLabel;
|
|
4781
5251
|
unit = smallVizProps.unit;
|
|
4782
5252
|
}
|
|
5253
|
+
|
|
4783
5254
|
var iconFontSize = getIconFontSize({
|
|
4784
5255
|
showValue: showValue,
|
|
4785
5256
|
majorTextFontSize: majorTextFontSize,
|
|
4786
5257
|
iconWidth: iconWidth
|
|
4787
|
-
});
|
|
5258
|
+
}); // calculate underlabel size
|
|
4788
5259
|
|
|
4789
|
-
// calculate underlabel size
|
|
4790
5260
|
var underLabelHeight = Object(singleValueUtils["getUnderLabelHeight"])(containerHeight * 0.1);
|
|
4791
5261
|
var underLabelFontSize = Object(singleValueUtils["getUnderLabel"])({
|
|
4792
5262
|
underLabel: underLabel,
|
|
@@ -4820,12 +5290,14 @@ var SingleValueIcon_SingleValueIcon = function SingleValueIcon(_ref) {
|
|
|
4820
5290
|
onValueClick: handleValueClick
|
|
4821
5291
|
});
|
|
4822
5292
|
}
|
|
5293
|
+
|
|
4823
5294
|
return /*#__PURE__*/external_react_default.a.createElement(VizStyleWrapper["default"], {
|
|
4824
5295
|
backgroundColor: backgroundColor,
|
|
4825
5296
|
style: style,
|
|
4826
5297
|
dataTestKey: "SingleValueIconWrapper"
|
|
4827
5298
|
}, IconLayout);
|
|
4828
5299
|
};
|
|
5300
|
+
|
|
4829
5301
|
if (isTrellisFeatureFlagOn && splitByLayout === layoutUtils["LAYOUT_TYPE"].Trellis) {
|
|
4830
5302
|
return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement(TrellisTitle["TrellisTitle"], {
|
|
4831
5303
|
fontColor: defaultFontColor,
|
|
@@ -4838,6 +5310,7 @@ var SingleValueIcon_SingleValueIcon = function SingleValueIcon(_ref) {
|
|
|
4838
5310
|
return renderVisualization(containerDimension);
|
|
4839
5311
|
})));
|
|
4840
5312
|
}
|
|
5313
|
+
|
|
4841
5314
|
return /*#__PURE__*/external_react_default.a.createElement(Container, {
|
|
4842
5315
|
width: width,
|
|
4843
5316
|
height: height
|
|
@@ -4845,6 +5318,7 @@ var SingleValueIcon_SingleValueIcon = function SingleValueIcon(_ref) {
|
|
|
4845
5318
|
return renderVisualization(containerDimension);
|
|
4846
5319
|
}));
|
|
4847
5320
|
};
|
|
5321
|
+
|
|
4848
5322
|
SingleValueIcon_SingleValueIcon.propTypes = {
|
|
4849
5323
|
width: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
|
|
4850
5324
|
height: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
|
|
@@ -4881,7 +5355,7 @@ SingleValueIcon_SingleValueIcon.propTypes = {
|
|
|
4881
5355
|
};
|
|
4882
5356
|
SingleValueIcon_SingleValueIcon.defaultProps = {
|
|
4883
5357
|
width: '100%',
|
|
4884
|
-
height:
|
|
5358
|
+
height: 400,
|
|
4885
5359
|
majorValue: 'N/A',
|
|
4886
5360
|
majorValueField: '',
|
|
4887
5361
|
trendDisplay: 'absolute',
|
|
@@ -4903,13 +5377,6 @@ SingleValueIcon_SingleValueIcon.defaultProps = {
|
|
|
4903
5377
|
|
|
4904
5378
|
/***/ }),
|
|
4905
5379
|
|
|
4906
|
-
/***/ 50:
|
|
4907
|
-
/***/ (function(module, exports) {
|
|
4908
|
-
|
|
4909
|
-
module.exports = require("@splunk/visualizations-shared/colorConstants");
|
|
4910
|
-
|
|
4911
|
-
/***/ }),
|
|
4912
|
-
|
|
4913
5380
|
/***/ 54:
|
|
4914
5381
|
/***/ (function(module, exports) {
|
|
4915
5382
|
|
|
@@ -4935,6 +5402,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4935
5402
|
});
|
|
4936
5403
|
exports.LAYOUT_TYPE = void 0;
|
|
4937
5404
|
var LAYOUT_TYPE;
|
|
5405
|
+
|
|
4938
5406
|
(function (LAYOUT_TYPE) {
|
|
4939
5407
|
LAYOUT_TYPE["Off"] = "off";
|
|
4940
5408
|
LAYOUT_TYPE["Trellis"] = "trellis";
|
|
@@ -4942,13 +5410,6 @@ var LAYOUT_TYPE;
|
|
|
4942
5410
|
|
|
4943
5411
|
/***/ }),
|
|
4944
5412
|
|
|
4945
|
-
/***/ 59:
|
|
4946
|
-
/***/ (function(module, exports) {
|
|
4947
|
-
|
|
4948
|
-
module.exports = require("@splunk/themes");
|
|
4949
|
-
|
|
4950
|
-
/***/ }),
|
|
4951
|
-
|
|
4952
5413
|
/***/ 6:
|
|
4953
5414
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4954
5415
|
|
|
@@ -4960,6 +5421,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4960
5421
|
});
|
|
4961
5422
|
exports.VizBehavior = void 0;
|
|
4962
5423
|
var VizBehavior;
|
|
5424
|
+
|
|
4963
5425
|
(function (VizBehavior) {
|
|
4964
5426
|
/**
|
|
4965
5427
|
* Dynamic Options Behavior.
|
|
@@ -4979,6 +5441,7 @@ var VizBehavior;
|
|
|
4979
5441
|
* missing.
|
|
4980
5442
|
* @type {string}
|
|
4981
5443
|
*/
|
|
5444
|
+
|
|
4982
5445
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
4983
5446
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
4984
5447
|
VizBehavior["TRELLIS"] = "trellis";
|
|
@@ -4989,6 +5452,13 @@ var VizBehavior;
|
|
|
4989
5452
|
/***/ 60:
|
|
4990
5453
|
/***/ (function(module, exports) {
|
|
4991
5454
|
|
|
5455
|
+
module.exports = require("@splunk/themes");
|
|
5456
|
+
|
|
5457
|
+
/***/ }),
|
|
5458
|
+
|
|
5459
|
+
/***/ 61:
|
|
5460
|
+
/***/ (function(module, exports) {
|
|
5461
|
+
|
|
4992
5462
|
module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
|
|
4993
5463
|
|
|
4994
5464
|
/***/ }),
|
|
@@ -5000,7 +5470,7 @@ module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
|
5000
5470
|
|
|
5001
5471
|
/***/ }),
|
|
5002
5472
|
|
|
5003
|
-
/***/
|
|
5473
|
+
/***/ 73:
|
|
5004
5474
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5005
5475
|
|
|
5006
5476
|
"use strict";
|
|
@@ -5025,7 +5495,7 @@ VizStyleWrapper.displayName = 'VizStyleWrapper';
|
|
|
5025
5495
|
|
|
5026
5496
|
/***/ }),
|
|
5027
5497
|
|
|
5028
|
-
/***/
|
|
5498
|
+
/***/ 79:
|
|
5029
5499
|
/***/ (function(module, exports, __webpack_require__) {
|
|
5030
5500
|
|
|
5031
5501
|
"use strict";
|
|
@@ -5035,8 +5505,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5035
5505
|
value: true
|
|
5036
5506
|
});
|
|
5037
5507
|
exports.TrellisTitle = exports.TRELLIS_TITLE_HEIGHT = void 0;
|
|
5508
|
+
|
|
5038
5509
|
var React = __webpack_require__(1);
|
|
5510
|
+
|
|
5039
5511
|
var styled_components_1 = __webpack_require__(4);
|
|
5512
|
+
|
|
5040
5513
|
exports.TRELLIS_TITLE_HEIGHT = 28;
|
|
5041
5514
|
var TrellisTitleText = styled_components_1.default.div.withConfig({
|
|
5042
5515
|
displayName: "TrellisTitle__TrellisTitleText",
|
|
@@ -5052,6 +5525,7 @@ var TrellisTitleDiv = styled_components_1.default.div.withConfig({
|
|
|
5052
5525
|
}, function (props) {
|
|
5053
5526
|
return props.backgroundColor;
|
|
5054
5527
|
});
|
|
5528
|
+
|
|
5055
5529
|
var TrellisTitle = function TrellisTitle(props) {
|
|
5056
5530
|
var titleText = String(props.trellisKey).toString();
|
|
5057
5531
|
return React.createElement(TrellisTitleDiv, {
|
|
@@ -5061,6 +5535,7 @@ var TrellisTitle = function TrellisTitle(props) {
|
|
|
5061
5535
|
title: titleText
|
|
5062
5536
|
}, React.createElement(TrellisTitleText, null, titleText));
|
|
5063
5537
|
};
|
|
5538
|
+
|
|
5064
5539
|
exports.TrellisTitle = TrellisTitle;
|
|
5065
5540
|
|
|
5066
5541
|
/***/ }),
|
|
@@ -5072,28 +5547,21 @@ module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
|
5072
5547
|
|
|
5073
5548
|
/***/ }),
|
|
5074
5549
|
|
|
5075
|
-
/***/
|
|
5550
|
+
/***/ 84:
|
|
5076
5551
|
/***/ (function(module, exports) {
|
|
5077
5552
|
|
|
5078
5553
|
module.exports = require("@splunk/visualizations-shared/trellisUtils");
|
|
5079
5554
|
|
|
5080
5555
|
/***/ }),
|
|
5081
5556
|
|
|
5082
|
-
/***/
|
|
5083
|
-
/***/ (function(module, exports) {
|
|
5084
|
-
|
|
5085
|
-
module.exports = require("lodash/pick");
|
|
5086
|
-
|
|
5087
|
-
/***/ }),
|
|
5088
|
-
|
|
5089
|
-
/***/ 82:
|
|
5557
|
+
/***/ 9:
|
|
5090
5558
|
/***/ (function(module, exports) {
|
|
5091
5559
|
|
|
5092
|
-
module.exports = require("
|
|
5560
|
+
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
5093
5561
|
|
|
5094
5562
|
/***/ }),
|
|
5095
5563
|
|
|
5096
|
-
/***/
|
|
5564
|
+
/***/ 91:
|
|
5097
5565
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5098
5566
|
|
|
5099
5567
|
"use strict";
|
|
@@ -5117,14 +5585,7 @@ var StaticBackgroundColorEditor = {
|
|
|
5117
5585
|
|
|
5118
5586
|
/***/ }),
|
|
5119
5587
|
|
|
5120
|
-
/***/
|
|
5121
|
-
/***/ (function(module, exports) {
|
|
5122
|
-
|
|
5123
|
-
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
5124
|
-
|
|
5125
|
-
/***/ }),
|
|
5126
|
-
|
|
5127
|
-
/***/ 92:
|
|
5588
|
+
/***/ 94:
|
|
5128
5589
|
/***/ (function(module, exports) {
|
|
5129
5590
|
|
|
5130
5591
|
module.exports = require("@splunk/react-ui/Paginator");
|