Skip to content
Snippets Groups Projects
Commit 91f65aee authored by piotr.kupczyk@id.ethz.ch's avatar piotr.kupczyk@id.ethz.ch
Browse files

SSDM-12250 : Table Widget : sticky first column - try to avoid absolute...

SSDM-12250 : Table Widget : sticky first column - try to avoid absolute elements with hardcoded heights
parent 1503e798
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ import logger from '@src/js/common/logger.js' ...@@ -21,6 +21,7 @@ import logger from '@src/js/common/logger.js'
const styles = theme => ({ const styles = theme => ({
container: { container: {
minWidth: '800px',
height: '100%' height: '100%'
}, },
loadingContainer: { loadingContainer: {
...@@ -44,7 +45,6 @@ const styles = theme => ({ ...@@ -44,7 +45,6 @@ const styles = theme => ({
backgroundColor: theme.palette.background.paper backgroundColor: theme.palette.background.paper
}, },
titleCell: { titleCell: {
height: '46px',
border: 0 border: 0
}, },
titleContent: { titleContent: {
...@@ -54,9 +54,7 @@ const styles = theme => ({ ...@@ -54,9 +54,7 @@ const styles = theme => ({
paddingTop: theme.spacing(1), paddingTop: theme.spacing(1),
paddingBottom: 0 paddingBottom: 0
}, },
pagingAndConfigsAndExportsCell: { pagingAndConfigsAndExportsCell: {},
height: '46px'
},
pagingAndConfigsAndExportsContent: { pagingAndConfigsAndExportsContent: {
display: 'flex' display: 'flex'
} }
......
...@@ -33,12 +33,11 @@ const styles = theme => ({ ...@@ -33,12 +33,11 @@ const styles = theme => ({
zIndex: 100 zIndex: 100
}, },
'$multiselectable &$firstCell': { '$multiselectable &$firstCell': {
left: '44px' left: '48px'
} }
}, },
globalFilterCell: { globalFilterCell: {
backgroundColor: 'inherit', backgroundColor: 'inherit'
height: '62px'
}, },
globalFilterContent: { globalFilterContent: {
paddingTop: theme.spacing(1), paddingTop: theme.spacing(1),
......
...@@ -10,13 +10,15 @@ import logger from '@src/js/common/logger.js' ...@@ -10,13 +10,15 @@ import logger from '@src/js/common/logger.js'
const styles = theme => ({ const styles = theme => ({
multiselectable: {}, multiselectable: {},
multiselectContainer: {
width: '32px'
},
multiselect: { multiselect: {
backgroundColor: theme.palette.background.primary, backgroundColor: theme.palette.background.primary,
paddingTop: theme.spacing(1), paddingTop: theme.spacing(1),
paddingBottom: theme.spacing(1), paddingBottom: theme.spacing(1),
paddingLeft: theme.spacing(2), paddingLeft: theme.spacing(2),
paddingRight: 0, paddingRight: 0,
width: '30px',
position: 'sticky', position: 'sticky',
left: 0, left: 0,
zIndex: 100 zIndex: 100
...@@ -29,7 +31,7 @@ const styles = theme => ({ ...@@ -29,7 +31,7 @@ const styles = theme => ({
zIndex: 100 zIndex: 100
}, },
'$multiselectable &$firstHeader': { '$multiselectable &$firstHeader': {
left: '44px' left: '48px'
} }
}, },
firstHeader: {} firstHeader: {}
...@@ -109,11 +111,13 @@ class GridHeaders extends React.PureComponent { ...@@ -109,11 +111,13 @@ class GridHeaders extends React.PureComponent {
return ( return (
<TableCell classes={{ root: classes.multiselect }}> <TableCell classes={{ root: classes.multiselect }}>
<CheckboxField <div className={classes.multiselectContainer}>
value={value} <CheckboxField
indeterminate={indeterminate} value={value}
onChange={this.handleMultiselectAllRowsChange} indeterminate={indeterminate}
/> onChange={this.handleMultiselectAllRowsChange}
/>
</div>
</TableCell> </TableCell>
) )
} else { } else {
......
...@@ -48,7 +48,7 @@ const styles = theme => ({ ...@@ -48,7 +48,7 @@ const styles = theme => ({
zIndex: 100 zIndex: 100
}, },
'$multiselectable &$firstCell': { '$multiselectable &$firstCell': {
left: '44px' left: '48px'
} }
}, },
firstCell: {} firstCell: {}
......
...@@ -10,10 +10,12 @@ const styles = () => ({ ...@@ -10,10 +10,12 @@ const styles = () => ({
position: 'sticky', position: 'sticky',
left: 0 left: 0
}, },
contentWrapper: {
width: 0,
overflow: 'visible'
},
content: { content: {
position: 'absolute', width: '750px'
top: 0,
whiteSpace: 'nowrap'
}, },
remainingCell: { remainingCell: {
padding: 0 padding: 0
...@@ -41,8 +43,10 @@ class GridRowFullWidth extends React.PureComponent { ...@@ -41,8 +43,10 @@ class GridRowFullWidth extends React.PureComponent {
root: `${classes.stickyCell} ${styles.cell}` root: `${classes.stickyCell} ${styles.cell}`
}} }}
> >
<div className={`${classes.content} ${styles.content}`}> <div className={classes.contentWrapper}>
{children} <div className={`${classes.content} ${styles.content}`}>
{children}
</div>
</div> </div>
</TableCell> </TableCell>
{columns.length > 1 && ( {columns.length > 1 && (
......
...@@ -7,12 +7,12 @@ import messages from '@src/js/common/messages.js' ...@@ -7,12 +7,12 @@ import messages from '@src/js/common/messages.js'
import logger from '@src/js/common/logger.js' import logger from '@src/js/common/logger.js'
const styles = theme => ({ const styles = theme => ({
cell: { cell: {},
height: '46px'
},
content: { content: {
paddingLeft: theme.spacing(2), paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(2),
paddingTop: theme.spacing(1), paddingTop: theme.spacing(1),
paddingBottom: theme.spacing(1),
display: 'flex', display: 'flex',
alignItems: 'center' alignItems: 'center'
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment