forked from CITKParus/P8-Panels
WEB APP: P8PTable - исправлена ошибка вёрстки сообщения об отсутствии данных
This commit is contained in:
parent
a494706be5
commit
3883e485dd
@ -798,8 +798,8 @@ const P8PTable = ({
|
|||||||
))}
|
))}
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{rows.length > 0
|
{rows.length > 0 ? (
|
||||||
? (Array.isArray(groups) && groups.length > 0 ? groups : [{}]).map((group, g) => {
|
(Array.isArray(groups) && groups.length > 0 ? groups : [{}]).map((group, g) => {
|
||||||
const rowsView = rows.map((row, i) =>
|
const rowsView = rows.map((row, i) =>
|
||||||
!group?.name || group?.name == row.groupName ? (
|
!group?.name || group?.name == row.groupName ? (
|
||||||
<React.Fragment key={`data-${i}`}>
|
<React.Fragment key={`data-${i}`}>
|
||||||
@ -826,9 +826,7 @@ const P8PTable = ({
|
|||||||
key={`data-cell-${j}`}
|
key={`data-cell-${j}`}
|
||||||
align={getAlignByDataType(columnDef)}
|
align={getAlignByDataType(columnDef)}
|
||||||
sx={{
|
sx={{
|
||||||
...(columnDef.width
|
...(columnDef.width ? { minWidth: columnDef.width, maxWidth: columnDef.width } : {}),
|
||||||
? { minWidth: columnDef.width, maxWidth: columnDef.width }
|
|
||||||
: {}),
|
|
||||||
...(columnDef.fixed ? STYLES.TABLE_CELL_STICKY(theme, columnDef.fixedLeft) : {}),
|
...(columnDef.fixed ? STYLES.TABLE_CELL_STICKY(theme, columnDef.fixedLeft) : {}),
|
||||||
...customRender.cellStyle
|
...customRender.cellStyle
|
||||||
}}
|
}}
|
||||||
@ -850,9 +848,7 @@ const P8PTable = ({
|
|||||||
...STYLES.TABLE_CELL_EXPAND_CONTAINER,
|
...STYLES.TABLE_CELL_EXPAND_CONTAINER,
|
||||||
...(fixedColumns ? STYLES.TABLE_CELL_STICKY(theme, 0) : {})
|
...(fixedColumns ? STYLES.TABLE_CELL_STICKY(theme, 0) : {})
|
||||||
}}
|
}}
|
||||||
colSpan={
|
colSpan={fixedColumns ? header.displayFixedColumnsCount + 1 : header.displayDataColumnsCount}
|
||||||
fixedColumns ? header.displayFixedColumnsCount + 1 : header.displayDataColumnsCount
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{rowExpandRender({ columnsDef, row })}
|
{rowExpandRender({ columnsDef, row })}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@ -870,15 +866,17 @@ const P8PTable = ({
|
|||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
: null}
|
) : noDataFoundText && !reloading ? (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={header.displayDataColumnsCount}>
|
||||||
|
<P8PAppInlineError text={noDataFoundText} />
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
) : null}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
</TableContainer>
|
</TableContainer>
|
||||||
{rows.length == 0 ? (
|
{morePages ? (
|
||||||
noDataFoundText && !reloading ? (
|
|
||||||
<P8PAppInlineError text={noDataFoundText} />
|
|
||||||
) : null
|
|
||||||
) : morePages ? (
|
|
||||||
<Container style={STYLES.MORE_BUTTON_CONTAINER}>
|
<Container style={STYLES.MORE_BUTTON_CONTAINER}>
|
||||||
<Button fullWidth onClick={handleMorePagesBtnClick}>
|
<Button fullWidth onClick={handleMorePagesBtnClick}>
|
||||||
{morePagesBtnCaption}
|
{morePagesBtnCaption}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user