@coldsmirk/ledger-mantine 0.10.0 → 0.10.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/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { ActionIcon, Box, Button, Center, Checkbox, CloseButton, EmptyState, Gro
6
6
  import clsx from "clsx";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  import { AutoScroller, Cursor, PointerActivationConstraints, PreventSelection } from "@dnd-kit/dom";
9
- import { memo, startTransition, useCallback, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
9
+ import { createElement, memo, startTransition, useCallback, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
10
10
  import { useDebouncedCallback, useUncontrolled } from "@mantine/hooks";
11
11
  import { aggregationFn_count, aggregationFn_extent, aggregationFn_first, aggregationFn_last, aggregationFn_max, aggregationFn_mean, aggregationFn_median, aggregationFn_min, aggregationFn_sum, aggregationFn_unique, aggregationFn_uniqueCount, cellSpanningFeature, columnFacetingFeature, columnFilteringFeature, columnGroupingFeature, columnOrderingFeature, columnPinningFeature, columnSizingFeature, columnVisibilityFeature, createColumnHelper as createColumnHelper$1, createExpandedRowModel, createFacetedMinMaxValues, createFacetedRowModel, createFacetedUniqueValues, createFilteredRowModel, createGroupedRowModel, createPaginatedRowModel, createSortedRowModel, filterFn_arrHas, filterFn_arrIncludes, filterFn_arrIncludesAll, filterFn_arrIncludesSome, filterFn_between, filterFn_betweenInclusive, filterFn_empty, filterFn_endsWith, filterFn_equals, filterFn_equalsString, filterFn_equalsStringSensitive, filterFn_greaterThan, filterFn_greaterThanOrEqualTo, filterFn_inDateRange, filterFn_inNumberRange, filterFn_includesString, filterFn_includesStringSensitive, filterFn_lessThan, filterFn_lessThanOrEqualTo, filterFn_notEmpty, filterFn_startsWith, filterFn_weakEquals, flexRender, flexRender as flexRender$1, functionalUpdate, globalFilteringFeature, rowAggregationFeature, rowExpandingFeature, rowPaginationFeature, rowPinningFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_alphanumericCaseSensitive, sortFn_basic, sortFn_datetime, sortFn_text, sortFn_textCaseSensitive, tableFeatures, useTable } from "@tanstack/react-table";
12
12
  import { measureElement, useVirtualizer } from "@tanstack/react-virtual";
@@ -2241,12 +2241,64 @@ function useColumnWindow({ enabled, overscan, viewport, centerColumnIds, widths,
2241
2241
  ]);
2242
2242
  }
2243
2243
  /**
2244
- * Rendered column count including the spacer cols — what a full-width cell (detail panel,
2245
- * loader row) spans.
2244
+ * What each rendered col holds, in colgroup order: a column, a spacer standing for the columns a
2245
+ * window left out, or the filler (docs/sizing.md#the-filler). Its length is what a full-width
2246
+ * cell (detail panel, loader row) spans; a row with no cells of its own (the skeleton) draws one
2247
+ * cell per entry.
2246
2248
  */
2247
- function renderedColCount(view, leafColumnCount) {
2248
- if (view === null) return leafColumnCount;
2249
- return view.pinnedStartCount + (view.end - view.start) + view.pinnedEndCount + (view.start > 0 ? 1 : 0) + (view.end < view.centerCount ? 1 : 0);
2249
+ function renderedCols(view, leafColumnCount, pinnedEndCount, filler) {
2250
+ const columns = (count) => Array.from({ length: count }, () => "column");
2251
+ const fillerCol = filler ? ["filler"] : [];
2252
+ if (view === null) return [
2253
+ ...columns(leafColumnCount - pinnedEndCount),
2254
+ ...fillerCol,
2255
+ ...columns(pinnedEndCount)
2256
+ ];
2257
+ return [
2258
+ ...columns(view.pinnedStartCount),
2259
+ ...view.start > 0 ? ["spacer"] : [],
2260
+ ...columns(view.end - view.start),
2261
+ ...view.end < view.centerCount ? ["spacer"] : [],
2262
+ ...fillerCol,
2263
+ ...columns(view.pinnedEndCount)
2264
+ ];
2265
+ }
2266
+ /**
2267
+ * Where the filler's cell stands in a row (docs/sizing.md#the-filler): before the first cell of
2268
+ * the end-pinned zone — so after the scrolling columns and a trailing spacer — or last where no
2269
+ * column is pinned to the end. The same index in every row, since every row tiles one colgroup.
2270
+ */
2271
+ function fillerIndex(cells, inEndZone) {
2272
+ const index = cells.findIndex((cell) => inEndZone(cell));
2273
+ return index === -1 ? cells.length : index;
2274
+ }
2275
+ /**
2276
+ * A row's rendered cells with the filler's cell put in its place (`fillerIndex`) — a `td`, or a
2277
+ * `th` in the header — or as they are where the row carries none. The cell is empty and, like a
2278
+ * spacer's, out of the accessibility tree: no cell of the ARIA table.
2279
+ */
2280
+ function withFillerCell(cells, filler) {
2281
+ const nodes = cells.map((cell) => cell.node);
2282
+ if (filler === null) return nodes;
2283
+ const at = fillerIndex(cells, (cell) => cell.endZone);
2284
+ const fillerCell = createElement(filler, {
2285
+ key: "ledger:filler",
2286
+ "aria-hidden": true,
2287
+ "data-ledger-filler": true
2288
+ });
2289
+ return [
2290
+ ...nodes.slice(0, at),
2291
+ fillerCell,
2292
+ ...nodes.slice(at)
2293
+ ];
2294
+ }
2295
+ /**
2296
+ * A header or footer cell's zone is its own leaves': v9 splits a group at every pinning
2297
+ * boundary, so each instance covers one zone — while the group column's `getIsPinned()` answers
2298
+ * for all its leaves at once, and would put a group's scrolling half in the end zone.
2299
+ */
2300
+ function headerInEndZone(header) {
2301
+ return header.getLeafHeaders()[0]?.column.getIsPinned() === "end";
2250
2302
  }
2251
2303
  /**
2252
2304
  * A leaf-level row's cells against the window. `cells` is the full display-ordered list, so a
@@ -2652,7 +2704,7 @@ function DataCell({ cell, editing, rowEditing, isFirstDataCell, depth, rowSpan,
2652
2704
  children: content
2653
2705
  });
2654
2706
  }
2655
- function DataRowImpl({ row, dataIndex, last, rowsBelow, editingColumnId, editingRow, dragging, dropSide, selected, active, activatable, expanded, depth, spanning, columnWindow, pinnedPosition, pinnedOffset, virtualIndex, measureRef, ariaRowIndex }) {
2707
+ function DataRowImpl({ row, dataIndex, last, rowsBelow, editingColumnId, editingRow, dragging, dropSide, selected, active, activatable, expanded, depth, spanning, columnWindow, filler, pinnedPosition, pinnedOffset, virtualIndex, measureRef, ariaRowIndex }) {
2656
2708
  const { getStyles, onRowClick, onRowActivate, onRowDoubleClick, onRowContextMenu, rowProps, activeRowEnabled, setActiveRow } = useDataTableContext();
2657
2709
  const cells = row.getVisibleCells();
2658
2710
  const firstDataCellIndex = cells.findIndex((cell) => !isInternalColumn(cell.column.id));
@@ -2707,26 +2759,40 @@ function DataRowImpl({ row, dataIndex, last, rowsBelow, editingColumnId, editing
2707
2759
  rowSpan: spanning ? cell.getRowSpan() : 1
2708
2760
  }, cell.id);
2709
2761
  };
2710
- if (columnWindow === null) return cells.map((cell, index) => renderCell(cell, index));
2762
+ const placed = (cell, displayIndex) => {
2763
+ return {
2764
+ node: renderCell(cell, displayIndex),
2765
+ endZone: cell.column.getIsPinned() === "end"
2766
+ };
2767
+ };
2768
+ const fillerCell = filler ? "td" : null;
2769
+ if (columnWindow === null) return withFillerCell(cells.map((cell, index) => placed(cell, index)), fillerCell);
2711
2770
  const segments = windowRowCells(cells, columnWindow);
2712
2771
  const windowedStart = columnWindow.pinnedStartCount + columnWindow.start;
2713
2772
  const trailingStart = cells.length - columnWindow.pinnedEndCount;
2714
- return /* @__PURE__ */ jsxs(Fragment, { children: [
2715
- segments.leading.map((cell, index) => renderCell(cell, index)),
2716
- columnWindow.start > 0 && /* @__PURE__ */ jsx("td", {
2717
- "aria-hidden": true,
2718
- "data-ledger-spacer": true
2719
- }),
2720
- segments.windowed.map((cell, index) => renderCell(cell, windowedStart + index)),
2721
- columnWindow.end < columnWindow.centerCount && /* @__PURE__ */ jsx("td", {
2722
- "aria-hidden": true,
2723
- "data-ledger-spacer": true
2724
- }),
2725
- segments.trailing.map((cell, index) => renderCell(cell, trailingStart + index))
2726
- ] });
2773
+ return withFillerCell([
2774
+ ...segments.leading.map((cell, index) => placed(cell, index)),
2775
+ ...columnWindow.start > 0 ? [spacerCell("leading")] : [],
2776
+ ...segments.windowed.map((cell, index) => placed(cell, windowedStart + index)),
2777
+ ...columnWindow.end < columnWindow.centerCount ? [spacerCell("trailing")] : [],
2778
+ ...segments.trailing.map((cell, index) => placed(cell, trailingStart + index))
2779
+ ], fillerCell);
2727
2780
  }
2728
2781
  }
2729
2782
  const DataRow = memo(DataRowImpl);
2783
+ /**
2784
+ * A spacer's cell over a spacer col (docs/virtualization.md#column-virtualization), placed in its
2785
+ * row as the scrolling columns' — never the end zone's.
2786
+ */
2787
+ function spacerCell(edge) {
2788
+ return {
2789
+ node: /* @__PURE__ */ jsx("td", {
2790
+ "aria-hidden": true,
2791
+ "data-ledger-spacer": true
2792
+ }, `ledger:spacer-${edge}`),
2793
+ endZone: false
2794
+ };
2795
+ }
2730
2796
  function DetailRow({ row, renderDetailPanel, colSpan, dragging, dropSide, last, pinnedPosition, pinnedOffset, virtualIndex, measureRef, ariaRowIndex }) {
2731
2797
  const { getStyles } = useDataTableContext();
2732
2798
  const pinnedStyle = pinnedPosition === "top" ? { top: `${pinnedOffset ?? 0}px` } : pinnedPosition === "bottom" ? { bottom: `${pinnedOffset ?? 0}px` } : void 0;
@@ -2750,15 +2816,15 @@ function DetailRow({ row, renderDetailPanel, colSpan, dragging, dropSide, last,
2750
2816
  })
2751
2817
  });
2752
2818
  }
2753
- function SkeletonRows({ rowCount, columnCount, ariaRowIndexStart }) {
2819
+ function SkeletonRows({ rowCount, cols, ariaRowIndexStart }) {
2754
2820
  const { getStyles } = useDataTableContext();
2755
2821
  return /* @__PURE__ */ jsx(Fragment, { children: Array.from({ length: rowCount }, (_, rowIndex) => /* @__PURE__ */ jsx(Table.Tr, {
2756
2822
  "aria-rowindex": ariaRowIndexStart === void 0 ? void 0 : ariaRowIndexStart + rowIndex,
2757
2823
  "data-last": rowIndex === rowCount - 1 || void 0,
2758
2824
  role: "row",
2759
2825
  ...getStyles("row"),
2760
- children: Array.from({ length: columnCount }, (_, columnIndex) => /* @__PURE__ */ jsx(Table.Td, {
2761
- "data-leading": columnIndex === 0 || void 0,
2826
+ children: cols.map((col, colIndex) => col === "column" ? /* @__PURE__ */ jsx(Table.Td, {
2827
+ "data-leading": colIndex === 0 || void 0,
2762
2828
  role: "cell",
2763
2829
  ...getStyles("cell"),
2764
2830
  children: /* @__PURE__ */ jsx(Skeleton, {
@@ -2766,7 +2832,13 @@ function SkeletonRows({ rowCount, columnCount, ariaRowIndexStart }) {
2766
2832
  my: "calc((1lh - 10px) / 2)",
2767
2833
  radius: "sm"
2768
2834
  })
2769
- }, columnIndex))
2835
+ }, colIndex) : col === "spacer" ? /* @__PURE__ */ jsx("td", {
2836
+ "aria-hidden": true,
2837
+ "data-ledger-spacer": true
2838
+ }, colIndex) : /* @__PURE__ */ jsx("td", {
2839
+ "aria-hidden": true,
2840
+ "data-ledger-filler": true
2841
+ }, colIndex))
2770
2842
  }, rowIndex)) });
2771
2843
  }
2772
2844
  function LoaderRow({ colSpan, ariaRowIndex }) {
@@ -2817,7 +2889,7 @@ function LoadMoreErrorRow({ colSpan, message, ariaRowIndex, onRetry }) {
2817
2889
  })
2818
2890
  });
2819
2891
  }
2820
- function TableBody({ table, virtualization, columnWindow, viewportRef, loading, loadingMore, loadMoreError, onLoadMoreRetry, reorderSourceId, reorderTarget, skeletonRowCount, onVirtualizerChange }) {
2892
+ function TableBody({ table, virtualization, columnWindow, filler, viewportRef, loading, loadingMore, loadMoreError, onLoadMoreRetry, reorderSourceId, reorderTarget, skeletonRowCount, onVirtualizerChange }) {
2821
2893
  const { getStyles, withColumnHeaders } = useDataTableContext();
2822
2894
  const ledger = table.options.meta?.ledger;
2823
2895
  const withDetailPanels = Boolean(ledger?.renderDetailPanel);
@@ -2864,8 +2936,8 @@ function TableBody({ table, virtualization, columnWindow, viewportRef, loading,
2864
2936
  virtualizer,
2865
2937
  onVirtualizerChange
2866
2938
  ]);
2867
- const leafColumnCount = table.getVisibleLeafColumns().length;
2868
- const fullWidthColSpan = renderedColCount(columnWindow, leafColumnCount);
2939
+ const cols = renderedCols(columnWindow, table.getVisibleLeafColumns().length, table.getEndVisibleLeafColumns().length, filler);
2940
+ const fullWidthColSpan = cols.length;
2869
2941
  const totalDisplayRowCount = topDisplayRows.length + centerDisplayRows.length + bottomDisplayRows.length;
2870
2942
  const canCommitCell = Boolean(ledger?.onEditCommit);
2871
2943
  const canCommitRow = Boolean(ledger?.onRowEditCommit);
@@ -2893,7 +2965,7 @@ function TableBody({ table, virtualization, columnWindow, viewportRef, loading,
2893
2965
  ...getStyles("tbody"),
2894
2966
  children: /* @__PURE__ */ jsx(SkeletonRows, {
2895
2967
  ariaRowIndexStart: virtualEnabled ? headerRowCount + 1 : void 0,
2896
- columnCount: fullWidthColSpan,
2968
+ cols,
2897
2969
  rowCount: skeletonRowCount
2898
2970
  })
2899
2971
  });
@@ -2946,6 +3018,7 @@ function TableBody({ table, virtualization, columnWindow, viewportRef, loading,
2946
3018
  dropSide,
2947
3019
  editingRow: editingRowId === row.id && (ledger?.editing.row.active(row.id) ?? false),
2948
3020
  expanded: row.getIsExpanded(),
3021
+ filler,
2949
3022
  last,
2950
3023
  measureRef: options.measureRef,
2951
3024
  pinKey,
@@ -3037,7 +3110,7 @@ function visibleFooterGroups(table) {
3037
3110
  function tableHasFooter(table) {
3038
3111
  return visibleFooterGroups(table).length > 0;
3039
3112
  }
3040
- function TableFooter({ table, ariaRowIndexStart, columnWindow }) {
3113
+ function TableFooter({ table, ariaRowIndexStart, columnWindow, filler }) {
3041
3114
  const { getStyles, footerRowProps } = useDataTableContext();
3042
3115
  const renderCell = (footer, colSpan, ariaColIndex) => /* @__PURE__ */ jsx(Table.Td, {
3043
3116
  ...mergeElementProps(resolveElementProps(footer.column.columnDef.meta?.footerCellProps, footer), {
@@ -3060,10 +3133,21 @@ function TableFooter({ table, ariaRowIndexStart, columnWindow }) {
3060
3133
  role: "row",
3061
3134
  ...getStyles("footerRow")
3062
3135
  }),
3063
- children: columnWindow === null ? footerGroup.headers.map((footer) => renderCell(footer, void 0, void 0)) : windowHeaderCells(footerGroup.headers, columnWindow).map((cell) => cell.kind === "spacer" ? /* @__PURE__ */ jsx("td", {
3064
- "aria-hidden": true,
3065
- "data-ledger-spacer": true
3066
- }, `ledger:spacer-${cell.edge}`) : renderCell(cell.header, cell.colSpan, cell.ariaColIndex))
3136
+ children: withFillerCell(columnWindow === null ? footerGroup.headers.map((footer) => {
3137
+ return {
3138
+ node: renderCell(footer, void 0, void 0),
3139
+ endZone: headerInEndZone(footer)
3140
+ };
3141
+ }) : windowHeaderCells(footerGroup.headers, columnWindow).map((cell) => cell.kind === "spacer" ? {
3142
+ node: /* @__PURE__ */ jsx("td", {
3143
+ "aria-hidden": true,
3144
+ "data-ledger-spacer": true
3145
+ }, `ledger:spacer-${cell.edge}`),
3146
+ endZone: false
3147
+ } : {
3148
+ node: renderCell(cell.header, cell.colSpan, cell.ariaColIndex),
3149
+ endZone: headerInEndZone(cell.header)
3150
+ }), filler ? "td" : null)
3067
3151
  }, footerGroup.id))
3068
3152
  });
3069
3153
  }
@@ -3669,7 +3753,7 @@ function useColumnResize(setColumnSizing) {
3669
3753
  * which carries whatever render pass ran last — a discarded one included
3670
3754
  * (docs/architecture.md).
3671
3755
  */
3672
- function TableHeader({ table, columnWidths, columnSizing, columnWindow }) {
3756
+ function TableHeader({ table, columnWidths, columnSizing, columnWindow, filler }) {
3673
3757
  const { getStyles, virtualizedRows, headerRowProps } = useDataTableContext();
3674
3758
  const reorder = useColumnReorder(table);
3675
3759
  const resize = useColumnResize(table.setColumnSizing);
@@ -3691,10 +3775,21 @@ function TableHeader({ table, columnWidths, columnSizing, columnWindow }) {
3691
3775
  role: "row",
3692
3776
  ...getStyles("headerRow")
3693
3777
  }),
3694
- children: columnWindow === null ? headerGroup.headers.map((header) => renderCell(header, void 0, void 0)) : windowHeaderCells(headerGroup.headers, columnWindow).map((cell) => cell.kind === "spacer" ? /* @__PURE__ */ jsx("th", {
3695
- "aria-hidden": true,
3696
- "data-ledger-spacer": true
3697
- }, `ledger:spacer-${cell.edge}`) : renderCell(cell.header, cell.colSpan, cell.ariaColIndex))
3778
+ children: withFillerCell(columnWindow === null ? headerGroup.headers.map((header) => {
3779
+ return {
3780
+ node: renderCell(header, void 0, void 0),
3781
+ endZone: headerInEndZone(header)
3782
+ };
3783
+ }) : windowHeaderCells(headerGroup.headers, columnWindow).map((cell) => cell.kind === "spacer" ? {
3784
+ node: /* @__PURE__ */ jsx("th", {
3785
+ "aria-hidden": true,
3786
+ "data-ledger-spacer": true
3787
+ }, `ledger:spacer-${cell.edge}`),
3788
+ endZone: false
3789
+ } : {
3790
+ node: renderCell(cell.header, cell.colSpan, cell.ariaColIndex),
3791
+ endZone: headerInEndZone(cell.header)
3792
+ }), filler ? "th" : null)
3698
3793
  }, headerGroup.id))
3699
3794
  });
3700
3795
  }
@@ -3996,7 +4091,9 @@ function useAutosizeWidths({ columns, columnSizing, main, viewport, rows, appear
3996
4091
  * by maxSize; when the container is too small every grow column falls back to its basis and the
3997
4092
  * table overflows into horizontal scroll;
3998
4093
  * - with no grow columns at all, surplus distributes proportionally over every column up to each
3999
- * maxSize. Hard maximums win over filling the viewport.
4094
+ * maxSize. Hard maximums win over filling the viewport: what no column may take is the filler,
4095
+ * an empty col between the scrolling columns and the end-pinned ones that every row carries a
4096
+ * cell of, so the table still spans the viewport (docs/sizing.md#the-filler).
4000
4097
  *
4001
4098
  * Author sizing comes from the raw-definition registry (`rawColumnSizing`), never from
4002
4099
  * `column.columnDef` — TanStack merges `size: 150, minSize: 20` defaults into every resolved
@@ -4068,7 +4165,8 @@ function resolveColumnWidths(columns, columnSizing, availableWidth) {
4068
4165
  } else byId[column.id] = clampWidth(sized, column.minSize, column.maxSize);
4069
4166
  }
4070
4167
  const baseTotal = columns.reduce((total, column) => total + (byId[column.id] ?? 0), 0);
4071
- const surplus = (Number.isFinite(availableWidth) ? Math.max(0, Math.round(availableWidth)) : 0) - baseTotal;
4168
+ const targetWidth = Number.isFinite(availableWidth) ? Math.max(0, Math.round(availableWidth)) : 0;
4169
+ const surplus = targetWidth - baseTotal;
4072
4170
  if (surplus > 0) distributeSurplus(byId, growColumns.length > 0 ? growColumns : columns.map((column) => {
4073
4171
  return {
4074
4172
  id: column.id,
@@ -4076,9 +4174,11 @@ function resolveColumnWidths(columns, columnSizing, availableWidth) {
4076
4174
  max: normalizedBound(column.maxSize)
4077
4175
  };
4078
4176
  }), surplus);
4177
+ const total = columns.reduce((sum, column) => sum + (byId[column.id] ?? 0), 0);
4079
4178
  return {
4080
4179
  byId,
4081
- total: columns.reduce((sum, column) => sum + (byId[column.id] ?? 0), 0)
4180
+ total,
4181
+ filler: Math.max(0, targetWidth - total)
4082
4182
  };
4083
4183
  }
4084
4184
  /**
@@ -4134,7 +4234,11 @@ function useColumnWidths(table, { columns, viewport, tableMinWidth, injectedWidt
4134
4234
  injectedWidth,
4135
4235
  autosizeWidths
4136
4236
  ]);
4137
- const signature = JSON.stringify([resolved.total, Object.entries(resolved.byId)]);
4237
+ const signature = JSON.stringify([
4238
+ resolved.total,
4239
+ resolved.filler,
4240
+ Object.entries(resolved.byId)
4241
+ ]);
4138
4242
  return useMemo(() => resolved, [signature]);
4139
4243
  }
4140
4244
  //#endregion
@@ -7158,7 +7262,17 @@ function DataTableCore({ presentation, stylesProps, table }) {
7158
7262
  columnWidths,
7159
7263
  tableState.columnPinning
7160
7264
  ]);
7161
- const colElements = columnWindow === null ? visibleLeafColumns.map((column) => leafCol(column)) : [
7265
+ const filler = columnWidths.filler > 0;
7266
+ const fillerCol = filler && /* @__PURE__ */ jsx("col", {
7267
+ "data-ledger-filler": true,
7268
+ style: { width: columnWidths.filler }
7269
+ }, "ledger:filler");
7270
+ const endCols = pinnedEndCount === 0 ? [] : visibleLeafColumns.slice(-pinnedEndCount).map((column) => leafCol(column));
7271
+ const colElements = columnWindow === null ? [
7272
+ ...visibleLeafColumns.slice(0, visibleLeafColumns.length - pinnedEndCount).map((column) => leafCol(column)),
7273
+ fillerCol,
7274
+ ...endCols
7275
+ ] : [
7162
7276
  ...visibleLeafColumns.slice(0, pinnedStartCount).map((column) => leafCol(column)),
7163
7277
  columnWindow.start > 0 && /* @__PURE__ */ jsx("col", {
7164
7278
  "data-ledger-spacer": true,
@@ -7169,7 +7283,8 @@ function DataTableCore({ presentation, stylesProps, table }) {
7169
7283
  "data-ledger-spacer": true,
7170
7284
  style: { width: columnWindow.trailingSpace }
7171
7285
  }, "ledger:spacer-trailing"),
7172
- ...pinnedEndCount === 0 ? [] : visibleLeafColumns.slice(-pinnedEndCount).map((column) => leafCol(column))
7286
+ fillerCol,
7287
+ ...endCols
7173
7288
  ];
7174
7289
  const rowsLength = table.getRowModel().rows.length;
7175
7290
  const errorActive = Boolean(error) && !loading;
@@ -7514,8 +7629,9 @@ function DataTableCore({ presentation, stylesProps, table }) {
7514
7629
  tabularNums,
7515
7630
  verticalSpacing: verticalSpacing ?? scale.verticalSpacing
7516
7631
  };
7632
+ const tableWidth = columnWidths.total + columnWidths.filler;
7517
7633
  const tableStyleProps = () => getStyles("table", { style: {
7518
- width: columnWidths.total > 0 ? columnWidths.total : void 0,
7634
+ width: tableWidth > 0 ? tableWidth : void 0,
7519
7635
  minWidth: toPx(tableMinWidth),
7520
7636
  borderCollapse: "separate",
7521
7637
  borderSpacing: 0,
@@ -7639,6 +7755,7 @@ function DataTableCore({ presentation, stylesProps, table }) {
7639
7755
  columnSizing: tableState.columnSizing,
7640
7756
  columnWidths: columnWidths.byId,
7641
7757
  columnWindow,
7758
+ filler,
7642
7759
  table: erasedTable
7643
7760
  })]
7644
7761
  })
@@ -7670,6 +7787,7 @@ function DataTableCore({ presentation, stylesProps, table }) {
7670
7787
  ...tableStyleProps(),
7671
7788
  children: [/* @__PURE__ */ jsx("colgroup", { children: colElements }), /* @__PURE__ */ jsx(TableBody, {
7672
7789
  columnWindow,
7790
+ filler,
7673
7791
  loading: loading === true,
7674
7792
  loadingMore: loadingMore === true,
7675
7793
  loadMoreError: loadMoreError ?? false,
@@ -7751,6 +7869,7 @@ function DataTableCore({ presentation, stylesProps, table }) {
7751
7869
  children: [/* @__PURE__ */ jsx("colgroup", { children: colElements }), /* @__PURE__ */ jsx(TableFooter, {
7752
7870
  ariaRowIndexStart: virtualEnabled ? footerAriaRowIndexStart : void 0,
7753
7871
  columnWindow,
7872
+ filler,
7754
7873
  table: erasedTable
7755
7874
  })]
7756
7875
  })