-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Table): Add Tree Table variant #5573
Changes from all commits
816c4e1
e1efde1
0695d6f
107966d
f38f71e
4f7ab69
9421e1c
13dd3bc
b07df37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from 'react'; | ||
import { css } from '@patternfly/react-styles'; | ||
import styles from '@patternfly/react-styles/css/components/Table/table'; | ||
import { RowWrapperProps } from './RowWrapper'; | ||
import { Tr } from '../TableComposable'; | ||
|
||
export const TreeRowWrapper: React.FunctionComponent<RowWrapperProps> = ({ | ||
className, | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
rowProps, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not totally sure all the reasons the rowData prop exists. At the very least it keeps track of rowIndex and rowKey for the sake of certain callback functions. But, I know that it's already being withheld in the RowWrapper, and if I don't withhold it in the TreeRowWrapper, it spreads all the way to the |
||
row, | ||
...props | ||
}: RowWrapperProps) => { | ||
const { 'aria-level': level, 'aria-posinset': posinset, 'aria-setsize': setsize, isExpanded, isHidden } = row.props; | ||
return ( | ||
<Tr | ||
aria-level={level} | ||
aria-posinset={posinset} | ||
aria-setsize={setsize} | ||
aria-expanded={!!isExpanded} | ||
isHidden={isHidden} | ||
className={css(className, isExpanded && 'pf-m-expandable', isExpanded && styles.modifiers.expanded)} | ||
{...props} | ||
/> | ||
); | ||
}; | ||
TreeRowWrapper.displayName = 'TreeRowWrapper'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had changed the props a handful of times while working on this, so in the end while cleaning stuff up, I guess I realized that
className
was being pulled out ofprops
unnecessarily on line 161. I can put it back, but it's now passed when I spread props to the Provider on line 230.