u
This commit is contained in:
@@ -83,8 +83,10 @@ export function createDummyTestQuote() {
|
||||
const rowGridSx = {
|
||||
display: 'grid',
|
||||
gridTemplateColumns: 'max-content max-content 1fr max-content max-content max-content auto',
|
||||
gridTemplateRows: '0px 1fr',
|
||||
rowGap: 0,
|
||||
columnGap: 1.5,
|
||||
alignItems: 'center',
|
||||
gap: 1.5,
|
||||
width: '100%',
|
||||
boxSizing: 'border-box',
|
||||
};
|
||||
@@ -92,8 +94,8 @@ const rowGridSx = {
|
||||
const ellipsisSx = { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' };
|
||||
|
||||
const measuringCellSx = {
|
||||
border: '1px dashed #1976d2',
|
||||
opacity: 0.55,
|
||||
visibility: 'hidden',
|
||||
height: 0,
|
||||
boxSizing: 'border-box',
|
||||
pointerEvents: 'none',
|
||||
textTransform: 'none',
|
||||
@@ -127,7 +129,7 @@ function renderInvisibleDummyRow(dummy) {
|
||||
</Box>
|
||||
<Box aria-hidden sx={{ gridColumn: 5, gridRow: 1, display: 'flex', gap: '3px', alignItems: 'center', whiteSpace: 'nowrap', ...measuringCellSx }}>
|
||||
{(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 aria-hidden sx={{ gridColumn: 6, gridRow: 1, whiteSpace: 'nowrap', display: 'flex', justifyContent: 'flex-end', ...measuringCellSx }}>
|
||||
@@ -176,15 +178,15 @@ class QuoteRow extends PureComponent {
|
||||
);
|
||||
}
|
||||
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)}
|
||||
<Box sx={{ gridColumn: 1, gridRow: 2, border: '1px solid red' }}><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: 3, gridRow: 2, border: '1px solid red' }}><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: 5, gridRow: 2, display: 'flex', alignItems: 'center', gap: '3px', border: '1px solid red' }}><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: 7, gridRow: 2, border: '1px solid red' }} />
|
||||
<Box sx={{ gridColumn: 1, gridRow: 2 }}><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 }}><Skeleton variant="text" width="60%" 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' }}><Skeleton variant="rounded" width={15} 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 }} />
|
||||
</ListItemButton>
|
||||
);
|
||||
}
|
||||
@@ -199,31 +201,31 @@ class QuoteRow extends PureComponent {
|
||||
return (
|
||||
<ListItemButton
|
||||
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)}
|
||||
disabled={disabled}
|
||||
>
|
||||
{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 }}>
|
||||
{quote.number}
|
||||
</Typography>
|
||||
</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}>
|
||||
{quote.date ? formatDate(quote.date) : '–'}
|
||||
</Typography>
|
||||
</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 }}>
|
||||
{customer}
|
||||
</Typography>
|
||||
</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
|
||||
size="small"
|
||||
label={posCount}
|
||||
@@ -253,7 +255,6 @@ class QuoteRow extends PureComponent {
|
||||
overflow: 'hidden',
|
||||
width: 0,
|
||||
minWidth: '100%',
|
||||
border: '1px solid red',
|
||||
}}
|
||||
>
|
||||
{files.slice(0, 4).map((file, index) => {
|
||||
@@ -315,7 +316,7 @@ class QuoteRow extends PureComponent {
|
||||
})}
|
||||
</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
|
||||
variant="body2"
|
||||
sx={{ fontWeight: 600, fontVariantNumeric: 'tabular-nums', textAlign: 'right', whiteSpace: 'nowrap' }}
|
||||
@@ -324,7 +325,7 @@ class QuoteRow extends PureComponent {
|
||||
</Typography>
|
||||
</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
|
||||
aria-label={`„${quote.number}“ löschen`}
|
||||
disabled={busyId != null || disabled}
|
||||
@@ -683,21 +684,21 @@ export class QuoteList extends PureComponent {
|
||||
<Box
|
||||
sx={{
|
||||
...rowGridSx,
|
||||
height: 36,
|
||||
minHeight: 36,
|
||||
px: 2,
|
||||
py: 0.5,
|
||||
borderBottom: '1px solid',
|
||||
borderColor: 'divider',
|
||||
}}
|
||||
>
|
||||
{renderInvisibleDummyRow(this.headerItem)}
|
||||
<Box sx={{ gridColumn: 1, gridRow: 2, ...headerCellSx, border: '1px solid red' }}>Nr.</Box>
|
||||
<Box sx={{ gridColumn: 2, gridRow: 2, ...headerCellSx, border: '1px solid red' }}>Datum</Box>
|
||||
<Box sx={{ gridColumn: 3, gridRow: 2, ...headerCellSx, border: '1px solid red' }}>Kunde</Box>
|
||||
<Box sx={{ gridColumn: 4, gridRow: 2, display: 'flex', justifyContent: 'center', textAlign: 'center', ...headerCellSx, border: '1px solid red' }}>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: 6, gridRow: 2, textAlign: 'right', ...headerCellSx, border: '1px solid red' }}>Gesamt</Box>
|
||||
<Box sx={{ gridColumn: 7, gridRow: 2, ...headerCellSx, border: '1px solid red' }} />
|
||||
<Box sx={{ gridColumn: 1, gridRow: 2, ...headerCellSx }}>Nr.</Box>
|
||||
<Box sx={{ gridColumn: 2, gridRow: 2, ...headerCellSx }}>Datum</Box>
|
||||
<Box sx={{ gridColumn: 3, gridRow: 2, ...headerCellSx }}>Kunde</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 }}></Box>
|
||||
<Box sx={{ gridColumn: 6, gridRow: 2, textAlign: 'right', ...headerCellSx }}>Gesamt</Box>
|
||||
<Box sx={{ gridColumn: 7, gridRow: 2, ...headerCellSx }} />
|
||||
</Box>
|
||||
}
|
||||
onPageChange={this.handlePageChange}
|
||||
|
||||
Reference in New Issue
Block a user