| 1 |
import { css } from '@patternfly/react-styles'; |
| 2 |
import styles from '@patternfly/react-styles/css/components/Table/table'; |
| 3 |
import stylesTreeView from '@patternfly/react-styles/css/components/Table/table-tree-view'; |
| 4 |
import { RowWrapperProps } from './RowWrapper'; |
| 5 |
import { Tr } from './Tr'; |
| 6 |
|
| 7 |
export const TreeRowWrapper: React.FunctionComponent<RowWrapperProps> = ({ |
| 8 |
className, |
| 9 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 10 |
rowProps, |
| 11 |
row, |
| 12 |
...props |
| 13 |
}: RowWrapperProps) => { |
| 14 |
const { |
| 15 |
'aria-level': level, |
| 16 |
'aria-posinset': posinset, |
| 17 |
'aria-setsize': setsize, |
| 18 |
isExpanded, |
| 19 |
isDetailsExpanded, |
| 20 |
isHidden |
| 21 |
} = row.props; |
| 22 |
return ( |
| 23 |
<Tr |
| 24 |
aria-level={level} |
| 25 |
aria-posinset={posinset} |
| 26 |
aria-setsize={setsize} |
| 27 |
aria-expanded={!!isExpanded} |
| 28 |
isHidden={isHidden} |
| 29 |
className={css( |
| 30 |
className, |
| 31 |
isExpanded && styles.modifiers.expanded, |
| 32 |
isDetailsExpanded && stylesTreeView.modifiers.treeViewDetailsExpanded |
| 33 |
)} |
| 34 |
{...props} |
| 35 |
/> |
| 36 |
); |
| 37 |
}; |
| 38 |
TreeRowWrapper.displayName = 'TreeRowWrapper'; |