@canvas-components/list-table 0.3.16 → 0.3.17
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/dist/index.cjs +21 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -14
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -666,15 +666,19 @@ function stretchColumnWidths(columns, containerWidth) {
|
|
|
666
666
|
}
|
|
667
667
|
const extra = containerWidth - totalWidth;
|
|
668
668
|
const stretchableWidth = computeColumnWidths(stretchableColumns);
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
669
|
+
let accumulatedWidth = 0;
|
|
670
|
+
let allocatedExtra = 0;
|
|
671
|
+
stretchableColumns.forEach((column, index) => {
|
|
672
|
+
accumulatedWidth += column.width;
|
|
673
|
+
const targetExtra = index === stretchableColumns.length - 1 ? extra : Math.min(
|
|
674
|
+
extra,
|
|
675
|
+
Math.floor(
|
|
676
|
+
extra * (stretchableWidth > 0 ? accumulatedWidth / stretchableWidth : (index + 1) / stretchableColumns.length)
|
|
677
|
+
)
|
|
678
|
+
);
|
|
679
|
+
column.width += targetExtra - allocatedExtra;
|
|
680
|
+
allocatedExtra = targetExtra;
|
|
681
|
+
});
|
|
678
682
|
}
|
|
679
683
|
function shrinkColumnWidthsToFit(columns, containerWidth) {
|
|
680
684
|
let remaining = Math.max(
|
|
@@ -30507,9 +30511,10 @@ var ListTableRenderController = class {
|
|
|
30507
30511
|
const availableHeight = this.options.getContainerClientHeight() > 0 ? this.options.getContainerClientHeight() : hostSize.height;
|
|
30508
30512
|
const zoom = this.resolveZoom();
|
|
30509
30513
|
const layoutWidth = hostSize.width / zoom;
|
|
30510
|
-
const
|
|
30511
|
-
|
|
30512
|
-
|
|
30514
|
+
const measureSnapshot = this.buildSnapshot(
|
|
30515
|
+
layoutWidth,
|
|
30516
|
+
hostSize.height / zoom
|
|
30517
|
+
);
|
|
30513
30518
|
if (!measureSnapshot) {
|
|
30514
30519
|
this.options.setFittedHeight(null);
|
|
30515
30520
|
return;
|
|
@@ -30528,10 +30533,13 @@ var ListTableRenderController = class {
|
|
|
30528
30533
|
summaryHeight: measureSnapshot.bodyLayout.summaryHeight
|
|
30529
30534
|
});
|
|
30530
30535
|
const paginationElement = this.options.getPaginationElement();
|
|
30536
|
+
const scrollbar = this.options.getOptions().scrollbar;
|
|
30537
|
+
const horizontal = utils.resolveCanvasScrollbarAxis(scrollbar, "horizontal");
|
|
30538
|
+
const horizontalReserve = horizontal.visible && measureSnapshot.columnMetrics.centerContentWidth - measureSnapshot.columnMetrics.availableCenterWidth > 1 ? horizontal.thickness + Math.max(scrollbar?.horizontalBottom ?? 0, 0) : 0;
|
|
30531
30539
|
const paginationHeight = paginationElement && paginationElement.style.display !== "none" ? paginationElement.offsetHeight : 0;
|
|
30532
30540
|
const fittedHeight = resolveFittedTableHeight({
|
|
30533
30541
|
availableHeight,
|
|
30534
|
-
contentHeight: contentHeight * zoom + paginationHeight
|
|
30542
|
+
contentHeight: (contentHeight + horizontalReserve) * zoom + paginationHeight
|
|
30535
30543
|
});
|
|
30536
30544
|
this.options.setFittedHeight(
|
|
30537
30545
|
fittedHeight == null ? null : fittedHeight + TABLE_CONTENT_BORDER_SIZE
|