@patternfly/react-table 6.6.2 → 6.7.0-prerelease.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -2
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/Table/package.json +1 -1
- package/dist/dynamic/components/Table/utils/decorators/package.json +1 -1
- package/dist/dynamic/components/Table/utils/package.json +1 -1
- package/dist/dynamic/deprecated/components/Table/base/package.json +1 -1
- package/dist/dynamic/deprecated/components/Table/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/dynamic-modules.json +2 -0
- package/dist/esm/components/Table/EditColumn.js +2 -2
- package/dist/esm/components/Table/EditColumn.js.map +1 -1
- package/dist/esm/components/Table/HeaderCellInfoWrapper.js +2 -2
- package/dist/esm/components/Table/HeaderCellInfoWrapper.js.map +1 -1
- package/dist/esm/components/Table/SortColumn.js +5 -5
- package/dist/esm/components/Table/SortColumn.js.map +1 -1
- package/dist/esm/components/Table/Table.d.ts +2 -0
- package/dist/esm/components/Table/Table.d.ts.map +1 -1
- package/dist/esm/components/Table/Table.js +3 -3
- package/dist/esm/components/Table/Table.js.map +1 -1
- package/dist/esm/components/Table/Tfoot.d.ts +11 -0
- package/dist/esm/components/Table/Tfoot.d.ts.map +1 -0
- package/dist/esm/components/Table/Tfoot.js +12 -0
- package/dist/esm/components/Table/Tfoot.js.map +1 -0
- package/dist/esm/components/Table/Tr.d.ts.map +1 -1
- package/dist/esm/components/Table/Tr.js +2 -1
- package/dist/esm/components/Table/Tr.js.map +1 -1
- package/dist/esm/components/Table/index.d.ts +1 -0
- package/dist/esm/components/Table/index.d.ts.map +1 -1
- package/dist/esm/components/Table/index.js +1 -0
- package/dist/esm/components/Table/index.js.map +1 -1
- package/dist/esm/components/Table/utils/inert.d.ts +6 -0
- package/dist/esm/components/Table/utils/inert.d.ts.map +1 -0
- package/dist/esm/components/Table/utils/inert.js +7 -0
- package/dist/esm/components/Table/utils/inert.js.map +1 -0
- package/dist/esm/demos/DashboardHeader.js +3 -3
- package/dist/esm/demos/DashboardHeader.js.map +1 -1
- package/dist/esm/deprecated/components/Table/Table.d.ts.map +1 -1
- package/dist/esm/deprecated/components/Table/Table.js +1 -0
- package/dist/esm/deprecated/components/Table/Table.js.map +1 -1
- package/dist/js/components/Table/EditColumn.js +2 -2
- package/dist/js/components/Table/EditColumn.js.map +1 -1
- package/dist/js/components/Table/HeaderCellInfoWrapper.js +2 -2
- package/dist/js/components/Table/HeaderCellInfoWrapper.js.map +1 -1
- package/dist/js/components/Table/SortColumn.js +5 -5
- package/dist/js/components/Table/SortColumn.js.map +1 -1
- package/dist/js/components/Table/Table.d.ts +2 -0
- package/dist/js/components/Table/Table.d.ts.map +1 -1
- package/dist/js/components/Table/Table.js +3 -3
- package/dist/js/components/Table/Table.js.map +1 -1
- package/dist/js/components/Table/Tfoot.d.ts +11 -0
- package/dist/js/components/Table/Tfoot.d.ts.map +1 -0
- package/dist/js/components/Table/Tfoot.js +15 -0
- package/dist/js/components/Table/Tfoot.js.map +1 -0
- package/dist/js/components/Table/Tr.d.ts.map +1 -1
- package/dist/js/components/Table/Tr.js +2 -1
- package/dist/js/components/Table/Tr.js.map +1 -1
- package/dist/js/components/Table/index.d.ts +1 -0
- package/dist/js/components/Table/index.d.ts.map +1 -1
- package/dist/js/components/Table/index.js +1 -0
- package/dist/js/components/Table/index.js.map +1 -1
- package/dist/js/components/Table/utils/inert.d.ts +6 -0
- package/dist/js/components/Table/utils/inert.d.ts.map +1 -0
- package/dist/js/components/Table/utils/inert.js +10 -0
- package/dist/js/components/Table/utils/inert.js.map +1 -0
- package/dist/js/demos/DashboardHeader.js +3 -3
- package/dist/js/demos/DashboardHeader.js.map +1 -1
- package/dist/js/deprecated/components/Table/Table.d.ts.map +1 -1
- package/dist/js/deprecated/components/Table/Table.js +1 -0
- package/dist/js/deprecated/components/Table/Table.js.map +1 -1
- package/dist/umd/assets/{output-DWpq4Q2w.css → output-Dgf2YLB7.css} +5590 -5466
- package/dist/umd/react-table.min.js +2 -2
- package/package.json +6 -6
- package/src/components/Table/EditColumn.tsx +2 -2
- package/src/components/Table/HeaderCellInfoWrapper.tsx +3 -3
- package/src/components/Table/SortColumn.tsx +5 -5
- package/src/components/Table/Table.tsx +4 -0
- package/src/components/Table/Tfoot.tsx +23 -0
- package/src/components/Table/Tr.tsx +2 -1
- package/src/components/Table/__tests__/Table.test.tsx +12 -0
- package/src/components/Table/__tests__/Tfoot.test.tsx +65 -0
- package/src/components/Table/examples/Table.md +13 -4
- package/src/components/Table/examples/TableEditable.tsx +35 -37
- package/src/components/Table/examples/TableEmptyState.tsx +7 -2
- package/src/components/Table/examples/TableStickyFooter.tsx +33 -0
- package/src/components/Table/examples/TableTree.tsx +3 -3
- package/src/components/Table/index.ts +1 -0
- package/src/components/Table/utils/inert.ts +7 -0
- package/src/demos/DashboardHeader.tsx +3 -3
- package/src/demos/Table.md +5 -6
- package/src/demos/examples/TableColumnManagement.tsx +7 -6
- package/src/demos/examples/TableColumnManagementWithDraggable.tsx +7 -6
- package/src/demos/examples/TableCompact.tsx +8 -7
- package/src/demos/examples/TableCompoundExpansion.tsx +2 -2
- package/src/demos/examples/TableEmptyStateDefault.tsx +2 -2
- package/src/demos/examples/TableExpandCollapseAll.tsx +6 -6
- package/src/demos/examples/TableFilterable.tsx +10 -9
- package/src/demos/examples/TableSortableResponsive.tsx +10 -9
- package/src/demos/examples/TableStaticBottomPagination.tsx +8 -7
- package/src/demos/examples/TableStickyHeader.tsx +6 -6
- package/src/deprecated/components/Table/Table.tsx +1 -0
- package/src/deprecated/components/Table/__tests__/Table.test.tsx +19 -0
- package/src/deprecated/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +869 -326
- package/src/deprecated/components/Table/examples/LegacyTableEmptyState.tsx +2 -2
- package/src/deprecated/components/Table/examples/LegacyTableTree.tsx +3 -3
- package/src/deprecated/components/Table/examples/Table.md +3 -4
|
@@ -12,10 +12,11 @@ import {
|
|
|
12
12
|
ToolbarGroup,
|
|
13
13
|
ToolbarItem,
|
|
14
14
|
Label,
|
|
15
|
+
LabelStatus,
|
|
15
16
|
PaginationVariant
|
|
16
17
|
} from '@patternfly/react-core';
|
|
17
18
|
import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
18
|
-
import
|
|
19
|
+
import RhUiFilterFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-filter-fill-icon';
|
|
19
20
|
import { rows, columns } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
20
21
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
21
22
|
|
|
@@ -72,7 +73,7 @@ export const TableCompact: React.FunctionComponent = () => {
|
|
|
72
73
|
aria-label="Select Input"
|
|
73
74
|
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
74
75
|
<MenuToggle
|
|
75
|
-
icon={<
|
|
76
|
+
icon={<RhUiFilterFillIcon />}
|
|
76
77
|
ref={toggleRef}
|
|
77
78
|
onClick={() => setIsSelectOpen(!isSelectOpen)}
|
|
78
79
|
isExpanded={isSelectOpen}
|
|
@@ -113,13 +114,13 @@ export const TableCompact: React.FunctionComponent = () => {
|
|
|
113
114
|
const renderLabel = (labelText: string) => {
|
|
114
115
|
switch (labelText) {
|
|
115
116
|
case 'Running':
|
|
116
|
-
return <Label
|
|
117
|
+
return <Label status={LabelStatus.success}>{labelText}</Label>;
|
|
117
118
|
case 'Stopped':
|
|
118
|
-
return <Label
|
|
119
|
-
case 'Needs
|
|
120
|
-
return <Label
|
|
119
|
+
return <Label status={LabelStatus.warning}>{labelText}</Label>;
|
|
120
|
+
case 'Needs maintenance':
|
|
121
|
+
return <Label status={LabelStatus.info}>{labelText}</Label>;
|
|
121
122
|
case 'Down':
|
|
122
|
-
return <Label
|
|
123
|
+
return <Label status={LabelStatus.danger}>{labelText}</Label>;
|
|
123
124
|
default:
|
|
124
125
|
return <></>;
|
|
125
126
|
}
|
|
@@ -20,7 +20,7 @@ import RhUiCodeIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-code-icon
|
|
|
20
20
|
import RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';
|
|
21
21
|
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
22
22
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
23
|
-
import
|
|
23
|
+
import RhUiFilterFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-filter-fill-icon';
|
|
24
24
|
|
|
25
25
|
export const TableCompoundExpansion: React.FunctionComponent = () => {
|
|
26
26
|
// In real usage, this data would come from some external source like an API via props.
|
|
@@ -93,7 +93,7 @@ export const TableCompoundExpansion: React.FunctionComponent = () => {
|
|
|
93
93
|
ref={toggleRef}
|
|
94
94
|
onClick={() => setIsSelectOpen(!isSelectOpen)}
|
|
95
95
|
isExpanded={isSelectOpen}
|
|
96
|
-
icon={<
|
|
96
|
+
icon={<RhUiFilterFillIcon />}
|
|
97
97
|
>
|
|
98
98
|
Status
|
|
99
99
|
</MenuToggle>
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
EmptyStateActions,
|
|
10
10
|
PageSection
|
|
11
11
|
} from '@patternfly/react-core';
|
|
12
|
-
import
|
|
12
|
+
import RhMicronsSearchIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-search-icon';
|
|
13
13
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
14
14
|
|
|
15
15
|
export const TableEmptyStateDefault: React.FunctionComponent = () => (
|
|
@@ -31,7 +31,7 @@ export const TableEmptyStateDefault: React.FunctionComponent = () => (
|
|
|
31
31
|
<Bullseye>
|
|
32
32
|
<EmptyState
|
|
33
33
|
titleText="No results found"
|
|
34
|
-
icon={
|
|
34
|
+
icon={RhMicronsSearchIcon}
|
|
35
35
|
headingLevel="h2"
|
|
36
36
|
variant={EmptyStateVariant.sm}
|
|
37
37
|
>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, ReactNode, useEffect, useState } from 'react';
|
|
2
|
-
import { Content, Label, PageSection } from '@patternfly/react-core';
|
|
2
|
+
import { Content, Label, LabelStatus, PageSection } from '@patternfly/react-core';
|
|
3
3
|
import { Table, Thead, Tbody, Tr, Th, Td, ExpandableRowContent } from '@patternfly/react-table';
|
|
4
4
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
5
5
|
|
|
@@ -20,7 +20,7 @@ const serverData: Server[] = [
|
|
|
20
20
|
threads: 18,
|
|
21
21
|
applications: 42,
|
|
22
22
|
workspaces: 7,
|
|
23
|
-
status: { title: <Label
|
|
23
|
+
status: { title: <Label status={LabelStatus.success}>Running</Label> },
|
|
24
24
|
details: (
|
|
25
25
|
<Content>
|
|
26
26
|
<p>
|
|
@@ -40,7 +40,7 @@ const serverData: Server[] = [
|
|
|
40
40
|
threads: 9,
|
|
41
41
|
applications: 24,
|
|
42
42
|
workspaces: 17,
|
|
43
|
-
status: { title: <Label
|
|
43
|
+
status: { title: <Label status={LabelStatus.danger}>Down</Label> },
|
|
44
44
|
details: (
|
|
45
45
|
<Content>
|
|
46
46
|
<p>
|
|
@@ -60,7 +60,7 @@ const serverData: Server[] = [
|
|
|
60
60
|
threads: 8,
|
|
61
61
|
applications: 47,
|
|
62
62
|
workspaces: 3,
|
|
63
|
-
status: { title: <Label
|
|
63
|
+
status: { title: <Label status={LabelStatus.success}>Running</Label> },
|
|
64
64
|
details: (
|
|
65
65
|
<Content>
|
|
66
66
|
<p>
|
|
@@ -80,7 +80,7 @@ const serverData: Server[] = [
|
|
|
80
80
|
threads: 6,
|
|
81
81
|
applications: 4,
|
|
82
82
|
workspaces: 15,
|
|
83
|
-
status: { title: <Label
|
|
83
|
+
status: { title: <Label status={LabelStatus.info}>Needs Maintenance</Label> },
|
|
84
84
|
details: (
|
|
85
85
|
<Content>
|
|
86
86
|
<p>
|
|
@@ -100,7 +100,7 @@ const serverData: Server[] = [
|
|
|
100
100
|
threads: 9,
|
|
101
101
|
applications: 24,
|
|
102
102
|
workspaces: 17,
|
|
103
|
-
status: { title: <Label
|
|
103
|
+
status: { title: <Label status={LabelStatus.warning}>Stopped</Label> },
|
|
104
104
|
details: (
|
|
105
105
|
<Content>
|
|
106
106
|
<p>
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
EmptyStateBody,
|
|
9
9
|
EmptyStateFooter,
|
|
10
10
|
Label,
|
|
11
|
+
LabelStatus,
|
|
11
12
|
MenuToggle,
|
|
12
13
|
MenuToggleElement,
|
|
13
14
|
Toolbar,
|
|
@@ -21,8 +22,8 @@ import {
|
|
|
21
22
|
SearchInput,
|
|
22
23
|
ToolbarLabelGroup
|
|
23
24
|
} from '@patternfly/react-core';
|
|
24
|
-
import
|
|
25
|
-
import
|
|
25
|
+
import RhMicronsSearchIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-search-icon';
|
|
26
|
+
import RhUiFilterFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-filter-fill-icon';
|
|
26
27
|
import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
27
28
|
import { rows, columns } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
28
29
|
|
|
@@ -125,7 +126,7 @@ export const TableFilterable: React.FunctionComponent = () => {
|
|
|
125
126
|
ref={toggleRef}
|
|
126
127
|
onClick={onCategoryToggle}
|
|
127
128
|
isExpanded={isCategoryDropdownOpen}
|
|
128
|
-
icon={<
|
|
129
|
+
icon={<RhUiFilterFillIcon />}
|
|
129
130
|
style={
|
|
130
131
|
{
|
|
131
132
|
width: '100%',
|
|
@@ -276,7 +277,7 @@ export const TableFilterable: React.FunctionComponent = () => {
|
|
|
276
277
|
collapseListedFiltersBreakpoint="xl"
|
|
277
278
|
>
|
|
278
279
|
<ToolbarContent>
|
|
279
|
-
<ToolbarToggleGroup toggleIcon={<
|
|
280
|
+
<ToolbarToggleGroup toggleIcon={<RhUiFilterFillIcon />} breakpoint="xl">
|
|
280
281
|
<ToolbarGroup
|
|
281
282
|
variant="filter-group"
|
|
282
283
|
style={
|
|
@@ -306,7 +307,7 @@ export const TableFilterable: React.FunctionComponent = () => {
|
|
|
306
307
|
: rowData;
|
|
307
308
|
|
|
308
309
|
const emptyState = (
|
|
309
|
-
<EmptyState icon={
|
|
310
|
+
<EmptyState icon={RhMicronsSearchIcon} titleText="Clear all filters and try again." headingLevel="h5">
|
|
310
311
|
<EmptyStateBody>No results match the filter criteria. Clear all filters and try again.</EmptyStateBody>
|
|
311
312
|
<EmptyStateFooter>
|
|
312
313
|
<EmptyStateActions>
|
|
@@ -326,13 +327,13 @@ export const TableFilterable: React.FunctionComponent = () => {
|
|
|
326
327
|
const renderLabel = (labelText: string) => {
|
|
327
328
|
switch (labelText) {
|
|
328
329
|
case 'Running':
|
|
329
|
-
return <Label
|
|
330
|
+
return <Label status={LabelStatus.success}>{labelText}</Label>;
|
|
330
331
|
case 'Stopped':
|
|
331
|
-
return <Label
|
|
332
|
+
return <Label status={LabelStatus.warning}>{labelText}</Label>;
|
|
332
333
|
case 'Needs maintenance':
|
|
333
|
-
return <Label
|
|
334
|
+
return <Label status={LabelStatus.info}>{labelText}</Label>;
|
|
334
335
|
case 'Down':
|
|
335
|
-
return <Label
|
|
336
|
+
return <Label status={LabelStatus.danger}>{labelText}</Label>;
|
|
336
337
|
}
|
|
337
338
|
};
|
|
338
339
|
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
OverflowMenuDropdownItem,
|
|
21
21
|
PaginationVariant,
|
|
22
22
|
Label,
|
|
23
|
+
LabelStatus,
|
|
23
24
|
Select,
|
|
24
25
|
OverflowMenu,
|
|
25
26
|
OverflowMenuContent,
|
|
@@ -29,9 +30,9 @@ import {
|
|
|
29
30
|
PageSectionVariants
|
|
30
31
|
} from '@patternfly/react-core';
|
|
31
32
|
import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
32
|
-
import
|
|
33
|
+
import RhUiCopyFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-copy-fill-icon';
|
|
33
34
|
import EditIcon from '@patternfly/react-icons/dist/esm/icons/edit-icon';
|
|
34
|
-
import
|
|
35
|
+
import RhUiSyncIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-sync-icon';
|
|
35
36
|
import RhUiCodeIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-code-icon';
|
|
36
37
|
import RhMicronsSortDownLargeToSmallIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-sort-down-large-to-small-icon';
|
|
37
38
|
import RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';
|
|
@@ -120,13 +121,13 @@ export const TableSortableResponsive: React.FunctionComponent = () => {
|
|
|
120
121
|
const renderLabel = (labelText: string) => {
|
|
121
122
|
switch (labelText) {
|
|
122
123
|
case 'Running':
|
|
123
|
-
return <Label
|
|
124
|
+
return <Label status={LabelStatus.success}>{labelText}</Label>;
|
|
124
125
|
case 'Stopped':
|
|
125
|
-
return <Label
|
|
126
|
-
case 'Needs
|
|
127
|
-
return <Label
|
|
126
|
+
return <Label status={LabelStatus.warning}>{labelText}</Label>;
|
|
127
|
+
case 'Needs maintenance':
|
|
128
|
+
return <Label status={LabelStatus.info}>{labelText}</Label>;
|
|
128
129
|
case 'Down':
|
|
129
|
-
return <Label
|
|
130
|
+
return <Label status={LabelStatus.danger}>{labelText}</Label>;
|
|
130
131
|
}
|
|
131
132
|
};
|
|
132
133
|
|
|
@@ -214,10 +215,10 @@ export const TableSortableResponsive: React.FunctionComponent = () => {
|
|
|
214
215
|
<Button aria-label="Edit" variant="plain" icon={<EditIcon />} />
|
|
215
216
|
</ToolbarItem>
|
|
216
217
|
<ToolbarItem>
|
|
217
|
-
<Button aria-label="Clone" variant="plain" icon={<
|
|
218
|
+
<Button aria-label="Clone" variant="plain" icon={<RhUiCopyFillIcon />} />
|
|
218
219
|
</ToolbarItem>
|
|
219
220
|
<ToolbarItem>
|
|
220
|
-
<Button aria-label="Sync" variant="plain" icon={<
|
|
221
|
+
<Button aria-label="Sync" variant="plain" icon={<RhUiSyncIcon />} />
|
|
221
222
|
</ToolbarItem>
|
|
222
223
|
</ToolbarGroup>
|
|
223
224
|
<ToolbarItem variant="pagination">{renderPagination('top', true)}</ToolbarItem>
|
|
@@ -10,12 +10,13 @@ import {
|
|
|
10
10
|
MenuToggle,
|
|
11
11
|
MenuToggleElement,
|
|
12
12
|
Label,
|
|
13
|
+
LabelStatus,
|
|
13
14
|
Select,
|
|
14
15
|
SelectOption,
|
|
15
16
|
PaginationVariant
|
|
16
17
|
} from '@patternfly/react-core';
|
|
17
18
|
import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
18
|
-
import
|
|
19
|
+
import RhUiFilterFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-filter-fill-icon';
|
|
19
20
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
20
21
|
import { rows, columns } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
21
22
|
|
|
@@ -67,25 +68,25 @@ export const TableStaticBottomPagination: React.FunctionComponent = () => {
|
|
|
67
68
|
case 'Running':
|
|
68
69
|
return (
|
|
69
70
|
<span>
|
|
70
|
-
<Label
|
|
71
|
+
<Label status={LabelStatus.success}>{labelText}</Label>
|
|
71
72
|
</span>
|
|
72
73
|
);
|
|
73
74
|
case 'Stopped':
|
|
74
75
|
return (
|
|
75
76
|
<span>
|
|
76
|
-
<Label
|
|
77
|
+
<Label status={LabelStatus.warning}>{labelText}</Label>
|
|
77
78
|
</span>
|
|
78
79
|
);
|
|
79
|
-
case 'Needs
|
|
80
|
+
case 'Needs maintenance':
|
|
80
81
|
return (
|
|
81
82
|
<span>
|
|
82
|
-
<Label
|
|
83
|
+
<Label status={LabelStatus.info}>{labelText}</Label>
|
|
83
84
|
</span>
|
|
84
85
|
);
|
|
85
86
|
case 'Down':
|
|
86
87
|
return (
|
|
87
88
|
<span>
|
|
88
|
-
<Label
|
|
89
|
+
<Label status={LabelStatus.danger}>{labelText}</Label>
|
|
89
90
|
</span>
|
|
90
91
|
);
|
|
91
92
|
}
|
|
@@ -100,7 +101,7 @@ export const TableStaticBottomPagination: React.FunctionComponent = () => {
|
|
|
100
101
|
aria-label="Select Input"
|
|
101
102
|
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
102
103
|
<MenuToggle
|
|
103
|
-
icon={<
|
|
104
|
+
icon={<RhUiFilterFillIcon />}
|
|
104
105
|
ref={toggleRef}
|
|
105
106
|
onClick={() => setIsSelectOpen(!isSelectOpen)}
|
|
106
107
|
isExpanded={isSelectOpen}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Label, PageSection } from '@patternfly/react-core';
|
|
1
|
+
import { Label, LabelStatus, PageSection } from '@patternfly/react-core';
|
|
2
2
|
import { Table, Thead, Tr, Th, Tbody, Td, TableText } from '@patternfly/react-table';
|
|
3
3
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
4
4
|
import { rows, columns } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
@@ -7,13 +7,13 @@ export const TableStickyHeader: React.FunctionComponent = () => {
|
|
|
7
7
|
const renderLabel = (labelText: string) => {
|
|
8
8
|
switch (labelText) {
|
|
9
9
|
case 'Running':
|
|
10
|
-
return <Label
|
|
10
|
+
return <Label status={LabelStatus.success}>{labelText}</Label>;
|
|
11
11
|
case 'Stopped':
|
|
12
|
-
return <Label
|
|
13
|
-
case 'Needs
|
|
14
|
-
return <Label
|
|
12
|
+
return <Label status={LabelStatus.warning}>{labelText}</Label>;
|
|
13
|
+
case 'Needs maintenance':
|
|
14
|
+
return <Label status={LabelStatus.info}>{labelText}</Label>;
|
|
15
15
|
case 'Down':
|
|
16
|
-
return <Label
|
|
16
|
+
return <Label status={LabelStatus.danger}>{labelText}</Label>;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -253,6 +253,7 @@ class Table extends Component<TableProps, {}> {
|
|
|
253
253
|
actionsToggle,
|
|
254
254
|
onFavorite,
|
|
255
255
|
canSortFavorites,
|
|
256
|
+
variant,
|
|
256
257
|
// order of columns: Collapsible | Selectable | Favoritable
|
|
257
258
|
firstUserColumnIndex: [onCollapse, onSelect, onFavorite].filter((callback) => callback).length
|
|
258
259
|
});
|
|
@@ -279,6 +279,25 @@ describe('Table', () => {
|
|
|
279
279
|
expect(asFragment()).toMatchSnapshot();
|
|
280
280
|
});
|
|
281
281
|
|
|
282
|
+
test('Compact table with Radio select', () => {
|
|
283
|
+
const onSelect: OnSelect = () => undefined;
|
|
284
|
+
const { asFragment } = render(
|
|
285
|
+
<Table
|
|
286
|
+
aria-label="Compact table with radio"
|
|
287
|
+
variant={TableVariant.compact}
|
|
288
|
+
selectVariant={RowSelectVariant.radio}
|
|
289
|
+
onSelect={onSelect}
|
|
290
|
+
cells={columns}
|
|
291
|
+
rows={rows}
|
|
292
|
+
>
|
|
293
|
+
<TableHeader />
|
|
294
|
+
<TableBody />
|
|
295
|
+
</Table>
|
|
296
|
+
);
|
|
297
|
+
|
|
298
|
+
expect(asFragment()).toMatchSnapshot();
|
|
299
|
+
});
|
|
300
|
+
|
|
282
301
|
test('Control text table', () => {
|
|
283
302
|
const controlTextColumns: ICell[] = [
|
|
284
303
|
{ ...(columns[0] as object), transforms: [nowrap] },
|