Skip to content

Commit e0c0c87

Browse files
thatblindgeyemattnolting
authored andcommitted
fix(Table): removed divider for expanded rows (patternfly#11815)
* fix(Table): removed divider for expanded rows * Updated snapshots
1 parent cda6da2 commit e0c0c87

File tree

13 files changed

+62
-65
lines changed

13 files changed

+62
-65
lines changed

packages/react-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"tslib": "^2.8.1"
5555
},
5656
"devDependencies": {
57-
"@patternfly/patternfly": "6.3.0-prerelease.6",
57+
"@patternfly/patternfly": "6.3.0-prerelease.15",
5858
"case-anything": "^3.1.2",
5959
"css": "^3.0.0",
6060
"fs-extra": "^11.3.0"

packages/react-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"test:a11y": "patternfly-a11y --config patternfly-a11y.config"
2424
},
2525
"dependencies": {
26-
"@patternfly/patternfly": "6.3.0-prerelease.6",
26+
"@patternfly/patternfly": "6.3.0-prerelease.15",
2727
"@patternfly/react-charts": "workspace:^",
2828
"@patternfly/react-code-editor": "workspace:^",
2929
"@patternfly/react-core": "workspace:^",

packages/react-icons/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@fortawesome/free-brands-svg-icons": "^5.15.4",
3434
"@fortawesome/free-regular-svg-icons": "^5.15.4",
3535
"@fortawesome/free-solid-svg-icons": "^5.15.4",
36-
"@patternfly/patternfly": "6.3.0-prerelease.6",
36+
"@patternfly/patternfly": "6.3.0-prerelease.15",
3737
"fs-extra": "^11.3.0",
3838
"tslib": "^2.8.1"
3939
},

packages/react-styles/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"clean": "rimraf dist css"
2020
},
2121
"devDependencies": {
22-
"@patternfly/patternfly": "6.3.0-prerelease.6",
22+
"@patternfly/patternfly": "6.3.0-prerelease.15",
2323
"change-case": "^5.4.4",
2424
"fs-extra": "^11.3.0"
2525
},

packages/react-table/src/components/Table/Tr.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ export interface TrProps extends Omit<React.HTMLProps<HTMLTableRowElement>, 'onR
1414
innerRef?: React.Ref<any>;
1515
/** Flag indicating the Tr is hidden */
1616
isHidden?: boolean;
17-
/** Only applicable to Tr within the Tbody: Makes the row expandable and determines if it's expanded or not.
17+
/** Only applicable to Tr within the Tbody and determines if the expandable row content is expanded or not.
1818
* To prevent column widths from responding automatically when expandable rows are toggled, the width prop must also be passed into either the th or td component
1919
*/
2020
isExpanded?: boolean;
21+
/** Flag to indicate that a row is expandable. Only applicable to a tr that is intended to collapse or expand. */
22+
isExpandable?: boolean;
2123
/** Only applicable to Tr within the Tbody: Whether the row is editable */
2224
isEditable?: boolean;
2325
/** Flag which adds hover styles for the clickable table row */
@@ -46,6 +48,7 @@ const TrBase: React.FunctionComponent<TrProps> = ({
4648
children,
4749
className,
4850
isExpanded,
51+
isExpandable,
4952
isEditable,
5053
isHidden = false,
5154
isClickable = false,
@@ -75,7 +78,7 @@ const TrBase: React.FunctionComponent<TrProps> = ({
7578
};
7679
}
7780

78-
const rowIsHidden = isHidden || (isExpanded !== undefined && !isExpanded);
81+
const rowIsHidden = isHidden || (isExpanded !== undefined && !isExpanded && isExpandable);
7982

8083
const { registerSelectableRow } = useContext(TableContext);
8184

@@ -96,7 +99,7 @@ const TrBase: React.FunctionComponent<TrProps> = ({
9699
className={css(
97100
styles.tableTr,
98101
className,
99-
isExpanded !== undefined && styles.tableExpandableRow,
102+
isExpandable !== undefined && styles.tableExpandableRow,
100103
isExpanded && styles.modifiers.expanded,
101104
isEditable && inlineStyles.modifiers.inlineEditable,
102105
isClickable && styles.modifiers.clickable,

packages/react-table/src/components/Table/__tests__/__snapshots__/RowWrapper.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exports[`RowWrapper renders expanded correctly 1`] = `
2020
<table>
2121
<tbody>
2222
<tr
23-
class="pf-v6-c-table__tr pf-v6-c-table__expandable-row pf-m-expanded"
23+
class="pf-v6-c-table__tr pf-m-expanded"
2424
data-ouia-component-id="OUIA-Generated-TableRow-2"
2525
data-ouia-component-type="PF6/TableRow"
2626
data-ouia-safe="true"

packages/react-table/src/components/Table/examples/TableExpandable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const TableExpandable: React.FunctionComponent = () => {
116116
id="toggle-compact"
117117
name="toggle-compact"
118118
/>
119-
<Table aria-label="Expandable table" variant={isExampleCompact ? 'compact' : undefined}>
119+
<Table isExpandable aria-label="Expandable table" variant={isExampleCompact ? 'compact' : undefined}>
120120
<Thead>
121121
<Tr>
122122
<Th screenReaderText="Row expansion" />
@@ -152,7 +152,7 @@ export const TableExpandable: React.FunctionComponent = () => {
152152
}
153153
return (
154154
<Tbody key={repo.name} isExpanded={isRepoExpanded(repo)}>
155-
<Tr>
155+
<Tr isExpanded={isRepoExpanded(repo)}>
156156
<Td
157157
expand={
158158
repo.details
@@ -172,7 +172,7 @@ export const TableExpandable: React.FunctionComponent = () => {
172172
<Td dataLabel={columnNames.lastCommit}>{repo.lastCommit}</Td>
173173
</Tr>
174174
{repo.details ? (
175-
<Tr isExpanded={isRepoExpanded(repo)}>
175+
<Tr isExpandable isExpanded={isRepoExpanded(repo)}>
176176
{!childIsFullWidth ? <Td /> : null}
177177
{repo.details.detail1 ? (
178178
<Td dataLabel="Repo detail 1" noPadding={childHasNoPadding} colSpan={detail1Colspan}>

packages/react-table/src/components/Table/examples/TableNestedTableExpandable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export const TableExpandable: React.FunctionComponent = () => {
128128
];
129129

130130
return (
131-
<Table aria-label="Simple table">
131+
<Table isExpandable aria-label="Simple table">
132132
<Thead>
133133
<Tr>
134134
<Th screenReaderText="Row expansion" />
@@ -141,7 +141,7 @@ export const TableExpandable: React.FunctionComponent = () => {
141141
</Thead>
142142
{repositories.map((repo, rowIndex) => (
143143
<Tbody key={repo.name} isExpanded={isRepoExpanded(repo)}>
144-
<Tr>
144+
<Tr isExpanded={isRepoExpanded(repo)}>
145145
<Td
146146
expand={
147147
repo.nestedComponent
@@ -163,7 +163,7 @@ export const TableExpandable: React.FunctionComponent = () => {
163163
</Td>
164164
</Tr>
165165
{repo.nestedComponent ? (
166-
<Tr isExpanded={isRepoExpanded(repo)}>
166+
<Tr isExpandable isExpanded={isRepoExpanded(repo)}>
167167
<Td
168168
noPadding={repo.noPadding}
169169
dataLabel={`${columnNames.name} expended`}

packages/react-table/src/demos/examples/TableExpandCollapseAll.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export const TableExpandCollapseAll: React.FunctionComponent = () => {
156156
aria-label="Collapsible table data"
157157
>
158158
<Card component="div">
159-
<Table aria-label="Collapsible table">
159+
<Table isExpandable aria-label="Collapsible table">
160160
<Thead>
161161
<Tr>
162162
<Th
@@ -175,7 +175,7 @@ export const TableExpandCollapseAll: React.FunctionComponent = () => {
175175

176176
{serverData.map((server, serverIndex) => (
177177
<Tbody key={server.name} isExpanded={isServerExpanded(server)}>
178-
<Tr>
178+
<Tr isExpanded={isServerExpanded(server)}>
179179
<Td
180180
expand={
181181
server.details
@@ -195,7 +195,7 @@ export const TableExpandCollapseAll: React.FunctionComponent = () => {
195195
<Td>{server?.workspaces}</Td>
196196
<Td>{server?.status?.title}</Td>
197197
</Tr>
198-
<Tr isExpanded={isServerExpanded(server)}>
198+
<Tr isExpandable isExpanded={isServerExpanded(server)}>
199199
<Td></Td>
200200
<Td colSpan={expandableColumns.length}>
201201
<ExpandableRowContent>{server?.details}</ExpandableRowContent>

0 commit comments

Comments
 (0)