@splunk/visualizations 24.3.0 → 24.3.1
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/.loki/reference/chrome_docker_Visualizations_Table_Table_Align_By_Type_Custom.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Align_Default.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Align_Kitchen_Sink.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Align_Right.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Align_Single_Column.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Background_Color_light_blue.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Background_No_Stripe.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Background_Stripe.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Basic_Table.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Basic_Table_With_No_Click.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Cell_Types.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Column_Gradient.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Column_Override.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Count_2.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Custom_Header_Colors.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Custom_Row_Colors.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Custom_Stripe.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Dark_Background_No_Stripe.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Dark_Background_Stripe.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Format_Number.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Format_Number_Adv.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Header_Visibility_fixed.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Header_Visibility_none.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Height_Percentage.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Height_Percentage_100_no_paginator.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Invalid_Background_Color.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Multi_Value_Field.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_No_Stripes.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_No_Stripes_Row_Numbers.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Show_Row_Numbers_true.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline_Custom.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline_Width.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparklines_Adv.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Table_Formatting.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Table_Gradient.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Time_Formatting.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Width_Height.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Width_Percentage.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Width_Px.png +0 -0
- package/Area.js +2 -2
- package/Area.js.map +1 -1
- package/Bar.js +2 -2
- package/Bar.js.map +1 -1
- package/Bubble.js +2 -2
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.js +5 -5
- package/ChoroplethSvg.js.map +1 -1
- package/Column.js +2 -2
- package/Column.js.map +1 -1
- package/Ellipse.js +5 -5
- package/Ellipse.js.map +1 -1
- package/FillerGauge.js +5 -5
- package/FillerGauge.js.map +1 -1
- package/Image.js +2 -2
- package/Image.js.map +1 -1
- package/Line.js +2 -2
- package/Line.js.map +1 -1
- package/LinkGraph.js +5 -5
- package/LinkGraph.js.map +1 -1
- package/Map.js +54 -50
- package/Map.js.map +1 -1
- package/Markdown.js +2 -2
- package/Markdown.js.map +1 -1
- package/MarkerGauge.js +2 -2
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.js +5 -5
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.js +2 -2
- package/Pie.js.map +1 -1
- package/Punchcard.js +7 -7
- package/Punchcard.js.map +1 -1
- package/Rectangle.js +4 -4
- package/Rectangle.js.map +1 -1
- package/Sankey.js +6 -6
- package/Sankey.js.map +1 -1
- package/Scatter.js +2 -2
- package/Scatter.js.map +1 -1
- package/SingleValue.js +4 -4
- package/SingleValue.js.map +1 -1
- package/SingleValueIcon.js +5 -5
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.js +4 -4
- package/SingleValueRadial.js.map +1 -1
- package/Table.config.js +1 -2
- package/Table.config.js.map +1 -1
- package/Table.js +67 -169
- package/Table.js.map +1 -1
- package/common/withDashboardViz.js +2 -2
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +9 -9
package/Table.js
CHANGED
|
@@ -220,7 +220,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
220
220
|
|
|
221
221
|
return React.createElement(FixSizeItem, {
|
|
222
222
|
"data-test": "fix-size-item",
|
|
223
|
-
"data-splunk-visualization-version": "24.3.
|
|
223
|
+
"data-splunk-visualization-version": "24.3.1 - da5652d2c",
|
|
224
224
|
width: width,
|
|
225
225
|
height: height,
|
|
226
226
|
backgroundColor: backgroundColor
|
|
@@ -255,7 +255,7 @@ module.exports = require("@splunk/visualizations-shared/style");
|
|
|
255
255
|
"use strict";
|
|
256
256
|
|
|
257
257
|
|
|
258
|
-
var _slicedToArray = __webpack_require__(
|
|
258
|
+
var _slicedToArray = __webpack_require__(49);
|
|
259
259
|
|
|
260
260
|
var __rest = this && this.__rest || function (s, e) {
|
|
261
261
|
var t = {};
|
|
@@ -275,8 +275,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
275
275
|
});
|
|
276
276
|
exports.config = exports.PureTable = exports.themes = exports.computeVizProps = void 0;
|
|
277
277
|
|
|
278
|
-
var lodash_1 = __webpack_require__(2);
|
|
279
|
-
|
|
280
278
|
var colorUtils_1 = __webpack_require__(11);
|
|
281
279
|
|
|
282
280
|
var config_1 = __webpack_require__(256);
|
|
@@ -292,13 +290,11 @@ exports.PureTable = PureTable_1.default;
|
|
|
292
290
|
var computeVizProps = function computeVizProps(_a) {
|
|
293
291
|
var props = __rest(_a, []);
|
|
294
292
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
var
|
|
299
|
-
var
|
|
300
|
-
var themeRowBackgroundColorEven = vizProps.themeFunc('rowBackgroundColorEven');
|
|
301
|
-
var themeTextColor = vizProps.themeFunc('textColor'); // `columns` looks like { `column title`: { rowBackgroundColors, rowColors... }}
|
|
293
|
+
if (props.columnFormat) {
|
|
294
|
+
var columns = props.columnFormat;
|
|
295
|
+
var themeRowBackgroundColorOdd = props.themeFunc('rowBackgroundColorOdd');
|
|
296
|
+
var themeRowBackgroundColorEven = props.themeFunc('rowBackgroundColorEven');
|
|
297
|
+
var themeTextColor = props.themeFunc('textColor'); // `columns` looks like { `column title`: { rowBackgroundColors, rowColors... }}
|
|
302
298
|
|
|
303
299
|
Object.entries(columns).forEach(function (_ref) {
|
|
304
300
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
@@ -321,9 +317,10 @@ var computeVizProps = function computeVizProps(_a) {
|
|
|
321
317
|
rowColors = colorUtils_1.sanitizeArrayOfColors(columnProperties.rowColors).map(function (color) {
|
|
322
318
|
return color || themeTextColor;
|
|
323
319
|
});
|
|
324
|
-
}
|
|
320
|
+
} // eslint-disable-next-line no-param-reassign
|
|
325
321
|
|
|
326
|
-
|
|
322
|
+
|
|
323
|
+
props.columnFormat[columnKey] = Object.assign(Object.assign(Object.assign({}, props.columnFormat[columnKey]), columnProperties.rowBackgroundColors && {
|
|
327
324
|
rowBackgroundColors: rowBackgroundColors
|
|
328
325
|
}), columnProperties.rowColors && {
|
|
329
326
|
rowColors: rowColors
|
|
@@ -331,52 +328,44 @@ var computeVizProps = function computeVizProps(_a) {
|
|
|
331
328
|
});
|
|
332
329
|
}
|
|
333
330
|
|
|
334
|
-
if (
|
|
335
|
-
var handleColumnFormatChange = function handleColumnFormatChange(updatedColumnFormat) {
|
|
336
|
-
vizProps.onOptionsChange({
|
|
337
|
-
columnFormat: updatedColumnFormat
|
|
338
|
-
});
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
vizProps.onColumnFormatChange = handleColumnFormatChange;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
if (!vizProps.showInternalFields) {
|
|
331
|
+
if (!props.showInternalFields) {
|
|
345
332
|
var filteredFields = [];
|
|
346
333
|
var filteredTable = [];
|
|
347
334
|
var filteredIndexes = [];
|
|
348
|
-
|
|
335
|
+
props.headers.forEach(function (fieldIn, index) {
|
|
349
336
|
var _a;
|
|
350
337
|
|
|
351
338
|
var field = (_a = fieldIn.name) !== null && _a !== void 0 ? _a : fieldIn;
|
|
352
339
|
|
|
353
340
|
if (field.charAt(0) !== '_' || field === '_time') {
|
|
354
341
|
filteredFields.push(field);
|
|
355
|
-
filteredTable.push(
|
|
342
|
+
filteredTable.push(props.table[index]);
|
|
356
343
|
filteredIndexes.push(index);
|
|
357
344
|
}
|
|
358
345
|
});
|
|
359
346
|
var filteredTableFormat = null;
|
|
360
347
|
|
|
361
|
-
if (
|
|
348
|
+
if (props.tableFormat) {
|
|
362
349
|
filteredTableFormat = {};
|
|
363
|
-
Object.keys(
|
|
364
|
-
if (Array.isArray(
|
|
365
|
-
filteredTableFormat[tableFormatKey] =
|
|
350
|
+
Object.keys(props.tableFormat).forEach(function (tableFormatKey) {
|
|
351
|
+
if (Array.isArray(props.tableFormat[tableFormatKey])) {
|
|
352
|
+
filteredTableFormat[tableFormatKey] = props.tableFormat[tableFormatKey].filter(function (tableFormatItem, tableFormatItemIndex) {
|
|
366
353
|
return filteredIndexes.indexOf(tableFormatItemIndex) !== -1;
|
|
367
354
|
});
|
|
368
355
|
} else {
|
|
369
|
-
filteredTableFormat[tableFormatKey] =
|
|
356
|
+
filteredTableFormat[tableFormatKey] = props.tableFormat[tableFormatKey];
|
|
370
357
|
}
|
|
371
358
|
});
|
|
372
359
|
}
|
|
373
360
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
361
|
+
return Object.assign(Object.assign({}, props), {
|
|
362
|
+
headers: filteredFields,
|
|
363
|
+
table: filteredTable,
|
|
364
|
+
tableFormat: filteredTableFormat
|
|
365
|
+
});
|
|
377
366
|
}
|
|
378
367
|
|
|
379
|
-
return
|
|
368
|
+
return props;
|
|
380
369
|
};
|
|
381
370
|
|
|
382
371
|
exports.computeVizProps = computeVizProps;
|
|
@@ -975,8 +964,7 @@ var optionsSchema = {
|
|
|
975
964
|
},
|
|
976
965
|
width: {
|
|
977
966
|
description: 'Controls how wide in pixels (where 1px = 1/96th of 1in) the column should be displayed.',
|
|
978
|
-
type: 'number'
|
|
979
|
-
minimum: 30
|
|
967
|
+
type: 'number'
|
|
980
968
|
}
|
|
981
969
|
}
|
|
982
970
|
}
|
|
@@ -1392,8 +1380,6 @@ exports.default = configUtils_1.enhanceConfig(config);
|
|
|
1392
1380
|
"use strict";
|
|
1393
1381
|
|
|
1394
1382
|
|
|
1395
|
-
var _slicedToArray = __webpack_require__(48);
|
|
1396
|
-
|
|
1397
1383
|
var _taggedTemplateLiteral = __webpack_require__(101);
|
|
1398
1384
|
|
|
1399
1385
|
var _templateObject, _templateObject2;
|
|
@@ -1455,22 +1441,13 @@ var FixedSizeContainer_1 = __webpack_require__(12); // debounce was imported thi
|
|
|
1455
1441
|
|
|
1456
1442
|
var debounce = __webpack_require__(266);
|
|
1457
1443
|
|
|
1458
|
-
var
|
|
1459
|
-
var StyledTableHead = styled_components_1.default(Table_1.default.Head).withConfig({
|
|
1460
|
-
displayName: "PureTable__StyledTableHead",
|
|
1461
|
-
componentId: "tovzjg-0"
|
|
1462
|
-
})(["& > tr > th:last-child > div > button{display:none;}"]);
|
|
1463
|
-
var NonVisibleTableHead = styled_components_1.default(StyledTableHead).withConfig({
|
|
1444
|
+
var NonVisibleTableHead = styled_components_1.default(Table_1.default.Head).withConfig({
|
|
1464
1445
|
displayName: "PureTable__NonVisibleTableHead",
|
|
1465
|
-
componentId: "tovzjg-
|
|
1446
|
+
componentId: "tovzjg-0"
|
|
1466
1447
|
})(["display:none;"]);
|
|
1467
|
-
var FixedTableHead = styled_components_1.default(StyledTableHead).withConfig({
|
|
1468
|
-
displayName: "PureTable__FixedTableHead",
|
|
1469
|
-
componentId: "tovzjg-2"
|
|
1470
|
-
})(["position:sticky;top:0;"]);
|
|
1471
1448
|
var VizTableContainer = styled_components_1.default.div.withConfig({
|
|
1472
1449
|
displayName: "PureTable__VizTableContainer",
|
|
1473
|
-
componentId: "tovzjg-
|
|
1450
|
+
componentId: "tovzjg-1"
|
|
1474
1451
|
})(["box-sizing:border-box;padding:", ";background-color:", ";display:flex;flex-flow:column nowrap;overflow:hidden;"], pick_1.default({
|
|
1475
1452
|
enterprise: variables_1.default.spacingHalf,
|
|
1476
1453
|
prisma: variables_1.default.spacingSmall
|
|
@@ -1482,7 +1459,7 @@ var PAGINATOR_CONTAINER_HEIGHT = 38;
|
|
|
1482
1459
|
var PAGINATOR_SPACING = 5;
|
|
1483
1460
|
var SUITableContainer = styled_components_1.default.div.withConfig({
|
|
1484
1461
|
displayName: "PureTable__SUITableContainer",
|
|
1485
|
-
componentId: "tovzjg-
|
|
1462
|
+
componentId: "tovzjg-2"
|
|
1486
1463
|
})(["box-sizing:border-box;flex-grow:1;overflow:hidden;", ";", ";", " ", ""], function (_ref) {
|
|
1487
1464
|
var width = _ref.width,
|
|
1488
1465
|
height = _ref.height,
|
|
@@ -1516,7 +1493,7 @@ var SUITableContainer = styled_components_1.default.div.withConfig({
|
|
|
1516
1493
|
SUITableContainer.displayName = 'SUITableContainer';
|
|
1517
1494
|
var PaginatorContainer = styled_components_1.default.div.withConfig({
|
|
1518
1495
|
displayName: "PureTable__PaginatorContainer",
|
|
1519
|
-
componentId: "tovzjg-
|
|
1496
|
+
componentId: "tovzjg-3"
|
|
1520
1497
|
})(["position:relative;text-align:right;height:", "px;"], PAGINATOR_CONTAINER_HEIGHT);
|
|
1521
1498
|
PaginatorContainer.displayName = 'PaginatorContainer'; // allow for early return in case of empty tableBody while still following hook rules
|
|
1522
1499
|
|
|
@@ -1563,20 +1540,6 @@ var withEmptyTableMessage = function withEmptyTableMessage(Viz) {
|
|
|
1563
1540
|
return Wrapper;
|
|
1564
1541
|
};
|
|
1565
1542
|
|
|
1566
|
-
var useTableHead = function useTableHead(visibility, mode) {
|
|
1567
|
-
if (visibility === 'none') {
|
|
1568
|
-
return NonVisibleTableHead;
|
|
1569
|
-
} // @TODO
|
|
1570
|
-
// Stacking context conflicts with editModeCover; temporary fix
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
if (visibility === 'fixed' && mode === 'view') {
|
|
1574
|
-
return FixedTableHead;
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
return StyledTableHead;
|
|
1578
|
-
};
|
|
1579
|
-
|
|
1580
1543
|
var PureTable = function PureTable(props) {
|
|
1581
1544
|
var count = props.count,
|
|
1582
1545
|
width = props.width,
|
|
@@ -1592,16 +1555,7 @@ var PureTable = function PureTable(props) {
|
|
|
1592
1555
|
_a = props.paginatorParams,
|
|
1593
1556
|
isPaging = _a.isPaging,
|
|
1594
1557
|
paginatorProps = __rest(_a, ["isPaging"]),
|
|
1595
|
-
onCellClick = props.onCellClick
|
|
1596
|
-
onColumnFormatChange = props.onColumnFormatChange,
|
|
1597
|
-
columnFormat = props.columnFormat,
|
|
1598
|
-
mode = props.mode,
|
|
1599
|
-
headerVisibility = props.headerVisibility;
|
|
1600
|
-
|
|
1601
|
-
var _React$useState = React.useState(columnFormat),
|
|
1602
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1603
|
-
columns = _React$useState2[0],
|
|
1604
|
-
setColumns = _React$useState2[1];
|
|
1558
|
+
onCellClick = props.onCellClick;
|
|
1605
1559
|
|
|
1606
1560
|
var firstRenderCount = React.useRef(count);
|
|
1607
1561
|
React.useEffect(function () {
|
|
@@ -1612,11 +1566,7 @@ var PureTable = function PureTable(props) {
|
|
|
1612
1566
|
});
|
|
1613
1567
|
}
|
|
1614
1568
|
}, [count, paginatorProps]);
|
|
1615
|
-
var
|
|
1616
|
-
React.useEffect(function () {
|
|
1617
|
-
setColumns(columnFormat);
|
|
1618
|
-
}, [mode, stringifiedColumnFormat]);
|
|
1619
|
-
var TableHead = useTableHead(headerVisibility, mode);
|
|
1569
|
+
var TableHead = tableHeader.visibility === 'none' ? NonVisibleTableHead : Table_1.default.Head;
|
|
1620
1570
|
var debouncedDrilldown = debounce(function (e, payload) {
|
|
1621
1571
|
if (window.getSelection().toString() === '') {
|
|
1622
1572
|
if (lodash_1.isFunction(onCellClick)) {
|
|
@@ -1668,47 +1618,6 @@ var PureTable = function PureTable(props) {
|
|
|
1668
1618
|
debouncedDrilldown(e.nativeEvent, payload);
|
|
1669
1619
|
}
|
|
1670
1620
|
}, [onCellClick, showRowNumbers, tableHeader, tableBody]);
|
|
1671
|
-
var debouncedOnColumnFormatChange = React.useMemo(function () {
|
|
1672
|
-
return debounce(function (newFormat) {
|
|
1673
|
-
onColumnFormatChange(newFormat);
|
|
1674
|
-
}, 300);
|
|
1675
|
-
}, [onColumnFormatChange]);
|
|
1676
|
-
|
|
1677
|
-
var sumColumnWidths = function sumColumnWidths(allColumns) {
|
|
1678
|
-
return Object.keys(allColumns).reduce(function (prev, key) {
|
|
1679
|
-
var _a, _b, _c;
|
|
1680
|
-
|
|
1681
|
-
if (((_a = allColumns[key]) === null || _a === void 0 ? void 0 : _a.width) === 'auto' || ((_b = allColumns[key]) === null || _b === void 0 ? void 0 : _b.width) === undefined) {
|
|
1682
|
-
return prev + MINIMUM_COLUMN_SIZE; // Columns with no width defined are automatically size 30
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
return prev + ((_c = allColumns[key]) === null || _c === void 0 ? void 0 : _c.width);
|
|
1686
|
-
}, 0) + // Add all remaining columns that do not have a columnFormat
|
|
1687
|
-
(tableHeader.cells.length - Object.keys(allColumns).length) * MINIMUM_COLUMN_SIZE;
|
|
1688
|
-
};
|
|
1689
|
-
|
|
1690
|
-
var handleResizeColumn = React.useCallback(function (_event, payload) {
|
|
1691
|
-
var updatedCF = lodash_1.cloneDeep(columns);
|
|
1692
|
-
var field = payload.columnId.split('-')[1];
|
|
1693
|
-
updatedCF[field] = Object.assign(Object.assign({}, updatedCF[field]), {
|
|
1694
|
-
width: Math.max(payload.width, MINIMUM_COLUMN_SIZE)
|
|
1695
|
-
}); // Prevent the user from expanding the columns too far
|
|
1696
|
-
|
|
1697
|
-
if (sumColumnWidths(updatedCF) > width) {
|
|
1698
|
-
return;
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1701
|
-
setColumns(updatedCF); // Updates column json in edit mode
|
|
1702
|
-
|
|
1703
|
-
if (mode === 'edit') {
|
|
1704
|
-
debouncedOnColumnFormatChange(updatedCF);
|
|
1705
|
-
}
|
|
1706
|
-
}, [mode, columns, width, debouncedOnColumnFormatChange]);
|
|
1707
|
-
|
|
1708
|
-
var handleEventClick = function handleEventClick(e) {
|
|
1709
|
-
e.stopPropagation();
|
|
1710
|
-
};
|
|
1711
|
-
|
|
1712
1621
|
return React.createElement(VizTableContainer, {
|
|
1713
1622
|
backgroundColor: backgroundColor
|
|
1714
1623
|
}, React.createElement(SUITableContainer, {
|
|
@@ -1717,7 +1626,7 @@ var PureTable = function PureTable(props) {
|
|
|
1717
1626
|
isPaging: isPaging,
|
|
1718
1627
|
headerStyle: tableHeader.style
|
|
1719
1628
|
}, React.createElement(Table_1.default, {
|
|
1720
|
-
headType: tableHeader.visibility !== 'none' ?
|
|
1629
|
+
headType: tableHeader.visibility !== 'none' ? tableHeader.visibility : undefined,
|
|
1721
1630
|
innerStyle: {
|
|
1722
1631
|
height: '100%'
|
|
1723
1632
|
},
|
|
@@ -1725,12 +1634,8 @@ var PureTable = function PureTable(props) {
|
|
|
1725
1634
|
height: '100%',
|
|
1726
1635
|
cursor: onCellClick ? 'pointer' : 'unset'
|
|
1727
1636
|
},
|
|
1728
|
-
onClick: onCellClick ? drilldownHandler : lodash_1.noop
|
|
1729
|
-
onRequestResizeColumn: handleResizeColumn,
|
|
1730
|
-
resizableFillLayout: true
|
|
1637
|
+
onClick: onCellClick ? drilldownHandler : lodash_1.noop
|
|
1731
1638
|
}, React.createElement(TableHead, null, tableHeader.cells.map(function (_a) {
|
|
1732
|
-
var _b;
|
|
1733
|
-
|
|
1734
1639
|
var key = _a.key,
|
|
1735
1640
|
value = _a.value,
|
|
1736
1641
|
sortKey = _a.sortKey,
|
|
@@ -1738,10 +1643,7 @@ var PureTable = function PureTable(props) {
|
|
|
1738
1643
|
|
|
1739
1644
|
return React.createElement(Table_1.default.HeadCell, Object.assign({
|
|
1740
1645
|
key: key,
|
|
1741
|
-
|
|
1742
|
-
sortDir: sortKey === currentSortKey ? currentSortDir : 'none',
|
|
1743
|
-
width: ((_b = columns[value]) === null || _b === void 0 ? void 0 : _b.width) || 'auto',
|
|
1744
|
-
onMouseDown: handleEventClick
|
|
1646
|
+
sortDir: sortKey === currentSortKey ? currentSortDir : 'none'
|
|
1745
1647
|
}, Object.assign({
|
|
1746
1648
|
sortKey: sortKey,
|
|
1747
1649
|
onSort: onSort
|
|
@@ -1750,23 +1652,18 @@ var PureTable = function PureTable(props) {
|
|
|
1750
1652
|
return React.createElement(Table_1.default.Row, {
|
|
1751
1653
|
key: row.key
|
|
1752
1654
|
}, row.cells.map(function (cell) {
|
|
1753
|
-
var _a, _b, _c;
|
|
1754
|
-
|
|
1755
1655
|
return React.createElement(cells_1.SwitchTableCell, {
|
|
1756
1656
|
key: cell.key,
|
|
1757
1657
|
type: cell.cellType
|
|
1758
1658
|
}, React.createElement(cells_1.TextCell, {
|
|
1759
1659
|
cell: cell,
|
|
1760
|
-
useMouseOverEffect: !!onCellClick
|
|
1761
|
-
width: ((_a = columns[cell.header]) === null || _a === void 0 ? void 0 : _a.width) || 'auto'
|
|
1660
|
+
useMouseOverEffect: !!onCellClick
|
|
1762
1661
|
}), React.createElement(cells_1.SparklineCell, {
|
|
1763
1662
|
cell: cell,
|
|
1764
|
-
useMouseOverEffect: !!onCellClick
|
|
1765
|
-
width: ((_b = columns[cell.header]) === null || _b === void 0 ? void 0 : _b.width) || 'auto'
|
|
1663
|
+
useMouseOverEffect: !!onCellClick
|
|
1766
1664
|
}), React.createElement(cells_1.ArrayCell, {
|
|
1767
1665
|
cell: cell,
|
|
1768
|
-
useMouseOverEffect: !!onCellClick
|
|
1769
|
-
width: ((_c = columns[cell.header]) === null || _c === void 0 ? void 0 : _c.width) || 'auto'
|
|
1666
|
+
useMouseOverEffect: !!onCellClick
|
|
1770
1667
|
}));
|
|
1771
1668
|
}));
|
|
1772
1669
|
})))), isPaging ? React.createElement(PaginatorContainer, null, React.createElement(Paginator_1.default, Object.assign({}, paginatorProps))) : null);
|
|
@@ -1808,8 +1705,7 @@ PureTable.propTypes = {
|
|
|
1808
1705
|
sparklineTypes: T.arrayOf(T.arrayOf(T.oneOf(consts_1.validSparklineTypes)))
|
|
1809
1706
|
}),
|
|
1810
1707
|
theme: T.any,
|
|
1811
|
-
width: T.oneOfType([T.number])
|
|
1812
|
-
onColumnFormatChange: T.func
|
|
1708
|
+
width: T.oneOfType([T.number])
|
|
1813
1709
|
};
|
|
1814
1710
|
PureTable.defaultProps = {
|
|
1815
1711
|
columnFormat: {},
|
|
@@ -1829,8 +1725,7 @@ PureTable.defaultProps = {
|
|
|
1829
1725
|
table: [],
|
|
1830
1726
|
tableFormat: {},
|
|
1831
1727
|
theme: {},
|
|
1832
|
-
width: 300
|
|
1833
|
-
onColumnFormatChange: lodash_1.noop
|
|
1728
|
+
width: 300
|
|
1834
1729
|
};
|
|
1835
1730
|
PureTable.displayName = 'VizTable';
|
|
1836
1731
|
exports.default = withEmptyTableMessage(FixedSizeContainer_1.default(PureTable));
|
|
@@ -1899,6 +1794,8 @@ var lodash_1 = __webpack_require__(2);
|
|
|
1899
1794
|
|
|
1900
1795
|
var colorUtils_1 = __webpack_require__(11);
|
|
1901
1796
|
|
|
1797
|
+
var style_1 = __webpack_require__(13);
|
|
1798
|
+
|
|
1902
1799
|
var consts_1 = __webpack_require__(105);
|
|
1903
1800
|
|
|
1904
1801
|
var isArray = function isArray(v) {
|
|
@@ -1906,7 +1803,8 @@ var isArray = function isArray(v) {
|
|
|
1906
1803
|
};
|
|
1907
1804
|
|
|
1908
1805
|
var getOverflowStyles = function getOverflowStyles(_ref) {
|
|
1909
|
-
var textOverflow = _ref.textOverflow
|
|
1806
|
+
var textOverflow = _ref.textOverflow,
|
|
1807
|
+
variables = _ref.variables;
|
|
1910
1808
|
var styles = {
|
|
1911
1809
|
anywhere: {
|
|
1912
1810
|
wordBreak: 'break-all'
|
|
@@ -1917,6 +1815,7 @@ var getOverflowStyles = function getOverflowStyles(_ref) {
|
|
|
1917
1815
|
overflowWrap: 'break-word'
|
|
1918
1816
|
},
|
|
1919
1817
|
ellipsis: {
|
|
1818
|
+
maxWidth: style_1.toPx(variables && variables.width || 100),
|
|
1920
1819
|
whiteSpace: 'nowrap',
|
|
1921
1820
|
overflow: 'hidden',
|
|
1922
1821
|
textOverflow: 'ellipsis'
|
|
@@ -1950,8 +1849,12 @@ var generateHeader = function generateHeader(value, i, columnFormat) {
|
|
|
1950
1849
|
if (lodash_1.isNumber(columnWidth)) {
|
|
1951
1850
|
var textOverflowType = exports.getTextOverflowType({}, value, 'ellipsis');
|
|
1952
1851
|
var textOverflowStyle = exports.getOverflowStyles({
|
|
1953
|
-
textOverflow: textOverflowType
|
|
1852
|
+
textOverflow: textOverflowType,
|
|
1853
|
+
variables: {
|
|
1854
|
+
width: columnWidth
|
|
1855
|
+
}
|
|
1954
1856
|
});
|
|
1857
|
+
ret.width = columnWidth;
|
|
1955
1858
|
ret.truncate = true;
|
|
1956
1859
|
ret.style = textOverflowStyle;
|
|
1957
1860
|
}
|
|
@@ -2233,8 +2136,6 @@ var useTable = function useTable() {
|
|
|
2233
2136
|
cells: []
|
|
2234
2137
|
};
|
|
2235
2138
|
table.forEach(function (column, i) {
|
|
2236
|
-
var _a;
|
|
2237
|
-
|
|
2238
2139
|
var currentHeader = tableHeader.cells[i];
|
|
2239
2140
|
var value = validValueSelector(getColumnFormatData(columnFormat, currentHeader, currentRow), getTableFormatData(tableFormat, i, currentRow), column[currentRow], '');
|
|
2240
2141
|
var rawValue = column[currentRow];
|
|
@@ -2248,12 +2149,17 @@ var useTable = function useTable() {
|
|
|
2248
2149
|
var key = generateKey(value, "".concat(currentRow, "-").concat(i));
|
|
2249
2150
|
var additionalStyles = {};
|
|
2250
2151
|
|
|
2251
|
-
if (lodash_1.isNumber(
|
|
2152
|
+
if (lodash_1.isNumber(currentHeader.width)) {
|
|
2252
2153
|
var textOverflowType = exports.getTextOverflowType(columnFormat, currentHeader.value, 'ellipsis');
|
|
2253
2154
|
var textOverflowStyle = exports.getOverflowStyles({
|
|
2254
|
-
textOverflow: textOverflowType
|
|
2155
|
+
textOverflow: textOverflowType,
|
|
2156
|
+
variables: {
|
|
2157
|
+
width: currentHeader.width
|
|
2158
|
+
}
|
|
2159
|
+
});
|
|
2160
|
+
additionalStyles = Object.assign(Object.assign(Object.assign({}, additionalStyles), textOverflowStyle), {
|
|
2161
|
+
width: style_1.toPx(currentHeader.width)
|
|
2255
2162
|
});
|
|
2256
|
-
additionalStyles = Object.assign(Object.assign({}, additionalStyles), textOverflowStyle);
|
|
2257
2163
|
}
|
|
2258
2164
|
|
|
2259
2165
|
row.cells.push({
|
|
@@ -2267,7 +2173,6 @@ var useTable = function useTable() {
|
|
|
2267
2173
|
sparklineColor: sparklineColor,
|
|
2268
2174
|
sparklineAreaColor: sparklineAreaColor,
|
|
2269
2175
|
sparklineType: sparklineType,
|
|
2270
|
-
header: currentHeader.value,
|
|
2271
2176
|
style: Object.assign({
|
|
2272
2177
|
backgroundColor: rowBackgroundColor,
|
|
2273
2178
|
color: rowColor
|
|
@@ -2370,12 +2275,9 @@ var Table_1 = __webpack_require__(82);
|
|
|
2370
2275
|
|
|
2371
2276
|
var TextCell = function TextCell(_ref) {
|
|
2372
2277
|
var cell = _ref.cell,
|
|
2373
|
-
useMouseOverEffect = _ref.useMouseOverEffect
|
|
2374
|
-
width = _ref.width;
|
|
2278
|
+
useMouseOverEffect = _ref.useMouseOverEffect;
|
|
2375
2279
|
return React.createElement(Table_1.default.Cell, {
|
|
2376
|
-
style:
|
|
2377
|
-
width: width
|
|
2378
|
-
}),
|
|
2280
|
+
style: cell.style,
|
|
2379
2281
|
align: cell.align,
|
|
2380
2282
|
"data-test-cell-type": "TextCell",
|
|
2381
2283
|
"data-row-index": cell.rowIndex,
|
|
@@ -2406,13 +2308,10 @@ var Table_1 = __webpack_require__(82);
|
|
|
2406
2308
|
|
|
2407
2309
|
var ArrayCell = function ArrayCell(_ref) {
|
|
2408
2310
|
var cell = _ref.cell,
|
|
2409
|
-
useMouseOverEffect = _ref.useMouseOverEffect
|
|
2410
|
-
width = _ref.width;
|
|
2311
|
+
useMouseOverEffect = _ref.useMouseOverEffect;
|
|
2411
2312
|
var value = Array.isArray(cell.value) ? cell.value : [cell.value];
|
|
2412
2313
|
return React.createElement(Table_1.default.Cell, {
|
|
2413
|
-
style:
|
|
2414
|
-
width: width
|
|
2415
|
-
}),
|
|
2314
|
+
style: cell.style,
|
|
2416
2315
|
align: cell.align,
|
|
2417
2316
|
"data-test-cell-type": "ArrayCell",
|
|
2418
2317
|
onClick: useMouseOverEffect ? function () {} : undefined
|
|
@@ -2437,7 +2336,7 @@ exports.ArrayCell.displayName = 'ArrayCell';
|
|
|
2437
2336
|
"use strict";
|
|
2438
2337
|
|
|
2439
2338
|
|
|
2440
|
-
var _slicedToArray = __webpack_require__(
|
|
2339
|
+
var _slicedToArray = __webpack_require__(49);
|
|
2441
2340
|
|
|
2442
2341
|
Object.defineProperty(exports, "__esModule", {
|
|
2443
2342
|
value: true
|
|
@@ -2466,8 +2365,7 @@ exports.validSparklineTypes = ['line', 'area'];
|
|
|
2466
2365
|
|
|
2467
2366
|
var SparklineCell = function SparklineCell(_ref) {
|
|
2468
2367
|
var cell = _ref.cell,
|
|
2469
|
-
useMouseOverEffect = _ref.useMouseOverEffect
|
|
2470
|
-
width = _ref.width;
|
|
2368
|
+
useMouseOverEffect = _ref.useMouseOverEffect;
|
|
2471
2369
|
|
|
2472
2370
|
var _React$useState = React.useState(React.createRef()),
|
|
2473
2371
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -2489,7 +2387,7 @@ var SparklineCell = function SparklineCell(_ref) {
|
|
|
2489
2387
|
style: Object.assign(Object.assign({}, cell.style), {
|
|
2490
2388
|
padding: 0,
|
|
2491
2389
|
margin: 0,
|
|
2492
|
-
width:
|
|
2390
|
+
width: "".concat(cellRef.offsetWidth, "px"),
|
|
2493
2391
|
height: "".concat(height, "px")
|
|
2494
2392
|
}),
|
|
2495
2393
|
align: cell.align,
|
|
@@ -3170,7 +3068,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
3170
3068
|
componentId: "sc-1gsbnxb-0"
|
|
3171
3069
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
3172
3070
|
var Blocker = styled_components_1.default.div.attrs({
|
|
3173
|
-
'data-splunk-visualization-version': "24.3.
|
|
3071
|
+
'data-splunk-visualization-version': "24.3.1 - da5652d2c"
|
|
3174
3072
|
}).withConfig({
|
|
3175
3073
|
displayName: "withEditModeCover__Blocker",
|
|
3176
3074
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -3290,7 +3188,7 @@ module.exports = require("@splunk/visualization-icons");
|
|
|
3290
3188
|
|
|
3291
3189
|
/***/ }),
|
|
3292
3190
|
|
|
3293
|
-
/***/
|
|
3191
|
+
/***/ 49:
|
|
3294
3192
|
/***/ (function(module, exports) {
|
|
3295
3193
|
|
|
3296
3194
|
module.exports = require("@babel/runtime/helpers/slicedToArray");
|