@coldsmirk/ledger-mantine 0.10.0 → 0.10.2
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 +169 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +170 -48
- package/dist/index.js.map +1 -1
- package/dist/styles.css +23 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -452,8 +452,11 @@ function useRowReorder({ onRowReorder, labels, viewportRef, getCenterRows, nameR
|
|
|
452
452
|
body.append(rowClone);
|
|
453
453
|
ghostTable.append(colgroup, body);
|
|
454
454
|
element.replaceChildren(ghostTable);
|
|
455
|
-
const
|
|
456
|
-
|
|
455
|
+
const sourceStyle = getComputedStyle(source);
|
|
456
|
+
for (const variable of ["--ledger-body-bg", "--ledger-border-color"]) {
|
|
457
|
+
const value = sourceStyle.getPropertyValue(variable).trim();
|
|
458
|
+
if (value !== "") element.style.setProperty(variable, value);
|
|
459
|
+
}
|
|
457
460
|
const rowRect = source.getBoundingClientRect();
|
|
458
461
|
ghostOrigin.current = {
|
|
459
462
|
x: rowRect.left - ghostPosition.current.x,
|
|
@@ -2265,12 +2268,64 @@ function useColumnWindow({ enabled, overscan, viewport, centerColumnIds, widths,
|
|
|
2265
2268
|
]);
|
|
2266
2269
|
}
|
|
2267
2270
|
/**
|
|
2268
|
-
*
|
|
2269
|
-
*
|
|
2271
|
+
* What each rendered col holds, in colgroup order: a column, a spacer standing for the columns a
|
|
2272
|
+
* window left out, or the filler (docs/sizing.md#the-filler). Its length is what a full-width
|
|
2273
|
+
* cell (detail panel, loader row) spans; a row with no cells of its own (the skeleton) draws one
|
|
2274
|
+
* cell per entry.
|
|
2275
|
+
*/
|
|
2276
|
+
function renderedCols(view, leafColumnCount, pinnedEndCount, filler) {
|
|
2277
|
+
const columns = (count) => Array.from({ length: count }, () => "column");
|
|
2278
|
+
const fillerCol = filler ? ["filler"] : [];
|
|
2279
|
+
if (view === null) return [
|
|
2280
|
+
...columns(leafColumnCount - pinnedEndCount),
|
|
2281
|
+
...fillerCol,
|
|
2282
|
+
...columns(pinnedEndCount)
|
|
2283
|
+
];
|
|
2284
|
+
return [
|
|
2285
|
+
...columns(view.pinnedStartCount),
|
|
2286
|
+
...view.start > 0 ? ["spacer"] : [],
|
|
2287
|
+
...columns(view.end - view.start),
|
|
2288
|
+
...view.end < view.centerCount ? ["spacer"] : [],
|
|
2289
|
+
...fillerCol,
|
|
2290
|
+
...columns(view.pinnedEndCount)
|
|
2291
|
+
];
|
|
2292
|
+
}
|
|
2293
|
+
/**
|
|
2294
|
+
* Where the filler's cell stands in a row (docs/sizing.md#the-filler): before the first cell of
|
|
2295
|
+
* the end-pinned zone — so after the scrolling columns and a trailing spacer — or last where no
|
|
2296
|
+
* column is pinned to the end. The same index in every row, since every row tiles one colgroup.
|
|
2270
2297
|
*/
|
|
2271
|
-
function
|
|
2272
|
-
|
|
2273
|
-
return
|
|
2298
|
+
function fillerIndex(cells, inEndZone) {
|
|
2299
|
+
const index = cells.findIndex((cell) => inEndZone(cell));
|
|
2300
|
+
return index === -1 ? cells.length : index;
|
|
2301
|
+
}
|
|
2302
|
+
/**
|
|
2303
|
+
* A row's rendered cells with the filler's cell put in its place (`fillerIndex`) — a `td`, or a
|
|
2304
|
+
* `th` in the header — or as they are where the row carries none. The cell is empty and, like a
|
|
2305
|
+
* spacer's, out of the accessibility tree: no cell of the ARIA table.
|
|
2306
|
+
*/
|
|
2307
|
+
function withFillerCell(cells, filler) {
|
|
2308
|
+
const nodes = cells.map((cell) => cell.node);
|
|
2309
|
+
if (filler === null) return nodes;
|
|
2310
|
+
const at = fillerIndex(cells, (cell) => cell.endZone);
|
|
2311
|
+
const fillerCell = (0, react.createElement)(filler, {
|
|
2312
|
+
key: "ledger:filler",
|
|
2313
|
+
"aria-hidden": true,
|
|
2314
|
+
"data-ledger-filler": true
|
|
2315
|
+
});
|
|
2316
|
+
return [
|
|
2317
|
+
...nodes.slice(0, at),
|
|
2318
|
+
fillerCell,
|
|
2319
|
+
...nodes.slice(at)
|
|
2320
|
+
];
|
|
2321
|
+
}
|
|
2322
|
+
/**
|
|
2323
|
+
* A header or footer cell's zone is its own leaves': v9 splits a group at every pinning
|
|
2324
|
+
* boundary, so each instance covers one zone — while the group column's `getIsPinned()` answers
|
|
2325
|
+
* for all its leaves at once, and would put a group's scrolling half in the end zone.
|
|
2326
|
+
*/
|
|
2327
|
+
function headerInEndZone(header) {
|
|
2328
|
+
return header.getLeafHeaders()[0]?.column.getIsPinned() === "end";
|
|
2274
2329
|
}
|
|
2275
2330
|
/**
|
|
2276
2331
|
* A leaf-level row's cells against the window. `cells` is the full display-ordered list, so a
|
|
@@ -2676,7 +2731,7 @@ function DataCell({ cell, editing, rowEditing, isFirstDataCell, depth, rowSpan,
|
|
|
2676
2731
|
children: content
|
|
2677
2732
|
});
|
|
2678
2733
|
}
|
|
2679
|
-
function DataRowImpl({ row, dataIndex, last, rowsBelow, editingColumnId, editingRow, dragging, dropSide, selected, active, activatable, expanded, depth, spanning, columnWindow, pinnedPosition, pinnedOffset, virtualIndex, measureRef, ariaRowIndex }) {
|
|
2734
|
+
function DataRowImpl({ row, dataIndex, last, rowsBelow, editingColumnId, editingRow, dragging, dropSide, selected, active, activatable, expanded, depth, spanning, columnWindow, filler, pinnedPosition, pinnedOffset, virtualIndex, measureRef, ariaRowIndex }) {
|
|
2680
2735
|
const { getStyles, onRowClick, onRowActivate, onRowDoubleClick, onRowContextMenu, rowProps, activeRowEnabled, setActiveRow } = useDataTableContext();
|
|
2681
2736
|
const cells = row.getVisibleCells();
|
|
2682
2737
|
const firstDataCellIndex = cells.findIndex((cell) => !isInternalColumn(cell.column.id));
|
|
@@ -2731,26 +2786,40 @@ function DataRowImpl({ row, dataIndex, last, rowsBelow, editingColumnId, editing
|
|
|
2731
2786
|
rowSpan: spanning ? cell.getRowSpan() : 1
|
|
2732
2787
|
}, cell.id);
|
|
2733
2788
|
};
|
|
2734
|
-
|
|
2789
|
+
const placed = (cell, displayIndex) => {
|
|
2790
|
+
return {
|
|
2791
|
+
node: renderCell(cell, displayIndex),
|
|
2792
|
+
endZone: cell.column.getIsPinned() === "end"
|
|
2793
|
+
};
|
|
2794
|
+
};
|
|
2795
|
+
const fillerCell = filler ? "td" : null;
|
|
2796
|
+
if (columnWindow === null) return withFillerCell(cells.map((cell, index) => placed(cell, index)), fillerCell);
|
|
2735
2797
|
const segments = windowRowCells(cells, columnWindow);
|
|
2736
2798
|
const windowedStart = columnWindow.pinnedStartCount + columnWindow.start;
|
|
2737
2799
|
const trailingStart = cells.length - columnWindow.pinnedEndCount;
|
|
2738
|
-
return
|
|
2739
|
-
segments.leading.map((cell, index) =>
|
|
2740
|
-
columnWindow.start > 0
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
columnWindow.end < columnWindow.centerCount && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2746
|
-
"aria-hidden": true,
|
|
2747
|
-
"data-ledger-spacer": true
|
|
2748
|
-
}),
|
|
2749
|
-
segments.trailing.map((cell, index) => renderCell(cell, trailingStart + index))
|
|
2750
|
-
] });
|
|
2800
|
+
return withFillerCell([
|
|
2801
|
+
...segments.leading.map((cell, index) => placed(cell, index)),
|
|
2802
|
+
...columnWindow.start > 0 ? [spacerCell("leading")] : [],
|
|
2803
|
+
...segments.windowed.map((cell, index) => placed(cell, windowedStart + index)),
|
|
2804
|
+
...columnWindow.end < columnWindow.centerCount ? [spacerCell("trailing")] : [],
|
|
2805
|
+
...segments.trailing.map((cell, index) => placed(cell, trailingStart + index))
|
|
2806
|
+
], fillerCell);
|
|
2751
2807
|
}
|
|
2752
2808
|
}
|
|
2753
2809
|
const DataRow = (0, react.memo)(DataRowImpl);
|
|
2810
|
+
/**
|
|
2811
|
+
* A spacer's cell over a spacer col (docs/virtualization.md#column-virtualization), placed in its
|
|
2812
|
+
* row as the scrolling columns' — never the end zone's.
|
|
2813
|
+
*/
|
|
2814
|
+
function spacerCell(edge) {
|
|
2815
|
+
return {
|
|
2816
|
+
node: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2817
|
+
"aria-hidden": true,
|
|
2818
|
+
"data-ledger-spacer": true
|
|
2819
|
+
}, `ledger:spacer-${edge}`),
|
|
2820
|
+
endZone: false
|
|
2821
|
+
};
|
|
2822
|
+
}
|
|
2754
2823
|
function DetailRow({ row, renderDetailPanel, colSpan, dragging, dropSide, last, pinnedPosition, pinnedOffset, virtualIndex, measureRef, ariaRowIndex }) {
|
|
2755
2824
|
const { getStyles } = useDataTableContext();
|
|
2756
2825
|
const pinnedStyle = pinnedPosition === "top" ? { top: `${pinnedOffset ?? 0}px` } : pinnedPosition === "bottom" ? { bottom: `${pinnedOffset ?? 0}px` } : void 0;
|
|
@@ -2774,15 +2843,15 @@ function DetailRow({ row, renderDetailPanel, colSpan, dragging, dropSide, last,
|
|
|
2774
2843
|
})
|
|
2775
2844
|
});
|
|
2776
2845
|
}
|
|
2777
|
-
function SkeletonRows({ rowCount,
|
|
2846
|
+
function SkeletonRows({ rowCount, cols, ariaRowIndexStart }) {
|
|
2778
2847
|
const { getStyles } = useDataTableContext();
|
|
2779
2848
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: Array.from({ length: rowCount }, (_, rowIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Tr, {
|
|
2780
2849
|
"aria-rowindex": ariaRowIndexStart === void 0 ? void 0 : ariaRowIndexStart + rowIndex,
|
|
2781
2850
|
"data-last": rowIndex === rowCount - 1 || void 0,
|
|
2782
2851
|
role: "row",
|
|
2783
2852
|
...getStyles("row"),
|
|
2784
|
-
children:
|
|
2785
|
-
"data-leading":
|
|
2853
|
+
children: cols.map((col, colIndex) => col === "column" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
2854
|
+
"data-leading": colIndex === 0 || void 0,
|
|
2786
2855
|
role: "cell",
|
|
2787
2856
|
...getStyles("cell"),
|
|
2788
2857
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Skeleton, {
|
|
@@ -2790,7 +2859,13 @@ function SkeletonRows({ rowCount, columnCount, ariaRowIndexStart }) {
|
|
|
2790
2859
|
my: "calc((1lh - 10px) / 2)",
|
|
2791
2860
|
radius: "sm"
|
|
2792
2861
|
})
|
|
2793
|
-
},
|
|
2862
|
+
}, colIndex) : col === "spacer" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2863
|
+
"aria-hidden": true,
|
|
2864
|
+
"data-ledger-spacer": true
|
|
2865
|
+
}, colIndex) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2866
|
+
"aria-hidden": true,
|
|
2867
|
+
"data-ledger-filler": true
|
|
2868
|
+
}, colIndex))
|
|
2794
2869
|
}, rowIndex)) });
|
|
2795
2870
|
}
|
|
2796
2871
|
function LoaderRow({ colSpan, ariaRowIndex }) {
|
|
@@ -2841,7 +2916,7 @@ function LoadMoreErrorRow({ colSpan, message, ariaRowIndex, onRetry }) {
|
|
|
2841
2916
|
})
|
|
2842
2917
|
});
|
|
2843
2918
|
}
|
|
2844
|
-
function TableBody({ table, virtualization, columnWindow, viewportRef, loading, loadingMore, loadMoreError, onLoadMoreRetry, reorderSourceId, reorderTarget, skeletonRowCount, onVirtualizerChange }) {
|
|
2919
|
+
function TableBody({ table, virtualization, columnWindow, filler, viewportRef, loading, loadingMore, loadMoreError, onLoadMoreRetry, reorderSourceId, reorderTarget, skeletonRowCount, onVirtualizerChange }) {
|
|
2845
2920
|
const { getStyles, withColumnHeaders } = useDataTableContext();
|
|
2846
2921
|
const ledger = table.options.meta?.ledger;
|
|
2847
2922
|
const withDetailPanels = Boolean(ledger?.renderDetailPanel);
|
|
@@ -2888,8 +2963,8 @@ function TableBody({ table, virtualization, columnWindow, viewportRef, loading,
|
|
|
2888
2963
|
virtualizer,
|
|
2889
2964
|
onVirtualizerChange
|
|
2890
2965
|
]);
|
|
2891
|
-
const
|
|
2892
|
-
const fullWidthColSpan =
|
|
2966
|
+
const cols = renderedCols(columnWindow, table.getVisibleLeafColumns().length, table.getEndVisibleLeafColumns().length, filler);
|
|
2967
|
+
const fullWidthColSpan = cols.length;
|
|
2893
2968
|
const totalDisplayRowCount = topDisplayRows.length + centerDisplayRows.length + bottomDisplayRows.length;
|
|
2894
2969
|
const canCommitCell = Boolean(ledger?.onEditCommit);
|
|
2895
2970
|
const canCommitRow = Boolean(ledger?.onRowEditCommit);
|
|
@@ -2917,7 +2992,7 @@ function TableBody({ table, virtualization, columnWindow, viewportRef, loading,
|
|
|
2917
2992
|
...getStyles("tbody"),
|
|
2918
2993
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonRows, {
|
|
2919
2994
|
ariaRowIndexStart: virtualEnabled ? headerRowCount + 1 : void 0,
|
|
2920
|
-
|
|
2995
|
+
cols,
|
|
2921
2996
|
rowCount: skeletonRowCount
|
|
2922
2997
|
})
|
|
2923
2998
|
});
|
|
@@ -2970,6 +3045,7 @@ function TableBody({ table, virtualization, columnWindow, viewportRef, loading,
|
|
|
2970
3045
|
dropSide,
|
|
2971
3046
|
editingRow: editingRowId === row.id && (ledger?.editing.row.active(row.id) ?? false),
|
|
2972
3047
|
expanded: row.getIsExpanded(),
|
|
3048
|
+
filler,
|
|
2973
3049
|
last,
|
|
2974
3050
|
measureRef: options.measureRef,
|
|
2975
3051
|
pinKey,
|
|
@@ -3061,7 +3137,7 @@ function visibleFooterGroups(table) {
|
|
|
3061
3137
|
function tableHasFooter(table) {
|
|
3062
3138
|
return visibleFooterGroups(table).length > 0;
|
|
3063
3139
|
}
|
|
3064
|
-
function TableFooter({ table, ariaRowIndexStart, columnWindow }) {
|
|
3140
|
+
function TableFooter({ table, ariaRowIndexStart, columnWindow, filler }) {
|
|
3065
3141
|
const { getStyles, footerRowProps } = useDataTableContext();
|
|
3066
3142
|
const renderCell = (footer, colSpan, ariaColIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
3067
3143
|
...mergeElementProps(resolveElementProps(footer.column.columnDef.meta?.footerCellProps, footer), {
|
|
@@ -3084,10 +3160,21 @@ function TableFooter({ table, ariaRowIndexStart, columnWindow }) {
|
|
|
3084
3160
|
role: "row",
|
|
3085
3161
|
...getStyles("footerRow")
|
|
3086
3162
|
}),
|
|
3087
|
-
children: columnWindow === null ? footerGroup.headers.map((footer) =>
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3163
|
+
children: withFillerCell(columnWindow === null ? footerGroup.headers.map((footer) => {
|
|
3164
|
+
return {
|
|
3165
|
+
node: renderCell(footer, void 0, void 0),
|
|
3166
|
+
endZone: headerInEndZone(footer)
|
|
3167
|
+
};
|
|
3168
|
+
}) : windowHeaderCells(footerGroup.headers, columnWindow).map((cell) => cell.kind === "spacer" ? {
|
|
3169
|
+
node: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
3170
|
+
"aria-hidden": true,
|
|
3171
|
+
"data-ledger-spacer": true
|
|
3172
|
+
}, `ledger:spacer-${cell.edge}`),
|
|
3173
|
+
endZone: false
|
|
3174
|
+
} : {
|
|
3175
|
+
node: renderCell(cell.header, cell.colSpan, cell.ariaColIndex),
|
|
3176
|
+
endZone: headerInEndZone(cell.header)
|
|
3177
|
+
}), filler ? "td" : null)
|
|
3091
3178
|
}, footerGroup.id))
|
|
3092
3179
|
});
|
|
3093
3180
|
}
|
|
@@ -3693,7 +3780,7 @@ function useColumnResize(setColumnSizing) {
|
|
|
3693
3780
|
* which carries whatever render pass ran last — a discarded one included
|
|
3694
3781
|
* (docs/architecture.md).
|
|
3695
3782
|
*/
|
|
3696
|
-
function TableHeader({ table, columnWidths, columnSizing, columnWindow }) {
|
|
3783
|
+
function TableHeader({ table, columnWidths, columnSizing, columnWindow, filler }) {
|
|
3697
3784
|
const { getStyles, virtualizedRows, headerRowProps } = useDataTableContext();
|
|
3698
3785
|
const reorder = useColumnReorder(table);
|
|
3699
3786
|
const resize = useColumnResize(table.setColumnSizing);
|
|
@@ -3715,10 +3802,21 @@ function TableHeader({ table, columnWidths, columnSizing, columnWindow }) {
|
|
|
3715
3802
|
role: "row",
|
|
3716
3803
|
...getStyles("headerRow")
|
|
3717
3804
|
}),
|
|
3718
|
-
children: columnWindow === null ? headerGroup.headers.map((header) =>
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3805
|
+
children: withFillerCell(columnWindow === null ? headerGroup.headers.map((header) => {
|
|
3806
|
+
return {
|
|
3807
|
+
node: renderCell(header, void 0, void 0),
|
|
3808
|
+
endZone: headerInEndZone(header)
|
|
3809
|
+
};
|
|
3810
|
+
}) : windowHeaderCells(headerGroup.headers, columnWindow).map((cell) => cell.kind === "spacer" ? {
|
|
3811
|
+
node: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
3812
|
+
"aria-hidden": true,
|
|
3813
|
+
"data-ledger-spacer": true
|
|
3814
|
+
}, `ledger:spacer-${cell.edge}`),
|
|
3815
|
+
endZone: false
|
|
3816
|
+
} : {
|
|
3817
|
+
node: renderCell(cell.header, cell.colSpan, cell.ariaColIndex),
|
|
3818
|
+
endZone: headerInEndZone(cell.header)
|
|
3819
|
+
}), filler ? "th" : null)
|
|
3722
3820
|
}, headerGroup.id))
|
|
3723
3821
|
});
|
|
3724
3822
|
}
|
|
@@ -4020,7 +4118,9 @@ function useAutosizeWidths({ columns, columnSizing, main, viewport, rows, appear
|
|
|
4020
4118
|
* by maxSize; when the container is too small every grow column falls back to its basis and the
|
|
4021
4119
|
* table overflows into horizontal scroll;
|
|
4022
4120
|
* - with no grow columns at all, surplus distributes proportionally over every column up to each
|
|
4023
|
-
* maxSize. Hard maximums win over filling the viewport
|
|
4121
|
+
* maxSize. Hard maximums win over filling the viewport: what no column may take is the filler,
|
|
4122
|
+
* an empty col between the scrolling columns and the end-pinned ones that every row carries a
|
|
4123
|
+
* cell of, so the table still spans the viewport (docs/sizing.md#the-filler).
|
|
4024
4124
|
*
|
|
4025
4125
|
* Author sizing comes from the raw-definition registry (`rawColumnSizing`), never from
|
|
4026
4126
|
* `column.columnDef` — TanStack merges `size: 150, minSize: 20` defaults into every resolved
|
|
@@ -4092,7 +4192,8 @@ function resolveColumnWidths(columns, columnSizing, availableWidth) {
|
|
|
4092
4192
|
} else byId[column.id] = clampWidth(sized, column.minSize, column.maxSize);
|
|
4093
4193
|
}
|
|
4094
4194
|
const baseTotal = columns.reduce((total, column) => total + (byId[column.id] ?? 0), 0);
|
|
4095
|
-
const
|
|
4195
|
+
const targetWidth = Number.isFinite(availableWidth) ? Math.max(0, Math.round(availableWidth)) : 0;
|
|
4196
|
+
const surplus = targetWidth - baseTotal;
|
|
4096
4197
|
if (surplus > 0) distributeSurplus(byId, growColumns.length > 0 ? growColumns : columns.map((column) => {
|
|
4097
4198
|
return {
|
|
4098
4199
|
id: column.id,
|
|
@@ -4100,9 +4201,11 @@ function resolveColumnWidths(columns, columnSizing, availableWidth) {
|
|
|
4100
4201
|
max: normalizedBound(column.maxSize)
|
|
4101
4202
|
};
|
|
4102
4203
|
}), surplus);
|
|
4204
|
+
const total = columns.reduce((sum, column) => sum + (byId[column.id] ?? 0), 0);
|
|
4103
4205
|
return {
|
|
4104
4206
|
byId,
|
|
4105
|
-
total
|
|
4207
|
+
total,
|
|
4208
|
+
filler: Math.max(0, targetWidth - total)
|
|
4106
4209
|
};
|
|
4107
4210
|
}
|
|
4108
4211
|
/**
|
|
@@ -4158,7 +4261,11 @@ function useColumnWidths(table, { columns, viewport, tableMinWidth, injectedWidt
|
|
|
4158
4261
|
injectedWidth,
|
|
4159
4262
|
autosizeWidths
|
|
4160
4263
|
]);
|
|
4161
|
-
const signature = JSON.stringify([
|
|
4264
|
+
const signature = JSON.stringify([
|
|
4265
|
+
resolved.total,
|
|
4266
|
+
resolved.filler,
|
|
4267
|
+
Object.entries(resolved.byId)
|
|
4268
|
+
]);
|
|
4162
4269
|
return (0, react.useMemo)(() => resolved, [signature]);
|
|
4163
4270
|
}
|
|
4164
4271
|
//#endregion
|
|
@@ -7182,7 +7289,17 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7182
7289
|
columnWidths,
|
|
7183
7290
|
tableState.columnPinning
|
|
7184
7291
|
]);
|
|
7185
|
-
const
|
|
7292
|
+
const filler = columnWidths.filler > 0;
|
|
7293
|
+
const fillerCol = filler && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("col", {
|
|
7294
|
+
"data-ledger-filler": true,
|
|
7295
|
+
style: { width: columnWidths.filler }
|
|
7296
|
+
}, "ledger:filler");
|
|
7297
|
+
const endCols = pinnedEndCount === 0 ? [] : visibleLeafColumns.slice(-pinnedEndCount).map((column) => leafCol(column));
|
|
7298
|
+
const colElements = columnWindow === null ? [
|
|
7299
|
+
...visibleLeafColumns.slice(0, visibleLeafColumns.length - pinnedEndCount).map((column) => leafCol(column)),
|
|
7300
|
+
fillerCol,
|
|
7301
|
+
...endCols
|
|
7302
|
+
] : [
|
|
7186
7303
|
...visibleLeafColumns.slice(0, pinnedStartCount).map((column) => leafCol(column)),
|
|
7187
7304
|
columnWindow.start > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("col", {
|
|
7188
7305
|
"data-ledger-spacer": true,
|
|
@@ -7193,7 +7310,8 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7193
7310
|
"data-ledger-spacer": true,
|
|
7194
7311
|
style: { width: columnWindow.trailingSpace }
|
|
7195
7312
|
}, "ledger:spacer-trailing"),
|
|
7196
|
-
|
|
7313
|
+
fillerCol,
|
|
7314
|
+
...endCols
|
|
7197
7315
|
];
|
|
7198
7316
|
const rowsLength = table.getRowModel().rows.length;
|
|
7199
7317
|
const errorActive = Boolean(error) && !loading;
|
|
@@ -7538,8 +7656,9 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7538
7656
|
tabularNums,
|
|
7539
7657
|
verticalSpacing: verticalSpacing ?? scale.verticalSpacing
|
|
7540
7658
|
};
|
|
7659
|
+
const tableWidth = columnWidths.total + columnWidths.filler;
|
|
7541
7660
|
const tableStyleProps = () => getStyles("table", { style: {
|
|
7542
|
-
width:
|
|
7661
|
+
width: tableWidth > 0 ? tableWidth : void 0,
|
|
7543
7662
|
minWidth: toPx(tableMinWidth),
|
|
7544
7663
|
borderCollapse: "separate",
|
|
7545
7664
|
borderSpacing: 0,
|
|
@@ -7663,6 +7782,7 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7663
7782
|
columnSizing: tableState.columnSizing,
|
|
7664
7783
|
columnWidths: columnWidths.byId,
|
|
7665
7784
|
columnWindow,
|
|
7785
|
+
filler,
|
|
7666
7786
|
table: erasedTable
|
|
7667
7787
|
})]
|
|
7668
7788
|
})
|
|
@@ -7694,6 +7814,7 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7694
7814
|
...tableStyleProps(),
|
|
7695
7815
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("colgroup", { children: colElements }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableBody, {
|
|
7696
7816
|
columnWindow,
|
|
7817
|
+
filler,
|
|
7697
7818
|
loading: loading === true,
|
|
7698
7819
|
loadingMore: loadingMore === true,
|
|
7699
7820
|
loadMoreError: loadMoreError ?? false,
|
|
@@ -7775,6 +7896,7 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7775
7896
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("colgroup", { children: colElements }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableFooter, {
|
|
7776
7897
|
ariaRowIndexStart: virtualEnabled ? footerAriaRowIndexStart : void 0,
|
|
7777
7898
|
columnWindow,
|
|
7899
|
+
filler,
|
|
7778
7900
|
table: erasedTable
|
|
7779
7901
|
})]
|
|
7780
7902
|
})
|