@patternfly/react-table 6.2.0-prerelease.2 → 6.2.0-prerelease.20
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 +76 -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/ActionsColumn.d.ts.map +1 -1
- package/dist/esm/components/Table/ActionsColumn.js.map +1 -1
- package/dist/esm/components/Table/EditableSelectInputCell.d.ts +1 -1
- package/dist/esm/components/Table/EditableSelectInputCell.d.ts.map +1 -1
- package/dist/esm/components/Table/EditableSelectInputCell.js.map +1 -1
- package/dist/esm/components/Table/SortColumn.d.ts.map +1 -1
- package/dist/esm/components/Table/SortColumn.js +2 -1
- package/dist/esm/components/Table/SortColumn.js.map +1 -1
- package/dist/esm/components/Table/Table.d.ts +1 -1
- package/dist/esm/components/Table/Table.d.ts.map +1 -1
- package/dist/esm/components/Table/Table.js +3 -1
- package/dist/esm/components/Table/Table.js.map +1 -1
- package/dist/esm/components/Table/TableTypes.d.ts +1 -1
- package/dist/esm/components/Table/TableTypes.d.ts.map +1 -1
- package/dist/esm/components/Table/Td.js.map +1 -1
- package/dist/esm/components/Table/Th.js.map +1 -1
- package/dist/esm/components/Table/base/types.d.ts +5 -2
- package/dist/esm/components/Table/base/types.d.ts.map +1 -1
- package/dist/esm/components/Table/base/types.js.map +1 -1
- package/dist/esm/demos/DashboardHeader.d.ts.map +1 -1
- package/dist/esm/demos/DashboardHeader.js +2 -3
- package/dist/esm/demos/DashboardHeader.js.map +1 -1
- package/dist/esm/demos/DashboardWrapper.d.ts +1 -1
- package/dist/esm/demos/DashboardWrapper.d.ts.map +1 -1
- package/dist/esm/deprecated/components/Table/BodyCell.d.ts +1 -1
- package/dist/esm/deprecated/components/Table/BodyCell.d.ts.map +1 -1
- package/dist/esm/deprecated/components/Table/BodyCell.js.map +1 -1
- package/dist/esm/deprecated/components/Table/Table.d.ts +3 -2
- package/dist/esm/deprecated/components/Table/Table.d.ts.map +1 -1
- package/dist/esm/deprecated/components/Table/Table.js +1 -1
- package/dist/esm/deprecated/components/Table/Table.js.map +1 -1
- package/dist/js/components/Table/ActionsColumn.d.ts.map +1 -1
- package/dist/js/components/Table/ActionsColumn.js.map +1 -1
- package/dist/js/components/Table/EditableSelectInputCell.d.ts +1 -1
- package/dist/js/components/Table/EditableSelectInputCell.d.ts.map +1 -1
- package/dist/js/components/Table/EditableSelectInputCell.js.map +1 -1
- package/dist/js/components/Table/SortColumn.d.ts.map +1 -1
- package/dist/js/components/Table/SortColumn.js +7 -6
- package/dist/js/components/Table/SortColumn.js.map +1 -1
- package/dist/js/components/Table/Table.d.ts +1 -1
- package/dist/js/components/Table/Table.d.ts.map +1 -1
- package/dist/js/components/Table/Table.js +7 -5
- package/dist/js/components/Table/Table.js.map +1 -1
- package/dist/js/components/Table/TableTypes.d.ts +1 -1
- package/dist/js/components/Table/TableTypes.d.ts.map +1 -1
- package/dist/js/components/Table/Td.js.map +1 -1
- package/dist/js/components/Table/Th.js.map +1 -1
- package/dist/js/components/Table/base/types.d.ts +5 -2
- package/dist/js/components/Table/base/types.d.ts.map +1 -1
- package/dist/js/components/Table/base/types.js.map +1 -1
- package/dist/js/demos/DashboardHeader.d.ts.map +1 -1
- package/dist/js/demos/DashboardHeader.js +1 -2
- package/dist/js/demos/DashboardHeader.js.map +1 -1
- package/dist/js/demos/DashboardWrapper.d.ts +1 -1
- package/dist/js/demos/DashboardWrapper.d.ts.map +1 -1
- package/dist/js/deprecated/components/Table/BodyCell.d.ts +1 -1
- package/dist/js/deprecated/components/Table/BodyCell.d.ts.map +1 -1
- package/dist/js/deprecated/components/Table/BodyCell.js.map +1 -1
- package/dist/js/deprecated/components/Table/Table.d.ts +3 -2
- package/dist/js/deprecated/components/Table/Table.d.ts.map +1 -1
- package/dist/js/deprecated/components/Table/Table.js +2 -2
- package/dist/js/deprecated/components/Table/Table.js.map +1 -1
- package/dist/umd/assets/output-DZkBT68i.css +7468 -0
- package/dist/umd/react-table.min.js +4 -4
- package/package.json +6 -6
- package/src/components/Table/ActionsColumn.tsx +1 -2
- package/src/components/Table/EditableSelectInputCell.tsx +2 -2
- package/src/components/Table/SortColumn.tsx +2 -1
- package/src/components/Table/Table.tsx +5 -1
- package/src/components/Table/TableTypes.tsx +1 -1
- package/src/components/Table/Td.tsx +2 -2
- package/src/components/Table/Th.tsx +2 -2
- package/src/components/Table/base/types.tsx +5 -2
- package/src/components/Table/examples/TableDraggable.tsx +1 -1
- package/src/components/Table/examples/TableEditable.tsx +3 -3
- package/src/demos/DashboardHeader.tsx +4 -4
- package/src/demos/DashboardWrapper.tsx +1 -1
- package/src/demos/Table.md +5 -1
- package/src/demos/examples/TableColumnManagement.tsx +212 -205
- package/src/demos/examples/TableColumnManagementWithDraggable.tsx +307 -556
- package/src/deprecated/components/Table/BodyCell.tsx +5 -5
- package/src/deprecated/components/Table/Table.tsx +3 -1
- package/src/deprecated/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +0 -11
- package/src/deprecated/components/Table/examples/LegacyTableMisc.tsx +1 -1
- package/src/deprecated/components/Table/examples/LegacyTableStripedCustomTr.tsx +1 -3
- package/src/test-helpers/MockedTableChanges.js +1 -6
- package/dist/umd/assets/output-81fDksv5.css +0 -27164
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "6.2.0-prerelease.
|
|
3
|
+
"version": "6.2.0-prerelease.20",
|
|
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.2.0-prerelease.
|
|
44
|
-
"@patternfly/react-icons": "^6.2.0-prerelease.
|
|
45
|
-
"@patternfly/react-styles": "^6.2.0-prerelease.
|
|
46
|
-
"@patternfly/react-tokens": "^6.2.0-prerelease.
|
|
43
|
+
"@patternfly/react-core": "^6.2.0-prerelease.19",
|
|
44
|
+
"@patternfly/react-icons": "^6.2.0-prerelease.3",
|
|
45
|
+
"@patternfly/react-styles": "^6.2.0-prerelease.3",
|
|
46
|
+
"@patternfly/react-tokens": "^6.2.0-prerelease.3",
|
|
47
47
|
"lodash": "^4.17.21",
|
|
48
48
|
"tslib": "^2.8.1"
|
|
49
49
|
},
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"react": "^17 || ^18",
|
|
52
52
|
"react-dom": "^17 || ^18"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "939bec6792f720d379d5bfd9c271e4920480bcc4"
|
|
55
55
|
}
|
|
@@ -88,10 +88,9 @@ const ActionsColumnBase: React.FunctionComponent<ActionsColumnProps> = ({
|
|
|
88
88
|
{title}
|
|
89
89
|
</Button>
|
|
90
90
|
) : (
|
|
91
|
-
React.cloneElement(title as React.ReactElement
|
|
91
|
+
React.cloneElement(title as React.ReactElement<any>, { onClick, isDisabled, ...props })
|
|
92
92
|
)
|
|
93
93
|
)}
|
|
94
|
-
|
|
95
94
|
<Dropdown
|
|
96
95
|
isOpen={isOpen}
|
|
97
96
|
onOpenChange={!isOnOpenChangeDisabled ? (isOpen: boolean) => setIsOpen(isOpen) : undefined}
|
|
@@ -22,7 +22,7 @@ export interface IEditableSelectInputCell extends Omit<React.HTMLProps<HTMLEleme
|
|
|
22
22
|
isPlaceholder?: boolean
|
|
23
23
|
) => void;
|
|
24
24
|
/** Options to display in the expandable select menu */
|
|
25
|
-
options?: React.ReactElement[];
|
|
25
|
+
options?: React.ReactElement<any>[];
|
|
26
26
|
/** Flag indicating the select input is disabled */
|
|
27
27
|
isDisabled?: boolean;
|
|
28
28
|
/** Flag indicating the toggle gets placeholder styles **/
|
|
@@ -47,7 +47,7 @@ export const EditableSelectInputCell: React.FunctionComponent<IEditableSelectInp
|
|
|
47
47
|
isPlaceholder = false,
|
|
48
48
|
onToggle = () => {},
|
|
49
49
|
selections = [''],
|
|
50
|
-
options = [] as React.ReactElement[],
|
|
50
|
+
options = [] as React.ReactElement<any>[],
|
|
51
51
|
props
|
|
52
52
|
}: IEditableSelectInputCell) => {
|
|
53
53
|
const onSelectHandler = (event: React.MouseEvent | React.ChangeEvent, newValue: any | any[]) => {
|
|
@@ -6,8 +6,9 @@ import StarIcon from '@patternfly/react-icons/dist/esm/icons/star-icon';
|
|
|
6
6
|
import { css } from '@patternfly/react-styles';
|
|
7
7
|
import styles from '@patternfly/react-styles/css/components/Table/table';
|
|
8
8
|
import { TableText } from './TableText';
|
|
9
|
+
import { ActionList, ActionListItem } from '@patternfly/react-core/dist/esm/components/ActionList';
|
|
10
|
+
import { Button } from '@patternfly/react-core/dist/esm/components/Button';
|
|
9
11
|
import { TooltipProps } from '@patternfly/react-core/dist/esm/components/Tooltip';
|
|
10
|
-
import { ActionList, ActionListItem, Button } from '@patternfly/react-core';
|
|
11
12
|
import { FavoriteButtonProps } from './base/types';
|
|
12
13
|
|
|
13
14
|
export enum SortByDirection {
|
|
@@ -5,9 +5,13 @@ import stylesTreeView from '@patternfly/react-styles/css/components/Table/table-
|
|
|
5
5
|
import { css } from '@patternfly/react-styles';
|
|
6
6
|
import { toCamel } from './utils';
|
|
7
7
|
import { IVisibility } from './utils/decorators/classNames';
|
|
8
|
-
import {
|
|
8
|
+
import { handleArrows, setTabIndex } from '@patternfly/react-core/dist/esm/helpers/KeyboardHandler';
|
|
9
|
+
import { KeyTypes } from '@patternfly/react-core/dist/esm/helpers/constants';
|
|
10
|
+
import { useOUIAProps, OUIAProps } from '@patternfly/react-core/dist/esm/helpers/OUIA/ouia';
|
|
9
11
|
import { TableGridBreakpoint, TableVariant } from './TableTypes';
|
|
10
12
|
|
|
13
|
+
import type { JSX } from 'react';
|
|
14
|
+
|
|
11
15
|
export interface BaseCellProps {
|
|
12
16
|
/** Content rendered inside the cell */
|
|
13
17
|
children?: React.ReactNode;
|
|
@@ -195,7 +195,7 @@ export interface decoratorReturnType {
|
|
|
195
195
|
scope?: string;
|
|
196
196
|
parentId?: number;
|
|
197
197
|
colSpan?: number;
|
|
198
|
-
id?:
|
|
198
|
+
id?: number | string;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
export type ITransform = (label?: IFormatterValueType, extra?: IExtra) => decoratorReturnType;
|
|
@@ -263,8 +263,8 @@ const TdBase: React.FunctionComponent<TdProps> = ({
|
|
|
263
263
|
|
|
264
264
|
React.useEffect(() => {
|
|
265
265
|
setTruncated(
|
|
266
|
-
(cellRef as React.RefObject<HTMLElement>).current.offsetWidth <
|
|
267
|
-
(cellRef as React.RefObject<HTMLElement>).current.scrollWidth
|
|
266
|
+
(cellRef as React.RefObject<HTMLElement | null>).current.offsetWidth <
|
|
267
|
+
(cellRef as React.RefObject<HTMLElement | null>).current.scrollWidth
|
|
268
268
|
);
|
|
269
269
|
}, [cellRef]);
|
|
270
270
|
|
|
@@ -198,8 +198,8 @@ const ThBase: React.FunctionComponent<ThProps> = ({
|
|
|
198
198
|
|
|
199
199
|
React.useEffect(() => {
|
|
200
200
|
setTruncated(
|
|
201
|
-
(cellRef as React.RefObject<HTMLElement>).current.offsetWidth <
|
|
202
|
-
(cellRef as React.RefObject<HTMLElement>).current.scrollWidth
|
|
201
|
+
(cellRef as React.RefObject<HTMLElement | null>).current.offsetWidth <
|
|
202
|
+
(cellRef as React.RefObject<HTMLElement | null>).current.scrollWidth
|
|
203
203
|
);
|
|
204
204
|
}, [cellRef]);
|
|
205
205
|
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import { ButtonProps
|
|
9
|
+
import { ButtonProps } from '@patternfly/react-core/dist/esm/components/Button';
|
|
10
|
+
import { PopoverProps } from '@patternfly/react-core/dist/esm/components/Popover';
|
|
11
|
+
import { SelectProps } from '@patternfly/react-core/dist/esm/components/Select';
|
|
12
|
+
import { TooltipProps } from '@patternfly/react-core/dist/esm/components/Tooltip';
|
|
10
13
|
import { Table } from '../Table';
|
|
11
14
|
import { Thead } from '../Thead';
|
|
12
15
|
import { Tbody } from '../Tbody';
|
|
@@ -295,7 +298,7 @@ export interface EditableSelectInputProps {
|
|
|
295
298
|
/** Single select option value for single select menus, or array of select option values for multi select. You can also specify isSelected on the SelectOption */
|
|
296
299
|
selected: any | any[];
|
|
297
300
|
/** Array of react elements to display in the select menu */
|
|
298
|
-
options: React.ReactElement[];
|
|
301
|
+
options: React.ReactElement<any>[];
|
|
299
302
|
/** Props to be passed down to the select component */
|
|
300
303
|
editableSelectProps?: SelectProps;
|
|
301
304
|
/** arbitrary data to pass to the internal select component in the editable select input cell */
|
|
@@ -9,7 +9,7 @@ export const TableDraggable: React.FunctionComponent = () => {
|
|
|
9
9
|
const [itemOrder, setItemOrder] = React.useState(['row1', 'row2', 'row3']);
|
|
10
10
|
const [tempItemOrder, setTempItemOrder] = React.useState<string[]>([]);
|
|
11
11
|
|
|
12
|
-
const bodyRef = React.useRef<HTMLTableSectionElement>();
|
|
12
|
+
const bodyRef = React.useRef<HTMLTableSectionElement>(undefined);
|
|
13
13
|
|
|
14
14
|
const onDragStart: TrProps['onDragStart'] = (evt) => {
|
|
15
15
|
evt.dataTransfer.effectAllowed = 'move';
|
|
@@ -18,7 +18,7 @@ const EditButtonsCell: React.FunctionComponent<EditButtonsCellProps> = ({
|
|
|
18
18
|
elementToFocusOnEditRef,
|
|
19
19
|
rowAriaLabel = 'row'
|
|
20
20
|
}) => {
|
|
21
|
-
const editButtonRef = React.useRef<HTMLButtonElement>();
|
|
21
|
+
const editButtonRef = React.useRef<HTMLButtonElement>(undefined);
|
|
22
22
|
|
|
23
23
|
const onKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>, button: 'edit' | 'stopEditing') => {
|
|
24
24
|
const focusRef = button === 'edit' ? elementToFocusOnEditRef : editButtonRef;
|
|
@@ -104,7 +104,7 @@ const EditableCell: React.FunctionComponent<EditableCellProps> = ({
|
|
|
104
104
|
<div className={css(inlineEditStyles.inlineEditValue)}>{staticValue}</div>
|
|
105
105
|
{hasMultipleInputs ? (
|
|
106
106
|
<div className={css(inlineEditStyles.inlineEditGroup, 'pf-m-column')} role={role} aria-label={ariaLabel}>
|
|
107
|
-
{(editingValue as React.ReactElement[]).map((elem, index) => (
|
|
107
|
+
{(editingValue as React.ReactElement<any>[]).map((elem, index) => (
|
|
108
108
|
<div key={index} className={css(inlineEditStyles.inlineEditInput)}>
|
|
109
109
|
{elem}
|
|
110
110
|
</div>
|
|
@@ -137,7 +137,7 @@ const EditableRow: React.FunctionComponent<EditableRow> = ({
|
|
|
137
137
|
const [editable, setEditable] = React.useState(false);
|
|
138
138
|
const [editedData, setEditedData] = React.useState(data);
|
|
139
139
|
|
|
140
|
-
const inputRef = React.useRef();
|
|
140
|
+
const inputRef = React.useRef(undefined);
|
|
141
141
|
|
|
142
142
|
return (
|
|
143
143
|
<Tr className={css(inlineEditStyles.inlineEdit, editable ? inlineEditStyles.modifiers.inlineEditable : '')}>
|
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
MastheadLogo,
|
|
17
17
|
MastheadContent,
|
|
18
18
|
MenuToggle,
|
|
19
|
+
NotificationBadge,
|
|
20
|
+
NotificationBadgeVariant,
|
|
19
21
|
Toolbar,
|
|
20
22
|
ToolbarContent,
|
|
21
23
|
ToolbarGroup,
|
|
@@ -26,7 +28,6 @@ import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
|
26
28
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
27
29
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
28
30
|
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
29
|
-
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
30
31
|
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
31
32
|
import imgAvatar from '@patternfly/react-table/src/demos/assets/avatarImg.svg';
|
|
32
33
|
import pfLogo from '@patternfly/react-table/src/demos/assets/pf-logo.svg';
|
|
@@ -108,10 +109,9 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
|
|
|
108
109
|
>
|
|
109
110
|
{notificationBadge ?? (
|
|
110
111
|
<ToolbarItem>
|
|
111
|
-
<
|
|
112
|
+
<NotificationBadge
|
|
112
113
|
aria-label="Notifications"
|
|
113
|
-
variant={
|
|
114
|
-
icon={<BellIcon />}
|
|
114
|
+
variant={NotificationBadgeVariant.read}
|
|
115
115
|
onClick={() => {}}
|
|
116
116
|
/>
|
|
117
117
|
</ToolbarItem>
|
|
@@ -38,7 +38,7 @@ interface DashboardWrapperProps {
|
|
|
38
38
|
/** Callback when notification drawer panel is finished expanding. */
|
|
39
39
|
onNotificationDrawerExpand?: (event: KeyboardEvent | React.MouseEvent | React.TransitionEvent) => void;
|
|
40
40
|
/** Skip to content component for the page */
|
|
41
|
-
skipToContent?: React.ReactElement
|
|
41
|
+
skipToContent?: React.ReactElement<any>;
|
|
42
42
|
/** Sets the value for role on the <main> element */
|
|
43
43
|
role?: string;
|
|
44
44
|
/** an id to use for the [role="main"] element */
|
package/src/demos/Table.md
CHANGED
|
@@ -40,8 +40,12 @@ NavItem,
|
|
|
40
40
|
NavList,
|
|
41
41
|
PageSidebar,
|
|
42
42
|
PageSidebarBody,
|
|
43
|
+
Modal,
|
|
44
|
+
ModalHeader,
|
|
45
|
+
ModalBody,
|
|
46
|
+
ModalFooter,
|
|
43
47
|
} from '@patternfly/react-core';
|
|
44
|
-
import {
|
|
48
|
+
import { DragDropSort } from '@patternfly/react-drag-drop';
|
|
45
49
|
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
46
50
|
import CloneIcon from '@patternfly/react-icons/dist/esm/icons/clone-icon';
|
|
47
51
|
import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|