@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/Markdown.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 = 423);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -113,17 +113,17 @@ module.exports = require("@splunk/visualizations-shared/Message");
|
|
|
113
113
|
|
|
114
114
|
/***/ }),
|
|
115
115
|
|
|
116
|
-
/***/
|
|
116
|
+
/***/ 11:
|
|
117
117
|
/***/ (function(module, exports) {
|
|
118
118
|
|
|
119
|
-
module.exports = require("@splunk/
|
|
119
|
+
module.exports = require("@splunk/themes/variables");
|
|
120
120
|
|
|
121
121
|
/***/ }),
|
|
122
122
|
|
|
123
|
-
/***/
|
|
123
|
+
/***/ 110:
|
|
124
124
|
/***/ (function(module, exports) {
|
|
125
125
|
|
|
126
|
-
module.exports = require("@splunk/
|
|
126
|
+
module.exports = require("@splunk/react-ui/Paragraph");
|
|
127
127
|
|
|
128
128
|
/***/ }),
|
|
129
129
|
|
|
@@ -134,14 +134,14 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
|
134
134
|
|
|
135
135
|
/***/ }),
|
|
136
136
|
|
|
137
|
-
/***/
|
|
137
|
+
/***/ 122:
|
|
138
138
|
/***/ (function(module, exports) {
|
|
139
139
|
|
|
140
140
|
module.exports = require("@splunk/react-ui/Markdown");
|
|
141
141
|
|
|
142
142
|
/***/ }),
|
|
143
143
|
|
|
144
|
-
/***/
|
|
144
|
+
/***/ 125:
|
|
145
145
|
/***/ (function(module, exports) {
|
|
146
146
|
|
|
147
147
|
module.exports = require("@splunk/react-ui/Heading");
|
|
@@ -157,40 +157,46 @@ 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 {
|
|
168
174
|
style: {
|
|
169
|
-
width: style_1.toPx(width)
|
|
175
|
+
width: (0, style_1.toPx)(width)
|
|
170
176
|
}
|
|
171
177
|
};
|
|
172
178
|
}).withConfig({
|
|
173
179
|
displayName: "FixedSizeContainer__Item",
|
|
174
180
|
componentId: "sc-1yhgpod-0"
|
|
175
181
|
})(["position:relative;background-color:", "};"], function (props) {
|
|
176
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
177
|
-
});
|
|
178
|
-
|
|
182
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
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
|
-
width: style_1.toPx(width)
|
|
190
|
+
width: (0, style_1.toPx)(width)
|
|
185
191
|
}), height && {
|
|
186
|
-
height: style_1.toPx(height)
|
|
192
|
+
height: (0, style_1.toPx)(height)
|
|
187
193
|
})
|
|
188
194
|
};
|
|
189
195
|
}).withConfig({
|
|
190
196
|
displayName: "FixedSizeContainer__FixSizeItem",
|
|
191
197
|
componentId: "sc-1yhgpod-1"
|
|
192
198
|
})(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
|
|
193
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
199
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
194
200
|
});
|
|
195
201
|
var ItemContent = styled_components_1.default.div.withConfig({
|
|
196
202
|
displayName: "FixedSizeContainer__ItemContent",
|
|
@@ -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": "
|
|
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,38 +280,63 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
268
280
|
}
|
|
269
281
|
});
|
|
270
282
|
};
|
|
283
|
+
|
|
271
284
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
272
285
|
|
|
273
286
|
/***/ }),
|
|
274
287
|
|
|
275
|
-
/***/
|
|
288
|
+
/***/ 16:
|
|
289
|
+
/***/ (function(module, exports) {
|
|
290
|
+
|
|
291
|
+
module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
292
|
+
|
|
293
|
+
/***/ }),
|
|
294
|
+
|
|
295
|
+
/***/ 161:
|
|
276
296
|
/***/ (function(module, exports, __webpack_require__) {
|
|
277
297
|
|
|
278
298
|
"use strict";
|
|
279
299
|
|
|
280
300
|
|
|
281
|
-
var _taggedTemplateLiteral = __webpack_require__(
|
|
301
|
+
var _taggedTemplateLiteral = __webpack_require__(59);
|
|
302
|
+
|
|
282
303
|
var _templateObject;
|
|
304
|
+
|
|
283
305
|
Object.defineProperty(exports, "__esModule", {
|
|
284
306
|
value: true
|
|
285
307
|
});
|
|
286
308
|
exports.getFontMap = exports.config = exports.themes = exports.computeVizProps = exports.FONT_SIZES = void 0;
|
|
309
|
+
|
|
287
310
|
var lodash_1 = __webpack_require__(3);
|
|
288
|
-
|
|
311
|
+
|
|
312
|
+
var types_1 = __webpack_require__(83);
|
|
313
|
+
|
|
289
314
|
var React = __webpack_require__(1);
|
|
315
|
+
|
|
290
316
|
var style_1 = __webpack_require__(14);
|
|
291
|
-
|
|
317
|
+
|
|
318
|
+
var Markdown_1 = __webpack_require__(122);
|
|
319
|
+
|
|
292
320
|
var styled_components_1 = __webpack_require__(4);
|
|
321
|
+
|
|
293
322
|
var T = __webpack_require__(0);
|
|
294
|
-
|
|
295
|
-
var
|
|
296
|
-
|
|
297
|
-
var
|
|
298
|
-
|
|
299
|
-
var
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
323
|
+
|
|
324
|
+
var themes_1 = __webpack_require__(60);
|
|
325
|
+
|
|
326
|
+
var Heading_1 = __webpack_require__(125);
|
|
327
|
+
|
|
328
|
+
var Paragraph_1 = __webpack_require__(110);
|
|
329
|
+
|
|
330
|
+
var List_1 = __webpack_require__(424);
|
|
331
|
+
|
|
332
|
+
var Code_1 = __webpack_require__(425);
|
|
333
|
+
|
|
334
|
+
var withDashboardViz_1 = __webpack_require__(37);
|
|
335
|
+
|
|
336
|
+
var config_1 = __webpack_require__(426);
|
|
337
|
+
|
|
338
|
+
exports.config = config_1.default; // map of valid font sizes with elements' respective pixel sizes
|
|
339
|
+
|
|
303
340
|
exports.FONT_SIZES = {
|
|
304
341
|
extraSmall: {
|
|
305
342
|
h1: 18,
|
|
@@ -331,19 +368,19 @@ exports.FONT_SIZES = {
|
|
|
331
368
|
h3: 24,
|
|
332
369
|
p: 18
|
|
333
370
|
}
|
|
334
|
-
};
|
|
335
|
-
// startsWithHeader is a prop that can be
|
|
371
|
+
}; // startsWithHeader is a prop that can be
|
|
336
372
|
// falsy if the markdown text begins with text
|
|
337
373
|
// or the number of heading level;
|
|
338
374
|
// casting heading level below 4 to 4
|
|
339
375
|
// because ReactMarkdown supports heading level 1-4
|
|
376
|
+
|
|
340
377
|
var MarkdownContainer = styled_components_1.default.div.withConfig({
|
|
341
378
|
displayName: "Markdown__MarkdownContainer",
|
|
342
379
|
componentId: "zd3qkg-0"
|
|
343
380
|
})(["overflow:auto;position:relative;box-sizing:border-box;", ";", ";background-color:", ";transform-origin:center;transform:rotate(", "deg);& *:not(code):not(pre):not(code *):not(a){color:", ";}", ";"], function (props) {
|
|
344
|
-
return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
|
|
381
|
+
return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
|
|
345
382
|
}, function (props) {
|
|
346
|
-
return style_1.toPadding(props.padding);
|
|
383
|
+
return (0, style_1.toPadding)(props.padding);
|
|
347
384
|
}, function (props) {
|
|
348
385
|
return props.backgroundColor;
|
|
349
386
|
}, function (props) {
|
|
@@ -357,13 +394,13 @@ var MarkdownContainer = styled_components_1.default.div.withConfig({
|
|
|
357
394
|
var CodeBlockContainer = styled_components_1.default.div.withConfig({
|
|
358
395
|
displayName: "Markdown__CodeBlockContainer",
|
|
359
396
|
componentId: "zd3qkg-1"
|
|
360
|
-
})(["padding:", ";margin:", " 0;background-color:", ";pre[data-test='code']{margin-bottom:0px;}code{font-size:", "px !important;line-height:", "px !important;}"], themes_1.pick({
|
|
397
|
+
})(["padding:", ";margin:", " 0;background-color:", ";pre[data-test='code']{margin-bottom:0px;}code{font-size:", "px !important;line-height:", "px !important;}"], (0, themes_1.pick)({
|
|
361
398
|
enterprise: themes_1.variables.spacingHalf,
|
|
362
|
-
prisma: styled_components_1.css(_templateObject || (_templateObject = _taggedTemplateLiteral(["10px ", ""])), themes_1.variables.spacingLarge)
|
|
363
|
-
}), themes_1.pick({
|
|
399
|
+
prisma: (0, styled_components_1.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["10px ", ""])), themes_1.variables.spacingLarge)
|
|
400
|
+
}), (0, themes_1.pick)({
|
|
364
401
|
enterprise: themes_1.variables.spacingHalf,
|
|
365
402
|
prisma: themes_1.variables.spacingLarge
|
|
366
|
-
}), themes_1.pick({
|
|
403
|
+
}), (0, themes_1.pick)({
|
|
367
404
|
enterprise: {
|
|
368
405
|
light: themes_1.variables.gray96,
|
|
369
406
|
dark: themes_1.variables.gray22
|
|
@@ -377,37 +414,43 @@ var CodeBlockContainer = styled_components_1.default.div.withConfig({
|
|
|
377
414
|
var CodeInlineContainer = styled_components_1.default.code.withConfig({
|
|
378
415
|
displayName: "Markdown__CodeInlineContainer",
|
|
379
416
|
componentId: "zd3qkg-2"
|
|
380
|
-
})(["", ";font-family:", ";background-color:", ";"], themes_1.mixins.reset('inline'), themes_1.variables.monoFontFamily, themes_1.pick({
|
|
417
|
+
})(["", ";font-family:", ";background-color:", ";"], themes_1.mixins.reset('inline'), themes_1.variables.monoFontFamily, (0, themes_1.pick)({
|
|
381
418
|
enterprise: {
|
|
382
419
|
light: themes_1.variables.gray92,
|
|
383
420
|
dark: themes_1.variables.gray22
|
|
384
421
|
},
|
|
385
422
|
prisma: themes_1.variables.neutral200
|
|
386
|
-
}));
|
|
387
|
-
// 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
|
|
388
424
|
// passed is invalid (does not exist in FONT_SIZES), the `default` value is used.
|
|
425
|
+
|
|
389
426
|
var getFontMap = function getFontMap(fontSize) {
|
|
390
427
|
var font = fontSize;
|
|
428
|
+
|
|
391
429
|
if (!exports.FONT_SIZES[fontSize] && fontSize !== 'custom') {
|
|
392
430
|
console.error("'".concat(fontSize, "' is not a valid value for Markdown's fontSize option. Using the 'default' font size."));
|
|
393
431
|
font = 'default';
|
|
394
432
|
}
|
|
433
|
+
|
|
395
434
|
return exports.FONT_SIZES[font];
|
|
396
435
|
};
|
|
436
|
+
|
|
397
437
|
exports.getFontMap = getFontMap;
|
|
438
|
+
|
|
398
439
|
var handleLinkClick = function handleLinkClick(e) {
|
|
399
440
|
return e.stopPropagation();
|
|
400
441
|
};
|
|
442
|
+
|
|
401
443
|
var StyledA = styled_components_1.default.a.withConfig({
|
|
402
444
|
displayName: "Markdown__StyledA",
|
|
403
445
|
componentId: "zd3qkg-3"
|
|
404
|
-
})(["text-decoration:underlined;"]);
|
|
405
|
-
|
|
446
|
+
})(["text-decoration:underlined;"]); // returns renderers customized with the appropriate font sizes given the provided `fontSize` value.
|
|
447
|
+
|
|
406
448
|
var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize, customFontSize) {
|
|
407
449
|
// defaults to customFontSize of 14px if value is invalid
|
|
408
|
-
var cleanedCustomFontSize = types_1.isNumber(customFontSize) ? customFontSize : 14;
|
|
450
|
+
var cleanedCustomFontSize = (0, types_1.isNumber)(customFontSize) ? customFontSize : 14;
|
|
409
451
|
var isCustomFontSize = fontSize === 'custom';
|
|
410
452
|
/* eslint-disable react/display-name, react/prop-types */
|
|
453
|
+
|
|
411
454
|
var fontMap = isCustomFontSize ? {
|
|
412
455
|
h1: cleanedCustomFontSize * 2.0,
|
|
413
456
|
h2: cleanedCustomFontSize * 1.5,
|
|
@@ -426,7 +469,7 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
|
|
|
426
469
|
},
|
|
427
470
|
headingRenderer: function headingRenderer(_ref3) {
|
|
428
471
|
var children = _ref3.children,
|
|
429
|
-
|
|
472
|
+
level = _ref3.level;
|
|
430
473
|
return React.createElement(Heading_1.default, {
|
|
431
474
|
level: level,
|
|
432
475
|
style: Object.assign({
|
|
@@ -437,7 +480,7 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
|
|
|
437
480
|
},
|
|
438
481
|
itemRenderer: function itemRenderer(_ref4) {
|
|
439
482
|
var children = _ref4.children,
|
|
440
|
-
|
|
483
|
+
nodeKey = _ref4.nodeKey;
|
|
441
484
|
return React.createElement(List_1.default.Item, {
|
|
442
485
|
style: Object.assign({
|
|
443
486
|
fontSize: fontMap.p,
|
|
@@ -448,8 +491,8 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
|
|
|
448
491
|
},
|
|
449
492
|
codeBlockRenderer: function codeBlockRenderer(_ref5) {
|
|
450
493
|
var language = _ref5.language,
|
|
451
|
-
|
|
452
|
-
|
|
494
|
+
literal = _ref5.literal,
|
|
495
|
+
nodeKey = _ref5.nodeKey;
|
|
453
496
|
return React.createElement(CodeBlockContainer, {
|
|
454
497
|
fontSize: fontMap.p
|
|
455
498
|
}, React.createElement(Code_1.default, {
|
|
@@ -468,7 +511,7 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
|
|
|
468
511
|
},
|
|
469
512
|
linkRenderer: function linkRenderer(_ref7) {
|
|
470
513
|
var href = _ref7.href,
|
|
471
|
-
|
|
514
|
+
children = _ref7.children;
|
|
472
515
|
return React.createElement(StyledA, {
|
|
473
516
|
href: href,
|
|
474
517
|
onClick: handleLinkClick
|
|
@@ -476,25 +519,30 @@ var getMarkdownRenderer = function getMarkdownRenderer(fontFamilyStyle, fontSize
|
|
|
476
519
|
}
|
|
477
520
|
};
|
|
478
521
|
};
|
|
522
|
+
|
|
479
523
|
var MarkdownVisualization = function MarkdownVisualization(_ref8) {
|
|
480
524
|
var height = _ref8.height,
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
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
|
+
|
|
491
536
|
var _a;
|
|
492
|
-
|
|
493
|
-
|
|
537
|
+
|
|
538
|
+
var _ref9 = (0, themes_1.useSplunkTheme)(),
|
|
539
|
+
defaultFontFamily = _ref9.fontFamily; // font-family style for non-code content - default font family appended to custom option value as fallback
|
|
540
|
+
|
|
541
|
+
|
|
494
542
|
var markdownContentFontFamilyStyle = {
|
|
495
543
|
fontFamily: "".concat(fontFamily, ", ").concat(defaultFontFamily)
|
|
496
|
-
};
|
|
497
|
-
|
|
544
|
+
}; // because DSL evaluation is not guaranteed to return string data if `markdown` is powered by DSL, we do a typecast here
|
|
545
|
+
|
|
498
546
|
var stringifiedMarkdown = "".concat(markdown);
|
|
499
547
|
var renderersForFontSize = getMarkdownRenderer(markdownContentFontFamilyStyle, fontSize, customFontSize);
|
|
500
548
|
return React.createElement(MarkdownContainer, {
|
|
@@ -516,6 +564,7 @@ var MarkdownVisualization = function MarkdownVisualization(_ref8) {
|
|
|
516
564
|
onClick: onMarkdownClick
|
|
517
565
|
})));
|
|
518
566
|
};
|
|
567
|
+
|
|
519
568
|
var propTypes = {
|
|
520
569
|
width: T.oneOfType([T.string, T.number]),
|
|
521
570
|
height: T.oneOfType([T.string, T.number]),
|
|
@@ -544,11 +593,13 @@ var defaultProps = {
|
|
|
544
593
|
};
|
|
545
594
|
MarkdownVisualization.propTypes = propTypes;
|
|
546
595
|
MarkdownVisualization.defaultProps = defaultProps;
|
|
596
|
+
|
|
547
597
|
var computeVizProps = function computeVizProps(props) {
|
|
548
598
|
return props;
|
|
549
599
|
};
|
|
600
|
+
|
|
550
601
|
exports.computeVizProps = computeVizProps;
|
|
551
|
-
var Markdown = withDashboardViz_1.default({
|
|
602
|
+
var Markdown = (0, withDashboardViz_1.default)({
|
|
552
603
|
ReactViz: MarkdownVisualization,
|
|
553
604
|
vizConfig: config_1.default,
|
|
554
605
|
computeVizProps: exports.computeVizProps
|
|
@@ -559,13 +610,6 @@ exports.default = Markdown;
|
|
|
559
610
|
|
|
560
611
|
/***/ }),
|
|
561
612
|
|
|
562
|
-
/***/ 16:
|
|
563
|
-
/***/ (function(module, exports) {
|
|
564
|
-
|
|
565
|
-
module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
566
|
-
|
|
567
|
-
/***/ }),
|
|
568
|
-
|
|
569
613
|
/***/ 17:
|
|
570
614
|
/***/ (function(module, exports) {
|
|
571
615
|
|
|
@@ -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
|
-
var presetContext = lodash_1.get(preset, ['value', 'context'], {});
|
|
758
|
-
var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
|
|
828
|
+
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
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,14 +843,16 @@ 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
|
-
return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
|
|
848
|
+
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
776
849
|
return {
|
|
777
850
|
label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
|
|
778
851
|
value: i
|
|
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
|
/***/ }),
|
|
@@ -808,28 +885,28 @@ module.exports = require("@splunk/visualization-context/FeatureFlagContext");
|
|
|
808
885
|
/***/ 25:
|
|
809
886
|
/***/ (function(module, exports) {
|
|
810
887
|
|
|
811
|
-
module.exports = require("@splunk/
|
|
888
|
+
module.exports = require("@splunk/ui-utils/id");
|
|
812
889
|
|
|
813
890
|
/***/ }),
|
|
814
891
|
|
|
815
892
|
/***/ 26:
|
|
816
893
|
/***/ (function(module, exports) {
|
|
817
894
|
|
|
818
|
-
module.exports = require("@splunk/
|
|
895
|
+
module.exports = require("@splunk/visualization-context/TimezoneContext");
|
|
819
896
|
|
|
820
897
|
/***/ }),
|
|
821
898
|
|
|
822
899
|
/***/ 27:
|
|
823
900
|
/***/ (function(module, exports) {
|
|
824
901
|
|
|
825
|
-
module.exports = require("@splunk/visualizations-shared/
|
|
902
|
+
module.exports = require("@splunk/visualizations-shared/hocUtils");
|
|
826
903
|
|
|
827
904
|
/***/ }),
|
|
828
905
|
|
|
829
|
-
/***/
|
|
906
|
+
/***/ 28:
|
|
830
907
|
/***/ (function(module, exports) {
|
|
831
908
|
|
|
832
|
-
module.exports = require("@splunk/
|
|
909
|
+
module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
|
|
833
910
|
|
|
834
911
|
/***/ }),
|
|
835
912
|
|
|
@@ -840,7 +917,14 @@ module.exports = require("lodash");
|
|
|
840
917
|
|
|
841
918
|
/***/ }),
|
|
842
919
|
|
|
843
|
-
/***/
|
|
920
|
+
/***/ 30:
|
|
921
|
+
/***/ (function(module, exports) {
|
|
922
|
+
|
|
923
|
+
module.exports = require("@splunk/visualization-encoding/Options");
|
|
924
|
+
|
|
925
|
+
/***/ }),
|
|
926
|
+
|
|
927
|
+
/***/ 32:
|
|
844
928
|
/***/ (function(module, exports, __webpack_require__) {
|
|
845
929
|
|
|
846
930
|
"use strict";
|
|
@@ -850,11 +934,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
850
934
|
value: true
|
|
851
935
|
});
|
|
852
936
|
exports.shouldShowIconPlaceholder = void 0;
|
|
937
|
+
|
|
853
938
|
var React = __webpack_require__(1);
|
|
939
|
+
|
|
854
940
|
var T = __webpack_require__(0);
|
|
941
|
+
|
|
855
942
|
var lodash_1 = __webpack_require__(3);
|
|
943
|
+
|
|
856
944
|
var i18n_1 = __webpack_require__(2);
|
|
945
|
+
|
|
857
946
|
var Message_1 = __webpack_require__(10);
|
|
947
|
+
|
|
858
948
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
859
949
|
/**
|
|
860
950
|
* @method shouldShowIconPlaceholder
|
|
@@ -862,14 +952,17 @@ var FixedSizeContainer_1 = __webpack_require__(13);
|
|
|
862
952
|
* @param {boolean} loading
|
|
863
953
|
* @returns {boolean}
|
|
864
954
|
*/
|
|
955
|
+
|
|
956
|
+
|
|
865
957
|
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
866
958
|
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
867
|
-
var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
|
|
959
|
+
var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
|
|
868
960
|
var noData = data === undefined;
|
|
869
|
-
var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
|
|
961
|
+
var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields[0]', undefined);
|
|
870
962
|
var noFields = fields === undefined;
|
|
871
963
|
return loading || noData || noFields;
|
|
872
964
|
};
|
|
965
|
+
|
|
873
966
|
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
874
967
|
var propTypes = {
|
|
875
968
|
icon: T.func,
|
|
@@ -884,11 +977,13 @@ var propTypes = {
|
|
|
884
977
|
* @param {IconPlaceholderProps} props
|
|
885
978
|
* @returns {React.ReactElement}
|
|
886
979
|
*/
|
|
980
|
+
|
|
887
981
|
var IconPlaceholder = function IconPlaceholder(props) {
|
|
888
982
|
var width = props.width,
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
983
|
+
height = props.height,
|
|
984
|
+
icon = props.icon,
|
|
985
|
+
iconColor = props.iconColor;
|
|
986
|
+
|
|
892
987
|
if (icon) {
|
|
893
988
|
return React.createElement(icon, {
|
|
894
989
|
style: {
|
|
@@ -903,26 +998,21 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
903
998
|
height: '50%'
|
|
904
999
|
});
|
|
905
1000
|
}
|
|
1001
|
+
|
|
906
1002
|
return React.createElement(Message_1.default, {
|
|
907
1003
|
width: width,
|
|
908
1004
|
height: height,
|
|
909
1005
|
level: "warning",
|
|
910
|
-
message: i18n_1._('No DataSource Connected')
|
|
1006
|
+
message: (0, i18n_1._)('No DataSource Connected')
|
|
911
1007
|
});
|
|
912
1008
|
};
|
|
1009
|
+
|
|
913
1010
|
IconPlaceholder.propTypes = propTypes;
|
|
914
1011
|
IconPlaceholder.defaultProps = {
|
|
915
1012
|
width: '100%',
|
|
916
1013
|
height: 250
|
|
917
1014
|
};
|
|
918
|
-
exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
919
|
-
|
|
920
|
-
/***/ }),
|
|
921
|
-
|
|
922
|
-
/***/ 32:
|
|
923
|
-
/***/ (function(module, exports) {
|
|
924
|
-
|
|
925
|
-
module.exports = require("@splunk/ui-utils/id");
|
|
1015
|
+
exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
|
|
926
1016
|
|
|
927
1017
|
/***/ }),
|
|
928
1018
|
|
|
@@ -933,21 +1023,27 @@ module.exports = require("@splunk/ui-utils/id");
|
|
|
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,17 +1052,20 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
956
1052
|
none: 'asc'
|
|
957
1053
|
};
|
|
958
1054
|
var onSort;
|
|
1055
|
+
|
|
959
1056
|
if (typeof onRequestParamsChange === 'function') {
|
|
960
|
-
if (requestParams && lodash_1.has(requestParams, 'sort')) {
|
|
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
|
-
var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
1068
|
+
var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
970
1069
|
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
971
1070
|
offset: 0,
|
|
972
1071
|
sort: _defineProperty({}, sortKey, nextSortDir)
|
|
@@ -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
|
-
|
|
1020
|
-
var newParams = lodash_1.cloneDeep(requestParams);
|
|
1141
|
+
countArg = _ref2.count;
|
|
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
|
-
|
|
1084
|
-
var
|
|
1085
|
-
|
|
1086
|
-
var
|
|
1087
|
-
|
|
1215
|
+
|
|
1216
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(38);
|
|
1217
|
+
|
|
1218
|
+
var Options_1 = __webpack_require__(30);
|
|
1219
|
+
|
|
1220
|
+
var SanitizeProps_1 = __webpack_require__(39);
|
|
1221
|
+
|
|
1222
|
+
var TimezoneContext_1 = __webpack_require__(26);
|
|
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);
|
|
1090
|
-
|
|
1091
|
-
var
|
|
1092
|
-
|
|
1093
|
-
var
|
|
1094
|
-
|
|
1229
|
+
|
|
1230
|
+
var hocUtils_1 = __webpack_require__(27);
|
|
1231
|
+
|
|
1232
|
+
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
1233
|
+
|
|
1234
|
+
var async_dynamic_options_evaluator_1 = __webpack_require__(41);
|
|
1235
|
+
|
|
1236
|
+
var id_1 = __webpack_require__(25);
|
|
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
|
-
|
|
1114
|
-
|
|
1115
|
-
var
|
|
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
|
+
|
|
1268
|
+
var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
|
|
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,44 +1300,58 @@ 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');
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1311
|
+
|
|
1312
|
+
var _ref = (0, getSettingsFromThemedProps_1.default)({
|
|
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);
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1328
|
+
|
|
1329
|
+
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
|
|
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
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1339
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
1340
|
+
dataFramesInState = _React$useState8[0],
|
|
1341
|
+
setDataFramesInState = _React$useState8[1];
|
|
1342
|
+
|
|
1343
|
+
var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
|
|
1344
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
1345
|
+
useAsyncEvaluatedOptions = _React$useState10[0],
|
|
1346
|
+
setUseAsyncEvaluatedOptions = _React$useState10[1];
|
|
1347
|
+
|
|
1348
|
+
var isMounted = React.useRef(true);
|
|
1349
|
+
evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
|
|
1178
1350
|
try {
|
|
1179
1351
|
if (useAsyncEvaluatedOptions) {
|
|
1180
1352
|
var optionsToEvaluate = {
|
|
1181
|
-
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
1182
|
-
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
1353
|
+
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
1354
|
+
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
1183
1355
|
};
|
|
1184
1356
|
var asyncDynamicOptionsEvaluatorParams = {
|
|
1185
1357
|
visualizationID: visualizationID,
|
|
@@ -1190,21 +1362,23 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1190
1362
|
};
|
|
1191
1363
|
async_dynamic_options_evaluator_1.default.evaluate(asyncDynamicOptionsEvaluatorParams).then(function (results) {
|
|
1192
1364
|
setEvaluatedOptionsAsync(results.results);
|
|
1193
|
-
}).catch(function (
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1365
|
+
}).catch(function () {
|
|
1366
|
+
if (isMounted.current) {
|
|
1367
|
+
setUseAsyncEvaluatedOptions(false);
|
|
1368
|
+
}
|
|
1197
1369
|
});
|
|
1198
1370
|
} else {
|
|
1199
1371
|
var dataFrames = dataFramesInState;
|
|
1372
|
+
|
|
1200
1373
|
if (dataSources !== dataSourcesInState) {
|
|
1201
1374
|
setDataSourcesInState(dataSources);
|
|
1202
1375
|
dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
|
|
1203
1376
|
setDataFramesInState(dataFrames);
|
|
1204
1377
|
}
|
|
1378
|
+
|
|
1205
1379
|
return Options_1.Options.evaluate({
|
|
1206
|
-
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
1207
|
-
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
1380
|
+
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
1381
|
+
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
1208
1382
|
}, dataSources, themeFunc, dataFrames);
|
|
1209
1383
|
}
|
|
1210
1384
|
} catch (e) {
|
|
@@ -1212,67 +1386,76 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1212
1386
|
console.error("unexpected error evaluating options: ".concat(e.message));
|
|
1213
1387
|
return {};
|
|
1214
1388
|
}
|
|
1389
|
+
|
|
1215
1390
|
return {};
|
|
1216
1391
|
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
|
|
1217
|
-
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
1218
|
-
// trellis specific backgroundColor update for onComputedProps
|
|
1392
|
+
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
|
|
1219
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
|
|
1220
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
|
+
|
|
1221
1396
|
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
1222
1397
|
var clonedEvaluatedOptions = evaluatedOptionsToUse;
|
|
1398
|
+
|
|
1223
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) {
|
|
1224
1400
|
clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
|
|
1225
1401
|
backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
1226
1402
|
});
|
|
1227
|
-
}
|
|
1228
|
-
// useEffect hook needs to be initialized before any early returns
|
|
1403
|
+
} // useEffect hook needs to be initialized before any early returns
|
|
1229
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
|
+
|
|
1230
1407
|
React.useEffect(function () {
|
|
1231
1408
|
onComputedProps(clonedEvaluatedOptions);
|
|
1232
1409
|
});
|
|
1233
1410
|
React.useEffect(function () {
|
|
1234
1411
|
return function () {
|
|
1235
1412
|
if (useAsyncEvaluatedOptions) {
|
|
1413
|
+
isMounted.current = false;
|
|
1236
1414
|
async_dynamic_options_evaluator_1.default.reset(visualizationID);
|
|
1237
1415
|
}
|
|
1238
|
-
};
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
// 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
|
+
|
|
1242
1419
|
var _vizConfig$requiredPr = vizConfig.requiredProps,
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptionsToUse);
|
|
1420
|
+
requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
|
|
1421
|
+
supports = vizConfig.supports;
|
|
1422
|
+
var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
|
|
1423
|
+
|
|
1246
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
|
|
1247
1425
|
) {
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
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
|
+
|
|
1257
1436
|
var eventCallbackProps = {};
|
|
1437
|
+
|
|
1258
1438
|
if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
|
|
1259
1439
|
var supportedEvents = vizConfig.events;
|
|
1260
1440
|
Object.keys(supportedEvents).forEach(function (eventName) {
|
|
1261
|
-
var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
|
|
1262
|
-
eventCallbackProps[eventCallbackPropName] = null;
|
|
1263
|
-
// todo: refactor single value and single value icon to send payload from viz
|
|
1441
|
+
var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
|
|
1442
|
+
eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
|
|
1264
1443
|
// then remove these lines
|
|
1444
|
+
|
|
1265
1445
|
var payloadKeys = supportedEvents[eventName].payloadKeys;
|
|
1266
1446
|
var payload = {};
|
|
1447
|
+
|
|
1267
1448
|
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
1268
1449
|
payloadKeys.forEach(function (p) {
|
|
1269
1450
|
payload[p] = evaluatedOptionsToUse[p];
|
|
1270
1451
|
});
|
|
1271
1452
|
}
|
|
1453
|
+
|
|
1272
1454
|
eventCallbackProps[eventCallbackPropName] = function (ev) {
|
|
1273
1455
|
if (ev && ev.payload) {
|
|
1274
1456
|
payload = ev.payload;
|
|
1275
1457
|
}
|
|
1458
|
+
|
|
1276
1459
|
return onEventTrigger({
|
|
1277
1460
|
originalEvent: ev,
|
|
1278
1461
|
payload: payload,
|
|
@@ -1280,8 +1463,9 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1280
1463
|
});
|
|
1281
1464
|
};
|
|
1282
1465
|
});
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1466
|
+
} // compute pure viz props which are not from options
|
|
1467
|
+
|
|
1468
|
+
|
|
1285
1469
|
var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
1286
1470
|
themeFunc: themeFunc
|
|
1287
1471
|
}));
|
|
@@ -1299,21 +1483,25 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1299
1483
|
* In future, we could automatically detect which all datasources are being used
|
|
1300
1484
|
* and bind those magically to pagination/sorting behavior.
|
|
1301
1485
|
*/
|
|
1486
|
+
|
|
1302
1487
|
var dataSourceMetadata = {};
|
|
1303
1488
|
var OptionKey = 'paginateDataSourceKey';
|
|
1304
|
-
var paginateDataSourceKey = lodash_1.has(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
var
|
|
1489
|
+
var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1490
|
+
|
|
1491
|
+
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
|
|
1492
|
+
var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
1493
|
+
var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
1494
|
+
|
|
1308
1495
|
var handleRequestParamsChange = function handleRequestParamsChange(payload) {
|
|
1309
1496
|
return onRequestParamsChange(paginateDataSourceKey, payload);
|
|
1310
1497
|
};
|
|
1311
|
-
|
|
1498
|
+
|
|
1499
|
+
var sortParams = (0, getSorting_1.getSortingParams)({
|
|
1312
1500
|
requestParams: requestParams,
|
|
1313
1501
|
meta: meta,
|
|
1314
1502
|
onRequestParamsChange: handleRequestParamsChange
|
|
1315
1503
|
});
|
|
1316
|
-
var paginatorParams = getPagination_1.getPaginationParams({
|
|
1504
|
+
var paginatorParams = (0, getPagination_1.getPaginationParams)({
|
|
1317
1505
|
requestParams: requestParams,
|
|
1318
1506
|
meta: meta,
|
|
1319
1507
|
onRequestParamsChange: handleRequestParamsChange
|
|
@@ -1322,115 +1510,132 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1322
1510
|
sortParams: sortParams,
|
|
1323
1511
|
paginatorParams: paginatorParams
|
|
1324
1512
|
};
|
|
1325
|
-
}
|
|
1326
|
-
|
|
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
|
+
|
|
1327
1516
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
1328
1517
|
return null;
|
|
1329
1518
|
}
|
|
1519
|
+
|
|
1330
1520
|
return React.createElement(SanitizedReactViz, Object.assign({
|
|
1331
1521
|
mode: mode,
|
|
1332
1522
|
width: width,
|
|
1333
1523
|
height: height
|
|
1334
1524
|
}, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
|
|
1335
1525
|
};
|
|
1526
|
+
|
|
1336
1527
|
DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
|
|
1337
1528
|
DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
|
|
1338
1529
|
// using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
|
|
1339
1530
|
theme: {}
|
|
1340
|
-
});
|
|
1341
|
-
|
|
1342
|
-
DashboardViz.config = vizConfig;
|
|
1343
|
-
|
|
1344
|
-
return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1531
|
+
}); // attach viz config
|
|
1532
|
+
|
|
1533
|
+
DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
|
|
1534
|
+
|
|
1535
|
+
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1345
1536
|
};
|
|
1537
|
+
|
|
1346
1538
|
exports.default = withDashboardViz;
|
|
1347
1539
|
|
|
1348
1540
|
/***/ }),
|
|
1349
1541
|
|
|
1350
|
-
/***/
|
|
1542
|
+
/***/ 38:
|
|
1351
1543
|
/***/ (function(module, exports) {
|
|
1352
1544
|
|
|
1353
1545
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
1354
1546
|
|
|
1355
1547
|
/***/ }),
|
|
1356
1548
|
|
|
1357
|
-
/***/
|
|
1549
|
+
/***/ 39:
|
|
1358
1550
|
/***/ (function(module, exports) {
|
|
1359
1551
|
|
|
1360
1552
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1361
1553
|
|
|
1362
1554
|
/***/ }),
|
|
1363
1555
|
|
|
1364
|
-
/***/
|
|
1556
|
+
/***/ 4:
|
|
1365
1557
|
/***/ (function(module, exports) {
|
|
1366
1558
|
|
|
1367
|
-
module.exports = require("
|
|
1559
|
+
module.exports = require("styled-components");
|
|
1368
1560
|
|
|
1369
1561
|
/***/ }),
|
|
1370
1562
|
|
|
1371
|
-
/***/
|
|
1563
|
+
/***/ 40:
|
|
1372
1564
|
/***/ (function(module, exports) {
|
|
1373
1565
|
|
|
1374
|
-
module.exports = require("
|
|
1566
|
+
module.exports = require("@splunk/moment");
|
|
1375
1567
|
|
|
1376
1568
|
/***/ }),
|
|
1377
1569
|
|
|
1378
|
-
/***/
|
|
1570
|
+
/***/ 41:
|
|
1379
1571
|
/***/ (function(module, exports) {
|
|
1380
1572
|
|
|
1381
1573
|
module.exports = require("@splunk/async-dynamic-options-evaluator");
|
|
1382
1574
|
|
|
1383
1575
|
/***/ }),
|
|
1384
1576
|
|
|
1385
|
-
/***/
|
|
1577
|
+
/***/ 42:
|
|
1386
1578
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1387
1579
|
|
|
1388
1580
|
"use strict";
|
|
1389
1581
|
|
|
1390
1582
|
|
|
1391
1583
|
var _classCallCheck = __webpack_require__(9);
|
|
1584
|
+
|
|
1392
1585
|
Object.defineProperty(exports, "__esModule", {
|
|
1393
1586
|
value: true
|
|
1394
1587
|
});
|
|
1395
1588
|
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
1396
1589
|
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
1590
|
+
|
|
1397
1591
|
var T = __webpack_require__(0);
|
|
1592
|
+
|
|
1398
1593
|
var lodash_1 = __webpack_require__(3);
|
|
1399
|
-
|
|
1400
|
-
// 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
|
+
|
|
1401
1598
|
exports.INITIAL_WIDTH = 250;
|
|
1402
1599
|
exports.INITIAL_HEIGHT = 250;
|
|
1403
1600
|
/**
|
|
1404
1601
|
* A Splunk visualization
|
|
1405
1602
|
*/
|
|
1603
|
+
|
|
1406
1604
|
var SplunkVisualization = function SplunkVisualization() {
|
|
1407
1605
|
_classCallCheck(this, SplunkVisualization);
|
|
1408
1606
|
};
|
|
1607
|
+
|
|
1409
1608
|
SplunkVisualization.propTypes = {
|
|
1410
1609
|
/**
|
|
1411
1610
|
* display mode
|
|
1412
1611
|
*/
|
|
1413
1612
|
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
1613
|
+
|
|
1414
1614
|
/**
|
|
1415
1615
|
* width in pixel or string, defaults to 100%
|
|
1416
1616
|
*/
|
|
1417
1617
|
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
1618
|
+
|
|
1418
1619
|
/**
|
|
1419
1620
|
* height in pixel or string
|
|
1420
1621
|
*/
|
|
1421
1622
|
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
1623
|
+
|
|
1422
1624
|
/**
|
|
1423
1625
|
* visualization context used for dynamic option evaluation
|
|
1424
1626
|
*/
|
|
1425
1627
|
context: T.object,
|
|
1628
|
+
|
|
1426
1629
|
/**
|
|
1427
1630
|
* visualization formatting options
|
|
1428
1631
|
*/
|
|
1429
1632
|
options: T.object,
|
|
1633
|
+
|
|
1430
1634
|
/**
|
|
1431
1635
|
* A callback to update formatting options
|
|
1432
1636
|
*/
|
|
1433
1637
|
onOptionsChange: T.func,
|
|
1638
|
+
|
|
1434
1639
|
/**
|
|
1435
1640
|
* datasource state which include data and request params, object key indicate the datasource type.
|
|
1436
1641
|
*/
|
|
@@ -1439,6 +1644,7 @@ SplunkVisualization.propTypes = {
|
|
|
1439
1644
|
* current request params
|
|
1440
1645
|
*/
|
|
1441
1646
|
requestParams: T.object,
|
|
1647
|
+
|
|
1442
1648
|
/**
|
|
1443
1649
|
* current dataset
|
|
1444
1650
|
*/
|
|
@@ -1446,6 +1652,7 @@ SplunkVisualization.propTypes = {
|
|
|
1446
1652
|
fields: T.array,
|
|
1447
1653
|
columns: T.array
|
|
1448
1654
|
}),
|
|
1655
|
+
|
|
1449
1656
|
/**
|
|
1450
1657
|
* error
|
|
1451
1658
|
*/
|
|
@@ -1453,29 +1660,35 @@ SplunkVisualization.propTypes = {
|
|
|
1453
1660
|
level: T.string,
|
|
1454
1661
|
message: T.string
|
|
1455
1662
|
}),
|
|
1663
|
+
|
|
1456
1664
|
/**
|
|
1457
1665
|
* meta data that came with the dataset
|
|
1458
1666
|
*/
|
|
1459
1667
|
meta: T.object
|
|
1460
1668
|
})),
|
|
1669
|
+
|
|
1461
1670
|
/**
|
|
1462
1671
|
* A callback to trigger event
|
|
1463
1672
|
*/
|
|
1464
1673
|
onEventTrigger: T.func,
|
|
1674
|
+
|
|
1465
1675
|
/**
|
|
1466
1676
|
* Inform viz if there are handlers listening to events
|
|
1467
1677
|
*/
|
|
1468
1678
|
hasEventHandlers: T.bool,
|
|
1679
|
+
|
|
1469
1680
|
/**
|
|
1470
1681
|
* A callback to communicate computed props to a consumer
|
|
1471
1682
|
*/
|
|
1472
1683
|
onComputedProps: T.func,
|
|
1684
|
+
|
|
1473
1685
|
/**
|
|
1474
1686
|
* A callback to obtain visualization api
|
|
1475
1687
|
*/
|
|
1476
1688
|
vizActionHandlerRef: T.func,
|
|
1477
1689
|
loading: T.bool,
|
|
1478
1690
|
theme: T.object,
|
|
1691
|
+
|
|
1479
1692
|
/**
|
|
1480
1693
|
* A callback to request new data with updated request params
|
|
1481
1694
|
*/
|
|
@@ -1484,6 +1697,7 @@ SplunkVisualization.propTypes = {
|
|
|
1484
1697
|
/**
|
|
1485
1698
|
*
|
|
1486
1699
|
*/
|
|
1700
|
+
|
|
1487
1701
|
SplunkVisualization.defaultProps = {
|
|
1488
1702
|
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
1489
1703
|
width: '100%',
|
|
@@ -1512,40 +1726,7 @@ exports.default = SplunkVisualization;
|
|
|
1512
1726
|
|
|
1513
1727
|
/***/ }),
|
|
1514
1728
|
|
|
1515
|
-
/***/
|
|
1516
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1517
|
-
|
|
1518
|
-
"use strict";
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
var _classCallCheck = __webpack_require__(9);
|
|
1522
|
-
var _createClass = __webpack_require__(18);
|
|
1523
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1524
|
-
value: true
|
|
1525
|
-
});
|
|
1526
|
-
exports.DefaultVizActionHandler = void 0;
|
|
1527
|
-
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
1528
|
-
function DefaultVizActionHandler() {
|
|
1529
|
-
_classCallCheck(this, DefaultVizActionHandler);
|
|
1530
|
-
}
|
|
1531
|
-
_createClass(DefaultVizActionHandler, [{
|
|
1532
|
-
key: "focus",
|
|
1533
|
-
value: function focus() {
|
|
1534
|
-
// noop
|
|
1535
|
-
}
|
|
1536
|
-
}, {
|
|
1537
|
-
key: "snapshot",
|
|
1538
|
-
value: function snapshot() {
|
|
1539
|
-
return null; // noop
|
|
1540
|
-
}
|
|
1541
|
-
}]);
|
|
1542
|
-
return DefaultVizActionHandler;
|
|
1543
|
-
}();
|
|
1544
|
-
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1545
|
-
|
|
1546
|
-
/***/ }),
|
|
1547
|
-
|
|
1548
|
-
/***/ 420:
|
|
1729
|
+
/***/ 423:
|
|
1549
1730
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1550
1731
|
|
|
1551
1732
|
"use strict";
|
|
@@ -1553,27 +1734,38 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
|
1553
1734
|
|
|
1554
1735
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1555
1736
|
if (k2 === undefined) k2 = k;
|
|
1556
|
-
Object.
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1737
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1738
|
+
|
|
1739
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1740
|
+
desc = {
|
|
1741
|
+
enumerable: true,
|
|
1742
|
+
get: function get() {
|
|
1743
|
+
return m[k];
|
|
1744
|
+
}
|
|
1745
|
+
};
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
Object.defineProperty(o, k2, desc);
|
|
1562
1749
|
} : function (o, m, k, k2) {
|
|
1563
1750
|
if (k2 === undefined) k2 = k;
|
|
1564
1751
|
o[k2] = m[k];
|
|
1565
1752
|
});
|
|
1753
|
+
|
|
1566
1754
|
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
1567
1755
|
for (var p in m) {
|
|
1568
1756
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1569
1757
|
}
|
|
1570
1758
|
};
|
|
1759
|
+
|
|
1571
1760
|
Object.defineProperty(exports, "__esModule", {
|
|
1572
1761
|
value: true
|
|
1573
1762
|
});
|
|
1574
1763
|
exports.default = void 0;
|
|
1575
|
-
|
|
1576
|
-
|
|
1764
|
+
|
|
1765
|
+
__exportStar(__webpack_require__(161), exports);
|
|
1766
|
+
|
|
1767
|
+
var Markdown_1 = __webpack_require__(161);
|
|
1768
|
+
|
|
1577
1769
|
Object.defineProperty(exports, "default", {
|
|
1578
1770
|
enumerable: true,
|
|
1579
1771
|
get: function get() {
|
|
@@ -1583,42 +1775,50 @@ Object.defineProperty(exports, "default", {
|
|
|
1583
1775
|
|
|
1584
1776
|
/***/ }),
|
|
1585
1777
|
|
|
1586
|
-
/***/
|
|
1778
|
+
/***/ 424:
|
|
1587
1779
|
/***/ (function(module, exports) {
|
|
1588
1780
|
|
|
1589
1781
|
module.exports = require("@splunk/react-ui/List");
|
|
1590
1782
|
|
|
1591
1783
|
/***/ }),
|
|
1592
1784
|
|
|
1593
|
-
/***/
|
|
1785
|
+
/***/ 425:
|
|
1594
1786
|
/***/ (function(module, exports) {
|
|
1595
1787
|
|
|
1596
1788
|
module.exports = require("@splunk/react-ui/Code");
|
|
1597
1789
|
|
|
1598
1790
|
/***/ }),
|
|
1599
1791
|
|
|
1600
|
-
/***/
|
|
1792
|
+
/***/ 426:
|
|
1601
1793
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1602
1794
|
|
|
1603
1795
|
"use strict";
|
|
1604
1796
|
|
|
1605
1797
|
|
|
1606
1798
|
var _toConsumableArray = __webpack_require__(8);
|
|
1799
|
+
|
|
1607
1800
|
Object.defineProperty(exports, "__esModule", {
|
|
1608
1801
|
value: true
|
|
1609
1802
|
});
|
|
1610
|
-
|
|
1803
|
+
|
|
1804
|
+
var themes_1 = __webpack_require__(60);
|
|
1805
|
+
|
|
1611
1806
|
var i18n_1 = __webpack_require__(2);
|
|
1807
|
+
|
|
1612
1808
|
var schemaUtils_1 = __webpack_require__(16);
|
|
1809
|
+
|
|
1613
1810
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1614
|
-
|
|
1811
|
+
|
|
1812
|
+
var VizCategory_1 = __webpack_require__(36);
|
|
1813
|
+
|
|
1615
1814
|
var configUtils_1 = __webpack_require__(20);
|
|
1815
|
+
|
|
1616
1816
|
var BackgroundColor_1 = __webpack_require__(53);
|
|
1817
|
+
|
|
1617
1818
|
var FONT_OPTIONS = new Set(['extraSmall', 'small', 'default', 'large', 'extraLarge']);
|
|
1618
1819
|
var dataContract = {
|
|
1619
1820
|
requiredDataSources: [],
|
|
1620
|
-
optionalDataSources: [
|
|
1621
|
-
// 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
|
|
1622
1822
|
// {
|
|
1623
1823
|
// name: 'annotation',
|
|
1624
1824
|
// description: 'DataSource that populate event annotations',
|
|
@@ -1656,7 +1856,7 @@ var optionsSchema = {
|
|
|
1656
1856
|
},
|
|
1657
1857
|
fontFamily: {
|
|
1658
1858
|
default: 'Splunk Platform Sans',
|
|
1659
|
-
pattern: schemaUtils_1.getPattern(['Splunk Platform Sans', 'Splunk Data Sans', 'Splunk Platform Mono', 'Arial', 'Helvetica', 'Times New Roman', 'Comic Sans MS']),
|
|
1859
|
+
pattern: (0, schemaUtils_1.getPattern)(['Splunk Platform Sans', 'Splunk Data Sans', 'Splunk Platform Mono', 'Arial', 'Helvetica', 'Times New Roman', 'Comic Sans MS']),
|
|
1660
1860
|
description: 'Specify the font family you would like to use for markdown content, such as "Comic Sans MS". Note: the font needs to be available to your end user.',
|
|
1661
1861
|
type: 'string'
|
|
1662
1862
|
},
|
|
@@ -1664,7 +1864,7 @@ var optionsSchema = {
|
|
|
1664
1864
|
description: 'Specify the font size you would like to use for markdown content. Font sizes range from extra small (10px for unformatted text) to extra large (18px for unformatted text) with the default being 14px for unformatted text.',
|
|
1665
1865
|
type: 'string',
|
|
1666
1866
|
default: 'default',
|
|
1667
|
-
pattern: schemaUtils_1.getPattern(['extraSmall', 'small', 'default', 'large', 'extraLarge', 'custom'])
|
|
1867
|
+
pattern: (0, schemaUtils_1.getPattern)(['extraSmall', 'small', 'default', 'large', 'extraLarge', 'custom'])
|
|
1668
1868
|
},
|
|
1669
1869
|
markdown: {
|
|
1670
1870
|
description: 'Add text using basic markdown syntax.',
|
|
@@ -1678,7 +1878,7 @@ var optionsSchema = {
|
|
|
1678
1878
|
};
|
|
1679
1879
|
var themes = {
|
|
1680
1880
|
defaultFontColor: function defaultFontColor(props) {
|
|
1681
|
-
return themes_1.pick({
|
|
1881
|
+
return (0, themes_1.pick)({
|
|
1682
1882
|
enterprise: {
|
|
1683
1883
|
dark: themes_1.variables.textColor(props),
|
|
1684
1884
|
light: themes_1.variables.textColor(props)
|
|
@@ -1688,20 +1888,20 @@ var themes = {
|
|
|
1688
1888
|
}
|
|
1689
1889
|
};
|
|
1690
1890
|
var editorConfig = [{
|
|
1691
|
-
label: i18n_1._('Color and style'),
|
|
1891
|
+
label: (0, i18n_1._)('Color and style'),
|
|
1692
1892
|
layout: [[{
|
|
1693
|
-
label: i18n_1._('Font'),
|
|
1893
|
+
label: (0, i18n_1._)('Font'),
|
|
1694
1894
|
option: 'fontColor',
|
|
1695
1895
|
editor: 'editor.color',
|
|
1696
1896
|
editorProps: {
|
|
1697
1897
|
labelPosition: 'top',
|
|
1698
1898
|
themes: themes
|
|
1699
1899
|
}
|
|
1700
|
-
}].concat(_toConsumableArray(BackgroundColor_1.default({
|
|
1900
|
+
}].concat(_toConsumableArray((0, BackgroundColor_1.default)({
|
|
1701
1901
|
label: 'Background',
|
|
1702
1902
|
themes: themes
|
|
1703
1903
|
}))), [{
|
|
1704
|
-
label: i18n_1._('Font family'),
|
|
1904
|
+
label: (0, i18n_1._)('Font family'),
|
|
1705
1905
|
option: 'fontFamily',
|
|
1706
1906
|
editor: 'editor.select',
|
|
1707
1907
|
editorProps: {
|
|
@@ -1722,32 +1922,32 @@ var editorConfig = [{
|
|
|
1722
1922
|
}]
|
|
1723
1923
|
}
|
|
1724
1924
|
}], [{
|
|
1725
|
-
label: i18n_1._('Font size'),
|
|
1925
|
+
label: (0, i18n_1._)('Font size'),
|
|
1726
1926
|
option: 'fontSize',
|
|
1727
1927
|
editor: 'editor.select',
|
|
1728
1928
|
editorProps: {
|
|
1729
1929
|
values: [{
|
|
1730
|
-
label: i18n_1._('Extra Small'),
|
|
1930
|
+
label: (0, i18n_1._)('Extra Small'),
|
|
1731
1931
|
value: 'extraSmall'
|
|
1732
1932
|
}, {
|
|
1733
|
-
label: i18n_1._('Small'),
|
|
1933
|
+
label: (0, i18n_1._)('Small'),
|
|
1734
1934
|
value: 'small'
|
|
1735
1935
|
}, {
|
|
1736
|
-
label: i18n_1._('Default'),
|
|
1936
|
+
label: (0, i18n_1._)('Default'),
|
|
1737
1937
|
value: 'default'
|
|
1738
1938
|
}, {
|
|
1739
|
-
label: i18n_1._('Large'),
|
|
1939
|
+
label: (0, i18n_1._)('Large'),
|
|
1740
1940
|
value: 'large'
|
|
1741
1941
|
}, {
|
|
1742
|
-
label: i18n_1._('Extra Large'),
|
|
1942
|
+
label: (0, i18n_1._)('Extra Large'),
|
|
1743
1943
|
value: 'extraLarge'
|
|
1744
1944
|
}, {
|
|
1745
|
-
label: i18n_1._('Custom'),
|
|
1945
|
+
label: (0, i18n_1._)('Custom'),
|
|
1746
1946
|
value: 'custom'
|
|
1747
1947
|
}]
|
|
1748
1948
|
}
|
|
1749
1949
|
}, {
|
|
1750
|
-
label: i18n_1._('Custom font size (px)'),
|
|
1950
|
+
label: (0, i18n_1._)('Custom font size (px)'),
|
|
1751
1951
|
option: 'customFontSize',
|
|
1752
1952
|
editor: 'editor.number',
|
|
1753
1953
|
editorProps: {
|
|
@@ -1759,7 +1959,7 @@ var editorConfig = [{
|
|
|
1759
1959
|
return options.fontSize && !FONT_OPTIONS.has(options.fontSize);
|
|
1760
1960
|
}
|
|
1761
1961
|
}], [{
|
|
1762
|
-
label: i18n_1._('Rotation (degrees)'),
|
|
1962
|
+
label: (0, i18n_1._)('Rotation (degrees)'),
|
|
1763
1963
|
option: 'rotation',
|
|
1764
1964
|
editor: 'editor.number',
|
|
1765
1965
|
editorProps: {
|
|
@@ -1768,7 +1968,7 @@ var editorConfig = [{
|
|
|
1768
1968
|
}
|
|
1769
1969
|
}]]
|
|
1770
1970
|
}, {
|
|
1771
|
-
label: i18n_1._('Markdown content'),
|
|
1971
|
+
label: (0, i18n_1._)('Markdown content'),
|
|
1772
1972
|
open: true,
|
|
1773
1973
|
layout: [[{
|
|
1774
1974
|
label: '',
|
|
@@ -1779,16 +1979,19 @@ var editorConfig = [{
|
|
|
1779
1979
|
/**
|
|
1780
1980
|
* visualization configuration
|
|
1781
1981
|
*/
|
|
1982
|
+
|
|
1782
1983
|
var config = {
|
|
1783
1984
|
/**
|
|
1784
1985
|
* unique viz key
|
|
1785
1986
|
*/
|
|
1786
1987
|
key: 'splunk.markdown',
|
|
1988
|
+
|
|
1787
1989
|
/**
|
|
1788
1990
|
* viz name
|
|
1789
1991
|
*/
|
|
1790
|
-
name: i18n_1._('Markdown'),
|
|
1992
|
+
name: (0, i18n_1._)('Markdown'),
|
|
1791
1993
|
category: VizCategory_1.VizCategory.COMPARISONS,
|
|
1994
|
+
|
|
1792
1995
|
/**
|
|
1793
1996
|
* viz icon
|
|
1794
1997
|
*/
|
|
@@ -1806,7 +2009,7 @@ var config = {
|
|
|
1806
2009
|
supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS],
|
|
1807
2010
|
themes: themes
|
|
1808
2011
|
};
|
|
1809
|
-
exports.default = configUtils_1.enhanceConfig(config);
|
|
2012
|
+
exports.default = (0, configUtils_1.enhanceConfig)(config);
|
|
1810
2013
|
|
|
1811
2014
|
/***/ }),
|
|
1812
2015
|
|
|
@@ -1816,11 +2019,35 @@ exports.default = configUtils_1.enhanceConfig(config);
|
|
|
1816
2019
|
"use strict";
|
|
1817
2020
|
|
|
1818
2021
|
|
|
2022
|
+
var _classCallCheck = __webpack_require__(9);
|
|
2023
|
+
|
|
2024
|
+
var _createClass = __webpack_require__(18);
|
|
2025
|
+
|
|
1819
2026
|
Object.defineProperty(exports, "__esModule", {
|
|
1820
2027
|
value: true
|
|
1821
2028
|
});
|
|
1822
|
-
exports.
|
|
1823
|
-
|
|
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;
|
|
1824
2051
|
|
|
1825
2052
|
/***/ }),
|
|
1826
2053
|
|
|
@@ -1834,7 +2061,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1834
2061
|
value: true
|
|
1835
2062
|
});
|
|
1836
2063
|
exports.useDeepMemo = void 0;
|
|
2064
|
+
|
|
1837
2065
|
var react_1 = __webpack_require__(1);
|
|
2066
|
+
|
|
1838
2067
|
var lodash_1 = __webpack_require__(3);
|
|
1839
2068
|
/**
|
|
1840
2069
|
* This hook evaluates and stores the result of a passed function and only
|
|
@@ -1849,16 +2078,21 @@ var lodash_1 = __webpack_require__(3);
|
|
|
1849
2078
|
* @param fn the function to be executed and
|
|
1850
2079
|
* @param dependencies an array of dependencies
|
|
1851
2080
|
*/
|
|
2081
|
+
|
|
2082
|
+
|
|
1852
2083
|
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
1853
|
-
var ref = react_1.useRef();
|
|
1854
|
-
|
|
2084
|
+
var ref = (0, react_1.useRef)();
|
|
2085
|
+
|
|
2086
|
+
if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
|
|
1855
2087
|
ref.current = {
|
|
1856
2088
|
dependencies: dependencies,
|
|
1857
2089
|
value: fn()
|
|
1858
2090
|
};
|
|
1859
2091
|
}
|
|
2092
|
+
|
|
1860
2093
|
return ref.current.value;
|
|
1861
2094
|
};
|
|
2095
|
+
|
|
1862
2096
|
exports.useDeepMemo = useDeepMemo;
|
|
1863
2097
|
|
|
1864
2098
|
/***/ }),
|
|
@@ -1873,19 +2107,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1873
2107
|
value: true
|
|
1874
2108
|
});
|
|
1875
2109
|
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
2110
|
+
|
|
1876
2111
|
var React = __webpack_require__(1);
|
|
2112
|
+
|
|
1877
2113
|
var T = __webpack_require__(0);
|
|
2114
|
+
|
|
1878
2115
|
var i18n_1 = __webpack_require__(2);
|
|
2116
|
+
|
|
1879
2117
|
var Message_1 = __webpack_require__(10);
|
|
2118
|
+
|
|
1880
2119
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
1881
2120
|
/**
|
|
1882
2121
|
* @method isMissing
|
|
1883
2122
|
* @param {any} v
|
|
1884
2123
|
* @returns {boolean} true if the input value === null or undefined
|
|
1885
2124
|
*/
|
|
2125
|
+
|
|
2126
|
+
|
|
1886
2127
|
var isMissing = function isMissing(v) {
|
|
1887
2128
|
return v === null || v === undefined;
|
|
1888
2129
|
};
|
|
2130
|
+
|
|
1889
2131
|
exports.isMissing = isMissing;
|
|
1890
2132
|
/**
|
|
1891
2133
|
* @method misskingKeys
|
|
@@ -1893,11 +2135,13 @@ exports.isMissing = isMissing;
|
|
|
1893
2135
|
* @param {object} target
|
|
1894
2136
|
* @returns {string[]} the keys of missing required props
|
|
1895
2137
|
*/
|
|
2138
|
+
|
|
1896
2139
|
var missingKeys = function missingKeys(keys, target) {
|
|
1897
2140
|
return keys.filter(function (k) {
|
|
1898
|
-
return exports.isMissing(target[k]);
|
|
2141
|
+
return (0, exports.isMissing)(target[k]);
|
|
1899
2142
|
});
|
|
1900
2143
|
};
|
|
2144
|
+
|
|
1901
2145
|
exports.missingKeys = missingKeys;
|
|
1902
2146
|
var propTypes = {
|
|
1903
2147
|
width: T.oneOfType([T.string, T.number]),
|
|
@@ -1911,24 +2155,26 @@ var propTypes = {
|
|
|
1911
2155
|
* @param {MissingPropsProps} props
|
|
1912
2156
|
* @returns {React.ReactElement}
|
|
1913
2157
|
*/
|
|
2158
|
+
|
|
1914
2159
|
var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
1915
2160
|
var width = props.width,
|
|
1916
|
-
|
|
1917
|
-
|
|
2161
|
+
height = props.height,
|
|
2162
|
+
missingProps = props.missingProps;
|
|
1918
2163
|
return React.createElement(Message_1.default, {
|
|
1919
2164
|
"data-test": "message",
|
|
1920
2165
|
width: width,
|
|
1921
2166
|
height: height,
|
|
1922
|
-
message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
|
|
2167
|
+
message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
|
|
1923
2168
|
});
|
|
1924
2169
|
};
|
|
2170
|
+
|
|
1925
2171
|
exports.MissingPropsMessage = MissingPropsMessage;
|
|
1926
2172
|
exports.MissingPropsMessage.propTypes = propTypes;
|
|
1927
2173
|
exports.MissingPropsMessage.defaultProps = {
|
|
1928
2174
|
width: '100%',
|
|
1929
2175
|
height: 250
|
|
1930
2176
|
};
|
|
1931
|
-
exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
2177
|
+
exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage);
|
|
1932
2178
|
|
|
1933
2179
|
/***/ }),
|
|
1934
2180
|
|
|
@@ -1941,15 +2187,19 @@ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
|
1941
2187
|
Object.defineProperty(exports, "__esModule", {
|
|
1942
2188
|
value: true
|
|
1943
2189
|
});
|
|
2190
|
+
|
|
1944
2191
|
var React = __webpack_require__(1);
|
|
2192
|
+
|
|
1945
2193
|
var styled_components_1 = __webpack_require__(4);
|
|
2194
|
+
|
|
1946
2195
|
var hocUtils_1 = __webpack_require__(15);
|
|
2196
|
+
|
|
1947
2197
|
var Cover = styled_components_1.default.div.withConfig({
|
|
1948
2198
|
displayName: "withEditModeCover__Cover",
|
|
1949
2199
|
componentId: "sc-1gsbnxb-0"
|
|
1950
2200
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1951
2201
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1952
|
-
'data-splunk-visualization-version': "
|
|
2202
|
+
'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
|
|
1953
2203
|
}).withConfig({
|
|
1954
2204
|
displayName: "withEditModeCover__Blocker",
|
|
1955
2205
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -1960,6 +2210,7 @@ var Blocker = styled_components_1.default.div.attrs({
|
|
|
1960
2210
|
* @param {ExtendedDashViz} Visualization
|
|
1961
2211
|
* @returns {ExtendedDashViz} Wrapper
|
|
1962
2212
|
*/
|
|
2213
|
+
|
|
1963
2214
|
var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
|
|
1964
2215
|
var Wrapper = function Wrapper(props) {
|
|
1965
2216
|
var mode = props.mode;
|
|
@@ -1968,12 +2219,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
|
|
|
1968
2219
|
"data-test": "edit-mode-cover"
|
|
1969
2220
|
}));
|
|
1970
2221
|
};
|
|
1971
|
-
|
|
2222
|
+
|
|
2223
|
+
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
1972
2224
|
Wrapper: Wrapper,
|
|
1973
2225
|
Visualization: Visualization
|
|
1974
2226
|
});
|
|
1975
2227
|
return Wrapper;
|
|
1976
2228
|
};
|
|
2229
|
+
|
|
1977
2230
|
exports.default = withEditModeCover;
|
|
1978
2231
|
|
|
1979
2232
|
/***/ }),
|
|
@@ -1987,27 +2240,37 @@ exports.default = withEditModeCover;
|
|
|
1987
2240
|
Object.defineProperty(exports, "__esModule", {
|
|
1988
2241
|
value: true
|
|
1989
2242
|
});
|
|
2243
|
+
|
|
1990
2244
|
var React = __webpack_require__(1);
|
|
2245
|
+
|
|
1991
2246
|
var colorUtils_1 = __webpack_require__(12);
|
|
2247
|
+
|
|
1992
2248
|
var variables_1 = __webpack_require__(11);
|
|
1993
|
-
|
|
2249
|
+
|
|
2250
|
+
var IconPlaceholder_1 = __webpack_require__(32);
|
|
2251
|
+
|
|
1994
2252
|
var VizBehavior_1 = __webpack_require__(6);
|
|
2253
|
+
|
|
1995
2254
|
var hocUtils_1 = __webpack_require__(15);
|
|
2255
|
+
|
|
1996
2256
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
1997
2257
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
1998
2258
|
var config = Visualization.config;
|
|
1999
2259
|
var themes = config.themes;
|
|
2260
|
+
|
|
2000
2261
|
var Wrapper = function Wrapper(props) {
|
|
2001
2262
|
var _a, _b;
|
|
2263
|
+
|
|
2002
2264
|
var dataSources = props.dataSources,
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2265
|
+
loading = props.loading,
|
|
2266
|
+
options = props.options,
|
|
2267
|
+
height = props.height,
|
|
2268
|
+
width = props.width;
|
|
2007
2269
|
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
2008
|
-
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);
|
|
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);
|
|
2009
2271
|
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
2010
2272
|
var iconColor = variables_1.default.contentColorActive(props);
|
|
2273
|
+
|
|
2011
2274
|
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
2012
2275
|
return React.createElement(IconPlaceholder_1.default, {
|
|
2013
2276
|
"data-test": "icon-placeholder",
|
|
@@ -2018,14 +2281,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
2018
2281
|
iconColor: iconColor
|
|
2019
2282
|
});
|
|
2020
2283
|
}
|
|
2284
|
+
|
|
2021
2285
|
return React.createElement(Visualization, Object.assign({}, props));
|
|
2022
2286
|
};
|
|
2023
|
-
|
|
2287
|
+
|
|
2288
|
+
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
2024
2289
|
Wrapper: Wrapper,
|
|
2025
2290
|
Visualization: Visualization
|
|
2026
2291
|
});
|
|
2027
2292
|
return Wrapper;
|
|
2028
2293
|
};
|
|
2294
|
+
|
|
2029
2295
|
exports.default = withPlaceholder;
|
|
2030
2296
|
|
|
2031
2297
|
/***/ }),
|
|
@@ -2039,13 +2305,15 @@ exports.default = withPlaceholder;
|
|
|
2039
2305
|
Object.defineProperty(exports, "__esModule", {
|
|
2040
2306
|
value: true
|
|
2041
2307
|
});
|
|
2308
|
+
|
|
2042
2309
|
var i18n_1 = __webpack_require__(2);
|
|
2310
|
+
|
|
2043
2311
|
var background = function background(_ref) {
|
|
2044
2312
|
var label = _ref.label,
|
|
2045
|
-
|
|
2046
|
-
|
|
2313
|
+
themes = _ref.themes,
|
|
2314
|
+
labelPosition = _ref.labelPosition;
|
|
2047
2315
|
return [{
|
|
2048
|
-
label: i18n_1._(label || 'Background'),
|
|
2316
|
+
label: (0, i18n_1._)(label || 'Background'),
|
|
2049
2317
|
option: 'backgroundColor',
|
|
2050
2318
|
editor: 'editor.color',
|
|
2051
2319
|
editorProps: {
|
|
@@ -2054,6 +2322,7 @@ var background = function background(_ref) {
|
|
|
2054
2322
|
}
|
|
2055
2323
|
}];
|
|
2056
2324
|
};
|
|
2325
|
+
|
|
2057
2326
|
exports.default = background;
|
|
2058
2327
|
|
|
2059
2328
|
/***/ }),
|
|
@@ -2061,7 +2330,7 @@ exports.default = background;
|
|
|
2061
2330
|
/***/ 59:
|
|
2062
2331
|
/***/ (function(module, exports) {
|
|
2063
2332
|
|
|
2064
|
-
module.exports = require("@
|
|
2333
|
+
module.exports = require("@babel/runtime/helpers/taggedTemplateLiteral");
|
|
2065
2334
|
|
|
2066
2335
|
/***/ }),
|
|
2067
2336
|
|
|
@@ -2076,6 +2345,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2076
2345
|
});
|
|
2077
2346
|
exports.VizBehavior = void 0;
|
|
2078
2347
|
var VizBehavior;
|
|
2348
|
+
|
|
2079
2349
|
(function (VizBehavior) {
|
|
2080
2350
|
/**
|
|
2081
2351
|
* Dynamic Options Behavior.
|
|
@@ -2095,6 +2365,7 @@ var VizBehavior;
|
|
|
2095
2365
|
* missing.
|
|
2096
2366
|
* @type {string}
|
|
2097
2367
|
*/
|
|
2368
|
+
|
|
2098
2369
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
2099
2370
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
2100
2371
|
VizBehavior["TRELLIS"] = "trellis";
|
|
@@ -2102,38 +2373,38 @@ var VizBehavior;
|
|
|
2102
2373
|
|
|
2103
2374
|
/***/ }),
|
|
2104
2375
|
|
|
2105
|
-
/***/
|
|
2376
|
+
/***/ 60:
|
|
2106
2377
|
/***/ (function(module, exports) {
|
|
2107
2378
|
|
|
2108
|
-
module.exports = require("@
|
|
2379
|
+
module.exports = require("@splunk/themes");
|
|
2109
2380
|
|
|
2110
2381
|
/***/ }),
|
|
2111
2382
|
|
|
2112
|
-
/***/
|
|
2383
|
+
/***/ 7:
|
|
2113
2384
|
/***/ (function(module, exports) {
|
|
2114
2385
|
|
|
2115
|
-
module.exports = require("@babel/runtime/helpers/
|
|
2386
|
+
module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
2116
2387
|
|
|
2117
2388
|
/***/ }),
|
|
2118
2389
|
|
|
2119
|
-
/***/
|
|
2390
|
+
/***/ 8:
|
|
2120
2391
|
/***/ (function(module, exports) {
|
|
2121
2392
|
|
|
2122
|
-
module.exports = require("@babel/runtime/helpers/
|
|
2393
|
+
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
2123
2394
|
|
|
2124
2395
|
/***/ }),
|
|
2125
2396
|
|
|
2126
|
-
/***/
|
|
2397
|
+
/***/ 83:
|
|
2127
2398
|
/***/ (function(module, exports) {
|
|
2128
2399
|
|
|
2129
2400
|
module.exports = require("@splunk/visualization-encoding/utils/types");
|
|
2130
2401
|
|
|
2131
2402
|
/***/ }),
|
|
2132
2403
|
|
|
2133
|
-
/***/
|
|
2404
|
+
/***/ 9:
|
|
2134
2405
|
/***/ (function(module, exports) {
|
|
2135
2406
|
|
|
2136
|
-
module.exports = require("@babel/runtime/helpers/
|
|
2407
|
+
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
2137
2408
|
|
|
2138
2409
|
/***/ })
|
|
2139
2410
|
|