@patternfly/react-table 6.6.1-prerelease.6 → 6.6.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 +2 -40
- 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/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/Tr.d.ts.map +1 -1
- package/dist/esm/components/Table/Tr.js +1 -2
- package/dist/esm/components/Table/Tr.js.map +1 -1
- 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 +0 -1
- 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/Tr.d.ts.map +1 -1
- package/dist/js/components/Table/Tr.js +1 -2
- package/dist/js/components/Table/Tr.js.map +1 -1
- 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 +0 -1
- package/dist/js/deprecated/components/Table/Table.js.map +1 -1
- package/dist/umd/assets/{output-DRG_VfPB.css → output-DWpq4Q2w.css} +5354 -5354
- 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/Tr.tsx +1 -2
- package/src/components/Table/examples/Table.md +4 -4
- package/src/components/Table/examples/TableEditable.tsx +37 -35
- package/src/components/Table/examples/TableEmptyState.tsx +2 -7
- package/src/components/Table/examples/TableTree.tsx +3 -3
- package/src/demos/DashboardHeader.tsx +3 -3
- package/src/demos/Table.md +6 -5
- package/src/demos/examples/TableColumnManagement.tsx +6 -7
- package/src/demos/examples/TableColumnManagementWithDraggable.tsx +6 -7
- package/src/demos/examples/TableCompact.tsx +7 -8
- 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 +9 -10
- package/src/demos/examples/TableSortableResponsive.tsx +9 -10
- package/src/demos/examples/TableStaticBottomPagination.tsx +7 -8
- package/src/demos/examples/TableStickyHeader.tsx +6 -6
- package/src/deprecated/components/Table/Table.tsx +0 -1
- package/src/deprecated/components/Table/__tests__/Table.test.tsx +0 -19
- package/src/deprecated/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +326 -869
- 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 +4 -3
- package/dist/esm/components/Table/utils/inert.d.ts +0 -6
- package/dist/esm/components/Table/utils/inert.d.ts.map +0 -1
- package/dist/esm/components/Table/utils/inert.js +0 -7
- package/dist/esm/components/Table/utils/inert.js.map +0 -1
- package/dist/js/components/Table/utils/inert.d.ts +0 -6
- package/dist/js/components/Table/utils/inert.d.ts.map +0 -1
- package/dist/js/components/Table/utils/inert.js +0 -10
- package/dist/js/components/Table/utils/inert.js.map +0 -1
- package/src/components/Table/utils/inert.ts +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.2",
|
|
4
4
|
"description": "This library provides a set of React table components for use with the PatternFly 4",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"subpaths": "node ../../scripts/exportSubpaths.mjs --config subpaths.config.json"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@patternfly/react-core": "^6.6.
|
|
44
|
-
"@patternfly/react-icons": "^6.6.1
|
|
45
|
-
"@patternfly/react-styles": "^6.6.1
|
|
46
|
-
"@patternfly/react-tokens": "^6.6.1
|
|
43
|
+
"@patternfly/react-core": "^6.6.2",
|
|
44
|
+
"@patternfly/react-icons": "^6.6.1",
|
|
45
|
+
"@patternfly/react-styles": "^6.6.1",
|
|
46
|
+
"@patternfly/react-tokens": "^6.6.1",
|
|
47
47
|
"lodash": "^4.18.1",
|
|
48
48
|
"tslib": "^2.8.1"
|
|
49
49
|
},
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"react": "^17 || ^18 || ^19",
|
|
52
52
|
"react-dom": "^17 || ^18 || ^19"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "02bbb5540dc894017949e1b3b66083bce4c9deee"
|
|
55
55
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment } from 'react';
|
|
2
2
|
import { Button } from '@patternfly/react-core/dist/esm/components/Button';
|
|
3
3
|
import RhUiEditFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-edit-fill-icon';
|
|
4
|
-
import
|
|
4
|
+
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
5
5
|
import RhMicronsCloseIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-close-icon';
|
|
6
6
|
import { OnRowEdit } from './TableTypes';
|
|
7
7
|
import inlineStyles from '@patternfly/react-styles/css/components/InlineEdit/inline-edit';
|
|
@@ -38,7 +38,7 @@ export const EditColumn: React.FunctionComponent<EditColumnProps> = ({
|
|
|
38
38
|
{...props}
|
|
39
39
|
onClick={(e) => onClick(e, 'save')}
|
|
40
40
|
variant="plain"
|
|
41
|
-
icon={<
|
|
41
|
+
icon={<CheckIcon />}
|
|
42
42
|
/>
|
|
43
43
|
</div>
|
|
44
44
|
<div className={css(inlineStyles.inlineEditAction)}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
3
|
import styles from '@patternfly/react-styles/css/components/Table/table';
|
|
4
4
|
import { Tooltip, TooltipProps } from '@patternfly/react-core/dist/esm/components/Tooltip';
|
|
@@ -55,7 +55,7 @@ export const HeaderCellInfoWrapper: React.FunctionComponent<ColumnHelpWrapperPro
|
|
|
55
55
|
variant="plain"
|
|
56
56
|
hasNoPadding
|
|
57
57
|
aria-label={ariaLabel || (typeof info === 'string' && info) || 'More info'}
|
|
58
|
-
icon={<
|
|
58
|
+
icon={<HelpIcon />}
|
|
59
59
|
/>
|
|
60
60
|
</Tooltip>
|
|
61
61
|
) : (
|
|
@@ -64,7 +64,7 @@ export const HeaderCellInfoWrapper: React.FunctionComponent<ColumnHelpWrapperPro
|
|
|
64
64
|
variant="plain"
|
|
65
65
|
hasNoPadding
|
|
66
66
|
aria-label={ariaLabel || (typeof info === 'string' && info) || 'More info'}
|
|
67
|
-
icon={<
|
|
67
|
+
icon={<HelpIcon />}
|
|
68
68
|
/>
|
|
69
69
|
</Popover>
|
|
70
70
|
)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import LongArrowAltUpIcon from '@patternfly/react-icons/dist/esm/icons/long-arrow-alt-up-icon';
|
|
3
|
+
import LongArrowAltDownIcon from '@patternfly/react-icons/dist/esm/icons/long-arrow-alt-down-icon';
|
|
4
|
+
import ArrowsAltVIcon from '@patternfly/react-icons/dist/esm/icons/arrows-alt-v-icon';
|
|
5
5
|
import { css } from '@patternfly/react-styles';
|
|
6
6
|
import styles from '@patternfly/react-styles/css/components/Table/table';
|
|
7
7
|
import { TableText } from './TableText';
|
|
@@ -43,9 +43,9 @@ export const SortColumn: React.FunctionComponent<SortColumnProps> = ({
|
|
|
43
43
|
let SortedByIcon;
|
|
44
44
|
const [focused, setFocused] = useState(false);
|
|
45
45
|
if (isSortedBy) {
|
|
46
|
-
SortedByIcon = sortDirection === SortByDirection.asc ?
|
|
46
|
+
SortedByIcon = sortDirection === SortByDirection.asc ? LongArrowAltUpIcon : LongArrowAltDownIcon;
|
|
47
47
|
} else {
|
|
48
|
-
SortedByIcon =
|
|
48
|
+
SortedByIcon = ArrowsAltVIcon;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
if (favoriteButtonProps) {
|
|
@@ -4,7 +4,6 @@ import styles from '@patternfly/react-styles/css/components/Table/table';
|
|
|
4
4
|
import inlineStyles from '@patternfly/react-styles/css/components/InlineEdit/inline-edit';
|
|
5
5
|
import { css } from '@patternfly/react-styles';
|
|
6
6
|
import { TableContext } from './Table';
|
|
7
|
-
import { IS_INERT } from './utils/inert';
|
|
8
7
|
|
|
9
8
|
export interface TrProps extends Omit<React.HTMLProps<HTMLTableRowElement>, 'onResize'>, OUIAProps {
|
|
10
9
|
/** Content rendered inside the <tr> row */
|
|
@@ -116,7 +115,7 @@ const TrBase: React.FunctionComponent<TrProps> = ({
|
|
|
116
115
|
{...(isClickable && { tabIndex: 0 })}
|
|
117
116
|
aria-label={ariaLabel}
|
|
118
117
|
ref={innerRef}
|
|
119
|
-
{...(hasAnimations && rowIsHidden && { inert:
|
|
118
|
+
{...(hasAnimations && rowIsHidden && { inert: '' })}
|
|
120
119
|
{...(onRowClick && { onClick: onRowClick, onKeyDown })}
|
|
121
120
|
{...ouiaProps}
|
|
122
121
|
{...props}
|
|
@@ -42,18 +42,18 @@ The `Table` component takes an explicit and declarative approach, and its implem
|
|
|
42
42
|
The documentation for the deprecated table implementation can be found under the [React deprecated](/components/table/react-deprecated) tab. It is configuration based and takes a less declarative and more implicit approach to laying out the table structure, such as the rows and cells within it.
|
|
43
43
|
|
|
44
44
|
import { Fragment, isValidElement, useCallback, useEffect, useRef, useState, useLayoutEffect } from 'react';
|
|
45
|
-
import
|
|
45
|
+
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
46
46
|
import RhUiCodeIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-code-icon';
|
|
47
47
|
import RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';
|
|
48
48
|
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
49
49
|
import LeafIcon from '@patternfly/react-icons/dist/esm/icons/leaf-icon';
|
|
50
|
-
import
|
|
51
|
-
import
|
|
50
|
+
import FolderIcon from '@patternfly/react-icons/dist/esm/icons/folder-icon';
|
|
51
|
+
import FolderOpenIcon from '@patternfly/react-icons/dist/esm/icons/folder-open-icon';
|
|
52
52
|
import RhMicronsSortDownLargeToSmallIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-sort-down-large-to-small-icon';
|
|
53
53
|
import RhUiBlueprintIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-blueprint-icon';
|
|
54
54
|
import RhUiEditFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-edit-fill-icon';
|
|
55
55
|
import RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';
|
|
56
|
-
import
|
|
56
|
+
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
57
57
|
import RhMicronsCloseIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-close-icon';
|
|
58
58
|
|
|
59
59
|
import { css } from '@patternfly/react-styles';
|
|
@@ -2,7 +2,7 @@ import { isValidElement, useRef, useState } from 'react';
|
|
|
2
2
|
import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
3
3
|
import { Button, Checkbox, Radio, TextInput, KeyTypes, getUniqueId } from '@patternfly/react-core';
|
|
4
4
|
import RhUiEditFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-edit-fill-icon';
|
|
5
|
-
import
|
|
5
|
+
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
6
6
|
import RhMicronsCloseIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-close-icon';
|
|
7
7
|
import inlineEditStyles from '@patternfly/react-styles/css/components/InlineEdit/inline-edit';
|
|
8
8
|
import { css } from '@patternfly/react-styles';
|
|
@@ -35,47 +35,49 @@ const EditButtonsCell: React.FunctionComponent<EditButtonsCellProps> = ({
|
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
37
|
<>
|
|
38
|
-
<Td
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</div>
|
|
56
|
-
<div className={css(inlineEditStyles.inlineEditAction)}>
|
|
57
|
-
<Button
|
|
58
|
-
aria-label={`Discard edits of ${rowAriaLabel}`}
|
|
59
|
-
onClick={() => onClick('cancel')}
|
|
60
|
-
onKeyDown={(event) => onKeyDown(event, 'stopEditing')}
|
|
61
|
-
variant="plain"
|
|
62
|
-
>
|
|
63
|
-
<RhMicronsCloseIcon />
|
|
64
|
-
</Button>
|
|
65
|
-
</div>
|
|
38
|
+
<Td
|
|
39
|
+
dataLabel="Save and cancel buttons"
|
|
40
|
+
className={css(
|
|
41
|
+
inlineEditStyles.inlineEditGroup,
|
|
42
|
+
inlineEditStyles.modifiers.iconGroup,
|
|
43
|
+
inlineEditStyles.modifiers.actionGroup
|
|
44
|
+
)}
|
|
45
|
+
>
|
|
46
|
+
<div className={css(inlineEditStyles.inlineEditAction, inlineEditStyles.modifiers.valid)}>
|
|
47
|
+
<Button
|
|
48
|
+
aria-label={`Save edits of ${rowAriaLabel}`}
|
|
49
|
+
onClick={() => onClick('save')}
|
|
50
|
+
onKeyDown={(event) => onKeyDown(event, 'stopEditing')}
|
|
51
|
+
variant="plain"
|
|
52
|
+
>
|
|
53
|
+
<CheckIcon />
|
|
54
|
+
</Button>
|
|
66
55
|
</div>
|
|
67
|
-
<div className={css(inlineEditStyles.inlineEditAction
|
|
56
|
+
<div className={css(inlineEditStyles.inlineEditAction)}>
|
|
68
57
|
<Button
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
onKeyDown={(event) => onKeyDown(event, 'edit')}
|
|
58
|
+
aria-label={`Discard edits of ${rowAriaLabel}`}
|
|
59
|
+
onClick={() => onClick('cancel')}
|
|
60
|
+
onKeyDown={(event) => onKeyDown(event, 'stopEditing')}
|
|
73
61
|
variant="plain"
|
|
74
62
|
>
|
|
75
|
-
<
|
|
63
|
+
<RhMicronsCloseIcon />
|
|
76
64
|
</Button>
|
|
77
65
|
</div>
|
|
78
66
|
</Td>
|
|
67
|
+
<Td
|
|
68
|
+
dataLabel="Edit button"
|
|
69
|
+
className={css(inlineEditStyles.inlineEditAction, inlineEditStyles.modifiers.enableEditable)}
|
|
70
|
+
>
|
|
71
|
+
<Button
|
|
72
|
+
ref={editButtonRef}
|
|
73
|
+
aria-label={`Edit ${rowAriaLabel}`}
|
|
74
|
+
onClick={() => onClick('edit')}
|
|
75
|
+
onKeyDown={(event) => onKeyDown(event, 'edit')}
|
|
76
|
+
variant="plain"
|
|
77
|
+
>
|
|
78
|
+
<RhUiEditFillIcon />
|
|
79
|
+
</Button>
|
|
80
|
+
</Td>
|
|
79
81
|
</>
|
|
80
82
|
);
|
|
81
83
|
};
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
EmptyStateFooter,
|
|
9
9
|
EmptyStateActions
|
|
10
10
|
} from '@patternfly/react-core';
|
|
11
|
-
import
|
|
11
|
+
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
12
12
|
|
|
13
13
|
// This example has been simplified to focus on the empty state. In real usage,
|
|
14
14
|
// you may want to derive your rows from typed underlying data and minimal state. See other examples.
|
|
@@ -28,12 +28,7 @@ export const TableEmptyState: React.FunctionComponent = () => (
|
|
|
28
28
|
<Tr>
|
|
29
29
|
<Td colSpan={8}>
|
|
30
30
|
<Bullseye>
|
|
31
|
-
<EmptyState
|
|
32
|
-
headingLevel="h2"
|
|
33
|
-
titleText="No results found"
|
|
34
|
-
icon={RhMicronsSearchIcon}
|
|
35
|
-
variant={EmptyStateVariant.sm}
|
|
36
|
-
>
|
|
31
|
+
<EmptyState headingLevel="h2" titleText="No results found" icon={SearchIcon} variant={EmptyStateVariant.sm}>
|
|
37
32
|
<EmptyStateBody>Clear all filters and try again.</EmptyStateBody>
|
|
38
33
|
<EmptyStateFooter>
|
|
39
34
|
<EmptyStateActions>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { Table, Thead, Tr, Th, Tbody, Td, TreeRowWrapper, TdProps } from '@patternfly/react-table';
|
|
3
3
|
import LeafIcon from '@patternfly/react-icons/dist/esm/icons/leaf-icon';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import FolderIcon from '@patternfly/react-icons/dist/esm/icons/folder-icon';
|
|
5
|
+
import FolderOpenIcon from '@patternfly/react-icons/dist/esm/icons/folder-open-icon';
|
|
6
6
|
|
|
7
7
|
interface RepositoriesTreeNode {
|
|
8
8
|
name: string;
|
|
@@ -139,7 +139,7 @@ export const TableTree: React.FunctionComponent = () => {
|
|
|
139
139
|
const isChecked = isNodeChecked(node);
|
|
140
140
|
let icon = <LeafIcon />;
|
|
141
141
|
if (node.children) {
|
|
142
|
-
icon = isExpanded ? <
|
|
142
|
+
icon = isExpanded ? <FolderOpenIcon /> : <FolderIcon />;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
const treeRow: TdProps['treeRow'] = {
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
PageToggleButton
|
|
25
25
|
} from '@patternfly/react-core';
|
|
26
26
|
import RhUiSettingsFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-settings-fill-icon';
|
|
27
|
-
import
|
|
27
|
+
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
28
28
|
import RhUiQuestionMarkCircleFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-question-mark-circle-fill-icon';
|
|
29
29
|
import RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';
|
|
30
30
|
import imgAvatar from '@patternfly/react-table/src/demos/assets/avatarImg.svg';
|
|
@@ -90,7 +90,7 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
|
|
|
90
90
|
<RhUiSettingsFillIcon /> Settings
|
|
91
91
|
</DropdownItem>
|
|
92
92
|
<DropdownItem>
|
|
93
|
-
<
|
|
93
|
+
<HelpIcon /> Help
|
|
94
94
|
</DropdownItem>
|
|
95
95
|
</>
|
|
96
96
|
);
|
|
@@ -149,7 +149,7 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
|
|
|
149
149
|
<ToolbarItem>
|
|
150
150
|
<NotificationBadge
|
|
151
151
|
aria-label="Notifications"
|
|
152
|
-
variant={NotificationBadgeVariant.
|
|
152
|
+
variant={NotificationBadgeVariant.read}
|
|
153
153
|
onClick={() => {}}
|
|
154
154
|
/>
|
|
155
155
|
</ToolbarItem>
|
package/src/demos/Table.md
CHANGED
|
@@ -48,18 +48,19 @@ ModalBody,
|
|
|
48
48
|
ModalFooter,
|
|
49
49
|
} from '@patternfly/react-core';
|
|
50
50
|
import { DragDropSort } from '@patternfly/react-drag-drop';
|
|
51
|
-
import
|
|
51
|
+
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
52
|
+
import CloneIcon from '@patternfly/react-icons/dist/esm/icons/clone-icon';
|
|
52
53
|
import RhUiCodeIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-code-icon';
|
|
53
54
|
import RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';
|
|
54
55
|
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
55
56
|
import EditIcon from '@patternfly/react-icons/dist/esm/icons/edit-icon';
|
|
57
|
+
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
56
58
|
import RhMicronsSortDownLargeToSmallIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-sort-down-large-to-small-icon';
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import RhUiSyncIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-sync-icon';
|
|
59
|
+
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
60
|
+
import SyncIcon from '@patternfly/react-icons/dist/esm/icons/sync-icon';
|
|
60
61
|
import RhUiErrorFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-error-fill-icon';
|
|
61
62
|
import RhUiSettingsFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-settings-fill-icon';
|
|
62
|
-
import
|
|
63
|
+
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
63
64
|
import RhUiQuestionMarkCircleFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-question-mark-circle-fill-icon';
|
|
64
65
|
import RhMicronsCaretDownIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-down-icon';
|
|
65
66
|
import RhMicronsCaretRightIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-right-icon';
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
DataListCell,
|
|
11
11
|
DataListItemCells,
|
|
12
12
|
Label,
|
|
13
|
-
LabelStatus,
|
|
14
13
|
Toolbar,
|
|
15
14
|
ToolbarContent,
|
|
16
15
|
ToolbarItem,
|
|
@@ -27,8 +26,8 @@ import {
|
|
|
27
26
|
PaginationVariant
|
|
28
27
|
} from '@patternfly/react-core';
|
|
29
28
|
import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
29
|
+
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
30
30
|
import RhMicronsSortDownLargeToSmallIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-sort-down-large-to-small-icon';
|
|
31
|
-
import RhUiFilterFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-filter-fill-icon';
|
|
32
31
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
33
32
|
import { capitalize } from '@patternfly/react-table/src/components/Table/utils/utils';
|
|
34
33
|
import { rows, columns, SampleDataRow } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
@@ -390,13 +389,13 @@ export const TableColumnManagement: React.FunctionComponent = () => {
|
|
|
390
389
|
const renderLabel = (labelText: string): React.JSX.Element => {
|
|
391
390
|
switch (labelText) {
|
|
392
391
|
case 'Running':
|
|
393
|
-
return <Label
|
|
392
|
+
return <Label color="green">{labelText}</Label>;
|
|
394
393
|
case 'Stopped':
|
|
395
|
-
return <Label
|
|
394
|
+
return <Label color="orange">{labelText}</Label>;
|
|
396
395
|
case 'Needs maintenance':
|
|
397
|
-
return <Label
|
|
396
|
+
return <Label color="blue">{labelText}</Label>;
|
|
398
397
|
case 'Down':
|
|
399
|
-
return <Label
|
|
398
|
+
return <Label color="red">{labelText}</Label>;
|
|
400
399
|
default:
|
|
401
400
|
return <></>;
|
|
402
401
|
}
|
|
@@ -412,7 +411,7 @@ export const TableColumnManagement: React.FunctionComponent = () => {
|
|
|
412
411
|
<ToolbarItem>
|
|
413
412
|
<OverflowMenu breakpoint="md">
|
|
414
413
|
<OverflowMenuItem>
|
|
415
|
-
<MenuToggle icon={<
|
|
414
|
+
<MenuToggle icon={<FilterIcon />}>Name</MenuToggle>
|
|
416
415
|
</OverflowMenuItem>
|
|
417
416
|
<OverflowMenuItem>
|
|
418
417
|
<MenuToggle variant="plain" aria-label="Sort columns" icon={<RhMicronsSortDownLargeToSmallIcon />} />
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
DataListItemCells,
|
|
10
10
|
DataListControl,
|
|
11
11
|
Label,
|
|
12
|
-
LabelStatus,
|
|
13
12
|
Toolbar,
|
|
14
13
|
ToolbarContent,
|
|
15
14
|
ToolbarItem,
|
|
@@ -27,8 +26,8 @@ import {
|
|
|
27
26
|
} from '@patternfly/react-core';
|
|
28
27
|
import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
29
28
|
import { DragDropSort } from '@patternfly/react-drag-drop';
|
|
29
|
+
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
30
30
|
import RhMicronsSortDownLargeToSmallIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-sort-down-large-to-small-icon';
|
|
31
|
-
import RhUiFilterFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-filter-fill-icon';
|
|
32
31
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
33
32
|
import { capitalize } from '@patternfly/react-table/src/components/Table/utils/utils';
|
|
34
33
|
import { rows, columns, SampleDataRow } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
@@ -285,13 +284,13 @@ export const TableColumnManagement: React.FunctionComponent = () => {
|
|
|
285
284
|
const renderLabel = (labelText: string): React.JSX.Element => {
|
|
286
285
|
switch (labelText) {
|
|
287
286
|
case 'Running':
|
|
288
|
-
return <Label
|
|
287
|
+
return <Label color="green">{labelText}</Label>;
|
|
289
288
|
case 'Stopped':
|
|
290
|
-
return <Label
|
|
289
|
+
return <Label color="orange">{labelText}</Label>;
|
|
291
290
|
case 'Needs maintenance':
|
|
292
|
-
return <Label
|
|
291
|
+
return <Label color="blue">{labelText}</Label>;
|
|
293
292
|
case 'Down':
|
|
294
|
-
return <Label
|
|
293
|
+
return <Label color="red">{labelText}</Label>;
|
|
295
294
|
default:
|
|
296
295
|
return <></>;
|
|
297
296
|
}
|
|
@@ -307,7 +306,7 @@ export const TableColumnManagement: React.FunctionComponent = () => {
|
|
|
307
306
|
<ToolbarItem>
|
|
308
307
|
<OverflowMenu breakpoint="md">
|
|
309
308
|
<OverflowMenuItem>
|
|
310
|
-
<MenuToggle icon={<
|
|
309
|
+
<MenuToggle icon={<FilterIcon />}>Name</MenuToggle>
|
|
311
310
|
</OverflowMenuItem>
|
|
312
311
|
<OverflowMenuItem>
|
|
313
312
|
<MenuToggle
|
|
@@ -12,11 +12,10 @@ import {
|
|
|
12
12
|
ToolbarGroup,
|
|
13
13
|
ToolbarItem,
|
|
14
14
|
Label,
|
|
15
|
-
LabelStatus,
|
|
16
15
|
PaginationVariant
|
|
17
16
|
} from '@patternfly/react-core';
|
|
18
17
|
import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
19
|
-
import
|
|
18
|
+
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
20
19
|
import { rows, columns } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
21
20
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
22
21
|
|
|
@@ -73,7 +72,7 @@ export const TableCompact: React.FunctionComponent = () => {
|
|
|
73
72
|
aria-label="Select Input"
|
|
74
73
|
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
75
74
|
<MenuToggle
|
|
76
|
-
icon={<
|
|
75
|
+
icon={<FilterIcon />}
|
|
77
76
|
ref={toggleRef}
|
|
78
77
|
onClick={() => setIsSelectOpen(!isSelectOpen)}
|
|
79
78
|
isExpanded={isSelectOpen}
|
|
@@ -114,13 +113,13 @@ export const TableCompact: React.FunctionComponent = () => {
|
|
|
114
113
|
const renderLabel = (labelText: string) => {
|
|
115
114
|
switch (labelText) {
|
|
116
115
|
case 'Running':
|
|
117
|
-
return <Label
|
|
116
|
+
return <Label color="green">{labelText}</Label>;
|
|
118
117
|
case 'Stopped':
|
|
119
|
-
return <Label
|
|
120
|
-
case 'Needs
|
|
121
|
-
return <Label
|
|
118
|
+
return <Label color="orange">{labelText}</Label>;
|
|
119
|
+
case 'Needs Maintenance':
|
|
120
|
+
return <Label color="blue">{labelText}</Label>;
|
|
122
121
|
case 'Down':
|
|
123
|
-
return <Label
|
|
122
|
+
return <Label color="red">{labelText}</Label>;
|
|
124
123
|
default:
|
|
125
124
|
return <></>;
|
|
126
125
|
}
|
|
@@ -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 FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-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={<FilterIcon />}
|
|
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 SearchIcon from '@patternfly/react-icons/dist/esm/icons/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={SearchIcon}
|
|
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,
|
|
2
|
+
import { Content, Label, 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 color="green">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 color="red">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 color="green">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 color="blue">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 color="orange">Stopped</Label> },
|
|
104
104
|
details: (
|
|
105
105
|
<Content>
|
|
106
106
|
<p>
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
EmptyStateBody,
|
|
9
9
|
EmptyStateFooter,
|
|
10
10
|
Label,
|
|
11
|
-
LabelStatus,
|
|
12
11
|
MenuToggle,
|
|
13
12
|
MenuToggleElement,
|
|
14
13
|
Toolbar,
|
|
@@ -22,8 +21,8 @@ import {
|
|
|
22
21
|
SearchInput,
|
|
23
22
|
ToolbarLabelGroup
|
|
24
23
|
} from '@patternfly/react-core';
|
|
25
|
-
import
|
|
26
|
-
import
|
|
24
|
+
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
25
|
+
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
27
26
|
import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
28
27
|
import { rows, columns } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
29
28
|
|
|
@@ -126,7 +125,7 @@ export const TableFilterable: React.FunctionComponent = () => {
|
|
|
126
125
|
ref={toggleRef}
|
|
127
126
|
onClick={onCategoryToggle}
|
|
128
127
|
isExpanded={isCategoryDropdownOpen}
|
|
129
|
-
icon={<
|
|
128
|
+
icon={<FilterIcon />}
|
|
130
129
|
style={
|
|
131
130
|
{
|
|
132
131
|
width: '100%',
|
|
@@ -277,7 +276,7 @@ export const TableFilterable: React.FunctionComponent = () => {
|
|
|
277
276
|
collapseListedFiltersBreakpoint="xl"
|
|
278
277
|
>
|
|
279
278
|
<ToolbarContent>
|
|
280
|
-
<ToolbarToggleGroup toggleIcon={<
|
|
279
|
+
<ToolbarToggleGroup toggleIcon={<FilterIcon />} breakpoint="xl">
|
|
281
280
|
<ToolbarGroup
|
|
282
281
|
variant="filter-group"
|
|
283
282
|
style={
|
|
@@ -307,7 +306,7 @@ export const TableFilterable: React.FunctionComponent = () => {
|
|
|
307
306
|
: rowData;
|
|
308
307
|
|
|
309
308
|
const emptyState = (
|
|
310
|
-
<EmptyState icon={
|
|
309
|
+
<EmptyState icon={SearchIcon} titleText="Clear all filters and try again." headingLevel="h5">
|
|
311
310
|
<EmptyStateBody>No results match the filter criteria. Clear all filters and try again.</EmptyStateBody>
|
|
312
311
|
<EmptyStateFooter>
|
|
313
312
|
<EmptyStateActions>
|
|
@@ -327,13 +326,13 @@ export const TableFilterable: React.FunctionComponent = () => {
|
|
|
327
326
|
const renderLabel = (labelText: string) => {
|
|
328
327
|
switch (labelText) {
|
|
329
328
|
case 'Running':
|
|
330
|
-
return <Label
|
|
329
|
+
return <Label color="green">{labelText}</Label>;
|
|
331
330
|
case 'Stopped':
|
|
332
|
-
return <Label
|
|
331
|
+
return <Label color="orange">{labelText}</Label>;
|
|
333
332
|
case 'Needs maintenance':
|
|
334
|
-
return <Label
|
|
333
|
+
return <Label color="blue">{labelText}</Label>;
|
|
335
334
|
case 'Down':
|
|
336
|
-
return <Label
|
|
335
|
+
return <Label color="red">{labelText}</Label>;
|
|
337
336
|
}
|
|
338
337
|
};
|
|
339
338
|
|