@splunk/visualizations 25.13.1 → 26.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +318 -234
- package/Area.config.js.map +1 -1
- package/Area.js +1131 -766
- package/Area.js.map +1 -1
- package/Bar.config.js +317 -233
- package/Bar.config.js.map +1 -1
- package/Bar.js +1007 -594
- package/Bar.js.map +1 -1
- package/Bubble.config.js +234 -160
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +912 -509
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +80 -29
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +691 -319
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +308 -223
- package/Column.config.js.map +1 -1
- package/Column.js +1011 -587
- package/Column.js.map +1 -1
- package/Ellipse.config.js +127 -62
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +576 -286
- package/Ellipse.js.map +1 -1
- package/Events.config.js +111 -29
- package/Events.config.js.map +1 -1
- package/Events.js +998 -527
- package/Events.js.map +1 -1
- package/FillerGauge.config.js +142 -73
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +962 -572
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +70 -26
- package/Image.config.js.map +1 -1
- package/Image.js +524 -253
- package/Image.js.map +1 -1
- package/Line.config.js +326 -242
- package/Line.config.js.map +1 -1
- package/Line.js +1022 -606
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +99 -49
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +1184 -762
- package/LinkGraph.js.map +1 -1
- package/MIGRATION.md +1082 -0
- package/Map.config.js +311 -167
- package/Map.config.js.map +1 -1
- package/Map.js +1479 -873
- package/Map.js.map +1 -1
- package/Markdown.config.js +93 -43
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +603 -332
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +163 -105
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +1025 -628
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +95 -41
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +993 -622
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +99 -46
- package/Pie.config.js.map +1 -1
- package/Pie.js +847 -442
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +114 -62
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +1097 -633
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +131 -65
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +580 -288
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +103 -41
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +1128 -586
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +231 -157
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +904 -504
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +212 -142
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +1506 -956
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +294 -233
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +208 -138
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +1375 -914
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +252 -137
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +2194 -1069
- package/SingleValueRadial.js.map +1 -1
- package/SparkLine.js +172 -83
- package/SparkLine.js.map +1 -1
- package/Table.config.js +123 -70
- package/Table.config.js.map +1 -1
- package/Table.js +1094 -590
- package/Table.js.map +1 -1
- package/common/Charting.js +147 -75
- package/common/Charting.js.map +1 -1
- package/common/ChartingApi.js +18 -7
- package/common/ChartingApi.js.map +1 -1
- package/common/EventsDoc.js +91 -36
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +70 -60
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +45 -36
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +177 -86
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js +65 -32
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.js +34 -7
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +10 -4
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemesDoc.js +41 -28
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +56 -24
- package/common/chartingUtils.js.map +1 -1
- package/common/docUtils.js +15 -5
- package/common/docUtils.js.map +1 -1
- package/common/gaugeUtils.js +238 -155
- package/common/gaugeUtils.js.map +1 -1
- package/common/shapeUtils.js +34 -16
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/configUtils.js +59 -23
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/dataUtils.js +9 -4
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/hocUtils.js +5 -3
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/layoutUtils.js +3 -2
- package/common/utils/layoutUtils.js.map +1 -1
- package/common/utils/mapUtils.js +370 -206
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +243 -198
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +36 -9
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +87 -26
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +4 -2
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +375 -193
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +25 -27
package/Ellipse.js
CHANGED
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 200);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ([
|
|
@@ -133,6 +133,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
133
133
|
});
|
|
134
134
|
exports.VizBehavior = void 0;
|
|
135
135
|
var VizBehavior;
|
|
136
|
+
|
|
136
137
|
(function (VizBehavior) {
|
|
137
138
|
/**
|
|
138
139
|
* Dynamic Options Behavior.
|
|
@@ -152,6 +153,7 @@ var VizBehavior;
|
|
|
152
153
|
* missing.
|
|
153
154
|
* @type {string}
|
|
154
155
|
*/
|
|
156
|
+
|
|
155
157
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
156
158
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
157
159
|
VizBehavior["TRELLIS"] = "trellis";
|
|
@@ -203,40 +205,46 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
|
203
205
|
Object.defineProperty(exports, "__esModule", {
|
|
204
206
|
value: true
|
|
205
207
|
});
|
|
208
|
+
|
|
206
209
|
var React = __webpack_require__(1);
|
|
210
|
+
|
|
207
211
|
var styled_components_1 = __webpack_require__(4);
|
|
212
|
+
|
|
208
213
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
214
|
+
|
|
209
215
|
var style_1 = __webpack_require__(14);
|
|
216
|
+
|
|
210
217
|
var colorUtils_1 = __webpack_require__(12);
|
|
218
|
+
|
|
211
219
|
var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
212
220
|
var width = _ref.width;
|
|
213
221
|
return {
|
|
214
222
|
style: {
|
|
215
|
-
width: style_1.toPx(width)
|
|
223
|
+
width: (0, style_1.toPx)(width)
|
|
216
224
|
}
|
|
217
225
|
};
|
|
218
226
|
}).withConfig({
|
|
219
227
|
displayName: "FixedSizeContainer__Item",
|
|
220
228
|
componentId: "sc-1yhgpod-0"
|
|
221
229
|
})(["position:relative;background-color:", "};"], function (props) {
|
|
222
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
223
|
-
});
|
|
224
|
-
|
|
230
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
231
|
+
}); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
|
|
232
|
+
|
|
225
233
|
var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
|
|
226
234
|
var width = _ref2.width,
|
|
227
|
-
|
|
235
|
+
height = _ref2.height;
|
|
228
236
|
return {
|
|
229
237
|
style: Object.assign(Object.assign({}, width && {
|
|
230
|
-
width: style_1.toPx(width)
|
|
238
|
+
width: (0, style_1.toPx)(width)
|
|
231
239
|
}), height && {
|
|
232
|
-
height: style_1.toPx(height)
|
|
240
|
+
height: (0, style_1.toPx)(height)
|
|
233
241
|
})
|
|
234
242
|
};
|
|
235
243
|
}).withConfig({
|
|
236
244
|
displayName: "FixedSizeContainer__FixSizeItem",
|
|
237
245
|
componentId: "sc-1yhgpod-1"
|
|
238
246
|
})(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
|
|
239
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
247
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
240
248
|
});
|
|
241
249
|
var ItemContent = styled_components_1.default.div.withConfig({
|
|
242
250
|
displayName: "FixedSizeContainer__ItemContent",
|
|
@@ -246,11 +254,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
|
|
|
246
254
|
displayName: "FixedSizeContainer__FixSizeItemContent",
|
|
247
255
|
componentId: "sc-1yhgpod-3"
|
|
248
256
|
})(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
|
|
257
|
+
|
|
249
258
|
var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
250
259
|
var FixedSizeContainer = function FixedSizeContainer(props) {
|
|
251
260
|
var width = props.width,
|
|
252
|
-
|
|
253
|
-
|
|
261
|
+
height = props.height,
|
|
262
|
+
backgroundColor = props.backgroundColor;
|
|
263
|
+
|
|
254
264
|
if (!height) {
|
|
255
265
|
return React.createElement(Item, {
|
|
256
266
|
"data-test": "item",
|
|
@@ -258,24 +268,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
258
268
|
backgroundColor: backgroundColor
|
|
259
269
|
}, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
|
|
260
270
|
}
|
|
271
|
+
|
|
261
272
|
return React.createElement(FixSizeItem, {
|
|
262
273
|
"data-test": "fix-size-item",
|
|
263
|
-
"data-splunk-visualization-version": "
|
|
274
|
+
"data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
|
|
264
275
|
width: width,
|
|
265
276
|
height: height,
|
|
266
277
|
backgroundColor: backgroundColor
|
|
267
278
|
}, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
|
|
268
279
|
var newWidth = _ref3.width,
|
|
269
|
-
|
|
280
|
+
newHeight = _ref3.height;
|
|
270
281
|
return React.createElement(Viz, Object.assign({}, props, {
|
|
271
282
|
width: newWidth,
|
|
272
283
|
height: newHeight
|
|
273
284
|
}));
|
|
274
285
|
})));
|
|
275
286
|
};
|
|
287
|
+
|
|
276
288
|
FixedSizeContainer.displayName = 'withFixedSizeContainer';
|
|
277
289
|
return FixedSizeContainer;
|
|
278
290
|
};
|
|
291
|
+
|
|
279
292
|
exports.default = withFixedSizeContainer;
|
|
280
293
|
|
|
281
294
|
/***/ }),
|
|
@@ -301,9 +314,10 @@ exports.extendStaticWrapperProps = void 0;
|
|
|
301
314
|
* @param {DashboardVizType} props.Wrapper
|
|
302
315
|
* @param {DashboardVizType} props.Visualization
|
|
303
316
|
*/
|
|
317
|
+
|
|
304
318
|
var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
305
319
|
var Wrapper = _ref.Wrapper,
|
|
306
|
-
|
|
320
|
+
Visualization = _ref.Visualization;
|
|
307
321
|
var extendProperties = ['propTypes', 'defaultProps', 'config'];
|
|
308
322
|
extendProperties.forEach(function (prop) {
|
|
309
323
|
if (Visualization[prop]) {
|
|
@@ -312,6 +326,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
312
326
|
}
|
|
313
327
|
});
|
|
314
328
|
};
|
|
329
|
+
|
|
315
330
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
316
331
|
|
|
317
332
|
/***/ }),
|
|
@@ -346,24 +361,33 @@ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
|
|
|
346
361
|
|
|
347
362
|
|
|
348
363
|
var _toConsumableArray = __webpack_require__(8);
|
|
364
|
+
|
|
349
365
|
var _defineProperty = __webpack_require__(7);
|
|
366
|
+
|
|
350
367
|
var __rest = this && this.__rest || function (s, e) {
|
|
351
368
|
var t = {};
|
|
369
|
+
|
|
352
370
|
for (var p in s) {
|
|
353
371
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
354
372
|
}
|
|
373
|
+
|
|
355
374
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
356
375
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
357
376
|
}
|
|
358
377
|
return t;
|
|
359
378
|
};
|
|
379
|
+
|
|
360
380
|
Object.defineProperty(exports, "__esModule", {
|
|
361
381
|
value: true
|
|
362
382
|
});
|
|
363
383
|
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
384
|
+
|
|
364
385
|
var lodash_1 = __webpack_require__(3);
|
|
386
|
+
|
|
365
387
|
var schemaUtils_1 = __webpack_require__(16);
|
|
388
|
+
|
|
366
389
|
var VizBehavior_1 = __webpack_require__(6);
|
|
390
|
+
|
|
367
391
|
var dynamicOptionsDSLType = {
|
|
368
392
|
type: 'string',
|
|
369
393
|
pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
|
|
@@ -373,20 +397,22 @@ var dynamicOptionsDSLType = {
|
|
|
373
397
|
* @param optionsSchema a visualization's options schema
|
|
374
398
|
* @returns an updated options schema that additionally allows strings starting with > for each option
|
|
375
399
|
*/
|
|
400
|
+
|
|
376
401
|
function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
377
402
|
var enhancedOptionsSchema = {};
|
|
378
403
|
Object.keys(optionsSchema).forEach(function (key) {
|
|
379
404
|
var _a = optionsSchema[key],
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
405
|
+
title = _a.title,
|
|
406
|
+
description = _a.description,
|
|
407
|
+
readOnly = _a.readOnly,
|
|
408
|
+
writeOnly = _a.writeOnly,
|
|
409
|
+
examples = _a.examples,
|
|
410
|
+
defaultValue = _a.default,
|
|
411
|
+
type = _a.type,
|
|
412
|
+
properties = _a.properties,
|
|
413
|
+
patternProperties = _a.patternProperties,
|
|
414
|
+
remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
|
|
415
|
+
|
|
390
416
|
var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
|
|
391
417
|
title: title
|
|
392
418
|
}), description !== undefined && {
|
|
@@ -400,12 +426,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
400
426
|
}), defaultValue !== undefined && {
|
|
401
427
|
default: defaultValue
|
|
402
428
|
});
|
|
429
|
+
|
|
403
430
|
if (type === 'object') {
|
|
404
431
|
enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
|
|
405
432
|
type: type
|
|
406
433
|
}), properties && {
|
|
407
434
|
properties: enhanceOptionsSchemaWithDynamicOptions(properties)
|
|
408
435
|
});
|
|
436
|
+
|
|
409
437
|
if (patternProperties) {
|
|
410
438
|
var enhancedPatternProperties = {};
|
|
411
439
|
Object.keys(patternProperties).forEach(function (opt) {
|
|
@@ -423,6 +451,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
423
451
|
});
|
|
424
452
|
return enhancedOptionsSchema;
|
|
425
453
|
}
|
|
454
|
+
|
|
426
455
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
427
456
|
/**
|
|
428
457
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
@@ -431,11 +460,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
|
|
|
431
460
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
432
461
|
* and containing `open: false` for all editor panels in editorConfig
|
|
433
462
|
*/
|
|
463
|
+
|
|
434
464
|
function enhanceConfig(vizConfig) {
|
|
435
465
|
var enhancedConfig = Object.assign({}, vizConfig);
|
|
466
|
+
|
|
436
467
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
|
|
437
468
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
438
469
|
}
|
|
470
|
+
|
|
439
471
|
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
440
472
|
return Object.assign(Object.assign({}, config), {
|
|
441
473
|
open: config.open || false
|
|
@@ -443,6 +475,7 @@ function enhanceConfig(vizConfig) {
|
|
|
443
475
|
});
|
|
444
476
|
return enhancedConfig;
|
|
445
477
|
}
|
|
478
|
+
|
|
446
479
|
exports.enhanceConfig = enhanceConfig;
|
|
447
480
|
/**
|
|
448
481
|
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
@@ -450,6 +483,7 @@ exports.enhanceConfig = enhanceConfig;
|
|
|
450
483
|
* @param vizConfig a Visualization Config
|
|
451
484
|
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
452
485
|
*/
|
|
486
|
+
|
|
453
487
|
function uncollapseEditorConfig(vizConfig) {
|
|
454
488
|
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
455
489
|
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
@@ -459,13 +493,16 @@ function uncollapseEditorConfig(vizConfig) {
|
|
|
459
493
|
});
|
|
460
494
|
return editorPanelUncollapsedConfig;
|
|
461
495
|
}
|
|
496
|
+
|
|
462
497
|
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
498
|
+
|
|
463
499
|
function isDynamicOption(option) {
|
|
464
500
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
465
501
|
}
|
|
466
|
-
|
|
467
|
-
// private helpers to improve readability of getInitialPreset
|
|
502
|
+
|
|
503
|
+
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
468
504
|
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
505
|
+
|
|
469
506
|
/**
|
|
470
507
|
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
471
508
|
* 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
|
|
@@ -474,6 +511,7 @@ exports.isDynamicOption = isDynamicOption;
|
|
|
474
511
|
*
|
|
475
512
|
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
476
513
|
*/
|
|
514
|
+
|
|
477
515
|
function hasCompatibleContexts(vizContext, presetContext) {
|
|
478
516
|
var presetContextKeys = Object.keys(presetContext);
|
|
479
517
|
return presetContextKeys.every(function (contextKey) {
|
|
@@ -483,6 +521,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
|
|
|
483
521
|
/**
|
|
484
522
|
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
485
523
|
*/
|
|
524
|
+
|
|
525
|
+
|
|
486
526
|
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
487
527
|
var presetOptionKeys = Object.keys(presetOptions);
|
|
488
528
|
return presetOptionKeys.every(function (optionKey) {
|
|
@@ -497,18 +537,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
|
497
537
|
* @param {Object} vizOptions - the current vizOptions definition
|
|
498
538
|
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
499
539
|
*/
|
|
540
|
+
|
|
541
|
+
|
|
500
542
|
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
501
543
|
return presets.find(function (preset) {
|
|
502
|
-
var presetContext = lodash_1.get(preset, ['value', 'context'], {});
|
|
503
|
-
var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
|
|
544
|
+
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
545
|
+
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
504
546
|
var presetContextKeys = Object.keys(presetContext);
|
|
505
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
506
|
-
// all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
547
|
+
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
507
548
|
// if not, then the preset is invalid in config.ts
|
|
549
|
+
|
|
508
550
|
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
509
551
|
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
510
552
|
});
|
|
511
553
|
}
|
|
554
|
+
|
|
512
555
|
exports.getInitialPreset = getInitialPreset;
|
|
513
556
|
/**
|
|
514
557
|
* generates number precision values for a Select editor
|
|
@@ -516,14 +559,16 @@ exports.getInitialPreset = getInitialPreset;
|
|
|
516
559
|
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
517
560
|
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
518
561
|
*/
|
|
562
|
+
|
|
519
563
|
function generatePrecisionValues(numPrecisionValues) {
|
|
520
|
-
return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
|
|
564
|
+
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
521
565
|
return {
|
|
522
566
|
label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
|
|
523
567
|
value: i
|
|
524
568
|
};
|
|
525
569
|
});
|
|
526
570
|
}
|
|
571
|
+
|
|
527
572
|
exports.generatePrecisionValues = generatePrecisionValues;
|
|
528
573
|
/**
|
|
529
574
|
* insert layout in layout array, return a new layout array instead of updating the original
|
|
@@ -533,12 +578,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
|
|
|
533
578
|
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
534
579
|
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
535
580
|
*/
|
|
581
|
+
|
|
536
582
|
var insertLayout = function insertLayout(layout, index) {
|
|
537
583
|
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
538
584
|
layoutItems[_key - 2] = arguments[_key];
|
|
539
585
|
}
|
|
586
|
+
|
|
540
587
|
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
541
588
|
};
|
|
589
|
+
|
|
542
590
|
exports.insertLayout = insertLayout;
|
|
543
591
|
|
|
544
592
|
/***/ }),
|
|
@@ -564,35 +612,41 @@ module.exports = require("@splunk/themes/pick");
|
|
|
564
612
|
/* 25 */
|
|
565
613
|
/***/ (function(module, exports) {
|
|
566
614
|
|
|
567
|
-
module.exports = require("@splunk/
|
|
615
|
+
module.exports = require("@splunk/ui-utils/id");
|
|
568
616
|
|
|
569
617
|
/***/ }),
|
|
570
618
|
/* 26 */
|
|
571
619
|
/***/ (function(module, exports) {
|
|
572
620
|
|
|
573
|
-
module.exports = require("@splunk/
|
|
621
|
+
module.exports = require("@splunk/visualization-context/TimezoneContext");
|
|
574
622
|
|
|
575
623
|
/***/ }),
|
|
576
624
|
/* 27 */
|
|
577
625
|
/***/ (function(module, exports) {
|
|
578
626
|
|
|
579
|
-
module.exports = require("@splunk/visualizations-shared/
|
|
627
|
+
module.exports = require("@splunk/visualizations-shared/hocUtils");
|
|
580
628
|
|
|
581
629
|
/***/ }),
|
|
582
630
|
/* 28 */
|
|
583
631
|
/***/ (function(module, exports) {
|
|
584
632
|
|
|
585
|
-
module.exports = require("@splunk/visualizations-shared/
|
|
633
|
+
module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
|
|
586
634
|
|
|
587
635
|
/***/ }),
|
|
588
636
|
/* 29 */
|
|
589
637
|
/***/ (function(module, exports) {
|
|
590
638
|
|
|
639
|
+
module.exports = require("@splunk/visualizations-shared/propUtils");
|
|
640
|
+
|
|
641
|
+
/***/ }),
|
|
642
|
+
/* 30 */
|
|
643
|
+
/***/ (function(module, exports) {
|
|
644
|
+
|
|
591
645
|
module.exports = require("@splunk/visualization-encoding/Options");
|
|
592
646
|
|
|
593
647
|
/***/ }),
|
|
594
|
-
/*
|
|
595
|
-
/*
|
|
648
|
+
/* 31 */,
|
|
649
|
+
/* 32 */
|
|
596
650
|
/***/ (function(module, exports, __webpack_require__) {
|
|
597
651
|
|
|
598
652
|
"use strict";
|
|
@@ -602,11 +656,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
602
656
|
value: true
|
|
603
657
|
});
|
|
604
658
|
exports.shouldShowIconPlaceholder = void 0;
|
|
659
|
+
|
|
605
660
|
var React = __webpack_require__(1);
|
|
661
|
+
|
|
606
662
|
var T = __webpack_require__(0);
|
|
663
|
+
|
|
607
664
|
var lodash_1 = __webpack_require__(3);
|
|
665
|
+
|
|
608
666
|
var i18n_1 = __webpack_require__(2);
|
|
667
|
+
|
|
609
668
|
var Message_1 = __webpack_require__(10);
|
|
669
|
+
|
|
610
670
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
611
671
|
/**
|
|
612
672
|
* @method shouldShowIconPlaceholder
|
|
@@ -614,14 +674,17 @@ var FixedSizeContainer_1 = __webpack_require__(13);
|
|
|
614
674
|
* @param {boolean} loading
|
|
615
675
|
* @returns {boolean}
|
|
616
676
|
*/
|
|
677
|
+
|
|
678
|
+
|
|
617
679
|
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
618
680
|
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
619
|
-
var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
|
|
681
|
+
var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
|
|
620
682
|
var noData = data === undefined;
|
|
621
|
-
var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
|
|
683
|
+
var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields[0]', undefined);
|
|
622
684
|
var noFields = fields === undefined;
|
|
623
685
|
return loading || noData || noFields;
|
|
624
686
|
};
|
|
687
|
+
|
|
625
688
|
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
626
689
|
var propTypes = {
|
|
627
690
|
icon: T.func,
|
|
@@ -636,11 +699,13 @@ var propTypes = {
|
|
|
636
699
|
* @param {IconPlaceholderProps} props
|
|
637
700
|
* @returns {React.ReactElement}
|
|
638
701
|
*/
|
|
702
|
+
|
|
639
703
|
var IconPlaceholder = function IconPlaceholder(props) {
|
|
640
704
|
var width = props.width,
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
705
|
+
height = props.height,
|
|
706
|
+
icon = props.icon,
|
|
707
|
+
iconColor = props.iconColor;
|
|
708
|
+
|
|
644
709
|
if (icon) {
|
|
645
710
|
return React.createElement(icon, {
|
|
646
711
|
style: {
|
|
@@ -655,25 +720,21 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
655
720
|
height: '50%'
|
|
656
721
|
});
|
|
657
722
|
}
|
|
723
|
+
|
|
658
724
|
return React.createElement(Message_1.default, {
|
|
659
725
|
width: width,
|
|
660
726
|
height: height,
|
|
661
727
|
level: "warning",
|
|
662
|
-
message: i18n_1._('No DataSource Connected')
|
|
728
|
+
message: (0, i18n_1._)('No DataSource Connected')
|
|
663
729
|
});
|
|
664
730
|
};
|
|
731
|
+
|
|
665
732
|
IconPlaceholder.propTypes = propTypes;
|
|
666
733
|
IconPlaceholder.defaultProps = {
|
|
667
734
|
width: '100%',
|
|
668
735
|
height: 250
|
|
669
736
|
};
|
|
670
|
-
exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
671
|
-
|
|
672
|
-
/***/ }),
|
|
673
|
-
/* 32 */
|
|
674
|
-
/***/ (function(module, exports) {
|
|
675
|
-
|
|
676
|
-
module.exports = require("@splunk/ui-utils/id");
|
|
737
|
+
exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
|
|
677
738
|
|
|
678
739
|
/***/ }),
|
|
679
740
|
/* 33 */
|
|
@@ -683,21 +744,27 @@ module.exports = require("@splunk/ui-utils/id");
|
|
|
683
744
|
|
|
684
745
|
|
|
685
746
|
var _defineProperty = __webpack_require__(7);
|
|
747
|
+
|
|
686
748
|
Object.defineProperty(exports, "__esModule", {
|
|
687
749
|
value: true
|
|
688
750
|
});
|
|
689
751
|
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
752
|
+
|
|
690
753
|
var T = __webpack_require__(0);
|
|
754
|
+
|
|
691
755
|
var lodash_1 = __webpack_require__(3);
|
|
692
|
-
|
|
756
|
+
|
|
757
|
+
var DataSource_1 = __webpack_require__(34);
|
|
758
|
+
|
|
693
759
|
exports.SortParamsPropTypes = T.shape({
|
|
694
760
|
currentSortKey: T.string,
|
|
695
761
|
currentSortDir: T.oneOf(DataSource_1.validSortDirs),
|
|
696
762
|
onSort: T.func
|
|
697
763
|
});
|
|
764
|
+
|
|
698
765
|
var getSortingParams = function getSortingParams(_ref) {
|
|
699
766
|
var requestParams = _ref.requestParams,
|
|
700
|
-
|
|
767
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
701
768
|
var currentSortKey;
|
|
702
769
|
var currentSortDir;
|
|
703
770
|
var nextSortDirMap = {
|
|
@@ -706,17 +773,20 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
706
773
|
none: 'asc'
|
|
707
774
|
};
|
|
708
775
|
var onSort;
|
|
776
|
+
|
|
709
777
|
if (typeof onRequestParamsChange === 'function') {
|
|
710
|
-
if (requestParams && lodash_1.has(requestParams, 'sort')) {
|
|
778
|
+
if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
|
|
711
779
|
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
712
780
|
currentSortDir = requestParams.sort[currentSortKey];
|
|
713
|
-
}
|
|
714
|
-
|
|
781
|
+
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
782
|
+
|
|
783
|
+
|
|
715
784
|
onSort = function onSort(e, _ref2) {
|
|
716
785
|
var sortKey = _ref2.sortKey,
|
|
717
|
-
|
|
786
|
+
sortDir = _ref2.sortDir;
|
|
787
|
+
|
|
718
788
|
if (typeof sortKey === 'string') {
|
|
719
|
-
var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
789
|
+
var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
720
790
|
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
721
791
|
offset: 0,
|
|
722
792
|
sort: _defineProperty({}, sortKey, nextSortDir)
|
|
@@ -726,12 +796,14 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
726
796
|
}
|
|
727
797
|
};
|
|
728
798
|
}
|
|
799
|
+
|
|
729
800
|
return {
|
|
730
801
|
currentSortKey: currentSortKey,
|
|
731
802
|
currentSortDir: currentSortDir,
|
|
732
803
|
onSort: onSort
|
|
733
804
|
};
|
|
734
805
|
};
|
|
806
|
+
|
|
735
807
|
exports.getSortingParams = getSortingParams;
|
|
736
808
|
|
|
737
809
|
/***/ }),
|
|
@@ -741,43 +813,68 @@ exports.getSortingParams = getSortingParams;
|
|
|
741
813
|
"use strict";
|
|
742
814
|
|
|
743
815
|
|
|
816
|
+
Object.defineProperty(exports, "__esModule", {
|
|
817
|
+
value: true
|
|
818
|
+
});
|
|
819
|
+
exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
|
|
820
|
+
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
821
|
+
exports.validSegmentationModes = ['none', 'inner'];
|
|
822
|
+
exports.validOutputModes = ['json_cols', 'json'];
|
|
823
|
+
|
|
824
|
+
/***/ }),
|
|
825
|
+
/* 35 */
|
|
826
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
827
|
+
|
|
828
|
+
"use strict";
|
|
829
|
+
|
|
830
|
+
|
|
744
831
|
Object.defineProperty(exports, "__esModule", {
|
|
745
832
|
value: true
|
|
746
833
|
});
|
|
747
834
|
exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
835
|
+
|
|
748
836
|
var T = __webpack_require__(0);
|
|
837
|
+
|
|
749
838
|
var lodash_1 = __webpack_require__(3);
|
|
839
|
+
|
|
750
840
|
exports.PaginatorParamsPropTypes = T.shape({
|
|
751
841
|
isPaging: T.bool,
|
|
752
842
|
current: T.number,
|
|
753
843
|
totalPages: T.number,
|
|
754
844
|
onChange: T.func
|
|
755
845
|
});
|
|
846
|
+
|
|
756
847
|
var getPaginationParams = function getPaginationParams(_ref) {
|
|
757
848
|
var requestParams = _ref.requestParams,
|
|
758
|
-
|
|
759
|
-
|
|
849
|
+
meta = _ref.meta,
|
|
850
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
760
851
|
var totalCount = meta && meta.totalCount || 0;
|
|
761
852
|
var offset = requestParams && requestParams.offset || 0;
|
|
762
853
|
var count = requestParams && requestParams.count;
|
|
763
854
|
var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
764
855
|
var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
765
856
|
var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
|
|
857
|
+
|
|
766
858
|
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
767
859
|
var page = _ref2.page,
|
|
768
|
-
|
|
769
|
-
var newParams = lodash_1.cloneDeep(requestParams);
|
|
860
|
+
countArg = _ref2.count;
|
|
861
|
+
var newParams = (0, lodash_1.cloneDeep)(requestParams);
|
|
862
|
+
|
|
770
863
|
if (typeof countArg === 'number') {
|
|
771
864
|
newParams.count = countArg;
|
|
772
865
|
newParams.offset = 0;
|
|
773
866
|
}
|
|
867
|
+
|
|
774
868
|
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
869
|
+
|
|
775
870
|
if (typeof page === 'number' && page > 0) {
|
|
776
871
|
newParams.count = pageCount;
|
|
777
872
|
newParams.offset = (page - 1) * pageCount;
|
|
778
873
|
}
|
|
874
|
+
|
|
779
875
|
onRequestParamsChange(newParams);
|
|
780
876
|
};
|
|
877
|
+
|
|
781
878
|
return {
|
|
782
879
|
isPaging: isPaging,
|
|
783
880
|
current: current,
|
|
@@ -785,10 +882,11 @@ var getPaginationParams = function getPaginationParams(_ref) {
|
|
|
785
882
|
onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
|
|
786
883
|
};
|
|
787
884
|
};
|
|
885
|
+
|
|
788
886
|
exports.getPaginationParams = getPaginationParams;
|
|
789
887
|
|
|
790
888
|
/***/ }),
|
|
791
|
-
/*
|
|
889
|
+
/* 36 */
|
|
792
890
|
/***/ (function(module, exports, __webpack_require__) {
|
|
793
891
|
|
|
794
892
|
"use strict";
|
|
@@ -799,6 +897,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
799
897
|
});
|
|
800
898
|
exports.VizCategory = void 0;
|
|
801
899
|
var VizCategory;
|
|
900
|
+
|
|
802
901
|
(function (VizCategory) {
|
|
803
902
|
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
804
903
|
VizCategory["TRENDS"] = "Trends";
|
|
@@ -815,67 +914,96 @@ var VizCategory;
|
|
|
815
914
|
})(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
|
|
816
915
|
|
|
817
916
|
/***/ }),
|
|
818
|
-
/*
|
|
917
|
+
/* 37 */
|
|
819
918
|
/***/ (function(module, exports, __webpack_require__) {
|
|
820
919
|
|
|
821
920
|
"use strict";
|
|
822
921
|
|
|
823
922
|
|
|
824
923
|
var _slicedToArray = __webpack_require__(17);
|
|
924
|
+
|
|
825
925
|
Object.defineProperty(exports, "__esModule", {
|
|
826
926
|
value: true
|
|
827
927
|
});
|
|
928
|
+
|
|
828
929
|
var React = __webpack_require__(1);
|
|
930
|
+
|
|
829
931
|
var lodash_1 = __webpack_require__(3);
|
|
830
|
-
|
|
831
|
-
var
|
|
832
|
-
|
|
833
|
-
var
|
|
834
|
-
|
|
932
|
+
|
|
933
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(38);
|
|
934
|
+
|
|
935
|
+
var Options_1 = __webpack_require__(30);
|
|
936
|
+
|
|
937
|
+
var SanitizeProps_1 = __webpack_require__(39);
|
|
938
|
+
|
|
939
|
+
var TimezoneContext_1 = __webpack_require__(26);
|
|
940
|
+
|
|
941
|
+
var moment_1 = __webpack_require__(40);
|
|
942
|
+
|
|
835
943
|
var FeatureFlagContext_1 = __webpack_require__(21);
|
|
944
|
+
|
|
836
945
|
var styled_components_1 = __webpack_require__(4);
|
|
837
|
-
|
|
838
|
-
var
|
|
839
|
-
|
|
840
|
-
var
|
|
841
|
-
|
|
946
|
+
|
|
947
|
+
var hocUtils_1 = __webpack_require__(27);
|
|
948
|
+
|
|
949
|
+
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
950
|
+
|
|
951
|
+
var async_dynamic_options_evaluator_1 = __webpack_require__(41);
|
|
952
|
+
|
|
953
|
+
var id_1 = __webpack_require__(25);
|
|
954
|
+
|
|
955
|
+
var SplunkVisualization_1 = __webpack_require__(42);
|
|
956
|
+
|
|
842
957
|
var VizBehavior_1 = __webpack_require__(6);
|
|
958
|
+
|
|
843
959
|
var getSorting_1 = __webpack_require__(33);
|
|
844
|
-
|
|
960
|
+
|
|
961
|
+
var getPagination_1 = __webpack_require__(35);
|
|
962
|
+
|
|
845
963
|
var useDeepMemo_1 = __webpack_require__(44);
|
|
964
|
+
|
|
846
965
|
var MissingPropsMessage_1 = __webpack_require__(45);
|
|
966
|
+
|
|
847
967
|
var withEditModeCover_1 = __webpack_require__(46);
|
|
968
|
+
|
|
848
969
|
var withPlaceholder_1 = __webpack_require__(47);
|
|
849
970
|
/**
|
|
850
971
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
851
972
|
* @param {DashboardVizOpts} opts
|
|
852
973
|
* @returns {HOC}
|
|
853
974
|
*/
|
|
975
|
+
|
|
976
|
+
|
|
854
977
|
var withDashboardViz = function withDashboardViz(opts) {
|
|
855
978
|
var ReactViz = opts.ReactViz,
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
var
|
|
979
|
+
vizConfig = opts.vizConfig,
|
|
980
|
+
_opts$computeVizProps = opts.computeVizProps,
|
|
981
|
+
computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
|
|
982
|
+
disableEditModeCover = opts.disableEditModeCover,
|
|
983
|
+
useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
|
|
984
|
+
|
|
985
|
+
var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
|
|
986
|
+
var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
|
|
987
|
+
|
|
863
988
|
var DashboardViz = function DashboardViz(props) {
|
|
864
989
|
var _a;
|
|
990
|
+
|
|
865
991
|
var mode = props.mode,
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
992
|
+
hasEventHandlers = props.hasEventHandlers,
|
|
993
|
+
dataSources = props.dataSources,
|
|
994
|
+
options = props.options,
|
|
995
|
+
_props$context = props.context,
|
|
996
|
+
context = _props$context === void 0 ? {} : _props$context,
|
|
997
|
+
width = props.width,
|
|
998
|
+
height = props.height,
|
|
999
|
+
onComputedProps = props.onComputedProps,
|
|
1000
|
+
onEventTrigger = props.onEventTrigger,
|
|
1001
|
+
theme = props.theme,
|
|
1002
|
+
onRequestParamsChange = props.onRequestParamsChange;
|
|
1003
|
+
|
|
877
1004
|
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
878
|
-
|
|
1005
|
+
serializedTimezone = _React$useContext.serializedTimezone;
|
|
1006
|
+
|
|
879
1007
|
if (serializedTimezone) {
|
|
880
1008
|
/*
|
|
881
1009
|
@splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
|
|
@@ -889,44 +1017,58 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
889
1017
|
moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
|
|
890
1018
|
}
|
|
891
1019
|
}
|
|
1020
|
+
|
|
892
1021
|
var themeFunc = function themeFunc(themeVar) {
|
|
893
1022
|
var _a, _b;
|
|
1023
|
+
|
|
894
1024
|
return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
|
|
895
1025
|
};
|
|
1026
|
+
|
|
896
1027
|
var bgColorFromTheme = themeFunc('defaultBackgroundColor');
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1028
|
+
|
|
1029
|
+
var _ref = (0, getSettingsFromThemedProps_1.default)({
|
|
1030
|
+
theme: theme
|
|
1031
|
+
}),
|
|
1032
|
+
currentThemeFamily = _ref.family,
|
|
1033
|
+
currentThemeColorScheme = _ref.colorScheme,
|
|
1034
|
+
currentThemeDensity = _ref.density;
|
|
1035
|
+
|
|
903
1036
|
var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
|
|
1037
|
+
|
|
904
1038
|
var _React$useState = React.useState({}),
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
1039
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1040
|
+
evaluatedOptionsAsync = _React$useState2[0],
|
|
1041
|
+
setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
|
|
1042
|
+
|
|
1043
|
+
|
|
908
1044
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
1045
|
+
|
|
1046
|
+
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
|
|
1047
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
1048
|
+
visualizationID = _React$useState4[0];
|
|
1049
|
+
|
|
912
1050
|
var _React$useState5 = React.useState({}),
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
1051
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
1052
|
+
dataSourcesInState = _React$useState6[0],
|
|
1053
|
+
setDataSourcesInState = _React$useState6[1];
|
|
1054
|
+
|
|
916
1055
|
var _React$useState7 = React.useState(),
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1056
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
1057
|
+
dataFramesInState = _React$useState8[0],
|
|
1058
|
+
setDataFramesInState = _React$useState8[1];
|
|
1059
|
+
|
|
1060
|
+
var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
|
|
1061
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
1062
|
+
useAsyncEvaluatedOptions = _React$useState10[0],
|
|
1063
|
+
setUseAsyncEvaluatedOptions = _React$useState10[1];
|
|
1064
|
+
|
|
1065
|
+
var isMounted = React.useRef(true);
|
|
1066
|
+
evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
|
|
925
1067
|
try {
|
|
926
1068
|
if (useAsyncEvaluatedOptions) {
|
|
927
1069
|
var optionsToEvaluate = {
|
|
928
|
-
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
929
|
-
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
1070
|
+
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
1071
|
+
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
930
1072
|
};
|
|
931
1073
|
var asyncDynamicOptionsEvaluatorParams = {
|
|
932
1074
|
visualizationID: visualizationID,
|
|
@@ -937,21 +1079,23 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
937
1079
|
};
|
|
938
1080
|
async_dynamic_options_evaluator_1.default.evaluate(asyncDynamicOptionsEvaluatorParams).then(function (results) {
|
|
939
1081
|
setEvaluatedOptionsAsync(results.results);
|
|
940
|
-
}).catch(function (
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
1082
|
+
}).catch(function () {
|
|
1083
|
+
if (isMounted.current) {
|
|
1084
|
+
setUseAsyncEvaluatedOptions(false);
|
|
1085
|
+
}
|
|
944
1086
|
});
|
|
945
1087
|
} else {
|
|
946
1088
|
var dataFrames = dataFramesInState;
|
|
1089
|
+
|
|
947
1090
|
if (dataSources !== dataSourcesInState) {
|
|
948
1091
|
setDataSourcesInState(dataSources);
|
|
949
1092
|
dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
|
|
950
1093
|
setDataFramesInState(dataFrames);
|
|
951
1094
|
}
|
|
1095
|
+
|
|
952
1096
|
return Options_1.Options.evaluate({
|
|
953
|
-
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
954
|
-
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
1097
|
+
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
1098
|
+
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
955
1099
|
}, dataSources, themeFunc, dataFrames);
|
|
956
1100
|
}
|
|
957
1101
|
} catch (e) {
|
|
@@ -959,67 +1103,76 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
959
1103
|
console.error("unexpected error evaluating options: ".concat(e.message));
|
|
960
1104
|
return {};
|
|
961
1105
|
}
|
|
1106
|
+
|
|
962
1107
|
return {};
|
|
963
1108
|
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
|
|
964
|
-
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
965
|
-
// trellis specific backgroundColor update for onComputedProps
|
|
1109
|
+
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
|
|
966
1110
|
// 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
|
|
967
1111
|
// onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
|
|
1112
|
+
|
|
968
1113
|
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
969
1114
|
var clonedEvaluatedOptions = evaluatedOptionsToUse;
|
|
1115
|
+
|
|
970
1116
|
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) {
|
|
971
1117
|
clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
|
|
972
1118
|
backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
973
1119
|
});
|
|
974
|
-
}
|
|
975
|
-
// useEffect hook needs to be initialized before any early returns
|
|
1120
|
+
} // useEffect hook needs to be initialized before any early returns
|
|
976
1121
|
// this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
|
|
1122
|
+
|
|
1123
|
+
|
|
977
1124
|
React.useEffect(function () {
|
|
978
1125
|
onComputedProps(clonedEvaluatedOptions);
|
|
979
1126
|
});
|
|
980
1127
|
React.useEffect(function () {
|
|
981
1128
|
return function () {
|
|
982
1129
|
if (useAsyncEvaluatedOptions) {
|
|
1130
|
+
isMounted.current = false;
|
|
983
1131
|
async_dynamic_options_evaluator_1.default.reset(visualizationID);
|
|
984
1132
|
}
|
|
985
|
-
};
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
// present warning message if any required props are missing
|
|
1133
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1134
|
+
}, []); // present warning message if any required props are missing
|
|
1135
|
+
|
|
989
1136
|
var _vizConfig$requiredPr = vizConfig.requiredProps,
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptionsToUse);
|
|
1137
|
+
requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
|
|
1138
|
+
supports = vizConfig.supports;
|
|
1139
|
+
var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
|
|
1140
|
+
|
|
993
1141
|
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
|
|
994
1142
|
) {
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1143
|
+
return React.createElement(MissingPropsMessage_1.default, {
|
|
1144
|
+
"data-test": "missing-props-message",
|
|
1145
|
+
width: width,
|
|
1146
|
+
height: height,
|
|
1147
|
+
missingProps: missing,
|
|
1148
|
+
backgroundColor: bgColorFromTheme
|
|
1149
|
+
});
|
|
1150
|
+
} // events
|
|
1151
|
+
|
|
1152
|
+
|
|
1004
1153
|
var eventCallbackProps = {};
|
|
1154
|
+
|
|
1005
1155
|
if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
|
|
1006
1156
|
var supportedEvents = vizConfig.events;
|
|
1007
1157
|
Object.keys(supportedEvents).forEach(function (eventName) {
|
|
1008
|
-
var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
|
|
1009
|
-
eventCallbackProps[eventCallbackPropName] = null;
|
|
1010
|
-
// todo: refactor single value and single value icon to send payload from viz
|
|
1158
|
+
var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
|
|
1159
|
+
eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
|
|
1011
1160
|
// then remove these lines
|
|
1161
|
+
|
|
1012
1162
|
var payloadKeys = supportedEvents[eventName].payloadKeys;
|
|
1013
1163
|
var payload = {};
|
|
1164
|
+
|
|
1014
1165
|
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
1015
1166
|
payloadKeys.forEach(function (p) {
|
|
1016
1167
|
payload[p] = evaluatedOptionsToUse[p];
|
|
1017
1168
|
});
|
|
1018
1169
|
}
|
|
1170
|
+
|
|
1019
1171
|
eventCallbackProps[eventCallbackPropName] = function (ev) {
|
|
1020
1172
|
if (ev && ev.payload) {
|
|
1021
1173
|
payload = ev.payload;
|
|
1022
1174
|
}
|
|
1175
|
+
|
|
1023
1176
|
return onEventTrigger({
|
|
1024
1177
|
originalEvent: ev,
|
|
1025
1178
|
payload: payload,
|
|
@@ -1027,8 +1180,9 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1027
1180
|
});
|
|
1028
1181
|
};
|
|
1029
1182
|
});
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1183
|
+
} // compute pure viz props which are not from options
|
|
1184
|
+
|
|
1185
|
+
|
|
1032
1186
|
var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
1033
1187
|
themeFunc: themeFunc
|
|
1034
1188
|
}));
|
|
@@ -1046,21 +1200,25 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1046
1200
|
* In future, we could automatically detect which all datasources are being used
|
|
1047
1201
|
* and bind those magically to pagination/sorting behavior.
|
|
1048
1202
|
*/
|
|
1203
|
+
|
|
1049
1204
|
var dataSourceMetadata = {};
|
|
1050
1205
|
var OptionKey = 'paginateDataSourceKey';
|
|
1051
|
-
var paginateDataSourceKey = lodash_1.has(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
var
|
|
1206
|
+
var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1207
|
+
|
|
1208
|
+
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
|
|
1209
|
+
var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
1210
|
+
var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
1211
|
+
|
|
1055
1212
|
var handleRequestParamsChange = function handleRequestParamsChange(payload) {
|
|
1056
1213
|
return onRequestParamsChange(paginateDataSourceKey, payload);
|
|
1057
1214
|
};
|
|
1058
|
-
|
|
1215
|
+
|
|
1216
|
+
var sortParams = (0, getSorting_1.getSortingParams)({
|
|
1059
1217
|
requestParams: requestParams,
|
|
1060
1218
|
meta: meta,
|
|
1061
1219
|
onRequestParamsChange: handleRequestParamsChange
|
|
1062
1220
|
});
|
|
1063
|
-
var paginatorParams = getPagination_1.getPaginationParams({
|
|
1221
|
+
var paginatorParams = (0, getPagination_1.getPaginationParams)({
|
|
1064
1222
|
requestParams: requestParams,
|
|
1065
1223
|
meta: meta,
|
|
1066
1224
|
onRequestParamsChange: handleRequestParamsChange
|
|
@@ -1069,103 +1227,120 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1069
1227
|
sortParams: sortParams,
|
|
1070
1228
|
paginatorParams: paginatorParams
|
|
1071
1229
|
};
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1230
|
+
} // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
|
|
1231
|
+
|
|
1232
|
+
|
|
1074
1233
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
1075
1234
|
return null;
|
|
1076
1235
|
}
|
|
1236
|
+
|
|
1077
1237
|
return React.createElement(SanitizedReactViz, Object.assign({
|
|
1078
1238
|
mode: mode,
|
|
1079
1239
|
width: width,
|
|
1080
1240
|
height: height
|
|
1081
1241
|
}, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
|
|
1082
1242
|
};
|
|
1243
|
+
|
|
1083
1244
|
DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
|
|
1084
1245
|
DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
|
|
1085
1246
|
// using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
|
|
1086
1247
|
theme: {}
|
|
1087
|
-
});
|
|
1088
|
-
|
|
1089
|
-
DashboardViz.config = vizConfig;
|
|
1090
|
-
|
|
1091
|
-
return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1248
|
+
}); // attach viz config
|
|
1249
|
+
|
|
1250
|
+
DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
|
|
1251
|
+
|
|
1252
|
+
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1092
1253
|
};
|
|
1254
|
+
|
|
1093
1255
|
exports.default = withDashboardViz;
|
|
1094
1256
|
|
|
1095
1257
|
/***/ }),
|
|
1096
|
-
/*
|
|
1258
|
+
/* 38 */
|
|
1097
1259
|
/***/ (function(module, exports) {
|
|
1098
1260
|
|
|
1099
1261
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
1100
1262
|
|
|
1101
1263
|
/***/ }),
|
|
1102
|
-
/*
|
|
1264
|
+
/* 39 */
|
|
1103
1265
|
/***/ (function(module, exports) {
|
|
1104
1266
|
|
|
1105
1267
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1106
1268
|
|
|
1107
1269
|
/***/ }),
|
|
1108
|
-
/*
|
|
1270
|
+
/* 40 */
|
|
1109
1271
|
/***/ (function(module, exports) {
|
|
1110
1272
|
|
|
1111
1273
|
module.exports = require("@splunk/moment");
|
|
1112
1274
|
|
|
1113
1275
|
/***/ }),
|
|
1114
|
-
/*
|
|
1276
|
+
/* 41 */
|
|
1115
1277
|
/***/ (function(module, exports) {
|
|
1116
1278
|
|
|
1117
1279
|
module.exports = require("@splunk/async-dynamic-options-evaluator");
|
|
1118
1280
|
|
|
1119
1281
|
/***/ }),
|
|
1120
|
-
/*
|
|
1282
|
+
/* 42 */
|
|
1121
1283
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1122
1284
|
|
|
1123
1285
|
"use strict";
|
|
1124
1286
|
|
|
1125
1287
|
|
|
1126
1288
|
var _classCallCheck = __webpack_require__(9);
|
|
1289
|
+
|
|
1127
1290
|
Object.defineProperty(exports, "__esModule", {
|
|
1128
1291
|
value: true
|
|
1129
1292
|
});
|
|
1130
1293
|
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
1131
1294
|
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
1295
|
+
|
|
1132
1296
|
var T = __webpack_require__(0);
|
|
1297
|
+
|
|
1133
1298
|
var lodash_1 = __webpack_require__(3);
|
|
1134
|
-
|
|
1135
|
-
// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1299
|
+
|
|
1300
|
+
var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1301
|
+
|
|
1302
|
+
|
|
1136
1303
|
exports.INITIAL_WIDTH = 250;
|
|
1137
1304
|
exports.INITIAL_HEIGHT = 250;
|
|
1138
1305
|
/**
|
|
1139
1306
|
* A Splunk visualization
|
|
1140
1307
|
*/
|
|
1308
|
+
|
|
1141
1309
|
var SplunkVisualization = function SplunkVisualization() {
|
|
1142
1310
|
_classCallCheck(this, SplunkVisualization);
|
|
1143
1311
|
};
|
|
1312
|
+
|
|
1144
1313
|
SplunkVisualization.propTypes = {
|
|
1145
1314
|
/**
|
|
1146
1315
|
* display mode
|
|
1147
1316
|
*/
|
|
1148
1317
|
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
1318
|
+
|
|
1149
1319
|
/**
|
|
1150
1320
|
* width in pixel or string, defaults to 100%
|
|
1151
1321
|
*/
|
|
1152
1322
|
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
1323
|
+
|
|
1153
1324
|
/**
|
|
1154
1325
|
* height in pixel or string
|
|
1155
1326
|
*/
|
|
1156
1327
|
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
1328
|
+
|
|
1157
1329
|
/**
|
|
1158
1330
|
* visualization context used for dynamic option evaluation
|
|
1159
1331
|
*/
|
|
1160
1332
|
context: T.object,
|
|
1333
|
+
|
|
1161
1334
|
/**
|
|
1162
1335
|
* visualization formatting options
|
|
1163
1336
|
*/
|
|
1164
1337
|
options: T.object,
|
|
1338
|
+
|
|
1165
1339
|
/**
|
|
1166
1340
|
* A callback to update formatting options
|
|
1167
1341
|
*/
|
|
1168
1342
|
onOptionsChange: T.func,
|
|
1343
|
+
|
|
1169
1344
|
/**
|
|
1170
1345
|
* datasource state which include data and request params, object key indicate the datasource type.
|
|
1171
1346
|
*/
|
|
@@ -1174,6 +1349,7 @@ SplunkVisualization.propTypes = {
|
|
|
1174
1349
|
* current request params
|
|
1175
1350
|
*/
|
|
1176
1351
|
requestParams: T.object,
|
|
1352
|
+
|
|
1177
1353
|
/**
|
|
1178
1354
|
* current dataset
|
|
1179
1355
|
*/
|
|
@@ -1181,6 +1357,7 @@ SplunkVisualization.propTypes = {
|
|
|
1181
1357
|
fields: T.array,
|
|
1182
1358
|
columns: T.array
|
|
1183
1359
|
}),
|
|
1360
|
+
|
|
1184
1361
|
/**
|
|
1185
1362
|
* error
|
|
1186
1363
|
*/
|
|
@@ -1188,29 +1365,35 @@ SplunkVisualization.propTypes = {
|
|
|
1188
1365
|
level: T.string,
|
|
1189
1366
|
message: T.string
|
|
1190
1367
|
}),
|
|
1368
|
+
|
|
1191
1369
|
/**
|
|
1192
1370
|
* meta data that came with the dataset
|
|
1193
1371
|
*/
|
|
1194
1372
|
meta: T.object
|
|
1195
1373
|
})),
|
|
1374
|
+
|
|
1196
1375
|
/**
|
|
1197
1376
|
* A callback to trigger event
|
|
1198
1377
|
*/
|
|
1199
1378
|
onEventTrigger: T.func,
|
|
1379
|
+
|
|
1200
1380
|
/**
|
|
1201
1381
|
* Inform viz if there are handlers listening to events
|
|
1202
1382
|
*/
|
|
1203
1383
|
hasEventHandlers: T.bool,
|
|
1384
|
+
|
|
1204
1385
|
/**
|
|
1205
1386
|
* A callback to communicate computed props to a consumer
|
|
1206
1387
|
*/
|
|
1207
1388
|
onComputedProps: T.func,
|
|
1389
|
+
|
|
1208
1390
|
/**
|
|
1209
1391
|
* A callback to obtain visualization api
|
|
1210
1392
|
*/
|
|
1211
1393
|
vizActionHandlerRef: T.func,
|
|
1212
1394
|
loading: T.bool,
|
|
1213
1395
|
theme: T.object,
|
|
1396
|
+
|
|
1214
1397
|
/**
|
|
1215
1398
|
* A callback to request new data with updated request params
|
|
1216
1399
|
*/
|
|
@@ -1219,6 +1402,7 @@ SplunkVisualization.propTypes = {
|
|
|
1219
1402
|
/**
|
|
1220
1403
|
*
|
|
1221
1404
|
*/
|
|
1405
|
+
|
|
1222
1406
|
SplunkVisualization.defaultProps = {
|
|
1223
1407
|
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
1224
1408
|
width: '100%',
|
|
@@ -1246,26 +1430,29 @@ SplunkVisualization.defaultProps = {
|
|
|
1246
1430
|
exports.default = SplunkVisualization;
|
|
1247
1431
|
|
|
1248
1432
|
/***/ }),
|
|
1249
|
-
/*
|
|
1433
|
+
/* 43 */
|
|
1250
1434
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1251
1435
|
|
|
1252
1436
|
"use strict";
|
|
1253
1437
|
|
|
1254
1438
|
|
|
1255
1439
|
var _classCallCheck = __webpack_require__(9);
|
|
1440
|
+
|
|
1256
1441
|
var _createClass = __webpack_require__(18);
|
|
1442
|
+
|
|
1257
1443
|
Object.defineProperty(exports, "__esModule", {
|
|
1258
1444
|
value: true
|
|
1259
1445
|
});
|
|
1260
1446
|
exports.DefaultVizActionHandler = void 0;
|
|
1447
|
+
|
|
1261
1448
|
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
1262
1449
|
function DefaultVizActionHandler() {
|
|
1263
1450
|
_classCallCheck(this, DefaultVizActionHandler);
|
|
1264
1451
|
}
|
|
1452
|
+
|
|
1265
1453
|
_createClass(DefaultVizActionHandler, [{
|
|
1266
1454
|
key: "focus",
|
|
1267
|
-
value: function focus() {
|
|
1268
|
-
// noop
|
|
1455
|
+
value: function focus() {// noop
|
|
1269
1456
|
}
|
|
1270
1457
|
}, {
|
|
1271
1458
|
key: "snapshot",
|
|
@@ -1273,22 +1460,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
|
1273
1460
|
return null; // noop
|
|
1274
1461
|
}
|
|
1275
1462
|
}]);
|
|
1463
|
+
|
|
1276
1464
|
return DefaultVizActionHandler;
|
|
1277
1465
|
}();
|
|
1278
|
-
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1279
|
-
|
|
1280
|
-
/***/ }),
|
|
1281
|
-
/* 43 */
|
|
1282
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1283
|
-
|
|
1284
|
-
"use strict";
|
|
1285
1466
|
|
|
1286
|
-
|
|
1287
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1288
|
-
value: true
|
|
1289
|
-
});
|
|
1290
|
-
exports.validSortDirs = void 0;
|
|
1291
|
-
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1467
|
+
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1292
1468
|
|
|
1293
1469
|
/***/ }),
|
|
1294
1470
|
/* 44 */
|
|
@@ -1301,7 +1477,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1301
1477
|
value: true
|
|
1302
1478
|
});
|
|
1303
1479
|
exports.useDeepMemo = void 0;
|
|
1480
|
+
|
|
1304
1481
|
var react_1 = __webpack_require__(1);
|
|
1482
|
+
|
|
1305
1483
|
var lodash_1 = __webpack_require__(3);
|
|
1306
1484
|
/**
|
|
1307
1485
|
* This hook evaluates and stores the result of a passed function and only
|
|
@@ -1316,16 +1494,21 @@ var lodash_1 = __webpack_require__(3);
|
|
|
1316
1494
|
* @param fn the function to be executed and
|
|
1317
1495
|
* @param dependencies an array of dependencies
|
|
1318
1496
|
*/
|
|
1497
|
+
|
|
1498
|
+
|
|
1319
1499
|
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
1320
|
-
var ref = react_1.useRef();
|
|
1321
|
-
|
|
1500
|
+
var ref = (0, react_1.useRef)();
|
|
1501
|
+
|
|
1502
|
+
if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
|
|
1322
1503
|
ref.current = {
|
|
1323
1504
|
dependencies: dependencies,
|
|
1324
1505
|
value: fn()
|
|
1325
1506
|
};
|
|
1326
1507
|
}
|
|
1508
|
+
|
|
1327
1509
|
return ref.current.value;
|
|
1328
1510
|
};
|
|
1511
|
+
|
|
1329
1512
|
exports.useDeepMemo = useDeepMemo;
|
|
1330
1513
|
|
|
1331
1514
|
/***/ }),
|
|
@@ -1339,19 +1522,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1339
1522
|
value: true
|
|
1340
1523
|
});
|
|
1341
1524
|
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
1525
|
+
|
|
1342
1526
|
var React = __webpack_require__(1);
|
|
1527
|
+
|
|
1343
1528
|
var T = __webpack_require__(0);
|
|
1529
|
+
|
|
1344
1530
|
var i18n_1 = __webpack_require__(2);
|
|
1531
|
+
|
|
1345
1532
|
var Message_1 = __webpack_require__(10);
|
|
1533
|
+
|
|
1346
1534
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
1347
1535
|
/**
|
|
1348
1536
|
* @method isMissing
|
|
1349
1537
|
* @param {any} v
|
|
1350
1538
|
* @returns {boolean} true if the input value === null or undefined
|
|
1351
1539
|
*/
|
|
1540
|
+
|
|
1541
|
+
|
|
1352
1542
|
var isMissing = function isMissing(v) {
|
|
1353
1543
|
return v === null || v === undefined;
|
|
1354
1544
|
};
|
|
1545
|
+
|
|
1355
1546
|
exports.isMissing = isMissing;
|
|
1356
1547
|
/**
|
|
1357
1548
|
* @method misskingKeys
|
|
@@ -1359,11 +1550,13 @@ exports.isMissing = isMissing;
|
|
|
1359
1550
|
* @param {object} target
|
|
1360
1551
|
* @returns {string[]} the keys of missing required props
|
|
1361
1552
|
*/
|
|
1553
|
+
|
|
1362
1554
|
var missingKeys = function missingKeys(keys, target) {
|
|
1363
1555
|
return keys.filter(function (k) {
|
|
1364
|
-
return exports.isMissing(target[k]);
|
|
1556
|
+
return (0, exports.isMissing)(target[k]);
|
|
1365
1557
|
});
|
|
1366
1558
|
};
|
|
1559
|
+
|
|
1367
1560
|
exports.missingKeys = missingKeys;
|
|
1368
1561
|
var propTypes = {
|
|
1369
1562
|
width: T.oneOfType([T.string, T.number]),
|
|
@@ -1377,24 +1570,26 @@ var propTypes = {
|
|
|
1377
1570
|
* @param {MissingPropsProps} props
|
|
1378
1571
|
* @returns {React.ReactElement}
|
|
1379
1572
|
*/
|
|
1573
|
+
|
|
1380
1574
|
var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
1381
1575
|
var width = props.width,
|
|
1382
|
-
|
|
1383
|
-
|
|
1576
|
+
height = props.height,
|
|
1577
|
+
missingProps = props.missingProps;
|
|
1384
1578
|
return React.createElement(Message_1.default, {
|
|
1385
1579
|
"data-test": "message",
|
|
1386
1580
|
width: width,
|
|
1387
1581
|
height: height,
|
|
1388
|
-
message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
|
|
1582
|
+
message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
|
|
1389
1583
|
});
|
|
1390
1584
|
};
|
|
1585
|
+
|
|
1391
1586
|
exports.MissingPropsMessage = MissingPropsMessage;
|
|
1392
1587
|
exports.MissingPropsMessage.propTypes = propTypes;
|
|
1393
1588
|
exports.MissingPropsMessage.defaultProps = {
|
|
1394
1589
|
width: '100%',
|
|
1395
1590
|
height: 250
|
|
1396
1591
|
};
|
|
1397
|
-
exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
1592
|
+
exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage);
|
|
1398
1593
|
|
|
1399
1594
|
/***/ }),
|
|
1400
1595
|
/* 46 */
|
|
@@ -1406,15 +1601,19 @@ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
|
1406
1601
|
Object.defineProperty(exports, "__esModule", {
|
|
1407
1602
|
value: true
|
|
1408
1603
|
});
|
|
1604
|
+
|
|
1409
1605
|
var React = __webpack_require__(1);
|
|
1606
|
+
|
|
1410
1607
|
var styled_components_1 = __webpack_require__(4);
|
|
1608
|
+
|
|
1411
1609
|
var hocUtils_1 = __webpack_require__(15);
|
|
1610
|
+
|
|
1412
1611
|
var Cover = styled_components_1.default.div.withConfig({
|
|
1413
1612
|
displayName: "withEditModeCover__Cover",
|
|
1414
1613
|
componentId: "sc-1gsbnxb-0"
|
|
1415
1614
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1416
1615
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1417
|
-
'data-splunk-visualization-version': "
|
|
1616
|
+
'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
|
|
1418
1617
|
}).withConfig({
|
|
1419
1618
|
displayName: "withEditModeCover__Blocker",
|
|
1420
1619
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -1425,6 +1624,7 @@ var Blocker = styled_components_1.default.div.attrs({
|
|
|
1425
1624
|
* @param {ExtendedDashViz} Visualization
|
|
1426
1625
|
* @returns {ExtendedDashViz} Wrapper
|
|
1427
1626
|
*/
|
|
1627
|
+
|
|
1428
1628
|
var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
|
|
1429
1629
|
var Wrapper = function Wrapper(props) {
|
|
1430
1630
|
var mode = props.mode;
|
|
@@ -1433,12 +1633,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
|
|
|
1433
1633
|
"data-test": "edit-mode-cover"
|
|
1434
1634
|
}));
|
|
1435
1635
|
};
|
|
1436
|
-
|
|
1636
|
+
|
|
1637
|
+
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
1437
1638
|
Wrapper: Wrapper,
|
|
1438
1639
|
Visualization: Visualization
|
|
1439
1640
|
});
|
|
1440
1641
|
return Wrapper;
|
|
1441
1642
|
};
|
|
1643
|
+
|
|
1442
1644
|
exports.default = withEditModeCover;
|
|
1443
1645
|
|
|
1444
1646
|
/***/ }),
|
|
@@ -1451,27 +1653,37 @@ exports.default = withEditModeCover;
|
|
|
1451
1653
|
Object.defineProperty(exports, "__esModule", {
|
|
1452
1654
|
value: true
|
|
1453
1655
|
});
|
|
1656
|
+
|
|
1454
1657
|
var React = __webpack_require__(1);
|
|
1658
|
+
|
|
1455
1659
|
var colorUtils_1 = __webpack_require__(12);
|
|
1660
|
+
|
|
1456
1661
|
var variables_1 = __webpack_require__(11);
|
|
1457
|
-
|
|
1662
|
+
|
|
1663
|
+
var IconPlaceholder_1 = __webpack_require__(32);
|
|
1664
|
+
|
|
1458
1665
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1666
|
+
|
|
1459
1667
|
var hocUtils_1 = __webpack_require__(15);
|
|
1668
|
+
|
|
1460
1669
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
1461
1670
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
1462
1671
|
var config = Visualization.config;
|
|
1463
1672
|
var themes = config.themes;
|
|
1673
|
+
|
|
1464
1674
|
var Wrapper = function Wrapper(props) {
|
|
1465
1675
|
var _a, _b;
|
|
1676
|
+
|
|
1466
1677
|
var dataSources = props.dataSources,
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1678
|
+
loading = props.loading,
|
|
1679
|
+
options = props.options,
|
|
1680
|
+
height = props.height,
|
|
1681
|
+
width = props.width;
|
|
1471
1682
|
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
1472
|
-
var bgColorFromTheme = colorUtils_1.isColor(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
|
|
1683
|
+
var 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);
|
|
1473
1684
|
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
1474
1685
|
var iconColor = variables_1.default.contentColorActive(props);
|
|
1686
|
+
|
|
1475
1687
|
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
1476
1688
|
return React.createElement(IconPlaceholder_1.default, {
|
|
1477
1689
|
"data-test": "icon-placeholder",
|
|
@@ -1482,14 +1694,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
1482
1694
|
iconColor: iconColor
|
|
1483
1695
|
});
|
|
1484
1696
|
}
|
|
1697
|
+
|
|
1485
1698
|
return React.createElement(Visualization, Object.assign({}, props));
|
|
1486
1699
|
};
|
|
1487
|
-
|
|
1700
|
+
|
|
1701
|
+
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
1488
1702
|
Wrapper: Wrapper,
|
|
1489
1703
|
Visualization: Visualization
|
|
1490
1704
|
});
|
|
1491
1705
|
return Wrapper;
|
|
1492
1706
|
};
|
|
1707
|
+
|
|
1493
1708
|
exports.default = withPlaceholder;
|
|
1494
1709
|
|
|
1495
1710
|
/***/ }),
|
|
@@ -1504,14 +1719,19 @@ exports.default = withPlaceholder;
|
|
|
1504
1719
|
/* 56 */,
|
|
1505
1720
|
/* 57 */,
|
|
1506
1721
|
/* 58 */,
|
|
1507
|
-
/* 59
|
|
1508
|
-
|
|
1722
|
+
/* 59 */
|
|
1723
|
+
/***/ (function(module, exports) {
|
|
1724
|
+
|
|
1725
|
+
module.exports = require("@babel/runtime/helpers/taggedTemplateLiteral");
|
|
1726
|
+
|
|
1727
|
+
/***/ }),
|
|
1728
|
+
/* 60 */,
|
|
1729
|
+
/* 61 */
|
|
1509
1730
|
/***/ (function(module, exports) {
|
|
1510
1731
|
|
|
1511
1732
|
module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
|
|
1512
1733
|
|
|
1513
1734
|
/***/ }),
|
|
1514
|
-
/* 61 */,
|
|
1515
1735
|
/* 62 */,
|
|
1516
1736
|
/* 63 */,
|
|
1517
1737
|
/* 64 */,
|
|
@@ -1563,7 +1783,8 @@ module.exports = require("@splunk/visualization-color-palettes/editors/PresetPal
|
|
|
1563
1783
|
/* 110 */,
|
|
1564
1784
|
/* 111 */,
|
|
1565
1785
|
/* 112 */,
|
|
1566
|
-
/* 113
|
|
1786
|
+
/* 113 */,
|
|
1787
|
+
/* 114 */
|
|
1567
1788
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1568
1789
|
|
|
1569
1790
|
"use strict";
|
|
@@ -1573,48 +1794,52 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1573
1794
|
value: true
|
|
1574
1795
|
});
|
|
1575
1796
|
exports.getDynamicFillColorEditor = void 0;
|
|
1797
|
+
|
|
1576
1798
|
var i18n_1 = __webpack_require__(2);
|
|
1799
|
+
|
|
1577
1800
|
var configUtils_1 = __webpack_require__(22);
|
|
1801
|
+
|
|
1578
1802
|
var getDynamicFillColorEditor = function getDynamicFillColorEditor(_ref) {
|
|
1579
1803
|
var defaultContext = _ref.defaultContext,
|
|
1580
|
-
|
|
1804
|
+
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
1581
1805
|
return {
|
|
1582
|
-
label: i18n_1._('Fill'),
|
|
1806
|
+
label: (0, i18n_1._)('Fill'),
|
|
1583
1807
|
option: 'fillColor',
|
|
1584
1808
|
context: 'fillColorEditorConfig',
|
|
1585
1809
|
editor: 'editor.dynamicColor',
|
|
1586
1810
|
showEditor: function showEditor(_ref2) {
|
|
1587
1811
|
var options = _ref2.options;
|
|
1588
|
-
return configUtils_1.isDynamicOption(options.fillColor);
|
|
1812
|
+
return (0, configUtils_1.isDynamicOption)(options.fillColor);
|
|
1589
1813
|
},
|
|
1590
1814
|
editorProps: {
|
|
1591
1815
|
labelPosition: 'top',
|
|
1592
|
-
flyoutTitle: i18n_1._('Dynamic coloring: fill'),
|
|
1816
|
+
flyoutTitle: (0, i18n_1._)('Dynamic coloring: fill'),
|
|
1593
1817
|
formatters: [{
|
|
1594
|
-
label: i18n_1._('Ranges'),
|
|
1818
|
+
label: (0, i18n_1._)('Ranges'),
|
|
1595
1819
|
value: 'rangeValue',
|
|
1596
1820
|
defaults: {
|
|
1597
1821
|
fillDataValue: defaultContext.fillColorConfig
|
|
1598
1822
|
}
|
|
1599
1823
|
}, {
|
|
1600
|
-
label: i18n_1._('Matches'),
|
|
1824
|
+
label: (0, i18n_1._)('Matches'),
|
|
1601
1825
|
value: 'matchValue',
|
|
1602
1826
|
defaults: {
|
|
1603
1827
|
fillDataValue: defaultContext.fillColorMatchConfig
|
|
1604
1828
|
}
|
|
1605
1829
|
}],
|
|
1606
1830
|
dataSelectors: [{
|
|
1607
|
-
label: i18n_1._('Fill'),
|
|
1831
|
+
label: (0, i18n_1._)('Fill'),
|
|
1608
1832
|
value: 'fillDataValue'
|
|
1609
1833
|
}],
|
|
1610
1834
|
defaultPalettesConfig: defaultPalettesConfig
|
|
1611
1835
|
}
|
|
1612
1836
|
};
|
|
1613
1837
|
};
|
|
1838
|
+
|
|
1614
1839
|
exports.getDynamicFillColorEditor = getDynamicFillColorEditor;
|
|
1615
1840
|
|
|
1616
1841
|
/***/ }),
|
|
1617
|
-
/*
|
|
1842
|
+
/* 115 */
|
|
1618
1843
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1619
1844
|
|
|
1620
1845
|
"use strict";
|
|
@@ -1624,48 +1849,52 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1624
1849
|
value: true
|
|
1625
1850
|
});
|
|
1626
1851
|
exports.getDynamicStrokeColorEditor = void 0;
|
|
1852
|
+
|
|
1627
1853
|
var i18n_1 = __webpack_require__(2);
|
|
1854
|
+
|
|
1628
1855
|
var configUtils_1 = __webpack_require__(22);
|
|
1856
|
+
|
|
1629
1857
|
var getDynamicStrokeColorEditor = function getDynamicStrokeColorEditor(_ref) {
|
|
1630
1858
|
var defaultContext = _ref.defaultContext,
|
|
1631
|
-
|
|
1859
|
+
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
1632
1860
|
return {
|
|
1633
|
-
label: i18n_1._('Stroke'),
|
|
1861
|
+
label: (0, i18n_1._)('Stroke'),
|
|
1634
1862
|
option: 'strokeColor',
|
|
1635
1863
|
context: 'strokeColorEditorConfig',
|
|
1636
1864
|
editor: 'editor.dynamicColor',
|
|
1637
1865
|
showEditor: function showEditor(_ref2) {
|
|
1638
1866
|
var options = _ref2.options;
|
|
1639
|
-
return configUtils_1.isDynamicOption(options.strokeColor);
|
|
1867
|
+
return (0, configUtils_1.isDynamicOption)(options.strokeColor);
|
|
1640
1868
|
},
|
|
1641
1869
|
editorProps: {
|
|
1642
1870
|
labelPosition: 'top',
|
|
1643
|
-
flyoutTitle: i18n_1._('Dynamic coloring: stroke'),
|
|
1871
|
+
flyoutTitle: (0, i18n_1._)('Dynamic coloring: stroke'),
|
|
1644
1872
|
formatters: [{
|
|
1645
|
-
label: i18n_1._('Ranges'),
|
|
1873
|
+
label: (0, i18n_1._)('Ranges'),
|
|
1646
1874
|
value: 'rangeValue',
|
|
1647
1875
|
defaults: {
|
|
1648
1876
|
strokeDataValue: defaultContext.strokeColorConfig
|
|
1649
1877
|
}
|
|
1650
1878
|
}, {
|
|
1651
|
-
label: i18n_1._('Matches'),
|
|
1879
|
+
label: (0, i18n_1._)('Matches'),
|
|
1652
1880
|
value: 'matchValue',
|
|
1653
1881
|
defaults: {
|
|
1654
1882
|
strokeDataValue: defaultContext.strokeColorMatchConfig
|
|
1655
1883
|
}
|
|
1656
1884
|
}],
|
|
1657
1885
|
dataSelectors: [{
|
|
1658
|
-
label: i18n_1._('Stroke'),
|
|
1886
|
+
label: (0, i18n_1._)('Stroke'),
|
|
1659
1887
|
value: 'strokeDataValue'
|
|
1660
1888
|
}],
|
|
1661
1889
|
defaultPalettesConfig: defaultPalettesConfig
|
|
1662
1890
|
}
|
|
1663
1891
|
};
|
|
1664
1892
|
};
|
|
1893
|
+
|
|
1665
1894
|
exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
|
|
1666
1895
|
|
|
1667
1896
|
/***/ }),
|
|
1668
|
-
/*
|
|
1897
|
+
/* 116 */
|
|
1669
1898
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1670
1899
|
|
|
1671
1900
|
"use strict";
|
|
@@ -1674,21 +1903,24 @@ exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
|
|
|
1674
1903
|
Object.defineProperty(exports, "__esModule", {
|
|
1675
1904
|
value: true
|
|
1676
1905
|
});
|
|
1906
|
+
|
|
1677
1907
|
var i18n_1 = __webpack_require__(2);
|
|
1908
|
+
|
|
1678
1909
|
var configUtils_1 = __webpack_require__(22);
|
|
1910
|
+
|
|
1679
1911
|
var StaticFillColorEditor = {
|
|
1680
|
-
label: i18n_1._('Fill'),
|
|
1912
|
+
label: (0, i18n_1._)('Fill'),
|
|
1681
1913
|
option: 'fillColor',
|
|
1682
1914
|
editor: 'editor.color',
|
|
1683
1915
|
showEditor: function showEditor(_ref) {
|
|
1684
1916
|
var options = _ref.options;
|
|
1685
|
-
return !configUtils_1.isDynamicOption(options.fillColor);
|
|
1917
|
+
return !(0, configUtils_1.isDynamicOption)(options.fillColor);
|
|
1686
1918
|
}
|
|
1687
1919
|
};
|
|
1688
1920
|
exports.default = StaticFillColorEditor;
|
|
1689
1921
|
|
|
1690
1922
|
/***/ }),
|
|
1691
|
-
/*
|
|
1923
|
+
/* 117 */
|
|
1692
1924
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1693
1925
|
|
|
1694
1926
|
"use strict";
|
|
@@ -1697,36 +1929,49 @@ exports.default = StaticFillColorEditor;
|
|
|
1697
1929
|
Object.defineProperty(exports, "__esModule", {
|
|
1698
1930
|
value: true
|
|
1699
1931
|
});
|
|
1932
|
+
|
|
1700
1933
|
var i18n_1 = __webpack_require__(2);
|
|
1934
|
+
|
|
1701
1935
|
var configUtils_1 = __webpack_require__(22);
|
|
1936
|
+
|
|
1702
1937
|
var StaticStrokeColorEditor = {
|
|
1703
|
-
label: i18n_1._('Stroke'),
|
|
1938
|
+
label: (0, i18n_1._)('Stroke'),
|
|
1704
1939
|
option: 'strokeColor',
|
|
1705
1940
|
editor: 'editor.color',
|
|
1706
1941
|
showEditor: function showEditor(_ref) {
|
|
1707
1942
|
var options = _ref.options;
|
|
1708
|
-
return !configUtils_1.isDynamicOption(options.strokeColor);
|
|
1943
|
+
return !(0, configUtils_1.isDynamicOption)(options.strokeColor);
|
|
1709
1944
|
}
|
|
1710
1945
|
};
|
|
1711
1946
|
exports.default = StaticStrokeColorEditor;
|
|
1712
1947
|
|
|
1713
1948
|
/***/ }),
|
|
1714
|
-
/*
|
|
1949
|
+
/* 118 */
|
|
1715
1950
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1716
1951
|
|
|
1717
1952
|
"use strict";
|
|
1718
1953
|
|
|
1719
1954
|
|
|
1955
|
+
var _taggedTemplateLiteral = __webpack_require__(59);
|
|
1956
|
+
|
|
1957
|
+
var _templateObject;
|
|
1958
|
+
|
|
1720
1959
|
Object.defineProperty(exports, "__esModule", {
|
|
1721
1960
|
value: true
|
|
1722
1961
|
});
|
|
1723
1962
|
exports.getStyledShape = exports.mapToOldKey = void 0;
|
|
1963
|
+
|
|
1724
1964
|
var lodash_1 = __webpack_require__(3);
|
|
1965
|
+
|
|
1725
1966
|
var styled_components_1 = __webpack_require__(4);
|
|
1967
|
+
|
|
1726
1968
|
var pick_1 = __webpack_require__(23);
|
|
1969
|
+
|
|
1727
1970
|
var variables_1 = __webpack_require__(11);
|
|
1728
|
-
|
|
1729
|
-
// map for new options names to old option names
|
|
1971
|
+
|
|
1972
|
+
var propUtils_1 = __webpack_require__(29); // map for new options names to old option names
|
|
1973
|
+
|
|
1974
|
+
|
|
1730
1975
|
var shapeOptionsMapping = {
|
|
1731
1976
|
fillColor: 'fill',
|
|
1732
1977
|
strokeColor: 'stroke',
|
|
@@ -1739,23 +1984,23 @@ var shapeOptionsMapping = {
|
|
|
1739
1984
|
* @param {Object} options
|
|
1740
1985
|
* @returns {Object}
|
|
1741
1986
|
*/
|
|
1987
|
+
|
|
1742
1988
|
var mapToOldKey = function mapToOldKey(options) {
|
|
1743
|
-
return lodash_1.mapKeys(options, function (val, key) {
|
|
1989
|
+
return (0, lodash_1.mapKeys)(options, function (val, key) {
|
|
1744
1990
|
return shapeOptionsMapping[key] ? shapeOptionsMapping[key] : key;
|
|
1745
1991
|
});
|
|
1746
1992
|
};
|
|
1993
|
+
|
|
1747
1994
|
exports.mapToOldKey = mapToOldKey;
|
|
1748
1995
|
/**
|
|
1749
1996
|
* Helper method to get styled component for ellipse or rectangle
|
|
1750
1997
|
* @method mapToOldKey
|
|
1751
1998
|
* @param {Shape} shape
|
|
1752
1999
|
*/
|
|
2000
|
+
|
|
1753
2001
|
var getStyledShape = function getStyledShape(shape) {
|
|
1754
|
-
return styled_components_1.default(shape)
|
|
1755
|
-
|
|
1756
|
-
componentId: "sc-1myvp5h-0"
|
|
1757
|
-
})(["fill:", ";stroke:", ";cursor:", ";"], function (props) {
|
|
1758
|
-
return props.fill && propUtils_1.formatColor(props.fill) || pick_1.default({
|
|
2002
|
+
return (0, styled_components_1.default)(shape)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fill: ", ";\n stroke: ", ";\n cursor: ", ";\n"])), function (props) {
|
|
2003
|
+
return props.fill && (0, propUtils_1.formatColor)(props.fill) || (0, pick_1.default)({
|
|
1759
2004
|
enterprise: {
|
|
1760
2005
|
light: variables_1.default.gray80,
|
|
1761
2006
|
dark: variables_1.default.gray25
|
|
@@ -1763,7 +2008,7 @@ var getStyledShape = function getStyledShape(shape) {
|
|
|
1763
2008
|
prisma: variables_1.default.backgroundColorSidebar
|
|
1764
2009
|
})(props);
|
|
1765
2010
|
}, function (props) {
|
|
1766
|
-
return props.stroke && propUtils_1.formatColor(props.stroke) || pick_1.default({
|
|
2011
|
+
return props.stroke && (0, propUtils_1.formatColor)(props.stroke) || (0, pick_1.default)({
|
|
1767
2012
|
enterprise: {
|
|
1768
2013
|
dark: variables_1.default.gray80,
|
|
1769
2014
|
light: variables_1.default.textColor
|
|
@@ -1774,10 +2019,10 @@ var getStyledShape = function getStyledShape(shape) {
|
|
|
1774
2019
|
return props.onClick ? 'pointer' : 'inherit';
|
|
1775
2020
|
});
|
|
1776
2021
|
};
|
|
2022
|
+
|
|
1777
2023
|
exports.getStyledShape = getStyledShape;
|
|
1778
2024
|
|
|
1779
2025
|
/***/ }),
|
|
1780
|
-
/* 118 */,
|
|
1781
2026
|
/* 119 */,
|
|
1782
2027
|
/* 120 */,
|
|
1783
2028
|
/* 121 */,
|
|
@@ -1805,7 +2050,10 @@ exports.getStyledShape = getStyledShape;
|
|
|
1805
2050
|
/* 143 */,
|
|
1806
2051
|
/* 144 */,
|
|
1807
2052
|
/* 145 */,
|
|
1808
|
-
/* 146
|
|
2053
|
+
/* 146 */,
|
|
2054
|
+
/* 147 */,
|
|
2055
|
+
/* 148 */,
|
|
2056
|
+
/* 149 */
|
|
1809
2057
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1810
2058
|
|
|
1811
2059
|
"use strict";
|
|
@@ -1813,26 +2061,38 @@ exports.getStyledShape = getStyledShape;
|
|
|
1813
2061
|
|
|
1814
2062
|
var __rest = this && this.__rest || function (s, e) {
|
|
1815
2063
|
var t = {};
|
|
2064
|
+
|
|
1816
2065
|
for (var p in s) {
|
|
1817
2066
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
1818
2067
|
}
|
|
2068
|
+
|
|
1819
2069
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1820
2070
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
1821
2071
|
}
|
|
1822
2072
|
return t;
|
|
1823
2073
|
};
|
|
2074
|
+
|
|
1824
2075
|
Object.defineProperty(exports, "__esModule", {
|
|
1825
2076
|
value: true
|
|
1826
2077
|
});
|
|
1827
2078
|
exports.config = exports.themes = void 0;
|
|
2079
|
+
|
|
1828
2080
|
var React = __webpack_require__(1);
|
|
2081
|
+
|
|
1829
2082
|
var lodash_1 = __webpack_require__(3);
|
|
2083
|
+
|
|
1830
2084
|
var styled_components_1 = __webpack_require__(4);
|
|
2085
|
+
|
|
1831
2086
|
var T = __webpack_require__(0);
|
|
1832
|
-
|
|
2087
|
+
|
|
2088
|
+
var config_1 = __webpack_require__(201);
|
|
2089
|
+
|
|
1833
2090
|
exports.config = config_1.default;
|
|
1834
|
-
|
|
1835
|
-
var
|
|
2091
|
+
|
|
2092
|
+
var withDashboardViz_1 = __webpack_require__(37);
|
|
2093
|
+
|
|
2094
|
+
var shapeUtils_1 = __webpack_require__(118);
|
|
2095
|
+
|
|
1836
2096
|
var validOptions = Object.keys(config_1.default.optionsSchema);
|
|
1837
2097
|
var SVGContainer = styled_components_1.default.svg.withConfig({
|
|
1838
2098
|
displayName: "Ellipse__SVGContainer",
|
|
@@ -1842,12 +2102,13 @@ var SVGContainer = styled_components_1.default.svg.withConfig({
|
|
|
1842
2102
|
}, function (props) {
|
|
1843
2103
|
return props.height;
|
|
1844
2104
|
});
|
|
1845
|
-
var EllipseShape = shapeUtils_1.getStyledShape('ellipse');
|
|
2105
|
+
var EllipseShape = (0, shapeUtils_1.getStyledShape)('ellipse');
|
|
2106
|
+
|
|
1846
2107
|
var EllipseVisualization = function EllipseVisualization(_ref) {
|
|
1847
2108
|
var height = _ref.height,
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
2109
|
+
width = _ref.width,
|
|
2110
|
+
onEllipseClick = _ref.onEllipseClick,
|
|
2111
|
+
options = _ref.options;
|
|
1851
2112
|
return React.createElement(SVGContainer, {
|
|
1852
2113
|
width: width,
|
|
1853
2114
|
height: height
|
|
@@ -1861,17 +2122,20 @@ var EllipseVisualization = function EllipseVisualization(_ref) {
|
|
|
1861
2122
|
onClick: onEllipseClick
|
|
1862
2123
|
})));
|
|
1863
2124
|
};
|
|
2125
|
+
|
|
1864
2126
|
var computeVizProps = function computeVizProps(_a) {
|
|
1865
2127
|
var width = _a.width,
|
|
1866
|
-
|
|
1867
|
-
|
|
2128
|
+
height = _a.height,
|
|
2129
|
+
options = __rest(_a, ["width", "height"]);
|
|
2130
|
+
|
|
1868
2131
|
var computedProps = {
|
|
1869
2132
|
width: width,
|
|
1870
2133
|
height: height
|
|
1871
2134
|
};
|
|
1872
|
-
computedProps.options = lodash_1.chain(options).pick(validOptions).thru(shapeUtils_1.mapToOldKey).value();
|
|
2135
|
+
computedProps.options = (0, lodash_1.chain)(options).pick(validOptions).thru(shapeUtils_1.mapToOldKey).value();
|
|
1873
2136
|
return computedProps;
|
|
1874
2137
|
};
|
|
2138
|
+
|
|
1875
2139
|
var propTypes = {
|
|
1876
2140
|
width: T.oneOfType([T.string, T.number]),
|
|
1877
2141
|
height: T.oneOfType([T.string, T.number]),
|
|
@@ -1886,7 +2150,7 @@ var defaultProps = {
|
|
|
1886
2150
|
};
|
|
1887
2151
|
EllipseVisualization.propTypes = propTypes;
|
|
1888
2152
|
EllipseVisualization.defaultProps = defaultProps;
|
|
1889
|
-
var Ellipse = withDashboardViz_1.default({
|
|
2153
|
+
var Ellipse = (0, withDashboardViz_1.default)({
|
|
1890
2154
|
ReactViz: EllipseVisualization,
|
|
1891
2155
|
computeVizProps: computeVizProps,
|
|
1892
2156
|
vizConfig: config_1.default
|
|
@@ -1896,9 +2160,6 @@ exports.themes = themes;
|
|
|
1896
2160
|
exports.default = Ellipse;
|
|
1897
2161
|
|
|
1898
2162
|
/***/ }),
|
|
1899
|
-
/* 147 */,
|
|
1900
|
-
/* 148 */,
|
|
1901
|
-
/* 149 */,
|
|
1902
2163
|
/* 150 */,
|
|
1903
2164
|
/* 151 */,
|
|
1904
2165
|
/* 152 */,
|
|
@@ -1946,7 +2207,10 @@ exports.default = Ellipse;
|
|
|
1946
2207
|
/* 194 */,
|
|
1947
2208
|
/* 195 */,
|
|
1948
2209
|
/* 196 */,
|
|
1949
|
-
/* 197
|
|
2210
|
+
/* 197 */,
|
|
2211
|
+
/* 198 */,
|
|
2212
|
+
/* 199 */,
|
|
2213
|
+
/* 200 */
|
|
1950
2214
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1951
2215
|
|
|
1952
2216
|
"use strict";
|
|
@@ -1954,27 +2218,38 @@ exports.default = Ellipse;
|
|
|
1954
2218
|
|
|
1955
2219
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1956
2220
|
if (k2 === undefined) k2 = k;
|
|
1957
|
-
Object.
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
2221
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2222
|
+
|
|
2223
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2224
|
+
desc = {
|
|
2225
|
+
enumerable: true,
|
|
2226
|
+
get: function get() {
|
|
2227
|
+
return m[k];
|
|
2228
|
+
}
|
|
2229
|
+
};
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
Object.defineProperty(o, k2, desc);
|
|
1963
2233
|
} : function (o, m, k, k2) {
|
|
1964
2234
|
if (k2 === undefined) k2 = k;
|
|
1965
2235
|
o[k2] = m[k];
|
|
1966
2236
|
});
|
|
2237
|
+
|
|
1967
2238
|
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
1968
2239
|
for (var p in m) {
|
|
1969
2240
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1970
2241
|
}
|
|
1971
2242
|
};
|
|
2243
|
+
|
|
1972
2244
|
Object.defineProperty(exports, "__esModule", {
|
|
1973
2245
|
value: true
|
|
1974
2246
|
});
|
|
1975
2247
|
exports.default = void 0;
|
|
1976
|
-
|
|
1977
|
-
|
|
2248
|
+
|
|
2249
|
+
__exportStar(__webpack_require__(149), exports);
|
|
2250
|
+
|
|
2251
|
+
var Ellipse_1 = __webpack_require__(149);
|
|
2252
|
+
|
|
1978
2253
|
Object.defineProperty(exports, "default", {
|
|
1979
2254
|
enumerable: true,
|
|
1980
2255
|
get: function get() {
|
|
@@ -1983,7 +2258,7 @@ Object.defineProperty(exports, "default", {
|
|
|
1983
2258
|
});
|
|
1984
2259
|
|
|
1985
2260
|
/***/ }),
|
|
1986
|
-
/*
|
|
2261
|
+
/* 201 */
|
|
1987
2262
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1988
2263
|
|
|
1989
2264
|
"use strict";
|
|
@@ -1992,17 +2267,29 @@ Object.defineProperty(exports, "default", {
|
|
|
1992
2267
|
Object.defineProperty(exports, "__esModule", {
|
|
1993
2268
|
value: true
|
|
1994
2269
|
});
|
|
2270
|
+
|
|
1995
2271
|
var i18n_1 = __webpack_require__(2);
|
|
1996
|
-
|
|
2272
|
+
|
|
2273
|
+
var PresetPalettes_1 = __webpack_require__(61);
|
|
2274
|
+
|
|
1997
2275
|
var pick_1 = __webpack_require__(23);
|
|
2276
|
+
|
|
1998
2277
|
var variables_1 = __webpack_require__(11);
|
|
2278
|
+
|
|
1999
2279
|
var VizBehavior_1 = __webpack_require__(6);
|
|
2000
|
-
|
|
2280
|
+
|
|
2281
|
+
var VizCategory_1 = __webpack_require__(36);
|
|
2282
|
+
|
|
2001
2283
|
var configUtils_1 = __webpack_require__(20);
|
|
2002
|
-
|
|
2003
|
-
var
|
|
2004
|
-
|
|
2005
|
-
var
|
|
2284
|
+
|
|
2285
|
+
var DynamicFillColorEditor_1 = __webpack_require__(114);
|
|
2286
|
+
|
|
2287
|
+
var DynamicStrokeColorEditor_1 = __webpack_require__(115);
|
|
2288
|
+
|
|
2289
|
+
var StaticFillColorEditor_1 = __webpack_require__(116);
|
|
2290
|
+
|
|
2291
|
+
var StaticStrokeColorEditor_1 = __webpack_require__(117);
|
|
2292
|
+
|
|
2006
2293
|
var dataContract = {
|
|
2007
2294
|
requiredDataSources: [],
|
|
2008
2295
|
optionalDataSources: [{
|
|
@@ -2118,7 +2405,7 @@ var optionsSchema = {
|
|
|
2118
2405
|
};
|
|
2119
2406
|
var themes = {
|
|
2120
2407
|
defaultFillColor: function defaultFillColor(props) {
|
|
2121
|
-
return pick_1.default({
|
|
2408
|
+
return (0, pick_1.default)({
|
|
2122
2409
|
enterprise: {
|
|
2123
2410
|
dark: variables_1.default.gray25(props),
|
|
2124
2411
|
light: variables_1.default.gray80(props)
|
|
@@ -2127,7 +2414,7 @@ var themes = {
|
|
|
2127
2414
|
})(props);
|
|
2128
2415
|
},
|
|
2129
2416
|
defaultStrokeColor: function defaultStrokeColor(props) {
|
|
2130
|
-
return pick_1.default({
|
|
2417
|
+
return (0, pick_1.default)({
|
|
2131
2418
|
enterprise: {
|
|
2132
2419
|
dark: variables_1.default.gray80(props),
|
|
2133
2420
|
light: variables_1.default.gray30(props)
|
|
@@ -2146,14 +2433,14 @@ var basePresetOptions = {
|
|
|
2146
2433
|
};
|
|
2147
2434
|
var presets = [{
|
|
2148
2435
|
// dummy context variables to allow for resetting of unused context states
|
|
2149
|
-
label: i18n_1._('None'),
|
|
2436
|
+
label: (0, i18n_1._)('None'),
|
|
2150
2437
|
name: 'ellipse.none',
|
|
2151
2438
|
value: {
|
|
2152
2439
|
context: Object.assign({}, basePresetContext),
|
|
2153
2440
|
options: Object.assign({}, basePresetOptions)
|
|
2154
2441
|
}
|
|
2155
2442
|
}, {
|
|
2156
|
-
label: i18n_1._('Fill'),
|
|
2443
|
+
label: (0, i18n_1._)('Fill'),
|
|
2157
2444
|
name: 'ellipse.fill',
|
|
2158
2445
|
value: {
|
|
2159
2446
|
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
@@ -2165,7 +2452,7 @@ var presets = [{
|
|
|
2165
2452
|
})
|
|
2166
2453
|
}
|
|
2167
2454
|
}, {
|
|
2168
|
-
label: i18n_1._('Stroke'),
|
|
2455
|
+
label: (0, i18n_1._)('Stroke'),
|
|
2169
2456
|
name: 'ellipse.stroke',
|
|
2170
2457
|
value: {
|
|
2171
2458
|
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
@@ -2177,7 +2464,7 @@ var presets = [{
|
|
|
2177
2464
|
})
|
|
2178
2465
|
}
|
|
2179
2466
|
}, {
|
|
2180
|
-
label: i18n_1._('Fill and Stroke'),
|
|
2467
|
+
label: (0, i18n_1._)('Fill and Stroke'),
|
|
2181
2468
|
name: 'ellipse.fillAndStroke',
|
|
2182
2469
|
value: {
|
|
2183
2470
|
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
@@ -2193,17 +2480,17 @@ var presets = [{
|
|
|
2193
2480
|
}
|
|
2194
2481
|
}];
|
|
2195
2482
|
var editorConfig = [{
|
|
2196
|
-
label: i18n_1._('Color and style'),
|
|
2483
|
+
label: (0, i18n_1._)('Color and style'),
|
|
2197
2484
|
layout: [[{
|
|
2198
|
-
label: i18n_1._('Dynamic elements'),
|
|
2485
|
+
label: (0, i18n_1._)('Dynamic elements'),
|
|
2199
2486
|
key: 'presetSelector',
|
|
2200
2487
|
editor: 'editor.presetSelector',
|
|
2201
2488
|
editorProps: {
|
|
2202
2489
|
presets: presets,
|
|
2203
2490
|
value: function value(_ref) {
|
|
2204
2491
|
var context = _ref.context,
|
|
2205
|
-
|
|
2206
|
-
var initialPreset = configUtils_1.getInitialPreset(context, options, presets);
|
|
2492
|
+
options = _ref.options;
|
|
2493
|
+
var initialPreset = (0, configUtils_1.getInitialPreset)(context, options, presets);
|
|
2207
2494
|
return initialPreset && initialPreset.label || null;
|
|
2208
2495
|
}
|
|
2209
2496
|
}
|
|
@@ -2211,39 +2498,39 @@ var editorConfig = [{
|
|
|
2211
2498
|
editorProps: {
|
|
2212
2499
|
themes: themes
|
|
2213
2500
|
}
|
|
2214
|
-
})], [DynamicFillColorEditor_1.getDynamicFillColorEditor({
|
|
2501
|
+
})], [(0, DynamicFillColorEditor_1.getDynamicFillColorEditor)({
|
|
2215
2502
|
defaultContext: defaultContext,
|
|
2216
2503
|
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
2217
2504
|
})], [Object.assign(Object.assign({}, StaticStrokeColorEditor_1.default), {
|
|
2218
2505
|
editorProps: {
|
|
2219
2506
|
themes: themes
|
|
2220
2507
|
}
|
|
2221
|
-
})], [DynamicStrokeColorEditor_1.getDynamicStrokeColorEditor({
|
|
2508
|
+
})], [(0, DynamicStrokeColorEditor_1.getDynamicStrokeColorEditor)({
|
|
2222
2509
|
defaultContext: defaultContext,
|
|
2223
2510
|
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
2224
2511
|
})], [{
|
|
2225
|
-
label: i18n_1._('Fill opacity (%)'),
|
|
2512
|
+
label: (0, i18n_1._)('Fill opacity (%)'),
|
|
2226
2513
|
option: 'fillOpacity',
|
|
2227
2514
|
editor: 'editor.percent',
|
|
2228
2515
|
editorProps: {
|
|
2229
2516
|
min: 0
|
|
2230
2517
|
}
|
|
2231
2518
|
}, {
|
|
2232
|
-
label: i18n_1._('Stroke opacity (%)'),
|
|
2519
|
+
label: (0, i18n_1._)('Stroke opacity (%)'),
|
|
2233
2520
|
option: 'strokeOpacity',
|
|
2234
2521
|
editor: 'editor.percent',
|
|
2235
2522
|
editorProps: {
|
|
2236
2523
|
min: 0
|
|
2237
2524
|
}
|
|
2238
2525
|
}], [{
|
|
2239
|
-
label: i18n_1._('Stroke width'),
|
|
2526
|
+
label: (0, i18n_1._)('Stroke width'),
|
|
2240
2527
|
option: 'strokeWidth',
|
|
2241
2528
|
editor: 'editor.number',
|
|
2242
2529
|
editorProps: {
|
|
2243
2530
|
min: 0
|
|
2244
2531
|
}
|
|
2245
2532
|
}, {
|
|
2246
|
-
label: i18n_1._('Stroke dash style'),
|
|
2533
|
+
label: (0, i18n_1._)('Stroke dash style'),
|
|
2247
2534
|
option: 'strokeDashStyle',
|
|
2248
2535
|
editor: 'editor.number',
|
|
2249
2536
|
editorProps: {
|
|
@@ -2254,16 +2541,19 @@ var editorConfig = [{
|
|
|
2254
2541
|
/**
|
|
2255
2542
|
* visualization configuration
|
|
2256
2543
|
*/
|
|
2544
|
+
|
|
2257
2545
|
var config = {
|
|
2258
2546
|
/**
|
|
2259
2547
|
* unique viz key
|
|
2260
2548
|
*/
|
|
2261
2549
|
key: 'splunk.ellipse',
|
|
2550
|
+
|
|
2262
2551
|
/**
|
|
2263
2552
|
* viz name
|
|
2264
2553
|
*/
|
|
2265
|
-
name: i18n_1._('Ellipse'),
|
|
2554
|
+
name: (0, i18n_1._)('Ellipse'),
|
|
2266
2555
|
category: VizCategory_1.VizCategory.SHAPES,
|
|
2556
|
+
|
|
2267
2557
|
/**
|
|
2268
2558
|
* viz icon
|
|
2269
2559
|
*/
|
|
@@ -2282,7 +2572,7 @@ var config = {
|
|
|
2282
2572
|
supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS],
|
|
2283
2573
|
themes: themes
|
|
2284
2574
|
};
|
|
2285
|
-
exports.default = configUtils_1.enhanceConfig(config);
|
|
2575
|
+
exports.default = (0, configUtils_1.enhanceConfig)(config);
|
|
2286
2576
|
|
|
2287
2577
|
/***/ })
|
|
2288
2578
|
/******/ ]);
|