@patternfly/react-table 6.2.0-prerelease.33 → 6.2.0-prerelease.35
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/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/Table.js.map +1 -1
- package/dist/esm/deprecated/components/Table/Table.d.ts +2 -2
- 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/Table.js.map +1 -1
- package/dist/js/deprecated/components/Table/Table.d.ts +2 -2
- 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-DB0h3ab0.css → output-B1NqtgrC.css} +5084 -4971
- package/dist/umd/react-table.min.js +1 -1
- package/package.json +6 -6
- package/src/components/Table/Table.tsx +2 -2
- package/src/components/Table/examples/TableSortableCustom.tsx +1 -1
- package/src/demos/Table.md +2 -0
- package/src/demos/examples/TableBulkSelect.tsx +7 -6
- package/src/demos/examples/TableColumnManagement.tsx +2 -2
- package/src/demos/examples/TableColumnManagementWithDraggable.tsx +2 -2
- package/src/demos/examples/TableCompoundExpansion.tsx +3 -2
- package/src/deprecated/components/Table/Table.tsx +2 -2
- package/src/deprecated/components/Table/examples/LegacyTableSortableCustom.tsx +1 -1
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.35",
|
|
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.34",
|
|
44
|
+
"@patternfly/react-icons": "^6.2.0-prerelease.12",
|
|
45
|
+
"@patternfly/react-styles": "^6.2.0-prerelease.11",
|
|
46
|
+
"@patternfly/react-tokens": "^6.2.0-prerelease.11",
|
|
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": "06f0914bed087998e510eddc309c8ab44e2ab194"
|
|
55
55
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext, forwardRef, useEffect, useRef, useState
|
|
1
|
+
import { createContext, forwardRef, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Table/table';
|
|
3
3
|
import stylesGrid from '@patternfly/react-styles/css/components/Table/table-grid';
|
|
4
4
|
import stylesTreeView from '@patternfly/react-styles/css/components/Table/table-tree-view';
|
|
@@ -105,7 +105,7 @@ const TableBase: React.FunctionComponent<TableProps> = ({
|
|
|
105
105
|
const tableRef = innerRef || ref;
|
|
106
106
|
|
|
107
107
|
const [hasSelectableRows, setHasSelectableRows] = useState(false);
|
|
108
|
-
const [tableCaption, setTableCaption] = useState<JSX.Element | undefined>();
|
|
108
|
+
const [tableCaption, setTableCaption] = useState<React.JSX.Element | undefined>();
|
|
109
109
|
|
|
110
110
|
useEffect(() => {
|
|
111
111
|
document.addEventListener('keydown', handleKeys);
|
|
@@ -48,7 +48,7 @@ export const TableSortableCustom: React.FunctionComponent = () => {
|
|
|
48
48
|
const [activeSortDirection, setActiveSortDirection] = useState<'asc' | 'desc' | null>(null);
|
|
49
49
|
|
|
50
50
|
// Sort dropdown expansion
|
|
51
|
-
// const [isSortDropdownOpen, setIsSortDropdownOpen] =
|
|
51
|
+
// const [isSortDropdownOpen, setIsSortDropdownOpen] = useState(false);
|
|
52
52
|
|
|
53
53
|
// Since OnSort specifies sorted columns by index, we need sortable values for our object by column index.
|
|
54
54
|
// This example is trivial since our data objects just contain strings, but if the data was more complex
|
package/src/demos/Table.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
Dropdown,
|
|
3
4
|
DropdownList,
|
|
@@ -18,12 +19,12 @@ import { rows, columns, SampleDataRow } from '@patternfly/react-table/dist/esm/d
|
|
|
18
19
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
19
20
|
|
|
20
21
|
export const TableBulkSelect: React.FunctionComponent = () => {
|
|
21
|
-
const [isBulkSelectDropdownOpen, setIsBulkSelectDropdownOpen] =
|
|
22
|
-
const [bulkSelection, setBulkSelection] =
|
|
23
|
-
const [page, setPage] =
|
|
24
|
-
const [perPage, setPerPage] =
|
|
25
|
-
const [paginatedRows, setPaginatedRows] =
|
|
26
|
-
const [selectedRows, setSelectedRows] =
|
|
22
|
+
const [isBulkSelectDropdownOpen, setIsBulkSelectDropdownOpen] = useState(false);
|
|
23
|
+
const [bulkSelection, setBulkSelection] = useState('');
|
|
24
|
+
const [page, setPage] = useState(1);
|
|
25
|
+
const [perPage, setPerPage] = useState(10);
|
|
26
|
+
const [paginatedRows, setPaginatedRows] = useState(rows.slice(0, 10));
|
|
27
|
+
const [selectedRows, setSelectedRows] = useState<string[]>([]);
|
|
27
28
|
|
|
28
29
|
const handleSetPage = (
|
|
29
30
|
_evt: React.MouseEvent | React.KeyboardEvent | MouseEvent,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, useEffect, useState
|
|
1
|
+
import { Fragment, useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
Button,
|
|
@@ -386,7 +386,7 @@ export const TableColumnManagement: React.FunctionComponent = () => {
|
|
|
386
386
|
</Modal>
|
|
387
387
|
);
|
|
388
388
|
|
|
389
|
-
const renderLabel = (labelText: string): JSX.Element => {
|
|
389
|
+
const renderLabel = (labelText: string): React.JSX.Element => {
|
|
390
390
|
switch (labelText) {
|
|
391
391
|
case 'Running':
|
|
392
392
|
return <Label color="green">{labelText}</Label>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, useEffect, useState
|
|
1
|
+
import { Fragment, useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
Button,
|
|
@@ -281,7 +281,7 @@ export const TableColumnManagement: React.FunctionComponent = () => {
|
|
|
281
281
|
</Modal>
|
|
282
282
|
);
|
|
283
283
|
|
|
284
|
-
const renderLabel = (labelText: string): JSX.Element => {
|
|
284
|
+
const renderLabel = (labelText: string): React.JSX.Element => {
|
|
285
285
|
switch (labelText) {
|
|
286
286
|
case 'Running':
|
|
287
287
|
return <Label color="green">{labelText}</Label>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
1
2
|
import { ActionsColumn, Table, Thead, Tr, Th, Tbody, Td, ExpandableRowContent } from '@patternfly/react-table';
|
|
2
3
|
import {
|
|
3
4
|
Button,
|
|
@@ -25,7 +26,7 @@ import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
|
|
|
25
26
|
|
|
26
27
|
export const TableCompoundExpansion: React.FunctionComponent = () => {
|
|
27
28
|
// In real usage, this data would come from some external source like an API via props.
|
|
28
|
-
const [isSelectOpen, setIsSelectOpen] =
|
|
29
|
+
const [isSelectOpen, setIsSelectOpen] = useState(false);
|
|
29
30
|
|
|
30
31
|
const NestedItemsTable = () => {
|
|
31
32
|
// In real usage, this data would come from some external source like an API via props.
|
|
@@ -176,7 +177,7 @@ export const TableCompoundExpansion: React.FunctionComponent = () => {
|
|
|
176
177
|
// In this example, expanded cells are tracked by the repo and property names from each row. This could be any pair of unique identifiers.
|
|
177
178
|
// This is to prevent state from being based on row and column order index in case we later add sorting and rearranging columns.
|
|
178
179
|
// Note that this behavior is very similar to selection state.
|
|
179
|
-
const [expandedCells, setExpandedCells] =
|
|
180
|
+
const [expandedCells, setExpandedCells] = useState<IDictionary<string>>({
|
|
180
181
|
'siemur/test-space': 'branches' // Default to the first cell of the first row being expanded
|
|
181
182
|
});
|
|
182
183
|
const setCellExpanded = (repo: Repo, columnKey: string, isExpanding = true) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component
|
|
1
|
+
import { Component } from 'react';
|
|
2
2
|
import { OUIAProps, getDefaultOUIAId } from '@patternfly/react-core/dist/esm/helpers/OUIA/ouia';
|
|
3
3
|
import inlineStyles from '@patternfly/react-styles/css/components/InlineEdit/inline-edit';
|
|
4
4
|
import { css } from '@patternfly/react-styles';
|
|
@@ -105,7 +105,7 @@ export interface TableProps extends OUIAProps {
|
|
|
105
105
|
/** Wrapper for the body */
|
|
106
106
|
bodyWrapper?: Function;
|
|
107
107
|
/** Wrapper for the row */
|
|
108
|
-
rowWrapper?: (props: RowWrapperProps) => JSX.Element;
|
|
108
|
+
rowWrapper?: (props: RowWrapperProps) => React.JSX.Element;
|
|
109
109
|
/** A valid WAI-ARIA role to be applied to the table element */
|
|
110
110
|
role?: string;
|
|
111
111
|
/** If set to true, the table header sticks to the top of its container */
|
|
@@ -46,7 +46,7 @@ export const LegacyTableSortableCustom: React.FunctionComponent = () => {
|
|
|
46
46
|
const [activeSortDirection, setActiveSortDirection] = useState<'asc' | 'desc' | null>(null);
|
|
47
47
|
|
|
48
48
|
// Sort dropdown expansion
|
|
49
|
-
// const [isSortDropdownOpen, setIsSortDropdownOpen] =
|
|
49
|
+
// const [isSortDropdownOpen, setIsSortDropdownOpen] = useState(false);
|
|
50
50
|
|
|
51
51
|
// Since OnSort specifies sorted columns by index, we need sortable values for our object by column index.
|
|
52
52
|
// This example is trivial since our data objects just contain strings, but if the data was more complex
|