@splunk/visualizations 26.0.0 → 26.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +102 -18
- package/Area.config.js.map +1 -1
- package/Area.js +618 -221
- package/Area.js.map +1 -1
- package/Bar.config.js +104 -20
- package/Bar.config.js.map +1 -1
- package/Bar.js +624 -219
- package/Bar.js.map +1 -1
- package/Bubble.config.js +94 -20
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +606 -211
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +65 -14
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +550 -183
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +103 -18
- package/Column.config.js.map +1 -1
- package/Column.js +637 -221
- package/Column.js.map +1 -1
- package/Ellipse.config.js +82 -17
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +425 -148
- package/Ellipse.js.map +1 -1
- package/Events.config.js +100 -18
- package/Events.config.js.map +1 -1
- package/Events.js +752 -293
- package/Events.js.map +1 -1
- package/FillerGauge.config.js +96 -27
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +759 -374
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +62 -18
- package/Image.config.js.map +1 -1
- package/Image.js +419 -154
- package/Image.js.map +1 -1
- package/Line.config.js +106 -22
- package/Line.config.js.map +1 -1
- package/Line.js +631 -223
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +72 -22
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +632 -219
- package/LinkGraph.js.map +1 -1
- package/MIGRATION.md +1082 -0
- package/Map.config.js +241 -97
- package/Map.config.js.map +1 -1
- package/Map.js +1195 -595
- package/Map.js.map +1 -1
- package/Markdown.config.js +70 -20
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +460 -195
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +79 -21
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +802 -411
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +72 -18
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +853 -484
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +75 -22
- package/Pie.config.js.map +1 -1
- package/Pie.js +612 -212
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +81 -29
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +844 -379
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +85 -19
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +432 -152
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +84 -22
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +878 -342
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +96 -22
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +607 -212
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +94 -24
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +1182 -650
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +286 -225
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +92 -22
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +965 -506
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +99 -26
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +1167 -616
- package/SingleValueRadial.js.map +1 -1
- package/SparkLine.js +126 -67
- package/SparkLine.js.map +1 -1
- package/Table.config.js +73 -20
- package/Table.config.js.map +1 -1
- package/Table.js +810 -322
- package/Table.js.map +1 -1
- package/common/Charting.js +107 -35
- package/common/Charting.js.map +1 -1
- package/common/ChartingApi.js +18 -7
- package/common/ChartingApi.js.map +1 -1
- package/common/EventsDoc.js +76 -22
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +68 -58
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +43 -34
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +156 -65
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js +33 -5
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.js +31 -4
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +8 -2
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemesDoc.js +27 -14
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +44 -12
- package/common/chartingUtils.js.map +1 -1
- package/common/docUtils.js +11 -1
- package/common/docUtils.js.map +1 -1
- package/common/gaugeUtils.js +173 -90
- package/common/gaugeUtils.js.map +1 -1
- package/common/shapeUtils.js +14 -2
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/configUtils.js +49 -14
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/dataUtils.js +7 -2
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/hocUtils.js +3 -1
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/layoutUtils.js +1 -0
- package/common/utils/layoutUtils.js.map +1 -1
- package/common/utils/mapUtils.js +287 -127
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +241 -196
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +9 -0
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +61 -0
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +2 -0
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +274 -95
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +16 -18
package/Markdown.js
CHANGED
|
@@ -157,11 +157,17 @@ module.exports = require("@splunk/react-ui/Heading");
|
|
|
157
157
|
Object.defineProperty(exports, "__esModule", {
|
|
158
158
|
value: true
|
|
159
159
|
});
|
|
160
|
+
|
|
160
161
|
var React = __webpack_require__(1);
|
|
162
|
+
|
|
161
163
|
var styled_components_1 = __webpack_require__(4);
|
|
164
|
+
|
|
162
165
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
166
|
+
|
|
163
167
|
var style_1 = __webpack_require__(14);
|
|
168
|
+
|
|
164
169
|
var colorUtils_1 = __webpack_require__(12);
|
|
170
|
+
|
|
165
171
|
var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
166
172
|
var width = _ref.width;
|
|
167
173
|
return {
|
|
@@ -174,11 +180,11 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
|
174
180
|
componentId: "sc-1yhgpod-0"
|
|
175
181
|
})(["position:relative;background-color:", "};"], function (props) {
|
|
176
182
|
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
177
|
-
});
|
|
178
|
-
|
|
183
|
+
}); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
|
|
184
|
+
|
|
179
185
|
var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
|
|
180
186
|
var width = _ref2.width,
|
|
181
|
-
|
|
187
|
+
height = _ref2.height;
|
|
182
188
|
return {
|
|
183
189
|
style: Object.assign(Object.assign({}, width && {
|
|
184
190
|
width: (0, style_1.toPx)(width)
|
|
@@ -200,11 +206,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
|
|
|
200
206
|
displayName: "FixedSizeContainer__FixSizeItemContent",
|
|
201
207
|
componentId: "sc-1yhgpod-3"
|
|
202
208
|
})(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
|
|
209
|
+
|
|
203
210
|
var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
204
211
|
var FixedSizeContainer = function FixedSizeContainer(props) {
|
|
205
212
|
var width = props.width,
|
|
206
|
-
|
|
207
|
-
|
|
213
|
+
height = props.height,
|
|
214
|
+
backgroundColor = props.backgroundColor;
|
|
215
|
+
|
|
208
216
|
if (!height) {
|
|
209
217
|
return React.createElement(Item, {
|
|
210
218
|
"data-test": "item",
|
|
@@ -212,24 +220,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
212
220
|
backgroundColor: backgroundColor
|
|
213
221
|
}, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
|
|
214
222
|
}
|
|
223
|
+
|
|
215
224
|
return React.createElement(FixSizeItem, {
|
|
216
225
|
"data-test": "fix-size-item",
|
|
217
|
-
"data-splunk-visualization-version": "26.
|
|
226
|
+
"data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
|
|
218
227
|
width: width,
|
|
219
228
|
height: height,
|
|
220
229
|
backgroundColor: backgroundColor
|
|
221
230
|
}, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
|
|
222
231
|
var newWidth = _ref3.width,
|
|
223
|
-
|
|
232
|
+
newHeight = _ref3.height;
|
|
224
233
|
return React.createElement(Viz, Object.assign({}, props, {
|
|
225
234
|
width: newWidth,
|
|
226
235
|
height: newHeight
|
|
227
236
|
}));
|
|
228
237
|
})));
|
|
229
238
|
};
|
|
239
|
+
|
|
230
240
|
FixedSizeContainer.displayName = 'withFixedSizeContainer';
|
|
231
241
|
return FixedSizeContainer;
|
|
232
242
|
};
|
|
243
|
+
|
|
233
244
|
exports.default = withFixedSizeContainer;
|
|
234
245
|
|
|
235
246
|
/***/ }),
|
|
@@ -257,9 +268,10 @@ exports.extendStaticWrapperProps = void 0;
|
|
|
257
268
|
* @param {DashboardVizType} props.Wrapper
|
|
258
269
|
* @param {DashboardVizType} props.Visualization
|
|
259
270
|
*/
|
|
271
|
+
|
|
260
272
|
var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
261
273
|
var Wrapper = _ref.Wrapper,
|
|
262
|
-
|
|
274
|
+
Visualization = _ref.Visualization;
|
|
263
275
|
var extendProperties = ['propTypes', 'defaultProps', 'config'];
|
|
264
276
|
extendProperties.forEach(function (prop) {
|
|
265
277
|
if (Visualization[prop]) {
|
|
@@ -268,6 +280,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
268
280
|
}
|
|
269
281
|
});
|
|
270
282
|
};
|
|
283
|
+
|
|
271
284
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
272
285
|
|
|
273
286
|
/***/ }),
|
|
@@ -286,27 +299,44 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
|
286
299
|
|
|
287
300
|
|
|
288
301
|
var _taggedTemplateLiteral = __webpack_require__(59);
|
|
302
|
+
|
|
289
303
|
var _templateObject;
|
|
304
|
+
|
|
290
305
|
Object.defineProperty(exports, "__esModule", {
|
|
291
306
|
value: true
|
|
292
307
|
});
|
|
293
308
|
exports.getFontMap = exports.config = exports.themes = exports.computeVizProps = exports.FONT_SIZES = void 0;
|
|
309
|
+
|
|
294
310
|
var lodash_1 = __webpack_require__(3);
|
|
295
|
-
|
|
311
|
+
|
|
312
|
+
var types_1 = __webpack_require__(83);
|
|
313
|
+
|
|
296
314
|
var React = __webpack_require__(1);
|
|
315
|
+
|
|
297
316
|
var style_1 = __webpack_require__(14);
|
|
317
|
+
|
|
298
318
|
var Markdown_1 = __webpack_require__(122);
|
|
319
|
+
|
|
299
320
|
var styled_components_1 = __webpack_require__(4);
|
|
321
|
+
|
|
300
322
|
var T = __webpack_require__(0);
|
|
323
|
+
|
|
301
324
|
var themes_1 = __webpack_require__(60);
|
|
325
|
+
|
|
302
326
|
var Heading_1 = __webpack_require__(125);
|
|
327
|
+
|
|
303
328
|
var Paragraph_1 = __webpack_require__(110);
|
|
329
|
+
|
|
304
330
|
var List_1 = __webpack_require__(424);
|
|
331
|
+
|
|
305
332
|
var Code_1 = __webpack_require__(425);
|
|
306
|
-
|
|
333
|
+
|
|
334
|
+
var withDashboardViz_1 = __webpack_require__(37);
|
|
335
|
+
|
|
307
336
|
var config_1 = __webpack_require__(426);
|
|
308
|
-
|
|
309
|
-
// map of valid font sizes with elements' respective pixel sizes
|
|
337
|
+
|
|
338
|
+
exports.config = config_1.default; // map of valid font sizes with elements' respective pixel sizes
|
|
339
|
+
|
|
310
340
|
exports.FONT_SIZES = {
|
|
311
341
|
extraSmall: {
|
|
312
342
|
h1: 18,
|
|
@@ -338,12 +368,12 @@ exports.FONT_SIZES = {
|
|
|
338
368
|
h3: 24,
|
|
339
369
|
p: 18
|
|
340
370
|
}
|
|
341
|
-
};
|
|
342
|
-
// startsWithHeader is a prop that can be
|
|
371
|
+
}; // startsWithHeader is a prop that can be
|
|
343
372
|
// falsy if the markdown text begins with text
|
|
344
373
|
// or the number of heading level;
|
|
345
374
|
// casting heading level below 4 to 4
|
|
346
375
|
// because ReactMarkdown supports heading level 1-4
|
|
376
|
+
|
|
347
377
|
var MarkdownContainer = styled_components_1.default.div.withConfig({
|
|
348
378
|
displayName: "Markdown__MarkdownContainer",
|
|
349
379
|
componentId: "zd3qkg-0"
|
|
@@ -390,31 +420,37 @@ var CodeInlineContainer = styled_components_1.default.code.withConfig({
|
|
|
390
420
|
dark: themes_1.variables.gray22
|
|
391
421
|
},
|
|
392
422
|
prisma: themes_1.variables.neutral200
|
|
393
|
-
}));
|
|
394
|
-
// retrieves the font map associated with a valid `fontSize` value. If the fontSize
|
|
423
|
+
})); // retrieves the font map associated with a valid `fontSize` value. If the fontSize
|
|
395
424
|
// passed is invalid (does not exist in FONT_SIZES), the `default` value is used.
|
|
425
|
+
|
|
396
426
|
var getFontMap = function getFontMap(fontSize) {
|
|
397
427
|
var font = fontSize;
|
|
428
|
+
|
|
398
429
|
if (!exports.FONT_SIZES[fontSize] && fontSize !== 'custom') {
|
|
399
430
|
console.error("'".concat(fontSize, "' is not a valid value for Markdown's fontSize option. Using the 'default' font size."));
|
|
400
431
|
font = 'default';
|
|
401
432
|
}
|
|
433
|
+
|
|
402
434
|
return exports.FONT_SIZES[font];
|
|
403
435
|
};
|
|
436
|
+
|
|
404
437
|
exports.getFontMap = getFontMap;
|
|
438
|
+
|
|
405
439
|
var handleLinkClick = function handleLinkClick(e) {
|
|
406
440
|
return e.stopPropagation();
|
|
407
441
|
};
|
|
442
|
+
|
|
408
443
|
var StyledA = styled_components_1.default.a.withConfig({
|
|
409
444
|
displayName: "Markdown__StyledA",
|
|
410
445
|
componentId: "zd3qkg-3"
|
|
411
|
-
})(["text-decoration:underlined;"]);
|
|
412
|
-
|
|
446
|
+
})(["text-decoration:underlined;"]); // returns renderers customized with the appropriate font sizes given the provided `fontSize` value.
|
|
447
|
+
|
|
413
448
|
var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize, customFontSize) {
|
|
414
449
|
// defaults to customFontSize of 14px if value is invalid
|
|
415
450
|
var cleanedCustomFontSize = (0, types_1.isNumber)(customFontSize) ? customFontSize : 14;
|
|
416
451
|
var isCustomFontSize = fontSize === 'custom';
|
|
417
452
|
/* eslint-disable react/display-name, react/prop-types */
|
|
453
|
+
|
|
418
454
|
var fontMap = isCustomFontSize ? {
|
|
419
455
|
h1: cleanedCustomFontSize * 2.0,
|
|
420
456
|
h2: cleanedCustomFontSize * 1.5,
|
|
@@ -433,7 +469,7 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
|
|
|
433
469
|
},
|
|
434
470
|
headingRenderer: function headingRenderer(_ref3) {
|
|
435
471
|
var children = _ref3.children,
|
|
436
|
-
|
|
472
|
+
level = _ref3.level;
|
|
437
473
|
return React.createElement(Heading_1.default, {
|
|
438
474
|
level: level,
|
|
439
475
|
style: Object.assign({
|
|
@@ -444,7 +480,7 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
|
|
|
444
480
|
},
|
|
445
481
|
itemRenderer: function itemRenderer(_ref4) {
|
|
446
482
|
var children = _ref4.children,
|
|
447
|
-
|
|
483
|
+
nodeKey = _ref4.nodeKey;
|
|
448
484
|
return React.createElement(List_1.default.Item, {
|
|
449
485
|
style: Object.assign({
|
|
450
486
|
fontSize: fontMap.p,
|
|
@@ -455,8 +491,8 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
|
|
|
455
491
|
},
|
|
456
492
|
codeBlockRenderer: function codeBlockRenderer(_ref5) {
|
|
457
493
|
var language = _ref5.language,
|
|
458
|
-
|
|
459
|
-
|
|
494
|
+
literal = _ref5.literal,
|
|
495
|
+
nodeKey = _ref5.nodeKey;
|
|
460
496
|
return React.createElement(CodeBlockContainer, {
|
|
461
497
|
fontSize: fontMap.p
|
|
462
498
|
}, React.createElement(Code_1.default, {
|
|
@@ -475,7 +511,7 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
|
|
|
475
511
|
},
|
|
476
512
|
linkRenderer: function linkRenderer(_ref7) {
|
|
477
513
|
var href = _ref7.href,
|
|
478
|
-
|
|
514
|
+
children = _ref7.children;
|
|
479
515
|
return React.createElement(StyledA, {
|
|
480
516
|
href: href,
|
|
481
517
|
onClick: handleLinkClick
|
|
@@ -483,25 +519,30 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
|
|
|
483
519
|
}
|
|
484
520
|
};
|
|
485
521
|
};
|
|
522
|
+
|
|
486
523
|
var MarkdownVisualization = function MarkdownVisualization(_ref8) {
|
|
487
524
|
var height = _ref8.height,
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
525
|
+
width = _ref8.width,
|
|
526
|
+
markdown = _ref8.markdown,
|
|
527
|
+
backgroundColor = _ref8.backgroundColor,
|
|
528
|
+
fontColor = _ref8.fontColor,
|
|
529
|
+
fontFamily = _ref8.fontFamily,
|
|
530
|
+
fontSize = _ref8.fontSize,
|
|
531
|
+
customFontSize = _ref8.customFontSize,
|
|
532
|
+
rotation = _ref8.rotation,
|
|
533
|
+
hasEventHandlers = _ref8.hasEventHandlers,
|
|
534
|
+
onMarkdownClick = _ref8.onMarkdownClick;
|
|
535
|
+
|
|
498
536
|
var _a;
|
|
537
|
+
|
|
499
538
|
var _ref9 = (0, themes_1.useSplunkTheme)(),
|
|
500
|
-
|
|
539
|
+
defaultFontFamily = _ref9.fontFamily; // font-family style for non-code content - default font family appended to custom option value as fallback
|
|
540
|
+
|
|
541
|
+
|
|
501
542
|
var markdownContentFontFamilyStyle = {
|
|
502
543
|
fontFamily: "".concat(fontFamily, ", ").concat(defaultFontFamily)
|
|
503
|
-
};
|
|
504
|
-
|
|
544
|
+
}; // because DSL evaluation is not guaranteed to return string data if `markdown` is powered by DSL, we do a typecast here
|
|
545
|
+
|
|
505
546
|
var stringifiedMarkdown = "".concat(markdown);
|
|
506
547
|
var renderersForFontSize = getMarkdownRenderer(markdownContentFontFamilyStyle, fontSize, customFontSize);
|
|
507
548
|
return React.createElement(MarkdownContainer, {
|
|
@@ -523,6 +564,7 @@ var MarkdownVisualization = function MarkdownVisualization(_ref8) {
|
|
|
523
564
|
onClick: onMarkdownClick
|
|
524
565
|
})));
|
|
525
566
|
};
|
|
567
|
+
|
|
526
568
|
var propTypes = {
|
|
527
569
|
width: T.oneOfType([T.string, T.number]),
|
|
528
570
|
height: T.oneOfType([T.string, T.number]),
|
|
@@ -551,9 +593,11 @@ var defaultProps = {
|
|
|
551
593
|
};
|
|
552
594
|
MarkdownVisualization.propTypes = propTypes;
|
|
553
595
|
MarkdownVisualization.defaultProps = defaultProps;
|
|
596
|
+
|
|
554
597
|
var computeVizProps = function computeVizProps(props) {
|
|
555
598
|
return props;
|
|
556
599
|
};
|
|
600
|
+
|
|
557
601
|
exports.computeVizProps = computeVizProps;
|
|
558
602
|
var Markdown = (0, withDashboardViz_1.default)({
|
|
559
603
|
ReactViz: MarkdownVisualization,
|
|
@@ -601,24 +645,33 @@ module.exports = require("@splunk/ui-utils/i18n");
|
|
|
601
645
|
|
|
602
646
|
|
|
603
647
|
var _toConsumableArray = __webpack_require__(8);
|
|
648
|
+
|
|
604
649
|
var _defineProperty = __webpack_require__(7);
|
|
650
|
+
|
|
605
651
|
var __rest = this && this.__rest || function (s, e) {
|
|
606
652
|
var t = {};
|
|
653
|
+
|
|
607
654
|
for (var p in s) {
|
|
608
655
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
609
656
|
}
|
|
657
|
+
|
|
610
658
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
611
659
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
612
660
|
}
|
|
613
661
|
return t;
|
|
614
662
|
};
|
|
663
|
+
|
|
615
664
|
Object.defineProperty(exports, "__esModule", {
|
|
616
665
|
value: true
|
|
617
666
|
});
|
|
618
667
|
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
668
|
+
|
|
619
669
|
var lodash_1 = __webpack_require__(3);
|
|
670
|
+
|
|
620
671
|
var schemaUtils_1 = __webpack_require__(16);
|
|
672
|
+
|
|
621
673
|
var VizBehavior_1 = __webpack_require__(6);
|
|
674
|
+
|
|
622
675
|
var dynamicOptionsDSLType = {
|
|
623
676
|
type: 'string',
|
|
624
677
|
pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
|
|
@@ -628,20 +681,22 @@ var dynamicOptionsDSLType = {
|
|
|
628
681
|
* @param optionsSchema a visualization's options schema
|
|
629
682
|
* @returns an updated options schema that additionally allows strings starting with > for each option
|
|
630
683
|
*/
|
|
684
|
+
|
|
631
685
|
function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
632
686
|
var enhancedOptionsSchema = {};
|
|
633
687
|
Object.keys(optionsSchema).forEach(function (key) {
|
|
634
688
|
var _a = optionsSchema[key],
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
689
|
+
title = _a.title,
|
|
690
|
+
description = _a.description,
|
|
691
|
+
readOnly = _a.readOnly,
|
|
692
|
+
writeOnly = _a.writeOnly,
|
|
693
|
+
examples = _a.examples,
|
|
694
|
+
defaultValue = _a.default,
|
|
695
|
+
type = _a.type,
|
|
696
|
+
properties = _a.properties,
|
|
697
|
+
patternProperties = _a.patternProperties,
|
|
698
|
+
remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
|
|
699
|
+
|
|
645
700
|
var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
|
|
646
701
|
title: title
|
|
647
702
|
}), description !== undefined && {
|
|
@@ -655,12 +710,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
655
710
|
}), defaultValue !== undefined && {
|
|
656
711
|
default: defaultValue
|
|
657
712
|
});
|
|
713
|
+
|
|
658
714
|
if (type === 'object') {
|
|
659
715
|
enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
|
|
660
716
|
type: type
|
|
661
717
|
}), properties && {
|
|
662
718
|
properties: enhanceOptionsSchemaWithDynamicOptions(properties)
|
|
663
719
|
});
|
|
720
|
+
|
|
664
721
|
if (patternProperties) {
|
|
665
722
|
var enhancedPatternProperties = {};
|
|
666
723
|
Object.keys(patternProperties).forEach(function (opt) {
|
|
@@ -678,6 +735,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
678
735
|
});
|
|
679
736
|
return enhancedOptionsSchema;
|
|
680
737
|
}
|
|
738
|
+
|
|
681
739
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
682
740
|
/**
|
|
683
741
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
@@ -686,11 +744,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
|
|
|
686
744
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
687
745
|
* and containing `open: false` for all editor panels in editorConfig
|
|
688
746
|
*/
|
|
747
|
+
|
|
689
748
|
function enhanceConfig(vizConfig) {
|
|
690
749
|
var enhancedConfig = Object.assign({}, vizConfig);
|
|
750
|
+
|
|
691
751
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
|
|
692
752
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
693
753
|
}
|
|
754
|
+
|
|
694
755
|
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
695
756
|
return Object.assign(Object.assign({}, config), {
|
|
696
757
|
open: config.open || false
|
|
@@ -698,6 +759,7 @@ function enhanceConfig(vizConfig) {
|
|
|
698
759
|
});
|
|
699
760
|
return enhancedConfig;
|
|
700
761
|
}
|
|
762
|
+
|
|
701
763
|
exports.enhanceConfig = enhanceConfig;
|
|
702
764
|
/**
|
|
703
765
|
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
@@ -705,6 +767,7 @@ exports.enhanceConfig = enhanceConfig;
|
|
|
705
767
|
* @param vizConfig a Visualization Config
|
|
706
768
|
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
707
769
|
*/
|
|
770
|
+
|
|
708
771
|
function uncollapseEditorConfig(vizConfig) {
|
|
709
772
|
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
710
773
|
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
@@ -714,13 +777,16 @@ function uncollapseEditorConfig(vizConfig) {
|
|
|
714
777
|
});
|
|
715
778
|
return editorPanelUncollapsedConfig;
|
|
716
779
|
}
|
|
780
|
+
|
|
717
781
|
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
782
|
+
|
|
718
783
|
function isDynamicOption(option) {
|
|
719
784
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
720
785
|
}
|
|
721
|
-
|
|
722
|
-
// private helpers to improve readability of getInitialPreset
|
|
786
|
+
|
|
787
|
+
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
723
788
|
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
789
|
+
|
|
724
790
|
/**
|
|
725
791
|
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
726
792
|
* 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
|
|
@@ -729,6 +795,7 @@ exports.isDynamicOption = isDynamicOption;
|
|
|
729
795
|
*
|
|
730
796
|
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
731
797
|
*/
|
|
798
|
+
|
|
732
799
|
function hasCompatibleContexts(vizContext, presetContext) {
|
|
733
800
|
var presetContextKeys = Object.keys(presetContext);
|
|
734
801
|
return presetContextKeys.every(function (contextKey) {
|
|
@@ -738,6 +805,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
|
|
|
738
805
|
/**
|
|
739
806
|
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
740
807
|
*/
|
|
808
|
+
|
|
809
|
+
|
|
741
810
|
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
742
811
|
var presetOptionKeys = Object.keys(presetOptions);
|
|
743
812
|
return presetOptionKeys.every(function (optionKey) {
|
|
@@ -752,18 +821,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
|
752
821
|
* @param {Object} vizOptions - the current vizOptions definition
|
|
753
822
|
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
754
823
|
*/
|
|
824
|
+
|
|
825
|
+
|
|
755
826
|
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
756
827
|
return presets.find(function (preset) {
|
|
757
828
|
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
758
829
|
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
759
830
|
var presetContextKeys = Object.keys(presetContext);
|
|
760
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
761
|
-
// all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
831
|
+
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
762
832
|
// if not, then the preset is invalid in config.ts
|
|
833
|
+
|
|
763
834
|
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
764
835
|
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
765
836
|
});
|
|
766
837
|
}
|
|
838
|
+
|
|
767
839
|
exports.getInitialPreset = getInitialPreset;
|
|
768
840
|
/**
|
|
769
841
|
* generates number precision values for a Select editor
|
|
@@ -771,6 +843,7 @@ exports.getInitialPreset = getInitialPreset;
|
|
|
771
843
|
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
772
844
|
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
773
845
|
*/
|
|
846
|
+
|
|
774
847
|
function generatePrecisionValues(numPrecisionValues) {
|
|
775
848
|
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
776
849
|
return {
|
|
@@ -779,6 +852,7 @@ function generatePrecisionValues(numPrecisionValues) {
|
|
|
779
852
|
};
|
|
780
853
|
});
|
|
781
854
|
}
|
|
855
|
+
|
|
782
856
|
exports.generatePrecisionValues = generatePrecisionValues;
|
|
783
857
|
/**
|
|
784
858
|
* insert layout in layout array, return a new layout array instead of updating the original
|
|
@@ -788,12 +862,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
|
|
|
788
862
|
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
789
863
|
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
790
864
|
*/
|
|
865
|
+
|
|
791
866
|
var insertLayout = function insertLayout(layout, index) {
|
|
792
867
|
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
793
868
|
layoutItems[_key - 2] = arguments[_key];
|
|
794
869
|
}
|
|
870
|
+
|
|
795
871
|
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
796
872
|
};
|
|
873
|
+
|
|
797
874
|
exports.insertLayout = insertLayout;
|
|
798
875
|
|
|
799
876
|
/***/ }),
|
|
@@ -857,11 +934,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
857
934
|
value: true
|
|
858
935
|
});
|
|
859
936
|
exports.shouldShowIconPlaceholder = void 0;
|
|
937
|
+
|
|
860
938
|
var React = __webpack_require__(1);
|
|
939
|
+
|
|
861
940
|
var T = __webpack_require__(0);
|
|
941
|
+
|
|
862
942
|
var lodash_1 = __webpack_require__(3);
|
|
943
|
+
|
|
863
944
|
var i18n_1 = __webpack_require__(2);
|
|
945
|
+
|
|
864
946
|
var Message_1 = __webpack_require__(10);
|
|
947
|
+
|
|
865
948
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
866
949
|
/**
|
|
867
950
|
* @method shouldShowIconPlaceholder
|
|
@@ -869,6 +952,8 @@ var FixedSizeContainer_1 = __webpack_require__(13);
|
|
|
869
952
|
* @param {boolean} loading
|
|
870
953
|
* @returns {boolean}
|
|
871
954
|
*/
|
|
955
|
+
|
|
956
|
+
|
|
872
957
|
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
873
958
|
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
874
959
|
var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
|
|
@@ -877,6 +962,7 @@ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources)
|
|
|
877
962
|
var noFields = fields === undefined;
|
|
878
963
|
return loading || noData || noFields;
|
|
879
964
|
};
|
|
965
|
+
|
|
880
966
|
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
881
967
|
var propTypes = {
|
|
882
968
|
icon: T.func,
|
|
@@ -891,11 +977,13 @@ var propTypes = {
|
|
|
891
977
|
* @param {IconPlaceholderProps} props
|
|
892
978
|
* @returns {React.ReactElement}
|
|
893
979
|
*/
|
|
980
|
+
|
|
894
981
|
var IconPlaceholder = function IconPlaceholder(props) {
|
|
895
982
|
var width = props.width,
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
983
|
+
height = props.height,
|
|
984
|
+
icon = props.icon,
|
|
985
|
+
iconColor = props.iconColor;
|
|
986
|
+
|
|
899
987
|
if (icon) {
|
|
900
988
|
return React.createElement(icon, {
|
|
901
989
|
style: {
|
|
@@ -910,6 +998,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
910
998
|
height: '50%'
|
|
911
999
|
});
|
|
912
1000
|
}
|
|
1001
|
+
|
|
913
1002
|
return React.createElement(Message_1.default, {
|
|
914
1003
|
width: width,
|
|
915
1004
|
height: height,
|
|
@@ -917,6 +1006,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
917
1006
|
message: (0, i18n_1._)('No DataSource Connected')
|
|
918
1007
|
});
|
|
919
1008
|
};
|
|
1009
|
+
|
|
920
1010
|
IconPlaceholder.propTypes = propTypes;
|
|
921
1011
|
IconPlaceholder.defaultProps = {
|
|
922
1012
|
width: '100%',
|
|
@@ -933,21 +1023,27 @@ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
|
|
|
933
1023
|
|
|
934
1024
|
|
|
935
1025
|
var _defineProperty = __webpack_require__(7);
|
|
1026
|
+
|
|
936
1027
|
Object.defineProperty(exports, "__esModule", {
|
|
937
1028
|
value: true
|
|
938
1029
|
});
|
|
939
1030
|
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
1031
|
+
|
|
940
1032
|
var T = __webpack_require__(0);
|
|
1033
|
+
|
|
941
1034
|
var lodash_1 = __webpack_require__(3);
|
|
942
|
-
|
|
1035
|
+
|
|
1036
|
+
var DataSource_1 = __webpack_require__(34);
|
|
1037
|
+
|
|
943
1038
|
exports.SortParamsPropTypes = T.shape({
|
|
944
1039
|
currentSortKey: T.string,
|
|
945
1040
|
currentSortDir: T.oneOf(DataSource_1.validSortDirs),
|
|
946
1041
|
onSort: T.func
|
|
947
1042
|
});
|
|
1043
|
+
|
|
948
1044
|
var getSortingParams = function getSortingParams(_ref) {
|
|
949
1045
|
var requestParams = _ref.requestParams,
|
|
950
|
-
|
|
1046
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
951
1047
|
var currentSortKey;
|
|
952
1048
|
var currentSortDir;
|
|
953
1049
|
var nextSortDirMap = {
|
|
@@ -956,15 +1052,18 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
956
1052
|
none: 'asc'
|
|
957
1053
|
};
|
|
958
1054
|
var onSort;
|
|
1055
|
+
|
|
959
1056
|
if (typeof onRequestParamsChange === 'function') {
|
|
960
1057
|
if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
|
|
961
1058
|
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
962
1059
|
currentSortDir = requestParams.sort[currentSortKey];
|
|
963
|
-
}
|
|
964
|
-
|
|
1060
|
+
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
1061
|
+
|
|
1062
|
+
|
|
965
1063
|
onSort = function onSort(e, _ref2) {
|
|
966
1064
|
var sortKey = _ref2.sortKey,
|
|
967
|
-
|
|
1065
|
+
sortDir = _ref2.sortDir;
|
|
1066
|
+
|
|
968
1067
|
if (typeof sortKey === 'string') {
|
|
969
1068
|
var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
970
1069
|
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
@@ -976,12 +1075,14 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
976
1075
|
}
|
|
977
1076
|
};
|
|
978
1077
|
}
|
|
1078
|
+
|
|
979
1079
|
return {
|
|
980
1080
|
currentSortKey: currentSortKey,
|
|
981
1081
|
currentSortDir: currentSortDir,
|
|
982
1082
|
onSort: onSort
|
|
983
1083
|
};
|
|
984
1084
|
};
|
|
1085
|
+
|
|
985
1086
|
exports.getSortingParams = getSortingParams;
|
|
986
1087
|
|
|
987
1088
|
/***/ }),
|
|
@@ -992,43 +1093,69 @@ exports.getSortingParams = getSortingParams;
|
|
|
992
1093
|
"use strict";
|
|
993
1094
|
|
|
994
1095
|
|
|
1096
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1097
|
+
value: true
|
|
1098
|
+
});
|
|
1099
|
+
exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
|
|
1100
|
+
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1101
|
+
exports.validSegmentationModes = ['none', 'inner'];
|
|
1102
|
+
exports.validOutputModes = ['json_cols', 'json'];
|
|
1103
|
+
|
|
1104
|
+
/***/ }),
|
|
1105
|
+
|
|
1106
|
+
/***/ 35:
|
|
1107
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1108
|
+
|
|
1109
|
+
"use strict";
|
|
1110
|
+
|
|
1111
|
+
|
|
995
1112
|
Object.defineProperty(exports, "__esModule", {
|
|
996
1113
|
value: true
|
|
997
1114
|
});
|
|
998
1115
|
exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
1116
|
+
|
|
999
1117
|
var T = __webpack_require__(0);
|
|
1118
|
+
|
|
1000
1119
|
var lodash_1 = __webpack_require__(3);
|
|
1120
|
+
|
|
1001
1121
|
exports.PaginatorParamsPropTypes = T.shape({
|
|
1002
1122
|
isPaging: T.bool,
|
|
1003
1123
|
current: T.number,
|
|
1004
1124
|
totalPages: T.number,
|
|
1005
1125
|
onChange: T.func
|
|
1006
1126
|
});
|
|
1127
|
+
|
|
1007
1128
|
var getPaginationParams = function getPaginationParams(_ref) {
|
|
1008
1129
|
var requestParams = _ref.requestParams,
|
|
1009
|
-
|
|
1010
|
-
|
|
1130
|
+
meta = _ref.meta,
|
|
1131
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
1011
1132
|
var totalCount = meta && meta.totalCount || 0;
|
|
1012
1133
|
var offset = requestParams && requestParams.offset || 0;
|
|
1013
1134
|
var count = requestParams && requestParams.count;
|
|
1014
1135
|
var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
1015
1136
|
var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
1016
1137
|
var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
|
|
1138
|
+
|
|
1017
1139
|
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
1018
1140
|
var page = _ref2.page,
|
|
1019
|
-
|
|
1141
|
+
countArg = _ref2.count;
|
|
1020
1142
|
var newParams = (0, lodash_1.cloneDeep)(requestParams);
|
|
1143
|
+
|
|
1021
1144
|
if (typeof countArg === 'number') {
|
|
1022
1145
|
newParams.count = countArg;
|
|
1023
1146
|
newParams.offset = 0;
|
|
1024
1147
|
}
|
|
1148
|
+
|
|
1025
1149
|
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
1150
|
+
|
|
1026
1151
|
if (typeof page === 'number' && page > 0) {
|
|
1027
1152
|
newParams.count = pageCount;
|
|
1028
1153
|
newParams.offset = (page - 1) * pageCount;
|
|
1029
1154
|
}
|
|
1155
|
+
|
|
1030
1156
|
onRequestParamsChange(newParams);
|
|
1031
1157
|
};
|
|
1158
|
+
|
|
1032
1159
|
return {
|
|
1033
1160
|
isPaging: isPaging,
|
|
1034
1161
|
current: current,
|
|
@@ -1036,11 +1163,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
|
|
|
1036
1163
|
onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
|
|
1037
1164
|
};
|
|
1038
1165
|
};
|
|
1166
|
+
|
|
1039
1167
|
exports.getPaginationParams = getPaginationParams;
|
|
1040
1168
|
|
|
1041
1169
|
/***/ }),
|
|
1042
1170
|
|
|
1043
|
-
/***/
|
|
1171
|
+
/***/ 36:
|
|
1044
1172
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1045
1173
|
|
|
1046
1174
|
"use strict";
|
|
@@ -1051,6 +1179,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1051
1179
|
});
|
|
1052
1180
|
exports.VizCategory = void 0;
|
|
1053
1181
|
var VizCategory;
|
|
1182
|
+
|
|
1054
1183
|
(function (VizCategory) {
|
|
1055
1184
|
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
1056
1185
|
VizCategory["TRENDS"] = "Trends";
|
|
@@ -1068,67 +1197,96 @@ var VizCategory;
|
|
|
1068
1197
|
|
|
1069
1198
|
/***/ }),
|
|
1070
1199
|
|
|
1071
|
-
/***/
|
|
1200
|
+
/***/ 37:
|
|
1072
1201
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1073
1202
|
|
|
1074
1203
|
"use strict";
|
|
1075
1204
|
|
|
1076
1205
|
|
|
1077
1206
|
var _slicedToArray = __webpack_require__(17);
|
|
1207
|
+
|
|
1078
1208
|
Object.defineProperty(exports, "__esModule", {
|
|
1079
1209
|
value: true
|
|
1080
1210
|
});
|
|
1211
|
+
|
|
1081
1212
|
var React = __webpack_require__(1);
|
|
1213
|
+
|
|
1082
1214
|
var lodash_1 = __webpack_require__(3);
|
|
1083
|
-
|
|
1215
|
+
|
|
1216
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(38);
|
|
1217
|
+
|
|
1084
1218
|
var Options_1 = __webpack_require__(30);
|
|
1085
|
-
|
|
1219
|
+
|
|
1220
|
+
var SanitizeProps_1 = __webpack_require__(39);
|
|
1221
|
+
|
|
1086
1222
|
var TimezoneContext_1 = __webpack_require__(26);
|
|
1087
|
-
|
|
1223
|
+
|
|
1224
|
+
var moment_1 = __webpack_require__(40);
|
|
1225
|
+
|
|
1088
1226
|
var FeatureFlagContext_1 = __webpack_require__(21);
|
|
1227
|
+
|
|
1089
1228
|
var styled_components_1 = __webpack_require__(4);
|
|
1229
|
+
|
|
1090
1230
|
var hocUtils_1 = __webpack_require__(27);
|
|
1231
|
+
|
|
1091
1232
|
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
1092
|
-
|
|
1233
|
+
|
|
1234
|
+
var async_dynamic_options_evaluator_1 = __webpack_require__(41);
|
|
1235
|
+
|
|
1093
1236
|
var id_1 = __webpack_require__(25);
|
|
1094
|
-
|
|
1237
|
+
|
|
1238
|
+
var SplunkVisualization_1 = __webpack_require__(42);
|
|
1239
|
+
|
|
1095
1240
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1241
|
+
|
|
1096
1242
|
var getSorting_1 = __webpack_require__(33);
|
|
1097
|
-
|
|
1243
|
+
|
|
1244
|
+
var getPagination_1 = __webpack_require__(35);
|
|
1245
|
+
|
|
1098
1246
|
var useDeepMemo_1 = __webpack_require__(44);
|
|
1247
|
+
|
|
1099
1248
|
var MissingPropsMessage_1 = __webpack_require__(45);
|
|
1249
|
+
|
|
1100
1250
|
var withEditModeCover_1 = __webpack_require__(46);
|
|
1251
|
+
|
|
1101
1252
|
var withPlaceholder_1 = __webpack_require__(47);
|
|
1102
1253
|
/**
|
|
1103
1254
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
1104
1255
|
* @param {DashboardVizOpts} opts
|
|
1105
1256
|
* @returns {HOC}
|
|
1106
1257
|
*/
|
|
1258
|
+
|
|
1259
|
+
|
|
1107
1260
|
var withDashboardViz = function withDashboardViz(opts) {
|
|
1108
1261
|
var ReactViz = opts.ReactViz,
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1262
|
+
vizConfig = opts.vizConfig,
|
|
1263
|
+
_opts$computeVizProps = opts.computeVizProps,
|
|
1264
|
+
computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
|
|
1265
|
+
disableEditModeCover = opts.disableEditModeCover,
|
|
1266
|
+
useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
|
|
1267
|
+
|
|
1114
1268
|
var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
|
|
1115
1269
|
var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
|
|
1270
|
+
|
|
1116
1271
|
var DashboardViz = function DashboardViz(props) {
|
|
1117
1272
|
var _a;
|
|
1273
|
+
|
|
1118
1274
|
var mode = props.mode,
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1275
|
+
hasEventHandlers = props.hasEventHandlers,
|
|
1276
|
+
dataSources = props.dataSources,
|
|
1277
|
+
options = props.options,
|
|
1278
|
+
_props$context = props.context,
|
|
1279
|
+
context = _props$context === void 0 ? {} : _props$context,
|
|
1280
|
+
width = props.width,
|
|
1281
|
+
height = props.height,
|
|
1282
|
+
onComputedProps = props.onComputedProps,
|
|
1283
|
+
onEventTrigger = props.onEventTrigger,
|
|
1284
|
+
theme = props.theme,
|
|
1285
|
+
onRequestParamsChange = props.onRequestParamsChange;
|
|
1286
|
+
|
|
1130
1287
|
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
1131
|
-
|
|
1288
|
+
serializedTimezone = _React$useContext.serializedTimezone;
|
|
1289
|
+
|
|
1132
1290
|
if (serializedTimezone) {
|
|
1133
1291
|
/*
|
|
1134
1292
|
@splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
|
|
@@ -1142,38 +1300,51 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1142
1300
|
moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
|
|
1143
1301
|
}
|
|
1144
1302
|
}
|
|
1303
|
+
|
|
1145
1304
|
var themeFunc = function themeFunc(themeVar) {
|
|
1146
1305
|
var _a, _b;
|
|
1306
|
+
|
|
1147
1307
|
return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
|
|
1148
1308
|
};
|
|
1309
|
+
|
|
1149
1310
|
var bgColorFromTheme = themeFunc('defaultBackgroundColor');
|
|
1311
|
+
|
|
1150
1312
|
var _ref = (0, getSettingsFromThemedProps_1.default)({
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1313
|
+
theme: theme
|
|
1314
|
+
}),
|
|
1315
|
+
currentThemeFamily = _ref.family,
|
|
1316
|
+
currentThemeColorScheme = _ref.colorScheme,
|
|
1317
|
+
currentThemeDensity = _ref.density;
|
|
1318
|
+
|
|
1156
1319
|
var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
|
|
1320
|
+
|
|
1157
1321
|
var _React$useState = React.useState({}),
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1322
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1323
|
+
evaluatedOptionsAsync = _React$useState2[0],
|
|
1324
|
+
setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
|
|
1325
|
+
|
|
1326
|
+
|
|
1161
1327
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
1328
|
+
|
|
1162
1329
|
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
|
|
1163
|
-
|
|
1164
|
-
|
|
1330
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
1331
|
+
visualizationID = _React$useState4[0];
|
|
1332
|
+
|
|
1165
1333
|
var _React$useState5 = React.useState({}),
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1334
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
1335
|
+
dataSourcesInState = _React$useState6[0],
|
|
1336
|
+
setDataSourcesInState = _React$useState6[1];
|
|
1337
|
+
|
|
1169
1338
|
var _React$useState7 = React.useState(),
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1339
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
1340
|
+
dataFramesInState = _React$useState8[0],
|
|
1341
|
+
setDataFramesInState = _React$useState8[1];
|
|
1342
|
+
|
|
1173
1343
|
var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1344
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
1345
|
+
useAsyncEvaluatedOptions = _React$useState10[0],
|
|
1346
|
+
setUseAsyncEvaluatedOptions = _React$useState10[1];
|
|
1347
|
+
|
|
1177
1348
|
var isMounted = React.useRef(true);
|
|
1178
1349
|
evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
|
|
1179
1350
|
try {
|
|
@@ -1198,11 +1369,13 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1198
1369
|
});
|
|
1199
1370
|
} else {
|
|
1200
1371
|
var dataFrames = dataFramesInState;
|
|
1372
|
+
|
|
1201
1373
|
if (dataSources !== dataSourcesInState) {
|
|
1202
1374
|
setDataSourcesInState(dataSources);
|
|
1203
1375
|
dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
|
|
1204
1376
|
setDataFramesInState(dataFrames);
|
|
1205
1377
|
}
|
|
1378
|
+
|
|
1206
1379
|
return Options_1.Options.evaluate({
|
|
1207
1380
|
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
1208
1381
|
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
@@ -1213,21 +1386,24 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1213
1386
|
console.error("unexpected error evaluating options: ".concat(e.message));
|
|
1214
1387
|
return {};
|
|
1215
1388
|
}
|
|
1389
|
+
|
|
1216
1390
|
return {};
|
|
1217
1391
|
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
|
|
1218
|
-
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
1219
|
-
// trellis specific backgroundColor update for onComputedProps
|
|
1392
|
+
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
|
|
1220
1393
|
// 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
|
|
1221
1394
|
// onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
|
|
1395
|
+
|
|
1222
1396
|
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
1223
1397
|
var clonedEvaluatedOptions = evaluatedOptionsToUse;
|
|
1398
|
+
|
|
1224
1399
|
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) {
|
|
1225
1400
|
clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
|
|
1226
1401
|
backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
1227
1402
|
});
|
|
1228
|
-
}
|
|
1229
|
-
// useEffect hook needs to be initialized before any early returns
|
|
1403
|
+
} // useEffect hook needs to be initialized before any early returns
|
|
1230
1404
|
// this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
|
|
1405
|
+
|
|
1406
|
+
|
|
1231
1407
|
React.useEffect(function () {
|
|
1232
1408
|
onComputedProps(clonedEvaluatedOptions);
|
|
1233
1409
|
});
|
|
@@ -1237,44 +1413,49 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1237
1413
|
isMounted.current = false;
|
|
1238
1414
|
async_dynamic_options_evaluator_1.default.reset(visualizationID);
|
|
1239
1415
|
}
|
|
1240
|
-
};
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
// present warning message if any required props are missing
|
|
1416
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1417
|
+
}, []); // present warning message if any required props are missing
|
|
1418
|
+
|
|
1244
1419
|
var _vizConfig$requiredPr = vizConfig.requiredProps,
|
|
1245
|
-
|
|
1246
|
-
|
|
1420
|
+
requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
|
|
1421
|
+
supports = vizConfig.supports;
|
|
1247
1422
|
var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
|
|
1423
|
+
|
|
1248
1424
|
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
|
|
1249
1425
|
) {
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1426
|
+
return React.createElement(MissingPropsMessage_1.default, {
|
|
1427
|
+
"data-test": "missing-props-message",
|
|
1428
|
+
width: width,
|
|
1429
|
+
height: height,
|
|
1430
|
+
missingProps: missing,
|
|
1431
|
+
backgroundColor: bgColorFromTheme
|
|
1432
|
+
});
|
|
1433
|
+
} // events
|
|
1434
|
+
|
|
1435
|
+
|
|
1259
1436
|
var eventCallbackProps = {};
|
|
1437
|
+
|
|
1260
1438
|
if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
|
|
1261
1439
|
var supportedEvents = vizConfig.events;
|
|
1262
1440
|
Object.keys(supportedEvents).forEach(function (eventName) {
|
|
1263
1441
|
var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
|
|
1264
|
-
eventCallbackProps[eventCallbackPropName] = null;
|
|
1265
|
-
// todo: refactor single value and single value icon to send payload from viz
|
|
1442
|
+
eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
|
|
1266
1443
|
// then remove these lines
|
|
1444
|
+
|
|
1267
1445
|
var payloadKeys = supportedEvents[eventName].payloadKeys;
|
|
1268
1446
|
var payload = {};
|
|
1447
|
+
|
|
1269
1448
|
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
1270
1449
|
payloadKeys.forEach(function (p) {
|
|
1271
1450
|
payload[p] = evaluatedOptionsToUse[p];
|
|
1272
1451
|
});
|
|
1273
1452
|
}
|
|
1453
|
+
|
|
1274
1454
|
eventCallbackProps[eventCallbackPropName] = function (ev) {
|
|
1275
1455
|
if (ev && ev.payload) {
|
|
1276
1456
|
payload = ev.payload;
|
|
1277
1457
|
}
|
|
1458
|
+
|
|
1278
1459
|
return onEventTrigger({
|
|
1279
1460
|
originalEvent: ev,
|
|
1280
1461
|
payload: payload,
|
|
@@ -1282,8 +1463,9 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1282
1463
|
});
|
|
1283
1464
|
};
|
|
1284
1465
|
});
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1466
|
+
} // compute pure viz props which are not from options
|
|
1467
|
+
|
|
1468
|
+
|
|
1287
1469
|
var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
1288
1470
|
themeFunc: themeFunc
|
|
1289
1471
|
}));
|
|
@@ -1301,15 +1483,19 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1301
1483
|
* In future, we could automatically detect which all datasources are being used
|
|
1302
1484
|
* and bind those magically to pagination/sorting behavior.
|
|
1303
1485
|
*/
|
|
1486
|
+
|
|
1304
1487
|
var dataSourceMetadata = {};
|
|
1305
1488
|
var OptionKey = 'paginateDataSourceKey';
|
|
1306
1489
|
var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1490
|
+
|
|
1307
1491
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
|
|
1308
1492
|
var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
1309
1493
|
var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
1494
|
+
|
|
1310
1495
|
var handleRequestParamsChange = function handleRequestParamsChange(payload) {
|
|
1311
1496
|
return onRequestParamsChange(paginateDataSourceKey, payload);
|
|
1312
1497
|
};
|
|
1498
|
+
|
|
1313
1499
|
var sortParams = (0, getSorting_1.getSortingParams)({
|
|
1314
1500
|
requestParams: requestParams,
|
|
1315
1501
|
meta: meta,
|
|
@@ -1324,115 +1510,132 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1324
1510
|
sortParams: sortParams,
|
|
1325
1511
|
paginatorParams: paginatorParams
|
|
1326
1512
|
};
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1513
|
+
} // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
|
|
1514
|
+
|
|
1515
|
+
|
|
1329
1516
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
1330
1517
|
return null;
|
|
1331
1518
|
}
|
|
1519
|
+
|
|
1332
1520
|
return React.createElement(SanitizedReactViz, Object.assign({
|
|
1333
1521
|
mode: mode,
|
|
1334
1522
|
width: width,
|
|
1335
1523
|
height: height
|
|
1336
1524
|
}, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
|
|
1337
1525
|
};
|
|
1526
|
+
|
|
1338
1527
|
DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
|
|
1339
1528
|
DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
|
|
1340
1529
|
// using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
|
|
1341
1530
|
theme: {}
|
|
1342
|
-
});
|
|
1343
|
-
|
|
1344
|
-
DashboardViz.config = vizConfig;
|
|
1345
|
-
|
|
1531
|
+
}); // attach viz config
|
|
1532
|
+
|
|
1533
|
+
DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
|
|
1534
|
+
|
|
1346
1535
|
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1347
1536
|
};
|
|
1537
|
+
|
|
1348
1538
|
exports.default = withDashboardViz;
|
|
1349
1539
|
|
|
1350
1540
|
/***/ }),
|
|
1351
1541
|
|
|
1352
|
-
/***/
|
|
1542
|
+
/***/ 38:
|
|
1353
1543
|
/***/ (function(module, exports) {
|
|
1354
1544
|
|
|
1355
1545
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
1356
1546
|
|
|
1357
1547
|
/***/ }),
|
|
1358
1548
|
|
|
1359
|
-
/***/
|
|
1549
|
+
/***/ 39:
|
|
1360
1550
|
/***/ (function(module, exports) {
|
|
1361
1551
|
|
|
1362
1552
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1363
1553
|
|
|
1364
1554
|
/***/ }),
|
|
1365
1555
|
|
|
1366
|
-
/***/
|
|
1556
|
+
/***/ 4:
|
|
1367
1557
|
/***/ (function(module, exports) {
|
|
1368
1558
|
|
|
1369
|
-
module.exports = require("
|
|
1559
|
+
module.exports = require("styled-components");
|
|
1370
1560
|
|
|
1371
1561
|
/***/ }),
|
|
1372
1562
|
|
|
1373
|
-
/***/
|
|
1563
|
+
/***/ 40:
|
|
1374
1564
|
/***/ (function(module, exports) {
|
|
1375
1565
|
|
|
1376
|
-
module.exports = require("
|
|
1566
|
+
module.exports = require("@splunk/moment");
|
|
1377
1567
|
|
|
1378
1568
|
/***/ }),
|
|
1379
1569
|
|
|
1380
|
-
/***/
|
|
1570
|
+
/***/ 41:
|
|
1381
1571
|
/***/ (function(module, exports) {
|
|
1382
1572
|
|
|
1383
1573
|
module.exports = require("@splunk/async-dynamic-options-evaluator");
|
|
1384
1574
|
|
|
1385
1575
|
/***/ }),
|
|
1386
1576
|
|
|
1387
|
-
/***/
|
|
1577
|
+
/***/ 42:
|
|
1388
1578
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1389
1579
|
|
|
1390
1580
|
"use strict";
|
|
1391
1581
|
|
|
1392
1582
|
|
|
1393
1583
|
var _classCallCheck = __webpack_require__(9);
|
|
1584
|
+
|
|
1394
1585
|
Object.defineProperty(exports, "__esModule", {
|
|
1395
1586
|
value: true
|
|
1396
1587
|
});
|
|
1397
1588
|
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
1398
1589
|
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
1590
|
+
|
|
1399
1591
|
var T = __webpack_require__(0);
|
|
1592
|
+
|
|
1400
1593
|
var lodash_1 = __webpack_require__(3);
|
|
1401
|
-
|
|
1402
|
-
// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1594
|
+
|
|
1595
|
+
var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1596
|
+
|
|
1597
|
+
|
|
1403
1598
|
exports.INITIAL_WIDTH = 250;
|
|
1404
1599
|
exports.INITIAL_HEIGHT = 250;
|
|
1405
1600
|
/**
|
|
1406
1601
|
* A Splunk visualization
|
|
1407
1602
|
*/
|
|
1603
|
+
|
|
1408
1604
|
var SplunkVisualization = function SplunkVisualization() {
|
|
1409
1605
|
_classCallCheck(this, SplunkVisualization);
|
|
1410
1606
|
};
|
|
1607
|
+
|
|
1411
1608
|
SplunkVisualization.propTypes = {
|
|
1412
1609
|
/**
|
|
1413
1610
|
* display mode
|
|
1414
1611
|
*/
|
|
1415
1612
|
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
1613
|
+
|
|
1416
1614
|
/**
|
|
1417
1615
|
* width in pixel or string, defaults to 100%
|
|
1418
1616
|
*/
|
|
1419
1617
|
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
1618
|
+
|
|
1420
1619
|
/**
|
|
1421
1620
|
* height in pixel or string
|
|
1422
1621
|
*/
|
|
1423
1622
|
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
1623
|
+
|
|
1424
1624
|
/**
|
|
1425
1625
|
* visualization context used for dynamic option evaluation
|
|
1426
1626
|
*/
|
|
1427
1627
|
context: T.object,
|
|
1628
|
+
|
|
1428
1629
|
/**
|
|
1429
1630
|
* visualization formatting options
|
|
1430
1631
|
*/
|
|
1431
1632
|
options: T.object,
|
|
1633
|
+
|
|
1432
1634
|
/**
|
|
1433
1635
|
* A callback to update formatting options
|
|
1434
1636
|
*/
|
|
1435
1637
|
onOptionsChange: T.func,
|
|
1638
|
+
|
|
1436
1639
|
/**
|
|
1437
1640
|
* datasource state which include data and request params, object key indicate the datasource type.
|
|
1438
1641
|
*/
|
|
@@ -1441,6 +1644,7 @@ SplunkVisualization.propTypes = {
|
|
|
1441
1644
|
* current request params
|
|
1442
1645
|
*/
|
|
1443
1646
|
requestParams: T.object,
|
|
1647
|
+
|
|
1444
1648
|
/**
|
|
1445
1649
|
* current dataset
|
|
1446
1650
|
*/
|
|
@@ -1448,6 +1652,7 @@ SplunkVisualization.propTypes = {
|
|
|
1448
1652
|
fields: T.array,
|
|
1449
1653
|
columns: T.array
|
|
1450
1654
|
}),
|
|
1655
|
+
|
|
1451
1656
|
/**
|
|
1452
1657
|
* error
|
|
1453
1658
|
*/
|
|
@@ -1455,29 +1660,35 @@ SplunkVisualization.propTypes = {
|
|
|
1455
1660
|
level: T.string,
|
|
1456
1661
|
message: T.string
|
|
1457
1662
|
}),
|
|
1663
|
+
|
|
1458
1664
|
/**
|
|
1459
1665
|
* meta data that came with the dataset
|
|
1460
1666
|
*/
|
|
1461
1667
|
meta: T.object
|
|
1462
1668
|
})),
|
|
1669
|
+
|
|
1463
1670
|
/**
|
|
1464
1671
|
* A callback to trigger event
|
|
1465
1672
|
*/
|
|
1466
1673
|
onEventTrigger: T.func,
|
|
1674
|
+
|
|
1467
1675
|
/**
|
|
1468
1676
|
* Inform viz if there are handlers listening to events
|
|
1469
1677
|
*/
|
|
1470
1678
|
hasEventHandlers: T.bool,
|
|
1679
|
+
|
|
1471
1680
|
/**
|
|
1472
1681
|
* A callback to communicate computed props to a consumer
|
|
1473
1682
|
*/
|
|
1474
1683
|
onComputedProps: T.func,
|
|
1684
|
+
|
|
1475
1685
|
/**
|
|
1476
1686
|
* A callback to obtain visualization api
|
|
1477
1687
|
*/
|
|
1478
1688
|
vizActionHandlerRef: T.func,
|
|
1479
1689
|
loading: T.bool,
|
|
1480
1690
|
theme: T.object,
|
|
1691
|
+
|
|
1481
1692
|
/**
|
|
1482
1693
|
* A callback to request new data with updated request params
|
|
1483
1694
|
*/
|
|
@@ -1486,6 +1697,7 @@ SplunkVisualization.propTypes = {
|
|
|
1486
1697
|
/**
|
|
1487
1698
|
*
|
|
1488
1699
|
*/
|
|
1700
|
+
|
|
1489
1701
|
SplunkVisualization.defaultProps = {
|
|
1490
1702
|
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
1491
1703
|
width: '100%',
|
|
@@ -1514,39 +1726,6 @@ exports.default = SplunkVisualization;
|
|
|
1514
1726
|
|
|
1515
1727
|
/***/ }),
|
|
1516
1728
|
|
|
1517
|
-
/***/ 42:
|
|
1518
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1519
|
-
|
|
1520
|
-
"use strict";
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
var _classCallCheck = __webpack_require__(9);
|
|
1524
|
-
var _createClass = __webpack_require__(18);
|
|
1525
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1526
|
-
value: true
|
|
1527
|
-
});
|
|
1528
|
-
exports.DefaultVizActionHandler = void 0;
|
|
1529
|
-
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
1530
|
-
function DefaultVizActionHandler() {
|
|
1531
|
-
_classCallCheck(this, DefaultVizActionHandler);
|
|
1532
|
-
}
|
|
1533
|
-
_createClass(DefaultVizActionHandler, [{
|
|
1534
|
-
key: "focus",
|
|
1535
|
-
value: function focus() {
|
|
1536
|
-
// noop
|
|
1537
|
-
}
|
|
1538
|
-
}, {
|
|
1539
|
-
key: "snapshot",
|
|
1540
|
-
value: function snapshot() {
|
|
1541
|
-
return null; // noop
|
|
1542
|
-
}
|
|
1543
|
-
}]);
|
|
1544
|
-
return DefaultVizActionHandler;
|
|
1545
|
-
}();
|
|
1546
|
-
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1547
|
-
|
|
1548
|
-
/***/ }),
|
|
1549
|
-
|
|
1550
1729
|
/***/ 423:
|
|
1551
1730
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1552
1731
|
|
|
@@ -1556,6 +1735,7 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
|
1556
1735
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1557
1736
|
if (k2 === undefined) k2 = k;
|
|
1558
1737
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1738
|
+
|
|
1559
1739
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1560
1740
|
desc = {
|
|
1561
1741
|
enumerable: true,
|
|
@@ -1564,22 +1744,28 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
|
|
|
1564
1744
|
}
|
|
1565
1745
|
};
|
|
1566
1746
|
}
|
|
1747
|
+
|
|
1567
1748
|
Object.defineProperty(o, k2, desc);
|
|
1568
1749
|
} : function (o, m, k, k2) {
|
|
1569
1750
|
if (k2 === undefined) k2 = k;
|
|
1570
1751
|
o[k2] = m[k];
|
|
1571
1752
|
});
|
|
1753
|
+
|
|
1572
1754
|
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
1573
1755
|
for (var p in m) {
|
|
1574
1756
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1575
1757
|
}
|
|
1576
1758
|
};
|
|
1759
|
+
|
|
1577
1760
|
Object.defineProperty(exports, "__esModule", {
|
|
1578
1761
|
value: true
|
|
1579
1762
|
});
|
|
1580
1763
|
exports.default = void 0;
|
|
1764
|
+
|
|
1581
1765
|
__exportStar(__webpack_require__(161), exports);
|
|
1766
|
+
|
|
1582
1767
|
var Markdown_1 = __webpack_require__(161);
|
|
1768
|
+
|
|
1583
1769
|
Object.defineProperty(exports, "default", {
|
|
1584
1770
|
enumerable: true,
|
|
1585
1771
|
get: function get() {
|
|
@@ -1610,21 +1796,29 @@ module.exports = require("@splunk/react-ui/Code");
|
|
|
1610
1796
|
|
|
1611
1797
|
|
|
1612
1798
|
var _toConsumableArray = __webpack_require__(8);
|
|
1799
|
+
|
|
1613
1800
|
Object.defineProperty(exports, "__esModule", {
|
|
1614
1801
|
value: true
|
|
1615
1802
|
});
|
|
1803
|
+
|
|
1616
1804
|
var themes_1 = __webpack_require__(60);
|
|
1805
|
+
|
|
1617
1806
|
var i18n_1 = __webpack_require__(2);
|
|
1807
|
+
|
|
1618
1808
|
var schemaUtils_1 = __webpack_require__(16);
|
|
1809
|
+
|
|
1619
1810
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1620
|
-
|
|
1811
|
+
|
|
1812
|
+
var VizCategory_1 = __webpack_require__(36);
|
|
1813
|
+
|
|
1621
1814
|
var configUtils_1 = __webpack_require__(20);
|
|
1815
|
+
|
|
1622
1816
|
var BackgroundColor_1 = __webpack_require__(53);
|
|
1817
|
+
|
|
1623
1818
|
var FONT_OPTIONS = new Set(['extraSmall', 'small', 'default', 'large', 'extraLarge']);
|
|
1624
1819
|
var dataContract = {
|
|
1625
1820
|
requiredDataSources: [],
|
|
1626
|
-
optionalDataSources: [
|
|
1627
|
-
// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
|
|
1821
|
+
optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
|
|
1628
1822
|
// {
|
|
1629
1823
|
// name: 'annotation',
|
|
1630
1824
|
// description: 'DataSource that populate event annotations',
|
|
@@ -1785,16 +1979,19 @@ var editorConfig = [{
|
|
|
1785
1979
|
/**
|
|
1786
1980
|
* visualization configuration
|
|
1787
1981
|
*/
|
|
1982
|
+
|
|
1788
1983
|
var config = {
|
|
1789
1984
|
/**
|
|
1790
1985
|
* unique viz key
|
|
1791
1986
|
*/
|
|
1792
1987
|
key: 'splunk.markdown',
|
|
1988
|
+
|
|
1793
1989
|
/**
|
|
1794
1990
|
* viz name
|
|
1795
1991
|
*/
|
|
1796
1992
|
name: (0, i18n_1._)('Markdown'),
|
|
1797
1993
|
category: VizCategory_1.VizCategory.COMPARISONS,
|
|
1994
|
+
|
|
1798
1995
|
/**
|
|
1799
1996
|
* viz icon
|
|
1800
1997
|
*/
|
|
@@ -1822,11 +2019,35 @@ exports.default = (0, configUtils_1.enhanceConfig)(config);
|
|
|
1822
2019
|
"use strict";
|
|
1823
2020
|
|
|
1824
2021
|
|
|
2022
|
+
var _classCallCheck = __webpack_require__(9);
|
|
2023
|
+
|
|
2024
|
+
var _createClass = __webpack_require__(18);
|
|
2025
|
+
|
|
1825
2026
|
Object.defineProperty(exports, "__esModule", {
|
|
1826
2027
|
value: true
|
|
1827
2028
|
});
|
|
1828
|
-
exports.
|
|
1829
|
-
|
|
2029
|
+
exports.DefaultVizActionHandler = void 0;
|
|
2030
|
+
|
|
2031
|
+
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
2032
|
+
function DefaultVizActionHandler() {
|
|
2033
|
+
_classCallCheck(this, DefaultVizActionHandler);
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
_createClass(DefaultVizActionHandler, [{
|
|
2037
|
+
key: "focus",
|
|
2038
|
+
value: function focus() {// noop
|
|
2039
|
+
}
|
|
2040
|
+
}, {
|
|
2041
|
+
key: "snapshot",
|
|
2042
|
+
value: function snapshot() {
|
|
2043
|
+
return null; // noop
|
|
2044
|
+
}
|
|
2045
|
+
}]);
|
|
2046
|
+
|
|
2047
|
+
return DefaultVizActionHandler;
|
|
2048
|
+
}();
|
|
2049
|
+
|
|
2050
|
+
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1830
2051
|
|
|
1831
2052
|
/***/ }),
|
|
1832
2053
|
|
|
@@ -1840,7 +2061,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1840
2061
|
value: true
|
|
1841
2062
|
});
|
|
1842
2063
|
exports.useDeepMemo = void 0;
|
|
2064
|
+
|
|
1843
2065
|
var react_1 = __webpack_require__(1);
|
|
2066
|
+
|
|
1844
2067
|
var lodash_1 = __webpack_require__(3);
|
|
1845
2068
|
/**
|
|
1846
2069
|
* This hook evaluates and stores the result of a passed function and only
|
|
@@ -1855,16 +2078,21 @@ var lodash_1 = __webpack_require__(3);
|
|
|
1855
2078
|
* @param fn the function to be executed and
|
|
1856
2079
|
* @param dependencies an array of dependencies
|
|
1857
2080
|
*/
|
|
2081
|
+
|
|
2082
|
+
|
|
1858
2083
|
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
1859
2084
|
var ref = (0, react_1.useRef)();
|
|
2085
|
+
|
|
1860
2086
|
if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
|
|
1861
2087
|
ref.current = {
|
|
1862
2088
|
dependencies: dependencies,
|
|
1863
2089
|
value: fn()
|
|
1864
2090
|
};
|
|
1865
2091
|
}
|
|
2092
|
+
|
|
1866
2093
|
return ref.current.value;
|
|
1867
2094
|
};
|
|
2095
|
+
|
|
1868
2096
|
exports.useDeepMemo = useDeepMemo;
|
|
1869
2097
|
|
|
1870
2098
|
/***/ }),
|
|
@@ -1879,19 +2107,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1879
2107
|
value: true
|
|
1880
2108
|
});
|
|
1881
2109
|
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
2110
|
+
|
|
1882
2111
|
var React = __webpack_require__(1);
|
|
2112
|
+
|
|
1883
2113
|
var T = __webpack_require__(0);
|
|
2114
|
+
|
|
1884
2115
|
var i18n_1 = __webpack_require__(2);
|
|
2116
|
+
|
|
1885
2117
|
var Message_1 = __webpack_require__(10);
|
|
2118
|
+
|
|
1886
2119
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
1887
2120
|
/**
|
|
1888
2121
|
* @method isMissing
|
|
1889
2122
|
* @param {any} v
|
|
1890
2123
|
* @returns {boolean} true if the input value === null or undefined
|
|
1891
2124
|
*/
|
|
2125
|
+
|
|
2126
|
+
|
|
1892
2127
|
var isMissing = function isMissing(v) {
|
|
1893
2128
|
return v === null || v === undefined;
|
|
1894
2129
|
};
|
|
2130
|
+
|
|
1895
2131
|
exports.isMissing = isMissing;
|
|
1896
2132
|
/**
|
|
1897
2133
|
* @method misskingKeys
|
|
@@ -1899,11 +2135,13 @@ exports.isMissing = isMissing;
|
|
|
1899
2135
|
* @param {object} target
|
|
1900
2136
|
* @returns {string[]} the keys of missing required props
|
|
1901
2137
|
*/
|
|
2138
|
+
|
|
1902
2139
|
var missingKeys = function missingKeys(keys, target) {
|
|
1903
2140
|
return keys.filter(function (k) {
|
|
1904
2141
|
return (0, exports.isMissing)(target[k]);
|
|
1905
2142
|
});
|
|
1906
2143
|
};
|
|
2144
|
+
|
|
1907
2145
|
exports.missingKeys = missingKeys;
|
|
1908
2146
|
var propTypes = {
|
|
1909
2147
|
width: T.oneOfType([T.string, T.number]),
|
|
@@ -1917,10 +2155,11 @@ var propTypes = {
|
|
|
1917
2155
|
* @param {MissingPropsProps} props
|
|
1918
2156
|
* @returns {React.ReactElement}
|
|
1919
2157
|
*/
|
|
2158
|
+
|
|
1920
2159
|
var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
1921
2160
|
var width = props.width,
|
|
1922
|
-
|
|
1923
|
-
|
|
2161
|
+
height = props.height,
|
|
2162
|
+
missingProps = props.missingProps;
|
|
1924
2163
|
return React.createElement(Message_1.default, {
|
|
1925
2164
|
"data-test": "message",
|
|
1926
2165
|
width: width,
|
|
@@ -1928,6 +2167,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
|
1928
2167
|
message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
|
|
1929
2168
|
});
|
|
1930
2169
|
};
|
|
2170
|
+
|
|
1931
2171
|
exports.MissingPropsMessage = MissingPropsMessage;
|
|
1932
2172
|
exports.MissingPropsMessage.propTypes = propTypes;
|
|
1933
2173
|
exports.MissingPropsMessage.defaultProps = {
|
|
@@ -1947,15 +2187,19 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage)
|
|
|
1947
2187
|
Object.defineProperty(exports, "__esModule", {
|
|
1948
2188
|
value: true
|
|
1949
2189
|
});
|
|
2190
|
+
|
|
1950
2191
|
var React = __webpack_require__(1);
|
|
2192
|
+
|
|
1951
2193
|
var styled_components_1 = __webpack_require__(4);
|
|
2194
|
+
|
|
1952
2195
|
var hocUtils_1 = __webpack_require__(15);
|
|
2196
|
+
|
|
1953
2197
|
var Cover = styled_components_1.default.div.withConfig({
|
|
1954
2198
|
displayName: "withEditModeCover__Cover",
|
|
1955
2199
|
componentId: "sc-1gsbnxb-0"
|
|
1956
2200
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1957
2201
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1958
|
-
'data-splunk-visualization-version': "26.
|
|
2202
|
+
'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
|
|
1959
2203
|
}).withConfig({
|
|
1960
2204
|
displayName: "withEditModeCover__Blocker",
|
|
1961
2205
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -1966,6 +2210,7 @@ var Blocker = styled_components_1.default.div.attrs({
|
|
|
1966
2210
|
* @param {ExtendedDashViz} Visualization
|
|
1967
2211
|
* @returns {ExtendedDashViz} Wrapper
|
|
1968
2212
|
*/
|
|
2213
|
+
|
|
1969
2214
|
var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
|
|
1970
2215
|
var Wrapper = function Wrapper(props) {
|
|
1971
2216
|
var mode = props.mode;
|
|
@@ -1974,12 +2219,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
|
|
|
1974
2219
|
"data-test": "edit-mode-cover"
|
|
1975
2220
|
}));
|
|
1976
2221
|
};
|
|
2222
|
+
|
|
1977
2223
|
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
1978
2224
|
Wrapper: Wrapper,
|
|
1979
2225
|
Visualization: Visualization
|
|
1980
2226
|
});
|
|
1981
2227
|
return Wrapper;
|
|
1982
2228
|
};
|
|
2229
|
+
|
|
1983
2230
|
exports.default = withEditModeCover;
|
|
1984
2231
|
|
|
1985
2232
|
/***/ }),
|
|
@@ -1993,27 +2240,37 @@ exports.default = withEditModeCover;
|
|
|
1993
2240
|
Object.defineProperty(exports, "__esModule", {
|
|
1994
2241
|
value: true
|
|
1995
2242
|
});
|
|
2243
|
+
|
|
1996
2244
|
var React = __webpack_require__(1);
|
|
2245
|
+
|
|
1997
2246
|
var colorUtils_1 = __webpack_require__(12);
|
|
2247
|
+
|
|
1998
2248
|
var variables_1 = __webpack_require__(11);
|
|
2249
|
+
|
|
1999
2250
|
var IconPlaceholder_1 = __webpack_require__(32);
|
|
2251
|
+
|
|
2000
2252
|
var VizBehavior_1 = __webpack_require__(6);
|
|
2253
|
+
|
|
2001
2254
|
var hocUtils_1 = __webpack_require__(15);
|
|
2255
|
+
|
|
2002
2256
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
2003
2257
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
2004
2258
|
var config = Visualization.config;
|
|
2005
2259
|
var themes = config.themes;
|
|
2260
|
+
|
|
2006
2261
|
var Wrapper = function Wrapper(props) {
|
|
2007
2262
|
var _a, _b;
|
|
2263
|
+
|
|
2008
2264
|
var dataSources = props.dataSources,
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2265
|
+
loading = props.loading,
|
|
2266
|
+
options = props.options,
|
|
2267
|
+
height = props.height,
|
|
2268
|
+
width = props.width;
|
|
2013
2269
|
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
2014
2270
|
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);
|
|
2015
2271
|
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
2016
2272
|
var iconColor = variables_1.default.contentColorActive(props);
|
|
2273
|
+
|
|
2017
2274
|
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
2018
2275
|
return React.createElement(IconPlaceholder_1.default, {
|
|
2019
2276
|
"data-test": "icon-placeholder",
|
|
@@ -2024,14 +2281,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
2024
2281
|
iconColor: iconColor
|
|
2025
2282
|
});
|
|
2026
2283
|
}
|
|
2284
|
+
|
|
2027
2285
|
return React.createElement(Visualization, Object.assign({}, props));
|
|
2028
2286
|
};
|
|
2287
|
+
|
|
2029
2288
|
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
2030
2289
|
Wrapper: Wrapper,
|
|
2031
2290
|
Visualization: Visualization
|
|
2032
2291
|
});
|
|
2033
2292
|
return Wrapper;
|
|
2034
2293
|
};
|
|
2294
|
+
|
|
2035
2295
|
exports.default = withPlaceholder;
|
|
2036
2296
|
|
|
2037
2297
|
/***/ }),
|
|
@@ -2045,11 +2305,13 @@ exports.default = withPlaceholder;
|
|
|
2045
2305
|
Object.defineProperty(exports, "__esModule", {
|
|
2046
2306
|
value: true
|
|
2047
2307
|
});
|
|
2308
|
+
|
|
2048
2309
|
var i18n_1 = __webpack_require__(2);
|
|
2310
|
+
|
|
2049
2311
|
var background = function background(_ref) {
|
|
2050
2312
|
var label = _ref.label,
|
|
2051
|
-
|
|
2052
|
-
|
|
2313
|
+
themes = _ref.themes,
|
|
2314
|
+
labelPosition = _ref.labelPosition;
|
|
2053
2315
|
return [{
|
|
2054
2316
|
label: (0, i18n_1._)(label || 'Background'),
|
|
2055
2317
|
option: 'backgroundColor',
|
|
@@ -2060,6 +2322,7 @@ var background = function background(_ref) {
|
|
|
2060
2322
|
}
|
|
2061
2323
|
}];
|
|
2062
2324
|
};
|
|
2325
|
+
|
|
2063
2326
|
exports.default = background;
|
|
2064
2327
|
|
|
2065
2328
|
/***/ }),
|
|
@@ -2082,6 +2345,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2082
2345
|
});
|
|
2083
2346
|
exports.VizBehavior = void 0;
|
|
2084
2347
|
var VizBehavior;
|
|
2348
|
+
|
|
2085
2349
|
(function (VizBehavior) {
|
|
2086
2350
|
/**
|
|
2087
2351
|
* Dynamic Options Behavior.
|
|
@@ -2101,6 +2365,7 @@ var VizBehavior;
|
|
|
2101
2365
|
* missing.
|
|
2102
2366
|
* @type {string}
|
|
2103
2367
|
*/
|
|
2368
|
+
|
|
2104
2369
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
2105
2370
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
2106
2371
|
VizBehavior["TRELLIS"] = "trellis";
|
|
@@ -2129,17 +2394,17 @@ module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
|
2129
2394
|
|
|
2130
2395
|
/***/ }),
|
|
2131
2396
|
|
|
2132
|
-
/***/
|
|
2397
|
+
/***/ 83:
|
|
2133
2398
|
/***/ (function(module, exports) {
|
|
2134
2399
|
|
|
2135
|
-
module.exports = require("@
|
|
2400
|
+
module.exports = require("@splunk/visualization-encoding/utils/types");
|
|
2136
2401
|
|
|
2137
2402
|
/***/ }),
|
|
2138
2403
|
|
|
2139
|
-
/***/
|
|
2404
|
+
/***/ 9:
|
|
2140
2405
|
/***/ (function(module, exports) {
|
|
2141
2406
|
|
|
2142
|
-
module.exports = require("@
|
|
2407
|
+
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
2143
2408
|
|
|
2144
2409
|
/***/ })
|
|
2145
2410
|
|