@patternfly/react-core 6.5.0-prerelease.25 → 6.5.0-prerelease.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/AboutModal/package.json +1 -1
- package/dist/dynamic/components/Accordion/package.json +1 -1
- package/dist/dynamic/components/ActionList/package.json +1 -1
- package/dist/dynamic/components/Alert/package.json +1 -1
- package/dist/dynamic/components/Avatar/package.json +1 -1
- package/dist/dynamic/components/BackToTop/package.json +1 -1
- package/dist/dynamic/components/Backdrop/package.json +1 -1
- package/dist/dynamic/components/BackgroundImage/package.json +1 -1
- package/dist/dynamic/components/Badge/package.json +1 -1
- package/dist/dynamic/components/Banner/package.json +1 -1
- package/dist/dynamic/components/Brand/package.json +1 -1
- package/dist/dynamic/components/Breadcrumb/package.json +1 -1
- package/dist/dynamic/components/Button/package.json +1 -1
- package/dist/dynamic/components/CalendarMonth/package.json +1 -1
- package/dist/dynamic/components/Card/package.json +1 -1
- package/dist/dynamic/components/Checkbox/package.json +1 -1
- package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
- package/dist/dynamic/components/CodeBlock/package.json +1 -1
- package/dist/dynamic/components/Compass/package.json +1 -1
- package/dist/dynamic/components/Content/package.json +1 -1
- package/dist/dynamic/components/DataList/package.json +1 -1
- package/dist/dynamic/components/DatePicker/package.json +1 -1
- package/dist/dynamic/components/DescriptionList/package.json +1 -1
- package/dist/dynamic/components/Divider/package.json +1 -1
- package/dist/dynamic/components/Drawer/package.json +1 -1
- package/dist/dynamic/components/Dropdown/package.json +1 -1
- package/dist/dynamic/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/components/EmptyState/package.json +1 -1
- package/dist/dynamic/components/ExpandableSection/package.json +1 -1
- package/dist/dynamic/components/FileUpload/package.json +1 -1
- package/dist/dynamic/components/Form/package.json +1 -1
- package/dist/dynamic/components/FormSelect/package.json +1 -1
- package/dist/dynamic/components/HelperText/package.json +1 -1
- package/dist/dynamic/components/Hero/package.json +1 -1
- package/dist/dynamic/components/Hint/package.json +1 -1
- package/dist/dynamic/components/Icon/package.json +1 -1
- package/dist/dynamic/components/InputGroup/package.json +1 -1
- package/dist/dynamic/components/JumpLinks/package.json +1 -1
- package/dist/dynamic/components/Label/package.json +1 -1
- package/dist/dynamic/components/List/package.json +1 -1
- package/dist/dynamic/components/LoginPage/package.json +1 -1
- package/dist/dynamic/components/Masthead/package.json +1 -1
- package/dist/dynamic/components/Menu/package.json +1 -1
- package/dist/dynamic/components/MenuToggle/package.json +1 -1
- package/dist/dynamic/components/Modal/package.json +1 -1
- package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
- package/dist/dynamic/components/Nav/package.json +1 -1
- package/dist/dynamic/components/NotificationBadge/package.json +1 -1
- package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
- package/dist/dynamic/components/NumberInput/package.json +1 -1
- package/dist/dynamic/components/OverflowMenu/package.json +1 -1
- package/dist/dynamic/components/Page/package.json +1 -1
- package/dist/dynamic/components/Pagination/package.json +1 -1
- package/dist/dynamic/components/Panel/package.json +1 -1
- package/dist/dynamic/components/Popover/package.json +1 -1
- package/dist/dynamic/components/Progress/package.json +1 -1
- package/dist/dynamic/components/ProgressStepper/package.json +1 -1
- package/dist/dynamic/components/Radio/package.json +1 -1
- package/dist/dynamic/components/SearchInput/package.json +1 -1
- package/dist/dynamic/components/Select/package.json +1 -1
- package/dist/dynamic/components/Sidebar/package.json +1 -1
- package/dist/dynamic/components/SimpleList/package.json +1 -1
- package/dist/dynamic/components/Skeleton/package.json +1 -1
- package/dist/dynamic/components/SkipToContent/package.json +1 -1
- package/dist/dynamic/components/Slider/package.json +1 -1
- package/dist/dynamic/components/Spinner/package.json +1 -1
- package/dist/dynamic/components/Switch/package.json +1 -1
- package/dist/dynamic/components/Tabs/package.json +1 -1
- package/dist/dynamic/components/TextArea/package.json +1 -1
- package/dist/dynamic/components/TextInput/package.json +1 -1
- package/dist/dynamic/components/TextInputGroup/package.json +1 -1
- package/dist/dynamic/components/TimePicker/package.json +1 -1
- package/dist/dynamic/components/Timestamp/package.json +1 -1
- package/dist/dynamic/components/Title/package.json +1 -1
- package/dist/dynamic/components/ToggleGroup/package.json +1 -1
- package/dist/dynamic/components/Toolbar/package.json +1 -1
- package/dist/dynamic/components/Tooltip/package.json +1 -1
- package/dist/dynamic/components/TreeView/package.json +1 -1
- package/dist/dynamic/components/Truncate/package.json +1 -1
- package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
- package/dist/dynamic/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/Chip/package.json +1 -1
- package/dist/dynamic/deprecated/components/DragDrop/package.json +1 -1
- package/dist/dynamic/deprecated/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Modal/package.json +1 -1
- package/dist/dynamic/deprecated/components/Tile/package.json +1 -1
- package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/dynamic/helpers/AnimationsProvider/AnimationsProvider/package.json +1 -1
- package/dist/dynamic/helpers/AnimationsProvider/package.json +1 -1
- package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
- package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
- package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
- package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
- package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
- package/dist/dynamic/helpers/constants/package.json +1 -1
- package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
- package/dist/dynamic/helpers/fileUtils/package.json +1 -1
- package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
- package/dist/dynamic/helpers/package.json +1 -1
- package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
- package/dist/dynamic/helpers/typeUtils/package.json +1 -1
- package/dist/dynamic/helpers/useInterval/package.json +1 -1
- package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
- package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
- package/dist/dynamic/helpers/util/package.json +1 -1
- package/dist/dynamic/layouts/Bullseye/package.json +1 -1
- package/dist/dynamic/layouts/Flex/package.json +1 -1
- package/dist/dynamic/layouts/Gallery/package.json +1 -1
- package/dist/dynamic/layouts/Grid/package.json +1 -1
- package/dist/dynamic/layouts/Level/package.json +1 -1
- package/dist/dynamic/layouts/Split/package.json +1 -1
- package/dist/dynamic/layouts/Stack/package.json +1 -1
- package/dist/dynamic/styles/package.json +1 -1
- package/dist/esm/components/Label/Label.js +1 -1
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/js/components/Label/Label.js +1 -1
- package/dist/js/components/Label/Label.js.map +1 -1
- package/dist/umd/assets/{output-ClqppqYH.css → output-BOKd1GXO.css} +19572 -19572
- package/dist/umd/react-core.min.js +1 -1
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +2 -2
- package/src/components/Label/Label.tsx +1 -1
- package/src/demos/Banner.md +2 -139
- package/src/demos/DateTimePicker.md +2 -86
- package/src/demos/JumpLinks.md +2 -129
- package/src/demos/ProgressDemo.md +2 -65
- package/src/demos/ProgressStepperDemo.md +1 -72
- package/src/demos/Tabs.md +6 -417
- package/src/demos/examples/Banner/BannerBasicSticky.tsx +55 -0
- package/src/demos/examples/Banner/BannerTopBottom.tsx +81 -0
- package/src/demos/examples/DateTimePicker/DateTimeRangePicker.tsx +93 -0
- package/src/demos/examples/JumpLinks/JumpLinksScrollspy.tsx +125 -0
- package/src/demos/examples/JumpLinks/{JumpLinksWithDrawer.js → JumpLinksWithDrawer.tsx} +1 -1
- package/src/demos/examples/Progress/ProgressBasic.tsx +32 -0
- package/src/demos/examples/Progress/ProgressWithOnlyIncreasing.tsx +33 -0
- package/src/demos/examples/ProgressStepper/ProgressStepperBasic.tsx +72 -0
- package/src/demos/examples/Tabs/TabsOpen.tsx +185 -0
- package/src/demos/examples/Tabs/TabsOpenWithSecondaryTabs.tsx +228 -0
- package/src/layouts/Gallery/examples/Gallery.md +8 -99
- package/src/layouts/Gallery/examples/GalleryAdjustingMaxWidths.tsx +21 -0
- package/src/layouts/Gallery/examples/GalleryAdjustingMinMaxWidths.tsx +25 -0
- package/src/layouts/Gallery/examples/GalleryAdjustingMinWidths.tsx +22 -0
- package/src/layouts/Gallery/examples/GalleryAlternativeComponents.tsx +11 -0
- package/src/layouts/Gallery/examples/GalleryBasic.tsx +14 -0
- package/src/layouts/Gallery/examples/GalleryWithGutters.tsx +12 -0
package/src/demos/Tabs.md
CHANGED
|
@@ -21,447 +21,36 @@ import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/Dashboard
|
|
|
21
21
|
|
|
22
22
|
### Open tabs
|
|
23
23
|
|
|
24
|
-
```
|
|
25
|
-
import { useState } from 'react';
|
|
26
|
-
import {
|
|
27
|
-
PageSection,
|
|
28
|
-
PageBreadcrumb,
|
|
29
|
-
Breadcrumb,
|
|
30
|
-
BreadcrumbItem,
|
|
31
|
-
Tabs,
|
|
32
|
-
Tab,
|
|
33
|
-
TabContent,
|
|
34
|
-
TabContentBody,
|
|
35
|
-
TabTitleText,
|
|
36
|
-
Title,
|
|
37
|
-
DescriptionList,
|
|
38
|
-
DescriptionListGroup,
|
|
39
|
-
DescriptionListTerm,
|
|
40
|
-
DescriptionListDescription,
|
|
41
|
-
Label,
|
|
42
|
-
LabelGroup,
|
|
43
|
-
Flex,
|
|
44
|
-
FlexItem
|
|
45
|
-
} from '@patternfly/react-core';
|
|
46
|
-
import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
|
|
47
|
-
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
48
|
-
import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
|
|
49
|
-
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
|
|
50
|
-
|
|
51
|
-
TabsOpenDemo = () => {
|
|
52
|
-
const [activeTabKey, setActiveTabKey] = useState(0);
|
|
24
|
+
```ts file="examples/Tabs/TabsOpen.tsx" isFullscreen
|
|
53
25
|
|
|
54
|
-
// Toggle currently active tab
|
|
55
|
-
const handleTabClick = (event, tabIndex) => {
|
|
56
|
-
setActiveTabKey(tabIndex);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const tabsBreadcrumb = (
|
|
60
|
-
<PageBreadcrumb isWidthLimited>
|
|
61
|
-
<Breadcrumb>
|
|
62
|
-
<BreadcrumbItem to="#">Overview</BreadcrumbItem>
|
|
63
|
-
<BreadcrumbItem to="#">Pods</BreadcrumbItem>
|
|
64
|
-
<BreadcrumbItem to="#" isActive>
|
|
65
|
-
Pod details{' '}
|
|
66
|
-
</BreadcrumbItem>
|
|
67
|
-
</Breadcrumb>
|
|
68
|
-
</PageBreadcrumb>
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const tabContent = (
|
|
72
|
-
<Flex direction={{ default: 'column' }}>
|
|
73
|
-
<FlexItem spacer={{ default: 'spacerLg' }}>
|
|
74
|
-
<Title headingLevel="h2" size="lg" className={spacing.mtSm} id="open-tabs-example-tabs-list-details-title">
|
|
75
|
-
Pod details
|
|
76
|
-
</Title>
|
|
77
|
-
</FlexItem>
|
|
78
|
-
<FlexItem>
|
|
79
|
-
<DescriptionList columnModifier={{ lg: '2Col' }} aria-labelledby="open-tabs-example-tabs-list-details-title">
|
|
80
|
-
<DescriptionListGroup>
|
|
81
|
-
<DescriptionListTerm>Name</DescriptionListTerm>
|
|
82
|
-
<DescriptionListDescription>3scale-control-fccb6ddb9-phyqv9</DescriptionListDescription>
|
|
83
|
-
</DescriptionListGroup>
|
|
84
|
-
<DescriptionListGroup>
|
|
85
|
-
<DescriptionListTerm>Status</DescriptionListTerm>
|
|
86
|
-
<DescriptionListDescription>
|
|
87
|
-
<Flex spacer={{ default: 'spacerLg' }}>
|
|
88
|
-
<FlexItem>
|
|
89
|
-
<CheckCircleIcon />
|
|
90
|
-
</FlexItem>
|
|
91
|
-
<FlexItem>Running</FlexItem>
|
|
92
|
-
</Flex>
|
|
93
|
-
</DescriptionListDescription>
|
|
94
|
-
</DescriptionListGroup>
|
|
95
|
-
<DescriptionListGroup>
|
|
96
|
-
<DescriptionListTerm>Namespace</DescriptionListTerm>
|
|
97
|
-
<DescriptionListDescription>
|
|
98
|
-
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
99
|
-
<FlexItem>
|
|
100
|
-
<Label color="teal">NS</Label>
|
|
101
|
-
</FlexItem>
|
|
102
|
-
<FlexItem>
|
|
103
|
-
<a href="#">knative-serving-ingress</a>
|
|
104
|
-
</FlexItem>
|
|
105
|
-
</Flex>
|
|
106
|
-
</DescriptionListDescription>
|
|
107
|
-
</DescriptionListGroup>
|
|
108
|
-
<DescriptionListGroup>
|
|
109
|
-
<DescriptionListTerm>Restart policy</DescriptionListTerm>
|
|
110
|
-
<DescriptionListDescription>Always restart</DescriptionListDescription>
|
|
111
|
-
</DescriptionListGroup>
|
|
112
|
-
<DescriptionListGroup>
|
|
113
|
-
<DescriptionListTerm>Labels</DescriptionListTerm>
|
|
114
|
-
<DescriptionListDescription>
|
|
115
|
-
<LabelGroup>
|
|
116
|
-
<Label>app=3scale-gateway</Label>
|
|
117
|
-
<Label>pod-template-has=6747686899</Label>
|
|
118
|
-
</LabelGroup>
|
|
119
|
-
</DescriptionListDescription>
|
|
120
|
-
</DescriptionListGroup>
|
|
121
|
-
<DescriptionListGroup>
|
|
122
|
-
<DescriptionListTerm>Active deadline seconds</DescriptionListTerm>
|
|
123
|
-
<DescriptionListDescription>Not configured</DescriptionListDescription>
|
|
124
|
-
</DescriptionListGroup>
|
|
125
|
-
<DescriptionListGroup>
|
|
126
|
-
<DescriptionListTerm>Tolerations</DescriptionListTerm>
|
|
127
|
-
<DescriptionListDescription>stuff</DescriptionListDescription>
|
|
128
|
-
</DescriptionListGroup>
|
|
129
|
-
<DescriptionListGroup>
|
|
130
|
-
<DescriptionListTerm>Pod IP</DescriptionListTerm>
|
|
131
|
-
<DescriptionListDescription>10..345.2.197</DescriptionListDescription>
|
|
132
|
-
</DescriptionListGroup>
|
|
133
|
-
<DescriptionListGroup>
|
|
134
|
-
<DescriptionListTerm>Annotations</DescriptionListTerm>
|
|
135
|
-
<DescriptionListDescription>stuff</DescriptionListDescription>
|
|
136
|
-
</DescriptionListGroup>
|
|
137
|
-
<DescriptionListGroup>
|
|
138
|
-
<DescriptionListTerm>Node</DescriptionListTerm>
|
|
139
|
-
<DescriptionListDescription>
|
|
140
|
-
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
141
|
-
<FlexItem>
|
|
142
|
-
<Label color="purple">N</Label>
|
|
143
|
-
</FlexItem>
|
|
144
|
-
<FlexItem>ip-10-0-233-118.us-east-2.computer.external</FlexItem>
|
|
145
|
-
</Flex>
|
|
146
|
-
</DescriptionListDescription>
|
|
147
|
-
</DescriptionListGroup>
|
|
148
|
-
<DescriptionListGroup>
|
|
149
|
-
<DescriptionListTerm>Created at</DescriptionListTerm>
|
|
150
|
-
<DescriptionListDescription>
|
|
151
|
-
<time>Oct 15, 1:51 pm</time>
|
|
152
|
-
</DescriptionListDescription>
|
|
153
|
-
</DescriptionListGroup>
|
|
154
|
-
</DescriptionList>
|
|
155
|
-
</FlexItem>
|
|
156
|
-
</Flex>
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
return (
|
|
160
|
-
<DashboardWrapper hasNoBreadcrumb>
|
|
161
|
-
{tabsBreadcrumb}
|
|
162
|
-
<PageSection isWidthLimited aria-label='Pod header'>
|
|
163
|
-
<Flex
|
|
164
|
-
spaceItems={{ default: 'spaceItemsMd' }}
|
|
165
|
-
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
166
|
-
flexWrap={{ default: 'noWrap' }}
|
|
167
|
-
>
|
|
168
|
-
<FlexItem>
|
|
169
|
-
<Label color="blue">N</Label>
|
|
170
|
-
</FlexItem>
|
|
171
|
-
<FlexItem>
|
|
172
|
-
<Title headingLevel="h1" size="2xl">
|
|
173
|
-
3scale-control-fccb6ddb9-phyqv9
|
|
174
|
-
</Title>
|
|
175
|
-
</FlexItem>
|
|
176
|
-
<FlexItem flex={{ default: 'flexNone' }}>
|
|
177
|
-
<Label icon={<InfoCircleIcon />}>Running</Label>
|
|
178
|
-
</FlexItem>
|
|
179
|
-
</Flex>
|
|
180
|
-
</PageSection>
|
|
181
|
-
<PageSection type="tabs" isWidthLimited aria-label='Pod navigation tabs'>
|
|
182
|
-
<Tabs activeKey={activeTabKey} onSelect={handleTabClick} usePageInsets id="open-tabs-example-tabs-list">
|
|
183
|
-
<Tab eventKey={0} title={<TabTitleText>Details</TabTitleText>} tabContentId={`tabContent${0}`} />
|
|
184
|
-
<Tab eventKey={1} title={<TabTitleText>YAML</TabTitleText>} tabContentId={`tabContent${1}`} />
|
|
185
|
-
<Tab eventKey={2} title={<TabTitleText>Environment</TabTitleText>} tabContentId={`tabContent${2}`} />
|
|
186
|
-
<Tab eventKey={3} title={<TabTitleText>Events</TabTitleText>} tabContentId={`tabContent${3}`} />
|
|
187
|
-
<Tab eventKey={4} title={<TabTitleText>Terminal</TabTitleText>} tabContentId={`tabContent${4}`} />
|
|
188
|
-
</Tabs>
|
|
189
|
-
</PageSection>
|
|
190
|
-
<PageSection isWidthLimited aria-label='Pod content'>
|
|
191
|
-
<TabContent key={0} eventKey={0} id={`tabContent${0}`} activeKey={activeTabKey} hidden={0 !== activeTabKey}>
|
|
192
|
-
<TabContentBody>{tabContent}</TabContentBody>
|
|
193
|
-
</TabContent>
|
|
194
|
-
<TabContent key={1} eventKey={1} id={`tabContent${1}`} activeKey={activeTabKey} hidden={1 !== activeTabKey}>
|
|
195
|
-
<TabContentBody>YAML panel</TabContentBody>
|
|
196
|
-
</TabContent>
|
|
197
|
-
<TabContent key={2} eventKey={2} id={`tabContent${2}`} activeKey={activeTabKey} hidden={2 !== activeTabKey}>
|
|
198
|
-
<TabContentBody>Environment panel</TabContentBody>
|
|
199
|
-
</TabContent>
|
|
200
|
-
<TabContent key={3} eventKey={3} id={`tabContent${3}`} activeKey={activeTabKey} hidden={3 !== activeTabKey}>
|
|
201
|
-
<TabContentBody>Events panel</TabContentBody>
|
|
202
|
-
</TabContent>
|
|
203
|
-
<TabContent key={4} eventKey={4} id={`tabContent${4}`} activeKey={activeTabKey} hidden={4 !== activeTabKey}>
|
|
204
|
-
<TabContentBody>Terminal panel</TabContentBody>
|
|
205
|
-
</TabContent>
|
|
206
|
-
</PageSection>
|
|
207
|
-
</DashboardWrapper>
|
|
208
|
-
);
|
|
209
|
-
};
|
|
210
26
|
```
|
|
211
27
|
|
|
212
28
|
### Open tabs with secondary tabs
|
|
213
29
|
|
|
214
|
-
```
|
|
215
|
-
import { useState } from 'react';
|
|
216
|
-
import {
|
|
217
|
-
PageSection,
|
|
218
|
-
PageBreadcrumb,
|
|
219
|
-
Breadcrumb,
|
|
220
|
-
BreadcrumbItem,
|
|
221
|
-
Tabs,
|
|
222
|
-
Tab,
|
|
223
|
-
TabContent,
|
|
224
|
-
TabContentBody,
|
|
225
|
-
TabTitleText,
|
|
226
|
-
Title,
|
|
227
|
-
DescriptionList,
|
|
228
|
-
DescriptionListGroup,
|
|
229
|
-
DescriptionListTerm,
|
|
230
|
-
DescriptionListDescription,
|
|
231
|
-
Label,
|
|
232
|
-
LabelGroup,
|
|
233
|
-
Flex,
|
|
234
|
-
FlexItem
|
|
235
|
-
} from '@patternfly/react-core';
|
|
236
|
-
import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
|
|
237
|
-
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
238
|
-
import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
|
|
239
|
-
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
|
|
240
|
-
|
|
241
|
-
TabsOpenWithSecondaryTabsDemo = () => {
|
|
242
|
-
const [activeTabKey, setActiveTabKey] = useState(0);
|
|
243
|
-
const [activeTabKeySecondary, setActiveTabKeySecondary] = useState(10);
|
|
244
|
-
|
|
245
|
-
// Toggle currently active tab
|
|
246
|
-
const handleTabClick = (event, tabIndex) => {
|
|
247
|
-
setActiveTabKey(tabIndex);
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
// Toggle currently active secondary tab
|
|
251
|
-
const handleTabClickSecondary = (event, tabIndex) => {
|
|
252
|
-
setActiveTabKeySecondary(tabIndex);
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
const tabsBreadcrumb = (
|
|
256
|
-
<PageBreadcrumb isWidthLimited>
|
|
257
|
-
<Breadcrumb>
|
|
258
|
-
<BreadcrumbItem to="#">Overview</BreadcrumbItem>
|
|
259
|
-
<BreadcrumbItem to="#">Pods</BreadcrumbItem>
|
|
260
|
-
<BreadcrumbItem to="#" isActive>
|
|
261
|
-
Pod details{' '}
|
|
262
|
-
</BreadcrumbItem>
|
|
263
|
-
</Breadcrumb>
|
|
264
|
-
</PageBreadcrumb>
|
|
265
|
-
);
|
|
266
|
-
|
|
267
|
-
const tabContent = (
|
|
268
|
-
<Flex direction={{ default: 'column' }}>
|
|
269
|
-
<FlexItem spacer={{ default: 'spacerLg' }}>
|
|
270
|
-
<Title headingLevel="h2" size="lg" className={spacing.mtSm} id="open-tabs-example-tabs-list-details-title">
|
|
271
|
-
Pod details
|
|
272
|
-
</Title>
|
|
273
|
-
</FlexItem>
|
|
274
|
-
<FlexItem>
|
|
275
|
-
<DescriptionList columnModifier={{ lg: '2Col' }} aria-labelledby="open-tabs-example-tabs-list-details-title">
|
|
276
|
-
<DescriptionListGroup>
|
|
277
|
-
<DescriptionListTerm>Name</DescriptionListTerm>
|
|
278
|
-
<DescriptionListDescription>3scale-control-fccb6ddb9-phyqv9</DescriptionListDescription>
|
|
279
|
-
</DescriptionListGroup>
|
|
280
|
-
<DescriptionListGroup>
|
|
281
|
-
<DescriptionListTerm>Status</DescriptionListTerm>
|
|
282
|
-
<DescriptionListDescription>
|
|
283
|
-
<Flex spacer={{ default: 'spacerLg' }}>
|
|
284
|
-
<FlexItem>
|
|
285
|
-
<CheckCircleIcon />
|
|
286
|
-
</FlexItem>
|
|
287
|
-
<FlexItem>Running</FlexItem>
|
|
288
|
-
</Flex>
|
|
289
|
-
</DescriptionListDescription>
|
|
290
|
-
</DescriptionListGroup>
|
|
291
|
-
<DescriptionListGroup>
|
|
292
|
-
<DescriptionListTerm>Namespace</DescriptionListTerm>
|
|
293
|
-
<DescriptionListDescription>
|
|
294
|
-
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
295
|
-
<FlexItem>
|
|
296
|
-
<Label color="teal">NS</Label>
|
|
297
|
-
</FlexItem>
|
|
298
|
-
<FlexItem>
|
|
299
|
-
<a href="#">knative-serving-ingress</a>
|
|
300
|
-
</FlexItem>
|
|
301
|
-
</Flex>
|
|
302
|
-
</DescriptionListDescription>
|
|
303
|
-
</DescriptionListGroup>
|
|
304
|
-
<DescriptionListGroup>
|
|
305
|
-
<DescriptionListTerm>Restart policy</DescriptionListTerm>
|
|
306
|
-
<DescriptionListDescription>Always restart</DescriptionListDescription>
|
|
307
|
-
</DescriptionListGroup>
|
|
308
|
-
<DescriptionListGroup>
|
|
309
|
-
<DescriptionListTerm>Labels</DescriptionListTerm>
|
|
310
|
-
<DescriptionListDescription>
|
|
311
|
-
<LabelGroup>
|
|
312
|
-
<Label>app=3scale-gateway</Label>
|
|
313
|
-
<Label>pod-template-has=6747686899</Label>
|
|
314
|
-
</LabelGroup>
|
|
315
|
-
</DescriptionListDescription>
|
|
316
|
-
</DescriptionListGroup>
|
|
317
|
-
<DescriptionListGroup>
|
|
318
|
-
<DescriptionListTerm>Active deadline seconds</DescriptionListTerm>
|
|
319
|
-
<DescriptionListDescription>Not configured</DescriptionListDescription>
|
|
320
|
-
</DescriptionListGroup>
|
|
321
|
-
<DescriptionListGroup>
|
|
322
|
-
<DescriptionListTerm>Tolerations</DescriptionListTerm>
|
|
323
|
-
<DescriptionListDescription>stuff</DescriptionListDescription>
|
|
324
|
-
</DescriptionListGroup>
|
|
325
|
-
<DescriptionListGroup>
|
|
326
|
-
<DescriptionListTerm>Pod IP</DescriptionListTerm>
|
|
327
|
-
<DescriptionListDescription>10..345.2.197</DescriptionListDescription>
|
|
328
|
-
</DescriptionListGroup>
|
|
329
|
-
<DescriptionListGroup>
|
|
330
|
-
<DescriptionListTerm>Annotations</DescriptionListTerm>
|
|
331
|
-
<DescriptionListDescription>stuff</DescriptionListDescription>
|
|
332
|
-
</DescriptionListGroup>
|
|
333
|
-
<DescriptionListGroup>
|
|
334
|
-
<DescriptionListTerm>Node</DescriptionListTerm>
|
|
335
|
-
<DescriptionListDescription>
|
|
336
|
-
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
337
|
-
<FlexItem>
|
|
338
|
-
<Label color="purple">N</Label>
|
|
339
|
-
</FlexItem>
|
|
340
|
-
<FlexItem>ip-10-0-233-118.us-east-2.computer.external</FlexItem>
|
|
341
|
-
</Flex>
|
|
342
|
-
</DescriptionListDescription>
|
|
343
|
-
</DescriptionListGroup>
|
|
344
|
-
<DescriptionListGroup>
|
|
345
|
-
<DescriptionListTerm>Created at</DescriptionListTerm>
|
|
346
|
-
<DescriptionListDescription>
|
|
347
|
-
<time>Oct 15, 1:51 pm</time>
|
|
348
|
-
</DescriptionListDescription>
|
|
349
|
-
</DescriptionListGroup>
|
|
350
|
-
</DescriptionList>
|
|
351
|
-
</FlexItem>
|
|
352
|
-
</Flex>
|
|
353
|
-
);
|
|
30
|
+
```ts file="examples/Tabs/TabsOpenWithSecondaryTabs.tsx" isFullscreen
|
|
354
31
|
|
|
355
|
-
return (
|
|
356
|
-
<DashboardWrapper hasNoBreadcrumb>
|
|
357
|
-
{tabsBreadcrumb}
|
|
358
|
-
<PageSection isWidthLimited aria-label='Pod header'>
|
|
359
|
-
<Flex
|
|
360
|
-
spaceItems={{ default: 'spaceItemsMd' }}
|
|
361
|
-
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
362
|
-
flexWrap={{ default: 'noWrap' }}
|
|
363
|
-
>
|
|
364
|
-
<FlexItem>
|
|
365
|
-
<Label color="blue">N</Label>
|
|
366
|
-
</FlexItem>
|
|
367
|
-
<FlexItem>
|
|
368
|
-
<Title headingLevel="h1" size="2xl">
|
|
369
|
-
3scale-control-fccb6ddb9-phyqv9
|
|
370
|
-
</Title>
|
|
371
|
-
</FlexItem>
|
|
372
|
-
<FlexItem flex={{ default: 'flexNone' }}>
|
|
373
|
-
<Label icon={<InfoCircleIcon />}>Running</Label>
|
|
374
|
-
</FlexItem>
|
|
375
|
-
</Flex>
|
|
376
|
-
</PageSection>
|
|
377
|
-
<PageSection type="tabs" isWidthLimited aria-label='Pod navigation tabs'>
|
|
378
|
-
<Tabs activeKey={activeTabKey} onSelect={handleTabClick} usePageInsets id="open-tabs-example-tabs-list">
|
|
379
|
-
<Tab eventKey={0} title={<TabTitleText>Details</TabTitleText>} tabContentId={`tabContent${0}`} />
|
|
380
|
-
<Tab eventKey={1} title={<TabTitleText>YAML</TabTitleText>} tabContentId={`tabContent${1}`} />
|
|
381
|
-
<Tab eventKey={2} title={<TabTitleText>Environment</TabTitleText>} tabContentId={`tabContent${2}`} />
|
|
382
|
-
<Tab eventKey={3} title={<TabTitleText>Events</TabTitleText>} tabContentId={`tabContent${3}`} />
|
|
383
|
-
<Tab eventKey={4} title={<TabTitleText>Terminal</TabTitleText>} tabContentId={`tabContent${4}`} />
|
|
384
|
-
</Tabs>
|
|
385
|
-
</PageSection>
|
|
386
|
-
<PageSection isWidthLimited padding={{ default: 'noPadding' }} aria-label='Pod content'>
|
|
387
|
-
<TabContent key={0} eventKey={0} id={`tabContent${0}`} activeKey={activeTabKey} hidden={0 !== activeTabKey}>
|
|
388
|
-
<TabContentBody>
|
|
389
|
-
<Tabs
|
|
390
|
-
isSecondary
|
|
391
|
-
activeKey={activeTabKeySecondary}
|
|
392
|
-
onSelect={handleTabClickSecondary}
|
|
393
|
-
usePageInsets
|
|
394
|
-
id="open-with-secondary-tabs-example-tabs-list-secondary"
|
|
395
|
-
>
|
|
396
|
-
<Tab
|
|
397
|
-
eventKey={10}
|
|
398
|
-
title={<TabTitleText>Pod information</TabTitleText>}
|
|
399
|
-
tabContentId={`tabContent${10}`}
|
|
400
|
-
/>
|
|
401
|
-
<Tab
|
|
402
|
-
eventKey={11}
|
|
403
|
-
title={<TabTitleText>Editable aspects</TabTitleText>}
|
|
404
|
-
tabContentId={`tabContent${11}`}
|
|
405
|
-
/>
|
|
406
|
-
</Tabs>
|
|
407
|
-
<TabContent
|
|
408
|
-
key={10}
|
|
409
|
-
eventKey={10}
|
|
410
|
-
id={`tabContent${10}`}
|
|
411
|
-
activeKey={activeTabKeySecondary}
|
|
412
|
-
hidden={10 !== activeTabKeySecondary}
|
|
413
|
-
>
|
|
414
|
-
<TabContentBody hasPadding>{tabContent}</TabContentBody>
|
|
415
|
-
</TabContent>
|
|
416
|
-
<TabContent
|
|
417
|
-
key={11}
|
|
418
|
-
eventKey={11}
|
|
419
|
-
id={`tabContent${11}`}
|
|
420
|
-
activeKey={activeTabKeySecondary}
|
|
421
|
-
hidden={11 !== activeTabKeySecondary}
|
|
422
|
-
>
|
|
423
|
-
<TabContentBody>Editable aspects</TabContentBody>
|
|
424
|
-
</TabContent>
|
|
425
|
-
</TabContentBody>
|
|
426
|
-
</TabContent>
|
|
427
|
-
<TabContent key={1} eventKey={1} id={`tabContent${1}`} activeKey={activeTabKey} hidden={1 !== activeTabKey}>
|
|
428
|
-
<TabContentBody>YAML panel</TabContentBody>
|
|
429
|
-
</TabContent>
|
|
430
|
-
<TabContent key={2} eventKey={2} id={`tabContent${2}`} activeKey={activeTabKey} hidden={2 !== activeTabKey}>
|
|
431
|
-
<TabContentBody>Environment panel</TabContentBody>
|
|
432
|
-
</TabContent>
|
|
433
|
-
<TabContent key={3} eventKey={3} id={`tabContent${3}`} activeKey={activeTabKey} hidden={3 !== activeTabKey}>
|
|
434
|
-
<TabContentBody>Events panel</TabContentBody>
|
|
435
|
-
</TabContent>
|
|
436
|
-
<TabContent key={4} eventKey={4} id={`tabContent${4}`} activeKey={activeTabKey} hidden={4 !== activeTabKey}>
|
|
437
|
-
<TabContentBody>Terminal panel</TabContentBody>
|
|
438
|
-
</TabContent>
|
|
439
|
-
</PageSection>
|
|
440
|
-
</DashboardWrapper>
|
|
441
|
-
);
|
|
442
|
-
};
|
|
443
32
|
```
|
|
444
33
|
|
|
445
34
|
### Nested tabs
|
|
446
35
|
|
|
447
|
-
```
|
|
36
|
+
```ts isFullscreen file="examples/Tabs/NestedTabs.tsx"
|
|
448
37
|
|
|
449
38
|
```
|
|
450
39
|
|
|
451
40
|
### Nested, unindented tabs
|
|
452
41
|
|
|
453
|
-
```
|
|
42
|
+
```ts isFullscreen file="examples/Tabs/NestedUnindentedTabs.tsx"
|
|
454
43
|
|
|
455
44
|
```
|
|
456
45
|
|
|
457
46
|
### Tables and tabs
|
|
458
47
|
|
|
459
|
-
```
|
|
48
|
+
```ts isFullscreen file="examples/Tabs/TabsAndTable.tsx"
|
|
460
49
|
|
|
461
50
|
```
|
|
462
51
|
|
|
463
52
|
### Modal tabs
|
|
464
53
|
|
|
465
|
-
```
|
|
54
|
+
```ts isFullscreen file="examples/Tabs/ModalTabs.tsx"
|
|
466
55
|
|
|
467
56
|
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { Banner, Card, CardBody, Flex, Gallery, GalleryItem, PageSection, Content } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
|
|
5
|
+
import { css } from '@patternfly/react-styles';
|
|
6
|
+
import display from '@patternfly/react-styles/css/utilities/Display/display';
|
|
7
|
+
|
|
8
|
+
export const BannerBasicSticky: React.FunctionComponent = () => {
|
|
9
|
+
const banner = (
|
|
10
|
+
<Banner isSticky>
|
|
11
|
+
<Flex
|
|
12
|
+
justifyContent={{ default: 'justifyContentCenter', lg: 'justifyContentSpaceBetween' }}
|
|
13
|
+
flexWrap={{ default: 'nowrap' }}
|
|
14
|
+
>
|
|
15
|
+
<div className={css(display.displayNone, display.displayBlockOnLg)}>Localhost</div>
|
|
16
|
+
|
|
17
|
+
<div className={css(display.displayNone, display.displayBlockOnLg)}>
|
|
18
|
+
This message is sticky to the top of the page.
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div className={css(display.displayNoneOnLg)}>Drop some text on mobile, truncate if needed.</div>
|
|
22
|
+
|
|
23
|
+
<div className={css(display.displayNone, display.displayBlockOnLg)}>Ned Username</div>
|
|
24
|
+
</Flex>
|
|
25
|
+
</Banner>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Fragment>
|
|
30
|
+
<DashboardWrapper banner={banner} breadcrumb={null}>
|
|
31
|
+
<PageSection aria-labelledby="main-title">
|
|
32
|
+
<Content>
|
|
33
|
+
<h1 id="main-title">Main title</h1>
|
|
34
|
+
<p>
|
|
35
|
+
Body text should be Red Hat Text at 1rem (16px). It should have leading of 1.5rem (24px) because <br />
|
|
36
|
+
of its relative line height of 1.5.
|
|
37
|
+
</p>
|
|
38
|
+
</Content>
|
|
39
|
+
</PageSection>
|
|
40
|
+
|
|
41
|
+
<PageSection aria-label="Cards gallery">
|
|
42
|
+
<Gallery hasGutter>
|
|
43
|
+
{Array.from({ length: 30 }).map((_value, index) => (
|
|
44
|
+
<GalleryItem key={index}>
|
|
45
|
+
<Card>
|
|
46
|
+
<CardBody>This is a card</CardBody>
|
|
47
|
+
</Card>
|
|
48
|
+
</GalleryItem>
|
|
49
|
+
))}
|
|
50
|
+
</Gallery>
|
|
51
|
+
</PageSection>
|
|
52
|
+
</DashboardWrapper>
|
|
53
|
+
</Fragment>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Banner,
|
|
4
|
+
Card,
|
|
5
|
+
CardBody,
|
|
6
|
+
Flex,
|
|
7
|
+
FlexItem,
|
|
8
|
+
Gallery,
|
|
9
|
+
GalleryItem,
|
|
10
|
+
PageSection,
|
|
11
|
+
Content
|
|
12
|
+
} from '@patternfly/react-core';
|
|
13
|
+
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
|
|
14
|
+
import { css } from '@patternfly/react-styles';
|
|
15
|
+
import display from '@patternfly/react-styles/css/utilities/Display/display';
|
|
16
|
+
|
|
17
|
+
export const BannerTopBottom: React.FunctionComponent = () => (
|
|
18
|
+
<Fragment>
|
|
19
|
+
<Flex
|
|
20
|
+
direction={{ default: 'column' }}
|
|
21
|
+
flexWrap={{ default: 'nowrap' }}
|
|
22
|
+
spaceItems={{ default: 'spaceItemsNone' }}
|
|
23
|
+
style={{ height: '100%' }}
|
|
24
|
+
>
|
|
25
|
+
<FlexItem>
|
|
26
|
+
<Banner isSticky>
|
|
27
|
+
<Flex
|
|
28
|
+
justifyContent={{ default: 'justifyContentCenter', lg: 'justifyContentSpaceBetween' }}
|
|
29
|
+
flexWrap={{ default: 'nowrap' }}
|
|
30
|
+
>
|
|
31
|
+
<div className={css(display.displayNone, display.displayBlockOnLg)}>Localhost</div>
|
|
32
|
+
<div className={css(display.displayNone, display.displayBlockOnLg)}>
|
|
33
|
+
This message is sticky to the top of the page.
|
|
34
|
+
</div>
|
|
35
|
+
<div className={css(display.displayNoneOnLg)}>Drop some text on mobile, truncate if needed.</div>
|
|
36
|
+
<div className={css(display.displayNone, display.displayBlockOnLg)}>Ned Username</div>
|
|
37
|
+
</Flex>
|
|
38
|
+
</Banner>
|
|
39
|
+
</FlexItem>
|
|
40
|
+
<FlexItem grow={{ default: 'grow' }} style={{ minHeight: 0 }}>
|
|
41
|
+
<DashboardWrapper breadcrumb={null}>
|
|
42
|
+
<PageSection aria-labelledby="main-title">
|
|
43
|
+
<Content>
|
|
44
|
+
<h1 id="main-title">Main title</h1>
|
|
45
|
+
<p>
|
|
46
|
+
Body text should be Red Hat Text at 1rem (16px). It should have leading of 1.5rem(24px) because <br />
|
|
47
|
+
of it's relative line height of 1.5.
|
|
48
|
+
</p>
|
|
49
|
+
</Content>
|
|
50
|
+
</PageSection>
|
|
51
|
+
<PageSection aria-label="Cards gallery">
|
|
52
|
+
<Gallery hasGutter>
|
|
53
|
+
{Array.from({ length: 30 }).map((_value, index) => (
|
|
54
|
+
<GalleryItem key={index}>
|
|
55
|
+
<Card key={index}>
|
|
56
|
+
<CardBody>This is a card</CardBody>
|
|
57
|
+
</Card>
|
|
58
|
+
</GalleryItem>
|
|
59
|
+
))}
|
|
60
|
+
</Gallery>
|
|
61
|
+
</PageSection>
|
|
62
|
+
</DashboardWrapper>
|
|
63
|
+
</FlexItem>
|
|
64
|
+
<FlexItem>
|
|
65
|
+
<Banner isSticky>
|
|
66
|
+
<Flex
|
|
67
|
+
justifyContent={{ default: 'justifyContentCenter', lg: 'justifyContentSpaceBetween' }}
|
|
68
|
+
flexWrap={{ default: 'nowrap' }}
|
|
69
|
+
>
|
|
70
|
+
<div className={css(display.displayNone, display.displayBlockOnLg)}>Localhost</div>
|
|
71
|
+
<div className={css(display.displayNone, display.displayBlockOnLg)}>
|
|
72
|
+
This message is sticky to the bottom of the page.
|
|
73
|
+
</div>
|
|
74
|
+
<div className={css(display.displayNoneOnLg)}>Drop some text on mobile, truncate if needed.</div>
|
|
75
|
+
<div className={css(display.displayNone, display.displayBlockOnLg)}>Ned Username</div>
|
|
76
|
+
</Flex>
|
|
77
|
+
</Banner>
|
|
78
|
+
</FlexItem>
|
|
79
|
+
</Flex>
|
|
80
|
+
</Fragment>
|
|
81
|
+
);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Flex,
|
|
4
|
+
FlexItem,
|
|
5
|
+
InputGroup,
|
|
6
|
+
InputGroupItem,
|
|
7
|
+
DatePicker,
|
|
8
|
+
isValidDate,
|
|
9
|
+
TimePicker,
|
|
10
|
+
yyyyMMddFormat
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
|
|
13
|
+
export const DateTimeRangePicker: React.FunctionComponent = () => {
|
|
14
|
+
const [from, setFrom] = useState<Date | undefined>(undefined);
|
|
15
|
+
const [to, setTo] = useState<Date | undefined>(undefined);
|
|
16
|
+
|
|
17
|
+
const toValidator = (date: Date) =>
|
|
18
|
+
isValidDate(from) && yyyyMMddFormat(date) >= yyyyMMddFormat(from)
|
|
19
|
+
? ''
|
|
20
|
+
: 'The "to" date must be after the "from" date';
|
|
21
|
+
|
|
22
|
+
const onFromDateChange = (_event: React.FormEvent<HTMLInputElement>, inputDate: string, newFromDate: Date) => {
|
|
23
|
+
if (isValidDate(from) && isValidDate(newFromDate) && inputDate === yyyyMMddFormat(newFromDate)) {
|
|
24
|
+
newFromDate.setHours(from.getHours());
|
|
25
|
+
newFromDate.setMinutes(from.getMinutes());
|
|
26
|
+
}
|
|
27
|
+
if (isValidDate(newFromDate) && inputDate === yyyyMMddFormat(newFromDate)) {
|
|
28
|
+
setFrom(new Date(newFromDate));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const onFromTimeChange = (_event: React.FormEvent<HTMLInputElement>, _time: string, hour: number, minute: number) => {
|
|
33
|
+
if (isValidDate(from)) {
|
|
34
|
+
const updatedFromDate = new Date(from);
|
|
35
|
+
updatedFromDate.setHours(hour);
|
|
36
|
+
updatedFromDate.setMinutes(minute);
|
|
37
|
+
setFrom(updatedFromDate);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const onToDateChange = (_event: React.FormEvent<HTMLInputElement>, inputDate: string, newToDate: Date) => {
|
|
42
|
+
if (isValidDate(to) && isValidDate(newToDate) && inputDate === yyyyMMddFormat(newToDate)) {
|
|
43
|
+
newToDate.setHours(to.getHours());
|
|
44
|
+
newToDate.setMinutes(to.getMinutes());
|
|
45
|
+
}
|
|
46
|
+
if (isValidDate(newToDate) && inputDate === yyyyMMddFormat(newToDate)) {
|
|
47
|
+
setTo(newToDate);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const onToTimeChange = (_event: React.FormEvent<HTMLInputElement>, _time: string, hour: number, minute: number) => {
|
|
52
|
+
if (isValidDate(to)) {
|
|
53
|
+
const updatedToDate = new Date(to);
|
|
54
|
+
updatedToDate.setHours(hour);
|
|
55
|
+
updatedToDate.setMinutes(minute);
|
|
56
|
+
setTo(updatedToDate);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Flex direction={{ default: 'column', lg: 'row' }}>
|
|
62
|
+
<FlexItem>
|
|
63
|
+
<InputGroup>
|
|
64
|
+
<InputGroupItem>
|
|
65
|
+
<DatePicker onChange={onFromDateChange} aria-label="Start date" placeholder="YYYY-MM-DD" />
|
|
66
|
+
</InputGroupItem>
|
|
67
|
+
<InputGroupItem>
|
|
68
|
+
<TimePicker aria-label="Start time" style={{ width: '150px' }} onChange={onFromTimeChange} />
|
|
69
|
+
</InputGroupItem>
|
|
70
|
+
</InputGroup>
|
|
71
|
+
</FlexItem>
|
|
72
|
+
<FlexItem>to</FlexItem>
|
|
73
|
+
<FlexItem>
|
|
74
|
+
<InputGroup>
|
|
75
|
+
<InputGroupItem>
|
|
76
|
+
<DatePicker
|
|
77
|
+
value={isValidDate(to) ? yyyyMMddFormat(to) : to}
|
|
78
|
+
onChange={onToDateChange}
|
|
79
|
+
isDisabled={!isValidDate(from)}
|
|
80
|
+
rangeStart={from}
|
|
81
|
+
validators={[toValidator]}
|
|
82
|
+
aria-label="End date"
|
|
83
|
+
placeholder="YYYY-MM-DD"
|
|
84
|
+
/>
|
|
85
|
+
</InputGroupItem>
|
|
86
|
+
<InputGroupItem>
|
|
87
|
+
<TimePicker style={{ width: '150px' }} onChange={onToTimeChange} isDisabled={!isValidDate(from)} />
|
|
88
|
+
</InputGroupItem>
|
|
89
|
+
</InputGroup>
|
|
90
|
+
</FlexItem>
|
|
91
|
+
</Flex>
|
|
92
|
+
);
|
|
93
|
+
};
|