@synerise/ds-table 0.49.7 → 0.50.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/CHANGELOG.md +27 -0
- package/dist/Cell/AvatarLabel/AvatarLabel.styles.js +4 -2
- package/dist/VirtualTable/VirtualTable.js +52 -56
- package/dist/VirtualTable/VirtualTable.styles.js +4 -19
- package/dist/index.d.ts +1 -1
- package/dist/utils/calculateColumnWidths.d.ts +2 -0
- package/dist/utils/calculateColumnWidths.js +43 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.50.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.49.8...@synerise/ds-table@0.50.0) (2024-05-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **table:** avatar label cell styles ([9613e00](https://github.com/synerise/synerise-design/commit/9613e008950ebd402e754ea6157dd155d681f5eb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **table:** virtual table - responsive columns ([a43786e](https://github.com/synerise/synerise-design/commit/a43786e3dc0acbda31eae62efb0cc6e5f838d344))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.49.8](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.49.7...@synerise/ds-table@0.49.8) (2024-04-29)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **table:** fixes table height in infinite scrolling mode ([58f9f96](https://github.com/synerise/synerise-design/commit/58f9f96c5dd22f5ebec47477da0bd05ca62d818b))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [0.49.7](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.49.6...@synerise/ds-table@0.49.7) (2024-04-26)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @synerise/ds-table
|
|
@@ -15,7 +15,7 @@ export var Avatar = styled.div.withConfig({
|
|
|
15
15
|
export var Description = styled.div.withConfig({
|
|
16
16
|
displayName: "AvatarLabelstyles__Description",
|
|
17
17
|
componentId: "sc-1485c9p-2"
|
|
18
|
-
})(["display:flex;min-width:0;flex-direction:column;align-items:flex-start;justify-content:center;
|
|
18
|
+
})(["display:flex;min-width:0;flex-direction:column;align-items:flex-start;justify-content:center;"]);
|
|
19
19
|
export var AvatarLink = styled.a.withConfig({
|
|
20
20
|
displayName: "AvatarLabelstyles__AvatarLink",
|
|
21
21
|
componentId: "sc-1485c9p-3"
|
|
@@ -31,10 +31,12 @@ export var Title = styled(Text).withConfig({
|
|
|
31
31
|
export var Labels = styled.span.withConfig({
|
|
32
32
|
displayName: "AvatarLabelstyles__Labels",
|
|
33
33
|
componentId: "sc-1485c9p-5"
|
|
34
|
-
})(["font-size:13px;line-height:1.38;font-weight:400;color:", ";", ";"], function (props) {
|
|
34
|
+
})(["font-size:13px;line-height:1.38;font-weight:400;color:", ";", ";color:", ";"], function (props) {
|
|
35
35
|
return props.theme.palette['grey-700'];
|
|
36
36
|
}, function (props) {
|
|
37
37
|
return props.ellipsis && css(["text-overflow:ellipsis;overflow:hidden;max-width:", ";"], props.maxWidth ? props.maxWidth + "px" : '100%');
|
|
38
|
+
}, function (props) {
|
|
39
|
+
return props.theme.palette['grey-700'];
|
|
38
40
|
});
|
|
39
41
|
export var Label = styled.span.withConfig({
|
|
40
42
|
displayName: "AvatarLabelstyles__Label",
|
|
@@ -21,7 +21,7 @@ import OuterListElement from '../InfiniteScroll/OuterListElement';
|
|
|
21
21
|
import DSTable from '../Table';
|
|
22
22
|
import VirtualTableRow, { INFINITE_LOADED_ITEM_HEIGHT } from './VirtualTableRow';
|
|
23
23
|
import * as S from './VirtualTable.styles';
|
|
24
|
-
import { useTableLocale,
|
|
24
|
+
import { useTableLocale, calculateColumnWidths } from '../utils';
|
|
25
25
|
import { useRowKey } from '../hooks/useRowKey';
|
|
26
26
|
import { useRowStar } from '../hooks/useRowStar';
|
|
27
27
|
import { RowSelectionColumn } from '../RowSelection';
|
|
@@ -31,7 +31,7 @@ var relativeInlineStyle = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
34
|
-
var _infiniteScroll$prevP2;
|
|
34
|
+
var _infiniteScroll$prevP2, _infiniteScroll$prevP4;
|
|
35
35
|
|
|
36
36
|
var _props$columns = props.columns,
|
|
37
37
|
columns = _props$columns === void 0 ? [] : _props$columns,
|
|
@@ -239,61 +239,46 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
239
239
|
}, !!rowStar && rowStarColumn].concat(columns));
|
|
240
240
|
}, [selection, renderRowSelection, rowStar, rowStarColumn, columns]);
|
|
241
241
|
var mergedColumns = useMemo(function () {
|
|
242
|
-
var
|
|
243
|
-
var width = _ref4.width;
|
|
244
|
-
return !width;
|
|
245
|
-
}).length;
|
|
246
|
-
var definedWidth = virtualColumns.reduce(function (total, _ref5) {
|
|
247
|
-
var width = _ref5.width;
|
|
248
|
-
var widthInPx = calculatePixels(width) || 0;
|
|
249
|
-
return total + widthInPx;
|
|
250
|
-
}, 0);
|
|
251
|
-
var columnsWithWidth = virtualColumns == null ? void 0 : virtualColumns.map(function (column) {
|
|
252
|
-
if (column.width) {
|
|
253
|
-
return _objectSpread({}, column, {
|
|
254
|
-
width: calculatePixels(column.width)
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
var calculatedWidth = Math.floor((tableWidth - definedWidth) / widthColumnCount);
|
|
259
|
-
return _objectSpread({}, column, {
|
|
260
|
-
width: calculatedWidth > 0 ? calculatedWidth : 1
|
|
261
|
-
});
|
|
262
|
-
});
|
|
242
|
+
var columnWidths = calculateColumnWidths(virtualColumns, tableWidth);
|
|
263
243
|
var cumulativeRightOffset = 0;
|
|
264
244
|
var cumulativeLeftOffset = 0;
|
|
245
|
+
var firstFixedRightFound = false;
|
|
265
246
|
|
|
266
|
-
var
|
|
247
|
+
var _virtualColumns$reduc = virtualColumns.reduce(function (prev, column, index) {
|
|
267
248
|
var left = cumulativeLeftOffset;
|
|
268
249
|
var right = cumulativeRightOffset;
|
|
250
|
+
var width = columnWidths[index];
|
|
269
251
|
|
|
270
252
|
if (column.fixed === 'right') {
|
|
271
|
-
|
|
272
|
-
|
|
253
|
+
cumulativeRightOffset += width;
|
|
254
|
+
var fixedFirst = !firstFixedRightFound;
|
|
255
|
+
|
|
256
|
+
if (!firstFixedRightFound) {
|
|
257
|
+
firstFixedRightFound = true;
|
|
273
258
|
}
|
|
274
259
|
|
|
275
260
|
return _objectSpread({}, prev, {
|
|
276
261
|
fixedRight: [].concat(prev.fixedRight, [_objectSpread({}, column, {
|
|
277
|
-
fixedFirst:
|
|
278
|
-
right: right
|
|
262
|
+
fixedFirst: fixedFirst,
|
|
263
|
+
right: right,
|
|
264
|
+
width: width
|
|
279
265
|
})])
|
|
280
266
|
});
|
|
281
267
|
}
|
|
282
268
|
|
|
283
269
|
if (column.fixed === 'left') {
|
|
284
|
-
|
|
285
|
-
cumulativeLeftOffset += column.width;
|
|
286
|
-
}
|
|
287
|
-
|
|
270
|
+
cumulativeLeftOffset += width;
|
|
288
271
|
var prevFixedLeft = prev.fixedLeft;
|
|
289
272
|
var newFixedLeft = prevFixedLeft.length ? [].concat(prevFixedLeft, [_objectSpread({}, prevFixedLeft.pop(), {
|
|
290
273
|
fixedFirst: false
|
|
291
274
|
}), _objectSpread({}, column, {
|
|
292
275
|
fixedFirst: true,
|
|
293
|
-
left: left
|
|
276
|
+
left: left,
|
|
277
|
+
width: width
|
|
294
278
|
})]) : [].concat(prevFixedLeft, [_objectSpread({}, column, {
|
|
295
279
|
fixedFirst: true,
|
|
296
|
-
left: left
|
|
280
|
+
left: left,
|
|
281
|
+
width: width
|
|
297
282
|
})]);
|
|
298
283
|
return _objectSpread({}, prev, {
|
|
299
284
|
fixedLeft: newFixedLeft
|
|
@@ -301,27 +286,38 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
301
286
|
}
|
|
302
287
|
|
|
303
288
|
return _objectSpread({}, prev, {
|
|
304
|
-
remaining: [].concat(prev.remaining, [column
|
|
289
|
+
remaining: [].concat(prev.remaining, [_objectSpread({}, column, {
|
|
290
|
+
width: width
|
|
291
|
+
})])
|
|
305
292
|
});
|
|
306
293
|
}, {
|
|
307
294
|
fixedLeft: [],
|
|
308
295
|
fixedRight: [],
|
|
309
296
|
remaining: []
|
|
310
297
|
}),
|
|
311
|
-
fixedLeft =
|
|
312
|
-
remaining =
|
|
313
|
-
fixedRight =
|
|
298
|
+
fixedLeft = _virtualColumns$reduc.fixedLeft,
|
|
299
|
+
remaining = _virtualColumns$reduc.remaining,
|
|
300
|
+
fixedRight = _virtualColumns$reduc.fixedRight;
|
|
314
301
|
|
|
315
302
|
return [].concat(fixedLeft, remaining, fixedRight);
|
|
316
|
-
}, [
|
|
317
|
-
var
|
|
318
|
-
var
|
|
319
|
-
|
|
303
|
+
}, [tableWidth, virtualColumns]);
|
|
304
|
+
var infiniteLoaderOffset = useMemo(function () {
|
|
305
|
+
var _infiniteScroll$prevP3;
|
|
306
|
+
|
|
307
|
+
if (isSticky && infiniteScroll != null && (_infiniteScroll$prevP3 = infiniteScroll.prevPage) != null && _infiniteScroll$prevP3.hasMore) {
|
|
308
|
+
return infiniteLoaderItemHeight * 2;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return infiniteLoaderItemHeight;
|
|
312
|
+
}, [isSticky, infiniteScroll == null || (_infiniteScroll$prevP4 = infiniteScroll.prevPage) == null ? void 0 : _infiniteScroll$prevP4.hasMore]);
|
|
313
|
+
var listInnerElementType = forwardRef(function (_ref4, innerElementRef) {
|
|
314
|
+
var style = _ref4.style,
|
|
315
|
+
rest = _objectWithoutPropertiesLoose(_ref4, _excluded);
|
|
320
316
|
|
|
321
317
|
return /*#__PURE__*/React.createElement(S.InnerListElement, _extends({
|
|
322
318
|
ref: innerElementRef,
|
|
323
319
|
style: _objectSpread({}, style, {
|
|
324
|
-
height: Number(style == null ? void 0 : style.height) +
|
|
320
|
+
height: Number(style == null ? void 0 : style.height) + infiniteLoaderOffset + "px"
|
|
325
321
|
})
|
|
326
322
|
}, rest));
|
|
327
323
|
});
|
|
@@ -349,7 +345,7 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
349
345
|
cellHeight: cellHeight,
|
|
350
346
|
defaultTableProps: defaultTableProps
|
|
351
347
|
};
|
|
352
|
-
}, [
|
|
348
|
+
}, [mergedColumns, selection, rowStar, onRowClick, infiniteScroll, cellHeight]);
|
|
353
349
|
var offsetScroll = sticky && sticky !== true ? sticky.offsetScroll : 0;
|
|
354
350
|
var connectObject = useMemo(function () {
|
|
355
351
|
var obj = {};
|
|
@@ -397,14 +393,14 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
397
393
|
}
|
|
398
394
|
|
|
399
395
|
var renderVirtualList = function renderVirtualList(data) {
|
|
400
|
-
var _infiniteScroll$nextP, _infiniteScroll$
|
|
396
|
+
var _infiniteScroll$nextP, _infiniteScroll$prevP5;
|
|
401
397
|
|
|
402
|
-
var listHeight = data.length * cellHeight - scroll.y +
|
|
398
|
+
var listHeight = data.length * cellHeight - scroll.y + infiniteLoaderOffset;
|
|
403
399
|
var listMaxScroll = stickyScrollThreshold && infiniteScroll != null && infiniteScroll.maxScroll ? (infiniteScroll == null ? void 0 : infiniteScroll.maxScroll) - stickyScrollThreshold : listHeight;
|
|
404
400
|
|
|
405
|
-
var handleListScroll = function handleListScroll(
|
|
406
|
-
var scrollOffset =
|
|
407
|
-
scrollDirection =
|
|
401
|
+
var handleListScroll = function handleListScroll(_ref5) {
|
|
402
|
+
var scrollOffset = _ref5.scrollOffset,
|
|
403
|
+
scrollDirection = _ref5.scrollDirection;
|
|
408
404
|
|
|
409
405
|
if (loading || listMaxScroll <= 0) {
|
|
410
406
|
return;
|
|
@@ -424,7 +420,7 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
424
420
|
var itemData = createItemData(data, defaultTableProps);
|
|
425
421
|
var scrollableHeight = isSticky ? scroll.y - HEADER_ROW_HEIGHT : scroll.y;
|
|
426
422
|
|
|
427
|
-
if (infiniteScroll != null && (_infiniteScroll$nextP = infiniteScroll.nextPage) != null && _infiniteScroll$nextP.hasMore && (_infiniteScroll$
|
|
423
|
+
if (infiniteScroll != null && (_infiniteScroll$nextP = infiniteScroll.nextPage) != null && _infiniteScroll$nextP.hasMore && (_infiniteScroll$prevP5 = infiniteScroll.prevPage) != null && _infiniteScroll$prevP5.hasMore) {
|
|
428
424
|
scrollableHeight += cellHeight;
|
|
429
425
|
}
|
|
430
426
|
|
|
@@ -464,7 +460,7 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
464
460
|
layout: "vertical",
|
|
465
461
|
itemCount: data.length,
|
|
466
462
|
itemSize: cellHeight,
|
|
467
|
-
width:
|
|
463
|
+
width: scrollWidth,
|
|
468
464
|
itemData: itemData,
|
|
469
465
|
itemKey: function itemKey(index) {
|
|
470
466
|
var key = getRowKey(data[index]); // @ts-ignore
|
|
@@ -498,7 +494,7 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
498
494
|
}
|
|
499
495
|
|
|
500
496
|
return renderVirtualList(rawData);
|
|
501
|
-
}, [connectObject, expandable == null ? void 0 : expandable.expandedRowKeys, cellHeight, scroll.y, isSticky, stickyScrollThreshold, infiniteScroll, createItemData, tableWidth, onItemsRendered, outerElement, listInnerElementType, loading, offsetScroll, getRowKey]);
|
|
497
|
+
}, [connectObject, expandable == null ? void 0 : expandable.expandedRowKeys, cellHeight, scroll.y, isSticky, stickyScrollThreshold, infiniteScroll, createItemData, tableWidth, scrollWidth, onItemsRendered, outerElement, listInnerElementType, loading, offsetScroll, getRowKey, infiniteLoaderOffset]);
|
|
502
498
|
var columnsSliceStartIndex = Number(!!selection) + Number(!!rowStar);
|
|
503
499
|
var scrollValue = !dataSource || (dataSource == null ? void 0 : dataSource.length) === 0 ? undefined : scroll;
|
|
504
500
|
var classNames = React.useMemo(function () {
|
|
@@ -509,9 +505,9 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
509
505
|
var finalColumns = mergedColumns.slice(columnsSliceStartIndex);
|
|
510
506
|
useEffect(function () {
|
|
511
507
|
// trigger body component onScroll to toggle .ant-table-ping-left / .ant-table-ping-right classes that indicate where columns overflow
|
|
512
|
-
if (customBodyOnScrollRef.current && outerListRef.current) {
|
|
508
|
+
if (customBodyOnScrollRef.current && outerListRef.current && outerListRef.current.parentElement) {
|
|
513
509
|
customBodyOnScrollRef.current({
|
|
514
|
-
currentTarget: outerListRef.current
|
|
510
|
+
currentTarget: outerListRef.current.parentElement
|
|
515
511
|
});
|
|
516
512
|
}
|
|
517
513
|
}, [tableWidth, scrollWidth]);
|
|
@@ -527,8 +523,8 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
527
523
|
key: "relative-container",
|
|
528
524
|
ref: containerRef
|
|
529
525
|
}, /*#__PURE__*/React.createElement(ResizeObserver, {
|
|
530
|
-
onResize: function onResize(
|
|
531
|
-
var offsetWidth =
|
|
526
|
+
onResize: function onResize(_ref6) {
|
|
527
|
+
var offsetWidth = _ref6.offsetWidth;
|
|
532
528
|
setTableWidth(offsetWidth);
|
|
533
529
|
}
|
|
534
530
|
}, /*#__PURE__*/React.createElement(DSTable, _extends({}, props, {
|
|
@@ -5,19 +5,7 @@ var numberToPixels = function numberToPixels(num) {
|
|
|
5
5
|
return num + "px";
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
if (props.maxWidth) {
|
|
10
|
-
return numberToPixels(props.maxWidth);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return props.width ? numberToPixels(props.width) : 'initial';
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
var getColumnMinWidth = function getColumnMinWidth(props) {
|
|
17
|
-
if (props.minWidth) {
|
|
18
|
-
return numberToPixels(props.minWidth);
|
|
19
|
-
}
|
|
20
|
-
|
|
8
|
+
var getColumnWidth = function getColumnWidth(props) {
|
|
21
9
|
return props.width ? numberToPixels(props.width) : 'initial';
|
|
22
10
|
};
|
|
23
11
|
|
|
@@ -56,16 +44,13 @@ export var StickyScrollbarContent = styled.div.withConfig({
|
|
|
56
44
|
export var ColWrapper = styled.div.withConfig({
|
|
57
45
|
displayName: "VirtualTablestyles__ColWrapper",
|
|
58
46
|
componentId: "aehkhc-6"
|
|
59
|
-
})(["display:table-cell;vertical-align:middle;", ";", ";
|
|
47
|
+
})(["display:table-cell;vertical-align:middle;", ";", ";", " padding:0 24px;&.virtual-table-cell.ant-table-selection-column{padding:0 8px 0 24px;}&.virtual-table-cell.ds-table-star-column{padding:0 8px 0 24px;& > button{display:flex;}}&.virtual-table-cell.ant-table-selection-column + .virtual-table-cell.ds-table-star-column{padding-left:0;}"], function (props) {
|
|
60
48
|
return props.left !== undefined && "left: " + numberToPixels(props.left);
|
|
61
49
|
}, function (props) {
|
|
62
50
|
return props.right !== undefined && "right: " + numberToPixels(props.right);
|
|
63
51
|
}, function (props) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return getColumnMinWidth(props);
|
|
67
|
-
}, function (props) {
|
|
68
|
-
return getColumnMaxWidth(props);
|
|
52
|
+
var width = getColumnWidth(props);
|
|
53
|
+
return css(["width:", ";min-width:", ";max-width:", ";"], width, width, width);
|
|
69
54
|
});
|
|
70
55
|
export var VirtualTableWrapper = styled.div.withConfig({
|
|
71
56
|
displayName: "VirtualTablestyles__VirtualTableWrapper",
|
package/dist/index.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export { default } from './Table';
|
|
|
7
7
|
export { GroupedTable, VirtualTable, TableCell, ItemsMenu, TreeTable };
|
|
8
8
|
export { default as BackToTopButton } from './InfiniteScroll/BackToTopButton';
|
|
9
9
|
export type { Props as VirtualTableProps, VirtualTableRef, VirtualColumnType } from './VirtualTable/VirtualTable.types';
|
|
10
|
-
export type { RowSelection, SingleColumnSort, OnSortFn, Locale } from './Table.types';
|
|
10
|
+
export type { RowSelection, RowType, SingleColumnSort, OnSortFn, Locale, DSColumnType, DSTableProps, ScrollProxyType, Selection, SelectionItem, CustomizeScrollBodyInfo, } from './Table.types';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { calculatePixels } from './calculatePixels';
|
|
2
|
+
export var calculateColumnWidths = function calculateColumnWidths(columns, availableSpace) {
|
|
3
|
+
var baseSum = 0;
|
|
4
|
+
var flexibleColumnCount = 0;
|
|
5
|
+
var noMaxColumnCount = 0;
|
|
6
|
+
var baseWidths = columns.map(function (column) {
|
|
7
|
+
var baseWidth = calculatePixels(column.width || column.minWidth) || 0;
|
|
8
|
+
flexibleColumnCount += Number(!column.width);
|
|
9
|
+
noMaxColumnCount += Number(!column.width && !column.maxWidth);
|
|
10
|
+
baseSum += baseWidth;
|
|
11
|
+
return baseWidth;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
if (!flexibleColumnCount) {
|
|
15
|
+
return baseWidths;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (baseSum < availableSpace) {
|
|
19
|
+
// split remaining space across columns with minWidth
|
|
20
|
+
var extraWidth = (availableSpace - baseSum) / flexibleColumnCount;
|
|
21
|
+
var interimSum = 0;
|
|
22
|
+
columns.forEach(function (column, index) {
|
|
23
|
+
if (!column.width) {
|
|
24
|
+
var maxWidthAsNumber = calculatePixels(column.maxWidth);
|
|
25
|
+
baseWidths[index] = maxWidthAsNumber !== undefined ? Math.min(maxWidthAsNumber, baseWidths[index] + extraWidth) : baseWidths[index] + extraWidth;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interimSum += baseWidths[index];
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (interimSum < availableSpace) {
|
|
32
|
+
// split the remainder across columns with no maxWidth
|
|
33
|
+
var extraWidth2 = (availableSpace - interimSum) / noMaxColumnCount;
|
|
34
|
+
columns.forEach(function (column, index) {
|
|
35
|
+
if (!column.width && !column.maxWidth) {
|
|
36
|
+
baseWidths[index] += extraWidth2;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return baseWidths;
|
|
43
|
+
};
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-table",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.0",
|
|
4
4
|
"description": "Table UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -34,29 +34,29 @@
|
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@synerise/ds-alert": "^0.8.10",
|
|
37
|
-
"@synerise/ds-badge": "^0.6.
|
|
37
|
+
"@synerise/ds-badge": "^0.6.57",
|
|
38
38
|
"@synerise/ds-button": "^0.19.7",
|
|
39
39
|
"@synerise/ds-button-group": "^0.6.47",
|
|
40
|
-
"@synerise/ds-checkbox": "^0.11.
|
|
41
|
-
"@synerise/ds-column-manager": "^0.11.
|
|
40
|
+
"@synerise/ds-checkbox": "^0.11.64",
|
|
41
|
+
"@synerise/ds-column-manager": "^0.11.49",
|
|
42
42
|
"@synerise/ds-data-format": "^0.4.8",
|
|
43
|
-
"@synerise/ds-dropdown": "^0.17.
|
|
43
|
+
"@synerise/ds-dropdown": "^0.17.107",
|
|
44
44
|
"@synerise/ds-flag": "^0.4.3",
|
|
45
45
|
"@synerise/ds-icon": "^0.60.7",
|
|
46
|
-
"@synerise/ds-input": "^0.
|
|
46
|
+
"@synerise/ds-input": "^0.21.0",
|
|
47
47
|
"@synerise/ds-loader": "^0.3.5",
|
|
48
48
|
"@synerise/ds-menu": "^0.18.20",
|
|
49
|
-
"@synerise/ds-modal": "^0.17.
|
|
49
|
+
"@synerise/ds-modal": "^0.17.26",
|
|
50
50
|
"@synerise/ds-pagination": "^0.7.47",
|
|
51
|
-
"@synerise/ds-result": "^0.6.
|
|
51
|
+
"@synerise/ds-result": "^0.6.52",
|
|
52
52
|
"@synerise/ds-scrollbar": "^0.10.2",
|
|
53
53
|
"@synerise/ds-search": "^0.8.88",
|
|
54
|
-
"@synerise/ds-select": "^0.15.
|
|
55
|
-
"@synerise/ds-skeleton": "^0.5.
|
|
56
|
-
"@synerise/ds-status": "^0.6.
|
|
57
|
-
"@synerise/ds-tags": "^0.8.
|
|
54
|
+
"@synerise/ds-select": "^0.15.48",
|
|
55
|
+
"@synerise/ds-skeleton": "^0.5.6",
|
|
56
|
+
"@synerise/ds-status": "^0.6.2",
|
|
57
|
+
"@synerise/ds-tags": "^0.8.41",
|
|
58
58
|
"@synerise/ds-tooltip": "^0.14.25",
|
|
59
|
-
"@synerise/ds-typography": "^0.
|
|
59
|
+
"@synerise/ds-typography": "^0.15.0",
|
|
60
60
|
"@synerise/ds-utils": "^0.26.3",
|
|
61
61
|
"@types/react-window": "^1.8.5",
|
|
62
62
|
"classnames": "2.3.2",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@testing-library/react": "10.0.1"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "700312e731dcbedacd206fd1d3389e5725c80d24"
|
|
83
83
|
}
|