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