@patternfly/react-core 4.164.1 → 4.168.4
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 +145 -0
- package/README.md +1 -1
- package/dist/esm/components/Dropdown/DropdownToggle.d.ts +1 -1
- package/dist/esm/components/Dropdown/DropdownToggle.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/KebabToggle.d.ts +1 -1
- package/dist/esm/components/Dropdown/KebabToggle.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.d.ts +1 -0
- package/dist/esm/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.js +23 -10
- package/dist/esm/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/esm/components/Label/Label.d.ts +2 -0
- package/dist/esm/components/Label/Label.d.ts.map +1 -1
- package/dist/esm/components/Label/Label.js +2 -2
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/esm/components/LabelGroup/LabelGroup.d.ts +2 -0
- package/dist/esm/components/LabelGroup/LabelGroup.d.ts.map +1 -1
- package/dist/esm/components/LabelGroup/LabelGroup.js +5 -3
- package/dist/esm/components/LabelGroup/LabelGroup.js.map +1 -1
- package/dist/esm/components/ProgressStepper/ProgressStep.d.ts +5 -1
- package/dist/esm/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
- package/dist/esm/components/ProgressStepper/ProgressStep.js +7 -3
- package/dist/esm/components/ProgressStepper/ProgressStep.js.map +1 -1
- package/dist/esm/components/Select/SelectOption.d.ts +1 -1
- package/dist/esm/components/Select/SelectOption.d.ts.map +1 -1
- package/dist/esm/components/Tabs/TabContentBody.d.ts +11 -0
- package/dist/esm/components/Tabs/TabContentBody.d.ts.map +1 -0
- package/dist/esm/components/Tabs/TabContentBody.js +10 -0
- package/dist/esm/components/Tabs/TabContentBody.js.map +1 -0
- 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/esm/components/TextInputGroup/TextInputGroup.d.ts +9 -0
- package/dist/esm/components/TextInputGroup/TextInputGroup.d.ts.map +1 -0
- package/dist/esm/components/TextInputGroup/TextInputGroup.js +10 -0
- package/dist/esm/components/TextInputGroup/TextInputGroup.js.map +1 -0
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts +15 -0
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -0
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.js +15 -0
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.js.map +1 -0
- package/dist/esm/components/TextInputGroup/TextInputGroupUtilities.d.ts +9 -0
- package/dist/esm/components/TextInputGroup/TextInputGroupUtilities.d.ts.map +1 -0
- package/dist/esm/components/TextInputGroup/TextInputGroupUtilities.js +10 -0
- package/dist/esm/components/TextInputGroup/TextInputGroupUtilities.js.map +1 -0
- package/dist/esm/components/TextInputGroup/index.d.ts +4 -0
- package/dist/esm/components/TextInputGroup/index.d.ts.map +1 -0
- package/dist/esm/components/TextInputGroup/index.js +4 -0
- package/dist/esm/components/TextInputGroup/index.js.map +1 -0
- package/dist/esm/components/Toolbar/Toolbar.d.ts +2 -0
- package/dist/esm/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/Toolbar.js +2 -2
- package/dist/esm/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/js/components/Dropdown/DropdownToggle.d.ts +1 -1
- package/dist/js/components/Dropdown/DropdownToggle.d.ts.map +1 -1
- package/dist/js/components/Dropdown/KebabToggle.d.ts +1 -1
- package/dist/js/components/Dropdown/KebabToggle.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.d.ts +1 -0
- package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.js +23 -10
- package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/js/components/Label/Label.d.ts +2 -0
- package/dist/js/components/Label/Label.d.ts.map +1 -1
- package/dist/js/components/Label/Label.js +2 -2
- package/dist/js/components/Label/Label.js.map +1 -1
- package/dist/js/components/LabelGroup/LabelGroup.d.ts +2 -0
- package/dist/js/components/LabelGroup/LabelGroup.d.ts.map +1 -1
- package/dist/js/components/LabelGroup/LabelGroup.js +5 -3
- package/dist/js/components/LabelGroup/LabelGroup.js.map +1 -1
- package/dist/js/components/ProgressStepper/ProgressStep.d.ts +5 -1
- package/dist/js/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
- package/dist/js/components/ProgressStepper/ProgressStep.js +7 -4
- package/dist/js/components/ProgressStepper/ProgressStep.js.map +1 -1
- package/dist/js/components/Select/SelectOption.d.ts +1 -1
- package/dist/js/components/Select/SelectOption.d.ts.map +1 -1
- package/dist/js/components/Tabs/TabContentBody.d.ts +11 -0
- package/dist/js/components/Tabs/TabContentBody.d.ts.map +1 -0
- package/dist/js/components/Tabs/TabContentBody.js +14 -0
- package/dist/js/components/Tabs/TabContentBody.js.map +1 -0
- 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/js/components/TextInputGroup/TextInputGroup.d.ts +9 -0
- package/dist/js/components/TextInputGroup/TextInputGroup.d.ts.map +1 -0
- package/dist/js/components/TextInputGroup/TextInputGroup.js +14 -0
- package/dist/js/components/TextInputGroup/TextInputGroup.js.map +1 -0
- package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts +15 -0
- package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -0
- package/dist/js/components/TextInputGroup/TextInputGroupMain.js +19 -0
- package/dist/js/components/TextInputGroup/TextInputGroupMain.js.map +1 -0
- package/dist/js/components/TextInputGroup/TextInputGroupUtilities.d.ts +9 -0
- package/dist/js/components/TextInputGroup/TextInputGroupUtilities.d.ts.map +1 -0
- package/dist/js/components/TextInputGroup/TextInputGroupUtilities.js +14 -0
- package/dist/js/components/TextInputGroup/TextInputGroupUtilities.js.map +1 -0
- package/dist/js/components/TextInputGroup/index.d.ts +4 -0
- package/dist/js/components/TextInputGroup/index.d.ts.map +1 -0
- package/dist/js/components/TextInputGroup/index.js +7 -0
- package/dist/js/components/TextInputGroup/index.js.map +1 -0
- package/dist/js/components/Toolbar/Toolbar.d.ts +2 -0
- package/dist/js/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/js/components/Toolbar/Toolbar.js +2 -2
- package/dist/js/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/js/components/index.d.ts +1 -0
- package/dist/js/components/index.d.ts.map +1 -1
- package/dist/js/components/index.js +1 -0
- package/dist/js/components/index.js.map +1 -1
- package/dist/styles/assets/pficon/pficon.woff +0 -0
- package/dist/styles/assets/pficon/pficon.woff2 +0 -0
- package/dist/umd/react-core.css +360 -17
- package/dist/umd/react-core.js +970 -890
- package/dist/umd/react-core.min.css +360 -17
- package/dist/umd/react-core.min.js +3 -3
- package/package.json +6 -6
- package/src/components/Dropdown/DropdownToggle.tsx +1 -1
- package/src/components/Dropdown/KebabToggle.tsx +1 -1
- package/src/components/DualListSelector/DualListSelector.tsx +25 -23
- package/src/components/Label/Label.tsx +4 -0
- package/src/components/Label/__tests__/Generated/__snapshots__/Label.test.tsx.snap +0 -1
- package/src/components/Label/examples/Label.md +72 -42
- package/src/components/LabelGroup/LabelGroup.tsx +10 -1
- package/src/components/LabelGroup/__tests__/LabelGroup.test.tsx +12 -0
- package/src/components/LabelGroup/__tests__/__snapshots__/LabelGroup.test.tsx.snap +8 -0
- package/src/components/Modal/__tests__/ModalBox.test.tsx +11 -21
- package/src/components/Modal/__tests__/ModalBoxDescription.test.tsx +12 -0
- package/src/components/Modal/__tests__/ModalBoxTitle.test.tsx +59 -0
- package/src/components/Modal/__tests__/ModalContent.test.tsx +15 -10
- package/src/components/Modal/__tests__/__snapshots__/ModalBox.test.tsx.snap +12 -30
- package/src/components/Modal/__tests__/__snapshots__/ModalBoxDescription.test.tsx.snap +10 -0
- package/src/components/Modal/__tests__/__snapshots__/ModalBoxTitle.test.tsx.snap +158 -0
- package/src/components/Modal/__tests__/__snapshots__/ModalContent.test.tsx.snap +53 -22
- package/src/components/ProgressStepper/ProgressStep.tsx +18 -4
- package/src/components/ProgressStepper/__tests__/ProgressStepper.test.tsx +5 -0
- package/src/components/ProgressStepper/__tests__/__snapshots__/ProgressStepper.test.tsx.snap +680 -517
- package/src/components/ProgressStepper/examples/ProgressStepper.md +78 -0
- package/src/components/Select/SelectOption.tsx +1 -1
- package/src/components/Tabs/TabContentBody.tsx +24 -0
- package/src/components/Tabs/__tests__/Tabs.test.tsx +4 -3
- package/src/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +10 -2
- package/src/components/Tabs/examples/Tabs.md +40 -0
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/TextInputGroup/TextInputGroup.tsx +22 -0
- package/src/components/TextInputGroup/TextInputGroupMain.tsx +43 -0
- package/src/components/TextInputGroup/TextInputGroupUtilities.tsx +22 -0
- package/src/components/TextInputGroup/__tests__/TextInputGroup.test.tsx +77 -0
- package/src/components/TextInputGroup/__tests__/__snapshots__/TextInputGroup.test.tsx.snap +211 -0
- package/src/components/TextInputGroup/examples/TextInputGroup.md +138 -0
- package/src/components/TextInputGroup/index.ts +3 -0
- package/src/components/Toolbar/Toolbar.tsx +4 -0
- package/src/components/Wizard/examples/Wizard.md +17 -1
- package/src/components/index.ts +1 -0
- package/src/demos/CardDemos.md +5 -5
- package/src/demos/ProgressDemo.md +82 -0
- package/src/demos/Tabs.md +439 -0
- package/src/demos/examples/DashboardWrapper.js +16 -2
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: Tabs
|
|
3
|
+
section: components
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import DashboardWrapper from './examples/DashboardWrapper';
|
|
7
|
+
import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
|
|
8
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
9
|
+
|
|
10
|
+
## Demos
|
|
11
|
+
|
|
12
|
+
### Open tabs
|
|
13
|
+
|
|
14
|
+
```js isFullscreen
|
|
15
|
+
import React from 'react';
|
|
16
|
+
import {
|
|
17
|
+
PageSection,
|
|
18
|
+
PageSectionVariants,
|
|
19
|
+
PageBreadcrumb,
|
|
20
|
+
Breadcrumb,
|
|
21
|
+
BreadcrumbItem,
|
|
22
|
+
Tabs,
|
|
23
|
+
Tab,
|
|
24
|
+
TabContent,
|
|
25
|
+
TabContentBody,
|
|
26
|
+
TabTitleText,
|
|
27
|
+
Title,
|
|
28
|
+
DescriptionList,
|
|
29
|
+
DescriptionListGroup,
|
|
30
|
+
DescriptionListTerm,
|
|
31
|
+
DescriptionListDescription,
|
|
32
|
+
Label,
|
|
33
|
+
LabelGroup,
|
|
34
|
+
Flex,
|
|
35
|
+
FlexItem
|
|
36
|
+
} from '@patternfly/react-core';
|
|
37
|
+
import DashboardWrapper from './examples/DashboardWrapper';
|
|
38
|
+
import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
|
|
39
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
40
|
+
|
|
41
|
+
TabsOpenDemo = () => {
|
|
42
|
+
const [activeTabKey, setActiveTabKey] = React.useState(0);
|
|
43
|
+
|
|
44
|
+
// Toggle currently active tab
|
|
45
|
+
const handleTabClick = (event, tabIndex) => {
|
|
46
|
+
setActiveTabKey(tabIndex);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const tabsBreadcrumb = (
|
|
50
|
+
<PageBreadcrumb isWidthLimited>
|
|
51
|
+
<Breadcrumb>
|
|
52
|
+
<BreadcrumbItem to="#">Overview</BreadcrumbItem>
|
|
53
|
+
<BreadcrumbItem to="#">Pods</BreadcrumbItem>
|
|
54
|
+
<BreadcrumbItem to="#" isActive>
|
|
55
|
+
Pod details{' '}
|
|
56
|
+
</BreadcrumbItem>
|
|
57
|
+
</Breadcrumb>
|
|
58
|
+
</PageBreadcrumb>
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const tabContent = (
|
|
62
|
+
<Flex direction={{ default: 'column' }}>
|
|
63
|
+
<FlexItem spacer={{ default: 'spacerLg' }}>
|
|
64
|
+
<Title headingLevel="h2" size="lg" className="pf-u-mt-sm" id="open-tabs-example-tabs-list-details-title">
|
|
65
|
+
Pod details
|
|
66
|
+
</Title>
|
|
67
|
+
</FlexItem>
|
|
68
|
+
<FlexItem>
|
|
69
|
+
<DescriptionList columnModifier={{ lg: '2Col' }} aria-labelledby="open-tabs-example-tabs-list-details-title">
|
|
70
|
+
<DescriptionListGroup>
|
|
71
|
+
<DescriptionListTerm>Name</DescriptionListTerm>
|
|
72
|
+
<DescriptionListDescription>3scale-control-fccb6ddb9-phyqv9</DescriptionListDescription>
|
|
73
|
+
</DescriptionListGroup>
|
|
74
|
+
<DescriptionListGroup>
|
|
75
|
+
<DescriptionListTerm>Status</DescriptionListTerm>
|
|
76
|
+
<DescriptionListDescription>
|
|
77
|
+
<Flex spacer={{ default: 'spacerLg' }}>
|
|
78
|
+
<FlexItem>
|
|
79
|
+
<CheckCircleIcon />
|
|
80
|
+
</FlexItem>
|
|
81
|
+
<FlexItem>Running</FlexItem>
|
|
82
|
+
</Flex>
|
|
83
|
+
</DescriptionListDescription>
|
|
84
|
+
</DescriptionListGroup>
|
|
85
|
+
<DescriptionListGroup>
|
|
86
|
+
<DescriptionListTerm>Namespace</DescriptionListTerm>
|
|
87
|
+
<DescriptionListDescription>
|
|
88
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
89
|
+
<FlexItem>
|
|
90
|
+
<Label color="cyan">NS</Label>
|
|
91
|
+
</FlexItem>
|
|
92
|
+
<FlexItem>
|
|
93
|
+
<a href="#">knative-serving-ingress</a>
|
|
94
|
+
</FlexItem>
|
|
95
|
+
</Flex>
|
|
96
|
+
</DescriptionListDescription>
|
|
97
|
+
</DescriptionListGroup>
|
|
98
|
+
<DescriptionListGroup>
|
|
99
|
+
<DescriptionListTerm>Restart policy</DescriptionListTerm>
|
|
100
|
+
<DescriptionListDescription>Always restart</DescriptionListDescription>
|
|
101
|
+
</DescriptionListGroup>
|
|
102
|
+
<DescriptionListGroup>
|
|
103
|
+
<DescriptionListTerm>Labels</DescriptionListTerm>
|
|
104
|
+
<DescriptionListDescription>
|
|
105
|
+
<LabelGroup>
|
|
106
|
+
<Label>app=3scale-gateway</Label>
|
|
107
|
+
<Label>pod-template-has=6747686899</Label>
|
|
108
|
+
</LabelGroup>
|
|
109
|
+
</DescriptionListDescription>
|
|
110
|
+
</DescriptionListGroup>
|
|
111
|
+
<DescriptionListGroup>
|
|
112
|
+
<DescriptionListTerm>Active deadline seconds</DescriptionListTerm>
|
|
113
|
+
<DescriptionListDescription>Not configured</DescriptionListDescription>
|
|
114
|
+
</DescriptionListGroup>
|
|
115
|
+
<DescriptionListGroup>
|
|
116
|
+
<DescriptionListTerm>Tolerations</DescriptionListTerm>
|
|
117
|
+
<DescriptionListDescription>stuff</DescriptionListDescription>
|
|
118
|
+
</DescriptionListGroup>
|
|
119
|
+
<DescriptionListGroup>
|
|
120
|
+
<DescriptionListTerm>Pod IP</DescriptionListTerm>
|
|
121
|
+
<DescriptionListDescription>10..345.2.197</DescriptionListDescription>
|
|
122
|
+
</DescriptionListGroup>
|
|
123
|
+
<DescriptionListGroup>
|
|
124
|
+
<DescriptionListTerm>Annotations</DescriptionListTerm>
|
|
125
|
+
<DescriptionListDescription>stuff</DescriptionListDescription>
|
|
126
|
+
</DescriptionListGroup>
|
|
127
|
+
<DescriptionListGroup>
|
|
128
|
+
<DescriptionListTerm>Node</DescriptionListTerm>
|
|
129
|
+
<DescriptionListDescription>
|
|
130
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
131
|
+
<FlexItem>
|
|
132
|
+
<Label color="purple">N</Label>
|
|
133
|
+
</FlexItem>
|
|
134
|
+
<FlexItem>ip-10-0-233-118.us-east-2.computer.external</FlexItem>
|
|
135
|
+
</Flex>
|
|
136
|
+
</DescriptionListDescription>
|
|
137
|
+
</DescriptionListGroup>
|
|
138
|
+
<DescriptionListGroup>
|
|
139
|
+
<DescriptionListTerm>Created at</DescriptionListTerm>
|
|
140
|
+
<DescriptionListDescription>
|
|
141
|
+
<time>Oct 15, 1:51 pm</time>
|
|
142
|
+
</DescriptionListDescription>
|
|
143
|
+
</DescriptionListGroup>
|
|
144
|
+
</DescriptionList>
|
|
145
|
+
</FlexItem>
|
|
146
|
+
</Flex>
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<DashboardWrapper hasNoBreadcrumb>
|
|
151
|
+
{tabsBreadcrumb}
|
|
152
|
+
<PageSection isWidthLimited variant={PageSectionVariants.light}>
|
|
153
|
+
<Flex
|
|
154
|
+
spaceItems={{ default: 'spaceItemsMd' }}
|
|
155
|
+
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
156
|
+
flexWrap={{ default: 'noWrap' }}
|
|
157
|
+
>
|
|
158
|
+
<FlexItem>
|
|
159
|
+
<Label color="blue">N</Label>
|
|
160
|
+
</FlexItem>
|
|
161
|
+
<FlexItem>
|
|
162
|
+
<Title headingLevel="h1" size="2xl">
|
|
163
|
+
3scale-control-fccb6ddb9-phyqv9
|
|
164
|
+
</Title>
|
|
165
|
+
</FlexItem>
|
|
166
|
+
<FlexItem flex={{ default: 'flexNone' }}>
|
|
167
|
+
<Label icon={<InfoCircleIcon />}>Running</Label>
|
|
168
|
+
</FlexItem>
|
|
169
|
+
</Flex>
|
|
170
|
+
</PageSection>
|
|
171
|
+
<PageSection type="tabs" variant={PageSectionVariants.light} isWidthLimited>
|
|
172
|
+
<Tabs activeKey={activeTabKey} onSelect={handleTabClick} usePageInsets id="open-tabs-example-tabs-list">
|
|
173
|
+
<Tab eventKey={0} title={<TabTitleText>Details</TabTitleText>} tabContentId={`tabContent${0}`} />
|
|
174
|
+
<Tab eventKey={1} title={<TabTitleText>YAML</TabTitleText>} tabContentId={`tabContent${1}`} />
|
|
175
|
+
<Tab eventKey={2} title={<TabTitleText>Environment</TabTitleText>} tabContentId={`tabContent${2}`} />
|
|
176
|
+
<Tab eventKey={3} title={<TabTitleText>Events</TabTitleText>} tabContentId={`tabContent${3}`} />
|
|
177
|
+
<Tab eventKey={4} title={<TabTitleText>Terminal</TabTitleText>} tabContentId={`tabContent${4}`} />
|
|
178
|
+
</Tabs>
|
|
179
|
+
</PageSection>
|
|
180
|
+
<PageSection isWidthLimited variant={PageSectionVariants.light}>
|
|
181
|
+
<TabContent key={0} eventKey={0} id={`tabContent${0}`} activeKey={activeTabKey} hidden={0 !== activeTabKey}>
|
|
182
|
+
<TabContentBody>{tabContent}</TabContentBody>
|
|
183
|
+
</TabContent>
|
|
184
|
+
<TabContent key={1} eventKey={1} id={`tabContent${1}`} activeKey={activeTabKey} hidden={1 !== activeTabKey}>
|
|
185
|
+
<TabContentBody>YAML panel</TabContentBody>
|
|
186
|
+
</TabContent>
|
|
187
|
+
<TabContent key={2} eventKey={2} id={`tabContent${2}`} activeKey={activeTabKey} hidden={2 !== activeTabKey}>
|
|
188
|
+
<TabContentBody>Environment panel</TabContentBody>
|
|
189
|
+
</TabContent>
|
|
190
|
+
<TabContent key={3} eventKey={3} id={`tabContent${3}`} activeKey={activeTabKey} hidden={3 !== activeTabKey}>
|
|
191
|
+
<TabContentBody>Events panel</TabContentBody>
|
|
192
|
+
</TabContent>
|
|
193
|
+
<TabContent key={4} eventKey={4} id={`tabContent${4}`} activeKey={activeTabKey} hidden={4 !== activeTabKey}>
|
|
194
|
+
<TabContentBody>Terminal panel</TabContentBody>
|
|
195
|
+
</TabContent>
|
|
196
|
+
</PageSection>
|
|
197
|
+
</DashboardWrapper>
|
|
198
|
+
);
|
|
199
|
+
};
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Open tabs with secondary tabs
|
|
203
|
+
|
|
204
|
+
```js isFullscreen
|
|
205
|
+
import React from 'react';
|
|
206
|
+
import {
|
|
207
|
+
PageSection,
|
|
208
|
+
PageSectionVariants,
|
|
209
|
+
PageBreadcrumb,
|
|
210
|
+
Breadcrumb,
|
|
211
|
+
BreadcrumbItem,
|
|
212
|
+
Tabs,
|
|
213
|
+
Tab,
|
|
214
|
+
TabContent,
|
|
215
|
+
TabContentBody,
|
|
216
|
+
TabTitleText,
|
|
217
|
+
Title,
|
|
218
|
+
DescriptionList,
|
|
219
|
+
DescriptionListGroup,
|
|
220
|
+
DescriptionListTerm,
|
|
221
|
+
DescriptionListDescription,
|
|
222
|
+
Label,
|
|
223
|
+
LabelGroup,
|
|
224
|
+
Flex,
|
|
225
|
+
FlexItem
|
|
226
|
+
} from '@patternfly/react-core';
|
|
227
|
+
import DashboardWrapper from './examples/DashboardWrapper';
|
|
228
|
+
import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
|
|
229
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
230
|
+
|
|
231
|
+
TabsOpenWithSecondaryTabsDemo = () => {
|
|
232
|
+
const [activeTabKey, setActiveTabKey] = React.useState(0);
|
|
233
|
+
const [activeTabKeySecondary, setActiveTabKeySecondary] = React.useState(10);
|
|
234
|
+
|
|
235
|
+
// Toggle currently active tab
|
|
236
|
+
const handleTabClick = (event, tabIndex) => {
|
|
237
|
+
setActiveTabKey(tabIndex);
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// Toggle currently active secondary tab
|
|
241
|
+
const handleTabClickSecondary = (event, tabIndex) => {
|
|
242
|
+
setActiveTabKeySecondary(tabIndex);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const tabsBreadcrumb = (
|
|
246
|
+
<PageBreadcrumb isWidthLimited>
|
|
247
|
+
<Breadcrumb>
|
|
248
|
+
<BreadcrumbItem to="#">Overview</BreadcrumbItem>
|
|
249
|
+
<BreadcrumbItem to="#">Pods</BreadcrumbItem>
|
|
250
|
+
<BreadcrumbItem to="#" isActive>
|
|
251
|
+
Pod details{' '}
|
|
252
|
+
</BreadcrumbItem>
|
|
253
|
+
</Breadcrumb>
|
|
254
|
+
</PageBreadcrumb>
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
const tabContent = (
|
|
258
|
+
<Flex direction={{ default: 'column' }}>
|
|
259
|
+
<FlexItem spacer={{ default: 'spacerLg' }}>
|
|
260
|
+
<Title headingLevel="h2" size="lg" className="pf-u-mt-sm" id="open-tabs-example-tabs-list-details-title">
|
|
261
|
+
Pod details
|
|
262
|
+
</Title>
|
|
263
|
+
</FlexItem>
|
|
264
|
+
<FlexItem>
|
|
265
|
+
<DescriptionList columnModifier={{ lg: '2Col' }} aria-labelledby="open-tabs-example-tabs-list-details-title">
|
|
266
|
+
<DescriptionListGroup>
|
|
267
|
+
<DescriptionListTerm>Name</DescriptionListTerm>
|
|
268
|
+
<DescriptionListDescription>3scale-control-fccb6ddb9-phyqv9</DescriptionListDescription>
|
|
269
|
+
</DescriptionListGroup>
|
|
270
|
+
<DescriptionListGroup>
|
|
271
|
+
<DescriptionListTerm>Status</DescriptionListTerm>
|
|
272
|
+
<DescriptionListDescription>
|
|
273
|
+
<Flex spacer={{ default: 'spacerLg' }}>
|
|
274
|
+
<FlexItem>
|
|
275
|
+
<CheckCircleIcon />
|
|
276
|
+
</FlexItem>
|
|
277
|
+
<FlexItem>Running</FlexItem>
|
|
278
|
+
</Flex>
|
|
279
|
+
</DescriptionListDescription>
|
|
280
|
+
</DescriptionListGroup>
|
|
281
|
+
<DescriptionListGroup>
|
|
282
|
+
<DescriptionListTerm>Namespace</DescriptionListTerm>
|
|
283
|
+
<DescriptionListDescription>
|
|
284
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
285
|
+
<FlexItem>
|
|
286
|
+
<Label color="cyan">NS</Label>
|
|
287
|
+
</FlexItem>
|
|
288
|
+
<FlexItem>
|
|
289
|
+
<a href="#">knative-serving-ingress</a>
|
|
290
|
+
</FlexItem>
|
|
291
|
+
</Flex>
|
|
292
|
+
</DescriptionListDescription>
|
|
293
|
+
</DescriptionListGroup>
|
|
294
|
+
<DescriptionListGroup>
|
|
295
|
+
<DescriptionListTerm>Restart policy</DescriptionListTerm>
|
|
296
|
+
<DescriptionListDescription>Always restart</DescriptionListDescription>
|
|
297
|
+
</DescriptionListGroup>
|
|
298
|
+
<DescriptionListGroup>
|
|
299
|
+
<DescriptionListTerm>Labels</DescriptionListTerm>
|
|
300
|
+
<DescriptionListDescription>
|
|
301
|
+
<LabelGroup>
|
|
302
|
+
<Label>app=3scale-gateway</Label>
|
|
303
|
+
<Label>pod-template-has=6747686899</Label>
|
|
304
|
+
</LabelGroup>
|
|
305
|
+
</DescriptionListDescription>
|
|
306
|
+
</DescriptionListGroup>
|
|
307
|
+
<DescriptionListGroup>
|
|
308
|
+
<DescriptionListTerm>Active deadline seconds</DescriptionListTerm>
|
|
309
|
+
<DescriptionListDescription>Not configured</DescriptionListDescription>
|
|
310
|
+
</DescriptionListGroup>
|
|
311
|
+
<DescriptionListGroup>
|
|
312
|
+
<DescriptionListTerm>Tolerations</DescriptionListTerm>
|
|
313
|
+
<DescriptionListDescription>stuff</DescriptionListDescription>
|
|
314
|
+
</DescriptionListGroup>
|
|
315
|
+
<DescriptionListGroup>
|
|
316
|
+
<DescriptionListTerm>Pod IP</DescriptionListTerm>
|
|
317
|
+
<DescriptionListDescription>10..345.2.197</DescriptionListDescription>
|
|
318
|
+
</DescriptionListGroup>
|
|
319
|
+
<DescriptionListGroup>
|
|
320
|
+
<DescriptionListTerm>Annotations</DescriptionListTerm>
|
|
321
|
+
<DescriptionListDescription>stuff</DescriptionListDescription>
|
|
322
|
+
</DescriptionListGroup>
|
|
323
|
+
<DescriptionListGroup>
|
|
324
|
+
<DescriptionListTerm>Node</DescriptionListTerm>
|
|
325
|
+
<DescriptionListDescription>
|
|
326
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
327
|
+
<FlexItem>
|
|
328
|
+
<Label color="purple">N</Label>
|
|
329
|
+
</FlexItem>
|
|
330
|
+
<FlexItem>ip-10-0-233-118.us-east-2.computer.external</FlexItem>
|
|
331
|
+
</Flex>
|
|
332
|
+
</DescriptionListDescription>
|
|
333
|
+
</DescriptionListGroup>
|
|
334
|
+
<DescriptionListGroup>
|
|
335
|
+
<DescriptionListTerm>Created at</DescriptionListTerm>
|
|
336
|
+
<DescriptionListDescription>
|
|
337
|
+
<time>Oct 15, 1:51 pm</time>
|
|
338
|
+
</DescriptionListDescription>
|
|
339
|
+
</DescriptionListGroup>
|
|
340
|
+
</DescriptionList>
|
|
341
|
+
</FlexItem>
|
|
342
|
+
</Flex>
|
|
343
|
+
);
|
|
344
|
+
|
|
345
|
+
return (
|
|
346
|
+
<DashboardWrapper hasNoBreadcrumb>
|
|
347
|
+
{tabsBreadcrumb}
|
|
348
|
+
<PageSection isWidthLimited variant={PageSectionVariants.light}>
|
|
349
|
+
<Flex
|
|
350
|
+
spaceItems={{ default: 'spaceItemsMd' }}
|
|
351
|
+
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
352
|
+
flexWrap={{ default: 'noWrap' }}
|
|
353
|
+
>
|
|
354
|
+
<FlexItem>
|
|
355
|
+
<Label color="blue">N</Label>
|
|
356
|
+
</FlexItem>
|
|
357
|
+
<FlexItem>
|
|
358
|
+
<Title headingLevel="h1" size="2xl">
|
|
359
|
+
3scale-control-fccb6ddb9-phyqv9
|
|
360
|
+
</Title>
|
|
361
|
+
</FlexItem>
|
|
362
|
+
<FlexItem flex={{ default: 'flexNone' }}>
|
|
363
|
+
<Label icon={<InfoCircleIcon />}>Running</Label>
|
|
364
|
+
</FlexItem>
|
|
365
|
+
</Flex>
|
|
366
|
+
</PageSection>
|
|
367
|
+
<PageSection type="tabs" variant={PageSectionVariants.light} isWidthLimited>
|
|
368
|
+
<Tabs activeKey={activeTabKey} onSelect={handleTabClick} usePageInsets id="open-tabs-example-tabs-list">
|
|
369
|
+
<Tab eventKey={0} title={<TabTitleText>Details</TabTitleText>} tabContentId={`tabContent${0}`} />
|
|
370
|
+
<Tab eventKey={1} title={<TabTitleText>YAML</TabTitleText>} tabContentId={`tabContent${1}`} />
|
|
371
|
+
<Tab eventKey={2} title={<TabTitleText>Environment</TabTitleText>} tabContentId={`tabContent${2}`} />
|
|
372
|
+
<Tab eventKey={3} title={<TabTitleText>Events</TabTitleText>} tabContentId={`tabContent${3}`} />
|
|
373
|
+
<Tab eventKey={4} title={<TabTitleText>Terminal</TabTitleText>} tabContentId={`tabContent${4}`} />
|
|
374
|
+
</Tabs>
|
|
375
|
+
</PageSection>
|
|
376
|
+
<PageSection isWidthLimited variant={PageSectionVariants.light}>
|
|
377
|
+
<Flex direction={{ default: 'column' }}>
|
|
378
|
+
<FlexItem>
|
|
379
|
+
<TabContent key={0} eventKey={0} id={`tabContent${0}`} activeKey={activeTabKey} hidden={0 !== activeTabKey}>
|
|
380
|
+
<TabContentBody>
|
|
381
|
+
<Tabs
|
|
382
|
+
isSecondary
|
|
383
|
+
activeKey={activeTabKeySecondary}
|
|
384
|
+
onSelect={handleTabClickSecondary}
|
|
385
|
+
inset={{ default: 'insetNone' }}
|
|
386
|
+
id="open-with-secondary-tabs-example-tabs-list-secondary"
|
|
387
|
+
>
|
|
388
|
+
<Tab
|
|
389
|
+
eventKey={10}
|
|
390
|
+
title={<TabTitleText>Pod information</TabTitleText>}
|
|
391
|
+
tabContentId={`tabContent${10}`}
|
|
392
|
+
/>
|
|
393
|
+
<Tab
|
|
394
|
+
eventKey={11}
|
|
395
|
+
title={<TabTitleText>Editable aspects</TabTitleText>}
|
|
396
|
+
tabContentId={`tabContent${11}`}
|
|
397
|
+
/>
|
|
398
|
+
</Tabs>
|
|
399
|
+
<TabContent
|
|
400
|
+
key={10}
|
|
401
|
+
eventKey={10}
|
|
402
|
+
id={`tabContent${10}`}
|
|
403
|
+
activeKey={activeTabKeySecondary}
|
|
404
|
+
hidden={10 !== activeTabKeySecondary}
|
|
405
|
+
>
|
|
406
|
+
<TabContentBody>{tabContent}</TabContentBody>
|
|
407
|
+
</TabContent>
|
|
408
|
+
<TabContent
|
|
409
|
+
key={11}
|
|
410
|
+
eventKey={11}
|
|
411
|
+
id={`tabContent${11}`}
|
|
412
|
+
activeKey={activeTabKeySecondary}
|
|
413
|
+
hidden={11 !== activeTabKeySecondary}
|
|
414
|
+
>
|
|
415
|
+
<TabContentBody>Editable aspects</TabContentBody>
|
|
416
|
+
</TabContent>
|
|
417
|
+
</TabContentBody>
|
|
418
|
+
</TabContent>
|
|
419
|
+
</FlexItem>
|
|
420
|
+
<FlexItem>
|
|
421
|
+
<TabContent key={1} eventKey={1} id={`tabContent${1}`} activeKey={activeTabKey} hidden={1 !== activeTabKey}>
|
|
422
|
+
<TabContentBody>YAML panel</TabContentBody>
|
|
423
|
+
</TabContent>
|
|
424
|
+
<TabContent key={2} eventKey={2} id={`tabContent${2}`} activeKey={activeTabKey} hidden={2 !== activeTabKey}>
|
|
425
|
+
<TabContentBody>Environment panel</TabContentBody>
|
|
426
|
+
</TabContent>
|
|
427
|
+
<TabContent key={3} eventKey={3} id={`tabContent${3}`} activeKey={activeTabKey} hidden={3 !== activeTabKey}>
|
|
428
|
+
<TabContentBody>Events panel</TabContentBody>
|
|
429
|
+
</TabContent>
|
|
430
|
+
<TabContent key={4} eventKey={4} id={`tabContent${4}`} activeKey={activeTabKey} hidden={4 !== activeTabKey}>
|
|
431
|
+
<TabContentBody>Terminal panel</TabContentBody>
|
|
432
|
+
</TabContent>
|
|
433
|
+
</FlexItem>
|
|
434
|
+
</Flex>
|
|
435
|
+
</PageSection>
|
|
436
|
+
</DashboardWrapper>
|
|
437
|
+
);
|
|
438
|
+
};
|
|
439
|
+
```
|
|
@@ -37,7 +37,21 @@ export default class DashboardWrapper extends React.Component {
|
|
|
37
37
|
|
|
38
38
|
render() {
|
|
39
39
|
const { activeItem } = this.state;
|
|
40
|
-
const {
|
|
40
|
+
const {
|
|
41
|
+
children,
|
|
42
|
+
mainContainerId,
|
|
43
|
+
breadcrumb,
|
|
44
|
+
header,
|
|
45
|
+
sidebar,
|
|
46
|
+
sidebarNavOpen,
|
|
47
|
+
onPageResize,
|
|
48
|
+
hasNoBreadcrumb
|
|
49
|
+
} = this.props;
|
|
50
|
+
|
|
51
|
+
let renderedBreadcrumb;
|
|
52
|
+
if (!hasNoBreadcrumb) {
|
|
53
|
+
renderedBreadcrumb = breadcrumb !== undefined ? breadcrumb : DashboardBreadcrumb;
|
|
54
|
+
}
|
|
41
55
|
|
|
42
56
|
const PageNav = (
|
|
43
57
|
<Nav onSelect={this.onNavSelect} aria-label="Nav">
|
|
@@ -74,7 +88,7 @@ export default class DashboardWrapper extends React.Component {
|
|
|
74
88
|
sidebar={sidebar !== undefined ? sidebar : _sidebar}
|
|
75
89
|
isManagedSidebar
|
|
76
90
|
skipToContent={PageSkipToContent}
|
|
77
|
-
breadcrumb={
|
|
91
|
+
breadcrumb={renderedBreadcrumb}
|
|
78
92
|
mainContainerId={mainContainerId ? mainContainerId : 'main-content-page-layout-default-nav'}
|
|
79
93
|
onPageResize={onPageResize}
|
|
80
94
|
>
|