|
|
|
@ -14,11 +14,10 @@ export interface FooterRowProps { |
|
|
|
footerGroups: HeaderGroup[]; |
|
|
|
footerGroups: HeaderGroup[]; |
|
|
|
footerValues: FooterItem[]; |
|
|
|
footerValues: FooterItem[]; |
|
|
|
isPaginationVisible: boolean; |
|
|
|
isPaginationVisible: boolean; |
|
|
|
height: number; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export const FooterRow = (props: FooterRowProps) => { |
|
|
|
export const FooterRow = (props: FooterRowProps) => { |
|
|
|
const { totalColumnsWidth, footerGroups, height, isPaginationVisible } = props; |
|
|
|
const { totalColumnsWidth, footerGroups, isPaginationVisible } = props; |
|
|
|
const e2eSelectorsTable = selectors.components.Panels.Visualization.Table; |
|
|
|
const e2eSelectorsTable = selectors.components.Panels.Visualization.Table; |
|
|
|
const tableStyles = useStyles2(getTableStyles); |
|
|
|
const tableStyles = useStyles2(getTableStyles); |
|
|
|
|
|
|
|
|
|
|
|
@ -33,14 +32,8 @@ export const FooterRow = (props: FooterRowProps) => { |
|
|
|
{footerGroups.map((footerGroup: HeaderGroup) => { |
|
|
|
{footerGroups.map((footerGroup: HeaderGroup) => { |
|
|
|
const { key, ...footerGroupProps } = footerGroup.getFooterGroupProps(); |
|
|
|
const { key, ...footerGroupProps } = footerGroup.getFooterGroupProps(); |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div |
|
|
|
<div className={tableStyles.tfoot} {...footerGroupProps} key={key} data-testid={e2eSelectorsTable.footer}> |
|
|
|
className={tableStyles.tfoot} |
|
|
|
{footerGroup.headers.map((column: ColumnInstance) => renderFooterCell(column, tableStyles))} |
|
|
|
{...footerGroupProps} |
|
|
|
|
|
|
|
key={key} |
|
|
|
|
|
|
|
data-testid={e2eSelectorsTable.footer} |
|
|
|
|
|
|
|
style={height ? { height: `${height}px` } : undefined} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{footerGroup.headers.map((column: ColumnInstance) => renderFooterCell(column, tableStyles, height))} |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
); |
|
|
|
); |
|
|
|
})} |
|
|
|
})} |
|
|
|
@ -48,7 +41,7 @@ export const FooterRow = (props: FooterRowProps) => { |
|
|
|
); |
|
|
|
); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
function renderFooterCell(column: ColumnInstance, tableStyles: TableStyles, height?: number) { |
|
|
|
function renderFooterCell(column: ColumnInstance, tableStyles: TableStyles) { |
|
|
|
const footerProps = column.getHeaderProps(); |
|
|
|
const footerProps = column.getHeaderProps(); |
|
|
|
|
|
|
|
|
|
|
|
if (!footerProps) { |
|
|
|
if (!footerProps) { |
|
|
|
@ -58,9 +51,6 @@ function renderFooterCell(column: ColumnInstance, tableStyles: TableStyles, heig |
|
|
|
footerProps.style = footerProps.style ?? {}; |
|
|
|
footerProps.style = footerProps.style ?? {}; |
|
|
|
footerProps.style.position = 'absolute'; |
|
|
|
footerProps.style.position = 'absolute'; |
|
|
|
footerProps.style.justifyContent = (column as any).justifyContent; |
|
|
|
footerProps.style.justifyContent = (column as any).justifyContent; |
|
|
|
if (height) { |
|
|
|
|
|
|
|
footerProps.style.height = height; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className={tableStyles.headerCell} {...footerProps}> |
|
|
|
<div className={tableStyles.headerCell} {...footerProps}> |
|
|
|
|