@coldsmirk/ledger-mantine 0.8.0 → 0.9.0
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 +91 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +92 -42
- package/dist/index.js.map +1 -1
- package/dist/styles.css +101 -33
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -621,6 +621,7 @@ function RowDragCell({ row, table }) {
|
|
|
621
621
|
"aria-pressed": lifted || void 0,
|
|
622
622
|
color: "gray",
|
|
623
623
|
size: SIZES[size].control,
|
|
624
|
+
style: { cursor: orderable ? "grab" : "default" },
|
|
624
625
|
variant: "subtle",
|
|
625
626
|
onBlur: () => {
|
|
626
627
|
if (lifted) rowReorderKeyboard?.cancel();
|
|
@@ -1380,6 +1381,7 @@ function ColumnsPanelItem({ column, table, labels, icons, index, zone, orderable
|
|
|
1380
1381
|
className: "ledger-columns-panel-handle",
|
|
1381
1382
|
color: "gray",
|
|
1382
1383
|
size: "sm",
|
|
1384
|
+
style: { cursor: isDragging ? "grabbing" : "grab" },
|
|
1383
1385
|
variant: "subtle",
|
|
1384
1386
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(icons.reorderColumn, {})
|
|
1385
1387
|
})
|
|
@@ -1699,7 +1701,8 @@ function PaginationBarCore({ table, labels, pageSizeOptions, size, className, st
|
|
|
1699
1701
|
children: labels.paginationSummary(from, to, total)
|
|
1700
1702
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
1701
1703
|
gap: "md",
|
|
1702
|
-
|
|
1704
|
+
justify: "flex-end",
|
|
1705
|
+
wrap: "wrap",
|
|
1703
1706
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
1704
1707
|
gap: "xs",
|
|
1705
1708
|
wrap: "nowrap",
|
|
@@ -1707,6 +1710,7 @@ function PaginationBarCore({ table, labels, pageSizeOptions, size, className, st
|
|
|
1707
1710
|
c: "var(--ledger-color-dimmed)",
|
|
1708
1711
|
id: pageSizeLabelId,
|
|
1709
1712
|
size,
|
|
1713
|
+
style: { whiteSpace: "nowrap" },
|
|
1710
1714
|
children: labels.rowsPerPage
|
|
1711
1715
|
}, "label"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Select, {
|
|
1712
1716
|
allowDeselect: false,
|
|
@@ -1885,7 +1889,7 @@ function cellValue(cell) {
|
|
|
1885
1889
|
*/
|
|
1886
1890
|
function canEditWith(row, edit, gate) {
|
|
1887
1891
|
if (!gate.enableEditing || !gate.hasCommitHandler) return false;
|
|
1888
|
-
if (!edit) return false;
|
|
1892
|
+
if (!edit || row.getIsGrouped()) return false;
|
|
1889
1893
|
return !(typeof edit === "object" && edit.enabled && !edit.enabled(row));
|
|
1890
1894
|
}
|
|
1891
1895
|
/**
|
|
@@ -2452,6 +2456,15 @@ const TREE_INDENT_PX = 20;
|
|
|
2452
2456
|
const DEFAULT_ESTIMATED_ROW_HEIGHT = SIZES.sm.rowHeight;
|
|
2453
2457
|
const DEFAULT_OVERSCAN = 8;
|
|
2454
2458
|
/**
|
|
2459
|
+
* A row's height as layout has it, fractions included. TanStack Virtual rounds every measurement
|
|
2460
|
+
* to the pixel, and a row is seldom a whole number of pixels tall (Mantine's line height is 1.55):
|
|
2461
|
+
* each measured row then counted up to half a pixel wrong, the virtualizer's idea of where a row
|
|
2462
|
+
* starts drifted from the DOM by that much per row, and `scrollToRow` landed its row a few pixels
|
|
2463
|
+
* under the header. The resize entry's border box is exact. Without an entry (a row mounting) the
|
|
2464
|
+
* default answers from its cache or the element, and the entry that follows corrects it.
|
|
2465
|
+
*/
|
|
2466
|
+
const measureRow = (element, entry, instance) => entry?.borderBoxSize[0]?.blockSize ?? (0, _tanstack_react_virtual.measureElement)(element, entry, instance);
|
|
2467
|
+
/**
|
|
2455
2468
|
* Whether any leaf definition declares a merge — the gate that keeps span-index reads (and the
|
|
2456
2469
|
* per-row span signature) entirely out of tables that never span.
|
|
2457
2470
|
*/
|
|
@@ -2593,9 +2606,10 @@ function DataCell({ cell, editing, rowEditing, isFirstDataCell, depth, rowSpan,
|
|
|
2593
2606
|
const editMode = ledger?.editing.mode ?? "cell";
|
|
2594
2607
|
const { meta } = column.columnDef;
|
|
2595
2608
|
const grouped = cell.getIsGrouped();
|
|
2596
|
-
const
|
|
2597
|
-
const
|
|
2598
|
-
const
|
|
2609
|
+
const groupRow = row.getIsGrouped();
|
|
2610
|
+
const aggregated = cell.getIsAggregated() && groupRow;
|
|
2611
|
+
const empty = cell.getIsPlaceholder() || groupRow && !grouped && !aggregated && !isInternalColumn(column.id);
|
|
2612
|
+
const gateOpen = !empty && canEditCell(cell, row);
|
|
2599
2613
|
const editable = !editing && gateOpen;
|
|
2600
2614
|
const cellEditorActive = editing && gateOpen;
|
|
2601
2615
|
const rowEditorActive = rowEditing && gateOpen;
|
|
@@ -2603,8 +2617,8 @@ function DataCell({ cell, editing, rowEditing, isFirstDataCell, depth, rowSpan,
|
|
|
2603
2617
|
const instantEdit = normalizedEdit?.kind === "instant" ? normalizedEdit : null;
|
|
2604
2618
|
let content;
|
|
2605
2619
|
if (grouped) content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupCell, { cell });
|
|
2606
|
-
else if (aggregated) content = (0, _tanstack_react_table.flexRender)(column.columnDef.aggregatedCell
|
|
2607
|
-
else if (
|
|
2620
|
+
else if (aggregated) content = (0, _tanstack_react_table.flexRender)(column.columnDef.aggregatedCell, cell.getContext());
|
|
2621
|
+
else if (empty) content = null;
|
|
2608
2622
|
else if (cellEditorActive) content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CellEditor, { cell });
|
|
2609
2623
|
else if (rowEditorActive) content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowCellEditor, { cell });
|
|
2610
2624
|
else if (editable && instantEdit && editMode === "cell") content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InstantCell, {
|
|
@@ -2746,6 +2760,7 @@ function DetailRow({ row, renderDetailPanel, colSpan, dragging, dropSide, last,
|
|
|
2746
2760
|
role: "row",
|
|
2747
2761
|
...getStyles("row", { style: pinnedStyle }),
|
|
2748
2762
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
2763
|
+
"data-leading": true,
|
|
2749
2764
|
colSpan,
|
|
2750
2765
|
role: "cell",
|
|
2751
2766
|
...getStyles("detailPanel"),
|
|
@@ -2761,10 +2776,12 @@ function SkeletonRows({ rowCount, columnCount, ariaRowIndexStart }) {
|
|
|
2761
2776
|
role: "row",
|
|
2762
2777
|
...getStyles("row"),
|
|
2763
2778
|
children: Array.from({ length: columnCount }, (_, columnIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
2779
|
+
"data-leading": columnIndex === 0 || void 0,
|
|
2764
2780
|
role: "cell",
|
|
2765
2781
|
...getStyles("cell"),
|
|
2766
2782
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Skeleton, {
|
|
2767
2783
|
height: 10,
|
|
2784
|
+
my: "calc((1lh - 10px) / 2)",
|
|
2768
2785
|
radius: "sm"
|
|
2769
2786
|
})
|
|
2770
2787
|
}, columnIndex))
|
|
@@ -2777,6 +2794,7 @@ function LoaderRow({ colSpan, ariaRowIndex }) {
|
|
|
2777
2794
|
role: "row",
|
|
2778
2795
|
...getStyles("loaderRow"),
|
|
2779
2796
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
2797
|
+
"data-leading": true,
|
|
2780
2798
|
colSpan,
|
|
2781
2799
|
role: "cell",
|
|
2782
2800
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2797,6 +2815,7 @@ function LoadMoreErrorRow({ colSpan, message, ariaRowIndex, onRetry }) {
|
|
|
2797
2815
|
role: "row",
|
|
2798
2816
|
...getStyles("loaderRow"),
|
|
2799
2817
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
2818
|
+
"data-leading": true,
|
|
2800
2819
|
colSpan,
|
|
2801
2820
|
role: "cell",
|
|
2802
2821
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2850,6 +2869,7 @@ function TableBody({ table, virtualization, columnWindow, viewportRef, loading,
|
|
|
2850
2869
|
estimateSize,
|
|
2851
2870
|
getItemKey,
|
|
2852
2871
|
getScrollElement: () => viewportRef.current,
|
|
2872
|
+
measureElement: measureRow,
|
|
2853
2873
|
overscan: virtualization?.overscan ?? DEFAULT_OVERSCAN,
|
|
2854
2874
|
useFlushSync: false
|
|
2855
2875
|
});
|
|
@@ -3037,7 +3057,7 @@ function tableHasFooter(table) {
|
|
|
3037
3057
|
}
|
|
3038
3058
|
function TableFooter({ table, ariaRowIndexStart, columnWindow }) {
|
|
3039
3059
|
const { getStyles, footerRowProps } = useDataTableContext();
|
|
3040
|
-
const renderCell = (footer, colSpan, ariaColIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.
|
|
3060
|
+
const renderCell = (footer, colSpan, ariaColIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
3041
3061
|
...mergeElementProps(resolveElementProps(footer.column.columnDef.meta?.footerCellProps, footer), {
|
|
3042
3062
|
"aria-colindex": ariaColIndex,
|
|
3043
3063
|
colSpan: colSpan ?? footer.colSpan,
|
|
@@ -3058,7 +3078,7 @@ function TableFooter({ table, ariaRowIndexStart, columnWindow }) {
|
|
|
3058
3078
|
role: "row",
|
|
3059
3079
|
...getStyles("footerRow")
|
|
3060
3080
|
}),
|
|
3061
|
-
children: columnWindow === null ? footerGroup.headers.map((footer) => renderCell(footer, void 0, void 0)) : windowHeaderCells(footerGroup.headers, columnWindow).map((cell) => cell.kind === "spacer" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
3081
|
+
children: columnWindow === null ? footerGroup.headers.map((footer) => renderCell(footer, void 0, void 0)) : windowHeaderCells(footerGroup.headers, columnWindow).map((cell) => cell.kind === "spacer" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
3062
3082
|
"aria-hidden": true,
|
|
3063
3083
|
"data-ledger-spacer": true
|
|
3064
3084
|
}, `ledger:spacer-${cell.edge}`) : renderCell(cell.header, cell.colSpan, cell.ariaColIndex))
|
|
@@ -3077,9 +3097,12 @@ function TableFooter({ table, ariaRowIndexStart, columnWindow }) {
|
|
|
3077
3097
|
* The column, its constraints and whether it carries a filter all arrive from the render that put
|
|
3078
3098
|
* the handle on screen, for the reason `use-column-resize.ts` gives.
|
|
3079
3099
|
*
|
|
3080
|
-
*
|
|
3081
|
-
*
|
|
3082
|
-
*
|
|
3100
|
+
* A content cell is measured out of the table's layout: for the pass it is a block as wide as its
|
|
3101
|
+
* content (`display: block; width: max-content`, no wrapping), so its width is the content's, in
|
|
3102
|
+
* whichever direction that lies. Read in place, a cell is never narrower than its column — a fixed
|
|
3103
|
+
* table lays every cell at the column's width, and a truncating span clips at it — so a fit could
|
|
3104
|
+
* only ever widen a column. Every cell is switched first and read afterwards, so the whole pass
|
|
3105
|
+
* costs one reflow, and each gets its own inline styles back before anything paints.
|
|
3083
3106
|
*/
|
|
3084
3107
|
/**
|
|
3085
3108
|
* Breathing room over the tightest fit — content flush against the column edge reads clipped.
|
|
@@ -3100,10 +3123,6 @@ function horizontalPadding(element) {
|
|
|
3100
3123
|
const style = getComputedStyle(element);
|
|
3101
3124
|
return asPx(style.paddingInlineStart) + asPx(style.paddingInlineEnd);
|
|
3102
3125
|
}
|
|
3103
|
-
function bodyCellWidth(cell) {
|
|
3104
|
-
const truncated = cell.querySelector(":scope [data-truncate]");
|
|
3105
|
-
return truncated ? truncated.scrollWidth + horizontalPadding(cell) : cell.scrollWidth;
|
|
3106
|
-
}
|
|
3107
3126
|
function headerCellWidth(th, hasFilter) {
|
|
3108
3127
|
const labelText = th.querySelector(":scope .ledger-header-label [data-truncate]");
|
|
3109
3128
|
if (!labelText) return th.scrollWidth;
|
|
@@ -3114,16 +3133,29 @@ function headerCellWidth(th, hasFilter) {
|
|
|
3114
3133
|
function autosizeColumn(setColumnSizing, { columnId, minSize, maxSize, hasFilter }, main) {
|
|
3115
3134
|
const selector = `[data-ledger-column-id="${CSS.escape(columnId)}"]`;
|
|
3116
3135
|
const headerCell = main.querySelector(`:scope .ledger-header ${selector}`);
|
|
3117
|
-
const
|
|
3118
|
-
const footerCells = [...main.querySelectorAll(`:scope .ledger-footer ${selector}`)].filter((cell) => cell.colSpan <= 1);
|
|
3119
|
-
const contentCells = [...bodyCells, ...footerCells];
|
|
3136
|
+
const contentCells = [...main.querySelectorAll(`:scope :is(.ledger-tbody, .ledger-footer) ${selector}`)].filter((cell) => cell.colSpan <= 1);
|
|
3120
3137
|
const cells = headerCell ? [headerCell, ...contentCells] : contentCells;
|
|
3121
3138
|
if (cells.length === 0) return;
|
|
3122
|
-
const
|
|
3139
|
+
const previous = cells.map((cell) => {
|
|
3140
|
+
return {
|
|
3141
|
+
display: cell.style.display,
|
|
3142
|
+
whiteSpace: cell.style.whiteSpace,
|
|
3143
|
+
width: cell.style.width
|
|
3144
|
+
};
|
|
3145
|
+
});
|
|
3123
3146
|
for (const cell of cells) cell.style.whiteSpace = "nowrap";
|
|
3147
|
+
for (const cell of contentCells) {
|
|
3148
|
+
cell.style.display = "block";
|
|
3149
|
+
cell.style.width = "max-content";
|
|
3150
|
+
}
|
|
3124
3151
|
let content = headerCell ? headerCellWidth(headerCell, hasFilter) : 0;
|
|
3125
|
-
for (const cell of contentCells) content = Math.max(content,
|
|
3126
|
-
for (const [index, cell] of cells.entries())
|
|
3152
|
+
for (const cell of contentCells) content = Math.max(content, cell.scrollWidth);
|
|
3153
|
+
for (const [index, cell] of cells.entries()) {
|
|
3154
|
+
const styles = previous[index];
|
|
3155
|
+
cell.style.display = styles?.display ?? "";
|
|
3156
|
+
cell.style.whiteSpace = styles?.whiteSpace ?? "";
|
|
3157
|
+
cell.style.width = styles?.width ?? "";
|
|
3158
|
+
}
|
|
3127
3159
|
const next = Math.min(Math.max(Math.round(content + AUTOSIZE_SLACK_PX), minSize), maxSize);
|
|
3128
3160
|
setColumnSizing((previous) => previous[columnId] === next ? previous : {
|
|
3129
3161
|
...previous,
|
|
@@ -3323,6 +3355,7 @@ function RangeFilter({ column, name }) {
|
|
|
3323
3355
|
wrap: "nowrap",
|
|
3324
3356
|
children: [
|
|
3325
3357
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.NumberInput, {
|
|
3358
|
+
hideControls: true,
|
|
3326
3359
|
"aria-label": labels.filterRangeMin,
|
|
3327
3360
|
flex: 1,
|
|
3328
3361
|
placeholder: facetMin === void 0 ? labels.filterRangeMin : String(facetMin),
|
|
@@ -3330,6 +3363,7 @@ function RangeFilter({ column, name }) {
|
|
|
3330
3363
|
onChange: setBound(0)
|
|
3331
3364
|
}),
|
|
3332
3365
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.NumberInput, {
|
|
3366
|
+
hideControls: true,
|
|
3333
3367
|
"aria-label": labels.filterRangeMax,
|
|
3334
3368
|
flex: 1,
|
|
3335
3369
|
placeholder: facetMax === void 0 ? labels.filterRangeMax : String(facetMax),
|
|
@@ -3685,7 +3719,11 @@ function HeaderCell({ header, table, reorder, resize, columnWidths, columnSizing
|
|
|
3685
3719
|
...getStyles("headerCell", { style: pinnedCellStyle(column) }),
|
|
3686
3720
|
...reorder.getHeaderProps(column.id)
|
|
3687
3721
|
}),
|
|
3688
|
-
children: header.isPlaceholder ? null : internal ?
|
|
3722
|
+
children: header.isPlaceholder ? null : internal ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3723
|
+
...getStyles("headerLabel"),
|
|
3724
|
+
"data-align": "center",
|
|
3725
|
+
children: label
|
|
3726
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
3689
3727
|
canSort ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3690
3728
|
type: "button",
|
|
3691
3729
|
onClick: handleSortClick,
|
|
@@ -6514,31 +6552,36 @@ function useStylesRevision(getStyles, selectors) {
|
|
|
6514
6552
|
return revision;
|
|
6515
6553
|
}
|
|
6516
6554
|
//#endregion
|
|
6517
|
-
//#region src/use-viewport-
|
|
6555
|
+
//#region src/use-viewport-fit.ts
|
|
6556
|
+
const UNMEASURED = {
|
|
6557
|
+
overflowing: false,
|
|
6558
|
+
underfilled: false
|
|
6559
|
+
};
|
|
6518
6560
|
/**
|
|
6519
|
-
*
|
|
6520
|
-
*
|
|
6521
|
-
*
|
|
6522
|
-
*
|
|
6523
|
-
* Measured whenever the viewport or its content resizes: rows arriving, columns widening, or
|
|
6524
|
-
* the host resizing the table each change the answer without a scroll event. A 1px tolerance
|
|
6525
|
-
* absorbs fractional layout rounding, which would otherwise flicker the stop on and off.
|
|
6561
|
+
* Layout sizes only, never rects: a transform (a modal scaling in) would shrink a rect but not
|
|
6562
|
+
* the viewport's client box, and nothing re-measures when the transform ends. A 1px tolerance
|
|
6563
|
+
* absorbs fractional layout rounding, which would otherwise flicker either answer.
|
|
6526
6564
|
*/
|
|
6527
|
-
function
|
|
6528
|
-
const [
|
|
6565
|
+
function useViewportFit(viewport) {
|
|
6566
|
+
const [fit, setFit] = (0, react.useState)(UNMEASURED);
|
|
6529
6567
|
(0, react.useLayoutEffect)(() => {
|
|
6530
6568
|
if (!viewport) return;
|
|
6569
|
+
const content = viewport.firstElementChild;
|
|
6531
6570
|
const measure = () => {
|
|
6532
|
-
const
|
|
6533
|
-
|
|
6571
|
+
const overflowing = viewport.scrollHeight - viewport.clientHeight > 1 || viewport.scrollWidth - viewport.clientWidth > 1;
|
|
6572
|
+
const underfilled = content instanceof HTMLElement && viewport.clientHeight - content.offsetHeight >= 1;
|
|
6573
|
+
setFit((previous) => previous.overflowing === overflowing && previous.underfilled === underfilled ? previous : {
|
|
6574
|
+
overflowing,
|
|
6575
|
+
underfilled
|
|
6576
|
+
});
|
|
6534
6577
|
};
|
|
6535
6578
|
measure();
|
|
6536
6579
|
const observer = new ResizeObserver(measure);
|
|
6537
6580
|
observer.observe(viewport);
|
|
6538
|
-
if (
|
|
6581
|
+
if (content) observer.observe(content);
|
|
6539
6582
|
return () => observer.disconnect();
|
|
6540
6583
|
}, [viewport]);
|
|
6541
|
-
return
|
|
6584
|
+
return fit;
|
|
6542
6585
|
}
|
|
6543
6586
|
//#endregion
|
|
6544
6587
|
//#region src/data-table.tsx
|
|
@@ -6790,7 +6833,7 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
6790
6833
|
viewportRef.current = element;
|
|
6791
6834
|
setViewport(element);
|
|
6792
6835
|
}, []);
|
|
6793
|
-
const
|
|
6836
|
+
const viewportFit = useViewportFit(viewport);
|
|
6794
6837
|
const startLeafColumns = table.getStartVisibleLeafColumns();
|
|
6795
6838
|
const endLeafColumns = table.getEndVisibleLeafColumns();
|
|
6796
6839
|
const displayColumns = [
|
|
@@ -6879,6 +6922,7 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
6879
6922
|
leftOffset += width;
|
|
6880
6923
|
}
|
|
6881
6924
|
}
|
|
6925
|
+
varsMap["--ledger-pinned-start-width"] = `${leftOffset}px`;
|
|
6882
6926
|
let rightOffset = 0;
|
|
6883
6927
|
for (let index = visibleLeafColumns.length - 1; index >= 0; index -= 1) {
|
|
6884
6928
|
const column = visibleLeafColumns[index];
|
|
@@ -7143,7 +7187,7 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7143
7187
|
]);
|
|
7144
7188
|
const activeRowAnnouncer = (0, react.useRef)(null);
|
|
7145
7189
|
const rowNavigationHintId = `${instanceId}-row-navigation`;
|
|
7146
|
-
const viewportFocusStop = activeRowEnabled ||
|
|
7190
|
+
const viewportFocusStop = activeRowEnabled || viewportFit.overflowing;
|
|
7147
7191
|
const viewportDescribedBy = activeRowEnabled ? [viewportProps?.["aria-describedby"], rowNavigationHintId].filter(Boolean).join(" ") : viewportProps?.["aria-describedby"];
|
|
7148
7192
|
const announceActiveRow = useEventCallback(() => {
|
|
7149
7193
|
const target = activeRowAnnouncer.current;
|
|
@@ -7253,7 +7297,8 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7253
7297
|
width: columnWidths.total > 0 ? columnWidths.total : void 0,
|
|
7254
7298
|
minWidth: toPx(tableMinWidth),
|
|
7255
7299
|
borderCollapse: "separate",
|
|
7256
|
-
borderSpacing: 0
|
|
7300
|
+
borderSpacing: 0,
|
|
7301
|
+
fontSize: "inherit"
|
|
7257
7302
|
} });
|
|
7258
7303
|
const rowOrderingEnabled = ledger?.rowOrdering.enabled === true;
|
|
7259
7304
|
const nameReorderRow = useEventCallback((row) => {
|
|
@@ -7333,6 +7378,7 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7333
7378
|
"data-scrolled-start": scrollEdges.start || void 0,
|
|
7334
7379
|
"data-size": size,
|
|
7335
7380
|
"data-striped": stripedMode,
|
|
7381
|
+
"data-underfilled": viewportFit.underfilled || void 0,
|
|
7336
7382
|
"data-virtualized-columns": columnWindow !== null || void 0,
|
|
7337
7383
|
"data-virtualized-rows": virtualEnabled || void 0,
|
|
7338
7384
|
"data-with-bottom-border": withBottomBorder || void 0,
|
|
@@ -7513,13 +7559,15 @@ DataTable.SelectionBar = DataTableSelectionBar;
|
|
|
7513
7559
|
* renderer over the public editing contexts (docs/editing.md#editors), which is the proof the
|
|
7514
7560
|
* contexts suffice: anything these do, an application's own renderer can do the same way.
|
|
7515
7561
|
* All are default-variant Mantine inputs at the context's `size` — the border marks the cell as an
|
|
7516
|
-
* open editor, and the size keeps it inside the row.
|
|
7562
|
+
* open editor, and the size keeps it inside the row. The fields fill the cell (`flex={1}` in the
|
|
7563
|
+
* host's flex line); the checkbox keeps its own size, placed by the column's alignment.
|
|
7517
7564
|
*/
|
|
7518
7565
|
const renderTextEditor = ({ value, setValue, error, pending, autoFocus, label, size }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.TextInput, {
|
|
7519
7566
|
"aria-label": label,
|
|
7520
7567
|
autoFocus,
|
|
7521
7568
|
disabled: pending,
|
|
7522
7569
|
error,
|
|
7570
|
+
flex: 1,
|
|
7523
7571
|
size,
|
|
7524
7572
|
value: value === null || value === void 0 ? "" : String(value),
|
|
7525
7573
|
onChange: (event) => setValue(event.currentTarget.value)
|
|
@@ -7536,6 +7584,7 @@ const renderNumberEditor = ({ value, setValue, error, pending, autoFocus, label,
|
|
|
7536
7584
|
autoFocus,
|
|
7537
7585
|
disabled: pending,
|
|
7538
7586
|
error,
|
|
7587
|
+
flex: 1,
|
|
7539
7588
|
size,
|
|
7540
7589
|
value: typeof value === "number" || typeof value === "string" ? value : "",
|
|
7541
7590
|
onChange: (next) => setValue(next === "" ? null : next)
|
|
@@ -7560,6 +7609,7 @@ function selectEditor(options) {
|
|
|
7560
7609
|
defaultDropdownOpened: mode === "cell",
|
|
7561
7610
|
disabled: pending,
|
|
7562
7611
|
error,
|
|
7612
|
+
flex: 1,
|
|
7563
7613
|
size,
|
|
7564
7614
|
value: value === null || value === void 0 ? null : String(value),
|
|
7565
7615
|
onChange: (next) => {
|