@canvas-components/list-table 0.3.8 → 0.3.9

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.js CHANGED
@@ -20498,6 +20498,10 @@ function buildListTableRenderSnapshot(params) {
20498
20498
  if (leafColumns.length === 0) {
20499
20499
  return null;
20500
20500
  }
20501
+ const columnMetrics = resolveColumnMetrics({
20502
+ columns: leafColumns,
20503
+ tableWidth: width
20504
+ });
20501
20505
  const headerInfo = buildHeaderTree(normalizedColumns, leafColumns);
20502
20506
  const sourceQueryRows = {
20503
20507
  baseRows: baseRowsOverride ?? getBaseDisplayRows({
@@ -20539,8 +20543,11 @@ function buildListTableRenderSnapshot(params) {
20539
20543
  (col) => col.summary != null || col.summaryTitle != null
20540
20544
  );
20541
20545
  const hasSummary = queryRows.displayRows.length > 0 && options.summaryRowHeight !== 0 && (options.summaryRowHeight != null || hasConfiguredSummary);
20546
+ const hasHorizontalScrollbar = options.scrollbar?.visible !== false && columnMetrics.centerContentWidth - columnMetrics.availableCenterWidth > 1;
20547
+ const horizontalScrollbarReserve = hasSummary && hasHorizontalScrollbar ? scrollbarThickness + Math.max(options.scrollbar?.horizontalBottom ?? 0, 0) : 0;
20548
+ const contentHeight = Math.max(height - horizontalScrollbarReserve, 0);
20542
20549
  const initialBodyLayout = resolveBodyLayout({
20543
- height,
20550
+ height: contentHeight,
20544
20551
  headerHeight,
20545
20552
  summaryRowHeight,
20546
20553
  hasSummary,
@@ -20670,7 +20677,7 @@ function buildListTableRenderSnapshot(params) {
20670
20677
  }
20671
20678
  },
20672
20679
  bodyLayout: resolveBodyLayout({
20673
- height,
20680
+ height: contentHeight,
20674
20681
  headerHeight,
20675
20682
  summaryRowHeight,
20676
20683
  hasSummary,
@@ -20692,7 +20699,7 @@ function buildListTableRenderSnapshot(params) {
20692
20699
  visibleRows: filteredVisibleRows,
20693
20700
  frozenState: frozenRows,
20694
20701
  getRowKey: (row) => row.kind === "data" ? row.rowKey : null,
20695
- height,
20702
+ height: contentHeight,
20696
20703
  headerHeight,
20697
20704
  summaryRowHeight,
20698
20705
  hasSummary,
@@ -20705,7 +20712,7 @@ function buildListTableRenderSnapshot(params) {
20705
20712
  bodyState.frozenRows.scroll.rowIndexMap = plainRowWindow.rowIndexMap;
20706
20713
  bodyState.frozenRows.scroll.rowOffsetMap = plainRowWindow.rowOffsetMap;
20707
20714
  bodyState.bodyLayout = resolveBodyLayout({
20708
- height,
20715
+ height: contentHeight,
20709
20716
  headerHeight,
20710
20717
  summaryRowHeight,
20711
20718
  hasSummary,
@@ -20729,7 +20736,7 @@ function buildListTableRenderSnapshot(params) {
20729
20736
  bodyState.frozenRows.scroll.rowIndexMap = plainRowWindow.rowIndexMap;
20730
20737
  bodyState.frozenRows.scroll.rowOffsetMap = plainRowWindow.rowOffsetMap;
20731
20738
  bodyState.bodyLayout = resolveBodyLayout({
20732
- height,
20739
+ height: contentHeight,
20733
20740
  headerHeight,
20734
20741
  summaryRowHeight,
20735
20742
  hasSummary,
@@ -20740,10 +20747,6 @@ function buildListTableRenderSnapshot(params) {
20740
20747
  scrollRowCount: plainRowWindow.totalRowCount
20741
20748
  });
20742
20749
  }
20743
- let columnMetrics = resolveColumnMetrics({
20744
- columns: leafColumns,
20745
- tableWidth: width
20746
- });
20747
20750
  let viewportResult = computeViewport({
20748
20751
  width,
20749
20752
  height,