@patternfly/react-table 6.2.0-prerelease.17 → 6.2.0-prerelease.19
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 +8 -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/Table.d.ts.map +1 -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 +1 -1
- package/dist/esm/components/Table/base/types.d.ts.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 +2 -1
- package/dist/esm/deprecated/components/Table/Table.d.ts.map +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/Table.d.ts.map +1 -1
- 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 +1 -1
- package/dist/js/components/Table/base/types.d.ts.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 +2 -1
- package/dist/js/deprecated/components/Table/Table.d.ts.map +1 -1
- package/dist/js/deprecated/components/Table/Table.js.map +1 -1
- package/dist/umd/assets/{output-DfUC2MiK.css → output-2yjaKIUG.css} +1838 -1839
- package/dist/umd/react-table.min.js +1 -1
- package/package.json +3 -3
- package/src/components/Table/ActionsColumn.tsx +1 -2
- package/src/components/Table/EditableSelectInputCell.tsx +2 -2
- package/src/components/Table/Table.tsx +2 -0
- 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 +1 -1
- package/src/components/Table/examples/TableDraggable.tsx +1 -1
- package/src/components/Table/examples/TableEditable.tsx +3 -3
- package/src/demos/DashboardWrapper.tsx +1 -1
- package/src/demos/examples/TableColumnManagement.tsx +1 -1
- package/src/demos/examples/TableColumnManagementWithDraggable.tsx +1 -1
- package/src/deprecated/components/Table/BodyCell.tsx +5 -5
- package/src/deprecated/components/Table/Table.tsx +2 -0
- 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/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.19",
|
|
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,7 +40,7 @@
|
|
|
40
40
|
"subpaths": "node ../../scripts/exportSubpaths.mjs --config subpaths.config.json"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@patternfly/react-core": "^6.2.0-prerelease.
|
|
43
|
+
"@patternfly/react-core": "^6.2.0-prerelease.18",
|
|
44
44
|
"@patternfly/react-icons": "^6.2.0-prerelease.2",
|
|
45
45
|
"@patternfly/react-styles": "^6.2.0-prerelease.2",
|
|
46
46
|
"@patternfly/react-tokens": "^6.2.0-prerelease.2",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"react": "^17 || ^18",
|
|
52
52
|
"react-dom": "^17 || ^18"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "e2c34186b346a3b2c5d5621227e475a7ff3e4076"
|
|
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[]) => {
|
|
@@ -10,6 +10,8 @@ import { KeyTypes } from '@patternfly/react-core/dist/esm/helpers/constants';
|
|
|
10
10
|
import { useOUIAProps, OUIAProps } from '@patternfly/react-core/dist/esm/helpers/OUIA/ouia';
|
|
11
11
|
import { TableGridBreakpoint, TableVariant } from './TableTypes';
|
|
12
12
|
|
|
13
|
+
import type { JSX } from 'react';
|
|
14
|
+
|
|
13
15
|
export interface BaseCellProps {
|
|
14
16
|
/** Content rendered inside the cell */
|
|
15
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
|
|
|
@@ -298,7 +298,7 @@ export interface EditableSelectInputProps {
|
|
|
298
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 */
|
|
299
299
|
selected: any | any[];
|
|
300
300
|
/** Array of react elements to display in the select menu */
|
|
301
|
-
options: React.ReactElement[];
|
|
301
|
+
options: React.ReactElement<any>[];
|
|
302
302
|
/** Props to be passed down to the select component */
|
|
303
303
|
editableSelectProps?: SelectProps;
|
|
304
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 : '')}>
|
|
@@ -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 */
|
|
@@ -18,7 +18,7 @@ export interface BodyCellProps {
|
|
|
18
18
|
ariaControls?: string;
|
|
19
19
|
editableValue?: any;
|
|
20
20
|
editableSelectProps?: SelectProps;
|
|
21
|
-
options?: React.ReactElement[];
|
|
21
|
+
options?: React.ReactElement<any>[];
|
|
22
22
|
isSelectOpen?: boolean;
|
|
23
23
|
value?: any;
|
|
24
24
|
isValid?: boolean;
|
|
@@ -69,10 +69,10 @@ export const BodyCell: React.FunctionComponent<BodyCellProps> = ({
|
|
|
69
69
|
let isEmptyStateCell = false;
|
|
70
70
|
if (children) {
|
|
71
71
|
isEmptyStateCell =
|
|
72
|
-
((children as React.ReactElement).type === Bullseye &&
|
|
73
|
-
(children as React.ReactElement).props.children &&
|
|
74
|
-
(children as React.ReactElement).props.children.type === EmptyState) ||
|
|
75
|
-
(children as React.ReactElement).type === EmptyState;
|
|
72
|
+
((children as React.ReactElement<any>).type === Bullseye &&
|
|
73
|
+
(children as React.ReactElement<any>).props.children &&
|
|
74
|
+
(children as React.ReactElement<any>).props.children.type === EmptyState) ||
|
|
75
|
+
(children as React.ReactElement<any>).type === EmptyState;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
const cell = (
|
|
@@ -36,7 +36,7 @@ export const LegacyTableMisc: React.FunctionComponent = () => {
|
|
|
36
36
|
};
|
|
37
37
|
return (
|
|
38
38
|
<tr
|
|
39
|
-
ref={trRef as React.
|
|
39
|
+
ref={trRef as React.Ref<HTMLTableRowElement>}
|
|
40
40
|
className={css(className, isOddRow ? 'odd-row-class' : 'even-row-class', 'custom-static-class')}
|
|
41
41
|
style={isOddRow ? customStyle : {}}
|
|
42
42
|
/>
|
|
@@ -29,9 +29,7 @@ export const LegacyTableStripedCustomTr: React.FunctionComponent = () => {
|
|
|
29
29
|
|
|
30
30
|
const customRowWrapper: TableProps['rowWrapper'] = ({ trRef, className, rowProps, row: _row }) => {
|
|
31
31
|
const isOddRow = rowProps ? !!((rowProps.rowIndex + 1) % 2) : true;
|
|
32
|
-
return (
|
|
33
|
-
<tr ref={trRef as React.LegacyRef<HTMLTableRowElement>} className={css(className, isOddRow && 'pf-m-striped')} />
|
|
34
|
-
);
|
|
32
|
+
return <tr ref={trRef as React.Ref<HTMLTableRowElement>} className={css(className, isOddRow && 'pf-m-striped')} />;
|
|
35
33
|
};
|
|
36
34
|
|
|
37
35
|
return (
|
|
@@ -41,7 +41,7 @@ export const TableProvider = withContext({
|
|
|
41
41
|
contextType: { columns: PropTypes.any, renderers: PropTypes.any }
|
|
42
42
|
})('table');
|
|
43
43
|
|
|
44
|
-
const MockedTableChanges = ({ updateFunc, columns }) => (
|
|
44
|
+
const MockedTableChanges = ({ updateFunc = () => undefined, columns = [] }) => (
|
|
45
45
|
<TableContext.Provider value={{ updateHeaderData: updateFunc }}>
|
|
46
46
|
<TableProvider>
|
|
47
47
|
<TableHeader headerRows={columns} />
|
|
@@ -54,9 +54,4 @@ MockedTableChanges.propTypes = {
|
|
|
54
54
|
columns: PropTypes.array
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
MockedTableChanges.defaultProps = {
|
|
58
|
-
updateFunc: () => undefined,
|
|
59
|
-
columns: []
|
|
60
|
-
};
|
|
61
|
-
|
|
62
57
|
export default MockedTableChanges;
|