@patternfly/react-table 5.3.0-prerelease.9 → 5.4.0-prerelease.1
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 +94 -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/ActionsColumn.d.ts +2 -0
- package/dist/esm/components/Table/ActionsColumn.d.ts.map +1 -1
- package/dist/esm/components/Table/ActionsColumn.js +4 -4
- package/dist/esm/components/Table/ActionsColumn.js.map +1 -1
- package/dist/esm/components/Table/TableTypes.d.ts +2 -0
- package/dist/esm/components/Table/TableTypes.d.ts.map +1 -1
- package/dist/esm/components/Table/Th.d.ts +8 -0
- package/dist/esm/components/Table/Th.d.ts.map +1 -1
- package/dist/esm/components/Table/Th.js +7 -3
- package/dist/esm/components/Table/Th.js.map +1 -1
- package/dist/esm/components/Table/utils/decorators/selectable.js +1 -1
- package/dist/esm/components/Table/utils/decorators/selectable.js.map +1 -1
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/js/components/Table/ActionsColumn.d.ts +2 -0
- package/dist/js/components/Table/ActionsColumn.d.ts.map +1 -1
- package/dist/js/components/Table/ActionsColumn.js +4 -4
- package/dist/js/components/Table/ActionsColumn.js.map +1 -1
- package/dist/js/components/Table/TableTypes.d.ts +2 -0
- package/dist/js/components/Table/TableTypes.d.ts.map +1 -1
- package/dist/js/components/Table/Th.d.ts +8 -0
- package/dist/js/components/Table/Th.d.ts.map +1 -1
- package/dist/js/components/Table/Th.js +7 -3
- package/dist/js/components/Table/Th.js.map +1 -1
- package/dist/js/components/Table/utils/decorators/selectable.js +1 -1
- package/dist/js/components/Table/utils/decorators/selectable.js.map +1 -1
- package/dist/js/index.d.ts +0 -1
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +0 -1
- package/dist/js/index.js.map +1 -1
- package/dist/umd/react-table.min.js +3 -3
- package/package.json +6 -6
- package/src/components/Table/ActionsColumn.tsx +33 -28
- package/src/components/Table/TableTypes.tsx +2 -0
- package/src/components/Table/Th.tsx +20 -2
- package/src/components/Table/__tests__/Th.test.tsx +31 -0
- package/src/components/Table/examples/TableActions.tsx +2 -2
- package/src/components/Table/examples/TableActionsOverflow.tsx +1 -1
- package/src/components/Table/examples/TableCompoundExpandable.tsx +1 -1
- package/src/components/Table/examples/TableDraggable.tsx +19 -16
- package/src/components/Table/examples/TableExpandable.tsx +1 -1
- package/src/components/Table/examples/TableNestedExpandable.tsx +1 -1
- package/src/components/Table/examples/TableNestedStickyHeader.tsx +3 -0
- package/src/components/Table/examples/TableNestedTableExpandable.tsx +1 -1
- package/src/components/Table/examples/TableSelectable.tsx +1 -0
- package/src/components/Table/examples/TableSelectableRadio.tsx +1 -1
- package/src/components/Table/examples/TableStripedExpandable.tsx +1 -1
- package/src/components/Table/utils/decorators/selectable.tsx +1 -1
- package/src/demos/Table.md +2 -2
- package/src/demos/examples/TableBulkSelect.tsx +1 -1
- package/src/demos/examples/TableCompoundExpansion.tsx +3 -2
- package/src/demos/examples/TableExpandCollapseAll.tsx +2 -1
- package/src/demos/examples/TableSortableResponsive.tsx +1 -1
- package/src/deprecated/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +10 -4
- package/src/index.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0-prerelease.1",
|
|
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",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"subpaths": "node ../../scripts/exportSubpaths.js --config subpaths.config.json"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@patternfly/react-core": "^5.
|
|
43
|
-
"@patternfly/react-icons": "^5.
|
|
44
|
-
"@patternfly/react-styles": "^5.
|
|
45
|
-
"@patternfly/react-tokens": "^5.
|
|
42
|
+
"@patternfly/react-core": "^5.4.0-prerelease.1",
|
|
43
|
+
"@patternfly/react-icons": "^5.4.0-prerelease.0",
|
|
44
|
+
"@patternfly/react-styles": "^5.4.0-prerelease.0",
|
|
45
|
+
"@patternfly/react-tokens": "^5.4.0-prerelease.0",
|
|
46
46
|
"lodash": "^4.17.19",
|
|
47
47
|
"tslib": "^2.5.0"
|
|
48
48
|
},
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"react": "^17 || ^18",
|
|
55
55
|
"react-dom": "^17 || ^18"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "593832e72c7bbad4096109cba7d7a79a5d135635"
|
|
58
58
|
}
|
|
@@ -30,6 +30,8 @@ export interface ActionsColumnProps extends Omit<React.HTMLProps<HTMLElement>, '
|
|
|
30
30
|
innerRef?: React.Ref<any>;
|
|
31
31
|
/** Ref to forward to the first item in the popup menu */
|
|
32
32
|
firstActionItemRef?: React.Ref<HTMLButtonElement>;
|
|
33
|
+
/** Flag indicating that the dropdown's onOpenChange callback should not be called. */
|
|
34
|
+
isOnOpenChangeDisabled?: boolean;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
const ActionsColumnBase: React.FunctionComponent<ActionsColumnProps> = ({
|
|
@@ -44,6 +46,7 @@ const ActionsColumnBase: React.FunctionComponent<ActionsColumnProps> = ({
|
|
|
44
46
|
},
|
|
45
47
|
innerRef,
|
|
46
48
|
firstActionItemRef,
|
|
49
|
+
isOnOpenChangeDisabled = false,
|
|
47
50
|
...props
|
|
48
51
|
}: ActionsColumnProps) => {
|
|
49
52
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
@@ -91,7 +94,7 @@ const ActionsColumnBase: React.FunctionComponent<ActionsColumnProps> = ({
|
|
|
91
94
|
|
|
92
95
|
<Dropdown
|
|
93
96
|
isOpen={isOpen}
|
|
94
|
-
onOpenChange={(isOpen: boolean) => setIsOpen(isOpen)}
|
|
97
|
+
onOpenChange={!isOnOpenChangeDisabled ? (isOpen: boolean) => setIsOpen(isOpen) : undefined}
|
|
95
98
|
toggle={(toggleRef: any) =>
|
|
96
99
|
actionsToggle ? (
|
|
97
100
|
actionsToggle({ onToggle, isOpen, isDisabled, toggleRef })
|
|
@@ -116,35 +119,37 @@ const ActionsColumnBase: React.FunctionComponent<ActionsColumnProps> = ({
|
|
|
116
119
|
<DropdownList>
|
|
117
120
|
{items
|
|
118
121
|
.filter((item) => !item.isOutsideDropdown)
|
|
119
|
-
.map(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (tooltipProps?.content) {
|
|
139
|
-
return (
|
|
140
|
-
<Tooltip key={itemKey || index} {...tooltipProps}>
|
|
141
|
-
{item}
|
|
142
|
-
</Tooltip>
|
|
122
|
+
.map(
|
|
123
|
+
({ title, itemKey, onClick, tooltipProps, isSeparator, shouldCloseOnClick = true, ...props }, index) => {
|
|
124
|
+
if (isSeparator) {
|
|
125
|
+
return <Divider key={itemKey || index} data-key={itemKey || index} />;
|
|
126
|
+
}
|
|
127
|
+
const item = (
|
|
128
|
+
<DropdownItem
|
|
129
|
+
onClick={(event: any) => {
|
|
130
|
+
onActionClick(event, onClick);
|
|
131
|
+
shouldCloseOnClick && onToggle();
|
|
132
|
+
}}
|
|
133
|
+
{...props}
|
|
134
|
+
key={itemKey || index}
|
|
135
|
+
data-key={itemKey || index}
|
|
136
|
+
ref={index === 0 ? firstActionItemRef : undefined}
|
|
137
|
+
>
|
|
138
|
+
{title}
|
|
139
|
+
</DropdownItem>
|
|
143
140
|
);
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
|
|
142
|
+
if (tooltipProps?.content) {
|
|
143
|
+
return (
|
|
144
|
+
<Tooltip key={itemKey || index} {...tooltipProps}>
|
|
145
|
+
{item}
|
|
146
|
+
</Tooltip>
|
|
147
|
+
);
|
|
148
|
+
} else {
|
|
149
|
+
return item;
|
|
150
|
+
}
|
|
146
151
|
}
|
|
147
|
-
|
|
152
|
+
)}
|
|
148
153
|
</DropdownList>
|
|
149
154
|
</Dropdown>
|
|
150
155
|
</React.Fragment>
|
|
@@ -166,6 +166,8 @@ export interface IAction extends Omit<DropdownItemProps, 'title' | 'onClick'>, P
|
|
|
166
166
|
onClick?: (event: React.MouseEvent, rowIndex: number, rowData: IRowData, extraData: IExtraData) => void;
|
|
167
167
|
/** Flag indicating this action should be placed outside the actions menu, beside the toggle */
|
|
168
168
|
isOutsideDropdown?: boolean;
|
|
169
|
+
/** Flag indicating whether the actions dropdown should close after an item is clicked. */
|
|
170
|
+
shouldCloseOnClick?: boolean;
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
export interface ISeparator extends IAction {
|
|
@@ -56,6 +56,14 @@ export interface ThProps
|
|
|
56
56
|
stickyRightOffset?: string;
|
|
57
57
|
/** Indicates the <th> is part of a subheader of a nested header */
|
|
58
58
|
isSubheader?: boolean;
|
|
59
|
+
/** Visually hidden text accessible only via assistive technologies. This must be passed in if the
|
|
60
|
+
* th is intended to be visually empty, and must be conveyed as a column header text.
|
|
61
|
+
*/
|
|
62
|
+
screenReaderText?: string;
|
|
63
|
+
/** Provides an accessible name to the th. This should only be passed in when the th contains only non-text
|
|
64
|
+
* content, such as a "select all" checkbox or "expand all" toggle.
|
|
65
|
+
*/
|
|
66
|
+
'aria-label'?: string;
|
|
59
67
|
}
|
|
60
68
|
|
|
61
69
|
const ThBase: React.FunctionComponent<ThProps> = ({
|
|
@@ -83,8 +91,17 @@ const ThBase: React.FunctionComponent<ThProps> = ({
|
|
|
83
91
|
stickyLeftOffset,
|
|
84
92
|
stickyRightOffset,
|
|
85
93
|
isSubheader = false,
|
|
94
|
+
screenReaderText,
|
|
95
|
+
'aria-label': ariaLabel,
|
|
86
96
|
...props
|
|
87
97
|
}: ThProps) => {
|
|
98
|
+
if (!children && !screenReaderText && !ariaLabel) {
|
|
99
|
+
// eslint-disable-next-line no-console
|
|
100
|
+
console.warn(
|
|
101
|
+
'Th: Table headers must have an accessible name. If the Th is intended to be visually empty, pass in screenReaderText. If the Th contains only non-text, interactive content such as a checkbox or expand toggle, pass in an aria-label.'
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
88
105
|
const [showTooltip, setShowTooltip] = React.useState(false);
|
|
89
106
|
const [truncated, setTruncated] = React.useState(false);
|
|
90
107
|
const cellRef = innerRef ? innerRef : React.createRef();
|
|
@@ -188,8 +205,9 @@ const ThBase: React.FunctionComponent<ThProps> = ({
|
|
|
188
205
|
onBlur={() => setShowTooltip(false)}
|
|
189
206
|
data-label={dataLabel}
|
|
190
207
|
onMouseEnter={tooltip !== null ? onMouseEnter : onMouseEnterProp}
|
|
191
|
-
scope={component === 'th'
|
|
208
|
+
scope={component === 'th' ? scope : null}
|
|
192
209
|
ref={cellRef}
|
|
210
|
+
aria-label={ariaLabel}
|
|
193
211
|
className={css(
|
|
194
212
|
styles.tableTh,
|
|
195
213
|
className,
|
|
@@ -212,7 +230,7 @@ const ThBase: React.FunctionComponent<ThProps> = ({
|
|
|
212
230
|
} as React.CSSProperties
|
|
213
231
|
})}
|
|
214
232
|
>
|
|
215
|
-
{transformedChildren}
|
|
233
|
+
{transformedChildren || (screenReaderText && <span className="pf-v5-screen-reader">{screenReaderText}</span>)}
|
|
216
234
|
</MergedComponent>
|
|
217
235
|
);
|
|
218
236
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { Th } from '../Th';
|
|
4
|
+
|
|
5
|
+
test('Does not render with aria-label by default', () => {
|
|
6
|
+
render(<Th />);
|
|
7
|
+
expect(screen.getByRole('columnheader')).not.toHaveAccessibleName();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('Renders with aria-label when passed in', () => {
|
|
11
|
+
render(<Th aria-label="Test" />);
|
|
12
|
+
expect(screen.getByRole('columnheader')).toHaveAccessibleName('Test');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('Does not render with screen reader text by default', () => {
|
|
16
|
+
render(<Th />);
|
|
17
|
+
|
|
18
|
+
expect(screen.getByRole('columnheader')).toBeEmptyDOMElement();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test('Does not render with screen reader text when children are passed in', () => {
|
|
22
|
+
render(<Th screenReaderText="Test">Heading label</Th>);
|
|
23
|
+
|
|
24
|
+
expect(screen.getByRole('columnheader')).not.toHaveTextContent('Test');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('Renders with screen reader text when screenReaderText is passed in', () => {
|
|
28
|
+
render(<Th screenReaderText="Test" />);
|
|
29
|
+
|
|
30
|
+
expect(screen.getByRole('columnheader')).toHaveTextContent('Test');
|
|
31
|
+
});
|
|
@@ -116,8 +116,8 @@ export const TableActions: React.FunctionComponent = () => {
|
|
|
116
116
|
<Th>{columnNames.prs}</Th>
|
|
117
117
|
<Th>{columnNames.workspaces}</Th>
|
|
118
118
|
<Th>{columnNames.lastCommit}</Th>
|
|
119
|
-
<
|
|
120
|
-
<
|
|
119
|
+
<Th screenReaderText="Primary action" />
|
|
120
|
+
<Th screenReaderText="Secondary action" />
|
|
121
121
|
</Tr>
|
|
122
122
|
</Thead>
|
|
123
123
|
<Tbody>
|
|
@@ -67,7 +67,7 @@ export const TableCompoundExpandable: React.FunctionComponent = () => {
|
|
|
67
67
|
<Th>{columnNames.prs}</Th>
|
|
68
68
|
<Th>{columnNames.workspaces}</Th>
|
|
69
69
|
<Th>{columnNames.lastCommit}</Th>
|
|
70
|
-
<Th />
|
|
70
|
+
<Th screenReaderText="URL" />
|
|
71
71
|
</Tr>
|
|
72
72
|
</Thead>
|
|
73
73
|
{repositories.map((repo: Repository, rowIndex: number) => {
|
|
@@ -140,30 +140,33 @@ export const TableDraggable: React.FunctionComponent = () => {
|
|
|
140
140
|
];
|
|
141
141
|
|
|
142
142
|
return (
|
|
143
|
-
<Table aria-label="Draggable table" className={isDragging
|
|
143
|
+
<Table aria-label="Draggable table" className={isDragging ? styles.modifiers.dragOver : ''}>
|
|
144
144
|
<Thead>
|
|
145
145
|
<Tr>
|
|
146
|
-
<Th />
|
|
146
|
+
<Th screenReaderText="Drag and drop" />
|
|
147
147
|
{columns.map((column, columnIndex) => (
|
|
148
148
|
<Th key={columnIndex}>{column}</Th>
|
|
149
149
|
))}
|
|
150
150
|
</Tr>
|
|
151
151
|
</Thead>
|
|
152
152
|
<Tbody ref={bodyRef} onDragOver={onDragOver} onDrop={onDragOver} onDragLeave={onDragLeave}>
|
|
153
|
-
{rows.map((row, rowIndex) =>
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
153
|
+
{rows.map((row, rowIndex) => {
|
|
154
|
+
const rowCellsToBuild = Object.keys(row).filter((rowCell) => rowCell !== 'id');
|
|
155
|
+
return (
|
|
156
|
+
<Tr key={rowIndex} id={row.id} draggable onDrop={onDrop} onDragEnd={onDragEnd} onDragStart={onDragStart}>
|
|
157
|
+
<Td
|
|
158
|
+
draggableRow={{
|
|
159
|
+
id: `draggable-row-${row.id}`
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
162
|
+
{rowCellsToBuild.map((key, keyIndex) => (
|
|
163
|
+
<Td key={`${rowIndex}_${keyIndex}`} dataLabel={columns[keyIndex]}>
|
|
164
|
+
{row[key]}
|
|
165
|
+
</Td>
|
|
166
|
+
))}
|
|
167
|
+
</Tr>
|
|
168
|
+
);
|
|
169
|
+
})}
|
|
167
170
|
</Tbody>
|
|
168
171
|
</Table>
|
|
169
172
|
);
|
|
@@ -120,7 +120,7 @@ export const TableExpandable: React.FunctionComponent = () => {
|
|
|
120
120
|
<Table aria-label="Expandable table" variant={isExampleCompact ? 'compact' : undefined}>
|
|
121
121
|
<Thead>
|
|
122
122
|
<Tr>
|
|
123
|
-
<Th />
|
|
123
|
+
<Th screenReaderText="Row expansion" />
|
|
124
124
|
<Th width={25}>{columnNames.name}</Th>
|
|
125
125
|
<Th width={10}>{columnNames.branches}</Th>
|
|
126
126
|
<Th width={15}>{columnNames.prs}</Th>
|
|
@@ -64,7 +64,7 @@ export const TableNestedExpandable: React.FunctionComponent = () => {
|
|
|
64
64
|
<Table aria-label="Nested column headers with expandable rows table" gridBreakPoint="">
|
|
65
65
|
<Thead hasNestedHeader>
|
|
66
66
|
<Tr>
|
|
67
|
-
<Th rowSpan={2} />
|
|
67
|
+
<Th screenReaderText="Row expansion" rowSpan={2} />
|
|
68
68
|
<Th width={35} rowSpan={2} hasRightBorder>
|
|
69
69
|
{columnNames.team}
|
|
70
70
|
</Th>
|
|
@@ -154,6 +154,9 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
|
|
|
154
154
|
{columnNames.destination}
|
|
155
155
|
</Th>
|
|
156
156
|
</Tr>
|
|
157
|
+
{/* TODO: Remove the following Tr once Core updates towards https://github.com/patternfly/patternfly/issues/6272
|
|
158
|
+
are made for the v5 branch. For v6 branch the row can be removed immediately.
|
|
159
|
+
*/}
|
|
157
160
|
<Tr isBorderRow aria-hidden="true">
|
|
158
161
|
<Td colSpan={9}></Td>
|
|
159
162
|
</Tr>
|
|
@@ -131,7 +131,7 @@ export const TableExpandable: React.FunctionComponent = () => {
|
|
|
131
131
|
<Table aria-label="Simple table">
|
|
132
132
|
<Thead>
|
|
133
133
|
<Tr>
|
|
134
|
-
<
|
|
134
|
+
<Th screenReaderText="Row expansion" />
|
|
135
135
|
<Th width={20}>{columnNames.name}</Th>
|
|
136
136
|
<Th>{columnNames.branches}</Th>
|
|
137
137
|
<Th>{columnNames.prs}</Th>
|
|
@@ -93,6 +93,7 @@ export const TableSelectable: React.FunctionComponent = () => {
|
|
|
93
93
|
onSelect: (_event, isSelecting) => selectAllRepos(isSelecting),
|
|
94
94
|
isSelected: areAllReposSelected
|
|
95
95
|
}}
|
|
96
|
+
aria-label="Row select"
|
|
96
97
|
/>
|
|
97
98
|
<Th>{columnNames.name}</Th>
|
|
98
99
|
<Th>{columnNames.branches}</Th>
|
|
@@ -35,7 +35,7 @@ export const TableSelectableRadio: React.FunctionComponent = () => {
|
|
|
35
35
|
<Table aria-label="Selectable table">
|
|
36
36
|
<Thead>
|
|
37
37
|
<Tr>
|
|
38
|
-
<Th />
|
|
38
|
+
<Th screenReaderText="Row select" />
|
|
39
39
|
<Th>{columnNames.name}</Th>
|
|
40
40
|
<Th>{columnNames.branches}</Th>
|
|
41
41
|
<Th>{columnNames.prs}</Th>
|
|
@@ -115,7 +115,7 @@ export const TableStripedExpandable: React.FunctionComponent = () => {
|
|
|
115
115
|
<Table aria-label="Expandable table" variant={isExampleCompact ? 'compact' : undefined} isStriped isExpandable>
|
|
116
116
|
<Thead>
|
|
117
117
|
<Tr>
|
|
118
|
-
<Th />
|
|
118
|
+
<Th screenReaderText="Row expansion" />
|
|
119
119
|
<Th width={25}>{columnNames.name}</Th>
|
|
120
120
|
<Th width={10}>{columnNames.branches}</Th>
|
|
121
121
|
<Th width={15}>{columnNames.prs}</Th>
|
package/src/demos/Table.md
CHANGED
|
@@ -103,7 +103,7 @@ import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
|
103
103
|
|
|
104
104
|
### Column management with draggable
|
|
105
105
|
|
|
106
|
-
```js isFullscreen file="./examples/TableColumnManagementWithDraggable.tsx"
|
|
106
|
+
```js isDeprecated isFullscreen file="./examples/TableColumnManagementWithDraggable.tsx"
|
|
107
107
|
|
|
108
108
|
```
|
|
109
109
|
|
|
@@ -136,7 +136,7 @@ To demonstrate this, navigate to the last page of data below using the `>>` navi
|
|
|
136
136
|
|
|
137
137
|
### Static bottom pagination on mobile
|
|
138
138
|
|
|
139
|
-
```
|
|
139
|
+
```js isFullscreen file="./examples/TableStaticBottomPagination.tsx"
|
|
140
140
|
|
|
141
141
|
```
|
|
142
142
|
|
|
@@ -154,7 +154,7 @@ export const TableBulkSelect: React.FunctionComponent = () => {
|
|
|
154
154
|
<Table aria-label="Selectable table">
|
|
155
155
|
<Thead>
|
|
156
156
|
<Tr>
|
|
157
|
-
<Th />
|
|
157
|
+
<Th screenReaderText="Row select" />
|
|
158
158
|
<Th key={0}>{columns[0]}</Th>
|
|
159
159
|
<Th key={1}>{columns[1]}</Th>
|
|
160
160
|
<Th key={2}>{columns[2]}</Th>
|
|
@@ -51,7 +51,7 @@ export const TableCompoundExpansion: React.FunctionComponent = () => {
|
|
|
51
51
|
<Th>{columnNames.description}</Th>
|
|
52
52
|
<Th>{columnNames.date}</Th>
|
|
53
53
|
<Th>{columnNames.status}</Th>
|
|
54
|
-
<Th />
|
|
54
|
+
<Th screenReaderText="Actions" />
|
|
55
55
|
</Tr>
|
|
56
56
|
</Thead>
|
|
57
57
|
<Tbody>
|
|
@@ -205,7 +205,8 @@ export const TableCompoundExpansion: React.FunctionComponent = () => {
|
|
|
205
205
|
<Th>{columnNames.prs}</Th>
|
|
206
206
|
<Th>{columnNames.workspaces}</Th>
|
|
207
207
|
<Th>{columnNames.lastCommit}</Th>
|
|
208
|
-
<Th />
|
|
208
|
+
<Th screenReaderText="URL" />
|
|
209
|
+
<Th screenReaderText="Actions" />
|
|
209
210
|
</Tr>
|
|
210
211
|
</Thead>
|
|
211
212
|
{repositories.map((repo, rowIndex) => {
|
|
@@ -164,7 +164,8 @@ export const TableExpandCollapseAll: React.FunctionComponent = () => {
|
|
|
164
164
|
collapseAllAriaLabel,
|
|
165
165
|
onToggle: onCollapseAll
|
|
166
166
|
}}
|
|
167
|
-
|
|
167
|
+
aria-label="Row expansion"
|
|
168
|
+
/>
|
|
168
169
|
{expandableColumns.map((column) => (
|
|
169
170
|
<Th key={column}>{column}</Th>
|
|
170
171
|
))}
|
|
@@ -88,7 +88,7 @@ export const TableSortableResponsive: React.FunctionComponent = () => {
|
|
|
88
88
|
const kebabDropdownItems = [<OverflowMenuDropdownItem key="kebab-1">Some action</OverflowMenuDropdownItem>];
|
|
89
89
|
|
|
90
90
|
React.useEffect(() => {
|
|
91
|
-
setSortedRows(sortedData.slice((page - 1) * perPage, page * perPage
|
|
91
|
+
setSortedRows(sortedData.slice((page - 1) * perPage, page * perPage));
|
|
92
92
|
}, [sortedData, page, perPage]);
|
|
93
93
|
|
|
94
94
|
const handleSetPage = (_evt: React.MouseEvent | React.KeyboardEvent | MouseEvent, newPage: number) => {
|
|
@@ -1366,6 +1366,7 @@ exports[`Table Collapsible nested table 1`] = `
|
|
|
1366
1366
|
class="pf-v5-c-table__th"
|
|
1367
1367
|
data-key="0"
|
|
1368
1368
|
data-label=""
|
|
1369
|
+
scope=""
|
|
1369
1370
|
tabindex="-1"
|
|
1370
1371
|
/>
|
|
1371
1372
|
<th
|
|
@@ -2118,6 +2119,7 @@ exports[`Table Collapsible table 1`] = `
|
|
|
2118
2119
|
class="pf-v5-c-table__th"
|
|
2119
2120
|
data-key="0"
|
|
2120
2121
|
data-label=""
|
|
2122
|
+
scope=""
|
|
2121
2123
|
tabindex="-1"
|
|
2122
2124
|
/>
|
|
2123
2125
|
<th
|
|
@@ -4133,10 +4135,11 @@ exports[`Table Selectable table 1`] = `
|
|
|
4133
4135
|
data-ouia-component-type="PF5/TableRow"
|
|
4134
4136
|
data-ouia-safe="true"
|
|
4135
4137
|
>
|
|
4136
|
-
<
|
|
4138
|
+
<th
|
|
4137
4139
|
class="pf-v5-c-table__th pf-v5-c-table__check"
|
|
4138
4140
|
data-key="0"
|
|
4139
4141
|
data-label=""
|
|
4142
|
+
scope=""
|
|
4140
4143
|
tabindex="-1"
|
|
4141
4144
|
>
|
|
4142
4145
|
<label>
|
|
@@ -4146,7 +4149,7 @@ exports[`Table Selectable table 1`] = `
|
|
|
4146
4149
|
type="checkbox"
|
|
4147
4150
|
/>
|
|
4148
4151
|
</label>
|
|
4149
|
-
</
|
|
4152
|
+
</th>
|
|
4150
4153
|
<th
|
|
4151
4154
|
aria-sort="none"
|
|
4152
4155
|
class="pf-v5-c-table__th pf-v5-c-table__sort"
|
|
@@ -4837,6 +4840,7 @@ exports[`Table Selectable table with Radio 1`] = `
|
|
|
4837
4840
|
class="pf-v5-c-table__th"
|
|
4838
4841
|
data-key="0"
|
|
4839
4842
|
data-label=""
|
|
4843
|
+
scope=""
|
|
4840
4844
|
tabindex="-1"
|
|
4841
4845
|
/>
|
|
4842
4846
|
<th
|
|
@@ -5525,10 +5529,11 @@ exports[`Table Selectable table with selected expandable row 1`] = `
|
|
|
5525
5529
|
data-ouia-component-type="PF5/TableRow"
|
|
5526
5530
|
data-ouia-safe="true"
|
|
5527
5531
|
>
|
|
5528
|
-
<
|
|
5532
|
+
<th
|
|
5529
5533
|
class="pf-v5-c-table__th pf-v5-c-table__check"
|
|
5530
5534
|
data-key="0"
|
|
5531
5535
|
data-label=""
|
|
5536
|
+
scope=""
|
|
5532
5537
|
tabindex="-1"
|
|
5533
5538
|
>
|
|
5534
5539
|
<label>
|
|
@@ -5539,7 +5544,7 @@ exports[`Table Selectable table with selected expandable row 1`] = `
|
|
|
5539
5544
|
type="checkbox"
|
|
5540
5545
|
/>
|
|
5541
5546
|
</label>
|
|
5542
|
-
</
|
|
5547
|
+
</th>
|
|
5543
5548
|
<th
|
|
5544
5549
|
class="pf-v5-c-table__th"
|
|
5545
5550
|
data-key="1"
|
|
@@ -10229,6 +10234,7 @@ exports[`Table simple Editable table 1`] = `
|
|
|
10229
10234
|
class="pf-v5-c-table__th"
|
|
10230
10235
|
data-key="4"
|
|
10231
10236
|
data-label=""
|
|
10237
|
+
scope=""
|
|
10232
10238
|
tabindex="-1"
|
|
10233
10239
|
/>
|
|
10234
10240
|
</tr>
|
package/src/index.ts
CHANGED