@patternfly/react-core 4.202.34 → 4.202.37
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 +24 -0
- package/dist/esm/components/Brand/Brand.d.ts +23 -3
- package/dist/esm/components/Brand/Brand.d.ts.map +1 -1
- package/dist/esm/components/Brand/Brand.js +12 -2
- package/dist/esm/components/Brand/Brand.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.d.ts +2 -0
- package/dist/esm/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +3 -2
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/js/components/Brand/Brand.d.ts +23 -3
- package/dist/js/components/Brand/Brand.d.ts.map +1 -1
- package/dist/js/components/Brand/Brand.js +12 -2
- package/dist/js/components/Brand/Brand.js.map +1 -1
- package/dist/js/components/Tabs/Tabs.d.ts +2 -0
- package/dist/js/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tabs.js +3 -2
- package/dist/js/components/Tabs/Tabs.js.map +1 -1
- package/dist/umd/react-core.css +115 -35
- package/dist/umd/react-core.js +145 -123
- package/dist/umd/react-core.min.css +80 -0
- package/dist/umd/react-core.min.js +4 -4
- package/package.json +6 -6
- package/src/components/Brand/Brand.tsx +61 -8
- package/src/components/Brand/__tests__/Brand.test.tsx +15 -4
- package/src/components/Brand/__tests__/__snapshots__/Brand.test.tsx.snap +1 -1
- package/src/components/Brand/examples/Brand.md +13 -0
- package/src/components/Brand/examples/BrandResponsive.tsx +18 -0
- package/src/components/Brand/examples/pf-c-brand--logo-base.jpg +0 -0
- package/src/components/Brand/examples/pf-c-brand--logo-on-lg.svg +32 -0
- package/src/components/Brand/examples/pf-c-brand--logo-on-md.svg +42 -0
- package/src/components/Brand/examples/pf-c-brand--logo-on-sm.svg +17 -0
- package/src/components/Brand/examples/pf-c-brand--logo-on-xl.svg +39 -0
- package/src/components/Brand/examples/pf-c-brand--logo.svg +10 -0
- package/src/components/Tabs/Tabs.tsx +5 -0
- package/src/components/Tabs/__tests__/Tabs.test.tsx +17 -0
- package/src/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +153 -0
- package/src/components/TextInputGroup/__tests__/TextInputGroup.test.tsx +47 -146
- package/src/components/TextInputGroup/__tests__/TextInputGroupMain.test.tsx +302 -0
- package/src/components/TextInputGroup/__tests__/TextInputGroupUtilities.test.tsx +34 -0
- package/src/components/TextInputGroup/__tests__/__snapshots__/TextInputGroup.test.tsx.snap +2 -203
- package/src/components/TextInputGroup/__tests__/__snapshots__/TextInputGroupMain.test.tsx.snap +21 -0
- package/src/components/TextInputGroup/__tests__/__snapshots__/TextInputGroupUtilities.test.tsx.snap +13 -0
- package/src/demos/Tabs.md +5 -0
- package/src/demos/examples/Tabs/TabsAndTablesAutoWidthTabs.tsx +442 -0
|
@@ -1,212 +1,11 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`TextInputGroup
|
|
4
|
-
<DocumentFragment>
|
|
5
|
-
<div
|
|
6
|
-
class="pf-c-text-input-group custom-class"
|
|
7
|
-
id="test-id"
|
|
8
|
-
>
|
|
9
|
-
<div
|
|
10
|
-
class="pf-c-text-input-group__main"
|
|
11
|
-
>
|
|
12
|
-
Foo
|
|
13
|
-
<span
|
|
14
|
-
class="pf-c-text-input-group__text"
|
|
15
|
-
>
|
|
16
|
-
<input
|
|
17
|
-
aria-label="Type to filter"
|
|
18
|
-
class="pf-c-text-input-group__text-input"
|
|
19
|
-
type="text"
|
|
20
|
-
value=""
|
|
21
|
-
/>
|
|
22
|
-
</span>
|
|
23
|
-
</div>
|
|
24
|
-
<div
|
|
25
|
-
class="pf-c-text-input-group__utilities"
|
|
26
|
-
/>
|
|
27
|
-
</div>
|
|
28
|
-
</DocumentFragment>
|
|
29
|
-
`;
|
|
30
|
-
|
|
31
|
-
exports[`TextInputGroup renders content 1`] = `
|
|
3
|
+
exports[`TextInputGroup matches the snapshot 1`] = `
|
|
32
4
|
<DocumentFragment>
|
|
33
5
|
<div
|
|
34
6
|
class="pf-c-text-input-group"
|
|
35
7
|
>
|
|
36
|
-
|
|
37
|
-
class="pf-c-text-input-group__main"
|
|
38
|
-
>
|
|
39
|
-
Foo
|
|
40
|
-
<span
|
|
41
|
-
class="pf-c-text-input-group__text"
|
|
42
|
-
>
|
|
43
|
-
<input
|
|
44
|
-
aria-label="Type to filter"
|
|
45
|
-
class="pf-c-text-input-group__text-input"
|
|
46
|
-
type="text"
|
|
47
|
-
value=""
|
|
48
|
-
/>
|
|
49
|
-
</span>
|
|
50
|
-
</div>
|
|
51
|
-
<div
|
|
52
|
-
class="pf-c-text-input-group__utilities"
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
</DocumentFragment>
|
|
56
|
-
`;
|
|
57
|
-
|
|
58
|
-
exports[`TextInputGroup renders with the proper stying when disabled 1`] = `
|
|
59
|
-
<DocumentFragment>
|
|
60
|
-
<div
|
|
61
|
-
class="pf-c-text-input-group pf-m-disabled"
|
|
62
|
-
>
|
|
63
|
-
<div
|
|
64
|
-
class="pf-c-text-input-group__main"
|
|
65
|
-
>
|
|
66
|
-
Foo
|
|
67
|
-
<span
|
|
68
|
-
class="pf-c-text-input-group__text"
|
|
69
|
-
>
|
|
70
|
-
<input
|
|
71
|
-
aria-label="Type to filter"
|
|
72
|
-
class="pf-c-text-input-group__text-input"
|
|
73
|
-
disabled=""
|
|
74
|
-
type="text"
|
|
75
|
-
value=""
|
|
76
|
-
/>
|
|
77
|
-
</span>
|
|
78
|
-
</div>
|
|
79
|
-
<div
|
|
80
|
-
class="pf-c-text-input-group__utilities"
|
|
81
|
-
/>
|
|
82
|
-
</div>
|
|
83
|
-
</DocumentFragment>
|
|
84
|
-
`;
|
|
85
|
-
|
|
86
|
-
exports[`TextInputGroupMain input is disabled when TextInputGroupContext isDisabled is true 1`] = `
|
|
87
|
-
<DocumentFragment>
|
|
88
|
-
<div
|
|
89
|
-
class="pf-c-text-input-group__main"
|
|
90
|
-
>
|
|
91
|
-
<span
|
|
92
|
-
class="pf-c-text-input-group__text"
|
|
93
|
-
>
|
|
94
|
-
<input
|
|
95
|
-
aria-label="Type to filter"
|
|
96
|
-
class="pf-c-text-input-group__text-input"
|
|
97
|
-
disabled=""
|
|
98
|
-
type="text"
|
|
99
|
-
value=""
|
|
100
|
-
/>
|
|
101
|
-
</span>
|
|
102
|
-
</div>
|
|
103
|
-
</DocumentFragment>
|
|
104
|
-
`;
|
|
105
|
-
|
|
106
|
-
exports[`TextInputGroupMain input is not disabled when TextInputGroupContext isDisabled is false 1`] = `
|
|
107
|
-
<DocumentFragment>
|
|
108
|
-
<div
|
|
109
|
-
class="pf-c-text-input-group__main"
|
|
110
|
-
>
|
|
111
|
-
<span
|
|
112
|
-
class="pf-c-text-input-group__text"
|
|
113
|
-
>
|
|
114
|
-
<input
|
|
115
|
-
aria-label="Type to filter"
|
|
116
|
-
class="pf-c-text-input-group__text-input"
|
|
117
|
-
type="text"
|
|
118
|
-
value=""
|
|
119
|
-
/>
|
|
120
|
-
</span>
|
|
121
|
-
</div>
|
|
122
|
-
</DocumentFragment>
|
|
123
|
-
`;
|
|
124
|
-
|
|
125
|
-
exports[`TextInputGroupMain renders content 1`] = `
|
|
126
|
-
<DocumentFragment>
|
|
127
|
-
<div
|
|
128
|
-
class="pf-c-text-input-group__main"
|
|
129
|
-
>
|
|
130
|
-
Foo
|
|
131
|
-
<span
|
|
132
|
-
class="pf-c-text-input-group__text"
|
|
133
|
-
>
|
|
134
|
-
<input
|
|
135
|
-
aria-label="Type to filter"
|
|
136
|
-
class="pf-c-text-input-group__text-input"
|
|
137
|
-
type="text"
|
|
138
|
-
value=""
|
|
139
|
-
/>
|
|
140
|
-
</span>
|
|
141
|
-
</div>
|
|
142
|
-
</DocumentFragment>
|
|
143
|
-
`;
|
|
144
|
-
|
|
145
|
-
exports[`TextInputGroupMain renders given input icon props 1`] = `
|
|
146
|
-
<DocumentFragment>
|
|
147
|
-
<div
|
|
148
|
-
class="pf-c-text-input-group__main pf-m-icon"
|
|
149
|
-
>
|
|
150
|
-
Foo
|
|
151
|
-
<span
|
|
152
|
-
class="pf-c-text-input-group__text"
|
|
153
|
-
>
|
|
154
|
-
<span
|
|
155
|
-
class="pf-c-text-input-group__icon"
|
|
156
|
-
>
|
|
157
|
-
<svg
|
|
158
|
-
aria-hidden="true"
|
|
159
|
-
fill="currentColor"
|
|
160
|
-
height="1em"
|
|
161
|
-
role="img"
|
|
162
|
-
style="vertical-align: -0.125em;"
|
|
163
|
-
viewBox="0 0 512 512"
|
|
164
|
-
width="1em"
|
|
165
|
-
>
|
|
166
|
-
<path
|
|
167
|
-
d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"
|
|
168
|
-
/>
|
|
169
|
-
</svg>
|
|
170
|
-
</span>
|
|
171
|
-
<input
|
|
172
|
-
aria-label="Type to filter"
|
|
173
|
-
class="pf-c-text-input-group__text-input"
|
|
174
|
-
type="text"
|
|
175
|
-
value=""
|
|
176
|
-
/>
|
|
177
|
-
</span>
|
|
178
|
-
</div>
|
|
179
|
-
</DocumentFragment>
|
|
180
|
-
`;
|
|
181
|
-
|
|
182
|
-
exports[`TextInputGroupMain renders the input with custom aria label when given 1`] = `
|
|
183
|
-
<DocumentFragment>
|
|
184
|
-
<div
|
|
185
|
-
class="pf-c-text-input-group__main"
|
|
186
|
-
>
|
|
187
|
-
Foo
|
|
188
|
-
<span
|
|
189
|
-
class="pf-c-text-input-group__text"
|
|
190
|
-
>
|
|
191
|
-
<input
|
|
192
|
-
aria-label="Foo"
|
|
193
|
-
class="pf-c-text-input-group__text-input"
|
|
194
|
-
type="text"
|
|
195
|
-
value=""
|
|
196
|
-
/>
|
|
197
|
-
</span>
|
|
198
|
-
</div>
|
|
199
|
-
</DocumentFragment>
|
|
200
|
-
`;
|
|
201
|
-
|
|
202
|
-
exports[`TextInputGroupUtilities renders the content 1`] = `
|
|
203
|
-
<DocumentFragment>
|
|
204
|
-
<div
|
|
205
|
-
class="pf-c-text-input-group__utilities"
|
|
206
|
-
>
|
|
207
|
-
<button>
|
|
208
|
-
Foo
|
|
209
|
-
</button>
|
|
8
|
+
Test
|
|
210
9
|
</div>
|
|
211
10
|
</DocumentFragment>
|
|
212
11
|
`;
|
package/src/components/TextInputGroup/__tests__/__snapshots__/TextInputGroupMain.test.tsx.snap
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`TextInputGroupMain matches the snapshot 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="pf-c-text-input-group__main"
|
|
7
|
+
>
|
|
8
|
+
Test
|
|
9
|
+
<span
|
|
10
|
+
class="pf-c-text-input-group__text"
|
|
11
|
+
>
|
|
12
|
+
<input
|
|
13
|
+
aria-label="Type to filter"
|
|
14
|
+
class="pf-c-text-input-group__text-input"
|
|
15
|
+
type="text"
|
|
16
|
+
value=""
|
|
17
|
+
/>
|
|
18
|
+
</span>
|
|
19
|
+
</div>
|
|
20
|
+
</DocumentFragment>
|
|
21
|
+
`;
|
package/src/demos/Tabs.md
CHANGED
|
@@ -453,6 +453,11 @@ TabsOpenWithSecondaryTabsDemo = () => {
|
|
|
453
453
|
```js isFullscreen file="./examples/Tabs/TabsAndTable.tsx"
|
|
454
454
|
```
|
|
455
455
|
|
|
456
|
+
### Tables and tabs, auto width tabs
|
|
457
|
+
|
|
458
|
+
```js isFullscreen file="./examples/Tabs/TabsAndTablesAutoWidthTabs.tsx"
|
|
459
|
+
```
|
|
460
|
+
|
|
456
461
|
### Modal tabs
|
|
457
462
|
|
|
458
463
|
```js isFullscreen file="./examples/Tabs/ModalTabs.tsx"
|
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
Divider,
|
|
6
|
+
Drawer,
|
|
7
|
+
DrawerContent,
|
|
8
|
+
DrawerContentBody,
|
|
9
|
+
DrawerPanelContent,
|
|
10
|
+
DrawerHead,
|
|
11
|
+
DrawerActions,
|
|
12
|
+
DrawerCloseButton,
|
|
13
|
+
DrawerPanelBody,
|
|
14
|
+
Dropdown,
|
|
15
|
+
Flex,
|
|
16
|
+
FlexItem,
|
|
17
|
+
KebabToggle,
|
|
18
|
+
Label,
|
|
19
|
+
LabelGroup,
|
|
20
|
+
OptionsMenu,
|
|
21
|
+
OptionsMenuToggle,
|
|
22
|
+
OverflowMenu,
|
|
23
|
+
OverflowMenuContent,
|
|
24
|
+
OverflowMenuControl,
|
|
25
|
+
OverflowMenuGroup,
|
|
26
|
+
OverflowMenuItem,
|
|
27
|
+
PageSection,
|
|
28
|
+
PageSectionVariants,
|
|
29
|
+
Pagination,
|
|
30
|
+
PaginationVariant,
|
|
31
|
+
Progress,
|
|
32
|
+
ProgressSize,
|
|
33
|
+
Select,
|
|
34
|
+
SelectVariant,
|
|
35
|
+
Tabs,
|
|
36
|
+
Tab,
|
|
37
|
+
TabContent,
|
|
38
|
+
TabContentBody,
|
|
39
|
+
TabTitleText,
|
|
40
|
+
Title,
|
|
41
|
+
Toolbar,
|
|
42
|
+
ToolbarItem,
|
|
43
|
+
ToolbarContent,
|
|
44
|
+
ToolbarToggleGroup
|
|
45
|
+
} from '@patternfly/react-core';
|
|
46
|
+
import {
|
|
47
|
+
TableComposable,
|
|
48
|
+
Thead,
|
|
49
|
+
Tbody,
|
|
50
|
+
Tr,
|
|
51
|
+
Th,
|
|
52
|
+
Td,
|
|
53
|
+
IAction,
|
|
54
|
+
ActionsColumn,
|
|
55
|
+
CustomActionsToggleProps
|
|
56
|
+
} from '@patternfly/react-table';
|
|
57
|
+
import DashboardWrapper from '../DashboardWrapper';
|
|
58
|
+
import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
59
|
+
import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
|
|
60
|
+
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
61
|
+
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
62
|
+
import SortAmountDownIcon from '@patternfly/react-icons/dist/esm/icons/sort-amount-down-icon';
|
|
63
|
+
|
|
64
|
+
interface Repository {
|
|
65
|
+
name: string;
|
|
66
|
+
branches: number | null;
|
|
67
|
+
prs: number | null;
|
|
68
|
+
workspaces: number;
|
|
69
|
+
lastCommit: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const TablesAndTabs = () => {
|
|
73
|
+
// tab properties
|
|
74
|
+
const [activeTabKey, setActiveTabKey] = React.useState<number>(0);
|
|
75
|
+
// Toggle currently active tab
|
|
76
|
+
const handleTabClick = (tabIndex: number) => {
|
|
77
|
+
setActiveTabKey(tabIndex);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// secondary tab properties
|
|
81
|
+
const [secondaryActiveTabKey, setSecondaryActiveTabKey] = React.useState<number>(10);
|
|
82
|
+
const handleSecondaryTabClick = (tabIndex: number) => {
|
|
83
|
+
setSecondaryActiveTabKey(tabIndex);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// drawer properties
|
|
87
|
+
const [isExpanded, setIsExpanded] = React.useState<boolean>(false);
|
|
88
|
+
|
|
89
|
+
// table properties
|
|
90
|
+
// In real usage, this data would come from some external source like an API via props.
|
|
91
|
+
const repositories: Repository[] = [
|
|
92
|
+
{ name: 'Node 1', branches: 10, prs: 25, workspaces: 5, lastCommit: '2 days ago' },
|
|
93
|
+
{ name: 'Node 2', branches: 8, prs: 30, workspaces: 2, lastCommit: '2 days ago' },
|
|
94
|
+
{ name: 'Node 3', branches: 12, prs: 48, workspaces: 13, lastCommit: '30 days ago' },
|
|
95
|
+
{ name: 'Node 4', branches: 3, prs: 8, workspaces: 20, lastCommit: '8 days ago' },
|
|
96
|
+
{ name: 'Node 5', branches: 33, prs: 21, workspaces: 2, lastCommit: '26 days ago' }
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
const columnNames = {
|
|
100
|
+
name: 'Repositories',
|
|
101
|
+
branches: 'Branches',
|
|
102
|
+
prs: 'Pull requests',
|
|
103
|
+
workspaces: 'Workspaces',
|
|
104
|
+
lastCommit: 'Last commit'
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const [selectedRepoNames, setSelectedRepoNames] = React.useState<string[]>([]);
|
|
108
|
+
const setRepoSelected = (event: React.FormEvent<HTMLInputElement>, repo: Repository, isSelecting = true) => {
|
|
109
|
+
setSelectedRepoNames(prevSelected => {
|
|
110
|
+
const otherSelectedRepoNames = prevSelected.filter(r => r !== repo.name);
|
|
111
|
+
return isSelecting ? [...otherSelectedRepoNames, repo.name] : otherSelectedRepoNames;
|
|
112
|
+
});
|
|
113
|
+
event.stopPropagation();
|
|
114
|
+
};
|
|
115
|
+
const onSelectAll = (isSelecting = true) => setSelectedRepoNames(isSelecting ? repositories.map(r => r.name) : []);
|
|
116
|
+
const allRowsSelected = selectedRepoNames.length === repositories.length;
|
|
117
|
+
const isRepoSelected = (repo: Repository) => selectedRepoNames.includes(repo.name);
|
|
118
|
+
|
|
119
|
+
const [rowClicked, setRowClicked] = React.useState<string>(null);
|
|
120
|
+
const isRowClicked = (repo: Repository) => rowClicked === repo.name;
|
|
121
|
+
|
|
122
|
+
const defaultActions: IAction[] = [
|
|
123
|
+
{
|
|
124
|
+
title: 'Some action',
|
|
125
|
+
onClick: event => {
|
|
126
|
+
event.stopPropagation();
|
|
127
|
+
console.log('clicked on Some action');
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
title: <a href="https://www.patternfly.org">Link action</a>,
|
|
132
|
+
onClick: event => {
|
|
133
|
+
event.stopPropagation();
|
|
134
|
+
console.log('clicked on Link action');
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
isSeparator: true
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
title: 'Third action',
|
|
142
|
+
onClick: event => {
|
|
143
|
+
event.stopPropagation();
|
|
144
|
+
console.log('clicked on Third action');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
];
|
|
148
|
+
|
|
149
|
+
const customActionsToggle = (props: CustomActionsToggleProps) => (
|
|
150
|
+
<KebabToggle
|
|
151
|
+
isDisabled={props.isDisabled}
|
|
152
|
+
onToggle={(value, event) => {
|
|
153
|
+
props.onToggle(value);
|
|
154
|
+
event.stopPropagation();
|
|
155
|
+
}}
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
const toolbar = (
|
|
160
|
+
<Toolbar id="page-layout-table-column-management-action-toolbar-top" usePageInsets>
|
|
161
|
+
<ToolbarContent>
|
|
162
|
+
<ToolbarToggleGroup toggleIcon={<FilterIcon />} breakpoint="xl">
|
|
163
|
+
<ToolbarItem>
|
|
164
|
+
<Select
|
|
165
|
+
onToggle={() => {}}
|
|
166
|
+
variant={SelectVariant.single}
|
|
167
|
+
aria-label="Select Input"
|
|
168
|
+
placeholderText="Name"
|
|
169
|
+
/>
|
|
170
|
+
</ToolbarItem>
|
|
171
|
+
</ToolbarToggleGroup>
|
|
172
|
+
<ToolbarItem>
|
|
173
|
+
<OptionsMenu
|
|
174
|
+
id="page-layout-table-column-management-action-toolbar-top-options-menu-toggle"
|
|
175
|
+
isPlain
|
|
176
|
+
menuItems={[]}
|
|
177
|
+
toggle={
|
|
178
|
+
<OptionsMenuToggle
|
|
179
|
+
toggleTemplate={<SortAmountDownIcon aria-hidden="true" />}
|
|
180
|
+
aria-label="Sort"
|
|
181
|
+
hideCaret
|
|
182
|
+
/>
|
|
183
|
+
}
|
|
184
|
+
/>
|
|
185
|
+
</ToolbarItem>
|
|
186
|
+
<OverflowMenu breakpoint="md">
|
|
187
|
+
<OverflowMenuContent className="pf-u-display-none pf-u-display-block-on-lg">
|
|
188
|
+
<OverflowMenuGroup groupType="button" isPersistent>
|
|
189
|
+
<OverflowMenuItem isPersistent>
|
|
190
|
+
<Button variant="primary">Generate</Button>
|
|
191
|
+
</OverflowMenuItem>
|
|
192
|
+
<OverflowMenuItem isPersistent>
|
|
193
|
+
<Button variant="secondary">Deploy</Button>
|
|
194
|
+
</OverflowMenuItem>
|
|
195
|
+
</OverflowMenuGroup>
|
|
196
|
+
</OverflowMenuContent>
|
|
197
|
+
<OverflowMenuControl hasAdditionalOptions>
|
|
198
|
+
<Dropdown
|
|
199
|
+
onSelect={() => {}}
|
|
200
|
+
toggle={<KebabToggle onToggle={() => {}} />}
|
|
201
|
+
isOpen={false}
|
|
202
|
+
isPlain
|
|
203
|
+
dropdownItems={[]}
|
|
204
|
+
/>
|
|
205
|
+
</OverflowMenuControl>
|
|
206
|
+
</OverflowMenu>
|
|
207
|
+
<ToolbarItem variant="pagination">
|
|
208
|
+
<Pagination
|
|
209
|
+
itemCount={36}
|
|
210
|
+
widgetId="pagination-options-menu-bottom"
|
|
211
|
+
page={1}
|
|
212
|
+
variant={PaginationVariant.top}
|
|
213
|
+
isCompact
|
|
214
|
+
/>
|
|
215
|
+
</ToolbarItem>
|
|
216
|
+
</ToolbarContent>
|
|
217
|
+
</Toolbar>
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
const tableComposable = (
|
|
221
|
+
<TableComposable aria-label="`Composable` table">
|
|
222
|
+
<Thead noWrap>
|
|
223
|
+
<Tr>
|
|
224
|
+
<Th
|
|
225
|
+
select={{
|
|
226
|
+
onSelect: (_event, isSelecting) => onSelectAll(isSelecting),
|
|
227
|
+
isSelected: allRowsSelected
|
|
228
|
+
}}
|
|
229
|
+
/>
|
|
230
|
+
<Th>{columnNames.name}</Th>
|
|
231
|
+
<Th>{columnNames.branches}</Th>
|
|
232
|
+
<Th>{columnNames.prs}</Th>
|
|
233
|
+
<Th>{columnNames.workspaces}</Th>
|
|
234
|
+
<Th>{columnNames.lastCommit}</Th>
|
|
235
|
+
</Tr>
|
|
236
|
+
</Thead>
|
|
237
|
+
<Tbody>
|
|
238
|
+
{repositories.map((repo, rowIndex) => (
|
|
239
|
+
<Tr
|
|
240
|
+
key={repo.name}
|
|
241
|
+
onRowClick={event => {
|
|
242
|
+
if ((event.target as HTMLInputElement).type !== 'checkbox') {
|
|
243
|
+
setRowClicked(rowClicked === repo.name ? null : repo.name);
|
|
244
|
+
setIsExpanded(!isRowClicked(repo));
|
|
245
|
+
}
|
|
246
|
+
}}
|
|
247
|
+
isHoverable
|
|
248
|
+
isRowSelected={repo.name === rowClicked}
|
|
249
|
+
>
|
|
250
|
+
<Td
|
|
251
|
+
key={`${rowIndex}_0`}
|
|
252
|
+
select={{
|
|
253
|
+
rowIndex,
|
|
254
|
+
onSelect: (event, isSelected) => setRepoSelected(event, repo, isSelected),
|
|
255
|
+
isSelected: isRepoSelected(repo)
|
|
256
|
+
}}
|
|
257
|
+
/>
|
|
258
|
+
<Td dataLabel={columnNames.name}>
|
|
259
|
+
{repo.name}
|
|
260
|
+
<div>
|
|
261
|
+
<a href="#">siemur/test-space</a>
|
|
262
|
+
</div>
|
|
263
|
+
</Td>
|
|
264
|
+
<Td dataLabel={columnNames.branches}>
|
|
265
|
+
<Flex>
|
|
266
|
+
<FlexItem>{repo.branches}</FlexItem>
|
|
267
|
+
<FlexItem>
|
|
268
|
+
<CodeBranchIcon key="icon" />
|
|
269
|
+
</FlexItem>
|
|
270
|
+
</Flex>
|
|
271
|
+
</Td>
|
|
272
|
+
<Td dataLabel={columnNames.prs}>
|
|
273
|
+
<Flex>
|
|
274
|
+
<FlexItem>{repo.prs}</FlexItem>
|
|
275
|
+
<FlexItem>
|
|
276
|
+
<CodeIcon key="icon" />
|
|
277
|
+
</FlexItem>
|
|
278
|
+
</Flex>
|
|
279
|
+
</Td>
|
|
280
|
+
<Td dataLabel={columnNames.workspaces}>
|
|
281
|
+
<Flex>
|
|
282
|
+
<FlexItem>{repo.workspaces}</FlexItem>
|
|
283
|
+
<FlexItem>
|
|
284
|
+
<CubeIcon key="icon" />
|
|
285
|
+
</FlexItem>
|
|
286
|
+
</Flex>
|
|
287
|
+
</Td>
|
|
288
|
+
<Td dataLabel={columnNames.lastCommit}>{repo.lastCommit}</Td>
|
|
289
|
+
<Td key={`${rowIndex}_5`}>
|
|
290
|
+
<ActionsColumn items={defaultActions} actionsToggle={customActionsToggle} />
|
|
291
|
+
</Td>
|
|
292
|
+
</Tr>
|
|
293
|
+
))}
|
|
294
|
+
</Tbody>
|
|
295
|
+
</TableComposable>
|
|
296
|
+
);
|
|
297
|
+
|
|
298
|
+
const panelContent = (
|
|
299
|
+
<DrawerPanelContent widths={{ default: 'width_33', xl: 'width_33' }}>
|
|
300
|
+
<DrawerHead>
|
|
301
|
+
<DrawerActions>
|
|
302
|
+
<DrawerCloseButton
|
|
303
|
+
onClick={() => {
|
|
304
|
+
setRowClicked(null);
|
|
305
|
+
setIsExpanded(false);
|
|
306
|
+
}}
|
|
307
|
+
/>
|
|
308
|
+
</DrawerActions>
|
|
309
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }} direction={{ default: 'column' }}>
|
|
310
|
+
<FlexItem>
|
|
311
|
+
<Title headingLevel="h2" size="lg">
|
|
312
|
+
{rowClicked}
|
|
313
|
+
</Title>
|
|
314
|
+
</FlexItem>
|
|
315
|
+
<FlexItem>
|
|
316
|
+
<a href="#">siemur/test-space</a>
|
|
317
|
+
</FlexItem>
|
|
318
|
+
</Flex>
|
|
319
|
+
</DrawerHead>
|
|
320
|
+
<DrawerPanelBody hasNoPadding>
|
|
321
|
+
<Tabs
|
|
322
|
+
activeKey={secondaryActiveTabKey}
|
|
323
|
+
onSelect={(_event, tabIndex) => handleSecondaryTabClick(Number(tabIndex))}
|
|
324
|
+
hasBorderBottom={false}
|
|
325
|
+
inset={{ default: 'insetMd', md: 'insetSm' }}
|
|
326
|
+
id="tabs-tables-secondary-tabs"
|
|
327
|
+
>
|
|
328
|
+
<Tab eventKey={10} title={<TabTitleText>Overview</TabTitleText>} tabContentId={`tabContent${10}`} />
|
|
329
|
+
<Tab eventKey={11} title={<TabTitleText>Activity</TabTitleText>} tabContentId={`tabContent${11}`} />
|
|
330
|
+
<Tab eventKey={12} title={<TabTitleText>Status</TabTitleText>} tabContentId={`tabContent${12}`} />
|
|
331
|
+
</Tabs>
|
|
332
|
+
</DrawerPanelBody>
|
|
333
|
+
<DrawerPanelBody>
|
|
334
|
+
<TabContent
|
|
335
|
+
key={10}
|
|
336
|
+
eventKey={10}
|
|
337
|
+
id={`tabContent${10}`}
|
|
338
|
+
activeKey={secondaryActiveTabKey}
|
|
339
|
+
hidden={10 !== secondaryActiveTabKey}
|
|
340
|
+
>
|
|
341
|
+
<TabContentBody>
|
|
342
|
+
<Flex direction={{ default: 'column' }} spaceItems={{ default: 'spaceItemsLg' }}>
|
|
343
|
+
<FlexItem>
|
|
344
|
+
<p>
|
|
345
|
+
The content of the drawer really is up to you. It could have form fields, definition lists, text
|
|
346
|
+
lists, labels, charts, progress bars, etc. Spacing recommendation is 24px margins. You can put tabs in
|
|
347
|
+
here, and can also make the drawer scrollable.
|
|
348
|
+
</p>
|
|
349
|
+
</FlexItem>
|
|
350
|
+
<FlexItem>
|
|
351
|
+
<Progress value={33} title="Capacity" size={ProgressSize.sm} />
|
|
352
|
+
</FlexItem>
|
|
353
|
+
<FlexItem>
|
|
354
|
+
<Progress value={66} title="Modules" size={ProgressSize.sm} />
|
|
355
|
+
</FlexItem>
|
|
356
|
+
<Flex direction={{ default: 'column' }}>
|
|
357
|
+
<FlexItem>
|
|
358
|
+
<Title headingLevel="h3">Tags</Title>
|
|
359
|
+
</FlexItem>
|
|
360
|
+
<FlexItem>
|
|
361
|
+
<LabelGroup>
|
|
362
|
+
{[1, 2, 3, 4, 5].map(labelNumber => (
|
|
363
|
+
<Label variant="outline" key={`label-${labelNumber}`}>{`Tag ${labelNumber}`}</Label>
|
|
364
|
+
))}
|
|
365
|
+
</LabelGroup>
|
|
366
|
+
</FlexItem>
|
|
367
|
+
</Flex>
|
|
368
|
+
</Flex>
|
|
369
|
+
</TabContentBody>
|
|
370
|
+
</TabContent>
|
|
371
|
+
<TabContent
|
|
372
|
+
key={11}
|
|
373
|
+
eventKey={11}
|
|
374
|
+
id={`tabContent${11}`}
|
|
375
|
+
activeKey={secondaryActiveTabKey}
|
|
376
|
+
hidden={11 !== secondaryActiveTabKey}
|
|
377
|
+
>
|
|
378
|
+
<TabContentBody>Activity panel</TabContentBody>
|
|
379
|
+
</TabContent>
|
|
380
|
+
<TabContent
|
|
381
|
+
key={12}
|
|
382
|
+
eventKey={12}
|
|
383
|
+
id={`tabContent${12}`}
|
|
384
|
+
activeKey={secondaryActiveTabKey}
|
|
385
|
+
hidden={12 !== secondaryActiveTabKey}
|
|
386
|
+
>
|
|
387
|
+
<TabContentBody>Status panel</TabContentBody>
|
|
388
|
+
</TabContent>
|
|
389
|
+
</DrawerPanelBody>
|
|
390
|
+
</DrawerPanelContent>
|
|
391
|
+
);
|
|
392
|
+
|
|
393
|
+
const tabContent = (
|
|
394
|
+
<Drawer isExpanded={isExpanded} isInline>
|
|
395
|
+
<DrawerContent panelContent={panelContent}>
|
|
396
|
+
<DrawerContentBody>
|
|
397
|
+
{toolbar}
|
|
398
|
+
<Divider />
|
|
399
|
+
{tableComposable}
|
|
400
|
+
<Pagination
|
|
401
|
+
id="page-layout-table-column-management-action-toolbar-bottom"
|
|
402
|
+
itemCount={36}
|
|
403
|
+
widgetId="pagination-options-menu-bottom"
|
|
404
|
+
page={1}
|
|
405
|
+
variant={PaginationVariant.bottom}
|
|
406
|
+
/>
|
|
407
|
+
</DrawerContentBody>
|
|
408
|
+
</DrawerContent>
|
|
409
|
+
</Drawer>
|
|
410
|
+
);
|
|
411
|
+
|
|
412
|
+
return (
|
|
413
|
+
<DashboardWrapper hasNoBreadcrumb>
|
|
414
|
+
<React.Fragment>
|
|
415
|
+
<PageSection variant={PageSectionVariants.light}>
|
|
416
|
+
<Title headingLevel="h1" size="2xl">
|
|
417
|
+
Nodes
|
|
418
|
+
</Title>
|
|
419
|
+
</PageSection>
|
|
420
|
+
<PageSection type="tabs" variant={PageSectionVariants.light} padding={{ default: 'noPadding' }}>
|
|
421
|
+
<Tabs
|
|
422
|
+
activeKey={activeTabKey}
|
|
423
|
+
onSelect={(_event, tabIndex) => handleTabClick(Number(tabIndex))}
|
|
424
|
+
usePageInsets
|
|
425
|
+
id="tabs-table-tabs-list"
|
|
426
|
+
>
|
|
427
|
+
<Tab eventKey={0} title={<TabTitleText>Nodes</TabTitleText>} tabContentId={`tabContent${0}`} />
|
|
428
|
+
<Tab eventKey={1} title={<TabTitleText>Node connectors</TabTitleText>} tabContentId={`tabContent${1}`} />
|
|
429
|
+
</Tabs>
|
|
430
|
+
</PageSection>
|
|
431
|
+
<PageSection variant={PageSectionVariants.light} padding={{ default: 'noPadding' }}>
|
|
432
|
+
<TabContent key={0} eventKey={0} id={`tabContent${0}`} activeKey={activeTabKey} hidden={0 !== activeTabKey}>
|
|
433
|
+
<TabContentBody>{tabContent}</TabContentBody>
|
|
434
|
+
</TabContent>
|
|
435
|
+
<TabContent key={1} eventKey={1} id={`tabContent${1}`} activeKey={activeTabKey} hidden={1 !== activeTabKey}>
|
|
436
|
+
<TabContentBody>Node connectors panel</TabContentBody>
|
|
437
|
+
</TabContent>
|
|
438
|
+
</PageSection>
|
|
439
|
+
</React.Fragment>
|
|
440
|
+
</DashboardWrapper>
|
|
441
|
+
);
|
|
442
|
+
};
|