This commit is contained in:
seb
2026-10-15 21:52:35 +02:00
parent 5d5c18635d
commit aeb9456204

View File

@@ -458,7 +458,7 @@ class FillSpace extends Component {
const total = totalCount != null ? Number(totalCount) : list.length;
const rawUnfiltered = propUnfilteredTotal ?? unfilteredCount;
const unfilteredTotal = rawUnfiltered != null ? Number(rawUnfiltered) : null;
const fullTotal = unfilteredTotal != null ? unfilteredTotal : Math.max(this.maxSeenCount || 0, total);
const fullTotal = unfilteredTotal != null ? Math.max(unfilteredTotal, total) : Math.max(this.maxSeenCount || 0, total);
const needsPaginationContainer = fullTotal > pageSize;
const showPaginationControls = total > pageSize;
const pageCount = Math.max(1, Math.ceil(total / Math.max(1, pageSize)));
@@ -502,7 +502,6 @@ class FillSpace extends Component {
sx={{ mb: 1, height: 44, overflow: 'hidden' }}
>
<Box
aria-hidden={!showPaginationControls || undefined}
sx={{
display: 'flex',
justifyContent: 'space-between',
@@ -511,8 +510,6 @@ class FillSpace extends Component {
gap: 1,
width: '100%',
height: 44,
visibility: showPaginationControls ? 'visible' : 'hidden',
pointerEvents: showPaginationControls ? 'auto' : 'none',
}}
>
<Typography
@@ -521,8 +518,15 @@ class FillSpace extends Component {
noWrap
sx={{ flexShrink: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis' }}
>
{total === 0 ? '0' : `${offset + 1}–${Math.min(offset + pageSize, total)}`} von{' '}
{total}
{total === 0
? (unfilteredTotal != null && unfilteredTotal > 0
? `0 von ${total} (${unfilteredTotal} gesamt)`
: '0')
: `${offset + 1}–${Math.min(offset + pageSize, total)} von ${total}${
unfilteredTotal != null && unfilteredTotal > total
? ` (${unfilteredTotal} gesamt)`
: ''
}`}
</Typography>
<Pagination
count={pageCount}
@@ -543,6 +547,8 @@ class FillSpace extends Component {
height: 44,
fontSize: '1rem',
},
visibility: showPaginationControls ? 'visible' : 'hidden',
pointerEvents: showPaginationControls ? 'auto' : 'none',
}}
/>
</Box>