@patternfly/react-core 4.263.0 → 4.264.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 +22 -0
- package/dist/esm/components/Tabs/Tab.d.ts +4 -2
- package/dist/esm/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tab.js +6 -7
- package/dist/esm/components/Tabs/Tab.js.map +1 -1
- package/dist/esm/components/Tabs/TabAction.d.ts +20 -0
- package/dist/esm/components/Tabs/TabAction.d.ts.map +1 -0
- package/dist/esm/components/Tabs/TabAction.js +17 -0
- package/dist/esm/components/Tabs/TabAction.js.map +1 -0
- package/dist/esm/components/Tabs/Tabs.d.ts +1 -1
- package/dist/esm/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/esm/components/Tabs/index.d.ts +1 -0
- package/dist/esm/components/Tabs/index.d.ts.map +1 -1
- package/dist/esm/components/Tabs/index.js +1 -0
- package/dist/esm/components/Tabs/index.js.map +1 -1
- package/dist/js/components/Tabs/Tab.d.ts +4 -2
- package/dist/js/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tab.js +6 -7
- package/dist/js/components/Tabs/Tab.js.map +1 -1
- package/dist/js/components/Tabs/TabAction.d.ts +20 -0
- package/dist/js/components/Tabs/TabAction.d.ts.map +1 -0
- package/dist/js/components/Tabs/TabAction.js +20 -0
- package/dist/js/components/Tabs/TabAction.js.map +1 -0
- package/dist/js/components/Tabs/Tabs.d.ts +1 -1
- package/dist/js/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/js/components/Tabs/index.d.ts +1 -0
- package/dist/js/components/Tabs/index.d.ts.map +1 -1
- package/dist/js/components/Tabs/index.js +1 -0
- package/dist/js/components/Tabs/index.js.map +1 -1
- package/dist/styles/assets/pficon/pficon.scss +12 -0
- package/dist/styles/assets/pficon/pficon.woff +0 -0
- package/dist/styles/assets/pficon/pficon.woff2 +0 -0
- package/dist/styles/base-no-reset.css +10 -0
- package/dist/styles/base.css +10 -0
- package/dist/umd/react-core.min.css +1063 -894
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +14 -7
- package/src/components/Tabs/Tab.tsx +17 -16
- package/src/components/Tabs/TabAction.tsx +57 -0
- package/src/components/Tabs/Tabs.tsx +1 -1
- package/src/components/Tabs/__tests__/Tab.test.tsx +10 -0
- package/src/components/Tabs/__tests__/__snapshots__/Tab.test.tsx.snap +45 -0
- package/src/components/Tabs/examples/Tabs.md +64 -20
- package/src/components/Tabs/examples/TabsHelp.tsx +61 -0
- package/src/components/Tabs/examples/TabsHelpAndClose.tsx +84 -0
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/Tooltip/examples/Tooltip.md +5 -285
- package/src/components/Tooltip/examples/TooltipBasic.tsx +16 -0
- package/src/components/Tooltip/examples/TooltipIcon.tsx +24 -0
- package/src/components/Tooltip/examples/TooltipOptions.tsx +197 -0
- package/src/components/Tooltip/examples/TooltipReactRef.tsx +22 -0
- package/src/components/Tooltip/examples/TooltipSelectorRef.tsx +19 -0
- package/src/demos/Tabs.md +0 -10
- package/src/demos/examples/DashboardWrapper.js +1 -0
- package/src/demos/examples/Tabs/ModalTabs.tsx +3 -3
- package/src/demos/examples/Tabs/NestedTabs.tsx +11 -3
- package/src/demos/examples/Tabs/NestedUnindentedTabs.tsx +25 -40
- package/src/demos/examples/Tabs/TabsAndTable.tsx +9 -52
- package/dist/esm/components/Button/__mocks__/Button.d.ts +0 -8
- package/dist/esm/components/Button/__mocks__/Button.d.ts.map +0 -1
- package/dist/esm/components/Button/__mocks__/Button.js +0 -14
- package/dist/esm/components/Button/__mocks__/Button.js.map +0 -1
- package/dist/esm/components/Button/__mocks__/index.d.ts +0 -2
- package/dist/esm/components/Button/__mocks__/index.d.ts.map +0 -1
- package/dist/esm/components/Button/__mocks__/index.js +0 -2
- package/dist/esm/components/Button/__mocks__/index.js.map +0 -1
- package/dist/esm/components/HelperText/__mocks__/HelperText.d.ts +0 -4
- package/dist/esm/components/HelperText/__mocks__/HelperText.d.ts.map +0 -1
- package/dist/esm/components/HelperText/__mocks__/HelperText.js +0 -5
- package/dist/esm/components/HelperText/__mocks__/HelperText.js.map +0 -1
- package/dist/esm/components/HelperText/__mocks__/HelperTextItem.d.ts +0 -4
- package/dist/esm/components/HelperText/__mocks__/HelperTextItem.d.ts.map +0 -1
- package/dist/esm/components/HelperText/__mocks__/HelperTextItem.js +0 -5
- package/dist/esm/components/HelperText/__mocks__/HelperTextItem.js.map +0 -1
- package/dist/esm/components/HelperText/__mocks__/index.d.ts +0 -3
- package/dist/esm/components/HelperText/__mocks__/index.d.ts.map +0 -1
- package/dist/esm/components/HelperText/__mocks__/index.js +0 -3
- package/dist/esm/components/HelperText/__mocks__/index.js.map +0 -1
- package/dist/js/components/Button/__mocks__/Button.d.ts +0 -8
- package/dist/js/components/Button/__mocks__/Button.d.ts.map +0 -1
- package/dist/js/components/Button/__mocks__/Button.js +0 -18
- package/dist/js/components/Button/__mocks__/Button.js.map +0 -1
- package/dist/js/components/Button/__mocks__/index.d.ts +0 -2
- package/dist/js/components/Button/__mocks__/index.d.ts.map +0 -1
- package/dist/js/components/Button/__mocks__/index.js +0 -5
- package/dist/js/components/Button/__mocks__/index.js.map +0 -1
- package/dist/js/components/HelperText/__mocks__/HelperText.d.ts +0 -4
- package/dist/js/components/HelperText/__mocks__/HelperText.d.ts.map +0 -1
- package/dist/js/components/HelperText/__mocks__/HelperText.js +0 -10
- package/dist/js/components/HelperText/__mocks__/HelperText.js.map +0 -1
- package/dist/js/components/HelperText/__mocks__/HelperTextItem.d.ts +0 -4
- package/dist/js/components/HelperText/__mocks__/HelperTextItem.d.ts.map +0 -1
- package/dist/js/components/HelperText/__mocks__/HelperTextItem.js +0 -10
- package/dist/js/components/HelperText/__mocks__/HelperTextItem.js.map +0 -1
- package/dist/js/components/HelperText/__mocks__/index.d.ts +0 -3
- package/dist/js/components/HelperText/__mocks__/index.d.ts.map +0 -1
- package/dist/js/components/HelperText/__mocks__/index.js +0 -6
- package/dist/js/components/HelperText/__mocks__/index.js.map +0 -1
- package/src/demos/examples/Tabs/GrayTabs.tsx +0 -152
- package/src/demos/examples/Tabs/TabsAndTablesAutoWidthTabs.tsx +0 -442
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
PageSection,
|
|
4
|
-
Tabs,
|
|
5
|
-
Tab,
|
|
6
|
-
TabContent,
|
|
7
|
-
TabContentBody,
|
|
8
|
-
TabTitleText,
|
|
9
|
-
Title,
|
|
10
|
-
Grid,
|
|
11
|
-
GridItem,
|
|
12
|
-
Flex,
|
|
13
|
-
FlexItem,
|
|
14
|
-
Card,
|
|
15
|
-
CardBody,
|
|
16
|
-
CardHeader
|
|
17
|
-
} from '@patternfly/react-core';
|
|
18
|
-
import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
|
|
19
|
-
|
|
20
|
-
export const GrayTabsDemo: React.FunctionComponent = () => {
|
|
21
|
-
const [activeTabKey, setActiveTabKey] = React.useState<string | number>(0);
|
|
22
|
-
const [activeNestedTabKey, setActiveNestedTabKey] = React.useState<string | number>(0);
|
|
23
|
-
|
|
24
|
-
// Toggle currently active tab
|
|
25
|
-
const handleTabClick = (_: React.MouseEvent, tabIndex: string | number) => setActiveTabKey(tabIndex);
|
|
26
|
-
|
|
27
|
-
// Toggle currently active nested tab
|
|
28
|
-
const handleNestedTabClick = (_: React.MouseEvent, tabIndex: string | number) => setActiveNestedTabKey(tabIndex);
|
|
29
|
-
|
|
30
|
-
const tabContent = (
|
|
31
|
-
<Grid hasGutter>
|
|
32
|
-
<GridItem xl={8} md={6}>
|
|
33
|
-
<Card>
|
|
34
|
-
<CardHeader>
|
|
35
|
-
<Title headingLevel="h2">Status</Title>
|
|
36
|
-
</CardHeader>
|
|
37
|
-
<CardBody>
|
|
38
|
-
<Flex direction={{ default: 'column' }}>
|
|
39
|
-
<FlexItem>
|
|
40
|
-
<Tabs
|
|
41
|
-
activeKey={activeNestedTabKey}
|
|
42
|
-
isSecondary
|
|
43
|
-
onSelect={handleNestedTabClick}
|
|
44
|
-
id="nested-tabs-example-tabs-list"
|
|
45
|
-
>
|
|
46
|
-
<Tab eventKey={10} title={<TabTitleText>Cluster</TabTitleText>} tabContentId={`tabContent${10}`} />
|
|
47
|
-
<Tab
|
|
48
|
-
eventKey={11}
|
|
49
|
-
title={<TabTitleText>Control plane</TabTitleText>}
|
|
50
|
-
tabContentId={`tabContent${11}`}
|
|
51
|
-
/>
|
|
52
|
-
<Tab eventKey={12} title={<TabTitleText>Operators</TabTitleText>} tabContentId={`tabContent${12}`} />
|
|
53
|
-
<Tab
|
|
54
|
-
eventKey={13}
|
|
55
|
-
title={<TabTitleText>Virtualization</TabTitleText>}
|
|
56
|
-
tabContentId={`tabContent${13}`}
|
|
57
|
-
/>
|
|
58
|
-
</Tabs>
|
|
59
|
-
</FlexItem>
|
|
60
|
-
<FlexItem>
|
|
61
|
-
<TabContent
|
|
62
|
-
key={10}
|
|
63
|
-
eventKey={10}
|
|
64
|
-
id={`tabContent${10}`}
|
|
65
|
-
activeKey={activeNestedTabKey}
|
|
66
|
-
hidden={10 !== activeNestedTabKey}
|
|
67
|
-
>
|
|
68
|
-
<TabContentBody>
|
|
69
|
-
{
|
|
70
|
-
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce in odio porttitor, feugiat risus in, feugiat arcu. Nullam euismod enim eget fringilla condimentum. Maecenas tincidunt et metus id aliquet. Integer et fermentum purus. Nulla tempor velit arcu, vitae semper purus iaculis at. Sed malesuada auctor luctus. Pellentesque et leo urna. Aliquam vitae felis congue lacus mattis fringilla. Nullam et ultricies erat, sed dignissim elit. Cras mattis pulvinar aliquam. In ac est nulla. Pellentesque fermentum nibh ac sapien porta, ut congue orci aliquam. Sed nisl est, tempor eu pharetra eget, ullamcorper ut augue. Vestibulum eleifend libero eu nulla cursus lacinia.'
|
|
71
|
-
}
|
|
72
|
-
</TabContentBody>
|
|
73
|
-
</TabContent>
|
|
74
|
-
<TabContent
|
|
75
|
-
key={11}
|
|
76
|
-
eventKey={11}
|
|
77
|
-
id={`tabContent${11}`}
|
|
78
|
-
activeKey={activeNestedTabKey}
|
|
79
|
-
hidden={11 !== activeNestedTabKey}
|
|
80
|
-
>
|
|
81
|
-
<TabContentBody>Control plane panel</TabContentBody>
|
|
82
|
-
</TabContent>
|
|
83
|
-
<TabContent
|
|
84
|
-
key={12}
|
|
85
|
-
eventKey={12}
|
|
86
|
-
id={`tabContent${12}`}
|
|
87
|
-
activeKey={activeNestedTabKey}
|
|
88
|
-
hidden={12 !== activeNestedTabKey}
|
|
89
|
-
>
|
|
90
|
-
<TabContentBody>Operators panel</TabContentBody>
|
|
91
|
-
</TabContent>
|
|
92
|
-
<TabContent
|
|
93
|
-
key={13}
|
|
94
|
-
eventKey={13}
|
|
95
|
-
id={`tabContent${13}`}
|
|
96
|
-
activeKey={activeNestedTabKey}
|
|
97
|
-
hidden={13 !== activeNestedTabKey}
|
|
98
|
-
>
|
|
99
|
-
<TabContentBody>Virtualization panel</TabContentBody>
|
|
100
|
-
</TabContent>
|
|
101
|
-
</FlexItem>
|
|
102
|
-
</Flex>
|
|
103
|
-
</CardBody>
|
|
104
|
-
</Card>
|
|
105
|
-
</GridItem>
|
|
106
|
-
<GridItem xl={4} md={6}>
|
|
107
|
-
<Flex direction={{ default: 'column' }} className="pf-u-h-100">
|
|
108
|
-
<FlexItem flex={{ default: 'flex_1' }}>
|
|
109
|
-
<Card isFullHeight>
|
|
110
|
-
<CardHeader>
|
|
111
|
-
<Title headingLevel="h2">Title of Card</Title>
|
|
112
|
-
</CardHeader>
|
|
113
|
-
</Card>
|
|
114
|
-
</FlexItem>
|
|
115
|
-
<FlexItem flex={{ default: 'flex_1' }}>
|
|
116
|
-
<Card isFullHeight>
|
|
117
|
-
<CardHeader>
|
|
118
|
-
<Title headingLevel="h2">Title of Card</Title>
|
|
119
|
-
</CardHeader>
|
|
120
|
-
</Card>
|
|
121
|
-
</FlexItem>
|
|
122
|
-
</Flex>
|
|
123
|
-
</GridItem>
|
|
124
|
-
</Grid>
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<DashboardWrapper hasPageTemplateTitle>
|
|
129
|
-
<PageSection type="tabs" isWidthLimited>
|
|
130
|
-
<Tabs
|
|
131
|
-
activeKey={activeTabKey}
|
|
132
|
-
onSelect={handleTabClick}
|
|
133
|
-
usePageInsets
|
|
134
|
-
isBox
|
|
135
|
-
variant="light300"
|
|
136
|
-
id="open-tabs-example-tabs-list"
|
|
137
|
-
>
|
|
138
|
-
<Tab eventKey={0} title={<TabTitleText>Cluster 1</TabTitleText>} tabContentId={`tabContent${0}`} />
|
|
139
|
-
<Tab eventKey={1} title={<TabTitleText>Cluster 2</TabTitleText>} tabContentId={`tabContent${1}`} />
|
|
140
|
-
</Tabs>
|
|
141
|
-
</PageSection>
|
|
142
|
-
<PageSection isWidthLimited>
|
|
143
|
-
<TabContent key={0} eventKey={0} id={`tabContent${0}`} activeKey={activeTabKey} hidden={0 !== activeTabKey}>
|
|
144
|
-
<TabContentBody>{tabContent}</TabContentBody>
|
|
145
|
-
</TabContent>
|
|
146
|
-
<TabContent key={1} eventKey={1} id={`tabContent${1}`} activeKey={activeTabKey} hidden={1 !== activeTabKey}>
|
|
147
|
-
<TabContentBody>Cluster 2 panel</TabContentBody>
|
|
148
|
-
</TabContent>
|
|
149
|
-
</PageSection>
|
|
150
|
-
</DashboardWrapper>
|
|
151
|
-
);
|
|
152
|
-
};
|
|
@@ -1,442 +0,0 @@
|
|
|
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 '@patternfly/react-core/src/demos/examples/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
|
-
};
|