@splunk/visualizations 26.0.0 → 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 +102 -18
- package/Area.config.js.map +1 -1
- package/Area.js +618 -221
- package/Area.js.map +1 -1
- package/Bar.config.js +104 -20
- package/Bar.config.js.map +1 -1
- package/Bar.js +624 -219
- package/Bar.js.map +1 -1
- package/Bubble.config.js +94 -20
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +606 -211
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +65 -14
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +550 -183
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +103 -18
- package/Column.config.js.map +1 -1
- package/Column.js +637 -221
- package/Column.js.map +1 -1
- package/Ellipse.config.js +82 -17
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +425 -148
- package/Ellipse.js.map +1 -1
- package/Events.config.js +100 -18
- package/Events.config.js.map +1 -1
- package/Events.js +752 -293
- package/Events.js.map +1 -1
- package/FillerGauge.config.js +96 -27
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +759 -374
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +62 -18
- package/Image.config.js.map +1 -1
- package/Image.js +419 -154
- package/Image.js.map +1 -1
- package/Line.config.js +106 -22
- package/Line.config.js.map +1 -1
- package/Line.js +631 -223
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +72 -22
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +632 -219
- package/LinkGraph.js.map +1 -1
- package/MIGRATION.md +1082 -0
- package/Map.config.js +241 -97
- package/Map.config.js.map +1 -1
- package/Map.js +1195 -595
- package/Map.js.map +1 -1
- package/Markdown.config.js +70 -20
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +460 -195
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +79 -21
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +802 -411
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +72 -18
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +853 -484
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +75 -22
- package/Pie.config.js.map +1 -1
- package/Pie.js +612 -212
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +81 -29
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +844 -379
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +85 -19
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +432 -152
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +84 -22
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +878 -342
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +96 -22
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +607 -212
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +94 -24
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +1182 -650
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +286 -225
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +92 -22
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +965 -506
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +99 -26
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +1167 -616
- package/SingleValueRadial.js.map +1 -1
- package/SparkLine.js +126 -67
- package/SparkLine.js.map +1 -1
- package/Table.config.js +73 -20
- package/Table.config.js.map +1 -1
- package/Table.js +810 -322
- package/Table.js.map +1 -1
- package/common/Charting.js +107 -35
- package/common/Charting.js.map +1 -1
- package/common/ChartingApi.js +18 -7
- package/common/ChartingApi.js.map +1 -1
- package/common/EventsDoc.js +76 -22
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +68 -58
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +43 -34
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +156 -65
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js +33 -5
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.js +31 -4
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +8 -2
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemesDoc.js +27 -14
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +44 -12
- package/common/chartingUtils.js.map +1 -1
- package/common/docUtils.js +11 -1
- package/common/docUtils.js.map +1 -1
- package/common/gaugeUtils.js +173 -90
- package/common/gaugeUtils.js.map +1 -1
- package/common/shapeUtils.js +14 -2
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/configUtils.js +49 -14
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/dataUtils.js +7 -2
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/hocUtils.js +3 -1
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/layoutUtils.js +1 -0
- package/common/utils/layoutUtils.js.map +1 -1
- package/common/utils/mapUtils.js +287 -127
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +241 -196
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +9 -0
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +61 -0
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +2 -0
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +274 -95
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +16 -18
package/Rectangle.js
CHANGED
|
@@ -130,11 +130,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
130
130
|
value: true
|
|
131
131
|
});
|
|
132
132
|
exports.getDynamicFillColorEditor = void 0;
|
|
133
|
+
|
|
133
134
|
var i18n_1 = __webpack_require__(2);
|
|
135
|
+
|
|
134
136
|
var configUtils_1 = __webpack_require__(22);
|
|
137
|
+
|
|
135
138
|
var getDynamicFillColorEditor = function getDynamicFillColorEditor(_ref) {
|
|
136
139
|
var defaultContext = _ref.defaultContext,
|
|
137
|
-
|
|
140
|
+
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
138
141
|
return {
|
|
139
142
|
label: (0, i18n_1._)('Fill'),
|
|
140
143
|
option: 'fillColor',
|
|
@@ -168,6 +171,7 @@ var getDynamicFillColorEditor = function getDynamicFillColorEditor(_ref) {
|
|
|
168
171
|
}
|
|
169
172
|
};
|
|
170
173
|
};
|
|
174
|
+
|
|
171
175
|
exports.getDynamicFillColorEditor = getDynamicFillColorEditor;
|
|
172
176
|
|
|
173
177
|
/***/ }),
|
|
@@ -182,11 +186,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
182
186
|
value: true
|
|
183
187
|
});
|
|
184
188
|
exports.getDynamicStrokeColorEditor = void 0;
|
|
189
|
+
|
|
185
190
|
var i18n_1 = __webpack_require__(2);
|
|
191
|
+
|
|
186
192
|
var configUtils_1 = __webpack_require__(22);
|
|
193
|
+
|
|
187
194
|
var getDynamicStrokeColorEditor = function getDynamicStrokeColorEditor(_ref) {
|
|
188
195
|
var defaultContext = _ref.defaultContext,
|
|
189
|
-
|
|
196
|
+
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
190
197
|
return {
|
|
191
198
|
label: (0, i18n_1._)('Stroke'),
|
|
192
199
|
option: 'strokeColor',
|
|
@@ -220,6 +227,7 @@ var getDynamicStrokeColorEditor = function getDynamicStrokeColorEditor(_ref) {
|
|
|
220
227
|
}
|
|
221
228
|
};
|
|
222
229
|
};
|
|
230
|
+
|
|
223
231
|
exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
|
|
224
232
|
|
|
225
233
|
/***/ }),
|
|
@@ -233,8 +241,11 @@ exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
|
|
|
233
241
|
Object.defineProperty(exports, "__esModule", {
|
|
234
242
|
value: true
|
|
235
243
|
});
|
|
244
|
+
|
|
236
245
|
var i18n_1 = __webpack_require__(2);
|
|
246
|
+
|
|
237
247
|
var configUtils_1 = __webpack_require__(22);
|
|
248
|
+
|
|
238
249
|
var StaticFillColorEditor = {
|
|
239
250
|
label: (0, i18n_1._)('Fill'),
|
|
240
251
|
option: 'fillColor',
|
|
@@ -257,8 +268,11 @@ exports.default = StaticFillColorEditor;
|
|
|
257
268
|
Object.defineProperty(exports, "__esModule", {
|
|
258
269
|
value: true
|
|
259
270
|
});
|
|
271
|
+
|
|
260
272
|
var i18n_1 = __webpack_require__(2);
|
|
273
|
+
|
|
261
274
|
var configUtils_1 = __webpack_require__(22);
|
|
275
|
+
|
|
262
276
|
var StaticStrokeColorEditor = {
|
|
263
277
|
label: (0, i18n_1._)('Stroke'),
|
|
264
278
|
option: 'strokeColor',
|
|
@@ -279,17 +293,25 @@ exports.default = StaticStrokeColorEditor;
|
|
|
279
293
|
|
|
280
294
|
|
|
281
295
|
var _taggedTemplateLiteral = __webpack_require__(59);
|
|
296
|
+
|
|
282
297
|
var _templateObject;
|
|
298
|
+
|
|
283
299
|
Object.defineProperty(exports, "__esModule", {
|
|
284
300
|
value: true
|
|
285
301
|
});
|
|
286
302
|
exports.getStyledShape = exports.mapToOldKey = void 0;
|
|
303
|
+
|
|
287
304
|
var lodash_1 = __webpack_require__(3);
|
|
305
|
+
|
|
288
306
|
var styled_components_1 = __webpack_require__(4);
|
|
307
|
+
|
|
289
308
|
var pick_1 = __webpack_require__(23);
|
|
309
|
+
|
|
290
310
|
var variables_1 = __webpack_require__(11);
|
|
291
|
-
|
|
292
|
-
// map for new options names to old option names
|
|
311
|
+
|
|
312
|
+
var propUtils_1 = __webpack_require__(29); // map for new options names to old option names
|
|
313
|
+
|
|
314
|
+
|
|
293
315
|
var shapeOptionsMapping = {
|
|
294
316
|
fillColor: 'fill',
|
|
295
317
|
strokeColor: 'stroke',
|
|
@@ -302,17 +324,20 @@ var shapeOptionsMapping = {
|
|
|
302
324
|
* @param {Object} options
|
|
303
325
|
* @returns {Object}
|
|
304
326
|
*/
|
|
327
|
+
|
|
305
328
|
var mapToOldKey = function mapToOldKey(options) {
|
|
306
329
|
return (0, lodash_1.mapKeys)(options, function (val, key) {
|
|
307
330
|
return shapeOptionsMapping[key] ? shapeOptionsMapping[key] : key;
|
|
308
331
|
});
|
|
309
332
|
};
|
|
333
|
+
|
|
310
334
|
exports.mapToOldKey = mapToOldKey;
|
|
311
335
|
/**
|
|
312
336
|
* Helper method to get styled component for ellipse or rectangle
|
|
313
337
|
* @method mapToOldKey
|
|
314
338
|
* @param {Shape} shape
|
|
315
339
|
*/
|
|
340
|
+
|
|
316
341
|
var getStyledShape = function getStyledShape(shape) {
|
|
317
342
|
return (0, styled_components_1.default)(shape)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fill: ", ";\n stroke: ", ";\n cursor: ", ";\n"])), function (props) {
|
|
318
343
|
return props.fill && (0, propUtils_1.formatColor)(props.fill) || (0, pick_1.default)({
|
|
@@ -334,6 +359,7 @@ var getStyledShape = function getStyledShape(shape) {
|
|
|
334
359
|
return props.onClick ? 'pointer' : 'inherit';
|
|
335
360
|
});
|
|
336
361
|
};
|
|
362
|
+
|
|
337
363
|
exports.getStyledShape = getStyledShape;
|
|
338
364
|
|
|
339
365
|
/***/ }),
|
|
@@ -354,11 +380,17 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
|
354
380
|
Object.defineProperty(exports, "__esModule", {
|
|
355
381
|
value: true
|
|
356
382
|
});
|
|
383
|
+
|
|
357
384
|
var React = __webpack_require__(1);
|
|
385
|
+
|
|
358
386
|
var styled_components_1 = __webpack_require__(4);
|
|
387
|
+
|
|
359
388
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
389
|
+
|
|
360
390
|
var style_1 = __webpack_require__(14);
|
|
391
|
+
|
|
361
392
|
var colorUtils_1 = __webpack_require__(12);
|
|
393
|
+
|
|
362
394
|
var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
363
395
|
var width = _ref.width;
|
|
364
396
|
return {
|
|
@@ -371,11 +403,11 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
|
371
403
|
componentId: "sc-1yhgpod-0"
|
|
372
404
|
})(["position:relative;background-color:", "};"], function (props) {
|
|
373
405
|
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
374
|
-
});
|
|
375
|
-
|
|
406
|
+
}); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
|
|
407
|
+
|
|
376
408
|
var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
|
|
377
409
|
var width = _ref2.width,
|
|
378
|
-
|
|
410
|
+
height = _ref2.height;
|
|
379
411
|
return {
|
|
380
412
|
style: Object.assign(Object.assign({}, width && {
|
|
381
413
|
width: (0, style_1.toPx)(width)
|
|
@@ -397,11 +429,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
|
|
|
397
429
|
displayName: "FixedSizeContainer__FixSizeItemContent",
|
|
398
430
|
componentId: "sc-1yhgpod-3"
|
|
399
431
|
})(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
|
|
432
|
+
|
|
400
433
|
var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
401
434
|
var FixedSizeContainer = function FixedSizeContainer(props) {
|
|
402
435
|
var width = props.width,
|
|
403
|
-
|
|
404
|
-
|
|
436
|
+
height = props.height,
|
|
437
|
+
backgroundColor = props.backgroundColor;
|
|
438
|
+
|
|
405
439
|
if (!height) {
|
|
406
440
|
return React.createElement(Item, {
|
|
407
441
|
"data-test": "item",
|
|
@@ -409,24 +443,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
409
443
|
backgroundColor: backgroundColor
|
|
410
444
|
}, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
|
|
411
445
|
}
|
|
446
|
+
|
|
412
447
|
return React.createElement(FixSizeItem, {
|
|
413
448
|
"data-test": "fix-size-item",
|
|
414
|
-
"data-splunk-visualization-version": "26.
|
|
449
|
+
"data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
|
|
415
450
|
width: width,
|
|
416
451
|
height: height,
|
|
417
452
|
backgroundColor: backgroundColor
|
|
418
453
|
}, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
|
|
419
454
|
var newWidth = _ref3.width,
|
|
420
|
-
|
|
455
|
+
newHeight = _ref3.height;
|
|
421
456
|
return React.createElement(Viz, Object.assign({}, props, {
|
|
422
457
|
width: newWidth,
|
|
423
458
|
height: newHeight
|
|
424
459
|
}));
|
|
425
460
|
})));
|
|
426
461
|
};
|
|
462
|
+
|
|
427
463
|
FixedSizeContainer.displayName = 'withFixedSizeContainer';
|
|
428
464
|
return FixedSizeContainer;
|
|
429
465
|
};
|
|
466
|
+
|
|
430
467
|
exports.default = withFixedSizeContainer;
|
|
431
468
|
|
|
432
469
|
/***/ }),
|
|
@@ -454,9 +491,10 @@ exports.extendStaticWrapperProps = void 0;
|
|
|
454
491
|
* @param {DashboardVizType} props.Wrapper
|
|
455
492
|
* @param {DashboardVizType} props.Visualization
|
|
456
493
|
*/
|
|
494
|
+
|
|
457
495
|
var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
458
496
|
var Wrapper = _ref.Wrapper,
|
|
459
|
-
|
|
497
|
+
Visualization = _ref.Visualization;
|
|
460
498
|
var extendProperties = ['propTypes', 'defaultProps', 'config'];
|
|
461
499
|
extendProperties.forEach(function (prop) {
|
|
462
500
|
if (Visualization[prop]) {
|
|
@@ -465,6 +503,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
465
503
|
}
|
|
466
504
|
});
|
|
467
505
|
};
|
|
506
|
+
|
|
468
507
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
469
508
|
|
|
470
509
|
/***/ }),
|
|
@@ -484,26 +523,38 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
|
484
523
|
|
|
485
524
|
var __rest = this && this.__rest || function (s, e) {
|
|
486
525
|
var t = {};
|
|
526
|
+
|
|
487
527
|
for (var p in s) {
|
|
488
528
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
489
529
|
}
|
|
530
|
+
|
|
490
531
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
491
532
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
492
533
|
}
|
|
493
534
|
return t;
|
|
494
535
|
};
|
|
536
|
+
|
|
495
537
|
Object.defineProperty(exports, "__esModule", {
|
|
496
538
|
value: true
|
|
497
539
|
});
|
|
498
540
|
exports.config = exports.computeVizProps = void 0;
|
|
541
|
+
|
|
499
542
|
var React = __webpack_require__(1);
|
|
543
|
+
|
|
500
544
|
var styled_components_1 = __webpack_require__(4);
|
|
545
|
+
|
|
501
546
|
var lodash_1 = __webpack_require__(3);
|
|
547
|
+
|
|
502
548
|
var T = __webpack_require__(0);
|
|
503
|
-
|
|
549
|
+
|
|
550
|
+
var withDashboardViz_1 = __webpack_require__(37);
|
|
551
|
+
|
|
504
552
|
var config_1 = __webpack_require__(456);
|
|
553
|
+
|
|
505
554
|
exports.config = config_1.default;
|
|
555
|
+
|
|
506
556
|
var shapeUtils_1 = __webpack_require__(118);
|
|
557
|
+
|
|
507
558
|
var SVGContainer = styled_components_1.default.svg.withConfig({
|
|
508
559
|
displayName: "Rectangle__SVGContainer",
|
|
509
560
|
componentId: "iwvil2-0"
|
|
@@ -520,14 +571,16 @@ var propTypes = {
|
|
|
520
571
|
onRectangleClick: T.func
|
|
521
572
|
};
|
|
522
573
|
var RectangleShape = (0, shapeUtils_1.getStyledShape)('rect');
|
|
574
|
+
|
|
523
575
|
var RectangleViz = function RectangleViz(props) {
|
|
524
576
|
var width = props.width,
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
577
|
+
height = props.height,
|
|
578
|
+
options = props.options,
|
|
579
|
+
onRectangleClick = props.onRectangleClick;
|
|
528
580
|
var strokeWidth = options.strokeWidth;
|
|
529
581
|
var rx = options.rx,
|
|
530
|
-
|
|
582
|
+
ry = options.ry; // If either radius value is NaN/undefined, sets value to 0.
|
|
583
|
+
|
|
531
584
|
rx = rx || 0;
|
|
532
585
|
ry = ry || 0;
|
|
533
586
|
return React.createElement(SVGContainer, {
|
|
@@ -544,10 +597,13 @@ var RectangleViz = function RectangleViz(props) {
|
|
|
544
597
|
onClick: onRectangleClick
|
|
545
598
|
})));
|
|
546
599
|
};
|
|
600
|
+
|
|
547
601
|
var validOptions = Object.keys(config_1.default.optionsSchema);
|
|
602
|
+
|
|
548
603
|
var computeVizProps = function computeVizProps(props) {
|
|
549
604
|
var dataSources = props.dataSources,
|
|
550
|
-
|
|
605
|
+
otherOptions = __rest(props, ["dataSources"]);
|
|
606
|
+
|
|
551
607
|
var computedProps = {
|
|
552
608
|
dataSources: dataSources,
|
|
553
609
|
options: null
|
|
@@ -555,6 +611,7 @@ var computeVizProps = function computeVizProps(props) {
|
|
|
555
611
|
computedProps.options = (0, lodash_1.chain)(otherOptions).pick(validOptions).thru(shapeUtils_1.mapToOldKey).value();
|
|
556
612
|
return computedProps;
|
|
557
613
|
};
|
|
614
|
+
|
|
558
615
|
exports.computeVizProps = computeVizProps;
|
|
559
616
|
RectangleViz.propTypes = propTypes;
|
|
560
617
|
RectangleViz.defaultProps = {
|
|
@@ -605,24 +662,33 @@ module.exports = require("@splunk/ui-utils/i18n");
|
|
|
605
662
|
|
|
606
663
|
|
|
607
664
|
var _toConsumableArray = __webpack_require__(8);
|
|
665
|
+
|
|
608
666
|
var _defineProperty = __webpack_require__(7);
|
|
667
|
+
|
|
609
668
|
var __rest = this && this.__rest || function (s, e) {
|
|
610
669
|
var t = {};
|
|
670
|
+
|
|
611
671
|
for (var p in s) {
|
|
612
672
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
613
673
|
}
|
|
674
|
+
|
|
614
675
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
615
676
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
616
677
|
}
|
|
617
678
|
return t;
|
|
618
679
|
};
|
|
680
|
+
|
|
619
681
|
Object.defineProperty(exports, "__esModule", {
|
|
620
682
|
value: true
|
|
621
683
|
});
|
|
622
684
|
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
685
|
+
|
|
623
686
|
var lodash_1 = __webpack_require__(3);
|
|
687
|
+
|
|
624
688
|
var schemaUtils_1 = __webpack_require__(16);
|
|
689
|
+
|
|
625
690
|
var VizBehavior_1 = __webpack_require__(6);
|
|
691
|
+
|
|
626
692
|
var dynamicOptionsDSLType = {
|
|
627
693
|
type: 'string',
|
|
628
694
|
pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
|
|
@@ -632,20 +698,22 @@ var dynamicOptionsDSLType = {
|
|
|
632
698
|
* @param optionsSchema a visualization's options schema
|
|
633
699
|
* @returns an updated options schema that additionally allows strings starting with > for each option
|
|
634
700
|
*/
|
|
701
|
+
|
|
635
702
|
function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
636
703
|
var enhancedOptionsSchema = {};
|
|
637
704
|
Object.keys(optionsSchema).forEach(function (key) {
|
|
638
705
|
var _a = optionsSchema[key],
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
706
|
+
title = _a.title,
|
|
707
|
+
description = _a.description,
|
|
708
|
+
readOnly = _a.readOnly,
|
|
709
|
+
writeOnly = _a.writeOnly,
|
|
710
|
+
examples = _a.examples,
|
|
711
|
+
defaultValue = _a.default,
|
|
712
|
+
type = _a.type,
|
|
713
|
+
properties = _a.properties,
|
|
714
|
+
patternProperties = _a.patternProperties,
|
|
715
|
+
remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
|
|
716
|
+
|
|
649
717
|
var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
|
|
650
718
|
title: title
|
|
651
719
|
}), description !== undefined && {
|
|
@@ -659,12 +727,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
659
727
|
}), defaultValue !== undefined && {
|
|
660
728
|
default: defaultValue
|
|
661
729
|
});
|
|
730
|
+
|
|
662
731
|
if (type === 'object') {
|
|
663
732
|
enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
|
|
664
733
|
type: type
|
|
665
734
|
}), properties && {
|
|
666
735
|
properties: enhanceOptionsSchemaWithDynamicOptions(properties)
|
|
667
736
|
});
|
|
737
|
+
|
|
668
738
|
if (patternProperties) {
|
|
669
739
|
var enhancedPatternProperties = {};
|
|
670
740
|
Object.keys(patternProperties).forEach(function (opt) {
|
|
@@ -682,6 +752,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
682
752
|
});
|
|
683
753
|
return enhancedOptionsSchema;
|
|
684
754
|
}
|
|
755
|
+
|
|
685
756
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
686
757
|
/**
|
|
687
758
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
@@ -690,11 +761,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
|
|
|
690
761
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
691
762
|
* and containing `open: false` for all editor panels in editorConfig
|
|
692
763
|
*/
|
|
764
|
+
|
|
693
765
|
function enhanceConfig(vizConfig) {
|
|
694
766
|
var enhancedConfig = Object.assign({}, vizConfig);
|
|
767
|
+
|
|
695
768
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
|
|
696
769
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
697
770
|
}
|
|
771
|
+
|
|
698
772
|
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
699
773
|
return Object.assign(Object.assign({}, config), {
|
|
700
774
|
open: config.open || false
|
|
@@ -702,6 +776,7 @@ function enhanceConfig(vizConfig) {
|
|
|
702
776
|
});
|
|
703
777
|
return enhancedConfig;
|
|
704
778
|
}
|
|
779
|
+
|
|
705
780
|
exports.enhanceConfig = enhanceConfig;
|
|
706
781
|
/**
|
|
707
782
|
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
@@ -709,6 +784,7 @@ exports.enhanceConfig = enhanceConfig;
|
|
|
709
784
|
* @param vizConfig a Visualization Config
|
|
710
785
|
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
711
786
|
*/
|
|
787
|
+
|
|
712
788
|
function uncollapseEditorConfig(vizConfig) {
|
|
713
789
|
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
714
790
|
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
@@ -718,13 +794,16 @@ function uncollapseEditorConfig(vizConfig) {
|
|
|
718
794
|
});
|
|
719
795
|
return editorPanelUncollapsedConfig;
|
|
720
796
|
}
|
|
797
|
+
|
|
721
798
|
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
799
|
+
|
|
722
800
|
function isDynamicOption(option) {
|
|
723
801
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
724
802
|
}
|
|
725
|
-
|
|
726
|
-
// private helpers to improve readability of getInitialPreset
|
|
803
|
+
|
|
804
|
+
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
727
805
|
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
806
|
+
|
|
728
807
|
/**
|
|
729
808
|
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
730
809
|
* 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
|
|
@@ -733,6 +812,7 @@ exports.isDynamicOption = isDynamicOption;
|
|
|
733
812
|
*
|
|
734
813
|
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
735
814
|
*/
|
|
815
|
+
|
|
736
816
|
function hasCompatibleContexts(vizContext, presetContext) {
|
|
737
817
|
var presetContextKeys = Object.keys(presetContext);
|
|
738
818
|
return presetContextKeys.every(function (contextKey) {
|
|
@@ -742,6 +822,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
|
|
|
742
822
|
/**
|
|
743
823
|
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
744
824
|
*/
|
|
825
|
+
|
|
826
|
+
|
|
745
827
|
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
746
828
|
var presetOptionKeys = Object.keys(presetOptions);
|
|
747
829
|
return presetOptionKeys.every(function (optionKey) {
|
|
@@ -756,18 +838,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
|
756
838
|
* @param {Object} vizOptions - the current vizOptions definition
|
|
757
839
|
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
758
840
|
*/
|
|
841
|
+
|
|
842
|
+
|
|
759
843
|
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
760
844
|
return presets.find(function (preset) {
|
|
761
845
|
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
762
846
|
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
763
847
|
var presetContextKeys = Object.keys(presetContext);
|
|
764
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
765
|
-
// all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
848
|
+
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
766
849
|
// if not, then the preset is invalid in config.ts
|
|
850
|
+
|
|
767
851
|
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
768
852
|
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
769
853
|
});
|
|
770
854
|
}
|
|
855
|
+
|
|
771
856
|
exports.getInitialPreset = getInitialPreset;
|
|
772
857
|
/**
|
|
773
858
|
* generates number precision values for a Select editor
|
|
@@ -775,6 +860,7 @@ exports.getInitialPreset = getInitialPreset;
|
|
|
775
860
|
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
776
861
|
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
777
862
|
*/
|
|
863
|
+
|
|
778
864
|
function generatePrecisionValues(numPrecisionValues) {
|
|
779
865
|
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
780
866
|
return {
|
|
@@ -783,6 +869,7 @@ function generatePrecisionValues(numPrecisionValues) {
|
|
|
783
869
|
};
|
|
784
870
|
});
|
|
785
871
|
}
|
|
872
|
+
|
|
786
873
|
exports.generatePrecisionValues = generatePrecisionValues;
|
|
787
874
|
/**
|
|
788
875
|
* insert layout in layout array, return a new layout array instead of updating the original
|
|
@@ -792,12 +879,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
|
|
|
792
879
|
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
793
880
|
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
794
881
|
*/
|
|
882
|
+
|
|
795
883
|
var insertLayout = function insertLayout(layout, index) {
|
|
796
884
|
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
797
885
|
layoutItems[_key - 2] = arguments[_key];
|
|
798
886
|
}
|
|
887
|
+
|
|
799
888
|
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
800
889
|
};
|
|
890
|
+
|
|
801
891
|
exports.insertLayout = insertLayout;
|
|
802
892
|
|
|
803
893
|
/***/ }),
|
|
@@ -882,11 +972,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
882
972
|
value: true
|
|
883
973
|
});
|
|
884
974
|
exports.shouldShowIconPlaceholder = void 0;
|
|
975
|
+
|
|
885
976
|
var React = __webpack_require__(1);
|
|
977
|
+
|
|
886
978
|
var T = __webpack_require__(0);
|
|
979
|
+
|
|
887
980
|
var lodash_1 = __webpack_require__(3);
|
|
981
|
+
|
|
888
982
|
var i18n_1 = __webpack_require__(2);
|
|
983
|
+
|
|
889
984
|
var Message_1 = __webpack_require__(10);
|
|
985
|
+
|
|
890
986
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
891
987
|
/**
|
|
892
988
|
* @method shouldShowIconPlaceholder
|
|
@@ -894,6 +990,8 @@ var FixedSizeContainer_1 = __webpack_require__(13);
|
|
|
894
990
|
* @param {boolean} loading
|
|
895
991
|
* @returns {boolean}
|
|
896
992
|
*/
|
|
993
|
+
|
|
994
|
+
|
|
897
995
|
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
898
996
|
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
899
997
|
var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
|
|
@@ -902,6 +1000,7 @@ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources)
|
|
|
902
1000
|
var noFields = fields === undefined;
|
|
903
1001
|
return loading || noData || noFields;
|
|
904
1002
|
};
|
|
1003
|
+
|
|
905
1004
|
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
906
1005
|
var propTypes = {
|
|
907
1006
|
icon: T.func,
|
|
@@ -916,11 +1015,13 @@ var propTypes = {
|
|
|
916
1015
|
* @param {IconPlaceholderProps} props
|
|
917
1016
|
* @returns {React.ReactElement}
|
|
918
1017
|
*/
|
|
1018
|
+
|
|
919
1019
|
var IconPlaceholder = function IconPlaceholder(props) {
|
|
920
1020
|
var width = props.width,
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
1021
|
+
height = props.height,
|
|
1022
|
+
icon = props.icon,
|
|
1023
|
+
iconColor = props.iconColor;
|
|
1024
|
+
|
|
924
1025
|
if (icon) {
|
|
925
1026
|
return React.createElement(icon, {
|
|
926
1027
|
style: {
|
|
@@ -935,6 +1036,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
935
1036
|
height: '50%'
|
|
936
1037
|
});
|
|
937
1038
|
}
|
|
1039
|
+
|
|
938
1040
|
return React.createElement(Message_1.default, {
|
|
939
1041
|
width: width,
|
|
940
1042
|
height: height,
|
|
@@ -942,6 +1044,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
942
1044
|
message: (0, i18n_1._)('No DataSource Connected')
|
|
943
1045
|
});
|
|
944
1046
|
};
|
|
1047
|
+
|
|
945
1048
|
IconPlaceholder.propTypes = propTypes;
|
|
946
1049
|
IconPlaceholder.defaultProps = {
|
|
947
1050
|
width: '100%',
|
|
@@ -958,21 +1061,27 @@ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
|
|
|
958
1061
|
|
|
959
1062
|
|
|
960
1063
|
var _defineProperty = __webpack_require__(7);
|
|
1064
|
+
|
|
961
1065
|
Object.defineProperty(exports, "__esModule", {
|
|
962
1066
|
value: true
|
|
963
1067
|
});
|
|
964
1068
|
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
1069
|
+
|
|
965
1070
|
var T = __webpack_require__(0);
|
|
1071
|
+
|
|
966
1072
|
var lodash_1 = __webpack_require__(3);
|
|
967
|
-
|
|
1073
|
+
|
|
1074
|
+
var DataSource_1 = __webpack_require__(34);
|
|
1075
|
+
|
|
968
1076
|
exports.SortParamsPropTypes = T.shape({
|
|
969
1077
|
currentSortKey: T.string,
|
|
970
1078
|
currentSortDir: T.oneOf(DataSource_1.validSortDirs),
|
|
971
1079
|
onSort: T.func
|
|
972
1080
|
});
|
|
1081
|
+
|
|
973
1082
|
var getSortingParams = function getSortingParams(_ref) {
|
|
974
1083
|
var requestParams = _ref.requestParams,
|
|
975
|
-
|
|
1084
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
976
1085
|
var currentSortKey;
|
|
977
1086
|
var currentSortDir;
|
|
978
1087
|
var nextSortDirMap = {
|
|
@@ -981,15 +1090,18 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
981
1090
|
none: 'asc'
|
|
982
1091
|
};
|
|
983
1092
|
var onSort;
|
|
1093
|
+
|
|
984
1094
|
if (typeof onRequestParamsChange === 'function') {
|
|
985
1095
|
if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
|
|
986
1096
|
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
987
1097
|
currentSortDir = requestParams.sort[currentSortKey];
|
|
988
|
-
}
|
|
989
|
-
|
|
1098
|
+
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
1099
|
+
|
|
1100
|
+
|
|
990
1101
|
onSort = function onSort(e, _ref2) {
|
|
991
1102
|
var sortKey = _ref2.sortKey,
|
|
992
|
-
|
|
1103
|
+
sortDir = _ref2.sortDir;
|
|
1104
|
+
|
|
993
1105
|
if (typeof sortKey === 'string') {
|
|
994
1106
|
var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
995
1107
|
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
@@ -1001,12 +1113,14 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
1001
1113
|
}
|
|
1002
1114
|
};
|
|
1003
1115
|
}
|
|
1116
|
+
|
|
1004
1117
|
return {
|
|
1005
1118
|
currentSortKey: currentSortKey,
|
|
1006
1119
|
currentSortDir: currentSortDir,
|
|
1007
1120
|
onSort: onSort
|
|
1008
1121
|
};
|
|
1009
1122
|
};
|
|
1123
|
+
|
|
1010
1124
|
exports.getSortingParams = getSortingParams;
|
|
1011
1125
|
|
|
1012
1126
|
/***/ }),
|
|
@@ -1017,43 +1131,69 @@ exports.getSortingParams = getSortingParams;
|
|
|
1017
1131
|
"use strict";
|
|
1018
1132
|
|
|
1019
1133
|
|
|
1134
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1135
|
+
value: true
|
|
1136
|
+
});
|
|
1137
|
+
exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
|
|
1138
|
+
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1139
|
+
exports.validSegmentationModes = ['none', 'inner'];
|
|
1140
|
+
exports.validOutputModes = ['json_cols', 'json'];
|
|
1141
|
+
|
|
1142
|
+
/***/ }),
|
|
1143
|
+
|
|
1144
|
+
/***/ 35:
|
|
1145
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1146
|
+
|
|
1147
|
+
"use strict";
|
|
1148
|
+
|
|
1149
|
+
|
|
1020
1150
|
Object.defineProperty(exports, "__esModule", {
|
|
1021
1151
|
value: true
|
|
1022
1152
|
});
|
|
1023
1153
|
exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
1154
|
+
|
|
1024
1155
|
var T = __webpack_require__(0);
|
|
1156
|
+
|
|
1025
1157
|
var lodash_1 = __webpack_require__(3);
|
|
1158
|
+
|
|
1026
1159
|
exports.PaginatorParamsPropTypes = T.shape({
|
|
1027
1160
|
isPaging: T.bool,
|
|
1028
1161
|
current: T.number,
|
|
1029
1162
|
totalPages: T.number,
|
|
1030
1163
|
onChange: T.func
|
|
1031
1164
|
});
|
|
1165
|
+
|
|
1032
1166
|
var getPaginationParams = function getPaginationParams(_ref) {
|
|
1033
1167
|
var requestParams = _ref.requestParams,
|
|
1034
|
-
|
|
1035
|
-
|
|
1168
|
+
meta = _ref.meta,
|
|
1169
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
1036
1170
|
var totalCount = meta && meta.totalCount || 0;
|
|
1037
1171
|
var offset = requestParams && requestParams.offset || 0;
|
|
1038
1172
|
var count = requestParams && requestParams.count;
|
|
1039
1173
|
var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
1040
1174
|
var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
1041
1175
|
var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
|
|
1176
|
+
|
|
1042
1177
|
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
1043
1178
|
var page = _ref2.page,
|
|
1044
|
-
|
|
1179
|
+
countArg = _ref2.count;
|
|
1045
1180
|
var newParams = (0, lodash_1.cloneDeep)(requestParams);
|
|
1181
|
+
|
|
1046
1182
|
if (typeof countArg === 'number') {
|
|
1047
1183
|
newParams.count = countArg;
|
|
1048
1184
|
newParams.offset = 0;
|
|
1049
1185
|
}
|
|
1186
|
+
|
|
1050
1187
|
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
1188
|
+
|
|
1051
1189
|
if (typeof page === 'number' && page > 0) {
|
|
1052
1190
|
newParams.count = pageCount;
|
|
1053
1191
|
newParams.offset = (page - 1) * pageCount;
|
|
1054
1192
|
}
|
|
1193
|
+
|
|
1055
1194
|
onRequestParamsChange(newParams);
|
|
1056
1195
|
};
|
|
1196
|
+
|
|
1057
1197
|
return {
|
|
1058
1198
|
isPaging: isPaging,
|
|
1059
1199
|
current: current,
|
|
@@ -1061,11 +1201,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
|
|
|
1061
1201
|
onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
|
|
1062
1202
|
};
|
|
1063
1203
|
};
|
|
1204
|
+
|
|
1064
1205
|
exports.getPaginationParams = getPaginationParams;
|
|
1065
1206
|
|
|
1066
1207
|
/***/ }),
|
|
1067
1208
|
|
|
1068
|
-
/***/
|
|
1209
|
+
/***/ 36:
|
|
1069
1210
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1070
1211
|
|
|
1071
1212
|
"use strict";
|
|
@@ -1076,6 +1217,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1076
1217
|
});
|
|
1077
1218
|
exports.VizCategory = void 0;
|
|
1078
1219
|
var VizCategory;
|
|
1220
|
+
|
|
1079
1221
|
(function (VizCategory) {
|
|
1080
1222
|
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
1081
1223
|
VizCategory["TRENDS"] = "Trends";
|
|
@@ -1093,67 +1235,96 @@ var VizCategory;
|
|
|
1093
1235
|
|
|
1094
1236
|
/***/ }),
|
|
1095
1237
|
|
|
1096
|
-
/***/
|
|
1238
|
+
/***/ 37:
|
|
1097
1239
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1098
1240
|
|
|
1099
1241
|
"use strict";
|
|
1100
1242
|
|
|
1101
1243
|
|
|
1102
1244
|
var _slicedToArray = __webpack_require__(17);
|
|
1245
|
+
|
|
1103
1246
|
Object.defineProperty(exports, "__esModule", {
|
|
1104
1247
|
value: true
|
|
1105
1248
|
});
|
|
1249
|
+
|
|
1106
1250
|
var React = __webpack_require__(1);
|
|
1251
|
+
|
|
1107
1252
|
var lodash_1 = __webpack_require__(3);
|
|
1108
|
-
|
|
1253
|
+
|
|
1254
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(38);
|
|
1255
|
+
|
|
1109
1256
|
var Options_1 = __webpack_require__(30);
|
|
1110
|
-
|
|
1257
|
+
|
|
1258
|
+
var SanitizeProps_1 = __webpack_require__(39);
|
|
1259
|
+
|
|
1111
1260
|
var TimezoneContext_1 = __webpack_require__(26);
|
|
1112
|
-
|
|
1261
|
+
|
|
1262
|
+
var moment_1 = __webpack_require__(40);
|
|
1263
|
+
|
|
1113
1264
|
var FeatureFlagContext_1 = __webpack_require__(21);
|
|
1265
|
+
|
|
1114
1266
|
var styled_components_1 = __webpack_require__(4);
|
|
1267
|
+
|
|
1115
1268
|
var hocUtils_1 = __webpack_require__(27);
|
|
1269
|
+
|
|
1116
1270
|
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
1117
|
-
|
|
1271
|
+
|
|
1272
|
+
var async_dynamic_options_evaluator_1 = __webpack_require__(41);
|
|
1273
|
+
|
|
1118
1274
|
var id_1 = __webpack_require__(25);
|
|
1119
|
-
|
|
1275
|
+
|
|
1276
|
+
var SplunkVisualization_1 = __webpack_require__(42);
|
|
1277
|
+
|
|
1120
1278
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1279
|
+
|
|
1121
1280
|
var getSorting_1 = __webpack_require__(33);
|
|
1122
|
-
|
|
1281
|
+
|
|
1282
|
+
var getPagination_1 = __webpack_require__(35);
|
|
1283
|
+
|
|
1123
1284
|
var useDeepMemo_1 = __webpack_require__(44);
|
|
1285
|
+
|
|
1124
1286
|
var MissingPropsMessage_1 = __webpack_require__(45);
|
|
1287
|
+
|
|
1125
1288
|
var withEditModeCover_1 = __webpack_require__(46);
|
|
1289
|
+
|
|
1126
1290
|
var withPlaceholder_1 = __webpack_require__(47);
|
|
1127
1291
|
/**
|
|
1128
1292
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
1129
1293
|
* @param {DashboardVizOpts} opts
|
|
1130
1294
|
* @returns {HOC}
|
|
1131
1295
|
*/
|
|
1296
|
+
|
|
1297
|
+
|
|
1132
1298
|
var withDashboardViz = function withDashboardViz(opts) {
|
|
1133
1299
|
var ReactViz = opts.ReactViz,
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1300
|
+
vizConfig = opts.vizConfig,
|
|
1301
|
+
_opts$computeVizProps = opts.computeVizProps,
|
|
1302
|
+
computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
|
|
1303
|
+
disableEditModeCover = opts.disableEditModeCover,
|
|
1304
|
+
useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
|
|
1305
|
+
|
|
1139
1306
|
var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
|
|
1140
1307
|
var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
|
|
1308
|
+
|
|
1141
1309
|
var DashboardViz = function DashboardViz(props) {
|
|
1142
1310
|
var _a;
|
|
1311
|
+
|
|
1143
1312
|
var mode = props.mode,
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1313
|
+
hasEventHandlers = props.hasEventHandlers,
|
|
1314
|
+
dataSources = props.dataSources,
|
|
1315
|
+
options = props.options,
|
|
1316
|
+
_props$context = props.context,
|
|
1317
|
+
context = _props$context === void 0 ? {} : _props$context,
|
|
1318
|
+
width = props.width,
|
|
1319
|
+
height = props.height,
|
|
1320
|
+
onComputedProps = props.onComputedProps,
|
|
1321
|
+
onEventTrigger = props.onEventTrigger,
|
|
1322
|
+
theme = props.theme,
|
|
1323
|
+
onRequestParamsChange = props.onRequestParamsChange;
|
|
1324
|
+
|
|
1155
1325
|
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
1156
|
-
|
|
1326
|
+
serializedTimezone = _React$useContext.serializedTimezone;
|
|
1327
|
+
|
|
1157
1328
|
if (serializedTimezone) {
|
|
1158
1329
|
/*
|
|
1159
1330
|
@splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
|
|
@@ -1167,38 +1338,51 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1167
1338
|
moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
|
|
1168
1339
|
}
|
|
1169
1340
|
}
|
|
1341
|
+
|
|
1170
1342
|
var themeFunc = function themeFunc(themeVar) {
|
|
1171
1343
|
var _a, _b;
|
|
1344
|
+
|
|
1172
1345
|
return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
|
|
1173
1346
|
};
|
|
1347
|
+
|
|
1174
1348
|
var bgColorFromTheme = themeFunc('defaultBackgroundColor');
|
|
1349
|
+
|
|
1175
1350
|
var _ref = (0, getSettingsFromThemedProps_1.default)({
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1351
|
+
theme: theme
|
|
1352
|
+
}),
|
|
1353
|
+
currentThemeFamily = _ref.family,
|
|
1354
|
+
currentThemeColorScheme = _ref.colorScheme,
|
|
1355
|
+
currentThemeDensity = _ref.density;
|
|
1356
|
+
|
|
1181
1357
|
var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
|
|
1358
|
+
|
|
1182
1359
|
var _React$useState = React.useState({}),
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1360
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1361
|
+
evaluatedOptionsAsync = _React$useState2[0],
|
|
1362
|
+
setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
|
|
1363
|
+
|
|
1364
|
+
|
|
1186
1365
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
1366
|
+
|
|
1187
1367
|
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
|
|
1188
|
-
|
|
1189
|
-
|
|
1368
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
1369
|
+
visualizationID = _React$useState4[0];
|
|
1370
|
+
|
|
1190
1371
|
var _React$useState5 = React.useState({}),
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1372
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
1373
|
+
dataSourcesInState = _React$useState6[0],
|
|
1374
|
+
setDataSourcesInState = _React$useState6[1];
|
|
1375
|
+
|
|
1194
1376
|
var _React$useState7 = React.useState(),
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1377
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
1378
|
+
dataFramesInState = _React$useState8[0],
|
|
1379
|
+
setDataFramesInState = _React$useState8[1];
|
|
1380
|
+
|
|
1198
1381
|
var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1382
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
1383
|
+
useAsyncEvaluatedOptions = _React$useState10[0],
|
|
1384
|
+
setUseAsyncEvaluatedOptions = _React$useState10[1];
|
|
1385
|
+
|
|
1202
1386
|
var isMounted = React.useRef(true);
|
|
1203
1387
|
evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
|
|
1204
1388
|
try {
|
|
@@ -1223,11 +1407,13 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1223
1407
|
});
|
|
1224
1408
|
} else {
|
|
1225
1409
|
var dataFrames = dataFramesInState;
|
|
1410
|
+
|
|
1226
1411
|
if (dataSources !== dataSourcesInState) {
|
|
1227
1412
|
setDataSourcesInState(dataSources);
|
|
1228
1413
|
dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
|
|
1229
1414
|
setDataFramesInState(dataFrames);
|
|
1230
1415
|
}
|
|
1416
|
+
|
|
1231
1417
|
return Options_1.Options.evaluate({
|
|
1232
1418
|
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
1233
1419
|
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
@@ -1238,21 +1424,24 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1238
1424
|
console.error("unexpected error evaluating options: ".concat(e.message));
|
|
1239
1425
|
return {};
|
|
1240
1426
|
}
|
|
1427
|
+
|
|
1241
1428
|
return {};
|
|
1242
1429
|
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
|
|
1243
|
-
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
1244
|
-
// trellis specific backgroundColor update for onComputedProps
|
|
1430
|
+
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
|
|
1245
1431
|
// 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
|
|
1246
1432
|
// onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
|
|
1433
|
+
|
|
1247
1434
|
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
1248
1435
|
var clonedEvaluatedOptions = evaluatedOptionsToUse;
|
|
1436
|
+
|
|
1249
1437
|
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) {
|
|
1250
1438
|
clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
|
|
1251
1439
|
backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
1252
1440
|
});
|
|
1253
|
-
}
|
|
1254
|
-
// useEffect hook needs to be initialized before any early returns
|
|
1441
|
+
} // useEffect hook needs to be initialized before any early returns
|
|
1255
1442
|
// this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
|
|
1443
|
+
|
|
1444
|
+
|
|
1256
1445
|
React.useEffect(function () {
|
|
1257
1446
|
onComputedProps(clonedEvaluatedOptions);
|
|
1258
1447
|
});
|
|
@@ -1262,44 +1451,49 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1262
1451
|
isMounted.current = false;
|
|
1263
1452
|
async_dynamic_options_evaluator_1.default.reset(visualizationID);
|
|
1264
1453
|
}
|
|
1265
|
-
};
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
// present warning message if any required props are missing
|
|
1454
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1455
|
+
}, []); // present warning message if any required props are missing
|
|
1456
|
+
|
|
1269
1457
|
var _vizConfig$requiredPr = vizConfig.requiredProps,
|
|
1270
|
-
|
|
1271
|
-
|
|
1458
|
+
requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
|
|
1459
|
+
supports = vizConfig.supports;
|
|
1272
1460
|
var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
|
|
1461
|
+
|
|
1273
1462
|
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
|
|
1274
1463
|
) {
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1464
|
+
return React.createElement(MissingPropsMessage_1.default, {
|
|
1465
|
+
"data-test": "missing-props-message",
|
|
1466
|
+
width: width,
|
|
1467
|
+
height: height,
|
|
1468
|
+
missingProps: missing,
|
|
1469
|
+
backgroundColor: bgColorFromTheme
|
|
1470
|
+
});
|
|
1471
|
+
} // events
|
|
1472
|
+
|
|
1473
|
+
|
|
1284
1474
|
var eventCallbackProps = {};
|
|
1475
|
+
|
|
1285
1476
|
if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
|
|
1286
1477
|
var supportedEvents = vizConfig.events;
|
|
1287
1478
|
Object.keys(supportedEvents).forEach(function (eventName) {
|
|
1288
1479
|
var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
|
|
1289
|
-
eventCallbackProps[eventCallbackPropName] = null;
|
|
1290
|
-
// todo: refactor single value and single value icon to send payload from viz
|
|
1480
|
+
eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
|
|
1291
1481
|
// then remove these lines
|
|
1482
|
+
|
|
1292
1483
|
var payloadKeys = supportedEvents[eventName].payloadKeys;
|
|
1293
1484
|
var payload = {};
|
|
1485
|
+
|
|
1294
1486
|
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
1295
1487
|
payloadKeys.forEach(function (p) {
|
|
1296
1488
|
payload[p] = evaluatedOptionsToUse[p];
|
|
1297
1489
|
});
|
|
1298
1490
|
}
|
|
1491
|
+
|
|
1299
1492
|
eventCallbackProps[eventCallbackPropName] = function (ev) {
|
|
1300
1493
|
if (ev && ev.payload) {
|
|
1301
1494
|
payload = ev.payload;
|
|
1302
1495
|
}
|
|
1496
|
+
|
|
1303
1497
|
return onEventTrigger({
|
|
1304
1498
|
originalEvent: ev,
|
|
1305
1499
|
payload: payload,
|
|
@@ -1307,8 +1501,9 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1307
1501
|
});
|
|
1308
1502
|
};
|
|
1309
1503
|
});
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1504
|
+
} // compute pure viz props which are not from options
|
|
1505
|
+
|
|
1506
|
+
|
|
1312
1507
|
var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
1313
1508
|
themeFunc: themeFunc
|
|
1314
1509
|
}));
|
|
@@ -1326,15 +1521,19 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1326
1521
|
* In future, we could automatically detect which all datasources are being used
|
|
1327
1522
|
* and bind those magically to pagination/sorting behavior.
|
|
1328
1523
|
*/
|
|
1524
|
+
|
|
1329
1525
|
var dataSourceMetadata = {};
|
|
1330
1526
|
var OptionKey = 'paginateDataSourceKey';
|
|
1331
1527
|
var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1528
|
+
|
|
1332
1529
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
|
|
1333
1530
|
var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
1334
1531
|
var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
1532
|
+
|
|
1335
1533
|
var handleRequestParamsChange = function handleRequestParamsChange(payload) {
|
|
1336
1534
|
return onRequestParamsChange(paginateDataSourceKey, payload);
|
|
1337
1535
|
};
|
|
1536
|
+
|
|
1338
1537
|
var sortParams = (0, getSorting_1.getSortingParams)({
|
|
1339
1538
|
requestParams: requestParams,
|
|
1340
1539
|
meta: meta,
|
|
@@ -1349,115 +1548,132 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1349
1548
|
sortParams: sortParams,
|
|
1350
1549
|
paginatorParams: paginatorParams
|
|
1351
1550
|
};
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1551
|
+
} // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
|
|
1552
|
+
|
|
1553
|
+
|
|
1354
1554
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
1355
1555
|
return null;
|
|
1356
1556
|
}
|
|
1557
|
+
|
|
1357
1558
|
return React.createElement(SanitizedReactViz, Object.assign({
|
|
1358
1559
|
mode: mode,
|
|
1359
1560
|
width: width,
|
|
1360
1561
|
height: height
|
|
1361
1562
|
}, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
|
|
1362
1563
|
};
|
|
1564
|
+
|
|
1363
1565
|
DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
|
|
1364
1566
|
DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
|
|
1365
1567
|
// using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
|
|
1366
1568
|
theme: {}
|
|
1367
|
-
});
|
|
1368
|
-
|
|
1369
|
-
DashboardViz.config = vizConfig;
|
|
1370
|
-
|
|
1569
|
+
}); // attach viz config
|
|
1570
|
+
|
|
1571
|
+
DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
|
|
1572
|
+
|
|
1371
1573
|
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1372
1574
|
};
|
|
1575
|
+
|
|
1373
1576
|
exports.default = withDashboardViz;
|
|
1374
1577
|
|
|
1375
1578
|
/***/ }),
|
|
1376
1579
|
|
|
1377
|
-
/***/
|
|
1580
|
+
/***/ 38:
|
|
1378
1581
|
/***/ (function(module, exports) {
|
|
1379
1582
|
|
|
1380
1583
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
1381
1584
|
|
|
1382
1585
|
/***/ }),
|
|
1383
1586
|
|
|
1384
|
-
/***/
|
|
1587
|
+
/***/ 39:
|
|
1385
1588
|
/***/ (function(module, exports) {
|
|
1386
1589
|
|
|
1387
1590
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1388
1591
|
|
|
1389
1592
|
/***/ }),
|
|
1390
1593
|
|
|
1391
|
-
/***/
|
|
1594
|
+
/***/ 4:
|
|
1392
1595
|
/***/ (function(module, exports) {
|
|
1393
1596
|
|
|
1394
|
-
module.exports = require("
|
|
1597
|
+
module.exports = require("styled-components");
|
|
1395
1598
|
|
|
1396
1599
|
/***/ }),
|
|
1397
1600
|
|
|
1398
|
-
/***/
|
|
1601
|
+
/***/ 40:
|
|
1399
1602
|
/***/ (function(module, exports) {
|
|
1400
1603
|
|
|
1401
|
-
module.exports = require("
|
|
1604
|
+
module.exports = require("@splunk/moment");
|
|
1402
1605
|
|
|
1403
1606
|
/***/ }),
|
|
1404
1607
|
|
|
1405
|
-
/***/
|
|
1608
|
+
/***/ 41:
|
|
1406
1609
|
/***/ (function(module, exports) {
|
|
1407
1610
|
|
|
1408
1611
|
module.exports = require("@splunk/async-dynamic-options-evaluator");
|
|
1409
1612
|
|
|
1410
1613
|
/***/ }),
|
|
1411
1614
|
|
|
1412
|
-
/***/
|
|
1615
|
+
/***/ 42:
|
|
1413
1616
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1414
1617
|
|
|
1415
1618
|
"use strict";
|
|
1416
1619
|
|
|
1417
1620
|
|
|
1418
1621
|
var _classCallCheck = __webpack_require__(9);
|
|
1622
|
+
|
|
1419
1623
|
Object.defineProperty(exports, "__esModule", {
|
|
1420
1624
|
value: true
|
|
1421
1625
|
});
|
|
1422
1626
|
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
1423
1627
|
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
1628
|
+
|
|
1424
1629
|
var T = __webpack_require__(0);
|
|
1630
|
+
|
|
1425
1631
|
var lodash_1 = __webpack_require__(3);
|
|
1426
|
-
|
|
1427
|
-
// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1632
|
+
|
|
1633
|
+
var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1634
|
+
|
|
1635
|
+
|
|
1428
1636
|
exports.INITIAL_WIDTH = 250;
|
|
1429
1637
|
exports.INITIAL_HEIGHT = 250;
|
|
1430
1638
|
/**
|
|
1431
1639
|
* A Splunk visualization
|
|
1432
1640
|
*/
|
|
1641
|
+
|
|
1433
1642
|
var SplunkVisualization = function SplunkVisualization() {
|
|
1434
1643
|
_classCallCheck(this, SplunkVisualization);
|
|
1435
1644
|
};
|
|
1645
|
+
|
|
1436
1646
|
SplunkVisualization.propTypes = {
|
|
1437
1647
|
/**
|
|
1438
1648
|
* display mode
|
|
1439
1649
|
*/
|
|
1440
1650
|
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
1651
|
+
|
|
1441
1652
|
/**
|
|
1442
1653
|
* width in pixel or string, defaults to 100%
|
|
1443
1654
|
*/
|
|
1444
1655
|
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
1656
|
+
|
|
1445
1657
|
/**
|
|
1446
1658
|
* height in pixel or string
|
|
1447
1659
|
*/
|
|
1448
1660
|
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
1661
|
+
|
|
1449
1662
|
/**
|
|
1450
1663
|
* visualization context used for dynamic option evaluation
|
|
1451
1664
|
*/
|
|
1452
1665
|
context: T.object,
|
|
1666
|
+
|
|
1453
1667
|
/**
|
|
1454
1668
|
* visualization formatting options
|
|
1455
1669
|
*/
|
|
1456
1670
|
options: T.object,
|
|
1671
|
+
|
|
1457
1672
|
/**
|
|
1458
1673
|
* A callback to update formatting options
|
|
1459
1674
|
*/
|
|
1460
1675
|
onOptionsChange: T.func,
|
|
1676
|
+
|
|
1461
1677
|
/**
|
|
1462
1678
|
* datasource state which include data and request params, object key indicate the datasource type.
|
|
1463
1679
|
*/
|
|
@@ -1466,6 +1682,7 @@ SplunkVisualization.propTypes = {
|
|
|
1466
1682
|
* current request params
|
|
1467
1683
|
*/
|
|
1468
1684
|
requestParams: T.object,
|
|
1685
|
+
|
|
1469
1686
|
/**
|
|
1470
1687
|
* current dataset
|
|
1471
1688
|
*/
|
|
@@ -1473,6 +1690,7 @@ SplunkVisualization.propTypes = {
|
|
|
1473
1690
|
fields: T.array,
|
|
1474
1691
|
columns: T.array
|
|
1475
1692
|
}),
|
|
1693
|
+
|
|
1476
1694
|
/**
|
|
1477
1695
|
* error
|
|
1478
1696
|
*/
|
|
@@ -1480,29 +1698,35 @@ SplunkVisualization.propTypes = {
|
|
|
1480
1698
|
level: T.string,
|
|
1481
1699
|
message: T.string
|
|
1482
1700
|
}),
|
|
1701
|
+
|
|
1483
1702
|
/**
|
|
1484
1703
|
* meta data that came with the dataset
|
|
1485
1704
|
*/
|
|
1486
1705
|
meta: T.object
|
|
1487
1706
|
})),
|
|
1707
|
+
|
|
1488
1708
|
/**
|
|
1489
1709
|
* A callback to trigger event
|
|
1490
1710
|
*/
|
|
1491
1711
|
onEventTrigger: T.func,
|
|
1712
|
+
|
|
1492
1713
|
/**
|
|
1493
1714
|
* Inform viz if there are handlers listening to events
|
|
1494
1715
|
*/
|
|
1495
1716
|
hasEventHandlers: T.bool,
|
|
1717
|
+
|
|
1496
1718
|
/**
|
|
1497
1719
|
* A callback to communicate computed props to a consumer
|
|
1498
1720
|
*/
|
|
1499
1721
|
onComputedProps: T.func,
|
|
1722
|
+
|
|
1500
1723
|
/**
|
|
1501
1724
|
* A callback to obtain visualization api
|
|
1502
1725
|
*/
|
|
1503
1726
|
vizActionHandlerRef: T.func,
|
|
1504
1727
|
loading: T.bool,
|
|
1505
1728
|
theme: T.object,
|
|
1729
|
+
|
|
1506
1730
|
/**
|
|
1507
1731
|
* A callback to request new data with updated request params
|
|
1508
1732
|
*/
|
|
@@ -1511,6 +1735,7 @@ SplunkVisualization.propTypes = {
|
|
|
1511
1735
|
/**
|
|
1512
1736
|
*
|
|
1513
1737
|
*/
|
|
1738
|
+
|
|
1514
1739
|
SplunkVisualization.defaultProps = {
|
|
1515
1740
|
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
1516
1741
|
width: '100%',
|
|
@@ -1539,26 +1764,29 @@ exports.default = SplunkVisualization;
|
|
|
1539
1764
|
|
|
1540
1765
|
/***/ }),
|
|
1541
1766
|
|
|
1542
|
-
/***/
|
|
1767
|
+
/***/ 43:
|
|
1543
1768
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1544
1769
|
|
|
1545
1770
|
"use strict";
|
|
1546
1771
|
|
|
1547
1772
|
|
|
1548
1773
|
var _classCallCheck = __webpack_require__(9);
|
|
1774
|
+
|
|
1549
1775
|
var _createClass = __webpack_require__(18);
|
|
1776
|
+
|
|
1550
1777
|
Object.defineProperty(exports, "__esModule", {
|
|
1551
1778
|
value: true
|
|
1552
1779
|
});
|
|
1553
1780
|
exports.DefaultVizActionHandler = void 0;
|
|
1781
|
+
|
|
1554
1782
|
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
1555
1783
|
function DefaultVizActionHandler() {
|
|
1556
1784
|
_classCallCheck(this, DefaultVizActionHandler);
|
|
1557
1785
|
}
|
|
1786
|
+
|
|
1558
1787
|
_createClass(DefaultVizActionHandler, [{
|
|
1559
1788
|
key: "focus",
|
|
1560
|
-
value: function focus() {
|
|
1561
|
-
// noop
|
|
1789
|
+
value: function focus() {// noop
|
|
1562
1790
|
}
|
|
1563
1791
|
}, {
|
|
1564
1792
|
key: "snapshot",
|
|
@@ -1566,23 +1794,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
|
1566
1794
|
return null; // noop
|
|
1567
1795
|
}
|
|
1568
1796
|
}]);
|
|
1797
|
+
|
|
1569
1798
|
return DefaultVizActionHandler;
|
|
1570
1799
|
}();
|
|
1571
|
-
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1572
1800
|
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
/***/ 43:
|
|
1576
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1577
|
-
|
|
1578
|
-
"use strict";
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1582
|
-
value: true
|
|
1583
|
-
});
|
|
1584
|
-
exports.validSortDirs = void 0;
|
|
1585
|
-
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1801
|
+
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1586
1802
|
|
|
1587
1803
|
/***/ }),
|
|
1588
1804
|
|
|
@@ -1596,7 +1812,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1596
1812
|
value: true
|
|
1597
1813
|
});
|
|
1598
1814
|
exports.useDeepMemo = void 0;
|
|
1815
|
+
|
|
1599
1816
|
var react_1 = __webpack_require__(1);
|
|
1817
|
+
|
|
1600
1818
|
var lodash_1 = __webpack_require__(3);
|
|
1601
1819
|
/**
|
|
1602
1820
|
* This hook evaluates and stores the result of a passed function and only
|
|
@@ -1611,16 +1829,21 @@ var lodash_1 = __webpack_require__(3);
|
|
|
1611
1829
|
* @param fn the function to be executed and
|
|
1612
1830
|
* @param dependencies an array of dependencies
|
|
1613
1831
|
*/
|
|
1832
|
+
|
|
1833
|
+
|
|
1614
1834
|
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
1615
1835
|
var ref = (0, react_1.useRef)();
|
|
1836
|
+
|
|
1616
1837
|
if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
|
|
1617
1838
|
ref.current = {
|
|
1618
1839
|
dependencies: dependencies,
|
|
1619
1840
|
value: fn()
|
|
1620
1841
|
};
|
|
1621
1842
|
}
|
|
1843
|
+
|
|
1622
1844
|
return ref.current.value;
|
|
1623
1845
|
};
|
|
1846
|
+
|
|
1624
1847
|
exports.useDeepMemo = useDeepMemo;
|
|
1625
1848
|
|
|
1626
1849
|
/***/ }),
|
|
@@ -1635,19 +1858,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1635
1858
|
value: true
|
|
1636
1859
|
});
|
|
1637
1860
|
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
1861
|
+
|
|
1638
1862
|
var React = __webpack_require__(1);
|
|
1863
|
+
|
|
1639
1864
|
var T = __webpack_require__(0);
|
|
1865
|
+
|
|
1640
1866
|
var i18n_1 = __webpack_require__(2);
|
|
1867
|
+
|
|
1641
1868
|
var Message_1 = __webpack_require__(10);
|
|
1869
|
+
|
|
1642
1870
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
1643
1871
|
/**
|
|
1644
1872
|
* @method isMissing
|
|
1645
1873
|
* @param {any} v
|
|
1646
1874
|
* @returns {boolean} true if the input value === null or undefined
|
|
1647
1875
|
*/
|
|
1876
|
+
|
|
1877
|
+
|
|
1648
1878
|
var isMissing = function isMissing(v) {
|
|
1649
1879
|
return v === null || v === undefined;
|
|
1650
1880
|
};
|
|
1881
|
+
|
|
1651
1882
|
exports.isMissing = isMissing;
|
|
1652
1883
|
/**
|
|
1653
1884
|
* @method misskingKeys
|
|
@@ -1655,11 +1886,13 @@ exports.isMissing = isMissing;
|
|
|
1655
1886
|
* @param {object} target
|
|
1656
1887
|
* @returns {string[]} the keys of missing required props
|
|
1657
1888
|
*/
|
|
1889
|
+
|
|
1658
1890
|
var missingKeys = function missingKeys(keys, target) {
|
|
1659
1891
|
return keys.filter(function (k) {
|
|
1660
1892
|
return (0, exports.isMissing)(target[k]);
|
|
1661
1893
|
});
|
|
1662
1894
|
};
|
|
1895
|
+
|
|
1663
1896
|
exports.missingKeys = missingKeys;
|
|
1664
1897
|
var propTypes = {
|
|
1665
1898
|
width: T.oneOfType([T.string, T.number]),
|
|
@@ -1673,10 +1906,11 @@ var propTypes = {
|
|
|
1673
1906
|
* @param {MissingPropsProps} props
|
|
1674
1907
|
* @returns {React.ReactElement}
|
|
1675
1908
|
*/
|
|
1909
|
+
|
|
1676
1910
|
var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
1677
1911
|
var width = props.width,
|
|
1678
|
-
|
|
1679
|
-
|
|
1912
|
+
height = props.height,
|
|
1913
|
+
missingProps = props.missingProps;
|
|
1680
1914
|
return React.createElement(Message_1.default, {
|
|
1681
1915
|
"data-test": "message",
|
|
1682
1916
|
width: width,
|
|
@@ -1684,6 +1918,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
|
1684
1918
|
message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
|
|
1685
1919
|
});
|
|
1686
1920
|
};
|
|
1921
|
+
|
|
1687
1922
|
exports.MissingPropsMessage = MissingPropsMessage;
|
|
1688
1923
|
exports.MissingPropsMessage.propTypes = propTypes;
|
|
1689
1924
|
exports.MissingPropsMessage.defaultProps = {
|
|
@@ -1703,6 +1938,7 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage)
|
|
|
1703
1938
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1704
1939
|
if (k2 === undefined) k2 = k;
|
|
1705
1940
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1941
|
+
|
|
1706
1942
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1707
1943
|
desc = {
|
|
1708
1944
|
enumerable: true,
|
|
@@ -1711,22 +1947,28 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
|
|
|
1711
1947
|
}
|
|
1712
1948
|
};
|
|
1713
1949
|
}
|
|
1950
|
+
|
|
1714
1951
|
Object.defineProperty(o, k2, desc);
|
|
1715
1952
|
} : function (o, m, k, k2) {
|
|
1716
1953
|
if (k2 === undefined) k2 = k;
|
|
1717
1954
|
o[k2] = m[k];
|
|
1718
1955
|
});
|
|
1956
|
+
|
|
1719
1957
|
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
1720
1958
|
for (var p in m) {
|
|
1721
1959
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1722
1960
|
}
|
|
1723
1961
|
};
|
|
1962
|
+
|
|
1724
1963
|
Object.defineProperty(exports, "__esModule", {
|
|
1725
1964
|
value: true
|
|
1726
1965
|
});
|
|
1727
1966
|
exports.default = void 0;
|
|
1967
|
+
|
|
1728
1968
|
__exportStar(__webpack_require__(165), exports);
|
|
1969
|
+
|
|
1729
1970
|
var Rectangle_1 = __webpack_require__(165);
|
|
1971
|
+
|
|
1730
1972
|
Object.defineProperty(exports, "default", {
|
|
1731
1973
|
enumerable: true,
|
|
1732
1974
|
get: function get() {
|
|
@@ -1746,18 +1988,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1746
1988
|
value: true
|
|
1747
1989
|
});
|
|
1748
1990
|
exports.optionsSchema = void 0;
|
|
1991
|
+
|
|
1749
1992
|
var visualization_icons_1 = __webpack_require__(52);
|
|
1993
|
+
|
|
1750
1994
|
var schemaUtils_1 = __webpack_require__(16);
|
|
1995
|
+
|
|
1751
1996
|
var i18n_1 = __webpack_require__(2);
|
|
1997
|
+
|
|
1752
1998
|
var PresetPalettes_1 = __webpack_require__(61);
|
|
1999
|
+
|
|
1753
2000
|
var themes_1 = __webpack_require__(60);
|
|
2001
|
+
|
|
1754
2002
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1755
|
-
|
|
2003
|
+
|
|
2004
|
+
var VizCategory_1 = __webpack_require__(36);
|
|
2005
|
+
|
|
1756
2006
|
var configUtils_1 = __webpack_require__(20);
|
|
2007
|
+
|
|
1757
2008
|
var DynamicFillColorEditor_1 = __webpack_require__(114);
|
|
2009
|
+
|
|
1758
2010
|
var DynamicStrokeColorEditor_1 = __webpack_require__(115);
|
|
2011
|
+
|
|
1759
2012
|
var StaticFillColorEditor_1 = __webpack_require__(116);
|
|
2013
|
+
|
|
1760
2014
|
var StaticStrokeColorEditor_1 = __webpack_require__(117);
|
|
2015
|
+
|
|
1761
2016
|
var dataContract = {
|
|
1762
2017
|
requiredDataSources: [],
|
|
1763
2018
|
optionalDataSources: [{
|
|
@@ -1973,7 +2228,7 @@ var editorConfig = [{
|
|
|
1973
2228
|
presets: presets,
|
|
1974
2229
|
value: function value(_ref) {
|
|
1975
2230
|
var context = _ref.context,
|
|
1976
|
-
|
|
2231
|
+
options = _ref.options;
|
|
1977
2232
|
var initialPreset = (0, configUtils_1.getInitialPreset)(context, options, presets);
|
|
1978
2233
|
return initialPreset && initialPreset.label || null;
|
|
1979
2234
|
}
|
|
@@ -2032,16 +2287,19 @@ var editorConfig = [{
|
|
|
2032
2287
|
/**
|
|
2033
2288
|
* visualization configuration
|
|
2034
2289
|
*/
|
|
2290
|
+
|
|
2035
2291
|
var config = {
|
|
2036
2292
|
/**
|
|
2037
2293
|
* unique viz key
|
|
2038
2294
|
*/
|
|
2039
2295
|
key: 'splunk.rectangle',
|
|
2296
|
+
|
|
2040
2297
|
/**
|
|
2041
2298
|
* viz name
|
|
2042
2299
|
*/
|
|
2043
2300
|
name: (0, i18n_1._)('Rectangle'),
|
|
2044
2301
|
category: VizCategory_1.VizCategory.SHAPES,
|
|
2302
|
+
|
|
2045
2303
|
/**
|
|
2046
2304
|
* viz icon
|
|
2047
2305
|
*/
|
|
@@ -2073,15 +2331,19 @@ exports.default = (0, configUtils_1.enhanceConfig)(config);
|
|
|
2073
2331
|
Object.defineProperty(exports, "__esModule", {
|
|
2074
2332
|
value: true
|
|
2075
2333
|
});
|
|
2334
|
+
|
|
2076
2335
|
var React = __webpack_require__(1);
|
|
2336
|
+
|
|
2077
2337
|
var styled_components_1 = __webpack_require__(4);
|
|
2338
|
+
|
|
2078
2339
|
var hocUtils_1 = __webpack_require__(15);
|
|
2340
|
+
|
|
2079
2341
|
var Cover = styled_components_1.default.div.withConfig({
|
|
2080
2342
|
displayName: "withEditModeCover__Cover",
|
|
2081
2343
|
componentId: "sc-1gsbnxb-0"
|
|
2082
2344
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
2083
2345
|
var Blocker = styled_components_1.default.div.attrs({
|
|
2084
|
-
'data-splunk-visualization-version': "26.
|
|
2346
|
+
'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
|
|
2085
2347
|
}).withConfig({
|
|
2086
2348
|
displayName: "withEditModeCover__Blocker",
|
|
2087
2349
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -2092,6 +2354,7 @@ var Blocker = styled_components_1.default.div.attrs({
|
|
|
2092
2354
|
* @param {ExtendedDashViz} Visualization
|
|
2093
2355
|
* @returns {ExtendedDashViz} Wrapper
|
|
2094
2356
|
*/
|
|
2357
|
+
|
|
2095
2358
|
var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
|
|
2096
2359
|
var Wrapper = function Wrapper(props) {
|
|
2097
2360
|
var mode = props.mode;
|
|
@@ -2100,12 +2363,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
|
|
|
2100
2363
|
"data-test": "edit-mode-cover"
|
|
2101
2364
|
}));
|
|
2102
2365
|
};
|
|
2366
|
+
|
|
2103
2367
|
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
2104
2368
|
Wrapper: Wrapper,
|
|
2105
2369
|
Visualization: Visualization
|
|
2106
2370
|
});
|
|
2107
2371
|
return Wrapper;
|
|
2108
2372
|
};
|
|
2373
|
+
|
|
2109
2374
|
exports.default = withEditModeCover;
|
|
2110
2375
|
|
|
2111
2376
|
/***/ }),
|
|
@@ -2119,27 +2384,37 @@ exports.default = withEditModeCover;
|
|
|
2119
2384
|
Object.defineProperty(exports, "__esModule", {
|
|
2120
2385
|
value: true
|
|
2121
2386
|
});
|
|
2387
|
+
|
|
2122
2388
|
var React = __webpack_require__(1);
|
|
2389
|
+
|
|
2123
2390
|
var colorUtils_1 = __webpack_require__(12);
|
|
2391
|
+
|
|
2124
2392
|
var variables_1 = __webpack_require__(11);
|
|
2393
|
+
|
|
2125
2394
|
var IconPlaceholder_1 = __webpack_require__(32);
|
|
2395
|
+
|
|
2126
2396
|
var VizBehavior_1 = __webpack_require__(6);
|
|
2397
|
+
|
|
2127
2398
|
var hocUtils_1 = __webpack_require__(15);
|
|
2399
|
+
|
|
2128
2400
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
2129
2401
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
2130
2402
|
var config = Visualization.config;
|
|
2131
2403
|
var themes = config.themes;
|
|
2404
|
+
|
|
2132
2405
|
var Wrapper = function Wrapper(props) {
|
|
2133
2406
|
var _a, _b;
|
|
2407
|
+
|
|
2134
2408
|
var dataSources = props.dataSources,
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2409
|
+
loading = props.loading,
|
|
2410
|
+
options = props.options,
|
|
2411
|
+
height = props.height,
|
|
2412
|
+
width = props.width;
|
|
2139
2413
|
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
2140
2414
|
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);
|
|
2141
2415
|
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
2142
2416
|
var iconColor = variables_1.default.contentColorActive(props);
|
|
2417
|
+
|
|
2143
2418
|
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
2144
2419
|
return React.createElement(IconPlaceholder_1.default, {
|
|
2145
2420
|
"data-test": "icon-placeholder",
|
|
@@ -2150,14 +2425,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
2150
2425
|
iconColor: iconColor
|
|
2151
2426
|
});
|
|
2152
2427
|
}
|
|
2428
|
+
|
|
2153
2429
|
return React.createElement(Visualization, Object.assign({}, props));
|
|
2154
2430
|
};
|
|
2431
|
+
|
|
2155
2432
|
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
2156
2433
|
Wrapper: Wrapper,
|
|
2157
2434
|
Visualization: Visualization
|
|
2158
2435
|
});
|
|
2159
2436
|
return Wrapper;
|
|
2160
2437
|
};
|
|
2438
|
+
|
|
2161
2439
|
exports.default = withPlaceholder;
|
|
2162
2440
|
|
|
2163
2441
|
/***/ }),
|
|
@@ -2187,6 +2465,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2187
2465
|
});
|
|
2188
2466
|
exports.VizBehavior = void 0;
|
|
2189
2467
|
var VizBehavior;
|
|
2468
|
+
|
|
2190
2469
|
(function (VizBehavior) {
|
|
2191
2470
|
/**
|
|
2192
2471
|
* Dynamic Options Behavior.
|
|
@@ -2206,6 +2485,7 @@ var VizBehavior;
|
|
|
2206
2485
|
* missing.
|
|
2207
2486
|
* @type {string}
|
|
2208
2487
|
*/
|
|
2488
|
+
|
|
2209
2489
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
2210
2490
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
2211
2491
|
VizBehavior["TRELLIS"] = "trellis";
|