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