@patternfly/react-table 4.67.12 → 4.67.15
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
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 4.67.15 (2022-03-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-table
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 4.67.14 (2022-03-04)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **NotificationDrawer:** Drawer receives focus after opening ([#6963](https://github.com/patternfly/patternfly-react/issues/6963)) ([f5b1c97](https://github.com/patternfly/patternfly-react/commit/f5b1c97f1c3ef6155d39d16da401fb9937b539e9))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## 4.67.13 (2022-03-04)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **Toolbar:** update test ([#6995](https://github.com/patternfly/patternfly-react/issues/6995)) ([4ddaeaa](https://github.com/patternfly/patternfly-react/commit/4ddaeaad5cd550b1bd88195a7a0eb9643cdb70f4))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
## 4.67.12 (2022-03-02)
|
|
7
37
|
|
|
8
38
|
**Note:** Version bump only for package @patternfly/react-table
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "4.67.
|
|
3
|
+
"version": "4.67.15",
|
|
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",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"clean": "rimraf dist"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@patternfly/react-core": "^4.198.
|
|
35
|
-
"@patternfly/react-icons": "^4.49.
|
|
36
|
-
"@patternfly/react-styles": "^4.48.
|
|
37
|
-
"@patternfly/react-tokens": "^4.50.
|
|
34
|
+
"@patternfly/react-core": "^4.198.15",
|
|
35
|
+
"@patternfly/react-icons": "^4.49.15",
|
|
36
|
+
"@patternfly/react-styles": "^4.48.15",
|
|
37
|
+
"@patternfly/react-tokens": "^4.50.15",
|
|
38
38
|
"lodash": "^4.17.19",
|
|
39
39
|
"tslib": "^2.0.0"
|
|
40
40
|
},
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"react": "^16.8.0 || ^17.0.0",
|
|
47
47
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "16259ba437f75ad2818da8ff55a1994340971e26"
|
|
50
50
|
}
|
|
@@ -167,6 +167,13 @@ To make a cell an action cell, render an `ActionsColumn` component inside a row'
|
|
|
167
167
|
```ts file="ComposableTableActions.tsx"
|
|
168
168
|
```
|
|
169
169
|
|
|
170
|
+
### Composable: Actions Overflow
|
|
171
|
+
|
|
172
|
+
Useing an `OverflowMenu` in the actions column, allowing the actions to condense into a dropdown if necessary for space.
|
|
173
|
+
|
|
174
|
+
```ts file="ComposableTableActionsOverflow.tsx"
|
|
175
|
+
```
|
|
176
|
+
|
|
170
177
|
### Composable: Expandable
|
|
171
178
|
|
|
172
179
|
To make a parent/child row pair expandable:
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
OverflowMenu,
|
|
6
|
+
OverflowMenuControl,
|
|
7
|
+
OverflowMenuContent,
|
|
8
|
+
OverflowMenuGroup,
|
|
9
|
+
OverflowMenuItem,
|
|
10
|
+
OverflowMenuDropdownItem,
|
|
11
|
+
Dropdown,
|
|
12
|
+
KebabToggle
|
|
13
|
+
} from '@patternfly/react-core';
|
|
14
|
+
import { TableComposable, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
15
|
+
|
|
16
|
+
interface Repository {
|
|
17
|
+
name: string;
|
|
18
|
+
branches: string;
|
|
19
|
+
prs: string;
|
|
20
|
+
workspaces: string;
|
|
21
|
+
lastCommit: string;
|
|
22
|
+
isMenuOpen: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const ComposableTableActions: React.FunctionComponent = () => {
|
|
26
|
+
// In real usage, this data would come from some external source like an API via props.
|
|
27
|
+
const repositories: Repository[] = [
|
|
28
|
+
{ name: 'one', branches: 'two', prs: 'a', workspaces: 'four', lastCommit: 'five', isMenuOpen: false },
|
|
29
|
+
{ name: 'a', branches: 'two', prs: 'k', workspaces: 'four', lastCommit: 'five', isMenuOpen: false },
|
|
30
|
+
{ name: 'p', branches: 'two', prs: 'b', workspaces: 'four', lastCommit: 'five', isMenuOpen: false },
|
|
31
|
+
{ name: '4', branches: '2', prs: 'b', workspaces: 'four', lastCommit: 'five', isMenuOpen: false },
|
|
32
|
+
{ name: '5', branches: '2', prs: 'b', workspaces: 'four', lastCommit: 'five', isMenuOpen: false }
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const [repos, setRepos] = React.useState(repositories);
|
|
36
|
+
|
|
37
|
+
const columnNames = {
|
|
38
|
+
name: 'Repositories',
|
|
39
|
+
branches: 'Branches',
|
|
40
|
+
prs: 'Pull requests',
|
|
41
|
+
workspaces: 'Workspaces',
|
|
42
|
+
lastCommit: 'Last commit'
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const dropdownItems = [
|
|
46
|
+
<OverflowMenuDropdownItem key="item1" isShared>
|
|
47
|
+
Pimary
|
|
48
|
+
</OverflowMenuDropdownItem>,
|
|
49
|
+
<OverflowMenuDropdownItem key="item2" isShared>
|
|
50
|
+
Secondary
|
|
51
|
+
</OverflowMenuDropdownItem>,
|
|
52
|
+
<OverflowMenuDropdownItem key="item3" isShared>
|
|
53
|
+
Tertiary
|
|
54
|
+
</OverflowMenuDropdownItem>
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<React.Fragment>
|
|
59
|
+
<TableComposable aria-label="Actions table">
|
|
60
|
+
<Thead>
|
|
61
|
+
<Tr>
|
|
62
|
+
<Th>{columnNames.name}</Th>
|
|
63
|
+
<Th>{columnNames.branches}</Th>
|
|
64
|
+
<Th>{columnNames.prs}</Th>
|
|
65
|
+
<Th>{columnNames.workspaces}</Th>
|
|
66
|
+
<Th>{columnNames.lastCommit}</Th>
|
|
67
|
+
<Td></Td>
|
|
68
|
+
</Tr>
|
|
69
|
+
</Thead>
|
|
70
|
+
<Tbody>
|
|
71
|
+
{repos.map(repo => (
|
|
72
|
+
<Tr key={repo.name}>
|
|
73
|
+
<Td dataLabel={columnNames.name}>{repo.name}</Td>
|
|
74
|
+
<Td dataLabel={columnNames.branches}>{repo.branches}</Td>
|
|
75
|
+
<Td dataLabel={columnNames.prs}>{repo.prs}</Td>
|
|
76
|
+
<Td dataLabel={columnNames.workspaces}>{repo.workspaces}</Td>
|
|
77
|
+
<Td dataLabel={columnNames.lastCommit}>{repo.lastCommit}</Td>
|
|
78
|
+
<Td isActionCell>
|
|
79
|
+
<OverflowMenu breakpoint="lg">
|
|
80
|
+
<OverflowMenuContent>
|
|
81
|
+
<OverflowMenuGroup groupType="button">
|
|
82
|
+
<OverflowMenuItem>
|
|
83
|
+
<Button variant="primary">Primary</Button>
|
|
84
|
+
</OverflowMenuItem>
|
|
85
|
+
<OverflowMenuItem>
|
|
86
|
+
<Button variant="secondary">Secondary</Button>
|
|
87
|
+
</OverflowMenuItem>
|
|
88
|
+
<OverflowMenuItem>
|
|
89
|
+
<Button variant="tertiary">Tertiary</Button>
|
|
90
|
+
</OverflowMenuItem>
|
|
91
|
+
</OverflowMenuGroup>
|
|
92
|
+
</OverflowMenuContent>
|
|
93
|
+
<OverflowMenuControl>
|
|
94
|
+
<Dropdown
|
|
95
|
+
position="right"
|
|
96
|
+
onSelect={() =>
|
|
97
|
+
setRepos(repos.map(r => (r.name !== repo.name ? r : { ...r, isMenuOpen: !r.isMenuOpen })))
|
|
98
|
+
}
|
|
99
|
+
toggle={
|
|
100
|
+
<KebabToggle
|
|
101
|
+
onToggle={open =>
|
|
102
|
+
setRepos(repos.map(r => (r.name !== repo.name ? r : { ...r, isMenuOpen: open })))
|
|
103
|
+
}
|
|
104
|
+
/>
|
|
105
|
+
}
|
|
106
|
+
isOpen={repo.isMenuOpen}
|
|
107
|
+
isPlain
|
|
108
|
+
dropdownItems={dropdownItems}
|
|
109
|
+
/>
|
|
110
|
+
</OverflowMenuControl>
|
|
111
|
+
</OverflowMenu>
|
|
112
|
+
</Td>
|
|
113
|
+
</Tr>
|
|
114
|
+
))}
|
|
115
|
+
</Tbody>
|
|
116
|
+
</TableComposable>
|
|
117
|
+
</React.Fragment>
|
|
118
|
+
);
|
|
119
|
+
};
|
package/src/demos/Table.md
CHANGED
|
@@ -13,6 +13,7 @@ import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
|
13
13
|
import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
|
|
14
14
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
15
15
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
16
|
+
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
16
17
|
import globalDangerColor200 from '@patternfly/react-tokens/dist/esm/global_danger_color_200';
|
|
17
18
|
import imgBrand from '@patternfly/react-core/src/components/Brand/examples/pfLogo.svg';
|
|
18
19
|
import imgAvatar from '@patternfly/react-core/src/components/Avatar/examples/avatarImg.svg';
|
|
@@ -2097,6 +2098,7 @@ import SortAmountDownIcon from '@patternfly/react-icons/dist/esm/icons/sort-amou
|
|
|
2097
2098
|
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
2098
2099
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
2099
2100
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
2101
|
+
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
2100
2102
|
import AttentionBellIcon from '@patternfly/react-icons/dist/esm/icons/attention-bell-icon';
|
|
2101
2103
|
|
|
2102
2104
|
ComposableTableSortable = () => {
|
|
@@ -2220,7 +2222,7 @@ ComposableTableSortable = () => {
|
|
|
2220
2222
|
</ToolbarItem>
|
|
2221
2223
|
<ToolbarItem>
|
|
2222
2224
|
<Button aria-label="Help actions" variant={ButtonVariant.plain}>
|
|
2223
|
-
<
|
|
2225
|
+
<QuestionCircleIcon />
|
|
2224
2226
|
</Button>
|
|
2225
2227
|
</ToolbarItem>
|
|
2226
2228
|
</ToolbarGroup>
|
|
@@ -2740,6 +2742,7 @@ import {
|
|
|
2740
2742
|
} from '@patternfly/react-core';
|
|
2741
2743
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
2742
2744
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
2745
|
+
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
2743
2746
|
import imgBrand from '@patternfly/react-core/src/components/Brand/examples/pfLogo.svg';
|
|
2744
2747
|
import imgAvatar from '@patternfly/react-core/src/components/Avatar/examples/avatarImg.svg';
|
|
2745
2748
|
import { Table, TableHeader, TableBody } from '@patternfly/react-table';
|
|
@@ -2852,7 +2855,7 @@ class PageLayoutDefaultNav extends React.Component {
|
|
|
2852
2855
|
</PageHeaderToolsItem>
|
|
2853
2856
|
<PageHeaderToolsItem>
|
|
2854
2857
|
<Button aria-label="Help actions" variant={ButtonVariant.plain}>
|
|
2855
|
-
<
|
|
2858
|
+
<QuestionCircleIcon />
|
|
2856
2859
|
</Button>
|
|
2857
2860
|
</PageHeaderToolsItem>
|
|
2858
2861
|
</PageHeaderToolsGroup>
|