@patternfly/react-table 4.112.39 → 5.0.0-alpha.10

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.
Files changed (96) hide show
  1. package/CHANGELOG.md +3439 -10266
  2. package/components/Table/ActionsColumn.d.ts +13 -27
  3. package/components/Table/ActionsColumn.d.ts.map +1 -1
  4. package/components/Table/ActionsColumn.js +43 -60
  5. package/components/Table/ActionsColumn.js.map +1 -1
  6. package/components/Table/TableTypes.d.ts +2 -1
  7. package/components/Table/TableTypes.d.ts.map +1 -1
  8. package/components/Table/base/provider.d.ts +6 -6
  9. package/components/Table/base/types.d.ts +7 -7
  10. package/components/Table/base/types.d.ts.map +1 -1
  11. package/components/Table/utils/decorators/cellActions.d.ts.map +1 -1
  12. package/components/Table/utils/decorators/cellActions.js +2 -2
  13. package/components/Table/utils/decorators/cellActions.js.map +1 -1
  14. package/components/TableComposable/TableComposable.d.ts +4 -6
  15. package/components/TableComposable/TableComposable.d.ts.map +1 -1
  16. package/components/TableComposable/TableComposable.js +2 -2
  17. package/components/TableComposable/TableComposable.js.map +1 -1
  18. package/components/TableComposable/Tbody.d.ts +2 -2
  19. package/components/TableComposable/Tbody.d.ts.map +1 -1
  20. package/components/TableComposable/Td.d.ts +1 -1
  21. package/components/TableComposable/Th.d.ts +1 -1
  22. package/components/TableComposable/Thead.d.ts +1 -1
  23. package/components/TableComposable/Thead.d.ts.map +1 -1
  24. package/components/TableComposable/Tr.d.ts +2 -2
  25. package/components/TableComposable/Tr.d.ts.map +1 -1
  26. package/dist/esm/components/Table/ActionsColumn.d.ts +13 -27
  27. package/dist/esm/components/Table/ActionsColumn.d.ts.map +1 -1
  28. package/dist/esm/components/Table/ActionsColumn.js +43 -60
  29. package/dist/esm/components/Table/ActionsColumn.js.map +1 -1
  30. package/dist/esm/components/Table/TableTypes.d.ts +2 -1
  31. package/dist/esm/components/Table/TableTypes.d.ts.map +1 -1
  32. package/dist/esm/components/Table/base/provider.d.ts +6 -6
  33. package/dist/esm/components/Table/base/types.d.ts +7 -7
  34. package/dist/esm/components/Table/base/types.d.ts.map +1 -1
  35. package/dist/esm/components/Table/utils/decorators/cellActions.d.ts.map +1 -1
  36. package/dist/esm/components/Table/utils/decorators/cellActions.js +2 -2
  37. package/dist/esm/components/Table/utils/decorators/cellActions.js.map +1 -1
  38. package/dist/esm/components/TableComposable/TableComposable.d.ts +4 -6
  39. package/dist/esm/components/TableComposable/TableComposable.d.ts.map +1 -1
  40. package/dist/esm/components/TableComposable/TableComposable.js +2 -2
  41. package/dist/esm/components/TableComposable/TableComposable.js.map +1 -1
  42. package/dist/esm/components/TableComposable/Tbody.d.ts +2 -2
  43. package/dist/esm/components/TableComposable/Tbody.d.ts.map +1 -1
  44. package/dist/esm/components/TableComposable/Td.d.ts +1 -1
  45. package/dist/esm/components/TableComposable/Th.d.ts +1 -1
  46. package/dist/esm/components/TableComposable/Thead.d.ts +1 -1
  47. package/dist/esm/components/TableComposable/Thead.d.ts.map +1 -1
  48. package/dist/esm/components/TableComposable/Tr.d.ts +2 -2
  49. package/dist/esm/components/TableComposable/Tr.d.ts.map +1 -1
  50. package/dist/js/components/Table/ActionsColumn.d.ts +13 -27
  51. package/dist/js/components/Table/ActionsColumn.d.ts.map +1 -1
  52. package/dist/js/components/Table/ActionsColumn.js +43 -61
  53. package/dist/js/components/Table/ActionsColumn.js.map +1 -1
  54. package/dist/js/components/Table/TableTypes.d.ts +2 -1
  55. package/dist/js/components/Table/TableTypes.d.ts.map +1 -1
  56. package/dist/js/components/Table/TableTypes.js +0 -1
  57. package/dist/js/components/Table/TableTypes.js.map +1 -1
  58. package/dist/js/components/Table/base/provider.d.ts +6 -6
  59. package/dist/js/components/Table/base/types.d.ts +7 -7
  60. package/dist/js/components/Table/base/types.d.ts.map +1 -1
  61. package/dist/js/components/Table/utils/decorators/cellActions.d.ts.map +1 -1
  62. package/dist/js/components/Table/utils/decorators/cellActions.js +2 -2
  63. package/dist/js/components/Table/utils/decorators/cellActions.js.map +1 -1
  64. package/dist/js/components/TableComposable/TableComposable.d.ts +4 -6
  65. package/dist/js/components/TableComposable/TableComposable.d.ts.map +1 -1
  66. package/dist/js/components/TableComposable/TableComposable.js +2 -2
  67. package/dist/js/components/TableComposable/TableComposable.js.map +1 -1
  68. package/dist/js/components/TableComposable/Tbody.d.ts +2 -2
  69. package/dist/js/components/TableComposable/Tbody.d.ts.map +1 -1
  70. package/dist/js/components/TableComposable/Td.d.ts +1 -1
  71. package/dist/js/components/TableComposable/Th.d.ts +1 -1
  72. package/dist/js/components/TableComposable/Thead.d.ts +1 -1
  73. package/dist/js/components/TableComposable/Thead.d.ts.map +1 -1
  74. package/dist/js/components/TableComposable/Tr.d.ts +2 -2
  75. package/dist/js/components/TableComposable/Tr.d.ts.map +1 -1
  76. package/dist/umd/react-table.min.js +6 -6
  77. package/package.json +7 -7
  78. package/src/components/Table/ActionsColumn.tsx +92 -103
  79. package/src/components/Table/TableTypes.tsx +2 -1
  80. package/src/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +419 -400
  81. package/src/components/Table/base/types.tsx +1 -1
  82. package/src/components/Table/examples/LegacyTableActions.tsx +4 -4
  83. package/src/components/Table/utils/decorators/cellActions.tsx +2 -4
  84. package/src/components/TableComposable/TableComposable.tsx +4 -7
  85. package/src/components/TableComposable/Tbody.tsx +1 -1
  86. package/src/components/TableComposable/Thead.tsx +1 -1
  87. package/src/components/TableComposable/Tr.tsx +1 -1
  88. package/src/components/TableComposable/examples/ComposableTableActions.tsx +4 -4
  89. package/src/components/TableComposable/examples/ComposableTableHoverable.tsx +1 -1
  90. package/src/docs/demos/Table.md +7 -7
  91. package/src/docs/demos/table-demos/ColumnManagement.jsx +2 -4
  92. package/src/docs/demos/table-demos/Compact.jsx +1 -1
  93. package/src/docs/demos/table-demos/CompoundExpansion.jsx +1 -1
  94. package/src/docs/demos/table-demos/SortableResponsive.jsx +47 -49
  95. package/src/docs/demos/table-demos/StaticBottomPagination.jsx +33 -18
  96. package/src/docs/examples/ComposableTableStickyToolbar.tsx +1 -1
@@ -191,7 +191,7 @@ export interface ThExpandType {
191
191
  /** Whether all are expanded */
192
192
  areAllExpanded: boolean;
193
193
  /** Alternative aria label */
194
- collapseAllAriaLabel: '';
194
+ collapseAllAriaLabel: string;
195
195
  }
196
196
 
197
197
  // Rows Types
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import {
4
4
  Button,
5
5
  Checkbox,
6
- DropdownToggle,
6
+ MenuToggle,
7
7
  ToggleGroup,
8
8
  ToggleGroupItem,
9
9
  ToggleGroupItemProps,
@@ -62,9 +62,9 @@ export const LegacyTableActions: React.FunctionComponent = () => {
62
62
  const [useCustomToggle, setUseCustomToggle] = React.useState(false);
63
63
 
64
64
  const customActionsToggle = (props: CustomActionsToggleProps) => (
65
- <DropdownToggle onToggle={props.onToggle} isDisabled={props.isDisabled}>
65
+ <MenuToggle ref={props.toggleRef} onClick={props.onToggle} isDisabled={props.isDisabled}>
66
66
  Actions
67
- </DropdownToggle>
67
+ </MenuToggle>
68
68
  );
69
69
 
70
70
  const columns: TableProps['cells'] = [
@@ -77,7 +77,7 @@ export const LegacyTableActions: React.FunctionComponent = () => {
77
77
  ];
78
78
 
79
79
  const rows: TableProps['rows'] = repositories.map(repo => {
80
- let singleActionButton = null;
80
+ let singleActionButton: React.ReactNode = null;
81
81
  if (repo.singleAction !== '') {
82
82
  singleActionButton = (
83
83
  <TableText>
@@ -33,7 +33,7 @@ export const cellActions = (
33
33
  rowIndex,
34
34
  columnIndex,
35
35
  column: {
36
- extraParams: { dropdownPosition, dropdownDirection, actionsToggle, menuAppendTo }
36
+ extraParams: { actionsToggle, actionsPopperProps }
37
37
  },
38
38
  property
39
39
  }: IExtra
@@ -58,13 +58,11 @@ export const cellActions = (
58
58
  children: (
59
59
  <ActionsColumn
60
60
  items={resolvedActions}
61
- dropdownPosition={dropdownPosition}
62
- dropdownDirection={dropdownDirection}
63
- menuAppendTo={menuAppendTo}
64
61
  isDisabled={resolvedIsDisabled}
65
62
  rowData={rowData}
66
63
  extraData={extraData}
67
64
  actionsToggle={actionsToggle}
65
+ popperProps={actionsPopperProps}
68
66
  >
69
67
  {label as React.ReactNode}
70
68
  </ActionsColumn>
@@ -23,7 +23,7 @@ export interface BaseCellProps {
23
23
  width?: 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 60 | 70 | 80 | 90 | 100;
24
24
  /** Visibility breakpoint modifiers */
25
25
  visibility?: (keyof IVisibility)[];
26
- /** Forwarded ref */
26
+ /** @hide Forwarded ref */
27
27
  innerRef?: React.Ref<any>;
28
28
  }
29
29
 
@@ -47,7 +47,7 @@ export interface TableComposableProps extends React.HTMLProps<HTMLTableElement>,
47
47
  role?: string;
48
48
  /** If set to true, the table header sticks to the top of its container */
49
49
  isStickyHeader?: boolean;
50
- /** Forwarded ref */
50
+ /** @hide Forwarded ref */
51
51
  innerRef?: React.RefObject<any>;
52
52
  /** Flag indicating table is a tree table */
53
53
  isTreeTable?: boolean;
@@ -59,9 +59,7 @@ export interface TableComposableProps extends React.HTMLProps<HTMLTableElement>,
59
59
  isExpandable?: boolean;
60
60
  /** Collection of column spans for nested headers. Deprecated: see https://github.com/patternfly/patternfly/issues/4584 */
61
61
  nestedHeaderColumnSpans?: number[];
62
- /** Flag to apply a caption element with visually hidden instructions that improves a11y for tables with selectable rows. If this prop is set to true other caption elements should not be passed as children of this table, and you should instead use the selectableRowCaptionText prop. */
63
- hasSelectableRowCaption?: boolean;
64
- /** Visible text to add alongside the hidden a11y caption for tables with selectable rows. This prop must be used to add custom caption content to the table when the hasSelectableRowCaption prop is set to true. */
62
+ /** Visible text to add alongside the hidden a11y caption for tables with selectable rows. */
65
63
  selectableRowCaptionText?: string;
66
64
  /** Value to overwrite the randomly generated data-ouia-component-id.*/
67
65
  ouiaId?: number | string;
@@ -95,7 +93,6 @@ const TableComposableBase: React.FunctionComponent<TableComposableProps> = ({
95
93
  isExpandable = false,
96
94
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
97
95
  nestedHeaderColumnSpans,
98
- hasSelectableRowCaption,
99
96
  selectableRowCaptionText,
100
97
  ...props
101
98
  }: TableComposableProps) => {
@@ -216,7 +213,7 @@ const TableComposableBase: React.FunctionComponent<TableComposableProps> = ({
216
213
  {...ouiaProps}
217
214
  {...props}
218
215
  >
219
- {hasSelectableRowCaption && hasSelectableRows && tableCaption}
216
+ {hasSelectableRows && tableCaption}
220
217
  {children}
221
218
  </table>
222
219
  </TableComposableContext.Provider>
@@ -9,7 +9,7 @@ export interface TbodyProps extends React.HTMLProps<HTMLTableSectionElement> {
9
9
  className?: string;
10
10
  /** Modifies the body to allow for expandable rows */
11
11
  isExpanded?: boolean;
12
- /** Forwarded ref */
12
+ /** @hide Forwarded ref */
13
13
  innerRef?: React.Ref<any>;
14
14
  /** Flag indicating the <tbody> contains oddly striped rows. */
15
15
  isOddStriped?: boolean;
@@ -9,7 +9,7 @@ export interface TheadProps extends React.HTMLProps<HTMLTableSectionElement> {
9
9
  className?: string;
10
10
  /** Won't wrap the table head if true */
11
11
  noWrap?: boolean;
12
- /** Forwarded ref */
12
+ /** @hide Forwarded ref */
13
13
  innerRef?: React.Ref<any>;
14
14
  /** Indicates the <thead> contains a nested header */
15
15
  hasNestedHeader?: boolean;
@@ -10,7 +10,7 @@ export interface TrProps extends React.HTMLProps<HTMLTableRowElement>, OUIAProps
10
10
  children?: React.ReactNode;
11
11
  /** Additional classes added to the <tr> row */
12
12
  className?: string;
13
- /** Forwarded ref */
13
+ /** @hide Forwarded ref */
14
14
  innerRef?: React.Ref<any>;
15
15
  /** Flag indicating the Tr is hidden */
16
16
  isHidden?: boolean;
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-console */
2
2
  import React from 'react';
3
- import { Button, DropdownToggle, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps } from '@patternfly/react-core';
3
+ import { Button, MenuToggle, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps } from '@patternfly/react-core';
4
4
  import {
5
5
  TableComposable,
6
6
  TableText,
@@ -52,9 +52,9 @@ export const ComposableTableActions: React.FunctionComponent = () => {
52
52
  };
53
53
 
54
54
  const customActionsToggle = (props: CustomActionsToggleProps) => (
55
- <DropdownToggle onToggle={props.onToggle} isDisabled={props.isDisabled}>
55
+ <MenuToggle ref={props.toggleRef} onClick={props.onToggle} isDisabled={props.isDisabled}>
56
56
  Actions
57
- </DropdownToggle>
57
+ </MenuToggle>
58
58
  );
59
59
 
60
60
  const defaultActions = (repo: Repository): IAction[] => [
@@ -130,7 +130,7 @@ export const ComposableTableActions: React.FunctionComponent = () => {
130
130
  if (repo.name === '5') {
131
131
  rowActions = lastRowActions(repo);
132
132
  }
133
- let singleActionButton = null;
133
+ let singleActionButton: React.ReactNode = null;
134
134
  if (repo.singleAction !== '') {
135
135
  singleActionButton = (
136
136
  <TableText>
@@ -30,7 +30,7 @@ export const ComposableTableHoverable: React.FunctionComponent = () => {
30
30
  const [selectedRepoName, setSelectedRepoName] = React.useState('');
31
31
 
32
32
  return (
33
- <TableComposable aria-label="Hoverable table" hasSelectableRowCaption>
33
+ <TableComposable aria-label="Hoverable table">
34
34
  <Thead>
35
35
  <Tr>
36
36
  <Th>{columnNames.name}</Th>
@@ -192,7 +192,7 @@ class BulkSelectTableDemo extends React.Component {
192
192
  }}
193
193
  variant={variant}
194
194
  titles={{
195
- paginationTitle: `${variant} pagination`
195
+ paginationAriaLabel: `${variant} pagination`
196
196
  }}
197
197
  />
198
198
  );
@@ -1036,7 +1036,7 @@ class ColumnManagementAction extends React.Component {
1036
1036
  variant={PaginationVariant.top}
1037
1037
  isCompact
1038
1038
  titles={{
1039
- paginationTitle: `Draggable column management top pagination`
1039
+ paginationAriaLabel: `Draggable column management top pagination`
1040
1040
  }}
1041
1041
  />
1042
1042
  </ToolbarItem>
@@ -1072,7 +1072,7 @@ class ColumnManagementAction extends React.Component {
1072
1072
  page={1}
1073
1073
  variant={PaginationVariant.bottom}
1074
1074
  titles={{
1075
- paginationTitle: `Draggable column management bottom pagination`
1075
+ paginationAriaLabel: `Draggable column management bottom pagination`
1076
1076
  }}
1077
1077
  />
1078
1078
  {this.renderModal()}
@@ -1464,14 +1464,14 @@ class FilterTableDemo extends React.Component {
1464
1464
 
1465
1465
  ### Automatic pagination
1466
1466
 
1467
- The below example illustrates the `defaultToFullPage` prop, which makes the following changes when the user sets the number of items to display per page to an amount that exceeds the remaining amount of data:
1467
+ The below example illustrates the `isLastFullPageShown` prop, which makes the following changes when the user sets the number of items to display per page to an amount that exceeds the remaining amount of data:
1468
1468
 
1469
1469
  - The component automatically changes the page back to the last full page of results, rather than defaulting to the final page of results.
1470
1470
 
1471
1471
  To demonstrate this, navigate to the last page of data below using the `>>` navigation arrows, then use the dropdown selector to change the view to 5 per page.
1472
1472
 
1473
1473
  - The default behavior would show the last page of results, which would only contain the last two rows (rows 11 - 12).
1474
- - The `defaultToFullPage` prop navigates you back to the previous page which does contain a full page of 5 rows (rows 6 - 10).
1474
+ - The `isLastFullPageShown` prop navigates you back to the previous page which does contain a full page of 5 rows (rows 6 - 10).
1475
1475
 
1476
1476
  ```js
1477
1477
  import React from 'react';
@@ -1529,7 +1529,7 @@ class ComplexPaginationTableDemo extends React.Component {
1529
1529
  itemCount={this.defaultRows.length}
1530
1530
  page={page}
1531
1531
  perPage={perPage}
1532
- defaultToFullPage
1532
+ isLastFullPageShown
1533
1533
  onSetPage={this.handleSetPage}
1534
1534
  onPerPageSelect={this.handlePerPageSelect}
1535
1535
  perPageOptions={[
@@ -1539,7 +1539,7 @@ class ComplexPaginationTableDemo extends React.Component {
1539
1539
  { title: '20', value: 20 }
1540
1540
  ]}
1541
1541
  titles={{
1542
- paginationTitle: `${variant} pagination`
1542
+ paginationAriaLabel: `${variant} pagination`
1543
1543
  }}
1544
1544
  />
1545
1545
  );
@@ -105,7 +105,7 @@ export const ColumnManagementAction = () => {
105
105
  onPerPageSelect={handlePerPageSelect}
106
106
  variant={variant}
107
107
  titles={{
108
- paginationTitle: `${variant} pagination`
108
+ paginationAriaLabel: `${variant} pagination`
109
109
  }}
110
110
  />
111
111
  );
@@ -463,9 +463,7 @@ export const ColumnManagementAction = () => {
463
463
  ) : (
464
464
  <Td
465
465
  width={key === 'name' ? 15 : 10}
466
- dataLabel={
467
- key === 'lastModified' ? 'Last modified' : capitalize(key)
468
- }
466
+ dataLabel={key === 'lastModified' ? 'Last modified' : capitalize(key)}
469
467
  >
470
468
  {value}
471
469
  </Td>
@@ -43,7 +43,7 @@ export const CompactTable = () => {
43
43
  onPerPageSelect={handlePerPageSelect}
44
44
  variant={variant}
45
45
  titles={{
46
- paginationTitle: `${variant} pagination`
46
+ paginationAriaLabel: `${variant} pagination`
47
47
  }}
48
48
  />
49
49
  );
@@ -84,7 +84,7 @@ export const CompoundExpandable = () => {
84
84
  perPage={10}
85
85
  variant={variant}
86
86
  titles={{
87
- paginationTitle: `${variant} pagination`
87
+ paginationAriaLabel: `${variant} pagination`
88
88
  }}
89
89
  />
90
90
  );
@@ -44,7 +44,7 @@ export const ComposableTableSortable = () => {
44
44
  return [...r].sort((a, b) => {
45
45
  let returnValue = 0;
46
46
  if (sortIndex === 0 || sortIndex === 7) {
47
- returnValue = 1
47
+ returnValue = 1;
48
48
  } else if (typeof Object.values(a)[sortIndex] === 'number') {
49
49
  // numeric sort
50
50
  returnValue = Object.values(a)[sortIndex] - Object.values(b)[sortIndex];
@@ -56,15 +56,11 @@ export const ComposableTableSortable = () => {
56
56
  return returnValue * -1;
57
57
  }
58
58
  return returnValue;
59
- })
59
+ });
60
60
  };
61
61
 
62
- const [sortedData, setSortedData] = React.useState([
63
- ...sortRows(rows, 0, 'asc')
64
- ]);
65
- const [sortedRows, setSortedRows] = React.useState([
66
- ...sortedData
67
- ]);
62
+ const [sortedData, setSortedData] = React.useState([...sortRows(rows, 0, 'asc')]);
63
+ const [sortedRows, setSortedRows] = React.useState([...sortedData]);
68
64
  const [page, setPage] = React.useState(1);
69
65
  const [perPage, setPerPage] = React.useState(10);
70
66
 
@@ -85,50 +81,50 @@ const [sortedRows, setSortedRows] = React.useState([
85
81
  const kebabDropdownItems = [<OverflowMenuDropdownItem key="kebab-1">Some action</OverflowMenuDropdownItem>];
86
82
 
87
83
  React.useEffect(() => {
88
- setSortedRows(sortedData.slice((page - 1) * perPage, page * perPage -1));
84
+ setSortedRows(sortedData.slice((page - 1) * perPage, page * perPage - 1));
89
85
  }, [sortedData, page, perPage]);
90
86
 
91
87
  const handleSetPage = (_evt, newPage) => {
92
88
  setPage(newPage);
93
- }
89
+ };
94
90
 
95
91
  const handlePerPageSelect = (_evt, newPerPage) => {
96
92
  setPerPage(newPerPage);
97
- }
93
+ };
98
94
 
99
- renderPagination = (variant) => (
100
- <Pagination
101
- isCompact
102
- itemCount={rows.length}
103
- page={page}
104
- perPage={perPage}
105
- onSetPage={handleSetPage}
106
- onPerPageSelect={handlePerPageSelect}
107
- perPageOptions={[
108
- { title: '10', value: 10 },
109
- { title: '20', value: 20 },
110
- { title: '50', value: 50 },
111
- { title: '100', value: 100 }
112
- ]}
113
- variant={variant}
114
- titles={{
115
- paginationTitle: `${variant} pagination`
116
- }}
117
- />
118
- );
95
+ renderPagination = variant => (
96
+ <Pagination
97
+ isCompact
98
+ itemCount={rows.length}
99
+ page={page}
100
+ perPage={perPage}
101
+ onSetPage={handleSetPage}
102
+ onPerPageSelect={handlePerPageSelect}
103
+ perPageOptions={[
104
+ { title: '10', value: 10 },
105
+ { title: '20', value: 20 },
106
+ { title: '50', value: 50 },
107
+ { title: '100', value: 100 }
108
+ ]}
109
+ variant={variant}
110
+ titles={{
111
+ paginationAriaLabel: `${variant} pagination`
112
+ }}
113
+ />
114
+ );
119
115
 
120
- const renderLabel = labelText => {
121
- switch (labelText) {
122
- case 'Running':
123
- return <Label color="green">{labelText}</Label>;
124
- case 'Stopped':
125
- return <Label color="orange">{labelText}</Label>;
126
- case 'Needs Maintenance':
127
- return <Label color="blue">{labelText}</Label>;
128
- case 'Down':
129
- return <Label color="red">{labelText}</Label>;
130
- }
131
- };
116
+ const renderLabel = labelText => {
117
+ switch (labelText) {
118
+ case 'Running':
119
+ return <Label color="green">{labelText}</Label>;
120
+ case 'Stopped':
121
+ return <Label color="orange">{labelText}</Label>;
122
+ case 'Needs Maintenance':
123
+ return <Label color="blue">{labelText}</Label>;
124
+ case 'Down':
125
+ return <Label color="red">{labelText}</Label>;
126
+ }
127
+ };
132
128
 
133
129
  const tableToolbar = (
134
130
  <Toolbar id="sortable-toolbar">
@@ -258,7 +254,7 @@ const [sortedRows, setSortedRows] = React.useState([
258
254
  }
259
255
  };
260
256
  return (
261
- <Th modifier={columnIndex !== 6 ? "wrap" : undefined} key={columnIndex} {...sortParams}>
257
+ <Th modifier={columnIndex !== 6 ? 'wrap' : undefined} key={columnIndex} {...sortParams}>
262
258
  {column}
263
259
  </Th>
264
260
  );
@@ -269,7 +265,7 @@ const [sortedRows, setSortedRows] = React.useState([
269
265
  {sortedRows.map((row, rowIndex) => (
270
266
  <Tr key={rowIndex}>
271
267
  <>
272
- <Td dataLabel={columns[0]} width={15} >
268
+ <Td dataLabel={columns[0]} width={15}>
273
269
  <div>{row.name}</div>
274
270
  </Td>
275
271
  <Td dataLabel={columns[1]} width={10}>
@@ -296,22 +292,24 @@ const [sortedRows, setSortedRows] = React.useState([
296
292
  <FlexItem>{row.workspaces}</FlexItem>
297
293
  </Flex>
298
294
  </Td>
299
- <Td dataLabel={columns[4]} width={15}>
295
+ <Td dataLabel={columns[4]} width={15}>
300
296
  <Flex spaceItems={{ default: 'spaceItemsSm' }}>
301
297
  <FlexItem>{renderLabel(row.status)}</FlexItem>
302
298
  </Flex>
303
299
  </Td>
304
- <Td dataLabel={columns[5]} width={10}>
300
+ <Td dataLabel={columns[5]} width={10}>
305
301
  <Flex spaceItems={{ default: 'spaceItemsSm' }}>
306
302
  <FlexItem>{row.location}</FlexItem>
307
303
  </Flex>
308
304
  </Td>
309
- <Td dataLabel={columns[6]} width={10}>
305
+ <Td dataLabel={columns[6]} width={10}>
310
306
  <Flex spaceItems={{ default: 'spaceItemsSm' }}>
311
307
  <FlexItem>{row.lastModified[0]} days ago</FlexItem>
312
308
  </Flex>
313
309
  </Td>
314
- <Td dataLabel={columns[7]} modifier="truncate"><a href="#">{row.url}</a></Td>
310
+ <Td dataLabel={columns[7]} modifier="truncate">
311
+ <a href="#">{row.url}</a>
312
+ </Td>
315
313
  </>
316
314
  </Tr>
317
315
  ))}
@@ -34,7 +34,6 @@ export const StaticBottomPagination = () => {
34
34
  setPerPage(newPerPage);
35
35
  };
36
36
 
37
-
38
37
  const renderPagination = (variant, isCompact) => (
39
38
  <Pagination
40
39
  isCompact={isCompact}
@@ -45,7 +44,7 @@ export const StaticBottomPagination = () => {
45
44
  onPerPageSelect={handlePerPageSelect}
46
45
  variant={variant}
47
46
  titles={{
48
- paginationTitle: `${variant} pagination`
47
+ paginationAriaLabel: `${variant} pagination`
49
48
  }}
50
49
  isStatic
51
50
  />
@@ -54,13 +53,29 @@ export const StaticBottomPagination = () => {
54
53
  const renderLabel = labelText => {
55
54
  switch (labelText) {
56
55
  case 'Running':
57
- return <span><Label color="green">{labelText}</Label></span>;
56
+ return (
57
+ <span>
58
+ <Label color="green">{labelText}</Label>
59
+ </span>
60
+ );
58
61
  case 'Stopped':
59
- return <span><Label color="orange">{labelText}</Label></span>;
62
+ return (
63
+ <span>
64
+ <Label color="orange">{labelText}</Label>
65
+ </span>
66
+ );
60
67
  case 'Needs Maintenance':
61
- return <span><Label color="blue">{labelText}</Label></span>;
68
+ return (
69
+ <span>
70
+ <Label color="blue">{labelText}</Label>
71
+ </span>
72
+ );
62
73
  case 'Down':
63
- return <span><Label color="red">{labelText}</Label></span>;
74
+ return (
75
+ <span>
76
+ <Label color="red">{labelText}</Label>
77
+ </span>
78
+ );
64
79
  }
65
80
  };
66
81
 
@@ -116,18 +131,18 @@ export const StaticBottomPagination = () => {
116
131
  <Tbody>
117
132
  {paginatedRows.map((row, rowIndex) => (
118
133
  <Tr key={rowIndex}>
119
- <Td dataLabel={columns[0]}>{row.name}</Td>
120
- <Td dataLabel={columns[1]}>{row.threads}</Td>
121
- <Td dataLabel={columns[2]}>{row.applications}</Td>
122
- <Td dataLabel={columns[3]}>{row.workspaces}</Td>
123
- <Td dataLabel={columns[4]}>{renderLabel(row.status)}</Td>
124
- <Td dataLabel={columns[5]}>{row.location}</Td>
125
- <Td dataLabel={columns[6]}>{row.lastModified}</Td>
126
- <Td dataLabel={columns[7]} modifier="truncate">
127
- <TableText>
128
- <a href="#">{row.url}</a>
129
- </TableText>
130
- </Td>
134
+ <Td dataLabel={columns[0]}>{row.name}</Td>
135
+ <Td dataLabel={columns[1]}>{row.threads}</Td>
136
+ <Td dataLabel={columns[2]}>{row.applications}</Td>
137
+ <Td dataLabel={columns[3]}>{row.workspaces}</Td>
138
+ <Td dataLabel={columns[4]}>{renderLabel(row.status)}</Td>
139
+ <Td dataLabel={columns[5]}>{row.location}</Td>
140
+ <Td dataLabel={columns[6]}>{row.lastModified}</Td>
141
+ <Td dataLabel={columns[7]} modifier="truncate">
142
+ <TableText>
143
+ <a href="#">{row.url}</a>
144
+ </TableText>
145
+ </Td>
131
146
  </Tr>
132
147
  ))}
133
148
  </Tbody>
@@ -168,7 +168,7 @@ export const ComposableTableStickyColumnsAndHeader: React.FunctionComponent = ()
168
168
  </PageSection>
169
169
  }
170
170
  groupProps={{
171
- sticky: 'top'
171
+ stickyOnBreakpoint: { default: 'top' }
172
172
  }}
173
173
  >
174
174
  <PageSection hasOverflowScroll>