@patternfly/react-table 5.0.0-alpha.98 → 5.0.0-alpha.99
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 +6 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/esm/components/Table/RowWrapper.js +2 -2
- package/dist/esm/components/Table/Table.js +2 -2
- package/dist/esm/components/Table/Table.js.map +1 -1
- package/dist/esm/components/Table/TableTypes.d.ts +1 -1
- package/dist/esm/components/Table/Tr.d.ts +3 -3
- 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/components/Table/base/provider.d.ts +2 -2
- package/dist/esm/components/Table/base/types.d.ts +2 -2
- package/dist/js/components/Table/RowWrapper.js +2 -2
- package/dist/js/components/Table/Table.js +2 -2
- package/dist/js/components/Table/Table.js.map +1 -1
- package/dist/js/components/Table/TableTypes.d.ts +1 -1
- package/dist/js/components/Table/Tr.d.ts +3 -3
- 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/components/Table/base/provider.d.ts +2 -2
- package/dist/js/components/Table/base/types.d.ts +2 -2
- 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/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 +1 -1
- package/package.json +3 -3
- package/src/components/Table/RowWrapper.tsx +2 -2
- package/src/components/Table/Table.tsx +2 -2
- package/src/components/Table/TableTypes.tsx +1 -1
- package/src/components/Table/Tr.tsx +6 -6
- package/src/components/Table/examples/Table.md +2 -2
- package/src/components/Table/examples/{TableHoverable.tsx → TableClickable.tsx} +3 -3
- package/src/deprecated/components/Table/examples/{LegacyTableHoverable.tsx → LegacyTableClickable.tsx} +2 -2
- package/src/deprecated/components/Table/examples/Table.md +2 -2
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.99",
|
|
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,7 +40,7 @@
|
|
|
40
40
|
"subpaths": "node scripts/createSubpaths.js"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@patternfly/react-core": "^5.0.0-alpha.
|
|
43
|
+
"@patternfly/react-core": "^5.0.0-alpha.97",
|
|
44
44
|
"@patternfly/react-icons": "^5.0.0-alpha.14",
|
|
45
45
|
"@patternfly/react-styles": "^5.0.0-alpha.10",
|
|
46
46
|
"@patternfly/react-tokens": "^5.0.0-alpha.9",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"react": "^17 || ^18",
|
|
56
56
|
"react-dom": "^17 || ^18"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "2f2eb377c744647e34d557e1550ae7a01f87f5a6"
|
|
59
59
|
}
|
|
@@ -94,7 +94,7 @@ export class RowWrapper extends React.Component<RowWrapperProps> {
|
|
|
94
94
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
95
95
|
onScroll,
|
|
96
96
|
onResize,
|
|
97
|
-
row: { isExpanded, isEditable,
|
|
97
|
+
row: { isExpanded, isEditable, isClickable, isRowSelected },
|
|
98
98
|
rowProps,
|
|
99
99
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
100
100
|
trRef,
|
|
@@ -111,7 +111,7 @@ export class RowWrapper extends React.Component<RowWrapperProps> {
|
|
|
111
111
|
isEditable={isEditable}
|
|
112
112
|
className={className}
|
|
113
113
|
ouiaId={ouiaId}
|
|
114
|
-
|
|
114
|
+
isClickable={isClickable}
|
|
115
115
|
isRowSelected={isRowSelected}
|
|
116
116
|
/>
|
|
117
117
|
);
|
|
@@ -121,7 +121,7 @@ const TableBase: React.FunctionComponent<TableProps> = ({
|
|
|
121
121
|
setTableCaption(
|
|
122
122
|
<caption>
|
|
123
123
|
{selectableRowCaptionText}
|
|
124
|
-
<div className="pf-screen-reader">
|
|
124
|
+
<div className="pf-v5-screen-reader">
|
|
125
125
|
This table has selectable rows. It can be navigated by row using tab, and each row can be selected using
|
|
126
126
|
space or enter.
|
|
127
127
|
</div>
|
|
@@ -129,7 +129,7 @@ const TableBase: React.FunctionComponent<TableProps> = ({
|
|
|
129
129
|
);
|
|
130
130
|
} else {
|
|
131
131
|
setTableCaption(
|
|
132
|
-
<caption className="pf-screen-reader">
|
|
132
|
+
<caption className="pf-v5-screen-reader">
|
|
133
133
|
This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space
|
|
134
134
|
or enter.
|
|
135
135
|
</caption>
|
|
@@ -238,7 +238,7 @@ export interface IRow extends RowType {
|
|
|
238
238
|
cells?: (React.ReactNode | IRowCell)[];
|
|
239
239
|
isOpen?: boolean;
|
|
240
240
|
isEditable?: boolean;
|
|
241
|
-
|
|
241
|
+
isClickable?: boolean;
|
|
242
242
|
isRowSelected?: boolean;
|
|
243
243
|
isValid?: boolean;
|
|
244
244
|
/** An array of validation functions to run against every cell for a given row */
|
|
@@ -20,8 +20,8 @@ export interface TrProps extends React.HTMLProps<HTMLTableRowElement>, OUIAProps
|
|
|
20
20
|
isExpanded?: boolean;
|
|
21
21
|
/** Only applicable to Tr within the Tbody: Whether the row is editable */
|
|
22
22
|
isEditable?: boolean;
|
|
23
|
-
/** Flag which adds hover styles for the table row */
|
|
24
|
-
|
|
23
|
+
/** Flag which adds hover styles for the clickable table row */
|
|
24
|
+
isClickable?: boolean;
|
|
25
25
|
/** Flag indicating the row is selected - adds selected styling */
|
|
26
26
|
isRowSelected?: boolean;
|
|
27
27
|
/** Flag indicating the row is striped */
|
|
@@ -46,7 +46,7 @@ const TrBase: React.FunctionComponent<TrProps> = ({
|
|
|
46
46
|
isExpanded,
|
|
47
47
|
isEditable,
|
|
48
48
|
isHidden = false,
|
|
49
|
-
|
|
49
|
+
isClickable = false,
|
|
50
50
|
isRowSelected = false,
|
|
51
51
|
isStriped = false,
|
|
52
52
|
isBorderRow = false,
|
|
@@ -89,21 +89,21 @@ const TrBase: React.FunctionComponent<TrProps> = ({
|
|
|
89
89
|
|
|
90
90
|
return (
|
|
91
91
|
<>
|
|
92
|
-
{isSelectable && <output className="pf-screen-reader">{ariaLabel}</output>}
|
|
92
|
+
{isSelectable && <output className="pf-v5-screen-reader">{ariaLabel}</output>}
|
|
93
93
|
<tr
|
|
94
94
|
className={css(
|
|
95
95
|
className,
|
|
96
96
|
isExpanded !== undefined && styles.tableExpandableRow,
|
|
97
97
|
isExpanded && styles.modifiers.expanded,
|
|
98
98
|
isEditable && inlineStyles.modifiers.inlineEditable,
|
|
99
|
-
|
|
99
|
+
isClickable && styles.modifiers.clickable,
|
|
100
100
|
isRowSelected && styles.modifiers.selected,
|
|
101
101
|
isStriped && styles.modifiers.striped,
|
|
102
102
|
isBorderRow && styles.modifiers.borderRow,
|
|
103
103
|
resetOffset && styles.modifiers.firstCellOffsetReset
|
|
104
104
|
)}
|
|
105
105
|
hidden={rowIsHidden}
|
|
106
|
-
{...(
|
|
106
|
+
{...(isClickable && { tabIndex: 0 })}
|
|
107
107
|
aria-label={ariaLabel}
|
|
108
108
|
ref={innerRef}
|
|
109
109
|
{...(onRowClick && { onClick: onRowClick, onKeyDown })}
|
|
@@ -147,11 +147,11 @@ Similarly to the selectable example above, the radio buttons use the first colum
|
|
|
147
147
|
```ts file="TableSelectableRadio.tsx"
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
-
### Row click handler,
|
|
150
|
+
### Row click handler, clickable rows
|
|
151
151
|
|
|
152
152
|
This selectable rows feature is intended for use when a table is used to present a list of objects in a Primary-detail view.
|
|
153
153
|
|
|
154
|
-
```ts file="
|
|
154
|
+
```ts file="TableClickable.tsx"
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
### Actions
|
|
@@ -9,7 +9,7 @@ interface Repository {
|
|
|
9
9
|
lastCommit: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export const
|
|
12
|
+
export const TableClickable: React.FunctionComponent = () => {
|
|
13
13
|
// In real usage, this data would come from some external source like an API via props.
|
|
14
14
|
const repositories: Repository[] = [
|
|
15
15
|
{ name: 'one', branches: 'two', prs: 'three', workspaces: 'four', lastCommit: 'five' },
|
|
@@ -30,7 +30,7 @@ export const TableHoverable: React.FunctionComponent = () => {
|
|
|
30
30
|
const [selectedRepoName, setSelectedRepoName] = React.useState('');
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
|
-
<Table aria-label="
|
|
33
|
+
<Table aria-label="Clickable table">
|
|
34
34
|
<Thead>
|
|
35
35
|
<Tr>
|
|
36
36
|
<Th>{columnNames.name}</Th>
|
|
@@ -46,7 +46,7 @@ export const TableHoverable: React.FunctionComponent = () => {
|
|
|
46
46
|
key={repo.name}
|
|
47
47
|
onRowClick={() => setSelectedRepoName(repo.name)}
|
|
48
48
|
isSelectable
|
|
49
|
-
|
|
49
|
+
isClickable
|
|
50
50
|
isRowSelected={selectedRepoName === repo.name}
|
|
51
51
|
>
|
|
52
52
|
<Td dataLabel={columnNames.name}>{repo.name}</Td>
|
|
@@ -11,7 +11,7 @@ interface Repository {
|
|
|
11
11
|
lastCommit: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export const
|
|
14
|
+
export const LegacyTableClickable: React.FunctionComponent = () => {
|
|
15
15
|
// In real usage, this data would come from some external source like an API via props.
|
|
16
16
|
const repositories: Repository[] = [
|
|
17
17
|
{
|
|
@@ -98,7 +98,7 @@ export const LegacyTableHoverable: React.FunctionComponent = () => {
|
|
|
98
98
|
}
|
|
99
99
|
return {
|
|
100
100
|
cells,
|
|
101
|
-
|
|
101
|
+
isClickable: true,
|
|
102
102
|
isRowSelected: selectedRepoName === repo.name
|
|
103
103
|
};
|
|
104
104
|
});
|
|
@@ -205,11 +205,11 @@ To disable selection for a row, set `disableSelection: true` on the row definiti
|
|
|
205
205
|
```ts file="LegacyTableSelectableRadio.tsx"
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
-
###
|
|
208
|
+
### Clickable rows, selectable rows, and header cell tooltips/popovers
|
|
209
209
|
|
|
210
210
|
This selectable rows feature is intended for use when a table is used to present a list of objects in a Primary-detail view.
|
|
211
211
|
|
|
212
|
-
```ts file="
|
|
212
|
+
```ts file="LegacyTableClickable.tsx"
|
|
213
213
|
```
|
|
214
214
|
|
|
215
215
|
### Actions and first cell in body rows as th
|