@patternfly/react-core 6.1.1-prerelease.2 → 6.2.0-prerelease.2
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 +12 -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/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/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/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/demos/sampleData.d.ts +11 -0
- package/dist/esm/demos/sampleData.d.ts.map +1 -0
- package/dist/esm/demos/sampleData.js +605 -0
- package/dist/esm/demos/sampleData.js.map +1 -0
- package/dist/js/demos/sampleData.d.ts +11 -0
- package/dist/js/demos/sampleData.d.ts.map +1 -0
- package/dist/js/demos/sampleData.js +608 -0
- package/dist/js/demos/sampleData.js.map +1 -0
- package/dist/umd/assets/{output-BpVMmGx2.css → output-L1iW-OEl.css} +16971 -16971
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +5 -5
- package/src/demos/DataList/examples/DataListActionable.tsx +134 -0
- package/src/demos/DataList/examples/DataListStaticBottomPagination.tsx +190 -0
- package/src/demos/DataListDemo.md +11 -0
- package/src/demos/sampleData.tsx +615 -0
package/helpers/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.
|
|
1
|
+
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.2.0-prerelease.1","private":true}
|
package/layouts/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.
|
|
1
|
+
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.2.0-prerelease.1","private":true}
|
package/next/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.
|
|
1
|
+
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.2.0-prerelease.1","private":true}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0-prerelease.2",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"subpaths": "node ../../scripts/exportSubpaths.mjs --config subpaths.config.json"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@patternfly/react-icons": "^6.
|
|
50
|
-
"@patternfly/react-styles": "^6.
|
|
51
|
-
"@patternfly/react-tokens": "^6.
|
|
49
|
+
"@patternfly/react-icons": "^6.2.0-prerelease.0",
|
|
50
|
+
"@patternfly/react-styles": "^6.2.0-prerelease.0",
|
|
51
|
+
"@patternfly/react-tokens": "^6.2.0-prerelease.0",
|
|
52
52
|
"focus-trap": "7.6.2",
|
|
53
53
|
"react-dropzone": "^14.3.5",
|
|
54
54
|
"tslib": "^2.8.1"
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"react": "^17 || ^18",
|
|
64
64
|
"react-dom": "^17 || ^18"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "ffab2937260ccd96a62d143b33954fe2c9f1e5e4"
|
|
67
67
|
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Content,
|
|
5
|
+
DataList,
|
|
6
|
+
DataListItem,
|
|
7
|
+
DataListCell,
|
|
8
|
+
DataListItemRow,
|
|
9
|
+
DataListItemCells,
|
|
10
|
+
DataListAction,
|
|
11
|
+
Dropdown,
|
|
12
|
+
DropdownList,
|
|
13
|
+
DropdownItem,
|
|
14
|
+
MenuToggle,
|
|
15
|
+
MenuToggleElement,
|
|
16
|
+
PageSection,
|
|
17
|
+
Title
|
|
18
|
+
} from '@patternfly/react-core';
|
|
19
|
+
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
20
|
+
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
|
|
21
|
+
|
|
22
|
+
export const DataListActionable: React.FunctionComponent = () => {
|
|
23
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
24
|
+
const [isDeleted, setIsDeleted] = React.useState(false);
|
|
25
|
+
|
|
26
|
+
const onToggle = () => {
|
|
27
|
+
setIsOpen(!isOpen);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const onSelect = () => {
|
|
31
|
+
setIsOpen(!isOpen);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<DashboardWrapper mainContainerId="main-content-datalist-view-actions" breadcrumb={null}>
|
|
36
|
+
<PageSection>
|
|
37
|
+
<Content>
|
|
38
|
+
<Title headingLevel="h1">Projects</Title>
|
|
39
|
+
<Content component="p">This is a demo that showcases PatternFly Data List</Content>
|
|
40
|
+
</Content>
|
|
41
|
+
</PageSection>
|
|
42
|
+
<PageSection>
|
|
43
|
+
<DataList aria-label="single action data list example ">
|
|
44
|
+
{!isDeleted && (
|
|
45
|
+
<DataListItem aria-labelledby="single-action-item1">
|
|
46
|
+
<DataListItemRow>
|
|
47
|
+
<DataListItemCells
|
|
48
|
+
dataListCells={[
|
|
49
|
+
<DataListCell key="primary content">
|
|
50
|
+
<span id="single-action-item1">Single actionable Primary content</span>
|
|
51
|
+
</DataListCell>,
|
|
52
|
+
<DataListCell key="secondary content">Single actionable Secondary content</DataListCell>
|
|
53
|
+
]}
|
|
54
|
+
/>
|
|
55
|
+
<DataListAction
|
|
56
|
+
aria-labelledby="single-action-item1 single-action-action1"
|
|
57
|
+
id="single-action-action1"
|
|
58
|
+
aria-label="Actions"
|
|
59
|
+
>
|
|
60
|
+
<Button
|
|
61
|
+
onClick={() => {
|
|
62
|
+
if (confirm('Are you sure?')) {
|
|
63
|
+
setIsDeleted(true);
|
|
64
|
+
}
|
|
65
|
+
}}
|
|
66
|
+
variant="primary"
|
|
67
|
+
key="delete-action"
|
|
68
|
+
>
|
|
69
|
+
Delete
|
|
70
|
+
</Button>
|
|
71
|
+
</DataListAction>
|
|
72
|
+
</DataListItemRow>
|
|
73
|
+
</DataListItem>
|
|
74
|
+
)}
|
|
75
|
+
<DataListItem aria-labelledby="multi-actions-item1">
|
|
76
|
+
<DataListItemRow>
|
|
77
|
+
<DataListItemCells
|
|
78
|
+
dataListCells={[
|
|
79
|
+
<DataListCell key="primary content">
|
|
80
|
+
<span id="multi-actions-item1">Multi actions Primary content</span>
|
|
81
|
+
</DataListCell>,
|
|
82
|
+
<DataListCell key="secondary content">Multi actions Secondary content</DataListCell>
|
|
83
|
+
]}
|
|
84
|
+
/>
|
|
85
|
+
<DataListAction
|
|
86
|
+
aria-labelledby="multi-actions-item1 multi-actions-action1"
|
|
87
|
+
id="multi-actions-action1"
|
|
88
|
+
aria-label="Actions"
|
|
89
|
+
>
|
|
90
|
+
<Dropdown
|
|
91
|
+
popperProps={{ position: 'right' }}
|
|
92
|
+
onSelect={onSelect}
|
|
93
|
+
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
94
|
+
<MenuToggle
|
|
95
|
+
ref={toggleRef}
|
|
96
|
+
isExpanded={isOpen}
|
|
97
|
+
onClick={onToggle}
|
|
98
|
+
variant="plain"
|
|
99
|
+
aria-label="Data list with actions example kebab toggle"
|
|
100
|
+
>
|
|
101
|
+
<EllipsisVIcon aria-hidden="true" />
|
|
102
|
+
</MenuToggle>
|
|
103
|
+
)}
|
|
104
|
+
isOpen={isOpen}
|
|
105
|
+
onOpenChange={(isOpen: boolean) => setIsOpen(isOpen)}
|
|
106
|
+
>
|
|
107
|
+
<DropdownList>
|
|
108
|
+
<DropdownItem key="action">Action</DropdownItem>
|
|
109
|
+
{/* Prevent default onClick functionality for example
|
|
110
|
+
purposes */}
|
|
111
|
+
<DropdownItem key="link" to="#" onClick={(event: any) => event.preventDefault()}>
|
|
112
|
+
Link
|
|
113
|
+
</DropdownItem>
|
|
114
|
+
<DropdownItem key="disabled action" isDisabled>
|
|
115
|
+
Disabled Action
|
|
116
|
+
</DropdownItem>
|
|
117
|
+
<DropdownItem
|
|
118
|
+
key="disabled link"
|
|
119
|
+
isDisabled
|
|
120
|
+
to="#"
|
|
121
|
+
onClick={(event: any) => event.preventDefault()}
|
|
122
|
+
>
|
|
123
|
+
Disabled Link
|
|
124
|
+
</DropdownItem>
|
|
125
|
+
</DropdownList>
|
|
126
|
+
</Dropdown>
|
|
127
|
+
</DataListAction>
|
|
128
|
+
</DataListItemRow>
|
|
129
|
+
</DataListItem>
|
|
130
|
+
</DataList>
|
|
131
|
+
</PageSection>
|
|
132
|
+
</DashboardWrapper>
|
|
133
|
+
);
|
|
134
|
+
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Content,
|
|
5
|
+
ContentVariants,
|
|
6
|
+
DataList,
|
|
7
|
+
DataListItem,
|
|
8
|
+
DataListCell,
|
|
9
|
+
DataListItemRow,
|
|
10
|
+
DataListItemCells,
|
|
11
|
+
Flex,
|
|
12
|
+
FlexItem,
|
|
13
|
+
MenuToggle,
|
|
14
|
+
MenuToggleCheckbox,
|
|
15
|
+
OverflowMenu,
|
|
16
|
+
OverflowMenuControl,
|
|
17
|
+
OverflowMenuItem,
|
|
18
|
+
PageSection,
|
|
19
|
+
Pagination,
|
|
20
|
+
Toolbar,
|
|
21
|
+
ToolbarItem,
|
|
22
|
+
ToolbarContent,
|
|
23
|
+
PaginationVariant
|
|
24
|
+
} from '@patternfly/react-core';
|
|
25
|
+
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
26
|
+
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
|
|
27
|
+
|
|
28
|
+
import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
|
|
29
|
+
import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
30
|
+
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
31
|
+
import { rows } from '@patternfly/react-core/dist/esm/demos/sampleData';
|
|
32
|
+
|
|
33
|
+
export const DataListStaticBottomPagination: React.FunctionComponent = () => {
|
|
34
|
+
const [page, setPage] = React.useState<number | undefined>(1);
|
|
35
|
+
const [perPage, setPerPage] = React.useState<number>(10);
|
|
36
|
+
const [paginatedRows, setPaginatedRows] = React.useState(rows.slice(0, 10));
|
|
37
|
+
|
|
38
|
+
const handleSetPage = (
|
|
39
|
+
_evt: React.MouseEvent | React.KeyboardEvent | MouseEvent,
|
|
40
|
+
newPage: number,
|
|
41
|
+
_perPage: number | undefined,
|
|
42
|
+
startIdx: number | undefined,
|
|
43
|
+
endIdx: number | undefined
|
|
44
|
+
) => {
|
|
45
|
+
setPaginatedRows(rows?.slice(startIdx, endIdx));
|
|
46
|
+
setPage(newPage);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const handlePerPageSelect = (
|
|
50
|
+
_evt: React.MouseEvent | React.KeyboardEvent | MouseEvent,
|
|
51
|
+
newPerPage: number,
|
|
52
|
+
newPage: number | undefined,
|
|
53
|
+
startIdx: number | undefined,
|
|
54
|
+
endIdx: number | undefined
|
|
55
|
+
) => {
|
|
56
|
+
setPaginatedRows(rows.slice(startIdx, endIdx));
|
|
57
|
+
setPage(newPage);
|
|
58
|
+
setPerPage(newPerPage);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const renderPagination = (variant: PaginationVariant, isCompact: boolean, isSticky: boolean, isStatic: boolean) => (
|
|
62
|
+
<Pagination
|
|
63
|
+
id={`datalist-${variant}-pagination`}
|
|
64
|
+
variant={variant}
|
|
65
|
+
itemCount={rows.length}
|
|
66
|
+
page={page}
|
|
67
|
+
perPage={perPage}
|
|
68
|
+
isCompact={isCompact}
|
|
69
|
+
isSticky={isSticky}
|
|
70
|
+
isStatic={isStatic}
|
|
71
|
+
onSetPage={handleSetPage}
|
|
72
|
+
onPerPageSelect={handlePerPageSelect}
|
|
73
|
+
titles={{
|
|
74
|
+
paginationAriaLabel: `${variant} pagination`
|
|
75
|
+
}}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const toolbarItems = (
|
|
80
|
+
<React.Fragment>
|
|
81
|
+
<ToolbarItem>
|
|
82
|
+
<MenuToggle
|
|
83
|
+
aria-label="Select data list items"
|
|
84
|
+
splitButtonItems={[
|
|
85
|
+
<MenuToggleCheckbox
|
|
86
|
+
id="split-dropdown-checkbox"
|
|
87
|
+
key="split-dropdown-checkbox"
|
|
88
|
+
aria-label={'Select all data list items'}
|
|
89
|
+
/>
|
|
90
|
+
]}
|
|
91
|
+
></MenuToggle>
|
|
92
|
+
</ToolbarItem>
|
|
93
|
+
<ToolbarItem>
|
|
94
|
+
<MenuToggle>Filter by creator name</MenuToggle>
|
|
95
|
+
</ToolbarItem>
|
|
96
|
+
<ToolbarItem>
|
|
97
|
+
<OverflowMenu breakpoint="md">
|
|
98
|
+
<OverflowMenuItem>
|
|
99
|
+
<Button variant="primary">Create instance</Button>
|
|
100
|
+
</OverflowMenuItem>
|
|
101
|
+
<OverflowMenuControl hasAdditionalOptions>
|
|
102
|
+
<MenuToggle aria-label="Toolbar kebab overflow menu" variant="plain">
|
|
103
|
+
<EllipsisVIcon />
|
|
104
|
+
</MenuToggle>
|
|
105
|
+
</OverflowMenuControl>
|
|
106
|
+
</OverflowMenu>
|
|
107
|
+
</ToolbarItem>
|
|
108
|
+
<ToolbarItem variant="pagination" align={{ default: 'alignEnd' }}>
|
|
109
|
+
{renderPagination(PaginationVariant.top, true, false, false)}
|
|
110
|
+
</ToolbarItem>
|
|
111
|
+
</React.Fragment>
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<DashboardWrapper mainContainerId="main-content-datalist-view-pagination" breadcrumb={null}>
|
|
116
|
+
<PageSection>
|
|
117
|
+
<Content>
|
|
118
|
+
<Content component="h1">Projects</Content>
|
|
119
|
+
<Content component="p">This is a demo that showcases PatternFly Data List</Content>
|
|
120
|
+
</Content>
|
|
121
|
+
</PageSection>
|
|
122
|
+
<PageSection isFilled>
|
|
123
|
+
<Toolbar id="toolbar-group-types">
|
|
124
|
+
<ToolbarContent>{toolbarItems}</ToolbarContent>
|
|
125
|
+
</Toolbar>
|
|
126
|
+
<DataList aria-label="Demo data list">
|
|
127
|
+
{paginatedRows.map((row, rowIndex) => {
|
|
128
|
+
const { name, threads, applications, workspaces, lastModified } = row;
|
|
129
|
+
return (
|
|
130
|
+
<DataListItem aria-labelledby={`Demo-item-${rowIndex}`} key={rowIndex}>
|
|
131
|
+
<DataListItemRow>
|
|
132
|
+
<DataListItemCells
|
|
133
|
+
dataListCells={[
|
|
134
|
+
<DataListCell isFilled={false} key="buttons1">
|
|
135
|
+
<Flex direction={{ default: 'column' }} spaceItems={{ default: 'spaceItemsMd' }}>
|
|
136
|
+
<Flex direction={{ default: 'column' }} spaceItems={{ default: 'spaceItemsNone' }}>
|
|
137
|
+
<FlexItem>
|
|
138
|
+
<Content id={`Demo-item-${rowIndex}`} component={ContentVariants.p}>
|
|
139
|
+
{name}
|
|
140
|
+
</Content>
|
|
141
|
+
</FlexItem>
|
|
142
|
+
<FlexItem>
|
|
143
|
+
<Content component={ContentVariants.small}>
|
|
144
|
+
Working repo for
|
|
145
|
+
<a href="http://www.patternfly.org/">PatternFly</a>
|
|
146
|
+
</Content>
|
|
147
|
+
</FlexItem>
|
|
148
|
+
</Flex>
|
|
149
|
+
<Flex flexWrap={{ default: 'wrap' }}>
|
|
150
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
151
|
+
<FlexItem>
|
|
152
|
+
<CodeBranchIcon /> {threads}
|
|
153
|
+
</FlexItem>
|
|
154
|
+
</Flex>
|
|
155
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
156
|
+
<FlexItem>
|
|
157
|
+
<CodeIcon /> {applications}
|
|
158
|
+
</FlexItem>
|
|
159
|
+
</Flex>
|
|
160
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
161
|
+
<FlexItem>
|
|
162
|
+
<CubeIcon /> {workspaces}
|
|
163
|
+
</FlexItem>
|
|
164
|
+
</Flex>
|
|
165
|
+
<FlexItem> Updated {lastModified}</FlexItem>
|
|
166
|
+
</Flex>
|
|
167
|
+
</Flex>
|
|
168
|
+
</DataListCell>,
|
|
169
|
+
<DataListCell isFilled={false} alignRight key="secondary content align">
|
|
170
|
+
<Flex>
|
|
171
|
+
<FlexItem>
|
|
172
|
+
<Button variant="secondary">Action</Button>
|
|
173
|
+
</FlexItem>
|
|
174
|
+
<FlexItem>
|
|
175
|
+
<a href="#">Link</a>
|
|
176
|
+
</FlexItem>
|
|
177
|
+
</Flex>
|
|
178
|
+
</DataListCell>
|
|
179
|
+
]}
|
|
180
|
+
/>
|
|
181
|
+
</DataListItemRow>
|
|
182
|
+
</DataListItem>
|
|
183
|
+
);
|
|
184
|
+
})}
|
|
185
|
+
</DataList>
|
|
186
|
+
{renderPagination(PaginationVariant.bottom, false, false, true)}
|
|
187
|
+
</PageSection>
|
|
188
|
+
</DashboardWrapper>
|
|
189
|
+
);
|
|
190
|
+
};
|
|
@@ -15,6 +15,7 @@ import ExclamationTriangleIcon from '@patternfly/react-icons/dist/esm/icons/excl
|
|
|
15
15
|
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
|
|
16
16
|
import TimesCircleIcon from '@patternfly/react-icons/dist/esm/icons/times-circle-icon';
|
|
17
17
|
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
|
|
18
|
+
import { rows } from '@patternfly/react-core/dist/esm/demos/sampleData';
|
|
18
19
|
|
|
19
20
|
## Demos
|
|
20
21
|
|
|
@@ -28,3 +29,13 @@ import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/Dashboard
|
|
|
28
29
|
|
|
29
30
|
```js file="./DataList/examples/DataListExpandableControlInToolbar.tsx" isFullscreen
|
|
30
31
|
```
|
|
32
|
+
|
|
33
|
+
### Actionable
|
|
34
|
+
|
|
35
|
+
```js file="./DataList/examples/DataListActionable.tsx" isFullscreen
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Static bottom pagination
|
|
39
|
+
|
|
40
|
+
```js file="./DataList/examples/DataListStaticBottomPagination.tsx" isFullscreen
|
|
41
|
+
```
|