@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/Table.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 = 479);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -120,7 +120,7 @@ module.exports = require("@splunk/themes/variables");
|
|
|
120
120
|
|
|
121
121
|
/***/ }),
|
|
122
122
|
|
|
123
|
-
/***/
|
|
123
|
+
/***/ 112:
|
|
124
124
|
/***/ (function(module, exports) {
|
|
125
125
|
|
|
126
126
|
module.exports = require("@splunk/react-ui/Table");
|
|
@@ -134,7 +134,7 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
|
134
134
|
|
|
135
135
|
/***/ }),
|
|
136
136
|
|
|
137
|
-
/***/
|
|
137
|
+
/***/ 124:
|
|
138
138
|
/***/ (function(module, exports) {
|
|
139
139
|
|
|
140
140
|
module.exports = require("@splunk/react-ui/Message");
|
|
@@ -150,40 +150,46 @@ module.exports = require("@splunk/react-ui/Message");
|
|
|
150
150
|
Object.defineProperty(exports, "__esModule", {
|
|
151
151
|
value: true
|
|
152
152
|
});
|
|
153
|
+
|
|
153
154
|
var React = __webpack_require__(1);
|
|
155
|
+
|
|
154
156
|
var styled_components_1 = __webpack_require__(4);
|
|
157
|
+
|
|
155
158
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
159
|
+
|
|
156
160
|
var style_1 = __webpack_require__(14);
|
|
161
|
+
|
|
157
162
|
var colorUtils_1 = __webpack_require__(12);
|
|
163
|
+
|
|
158
164
|
var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
159
165
|
var width = _ref.width;
|
|
160
166
|
return {
|
|
161
167
|
style: {
|
|
162
|
-
width: style_1.toPx(width)
|
|
168
|
+
width: (0, style_1.toPx)(width)
|
|
163
169
|
}
|
|
164
170
|
};
|
|
165
171
|
}).withConfig({
|
|
166
172
|
displayName: "FixedSizeContainer__Item",
|
|
167
173
|
componentId: "sc-1yhgpod-0"
|
|
168
174
|
})(["position:relative;background-color:", "};"], function (props) {
|
|
169
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
170
|
-
});
|
|
171
|
-
|
|
175
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
176
|
+
}); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
|
|
177
|
+
|
|
172
178
|
var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
|
|
173
179
|
var width = _ref2.width,
|
|
174
|
-
|
|
180
|
+
height = _ref2.height;
|
|
175
181
|
return {
|
|
176
182
|
style: Object.assign(Object.assign({}, width && {
|
|
177
|
-
width: style_1.toPx(width)
|
|
183
|
+
width: (0, style_1.toPx)(width)
|
|
178
184
|
}), height && {
|
|
179
|
-
height: style_1.toPx(height)
|
|
185
|
+
height: (0, style_1.toPx)(height)
|
|
180
186
|
})
|
|
181
187
|
};
|
|
182
188
|
}).withConfig({
|
|
183
189
|
displayName: "FixedSizeContainer__FixSizeItem",
|
|
184
190
|
componentId: "sc-1yhgpod-1"
|
|
185
191
|
})(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
|
|
186
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
192
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
187
193
|
});
|
|
188
194
|
var ItemContent = styled_components_1.default.div.withConfig({
|
|
189
195
|
displayName: "FixedSizeContainer__ItemContent",
|
|
@@ -193,11 +199,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
|
|
|
193
199
|
displayName: "FixedSizeContainer__FixSizeItemContent",
|
|
194
200
|
componentId: "sc-1yhgpod-3"
|
|
195
201
|
})(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
|
|
202
|
+
|
|
196
203
|
var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
197
204
|
var FixedSizeContainer = function FixedSizeContainer(props) {
|
|
198
205
|
var width = props.width,
|
|
199
|
-
|
|
200
|
-
|
|
206
|
+
height = props.height,
|
|
207
|
+
backgroundColor = props.backgroundColor;
|
|
208
|
+
|
|
201
209
|
if (!height) {
|
|
202
210
|
return React.createElement(Item, {
|
|
203
211
|
"data-test": "item",
|
|
@@ -205,29 +213,32 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
205
213
|
backgroundColor: backgroundColor
|
|
206
214
|
}, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
|
|
207
215
|
}
|
|
216
|
+
|
|
208
217
|
return React.createElement(FixSizeItem, {
|
|
209
218
|
"data-test": "fix-size-item",
|
|
210
|
-
"data-splunk-visualization-version": "
|
|
219
|
+
"data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
|
|
211
220
|
width: width,
|
|
212
221
|
height: height,
|
|
213
222
|
backgroundColor: backgroundColor
|
|
214
223
|
}, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
|
|
215
224
|
var newWidth = _ref3.width,
|
|
216
|
-
|
|
225
|
+
newHeight = _ref3.height;
|
|
217
226
|
return React.createElement(Viz, Object.assign({}, props, {
|
|
218
227
|
width: newWidth,
|
|
219
228
|
height: newHeight
|
|
220
229
|
}));
|
|
221
230
|
})));
|
|
222
231
|
};
|
|
232
|
+
|
|
223
233
|
FixedSizeContainer.displayName = 'withFixedSizeContainer';
|
|
224
234
|
return FixedSizeContainer;
|
|
225
235
|
};
|
|
236
|
+
|
|
226
237
|
exports.default = withFixedSizeContainer;
|
|
227
238
|
|
|
228
239
|
/***/ }),
|
|
229
240
|
|
|
230
|
-
/***/
|
|
241
|
+
/***/ 137:
|
|
231
242
|
/***/ (function(module, exports, __webpack_require__) {
|
|
232
243
|
|
|
233
244
|
"use strict";
|
|
@@ -269,9 +280,10 @@ exports.extendStaticWrapperProps = void 0;
|
|
|
269
280
|
* @param {DashboardVizType} props.Wrapper
|
|
270
281
|
* @param {DashboardVizType} props.Visualization
|
|
271
282
|
*/
|
|
283
|
+
|
|
272
284
|
var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
273
285
|
var Wrapper = _ref.Wrapper,
|
|
274
|
-
|
|
286
|
+
Visualization = _ref.Visualization;
|
|
275
287
|
var extendProperties = ['propTypes', 'defaultProps', 'config'];
|
|
276
288
|
extendProperties.forEach(function (prop) {
|
|
277
289
|
if (Visualization[prop]) {
|
|
@@ -280,6 +292,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
280
292
|
}
|
|
281
293
|
});
|
|
282
294
|
};
|
|
295
|
+
|
|
283
296
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
284
297
|
|
|
285
298
|
/***/ }),
|
|
@@ -291,64 +304,80 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
|
291
304
|
|
|
292
305
|
/***/ }),
|
|
293
306
|
|
|
294
|
-
/***/
|
|
307
|
+
/***/ 168:
|
|
295
308
|
/***/ (function(module, exports, __webpack_require__) {
|
|
296
309
|
|
|
297
310
|
"use strict";
|
|
298
311
|
|
|
299
312
|
|
|
300
313
|
var _slicedToArray = __webpack_require__(17);
|
|
314
|
+
|
|
301
315
|
var __rest = this && this.__rest || function (s, e) {
|
|
302
316
|
var t = {};
|
|
317
|
+
|
|
303
318
|
for (var p in s) {
|
|
304
319
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
305
320
|
}
|
|
321
|
+
|
|
306
322
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
307
323
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
308
324
|
}
|
|
309
325
|
return t;
|
|
310
326
|
};
|
|
327
|
+
|
|
311
328
|
Object.defineProperty(exports, "__esModule", {
|
|
312
329
|
value: true
|
|
313
330
|
});
|
|
314
331
|
exports.config = exports.PureTable = exports.themes = exports.computeVizProps = void 0;
|
|
332
|
+
|
|
315
333
|
var lodash_1 = __webpack_require__(3);
|
|
334
|
+
|
|
316
335
|
var colorUtils_1 = __webpack_require__(12);
|
|
317
|
-
|
|
336
|
+
|
|
337
|
+
var config_1 = __webpack_require__(480);
|
|
338
|
+
|
|
318
339
|
exports.config = config_1.default;
|
|
319
|
-
|
|
320
|
-
var
|
|
340
|
+
|
|
341
|
+
var withDashboardViz_1 = __webpack_require__(37);
|
|
342
|
+
|
|
343
|
+
var PureTable_1 = __webpack_require__(481);
|
|
344
|
+
|
|
321
345
|
exports.PureTable = PureTable_1.default;
|
|
346
|
+
|
|
322
347
|
var computeVizProps = function computeVizProps(_a) {
|
|
323
348
|
var props = __rest(_a, []);
|
|
349
|
+
|
|
324
350
|
var vizProps = Object.assign({}, props);
|
|
351
|
+
|
|
325
352
|
if (vizProps.columnFormat) {
|
|
326
353
|
var columns = vizProps.columnFormat;
|
|
327
354
|
var themeRowBackgroundColorOdd = vizProps.themeFunc('rowBackgroundColorOdd');
|
|
328
355
|
var themeRowBackgroundColorEven = vizProps.themeFunc('rowBackgroundColorEven');
|
|
329
|
-
var themeTextColor = vizProps.themeFunc('textColor');
|
|
330
|
-
|
|
356
|
+
var themeTextColor = vizProps.themeFunc('textColor'); // `columns` looks like { `column title`: { rowBackgroundColors, rowColors... }}
|
|
357
|
+
|
|
331
358
|
Object.entries(columns).forEach(function (_ref) {
|
|
332
359
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
333
|
-
|
|
334
|
-
|
|
360
|
+
columnKey = _ref2[0],
|
|
361
|
+
columnProperties = _ref2[1];
|
|
362
|
+
|
|
335
363
|
var rowBackgroundColors;
|
|
336
|
-
var rowColors;
|
|
337
|
-
// If columns have `rowBackgroundColors` or `rowColors` arrays defined, sanitize them. If there are undefined values after sanitization, these
|
|
364
|
+
var rowColors; // If columns have `rowBackgroundColors` or `rowColors` arrays defined, sanitize them. If there are undefined values after sanitization, these
|
|
338
365
|
// elements are populated with the default values provided by the theme.
|
|
366
|
+
|
|
339
367
|
if (columnProperties.rowBackgroundColors) {
|
|
340
|
-
rowBackgroundColors = colorUtils_1.sanitizeArrayOfColors(columnProperties.rowBackgroundColors).map(function (color, i) {
|
|
341
|
-
return (
|
|
342
|
-
// using (i + 1) % 2 because 'odd' refers to row number, so index 0 -> row 1 -> odd colored
|
|
368
|
+
rowBackgroundColors = (0, colorUtils_1.sanitizeArrayOfColors)(columnProperties.rowBackgroundColors).map(function (color, i) {
|
|
369
|
+
return (// using (i + 1) % 2 because 'odd' refers to row number, so index 0 -> row 1 -> odd colored
|
|
343
370
|
color || ((i + 1) % 2 === 0 ? themeRowBackgroundColorEven : themeRowBackgroundColorOdd)
|
|
344
371
|
);
|
|
345
372
|
});
|
|
346
373
|
}
|
|
374
|
+
|
|
347
375
|
if (columnProperties.rowColors) {
|
|
348
|
-
rowColors = colorUtils_1.sanitizeArrayOfColors(columnProperties.rowColors).map(function (color) {
|
|
376
|
+
rowColors = (0, colorUtils_1.sanitizeArrayOfColors)(columnProperties.rowColors).map(function (color) {
|
|
349
377
|
return color || themeTextColor;
|
|
350
378
|
});
|
|
351
379
|
}
|
|
380
|
+
|
|
352
381
|
vizProps.columnFormat[columnKey] = Object.assign(Object.assign(Object.assign({}, vizProps.columnFormat[columnKey]), columnProperties.rowBackgroundColors && {
|
|
353
382
|
rowBackgroundColors: rowBackgroundColors
|
|
354
383
|
}), columnProperties.rowColors && {
|
|
@@ -356,9 +385,11 @@ var computeVizProps = function computeVizProps(_a) {
|
|
|
356
385
|
});
|
|
357
386
|
});
|
|
358
387
|
}
|
|
388
|
+
|
|
359
389
|
if (vizProps.onOptionsChange) {
|
|
360
390
|
var handleColumnFormatChange = function handleColumnFormatChange(updatedColumnFormat) {
|
|
361
391
|
var _a, _b;
|
|
392
|
+
|
|
362
393
|
var cloneOfExistingColumnFormat = (_b = Object.assign({}, (_a = vizProps === null || vizProps === void 0 ? void 0 : vizProps.options) === null || _a === void 0 ? void 0 : _a.columnFormat)) !== null && _b !== void 0 ? _b : {};
|
|
363
394
|
var keys = Object.keys(updatedColumnFormat);
|
|
364
395
|
var values = Object.values(updatedColumnFormat);
|
|
@@ -366,7 +397,8 @@ var computeVizProps = function computeVizProps(_a) {
|
|
|
366
397
|
if (!cloneOfExistingColumnFormat[key]) {
|
|
367
398
|
cloneOfExistingColumnFormat[key] = {};
|
|
368
399
|
}
|
|
369
|
-
|
|
400
|
+
|
|
401
|
+
var newWidth = (0, lodash_1.get)(values[index], 'width');
|
|
370
402
|
cloneOfExistingColumnFormat[key] = Object.assign(Object.assign({}, cloneOfExistingColumnFormat[key]), {
|
|
371
403
|
width: newWidth
|
|
372
404
|
});
|
|
@@ -375,12 +407,15 @@ var computeVizProps = function computeVizProps(_a) {
|
|
|
375
407
|
columnFormat: cloneOfExistingColumnFormat
|
|
376
408
|
});
|
|
377
409
|
};
|
|
410
|
+
|
|
378
411
|
vizProps.onColumnFormatChange = handleColumnFormatChange;
|
|
379
412
|
}
|
|
413
|
+
|
|
380
414
|
return vizProps;
|
|
381
415
|
};
|
|
416
|
+
|
|
382
417
|
exports.computeVizProps = computeVizProps;
|
|
383
|
-
var Table = withDashboardViz_1.default({
|
|
418
|
+
var Table = (0, withDashboardViz_1.default)({
|
|
384
419
|
ReactViz: PureTable_1.default,
|
|
385
420
|
vizConfig: config_1.default,
|
|
386
421
|
disableEditModeCover: true,
|
|
@@ -427,24 +462,33 @@ module.exports = require("@splunk/ui-utils/i18n");
|
|
|
427
462
|
|
|
428
463
|
|
|
429
464
|
var _toConsumableArray = __webpack_require__(8);
|
|
465
|
+
|
|
430
466
|
var _defineProperty = __webpack_require__(7);
|
|
467
|
+
|
|
431
468
|
var __rest = this && this.__rest || function (s, e) {
|
|
432
469
|
var t = {};
|
|
470
|
+
|
|
433
471
|
for (var p in s) {
|
|
434
472
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
435
473
|
}
|
|
474
|
+
|
|
436
475
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
437
476
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
438
477
|
}
|
|
439
478
|
return t;
|
|
440
479
|
};
|
|
480
|
+
|
|
441
481
|
Object.defineProperty(exports, "__esModule", {
|
|
442
482
|
value: true
|
|
443
483
|
});
|
|
444
484
|
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
485
|
+
|
|
445
486
|
var lodash_1 = __webpack_require__(3);
|
|
487
|
+
|
|
446
488
|
var schemaUtils_1 = __webpack_require__(16);
|
|
489
|
+
|
|
447
490
|
var VizBehavior_1 = __webpack_require__(6);
|
|
491
|
+
|
|
448
492
|
var dynamicOptionsDSLType = {
|
|
449
493
|
type: 'string',
|
|
450
494
|
pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
|
|
@@ -454,20 +498,22 @@ var dynamicOptionsDSLType = {
|
|
|
454
498
|
* @param optionsSchema a visualization's options schema
|
|
455
499
|
* @returns an updated options schema that additionally allows strings starting with > for each option
|
|
456
500
|
*/
|
|
501
|
+
|
|
457
502
|
function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
458
503
|
var enhancedOptionsSchema = {};
|
|
459
504
|
Object.keys(optionsSchema).forEach(function (key) {
|
|
460
505
|
var _a = optionsSchema[key],
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
506
|
+
title = _a.title,
|
|
507
|
+
description = _a.description,
|
|
508
|
+
readOnly = _a.readOnly,
|
|
509
|
+
writeOnly = _a.writeOnly,
|
|
510
|
+
examples = _a.examples,
|
|
511
|
+
defaultValue = _a.default,
|
|
512
|
+
type = _a.type,
|
|
513
|
+
properties = _a.properties,
|
|
514
|
+
patternProperties = _a.patternProperties,
|
|
515
|
+
remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
|
|
516
|
+
|
|
471
517
|
var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
|
|
472
518
|
title: title
|
|
473
519
|
}), description !== undefined && {
|
|
@@ -481,12 +527,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
481
527
|
}), defaultValue !== undefined && {
|
|
482
528
|
default: defaultValue
|
|
483
529
|
});
|
|
530
|
+
|
|
484
531
|
if (type === 'object') {
|
|
485
532
|
enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
|
|
486
533
|
type: type
|
|
487
534
|
}), properties && {
|
|
488
535
|
properties: enhanceOptionsSchemaWithDynamicOptions(properties)
|
|
489
536
|
});
|
|
537
|
+
|
|
490
538
|
if (patternProperties) {
|
|
491
539
|
var enhancedPatternProperties = {};
|
|
492
540
|
Object.keys(patternProperties).forEach(function (opt) {
|
|
@@ -504,6 +552,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
504
552
|
});
|
|
505
553
|
return enhancedOptionsSchema;
|
|
506
554
|
}
|
|
555
|
+
|
|
507
556
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
508
557
|
/**
|
|
509
558
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
@@ -512,11 +561,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
|
|
|
512
561
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
513
562
|
* and containing `open: false` for all editor panels in editorConfig
|
|
514
563
|
*/
|
|
564
|
+
|
|
515
565
|
function enhanceConfig(vizConfig) {
|
|
516
566
|
var enhancedConfig = Object.assign({}, vizConfig);
|
|
567
|
+
|
|
517
568
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
|
|
518
569
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
519
570
|
}
|
|
571
|
+
|
|
520
572
|
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
521
573
|
return Object.assign(Object.assign({}, config), {
|
|
522
574
|
open: config.open || false
|
|
@@ -524,6 +576,7 @@ function enhanceConfig(vizConfig) {
|
|
|
524
576
|
});
|
|
525
577
|
return enhancedConfig;
|
|
526
578
|
}
|
|
579
|
+
|
|
527
580
|
exports.enhanceConfig = enhanceConfig;
|
|
528
581
|
/**
|
|
529
582
|
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
@@ -531,6 +584,7 @@ exports.enhanceConfig = enhanceConfig;
|
|
|
531
584
|
* @param vizConfig a Visualization Config
|
|
532
585
|
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
533
586
|
*/
|
|
587
|
+
|
|
534
588
|
function uncollapseEditorConfig(vizConfig) {
|
|
535
589
|
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
536
590
|
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
@@ -540,13 +594,16 @@ function uncollapseEditorConfig(vizConfig) {
|
|
|
540
594
|
});
|
|
541
595
|
return editorPanelUncollapsedConfig;
|
|
542
596
|
}
|
|
597
|
+
|
|
543
598
|
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
599
|
+
|
|
544
600
|
function isDynamicOption(option) {
|
|
545
601
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
546
602
|
}
|
|
547
|
-
|
|
548
|
-
// private helpers to improve readability of getInitialPreset
|
|
603
|
+
|
|
604
|
+
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
549
605
|
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
606
|
+
|
|
550
607
|
/**
|
|
551
608
|
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
552
609
|
* 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
|
|
@@ -555,6 +612,7 @@ exports.isDynamicOption = isDynamicOption;
|
|
|
555
612
|
*
|
|
556
613
|
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
557
614
|
*/
|
|
615
|
+
|
|
558
616
|
function hasCompatibleContexts(vizContext, presetContext) {
|
|
559
617
|
var presetContextKeys = Object.keys(presetContext);
|
|
560
618
|
return presetContextKeys.every(function (contextKey) {
|
|
@@ -564,6 +622,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
|
|
|
564
622
|
/**
|
|
565
623
|
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
566
624
|
*/
|
|
625
|
+
|
|
626
|
+
|
|
567
627
|
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
568
628
|
var presetOptionKeys = Object.keys(presetOptions);
|
|
569
629
|
return presetOptionKeys.every(function (optionKey) {
|
|
@@ -578,18 +638,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
|
578
638
|
* @param {Object} vizOptions - the current vizOptions definition
|
|
579
639
|
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
580
640
|
*/
|
|
641
|
+
|
|
642
|
+
|
|
581
643
|
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
582
644
|
return presets.find(function (preset) {
|
|
583
|
-
var presetContext = lodash_1.get(preset, ['value', 'context'], {});
|
|
584
|
-
var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
|
|
645
|
+
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
646
|
+
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
585
647
|
var presetContextKeys = Object.keys(presetContext);
|
|
586
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
587
|
-
// all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
648
|
+
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
588
649
|
// if not, then the preset is invalid in config.ts
|
|
650
|
+
|
|
589
651
|
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
590
652
|
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
591
653
|
});
|
|
592
654
|
}
|
|
655
|
+
|
|
593
656
|
exports.getInitialPreset = getInitialPreset;
|
|
594
657
|
/**
|
|
595
658
|
* generates number precision values for a Select editor
|
|
@@ -597,14 +660,16 @@ exports.getInitialPreset = getInitialPreset;
|
|
|
597
660
|
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
598
661
|
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
599
662
|
*/
|
|
663
|
+
|
|
600
664
|
function generatePrecisionValues(numPrecisionValues) {
|
|
601
|
-
return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
|
|
665
|
+
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
602
666
|
return {
|
|
603
667
|
label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
|
|
604
668
|
value: i
|
|
605
669
|
};
|
|
606
670
|
});
|
|
607
671
|
}
|
|
672
|
+
|
|
608
673
|
exports.generatePrecisionValues = generatePrecisionValues;
|
|
609
674
|
/**
|
|
610
675
|
* insert layout in layout array, return a new layout array instead of updating the original
|
|
@@ -614,12 +679,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
|
|
|
614
679
|
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
615
680
|
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
616
681
|
*/
|
|
682
|
+
|
|
617
683
|
var insertLayout = function insertLayout(layout, index) {
|
|
618
684
|
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
619
685
|
layoutItems[_key - 2] = arguments[_key];
|
|
620
686
|
}
|
|
687
|
+
|
|
621
688
|
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
622
689
|
};
|
|
690
|
+
|
|
623
691
|
exports.insertLayout = insertLayout;
|
|
624
692
|
|
|
625
693
|
/***/ }),
|
|
@@ -641,28 +709,28 @@ module.exports = require("@splunk/themes/pick");
|
|
|
641
709
|
/***/ 25:
|
|
642
710
|
/***/ (function(module, exports) {
|
|
643
711
|
|
|
644
|
-
module.exports = require("@splunk/
|
|
712
|
+
module.exports = require("@splunk/ui-utils/id");
|
|
645
713
|
|
|
646
714
|
/***/ }),
|
|
647
715
|
|
|
648
716
|
/***/ 26:
|
|
649
717
|
/***/ (function(module, exports) {
|
|
650
718
|
|
|
651
|
-
module.exports = require("@splunk/
|
|
719
|
+
module.exports = require("@splunk/visualization-context/TimezoneContext");
|
|
652
720
|
|
|
653
721
|
/***/ }),
|
|
654
722
|
|
|
655
723
|
/***/ 27:
|
|
656
724
|
/***/ (function(module, exports) {
|
|
657
725
|
|
|
658
|
-
module.exports = require("@splunk/visualizations-shared/
|
|
726
|
+
module.exports = require("@splunk/visualizations-shared/hocUtils");
|
|
659
727
|
|
|
660
728
|
/***/ }),
|
|
661
729
|
|
|
662
|
-
/***/
|
|
730
|
+
/***/ 28:
|
|
663
731
|
/***/ (function(module, exports) {
|
|
664
732
|
|
|
665
|
-
module.exports = require("@splunk/
|
|
733
|
+
module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
|
|
666
734
|
|
|
667
735
|
/***/ }),
|
|
668
736
|
|
|
@@ -673,7 +741,14 @@ module.exports = require("lodash");
|
|
|
673
741
|
|
|
674
742
|
/***/ }),
|
|
675
743
|
|
|
676
|
-
/***/
|
|
744
|
+
/***/ 30:
|
|
745
|
+
/***/ (function(module, exports) {
|
|
746
|
+
|
|
747
|
+
module.exports = require("@splunk/visualization-encoding/Options");
|
|
748
|
+
|
|
749
|
+
/***/ }),
|
|
750
|
+
|
|
751
|
+
/***/ 32:
|
|
677
752
|
/***/ (function(module, exports, __webpack_require__) {
|
|
678
753
|
|
|
679
754
|
"use strict";
|
|
@@ -683,11 +758,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
683
758
|
value: true
|
|
684
759
|
});
|
|
685
760
|
exports.shouldShowIconPlaceholder = void 0;
|
|
761
|
+
|
|
686
762
|
var React = __webpack_require__(1);
|
|
763
|
+
|
|
687
764
|
var T = __webpack_require__(0);
|
|
765
|
+
|
|
688
766
|
var lodash_1 = __webpack_require__(3);
|
|
767
|
+
|
|
689
768
|
var i18n_1 = __webpack_require__(2);
|
|
769
|
+
|
|
690
770
|
var Message_1 = __webpack_require__(10);
|
|
771
|
+
|
|
691
772
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
692
773
|
/**
|
|
693
774
|
* @method shouldShowIconPlaceholder
|
|
@@ -695,14 +776,17 @@ var FixedSizeContainer_1 = __webpack_require__(13);
|
|
|
695
776
|
* @param {boolean} loading
|
|
696
777
|
* @returns {boolean}
|
|
697
778
|
*/
|
|
779
|
+
|
|
780
|
+
|
|
698
781
|
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
699
782
|
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
700
|
-
var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
|
|
783
|
+
var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
|
|
701
784
|
var noData = data === undefined;
|
|
702
|
-
var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
|
|
785
|
+
var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields[0]', undefined);
|
|
703
786
|
var noFields = fields === undefined;
|
|
704
787
|
return loading || noData || noFields;
|
|
705
788
|
};
|
|
789
|
+
|
|
706
790
|
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
707
791
|
var propTypes = {
|
|
708
792
|
icon: T.func,
|
|
@@ -717,11 +801,13 @@ var propTypes = {
|
|
|
717
801
|
* @param {IconPlaceholderProps} props
|
|
718
802
|
* @returns {React.ReactElement}
|
|
719
803
|
*/
|
|
804
|
+
|
|
720
805
|
var IconPlaceholder = function IconPlaceholder(props) {
|
|
721
806
|
var width = props.width,
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
807
|
+
height = props.height,
|
|
808
|
+
icon = props.icon,
|
|
809
|
+
iconColor = props.iconColor;
|
|
810
|
+
|
|
725
811
|
if (icon) {
|
|
726
812
|
return React.createElement(icon, {
|
|
727
813
|
style: {
|
|
@@ -736,26 +822,21 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
736
822
|
height: '50%'
|
|
737
823
|
});
|
|
738
824
|
}
|
|
825
|
+
|
|
739
826
|
return React.createElement(Message_1.default, {
|
|
740
827
|
width: width,
|
|
741
828
|
height: height,
|
|
742
829
|
level: "warning",
|
|
743
|
-
message: i18n_1._('No DataSource Connected')
|
|
830
|
+
message: (0, i18n_1._)('No DataSource Connected')
|
|
744
831
|
});
|
|
745
832
|
};
|
|
833
|
+
|
|
746
834
|
IconPlaceholder.propTypes = propTypes;
|
|
747
835
|
IconPlaceholder.defaultProps = {
|
|
748
836
|
width: '100%',
|
|
749
837
|
height: 250
|
|
750
838
|
};
|
|
751
|
-
exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
752
|
-
|
|
753
|
-
/***/ }),
|
|
754
|
-
|
|
755
|
-
/***/ 32:
|
|
756
|
-
/***/ (function(module, exports) {
|
|
757
|
-
|
|
758
|
-
module.exports = require("@splunk/ui-utils/id");
|
|
839
|
+
exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
|
|
759
840
|
|
|
760
841
|
/***/ }),
|
|
761
842
|
|
|
@@ -766,21 +847,27 @@ module.exports = require("@splunk/ui-utils/id");
|
|
|
766
847
|
|
|
767
848
|
|
|
768
849
|
var _defineProperty = __webpack_require__(7);
|
|
850
|
+
|
|
769
851
|
Object.defineProperty(exports, "__esModule", {
|
|
770
852
|
value: true
|
|
771
853
|
});
|
|
772
854
|
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
855
|
+
|
|
773
856
|
var T = __webpack_require__(0);
|
|
857
|
+
|
|
774
858
|
var lodash_1 = __webpack_require__(3);
|
|
775
|
-
|
|
859
|
+
|
|
860
|
+
var DataSource_1 = __webpack_require__(34);
|
|
861
|
+
|
|
776
862
|
exports.SortParamsPropTypes = T.shape({
|
|
777
863
|
currentSortKey: T.string,
|
|
778
864
|
currentSortDir: T.oneOf(DataSource_1.validSortDirs),
|
|
779
865
|
onSort: T.func
|
|
780
866
|
});
|
|
867
|
+
|
|
781
868
|
var getSortingParams = function getSortingParams(_ref) {
|
|
782
869
|
var requestParams = _ref.requestParams,
|
|
783
|
-
|
|
870
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
784
871
|
var currentSortKey;
|
|
785
872
|
var currentSortDir;
|
|
786
873
|
var nextSortDirMap = {
|
|
@@ -789,17 +876,20 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
789
876
|
none: 'asc'
|
|
790
877
|
};
|
|
791
878
|
var onSort;
|
|
879
|
+
|
|
792
880
|
if (typeof onRequestParamsChange === 'function') {
|
|
793
|
-
if (requestParams && lodash_1.has(requestParams, 'sort')) {
|
|
881
|
+
if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
|
|
794
882
|
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
795
883
|
currentSortDir = requestParams.sort[currentSortKey];
|
|
796
|
-
}
|
|
797
|
-
|
|
884
|
+
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
885
|
+
|
|
886
|
+
|
|
798
887
|
onSort = function onSort(e, _ref2) {
|
|
799
888
|
var sortKey = _ref2.sortKey,
|
|
800
|
-
|
|
889
|
+
sortDir = _ref2.sortDir;
|
|
890
|
+
|
|
801
891
|
if (typeof sortKey === 'string') {
|
|
802
|
-
var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
892
|
+
var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
803
893
|
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
804
894
|
offset: 0,
|
|
805
895
|
sort: _defineProperty({}, sortKey, nextSortDir)
|
|
@@ -809,12 +899,14 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
809
899
|
}
|
|
810
900
|
};
|
|
811
901
|
}
|
|
902
|
+
|
|
812
903
|
return {
|
|
813
904
|
currentSortKey: currentSortKey,
|
|
814
905
|
currentSortDir: currentSortDir,
|
|
815
906
|
onSort: onSort
|
|
816
907
|
};
|
|
817
908
|
};
|
|
909
|
+
|
|
818
910
|
exports.getSortingParams = getSortingParams;
|
|
819
911
|
|
|
820
912
|
/***/ }),
|
|
@@ -825,43 +917,69 @@ exports.getSortingParams = getSortingParams;
|
|
|
825
917
|
"use strict";
|
|
826
918
|
|
|
827
919
|
|
|
920
|
+
Object.defineProperty(exports, "__esModule", {
|
|
921
|
+
value: true
|
|
922
|
+
});
|
|
923
|
+
exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
|
|
924
|
+
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
925
|
+
exports.validSegmentationModes = ['none', 'inner'];
|
|
926
|
+
exports.validOutputModes = ['json_cols', 'json'];
|
|
927
|
+
|
|
928
|
+
/***/ }),
|
|
929
|
+
|
|
930
|
+
/***/ 35:
|
|
931
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
932
|
+
|
|
933
|
+
"use strict";
|
|
934
|
+
|
|
935
|
+
|
|
828
936
|
Object.defineProperty(exports, "__esModule", {
|
|
829
937
|
value: true
|
|
830
938
|
});
|
|
831
939
|
exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
940
|
+
|
|
832
941
|
var T = __webpack_require__(0);
|
|
942
|
+
|
|
833
943
|
var lodash_1 = __webpack_require__(3);
|
|
944
|
+
|
|
834
945
|
exports.PaginatorParamsPropTypes = T.shape({
|
|
835
946
|
isPaging: T.bool,
|
|
836
947
|
current: T.number,
|
|
837
948
|
totalPages: T.number,
|
|
838
949
|
onChange: T.func
|
|
839
950
|
});
|
|
951
|
+
|
|
840
952
|
var getPaginationParams = function getPaginationParams(_ref) {
|
|
841
953
|
var requestParams = _ref.requestParams,
|
|
842
|
-
|
|
843
|
-
|
|
954
|
+
meta = _ref.meta,
|
|
955
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
844
956
|
var totalCount = meta && meta.totalCount || 0;
|
|
845
957
|
var offset = requestParams && requestParams.offset || 0;
|
|
846
958
|
var count = requestParams && requestParams.count;
|
|
847
959
|
var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
848
960
|
var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
849
961
|
var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
|
|
962
|
+
|
|
850
963
|
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
851
964
|
var page = _ref2.page,
|
|
852
|
-
|
|
853
|
-
var newParams = lodash_1.cloneDeep(requestParams);
|
|
965
|
+
countArg = _ref2.count;
|
|
966
|
+
var newParams = (0, lodash_1.cloneDeep)(requestParams);
|
|
967
|
+
|
|
854
968
|
if (typeof countArg === 'number') {
|
|
855
969
|
newParams.count = countArg;
|
|
856
970
|
newParams.offset = 0;
|
|
857
971
|
}
|
|
972
|
+
|
|
858
973
|
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
974
|
+
|
|
859
975
|
if (typeof page === 'number' && page > 0) {
|
|
860
976
|
newParams.count = pageCount;
|
|
861
977
|
newParams.offset = (page - 1) * pageCount;
|
|
862
978
|
}
|
|
979
|
+
|
|
863
980
|
onRequestParamsChange(newParams);
|
|
864
981
|
};
|
|
982
|
+
|
|
865
983
|
return {
|
|
866
984
|
isPaging: isPaging,
|
|
867
985
|
current: current,
|
|
@@ -869,11 +987,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
|
|
|
869
987
|
onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
|
|
870
988
|
};
|
|
871
989
|
};
|
|
990
|
+
|
|
872
991
|
exports.getPaginationParams = getPaginationParams;
|
|
873
992
|
|
|
874
993
|
/***/ }),
|
|
875
994
|
|
|
876
|
-
/***/
|
|
995
|
+
/***/ 36:
|
|
877
996
|
/***/ (function(module, exports, __webpack_require__) {
|
|
878
997
|
|
|
879
998
|
"use strict";
|
|
@@ -884,6 +1003,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
884
1003
|
});
|
|
885
1004
|
exports.VizCategory = void 0;
|
|
886
1005
|
var VizCategory;
|
|
1006
|
+
|
|
887
1007
|
(function (VizCategory) {
|
|
888
1008
|
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
889
1009
|
VizCategory["TRENDS"] = "Trends";
|
|
@@ -901,67 +1021,96 @@ var VizCategory;
|
|
|
901
1021
|
|
|
902
1022
|
/***/ }),
|
|
903
1023
|
|
|
904
|
-
/***/
|
|
1024
|
+
/***/ 37:
|
|
905
1025
|
/***/ (function(module, exports, __webpack_require__) {
|
|
906
1026
|
|
|
907
1027
|
"use strict";
|
|
908
1028
|
|
|
909
1029
|
|
|
910
1030
|
var _slicedToArray = __webpack_require__(17);
|
|
1031
|
+
|
|
911
1032
|
Object.defineProperty(exports, "__esModule", {
|
|
912
1033
|
value: true
|
|
913
1034
|
});
|
|
1035
|
+
|
|
914
1036
|
var React = __webpack_require__(1);
|
|
1037
|
+
|
|
915
1038
|
var lodash_1 = __webpack_require__(3);
|
|
916
|
-
|
|
917
|
-
var
|
|
918
|
-
|
|
919
|
-
var
|
|
920
|
-
|
|
1039
|
+
|
|
1040
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(38);
|
|
1041
|
+
|
|
1042
|
+
var Options_1 = __webpack_require__(30);
|
|
1043
|
+
|
|
1044
|
+
var SanitizeProps_1 = __webpack_require__(39);
|
|
1045
|
+
|
|
1046
|
+
var TimezoneContext_1 = __webpack_require__(26);
|
|
1047
|
+
|
|
1048
|
+
var moment_1 = __webpack_require__(40);
|
|
1049
|
+
|
|
921
1050
|
var FeatureFlagContext_1 = __webpack_require__(21);
|
|
1051
|
+
|
|
922
1052
|
var styled_components_1 = __webpack_require__(4);
|
|
923
|
-
|
|
924
|
-
var
|
|
925
|
-
|
|
926
|
-
var
|
|
927
|
-
|
|
1053
|
+
|
|
1054
|
+
var hocUtils_1 = __webpack_require__(27);
|
|
1055
|
+
|
|
1056
|
+
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
1057
|
+
|
|
1058
|
+
var async_dynamic_options_evaluator_1 = __webpack_require__(41);
|
|
1059
|
+
|
|
1060
|
+
var id_1 = __webpack_require__(25);
|
|
1061
|
+
|
|
1062
|
+
var SplunkVisualization_1 = __webpack_require__(42);
|
|
1063
|
+
|
|
928
1064
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1065
|
+
|
|
929
1066
|
var getSorting_1 = __webpack_require__(33);
|
|
930
|
-
|
|
1067
|
+
|
|
1068
|
+
var getPagination_1 = __webpack_require__(35);
|
|
1069
|
+
|
|
931
1070
|
var useDeepMemo_1 = __webpack_require__(44);
|
|
1071
|
+
|
|
932
1072
|
var MissingPropsMessage_1 = __webpack_require__(45);
|
|
1073
|
+
|
|
933
1074
|
var withEditModeCover_1 = __webpack_require__(46);
|
|
1075
|
+
|
|
934
1076
|
var withPlaceholder_1 = __webpack_require__(47);
|
|
935
1077
|
/**
|
|
936
1078
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
937
1079
|
* @param {DashboardVizOpts} opts
|
|
938
1080
|
* @returns {HOC}
|
|
939
1081
|
*/
|
|
1082
|
+
|
|
1083
|
+
|
|
940
1084
|
var withDashboardViz = function withDashboardViz(opts) {
|
|
941
1085
|
var ReactViz = opts.ReactViz,
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
var
|
|
1086
|
+
vizConfig = opts.vizConfig,
|
|
1087
|
+
_opts$computeVizProps = opts.computeVizProps,
|
|
1088
|
+
computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
|
|
1089
|
+
disableEditModeCover = opts.disableEditModeCover,
|
|
1090
|
+
useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
|
|
1091
|
+
|
|
1092
|
+
var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
|
|
1093
|
+
var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
|
|
1094
|
+
|
|
949
1095
|
var DashboardViz = function DashboardViz(props) {
|
|
950
1096
|
var _a;
|
|
1097
|
+
|
|
951
1098
|
var mode = props.mode,
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
1099
|
+
hasEventHandlers = props.hasEventHandlers,
|
|
1100
|
+
dataSources = props.dataSources,
|
|
1101
|
+
options = props.options,
|
|
1102
|
+
_props$context = props.context,
|
|
1103
|
+
context = _props$context === void 0 ? {} : _props$context,
|
|
1104
|
+
width = props.width,
|
|
1105
|
+
height = props.height,
|
|
1106
|
+
onComputedProps = props.onComputedProps,
|
|
1107
|
+
onEventTrigger = props.onEventTrigger,
|
|
1108
|
+
theme = props.theme,
|
|
1109
|
+
onRequestParamsChange = props.onRequestParamsChange;
|
|
1110
|
+
|
|
963
1111
|
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
964
|
-
|
|
1112
|
+
serializedTimezone = _React$useContext.serializedTimezone;
|
|
1113
|
+
|
|
965
1114
|
if (serializedTimezone) {
|
|
966
1115
|
/*
|
|
967
1116
|
@splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
|
|
@@ -975,44 +1124,58 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
975
1124
|
moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
|
|
976
1125
|
}
|
|
977
1126
|
}
|
|
1127
|
+
|
|
978
1128
|
var themeFunc = function themeFunc(themeVar) {
|
|
979
1129
|
var _a, _b;
|
|
1130
|
+
|
|
980
1131
|
return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
|
|
981
1132
|
};
|
|
1133
|
+
|
|
982
1134
|
var bgColorFromTheme = themeFunc('defaultBackgroundColor');
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1135
|
+
|
|
1136
|
+
var _ref = (0, getSettingsFromThemedProps_1.default)({
|
|
1137
|
+
theme: theme
|
|
1138
|
+
}),
|
|
1139
|
+
currentThemeFamily = _ref.family,
|
|
1140
|
+
currentThemeColorScheme = _ref.colorScheme,
|
|
1141
|
+
currentThemeDensity = _ref.density;
|
|
1142
|
+
|
|
989
1143
|
var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
|
|
1144
|
+
|
|
990
1145
|
var _React$useState = React.useState({}),
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1146
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1147
|
+
evaluatedOptionsAsync = _React$useState2[0],
|
|
1148
|
+
setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
|
|
1149
|
+
|
|
1150
|
+
|
|
994
1151
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1152
|
+
|
|
1153
|
+
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
|
|
1154
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
1155
|
+
visualizationID = _React$useState4[0];
|
|
1156
|
+
|
|
998
1157
|
var _React$useState5 = React.useState({}),
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1158
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
1159
|
+
dataSourcesInState = _React$useState6[0],
|
|
1160
|
+
setDataSourcesInState = _React$useState6[1];
|
|
1161
|
+
|
|
1002
1162
|
var _React$useState7 = React.useState(),
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1163
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
1164
|
+
dataFramesInState = _React$useState8[0],
|
|
1165
|
+
setDataFramesInState = _React$useState8[1];
|
|
1166
|
+
|
|
1167
|
+
var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
|
|
1168
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
1169
|
+
useAsyncEvaluatedOptions = _React$useState10[0],
|
|
1170
|
+
setUseAsyncEvaluatedOptions = _React$useState10[1];
|
|
1171
|
+
|
|
1172
|
+
var isMounted = React.useRef(true);
|
|
1173
|
+
evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
|
|
1011
1174
|
try {
|
|
1012
1175
|
if (useAsyncEvaluatedOptions) {
|
|
1013
1176
|
var optionsToEvaluate = {
|
|
1014
|
-
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
1015
|
-
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
1177
|
+
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
1178
|
+
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
1016
1179
|
};
|
|
1017
1180
|
var asyncDynamicOptionsEvaluatorParams = {
|
|
1018
1181
|
visualizationID: visualizationID,
|
|
@@ -1023,21 +1186,23 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1023
1186
|
};
|
|
1024
1187
|
async_dynamic_options_evaluator_1.default.evaluate(asyncDynamicOptionsEvaluatorParams).then(function (results) {
|
|
1025
1188
|
setEvaluatedOptionsAsync(results.results);
|
|
1026
|
-
}).catch(function (
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1189
|
+
}).catch(function () {
|
|
1190
|
+
if (isMounted.current) {
|
|
1191
|
+
setUseAsyncEvaluatedOptions(false);
|
|
1192
|
+
}
|
|
1030
1193
|
});
|
|
1031
1194
|
} else {
|
|
1032
1195
|
var dataFrames = dataFramesInState;
|
|
1196
|
+
|
|
1033
1197
|
if (dataSources !== dataSourcesInState) {
|
|
1034
1198
|
setDataSourcesInState(dataSources);
|
|
1035
1199
|
dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
|
|
1036
1200
|
setDataFramesInState(dataFrames);
|
|
1037
1201
|
}
|
|
1202
|
+
|
|
1038
1203
|
return Options_1.Options.evaluate({
|
|
1039
|
-
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
1040
|
-
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
1204
|
+
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
1205
|
+
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
1041
1206
|
}, dataSources, themeFunc, dataFrames);
|
|
1042
1207
|
}
|
|
1043
1208
|
} catch (e) {
|
|
@@ -1045,67 +1210,76 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1045
1210
|
console.error("unexpected error evaluating options: ".concat(e.message));
|
|
1046
1211
|
return {};
|
|
1047
1212
|
}
|
|
1213
|
+
|
|
1048
1214
|
return {};
|
|
1049
1215
|
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
|
|
1050
|
-
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
1051
|
-
// trellis specific backgroundColor update for onComputedProps
|
|
1216
|
+
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
|
|
1052
1217
|
// 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
|
|
1053
1218
|
// onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
|
|
1219
|
+
|
|
1054
1220
|
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
1055
1221
|
var clonedEvaluatedOptions = evaluatedOptionsToUse;
|
|
1222
|
+
|
|
1056
1223
|
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) {
|
|
1057
1224
|
clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
|
|
1058
1225
|
backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
1059
1226
|
});
|
|
1060
|
-
}
|
|
1061
|
-
// useEffect hook needs to be initialized before any early returns
|
|
1227
|
+
} // useEffect hook needs to be initialized before any early returns
|
|
1062
1228
|
// this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
|
|
1229
|
+
|
|
1230
|
+
|
|
1063
1231
|
React.useEffect(function () {
|
|
1064
1232
|
onComputedProps(clonedEvaluatedOptions);
|
|
1065
1233
|
});
|
|
1066
1234
|
React.useEffect(function () {
|
|
1067
1235
|
return function () {
|
|
1068
1236
|
if (useAsyncEvaluatedOptions) {
|
|
1237
|
+
isMounted.current = false;
|
|
1069
1238
|
async_dynamic_options_evaluator_1.default.reset(visualizationID);
|
|
1070
1239
|
}
|
|
1071
|
-
};
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
// present warning message if any required props are missing
|
|
1240
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1241
|
+
}, []); // present warning message if any required props are missing
|
|
1242
|
+
|
|
1075
1243
|
var _vizConfig$requiredPr = vizConfig.requiredProps,
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptionsToUse);
|
|
1244
|
+
requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
|
|
1245
|
+
supports = vizConfig.supports;
|
|
1246
|
+
var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
|
|
1247
|
+
|
|
1079
1248
|
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
|
|
1080
1249
|
) {
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1250
|
+
return React.createElement(MissingPropsMessage_1.default, {
|
|
1251
|
+
"data-test": "missing-props-message",
|
|
1252
|
+
width: width,
|
|
1253
|
+
height: height,
|
|
1254
|
+
missingProps: missing,
|
|
1255
|
+
backgroundColor: bgColorFromTheme
|
|
1256
|
+
});
|
|
1257
|
+
} // events
|
|
1258
|
+
|
|
1259
|
+
|
|
1090
1260
|
var eventCallbackProps = {};
|
|
1261
|
+
|
|
1091
1262
|
if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
|
|
1092
1263
|
var supportedEvents = vizConfig.events;
|
|
1093
1264
|
Object.keys(supportedEvents).forEach(function (eventName) {
|
|
1094
|
-
var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
|
|
1095
|
-
eventCallbackProps[eventCallbackPropName] = null;
|
|
1096
|
-
// todo: refactor single value and single value icon to send payload from viz
|
|
1265
|
+
var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
|
|
1266
|
+
eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
|
|
1097
1267
|
// then remove these lines
|
|
1268
|
+
|
|
1098
1269
|
var payloadKeys = supportedEvents[eventName].payloadKeys;
|
|
1099
1270
|
var payload = {};
|
|
1271
|
+
|
|
1100
1272
|
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
1101
1273
|
payloadKeys.forEach(function (p) {
|
|
1102
1274
|
payload[p] = evaluatedOptionsToUse[p];
|
|
1103
1275
|
});
|
|
1104
1276
|
}
|
|
1277
|
+
|
|
1105
1278
|
eventCallbackProps[eventCallbackPropName] = function (ev) {
|
|
1106
1279
|
if (ev && ev.payload) {
|
|
1107
1280
|
payload = ev.payload;
|
|
1108
1281
|
}
|
|
1282
|
+
|
|
1109
1283
|
return onEventTrigger({
|
|
1110
1284
|
originalEvent: ev,
|
|
1111
1285
|
payload: payload,
|
|
@@ -1113,8 +1287,9 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1113
1287
|
});
|
|
1114
1288
|
};
|
|
1115
1289
|
});
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1290
|
+
} // compute pure viz props which are not from options
|
|
1291
|
+
|
|
1292
|
+
|
|
1118
1293
|
var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
1119
1294
|
themeFunc: themeFunc
|
|
1120
1295
|
}));
|
|
@@ -1132,21 +1307,25 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1132
1307
|
* In future, we could automatically detect which all datasources are being used
|
|
1133
1308
|
* and bind those magically to pagination/sorting behavior.
|
|
1134
1309
|
*/
|
|
1310
|
+
|
|
1135
1311
|
var dataSourceMetadata = {};
|
|
1136
1312
|
var OptionKey = 'paginateDataSourceKey';
|
|
1137
|
-
var paginateDataSourceKey = lodash_1.has(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
var
|
|
1313
|
+
var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1314
|
+
|
|
1315
|
+
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
|
|
1316
|
+
var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
1317
|
+
var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
1318
|
+
|
|
1141
1319
|
var handleRequestParamsChange = function handleRequestParamsChange(payload) {
|
|
1142
1320
|
return onRequestParamsChange(paginateDataSourceKey, payload);
|
|
1143
1321
|
};
|
|
1144
|
-
|
|
1322
|
+
|
|
1323
|
+
var sortParams = (0, getSorting_1.getSortingParams)({
|
|
1145
1324
|
requestParams: requestParams,
|
|
1146
1325
|
meta: meta,
|
|
1147
1326
|
onRequestParamsChange: handleRequestParamsChange
|
|
1148
1327
|
});
|
|
1149
|
-
var paginatorParams = getPagination_1.getPaginationParams({
|
|
1328
|
+
var paginatorParams = (0, getPagination_1.getPaginationParams)({
|
|
1150
1329
|
requestParams: requestParams,
|
|
1151
1330
|
meta: meta,
|
|
1152
1331
|
onRequestParamsChange: handleRequestParamsChange
|
|
@@ -1155,115 +1334,132 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1155
1334
|
sortParams: sortParams,
|
|
1156
1335
|
paginatorParams: paginatorParams
|
|
1157
1336
|
};
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1337
|
+
} // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
|
|
1338
|
+
|
|
1339
|
+
|
|
1160
1340
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
1161
1341
|
return null;
|
|
1162
1342
|
}
|
|
1343
|
+
|
|
1163
1344
|
return React.createElement(SanitizedReactViz, Object.assign({
|
|
1164
1345
|
mode: mode,
|
|
1165
1346
|
width: width,
|
|
1166
1347
|
height: height
|
|
1167
1348
|
}, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
|
|
1168
1349
|
};
|
|
1350
|
+
|
|
1169
1351
|
DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
|
|
1170
1352
|
DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
|
|
1171
1353
|
// using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
|
|
1172
1354
|
theme: {}
|
|
1173
|
-
});
|
|
1174
|
-
|
|
1175
|
-
DashboardViz.config = vizConfig;
|
|
1176
|
-
|
|
1177
|
-
return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1355
|
+
}); // attach viz config
|
|
1356
|
+
|
|
1357
|
+
DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
|
|
1358
|
+
|
|
1359
|
+
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1178
1360
|
};
|
|
1361
|
+
|
|
1179
1362
|
exports.default = withDashboardViz;
|
|
1180
1363
|
|
|
1181
1364
|
/***/ }),
|
|
1182
1365
|
|
|
1183
|
-
/***/
|
|
1366
|
+
/***/ 38:
|
|
1184
1367
|
/***/ (function(module, exports) {
|
|
1185
1368
|
|
|
1186
1369
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
1187
1370
|
|
|
1188
1371
|
/***/ }),
|
|
1189
1372
|
|
|
1190
|
-
/***/
|
|
1373
|
+
/***/ 39:
|
|
1191
1374
|
/***/ (function(module, exports) {
|
|
1192
1375
|
|
|
1193
1376
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1194
1377
|
|
|
1195
1378
|
/***/ }),
|
|
1196
1379
|
|
|
1197
|
-
/***/
|
|
1380
|
+
/***/ 4:
|
|
1198
1381
|
/***/ (function(module, exports) {
|
|
1199
1382
|
|
|
1200
|
-
module.exports = require("
|
|
1383
|
+
module.exports = require("styled-components");
|
|
1201
1384
|
|
|
1202
1385
|
/***/ }),
|
|
1203
1386
|
|
|
1204
|
-
/***/
|
|
1387
|
+
/***/ 40:
|
|
1205
1388
|
/***/ (function(module, exports) {
|
|
1206
1389
|
|
|
1207
|
-
module.exports = require("
|
|
1390
|
+
module.exports = require("@splunk/moment");
|
|
1208
1391
|
|
|
1209
1392
|
/***/ }),
|
|
1210
1393
|
|
|
1211
|
-
/***/
|
|
1394
|
+
/***/ 41:
|
|
1212
1395
|
/***/ (function(module, exports) {
|
|
1213
1396
|
|
|
1214
1397
|
module.exports = require("@splunk/async-dynamic-options-evaluator");
|
|
1215
1398
|
|
|
1216
1399
|
/***/ }),
|
|
1217
1400
|
|
|
1218
|
-
/***/
|
|
1401
|
+
/***/ 42:
|
|
1219
1402
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1220
1403
|
|
|
1221
1404
|
"use strict";
|
|
1222
1405
|
|
|
1223
1406
|
|
|
1224
1407
|
var _classCallCheck = __webpack_require__(9);
|
|
1408
|
+
|
|
1225
1409
|
Object.defineProperty(exports, "__esModule", {
|
|
1226
1410
|
value: true
|
|
1227
1411
|
});
|
|
1228
1412
|
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
1229
1413
|
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
1414
|
+
|
|
1230
1415
|
var T = __webpack_require__(0);
|
|
1416
|
+
|
|
1231
1417
|
var lodash_1 = __webpack_require__(3);
|
|
1232
|
-
|
|
1233
|
-
// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1418
|
+
|
|
1419
|
+
var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1420
|
+
|
|
1421
|
+
|
|
1234
1422
|
exports.INITIAL_WIDTH = 250;
|
|
1235
1423
|
exports.INITIAL_HEIGHT = 250;
|
|
1236
1424
|
/**
|
|
1237
1425
|
* A Splunk visualization
|
|
1238
1426
|
*/
|
|
1427
|
+
|
|
1239
1428
|
var SplunkVisualization = function SplunkVisualization() {
|
|
1240
1429
|
_classCallCheck(this, SplunkVisualization);
|
|
1241
1430
|
};
|
|
1431
|
+
|
|
1242
1432
|
SplunkVisualization.propTypes = {
|
|
1243
1433
|
/**
|
|
1244
1434
|
* display mode
|
|
1245
1435
|
*/
|
|
1246
1436
|
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
1437
|
+
|
|
1247
1438
|
/**
|
|
1248
1439
|
* width in pixel or string, defaults to 100%
|
|
1249
1440
|
*/
|
|
1250
1441
|
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
1442
|
+
|
|
1251
1443
|
/**
|
|
1252
1444
|
* height in pixel or string
|
|
1253
1445
|
*/
|
|
1254
1446
|
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
1447
|
+
|
|
1255
1448
|
/**
|
|
1256
1449
|
* visualization context used for dynamic option evaluation
|
|
1257
1450
|
*/
|
|
1258
1451
|
context: T.object,
|
|
1452
|
+
|
|
1259
1453
|
/**
|
|
1260
1454
|
* visualization formatting options
|
|
1261
1455
|
*/
|
|
1262
1456
|
options: T.object,
|
|
1457
|
+
|
|
1263
1458
|
/**
|
|
1264
1459
|
* A callback to update formatting options
|
|
1265
1460
|
*/
|
|
1266
1461
|
onOptionsChange: T.func,
|
|
1462
|
+
|
|
1267
1463
|
/**
|
|
1268
1464
|
* datasource state which include data and request params, object key indicate the datasource type.
|
|
1269
1465
|
*/
|
|
@@ -1272,6 +1468,7 @@ SplunkVisualization.propTypes = {
|
|
|
1272
1468
|
* current request params
|
|
1273
1469
|
*/
|
|
1274
1470
|
requestParams: T.object,
|
|
1471
|
+
|
|
1275
1472
|
/**
|
|
1276
1473
|
* current dataset
|
|
1277
1474
|
*/
|
|
@@ -1279,6 +1476,7 @@ SplunkVisualization.propTypes = {
|
|
|
1279
1476
|
fields: T.array,
|
|
1280
1477
|
columns: T.array
|
|
1281
1478
|
}),
|
|
1479
|
+
|
|
1282
1480
|
/**
|
|
1283
1481
|
* error
|
|
1284
1482
|
*/
|
|
@@ -1286,29 +1484,35 @@ SplunkVisualization.propTypes = {
|
|
|
1286
1484
|
level: T.string,
|
|
1287
1485
|
message: T.string
|
|
1288
1486
|
}),
|
|
1487
|
+
|
|
1289
1488
|
/**
|
|
1290
1489
|
* meta data that came with the dataset
|
|
1291
1490
|
*/
|
|
1292
1491
|
meta: T.object
|
|
1293
1492
|
})),
|
|
1493
|
+
|
|
1294
1494
|
/**
|
|
1295
1495
|
* A callback to trigger event
|
|
1296
1496
|
*/
|
|
1297
1497
|
onEventTrigger: T.func,
|
|
1498
|
+
|
|
1298
1499
|
/**
|
|
1299
1500
|
* Inform viz if there are handlers listening to events
|
|
1300
1501
|
*/
|
|
1301
1502
|
hasEventHandlers: T.bool,
|
|
1503
|
+
|
|
1302
1504
|
/**
|
|
1303
1505
|
* A callback to communicate computed props to a consumer
|
|
1304
1506
|
*/
|
|
1305
1507
|
onComputedProps: T.func,
|
|
1508
|
+
|
|
1306
1509
|
/**
|
|
1307
1510
|
* A callback to obtain visualization api
|
|
1308
1511
|
*/
|
|
1309
1512
|
vizActionHandlerRef: T.func,
|
|
1310
1513
|
loading: T.bool,
|
|
1311
1514
|
theme: T.object,
|
|
1515
|
+
|
|
1312
1516
|
/**
|
|
1313
1517
|
* A callback to request new data with updated request params
|
|
1314
1518
|
*/
|
|
@@ -1317,6 +1521,7 @@ SplunkVisualization.propTypes = {
|
|
|
1317
1521
|
/**
|
|
1318
1522
|
*
|
|
1319
1523
|
*/
|
|
1524
|
+
|
|
1320
1525
|
SplunkVisualization.defaultProps = {
|
|
1321
1526
|
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
1322
1527
|
width: '100%',
|
|
@@ -1345,26 +1550,29 @@ exports.default = SplunkVisualization;
|
|
|
1345
1550
|
|
|
1346
1551
|
/***/ }),
|
|
1347
1552
|
|
|
1348
|
-
/***/
|
|
1553
|
+
/***/ 43:
|
|
1349
1554
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1350
1555
|
|
|
1351
1556
|
"use strict";
|
|
1352
1557
|
|
|
1353
1558
|
|
|
1354
1559
|
var _classCallCheck = __webpack_require__(9);
|
|
1560
|
+
|
|
1355
1561
|
var _createClass = __webpack_require__(18);
|
|
1562
|
+
|
|
1356
1563
|
Object.defineProperty(exports, "__esModule", {
|
|
1357
1564
|
value: true
|
|
1358
1565
|
});
|
|
1359
1566
|
exports.DefaultVizActionHandler = void 0;
|
|
1567
|
+
|
|
1360
1568
|
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
1361
1569
|
function DefaultVizActionHandler() {
|
|
1362
1570
|
_classCallCheck(this, DefaultVizActionHandler);
|
|
1363
1571
|
}
|
|
1572
|
+
|
|
1364
1573
|
_createClass(DefaultVizActionHandler, [{
|
|
1365
1574
|
key: "focus",
|
|
1366
|
-
value: function focus() {
|
|
1367
|
-
// noop
|
|
1575
|
+
value: function focus() {// noop
|
|
1368
1576
|
}
|
|
1369
1577
|
}, {
|
|
1370
1578
|
key: "snapshot",
|
|
@@ -1372,23 +1580,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
|
1372
1580
|
return null; // noop
|
|
1373
1581
|
}
|
|
1374
1582
|
}]);
|
|
1583
|
+
|
|
1375
1584
|
return DefaultVizActionHandler;
|
|
1376
1585
|
}();
|
|
1377
|
-
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1378
|
-
|
|
1379
|
-
/***/ }),
|
|
1380
1586
|
|
|
1381
|
-
|
|
1382
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1383
|
-
|
|
1384
|
-
"use strict";
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1388
|
-
value: true
|
|
1389
|
-
});
|
|
1390
|
-
exports.validSortDirs = void 0;
|
|
1391
|
-
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1587
|
+
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1392
1588
|
|
|
1393
1589
|
/***/ }),
|
|
1394
1590
|
|
|
@@ -1402,7 +1598,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1402
1598
|
value: true
|
|
1403
1599
|
});
|
|
1404
1600
|
exports.useDeepMemo = void 0;
|
|
1601
|
+
|
|
1405
1602
|
var react_1 = __webpack_require__(1);
|
|
1603
|
+
|
|
1406
1604
|
var lodash_1 = __webpack_require__(3);
|
|
1407
1605
|
/**
|
|
1408
1606
|
* This hook evaluates and stores the result of a passed function and only
|
|
@@ -1417,16 +1615,21 @@ var lodash_1 = __webpack_require__(3);
|
|
|
1417
1615
|
* @param fn the function to be executed and
|
|
1418
1616
|
* @param dependencies an array of dependencies
|
|
1419
1617
|
*/
|
|
1618
|
+
|
|
1619
|
+
|
|
1420
1620
|
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
1421
|
-
var ref = react_1.useRef();
|
|
1422
|
-
|
|
1621
|
+
var ref = (0, react_1.useRef)();
|
|
1622
|
+
|
|
1623
|
+
if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
|
|
1423
1624
|
ref.current = {
|
|
1424
1625
|
dependencies: dependencies,
|
|
1425
1626
|
value: fn()
|
|
1426
1627
|
};
|
|
1427
1628
|
}
|
|
1629
|
+
|
|
1428
1630
|
return ref.current.value;
|
|
1429
1631
|
};
|
|
1632
|
+
|
|
1430
1633
|
exports.useDeepMemo = useDeepMemo;
|
|
1431
1634
|
|
|
1432
1635
|
/***/ }),
|
|
@@ -1441,19 +1644,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1441
1644
|
value: true
|
|
1442
1645
|
});
|
|
1443
1646
|
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
1647
|
+
|
|
1444
1648
|
var React = __webpack_require__(1);
|
|
1649
|
+
|
|
1445
1650
|
var T = __webpack_require__(0);
|
|
1651
|
+
|
|
1446
1652
|
var i18n_1 = __webpack_require__(2);
|
|
1653
|
+
|
|
1447
1654
|
var Message_1 = __webpack_require__(10);
|
|
1655
|
+
|
|
1448
1656
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
1449
1657
|
/**
|
|
1450
1658
|
* @method isMissing
|
|
1451
1659
|
* @param {any} v
|
|
1452
1660
|
* @returns {boolean} true if the input value === null or undefined
|
|
1453
1661
|
*/
|
|
1662
|
+
|
|
1663
|
+
|
|
1454
1664
|
var isMissing = function isMissing(v) {
|
|
1455
1665
|
return v === null || v === undefined;
|
|
1456
1666
|
};
|
|
1667
|
+
|
|
1457
1668
|
exports.isMissing = isMissing;
|
|
1458
1669
|
/**
|
|
1459
1670
|
* @method misskingKeys
|
|
@@ -1461,11 +1672,13 @@ exports.isMissing = isMissing;
|
|
|
1461
1672
|
* @param {object} target
|
|
1462
1673
|
* @returns {string[]} the keys of missing required props
|
|
1463
1674
|
*/
|
|
1675
|
+
|
|
1464
1676
|
var missingKeys = function missingKeys(keys, target) {
|
|
1465
1677
|
return keys.filter(function (k) {
|
|
1466
|
-
return exports.isMissing(target[k]);
|
|
1678
|
+
return (0, exports.isMissing)(target[k]);
|
|
1467
1679
|
});
|
|
1468
1680
|
};
|
|
1681
|
+
|
|
1469
1682
|
exports.missingKeys = missingKeys;
|
|
1470
1683
|
var propTypes = {
|
|
1471
1684
|
width: T.oneOfType([T.string, T.number]),
|
|
@@ -1479,24 +1692,26 @@ var propTypes = {
|
|
|
1479
1692
|
* @param {MissingPropsProps} props
|
|
1480
1693
|
* @returns {React.ReactElement}
|
|
1481
1694
|
*/
|
|
1695
|
+
|
|
1482
1696
|
var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
1483
1697
|
var width = props.width,
|
|
1484
|
-
|
|
1485
|
-
|
|
1698
|
+
height = props.height,
|
|
1699
|
+
missingProps = props.missingProps;
|
|
1486
1700
|
return React.createElement(Message_1.default, {
|
|
1487
1701
|
"data-test": "message",
|
|
1488
1702
|
width: width,
|
|
1489
1703
|
height: height,
|
|
1490
|
-
message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
|
|
1704
|
+
message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
|
|
1491
1705
|
});
|
|
1492
1706
|
};
|
|
1707
|
+
|
|
1493
1708
|
exports.MissingPropsMessage = MissingPropsMessage;
|
|
1494
1709
|
exports.MissingPropsMessage.propTypes = propTypes;
|
|
1495
1710
|
exports.MissingPropsMessage.defaultProps = {
|
|
1496
1711
|
width: '100%',
|
|
1497
1712
|
height: 250
|
|
1498
1713
|
};
|
|
1499
|
-
exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
1714
|
+
exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage);
|
|
1500
1715
|
|
|
1501
1716
|
/***/ }),
|
|
1502
1717
|
|
|
@@ -1509,15 +1724,19 @@ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
|
1509
1724
|
Object.defineProperty(exports, "__esModule", {
|
|
1510
1725
|
value: true
|
|
1511
1726
|
});
|
|
1727
|
+
|
|
1512
1728
|
var React = __webpack_require__(1);
|
|
1729
|
+
|
|
1513
1730
|
var styled_components_1 = __webpack_require__(4);
|
|
1731
|
+
|
|
1514
1732
|
var hocUtils_1 = __webpack_require__(15);
|
|
1733
|
+
|
|
1515
1734
|
var Cover = styled_components_1.default.div.withConfig({
|
|
1516
1735
|
displayName: "withEditModeCover__Cover",
|
|
1517
1736
|
componentId: "sc-1gsbnxb-0"
|
|
1518
1737
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1519
1738
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1520
|
-
'data-splunk-visualization-version': "
|
|
1739
|
+
'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
|
|
1521
1740
|
}).withConfig({
|
|
1522
1741
|
displayName: "withEditModeCover__Blocker",
|
|
1523
1742
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -1528,6 +1747,7 @@ var Blocker = styled_components_1.default.div.attrs({
|
|
|
1528
1747
|
* @param {ExtendedDashViz} Visualization
|
|
1529
1748
|
* @returns {ExtendedDashViz} Wrapper
|
|
1530
1749
|
*/
|
|
1750
|
+
|
|
1531
1751
|
var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
|
|
1532
1752
|
var Wrapper = function Wrapper(props) {
|
|
1533
1753
|
var mode = props.mode;
|
|
@@ -1536,12 +1756,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
|
|
|
1536
1756
|
"data-test": "edit-mode-cover"
|
|
1537
1757
|
}));
|
|
1538
1758
|
};
|
|
1539
|
-
|
|
1759
|
+
|
|
1760
|
+
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
1540
1761
|
Wrapper: Wrapper,
|
|
1541
1762
|
Visualization: Visualization
|
|
1542
1763
|
});
|
|
1543
1764
|
return Wrapper;
|
|
1544
1765
|
};
|
|
1766
|
+
|
|
1545
1767
|
exports.default = withEditModeCover;
|
|
1546
1768
|
|
|
1547
1769
|
/***/ }),
|
|
@@ -1555,27 +1777,37 @@ exports.default = withEditModeCover;
|
|
|
1555
1777
|
Object.defineProperty(exports, "__esModule", {
|
|
1556
1778
|
value: true
|
|
1557
1779
|
});
|
|
1780
|
+
|
|
1558
1781
|
var React = __webpack_require__(1);
|
|
1782
|
+
|
|
1559
1783
|
var colorUtils_1 = __webpack_require__(12);
|
|
1784
|
+
|
|
1560
1785
|
var variables_1 = __webpack_require__(11);
|
|
1561
|
-
|
|
1786
|
+
|
|
1787
|
+
var IconPlaceholder_1 = __webpack_require__(32);
|
|
1788
|
+
|
|
1562
1789
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1790
|
+
|
|
1563
1791
|
var hocUtils_1 = __webpack_require__(15);
|
|
1792
|
+
|
|
1564
1793
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
1565
1794
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
1566
1795
|
var config = Visualization.config;
|
|
1567
1796
|
var themes = config.themes;
|
|
1797
|
+
|
|
1568
1798
|
var Wrapper = function Wrapper(props) {
|
|
1569
1799
|
var _a, _b;
|
|
1800
|
+
|
|
1570
1801
|
var dataSources = props.dataSources,
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1802
|
+
loading = props.loading,
|
|
1803
|
+
options = props.options,
|
|
1804
|
+
height = props.height,
|
|
1805
|
+
width = props.width;
|
|
1575
1806
|
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
1576
|
-
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);
|
|
1807
|
+
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);
|
|
1577
1808
|
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
1578
1809
|
var iconColor = variables_1.default.contentColorActive(props);
|
|
1810
|
+
|
|
1579
1811
|
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
1580
1812
|
return React.createElement(IconPlaceholder_1.default, {
|
|
1581
1813
|
"data-test": "icon-placeholder",
|
|
@@ -1586,19 +1818,22 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
1586
1818
|
iconColor: iconColor
|
|
1587
1819
|
});
|
|
1588
1820
|
}
|
|
1821
|
+
|
|
1589
1822
|
return React.createElement(Visualization, Object.assign({}, props));
|
|
1590
1823
|
};
|
|
1591
|
-
|
|
1824
|
+
|
|
1825
|
+
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
1592
1826
|
Wrapper: Wrapper,
|
|
1593
1827
|
Visualization: Visualization
|
|
1594
1828
|
});
|
|
1595
1829
|
return Wrapper;
|
|
1596
1830
|
};
|
|
1831
|
+
|
|
1597
1832
|
exports.default = withPlaceholder;
|
|
1598
1833
|
|
|
1599
1834
|
/***/ }),
|
|
1600
1835
|
|
|
1601
|
-
/***/
|
|
1836
|
+
/***/ 479:
|
|
1602
1837
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1603
1838
|
|
|
1604
1839
|
"use strict";
|
|
@@ -1606,30 +1841,40 @@ exports.default = withPlaceholder;
|
|
|
1606
1841
|
|
|
1607
1842
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1608
1843
|
if (k2 === undefined) k2 = k;
|
|
1609
|
-
Object.
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1844
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1845
|
+
|
|
1846
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1847
|
+
desc = {
|
|
1848
|
+
enumerable: true,
|
|
1849
|
+
get: function get() {
|
|
1850
|
+
return m[k];
|
|
1851
|
+
}
|
|
1852
|
+
};
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
Object.defineProperty(o, k2, desc);
|
|
1615
1856
|
} : function (o, m, k, k2) {
|
|
1616
1857
|
if (k2 === undefined) k2 = k;
|
|
1617
1858
|
o[k2] = m[k];
|
|
1618
1859
|
});
|
|
1860
|
+
|
|
1619
1861
|
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
1620
1862
|
for (var p in m) {
|
|
1621
1863
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1622
1864
|
}
|
|
1623
1865
|
};
|
|
1866
|
+
|
|
1624
1867
|
Object.defineProperty(exports, "__esModule", {
|
|
1625
1868
|
value: true
|
|
1626
1869
|
});
|
|
1627
|
-
exports.default = void 0;
|
|
1628
|
-
// NOTE: wildcard syntax only works for named exports
|
|
1870
|
+
exports.default = void 0; // NOTE: wildcard syntax only works for named exports
|
|
1629
1871
|
// for some reason, omitting the default export worked before TS v4
|
|
1630
1872
|
// see: https://stackoverflow.com/a/34445175
|
|
1631
|
-
|
|
1632
|
-
|
|
1873
|
+
|
|
1874
|
+
__exportStar(__webpack_require__(168), exports);
|
|
1875
|
+
|
|
1876
|
+
var Table_1 = __webpack_require__(168);
|
|
1877
|
+
|
|
1633
1878
|
Object.defineProperty(exports, "default", {
|
|
1634
1879
|
enumerable: true,
|
|
1635
1880
|
get: function get() {
|
|
@@ -1639,28 +1884,49 @@ Object.defineProperty(exports, "default", {
|
|
|
1639
1884
|
|
|
1640
1885
|
/***/ }),
|
|
1641
1886
|
|
|
1642
|
-
/***/
|
|
1887
|
+
/***/ 48:
|
|
1888
|
+
/***/ (function(module, exports) {
|
|
1889
|
+
|
|
1890
|
+
module.exports = require("@babel/runtime/helpers/extends");
|
|
1891
|
+
|
|
1892
|
+
/***/ }),
|
|
1893
|
+
|
|
1894
|
+
/***/ 480:
|
|
1643
1895
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1644
1896
|
|
|
1645
1897
|
"use strict";
|
|
1646
1898
|
|
|
1647
1899
|
|
|
1648
1900
|
var _toConsumableArray = __webpack_require__(8);
|
|
1901
|
+
|
|
1649
1902
|
Object.defineProperty(exports, "__esModule", {
|
|
1650
1903
|
value: true
|
|
1651
1904
|
});
|
|
1905
|
+
|
|
1652
1906
|
var i18n_1 = __webpack_require__(2);
|
|
1907
|
+
|
|
1653
1908
|
var lodash_1 = __webpack_require__(3);
|
|
1909
|
+
|
|
1654
1910
|
var schemaUtils_1 = __webpack_require__(16);
|
|
1655
|
-
|
|
1911
|
+
|
|
1912
|
+
var colorConstants_1 = __webpack_require__(49);
|
|
1913
|
+
|
|
1656
1914
|
var visualization_icons_1 = __webpack_require__(52);
|
|
1657
|
-
|
|
1915
|
+
|
|
1916
|
+
var placeholders_1 = __webpack_require__(50);
|
|
1917
|
+
|
|
1658
1918
|
var variables_1 = __webpack_require__(11);
|
|
1919
|
+
|
|
1659
1920
|
var pick_1 = __webpack_require__(23);
|
|
1921
|
+
|
|
1660
1922
|
var configUtils_1 = __webpack_require__(20);
|
|
1923
|
+
|
|
1661
1924
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1662
|
-
|
|
1663
|
-
var
|
|
1925
|
+
|
|
1926
|
+
var consts_1 = __webpack_require__(137);
|
|
1927
|
+
|
|
1928
|
+
var VizCategory_1 = __webpack_require__(36);
|
|
1929
|
+
|
|
1664
1930
|
var dataContract = {
|
|
1665
1931
|
requiredDataSources: [{
|
|
1666
1932
|
name: 'primary',
|
|
@@ -1754,30 +2020,30 @@ var defaultContext = {
|
|
|
1754
2020
|
tableAltRowBackgroundColorsByBackgroundColor: ['> backgroundColor', '> backgroundColor | setColorChannel(tableRowBackgroundColorEvenConfig)']
|
|
1755
2021
|
};
|
|
1756
2022
|
var unitPositionConfig = {
|
|
1757
|
-
label: i18n_1._('Units position'),
|
|
2023
|
+
label: (0, i18n_1._)('Units position'),
|
|
1758
2024
|
editor: 'editor.select',
|
|
1759
2025
|
option: 'unitPosition',
|
|
1760
2026
|
editorProps: {
|
|
1761
2027
|
values: [{
|
|
1762
|
-
label: i18n_1._('Before'),
|
|
2028
|
+
label: (0, i18n_1._)('Before'),
|
|
1763
2029
|
value: 'before'
|
|
1764
2030
|
}, {
|
|
1765
|
-
label: i18n_1._('After'),
|
|
2031
|
+
label: (0, i18n_1._)('After'),
|
|
1766
2032
|
value: 'after'
|
|
1767
2033
|
}]
|
|
1768
2034
|
}
|
|
1769
2035
|
};
|
|
1770
2036
|
var unitLabelConfig = {
|
|
1771
|
-
label: i18n_1._('Unit label'),
|
|
2037
|
+
label: (0, i18n_1._)('Unit label'),
|
|
1772
2038
|
option: 'unit',
|
|
1773
2039
|
editor: 'editor.text'
|
|
1774
2040
|
};
|
|
1775
2041
|
var timeFormattingConfig = {
|
|
1776
|
-
label: i18n_1._('Date & Time formatting'),
|
|
2042
|
+
label: (0, i18n_1._)('Date & Time formatting'),
|
|
1777
2043
|
option: 'format',
|
|
1778
2044
|
editor: 'editor.text',
|
|
1779
2045
|
editorProps: {
|
|
1780
|
-
tooltip: i18n_1._('For example: DD-MM-YYYY')
|
|
2046
|
+
tooltip: (0, i18n_1._)('For example: DD-MM-YYYY')
|
|
1781
2047
|
}
|
|
1782
2048
|
};
|
|
1783
2049
|
var sequentialColorConfig = [{
|
|
@@ -1893,7 +2159,7 @@ var optionsSchema = {
|
|
|
1893
2159
|
textOverflow: {
|
|
1894
2160
|
description: 'Controls how the text should be truncated within a particular column. Valid types include "anywhere", "break-word", "ellipsis". Columns are "break-word" styled by default when "textOverflow" is not configured.',
|
|
1895
2161
|
type: 'string',
|
|
1896
|
-
pattern: schemaUtils_1.getPattern(consts_1.validTextOverflows),
|
|
2162
|
+
pattern: (0, schemaUtils_1.getPattern)(consts_1.validTextOverflows),
|
|
1897
2163
|
enum: consts_1.validTextOverflows.concat()
|
|
1898
2164
|
},
|
|
1899
2165
|
width: {
|
|
@@ -1914,13 +2180,13 @@ var optionsSchema = {
|
|
|
1914
2180
|
default: 'proportional',
|
|
1915
2181
|
description: 'Specify the font style to use for table content.',
|
|
1916
2182
|
type: 'string',
|
|
1917
|
-
pattern: schemaUtils_1.getPattern(['proportional', 'monospace'])
|
|
2183
|
+
pattern: (0, schemaUtils_1.getPattern)(['proportional', 'monospace'])
|
|
1918
2184
|
},
|
|
1919
2185
|
fontSize: {
|
|
1920
2186
|
default: 'default',
|
|
1921
2187
|
description: 'Specify the font size to use for table content. Font sizes range from extra small (10px) to large (16px) with the default being 14px.',
|
|
1922
2188
|
type: 'string',
|
|
1923
|
-
pattern: schemaUtils_1.getPattern(consts_1.validFontSizes)
|
|
2189
|
+
pattern: (0, schemaUtils_1.getPattern)(consts_1.validFontSizes)
|
|
1924
2190
|
},
|
|
1925
2191
|
headers: {
|
|
1926
2192
|
default: '> table | getField()',
|
|
@@ -1933,7 +2199,7 @@ var optionsSchema = {
|
|
|
1933
2199
|
headerVisibility: {
|
|
1934
2200
|
default: 'inline',
|
|
1935
2201
|
description: 'Specify how to display the table header row.',
|
|
1936
|
-
pattern: schemaUtils_1.getPattern(consts_1.validHeaderVisibilities),
|
|
2202
|
+
pattern: (0, schemaUtils_1.getPattern)(consts_1.validHeaderVisibilities),
|
|
1937
2203
|
enum: consts_1.validHeaderVisibilities.concat(),
|
|
1938
2204
|
type: 'string'
|
|
1939
2205
|
},
|
|
@@ -2091,7 +2357,7 @@ var optionsSchema = {
|
|
|
2091
2357
|
};
|
|
2092
2358
|
var themes = {
|
|
2093
2359
|
defaultBackgroundColor: function defaultBackgroundColor(props) {
|
|
2094
|
-
return pick_1.default({
|
|
2360
|
+
return (0, pick_1.default)({
|
|
2095
2361
|
enterprise: {
|
|
2096
2362
|
dark: variables_1.default.black(props),
|
|
2097
2363
|
light: variables_1.default.backgroundColor(props)
|
|
@@ -2100,7 +2366,7 @@ var themes = {
|
|
|
2100
2366
|
})(props);
|
|
2101
2367
|
},
|
|
2102
2368
|
defaultHeaderBackgroundColor: function defaultHeaderBackgroundColor(props) {
|
|
2103
|
-
return pick_1.default({
|
|
2369
|
+
return (0, pick_1.default)({
|
|
2104
2370
|
enterprise: {
|
|
2105
2371
|
dark: variables_1.default.gray20(props),
|
|
2106
2372
|
light: variables_1.default.gray92(props)
|
|
@@ -2109,7 +2375,7 @@ var themes = {
|
|
|
2109
2375
|
})(props);
|
|
2110
2376
|
},
|
|
2111
2377
|
rowBackgroundColorEven: function rowBackgroundColorEven(props) {
|
|
2112
|
-
return pick_1.default({
|
|
2378
|
+
return (0, pick_1.default)({
|
|
2113
2379
|
enterprise: {
|
|
2114
2380
|
dark: variables_1.default.black(props),
|
|
2115
2381
|
light: variables_1.default.gray96(props)
|
|
@@ -2118,7 +2384,7 @@ var themes = {
|
|
|
2118
2384
|
})(props);
|
|
2119
2385
|
},
|
|
2120
2386
|
rowBackgroundColorOdd: function rowBackgroundColorOdd(props) {
|
|
2121
|
-
return pick_1.default({
|
|
2387
|
+
return (0, pick_1.default)({
|
|
2122
2388
|
enterprise: {
|
|
2123
2389
|
dark: '#0D1012',
|
|
2124
2390
|
light: variables_1.default.backgroundColor(props)
|
|
@@ -2127,30 +2393,30 @@ var themes = {
|
|
|
2127
2393
|
})(props);
|
|
2128
2394
|
},
|
|
2129
2395
|
textColor: function textColor(props) {
|
|
2130
|
-
return pick_1.default({
|
|
2396
|
+
return (0, pick_1.default)({
|
|
2131
2397
|
enterprise: variables_1.default.textColor(props),
|
|
2132
2398
|
prisma: variables_1.default.contentColorDefault(props)
|
|
2133
2399
|
})(props);
|
|
2134
2400
|
},
|
|
2135
2401
|
inverseTextColor: function inverseTextColor(props) {
|
|
2136
|
-
return pick_1.default({
|
|
2402
|
+
return (0, pick_1.default)({
|
|
2137
2403
|
enterprise: {
|
|
2138
2404
|
dark: variables_1.default.contentColorInverted(props),
|
|
2139
2405
|
light: variables_1.default.white(props) // equal to textColor in enterpriseDark
|
|
2140
|
-
},
|
|
2141
2406
|
|
|
2407
|
+
},
|
|
2142
2408
|
prisma: variables_1.default.contentColorInverted(props)
|
|
2143
2409
|
})(props);
|
|
2144
2410
|
}
|
|
2145
2411
|
};
|
|
2146
|
-
var backgroundColorPaletteSet = new Set([].concat(_toConsumableArray(colorConstants_1.COLOR_EDITOR_PALETTE), _toConsumableArray(lodash_1.map(themes, function (t) {
|
|
2147
|
-
return lodash_1.get(t, 'defaultBackgroundColor');
|
|
2412
|
+
var backgroundColorPaletteSet = new Set([].concat(_toConsumableArray(colorConstants_1.COLOR_EDITOR_PALETTE), _toConsumableArray((0, lodash_1.map)(themes, function (t) {
|
|
2413
|
+
return (0, lodash_1.get)(t, 'defaultBackgroundColor');
|
|
2148
2414
|
}))));
|
|
2149
2415
|
var EDITOR_LABEL_WIDTH = 100;
|
|
2150
2416
|
var editorConfig = [{
|
|
2151
|
-
label: i18n_1._('Data display'),
|
|
2417
|
+
label: (0, i18n_1._)('Data display'),
|
|
2152
2418
|
layout: [[{
|
|
2153
|
-
label: i18n_1._('Rows displayed'),
|
|
2419
|
+
label: (0, i18n_1._)('Rows displayed'),
|
|
2154
2420
|
option: 'count',
|
|
2155
2421
|
editor: 'editor.number',
|
|
2156
2422
|
editorProps: {
|
|
@@ -2158,39 +2424,39 @@ var editorConfig = [{
|
|
|
2158
2424
|
labelWidth: EDITOR_LABEL_WIDTH
|
|
2159
2425
|
}
|
|
2160
2426
|
}], [{
|
|
2161
|
-
label: i18n_1._('Row numbers'),
|
|
2427
|
+
label: (0, i18n_1._)('Row numbers'),
|
|
2162
2428
|
option: 'showRowNumbers',
|
|
2163
2429
|
editor: 'editor.checkbox',
|
|
2164
2430
|
editorProps: {
|
|
2165
2431
|
labelWidth: EDITOR_LABEL_WIDTH
|
|
2166
2432
|
}
|
|
2167
2433
|
}], [{
|
|
2168
|
-
label: i18n_1._('Internal fields'),
|
|
2434
|
+
label: (0, i18n_1._)('Internal fields'),
|
|
2169
2435
|
option: 'showInternalFields',
|
|
2170
2436
|
editor: 'editor.checkbox',
|
|
2171
2437
|
editorProps: {
|
|
2172
2438
|
labelWidth: EDITOR_LABEL_WIDTH
|
|
2173
2439
|
}
|
|
2174
2440
|
}], [{
|
|
2175
|
-
label: i18n_1._('Header row'),
|
|
2441
|
+
label: (0, i18n_1._)('Header row'),
|
|
2176
2442
|
option: 'headerVisibility',
|
|
2177
2443
|
editor: 'editor.select',
|
|
2178
2444
|
editorProps: {
|
|
2179
2445
|
values: [{
|
|
2180
|
-
label: i18n_1._('Inline'),
|
|
2446
|
+
label: (0, i18n_1._)('Inline'),
|
|
2181
2447
|
value: 'inline'
|
|
2182
2448
|
}, {
|
|
2183
|
-
label: i18n_1._('Fixed'),
|
|
2449
|
+
label: (0, i18n_1._)('Fixed'),
|
|
2184
2450
|
value: 'fixed'
|
|
2185
2451
|
}, {
|
|
2186
|
-
label: i18n_1._('Hidden'),
|
|
2452
|
+
label: (0, i18n_1._)('Hidden'),
|
|
2187
2453
|
value: 'none'
|
|
2188
2454
|
}],
|
|
2189
2455
|
labelWidth: EDITOR_LABEL_WIDTH
|
|
2190
2456
|
}
|
|
2191
2457
|
}]]
|
|
2192
2458
|
}, {
|
|
2193
|
-
label: i18n_1._('Color and style'),
|
|
2459
|
+
label: (0, i18n_1._)('Color and style'),
|
|
2194
2460
|
layout: [[{
|
|
2195
2461
|
key: 'backgroundColor',
|
|
2196
2462
|
editor: 'editor.tableBackgroundColor',
|
|
@@ -2202,14 +2468,14 @@ var editorConfig = [{
|
|
|
2202
2468
|
}
|
|
2203
2469
|
}], [{
|
|
2204
2470
|
option: 'font',
|
|
2205
|
-
label: i18n_1._('Font'),
|
|
2471
|
+
label: (0, i18n_1._)('Font'),
|
|
2206
2472
|
editor: 'editor.select',
|
|
2207
2473
|
editorProps: {
|
|
2208
2474
|
values: [{
|
|
2209
|
-
label: i18n_1._('Proportional (Default)'),
|
|
2475
|
+
label: (0, i18n_1._)('Proportional (Default)'),
|
|
2210
2476
|
value: 'proportional'
|
|
2211
2477
|
}, {
|
|
2212
|
-
label: i18n_1._('Monospace'),
|
|
2478
|
+
label: (0, i18n_1._)('Monospace'),
|
|
2213
2479
|
value: 'monospace'
|
|
2214
2480
|
}],
|
|
2215
2481
|
labelPosition: 'top',
|
|
@@ -2217,48 +2483,48 @@ var editorConfig = [{
|
|
|
2217
2483
|
}
|
|
2218
2484
|
}], [{
|
|
2219
2485
|
option: 'fontSize',
|
|
2220
|
-
label: i18n_1._('Font size'),
|
|
2486
|
+
label: (0, i18n_1._)('Font size'),
|
|
2221
2487
|
editor: 'editor.select',
|
|
2222
2488
|
editorProps: {
|
|
2223
2489
|
values: [{
|
|
2224
|
-
label: i18n_1._('Extra Small (font 10px, row 24px)'),
|
|
2490
|
+
label: (0, i18n_1._)('Extra Small (font 10px, row 24px)'),
|
|
2225
2491
|
value: 'extraSmall'
|
|
2226
2492
|
}, {
|
|
2227
|
-
label: i18n_1._('Small (font 12px, row 24px)'),
|
|
2493
|
+
label: (0, i18n_1._)('Small (font 12px, row 24px)'),
|
|
2228
2494
|
value: 'small'
|
|
2229
2495
|
}, {
|
|
2230
|
-
label: i18n_1._('Default (font 14px, row 32px)'),
|
|
2496
|
+
label: (0, i18n_1._)('Default (font 14px, row 32px)'),
|
|
2231
2497
|
value: 'default'
|
|
2232
2498
|
}, {
|
|
2233
|
-
label: i18n_1._('Large (font 16px, row 36px)'),
|
|
2499
|
+
label: (0, i18n_1._)('Large (font 16px, row 36px)'),
|
|
2234
2500
|
value: 'large'
|
|
2235
2501
|
}],
|
|
2236
2502
|
labelPosition: 'top',
|
|
2237
2503
|
labelWidth: EDITOR_LABEL_WIDTH
|
|
2238
2504
|
}
|
|
2239
2505
|
}], [{
|
|
2240
|
-
label: i18n_1._('Column-specific formatting'),
|
|
2506
|
+
label: (0, i18n_1._)('Column-specific formatting'),
|
|
2241
2507
|
editor: 'editor.tableColumnFormatter',
|
|
2242
2508
|
editorProps: {
|
|
2243
2509
|
// Table column coloring does not adhere to same DSL structure as other dynamically colored options
|
|
2244
2510
|
// we use the FormatterEditor directly and not the DynamicColorEditor's provided DSL builders
|
|
2245
2511
|
columnColoringConfig: {
|
|
2246
2512
|
coloringTypes: [{
|
|
2247
|
-
label: i18n_1._('Text'),
|
|
2513
|
+
label: (0, i18n_1._)('Text'),
|
|
2248
2514
|
value: 'rowColors'
|
|
2249
2515
|
}, {
|
|
2250
|
-
label: i18n_1._('Background'),
|
|
2516
|
+
label: (0, i18n_1._)('Background'),
|
|
2251
2517
|
value: 'rowBackgroundColors'
|
|
2252
2518
|
}],
|
|
2253
2519
|
formatters: [{
|
|
2254
|
-
label: i18n_1._('Ranges'),
|
|
2520
|
+
label: (0, i18n_1._)('Ranges'),
|
|
2255
2521
|
value: 'rangeValue',
|
|
2256
2522
|
defaults: {
|
|
2257
2523
|
rowBackgroundColors: sequentialColorConfig,
|
|
2258
2524
|
rowColors: sequentialColorConfig
|
|
2259
2525
|
}
|
|
2260
2526
|
}, {
|
|
2261
|
-
label: i18n_1._('Matches'),
|
|
2527
|
+
label: (0, i18n_1._)('Matches'),
|
|
2262
2528
|
value: 'matchValue',
|
|
2263
2529
|
defaults: {
|
|
2264
2530
|
rowBackgroundColors: matchColorConfig,
|
|
@@ -2278,22 +2544,22 @@ var editorConfig = [{
|
|
|
2278
2544
|
},
|
|
2279
2545
|
flyoutConfig: {
|
|
2280
2546
|
number: [[Object.assign({}, unitPositionConfig), Object.assign({}, unitLabelConfig)], [{
|
|
2281
|
-
label: i18n_1._('Precision'),
|
|
2547
|
+
label: (0, i18n_1._)('Precision'),
|
|
2282
2548
|
option: 'precision',
|
|
2283
2549
|
editor: 'editor.select',
|
|
2284
2550
|
editorProps: {
|
|
2285
|
-
values: configUtils_1.generatePrecisionValues(20)
|
|
2551
|
+
values: (0, configUtils_1.generatePrecisionValues)(20)
|
|
2286
2552
|
}
|
|
2287
2553
|
}, {
|
|
2288
|
-
label: i18n_1._('Thousand separators'),
|
|
2554
|
+
label: (0, i18n_1._)('Thousand separators'),
|
|
2289
2555
|
option: 'thousandSeparated',
|
|
2290
2556
|
editor: 'editor.radioBar',
|
|
2291
2557
|
editorProps: {
|
|
2292
2558
|
values: [{
|
|
2293
|
-
label: i18n_1._('Off'),
|
|
2559
|
+
label: (0, i18n_1._)('Off'),
|
|
2294
2560
|
value: false
|
|
2295
2561
|
}, {
|
|
2296
|
-
label: i18n_1._('On'),
|
|
2562
|
+
label: (0, i18n_1._)('On'),
|
|
2297
2563
|
value: true
|
|
2298
2564
|
}]
|
|
2299
2565
|
}
|
|
@@ -2305,7 +2571,7 @@ var editorConfig = [{
|
|
|
2305
2571
|
},
|
|
2306
2572
|
value: function value(_ref) {
|
|
2307
2573
|
var context = _ref.context,
|
|
2308
|
-
|
|
2574
|
+
options = _ref.options;
|
|
2309
2575
|
return {
|
|
2310
2576
|
context: context,
|
|
2311
2577
|
columnFormat: options.columnFormat,
|
|
@@ -2319,16 +2585,19 @@ var editorConfig = [{
|
|
|
2319
2585
|
/**
|
|
2320
2586
|
* visualization configuration
|
|
2321
2587
|
*/
|
|
2588
|
+
|
|
2322
2589
|
var config = {
|
|
2323
2590
|
/**
|
|
2324
2591
|
* unique viz key
|
|
2325
2592
|
*/
|
|
2326
2593
|
key: 'splunk.table',
|
|
2594
|
+
|
|
2327
2595
|
/**
|
|
2328
2596
|
* viz name
|
|
2329
2597
|
*/
|
|
2330
|
-
name: i18n_1._('Table'),
|
|
2598
|
+
name: (0, i18n_1._)('Table'),
|
|
2331
2599
|
category: VizCategory_1.VizCategory.TABLE,
|
|
2600
|
+
|
|
2332
2601
|
/**
|
|
2333
2602
|
* viz icon
|
|
2334
2603
|
*/
|
|
@@ -2347,79 +2616,96 @@ var config = {
|
|
|
2347
2616
|
supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PAGE_AND_SORT, VizBehavior_1.VizBehavior.PLACEHOLDER],
|
|
2348
2617
|
themes: themes
|
|
2349
2618
|
};
|
|
2350
|
-
exports.default = configUtils_1.enhanceConfig(config);
|
|
2619
|
+
exports.default = (0, configUtils_1.enhanceConfig)(config);
|
|
2351
2620
|
|
|
2352
2621
|
/***/ }),
|
|
2353
2622
|
|
|
2354
|
-
/***/
|
|
2623
|
+
/***/ 481:
|
|
2355
2624
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2356
2625
|
|
|
2357
2626
|
"use strict";
|
|
2358
2627
|
|
|
2359
2628
|
|
|
2360
2629
|
var _slicedToArray = __webpack_require__(17);
|
|
2361
|
-
|
|
2362
|
-
var
|
|
2630
|
+
|
|
2631
|
+
var _taggedTemplateLiteral = __webpack_require__(59);
|
|
2632
|
+
|
|
2633
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
2634
|
+
|
|
2363
2635
|
var __rest = this && this.__rest || function (s, e) {
|
|
2364
2636
|
var t = {};
|
|
2637
|
+
|
|
2365
2638
|
for (var p in s) {
|
|
2366
2639
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
2367
2640
|
}
|
|
2641
|
+
|
|
2368
2642
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2369
2643
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
2370
2644
|
}
|
|
2371
2645
|
return t;
|
|
2372
2646
|
};
|
|
2647
|
+
|
|
2373
2648
|
Object.defineProperty(exports, "__esModule", {
|
|
2374
2649
|
value: true
|
|
2375
2650
|
});
|
|
2376
2651
|
exports.INITIAL_UNSET_COLUMN_WIDTH = exports.MINIMUM_COLUMN_SIZE = void 0;
|
|
2652
|
+
|
|
2377
2653
|
var React = __webpack_require__(1);
|
|
2654
|
+
|
|
2378
2655
|
var T = __webpack_require__(0);
|
|
2656
|
+
|
|
2379
2657
|
var lodash_1 = __webpack_require__(3);
|
|
2658
|
+
|
|
2380
2659
|
var styled_components_1 = __webpack_require__(4);
|
|
2660
|
+
|
|
2381
2661
|
var i18n_1 = __webpack_require__(2);
|
|
2382
|
-
|
|
2383
|
-
var
|
|
2384
|
-
|
|
2662
|
+
|
|
2663
|
+
var Table_1 = __webpack_require__(112);
|
|
2664
|
+
|
|
2665
|
+
var Paginator_1 = __webpack_require__(94);
|
|
2666
|
+
|
|
2667
|
+
var Message_1 = __webpack_require__(124);
|
|
2668
|
+
|
|
2385
2669
|
var colorUtils_1 = __webpack_require__(12);
|
|
2670
|
+
|
|
2386
2671
|
var style_1 = __webpack_require__(14);
|
|
2672
|
+
|
|
2387
2673
|
var pick_1 = __webpack_require__(23);
|
|
2674
|
+
|
|
2388
2675
|
var variables_1 = __webpack_require__(11);
|
|
2389
|
-
|
|
2390
|
-
var
|
|
2391
|
-
|
|
2392
|
-
var
|
|
2676
|
+
|
|
2677
|
+
var hooks_1 = __webpack_require__(482);
|
|
2678
|
+
|
|
2679
|
+
var consts_1 = __webpack_require__(137);
|
|
2680
|
+
|
|
2681
|
+
var cells_1 = __webpack_require__(483);
|
|
2682
|
+
|
|
2683
|
+
var getPagination_1 = __webpack_require__(35);
|
|
2684
|
+
|
|
2393
2685
|
var getSorting_1 = __webpack_require__(33);
|
|
2394
|
-
|
|
2395
|
-
// debounce was imported this way due to typing
|
|
2686
|
+
|
|
2687
|
+
var FixedSizeContainer_1 = __webpack_require__(13); // debounce was imported this way due to typing
|
|
2396
2688
|
// eslint-disable-next-line import/order
|
|
2397
|
-
|
|
2689
|
+
|
|
2690
|
+
|
|
2691
|
+
var debounce = __webpack_require__(488);
|
|
2692
|
+
|
|
2398
2693
|
exports.MINIMUM_COLUMN_SIZE = 30;
|
|
2399
2694
|
exports.INITIAL_UNSET_COLUMN_WIDTH = 90;
|
|
2400
|
-
var NonVisibleTableHead = styled_components_1.default(Table_1.default.Head)
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
})(["display:none;"]);
|
|
2404
|
-
var FixedTableHead = styled_components_1.default(Table_1.default.Head).withConfig({
|
|
2405
|
-
displayName: "PureTable__FixedTableHead",
|
|
2406
|
-
componentId: "tovzjg-1"
|
|
2407
|
-
})(["position:sticky;top:0;"]);
|
|
2408
|
-
var TableHeadCell = styled_components_1.default(Table_1.default.HeadCell).withConfig({
|
|
2409
|
-
displayName: "PureTable__TableHeadCell",
|
|
2410
|
-
componentId: "tovzjg-2"
|
|
2411
|
-
})(["div > span{word-break:inherit;word-wrap:inherit;white-space:", ";display:inline;}"], function (_ref) {
|
|
2695
|
+
var NonVisibleTableHead = (0, styled_components_1.default)(Table_1.default.Head)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n pointer-events: none;\n & [data-test='head-cell'] > div {\n height: 0;\n padding: 0;\n margin: 0;\n }\n"])));
|
|
2696
|
+
var FixedTableHead = (0, styled_components_1.default)(Table_1.default.Head)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: sticky;\n top: 0;\n"])));
|
|
2697
|
+
var TableHeadCell = (0, styled_components_1.default)(Table_1.default.HeadCell)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n div > span {\n word-break: inherit;\n word-wrap: inherit;\n white-space: ", ";\n display: inline;\n }\n"])), function (_ref) {
|
|
2412
2698
|
var textOverflowType = _ref.textOverflowType;
|
|
2413
2699
|
return textOverflowType === 'ellipsis' ? 'nowrap' : 'inherit';
|
|
2414
2700
|
});
|
|
2415
2701
|
var VizTableContainer = styled_components_1.default.div.withConfig({
|
|
2416
2702
|
displayName: "PureTable__VizTableContainer",
|
|
2417
|
-
componentId: "tovzjg-
|
|
2418
|
-
})(["box-sizing:border-box;padding:", ";background-color:", ";display:flex;flex-flow:column nowrap;overflow:hidden;td,* > td:hover{color:", ";}"], pick_1.default({
|
|
2703
|
+
componentId: "tovzjg-0"
|
|
2704
|
+
})(["box-sizing:border-box;padding:", ";background-color:", ";display:flex;flex-flow:column nowrap;overflow:hidden;td,* > td:hover{color:", ";}"], (0, pick_1.default)({
|
|
2419
2705
|
enterprise: variables_1.default.spacingHalf,
|
|
2420
2706
|
prisma: variables_1.default.spacingSmall
|
|
2421
2707
|
}), function (props) {
|
|
2422
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
2708
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
2423
2709
|
}, function (_ref2) {
|
|
2424
2710
|
var isCellClickable = _ref2.isCellClickable;
|
|
2425
2711
|
return isCellClickable ? variables_1.default.linkColor : variables_1.default.textColor;
|
|
@@ -2429,8 +2715,8 @@ var PAGINATOR_CONTAINER_HEIGHT = 38;
|
|
|
2429
2715
|
var PAGINATOR_SPACING = 5;
|
|
2430
2716
|
var SUITableContainer = styled_components_1.default.div.withConfig({
|
|
2431
2717
|
displayName: "PureTable__SUITableContainer",
|
|
2432
|
-
componentId: "tovzjg-
|
|
2433
|
-
})(["& *{font-family:", ";font-size:", ";line-height:", ";}box-sizing:border-box;flex-grow:1;overflow:hidden;", ";", ";", " ", " [data-test=\"main-table\"]{", " td{white-space:pre-
|
|
2718
|
+
componentId: "tovzjg-1"
|
|
2719
|
+
})(["& *{font-family:", ";font-size:", ";line-height:", ";}box-sizing:border-box;flex-grow:1;overflow:hidden;", ";", ";", " ", " [data-test=\"main-table\"]{", " td{white-space:pre-wrap;}}"], function (props) {
|
|
2434
2720
|
return props.font;
|
|
2435
2721
|
}, function (props) {
|
|
2436
2722
|
return props.fontSize;
|
|
@@ -2438,10 +2724,10 @@ var SUITableContainer = styled_components_1.default.div.withConfig({
|
|
|
2438
2724
|
return props.lineHeight;
|
|
2439
2725
|
}, function (_ref3) {
|
|
2440
2726
|
var width = _ref3.width,
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
var padding = pick_1.default({
|
|
2727
|
+
height = _ref3.height,
|
|
2728
|
+
isPaging = _ref3.isPaging,
|
|
2729
|
+
theme = _ref3.theme;
|
|
2730
|
+
var padding = (0, pick_1.default)({
|
|
2445
2731
|
enterprise: variables_1.default.spacingHalf({
|
|
2446
2732
|
theme: theme
|
|
2447
2733
|
}),
|
|
@@ -2452,7 +2738,7 @@ var SUITableContainer = styled_components_1.default.div.withConfig({
|
|
|
2452
2738
|
theme: theme
|
|
2453
2739
|
});
|
|
2454
2740
|
var paddingOffset = parseInt(padding, 10) * 2;
|
|
2455
|
-
return style_1.toDimension({
|
|
2741
|
+
return (0, style_1.toDimension)({
|
|
2456
2742
|
width: width - paddingOffset,
|
|
2457
2743
|
height: isPaging ? height - PAGINATOR_CONTAINER_HEIGHT - PAGINATOR_SPACING - paddingOffset : height - paddingOffset
|
|
2458
2744
|
});
|
|
@@ -2461,82 +2747,92 @@ var SUITableContainer = styled_components_1.default.div.withConfig({
|
|
|
2461
2747
|
return isPaging && "\n margin-bottom: ".concat(PAGINATOR_SPACING, "px;\n ");
|
|
2462
2748
|
}, function (_ref5) {
|
|
2463
2749
|
var headerStyle = _ref5.headerStyle;
|
|
2464
|
-
return headerStyle && headerStyle.backgroundColor && styled_components_1.css(
|
|
2750
|
+
return headerStyle && headerStyle.backgroundColor && (0, styled_components_1.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n & [data-test='head-cell'] {\n background-color: ", ";\n }\n "])), headerStyle.backgroundColor);
|
|
2465
2751
|
}, function (_ref6) {
|
|
2466
2752
|
var headerStyle = _ref6.headerStyle;
|
|
2467
|
-
return headerStyle && headerStyle.color && styled_components_1.css(
|
|
2753
|
+
return headerStyle && headerStyle.color && (0, styled_components_1.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n & [data-test='head-cell'] > div > span {\n color: ", ";\n }\n "])), headerStyle.color);
|
|
2468
2754
|
}, function (_ref7) {
|
|
2469
2755
|
var isFullyFixed = _ref7.isFullyFixed;
|
|
2470
|
-
return isFullyFixed && styled_components_1.css(
|
|
2756
|
+
return isFullyFixed && (0, styled_components_1.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: fit-content;\n min-width: unset;\n "])));
|
|
2471
2757
|
});
|
|
2472
2758
|
SUITableContainer.displayName = 'SUITableContainer';
|
|
2473
2759
|
var PaginatorContainer = styled_components_1.default.div.withConfig({
|
|
2474
2760
|
displayName: "PureTable__PaginatorContainer",
|
|
2475
|
-
componentId: "tovzjg-
|
|
2761
|
+
componentId: "tovzjg-2"
|
|
2476
2762
|
})(["position:relative;text-align:right;height:", "px;"], PAGINATOR_CONTAINER_HEIGHT);
|
|
2477
|
-
PaginatorContainer.displayName = 'PaginatorContainer';
|
|
2478
|
-
|
|
2763
|
+
PaginatorContainer.displayName = 'PaginatorContainer'; // allow for early return in case of empty tableBody while still following hook rules
|
|
2764
|
+
|
|
2479
2765
|
var withEmptyTableMessage = function withEmptyTableMessage(Viz) {
|
|
2480
2766
|
// TODO(fkurniawan): add omit type to differentiate WrapperProps from PureTableProps
|
|
2481
2767
|
var Wrapper = function Wrapper(props) {
|
|
2482
2768
|
var headers = props.headers,
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
columnFormat: columnFormat,
|
|
2505
|
-
paginationOffset: paginatorParams === null || paginatorParams === void 0 ? void 0 : paginatorParams.current,
|
|
2506
|
-
count: count
|
|
2769
|
+
table = props.table,
|
|
2770
|
+
headerVisibility = props.headerVisibility,
|
|
2771
|
+
showRowNumbers = props.showRowNumbers,
|
|
2772
|
+
showInternalFields = props.showInternalFields,
|
|
2773
|
+
tableFormat = props.tableFormat,
|
|
2774
|
+
columnFormat = props.columnFormat,
|
|
2775
|
+
paginatorParams = props.paginatorParams,
|
|
2776
|
+
count = props.count;
|
|
2777
|
+
|
|
2778
|
+
var _ref8 = (0, hooks_1.useTable)({
|
|
2779
|
+
headers: headers,
|
|
2780
|
+
table: table,
|
|
2781
|
+
headerVisibility: headerVisibility,
|
|
2782
|
+
showRowNumbers: showRowNumbers,
|
|
2783
|
+
showInternalFields: showInternalFields,
|
|
2784
|
+
tableFormat: Object.assign(Object.assign(Object.assign(Object.assign({}, tableFormat), (tableFormat === null || tableFormat === void 0 ? void 0 : tableFormat.align) && {
|
|
2785
|
+
align: (0, lodash_1.cloneDeep)(tableFormat.align)
|
|
2786
|
+
}), (tableFormat === null || tableFormat === void 0 ? void 0 : tableFormat.cellTypes) && {
|
|
2787
|
+
cellTypes: (0, lodash_1.cloneDeep)(tableFormat.cellTypes)
|
|
2788
|
+
}), (tableFormat === null || tableFormat === void 0 ? void 0 : tableFormat.data) && {
|
|
2789
|
+
data: (0, lodash_1.cloneDeep)(tableFormat.data)
|
|
2507
2790
|
}),
|
|
2508
|
-
|
|
2509
|
-
|
|
2791
|
+
columnFormat: columnFormat,
|
|
2792
|
+
paginationOffset: paginatorParams === null || paginatorParams === void 0 ? void 0 : paginatorParams.current,
|
|
2793
|
+
count: count
|
|
2794
|
+
}),
|
|
2795
|
+
tableHeader = _ref8.tableHeader,
|
|
2796
|
+
tableBody = _ref8.tableBody;
|
|
2797
|
+
|
|
2510
2798
|
if (tableBody.rows.length === 0) {
|
|
2511
2799
|
return React.createElement(Message_1.default, {
|
|
2512
2800
|
type: "warning"
|
|
2513
|
-
}, i18n_1._('No data!'));
|
|
2801
|
+
}, (0, i18n_1._)('No data!'));
|
|
2514
2802
|
}
|
|
2803
|
+
|
|
2515
2804
|
return React.createElement(Viz, Object.assign({}, props, {
|
|
2516
2805
|
tableHeader: tableHeader,
|
|
2517
2806
|
tableBody: tableBody
|
|
2518
2807
|
}));
|
|
2519
2808
|
};
|
|
2809
|
+
|
|
2520
2810
|
Wrapper.displayName = 'PureTableWrapper';
|
|
2521
2811
|
return Wrapper;
|
|
2522
2812
|
};
|
|
2813
|
+
|
|
2523
2814
|
var useTableHead = function useTableHead(visibility) {
|
|
2524
2815
|
if (visibility === 'none') {
|
|
2525
2816
|
return NonVisibleTableHead;
|
|
2526
2817
|
}
|
|
2818
|
+
|
|
2527
2819
|
if (visibility === 'fixed') {
|
|
2528
2820
|
return FixedTableHead;
|
|
2529
2821
|
}
|
|
2822
|
+
|
|
2530
2823
|
return Table_1.default.Head;
|
|
2531
2824
|
};
|
|
2825
|
+
|
|
2532
2826
|
var HeadCell = function HeadCell(_a) {
|
|
2533
2827
|
var value = _a.value,
|
|
2534
|
-
|
|
2828
|
+
props = __rest(_a, ["value"]);
|
|
2829
|
+
|
|
2535
2830
|
var cellRef = React.useRef(null);
|
|
2536
2831
|
return React.createElement(TableHeadCell, Object.assign({
|
|
2537
2832
|
elementRef: cellRef
|
|
2538
2833
|
}, props), value);
|
|
2539
2834
|
};
|
|
2835
|
+
|
|
2540
2836
|
var fontMap = {
|
|
2541
2837
|
proportional: 'Splunk Platform Sans',
|
|
2542
2838
|
monospace: 'Splunk Platform Mono'
|
|
@@ -2556,40 +2852,44 @@ var rowHeightMap = {
|
|
|
2556
2852
|
var tableInnerStyle = {
|
|
2557
2853
|
height: '100%'
|
|
2558
2854
|
};
|
|
2855
|
+
|
|
2559
2856
|
var PureTable = function PureTable(props) {
|
|
2560
2857
|
var count = props.count,
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2858
|
+
width = props.width,
|
|
2859
|
+
height = props.height,
|
|
2860
|
+
backgroundColor = props.backgroundColor,
|
|
2861
|
+
tableHeader = props.tableHeader,
|
|
2862
|
+
tableBody = props.tableBody,
|
|
2863
|
+
showRowNumbers = props.showRowNumbers,
|
|
2864
|
+
_props$sortParams = props.sortParams,
|
|
2865
|
+
currentSortKey = _props$sortParams.currentSortKey,
|
|
2866
|
+
currentSortDir = _props$sortParams.currentSortDir,
|
|
2867
|
+
onSort = _props$sortParams.onSort,
|
|
2868
|
+
_a = props.paginatorParams,
|
|
2869
|
+
isPaging = _a.isPaging,
|
|
2870
|
+
paginatorOnChange = _a.onChange,
|
|
2871
|
+
paginatorProps = __rest(_a, ["isPaging", "onChange"]),
|
|
2872
|
+
onCellClick = props.onCellClick,
|
|
2873
|
+
onColumnFormatChange = props.onColumnFormatChange,
|
|
2874
|
+
columnFormat = props.columnFormat,
|
|
2875
|
+
mode = props.mode,
|
|
2876
|
+
headerVisibility = props.headerVisibility,
|
|
2877
|
+
font = props.font,
|
|
2878
|
+
fontSize = props.fontSize;
|
|
2879
|
+
|
|
2582
2880
|
var _React$useState = React.useState(columnFormat),
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2881
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2882
|
+
columns = _React$useState2[0],
|
|
2883
|
+
setColumns = _React$useState2[1];
|
|
2884
|
+
|
|
2586
2885
|
var containerRef = React.useRef(null);
|
|
2587
|
-
var containerRefInner = React.useRef(null);
|
|
2588
|
-
|
|
2886
|
+
var containerRefInner = React.useRef(null); // this state avoids unncessary column sorting when column resize ends
|
|
2887
|
+
|
|
2589
2888
|
var _React$useState3 = React.useState(false),
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2889
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
2890
|
+
isResizing = _React$useState4[0],
|
|
2891
|
+
setResizing = _React$useState4[1];
|
|
2892
|
+
|
|
2593
2893
|
var firstRenderCount = React.useRef(count);
|
|
2594
2894
|
React.useEffect(function () {
|
|
2595
2895
|
if (firstRenderCount.current !== count) {
|
|
@@ -2612,6 +2912,7 @@ var PureTable = function PureTable(props) {
|
|
|
2612
2912
|
var TableHead = useTableHead(headerVisibility);
|
|
2613
2913
|
var tableCellClickHandler = React.useCallback(function (e) {
|
|
2614
2914
|
setResizing(false); // The resizing state will be set back to false on any cell click
|
|
2915
|
+
|
|
2615
2916
|
return onCellClick ? drilldownHandler(e) : lodash_1.noop;
|
|
2616
2917
|
}, [onCellClick, showRowNumbers, tableHeader, tableBody]);
|
|
2617
2918
|
var debouncedDrilldown = debounce(function (e, payload) {
|
|
@@ -2624,11 +2925,13 @@ var PureTable = function PureTable(props) {
|
|
|
2624
2925
|
}
|
|
2625
2926
|
}
|
|
2626
2927
|
}, 200);
|
|
2928
|
+
|
|
2627
2929
|
var drilldownHandler = function drilldownHandler(e) {
|
|
2628
2930
|
var element = e.target;
|
|
2629
2931
|
var row = element.getAttribute('data-row-index');
|
|
2630
2932
|
var col = element.getAttribute('data-col-index');
|
|
2631
2933
|
var arrayIndex = element.getAttribute('data-array-index') || -1;
|
|
2934
|
+
|
|
2632
2935
|
if (row && col) {
|
|
2633
2936
|
var cellRefIndex = +col;
|
|
2634
2937
|
var cellIndex = cellRefIndex;
|
|
@@ -2636,16 +2939,18 @@ var PureTable = function PureTable(props) {
|
|
|
2636
2939
|
var fieldValue = tableHeader.cells[cellRefIndex].value;
|
|
2637
2940
|
var cellValue = tableBody.rows[rowIndex].cells[cellRefIndex].value;
|
|
2638
2941
|
var cellRawValue = tableBody.rows[rowIndex].cells[cellRefIndex].value;
|
|
2639
|
-
var value = arrayIndex === -1 ? cellValue : cellRawValue[+arrayIndex];
|
|
2640
|
-
// Wish we did not have these if statements for
|
|
2942
|
+
var value = arrayIndex === -1 ? cellValue : cellRawValue[+arrayIndex]; // Wish we did not have these if statements for
|
|
2641
2943
|
// showRowNumbers
|
|
2944
|
+
|
|
2642
2945
|
if (showRowNumbers === true) {
|
|
2643
2946
|
if (cellIndex === 0) {
|
|
2644
2947
|
// no click event for row numbers
|
|
2645
2948
|
return;
|
|
2646
2949
|
}
|
|
2950
|
+
|
|
2647
2951
|
cellIndex -= 1;
|
|
2648
2952
|
}
|
|
2953
|
+
|
|
2649
2954
|
var payload = {
|
|
2650
2955
|
cellIndex: cellIndex,
|
|
2651
2956
|
rowIndex: rowIndex,
|
|
@@ -2662,23 +2967,28 @@ var PureTable = function PureTable(props) {
|
|
|
2662
2967
|
debouncedDrilldown(e.nativeEvent, payload);
|
|
2663
2968
|
}
|
|
2664
2969
|
};
|
|
2970
|
+
|
|
2665
2971
|
var debouncedOnColumnFormatChange = React.useMemo(function () {
|
|
2666
2972
|
return debounce(function (newFormat) {
|
|
2667
2973
|
onColumnFormatChange(newFormat);
|
|
2668
2974
|
}, 300);
|
|
2669
2975
|
}, [onColumnFormatChange]);
|
|
2976
|
+
|
|
2670
2977
|
var handleEventClick = function handleEventClick(e) {
|
|
2671
2978
|
// Hack to target the resize handlers, since the only button within a HeadCell is the resize handlers
|
|
2672
2979
|
if (e.target.tagName.toLowerCase() === 'button') {
|
|
2673
2980
|
e.stopPropagation();
|
|
2674
2981
|
}
|
|
2675
2982
|
};
|
|
2983
|
+
|
|
2676
2984
|
var handleKeyDown = function handleKeyDown(e) {
|
|
2677
2985
|
if (e.keyCode !== 13) {
|
|
2678
2986
|
return;
|
|
2679
2987
|
}
|
|
2988
|
+
|
|
2680
2989
|
drilldownHandler(e);
|
|
2681
2990
|
};
|
|
2991
|
+
|
|
2682
2992
|
var handleResizeColumn = function handleResizeColumn(_event, payload) {
|
|
2683
2993
|
setResizing(true);
|
|
2684
2994
|
var updatedCF = columns;
|
|
@@ -2686,12 +2996,13 @@ var PureTable = function PureTable(props) {
|
|
|
2686
2996
|
updatedCF[field] = Object.assign(Object.assign({}, updatedCF[field]), {
|
|
2687
2997
|
width: Math.max(payload.width, exports.MINIMUM_COLUMN_SIZE)
|
|
2688
2998
|
});
|
|
2689
|
-
setColumns(Object.assign({}, updatedCF));
|
|
2690
|
-
|
|
2999
|
+
setColumns(Object.assign({}, updatedCF)); // Updates column json in edit mode
|
|
3000
|
+
|
|
2691
3001
|
if (mode === 'edit') {
|
|
2692
3002
|
debouncedOnColumnFormatChange(updatedCF);
|
|
2693
3003
|
}
|
|
2694
3004
|
};
|
|
3005
|
+
|
|
2695
3006
|
var fontMapped = fontMap[font] || fontMap.proportional;
|
|
2696
3007
|
var fontSizeMapped = fontSizeMap[fontSize] || fontSizeMap.default;
|
|
2697
3008
|
var rowHeightMapped = rowHeightMap[fontSize] || rowHeightMap.default;
|
|
@@ -2701,21 +3012,23 @@ var PureTable = function PureTable(props) {
|
|
|
2701
3012
|
cursor: onCellClick ? 'pointer' : 'unset'
|
|
2702
3013
|
};
|
|
2703
3014
|
}, [onCellClick]);
|
|
2704
|
-
var
|
|
2705
|
-
return c.showCell;
|
|
2706
|
-
}).length;
|
|
2707
|
-
var numberOfFixedHeaders = tableHeader.cells.filter(function (c) {
|
|
3015
|
+
var visibleHeaderCells = tableHeader.cells.filter(function (c) {
|
|
2708
3016
|
return c.showCell;
|
|
2709
|
-
})
|
|
2710
|
-
|
|
3017
|
+
});
|
|
3018
|
+
var numberOfFixedHeaders = visibleHeaderCells.filter(function (_ref9) {
|
|
3019
|
+
var value = _ref9.value;
|
|
3020
|
+
|
|
2711
3021
|
var _a, _b;
|
|
3022
|
+
|
|
2712
3023
|
return ((_a = columns[value]) === null || _a === void 0 ? void 0 : _a.width) && ((_b = columns[value]) === null || _b === void 0 ? void 0 : _b.width) !== 'auto';
|
|
2713
3024
|
}).length;
|
|
2714
|
-
var isFullyFixed =
|
|
3025
|
+
var isFullyFixed = visibleHeaderCells.length === numberOfFixedHeaders;
|
|
3026
|
+
var isHeaderHidden = headerVisibility === 'none';
|
|
2715
3027
|
return React.createElement(VizTableContainer, {
|
|
2716
3028
|
isCellClickable: Boolean(onCellClick),
|
|
2717
3029
|
backgroundColor: backgroundColor,
|
|
2718
|
-
ref: containerRef
|
|
3030
|
+
ref: containerRef,
|
|
3031
|
+
"data-test": "table-container"
|
|
2719
3032
|
}, React.createElement(SUITableContainer, {
|
|
2720
3033
|
ref: containerRefInner,
|
|
2721
3034
|
width: width,
|
|
@@ -2728,21 +3041,21 @@ var PureTable = function PureTable(props) {
|
|
|
2728
3041
|
isFullyFixed: isFullyFixed
|
|
2729
3042
|
}, React.createElement(Table_1.default, {
|
|
2730
3043
|
resizableFillLayout: true,
|
|
2731
|
-
headType:
|
|
3044
|
+
headType: isHeaderHidden ? undefined : 'inline',
|
|
2732
3045
|
innerStyle: tableInnerStyle,
|
|
2733
3046
|
outerStyle: tableOuterStyle,
|
|
2734
3047
|
onClick: tableCellClickHandler,
|
|
2735
3048
|
onKeyDown: onCellClick ? handleKeyDown : lodash_1.noop,
|
|
2736
3049
|
onRequestResizeColumn: handleResizeColumn
|
|
2737
|
-
}, React.createElement(TableHead, null,
|
|
2738
|
-
return c.showCell;
|
|
2739
|
-
}).map(function (_a) {
|
|
3050
|
+
}, React.createElement(TableHead, null, visibleHeaderCells.map(function (_a) {
|
|
2740
3051
|
var _b, _c;
|
|
3052
|
+
|
|
2741
3053
|
var key = _a.key,
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
3054
|
+
value = _a.value,
|
|
3055
|
+
sortKey = _a.sortKey,
|
|
3056
|
+
style = _a.style,
|
|
3057
|
+
rest = __rest(_a, ["key", "value", "sortKey", "style"]);
|
|
3058
|
+
|
|
2746
3059
|
return React.createElement(HeadCell, Object.assign({
|
|
2747
3060
|
key: key,
|
|
2748
3061
|
columnId: value,
|
|
@@ -2750,7 +3063,8 @@ var PureTable = function PureTable(props) {
|
|
|
2750
3063
|
width: (_c = (_b = columns[value]) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : exports.INITIAL_UNSET_COLUMN_WIDTH,
|
|
2751
3064
|
onMouseDown: handleEventClick,
|
|
2752
3065
|
value: value,
|
|
2753
|
-
onSort: isResizing || showRowNumbers && value === '#' ? null : onSort,
|
|
3066
|
+
onSort: isResizing || showRowNumbers && value === '#' || isHeaderHidden ? null : onSort,
|
|
3067
|
+
resizable: !isHeaderHidden,
|
|
2754
3068
|
style: showRowNumbers && value === '#' ? Object.assign(Object.assign({}, style), {
|
|
2755
3069
|
cursor: 'auto'
|
|
2756
3070
|
}) : style,
|
|
@@ -2765,6 +3079,7 @@ var PureTable = function PureTable(props) {
|
|
|
2765
3079
|
return c.showCell;
|
|
2766
3080
|
}).map(function (cell) {
|
|
2767
3081
|
var _a, _b;
|
|
3082
|
+
|
|
2768
3083
|
return React.createElement(cells_1.SwitchTableCell, {
|
|
2769
3084
|
key: cell.key,
|
|
2770
3085
|
type: cell.cellType
|
|
@@ -2784,6 +3099,7 @@ var PureTable = function PureTable(props) {
|
|
|
2784
3099
|
onChange: paginatorOnChange
|
|
2785
3100
|
}, paginatorProps))) : null);
|
|
2786
3101
|
};
|
|
3102
|
+
|
|
2787
3103
|
var cellDataType = T.oneOfType([T.string, T.number, T.arrayOf(T.oneOfType([T.string, T.number]))]);
|
|
2788
3104
|
PureTable.propTypes = {
|
|
2789
3105
|
backgroundColor: T.string,
|
|
@@ -2849,28 +3165,35 @@ PureTable.defaultProps = {
|
|
|
2849
3165
|
fontSize: fontSizeMap.default
|
|
2850
3166
|
};
|
|
2851
3167
|
PureTable.displayName = 'VizTable';
|
|
2852
|
-
exports.default = withEmptyTableMessage(FixedSizeContainer_1.default(PureTable));
|
|
3168
|
+
exports.default = withEmptyTableMessage((0, FixedSizeContainer_1.default)(PureTable));
|
|
2853
3169
|
|
|
2854
3170
|
/***/ }),
|
|
2855
3171
|
|
|
2856
|
-
/***/
|
|
3172
|
+
/***/ 482:
|
|
2857
3173
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2858
3174
|
|
|
2859
3175
|
"use strict";
|
|
2860
3176
|
|
|
2861
3177
|
|
|
2862
3178
|
var _toConsumableArray = __webpack_require__(8);
|
|
2863
|
-
|
|
3179
|
+
|
|
3180
|
+
var _typeof = __webpack_require__(82);
|
|
3181
|
+
|
|
2864
3182
|
Object.defineProperty(exports, "__esModule", {
|
|
2865
3183
|
value: true
|
|
2866
3184
|
});
|
|
2867
3185
|
exports.useTable = exports.getTextOverflowType = exports.getOverflowStyles = void 0;
|
|
3186
|
+
|
|
2868
3187
|
var lodash_1 = __webpack_require__(3);
|
|
3188
|
+
|
|
2869
3189
|
var colorUtils_1 = __webpack_require__(12);
|
|
2870
|
-
|
|
3190
|
+
|
|
3191
|
+
var consts_1 = __webpack_require__(137);
|
|
3192
|
+
|
|
2871
3193
|
var isArray = function isArray(v) {
|
|
2872
3194
|
return Array.isArray(v);
|
|
2873
3195
|
};
|
|
3196
|
+
|
|
2874
3197
|
var textOverflowStyles = {
|
|
2875
3198
|
anywhere: {
|
|
2876
3199
|
wordBreak: 'break-all'
|
|
@@ -2887,20 +3210,26 @@ var textOverflowStyles = {
|
|
|
2887
3210
|
}
|
|
2888
3211
|
};
|
|
2889
3212
|
var empty = {};
|
|
3213
|
+
|
|
2890
3214
|
var getOverflowStyles = function getOverflowStyles(_ref) {
|
|
2891
3215
|
var textOverflow = _ref.textOverflow;
|
|
2892
3216
|
return textOverflowStyles[textOverflow] || empty;
|
|
2893
3217
|
};
|
|
3218
|
+
|
|
2894
3219
|
exports.getOverflowStyles = getOverflowStyles;
|
|
3220
|
+
|
|
2895
3221
|
var generateKey = function generateKey() {
|
|
2896
3222
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
2897
3223
|
var i = arguments.length > 1 ? arguments[1] : undefined;
|
|
2898
3224
|
return "".concat(i, "-").concat(value);
|
|
2899
3225
|
};
|
|
3226
|
+
|
|
2900
3227
|
var getTextOverflowType = function getTextOverflowType(columnFormat, currentColumn) {
|
|
2901
|
-
return lodash_1.get(columnFormat, ["".concat(currentColumn), 'textOverflow']);
|
|
3228
|
+
return (0, lodash_1.get)(columnFormat, ["".concat(currentColumn), 'textOverflow']);
|
|
2902
3229
|
};
|
|
3230
|
+
|
|
2903
3231
|
exports.getTextOverflowType = getTextOverflowType;
|
|
3232
|
+
|
|
2904
3233
|
var generateHeader = function generateHeader(value, i, columnFormat, showInternalFields) {
|
|
2905
3234
|
var ret = {
|
|
2906
3235
|
key: generateKey(value, i),
|
|
@@ -2908,11 +3237,13 @@ var generateHeader = function generateHeader(value, i, columnFormat, showInterna
|
|
|
2908
3237
|
sortKey: value,
|
|
2909
3238
|
showCell: true
|
|
2910
3239
|
};
|
|
3240
|
+
|
|
2911
3241
|
if (!showInternalFields && value.charAt(0) === '_' && value !== '_time') {
|
|
2912
3242
|
ret.showCell = false;
|
|
2913
3243
|
}
|
|
2914
|
-
|
|
2915
|
-
var
|
|
3244
|
+
|
|
3245
|
+
var textOverflowType = (0, exports.getTextOverflowType)(columnFormat, value);
|
|
3246
|
+
var textOverflowStyle = (0, exports.getOverflowStyles)({
|
|
2916
3247
|
textOverflow: textOverflowType
|
|
2917
3248
|
});
|
|
2918
3249
|
ret.truncate = true;
|
|
@@ -2920,168 +3251,213 @@ var generateHeader = function generateHeader(value, i, columnFormat, showInterna
|
|
|
2920
3251
|
ret.style = textOverflowStyle;
|
|
2921
3252
|
return ret;
|
|
2922
3253
|
};
|
|
3254
|
+
|
|
2923
3255
|
var getColumnFormatAlign = function getColumnFormatAlign(columnFormat, currentColumn, currentRow) {
|
|
2924
|
-
var alignOption = lodash_1.get(columnFormat, [currentColumn.value, 'align']);
|
|
3256
|
+
var alignOption = (0, lodash_1.get)(columnFormat, [currentColumn.value, 'align']);
|
|
2925
3257
|
var align;
|
|
2926
|
-
|
|
3258
|
+
|
|
3259
|
+
if (isArray(alignOption) && (0, lodash_1.includes)(consts_1.validAlignments, alignOption[currentRow])) {
|
|
2927
3260
|
align = alignOption[currentRow];
|
|
2928
3261
|
} else if (typeof alignOption !== 'undefined') {
|
|
2929
3262
|
console.warn("columnFormat.".concat(currentColumn.value, ".align should be an array containing (").concat(consts_1.validAlignments.join(' | '), "). ").concat(JSON.stringify(alignOption), " provided"));
|
|
2930
3263
|
}
|
|
3264
|
+
|
|
2931
3265
|
return align;
|
|
2932
3266
|
};
|
|
3267
|
+
|
|
2933
3268
|
var getColumnFormatCellType = function getColumnFormatCellType(columnFormat, currentColumn, currentRow) {
|
|
2934
|
-
var cellTypes = lodash_1.get(columnFormat, [currentColumn.value, 'cellTypes']);
|
|
3269
|
+
var cellTypes = (0, lodash_1.get)(columnFormat, [currentColumn.value, 'cellTypes']);
|
|
2935
3270
|
var cellType;
|
|
2936
|
-
|
|
3271
|
+
|
|
3272
|
+
if (isArray(cellTypes) && (0, lodash_1.includes)(consts_1.validCellRenderers, cellTypes[currentRow])) {
|
|
2937
3273
|
cellType = cellTypes[currentRow];
|
|
2938
3274
|
} else if (typeof cellTypes !== 'undefined') {
|
|
2939
3275
|
console.warn("columnFormat.".concat(currentColumn.value, ".cellType should be an array containing (").concat(consts_1.validCellRenderers.join(' | '), "). ").concat(JSON.stringify(cellTypes), " provided"));
|
|
2940
3276
|
}
|
|
3277
|
+
|
|
2941
3278
|
return cellType;
|
|
2942
3279
|
};
|
|
3280
|
+
|
|
2943
3281
|
var getColumnFormatSparklineType = function getColumnFormatSparklineType(columnFormat, currentColumn, currentRow) {
|
|
2944
|
-
var types = lodash_1.get(columnFormat, [currentColumn.value, 'sparklineTypes']);
|
|
3282
|
+
var types = (0, lodash_1.get)(columnFormat, [currentColumn.value, 'sparklineTypes']);
|
|
2945
3283
|
var sparklineType;
|
|
2946
|
-
|
|
3284
|
+
|
|
3285
|
+
if (isArray(types) && (0, lodash_1.includes)(consts_1.validSparklineTypes, types[currentRow])) {
|
|
2947
3286
|
sparklineType = types[currentRow];
|
|
2948
3287
|
} else if (typeof types !== 'undefined') {
|
|
2949
3288
|
console.warn("columnFormat.".concat(currentColumn.value, ".sparklineTypes should be one of (").concat(consts_1.validSparklineTypes.join(' | '), "). ").concat(JSON.stringify(types), " provided"));
|
|
2950
3289
|
}
|
|
3290
|
+
|
|
2951
3291
|
return sparklineType;
|
|
2952
3292
|
};
|
|
3293
|
+
|
|
2953
3294
|
var getColumnFormatData = function getColumnFormatData(columnFormat, currentColumn, currentRow) {
|
|
2954
|
-
var data = lodash_1.get(columnFormat, [currentColumn.value, 'data']);
|
|
3295
|
+
var data = (0, lodash_1.get)(columnFormat, [currentColumn.value, 'data']);
|
|
2955
3296
|
var datum;
|
|
3297
|
+
|
|
2956
3298
|
if (isArray(data)) {
|
|
2957
3299
|
datum = data[currentRow];
|
|
2958
3300
|
} else if (typeof data !== 'undefined') {
|
|
2959
3301
|
console.warn("columnFormat.".concat(currentColumn.value, ".data should be an array containing formatted data. ").concat(_typeof(data), " provided"));
|
|
2960
3302
|
}
|
|
3303
|
+
|
|
2961
3304
|
return datum;
|
|
2962
3305
|
};
|
|
3306
|
+
|
|
2963
3307
|
var getColumnFormatColor = function getColumnFormatColor(columnFormat, currentColumn, currentRow, field) {
|
|
2964
|
-
var colors = lodash_1.get(columnFormat, [currentColumn.value, field]);
|
|
3308
|
+
var colors = (0, lodash_1.get)(columnFormat, [currentColumn.value, field]);
|
|
2965
3309
|
var color;
|
|
2966
|
-
|
|
3310
|
+
|
|
3311
|
+
if (isArray(colors) && (0, colorUtils_1.isColor)(colors[currentRow])) {
|
|
2967
3312
|
color = colors[currentRow];
|
|
2968
3313
|
} else if (typeof colors !== 'undefined') {
|
|
2969
3314
|
console.warn("columnFormat.".concat(currentColumn.value, ".").concat(field, " should be an array containing valid colors. ").concat(JSON.stringify(colors), " provided"));
|
|
2970
3315
|
}
|
|
3316
|
+
|
|
2971
3317
|
return color;
|
|
2972
3318
|
};
|
|
3319
|
+
|
|
2973
3320
|
var getColumnFormatRowColor = function getColumnFormatRowColor(columnFormat, currentColumn, currentRow) {
|
|
2974
3321
|
return getColumnFormatColor(columnFormat, currentColumn, currentRow, 'rowColors');
|
|
2975
3322
|
};
|
|
3323
|
+
|
|
2976
3324
|
var getColumnFormatRowBgColor = function getColumnFormatRowBgColor(columnFormat, currentColumn, currentRow) {
|
|
2977
3325
|
return getColumnFormatColor(columnFormat, currentColumn, currentRow, 'rowBackgroundColors');
|
|
2978
3326
|
};
|
|
3327
|
+
|
|
2979
3328
|
var getColumnFormatSparklineColor = function getColumnFormatSparklineColor(columnFormat, currentColumn, currentRow) {
|
|
2980
3329
|
return getColumnFormatColor(columnFormat, currentColumn, currentRow, 'sparklineColors');
|
|
2981
3330
|
};
|
|
3331
|
+
|
|
2982
3332
|
var getColumnFormatSparklineAreaColor = function getColumnFormatSparklineAreaColor(columnFormat, currentColumn, currentRow) {
|
|
2983
3333
|
return getColumnFormatColor(columnFormat, currentColumn, currentRow, 'sparklineAreaColors');
|
|
2984
3334
|
};
|
|
3335
|
+
|
|
2985
3336
|
var getTableFormatAlign = function getTableFormatAlign(tableFormat, currentColumn, currentRow) {
|
|
2986
|
-
var alignOption = lodash_1.get(tableFormat, 'align');
|
|
3337
|
+
var alignOption = (0, lodash_1.get)(tableFormat, 'align');
|
|
2987
3338
|
var align;
|
|
2988
|
-
|
|
3339
|
+
|
|
3340
|
+
if (isArray(alignOption) && isArray(alignOption[currentColumn]) && (0, lodash_1.includes)(consts_1.validAlignments, alignOption[currentColumn][currentRow])) {
|
|
2989
3341
|
align = alignOption[currentColumn][currentRow];
|
|
2990
3342
|
} else if (typeof alignOption !== 'undefined') {
|
|
2991
3343
|
console.warn("tableFormat.align should be a 2 dimensional array containing (".concat(consts_1.validAlignments.join(' | '), "). ").concat(JSON.stringify(alignOption), " provided"));
|
|
2992
3344
|
}
|
|
3345
|
+
|
|
2993
3346
|
return align;
|
|
2994
3347
|
};
|
|
3348
|
+
|
|
2995
3349
|
var getTableFormatCellType = function getTableFormatCellType(tableFormat, currentColumn, currentRow) {
|
|
2996
|
-
var cellTypes = lodash_1.get(tableFormat, 'cellTypes');
|
|
3350
|
+
var cellTypes = (0, lodash_1.get)(tableFormat, 'cellTypes');
|
|
2997
3351
|
var cellType;
|
|
2998
|
-
|
|
3352
|
+
|
|
3353
|
+
if (isArray(cellTypes) && isArray(cellTypes[currentColumn]) && (0, lodash_1.includes)(consts_1.validCellRenderers, cellTypes[currentColumn][currentRow])) {
|
|
2999
3354
|
cellType = cellTypes[currentColumn][currentRow];
|
|
3000
3355
|
} else if (typeof cellTypes !== 'undefined') {
|
|
3001
3356
|
console.warn("tableFormat.cellType should be a 2 dimensional array containing (".concat(consts_1.validCellRenderers.join(' | '), "). ").concat(JSON.stringify(cellTypes), " provided"));
|
|
3002
3357
|
}
|
|
3358
|
+
|
|
3003
3359
|
return cellType;
|
|
3004
3360
|
};
|
|
3361
|
+
|
|
3005
3362
|
var getTableFormatSparklineType = function getTableFormatSparklineType(tableFormat, currentColumn, currentRow) {
|
|
3006
|
-
var types = lodash_1.get(tableFormat, 'sparklineTypes');
|
|
3363
|
+
var types = (0, lodash_1.get)(tableFormat, 'sparklineTypes');
|
|
3007
3364
|
var sparklineType;
|
|
3008
|
-
|
|
3365
|
+
|
|
3366
|
+
if (isArray(types) && isArray(types[currentColumn]) && (0, lodash_1.includes)(consts_1.validSparklineTypes, types[currentColumn][currentRow])) {
|
|
3009
3367
|
sparklineType = types[currentColumn][currentRow];
|
|
3010
3368
|
} else if (typeof types !== 'undefined') {
|
|
3011
3369
|
console.warn("tableFormat.sparklineTypes should be a 2 dimensional array containing one of (".concat(consts_1.validSparklineTypes.join(' | '), "). ").concat(JSON.stringify(types), " provided"));
|
|
3012
3370
|
}
|
|
3371
|
+
|
|
3013
3372
|
return sparklineType;
|
|
3014
3373
|
};
|
|
3374
|
+
|
|
3015
3375
|
var getTableFormatColor = function getTableFormatColor(tableFormat, currentColumn, currentRow, field) {
|
|
3016
|
-
var colors = lodash_1.get(tableFormat, field);
|
|
3376
|
+
var colors = (0, lodash_1.get)(tableFormat, field);
|
|
3017
3377
|
var color;
|
|
3018
|
-
|
|
3378
|
+
|
|
3379
|
+
if (isArray(colors) && isArray(colors[currentColumn]) && (0, colorUtils_1.isColor)(colors[currentColumn][currentRow])) {
|
|
3019
3380
|
color = colors[currentColumn][currentRow];
|
|
3020
|
-
} else if (isArray(colors) && colorUtils_1.isColor(colors[currentRow])) {
|
|
3381
|
+
} else if (isArray(colors) && (0, colorUtils_1.isColor)(colors[currentRow])) {
|
|
3021
3382
|
color = colors[currentRow];
|
|
3022
3383
|
} else if (typeof colors !== 'undefined' && isArray(colors) && isArray(colors[currentColumn]) && colors[currentColumn][currentRow] !== undefined) {
|
|
3023
3384
|
console.warn("tableFormat.".concat(field, " needs to be an array of colors, provided ").concat(JSON.stringify(colors), ". Current value at [").concat(currentColumn, "][").concat(currentRow, "] is ").concat(JSON.stringify(colors[currentRow])));
|
|
3024
3385
|
}
|
|
3386
|
+
|
|
3025
3387
|
return color;
|
|
3026
3388
|
};
|
|
3389
|
+
|
|
3027
3390
|
var getTableFormatRowColor = function getTableFormatRowColor(tableFormat, currentCol, currentRow) {
|
|
3028
3391
|
return getTableFormatColor(tableFormat, currentCol, currentRow, 'rowColors');
|
|
3029
3392
|
};
|
|
3393
|
+
|
|
3030
3394
|
var getTableFormatRowBgColor = function getTableFormatRowBgColor(tableFormat, currentCol, currentRow) {
|
|
3031
3395
|
return getTableFormatColor(tableFormat, currentCol, currentRow, 'rowBackgroundColors');
|
|
3032
3396
|
};
|
|
3397
|
+
|
|
3033
3398
|
var getTableFormatSparklineColor = function getTableFormatSparklineColor(tableFormat, currentCol, currentRow) {
|
|
3034
3399
|
return getTableFormatColor(tableFormat, currentCol, currentRow, 'sparklineColors');
|
|
3035
3400
|
};
|
|
3401
|
+
|
|
3036
3402
|
var getTableFormatSparklineAreaColor = function getTableFormatSparklineAreaColor(tableFormat, currentCol, currentRow) {
|
|
3037
3403
|
return getTableFormatColor(tableFormat, currentCol, currentRow, 'sparklineAreaColors');
|
|
3038
3404
|
};
|
|
3405
|
+
|
|
3039
3406
|
var getTableFormatData = function getTableFormatData(tableFormat, currentCol, currentRow) {
|
|
3040
|
-
var data = lodash_1.get(tableFormat, 'data');
|
|
3407
|
+
var data = (0, lodash_1.get)(tableFormat, 'data');
|
|
3041
3408
|
var datum;
|
|
3409
|
+
|
|
3042
3410
|
if (isArray(data) && isArray(data[currentCol])) {
|
|
3043
3411
|
datum = data[currentCol][currentRow];
|
|
3044
3412
|
} else if (typeof data !== 'undefined') {
|
|
3045
3413
|
console.warn("tableFormat.data should be a 2 dimensional array containing formatted data to be displayed. ".concat(_typeof(data), " provided"));
|
|
3046
3414
|
}
|
|
3415
|
+
|
|
3047
3416
|
return datum;
|
|
3048
3417
|
};
|
|
3418
|
+
|
|
3049
3419
|
var validValueSelector = function validValueSelector(v1, v2, v3, defaultValue) {
|
|
3050
3420
|
var validTypes = ['string', 'number'];
|
|
3421
|
+
|
|
3051
3422
|
if (validTypes.includes(_typeof(v1)) || isArray(v1)) {
|
|
3052
3423
|
return v1;
|
|
3053
3424
|
}
|
|
3425
|
+
|
|
3054
3426
|
if (validTypes.includes(_typeof(v2)) || isArray(v2)) {
|
|
3055
3427
|
return v2;
|
|
3056
3428
|
}
|
|
3429
|
+
|
|
3057
3430
|
if (validTypes.includes(_typeof(v3)) || isArray(v3)) {
|
|
3058
3431
|
return v3;
|
|
3059
3432
|
}
|
|
3433
|
+
|
|
3060
3434
|
return defaultValue;
|
|
3061
3435
|
};
|
|
3436
|
+
|
|
3062
3437
|
var useTable = function useTable() {
|
|
3063
3438
|
var tableArgs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3064
3439
|
var _tableArgs$table = tableArgs.table,
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3440
|
+
table = _tableArgs$table === void 0 ? [] : _tableArgs$table,
|
|
3441
|
+
_tableArgs$headers = tableArgs.headers,
|
|
3442
|
+
headers = _tableArgs$headers === void 0 ? [] : _tableArgs$headers;
|
|
3068
3443
|
var _tableArgs$headerVisi = tableArgs.headerVisibility,
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3444
|
+
headerVisibility = _tableArgs$headerVisi === void 0 ? 'inline' : _tableArgs$headerVisi,
|
|
3445
|
+
_tableArgs$showRowNum = tableArgs.showRowNumbers,
|
|
3446
|
+
showRowNumbers = _tableArgs$showRowNum === void 0 ? false : _tableArgs$showRowNum,
|
|
3447
|
+
_tableArgs$showIntern = tableArgs.showInternalFields,
|
|
3448
|
+
showInternalFields = _tableArgs$showIntern === void 0 ? true : _tableArgs$showIntern,
|
|
3449
|
+
_tableArgs$tableForma = tableArgs.tableFormat,
|
|
3450
|
+
tableFormat = _tableArgs$tableForma === void 0 ? {} : _tableArgs$tableForma,
|
|
3451
|
+
_tableArgs$columnForm = tableArgs.columnFormat,
|
|
3452
|
+
columnFormat = _tableArgs$columnForm === void 0 ? {} : _tableArgs$columnForm,
|
|
3453
|
+
_tableArgs$pagination = tableArgs.paginationOffset,
|
|
3454
|
+
paginationOffset = _tableArgs$pagination === void 0 ? 0 : _tableArgs$pagination,
|
|
3455
|
+
_tableArgs$count = tableArgs.count,
|
|
3456
|
+
count = _tableArgs$count === void 0 ? 0 : _tableArgs$count;
|
|
3082
3457
|
var longestColumnLength = Math.max.apply(Math, _toConsumableArray(table.map(function (column) {
|
|
3083
3458
|
return column.length;
|
|
3084
3459
|
})));
|
|
3460
|
+
|
|
3085
3461
|
if (showRowNumbers) {
|
|
3086
3462
|
var correctedPaginationOffset = Math.max(0, (paginationOffset - 1) * count);
|
|
3087
3463
|
headers = ['#'].concat(_toConsumableArray(headers));
|
|
@@ -3090,12 +3466,15 @@ var useTable = function useTable() {
|
|
|
3090
3466
|
}, function (v, i) {
|
|
3091
3467
|
return correctedPaginationOffset + i + 1;
|
|
3092
3468
|
})].concat(_toConsumableArray(table));
|
|
3469
|
+
|
|
3093
3470
|
if (isArray(tableFormat.align)) {
|
|
3094
3471
|
tableFormat.align = [new Array(longestColumnLength).fill('left')].concat(_toConsumableArray(tableFormat.align));
|
|
3095
3472
|
}
|
|
3473
|
+
|
|
3096
3474
|
if (isArray(tableFormat.cellTypes)) {
|
|
3097
3475
|
tableFormat.cellTypes = [new Array(longestColumnLength).fill('TextCell')].concat(_toConsumableArray(tableFormat.cellTypes));
|
|
3098
3476
|
}
|
|
3477
|
+
|
|
3099
3478
|
if (isArray(tableFormat.data)) {
|
|
3100
3479
|
tableFormat.data = [Array.from({
|
|
3101
3480
|
length: longestColumnLength
|
|
@@ -3103,42 +3482,50 @@ var useTable = function useTable() {
|
|
|
3103
3482
|
return "".concat(i + 1);
|
|
3104
3483
|
})].concat(_toConsumableArray(tableFormat.data));
|
|
3105
3484
|
}
|
|
3485
|
+
|
|
3106
3486
|
if (isArray(tableFormat.rowBackgroundColors)) {
|
|
3107
3487
|
if (tableFormat.rowBackgroundColors.length > 0 && isArray(tableFormat.rowBackgroundColors[0])) {
|
|
3108
3488
|
tableFormat.rowBackgroundColors = [new Array(longestColumnLength)].concat(_toConsumableArray(tableFormat.rowBackgroundColors));
|
|
3109
3489
|
}
|
|
3110
3490
|
}
|
|
3491
|
+
|
|
3111
3492
|
if (isArray(tableFormat.rowColors)) {
|
|
3112
3493
|
if (tableFormat.rowColors.length > 0 && isArray(tableFormat.rowColors[0])) {
|
|
3113
3494
|
tableFormat.rowColors = [new Array(longestColumnLength)].concat(_toConsumableArray(tableFormat.rowColors));
|
|
3114
3495
|
}
|
|
3115
3496
|
}
|
|
3497
|
+
|
|
3116
3498
|
if (isArray(tableFormat.sparklineColors)) {
|
|
3117
3499
|
tableFormat.sparklineColors = [new Array(longestColumnLength)].concat(_toConsumableArray(tableFormat.sparklineColors));
|
|
3118
3500
|
}
|
|
3501
|
+
|
|
3119
3502
|
if (isArray(tableFormat.sparklineAreaColors)) {
|
|
3120
3503
|
tableFormat.sparklineAreaColors = [new Array(longestColumnLength)].concat(_toConsumableArray(tableFormat.sparklineAreaColors));
|
|
3121
3504
|
}
|
|
3505
|
+
|
|
3122
3506
|
if (isArray(tableFormat.sparklineTypes)) {
|
|
3123
3507
|
tableFormat.sparklineTypes = [new Array(longestColumnLength).fill('area')].concat(_toConsumableArray(tableFormat.sparklineTypes));
|
|
3124
3508
|
}
|
|
3125
3509
|
}
|
|
3510
|
+
|
|
3126
3511
|
var tableHeader = {
|
|
3127
3512
|
visibility: consts_1.validHeaderVisibilities.indexOf(headerVisibility) >= 0 ? headerVisibility : 'inline',
|
|
3128
3513
|
cells: table.map(function (f, i) {
|
|
3129
3514
|
if (i < headers.length) {
|
|
3130
3515
|
return generateHeader(headers[i], i, columnFormat, showInternalFields);
|
|
3131
3516
|
}
|
|
3517
|
+
|
|
3132
3518
|
return generateHeader('', i, columnFormat, showInternalFields);
|
|
3133
3519
|
}),
|
|
3134
3520
|
style: {
|
|
3135
|
-
backgroundColor: lodash_1.has(tableFormat, 'headerBackgroundColor') && colorUtils_1.isColor(tableFormat.headerBackgroundColor) && tableFormat.headerBackgroundColor || undefined,
|
|
3136
|
-
color: lodash_1.has(tableFormat, 'headerColor') && colorUtils_1.isColor(tableFormat.headerColor) && tableFormat.headerColor || undefined
|
|
3521
|
+
backgroundColor: (0, lodash_1.has)(tableFormat, 'headerBackgroundColor') && (0, colorUtils_1.isColor)(tableFormat.headerBackgroundColor) && tableFormat.headerBackgroundColor || undefined,
|
|
3522
|
+
color: (0, lodash_1.has)(tableFormat, 'headerColor') && (0, colorUtils_1.isColor)(tableFormat.headerColor) && tableFormat.headerColor || undefined
|
|
3137
3523
|
}
|
|
3138
3524
|
};
|
|
3139
3525
|
var tableBody = {
|
|
3140
3526
|
rows: []
|
|
3141
3527
|
};
|
|
3528
|
+
|
|
3142
3529
|
var _loop = function _loop(currentRow) {
|
|
3143
3530
|
var row = {
|
|
3144
3531
|
key: "row-".concat(currentRow),
|
|
@@ -3158,15 +3545,17 @@ var useTable = function useTable() {
|
|
|
3158
3545
|
var sparklineType = getColumnFormatSparklineType(columnFormat, currentHeader, currentRow) || getTableFormatSparklineType(tableFormat, i, currentRow) || 'area';
|
|
3159
3546
|
var key = generateKey(value, "".concat(currentRow, "-").concat(i));
|
|
3160
3547
|
var additionalStyles = {};
|
|
3161
|
-
var textOverflowType = exports.getTextOverflowType(columnFormat, currentHeader.value);
|
|
3162
|
-
var textOverflowStyle = exports.getOverflowStyles({
|
|
3548
|
+
var textOverflowType = (0, exports.getTextOverflowType)(columnFormat, currentHeader.value);
|
|
3549
|
+
var textOverflowStyle = (0, exports.getOverflowStyles)({
|
|
3163
3550
|
textOverflow: textOverflowType
|
|
3164
3551
|
});
|
|
3165
3552
|
additionalStyles = Object.assign(Object.assign({}, additionalStyles), textOverflowStyle);
|
|
3166
3553
|
var showCell = true;
|
|
3554
|
+
|
|
3167
3555
|
if (!showInternalFields && currentHeader.value.charAt(0) === '_' && currentHeader.value !== '_time') {
|
|
3168
3556
|
showCell = false;
|
|
3169
3557
|
}
|
|
3558
|
+
|
|
3170
3559
|
row.cells.push({
|
|
3171
3560
|
key: key,
|
|
3172
3561
|
value: value,
|
|
@@ -3188,19 +3577,22 @@ var useTable = function useTable() {
|
|
|
3188
3577
|
});
|
|
3189
3578
|
tableBody.rows.push(row);
|
|
3190
3579
|
};
|
|
3580
|
+
|
|
3191
3581
|
for (var currentRow = 0; currentRow < longestColumnLength; currentRow += 1) {
|
|
3192
3582
|
_loop(currentRow);
|
|
3193
3583
|
}
|
|
3584
|
+
|
|
3194
3585
|
return {
|
|
3195
3586
|
tableHeader: tableHeader,
|
|
3196
3587
|
tableBody: tableBody
|
|
3197
3588
|
};
|
|
3198
3589
|
};
|
|
3590
|
+
|
|
3199
3591
|
exports.useTable = useTable;
|
|
3200
3592
|
|
|
3201
3593
|
/***/ }),
|
|
3202
3594
|
|
|
3203
|
-
/***/
|
|
3595
|
+
/***/ 483:
|
|
3204
3596
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3205
3597
|
|
|
3206
3598
|
"use strict";
|
|
@@ -3208,39 +3600,44 @@ exports.useTable = useTable;
|
|
|
3208
3600
|
|
|
3209
3601
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
3210
3602
|
if (k2 === undefined) k2 = k;
|
|
3211
|
-
Object.
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3603
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3604
|
+
|
|
3605
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3606
|
+
desc = {
|
|
3607
|
+
enumerable: true,
|
|
3608
|
+
get: function get() {
|
|
3609
|
+
return m[k];
|
|
3610
|
+
}
|
|
3611
|
+
};
|
|
3612
|
+
}
|
|
3613
|
+
|
|
3614
|
+
Object.defineProperty(o, k2, desc);
|
|
3217
3615
|
} : function (o, m, k, k2) {
|
|
3218
3616
|
if (k2 === undefined) k2 = k;
|
|
3219
3617
|
o[k2] = m[k];
|
|
3220
3618
|
});
|
|
3619
|
+
|
|
3221
3620
|
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
3222
3621
|
for (var p in m) {
|
|
3223
3622
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3224
3623
|
}
|
|
3225
3624
|
};
|
|
3625
|
+
|
|
3226
3626
|
Object.defineProperty(exports, "__esModule", {
|
|
3227
3627
|
value: true
|
|
3228
3628
|
});
|
|
3229
|
-
__exportStar(__webpack_require__(480), exports);
|
|
3230
|
-
__exportStar(__webpack_require__(481), exports);
|
|
3231
|
-
__exportStar(__webpack_require__(482), exports);
|
|
3232
|
-
__exportStar(__webpack_require__(483), exports);
|
|
3233
3629
|
|
|
3234
|
-
|
|
3630
|
+
__exportStar(__webpack_require__(484), exports);
|
|
3235
3631
|
|
|
3236
|
-
|
|
3237
|
-
/***/ (function(module, exports) {
|
|
3632
|
+
__exportStar(__webpack_require__(485), exports);
|
|
3238
3633
|
|
|
3239
|
-
|
|
3634
|
+
__exportStar(__webpack_require__(486), exports);
|
|
3635
|
+
|
|
3636
|
+
__exportStar(__webpack_require__(487), exports);
|
|
3240
3637
|
|
|
3241
3638
|
/***/ }),
|
|
3242
3639
|
|
|
3243
|
-
/***/
|
|
3640
|
+
/***/ 484:
|
|
3244
3641
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3245
3642
|
|
|
3246
3643
|
"use strict";
|
|
@@ -3250,18 +3647,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3250
3647
|
value: true
|
|
3251
3648
|
});
|
|
3252
3649
|
exports.SwitchTableCell = void 0;
|
|
3650
|
+
|
|
3253
3651
|
var SwitchTableCell = function SwitchTableCell(_ref) {
|
|
3254
3652
|
var type = _ref.type,
|
|
3255
|
-
|
|
3653
|
+
children = _ref.children;
|
|
3256
3654
|
return children.filter(function (child) {
|
|
3257
3655
|
return child.type.displayName === type;
|
|
3258
3656
|
});
|
|
3259
3657
|
};
|
|
3658
|
+
|
|
3260
3659
|
exports.SwitchTableCell = SwitchTableCell;
|
|
3261
3660
|
|
|
3262
3661
|
/***/ }),
|
|
3263
3662
|
|
|
3264
|
-
/***/
|
|
3663
|
+
/***/ 485:
|
|
3265
3664
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3266
3665
|
|
|
3267
3666
|
"use strict";
|
|
@@ -3271,14 +3670,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3271
3670
|
value: true
|
|
3272
3671
|
});
|
|
3273
3672
|
exports.TextCell = void 0;
|
|
3673
|
+
|
|
3274
3674
|
var React = __webpack_require__(1);
|
|
3275
|
-
|
|
3675
|
+
|
|
3676
|
+
var Table_1 = __webpack_require__(112);
|
|
3677
|
+
|
|
3276
3678
|
var noop = function noop() {
|
|
3277
3679
|
return undefined;
|
|
3278
3680
|
};
|
|
3681
|
+
|
|
3279
3682
|
var TextCell = function TextCell(_ref) {
|
|
3280
3683
|
var cell = _ref.cell,
|
|
3281
|
-
|
|
3684
|
+
useMouseOverEffect = _ref.useMouseOverEffect;
|
|
3282
3685
|
var cellStyle = React.useMemo(function () {
|
|
3283
3686
|
return Object.assign({}, cell.style);
|
|
3284
3687
|
}, [cell.style]);
|
|
@@ -3291,12 +3694,13 @@ var TextCell = function TextCell(_ref) {
|
|
|
3291
3694
|
onClick: useMouseOverEffect ? noop : undefined
|
|
3292
3695
|
}, cell.value.toString());
|
|
3293
3696
|
};
|
|
3697
|
+
|
|
3294
3698
|
exports.TextCell = TextCell;
|
|
3295
3699
|
exports.TextCell.displayName = 'TextCell';
|
|
3296
3700
|
|
|
3297
3701
|
/***/ }),
|
|
3298
3702
|
|
|
3299
|
-
/***/
|
|
3703
|
+
/***/ 486:
|
|
3300
3704
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3301
3705
|
|
|
3302
3706
|
"use strict";
|
|
@@ -3306,14 +3710,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3306
3710
|
value: true
|
|
3307
3711
|
});
|
|
3308
3712
|
exports.ArrayCell = void 0;
|
|
3713
|
+
|
|
3309
3714
|
var React = __webpack_require__(1);
|
|
3310
|
-
|
|
3715
|
+
|
|
3716
|
+
var Table_1 = __webpack_require__(112);
|
|
3717
|
+
|
|
3311
3718
|
var noop = function noop() {
|
|
3312
3719
|
return undefined;
|
|
3313
3720
|
};
|
|
3721
|
+
|
|
3314
3722
|
var ArrayCell = function ArrayCell(_ref) {
|
|
3315
3723
|
var cell = _ref.cell,
|
|
3316
|
-
|
|
3724
|
+
useMouseOverEffect = _ref.useMouseOverEffect;
|
|
3317
3725
|
var value = React.useMemo(function () {
|
|
3318
3726
|
return Array.isArray(cell.value) ? cell.value : [cell.value];
|
|
3319
3727
|
}, [cell.value]);
|
|
@@ -3334,28 +3742,34 @@ var ArrayCell = function ArrayCell(_ref) {
|
|
|
3334
3742
|
}, v.toString());
|
|
3335
3743
|
}));
|
|
3336
3744
|
};
|
|
3745
|
+
|
|
3337
3746
|
exports.ArrayCell = ArrayCell;
|
|
3338
3747
|
exports.ArrayCell.displayName = 'ArrayCell';
|
|
3339
3748
|
|
|
3340
3749
|
/***/ }),
|
|
3341
3750
|
|
|
3342
|
-
/***/
|
|
3751
|
+
/***/ 487:
|
|
3343
3752
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3344
3753
|
|
|
3345
3754
|
"use strict";
|
|
3346
3755
|
|
|
3347
3756
|
|
|
3348
3757
|
var _slicedToArray = __webpack_require__(17);
|
|
3758
|
+
|
|
3349
3759
|
Object.defineProperty(exports, "__esModule", {
|
|
3350
3760
|
value: true
|
|
3351
3761
|
});
|
|
3352
3762
|
exports.SparklineCell = exports.validSparklineTypes = void 0;
|
|
3763
|
+
|
|
3353
3764
|
var React = __webpack_require__(1);
|
|
3354
|
-
|
|
3355
|
-
var Table_1 = __webpack_require__(
|
|
3765
|
+
|
|
3766
|
+
var Table_1 = __webpack_require__(112);
|
|
3767
|
+
|
|
3356
3768
|
var SparkLine_1 = __webpack_require__(95);
|
|
3769
|
+
|
|
3357
3770
|
var paddingLeftRight = 5;
|
|
3358
3771
|
var paddingTopBottom = 3;
|
|
3772
|
+
|
|
3359
3773
|
var parseSparklineData = function parseSparklineData(data) {
|
|
3360
3774
|
return (Array.isArray(data) ? data : [data]).map(function (d) {
|
|
3361
3775
|
return parseInt(d.toString(), 10);
|
|
@@ -3363,31 +3777,44 @@ var parseSparklineData = function parseSparklineData(data) {
|
|
|
3363
3777
|
return isNaN(d) ? null : d;
|
|
3364
3778
|
});
|
|
3365
3779
|
}; // eslint-disable-line no-restricted-globals
|
|
3780
|
+
|
|
3781
|
+
|
|
3366
3782
|
exports.validSparklineTypes = ['line', 'area'];
|
|
3783
|
+
|
|
3367
3784
|
var noop = function noop() {
|
|
3368
3785
|
return undefined;
|
|
3369
3786
|
};
|
|
3787
|
+
|
|
3370
3788
|
var svgStyle = {
|
|
3371
3789
|
height: 0
|
|
3372
3790
|
};
|
|
3373
3791
|
var dummySVG = React.createElement("svg", {
|
|
3374
3792
|
style: svgStyle
|
|
3375
3793
|
});
|
|
3794
|
+
|
|
3376
3795
|
var SparklineCell = function SparklineCell(_ref) {
|
|
3377
3796
|
var cell = _ref.cell,
|
|
3378
|
-
|
|
3379
|
-
|
|
3797
|
+
useMouseOverEffect = _ref.useMouseOverEffect,
|
|
3798
|
+
width = _ref.width;
|
|
3799
|
+
|
|
3380
3800
|
var _React$useState = React.useState(),
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3801
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
3802
|
+
cellEl = _React$useState2[0],
|
|
3803
|
+
setEl = _React$useState2[1];
|
|
3804
|
+
|
|
3384
3805
|
var _React$useState3 = React.useState(),
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3806
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
3807
|
+
height = _React$useState4[0],
|
|
3808
|
+
setHeight = _React$useState4[1];
|
|
3809
|
+
|
|
3388
3810
|
var data = React.useMemo(function () {
|
|
3389
3811
|
return parseSparklineData(cell.value);
|
|
3390
3812
|
}, [cell.value]);
|
|
3813
|
+
|
|
3814
|
+
if (cell.value[0] === '##__SPARKLINE__##') {
|
|
3815
|
+
data = data.slice(1);
|
|
3816
|
+
}
|
|
3817
|
+
|
|
3391
3818
|
React.useLayoutEffect(function () {
|
|
3392
3819
|
setHeight(cellEl === null || cellEl === void 0 ? void 0 : cellEl.offsetHeight);
|
|
3393
3820
|
}, [cellEl]);
|
|
@@ -3412,7 +3839,6 @@ var SparklineCell = function SparklineCell(_ref) {
|
|
|
3412
3839
|
align: cell.align,
|
|
3413
3840
|
elementRef: setEl,
|
|
3414
3841
|
"data-test-cell-type": "SparklineCell",
|
|
3415
|
-
"aria-label": i18n_1._('Source count over time sparkline trend'),
|
|
3416
3842
|
"data-row-index": cell.rowIndex,
|
|
3417
3843
|
"data-col-index": cell.columnIndex,
|
|
3418
3844
|
onClick: useMouseOverEffect ? noop : undefined
|
|
@@ -3427,12 +3853,13 @@ var SparklineCell = function SparklineCell(_ref) {
|
|
|
3427
3853
|
fillColor: cell.sparklineAreaColor
|
|
3428
3854
|
}) : dummySVG);
|
|
3429
3855
|
};
|
|
3856
|
+
|
|
3430
3857
|
exports.SparklineCell = SparklineCell;
|
|
3431
3858
|
exports.SparklineCell.displayName = 'SparklineCell';
|
|
3432
3859
|
|
|
3433
3860
|
/***/ }),
|
|
3434
3861
|
|
|
3435
|
-
/***/
|
|
3862
|
+
/***/ 488:
|
|
3436
3863
|
/***/ (function(module, exports) {
|
|
3437
3864
|
|
|
3438
3865
|
module.exports = require("lodash/debounce");
|
|
@@ -3442,14 +3869,14 @@ module.exports = require("lodash/debounce");
|
|
|
3442
3869
|
/***/ 49:
|
|
3443
3870
|
/***/ (function(module, exports) {
|
|
3444
3871
|
|
|
3445
|
-
module.exports = require("@splunk/
|
|
3872
|
+
module.exports = require("@splunk/visualizations-shared/colorConstants");
|
|
3446
3873
|
|
|
3447
3874
|
/***/ }),
|
|
3448
3875
|
|
|
3449
3876
|
/***/ 50:
|
|
3450
3877
|
/***/ (function(module, exports) {
|
|
3451
3878
|
|
|
3452
|
-
module.exports = require("@splunk/
|
|
3879
|
+
module.exports = require("@splunk/visualization-icons/placeholders");
|
|
3453
3880
|
|
|
3454
3881
|
/***/ }),
|
|
3455
3882
|
|
|
@@ -3460,6 +3887,13 @@ module.exports = require("@splunk/visualization-icons");
|
|
|
3460
3887
|
|
|
3461
3888
|
/***/ }),
|
|
3462
3889
|
|
|
3890
|
+
/***/ 59:
|
|
3891
|
+
/***/ (function(module, exports) {
|
|
3892
|
+
|
|
3893
|
+
module.exports = require("@babel/runtime/helpers/taggedTemplateLiteral");
|
|
3894
|
+
|
|
3895
|
+
/***/ }),
|
|
3896
|
+
|
|
3463
3897
|
/***/ 6:
|
|
3464
3898
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3465
3899
|
|
|
@@ -3471,6 +3905,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3471
3905
|
});
|
|
3472
3906
|
exports.VizBehavior = void 0;
|
|
3473
3907
|
var VizBehavior;
|
|
3908
|
+
|
|
3474
3909
|
(function (VizBehavior) {
|
|
3475
3910
|
/**
|
|
3476
3911
|
* Dynamic Options Behavior.
|
|
@@ -3490,6 +3925,7 @@ var VizBehavior;
|
|
|
3490
3925
|
* missing.
|
|
3491
3926
|
* @type {string}
|
|
3492
3927
|
*/
|
|
3928
|
+
|
|
3493
3929
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
3494
3930
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
3495
3931
|
VizBehavior["TRELLIS"] = "trellis";
|
|
@@ -3497,14 +3933,14 @@ var VizBehavior;
|
|
|
3497
3933
|
|
|
3498
3934
|
/***/ }),
|
|
3499
3935
|
|
|
3500
|
-
/***/
|
|
3936
|
+
/***/ 62:
|
|
3501
3937
|
/***/ (function(module, exports) {
|
|
3502
3938
|
|
|
3503
3939
|
module.exports = require("@splunk/react-ui/Popover");
|
|
3504
3940
|
|
|
3505
3941
|
/***/ }),
|
|
3506
3942
|
|
|
3507
|
-
/***/
|
|
3943
|
+
/***/ 63:
|
|
3508
3944
|
/***/ (function(module, exports) {
|
|
3509
3945
|
|
|
3510
3946
|
module.exports = require("@babel/runtime/helpers/getPrototypeOf");
|
|
@@ -3518,14 +3954,14 @@ module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
|
3518
3954
|
|
|
3519
3955
|
/***/ }),
|
|
3520
3956
|
|
|
3521
|
-
/***/
|
|
3957
|
+
/***/ 71:
|
|
3522
3958
|
/***/ (function(module, exports) {
|
|
3523
3959
|
|
|
3524
3960
|
module.exports = require("@babel/runtime/helpers/inherits");
|
|
3525
3961
|
|
|
3526
3962
|
/***/ }),
|
|
3527
3963
|
|
|
3528
|
-
/***/
|
|
3964
|
+
/***/ 72:
|
|
3529
3965
|
/***/ (function(module, exports) {
|
|
3530
3966
|
|
|
3531
3967
|
module.exports = require("@babel/runtime/helpers/possibleConstructorReturn");
|
|
@@ -3539,31 +3975,31 @@ module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
|
3539
3975
|
|
|
3540
3976
|
/***/ }),
|
|
3541
3977
|
|
|
3542
|
-
/***/
|
|
3978
|
+
/***/ 82:
|
|
3543
3979
|
/***/ (function(module, exports) {
|
|
3544
3980
|
|
|
3545
|
-
module.exports = require("@babel/runtime/helpers/
|
|
3981
|
+
module.exports = require("@babel/runtime/helpers/typeof");
|
|
3546
3982
|
|
|
3547
3983
|
/***/ }),
|
|
3548
3984
|
|
|
3549
|
-
/***/
|
|
3985
|
+
/***/ 88:
|
|
3550
3986
|
/***/ (function(module, exports) {
|
|
3551
3987
|
|
|
3552
|
-
module.exports = require("@babel/runtime/helpers/
|
|
3988
|
+
module.exports = require("@babel/runtime/helpers/assertThisInitialized");
|
|
3553
3989
|
|
|
3554
3990
|
/***/ }),
|
|
3555
3991
|
|
|
3556
|
-
/***/
|
|
3992
|
+
/***/ 9:
|
|
3557
3993
|
/***/ (function(module, exports) {
|
|
3558
3994
|
|
|
3559
|
-
module.exports = require("@
|
|
3995
|
+
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
3560
3996
|
|
|
3561
3997
|
/***/ }),
|
|
3562
3998
|
|
|
3563
|
-
/***/
|
|
3999
|
+
/***/ 94:
|
|
3564
4000
|
/***/ (function(module, exports) {
|
|
3565
4001
|
|
|
3566
|
-
module.exports = require("@
|
|
4002
|
+
module.exports = require("@splunk/react-ui/Paginator");
|
|
3567
4003
|
|
|
3568
4004
|
/***/ }),
|
|
3569
4005
|
|
|
@@ -3578,13 +4014,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3578
4014
|
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
|
|
3579
4015
|
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18);
|
|
3580
4016
|
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);
|
|
3581
|
-
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
4017
|
+
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(88);
|
|
3582
4018
|
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__);
|
|
3583
|
-
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
4019
|
+
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(71);
|
|
3584
4020
|
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);
|
|
3585
|
-
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
4021
|
+
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(72);
|
|
3586
4022
|
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);
|
|
3587
|
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
4023
|
+
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(63);
|
|
3588
4024
|
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);
|
|
3589
4025
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7);
|
|
3590
4026
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__);
|
|
@@ -3594,10 +4030,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3594
4030
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_9__);
|
|
3595
4031
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(3);
|
|
3596
4032
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__);
|
|
3597
|
-
/* harmony import */ var
|
|
3598
|
-
/* harmony import */ var
|
|
3599
|
-
/* harmony import */ var
|
|
3600
|
-
/* harmony import */ var
|
|
4033
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4);
|
|
4034
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_11__);
|
|
4035
|
+
/* harmony import */ var _splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62);
|
|
4036
|
+
/* harmony import */ var _splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12__);
|
|
4037
|
+
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2);
|
|
4038
|
+
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_13__);
|
|
4039
|
+
/* harmony import */ var _splunk_ui_utils_id__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(25);
|
|
4040
|
+
/* harmony import */ var _splunk_ui_utils_id__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_id__WEBPACK_IMPORTED_MODULE_14__);
|
|
4041
|
+
|
|
3601
4042
|
|
|
3602
4043
|
|
|
3603
4044
|
|
|
@@ -3608,22 +4049,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3608
4049
|
|
|
3609
4050
|
function _createSuper(Derived) {
|
|
3610
4051
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
4052
|
+
|
|
3611
4053
|
return function _createSuperInternal() {
|
|
3612
4054
|
var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(Derived),
|
|
3613
|
-
|
|
4055
|
+
result;
|
|
4056
|
+
|
|
3614
4057
|
if (hasNativeReflectConstruct) {
|
|
3615
4058
|
var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(this).constructor;
|
|
4059
|
+
|
|
3616
4060
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
3617
4061
|
} else {
|
|
3618
4062
|
result = Super.apply(this, arguments);
|
|
3619
4063
|
}
|
|
4064
|
+
|
|
3620
4065
|
return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, result);
|
|
3621
4066
|
};
|
|
3622
4067
|
}
|
|
4068
|
+
|
|
3623
4069
|
function _isNativeReflectConstruct() {
|
|
3624
4070
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
3625
4071
|
if (Reflect.construct.sham) return false;
|
|
3626
4072
|
if (typeof Proxy === "function") return true;
|
|
4073
|
+
|
|
3627
4074
|
try {
|
|
3628
4075
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
3629
4076
|
return true;
|
|
@@ -3636,29 +4083,40 @@ function _isNativeReflectConstruct() {
|
|
|
3636
4083
|
|
|
3637
4084
|
|
|
3638
4085
|
|
|
3639
|
-
|
|
4086
|
+
|
|
4087
|
+
|
|
4088
|
+
|
|
4089
|
+
var StyledSvg = styled_components__WEBPACK_IMPORTED_MODULE_11___default.a.svg.withConfig({
|
|
3640
4090
|
displayName: "SparkLine__StyledSvg",
|
|
3641
4091
|
componentId: "sc-5oplra-0"
|
|
3642
4092
|
})(["overflow:hidden;"]);
|
|
3643
|
-
var StyledTooltip =
|
|
4093
|
+
var StyledTooltip = styled_components__WEBPACK_IMPORTED_MODULE_11___default.a.div.withConfig({
|
|
3644
4094
|
displayName: "SparkLine__StyledTooltip",
|
|
3645
4095
|
componentId: "sc-5oplra-1"
|
|
3646
4096
|
})(["padding:3px 8px;font-size:12px;"]);
|
|
4097
|
+
|
|
3647
4098
|
var SparkLine = /*#__PURE__*/function (_Component) {
|
|
3648
4099
|
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(SparkLine, _Component);
|
|
4100
|
+
|
|
3649
4101
|
var _super = _createSuper(SparkLine);
|
|
4102
|
+
|
|
3650
4103
|
function SparkLine(props) {
|
|
3651
4104
|
var _this;
|
|
4105
|
+
|
|
3652
4106
|
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SparkLine);
|
|
4107
|
+
|
|
3653
4108
|
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
3654
4109
|
rest[_key - 1] = arguments[_key];
|
|
3655
4110
|
}
|
|
4111
|
+
|
|
3656
4112
|
_this = _super.call.apply(_super, [this, props].concat(rest));
|
|
4113
|
+
|
|
3657
4114
|
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this), "handleCursorMount", function (el) {
|
|
3658
4115
|
_this.setState({
|
|
3659
4116
|
anchor: el
|
|
3660
4117
|
});
|
|
3661
4118
|
});
|
|
4119
|
+
|
|
3662
4120
|
_this.state = {
|
|
3663
4121
|
anchor: null,
|
|
3664
4122
|
currentPointX: null,
|
|
@@ -3666,71 +4124,78 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3666
4124
|
rectArea: null,
|
|
3667
4125
|
tooltip: null
|
|
3668
4126
|
};
|
|
4127
|
+
_this.titleId = Object(_splunk_ui_utils_id__WEBPACK_IMPORTED_MODULE_14__["createDOMID"])();
|
|
3669
4128
|
return _this;
|
|
3670
4129
|
}
|
|
4130
|
+
|
|
3671
4131
|
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(SparkLine, [{
|
|
3672
4132
|
key: "getMax",
|
|
3673
4133
|
value: function getMax() {
|
|
3674
4134
|
var _this2 = this;
|
|
4135
|
+
|
|
3675
4136
|
var _this$props = this.props,
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
4137
|
+
data = _this$props.data,
|
|
4138
|
+
acceptNull = _this$props.acceptNull,
|
|
4139
|
+
yMax = _this$props.yMax;
|
|
4140
|
+
|
|
3679
4141
|
var dataMax = function dataMax() {
|
|
3680
4142
|
return acceptNull ? Object(lodash__WEBPACK_IMPORTED_MODULE_10__["max"])(_this2.fillNull(data)) : Object(lodash__WEBPACK_IMPORTED_MODULE_10__["max"])(data);
|
|
3681
4143
|
};
|
|
4144
|
+
|
|
3682
4145
|
return yMax !== undefined ? yMax : dataMax();
|
|
3683
4146
|
}
|
|
3684
4147
|
}, {
|
|
3685
4148
|
key: "getMin",
|
|
3686
4149
|
value: function getMin() {
|
|
3687
4150
|
var _this3 = this;
|
|
4151
|
+
|
|
3688
4152
|
var _this$props2 = this.props,
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
4153
|
+
data = _this$props2.data,
|
|
4154
|
+
acceptNull = _this$props2.acceptNull,
|
|
4155
|
+
yMin = _this$props2.yMin;
|
|
4156
|
+
|
|
3692
4157
|
var dataMin = function dataMin() {
|
|
3693
4158
|
return acceptNull ? Object(lodash__WEBPACK_IMPORTED_MODULE_10__["min"])(_this3.fillNull(data)) : Object(lodash__WEBPACK_IMPORTED_MODULE_10__["min"])(data);
|
|
3694
4159
|
};
|
|
4160
|
+
|
|
3695
4161
|
return yMin !== undefined ? yMin : dataMin();
|
|
3696
4162
|
}
|
|
3697
|
-
|
|
3698
4163
|
/**
|
|
3699
4164
|
* Gets unit value of x axis.
|
|
3700
4165
|
* @param {Number} xMargin - margin of x axis.
|
|
3701
4166
|
* @return {Number} unit value of x axis.
|
|
3702
4167
|
* @private
|
|
3703
4168
|
*/
|
|
4169
|
+
|
|
3704
4170
|
}, {
|
|
3705
4171
|
key: "getXUnit",
|
|
3706
4172
|
value: function getXUnit(xMargin) {
|
|
3707
4173
|
var _this$props3 = this.props,
|
|
3708
|
-
|
|
3709
|
-
|
|
4174
|
+
data = _this$props3.data,
|
|
4175
|
+
width = _this$props3.width; // Calculate xUnit. Width substract the left margin and right margin, then divide by data length.
|
|
4176
|
+
|
|
3710
4177
|
var xUnit = (width - xMargin * 2) / (data.length > 1 ? data.length - 1 : 1);
|
|
3711
4178
|
return Math.max(0, xUnit);
|
|
3712
4179
|
}
|
|
3713
|
-
|
|
3714
4180
|
/**
|
|
3715
4181
|
* Gets unit value of y axis.
|
|
3716
4182
|
* @param {String} yMargin - margin of y axis.
|
|
3717
4183
|
* @return {Number} unit value of y axis.
|
|
3718
4184
|
* @private
|
|
3719
4185
|
*/
|
|
4186
|
+
|
|
3720
4187
|
}, {
|
|
3721
4188
|
key: "getYUnit",
|
|
3722
4189
|
value: function getYUnit(yMargin) {
|
|
3723
4190
|
var height = this.props.height;
|
|
3724
4191
|
var maxValue = this.getMax();
|
|
3725
|
-
var minValue = this.getMin();
|
|
3726
|
-
|
|
3727
|
-
// Calculate yUnit. Height substract the upper margin and bottom margin, then divide by value range of values in data.
|
|
4192
|
+
var minValue = this.getMin(); // Calculate yUnit. Height substract the upper margin and bottom margin, then divide by value range of values in data.
|
|
3728
4193
|
// if the maxValue equals minValue, means all values in data are the same, then, we need to set the YUnit at the mid value of Height.
|
|
3729
4194
|
// So, draws sparkline right in the mid of the container.
|
|
4195
|
+
|
|
3730
4196
|
var yUnit = (height - yMargin * 2) / (maxValue - minValue || 2);
|
|
3731
4197
|
return Math.max(0, yUnit);
|
|
3732
4198
|
}
|
|
3733
|
-
|
|
3734
4199
|
/**
|
|
3735
4200
|
* Get a list of arrays of points for drawing lines, based on acceptNull property
|
|
3736
4201
|
* @method getSegmentSets
|
|
@@ -3738,6 +4203,7 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3738
4203
|
* @param {Array} points
|
|
3739
4204
|
* @returns {Array} List of datapoint sets used for drawing lines
|
|
3740
4205
|
*/
|
|
4206
|
+
|
|
3741
4207
|
}, {
|
|
3742
4208
|
key: "getSegmentSets",
|
|
3743
4209
|
value: function getSegmentSets(data, points) {
|
|
@@ -3750,19 +4216,20 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3750
4216
|
// need at least 2 points to draw a segment
|
|
3751
4217
|
if (currentLine.length > 1) {
|
|
3752
4218
|
lines.push(currentLine);
|
|
3753
|
-
}
|
|
3754
|
-
|
|
4219
|
+
} // reset for the next segment
|
|
4220
|
+
|
|
4221
|
+
|
|
3755
4222
|
currentLine = [];
|
|
3756
4223
|
} else {
|
|
3757
4224
|
// data is good, add point data
|
|
3758
4225
|
currentLine.push(points[idx]);
|
|
3759
4226
|
}
|
|
3760
|
-
});
|
|
4227
|
+
}); // Add the last line
|
|
3761
4228
|
|
|
3762
|
-
// Add the last line
|
|
3763
4229
|
if (currentLine.length > 1) {
|
|
3764
4230
|
lines.push(currentLine);
|
|
3765
4231
|
}
|
|
4232
|
+
|
|
3766
4233
|
return lines;
|
|
3767
4234
|
}
|
|
3768
4235
|
}, {
|
|
@@ -3778,7 +4245,6 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3778
4245
|
return value === null ? 0 : value;
|
|
3779
4246
|
});
|
|
3780
4247
|
}
|
|
3781
|
-
|
|
3782
4248
|
/**
|
|
3783
4249
|
* Converts data to points in svg
|
|
3784
4250
|
* @param {Number} xMargin - margin of x axis.
|
|
@@ -3786,6 +4252,7 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3786
4252
|
* @return {Array} points coordination.
|
|
3787
4253
|
* @private
|
|
3788
4254
|
*/
|
|
4255
|
+
|
|
3789
4256
|
}, {
|
|
3790
4257
|
key: "dataToPoints",
|
|
3791
4258
|
value: function dataToPoints(xMargin, yMargin) {
|
|
@@ -3803,7 +4270,6 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3803
4270
|
return [p.x, p.y];
|
|
3804
4271
|
});
|
|
3805
4272
|
}
|
|
3806
|
-
|
|
3807
4273
|
/**
|
|
3808
4274
|
* Renders rect area for helping figure out which is the nearest point so that
|
|
3809
4275
|
* render related cursor and tooltip.
|
|
@@ -3812,16 +4278,20 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3812
4278
|
* @return {Array} array of svg rect objects
|
|
3813
4279
|
* @private
|
|
3814
4280
|
*/
|
|
4281
|
+
|
|
3815
4282
|
}, {
|
|
3816
4283
|
key: "renderRect",
|
|
3817
4284
|
value: function renderRect(points, xMargin) {
|
|
3818
4285
|
var _this4 = this;
|
|
4286
|
+
|
|
3819
4287
|
var _this$props4 = this.props,
|
|
3820
|
-
|
|
3821
|
-
|
|
4288
|
+
data = _this$props4.data,
|
|
4289
|
+
height = _this$props4.height;
|
|
3822
4290
|
var xUnit = this.getXUnit(xMargin);
|
|
3823
4291
|
return points.map(function (p, i) {
|
|
3824
|
-
return
|
|
4292
|
+
return (
|
|
4293
|
+
/*#__PURE__*/
|
|
4294
|
+
|
|
3825
4295
|
/* eslint-disable react/no-array-index-key */
|
|
3826
4296
|
react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("rect", {
|
|
3827
4297
|
// eslint-disable-line jsx-a11y/mouse-events-have-key-events
|
|
@@ -3844,33 +4314,32 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3844
4314
|
}
|
|
3845
4315
|
})
|
|
3846
4316
|
/* eslint-enable react/no-array-index-key */
|
|
4317
|
+
|
|
3847
4318
|
);
|
|
3848
4319
|
});
|
|
3849
|
-
}
|
|
4320
|
+
} // Renders area chart
|
|
3850
4321
|
|
|
3851
|
-
// Renders area chart
|
|
3852
4322
|
}, {
|
|
3853
4323
|
key: "renderArea",
|
|
3854
4324
|
value: function renderArea(points) {
|
|
3855
4325
|
var _this$props5 = this.props,
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
4326
|
+
data = _this$props5.data,
|
|
4327
|
+
fillColor = _this$props5.fillColor,
|
|
4328
|
+
fillOpacity = _this$props5.fillOpacity,
|
|
4329
|
+
height = _this$props5.height,
|
|
4330
|
+
isArea = _this$props5.isArea;
|
|
4331
|
+
|
|
3861
4332
|
if (!isArea || points.length === 0) {
|
|
3862
4333
|
return null;
|
|
3863
4334
|
}
|
|
4335
|
+
|
|
3864
4336
|
var segments = this.getSegmentSets(data, points);
|
|
3865
4337
|
segments = segments.map(function (s) {
|
|
3866
|
-
return s.concat([[s[s.length - 1][0], height],
|
|
3867
|
-
//
|
|
3868
|
-
[s[0][0], height],
|
|
3869
|
-
// over to below first data point
|
|
4338
|
+
return s.concat([[s[s.length - 1][0], height], // down to bottom of graph
|
|
4339
|
+
[s[0][0], height], // over to below first data point
|
|
3870
4340
|
s[0] // up to first data point to close the box
|
|
3871
4341
|
]);
|
|
3872
4342
|
});
|
|
3873
|
-
|
|
3874
4343
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("g", {
|
|
3875
4344
|
"data-test": "area"
|
|
3876
4345
|
}, segments.map(function (s) {
|
|
@@ -3890,11 +4359,11 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3890
4359
|
key: "renderCursor",
|
|
3891
4360
|
value: function renderCursor() {
|
|
3892
4361
|
var _this$props6 = this.props,
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
4362
|
+
cursorStroke = _this$props6.cursorStroke,
|
|
4363
|
+
cursorStrokeWidth = _this$props6.cursorStrokeWidth,
|
|
4364
|
+
cursorStrokeLinecap = _this$props6.cursorStrokeLinecap,
|
|
4365
|
+
cursorStrokeDasharray = _this$props6.cursorStrokeDasharray,
|
|
4366
|
+
height = _this$props6.height;
|
|
3898
4367
|
return this.state.rectArea !== null && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("line", {
|
|
3899
4368
|
"data-test": "cursor",
|
|
3900
4369
|
ref: this.handleCursorMount,
|
|
@@ -3913,7 +4382,7 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3913
4382
|
}, {
|
|
3914
4383
|
key: "renderTooltip",
|
|
3915
4384
|
value: function renderTooltip() {
|
|
3916
|
-
return this.state.anchor !== null && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement(
|
|
4385
|
+
return this.state.anchor !== null && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement(_splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12___default.a, {
|
|
3917
4386
|
"data-test": "tooltip",
|
|
3918
4387
|
open: this.state.open,
|
|
3919
4388
|
anchor: this.state.anchor,
|
|
@@ -3923,7 +4392,6 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3923
4392
|
animation: false
|
|
3924
4393
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement(StyledTooltip, null, this.state.anchor !== null ? this.state.tooltip : undefined));
|
|
3925
4394
|
}
|
|
3926
|
-
|
|
3927
4395
|
/**
|
|
3928
4396
|
* Renders one or more svg circles to highlight values on the sparkline
|
|
3929
4397
|
* @method renderEndDots
|
|
@@ -3933,14 +4401,15 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3933
4401
|
* @returns {Object} React representation of SVG group
|
|
3934
4402
|
* @private
|
|
3935
4403
|
*/
|
|
4404
|
+
|
|
3936
4405
|
}, {
|
|
3937
4406
|
key: "renderEndDots",
|
|
3938
4407
|
value: function renderEndDots(points, dotsToShow, xMargin) {
|
|
3939
4408
|
var _this$props7 = this.props,
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
4409
|
+
endDotFillColor = _this$props7.endDotFillColor,
|
|
4410
|
+
endDotRadius = _this$props7.endDotRadius,
|
|
4411
|
+
endDotStroke = _this$props7.endDotStroke,
|
|
4412
|
+
endDotStrokeWidth = _this$props7.endDotStrokeWidth;
|
|
3944
4413
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("g", null, points.slice(-dotsToShow).map(function (point) {
|
|
3945
4414
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("circle", {
|
|
3946
4415
|
key: "end-dot".concat(point[0]).concat(point[1]),
|
|
@@ -3956,21 +4425,21 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3956
4425
|
});
|
|
3957
4426
|
}));
|
|
3958
4427
|
}
|
|
3959
|
-
|
|
3960
4428
|
/**
|
|
3961
4429
|
* Renders the line(s) above the area graph
|
|
3962
4430
|
* @method renderPolyline
|
|
3963
4431
|
* @param {Array} points
|
|
3964
4432
|
* @returns {Object} SVG Group of polylines
|
|
3965
4433
|
*/
|
|
4434
|
+
|
|
3966
4435
|
}, {
|
|
3967
4436
|
key: "renderPolyline",
|
|
3968
4437
|
value: function renderPolyline(points) {
|
|
3969
4438
|
var _this$props8 = this.props,
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
4439
|
+
data = _this$props8.data,
|
|
4440
|
+
lineColor = _this$props8.lineColor,
|
|
4441
|
+
lineLength = _this$props8.lineLength,
|
|
4442
|
+
lineStrokeWidth = _this$props8.lineStrokeWidth;
|
|
3974
4443
|
var linePoints = Object(lodash__WEBPACK_IMPORTED_MODULE_10__["isFinite"])(lineLength) && lineLength > 0 ? lineLength : points.length;
|
|
3975
4444
|
var lines = this.getSegmentSets(data.slice(-linePoints), points.slice(-linePoints));
|
|
3976
4445
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("g", {
|
|
@@ -3994,23 +4463,26 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
3994
4463
|
key: "render",
|
|
3995
4464
|
value: function render() {
|
|
3996
4465
|
var _this5 = this;
|
|
4466
|
+
|
|
3997
4467
|
var _this$props9 = this.props,
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4468
|
+
data = _this$props9.data,
|
|
4469
|
+
elementRef = _this$props9.elementRef,
|
|
4470
|
+
showTooltip = _this$props9.showTooltip,
|
|
4471
|
+
showEndDot = _this$props9.showEndDot,
|
|
4472
|
+
endDotRadius = _this$props9.endDotRadius,
|
|
4473
|
+
endDotStrokeWidth = _this$props9.endDotStrokeWidth,
|
|
4474
|
+
endDotCount = _this$props9.endDotCount,
|
|
4475
|
+
height = _this$props9.height,
|
|
4476
|
+
isArea = _this$props9.isArea,
|
|
4477
|
+
lineStrokeWidth = _this$props9.lineStrokeWidth,
|
|
4478
|
+
width = _this$props9.width,
|
|
4479
|
+
title = _this$props9.title;
|
|
4480
|
+
|
|
4009
4481
|
if (data.length === 0) {
|
|
4010
4482
|
return null;
|
|
4011
|
-
}
|
|
4483
|
+
} // Calculate horizontal and vertical margin so that fit line or end dot.
|
|
4484
|
+
|
|
4012
4485
|
|
|
4013
|
-
// Calculate horizontal and vertical margin so that fit line or end dot.
|
|
4014
4486
|
var xMargin = endDotRadius + endDotStrokeWidth / 2;
|
|
4015
4487
|
var yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);
|
|
4016
4488
|
var points = this.dataToPoints(xMargin, yMargin);
|
|
@@ -4030,86 +4502,124 @@ var SparkLine = /*#__PURE__*/function (_Component) {
|
|
|
4030
4502
|
ref: elementRef
|
|
4031
4503
|
}, Object(lodash__WEBPACK_IMPORTED_MODULE_10__["omit"])(this.props, Object(lodash__WEBPACK_IMPORTED_MODULE_10__["keys"])(SparkLine.propTypes))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement(StyledSvg, {
|
|
4032
4504
|
height: height,
|
|
4033
|
-
width: width
|
|
4034
|
-
|
|
4505
|
+
width: width,
|
|
4506
|
+
role: "img",
|
|
4507
|
+
"aria-labelledby": this.titleId,
|
|
4508
|
+
"data-test": "sparkline-svg"
|
|
4509
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("title", {
|
|
4510
|
+
id: this.titleId,
|
|
4511
|
+
"data-test": "sparkline-title"
|
|
4512
|
+
}, title || Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_13__["_"])('Source count over time sparkline trend')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("g", null, this.renderCursor(), this.renderPolyline(points), this.renderArea(points), dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null, showTooltip ? this.renderRect(points, xMargin) : null, showTooltip ? this.renderTooltip() : null)));
|
|
4035
4513
|
}
|
|
4036
4514
|
}]);
|
|
4515
|
+
|
|
4037
4516
|
return SparkLine;
|
|
4038
4517
|
}(react__WEBPACK_IMPORTED_MODULE_9__["Component"]);
|
|
4518
|
+
|
|
4039
4519
|
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(SparkLine, "propTypes", {
|
|
4040
4520
|
/**
|
|
4041
4521
|
* If true, data can contain `null` as a value and is treated as `0`. If false, this throws error when data contains `null`.
|
|
4042
4522
|
*/
|
|
4043
4523
|
acceptNull: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.bool,
|
|
4524
|
+
|
|
4044
4525
|
/** Array of numbers. These data numbers are converted to points and show on sparkline. */
|
|
4045
4526
|
data: function data(props) {
|
|
4046
4527
|
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_10__["isArray"])(props.data)) {
|
|
4047
4528
|
return new Error('Data provided to Sparkline must be an array.');
|
|
4048
4529
|
}
|
|
4530
|
+
|
|
4049
4531
|
if (props.acceptNull && !props.data.every(function (value) {
|
|
4050
4532
|
return Object(lodash__WEBPACK_IMPORTED_MODULE_10__["isNull"])(value) || Object(lodash__WEBPACK_IMPORTED_MODULE_10__["isFinite"])(value);
|
|
4051
4533
|
})) {
|
|
4052
4534
|
return new Error('Data provided to Sparkline must be finite numbers or null.');
|
|
4053
4535
|
}
|
|
4536
|
+
|
|
4054
4537
|
if (!props.acceptNull && !props.data.every(function (value) {
|
|
4055
4538
|
return Object(lodash__WEBPACK_IMPORTED_MODULE_10__["isFinite"])(value);
|
|
4056
4539
|
})) {
|
|
4057
4540
|
return new Error('Data provided to Sparkline must be finite numbers.');
|
|
4058
4541
|
}
|
|
4542
|
+
|
|
4059
4543
|
return null;
|
|
4060
4544
|
},
|
|
4545
|
+
|
|
4061
4546
|
/** A React ref which is set to the DOM element when the component mounts and `null` when it unmounts. */
|
|
4062
4547
|
elementRef: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.func, prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.object]),
|
|
4548
|
+
|
|
4063
4549
|
/** Sets the number of end dots to display. When showEndDot is set to `true`, endDotCount is at least 1. If set to a positive value, this overrides showEndDot. */
|
|
4064
4550
|
endDotCount: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.number,
|
|
4551
|
+
|
|
4065
4552
|
/** Fills color to the end dot. */
|
|
4066
4553
|
endDotFillColor: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.string,
|
|
4554
|
+
|
|
4067
4555
|
/**
|
|
4068
4556
|
* Sets end dot radius. End dot radius must be less than or equal to the margin. By default, its value equals the margin.
|
|
4069
4557
|
*/
|
|
4070
4558
|
endDotRadius: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.number,
|
|
4559
|
+
|
|
4071
4560
|
/** Sets end dot circle stroke color. */
|
|
4072
4561
|
endDotStroke: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.string,
|
|
4562
|
+
|
|
4073
4563
|
/** Sets end dot circle stroke width in pixels. */
|
|
4074
4564
|
endDotStrokeWidth: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.number,
|
|
4565
|
+
|
|
4075
4566
|
/** Fills color to area. */
|
|
4076
4567
|
fillColor: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.string,
|
|
4568
|
+
|
|
4077
4569
|
/** Fills opacity to area. Value must be in 0 ~ 1. */
|
|
4078
4570
|
fillOpacity: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.string,
|
|
4571
|
+
|
|
4079
4572
|
/** Sets cursor stroke color. */
|
|
4080
4573
|
cursorStroke: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.string,
|
|
4574
|
+
|
|
4081
4575
|
/** Sets cursor stroke width in pixels. */
|
|
4082
4576
|
cursorStrokeWidth: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.number,
|
|
4577
|
+
|
|
4083
4578
|
/** Sets cursor line cap style. */
|
|
4084
4579
|
cursorStrokeLinecap: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.oneOf(['butt', 'round', 'square']),
|
|
4580
|
+
|
|
4085
4581
|
/** Sets cursor dash array style. */
|
|
4086
4582
|
cursorStrokeDasharray: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.string,
|
|
4583
|
+
|
|
4087
4584
|
/**
|
|
4088
4585
|
* Container height. If this value is specified, sparkline calculates the size using this height. If height isn't specified,
|
|
4089
4586
|
* sparkline figures out the container height by itself.
|
|
4090
4587
|
*/
|
|
4091
4588
|
height: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.number.isRequired,
|
|
4589
|
+
|
|
4092
4590
|
/** When set to `true`, sparkline shows as area. */
|
|
4093
4591
|
isArea: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.bool,
|
|
4592
|
+
|
|
4094
4593
|
/** The sparkline line color. */
|
|
4095
4594
|
lineColor: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.string,
|
|
4595
|
+
|
|
4096
4596
|
/** Allows user to draw only the last data points for the line. */
|
|
4097
4597
|
lineLength: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.number,
|
|
4598
|
+
|
|
4098
4599
|
/** The sparkline line stroke width in pixels. */
|
|
4099
4600
|
lineStrokeWidth: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.number,
|
|
4601
|
+
|
|
4100
4602
|
/** Enable to show end dot. */
|
|
4101
4603
|
showEndDot: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.bool,
|
|
4604
|
+
|
|
4102
4605
|
/** Enable to show tooltip. */
|
|
4103
4606
|
showTooltip: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.bool,
|
|
4607
|
+
|
|
4104
4608
|
/** Sets the data value range and maximum value shown on sparkline. */
|
|
4105
4609
|
yMax: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.number,
|
|
4610
|
+
|
|
4106
4611
|
/** Sets the data value range and minimum value shown on sparkline. */
|
|
4107
4612
|
yMin: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.number,
|
|
4613
|
+
|
|
4108
4614
|
/**
|
|
4109
4615
|
* The width of the container.
|
|
4110
4616
|
*/
|
|
4111
|
-
width: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.number.isRequired
|
|
4617
|
+
width: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.number.isRequired,
|
|
4618
|
+
|
|
4619
|
+
/** Sets the a11y title text on sparkline. */
|
|
4620
|
+
title: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.string
|
|
4112
4621
|
});
|
|
4622
|
+
|
|
4113
4623
|
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(SparkLine, "defaultProps", {
|
|
4114
4624
|
acceptNull: false,
|
|
4115
4625
|
data: [],
|
|
@@ -4130,14 +4640,8 @@ _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(Spa
|
|
|
4130
4640
|
lineColor: '#65a637',
|
|
4131
4641
|
lineStrokeWidth: 1
|
|
4132
4642
|
});
|
|
4133
|
-
/* harmony default export */ __webpack_exports__["default"] = (SparkLine);
|
|
4134
|
-
|
|
4135
|
-
/***/ }),
|
|
4136
4643
|
|
|
4137
|
-
|
|
4138
|
-
/***/ (function(module, exports) {
|
|
4139
|
-
|
|
4140
|
-
module.exports = require("@babel/runtime/helpers/taggedTemplateLiteral");
|
|
4644
|
+
/* harmony default export */ __webpack_exports__["default"] = (SparkLine);
|
|
4141
4645
|
|
|
4142
4646
|
/***/ })
|
|
4143
4647
|
|