@patternfly/react-table 5.0.0-alpha.128 → 5.0.0-alpha.129

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 CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.0.0-alpha.129](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@5.0.0-alpha.128...@patternfly/react-table@5.0.0-alpha.129) (2023-05-31)
7
+
8
+ **Note:** Version bump only for package @patternfly/react-table
9
+
6
10
  # [5.0.0-alpha.128](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@5.0.0-alpha.127...@patternfly/react-table@5.0.0-alpha.128) (2023-05-31)
7
11
 
8
12
  **Note:** Version bump only for package @patternfly/react-table
@@ -1 +1 @@
1
- {"name":"@patternfly/react-table-components-esm","main":"index.js","module":"./components/index.js","typings":"index.d.ts","version":"5.0.0-alpha.127"}
1
+ {"name":"@patternfly/react-table-components-esm","main":"index.js","module":"./components/index.js","typings":"index.d.ts","version":"5.0.0-alpha.128"}
@@ -1 +1 @@
1
- {"name":"@patternfly/react-table-deprecated-deprecated-esm","main":"index.js","module":"./deprecated/index.js","typings":"index.d.ts","version":"5.0.0-alpha.127"}
1
+ {"name":"@patternfly/react-table-deprecated-deprecated-esm","main":"index.js","module":"./deprecated/index.js","typings":"index.d.ts","version":"5.0.0-alpha.128"}
@@ -1 +1 @@
1
- {"name":"@patternfly/react-table-table-cjs","main":"index.js","module":"./dist/js/components/Table/index.js","typings":"index.d.ts","version":"5.0.0-alpha.127"}
1
+ {"name":"@patternfly/react-table-table-cjs","main":"index.js","module":"./dist/js/components/Table/index.js","typings":"index.d.ts","version":"5.0.0-alpha.128"}
@@ -1 +1 @@
1
- {"name":"@patternfly/react-table-decorators-cjs","main":"index.js","module":"./dist/js/components/Table/utils/decorators/index.js","typings":"index.d.ts","version":"5.0.0-alpha.127"}
1
+ {"name":"@patternfly/react-table-decorators-cjs","main":"index.js","module":"./dist/js/components/Table/utils/decorators/index.js","typings":"index.d.ts","version":"5.0.0-alpha.128"}
@@ -1 +1 @@
1
- {"name":"@patternfly/react-table-utils-cjs","main":"index.js","module":"./dist/js/components/Table/utils/index.js","typings":"index.d.ts","version":"5.0.0-alpha.127"}
1
+ {"name":"@patternfly/react-table-utils-cjs","main":"index.js","module":"./dist/js/components/Table/utils/index.js","typings":"index.d.ts","version":"5.0.0-alpha.128"}
@@ -1 +1 @@
1
- {"name":"@patternfly/react-table-components-cjs","main":"index.js","module":"./dist/js/components/index.js","typings":"index.d.ts","version":"5.0.0-alpha.127"}
1
+ {"name":"@patternfly/react-table-components-cjs","main":"index.js","module":"./dist/js/components/index.js","typings":"index.d.ts","version":"5.0.0-alpha.128"}
@@ -1 +1 @@
1
- {"name":"@patternfly/react-table-base-deprecated-cjs","main":"index.js","module":"./dist/js/deprecated/components/Table/base/index.js","typings":"index.d.ts","version":"5.0.0-alpha.127"}
1
+ {"name":"@patternfly/react-table-base-deprecated-cjs","main":"index.js","module":"./dist/js/deprecated/components/Table/base/index.js","typings":"index.d.ts","version":"5.0.0-alpha.128"}
@@ -1 +1 @@
1
- {"name":"@patternfly/react-table-table-deprecated-cjs","main":"index.js","module":"./dist/js/deprecated/components/Table/index.js","typings":"index.d.ts","version":"5.0.0-alpha.127"}
1
+ {"name":"@patternfly/react-table-table-deprecated-cjs","main":"index.js","module":"./dist/js/deprecated/components/Table/index.js","typings":"index.d.ts","version":"5.0.0-alpha.128"}
@@ -1 +1 @@
1
- {"name":"@patternfly/react-table-components-deprecated-cjs","main":"index.js","module":"./dist/js/deprecated/components/index.js","typings":"index.d.ts","version":"5.0.0-alpha.127"}
1
+ {"name":"@patternfly/react-table-components-deprecated-cjs","main":"index.js","module":"./dist/js/deprecated/components/index.js","typings":"index.d.ts","version":"5.0.0-alpha.128"}
@@ -1 +1 @@
1
- {"name":"@patternfly/react-table-deprecated-deprecated-cjs","main":"index.js","module":"./dist/js/deprecated/index.js","typings":"index.d.ts","version":"5.0.0-alpha.127"}
1
+ {"name":"@patternfly/react-table-deprecated-deprecated-cjs","main":"index.js","module":"./dist/js/deprecated/index.js","typings":"index.d.ts","version":"5.0.0-alpha.128"}
@@ -1 +1 @@
1
- {"name":"@patternfly/react-table-js-cjs","main":"index.js","module":"./dist/js/index.js","typings":"index.d.ts","version":"5.0.0-alpha.127"}
1
+ {"name":"@patternfly/react-table-js-cjs","main":"index.js","module":"./dist/js/index.js","typings":"index.d.ts","version":"5.0.0-alpha.128"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-table",
3
- "version": "5.0.0-alpha.128",
3
+ "version": "5.0.0-alpha.129",
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",
@@ -55,5 +55,5 @@
55
55
  "react": "^17 || ^18",
56
56
  "react-dom": "^17 || ^18"
57
57
  },
58
- "gitHead": "0f4a1d04e19c94a00f2174fb5e063e4cc516819f"
58
+ "gitHead": "0343f858695fe246724a5f730414238a5e49a5cc"
59
59
  }
@@ -50,7 +50,7 @@ import AttentionBellIcon from '@patternfly/react-icons/dist/esm/icons/attention-
50
50
  import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
51
51
  import BlueprintIcon from '@patternfly/react-icons/dist/esm/icons/blueprint-icon';
52
52
  import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
53
- import { rows, columns } from '../examples/Data.jsx';
53
+ import { rows, columns } from './table-demos/sampleData';
54
54
 
55
55
  ## Demos
56
56
 
@@ -855,7 +855,7 @@ import {
855
855
  import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
856
856
  import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
857
857
  import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
858
- import { rows, columns } from '../../examples/Data.jsx';
858
+ import { rows, columns } from '';
859
859
 
860
860
  class FilterTableDemo extends React.Component {
861
861
  constructor(props) {
@@ -1426,70 +1426,8 @@ class ComplexPaginationTableDemo extends React.Component {
1426
1426
 
1427
1427
  ### Sticky header
1428
1428
 
1429
- ```js isFullscreen
1430
- import React from 'react';
1431
- import { Label, PageSection } from '@patternfly/react-core';
1432
- import { Table as TableDeprecated, TableHeader, TableBody } from '@patternfly/react-table/deprecated';
1433
- import { rows } from '../examples/Data.jsx';
1434
-
1435
- class StickyHeaderTableDemo extends React.Component {
1436
- render() {
1437
- const renderLabel = (labelText) => {
1438
- switch (labelText) {
1439
- case 'Running':
1440
- return <Label color="green">{labelText}</Label>;
1441
- case 'Stopped':
1442
- return <Label color="orange">{labelText}</Label>;
1443
- case 'Needs maintenance':
1444
- return <Label color="blue">{labelText}</Label>;
1445
- case 'Down':
1446
- return <Label color="red">{labelText}</Label>;
1447
- }
1448
- };
1429
+ ```js isFullscreen file="./table-demos/StickyHeader.jsx"
1449
1430
 
1450
- return (
1451
- <DashboardWrapper hasPageTemplateTitle>
1452
- <PageSection padding={{ default: 'noPadding', xl: 'padding' }}>
1453
- <Card component="div">
1454
- <TableDeprecated
1455
- cells={[
1456
- { title: 'Servers', transforms: [cellWidth(15)] },
1457
- { title: 'Threads', transforms: [cellWidth(10)] },
1458
- { title: 'Applications', transforms: [cellWidth(10)] },
1459
- { title: 'Workspaces', transforms: [cellWidth(10)] },
1460
- { title: 'Status', transforms: [cellWidth(10)] },
1461
- { title: 'Location', transforms: [cellWidth(15)] },
1462
- { title: 'Last Modified', transforms: [cellWidth(15)] },
1463
- { title: 'URL', transforms: [cellWidth(10)] }
1464
- ]}
1465
- rows={rows.map((row) => [
1466
- row.name,
1467
- row.threads,
1468
- row.applications,
1469
- row.workspaces,
1470
- { title: renderLabel(row.status) },
1471
- row.location,
1472
- row.lastModified,
1473
- {
1474
- title: (
1475
- <a href="#">
1476
- <TableText wrapModifier="truncate">{row.url} </TableText>
1477
- </a>
1478
- )
1479
- }
1480
- ])}
1481
- aria-label="Sticky Header Table Demo"
1482
- isStickyHeader
1483
- >
1484
- <TableHeader />
1485
- <TableBody />
1486
- </TableDeprecated>
1487
- </Card>
1488
- </PageSection>
1489
- </DashboardWrapper>
1490
- );
1491
- }
1492
- }
1493
1431
  ```
1494
1432
 
1495
1433
  ### Sticky first column
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+
2
3
  import {
3
4
  Dropdown,
4
5
  DropdownList,
@@ -14,7 +15,8 @@ import {
14
15
  } from '@patternfly/react-core';
15
16
  import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
16
17
  import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
17
- import { rows, columns } from '../../examples/Data.jsx';
18
+
19
+ import { rows, columns } from './sampleData';
18
20
 
19
21
  export const BulkSelectTableDemo = () => {
20
22
  const [isBulkSelectDropdownOpen, setIsBulkSelectDropdownOpen] = React.useState(false);
@@ -1,4 +1,5 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
+
2
3
  import {
3
4
  Button,
4
5
  DataList,
@@ -26,10 +27,11 @@ import {
26
27
  import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
27
28
  import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
28
29
  import SortAmountDownIcon from '@patternfly/react-icons/dist/esm/icons/sort-amount-down-icon';
29
- import { rows, columns } from '../../examples/Data.jsx';
30
30
  import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper.js';
31
31
  import { capitalize } from '@patternfly/react-table/src/components/Table/utils/utils';
32
32
 
33
+ import { rows, columns } from './sampleData';
34
+
33
35
  export const ColumnManagementAction = () => {
34
36
  const defaultColumns = columns;
35
37
  const defaultRows = rows;
@@ -389,10 +391,14 @@ export const ColumnManagementAction = () => {
389
391
  <ToolbarItem variant="overflow-menu">
390
392
  <OverflowMenu breakpoint="md">
391
393
  <OverflowMenuItem>
392
- <MenuToggle><FilterIcon /> Name</MenuToggle>
394
+ <MenuToggle>
395
+ <FilterIcon /> Name
396
+ </MenuToggle>
393
397
  </OverflowMenuItem>
394
398
  <OverflowMenuItem>
395
- <MenuToggle variant="plain" aria-label="Sort columns"><SortAmountDownIcon aria-hidden="true" /></MenuToggle>
399
+ <MenuToggle variant="plain" aria-label="Sort columns">
400
+ <SortAmountDownIcon aria-hidden="true" />
401
+ </MenuToggle>
396
402
  </OverflowMenuItem>
397
403
  <OverflowMenuGroup groupType="button" isPersistent>
398
404
  <OverflowMenuItem>
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+
2
3
  import {
3
4
  Button,
4
5
  Card,
@@ -14,10 +15,10 @@ import {
14
15
  ToolbarItem
15
16
  } from '@patternfly/react-core';
16
17
  import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
17
-
18
18
  import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
19
19
  import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
20
- import { rows, columns } from '../../examples/Data.jsx';
20
+
21
+ import { rows, columns } from './sampleData';
21
22
 
22
23
  export const CompactTable = () => {
23
24
  const [isSelectOpen, setIsSelectOpen] = React.useState(false);
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+
2
3
  import {
3
4
  Button,
4
5
  Card,
@@ -21,7 +22,6 @@ import {
21
22
  ToolbarItem
22
23
  } from '@patternfly/react-core';
23
24
  import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
24
- import { rows, columns } from '../../examples/Data.jsx';
25
25
  import CloneIcon from '@patternfly/react-icons/dist/esm/icons/clone-icon';
26
26
  import EditIcon from '@patternfly/react-icons/dist/esm/icons/edit-icon';
27
27
  import SyncIcon from '@patternfly/react-icons/dist/esm/icons/sync-icon';
@@ -32,6 +32,8 @@ import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
32
32
  import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
33
33
  import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
34
34
 
35
+ import { rows, columns } from './sampleData';
36
+
35
37
  export const ComposableTableSortable = () => {
36
38
  const [isKebabDropdownOpen, setIsKebabDropdownOpen] = React.useState(false);
37
39
 
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+
2
3
  import {
3
4
  Button,
4
5
  Card,
@@ -15,11 +16,11 @@ import {
15
16
  SelectOption
16
17
  } from '@patternfly/react-core';
17
18
  import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
18
- import { rows, columns } from '../../examples/Data.jsx';
19
-
20
19
  import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
21
20
  import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
22
21
 
22
+ import { rows, columns } from './sampleData';
23
+
23
24
  export const StaticBottomPagination = () => {
24
25
  const [isSelectOpen, setIsSelectOpen] = React.useState(false);
25
26
  const [page, setPage] = React.useState(1);
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+
3
+ import { Card, Label, PageSection } from '@patternfly/react-core';
4
+ import { Table, Thead, Tr, Th, Tbody, Td, TableText } from '@patternfly/react-table';
5
+ import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
6
+
7
+ import { rows, columns } from '../examples/Data';
8
+
9
+ export const StickyHeader: React.FunctionComponent = () => {
10
+ const renderLabel = (labelText: string) => {
11
+ switch (labelText) {
12
+ case 'Running':
13
+ return <Label color="green">{labelText}</Label>;
14
+ case 'Stopped':
15
+ return <Label color="orange">{labelText}</Label>;
16
+ case 'Needs Maintenance':
17
+ return <Label color="blue">{labelText}</Label>;
18
+ case 'Down':
19
+ return <Label color="red">{labelText}</Label>;
20
+ }
21
+ };
22
+
23
+ return (
24
+ <DashboardWrapper hasPageTemplateTitle>
25
+ <PageSection padding={{ default: 'noPadding', xl: 'padding' }}>
26
+ <Card component="div">
27
+ <Table aria-label="Sticky Header Table Demo" isStickyHeader>
28
+ <Thead>
29
+ <Tr>
30
+ <Th width={15}>{columns[0]}</Th>
31
+ <Th width={10}>{columns[1]}</Th>
32
+ <Th width={10}>{columns[2]}</Th>
33
+ <Th width={10}>{columns[3]}</Th>
34
+ <Th width={10}>{columns[4]}</Th>
35
+ <Th width={15}>{columns[5]}</Th>
36
+ <Th width={15}>{columns[6]}</Th>
37
+ <Th width={10}>{columns[7]}</Th>
38
+ </Tr>
39
+ </Thead>
40
+ <Tbody>
41
+ {rows.map((row) => (
42
+ <Tr key={row.name}>
43
+ <Td dataLabel={columns[0]}>{row.name}</Td>
44
+ <Td dataLabel={columns[1]}>{row.threads}</Td>
45
+ <Td dataLabel={columns[2]}>{row.applications}</Td>
46
+ <Td dataLabel={columns[3]}>{row.workspaces}</Td>
47
+ <Td dataLabel={columns[4]}>{renderLabel(row.status)}</Td>
48
+ <Td dataLabel={columns[5]}>{row.location}</Td>
49
+ <Td dataLabel={columns[6]}>{row.lastModified}</Td>
50
+ <Td dataLabel={columns[7]}>
51
+ <a href="#">
52
+ <TableText wrapModifier="truncate">{row.url} </TableText>
53
+ </a>
54
+ </Td>
55
+ </Tr>
56
+ ))}
57
+ </Tbody>
58
+ </Table>
59
+ </Card>
60
+ </PageSection>
61
+ </DashboardWrapper>
62
+ );
63
+ };
@@ -1,6 +1,4 @@
1
- const getRandomInteger = (min, max) => (
2
- Math.floor(Math.random() * (max - min + 1)) + min
3
- );
1
+ const getRandomInteger = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
4
2
 
5
3
  export const columns = [
6
4
  'Servers',
@@ -14,7 +12,7 @@ export const columns = [
14
12
  ];
15
13
 
16
14
  export const rows = [
17
- {
15
+ {
18
16
  name: 'US-Node 1',
19
17
  threads: getRandomInteger(1, 20),
20
18
  applications: getRandomInteger(1, 50),
@@ -24,7 +22,7 @@ export const rows = [
24
22
  lastModified: '2 hours ago',
25
23
  url: 'http://www.redhat.com/en/office-locations/US-node1'
26
24
  },
27
- {
25
+ {
28
26
  name: 'US-Node 2',
29
27
  threads: getRandomInteger(1, 20),
30
28
  applications: getRandomInteger(1, 50),
@@ -34,7 +32,7 @@ export const rows = [
34
32
  lastModified: '5 hours ago',
35
33
  url: 'http://www.redhat.com/en/office-locations/US-node2'
36
34
  },
37
- {
35
+ {
38
36
  name: 'US-Node 3',
39
37
  threads: getRandomInteger(1, 20),
40
38
  applications: getRandomInteger(1, 50),
@@ -734,7 +732,7 @@ export const rows = [
734
732
  lastModified: '20 minutes ago',
735
733
  url: 'http://www.redhat.com/en/office-locations/Bangalore-node13'
736
734
  },
737
- {
735
+ {
738
736
  name: 'Bangalore-Node 14',
739
737
  threads: getRandomInteger(1, 20),
740
738
  applications: getRandomInteger(1, 50),
@@ -744,7 +742,7 @@ export const rows = [
744
742
  lastModified: '4 hours ago',
745
743
  url: 'http://www.redhat.com/en/office-locations/Bangalore-node14'
746
744
  },
747
- {
745
+ {
748
746
  name: 'Bangalore-Node 15',
749
747
  threads: getRandomInteger(1, 20),
750
748
  applications: getRandomInteger(1, 50),