@patternfly/react-core 5.0.0-alpha.126 → 5.0.0-alpha.127
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 +4 -0
- package/dist/esm/components/AboutModal/package.json +1 -1
- package/dist/esm/components/Accordion/package.json +1 -1
- package/dist/esm/components/ActionList/package.json +1 -1
- package/dist/esm/components/Alert/package.json +1 -1
- package/dist/esm/components/Avatar/package.json +1 -1
- package/dist/esm/components/BackToTop/package.json +1 -1
- package/dist/esm/components/Backdrop/package.json +1 -1
- package/dist/esm/components/BackgroundImage/package.json +1 -1
- package/dist/esm/components/Badge/package.json +1 -1
- package/dist/esm/components/Banner/package.json +1 -1
- package/dist/esm/components/Brand/package.json +1 -1
- package/dist/esm/components/Breadcrumb/package.json +1 -1
- package/dist/esm/components/Button/package.json +1 -1
- package/dist/esm/components/CalendarMonth/package.json +1 -1
- package/dist/esm/components/Card/package.json +1 -1
- package/dist/esm/components/Checkbox/package.json +1 -1
- package/dist/esm/components/Chip/package.json +1 -1
- package/dist/esm/components/ClipboardCopy/package.json +1 -1
- package/dist/esm/components/CodeBlock/package.json +1 -1
- package/dist/esm/components/DataList/package.json +1 -1
- package/dist/esm/components/DatePicker/package.json +1 -1
- package/dist/esm/components/DescriptionList/package.json +1 -1
- package/dist/esm/components/Divider/package.json +1 -1
- package/dist/esm/components/DragDrop/package.json +1 -1
- package/dist/esm/components/Drawer/package.json +1 -1
- package/dist/esm/components/Dropdown/package.json +1 -1
- package/dist/esm/components/DualListSelector/package.json +1 -1
- package/dist/esm/components/EmptyState/package.json +1 -1
- package/dist/esm/components/ExpandableSection/package.json +1 -1
- package/dist/esm/components/FileUpload/package.json +1 -1
- package/dist/esm/components/Form/package.json +1 -1
- package/dist/esm/components/FormSelect/package.json +1 -1
- package/dist/esm/components/HelperText/package.json +1 -1
- package/dist/esm/components/Hint/package.json +1 -1
- package/dist/esm/components/Icon/package.json +1 -1
- package/dist/esm/components/InputGroup/package.json +1 -1
- package/dist/esm/components/JumpLinks/package.json +1 -1
- package/dist/esm/components/Label/package.json +1 -1
- package/dist/esm/components/List/package.json +1 -1
- package/dist/esm/components/LoginPage/package.json +1 -1
- package/dist/esm/components/Masthead/package.json +1 -1
- package/dist/esm/components/Menu/package.json +1 -1
- package/dist/esm/components/MenuToggle/package.json +1 -1
- package/dist/esm/components/Modal/package.json +1 -1
- package/dist/esm/components/MultipleFileUpload/package.json +1 -1
- package/dist/esm/components/Nav/package.json +1 -1
- package/dist/esm/components/NotificationBadge/package.json +1 -1
- package/dist/esm/components/NotificationDrawer/package.json +1 -1
- package/dist/esm/components/NumberInput/package.json +1 -1
- package/dist/esm/components/OverflowMenu/package.json +1 -1
- package/dist/esm/components/Page/package.json +1 -1
- package/dist/esm/components/Pagination/package.json +1 -1
- package/dist/esm/components/Panel/package.json +1 -1
- package/dist/esm/components/Popover/package.json +1 -1
- package/dist/esm/components/Progress/package.json +1 -1
- package/dist/esm/components/ProgressStepper/package.json +1 -1
- package/dist/esm/components/Radio/package.json +1 -1
- package/dist/esm/components/SearchInput/package.json +1 -1
- package/dist/esm/components/Select/package.json +1 -1
- package/dist/esm/components/Sidebar/package.json +1 -1
- package/dist/esm/components/SimpleList/package.json +1 -1
- package/dist/esm/components/Skeleton/package.json +1 -1
- package/dist/esm/components/SkipToContent/package.json +1 -1
- package/dist/esm/components/Slider/package.json +1 -1
- package/dist/esm/components/Spinner/package.json +1 -1
- package/dist/esm/components/Switch/package.json +1 -1
- package/dist/esm/components/Tabs/package.json +1 -1
- package/dist/esm/components/Text/package.json +1 -1
- package/dist/esm/components/TextArea/package.json +1 -1
- package/dist/esm/components/TextInput/package.json +1 -1
- package/dist/esm/components/TextInputGroup/package.json +1 -1
- package/dist/esm/components/Tile/package.json +1 -1
- package/dist/esm/components/TimePicker/package.json +1 -1
- package/dist/esm/components/Timestamp/package.json +1 -1
- package/dist/esm/components/Title/package.json +1 -1
- package/dist/esm/components/ToggleGroup/package.json +1 -1
- package/dist/esm/components/Toolbar/package.json +1 -1
- package/dist/esm/components/Tooltip/package.json +1 -1
- package/dist/esm/components/TreeView/package.json +1 -1
- package/dist/esm/components/Truncate/package.json +1 -1
- package/dist/esm/components/Wizard/hooks/package.json +1 -1
- package/dist/esm/components/Wizard/package.json +1 -1
- package/dist/esm/components/package.json +1 -1
- package/dist/esm/deprecated/components/ApplicationLauncher/package.json +1 -1
- package/dist/esm/deprecated/components/ContextSelector/package.json +1 -1
- package/dist/esm/deprecated/components/Dropdown/package.json +1 -1
- package/dist/esm/deprecated/components/OptionsMenu/package.json +1 -1
- package/dist/esm/deprecated/components/PageHeader/package.json +1 -1
- package/dist/esm/deprecated/components/Select/package.json +1 -1
- package/dist/esm/deprecated/components/Wizard/package.json +1 -1
- package/dist/esm/deprecated/components/package.json +1 -1
- package/dist/esm/deprecated/package.json +1 -1
- package/dist/esm/helpers/Popper/thirdparty/popper-core/package.json +1 -1
- package/dist/esm/helpers/package.json +1 -1
- package/dist/esm/layouts/Bullseye/package.json +1 -1
- package/dist/esm/layouts/Flex/package.json +1 -1
- package/dist/esm/layouts/Gallery/package.json +1 -1
- package/dist/esm/layouts/Grid/package.json +1 -1
- package/dist/esm/layouts/Level/package.json +1 -1
- package/dist/esm/layouts/Split/package.json +1 -1
- package/dist/esm/layouts/Stack/package.json +1 -1
- package/dist/esm/layouts/package.json +1 -1
- package/dist/esm/next/components/package.json +1 -1
- package/dist/esm/next/package.json +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/js/components/AboutModal/package.json +1 -1
- package/dist/js/components/Accordion/package.json +1 -1
- package/dist/js/components/ActionList/package.json +1 -1
- package/dist/js/components/Alert/package.json +1 -1
- package/dist/js/components/Avatar/package.json +1 -1
- package/dist/js/components/BackToTop/package.json +1 -1
- package/dist/js/components/Backdrop/package.json +1 -1
- package/dist/js/components/BackgroundImage/package.json +1 -1
- package/dist/js/components/Badge/package.json +1 -1
- package/dist/js/components/Banner/package.json +1 -1
- package/dist/js/components/Brand/package.json +1 -1
- package/dist/js/components/Breadcrumb/package.json +1 -1
- package/dist/js/components/Button/package.json +1 -1
- package/dist/js/components/CalendarMonth/package.json +1 -1
- package/dist/js/components/Card/package.json +1 -1
- package/dist/js/components/Checkbox/package.json +1 -1
- package/dist/js/components/Chip/package.json +1 -1
- package/dist/js/components/ClipboardCopy/package.json +1 -1
- package/dist/js/components/CodeBlock/package.json +1 -1
- package/dist/js/components/DataList/package.json +1 -1
- package/dist/js/components/DatePicker/package.json +1 -1
- package/dist/js/components/DescriptionList/package.json +1 -1
- package/dist/js/components/Divider/package.json +1 -1
- package/dist/js/components/DragDrop/package.json +1 -1
- package/dist/js/components/Drawer/package.json +1 -1
- package/dist/js/components/Dropdown/package.json +1 -1
- package/dist/js/components/DualListSelector/package.json +1 -1
- package/dist/js/components/EmptyState/package.json +1 -1
- package/dist/js/components/ExpandableSection/package.json +1 -1
- package/dist/js/components/FileUpload/package.json +1 -1
- package/dist/js/components/Form/package.json +1 -1
- package/dist/js/components/FormSelect/package.json +1 -1
- package/dist/js/components/HelperText/package.json +1 -1
- package/dist/js/components/Hint/package.json +1 -1
- package/dist/js/components/Icon/package.json +1 -1
- package/dist/js/components/InputGroup/package.json +1 -1
- package/dist/js/components/JumpLinks/package.json +1 -1
- package/dist/js/components/Label/package.json +1 -1
- package/dist/js/components/List/package.json +1 -1
- package/dist/js/components/LoginPage/package.json +1 -1
- package/dist/js/components/Masthead/package.json +1 -1
- package/dist/js/components/Menu/package.json +1 -1
- package/dist/js/components/MenuToggle/package.json +1 -1
- package/dist/js/components/Modal/package.json +1 -1
- package/dist/js/components/MultipleFileUpload/package.json +1 -1
- package/dist/js/components/Nav/package.json +1 -1
- package/dist/js/components/NotificationBadge/package.json +1 -1
- package/dist/js/components/NotificationDrawer/package.json +1 -1
- package/dist/js/components/NumberInput/package.json +1 -1
- package/dist/js/components/OverflowMenu/package.json +1 -1
- package/dist/js/components/Page/package.json +1 -1
- package/dist/js/components/Pagination/package.json +1 -1
- package/dist/js/components/Panel/package.json +1 -1
- package/dist/js/components/Popover/package.json +1 -1
- package/dist/js/components/Progress/package.json +1 -1
- package/dist/js/components/ProgressStepper/package.json +1 -1
- package/dist/js/components/Radio/package.json +1 -1
- package/dist/js/components/SearchInput/package.json +1 -1
- package/dist/js/components/Select/package.json +1 -1
- package/dist/js/components/Sidebar/package.json +1 -1
- package/dist/js/components/SimpleList/package.json +1 -1
- package/dist/js/components/Skeleton/package.json +1 -1
- package/dist/js/components/SkipToContent/package.json +1 -1
- package/dist/js/components/Slider/package.json +1 -1
- package/dist/js/components/Spinner/package.json +1 -1
- package/dist/js/components/Switch/package.json +1 -1
- package/dist/js/components/Tabs/package.json +1 -1
- package/dist/js/components/Text/package.json +1 -1
- package/dist/js/components/TextArea/package.json +1 -1
- package/dist/js/components/TextInput/package.json +1 -1
- package/dist/js/components/TextInputGroup/package.json +1 -1
- package/dist/js/components/Tile/package.json +1 -1
- package/dist/js/components/TimePicker/package.json +1 -1
- package/dist/js/components/Timestamp/package.json +1 -1
- package/dist/js/components/Title/package.json +1 -1
- package/dist/js/components/ToggleGroup/package.json +1 -1
- package/dist/js/components/Toolbar/package.json +1 -1
- package/dist/js/components/Tooltip/package.json +1 -1
- package/dist/js/components/TreeView/package.json +1 -1
- package/dist/js/components/Truncate/package.json +1 -1
- package/dist/js/components/Wizard/hooks/package.json +1 -1
- package/dist/js/components/Wizard/package.json +1 -1
- package/dist/js/components/package.json +1 -1
- package/dist/js/deprecated/components/ApplicationLauncher/package.json +1 -1
- package/dist/js/deprecated/components/ContextSelector/package.json +1 -1
- package/dist/js/deprecated/components/Dropdown/package.json +1 -1
- package/dist/js/deprecated/components/OptionsMenu/package.json +1 -1
- package/dist/js/deprecated/components/PageHeader/package.json +1 -1
- package/dist/js/deprecated/components/Select/package.json +1 -1
- package/dist/js/deprecated/components/Wizard/package.json +1 -1
- package/dist/js/deprecated/components/package.json +1 -1
- package/dist/js/deprecated/package.json +1 -1
- package/dist/js/helpers/Popper/thirdparty/popper-core/package.json +1 -1
- package/dist/js/helpers/package.json +1 -1
- package/dist/js/layouts/Bullseye/package.json +1 -1
- package/dist/js/layouts/Flex/package.json +1 -1
- package/dist/js/layouts/Gallery/package.json +1 -1
- package/dist/js/layouts/Grid/package.json +1 -1
- package/dist/js/layouts/Level/package.json +1 -1
- package/dist/js/layouts/Split/package.json +1 -1
- package/dist/js/layouts/Stack/package.json +1 -1
- package/dist/js/layouts/package.json +1 -1
- package/dist/js/next/components/package.json +1 -1
- package/dist/js/next/package.json +1 -1
- package/dist/js/package.json +1 -1
- package/package.json +2 -2
- package/src/demos/PrimaryDetail.md +7 -1393
- package/src/demos/examples/PrimaryDetail/PrimaryDetailContentPadding.tsx +443 -0
- package/src/demos/examples/PrimaryDetail/PrimaryDetailFullPage.tsx +443 -0
- package/src/demos/examples/PrimaryDetail/PrimaryDetailInlineModifier.tsx +443 -0
|
@@ -3,8 +3,6 @@ id: Primary-detail
|
|
|
3
3
|
section: patterns
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { Select as SelectDeprecated, SelectOption as SelectOptionDeprecated, SelectVariant } from '@patternfly/react-core/deprecated';
|
|
7
|
-
import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
|
|
8
6
|
import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
|
|
9
7
|
import TrashIcon from '@patternfly/react-icons/dist/esm/icons/trash-icon';
|
|
10
8
|
import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
@@ -26,943 +24,20 @@ import azureIcon from './Card/FuseConnector_Icons_AzureServices.png';
|
|
|
26
24
|
import restIcon from './Card/FuseConnector_Icons_REST.png';
|
|
27
25
|
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
28
26
|
import { data } from '@patternfly/react-core/src/demos/Card/CardData.jsx';
|
|
27
|
+
import DashboardWrapper from './examples/DashboardWrapper';
|
|
29
28
|
|
|
30
29
|
## Demos
|
|
31
30
|
|
|
32
31
|
### Primary-detail full page
|
|
33
32
|
|
|
34
|
-
```js isFullscreen
|
|
35
|
-
import React from 'react';
|
|
36
|
-
import {
|
|
37
|
-
Button,
|
|
38
|
-
ButtonVariant,
|
|
39
|
-
DataList,
|
|
40
|
-
DataListAction,
|
|
41
|
-
DataListCell,
|
|
42
|
-
DataListItem,
|
|
43
|
-
DataListItemCells,
|
|
44
|
-
DataListItemRow,
|
|
45
|
-
Toolbar,
|
|
46
|
-
ToolbarItem,
|
|
47
|
-
ToolbarContent,
|
|
48
|
-
ToolbarToggleGroup,
|
|
49
|
-
ToolbarGroup,
|
|
50
|
-
Divider,
|
|
51
|
-
Drawer,
|
|
52
|
-
DrawerActions,
|
|
53
|
-
DrawerCloseButton,
|
|
54
|
-
DrawerContent,
|
|
55
|
-
DrawerContentBody,
|
|
56
|
-
DrawerHead,
|
|
57
|
-
DrawerPanelBody,
|
|
58
|
-
DrawerPanelContent,
|
|
59
|
-
Flex,
|
|
60
|
-
FlexItem,
|
|
61
|
-
InputGroup,
|
|
62
|
-
InputGroupItem,
|
|
63
|
-
PageSection,
|
|
64
|
-
PageSectionVariants,
|
|
65
|
-
Progress,
|
|
66
|
-
Stack,
|
|
67
|
-
StackItem,
|
|
68
|
-
Text,
|
|
69
|
-
TextContent,
|
|
70
|
-
TextInput,
|
|
71
|
-
Title
|
|
72
|
-
} from '@patternfly/react-core';
|
|
73
|
-
import {
|
|
74
|
-
Select as SelectDeprecated,
|
|
75
|
-
SelectOption as SelectOptionDeprecated,
|
|
76
|
-
SelectVariant
|
|
77
|
-
} from '@patternfly/react-core/deprecated';
|
|
78
|
-
import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
|
|
79
|
-
import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
|
|
80
|
-
import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
81
|
-
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
82
|
-
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
|
|
83
|
-
import ExclamationTriangleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon';
|
|
84
|
-
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
85
|
-
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
86
|
-
import TimesCircleIcon from '@patternfly/react-icons/dist/esm/icons/times-circle-icon';
|
|
87
|
-
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
88
|
-
|
|
89
|
-
class PrimaryDetailFullPage extends React.Component {
|
|
90
|
-
constructor(props) {
|
|
91
|
-
super(props);
|
|
92
|
-
this.state = {
|
|
93
|
-
isDrawerExpanded: false,
|
|
94
|
-
drawerPanelBodyContent: '',
|
|
95
|
-
isDropdownOpen: false,
|
|
96
|
-
isKebabDropdownOpen: false,
|
|
97
|
-
activeItem: 0,
|
|
98
|
-
inputValue: '',
|
|
99
|
-
statusIsExpanded: false,
|
|
100
|
-
statusSelected: null,
|
|
101
|
-
riskIsExpanded: false,
|
|
102
|
-
riskSelected: null,
|
|
103
|
-
selectedDataListItemId: ''
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
this.statusOptions = [
|
|
107
|
-
{ value: 'Status', disabled: false, isPlaceholder: true },
|
|
108
|
-
{ value: 'New', disabled: false },
|
|
109
|
-
{ value: 'Pending', disabled: false },
|
|
110
|
-
{ value: 'Running', disabled: false },
|
|
111
|
-
{ value: 'Cancelled', disabled: false }
|
|
112
|
-
];
|
|
113
|
-
|
|
114
|
-
this.riskOptions = [
|
|
115
|
-
{ value: 'Risk', disabled: false, isPlaceholder: true },
|
|
116
|
-
{ value: 'Low', disabled: false },
|
|
117
|
-
{ value: 'Medium', disabled: false },
|
|
118
|
-
{ value: 'High', disabled: false }
|
|
119
|
-
];
|
|
120
|
-
|
|
121
|
-
this.onInputChange = (_event, newValue) => {
|
|
122
|
-
this.setState({ inputValue: newValue });
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
this.onStatusToggle = (_event, isExpanded) => {
|
|
126
|
-
this.setState({
|
|
127
|
-
statusIsExpanded: isExpanded
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
this.onStatusSelect = (event, selection, isPlaceholder) => {
|
|
132
|
-
if (isPlaceholder) this.clearStatusSelection();
|
|
133
|
-
this.setState({
|
|
134
|
-
statusSelected: selection,
|
|
135
|
-
statusIsExpanded: false
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
this.clearStatusSelection = () => {
|
|
140
|
-
this.setState({
|
|
141
|
-
statusSelected: null,
|
|
142
|
-
statusIsExpanded: false
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
this.onRiskToggle = (_event, isExpanded) => {
|
|
147
|
-
this.setState({
|
|
148
|
-
riskIsExpanded: isExpanded
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
this.onRiskSelect = (event, selection, isPlaceholder) => {
|
|
153
|
-
if (isPlaceholder) this.clearRiskSelection();
|
|
154
|
-
this.setState({
|
|
155
|
-
riskSelected: selection,
|
|
156
|
-
riskIsExpanded: false
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
this.clearRiskSelection = () => {
|
|
161
|
-
this.setState({
|
|
162
|
-
riskSelected: null,
|
|
163
|
-
riskIsExpanded: false
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
this.onSelectDataListItem = (_event, id) => {
|
|
168
|
-
this.setState({
|
|
169
|
-
selectedDataListItemId: id,
|
|
170
|
-
isDrawerExpanded: true,
|
|
171
|
-
drawerPanelBodyContent: id.charAt(id.length - 1)
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
this.onCloseDrawerClick = () => {
|
|
176
|
-
this.setState({
|
|
177
|
-
isDrawerExpanded: false,
|
|
178
|
-
selectedDataListItemId: ''
|
|
179
|
-
});
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
render() {
|
|
184
|
-
const {
|
|
185
|
-
isDrawerExpanded,
|
|
186
|
-
drawerPanelBodyContent,
|
|
187
|
-
isDropdownOpen,
|
|
188
|
-
isKebabDropdownOpen,
|
|
189
|
-
activeItem,
|
|
190
|
-
inputValue,
|
|
191
|
-
statusIsExpanded,
|
|
192
|
-
statusSelected,
|
|
193
|
-
riskIsExpanded,
|
|
194
|
-
riskSelected,
|
|
195
|
-
selectedDataListItemId
|
|
196
|
-
} = this.state;
|
|
197
|
-
|
|
198
|
-
const toggleGroupItems = (
|
|
199
|
-
<React.Fragment>
|
|
200
|
-
<ToolbarItem>
|
|
201
|
-
<InputGroup>
|
|
202
|
-
<InputGroupItem isFill>
|
|
203
|
-
<TextInput
|
|
204
|
-
name="full-page-data-toolbar-input1"
|
|
205
|
-
id="full-page-data-toolbar-input1"
|
|
206
|
-
type="search"
|
|
207
|
-
aria-label="search input example"
|
|
208
|
-
onChange={this.onInputChange}
|
|
209
|
-
value={inputValue}
|
|
210
|
-
/>
|
|
211
|
-
</InputGroupItem>
|
|
212
|
-
<InputGroupItem>
|
|
213
|
-
<Button variant={ButtonVariant.control} aria-label="search button for search input">
|
|
214
|
-
<SearchIcon />
|
|
215
|
-
</Button>
|
|
216
|
-
</InputGroupItem>
|
|
217
|
-
</InputGroup>
|
|
218
|
-
</ToolbarItem>
|
|
219
|
-
<ToolbarGroup variant="filter-group">
|
|
220
|
-
<ToolbarItem>
|
|
221
|
-
<SelectDeprecated
|
|
222
|
-
variant={SelectVariant.single}
|
|
223
|
-
aria-label="Select Input"
|
|
224
|
-
onToggle={this.onStatusToggle}
|
|
225
|
-
onSelect={this.onStatusSelect}
|
|
226
|
-
selections={statusSelected}
|
|
227
|
-
isExpanded={statusIsExpanded}
|
|
228
|
-
>
|
|
229
|
-
{this.statusOptions.map((option, index) => (
|
|
230
|
-
<SelectOptionDeprecated isDisabled={option.disabled} key={index} value={option.value} />
|
|
231
|
-
))}
|
|
232
|
-
</SelectDeprecated>
|
|
233
|
-
</ToolbarItem>
|
|
234
|
-
<ToolbarItem>
|
|
235
|
-
<SelectDeprecated
|
|
236
|
-
variant={SelectVariant.single}
|
|
237
|
-
aria-label="Select Input"
|
|
238
|
-
onToggle={this.onRiskToggle}
|
|
239
|
-
onSelect={this.onRiskSelect}
|
|
240
|
-
selections={riskSelected}
|
|
241
|
-
isExpanded={riskIsExpanded}
|
|
242
|
-
>
|
|
243
|
-
{this.riskOptions.map((option, index) => (
|
|
244
|
-
<SelectOptionDeprecated isDisabled={option.disabled} key={index} value={option.value} />
|
|
245
|
-
))}
|
|
246
|
-
</SelectDeprecated>
|
|
247
|
-
</ToolbarItem>
|
|
248
|
-
</ToolbarGroup>
|
|
249
|
-
</React.Fragment>
|
|
250
|
-
);
|
|
251
|
-
|
|
252
|
-
const ToolbarItems = (
|
|
253
|
-
<ToolbarToggleGroup toggleIcon={<FilterIcon />} breakpoint="xl">
|
|
254
|
-
{toggleGroupItems}
|
|
255
|
-
</ToolbarToggleGroup>
|
|
256
|
-
);
|
|
257
|
-
|
|
258
|
-
const panelContent = (
|
|
259
|
-
<DrawerPanelContent>
|
|
260
|
-
<DrawerHead>
|
|
261
|
-
<Title headingLevel="h2" size="xl">
|
|
262
|
-
node-{drawerPanelBodyContent}
|
|
263
|
-
</Title>
|
|
264
|
-
<DrawerActions>
|
|
265
|
-
<DrawerCloseButton onClick={this.onCloseDrawerClick} />
|
|
266
|
-
</DrawerActions>
|
|
267
|
-
</DrawerHead>
|
|
268
|
-
<DrawerPanelBody>
|
|
269
|
-
<Flex spaceItems={{ default: 'spaceItemsLg' }} direction={{ default: 'column' }}>
|
|
270
|
-
<FlexItem>
|
|
271
|
-
<p>
|
|
272
|
-
The content of the drawer really is up to you. It could have form fields, definition lists, text lists,
|
|
273
|
-
labels, charts, progress bars, etc. Spacing recommendation is 24px margins. You can put tabs in here,
|
|
274
|
-
and can also make the drawer scrollable.
|
|
275
|
-
</p>
|
|
276
|
-
</FlexItem>
|
|
277
|
-
<FlexItem>
|
|
278
|
-
<Progress value={drawerPanelBodyContent * 10} title="Title" />
|
|
279
|
-
</FlexItem>
|
|
280
|
-
<FlexItem>
|
|
281
|
-
<Progress value={drawerPanelBodyContent * 5} title="Title" />
|
|
282
|
-
</FlexItem>
|
|
283
|
-
</Flex>
|
|
284
|
-
</DrawerPanelBody>
|
|
285
|
-
</DrawerPanelContent>
|
|
286
|
-
);
|
|
287
|
-
const drawerContent = (
|
|
288
|
-
<React.Fragment>
|
|
289
|
-
<Toolbar id="full-page-data-toolbar" usePageInsets>
|
|
290
|
-
<ToolbarContent>{ToolbarItems}</ToolbarContent>
|
|
291
|
-
</Toolbar>
|
|
292
|
-
<DataList
|
|
293
|
-
aria-label="data list"
|
|
294
|
-
selectedDataListItemId={selectedDataListItemId}
|
|
295
|
-
onSelectDataListItem={this.onSelectDataListItem}
|
|
296
|
-
>
|
|
297
|
-
<DataListItem id="full-page-item1">
|
|
298
|
-
<DataListItemRow>
|
|
299
|
-
<DataListItemCells
|
|
300
|
-
dataListCells={[
|
|
301
|
-
<DataListCell key="primary content">
|
|
302
|
-
<Flex direction={{ default: 'column' }}>
|
|
303
|
-
<FlexItem>
|
|
304
|
-
<p>patternfly</p>
|
|
305
|
-
<small>
|
|
306
|
-
Working repo for PatternFly 4 <a>https://pf4.patternfly.org/</a>
|
|
307
|
-
</small>
|
|
308
|
-
</FlexItem>
|
|
309
|
-
<Flex>
|
|
310
|
-
<FlexItem>
|
|
311
|
-
<CodeBranchIcon /> 10
|
|
312
|
-
</FlexItem>
|
|
313
|
-
<FlexItem>
|
|
314
|
-
<CodeIcon /> 4
|
|
315
|
-
</FlexItem>
|
|
316
|
-
<FlexItem>
|
|
317
|
-
<CubeIcon /> 5
|
|
318
|
-
</FlexItem>
|
|
319
|
-
<FlexItem>Updated 2 days ago</FlexItem>
|
|
320
|
-
</Flex>
|
|
321
|
-
</Flex>
|
|
322
|
-
</DataListCell>,
|
|
323
|
-
<DataListAction alignRight>
|
|
324
|
-
<Stack>
|
|
325
|
-
<StackItem>
|
|
326
|
-
<Button variant={ButtonVariant.secondary}>Secondary</Button>
|
|
327
|
-
</StackItem>
|
|
328
|
-
<StackItem>
|
|
329
|
-
<Button variant={ButtonVariant.link}>Link Button</Button>
|
|
330
|
-
</StackItem>
|
|
331
|
-
</Stack>
|
|
332
|
-
</DataListAction>
|
|
333
|
-
]}
|
|
334
|
-
/>
|
|
335
|
-
</DataListItemRow>
|
|
336
|
-
</DataListItem>
|
|
337
|
-
<DataListItem id="full-page-item2">
|
|
338
|
-
<DataListItemRow>
|
|
339
|
-
<DataListItemCells
|
|
340
|
-
dataListCells={[
|
|
341
|
-
<DataListCell key="primary content">
|
|
342
|
-
<Flex direction={{ default: 'column' }}>
|
|
343
|
-
<FlexItem>
|
|
344
|
-
<p>patternfly-elements</p>
|
|
345
|
-
<small>PatternFly elements</small>
|
|
346
|
-
</FlexItem>
|
|
347
|
-
<Flex>
|
|
348
|
-
<FlexItem>
|
|
349
|
-
<CodeBranchIcon /> 10
|
|
350
|
-
</FlexItem>
|
|
351
|
-
<FlexItem>
|
|
352
|
-
<CodeIcon /> 4
|
|
353
|
-
</FlexItem>
|
|
354
|
-
<FlexItem>
|
|
355
|
-
<CubeIcon /> 5
|
|
356
|
-
</FlexItem>
|
|
357
|
-
<FlexItem>
|
|
358
|
-
<CheckCircleIcon /> 7
|
|
359
|
-
</FlexItem>
|
|
360
|
-
<FlexItem>
|
|
361
|
-
<ExclamationTriangleIcon /> 5
|
|
362
|
-
</FlexItem>
|
|
363
|
-
<FlexItem>
|
|
364
|
-
<TimesCircleIcon /> 5
|
|
365
|
-
</FlexItem>
|
|
366
|
-
<FlexItem>Updated 2 days ago</FlexItem>
|
|
367
|
-
</Flex>
|
|
368
|
-
</Flex>
|
|
369
|
-
</DataListCell>,
|
|
370
|
-
<DataListAction alignRight>
|
|
371
|
-
<Stack>
|
|
372
|
-
<StackItem>
|
|
373
|
-
<Button variant={ButtonVariant.secondary}>Secondary</Button>
|
|
374
|
-
</StackItem>
|
|
375
|
-
<StackItem>
|
|
376
|
-
<Button variant={ButtonVariant.link}>Link Button</Button>
|
|
377
|
-
</StackItem>
|
|
378
|
-
</Stack>
|
|
379
|
-
</DataListAction>
|
|
380
|
-
]}
|
|
381
|
-
/>
|
|
382
|
-
</DataListItemRow>
|
|
383
|
-
</DataListItem>
|
|
384
|
-
<DataListItem id="full-page-item3">
|
|
385
|
-
<DataListItemRow>
|
|
386
|
-
<DataListItemCells
|
|
387
|
-
dataListCells={[
|
|
388
|
-
<DataListCell key="primary content">
|
|
389
|
-
<Flex direction={{ default: 'column' }}>
|
|
390
|
-
<FlexItem>
|
|
391
|
-
<p>patternfly</p>
|
|
392
|
-
<small>
|
|
393
|
-
Working repo for PatternFly 4 <a>https://pf4.patternfly.org/</a>
|
|
394
|
-
</small>
|
|
395
|
-
</FlexItem>
|
|
396
|
-
<Flex>
|
|
397
|
-
<FlexItem>
|
|
398
|
-
<CodeBranchIcon /> 10
|
|
399
|
-
</FlexItem>
|
|
400
|
-
<FlexItem>
|
|
401
|
-
<CodeIcon /> 4
|
|
402
|
-
</FlexItem>
|
|
403
|
-
<FlexItem>
|
|
404
|
-
<CubeIcon /> 5
|
|
405
|
-
</FlexItem>
|
|
406
|
-
<FlexItem>Updated 2 days ago</FlexItem>
|
|
407
|
-
</Flex>
|
|
408
|
-
</Flex>
|
|
409
|
-
</DataListCell>,
|
|
410
|
-
<DataListAction alignRight>
|
|
411
|
-
<Stack>
|
|
412
|
-
<StackItem>
|
|
413
|
-
<Button variant={ButtonVariant.secondary}>Secondary</Button>
|
|
414
|
-
</StackItem>
|
|
415
|
-
<StackItem>
|
|
416
|
-
<Button variant={ButtonVariant.link}>Link Button</Button>
|
|
417
|
-
</StackItem>
|
|
418
|
-
</Stack>
|
|
419
|
-
</DataListAction>
|
|
420
|
-
]}
|
|
421
|
-
/>
|
|
422
|
-
</DataListItemRow>
|
|
423
|
-
</DataListItem>
|
|
424
|
-
<DataListItem id="full-page-item4">
|
|
425
|
-
<DataListItemRow>
|
|
426
|
-
<DataListItemCells
|
|
427
|
-
dataListCells={[
|
|
428
|
-
<DataListCell key="primary content">
|
|
429
|
-
<Flex direction={{ default: 'column' }}>
|
|
430
|
-
<FlexItem>
|
|
431
|
-
<p>patternfly-elements</p>
|
|
432
|
-
<small>PatternFly elements</small>
|
|
433
|
-
</FlexItem>
|
|
434
|
-
<Flex>
|
|
435
|
-
<FlexItem>
|
|
436
|
-
<CodeBranchIcon /> 10
|
|
437
|
-
</FlexItem>
|
|
438
|
-
<FlexItem>
|
|
439
|
-
<CodeIcon /> 4
|
|
440
|
-
</FlexItem>
|
|
441
|
-
<FlexItem>
|
|
442
|
-
<CubeIcon /> 5
|
|
443
|
-
</FlexItem>
|
|
444
|
-
<FlexItem>
|
|
445
|
-
<CheckCircleIcon /> 7
|
|
446
|
-
</FlexItem>
|
|
447
|
-
<FlexItem>
|
|
448
|
-
<ExclamationTriangleIcon /> 5
|
|
449
|
-
</FlexItem>
|
|
450
|
-
<FlexItem>
|
|
451
|
-
<TimesCircleIcon /> 5
|
|
452
|
-
</FlexItem>
|
|
453
|
-
<FlexItem>Updated 2 days ago</FlexItem>
|
|
454
|
-
</Flex>
|
|
455
|
-
</Flex>
|
|
456
|
-
</DataListCell>,
|
|
457
|
-
<DataListAction alignRight>
|
|
458
|
-
<Stack>
|
|
459
|
-
<StackItem>
|
|
460
|
-
<Button variant={ButtonVariant.secondary}>Secondary</Button>
|
|
461
|
-
</StackItem>
|
|
462
|
-
<StackItem>
|
|
463
|
-
<Button variant={ButtonVariant.link}>Link Button</Button>
|
|
464
|
-
</StackItem>
|
|
465
|
-
</Stack>
|
|
466
|
-
</DataListAction>
|
|
467
|
-
]}
|
|
468
|
-
/>
|
|
469
|
-
</DataListItemRow>
|
|
470
|
-
</DataListItem>
|
|
471
|
-
</DataList>
|
|
472
|
-
</React.Fragment>
|
|
473
|
-
);
|
|
474
|
-
|
|
475
|
-
return (
|
|
476
|
-
<DashboardWrapper mainContainerId="main-content-page-layout-default-nav">
|
|
477
|
-
<PageSection variant={PageSectionVariants.light}>
|
|
478
|
-
<TextContent>
|
|
479
|
-
<Text component="h1">Main title</Text>
|
|
480
|
-
<Text component="p">
|
|
481
|
-
Body text should be Overpass Regular at 16px. It should have leading of 24px because <br />
|
|
482
|
-
of it’s relative line height of 1.5.
|
|
483
|
-
</Text>
|
|
484
|
-
</TextContent>
|
|
485
|
-
</PageSection>
|
|
486
|
-
<Divider component="div" />
|
|
487
|
-
<PageSection variant={PageSectionVariants.light} padding={{ default: 'noPadding' }}>
|
|
488
|
-
<Drawer isExpanded={isDrawerExpanded}>
|
|
489
|
-
<DrawerContent panelContent={panelContent}>
|
|
490
|
-
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
491
|
-
</DrawerContent>
|
|
492
|
-
</Drawer>
|
|
493
|
-
</PageSection>
|
|
494
|
-
</DashboardWrapper>
|
|
495
|
-
);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
### Primary-detail content padding
|
|
501
|
-
|
|
502
|
-
```js isFullscreen
|
|
503
|
-
import React from 'react';
|
|
504
|
-
import {
|
|
505
|
-
Button,
|
|
506
|
-
ButtonVariant,
|
|
507
|
-
DataList,
|
|
508
|
-
DataListAction,
|
|
509
|
-
DataListCell,
|
|
510
|
-
DataListItem,
|
|
511
|
-
DataListItemCells,
|
|
512
|
-
DataListItemRow,
|
|
513
|
-
Toolbar,
|
|
514
|
-
ToolbarItem,
|
|
515
|
-
ToolbarContent,
|
|
516
|
-
ToolbarToggleGroup,
|
|
517
|
-
ToolbarGroup,
|
|
518
|
-
Divider,
|
|
519
|
-
Drawer,
|
|
520
|
-
DrawerActions,
|
|
521
|
-
DrawerCloseButton,
|
|
522
|
-
DrawerContent,
|
|
523
|
-
DrawerContentBody,
|
|
524
|
-
DrawerHead,
|
|
525
|
-
DrawerPanelBody,
|
|
526
|
-
DrawerPanelContent,
|
|
527
|
-
Flex,
|
|
528
|
-
FlexItem,
|
|
529
|
-
InputGroup,
|
|
530
|
-
InputGroupItem,
|
|
531
|
-
PageSection,
|
|
532
|
-
PageSectionVariants,
|
|
533
|
-
Progress,
|
|
534
|
-
Stack,
|
|
535
|
-
StackItem,
|
|
536
|
-
Text,
|
|
537
|
-
TextContent,
|
|
538
|
-
TextInput,
|
|
539
|
-
Title
|
|
540
|
-
} from '@patternfly/react-core';
|
|
541
|
-
import {
|
|
542
|
-
Select as SelectDeprecated,
|
|
543
|
-
SelectOption as SelectOptionDeprecated,
|
|
544
|
-
SelectVariant
|
|
545
|
-
} from '@patternfly/react-core/deprecated';
|
|
546
|
-
import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
|
|
547
|
-
import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
|
|
548
|
-
import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
549
|
-
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
550
|
-
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
|
|
551
|
-
import ExclamationTriangleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon';
|
|
552
|
-
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
553
|
-
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
554
|
-
import TimesCircleIcon from '@patternfly/react-icons/dist/esm/icons/times-circle-icon';
|
|
555
|
-
|
|
556
|
-
class PrimaryDetailContentPadding extends React.Component {
|
|
557
|
-
constructor(props) {
|
|
558
|
-
super(props);
|
|
559
|
-
this.state = {
|
|
560
|
-
isDrawerExpanded: false,
|
|
561
|
-
drawerPanelBodyContent: '',
|
|
562
|
-
isDropdownOpen: false,
|
|
563
|
-
isKebabDropdownOpen: false,
|
|
564
|
-
activeItem: 0,
|
|
565
|
-
inputValue: '',
|
|
566
|
-
statusIsExpanded: false,
|
|
567
|
-
statusSelected: null,
|
|
568
|
-
riskIsExpanded: false,
|
|
569
|
-
riskSelected: null,
|
|
570
|
-
selectedDataListItemId: ''
|
|
571
|
-
};
|
|
572
|
-
|
|
573
|
-
this.statusOptions = [
|
|
574
|
-
{ value: 'Status', disabled: false, isPlaceholder: true },
|
|
575
|
-
{ value: 'New', disabled: false },
|
|
576
|
-
{ value: 'Pending', disabled: false },
|
|
577
|
-
{ value: 'Running', disabled: false },
|
|
578
|
-
{ value: 'Cancelled', disabled: false }
|
|
579
|
-
];
|
|
580
|
-
|
|
581
|
-
this.riskOptions = [
|
|
582
|
-
{ value: 'Risk', disabled: false, isPlaceholder: true },
|
|
583
|
-
{ value: 'Low', disabled: false },
|
|
584
|
-
{ value: 'Medium', disabled: false },
|
|
585
|
-
{ value: 'High', disabled: false }
|
|
586
|
-
];
|
|
587
|
-
|
|
588
|
-
this.onInputChange = (_event, newValue) => {
|
|
589
|
-
this.setState({ inputValue: newValue });
|
|
590
|
-
};
|
|
591
|
-
|
|
592
|
-
this.onStatusToggle = (_event, isExpanded) => {
|
|
593
|
-
this.setState({
|
|
594
|
-
statusIsExpanded: isExpanded
|
|
595
|
-
});
|
|
596
|
-
};
|
|
597
|
-
|
|
598
|
-
this.onStatusSelect = (event, selection, isPlaceholder) => {
|
|
599
|
-
if (isPlaceholder) this.clearStatusSelection();
|
|
600
|
-
this.setState({
|
|
601
|
-
statusSelected: selection,
|
|
602
|
-
statusIsExpanded: false
|
|
603
|
-
});
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
this.clearStatusSelection = () => {
|
|
607
|
-
this.setState({
|
|
608
|
-
statusSelected: null,
|
|
609
|
-
statusIsExpanded: false
|
|
610
|
-
});
|
|
611
|
-
};
|
|
612
|
-
|
|
613
|
-
this.onRiskToggle = (_event, isExpanded) => {
|
|
614
|
-
this.setState({
|
|
615
|
-
riskIsExpanded: isExpanded
|
|
616
|
-
});
|
|
617
|
-
};
|
|
618
|
-
|
|
619
|
-
this.onRiskSelect = (event, selection, isPlaceholder) => {
|
|
620
|
-
if (isPlaceholder) this.clearRiskSelection();
|
|
621
|
-
this.setState({
|
|
622
|
-
riskSelected: selection,
|
|
623
|
-
riskIsExpanded: false
|
|
624
|
-
});
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
this.clearRiskSelection = () => {
|
|
628
|
-
this.setState({
|
|
629
|
-
riskSelected: null,
|
|
630
|
-
riskIsExpanded: false
|
|
631
|
-
});
|
|
632
|
-
};
|
|
633
|
-
|
|
634
|
-
this.onSelectDataListItem = (_event, id) => {
|
|
635
|
-
this.setState({
|
|
636
|
-
selectedDataListItemId: id,
|
|
637
|
-
isDrawerExpanded: true,
|
|
638
|
-
drawerPanelBodyContent: id.charAt(id.length - 1)
|
|
639
|
-
});
|
|
640
|
-
};
|
|
641
|
-
|
|
642
|
-
this.onCloseDrawerClick = () => {
|
|
643
|
-
this.setState({
|
|
644
|
-
isDrawerExpanded: false,
|
|
645
|
-
selectedDataListItemId: ''
|
|
646
|
-
});
|
|
647
|
-
};
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
render() {
|
|
651
|
-
const {
|
|
652
|
-
isDrawerExpanded,
|
|
653
|
-
drawerPanelBodyContent,
|
|
654
|
-
isDropdownOpen,
|
|
655
|
-
isKebabDropdownOpen,
|
|
656
|
-
activeItem,
|
|
657
|
-
inputValue,
|
|
658
|
-
statusIsExpanded,
|
|
659
|
-
statusSelected,
|
|
660
|
-
riskIsExpanded,
|
|
661
|
-
riskSelected,
|
|
662
|
-
selectedDataListItemId
|
|
663
|
-
} = this.state;
|
|
664
|
-
|
|
665
|
-
const toggleGroupItems = (
|
|
666
|
-
<React.Fragment>
|
|
667
|
-
<ToolbarItem>
|
|
668
|
-
<InputGroup>
|
|
669
|
-
<InputGroupItem isFill>
|
|
670
|
-
<TextInput
|
|
671
|
-
name="content-padding-data-toolbar-input1"
|
|
672
|
-
id="content-padding-data-toolbar-input1"
|
|
673
|
-
type="search"
|
|
674
|
-
aria-label="search input example"
|
|
675
|
-
onChange={this.onInputChange}
|
|
676
|
-
value={inputValue}
|
|
677
|
-
/>
|
|
678
|
-
</InputGroupItem>
|
|
679
|
-
<InputGroupItem>
|
|
680
|
-
<Button variant={ButtonVariant.control} aria-label="search button for search input">
|
|
681
|
-
<SearchIcon />
|
|
682
|
-
</Button>
|
|
683
|
-
</InputGroupItem>
|
|
684
|
-
</InputGroup>
|
|
685
|
-
</ToolbarItem>
|
|
686
|
-
<ToolbarGroup variant="filter-group">
|
|
687
|
-
<ToolbarItem>
|
|
688
|
-
<SelectDeprecated
|
|
689
|
-
variant={SelectVariant.single}
|
|
690
|
-
aria-label="Select Input"
|
|
691
|
-
onToggle={this.onStatusToggle}
|
|
692
|
-
onSelect={this.onStatusSelect}
|
|
693
|
-
selections={statusSelected}
|
|
694
|
-
isExpanded={statusIsExpanded}
|
|
695
|
-
>
|
|
696
|
-
{this.statusOptions.map((option, index) => (
|
|
697
|
-
<SelectOptionDeprecated isDisabled={option.disabled} key={index} value={option.value} />
|
|
698
|
-
))}
|
|
699
|
-
</SelectDeprecated>
|
|
700
|
-
</ToolbarItem>
|
|
701
|
-
<ToolbarItem>
|
|
702
|
-
<SelectDeprecated
|
|
703
|
-
variant={SelectVariant.single}
|
|
704
|
-
aria-label="Select Input"
|
|
705
|
-
onToggle={this.onRiskToggle}
|
|
706
|
-
onSelect={this.onRiskSelect}
|
|
707
|
-
selections={riskSelected}
|
|
708
|
-
isExpanded={riskIsExpanded}
|
|
709
|
-
>
|
|
710
|
-
{this.riskOptions.map((option, index) => (
|
|
711
|
-
<SelectOptionDeprecated isDisabled={option.disabled} key={index} value={option.value} />
|
|
712
|
-
))}
|
|
713
|
-
</SelectDeprecated>
|
|
714
|
-
</ToolbarItem>
|
|
715
|
-
</ToolbarGroup>
|
|
716
|
-
</React.Fragment>
|
|
717
|
-
);
|
|
718
|
-
|
|
719
|
-
const ToolbarItems = (
|
|
720
|
-
<ToolbarToggleGroup toggleIcon={<FilterIcon />} breakpoint="xl">
|
|
721
|
-
{toggleGroupItems}
|
|
722
|
-
</ToolbarToggleGroup>
|
|
723
|
-
);
|
|
33
|
+
```js file="./examples/PrimaryDetail/PrimaryDetailFullPage.tsx" isFullscreen
|
|
724
34
|
|
|
725
|
-
|
|
726
|
-
<DrawerPanelContent>
|
|
727
|
-
<DrawerHead>
|
|
728
|
-
<Title headingLevel="h2" size="xl">
|
|
729
|
-
node-{drawerPanelBodyContent}
|
|
730
|
-
</Title>
|
|
731
|
-
<DrawerActions>
|
|
732
|
-
<DrawerCloseButton onClick={this.onCloseDrawerClick} />
|
|
733
|
-
</DrawerActions>
|
|
734
|
-
</DrawerHead>
|
|
735
|
-
<DrawerPanelBody>
|
|
736
|
-
<Flex spaceItems={{ default: 'spaceItemsLg' }} direction={{ default: 'column' }}>
|
|
737
|
-
<FlexItem>
|
|
738
|
-
<p>
|
|
739
|
-
The content of the drawer really is up to you. It could have form fields, definition lists, text lists,
|
|
740
|
-
labels, charts, progress bars, etc. Spacing recommendation is 24px margins. You can put tabs in here,
|
|
741
|
-
and can also make the drawer scrollable.
|
|
742
|
-
</p>
|
|
743
|
-
</FlexItem>
|
|
744
|
-
<FlexItem>
|
|
745
|
-
<Progress value={drawerPanelBodyContent * 10} title="Title" />
|
|
746
|
-
</FlexItem>
|
|
747
|
-
<FlexItem>
|
|
748
|
-
<Progress value={drawerPanelBodyContent * 5} title="Title" />
|
|
749
|
-
</FlexItem>
|
|
750
|
-
</Flex>
|
|
751
|
-
</DrawerPanelBody>
|
|
752
|
-
</DrawerPanelContent>
|
|
753
|
-
);
|
|
35
|
+
```
|
|
754
36
|
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
<ToolbarContent>{ToolbarItems}</ToolbarContent>
|
|
759
|
-
</Toolbar>
|
|
760
|
-
<DataList
|
|
761
|
-
aria-label="data list"
|
|
762
|
-
selectedDataListItemId={selectedDataListItemId}
|
|
763
|
-
onSelectDataListItem={this.onSelectDataListItem}
|
|
764
|
-
>
|
|
765
|
-
<DataListItem id="content-padding-item1">
|
|
766
|
-
<DataListItemRow>
|
|
767
|
-
<DataListItemCells
|
|
768
|
-
dataListCells={[
|
|
769
|
-
<DataListCell key="primary content">
|
|
770
|
-
<Flex direction={{ default: 'column' }}>
|
|
771
|
-
<FlexItem>
|
|
772
|
-
<p>patternfly</p>
|
|
773
|
-
<small>
|
|
774
|
-
Working repo for PatternFly 4 <a>https://pf4.patternfly.org/</a>
|
|
775
|
-
</small>
|
|
776
|
-
</FlexItem>
|
|
777
|
-
<Flex>
|
|
778
|
-
<FlexItem>
|
|
779
|
-
<CodeBranchIcon /> 10
|
|
780
|
-
</FlexItem>
|
|
781
|
-
<FlexItem>
|
|
782
|
-
<CodeIcon /> 4
|
|
783
|
-
</FlexItem>
|
|
784
|
-
<FlexItem>
|
|
785
|
-
<CubeIcon /> 5
|
|
786
|
-
</FlexItem>
|
|
787
|
-
<FlexItem>Updated 2 days ago</FlexItem>
|
|
788
|
-
</Flex>
|
|
789
|
-
</Flex>
|
|
790
|
-
</DataListCell>,
|
|
791
|
-
<DataListAction alignRight>
|
|
792
|
-
<Stack>
|
|
793
|
-
<StackItem>
|
|
794
|
-
<Button variant={ButtonVariant.secondary}>Secondary</Button>
|
|
795
|
-
</StackItem>
|
|
796
|
-
<StackItem>
|
|
797
|
-
<Button variant={ButtonVariant.link}>Link Button</Button>
|
|
798
|
-
</StackItem>
|
|
799
|
-
</Stack>
|
|
800
|
-
</DataListAction>
|
|
801
|
-
]}
|
|
802
|
-
/>
|
|
803
|
-
</DataListItemRow>
|
|
804
|
-
</DataListItem>
|
|
805
|
-
<DataListItem id="content-padding-item2">
|
|
806
|
-
<DataListItemRow>
|
|
807
|
-
<DataListItemCells
|
|
808
|
-
dataListCells={[
|
|
809
|
-
<DataListCell key="primary content">
|
|
810
|
-
<Flex direction={{ default: 'column' }}>
|
|
811
|
-
<FlexItem>
|
|
812
|
-
<p>patternfly-elements</p>
|
|
813
|
-
<small>PatternFly elements</small>
|
|
814
|
-
</FlexItem>
|
|
815
|
-
<Flex>
|
|
816
|
-
<FlexItem>
|
|
817
|
-
<CodeBranchIcon /> 10
|
|
818
|
-
</FlexItem>
|
|
819
|
-
<FlexItem>
|
|
820
|
-
<CodeIcon /> 4
|
|
821
|
-
</FlexItem>
|
|
822
|
-
<FlexItem>
|
|
823
|
-
<CubeIcon /> 5
|
|
824
|
-
</FlexItem>
|
|
825
|
-
<FlexItem>
|
|
826
|
-
<CheckCircleIcon /> 7
|
|
827
|
-
</FlexItem>
|
|
828
|
-
<FlexItem>
|
|
829
|
-
<ExclamationTriangleIcon /> 5
|
|
830
|
-
</FlexItem>
|
|
831
|
-
<FlexItem>
|
|
832
|
-
<TimesCircleIcon /> 5
|
|
833
|
-
</FlexItem>
|
|
834
|
-
<FlexItem>Updated 2 days ago</FlexItem>
|
|
835
|
-
</Flex>
|
|
836
|
-
</Flex>
|
|
837
|
-
</DataListCell>,
|
|
838
|
-
<DataListAction alignRight>
|
|
839
|
-
<Stack>
|
|
840
|
-
<StackItem>
|
|
841
|
-
<Button variant={ButtonVariant.secondary}>Secondary</Button>
|
|
842
|
-
</StackItem>
|
|
843
|
-
<StackItem>
|
|
844
|
-
<Button variant={ButtonVariant.link}>Link Button</Button>
|
|
845
|
-
</StackItem>
|
|
846
|
-
</Stack>
|
|
847
|
-
</DataListAction>
|
|
848
|
-
]}
|
|
849
|
-
/>
|
|
850
|
-
</DataListItemRow>
|
|
851
|
-
</DataListItem>
|
|
852
|
-
<DataListItem id="content-padding-item3">
|
|
853
|
-
<DataListItemRow>
|
|
854
|
-
<DataListItemCells
|
|
855
|
-
dataListCells={[
|
|
856
|
-
<DataListCell key="primary content">
|
|
857
|
-
<Flex direction={{ default: 'column' }}>
|
|
858
|
-
<FlexItem>
|
|
859
|
-
<p>patternfly</p>
|
|
860
|
-
<small>
|
|
861
|
-
Working repo for PatternFly 4 <a>https://pf4.patternfly.org/</a>
|
|
862
|
-
</small>
|
|
863
|
-
</FlexItem>
|
|
864
|
-
<Flex>
|
|
865
|
-
<FlexItem>
|
|
866
|
-
<CodeBranchIcon /> 10
|
|
867
|
-
</FlexItem>
|
|
868
|
-
<FlexItem>
|
|
869
|
-
<CodeIcon /> 4
|
|
870
|
-
</FlexItem>
|
|
871
|
-
<FlexItem>
|
|
872
|
-
<CubeIcon /> 5
|
|
873
|
-
</FlexItem>
|
|
874
|
-
<FlexItem>Updated 2 days ago</FlexItem>
|
|
875
|
-
</Flex>
|
|
876
|
-
</Flex>
|
|
877
|
-
</DataListCell>,
|
|
878
|
-
<DataListAction alignRight>
|
|
879
|
-
<Stack>
|
|
880
|
-
<StackItem>
|
|
881
|
-
<Button variant={ButtonVariant.secondary}>Secondary</Button>
|
|
882
|
-
</StackItem>
|
|
883
|
-
<StackItem>
|
|
884
|
-
<Button variant={ButtonVariant.link}>Link Button</Button>
|
|
885
|
-
</StackItem>
|
|
886
|
-
</Stack>
|
|
887
|
-
</DataListAction>
|
|
888
|
-
]}
|
|
889
|
-
/>
|
|
890
|
-
</DataListItemRow>
|
|
891
|
-
</DataListItem>
|
|
892
|
-
<DataListItem id="content-padding-item4">
|
|
893
|
-
<DataListItemRow>
|
|
894
|
-
<DataListItemCells
|
|
895
|
-
dataListCells={[
|
|
896
|
-
<DataListCell key="primary content">
|
|
897
|
-
<Flex direction={{ default: 'column' }}>
|
|
898
|
-
<FlexItem>
|
|
899
|
-
<p>patternfly-elements</p>
|
|
900
|
-
<small>PatternFly elements</small>
|
|
901
|
-
</FlexItem>
|
|
902
|
-
<Flex>
|
|
903
|
-
<FlexItem>
|
|
904
|
-
<CodeBranchIcon /> 10
|
|
905
|
-
</FlexItem>
|
|
906
|
-
<FlexItem>
|
|
907
|
-
<CodeIcon /> 4
|
|
908
|
-
</FlexItem>
|
|
909
|
-
<FlexItem>
|
|
910
|
-
<CubeIcon /> 5
|
|
911
|
-
</FlexItem>
|
|
912
|
-
<FlexItem>
|
|
913
|
-
<CheckCircleIcon /> 7
|
|
914
|
-
</FlexItem>
|
|
915
|
-
<FlexItem>
|
|
916
|
-
<ExclamationTriangleIcon /> 5
|
|
917
|
-
</FlexItem>
|
|
918
|
-
<FlexItem>
|
|
919
|
-
<TimesCircleIcon /> 5
|
|
920
|
-
</FlexItem>
|
|
921
|
-
<FlexItem>Updated 2 days ago</FlexItem>
|
|
922
|
-
</Flex>
|
|
923
|
-
</Flex>
|
|
924
|
-
</DataListCell>,
|
|
925
|
-
<DataListAction alignRight>
|
|
926
|
-
<Stack>
|
|
927
|
-
<StackItem>
|
|
928
|
-
<Button variant={ButtonVariant.secondary}>Secondary</Button>
|
|
929
|
-
</StackItem>
|
|
930
|
-
<StackItem>
|
|
931
|
-
<Button variant={ButtonVariant.link}>Link Button</Button>
|
|
932
|
-
</StackItem>
|
|
933
|
-
</Stack>
|
|
934
|
-
</DataListAction>
|
|
935
|
-
]}
|
|
936
|
-
/>
|
|
937
|
-
</DataListItemRow>
|
|
938
|
-
</DataListItem>
|
|
939
|
-
</DataList>
|
|
940
|
-
</React.Fragment>
|
|
941
|
-
);
|
|
37
|
+
### Primary-detail content padding
|
|
38
|
+
|
|
39
|
+
```js file="./examples/PrimaryDetail/PrimaryDetailContentPadding.tsx" isFullscreen
|
|
942
40
|
|
|
943
|
-
return (
|
|
944
|
-
<DashboardWrapper>
|
|
945
|
-
<PageSection variant={PageSectionVariants.light}>
|
|
946
|
-
<TextContent>
|
|
947
|
-
<Text component="h1">Main title</Text>
|
|
948
|
-
<Text component="p">
|
|
949
|
-
Body text should be Overpass Regular at 16px. It should have leading of 24px because <br />
|
|
950
|
-
of it’s relative line height of 1.5.
|
|
951
|
-
</Text>
|
|
952
|
-
</TextContent>
|
|
953
|
-
</PageSection>
|
|
954
|
-
<Divider component="div" />
|
|
955
|
-
<PageSection padding={{ default: 'noPadding' }}>
|
|
956
|
-
<Drawer isExpanded={isDrawerExpanded}>
|
|
957
|
-
<DrawerContent panelContent={panelContent} className={'pf-m-no-background'}>
|
|
958
|
-
<DrawerContentBody hasPadding>{drawerContent}</DrawerContentBody>
|
|
959
|
-
</DrawerContent>
|
|
960
|
-
</Drawer>
|
|
961
|
-
</PageSection>
|
|
962
|
-
</DashboardWrapper>
|
|
963
|
-
);
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
41
|
```
|
|
967
42
|
|
|
968
43
|
### Primary-detail card view
|
|
@@ -1975,467 +1050,6 @@ class PrimaryDetailDataListInCard extends React.Component {
|
|
|
1975
1050
|
|
|
1976
1051
|
### Primary-detail inline modifier
|
|
1977
1052
|
|
|
1978
|
-
```js isFullscreen
|
|
1979
|
-
import React from 'react';
|
|
1980
|
-
import {
|
|
1981
|
-
Button,
|
|
1982
|
-
ButtonVariant,
|
|
1983
|
-
DataList,
|
|
1984
|
-
DataListAction,
|
|
1985
|
-
DataListCell,
|
|
1986
|
-
DataListItem,
|
|
1987
|
-
DataListItemCells,
|
|
1988
|
-
DataListItemRow,
|
|
1989
|
-
Toolbar,
|
|
1990
|
-
ToolbarItem,
|
|
1991
|
-
ToolbarContent,
|
|
1992
|
-
ToolbarToggleGroup,
|
|
1993
|
-
ToolbarGroup,
|
|
1994
|
-
Divider,
|
|
1995
|
-
Drawer,
|
|
1996
|
-
DrawerActions,
|
|
1997
|
-
DrawerCloseButton,
|
|
1998
|
-
DrawerContent,
|
|
1999
|
-
DrawerContentBody,
|
|
2000
|
-
DrawerHead,
|
|
2001
|
-
DrawerPanelBody,
|
|
2002
|
-
DrawerPanelContent,
|
|
2003
|
-
Flex,
|
|
2004
|
-
FlexItem,
|
|
2005
|
-
InputGroup,
|
|
2006
|
-
InputGroupItem,
|
|
2007
|
-
PageSection,
|
|
2008
|
-
PageSectionVariants,
|
|
2009
|
-
Progress,
|
|
2010
|
-
Stack,
|
|
2011
|
-
StackItem,
|
|
2012
|
-
Text,
|
|
2013
|
-
TextContent,
|
|
2014
|
-
TextInput,
|
|
2015
|
-
Title
|
|
2016
|
-
} from '@patternfly/react-core';
|
|
2017
|
-
import {
|
|
2018
|
-
Select as SelectDeprecated,
|
|
2019
|
-
SelectOption as SelectOptionDeprecated,
|
|
2020
|
-
SelectVariant
|
|
2021
|
-
} from '@patternfly/react-core/deprecated';
|
|
2022
|
-
import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
|
|
2023
|
-
import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
|
|
2024
|
-
import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
2025
|
-
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
2026
|
-
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
|
|
2027
|
-
import ExclamationTriangleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon';
|
|
2028
|
-
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
2029
|
-
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
2030
|
-
import TimesCircleIcon from '@patternfly/react-icons/dist/esm/icons/times-circle-icon';
|
|
2031
|
-
|
|
2032
|
-
class PrimaryDetailInlineModifier extends React.Component {
|
|
2033
|
-
constructor(props) {
|
|
2034
|
-
super(props);
|
|
2035
|
-
this.state = {
|
|
2036
|
-
isDrawerExpanded: false,
|
|
2037
|
-
drawerPanelBodyContent: '',
|
|
2038
|
-
isDropdownOpen: false,
|
|
2039
|
-
isKebabDropdownOpen: false,
|
|
2040
|
-
activeItem: 0,
|
|
2041
|
-
inputValue: '',
|
|
2042
|
-
statusIsExpanded: false,
|
|
2043
|
-
statusSelected: null,
|
|
2044
|
-
riskIsExpanded: false,
|
|
2045
|
-
riskSelected: null,
|
|
2046
|
-
selectedDataListItemId: ''
|
|
2047
|
-
};
|
|
2048
|
-
|
|
2049
|
-
this.statusOptions = [
|
|
2050
|
-
{ value: 'Status', disabled: false, isPlaceholder: true },
|
|
2051
|
-
{ value: 'New', disabled: false },
|
|
2052
|
-
{ value: 'Pending', disabled: false },
|
|
2053
|
-
{ value: 'Running', disabled: false },
|
|
2054
|
-
{ value: 'Cancelled', disabled: false }
|
|
2055
|
-
];
|
|
2056
|
-
|
|
2057
|
-
this.riskOptions = [
|
|
2058
|
-
{ value: 'Risk', disabled: false, isPlaceholder: true },
|
|
2059
|
-
{ value: 'Low', disabled: false },
|
|
2060
|
-
{ value: 'Medium', disabled: false },
|
|
2061
|
-
{ value: 'High', disabled: false }
|
|
2062
|
-
];
|
|
2063
|
-
|
|
2064
|
-
this.onInputChange = (_event, newValue) => {
|
|
2065
|
-
this.setState({ inputValue: newValue });
|
|
2066
|
-
};
|
|
2067
|
-
|
|
2068
|
-
this.onStatusToggle = (_event, isExpanded) => {
|
|
2069
|
-
this.setState({
|
|
2070
|
-
statusIsExpanded: isExpanded
|
|
2071
|
-
});
|
|
2072
|
-
};
|
|
2073
|
-
|
|
2074
|
-
this.onStatusSelect = (event, selection, isPlaceholder) => {
|
|
2075
|
-
if (isPlaceholder) this.clearStatusSelection();
|
|
2076
|
-
this.setState({
|
|
2077
|
-
statusSelected: selection,
|
|
2078
|
-
statusIsExpanded: false
|
|
2079
|
-
});
|
|
2080
|
-
};
|
|
2081
|
-
|
|
2082
|
-
this.clearStatusSelection = () => {
|
|
2083
|
-
this.setState({
|
|
2084
|
-
statusSelected: null,
|
|
2085
|
-
statusIsExpanded: false
|
|
2086
|
-
});
|
|
2087
|
-
};
|
|
2088
|
-
|
|
2089
|
-
this.onRiskToggle = (_event, isExpanded) => {
|
|
2090
|
-
this.setState({
|
|
2091
|
-
riskIsExpanded: isExpanded
|
|
2092
|
-
});
|
|
2093
|
-
};
|
|
2094
|
-
|
|
2095
|
-
this.onRiskSelect = (event, selection, isPlaceholder) => {
|
|
2096
|
-
if (isPlaceholder) this.clearRiskSelection();
|
|
2097
|
-
this.setState({
|
|
2098
|
-
riskSelected: selection,
|
|
2099
|
-
riskIsExpanded: false
|
|
2100
|
-
});
|
|
2101
|
-
};
|
|
2102
|
-
|
|
2103
|
-
this.clearRiskSelection = () => {
|
|
2104
|
-
this.setState({
|
|
2105
|
-
riskSelected: null,
|
|
2106
|
-
riskIsExpanded: false
|
|
2107
|
-
});
|
|
2108
|
-
};
|
|
2109
|
-
|
|
2110
|
-
this.onSelectDataListItem = (_event, id) => {
|
|
2111
|
-
this.setState({
|
|
2112
|
-
selectedDataListItemId: id,
|
|
2113
|
-
isDrawerExpanded: true,
|
|
2114
|
-
drawerPanelBodyContent: id.charAt(id.length - 1)
|
|
2115
|
-
});
|
|
2116
|
-
};
|
|
2117
|
-
|
|
2118
|
-
this.onCloseDrawerClick = () => {
|
|
2119
|
-
this.setState({
|
|
2120
|
-
isDrawerExpanded: false,
|
|
2121
|
-
selectedDataListItemId: ''
|
|
2122
|
-
});
|
|
2123
|
-
};
|
|
2124
|
-
}
|
|
2125
|
-
|
|
2126
|
-
render() {
|
|
2127
|
-
const {
|
|
2128
|
-
isDrawerExpanded,
|
|
2129
|
-
drawerPanelBodyContent,
|
|
2130
|
-
isDropdownOpen,
|
|
2131
|
-
isKebabDropdownOpen,
|
|
2132
|
-
activeItem,
|
|
2133
|
-
inputValue,
|
|
2134
|
-
statusIsExpanded,
|
|
2135
|
-
statusSelected,
|
|
2136
|
-
riskIsExpanded,
|
|
2137
|
-
riskSelected,
|
|
2138
|
-
selectedDataListItemId
|
|
2139
|
-
} = this.state;
|
|
2140
|
-
|
|
2141
|
-
const toggleGroupItems = (
|
|
2142
|
-
<React.Fragment>
|
|
2143
|
-
<ToolbarItem>
|
|
2144
|
-
<InputGroup>
|
|
2145
|
-
<InputGroupItem isFill>
|
|
2146
|
-
<TextInput
|
|
2147
|
-
name="inline-modifier-input"
|
|
2148
|
-
id="inline-modifier-input"
|
|
2149
|
-
type="search"
|
|
2150
|
-
aria-label="search input example"
|
|
2151
|
-
onChange={this.onInputChange}
|
|
2152
|
-
value={inputValue}
|
|
2153
|
-
/>
|
|
2154
|
-
</InputGroupItem>
|
|
2155
|
-
<InputGroupItem>
|
|
2156
|
-
<Button variant={ButtonVariant.control} aria-label="search button for search input">
|
|
2157
|
-
<SearchIcon />
|
|
2158
|
-
</Button>
|
|
2159
|
-
</InputGroupItem>
|
|
2160
|
-
</InputGroup>
|
|
2161
|
-
</ToolbarItem>
|
|
2162
|
-
<ToolbarGroup variant="filter-group">
|
|
2163
|
-
<ToolbarItem>
|
|
2164
|
-
<SelectDeprecated
|
|
2165
|
-
variant={SelectVariant.single}
|
|
2166
|
-
aria-label="Select Input"
|
|
2167
|
-
onToggle={this.onStatusToggle}
|
|
2168
|
-
onSelect={this.onStatusSelect}
|
|
2169
|
-
selections={statusSelected}
|
|
2170
|
-
isExpanded={statusIsExpanded}
|
|
2171
|
-
>
|
|
2172
|
-
{this.statusOptions.map((option, index) => (
|
|
2173
|
-
<SelectOptionDeprecated isDisabled={option.disabled} key={index} value={option.value} />
|
|
2174
|
-
))}
|
|
2175
|
-
</SelectDeprecated>
|
|
2176
|
-
</ToolbarItem>
|
|
2177
|
-
<ToolbarItem>
|
|
2178
|
-
<SelectDeprecated
|
|
2179
|
-
variant={SelectVariant.single}
|
|
2180
|
-
aria-label="Select Input"
|
|
2181
|
-
onToggle={this.onRiskToggle}
|
|
2182
|
-
onSelect={this.onRiskSelect}
|
|
2183
|
-
selections={riskSelected}
|
|
2184
|
-
isExpanded={riskIsExpanded}
|
|
2185
|
-
>
|
|
2186
|
-
{this.riskOptions.map((option, index) => (
|
|
2187
|
-
<SelectOptionDeprecated isDisabled={option.disabled} key={index} value={option.value} />
|
|
2188
|
-
))}
|
|
2189
|
-
</SelectDeprecated>
|
|
2190
|
-
</ToolbarItem>
|
|
2191
|
-
</ToolbarGroup>
|
|
2192
|
-
</React.Fragment>
|
|
2193
|
-
);
|
|
2194
|
-
|
|
2195
|
-
const ToolbarItems = (
|
|
2196
|
-
<ToolbarToggleGroup toggleIcon={<FilterIcon />} breakpoint="xl">
|
|
2197
|
-
{toggleGroupItems}
|
|
2198
|
-
</ToolbarToggleGroup>
|
|
2199
|
-
);
|
|
2200
|
-
|
|
2201
|
-
const panelContent = (
|
|
2202
|
-
<DrawerPanelContent>
|
|
2203
|
-
<DrawerHead>
|
|
2204
|
-
<Title headingLevel="h2" size="xl">
|
|
2205
|
-
node-{drawerPanelBodyContent}
|
|
2206
|
-
</Title>
|
|
2207
|
-
<DrawerActions>
|
|
2208
|
-
<DrawerCloseButton onClick={this.onCloseDrawerClick} />
|
|
2209
|
-
</DrawerActions>
|
|
2210
|
-
</DrawerHead>
|
|
2211
|
-
<DrawerPanelBody>
|
|
2212
|
-
<Flex spaceItems={{ default: 'spaceItemsLg' }} direction={{ default: 'column' }}>
|
|
2213
|
-
<FlexItem>
|
|
2214
|
-
<p>
|
|
2215
|
-
The content of the drawer really is up to you. It could have form fields, definition lists, text lists,
|
|
2216
|
-
labels, charts, progress bars, etc. Spacing recommendation is 24px margins. You can put tabs in here,
|
|
2217
|
-
and can also make the drawer scrollable.
|
|
2218
|
-
</p>
|
|
2219
|
-
</FlexItem>
|
|
2220
|
-
<FlexItem>
|
|
2221
|
-
<Progress value={drawerPanelBodyContent * 10} title="Title" />
|
|
2222
|
-
</FlexItem>
|
|
2223
|
-
<FlexItem>
|
|
2224
|
-
<Progress value={drawerPanelBodyContent * 5} title="Title" />
|
|
2225
|
-
</FlexItem>
|
|
2226
|
-
</Flex>
|
|
2227
|
-
</DrawerPanelBody>
|
|
2228
|
-
</DrawerPanelContent>
|
|
2229
|
-
);
|
|
2230
|
-
const drawerContent = (
|
|
2231
|
-
<React.Fragment>
|
|
2232
|
-
<Toolbar id="inline-modifier-data-toolbar" usePageInsets>
|
|
2233
|
-
<ToolbarContent>{ToolbarItems}</ToolbarContent>
|
|
2234
|
-
</Toolbar>
|
|
2235
|
-
<DataList
|
|
2236
|
-
aria-label="data list"
|
|
2237
|
-
selectedDataListItemId={selectedDataListItemId}
|
|
2238
|
-
onSelectDataListItem={this.onSelectDataListItem}
|
|
2239
|
-
>
|
|
2240
|
-
<DataListItem id="inline-modifier-item1">
|
|
2241
|
-
<DataListItemRow>
|
|
2242
|
-
<DataListItemCells
|
|
2243
|
-
dataListCells={[
|
|
2244
|
-
<DataListCell key="primary content">
|
|
2245
|
-
<Flex direction={{ default: 'column' }}>
|
|
2246
|
-
<FlexItem>
|
|
2247
|
-
<p>patternfly</p>
|
|
2248
|
-
<small>
|
|
2249
|
-
Working repo for PatternFly 4 <a>https://pf4.patternfly.org/</a>
|
|
2250
|
-
</small>
|
|
2251
|
-
</FlexItem>
|
|
2252
|
-
<Flex>
|
|
2253
|
-
<FlexItem>
|
|
2254
|
-
<CodeBranchIcon /> 10
|
|
2255
|
-
</FlexItem>
|
|
2256
|
-
<FlexItem>
|
|
2257
|
-
<CodeIcon /> 4
|
|
2258
|
-
</FlexItem>
|
|
2259
|
-
<FlexItem>
|
|
2260
|
-
<CubeIcon /> 5
|
|
2261
|
-
</FlexItem>
|
|
2262
|
-
<FlexItem>Updated 2 days ago</FlexItem>
|
|
2263
|
-
</Flex>
|
|
2264
|
-
</Flex>
|
|
2265
|
-
</DataListCell>,
|
|
2266
|
-
<DataListAction alignRight>
|
|
2267
|
-
<Stack>
|
|
2268
|
-
<StackItem>
|
|
2269
|
-
<Button variant={ButtonVariant.secondary}>Secondary</Button>
|
|
2270
|
-
</StackItem>
|
|
2271
|
-
<StackItem>
|
|
2272
|
-
<Button variant={ButtonVariant.link}>Link Button</Button>
|
|
2273
|
-
</StackItem>
|
|
2274
|
-
</Stack>
|
|
2275
|
-
</DataListAction>
|
|
2276
|
-
]}
|
|
2277
|
-
/>
|
|
2278
|
-
</DataListItemRow>
|
|
2279
|
-
</DataListItem>
|
|
2280
|
-
<DataListItem id="inline-modifier-item2">
|
|
2281
|
-
<DataListItemRow>
|
|
2282
|
-
<DataListItemCells
|
|
2283
|
-
dataListCells={[
|
|
2284
|
-
<DataListCell key="primary content">
|
|
2285
|
-
<Flex direction={{ default: 'column' }}>
|
|
2286
|
-
<FlexItem>
|
|
2287
|
-
<p>patternfly-elements</p>
|
|
2288
|
-
<small>PatternFly elements</small>
|
|
2289
|
-
</FlexItem>
|
|
2290
|
-
<Flex>
|
|
2291
|
-
<FlexItem>
|
|
2292
|
-
<CodeBranchIcon /> 10
|
|
2293
|
-
</FlexItem>
|
|
2294
|
-
<FlexItem>
|
|
2295
|
-
<CodeIcon /> 4
|
|
2296
|
-
</FlexItem>
|
|
2297
|
-
<FlexItem>
|
|
2298
|
-
<CubeIcon /> 5
|
|
2299
|
-
</FlexItem>
|
|
2300
|
-
<FlexItem>
|
|
2301
|
-
<CheckCircleIcon /> 7
|
|
2302
|
-
</FlexItem>
|
|
2303
|
-
<FlexItem>
|
|
2304
|
-
<ExclamationTriangleIcon /> 5
|
|
2305
|
-
</FlexItem>
|
|
2306
|
-
<FlexItem>
|
|
2307
|
-
<TimesCircleIcon /> 5
|
|
2308
|
-
</FlexItem>
|
|
2309
|
-
<FlexItem>Updated 2 days ago</FlexItem>
|
|
2310
|
-
</Flex>
|
|
2311
|
-
</Flex>
|
|
2312
|
-
</DataListCell>,
|
|
2313
|
-
<DataListAction alignRight>
|
|
2314
|
-
<Stack>
|
|
2315
|
-
<StackItem>
|
|
2316
|
-
<Button variant={ButtonVariant.secondary}>Secondary</Button>
|
|
2317
|
-
</StackItem>
|
|
2318
|
-
<StackItem>
|
|
2319
|
-
<Button variant={ButtonVariant.link}>Link Button</Button>
|
|
2320
|
-
</StackItem>
|
|
2321
|
-
</Stack>
|
|
2322
|
-
</DataListAction>
|
|
2323
|
-
]}
|
|
2324
|
-
/>
|
|
2325
|
-
</DataListItemRow>
|
|
2326
|
-
</DataListItem>
|
|
2327
|
-
<DataListItem id="inline-modifier-item3">
|
|
2328
|
-
<DataListItemRow>
|
|
2329
|
-
<DataListItemCells
|
|
2330
|
-
dataListCells={[
|
|
2331
|
-
<DataListCell key="primary content">
|
|
2332
|
-
<Flex direction={{ default: 'column' }}>
|
|
2333
|
-
<FlexItem>
|
|
2334
|
-
<p>patternfly</p>
|
|
2335
|
-
<small>
|
|
2336
|
-
Working repo for PatternFly 4 <a>https://pf4.patternfly.org/</a>
|
|
2337
|
-
</small>
|
|
2338
|
-
</FlexItem>
|
|
2339
|
-
<Flex>
|
|
2340
|
-
<FlexItem>
|
|
2341
|
-
<CodeBranchIcon /> 10
|
|
2342
|
-
</FlexItem>
|
|
2343
|
-
<FlexItem>
|
|
2344
|
-
<CodeIcon /> 4
|
|
2345
|
-
</FlexItem>
|
|
2346
|
-
<FlexItem>
|
|
2347
|
-
<CubeIcon /> 5
|
|
2348
|
-
</FlexItem>
|
|
2349
|
-
<FlexItem>Updated 2 days ago</FlexItem>
|
|
2350
|
-
</Flex>
|
|
2351
|
-
</Flex>
|
|
2352
|
-
</DataListCell>,
|
|
2353
|
-
<DataListAction alignRight>
|
|
2354
|
-
<Stack>
|
|
2355
|
-
<StackItem>
|
|
2356
|
-
<Button variant={ButtonVariant.secondary}>Secondary</Button>
|
|
2357
|
-
</StackItem>
|
|
2358
|
-
<StackItem>
|
|
2359
|
-
<Button variant={ButtonVariant.link}>Link Button</Button>
|
|
2360
|
-
</StackItem>
|
|
2361
|
-
</Stack>
|
|
2362
|
-
</DataListAction>
|
|
2363
|
-
]}
|
|
2364
|
-
/>
|
|
2365
|
-
</DataListItemRow>
|
|
2366
|
-
</DataListItem>
|
|
2367
|
-
<DataListItem id="inline-modifier-item4">
|
|
2368
|
-
<DataListItemRow>
|
|
2369
|
-
<DataListItemCells
|
|
2370
|
-
dataListCells={[
|
|
2371
|
-
<DataListCell key="primary content">
|
|
2372
|
-
<Flex direction={{ default: 'column' }}>
|
|
2373
|
-
<FlexItem>
|
|
2374
|
-
<p>patternfly-elements</p>
|
|
2375
|
-
<small>PatternFly elements</small>
|
|
2376
|
-
</FlexItem>
|
|
2377
|
-
<Flex>
|
|
2378
|
-
<FlexItem>
|
|
2379
|
-
<CodeBranchIcon /> 10
|
|
2380
|
-
</FlexItem>
|
|
2381
|
-
<FlexItem>
|
|
2382
|
-
<CodeIcon /> 4
|
|
2383
|
-
</FlexItem>
|
|
2384
|
-
<FlexItem>
|
|
2385
|
-
<CubeIcon /> 5
|
|
2386
|
-
</FlexItem>
|
|
2387
|
-
<FlexItem>
|
|
2388
|
-
<CheckCircleIcon /> 7
|
|
2389
|
-
</FlexItem>
|
|
2390
|
-
<FlexItem>
|
|
2391
|
-
<ExclamationTriangleIcon /> 5
|
|
2392
|
-
</FlexItem>
|
|
2393
|
-
<FlexItem>
|
|
2394
|
-
<TimesCircleIcon /> 5
|
|
2395
|
-
</FlexItem>
|
|
2396
|
-
<FlexItem>Updated 2 days ago</FlexItem>
|
|
2397
|
-
</Flex>
|
|
2398
|
-
</Flex>
|
|
2399
|
-
</DataListCell>,
|
|
2400
|
-
<DataListAction alignRight>
|
|
2401
|
-
<Stack>
|
|
2402
|
-
<StackItem>
|
|
2403
|
-
<Button variant={ButtonVariant.secondary}>Secondary</Button>
|
|
2404
|
-
</StackItem>
|
|
2405
|
-
<StackItem>
|
|
2406
|
-
<Button variant={ButtonVariant.link}>Link Button</Button>
|
|
2407
|
-
</StackItem>
|
|
2408
|
-
</Stack>
|
|
2409
|
-
</DataListAction>
|
|
2410
|
-
]}
|
|
2411
|
-
/>
|
|
2412
|
-
</DataListItemRow>
|
|
2413
|
-
</DataListItem>
|
|
2414
|
-
</DataList>
|
|
2415
|
-
</React.Fragment>
|
|
2416
|
-
);
|
|
1053
|
+
```js file="./examples/PrimaryDetail/PrimaryDetailInlineModifier.tsx" isFullscreen
|
|
2417
1054
|
|
|
2418
|
-
return (
|
|
2419
|
-
<DashboardWrapper>
|
|
2420
|
-
<PageSection variant={PageSectionVariants.light}>
|
|
2421
|
-
<TextContent>
|
|
2422
|
-
<Text component="h1">Main title</Text>
|
|
2423
|
-
<Text component="p">
|
|
2424
|
-
Body text should be Overpass Regular at 16px. It should have leading of 24px because <br />
|
|
2425
|
-
of it’s relative line height of 1.5.
|
|
2426
|
-
</Text>
|
|
2427
|
-
</TextContent>
|
|
2428
|
-
</PageSection>
|
|
2429
|
-
<Divider component="div" />
|
|
2430
|
-
<PageSection variant={PageSectionVariants.light} padding={{ default: 'noPadding' }}>
|
|
2431
|
-
<Drawer isExpanded={isDrawerExpanded} isInline>
|
|
2432
|
-
<DrawerContent panelContent={panelContent}>
|
|
2433
|
-
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
2434
|
-
</DrawerContent>
|
|
2435
|
-
</Drawer>
|
|
2436
|
-
</PageSection>
|
|
2437
|
-
</DashboardWrapper>
|
|
2438
|
-
);
|
|
2439
|
-
}
|
|
2440
|
-
}
|
|
2441
1055
|
```
|