@patternfly/react-table 6.0.0-alpha.57 → 6.0.0-alpha.58
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 +6 -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/EditableSelectInputCell.d.ts +3 -4
- package/dist/esm/components/Table/EditableSelectInputCell.d.ts.map +1 -1
- package/dist/esm/components/Table/EditableSelectInputCell.js +8 -4
- package/dist/esm/components/Table/EditableSelectInputCell.js.map +1 -1
- package/dist/esm/components/Table/TableTypes.d.ts +2 -3
- package/dist/esm/components/Table/TableTypes.d.ts.map +1 -1
- package/dist/esm/components/Table/TableTypes.js.map +1 -1
- package/dist/esm/components/Table/base/types.d.ts +6 -7
- 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/deprecated/components/Table/Table.d.ts.map +1 -1
- package/dist/esm/deprecated/components/Table/Table.js +2 -3
- package/dist/esm/deprecated/components/Table/Table.js.map +1 -1
- package/dist/js/components/Table/EditableSelectInputCell.d.ts +3 -4
- package/dist/js/components/Table/EditableSelectInputCell.d.ts.map +1 -1
- package/dist/js/components/Table/EditableSelectInputCell.js +8 -4
- package/dist/js/components/Table/EditableSelectInputCell.js.map +1 -1
- package/dist/js/components/Table/TableTypes.d.ts +2 -3
- package/dist/js/components/Table/TableTypes.d.ts.map +1 -1
- package/dist/js/components/Table/TableTypes.js +0 -1
- package/dist/js/components/Table/TableTypes.js.map +1 -1
- package/dist/js/components/Table/base/types.d.ts +6 -7
- package/dist/js/components/Table/base/types.d.ts.map +1 -1
- package/dist/js/components/Table/base/types.js +1 -2
- package/dist/js/components/Table/base/types.js.map +1 -1
- package/dist/js/deprecated/components/Table/Table.d.ts.map +1 -1
- package/dist/js/deprecated/components/Table/Table.js +9 -10
- package/dist/js/deprecated/components/Table/Table.js.map +1 -1
- package/dist/umd/react-table.min.js +3 -3
- package/package.json +3 -3
- package/src/components/Table/EditableSelectInputCell.tsx +15 -10
- package/src/components/Table/TableTypes.tsx +2 -3
- package/src/components/Table/base/types.tsx +6 -7
- package/src/components/Table/utils/transformers.test.tsx +2 -3
- package/src/deprecated/components/Table/Table.tsx +2 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.58",
|
|
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.js --config subpaths.config.json"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@patternfly/react-core": "^6.0.0-alpha.
|
|
43
|
+
"@patternfly/react-core": "^6.0.0-alpha.58",
|
|
44
44
|
"@patternfly/react-icons": "^6.0.0-alpha.20",
|
|
45
45
|
"@patternfly/react-styles": "^6.0.0-alpha.20",
|
|
46
46
|
"@patternfly/react-tokens": "^6.0.0-alpha.20",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"react": "^17 || ^18",
|
|
56
56
|
"react-dom": "^17 || ^18"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "085b43fa526d2b629825d72a19083f506379cd30"
|
|
59
59
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
|
-
import { Select,
|
|
3
|
+
import { Select, SelectList } from '@patternfly/react-core/dist/esm/components/Select';
|
|
4
|
+
import { MenuToggle } from '@patternfly/react-core/dist/esm/components/MenuToggle';
|
|
4
5
|
import inlineStyles from '@patternfly/react-styles/css/components/InlineEdit/inline-edit';
|
|
5
6
|
import formStyles from '@patternfly/react-styles/css/components/Form/form';
|
|
6
7
|
import { EditableSelectInputProps } from './base/types';
|
|
@@ -15,7 +16,7 @@ export interface IEditableSelectInputCell extends Omit<React.HTMLProps<HTMLEleme
|
|
|
15
16
|
/** Event handler which fires when user selects an option in this cell */
|
|
16
17
|
onSelect: (
|
|
17
18
|
event: React.MouseEvent | React.ChangeEvent,
|
|
18
|
-
newValue:
|
|
19
|
+
newValue: any | any[],
|
|
19
20
|
rowIndex: number,
|
|
20
21
|
cellIndex: number,
|
|
21
22
|
isPlaceholder?: boolean
|
|
@@ -25,11 +26,11 @@ export interface IEditableSelectInputCell extends Omit<React.HTMLProps<HTMLEleme
|
|
|
25
26
|
/** Flag indicating the select input is disabled */
|
|
26
27
|
isDisabled?: boolean;
|
|
27
28
|
/** Current selected options to display as the read only value of the table cell */
|
|
28
|
-
selections?:
|
|
29
|
+
selections?: any | any[];
|
|
29
30
|
/** Flag indicating the select menu is open */
|
|
30
31
|
isOpen?: boolean;
|
|
31
32
|
/** Event handler which fires when the select toggle is toggled */
|
|
32
|
-
onToggle?: (event: React.MouseEvent |
|
|
33
|
+
onToggle?: (event: React.MouseEvent | undefined) => void;
|
|
33
34
|
/** Event handler which fires when the user clears the selections */
|
|
34
35
|
clearSelection?: (event: React.MouseEvent, rowIndex: number, cellIndex: number) => void;
|
|
35
36
|
}
|
|
@@ -48,10 +49,10 @@ export const EditableSelectInputCell: React.FunctionComponent<IEditableSelectInp
|
|
|
48
49
|
}: IEditableSelectInputCell) => {
|
|
49
50
|
const onSelectHandler = (
|
|
50
51
|
event: React.MouseEvent | React.ChangeEvent,
|
|
51
|
-
newValue:
|
|
52
|
-
isPlaceholder: boolean
|
|
52
|
+
newValue: any | any[]
|
|
53
|
+
// isPlaceholder: boolean
|
|
53
54
|
) => {
|
|
54
|
-
onSelect(event, newValue, rowIndex, cellIndex
|
|
55
|
+
onSelect(event, newValue, rowIndex, cellIndex);
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
const onClear = (event: React.MouseEvent) => {
|
|
@@ -64,10 +65,14 @@ export const EditableSelectInputCell: React.FunctionComponent<IEditableSelectInp
|
|
|
64
65
|
onSelect={onSelectHandler}
|
|
65
66
|
{...(clearSelection && { onClear })}
|
|
66
67
|
isOpen={isOpen}
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
selected={selections}
|
|
69
|
+
toggle={(toggleRef: any) => (
|
|
70
|
+
<MenuToggle ref={toggleRef} onClick={onToggle} isExpanded={isOpen}>
|
|
71
|
+
{isOpen ? 'Expanded' : 'Collapsed'}
|
|
72
|
+
</MenuToggle>
|
|
73
|
+
)}
|
|
69
74
|
>
|
|
70
|
-
{options}
|
|
75
|
+
<SelectList>{options}</SelectList>
|
|
71
76
|
</Select>
|
|
72
77
|
);
|
|
73
78
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { formatterValueType, ColumnType, RowType, RowKeyType, HeaderType } from './base/types';
|
|
2
2
|
import { SortByDirection } from './SortColumn';
|
|
3
3
|
import { DropdownItemProps } from '@patternfly/react-core/dist/esm/components/Dropdown';
|
|
4
|
-
import { DropdownDirection, DropdownPosition } from '@patternfly/react-core/dist/esm/deprecated/components/Dropdown';
|
|
5
4
|
import * as React from 'react';
|
|
6
5
|
import { CustomActionsToggleProps } from './ActionsColumn';
|
|
7
6
|
import { ButtonProps } from '@patternfly/react-core/dist/esm/components/Button';
|
|
@@ -102,8 +101,8 @@ export interface IColumn {
|
|
|
102
101
|
rowLabeledBy?: string;
|
|
103
102
|
expandId?: string;
|
|
104
103
|
contentId?: string;
|
|
105
|
-
dropdownPosition?:
|
|
106
|
-
dropdownDirection?:
|
|
104
|
+
dropdownPosition?: 'right' | 'left';
|
|
105
|
+
dropdownDirection?: 'up' | 'down';
|
|
107
106
|
menuAppendTo?: HTMLElement | (() => HTMLElement) | 'inline' | 'parent';
|
|
108
107
|
actionsToggle?: (props: CustomActionsToggleProps) => React.ReactNode;
|
|
109
108
|
actionsPopperProps?: any;
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { TooltipProps } from '@patternfly/react-core/dist/esm/components/Tooltip';
|
|
10
10
|
import { PopoverProps } from '@patternfly/react-core/dist/esm/components/Popover';
|
|
11
|
-
import {
|
|
12
|
-
import { SelectOptionObject, SelectProps } from '@patternfly/react-core/dist/esm/deprecated/components/Select';
|
|
11
|
+
import { SelectProps } from '@patternfly/react-core/dist/esm/components/Select';
|
|
13
12
|
import { Table } from '../Table';
|
|
14
13
|
import { Thead } from '../Thead';
|
|
15
14
|
import { Tbody } from '../Tbody';
|
|
@@ -61,9 +60,9 @@ export interface TdActionsType {
|
|
|
61
60
|
/** Whether the actions are disabled */
|
|
62
61
|
isDisabled?: boolean;
|
|
63
62
|
/** Actions dropdown position */
|
|
64
|
-
dropdownPosition?:
|
|
63
|
+
dropdownPosition?: 'right' | 'left';
|
|
65
64
|
/** Actions dropdown direction */
|
|
66
|
-
dropdownDirection?:
|
|
65
|
+
dropdownDirection?: 'up' | 'down';
|
|
67
66
|
/** The container to append the dropdown menu to. Defaults to 'inline'.
|
|
68
67
|
* If your menu is being cut off you can append it to an element higher up the DOM tree.
|
|
69
68
|
* Some examples:
|
|
@@ -286,11 +285,11 @@ export interface EditableSelectInputProps {
|
|
|
286
285
|
value: string | string[];
|
|
287
286
|
/** Flag controlling isOpen state of select */
|
|
288
287
|
isSelectOpen: boolean;
|
|
289
|
-
/**
|
|
290
|
-
selected:
|
|
288
|
+
/** 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 */
|
|
289
|
+
selected: any | any[];
|
|
291
290
|
/** Array of react elements to display in the select menu */
|
|
292
291
|
options: React.ReactElement[];
|
|
293
|
-
/** Props to be passed down to the
|
|
292
|
+
/** Props to be passed down to the select component */
|
|
294
293
|
editableSelectProps?: SelectProps;
|
|
295
294
|
/** arbitrary data to pass to the internal select component in the editable select input cell */
|
|
296
295
|
[key: string]: any;
|
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
textCenter,
|
|
19
19
|
cellActions
|
|
20
20
|
} from './';
|
|
21
|
-
import { DropdownPosition, DropdownDirection } from '@patternfly/react-core/dist/esm/deprecated/components/Dropdown';
|
|
22
21
|
import {
|
|
23
22
|
IAction,
|
|
24
23
|
IActions,
|
|
@@ -58,8 +57,8 @@ const testCellActions = async ({
|
|
|
58
57
|
rowData,
|
|
59
58
|
column: {
|
|
60
59
|
extraParams: {
|
|
61
|
-
dropdownPosition:
|
|
62
|
-
dropdownDirection:
|
|
60
|
+
dropdownPosition: 'right',
|
|
61
|
+
dropdownDirection: 'down'
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { OUIAProps, getDefaultOUIAId } from '@patternfly/react-core';
|
|
3
|
-
import { DropdownDirection, DropdownPosition } from '@patternfly/react-core/dist/esm/deprecated/components';
|
|
4
3
|
import inlineStyles from '@patternfly/react-styles/css/components/InlineEdit/inline-edit';
|
|
5
4
|
import { css } from '@patternfly/react-styles';
|
|
6
5
|
import { Provider } from '../../../components/Table/base/provider';
|
|
@@ -143,8 +142,8 @@ class Table extends React.Component<TableProps, {}> {
|
|
|
143
142
|
rowLabeledBy: 'simple-node',
|
|
144
143
|
expandId: 'expandable-toggle',
|
|
145
144
|
contentId: 'expanded-content',
|
|
146
|
-
dropdownPosition:
|
|
147
|
-
dropdownDirection:
|
|
145
|
+
dropdownPosition: 'right',
|
|
146
|
+
dropdownDirection: 'down',
|
|
148
147
|
actionsMenuAppendTo: 'inline',
|
|
149
148
|
header: undefined as React.ReactNode,
|
|
150
149
|
caption: undefined as React.ReactNode,
|