@patternfly/react-table 5.0.0-alpha.91 → 5.0.0-alpha.93
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 +10 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/esm/components/Table/Td.js +3 -3
- package/dist/esm/components/Table/Td.js.map +1 -1
- package/dist/esm/components/Table/Th.js +1 -1
- package/dist/esm/components/Table/Th.js.map +1 -1
- package/dist/esm/components/Table/utils/decorators/treeRow.d.ts.map +1 -1
- package/dist/esm/components/Table/utils/decorators/treeRow.js +5 -5
- package/dist/esm/components/Table/utils/decorators/treeRow.js.map +1 -1
- package/dist/js/components/Table/Td.js +3 -3
- package/dist/js/components/Table/Td.js.map +1 -1
- package/dist/js/components/Table/Th.js +1 -1
- package/dist/js/components/Table/Th.js.map +1 -1
- package/dist/js/components/Table/package.json +1 -1
- package/dist/js/components/Table/utils/decorators/package.json +1 -1
- package/dist/js/components/Table/utils/decorators/treeRow.d.ts.map +1 -1
- package/dist/js/components/Table/utils/decorators/treeRow.js +5 -5
- package/dist/js/components/Table/utils/decorators/treeRow.js.map +1 -1
- package/dist/js/components/Table/utils/package.json +1 -1
- package/dist/js/components/package.json +1 -1
- package/dist/js/deprecated/components/Table/base/package.json +1 -1
- package/dist/js/deprecated/components/Table/package.json +1 -1
- package/dist/js/deprecated/components/package.json +1 -1
- package/dist/js/deprecated/package.json +1 -1
- package/dist/js/package.json +1 -1
- package/dist/umd/react-table.min.js +2 -2
- package/package.json +6 -6
- package/src/components/Table/Td.tsx +5 -5
- package/src/components/Table/Th.tsx +3 -3
- package/src/components/Table/__tests__/__snapshots__/RowWrapper.test.tsx.snap +1 -1
- package/src/components/Table/examples/TableCompoundExpandable.tsx +1 -1
- package/src/components/Table/examples/TableMisc.tsx +1 -1
- package/src/components/Table/examples/TableNestedHeaders.tsx +4 -4
- package/src/components/Table/examples/TableNestedStickyHeader.tsx +4 -4
- package/src/components/Table/utils/__snapshots__/transformers.test.tsx.snap +2 -2
- package/src/components/Table/utils/decorators/treeRow.tsx +85 -87
- package/src/components/Table/utils/transformers.test.tsx +7 -7
- package/src/deprecated/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +300 -300
- package/src/deprecated/components/Table/examples/LegacyTableCompoundExpandable.tsx +4 -4
- package/src/deprecated/components/Table/examples/LegacyTableMisc.tsx +2 -2
- package/src/deprecated/components/Table/examples/LegacyTableSelectable.tsx +6 -6
- package/src/docs/demos/Table.md +28 -22
- package/src/docs/demos/table-demos/CompoundExpansion.jsx +17 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.93",
|
|
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/createSubpaths.js"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@patternfly/react-core": "^5.0.0-alpha.
|
|
44
|
-
"@patternfly/react-icons": "^5.0.0-alpha.
|
|
45
|
-
"@patternfly/react-styles": "^5.0.0-alpha.
|
|
46
|
-
"@patternfly/react-tokens": "^5.0.0-alpha.
|
|
43
|
+
"@patternfly/react-core": "^5.0.0-alpha.91",
|
|
44
|
+
"@patternfly/react-icons": "^5.0.0-alpha.14",
|
|
45
|
+
"@patternfly/react-styles": "^5.0.0-alpha.10",
|
|
46
|
+
"@patternfly/react-tokens": "^5.0.0-alpha.9",
|
|
47
47
|
"lodash": "^4.17.19",
|
|
48
48
|
"tslib": "^2.5.0"
|
|
49
49
|
},
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"react": "^17 || ^18",
|
|
56
56
|
"react-dom": "^17 || ^18"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "f66b668ef3fc16098974e1ac80c94e98b02a03d2"
|
|
59
59
|
}
|
|
@@ -252,8 +252,8 @@ const TdBase: React.FunctionComponent<TdProps> = ({
|
|
|
252
252
|
} = merged;
|
|
253
253
|
|
|
254
254
|
const treeTableTitleCell =
|
|
255
|
-
(className && className.includes('pf-c-table__tree-view-title-cell')) ||
|
|
256
|
-
(mergedClassName && mergedClassName.includes('pf-c-table__tree-view-title-cell'));
|
|
255
|
+
(className && className.includes('pf-v5-c-table__tree-view-title-cell')) ||
|
|
256
|
+
(mergedClassName && mergedClassName.includes('pf-v5-c-table__tree-view-title-cell'));
|
|
257
257
|
|
|
258
258
|
const cell = (
|
|
259
259
|
<MergedComponent
|
|
@@ -276,9 +276,9 @@ const TdBase: React.FunctionComponent<TdProps> = ({
|
|
|
276
276
|
{...props}
|
|
277
277
|
{...(isStickyColumn && {
|
|
278
278
|
style: {
|
|
279
|
-
'--pf-c-table__sticky-cell--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
|
|
280
|
-
'--pf-c-table__sticky-cell--Left': stickyLeftOffset ? stickyLeftOffset : 0,
|
|
281
|
-
'--pf-c-table__sticky-cell--Right': stickyRightOffset ? stickyRightOffset : 0,
|
|
279
|
+
'--pf-v5-c-table__sticky-cell--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
|
|
280
|
+
'--pf-v5-c-table__sticky-cell--Left': stickyLeftOffset ? stickyLeftOffset : 0,
|
|
281
|
+
'--pf-v5-c-table__sticky-cell--Right': stickyRightOffset ? stickyRightOffset : 0,
|
|
282
282
|
...props.style
|
|
283
283
|
} as React.CSSProperties
|
|
284
284
|
})}
|
|
@@ -181,9 +181,9 @@ const ThBase: React.FunctionComponent<ThProps> = ({
|
|
|
181
181
|
{...props}
|
|
182
182
|
{...(isStickyColumn && {
|
|
183
183
|
style: {
|
|
184
|
-
'--pf-c-table__sticky-cell--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
|
|
185
|
-
'--pf-c-table__sticky-cell--Left': stickyLeftOffset ? stickyLeftOffset : 0,
|
|
186
|
-
'--pf-c-table__sticky-cell--Right': stickyRightOffset ? stickyRightOffset : 0,
|
|
184
|
+
'--pf-v5-c-table__sticky-cell--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
|
|
185
|
+
'--pf-v5-c-table__sticky-cell--Left': stickyLeftOffset ? stickyLeftOffset : 0,
|
|
186
|
+
'--pf-v5-c-table__sticky-cell--Right': stickyRightOffset ? stickyRightOffset : 0,
|
|
187
187
|
...props.style
|
|
188
188
|
} as React.CSSProperties
|
|
189
189
|
})}
|
|
@@ -20,7 +20,7 @@ exports[`RowWrapper renders expanded correctly 1`] = `
|
|
|
20
20
|
<table>
|
|
21
21
|
<tbody>
|
|
22
22
|
<tr
|
|
23
|
-
class="pf-c-table__expandable-row pf-m-expanded"
|
|
23
|
+
class="pf-v5-c-table__expandable-row pf-m-expanded"
|
|
24
24
|
data-ouia-component-id="OUIA-Generated-TableRow-2"
|
|
25
25
|
data-ouia-component-type="PF4/TableRow"
|
|
26
26
|
data-ouia-safe="true"
|
|
@@ -110,7 +110,7 @@ export const TableCompoundExpandable: React.FunctionComponent = () => {
|
|
|
110
110
|
<Tr isExpanded={isRowExpanded}>
|
|
111
111
|
<Td dataLabel={columnNames[expandedCellKey]} noPadding colSpan={6}>
|
|
112
112
|
<ExpandableRowContent>
|
|
113
|
-
<div className="pf-u-m-md">
|
|
113
|
+
<div className="pf-v5-u-m-md">
|
|
114
114
|
Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem
|
|
115
115
|
ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum
|
|
116
116
|
sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit
|
|
@@ -65,7 +65,7 @@ export const TableMisc: React.FunctionComponent = () => {
|
|
|
65
65
|
{repositories.map((repo, rowIndex) => {
|
|
66
66
|
const isOddRow = (rowIndex + 1) % 2;
|
|
67
67
|
const customStyle = {
|
|
68
|
-
backgroundColor: 'var(--pf-global--palette--blue-50)'
|
|
68
|
+
backgroundColor: 'var(--pf-v5-global--palette--blue-50)'
|
|
69
69
|
};
|
|
70
70
|
// Some arbitrary logic to demonstrate that cell styles can be based on anything
|
|
71
71
|
const nameColSpan = repo.branches === null && repo.prs === null ? 3 : 1;
|
|
@@ -155,14 +155,14 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
|
|
|
155
155
|
</Tr>
|
|
156
156
|
</Thead>
|
|
157
157
|
<Tbody>
|
|
158
|
-
{sortedConnections.map(connection => (
|
|
158
|
+
{sortedConnections.map((connection) => (
|
|
159
159
|
<Tr key={connection.source.podName}>
|
|
160
160
|
<Td dataLabel={columnNames.source}>{connection.source.podName}</Td>
|
|
161
161
|
<Td dataLabel={columnNames.destination}>{connection.destination.podName}</Td>\
|
|
162
162
|
<Td dataLabel={columnNames.datetime}>
|
|
163
163
|
<div>
|
|
164
164
|
<span>{new Date(connection.timestamp).toDateString()}</span>{' '}
|
|
165
|
-
<span className="pf-u-color-200">{new Date(connection.timestamp).toLocaleTimeString()}</span>
|
|
165
|
+
<span className="pf-v5-u-color-200">{new Date(connection.timestamp).toLocaleTimeString()}</span>
|
|
166
166
|
</div>
|
|
167
167
|
</Td>
|
|
168
168
|
<Td dataLabel={columnNames.source}>
|
|
@@ -171,7 +171,7 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
|
|
|
171
171
|
<span>{connection.source.port.num}</span>
|
|
172
172
|
</StackItem>
|
|
173
173
|
<StackItem>
|
|
174
|
-
<span className="pf-u-color-200">({connection.source.port.protocol})</span>
|
|
174
|
+
<span className="pf-v5-u-color-200">({connection.source.port.protocol})</span>
|
|
175
175
|
</StackItem>
|
|
176
176
|
</Stack>
|
|
177
177
|
</Td>
|
|
@@ -181,7 +181,7 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
|
|
|
181
181
|
<span>{connection.destination.port.num}</span>
|
|
182
182
|
</StackItem>
|
|
183
183
|
<StackItem>
|
|
184
|
-
<span className="pf-u-color-200">({connection.destination.port.protocol})</span>
|
|
184
|
+
<span className="pf-v5-u-color-200">({connection.destination.port.protocol})</span>
|
|
185
185
|
</StackItem>
|
|
186
186
|
</Stack>
|
|
187
187
|
</Td>
|
|
@@ -158,14 +158,14 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
|
|
|
158
158
|
</Tr>
|
|
159
159
|
</Thead>
|
|
160
160
|
<Tbody>
|
|
161
|
-
{sortedConnections.map(connection => (
|
|
161
|
+
{sortedConnections.map((connection) => (
|
|
162
162
|
<Tr key={connection.source.podName}>
|
|
163
163
|
<Td dataLabel={columnNames.source}>{connection.source.podName}</Td>
|
|
164
164
|
<Td dataLabel={columnNames.destination}>{connection.destination.podName}</Td>\
|
|
165
165
|
<Td dataLabel={columnNames.datetime}>
|
|
166
166
|
<div>
|
|
167
167
|
<span>{new Date(connection.timestamp).toDateString()}</span>{' '}
|
|
168
|
-
<span className="pf-u-color-200">{new Date(connection.timestamp).toLocaleTimeString()}</span>
|
|
168
|
+
<span className="pf-v5-u-color-200">{new Date(connection.timestamp).toLocaleTimeString()}</span>
|
|
169
169
|
</div>
|
|
170
170
|
</Td>
|
|
171
171
|
<Td dataLabel={columnNames.source}>
|
|
@@ -174,7 +174,7 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
|
|
|
174
174
|
<span>{connection.source.port.num}</span>
|
|
175
175
|
</StackItem>
|
|
176
176
|
<StackItem>
|
|
177
|
-
<span className="pf-u-color-200">({connection.source.port.protocol})</span>
|
|
177
|
+
<span className="pf-v5-u-color-200">({connection.source.port.protocol})</span>
|
|
178
178
|
</StackItem>
|
|
179
179
|
</Stack>
|
|
180
180
|
</Td>
|
|
@@ -184,7 +184,7 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
|
|
|
184
184
|
<span>{connection.destination.port.num}</span>
|
|
185
185
|
</StackItem>
|
|
186
186
|
<StackItem>
|
|
187
|
-
<span className="pf-u-color-200">({connection.destination.port.protocol})</span>
|
|
187
|
+
<span className="pf-v5-u-color-200">({connection.destination.port.protocol})</span>
|
|
188
188
|
</StackItem>
|
|
189
189
|
</Stack>
|
|
190
190
|
</Td>
|
|
@@ -10,7 +10,7 @@ Object {
|
|
|
10
10
|
>
|
|
11
11
|
|
|
12
12
|
</SelectColumn>,
|
|
13
|
-
"className": "pf-c-table__check",
|
|
13
|
+
"className": "pf-v5-c-table__check",
|
|
14
14
|
"component": "td",
|
|
15
15
|
"isVisible": true,
|
|
16
16
|
}
|
|
@@ -26,6 +26,6 @@ Object {
|
|
|
26
26
|
>
|
|
27
27
|
|
|
28
28
|
</SortColumn>,
|
|
29
|
-
"className": "pf-c-table__sort pf-m-selected",
|
|
29
|
+
"className": "pf-v5-c-table__sort pf-m-selected",
|
|
30
30
|
}
|
|
31
31
|
`;
|
|
@@ -8,92 +8,90 @@ import { Checkbox } from '@patternfly/react-core/dist/esm/components/Checkbox';
|
|
|
8
8
|
import AngleDownIcon from '@patternfly/react-icons/dist/esm/icons/angle-down-icon';
|
|
9
9
|
import EllipsisHIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-h-icon';
|
|
10
10
|
|
|
11
|
-
export const treeRow =
|
|
12
|
-
onCollapse: OnTreeRowCollapse,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
11
|
+
export const treeRow =
|
|
12
|
+
(onCollapse: OnTreeRowCollapse, onCheckChange?: OnCheckChange, onToggleRowDetails?: OnToggleRowDetails) =>
|
|
13
|
+
(value: IFormatterValueType, { rowIndex, rowData }: IExtra) => {
|
|
14
|
+
const {
|
|
15
|
+
isExpanded,
|
|
16
|
+
isDetailsExpanded,
|
|
17
|
+
'aria-level': level,
|
|
18
|
+
'aria-setsize': setsize,
|
|
19
|
+
toggleAriaLabel,
|
|
20
|
+
checkAriaLabel,
|
|
21
|
+
showDetailsAriaLabel,
|
|
22
|
+
isChecked,
|
|
23
|
+
checkboxId,
|
|
24
|
+
icon
|
|
25
|
+
} = rowData.props;
|
|
26
|
+
const content = value.title || value;
|
|
27
|
+
const text = (
|
|
28
|
+
<div className={css(stylesTreeView.tableTreeViewText)} key="tree-view-text">
|
|
29
|
+
{icon && (
|
|
30
|
+
<span className={css(stylesTreeView.tableTreeViewIcon)} key="tree-view-text-icon">
|
|
31
|
+
{icon}
|
|
32
|
+
</span>
|
|
33
|
+
)}
|
|
34
|
+
<span className="pf-v5-c-table__text" key="table-text">
|
|
35
|
+
{content as React.ReactNode}
|
|
34
36
|
</span>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
const onChange = (isChecked: boolean, event: React.FormEvent<HTMLInputElement>) => {
|
|
40
|
+
onCheckChange(event, isChecked, rowIndex, content as React.ReactNode, rowData);
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
component: 'th',
|
|
44
|
+
className: 'pf-v5-c-table__tree-view-title-cell',
|
|
45
|
+
children:
|
|
46
|
+
level !== undefined ? (
|
|
47
|
+
<div className={css(stylesTreeView.tableTreeViewMain)}>
|
|
48
|
+
{setsize > 0 && (
|
|
49
|
+
<span className={css(stylesTreeView.tableToggle)} key="table-toggle">
|
|
50
|
+
<Button
|
|
51
|
+
variant="plain"
|
|
52
|
+
onClick={(event) => onCollapse && onCollapse(event, rowIndex, content as React.ReactNode, rowData)}
|
|
53
|
+
className={css(isExpanded && styles.modifiers.expanded)}
|
|
54
|
+
aria-expanded={isExpanded}
|
|
55
|
+
aria-label={toggleAriaLabel || `${isExpanded ? 'Collapse' : 'Expand'} row ${rowIndex}`}
|
|
56
|
+
>
|
|
57
|
+
<div className={css(stylesTreeView.tableToggleIcon)}>
|
|
58
|
+
<AngleDownIcon aria-hidden="true" />
|
|
59
|
+
</div>
|
|
60
|
+
</Button>
|
|
61
|
+
</span>
|
|
62
|
+
)}
|
|
63
|
+
{!!onCheckChange && (
|
|
64
|
+
<span className={css(stylesTreeView.tableCheck)} key="table-check">
|
|
65
|
+
<label htmlFor={checkboxId || `checkbox_${rowIndex}`}>
|
|
66
|
+
<Checkbox
|
|
67
|
+
id={checkboxId || `checkbox_${rowIndex}`}
|
|
68
|
+
aria-label={checkAriaLabel || `Row ${rowIndex} checkbox`}
|
|
69
|
+
isChecked={isChecked}
|
|
70
|
+
onChange={(event, checked) => onChange(checked, event)}
|
|
71
|
+
/>
|
|
72
|
+
</label>
|
|
73
|
+
</span>
|
|
74
|
+
)}
|
|
75
|
+
{text}
|
|
76
|
+
{!!onToggleRowDetails && (
|
|
77
|
+
<span className={css(stylesTreeView.tableTreeViewDetailsToggle)} key="view-details-toggle">
|
|
78
|
+
<Button
|
|
79
|
+
variant="plain"
|
|
80
|
+
aria-expanded={isDetailsExpanded}
|
|
81
|
+
aria-label={showDetailsAriaLabel || 'Show row details'}
|
|
82
|
+
onClick={(event) =>
|
|
83
|
+
onToggleRowDetails && onToggleRowDetails(event, rowIndex, content as React.ReactNode, rowData)
|
|
84
|
+
}
|
|
85
|
+
>
|
|
86
|
+
<span className="pf-v5-c-table__details-toggle-icon">
|
|
87
|
+
<EllipsisHIcon aria-hidden />
|
|
88
|
+
</span>
|
|
89
|
+
</Button>
|
|
90
|
+
</span>
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
) : (
|
|
94
|
+
text
|
|
95
|
+
)
|
|
96
|
+
};
|
|
43
97
|
};
|
|
44
|
-
return {
|
|
45
|
-
component: 'th',
|
|
46
|
-
className: 'pf-c-table__tree-view-title-cell',
|
|
47
|
-
children:
|
|
48
|
-
level !== undefined ? (
|
|
49
|
-
<div className={css(stylesTreeView.tableTreeViewMain)}>
|
|
50
|
-
{setsize > 0 && (
|
|
51
|
-
<span className={css(stylesTreeView.tableToggle)} key="table-toggle">
|
|
52
|
-
<Button
|
|
53
|
-
variant="plain"
|
|
54
|
-
onClick={event => onCollapse && onCollapse(event, rowIndex, content as React.ReactNode, rowData)}
|
|
55
|
-
className={css(isExpanded && styles.modifiers.expanded)}
|
|
56
|
-
aria-expanded={isExpanded}
|
|
57
|
-
aria-label={toggleAriaLabel || `${isExpanded ? 'Collapse' : 'Expand'} row ${rowIndex}`}
|
|
58
|
-
>
|
|
59
|
-
<div className={css(stylesTreeView.tableToggleIcon)}>
|
|
60
|
-
<AngleDownIcon aria-hidden="true" />
|
|
61
|
-
</div>
|
|
62
|
-
</Button>
|
|
63
|
-
</span>
|
|
64
|
-
)}
|
|
65
|
-
{!!onCheckChange && (
|
|
66
|
-
<span className={css(stylesTreeView.tableCheck)} key="table-check">
|
|
67
|
-
<label htmlFor={checkboxId || `checkbox_${rowIndex}`}>
|
|
68
|
-
<Checkbox
|
|
69
|
-
id={checkboxId || `checkbox_${rowIndex}`}
|
|
70
|
-
aria-label={checkAriaLabel || `Row ${rowIndex} checkbox`}
|
|
71
|
-
isChecked={isChecked}
|
|
72
|
-
onChange={(event, checked) => onChange(checked, event)}
|
|
73
|
-
/>
|
|
74
|
-
</label>
|
|
75
|
-
</span>
|
|
76
|
-
)}
|
|
77
|
-
{text}
|
|
78
|
-
{!!onToggleRowDetails && (
|
|
79
|
-
<span className={css(stylesTreeView.tableTreeViewDetailsToggle)} key="view-details-toggle">
|
|
80
|
-
<Button
|
|
81
|
-
variant="plain"
|
|
82
|
-
aria-expanded={isDetailsExpanded}
|
|
83
|
-
aria-label={showDetailsAriaLabel || 'Show row details'}
|
|
84
|
-
onClick={event =>
|
|
85
|
-
onToggleRowDetails && onToggleRowDetails(event, rowIndex, content as React.ReactNode, rowData)
|
|
86
|
-
}
|
|
87
|
-
>
|
|
88
|
-
<span className="pf-c-table__details-toggle-icon">
|
|
89
|
-
<EllipsisHIcon aria-hidden />
|
|
90
|
-
</span>
|
|
91
|
-
</Button>
|
|
92
|
-
</span>
|
|
93
|
-
)}
|
|
94
|
-
</div>
|
|
95
|
-
) : (
|
|
96
|
-
text
|
|
97
|
-
)
|
|
98
|
-
};
|
|
99
|
-
};
|
|
@@ -65,7 +65,7 @@ const testCellActions = async ({
|
|
|
65
65
|
actions = actionResolver(rowData, extraData);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
expect(returnedData).toMatchObject({ className: 'pf-c-table__action' });
|
|
68
|
+
expect(returnedData).toMatchObject({ className: 'pf-v5-c-table__action' });
|
|
69
69
|
|
|
70
70
|
if (!actions || actions.length === 0) {
|
|
71
71
|
expect(returnedData.children).toBeUndefined();
|
|
@@ -86,7 +86,7 @@ describe('Transformer functions', () => {
|
|
|
86
86
|
extraParams: { onSelect }
|
|
87
87
|
};
|
|
88
88
|
const returnedData = selectable('', { column, rowData: {} } as IExtra);
|
|
89
|
-
expect(returnedData).toMatchObject({ className: 'pf-c-table__check' });
|
|
89
|
+
expect(returnedData).toMatchObject({ className: 'pf-v5-c-table__check' });
|
|
90
90
|
|
|
91
91
|
const user = userEvent.setup();
|
|
92
92
|
|
|
@@ -103,7 +103,7 @@ describe('Transformer functions', () => {
|
|
|
103
103
|
extraParams: { onSelect }
|
|
104
104
|
};
|
|
105
105
|
const returnedData = selectable('', { column, rowIndex: 0, rowData: { selected: true } } as IExtra);
|
|
106
|
-
expect(returnedData).toMatchObject({ className: 'pf-c-table__check' });
|
|
106
|
+
expect(returnedData).toMatchObject({ className: 'pf-v5-c-table__check' });
|
|
107
107
|
const user = userEvent.setup();
|
|
108
108
|
|
|
109
109
|
render(returnedData.children as React.ReactElement<any>);
|
|
@@ -128,7 +128,7 @@ describe('Transformer functions', () => {
|
|
|
128
128
|
const onSort = jest.fn();
|
|
129
129
|
const column = { extraParams: { sortBy: {}, onSort } };
|
|
130
130
|
const returnedData = sortable('', { column, columnIndex: 0 });
|
|
131
|
-
expect(returnedData).toMatchObject({ className: 'pf-c-table__sort' });
|
|
131
|
+
expect(returnedData).toMatchObject({ className: 'pf-v5-c-table__sort' });
|
|
132
132
|
|
|
133
133
|
const user = userEvent.setup();
|
|
134
134
|
|
|
@@ -154,7 +154,7 @@ describe('Transformer functions', () => {
|
|
|
154
154
|
const onSort = jest.fn();
|
|
155
155
|
const column = { extraParams: { sortBy: { index: 0, direction: 'desc' }, onSort } };
|
|
156
156
|
const returnedData = sortable('', { column, columnIndex: 0 } as IExtra);
|
|
157
|
-
expect(returnedData).toMatchObject({ className: 'pf-c-table__sort pf-m-selected' });
|
|
157
|
+
expect(returnedData).toMatchObject({ className: 'pf-v5-c-table__sort pf-m-selected' });
|
|
158
158
|
|
|
159
159
|
const user = userEvent.setup();
|
|
160
160
|
|
|
@@ -226,7 +226,7 @@ describe('Transformer functions', () => {
|
|
|
226
226
|
extraParams: { onCollapse }
|
|
227
227
|
};
|
|
228
228
|
const returnedData = collapsible('', { rowIndex: 0, rowData, column });
|
|
229
|
-
expect(returnedData).toMatchObject({ className: 'pf-c-table__toggle' });
|
|
229
|
+
expect(returnedData).toMatchObject({ className: 'pf-v5-c-table__toggle' });
|
|
230
230
|
|
|
231
231
|
const user = userEvent.setup();
|
|
232
232
|
|
|
@@ -332,7 +332,7 @@ describe('Transformer functions', () => {
|
|
|
332
332
|
extraParams: { onRowEdit }
|
|
333
333
|
};
|
|
334
334
|
const returned = editable('test', { rowIndex: 0, column });
|
|
335
|
-
expect(returned).toMatchObject({ className: 'pf-c-table__inline-edit-action' });
|
|
335
|
+
expect(returned).toMatchObject({ className: 'pf-v5-c-table__inline-edit-action' });
|
|
336
336
|
});
|
|
337
337
|
|
|
338
338
|
describe('visibility classNames', () => {
|