This commit is contained in:
seb
2026-10-15 03:42:19 +02:00
parent 9817d4abda
commit 37acaf9554

View File

@@ -83,8 +83,10 @@ export function createDummyTestQuote() {
const rowGridSx = { const rowGridSx = {
display: 'grid', display: 'grid',
gridTemplateColumns: 'max-content max-content 1fr max-content max-content max-content auto', gridTemplateColumns: 'max-content max-content 1fr max-content max-content max-content auto',
gridTemplateRows: '0px 1fr',
rowGap: 0,
columnGap: 1.5,
alignItems: 'center', alignItems: 'center',
gap: 1.5,
width: '100%', width: '100%',
boxSizing: 'border-box', boxSizing: 'border-box',
}; };
@@ -92,8 +94,8 @@ const rowGridSx = {
const ellipsisSx = { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }; const ellipsisSx = { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' };
const measuringCellSx = { const measuringCellSx = {
border: '1px dashed #1976d2', visibility: 'hidden',
opacity: 0.55, height: 0,
boxSizing: 'border-box', boxSizing: 'border-box',
pointerEvents: 'none', pointerEvents: 'none',
textTransform: 'none', textTransform: 'none',
@@ -127,7 +129,7 @@ function renderInvisibleDummyRow(dummy) {
</Box> </Box>
<Box aria-hidden sx={{ gridColumn: 5, gridRow: 1, display: 'flex', gap: '3px', alignItems: 'center', whiteSpace: 'nowrap', ...measuringCellSx }}> <Box aria-hidden sx={{ gridColumn: 5, gridRow: 1, display: 'flex', gap: '3px', alignItems: 'center', whiteSpace: 'nowrap', ...measuringCellSx }}>
{(d.files || []).map((file, i) => ( {(d.files || []).map((file, i) => (
<Box key={file.id ?? file.fileId ?? i} sx={{ width: 15, height: 20, flexShrink: 0, bgcolor: 'primary.light', borderRadius: 0.5 }} /> <Box key={file.id ?? file.fileId ?? i} sx={{ width: 15, height: 20, flexShrink: 0 }} />
))} ))}
</Box> </Box>
<Box aria-hidden sx={{ gridColumn: 6, gridRow: 1, whiteSpace: 'nowrap', display: 'flex', justifyContent: 'flex-end', ...measuringCellSx }}> <Box aria-hidden sx={{ gridColumn: 6, gridRow: 1, whiteSpace: 'nowrap', display: 'flex', justifyContent: 'flex-end', ...measuringCellSx }}>
@@ -176,15 +178,15 @@ class QuoteRow extends PureComponent {
); );
} }
return ( return (
<ListItemButton disabled divider sx={{ ...rowGridSx, minHeight: 64, px: 2, py: 0.5 }}> <ListItemButton disabled divider sx={{ ...rowGridSx, height: 64, minHeight: 64, maxHeight: 64, px: 2, py: 0 }}>
{renderInvisibleDummyRow(dummy)} {renderInvisibleDummyRow(dummy)}
<Box sx={{ gridColumn: 1, gridRow: 2, border: '1px solid red' }}><Skeleton variant="text" width="90%" height={20} /></Box> <Box sx={{ gridColumn: 1, gridRow: 2 }}><Skeleton variant="text" width="90%" height={20} /></Box>
<Box sx={{ gridColumn: 2, gridRow: 2, border: '1px solid red' }}><Skeleton variant="text" width="90%" height={20} /></Box> <Box sx={{ gridColumn: 2, gridRow: 2 }}><Skeleton variant="text" width="90%" height={20} /></Box>
<Box sx={{ gridColumn: 3, gridRow: 2, border: '1px solid red' }}><Skeleton variant="text" width="60%" height={20} /></Box> <Box sx={{ gridColumn: 3, gridRow: 2 }}><Skeleton variant="text" width="60%" height={20} /></Box>
<Box sx={{ gridColumn: 4, gridRow: 2, display: 'flex', justifyContent: 'center', border: '1px solid red' }}><Skeleton variant="rounded" width={28} height={20} /></Box> <Box sx={{ gridColumn: 4, gridRow: 2, display: 'flex', justifyContent: 'center' }}><Skeleton variant="rounded" width={28} height={20} /></Box>
<Box sx={{ gridColumn: 5, gridRow: 2, display: 'flex', alignItems: 'center', gap: '3px', border: '1px solid red' }}><Skeleton variant="rounded" width={15} height={20} /></Box> <Box sx={{ gridColumn: 5, gridRow: 2, display: 'flex', alignItems: 'center', gap: '3px' }}><Skeleton variant="rounded" width={15} height={20} /></Box>
<Box sx={{ gridColumn: 6, gridRow: 2, display: 'flex', justifyContent: 'flex-end', border: '1px solid red' }}><Skeleton variant="text" width="80%" height={20} /></Box> <Box sx={{ gridColumn: 6, gridRow: 2, display: 'flex', justifyContent: 'flex-end' }}><Skeleton variant="text" width="80%" height={20} /></Box>
<Box sx={{ gridColumn: 7, gridRow: 2, border: '1px solid red' }} /> <Box sx={{ gridColumn: 7, gridRow: 2 }} />
</ListItemButton> </ListItemButton>
); );
} }
@@ -199,31 +201,31 @@ class QuoteRow extends PureComponent {
return ( return (
<ListItemButton <ListItemButton
divider divider
sx={{ ...rowGridSx, minHeight: 64, px: 2, py: 0.5 }} sx={{ ...rowGridSx, height: 64, minHeight: 64, maxHeight: 64, px: 2, py: 0 }}
onClick={disabled ? undefined : () => onOpen?.(quote)} onClick={disabled ? undefined : () => onOpen?.(quote)}
disabled={disabled} disabled={disabled}
> >
{renderInvisibleDummyRow(dummy)} {renderInvisibleDummyRow(dummy)}
<Box sx={{ gridColumn: 1, gridRow: 2, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', border: '1px solid red' }}> <Box sx={{ gridColumn: 1, gridRow: 2, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
<Typography variant="body1" sx={{ fontWeight: 600, ...ellipsisSx }}> <Typography variant="body1" sx={{ fontWeight: 600, ...ellipsisSx }}>
{quote.number} {quote.number}
</Typography> </Typography>
</Box> </Box>
<Box sx={{ gridColumn: 2, gridRow: 2, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', border: '1px solid red' }}> <Box sx={{ gridColumn: 2, gridRow: 2, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
<Typography variant="body2" color="text.secondary" sx={ellipsisSx}> <Typography variant="body2" color="text.secondary" sx={ellipsisSx}>
{quote.date ? formatDate(quote.date) : '–'} {quote.date ? formatDate(quote.date) : '–'}
</Typography> </Typography>
</Box> </Box>
<Box sx={{ gridColumn: 3, gridRow: 2, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', border: '1px solid red' }}> <Box sx={{ gridColumn: 3, gridRow: 2, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
<Typography variant="body1" sx={{ fontWeight: 500, ...ellipsisSx }}> <Typography variant="body1" sx={{ fontWeight: 500, ...ellipsisSx }}>
{customer} {customer}
</Typography> </Typography>
</Box> </Box>
<Box sx={{ gridColumn: 4, gridRow: 2, display: 'flex', justifyContent: 'center', border: '1px solid red' }}> <Box sx={{ gridColumn: 4, gridRow: 2, display: 'flex', justifyContent: 'center' }}>
<Chip <Chip
size="small" size="small"
label={posCount} label={posCount}
@@ -253,7 +255,6 @@ class QuoteRow extends PureComponent {
overflow: 'hidden', overflow: 'hidden',
width: 0, width: 0,
minWidth: '100%', minWidth: '100%',
border: '1px solid red',
}} }}
> >
{files.slice(0, 4).map((file, index) => { {files.slice(0, 4).map((file, index) => {
@@ -315,7 +316,7 @@ class QuoteRow extends PureComponent {
})} })}
</Box> </Box>
<Box sx={{ gridColumn: 6, gridRow: 2, display: 'flex', justifyContent: 'flex-end', border: '1px solid red' }}> <Box sx={{ gridColumn: 6, gridRow: 2, display: 'flex', justifyContent: 'flex-end' }}>
<Typography <Typography
variant="body2" variant="body2"
sx={{ fontWeight: 600, fontVariantNumeric: 'tabular-nums', textAlign: 'right', whiteSpace: 'nowrap' }} sx={{ fontWeight: 600, fontVariantNumeric: 'tabular-nums', textAlign: 'right', whiteSpace: 'nowrap' }}
@@ -324,7 +325,7 @@ class QuoteRow extends PureComponent {
</Typography> </Typography>
</Box> </Box>
<Box sx={{ gridColumn: 7, gridRow: 2, display: 'flex', justifyContent: 'center', border: '1px solid red' }}> <Box sx={{ gridColumn: 7, gridRow: 2, display: 'flex', justifyContent: 'center' }}>
<IconButton <IconButton
aria-label={`„${quote.number}“ löschen`} aria-label={`„${quote.number}“ löschen`}
disabled={busyId != null || disabled} disabled={busyId != null || disabled}
@@ -683,21 +684,21 @@ export class QuoteList extends PureComponent {
<Box <Box
sx={{ sx={{
...rowGridSx, ...rowGridSx,
height: 36,
minHeight: 36, minHeight: 36,
px: 2, px: 2,
py: 0.5,
borderBottom: '1px solid', borderBottom: '1px solid',
borderColor: 'divider', borderColor: 'divider',
}} }}
> >
{renderInvisibleDummyRow(this.headerItem)} {renderInvisibleDummyRow(this.headerItem)}
<Box sx={{ gridColumn: 1, gridRow: 2, ...headerCellSx, border: '1px solid red' }}>Nr.</Box> <Box sx={{ gridColumn: 1, gridRow: 2, ...headerCellSx }}>Nr.</Box>
<Box sx={{ gridColumn: 2, gridRow: 2, ...headerCellSx, border: '1px solid red' }}>Datum</Box> <Box sx={{ gridColumn: 2, gridRow: 2, ...headerCellSx }}>Datum</Box>
<Box sx={{ gridColumn: 3, gridRow: 2, ...headerCellSx, border: '1px solid red' }}>Kunde</Box> <Box sx={{ gridColumn: 3, gridRow: 2, ...headerCellSx }}>Kunde</Box>
<Box sx={{ gridColumn: 4, gridRow: 2, display: 'flex', justifyContent: 'center', textAlign: 'center', ...headerCellSx, border: '1px solid red' }}>Pos.</Box> <Box sx={{ gridColumn: 4, gridRow: 2, display: 'flex', justifyContent: 'center', textAlign: 'center', ...headerCellSx }}>Pos.</Box>
<Box sx={{ gridColumn: 5, gridRow: 2, textAlign: 'left', minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', ...headerCellSx, border: '1px solid red' }}></Box> <Box sx={{ gridColumn: 5, gridRow: 2, textAlign: 'left', minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', ...headerCellSx }}></Box>
<Box sx={{ gridColumn: 6, gridRow: 2, textAlign: 'right', ...headerCellSx, border: '1px solid red' }}>Gesamt</Box> <Box sx={{ gridColumn: 6, gridRow: 2, textAlign: 'right', ...headerCellSx }}>Gesamt</Box>
<Box sx={{ gridColumn: 7, gridRow: 2, ...headerCellSx, border: '1px solid red' }} /> <Box sx={{ gridColumn: 7, gridRow: 2, ...headerCellSx }} />
</Box> </Box>
} }
onPageChange={this.handlePageChange} onPageChange={this.handlePageChange}