@patternfly/react-table 5.0.0-alpha.43 → 5.0.0-alpha.45
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 +10 -0
- package/components/Table/ActionsColumn.d.ts.map +1 -1
- package/components/Table/ActionsColumn.js +12 -2
- package/components/Table/ActionsColumn.js.map +1 -1
- package/components/Table/TableTypes.d.ts +4 -0
- package/components/Table/TableTypes.d.ts.map +1 -1
- package/dist/esm/components/Table/ActionsColumn.d.ts.map +1 -1
- package/dist/esm/components/Table/ActionsColumn.js +12 -2
- package/dist/esm/components/Table/ActionsColumn.js.map +1 -1
- package/dist/esm/components/Table/TableTypes.d.ts +4 -0
- package/dist/esm/components/Table/TableTypes.d.ts.map +1 -1
- package/dist/js/components/Table/ActionsColumn.d.ts.map +1 -1
- package/dist/js/components/Table/ActionsColumn.js +12 -2
- package/dist/js/components/Table/ActionsColumn.js.map +1 -1
- package/dist/js/components/Table/TableTypes.d.ts +4 -0
- package/dist/js/components/Table/TableTypes.d.ts.map +1 -1
- package/dist/umd/react-table.min.js +1 -1
- package/package.json +3 -3
- package/src/components/Table/ActionsColumn.tsx +18 -6
- package/src/components/Table/TableTypes.tsx +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.45",
|
|
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",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"subpaths": "node scripts/copySubpaths.js"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@patternfly/react-core": "^5.0.0-alpha.
|
|
42
|
+
"@patternfly/react-core": "^5.0.0-alpha.45",
|
|
43
43
|
"@patternfly/react-icons": "^5.0.0-alpha.6",
|
|
44
44
|
"@patternfly/react-styles": "^5.0.0-alpha.5",
|
|
45
45
|
"@patternfly/react-tokens": "^5.0.0-alpha.5",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"react": "^17 || ^18",
|
|
55
55
|
"react-dom": "^17 || ^18"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "b4d34f7a9978200a95142d099115f91bf4170497"
|
|
58
58
|
}
|
|
@@ -5,6 +5,7 @@ import { Divider } from '@patternfly/react-core/dist/esm/components/Divider';
|
|
|
5
5
|
import { MenuToggle } from '@patternfly/react-core/dist/esm/components/MenuToggle';
|
|
6
6
|
import { IAction, IExtraData, IRowData } from './TableTypes';
|
|
7
7
|
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
8
|
+
import { Tooltip } from '@patternfly/react-core/dist/esm/components/Tooltip';
|
|
8
9
|
|
|
9
10
|
export interface CustomActionsToggleProps {
|
|
10
11
|
onToggle: (event: React.MouseEvent) => void;
|
|
@@ -108,10 +109,11 @@ const ActionsColumnBase: React.FunctionComponent<ActionsColumnProps> = ({
|
|
|
108
109
|
<DropdownList>
|
|
109
110
|
{items
|
|
110
111
|
.filter((item) => !item.isOutsideDropdown)
|
|
111
|
-
.map(({ title, itemKey, onClick, isSeparator, ...props }, key) =>
|
|
112
|
-
isSeparator
|
|
113
|
-
<Divider key={itemKey || key} data-key={itemKey || key}
|
|
114
|
-
|
|
112
|
+
.map(({ title, itemKey, onClick, tooltip, tooltipProps, isSeparator, ...props }, key) => {
|
|
113
|
+
if (isSeparator) {
|
|
114
|
+
return <Divider key={itemKey || key} data-key={itemKey || key} />;
|
|
115
|
+
}
|
|
116
|
+
const item = (
|
|
115
117
|
<DropdownItem
|
|
116
118
|
onClick={(event) => {
|
|
117
119
|
onActionClick(event, onClick);
|
|
@@ -123,8 +125,18 @@ const ActionsColumnBase: React.FunctionComponent<ActionsColumnProps> = ({
|
|
|
123
125
|
>
|
|
124
126
|
{title}
|
|
125
127
|
</DropdownItem>
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
if (tooltip) {
|
|
131
|
+
return (
|
|
132
|
+
<Tooltip key={itemKey || key} content={tooltip} {...tooltipProps}>
|
|
133
|
+
{item}
|
|
134
|
+
</Tooltip>
|
|
135
|
+
);
|
|
136
|
+
} else {
|
|
137
|
+
return item;
|
|
138
|
+
}
|
|
139
|
+
})}
|
|
128
140
|
</DropdownList>
|
|
129
141
|
</Dropdown>
|
|
130
142
|
</React.Fragment>
|
|
@@ -157,6 +157,10 @@ export interface IAction extends Omit<DropdownItemProps, 'title' | 'onClick'>, P
|
|
|
157
157
|
itemKey?: string;
|
|
158
158
|
/** Content to display in the actions menu item */
|
|
159
159
|
title?: string | React.ReactNode;
|
|
160
|
+
/** Tooltip to display when hovered over the item */
|
|
161
|
+
tooltip?: React.ReactNode;
|
|
162
|
+
/** Additional props forwarded to the tooltip component */
|
|
163
|
+
tooltipProps?: any;
|
|
160
164
|
/** Click handler for the actions menu item */
|
|
161
165
|
onClick?: (event: React.MouseEvent, rowIndex: number, rowData: IRowData, extraData: IExtraData) => void;
|
|
162
166
|
/** Flag indicating this action should be placed outside the actions menu, beside the toggle */
|