@patternfly/react-table 6.6.0-prerelease.9 → 6.6.1-prerelease.0
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 +26 -0
- 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 +2 -1
- package/dist/esm/components/Table/Tr.js.map +1 -1
- package/dist/esm/components/Table/utils/decorators/treeRow.js +2 -2
- package/dist/esm/components/Table/utils/decorators/treeRow.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 +2 -2
- 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/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/utils/decorators/treeRow.js +2 -2
- package/dist/js/components/Table/utils/decorators/treeRow.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 +2 -2
- 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-BNeslI6z.css → output-bkpDV61l.css} +4761 -4757
- 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 +2 -1
- package/src/components/Table/examples/Table.md +4 -4
- package/src/components/Table/examples/TableEditable.tsx +2 -2
- package/src/components/Table/examples/TableEmptyState.tsx +7 -2
- package/src/components/Table/examples/TableTree.tsx +3 -3
- package/src/components/Table/utils/decorators/treeRow.tsx +2 -2
- package/src/components/Table/utils/inert.ts +7 -0
- package/src/demos/DashboardHeader.tsx +2 -2
- package/src/demos/Table.md +5 -6
- package/src/demos/examples/TableColumnManagement.tsx +2 -2
- package/src/demos/examples/TableColumnManagementWithDraggable.tsx +2 -2
- package/src/demos/examples/TableCompact.tsx +2 -2
- package/src/demos/examples/TableCompoundExpansion.tsx +2 -2
- package/src/demos/examples/TableEmptyStateDefault.tsx +2 -2
- package/src/demos/examples/TableFilterable.tsx +5 -5
- package/src/demos/examples/TableSortableResponsive.tsx +4 -4
- package/src/demos/examples/TableStaticBottomPagination.tsx +2 -2
- 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 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.1-prerelease.0",
|
|
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.
|
|
45
|
-
"@patternfly/react-styles": "^6.6.
|
|
46
|
-
"@patternfly/react-tokens": "^6.6.
|
|
43
|
+
"@patternfly/react-core": "^6.6.1-prerelease.0",
|
|
44
|
+
"@patternfly/react-icons": "^6.6.1-prerelease.0",
|
|
45
|
+
"@patternfly/react-styles": "^6.6.1-prerelease.0",
|
|
46
|
+
"@patternfly/react-tokens": "^6.6.1-prerelease.0",
|
|
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": "8acdd6b143e4d03b24e4f3964e9e6c1fa3696154"
|
|
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 RhMicronsCheckmarkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-checkmark-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={<RhMicronsCheckmarkIcon />}
|
|
42
42
|
/>
|
|
43
43
|
</div>
|
|
44
44
|
<div className={css(inlineStyles.inlineEditAction)}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import RhUiQuestionMarkCircleIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-question-mark-circle-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={<RhUiQuestionMarkCircleIcon />}
|
|
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={<RhUiQuestionMarkCircleIcon />}
|
|
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 RhMicronsArrowUpIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-arrow-up-icon';
|
|
3
|
+
import RhMicronsArrowDownIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-arrow-down-icon';
|
|
4
|
+
import RhUiArrowUpDownIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-arrow-up-down-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 ? RhMicronsArrowUpIcon : RhMicronsArrowDownIcon;
|
|
47
47
|
} else {
|
|
48
|
-
SortedByIcon =
|
|
48
|
+
SortedByIcon = RhUiArrowUpDownIcon;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
if (favoriteButtonProps) {
|
|
@@ -4,6 +4,7 @@ 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';
|
|
7
8
|
|
|
8
9
|
export interface TrProps extends Omit<React.HTMLProps<HTMLTableRowElement>, 'onResize'>, OUIAProps {
|
|
9
10
|
/** Content rendered inside the <tr> row */
|
|
@@ -115,7 +116,7 @@ const TrBase: React.FunctionComponent<TrProps> = ({
|
|
|
115
116
|
{...(isClickable && { tabIndex: 0 })}
|
|
116
117
|
aria-label={ariaLabel}
|
|
117
118
|
ref={innerRef}
|
|
118
|
-
{...(hasAnimations && rowIsHidden && { inert:
|
|
119
|
+
{...(hasAnimations && rowIsHidden && { inert: IS_INERT })}
|
|
119
120
|
{...(onRowClick && { onClick: onRowClick, onKeyDown })}
|
|
120
121
|
{...ouiaProps}
|
|
121
122
|
{...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 RhMicronsSearchIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-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 RhUiFolderFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-folder-fill-icon';
|
|
51
|
+
import RhUiFolderOpenFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-folder-open-fill-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 RhMicronsCheckmarkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-checkmark-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 RhMicronsCheckmarkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-checkmark-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';
|
|
@@ -50,7 +50,7 @@ const EditButtonsCell: React.FunctionComponent<EditButtonsCellProps> = ({
|
|
|
50
50
|
onKeyDown={(event) => onKeyDown(event, 'stopEditing')}
|
|
51
51
|
variant="plain"
|
|
52
52
|
>
|
|
53
|
-
<
|
|
53
|
+
<RhMicronsCheckmarkIcon />
|
|
54
54
|
</Button>
|
|
55
55
|
</div>
|
|
56
56
|
<div className={css(inlineEditStyles.inlineEditAction)}>
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
EmptyStateFooter,
|
|
9
9
|
EmptyStateActions
|
|
10
10
|
} from '@patternfly/react-core';
|
|
11
|
-
import
|
|
11
|
+
import RhMicronsSearchIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-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,7 +28,12 @@ export const TableEmptyState: React.FunctionComponent = () => (
|
|
|
28
28
|
<Tr>
|
|
29
29
|
<Td colSpan={8}>
|
|
30
30
|
<Bullseye>
|
|
31
|
-
<EmptyState
|
|
31
|
+
<EmptyState
|
|
32
|
+
headingLevel="h2"
|
|
33
|
+
titleText="No results found"
|
|
34
|
+
icon={RhMicronsSearchIcon}
|
|
35
|
+
variant={EmptyStateVariant.sm}
|
|
36
|
+
>
|
|
32
37
|
<EmptyStateBody>Clear all filters and try again.</EmptyStateBody>
|
|
33
38
|
<EmptyStateFooter>
|
|
34
39
|
<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 RhUiFolderFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-folder-fill-icon';
|
|
5
|
+
import RhUiFolderOpenFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-folder-open-fill-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 ? <RhUiFolderOpenFillIcon /> : <RhUiFolderFillIcon />;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
const treeRow: TdProps['treeRow'] = {
|
|
@@ -4,7 +4,7 @@ import styles from '@patternfly/react-styles/css/components/Table/table';
|
|
|
4
4
|
import stylesTreeView from '@patternfly/react-styles/css/components/Table/table-tree-view';
|
|
5
5
|
import { Button } from '@patternfly/react-core/dist/esm/components/Button';
|
|
6
6
|
import { Checkbox } from '@patternfly/react-core/dist/esm/components/Checkbox';
|
|
7
|
-
import
|
|
7
|
+
import RhMicronsCaretRightIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-right-icon';
|
|
8
8
|
import RhUiEllipsisHorizontalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-horizontal-fill-icon';
|
|
9
9
|
|
|
10
10
|
export const treeRow =
|
|
@@ -54,7 +54,7 @@ export const treeRow =
|
|
|
54
54
|
aria-label={toggleAriaLabel || `${isExpanded ? 'Collapse' : 'Expand'} row ${rowIndex}`}
|
|
55
55
|
icon={
|
|
56
56
|
<div className={css(stylesTreeView.tableToggleIcon)}>
|
|
57
|
-
<
|
|
57
|
+
<RhMicronsCaretRightIcon />
|
|
58
58
|
</div>
|
|
59
59
|
}
|
|
60
60
|
/>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { version } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Before React 19, React JSX treats empty string "" as truthy for inert prop.
|
|
5
|
+
* @see {@link https://stackoverflow.com/questions/72720469}
|
|
6
|
+
*/
|
|
7
|
+
export const IS_INERT = Number(version.split('.')[0]) >= 19 ? true : ('' as unknown as boolean);
|
|
@@ -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 RhUiQuestionMarkCircleIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-question-mark-circle-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
|
+
<RhUiQuestionMarkCircleIcon /> Help
|
|
94
94
|
</DropdownItem>
|
|
95
95
|
</>
|
|
96
96
|
);
|
package/src/demos/Table.md
CHANGED
|
@@ -48,19 +48,18 @@ ModalBody,
|
|
|
48
48
|
ModalFooter,
|
|
49
49
|
} from '@patternfly/react-core';
|
|
50
50
|
import { DragDropSort } from '@patternfly/react-drag-drop';
|
|
51
|
-
import
|
|
52
|
-
import CloneIcon from '@patternfly/react-icons/dist/esm/icons/clone-icon';
|
|
51
|
+
import RhUiCopyFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-copy-fill-icon';
|
|
53
52
|
import RhUiCodeIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-code-icon';
|
|
54
53
|
import RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';
|
|
55
54
|
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
56
55
|
import EditIcon from '@patternfly/react-icons/dist/esm/icons/edit-icon';
|
|
57
|
-
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
58
56
|
import RhMicronsSortDownLargeToSmallIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-sort-down-large-to-small-icon';
|
|
59
|
-
import
|
|
60
|
-
import
|
|
57
|
+
import RhUiFilterFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-filter-fill-icon';
|
|
58
|
+
import RhMicronsSearchIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-search-icon';
|
|
59
|
+
import RhUiSyncIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-sync-icon';
|
|
61
60
|
import RhUiErrorFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-error-fill-icon';
|
|
62
61
|
import RhUiSettingsFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-settings-fill-icon';
|
|
63
|
-
import
|
|
62
|
+
import RhUiQuestionMarkCircleIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-question-mark-circle-icon';
|
|
64
63
|
import RhUiQuestionMarkCircleFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-question-mark-circle-fill-icon';
|
|
65
64
|
import RhMicronsCaretDownIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-down-icon';
|
|
66
65
|
import RhMicronsCaretRightIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-right-icon';
|
|
@@ -26,8 +26,8 @@ import {
|
|
|
26
26
|
PaginationVariant
|
|
27
27
|
} from '@patternfly/react-core';
|
|
28
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
29
|
import RhMicronsSortDownLargeToSmallIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-sort-down-large-to-small-icon';
|
|
30
|
+
import RhUiFilterFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-filter-fill-icon';
|
|
31
31
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
32
32
|
import { capitalize } from '@patternfly/react-table/src/components/Table/utils/utils';
|
|
33
33
|
import { rows, columns, SampleDataRow } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
@@ -411,7 +411,7 @@ export const TableColumnManagement: React.FunctionComponent = () => {
|
|
|
411
411
|
<ToolbarItem>
|
|
412
412
|
<OverflowMenu breakpoint="md">
|
|
413
413
|
<OverflowMenuItem>
|
|
414
|
-
<MenuToggle icon={<
|
|
414
|
+
<MenuToggle icon={<RhUiFilterFillIcon />}>Name</MenuToggle>
|
|
415
415
|
</OverflowMenuItem>
|
|
416
416
|
<OverflowMenuItem>
|
|
417
417
|
<MenuToggle variant="plain" aria-label="Sort columns" icon={<RhMicronsSortDownLargeToSmallIcon />} />
|
|
@@ -26,8 +26,8 @@ import {
|
|
|
26
26
|
} from '@patternfly/react-core';
|
|
27
27
|
import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
28
28
|
import { DragDropSort } from '@patternfly/react-drag-drop';
|
|
29
|
-
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
30
29
|
import RhMicronsSortDownLargeToSmallIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-sort-down-large-to-small-icon';
|
|
30
|
+
import RhUiFilterFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-filter-fill-icon';
|
|
31
31
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
32
32
|
import { capitalize } from '@patternfly/react-table/src/components/Table/utils/utils';
|
|
33
33
|
import { rows, columns, SampleDataRow } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
@@ -306,7 +306,7 @@ export const TableColumnManagement: React.FunctionComponent = () => {
|
|
|
306
306
|
<ToolbarItem>
|
|
307
307
|
<OverflowMenu breakpoint="md">
|
|
308
308
|
<OverflowMenuItem>
|
|
309
|
-
<MenuToggle icon={<
|
|
309
|
+
<MenuToggle icon={<RhUiFilterFillIcon />}>Name</MenuToggle>
|
|
310
310
|
</OverflowMenuItem>
|
|
311
311
|
<OverflowMenuItem>
|
|
312
312
|
<MenuToggle
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
PaginationVariant
|
|
16
16
|
} from '@patternfly/react-core';
|
|
17
17
|
import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
18
|
-
import
|
|
18
|
+
import RhUiFilterFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-filter-fill-icon';
|
|
19
19
|
import { rows, columns } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
20
20
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
21
21
|
|
|
@@ -72,7 +72,7 @@ export const TableCompact: React.FunctionComponent = () => {
|
|
|
72
72
|
aria-label="Select Input"
|
|
73
73
|
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
74
74
|
<MenuToggle
|
|
75
|
-
icon={<
|
|
75
|
+
icon={<RhUiFilterFillIcon />}
|
|
76
76
|
ref={toggleRef}
|
|
77
77
|
onClick={() => setIsSelectOpen(!isSelectOpen)}
|
|
78
78
|
isExpanded={isSelectOpen}
|
|
@@ -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
|
>
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
SearchInput,
|
|
22
22
|
ToolbarLabelGroup
|
|
23
23
|
} from '@patternfly/react-core';
|
|
24
|
-
import
|
|
25
|
-
import
|
|
24
|
+
import RhMicronsSearchIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-search-icon';
|
|
25
|
+
import RhUiFilterFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-filter-fill-icon';
|
|
26
26
|
import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
27
27
|
import { rows, columns } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
28
28
|
|
|
@@ -125,7 +125,7 @@ export const TableFilterable: React.FunctionComponent = () => {
|
|
|
125
125
|
ref={toggleRef}
|
|
126
126
|
onClick={onCategoryToggle}
|
|
127
127
|
isExpanded={isCategoryDropdownOpen}
|
|
128
|
-
icon={<
|
|
128
|
+
icon={<RhUiFilterFillIcon />}
|
|
129
129
|
style={
|
|
130
130
|
{
|
|
131
131
|
width: '100%',
|
|
@@ -276,7 +276,7 @@ export const TableFilterable: React.FunctionComponent = () => {
|
|
|
276
276
|
collapseListedFiltersBreakpoint="xl"
|
|
277
277
|
>
|
|
278
278
|
<ToolbarContent>
|
|
279
|
-
<ToolbarToggleGroup toggleIcon={<
|
|
279
|
+
<ToolbarToggleGroup toggleIcon={<RhUiFilterFillIcon />} breakpoint="xl">
|
|
280
280
|
<ToolbarGroup
|
|
281
281
|
variant="filter-group"
|
|
282
282
|
style={
|
|
@@ -306,7 +306,7 @@ export const TableFilterable: React.FunctionComponent = () => {
|
|
|
306
306
|
: rowData;
|
|
307
307
|
|
|
308
308
|
const emptyState = (
|
|
309
|
-
<EmptyState icon={
|
|
309
|
+
<EmptyState icon={RhMicronsSearchIcon} titleText="Clear all filters and try again." headingLevel="h5">
|
|
310
310
|
<EmptyStateBody>No results match the filter criteria. Clear all filters and try again.</EmptyStateBody>
|
|
311
311
|
<EmptyStateFooter>
|
|
312
312
|
<EmptyStateActions>
|
|
@@ -29,9 +29,9 @@ import {
|
|
|
29
29
|
PageSectionVariants
|
|
30
30
|
} from '@patternfly/react-core';
|
|
31
31
|
import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
32
|
-
import
|
|
32
|
+
import RhUiCopyFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-copy-fill-icon';
|
|
33
33
|
import EditIcon from '@patternfly/react-icons/dist/esm/icons/edit-icon';
|
|
34
|
-
import
|
|
34
|
+
import RhUiSyncIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-sync-icon';
|
|
35
35
|
import RhUiCodeIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-code-icon';
|
|
36
36
|
import RhMicronsSortDownLargeToSmallIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-sort-down-large-to-small-icon';
|
|
37
37
|
import RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';
|
|
@@ -214,10 +214,10 @@ export const TableSortableResponsive: React.FunctionComponent = () => {
|
|
|
214
214
|
<Button aria-label="Edit" variant="plain" icon={<EditIcon />} />
|
|
215
215
|
</ToolbarItem>
|
|
216
216
|
<ToolbarItem>
|
|
217
|
-
<Button aria-label="Clone" variant="plain" icon={<
|
|
217
|
+
<Button aria-label="Clone" variant="plain" icon={<RhUiCopyFillIcon />} />
|
|
218
218
|
</ToolbarItem>
|
|
219
219
|
<ToolbarItem>
|
|
220
|
-
<Button aria-label="Sync" variant="plain" icon={<
|
|
220
|
+
<Button aria-label="Sync" variant="plain" icon={<RhUiSyncIcon />} />
|
|
221
221
|
</ToolbarItem>
|
|
222
222
|
</ToolbarGroup>
|
|
223
223
|
<ToolbarItem variant="pagination">{renderPagination('top', true)}</ToolbarItem>
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
PaginationVariant
|
|
16
16
|
} from '@patternfly/react-core';
|
|
17
17
|
import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
18
|
-
import
|
|
18
|
+
import RhUiFilterFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-filter-fill-icon';
|
|
19
19
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
20
20
|
import { rows, columns } from '@patternfly/react-table/dist/esm/demos/sampleData';
|
|
21
21
|
|
|
@@ -100,7 +100,7 @@ export const TableStaticBottomPagination: React.FunctionComponent = () => {
|
|
|
100
100
|
aria-label="Select Input"
|
|
101
101
|
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
102
102
|
<MenuToggle
|
|
103
|
-
icon={<
|
|
103
|
+
icon={<RhUiFilterFillIcon />}
|
|
104
104
|
ref={toggleRef}
|
|
105
105
|
onClick={() => setIsSelectOpen(!isSelectOpen)}
|
|
106
106
|
isExpanded={isSelectOpen}
|
|
@@ -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] },
|