@patternfly/react-table 6.3.0-prerelease.2 → 6.3.0-prerelease.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/Table/package.json +1 -1
- package/dist/dynamic/components/Table/utils/decorators/package.json +1 -1
- package/dist/dynamic/components/Table/utils/package.json +1 -1
- package/dist/dynamic/deprecated/components/Table/base/package.json +1 -1
- package/dist/dynamic/deprecated/components/Table/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/esm/components/Table/Tr.d.ts +3 -1
- package/dist/esm/components/Table/Tr.d.ts.map +1 -1
- package/dist/esm/components/Table/Tr.js +3 -3
- package/dist/esm/components/Table/Tr.js.map +1 -1
- package/dist/esm/demos/DashboardHeader.d.ts.map +1 -1
- package/dist/esm/demos/DashboardHeader.js +1 -2
- package/dist/esm/demos/DashboardHeader.js.map +1 -1
- package/dist/esm/demos/sampleData.d.ts.map +1 -1
- package/dist/esm/demos/sampleData.js +359 -360
- package/dist/esm/demos/sampleData.js.map +1 -1
- package/dist/js/components/Table/Tr.d.ts +3 -1
- package/dist/js/components/Table/Tr.d.ts.map +1 -1
- package/dist/js/components/Table/Tr.js +3 -3
- package/dist/js/components/Table/Tr.js.map +1 -1
- package/dist/js/demos/DashboardHeader.d.ts.map +1 -1
- package/dist/js/demos/DashboardHeader.js +1 -2
- package/dist/js/demos/DashboardHeader.js.map +1 -1
- package/dist/js/demos/sampleData.d.ts.map +1 -1
- package/dist/js/demos/sampleData.js +359 -360
- package/dist/js/demos/sampleData.js.map +1 -1
- package/dist/umd/assets/{output-qZDIkOqE.css → output-CRziN2aE.css} +4391 -4058
- package/dist/umd/react-table.min.js +2 -2
- package/package.json +6 -6
- package/src/components/Table/Tr.tsx +6 -3
- package/src/components/Table/__tests__/__snapshots__/RowWrapper.test.tsx.snap +1 -1
- package/src/components/Table/examples/TableExpandable.tsx +3 -3
- package/src/components/Table/examples/TableMisc.tsx +0 -1
- package/src/components/Table/examples/TableNestedTableExpandable.tsx +3 -3
- package/src/demos/DashboardHeader.tsx +2 -5
- package/src/demos/examples/TableExpandCollapseAll.tsx +3 -3
- package/src/demos/sampleData.tsx +359 -361
- package/src/deprecated/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +19 -36
- package/src/deprecated/components/Table/examples/LegacyTableMisc.tsx +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "6.3.0-prerelease.
|
|
3
|
+
"version": "6.3.0-prerelease.21",
|
|
4
4
|
"description": "This library provides a set of React table components for use with the PatternFly 4",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"subpaths": "node ../../scripts/exportSubpaths.mjs --config subpaths.config.json"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@patternfly/react-core": "^6.3.0-prerelease.
|
|
44
|
-
"@patternfly/react-icons": "^6.3.0-prerelease.
|
|
45
|
-
"@patternfly/react-styles": "^6.3.0-prerelease.
|
|
46
|
-
"@patternfly/react-tokens": "^6.3.0-prerelease.
|
|
43
|
+
"@patternfly/react-core": "^6.3.0-prerelease.21",
|
|
44
|
+
"@patternfly/react-icons": "^6.3.0-prerelease.6",
|
|
45
|
+
"@patternfly/react-styles": "^6.3.0-prerelease.6",
|
|
46
|
+
"@patternfly/react-tokens": "^6.3.0-prerelease.6",
|
|
47
47
|
"lodash": "^4.17.21",
|
|
48
48
|
"tslib": "^2.8.1"
|
|
49
49
|
},
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"react": "^17 || ^18 || ^19",
|
|
52
52
|
"react-dom": "^17 || ^18 || ^19"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "c40f2f81ebe65b6bd785bc38da66330532ac7a30"
|
|
55
55
|
}
|
|
@@ -14,10 +14,12 @@ export interface TrProps extends Omit<React.HTMLProps<HTMLTableRowElement>, 'onR
|
|
|
14
14
|
innerRef?: React.Ref<any>;
|
|
15
15
|
/** Flag indicating the Tr is hidden */
|
|
16
16
|
isHidden?: boolean;
|
|
17
|
-
/** Only applicable to Tr within the Tbody
|
|
17
|
+
/** Only applicable to Tr within the Tbody and determines if the expandable row content is expanded or not.
|
|
18
18
|
* 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
|
|
19
19
|
*/
|
|
20
20
|
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;
|
|
21
23
|
/** Only applicable to Tr within the Tbody: Whether the row is editable */
|
|
22
24
|
isEditable?: boolean;
|
|
23
25
|
/** Flag which adds hover styles for the clickable table row */
|
|
@@ -46,6 +48,7 @@ const TrBase: React.FunctionComponent<TrProps> = ({
|
|
|
46
48
|
children,
|
|
47
49
|
className,
|
|
48
50
|
isExpanded,
|
|
51
|
+
isExpandable,
|
|
49
52
|
isEditable,
|
|
50
53
|
isHidden = false,
|
|
51
54
|
isClickable = false,
|
|
@@ -75,7 +78,7 @@ const TrBase: React.FunctionComponent<TrProps> = ({
|
|
|
75
78
|
};
|
|
76
79
|
}
|
|
77
80
|
|
|
78
|
-
const rowIsHidden = isHidden || (isExpanded !== undefined && !isExpanded);
|
|
81
|
+
const rowIsHidden = isHidden || (isExpanded !== undefined && !isExpanded && isExpandable);
|
|
79
82
|
|
|
80
83
|
const { registerSelectableRow } = useContext(TableContext);
|
|
81
84
|
|
|
@@ -96,7 +99,7 @@ const TrBase: React.FunctionComponent<TrProps> = ({
|
|
|
96
99
|
className={css(
|
|
97
100
|
styles.tableTr,
|
|
98
101
|
className,
|
|
99
|
-
|
|
102
|
+
isExpandable !== undefined && styles.tableExpandableRow,
|
|
100
103
|
isExpanded && styles.modifiers.expanded,
|
|
101
104
|
isEditable && inlineStyles.modifiers.inlineEditable,
|
|
102
105
|
isClickable && styles.modifiers.clickable,
|
|
@@ -20,7 +20,7 @@ exports[`RowWrapper renders expanded correctly 1`] = `
|
|
|
20
20
|
<table>
|
|
21
21
|
<tbody>
|
|
22
22
|
<tr
|
|
23
|
-
class="pf-v6-c-table__tr pf-
|
|
23
|
+
class="pf-v6-c-table__tr pf-m-expanded"
|
|
24
24
|
data-ouia-component-id="OUIA-Generated-TableRow-2"
|
|
25
25
|
data-ouia-component-type="PF6/TableRow"
|
|
26
26
|
data-ouia-safe="true"
|
|
@@ -116,7 +116,7 @@ export const TableExpandable: React.FunctionComponent = () => {
|
|
|
116
116
|
id="toggle-compact"
|
|
117
117
|
name="toggle-compact"
|
|
118
118
|
/>
|
|
119
|
-
<Table aria-label="Expandable table" variant={isExampleCompact ? 'compact' : undefined}>
|
|
119
|
+
<Table isExpandable aria-label="Expandable table" variant={isExampleCompact ? 'compact' : undefined}>
|
|
120
120
|
<Thead>
|
|
121
121
|
<Tr>
|
|
122
122
|
<Th screenReaderText="Row expansion" />
|
|
@@ -152,7 +152,7 @@ export const TableExpandable: React.FunctionComponent = () => {
|
|
|
152
152
|
}
|
|
153
153
|
return (
|
|
154
154
|
<Tbody key={repo.name} isExpanded={isRepoExpanded(repo)}>
|
|
155
|
-
<Tr>
|
|
155
|
+
<Tr isExpanded={isRepoExpanded(repo)}>
|
|
156
156
|
<Td
|
|
157
157
|
expand={
|
|
158
158
|
repo.details
|
|
@@ -172,7 +172,7 @@ export const TableExpandable: React.FunctionComponent = () => {
|
|
|
172
172
|
<Td dataLabel={columnNames.lastCommit}>{repo.lastCommit}</Td>
|
|
173
173
|
</Tr>
|
|
174
174
|
{repo.details ? (
|
|
175
|
-
<Tr isExpanded={isRepoExpanded(repo)}>
|
|
175
|
+
<Tr isExpandable isExpanded={isRepoExpanded(repo)}>
|
|
176
176
|
{!childIsFullWidth ? <Td /> : null}
|
|
177
177
|
{repo.details.detail1 ? (
|
|
178
178
|
<Td dataLabel="Repo detail 1" noPadding={childHasNoPadding} colSpan={detail1Colspan}>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
2
|
-
/* eslint-disable camelcase */
|
|
3
2
|
import t_global_background_color_secondary_default from '@patternfly/react-tokens/dist/esm/t_global_background_color_secondary_default';
|
|
4
3
|
|
|
5
4
|
interface Repository {
|
|
@@ -128,7 +128,7 @@ export const TableExpandable: React.FunctionComponent = () => {
|
|
|
128
128
|
];
|
|
129
129
|
|
|
130
130
|
return (
|
|
131
|
-
<Table aria-label="Simple table">
|
|
131
|
+
<Table isExpandable aria-label="Simple table">
|
|
132
132
|
<Thead>
|
|
133
133
|
<Tr>
|
|
134
134
|
<Th screenReaderText="Row expansion" />
|
|
@@ -141,7 +141,7 @@ export const TableExpandable: React.FunctionComponent = () => {
|
|
|
141
141
|
</Thead>
|
|
142
142
|
{repositories.map((repo, rowIndex) => (
|
|
143
143
|
<Tbody key={repo.name} isExpanded={isRepoExpanded(repo)}>
|
|
144
|
-
<Tr>
|
|
144
|
+
<Tr isExpanded={isRepoExpanded(repo)}>
|
|
145
145
|
<Td
|
|
146
146
|
expand={
|
|
147
147
|
repo.nestedComponent
|
|
@@ -163,7 +163,7 @@ export const TableExpandable: React.FunctionComponent = () => {
|
|
|
163
163
|
</Td>
|
|
164
164
|
</Tr>
|
|
165
165
|
{repo.nestedComponent ? (
|
|
166
|
-
<Tr isExpanded={isRepoExpanded(repo)}>
|
|
166
|
+
<Tr isExpandable isExpanded={isRepoExpanded(repo)}>
|
|
167
167
|
<Td
|
|
168
168
|
noPadding={repo.noPadding}
|
|
169
169
|
dataLabel={`${columnNames.name} expended`}
|
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
ToolbarItem,
|
|
24
24
|
PageToggleButton
|
|
25
25
|
} from '@patternfly/react-core';
|
|
26
|
-
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
27
26
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
28
27
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
29
28
|
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
@@ -132,9 +131,7 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
|
|
|
132
131
|
<Masthead>
|
|
133
132
|
<MastheadMain>
|
|
134
133
|
<MastheadToggle>
|
|
135
|
-
<PageToggleButton
|
|
136
|
-
<BarsIcon />
|
|
137
|
-
</PageToggleButton>
|
|
134
|
+
<PageToggleButton isHamburgerButton aria-label="Global navigation" />
|
|
138
135
|
</MastheadToggle>
|
|
139
136
|
<MastheadBrand>
|
|
140
137
|
<MastheadLogo>{patternflyLogo}</MastheadLogo>
|
|
@@ -159,7 +156,7 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
|
|
|
159
156
|
)}
|
|
160
157
|
<ToolbarGroup variant="action-group-plain" visibility={{ default: 'hidden', lg: 'visible' }}>
|
|
161
158
|
<ToolbarItem>
|
|
162
|
-
<Button aria-label="Settings" variant=
|
|
159
|
+
<Button aria-label="Settings" isSettings variant="plain" />
|
|
163
160
|
</ToolbarItem>
|
|
164
161
|
<ToolbarItem>
|
|
165
162
|
<Button aria-label="Help" variant={ButtonVariant.plain} icon={<QuestionCircleIcon />} />
|
|
@@ -156,7 +156,7 @@ export const TableExpandCollapseAll: React.FunctionComponent = () => {
|
|
|
156
156
|
aria-label="Collapsible table data"
|
|
157
157
|
>
|
|
158
158
|
<Card component="div">
|
|
159
|
-
<Table aria-label="Collapsible table">
|
|
159
|
+
<Table isExpandable aria-label="Collapsible table">
|
|
160
160
|
<Thead>
|
|
161
161
|
<Tr>
|
|
162
162
|
<Th
|
|
@@ -175,7 +175,7 @@ export const TableExpandCollapseAll: React.FunctionComponent = () => {
|
|
|
175
175
|
|
|
176
176
|
{serverData.map((server, serverIndex) => (
|
|
177
177
|
<Tbody key={server.name} isExpanded={isServerExpanded(server)}>
|
|
178
|
-
<Tr>
|
|
178
|
+
<Tr isExpanded={isServerExpanded(server)}>
|
|
179
179
|
<Td
|
|
180
180
|
expand={
|
|
181
181
|
server.details
|
|
@@ -195,7 +195,7 @@ export const TableExpandCollapseAll: React.FunctionComponent = () => {
|
|
|
195
195
|
<Td>{server?.workspaces}</Td>
|
|
196
196
|
<Td>{server?.status?.title}</Td>
|
|
197
197
|
</Tr>
|
|
198
|
-
<Tr isExpanded={isServerExpanded(server)}>
|
|
198
|
+
<Tr isExpandable isExpanded={isServerExpanded(server)}>
|
|
199
199
|
<Td></Td>
|
|
200
200
|
<Td colSpan={expandableColumns.length}>
|
|
201
201
|
<ExpandableRowContent>{server?.details}</ExpandableRowContent>
|