Skip to content

Commit

Permalink
chore: add selected groups/rows higlight #1713
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-mihok committed Dec 5, 2022
1 parent 905e3fd commit e4ffbd3
Showing 1 changed file with 30 additions and 21 deletions.
51 changes: 30 additions & 21 deletions ui/src/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,18 @@ const
return (
<Fluent.GroupHeader
{...props}
styles={{
root: {
position: 'sticky',
top: 48,
backgroundColor: cssVar('$card'),
zIndex: 1
}
}} />
styles={stylesProps => ({
root: [
{
position: 'sticky',
top: 48,
backgroundColor: cssVar('$card'),
zIndex: 1
},
stylesProps.selected ? { background: `${cssVar('$neutralLight')} !important` } : undefined
]
})
} />
)
}, []),
onToggleCollapseAll = (isAllCollapsed: B) => expandedRefs.current = isAllCollapsed ? {} : null,
Expand All @@ -444,21 +448,26 @@ const
}
},
onRenderRow = (props?: Fluent.IDetailsRowProps) => props
? <Fluent.DetailsRow {...props} styles={{
? <Fluent.DetailsRow {...props} styles={styleProps =>
({
cell: { alignSelf: 'center', fontSize: 14, lineHeight: 20, color: cssVar('$text9') },
checkCell: { display: 'flex', alignItems: 'center' },
root: {
width: '100%',
border: border(2, 'transparent'),
borderTop: border(2, cssVar('$neutralLight')),
background: cssVar('$card'),
minHeight: 48,
'&:hover': {
background: cssVar('$neutralLight'),
border: `${border(2, cssVar('$themePrimary'))} !important`,
}
}
}} />
root: [
{
width: '100%',
border: border(2, 'transparent'),
borderTop: border(2, cssVar('$neutralLight')),
background: cssVar('$card'),
minHeight: 48,
'&:hover': {
background: cssVar('$neutralLight'),
border: `${border(2, cssVar('$themePrimary'))} !important`,
},
},
styleProps.isSelected ? { background: cssVar('$neutralLight') } : undefined
]
})
} />
: null,
onItemInvoked = (item: Fluent.IObjectWithKey & Dict<any>) => {
wave.args[m.name] = [item.key as S]
Expand Down

0 comments on commit e4ffbd3

Please sign in to comment.