@patternfly/react-table 5.2.0-prerelease.3 → 5.2.0-prerelease.30

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 (105) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/components/package.json +1 -1
  3. package/deprecated/package.json +1 -1
  4. package/dist/dynamic/components/Table/package.json +1 -1
  5. package/dist/dynamic/components/Table/utils/decorators/package.json +1 -1
  6. package/dist/dynamic/components/Table/utils/package.json +1 -1
  7. package/dist/dynamic/deprecated/components/Table/base/package.json +1 -1
  8. package/dist/dynamic/deprecated/components/Table/package.json +1 -1
  9. package/dist/dynamic/deprecated/components/package.json +1 -1
  10. package/dist/esm/components/Table/Caption.js +1 -1
  11. package/dist/esm/components/Table/Caption.js.map +1 -1
  12. package/dist/esm/components/Table/CollapseColumn.js +1 -1
  13. package/dist/esm/components/Table/CollapseColumn.js.map +1 -1
  14. package/dist/esm/components/Table/DraggableRowWrapper.js +2 -2
  15. package/dist/esm/components/Table/DraggableRowWrapper.js.map +1 -1
  16. package/dist/esm/components/Table/EditColumn.js +1 -1
  17. package/dist/esm/components/Table/EditColumn.js.map +1 -1
  18. package/dist/esm/components/Table/EditableSelectInputCell.js +2 -2
  19. package/dist/esm/components/Table/EditableSelectInputCell.js.map +1 -1
  20. package/dist/esm/components/Table/EditableTextCell.js +2 -2
  21. package/dist/esm/components/Table/EditableTextCell.js.map +1 -1
  22. package/dist/esm/components/Table/ExpandableRowContent.js +1 -1
  23. package/dist/esm/components/Table/ExpandableRowContent.js.map +1 -1
  24. package/dist/esm/components/Table/HeaderCellInfoWrapper.js +1 -1
  25. package/dist/esm/components/Table/HeaderCellInfoWrapper.js.map +1 -1
  26. package/dist/esm/components/Table/InnerScrollContainer.js +1 -1
  27. package/dist/esm/components/Table/InnerScrollContainer.js.map +1 -1
  28. package/dist/esm/components/Table/OuterScrollContainer.js +1 -1
  29. package/dist/esm/components/Table/OuterScrollContainer.js.map +1 -1
  30. package/dist/esm/components/Table/SortColumn.js +1 -1
  31. package/dist/esm/components/Table/SortColumn.js.map +1 -1
  32. package/dist/esm/components/Table/Table.js +5 -5
  33. package/dist/esm/components/Table/Table.js.map +1 -1
  34. package/dist/esm/components/Table/TableText.js +1 -1
  35. package/dist/esm/components/Table/TableText.js.map +1 -1
  36. package/dist/esm/components/Table/Tbody.js +1 -1
  37. package/dist/esm/components/Table/Tbody.js.map +1 -1
  38. package/dist/esm/components/Table/Td.d.ts.map +1 -1
  39. package/dist/esm/components/Table/Td.js +9 -5
  40. package/dist/esm/components/Table/Td.js.map +1 -1
  41. package/dist/esm/components/Table/Th.d.ts.map +1 -1
  42. package/dist/esm/components/Table/Th.js +6 -3
  43. package/dist/esm/components/Table/Th.js.map +1 -1
  44. package/dist/esm/components/Table/Thead.js +1 -1
  45. package/dist/esm/components/Table/Thead.js.map +1 -1
  46. package/dist/esm/components/Table/Tr.js +2 -2
  47. package/dist/esm/components/Table/Tr.js.map +1 -1
  48. package/dist/esm/components/Table/TreeRowWrapper.js +2 -2
  49. package/dist/esm/components/Table/TreeRowWrapper.js.map +1 -1
  50. package/dist/esm/components/Table/utils/decorators/cellActions.js +1 -1
  51. package/dist/esm/components/Table/utils/decorators/cellActions.js.map +1 -1
  52. package/dist/esm/components/Table/utils/decorators/cellWidth.js +1 -1
  53. package/dist/esm/components/Table/utils/decorators/cellWidth.js.map +1 -1
  54. package/dist/esm/components/Table/utils/decorators/classNames.js +1 -1
  55. package/dist/esm/components/Table/utils/decorators/classNames.js.map +1 -1
  56. package/dist/esm/components/Table/utils/decorators/collapsible.js +1 -1
  57. package/dist/esm/components/Table/utils/decorators/collapsible.js.map +1 -1
  58. package/dist/esm/components/Table/utils/decorators/compoundExpand.js +1 -1
  59. package/dist/esm/components/Table/utils/decorators/compoundExpand.js.map +1 -1
  60. package/dist/esm/components/Table/utils/decorators/editable.js +1 -1
  61. package/dist/esm/components/Table/utils/decorators/editable.js.map +1 -1
  62. package/dist/esm/components/Table/utils/decorators/favoritable.js +1 -1
  63. package/dist/esm/components/Table/utils/decorators/favoritable.js.map +1 -1
  64. package/dist/esm/components/Table/utils/decorators/info.js +1 -1
  65. package/dist/esm/components/Table/utils/decorators/info.js.map +1 -1
  66. package/dist/esm/components/Table/utils/decorators/selectable.js +2 -2
  67. package/dist/esm/components/Table/utils/decorators/selectable.js.map +1 -1
  68. package/dist/esm/components/Table/utils/decorators/sortable.js +1 -1
  69. package/dist/esm/components/Table/utils/decorators/sortable.js.map +1 -1
  70. package/dist/esm/components/Table/utils/decorators/treeRow.d.ts +1 -1
  71. package/dist/esm/components/Table/utils/decorators/treeRow.js +5 -5
  72. package/dist/esm/components/Table/utils/decorators/treeRow.js.map +1 -1
  73. package/dist/esm/components/Table/utils/decorators/wrappable.js +1 -1
  74. package/dist/esm/components/Table/utils/decorators/wrappable.js.map +1 -1
  75. package/dist/esm/deprecated/components/Table/Table.js +1 -1
  76. package/dist/esm/deprecated/components/Table/Table.js.map +1 -1
  77. package/dist/js/components/Table/Table.js +2 -2
  78. package/dist/js/components/Table/Table.js.map +1 -1
  79. package/dist/js/components/Table/Td.d.ts.map +1 -1
  80. package/dist/js/components/Table/Td.js +7 -3
  81. package/dist/js/components/Table/Td.js.map +1 -1
  82. package/dist/js/components/Table/Th.d.ts.map +1 -1
  83. package/dist/js/components/Table/Th.js +4 -1
  84. package/dist/js/components/Table/Th.js.map +1 -1
  85. package/dist/js/components/Table/utils/decorators/treeRow.d.ts +1 -1
  86. package/dist/js/components/Table/utils/decorators/treeRow.js +3 -3
  87. package/dist/js/components/Table/utils/decorators/treeRow.js.map +1 -1
  88. package/dist/umd/react-table.min.js +9 -9
  89. package/package.json +6 -6
  90. package/src/components/Table/Table.tsx +2 -2
  91. package/src/components/Table/Td.tsx +10 -5
  92. package/src/components/Table/Th.tsx +6 -3
  93. package/src/components/Table/examples/Table.md +3 -0
  94. package/src/components/Table/examples/TableCompoundExpandable.tsx +2 -1
  95. package/src/components/Table/examples/TableMisc.tsx +3 -1
  96. package/src/components/Table/examples/TableNestedHeaders.tsx +4 -3
  97. package/src/components/Table/examples/TableNestedStickyHeader.tsx +4 -3
  98. package/src/components/Table/utils/decorators/treeRow.tsx +3 -3
  99. package/src/components/Table/utils/transformers.test.tsx +14 -8
  100. package/src/deprecated/components/Table/__tests__/Table.test.tsx +4 -9
  101. package/src/deprecated/components/Table/examples/LegacyTableCompoundExpandable.tsx +4 -3
  102. package/src/deprecated/components/Table/examples/LegacyTableMisc.tsx +3 -1
  103. package/src/deprecated/components/Table/examples/LegacyTableSelectable.tsx +2 -1
  104. package/src/deprecated/components/Table/examples/Table.md +2 -0
  105. package/src/docs/demos/table-demos/CompoundExpansion.jsx +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-table",
3
- "version": "5.2.0-prerelease.3",
3
+ "version": "5.2.0-prerelease.30",
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",
@@ -39,10 +39,10 @@
39
39
  "subpaths": "node ../../scripts/exportSubpaths.js --config subpaths.config.json"
40
40
  },
41
41
  "dependencies": {
42
- "@patternfly/react-core": "^5.2.0-prerelease.3",
43
- "@patternfly/react-icons": "^5.2.0-prerelease.2",
44
- "@patternfly/react-styles": "^5.2.0-prerelease.1",
45
- "@patternfly/react-tokens": "^5.2.0-prerelease.2",
42
+ "@patternfly/react-core": "^5.2.0-prerelease.30",
43
+ "@patternfly/react-icons": "^5.2.0-prerelease.8",
44
+ "@patternfly/react-styles": "^5.2.0-prerelease.5",
45
+ "@patternfly/react-tokens": "^5.2.0-prerelease.6",
46
46
  "lodash": "^4.17.19",
47
47
  "tslib": "^2.5.0"
48
48
  },
@@ -54,5 +54,5 @@
54
54
  "react": "^17 || ^18",
55
55
  "react-dom": "^17 || ^18"
56
56
  },
57
- "gitHead": "ba97574ae6a7bad254fcb92569871e3de5803683"
57
+ "gitHead": "e112034cf060e8917e5ba47079af4850a4f12d1a"
58
58
  }
@@ -159,8 +159,8 @@ const TableBase: React.FunctionComponent<TableProps> = ({
159
159
  const handleKeys = (event: KeyboardEvent) => {
160
160
  if (
161
161
  isNested ||
162
- !(tableRef && tableRef.current && tableRef.current.classList.contains('pf-m-tree-view')) || // implements roving tab-index to tree tables only
163
- (tableRef && tableRef.current !== (event.target as HTMLElement).closest('.pf-v5-c-table:not(.pf-m-nested)'))
162
+ !(tableRef && tableRef.current && tableRef.current.classList.contains(stylesTreeView.modifiers.treeView)) || // implements roving tab-index to tree tables only
163
+ (tableRef && tableRef.current !== (event.target as HTMLElement).closest(`.${styles.table}:not(.pf-m-nested)`))
164
164
  ) {
165
165
  return;
166
166
  }
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { css } from '@patternfly/react-styles';
3
3
  import styles from '@patternfly/react-styles/css/components/Table/table';
4
4
  import scrollStyles from '@patternfly/react-styles/css/components/Table/table-scrollable';
5
+ import treeViewStyles from '@patternfly/react-styles/css/components/Table/table-tree-view';
5
6
  import { BaseCellProps } from './Table';
6
7
  import {
7
8
  cellActions,
@@ -28,6 +29,10 @@ import {
28
29
  TdSelectType,
29
30
  TdTreeRowType
30
31
  } from './base/types';
32
+ import cssStickyCellMinWidth from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_MinWidth';
33
+ import cssStickyCellLeft from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_Left';
34
+ import cssStickyCellRight from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_Right';
35
+
31
36
  export interface TdProps extends BaseCellProps, Omit<React.HTMLProps<HTMLTableDataCellElement>, 'onSelect' | 'width'> {
32
37
  /**
33
38
  * The column header the cell corresponds to.
@@ -253,8 +258,8 @@ const TdBase: React.FunctionComponent<TdProps> = ({
253
258
  } = merged;
254
259
 
255
260
  const treeTableTitleCell =
256
- (className && className.includes('pf-v5-c-table__tree-view-title-cell')) ||
257
- (mergedClassName && mergedClassName.includes('pf-v5-c-table__tree-view-title-cell'));
261
+ (className && className.includes(treeViewStyles.tableTreeViewTitleCell)) ||
262
+ (mergedClassName && mergedClassName.includes(treeViewStyles.tableTreeViewTitleCell));
258
263
 
259
264
  React.useEffect(() => {
260
265
  setTruncated(
@@ -288,9 +293,9 @@ const TdBase: React.FunctionComponent<TdProps> = ({
288
293
  {...props}
289
294
  {...(isStickyColumn && {
290
295
  style: {
291
- '--pf-v5-c-table__sticky-cell--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
292
- '--pf-v5-c-table__sticky-cell--Left': stickyLeftOffset ? stickyLeftOffset : 0,
293
- '--pf-v5-c-table__sticky-cell--Right': stickyRightOffset ? stickyRightOffset : 0,
296
+ [cssStickyCellMinWidth.name]: stickyMinWidth ? stickyMinWidth : undefined,
297
+ [cssStickyCellLeft.name]: stickyLeftOffset ? stickyLeftOffset : 0,
298
+ [cssStickyCellRight.name]: stickyRightOffset ? stickyRightOffset : 0,
294
299
  ...props.style
295
300
  } as React.CSSProperties
296
301
  })}
@@ -9,6 +9,9 @@ import { IVisibility } from './utils/decorators/classNames';
9
9
  import { Tooltip } from '@patternfly/react-core/dist/esm/components/Tooltip/Tooltip';
10
10
  import { BaseCellProps } from './Table';
11
11
  import { IFormatterValueType, IColumn } from './TableTypes';
12
+ import cssStickyCellMinWidth from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_MinWidth';
13
+ import cssStickyCellLeft from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_Left';
14
+ import cssStickyCellRight from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_Right';
12
15
 
13
16
  export interface ThProps
14
17
  extends BaseCellProps,
@@ -193,9 +196,9 @@ const ThBase: React.FunctionComponent<ThProps> = ({
193
196
  {...props}
194
197
  {...(isStickyColumn && {
195
198
  style: {
196
- '--pf-v5-c-table__sticky-cell--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
197
- '--pf-v5-c-table__sticky-cell--Left': stickyLeftOffset ? stickyLeftOffset : 0,
198
- '--pf-v5-c-table__sticky-cell--Right': stickyRightOffset ? stickyRightOffset : 0,
199
+ [cssStickyCellMinWidth.name]: stickyMinWidth ? stickyMinWidth : undefined,
200
+ [cssStickyCellLeft.name]: stickyLeftOffset ? stickyLeftOffset : 0,
201
+ [cssStickyCellRight.name]: stickyRightOffset ? stickyRightOffset : 0,
199
202
  ...props.style
200
203
  } as React.CSSProperties
201
204
  })}
@@ -54,6 +54,9 @@ import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-ico
54
54
 
55
55
  import { css } from '@patternfly/react-styles';
56
56
  import styles from '@patternfly/react-styles/css/components/Table/table';
57
+ import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
58
+ import textStyles from '@patternfly/react-styles/css/utilities/Text/text';
59
+ import global_BackgroundColor_150 from '@patternfly/react-tokens/dist/esm/global_BackgroundColor_150';
57
60
 
58
61
  ## Table examples
59
62
 
@@ -4,6 +4,7 @@ import { Table, Thead, Tr, Th, Tbody, Td, TdProps, ExpandableRowContent } from '
4
4
  import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
5
5
  import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
6
6
  import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
7
+ import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
7
8
 
8
9
  interface Repository {
9
10
  name: string;
@@ -110,7 +111,7 @@ export const TableCompoundExpandable: React.FunctionComponent = () => {
110
111
  <Tr isExpanded={isRowExpanded}>
111
112
  <Td dataLabel={columnNames[expandedCellKey]} noPadding colSpan={6}>
112
113
  <ExpandableRowContent>
113
- <div className="pf-v5-u-m-md">
114
+ <div className={spacing.mMd}>
114
115
  Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem
115
116
  ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum
116
117
  sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit dolor. Lorem ipsum sit
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
3
+ /* eslint-disable camelcase */
4
+ import global_BackgroundColor_150 from '@patternfly/react-tokens/dist/esm/global_BackgroundColor_150';
3
5
 
4
6
  interface Repository {
5
7
  name: string;
@@ -65,7 +67,7 @@ export const TableMisc: React.FunctionComponent = () => {
65
67
  {repositories.map((repo, rowIndex) => {
66
68
  const isOddRow = (rowIndex + 1) % 2;
67
69
  const customStyle = {
68
- backgroundColor: 'var(--pf-v5-global--BackgroundColor--150)'
70
+ backgroundColor: global_BackgroundColor_150.var
69
71
  };
70
72
  // Some arbitrary logic to demonstrate that cell styles can be based on anything
71
73
  const nameColSpan = repo.branches === null && repo.prs === null ? 3 : 1;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Table, Thead, Tr, Th, Tbody, Td, InnerScrollContainer, ThProps } from '@patternfly/react-table';
3
3
  import { Stack, StackItem } from '@patternfly/react-core';
4
+ import textStyles from '@patternfly/react-styles/css/utilities/Text/text';
4
5
 
5
6
  interface PodConnection {
6
7
  source: {
@@ -162,7 +163,7 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
162
163
  <Td dataLabel={columnNames.datetime}>
163
164
  <div>
164
165
  <span>{new Date(connection.timestamp).toDateString()}</span>{' '}
165
- <span className="pf-v5-u-color-200">{new Date(connection.timestamp).toLocaleTimeString()}</span>
166
+ <span className={textStyles.color_200}>{new Date(connection.timestamp).toLocaleTimeString()}</span>
166
167
  </div>
167
168
  </Td>
168
169
  <Td dataLabel={columnNames.source}>
@@ -171,7 +172,7 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
171
172
  <span>{connection.source.port.num}</span>
172
173
  </StackItem>
173
174
  <StackItem>
174
- <span className="pf-v5-u-color-200">({connection.source.port.protocol})</span>
175
+ <span className={textStyles.color_200}>({connection.source.port.protocol})</span>
175
176
  </StackItem>
176
177
  </Stack>
177
178
  </Td>
@@ -181,7 +182,7 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
181
182
  <span>{connection.destination.port.num}</span>
182
183
  </StackItem>
183
184
  <StackItem>
184
- <span className="pf-v5-u-color-200">({connection.destination.port.protocol})</span>
185
+ <span className={textStyles.color_200}>({connection.destination.port.protocol})</span>
185
186
  </StackItem>
186
187
  </Stack>
187
188
  </Td>
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Table, Thead, Tr, Th, Tbody, Td, InnerScrollContainer, ThProps } from '@patternfly/react-table';
3
3
  import { Stack, StackItem } from '@patternfly/react-core';
4
+ import textStyles from '@patternfly/react-styles/css/utilities/Text/text';
4
5
 
5
6
  interface PodConnection {
6
7
  source: {
@@ -165,7 +166,7 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
165
166
  <Td dataLabel={columnNames.datetime}>
166
167
  <div>
167
168
  <span>{new Date(connection.timestamp).toDateString()}</span>{' '}
168
- <span className="pf-v5-u-color-200">{new Date(connection.timestamp).toLocaleTimeString()}</span>
169
+ <span className={textStyles.color_200}>{new Date(connection.timestamp).toLocaleTimeString()}</span>
169
170
  </div>
170
171
  </Td>
171
172
  <Td dataLabel={columnNames.source}>
@@ -174,7 +175,7 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
174
175
  <span>{connection.source.port.num}</span>
175
176
  </StackItem>
176
177
  <StackItem>
177
- <span className="pf-v5-u-color-200">({connection.source.port.protocol})</span>
178
+ <span className={textStyles.color_200}>({connection.source.port.protocol})</span>
178
179
  </StackItem>
179
180
  </Stack>
180
181
  </Td>
@@ -184,7 +185,7 @@ export const TableNestedHeaders: React.FunctionComponent = () => {
184
185
  <span>{connection.destination.port.num}</span>
185
186
  </StackItem>
186
187
  <StackItem>
187
- <span className="pf-v5-u-color-200">({connection.destination.port.protocol})</span>
188
+ <span className={textStyles.color_200}>({connection.destination.port.protocol})</span>
188
189
  </StackItem>
189
190
  </Stack>
190
191
  </Td>
@@ -31,7 +31,7 @@ export const treeRow =
31
31
  {icon}
32
32
  </span>
33
33
  )}
34
- <span className="pf-v5-c-table__text" key="table-text">
34
+ <span className={styles.tableText} key="table-text">
35
35
  {content as React.ReactNode}
36
36
  </span>
37
37
  </div>
@@ -41,7 +41,7 @@ export const treeRow =
41
41
  };
42
42
  return {
43
43
  component: 'th',
44
- className: 'pf-v5-c-table__tree-view-title-cell',
44
+ className: stylesTreeView.tableTreeViewTitleCell,
45
45
  children:
46
46
  level !== undefined ? (
47
47
  <div className={css(stylesTreeView.tableTreeViewMain)}>
@@ -83,7 +83,7 @@ export const treeRow =
83
83
  onToggleRowDetails && onToggleRowDetails(event, rowIndex, content as React.ReactNode, rowData)
84
84
  }
85
85
  >
86
- <span className="pf-v5-c-table__details-toggle-icon">
86
+ <span className={`${styles.table}__details-toggle-icon`}>
87
87
  <EllipsisHIcon aria-hidden />
88
88
  </span>
89
89
  </Button>
@@ -29,6 +29,9 @@ import {
29
29
  IRowData,
30
30
  ISeparator
31
31
  } from '../TableTypes';
32
+ import { css } from '@patternfly/react-styles';
33
+ import tableStyles from '@patternfly/react-styles/css/components/Table/table';
34
+ import dropdownStyles from '@patternfly/react-styles/css/components/Dropdown/dropdown';
32
35
 
33
36
  const testCellActions = async ({
34
37
  actions,
@@ -65,7 +68,7 @@ const testCellActions = async ({
65
68
  actions = actionResolver(rowData, extraData);
66
69
  }
67
70
 
68
- expect(returnedData).toMatchObject({ className: 'pf-v5-c-table__action' });
71
+ expect(returnedData).toMatchObject({ className: tableStyles.tableAction });
69
72
 
70
73
  if (!actions || actions.length === 0) {
71
74
  expect(returnedData.children).toBeUndefined();
@@ -73,7 +76,10 @@ const testCellActions = async ({
73
76
  const { container } = render(returnedData.children as React.ReactElement<any>);
74
77
  await user.click(screen.getAllByRole('button')[0]);
75
78
  await waitFor(() =>
76
- expect(container.querySelectorAll('.pf-v5-c-dropdown__menu li button')).toHaveLength(expectDisabled ? 0 : 1)
79
+ // eslint-disable-next-line testing-library/no-container
80
+ expect(container.querySelectorAll(`.${dropdownStyles.dropdownMenu} li button`)).toHaveLength(
81
+ expectDisabled ? 0 : 1
82
+ )
77
83
  );
78
84
  }
79
85
  };
@@ -86,7 +92,7 @@ describe('Transformer functions', () => {
86
92
  extraParams: { onSelect }
87
93
  };
88
94
  const returnedData = selectable('', { column, rowData: {} } as IExtra);
89
- expect(returnedData).toMatchObject({ className: 'pf-v5-c-table__check' });
95
+ expect(returnedData).toMatchObject({ className: tableStyles.tableCheck });
90
96
 
91
97
  const user = userEvent.setup();
92
98
 
@@ -103,7 +109,7 @@ describe('Transformer functions', () => {
103
109
  extraParams: { onSelect }
104
110
  };
105
111
  const returnedData = selectable('', { column, rowIndex: 0, rowData: { selected: true } } as IExtra);
106
- expect(returnedData).toMatchObject({ className: 'pf-v5-c-table__check' });
112
+ expect(returnedData).toMatchObject({ className: tableStyles.tableCheck });
107
113
  const user = userEvent.setup();
108
114
 
109
115
  render(returnedData.children as React.ReactElement<any>);
@@ -128,7 +134,7 @@ describe('Transformer functions', () => {
128
134
  const onSort = jest.fn();
129
135
  const column = { extraParams: { sortBy: {}, onSort } };
130
136
  const returnedData = sortable('', { column, columnIndex: 0 });
131
- expect(returnedData).toMatchObject({ className: 'pf-v5-c-table__sort' });
137
+ expect(returnedData).toMatchObject({ className: tableStyles.tableSort });
132
138
 
133
139
  const user = userEvent.setup();
134
140
 
@@ -154,7 +160,7 @@ describe('Transformer functions', () => {
154
160
  const onSort = jest.fn();
155
161
  const column = { extraParams: { sortBy: { index: 0, direction: 'desc' }, onSort } };
156
162
  const returnedData = sortable('', { column, columnIndex: 0 } as IExtra);
157
- expect(returnedData).toMatchObject({ className: 'pf-v5-c-table__sort pf-m-selected' });
163
+ expect(returnedData).toMatchObject({ className: css(tableStyles.tableSort, tableStyles.modifiers.selected) });
158
164
 
159
165
  const user = userEvent.setup();
160
166
 
@@ -226,7 +232,7 @@ describe('Transformer functions', () => {
226
232
  extraParams: { onCollapse }
227
233
  };
228
234
  const returnedData = collapsible('', { rowIndex: 0, rowData, column });
229
- expect(returnedData).toMatchObject({ className: 'pf-v5-c-table__toggle' });
235
+ expect(returnedData).toMatchObject({ className: tableStyles.tableToggle });
230
236
 
231
237
  const user = userEvent.setup();
232
238
 
@@ -332,7 +338,7 @@ describe('Transformer functions', () => {
332
338
  extraParams: { onRowEdit }
333
339
  };
334
340
  const returned = editable('test', { rowIndex: 0, column });
335
- expect(returned).toMatchObject({ className: 'pf-v5-c-table__inline-edit-action' });
341
+ expect(returned).toMatchObject({ className: tableStyles.tableInlineEditAction });
336
342
  });
337
343
 
338
344
  describe('visibility classNames', () => {
@@ -24,11 +24,7 @@ import {
24
24
  fitContent,
25
25
  ICell
26
26
  } from '../../../../components';
27
- import {
28
- Table,
29
- TableHeader,
30
- TableBody
31
- } from '../index';
27
+ import { Table, TableHeader, TableBody } from '../index';
32
28
  import { rows, columns, editableRows, editableColumns, actions } from '../../../../test-helpers/data-sets';
33
29
  import { ColumnsType } from '../../../../components/Table/base/types';
34
30
 
@@ -52,8 +48,7 @@ describe('Table', () => {
52
48
  </Table>
53
49
  );
54
50
  const table = screen.getByLabelText('Table with ouiaSafe');
55
- expect(table.getAttribute('data-ouia-safe')).toEqual("false");
56
-
51
+ expect(table.getAttribute('data-ouia-safe')).toEqual('false');
57
52
  });
58
53
 
59
54
  test('header', () => {
@@ -116,7 +111,7 @@ describe('Table', () => {
116
111
  });
117
112
 
118
113
  describe('Table variants', () => {
119
- Object.values(TableGridBreakpoint).forEach(oneBreakpoint => {
114
+ Object.values(TableGridBreakpoint).forEach((oneBreakpoint) => {
120
115
  test(`Breakpoint - ${oneBreakpoint}`, () => {
121
116
  const { asFragment } = render(
122
117
  <Table aria-label="Aria labeled" gridBreakPoint={oneBreakpoint} cells={columns} rows={rows}>
@@ -128,7 +123,7 @@ describe('Table', () => {
128
123
  });
129
124
  });
130
125
 
131
- Object.values(TableVariant).forEach(onevariant => {
126
+ Object.values(TableVariant).forEach((onevariant) => {
132
127
  test(`Size - ${onevariant}`, () => {
133
128
  const { asFragment } = render(
134
129
  <Table aria-label="Aria labeled" variant={onevariant} cells={columns} rows={rows}>
@@ -5,6 +5,7 @@ import { compoundExpand } from '@patternfly/react-table';
5
5
  import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
6
6
  import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
7
7
  import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
8
+ import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
8
9
 
9
10
  interface Repository {
10
11
  name: string;
@@ -117,7 +118,7 @@ export const LegacyTableCompoundExpandable: React.FunctionComponent = () => {
117
118
  cells: [
118
119
  {
119
120
  title: (
120
- <div className="pf-v5-u-m-md" id={`compound-expansion-table-${repo.name}-1`}>
121
+ <div className={spacing.mMd} id={`compound-expansion-table-${repo.name}-1`}>
121
122
  Expanded content for {repo.name}: Branches goes here!
122
123
  </div>
123
124
  ),
@@ -132,7 +133,7 @@ export const LegacyTableCompoundExpandable: React.FunctionComponent = () => {
132
133
  cells: [
133
134
  {
134
135
  title: (
135
- <div className="pf-v5-u-m-md" id={`compound-expansion-table-${repo.name}-2`}>
136
+ <div className={spacing.mMd} id={`compound-expansion-table-${repo.name}-2`}>
136
137
  Expanded content for {repo.name}: Pull requests goes here!
137
138
  </div>
138
139
  ),
@@ -147,7 +148,7 @@ export const LegacyTableCompoundExpandable: React.FunctionComponent = () => {
147
148
  cells: [
148
149
  {
149
150
  title: (
150
- <div className="pf-v5-u-m-md" id={`compound-expansion-table-${repo.name}-3`}>
151
+ <div className={spacing.mMd} id={`compound-expansion-table-${repo.name}-3`}>
151
152
  Expanded content for {repo.name}: Workspaces goes here!
152
153
  </div>
153
154
  ),
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Table, TableHeader, TableBody, TableProps } from '@patternfly/react-table/deprecated';
3
3
  import { css } from '@patternfly/react-styles';
4
+ /* eslint-disable camelcase */
5
+ import global_primary_color_100 from '@patternfly/react-tokens/dist/esm/global_primary_color_100';
4
6
 
5
7
  interface Repository {
6
8
  name: string;
@@ -30,7 +32,7 @@ export const LegacyTableMisc: React.FunctionComponent = () => {
30
32
  const customRowWrapper: TableProps['rowWrapper'] = ({ trRef, className, rowProps, row: _row }) => {
31
33
  const isOddRow = rowProps ? !!((rowProps.rowIndex + 1) % 2) : true;
32
34
  const customStyle = {
33
- borderLeft: '3px solid var(--pf-v5-global--primary-color--100)'
35
+ borderLeft: `3px solid ${global_primary_color_100.var}`
34
36
  };
35
37
  return (
36
38
  <tr
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { headerCol } from '@patternfly/react-table';
3
3
  import { Table, TableHeader, TableBody, TableProps } from '@patternfly/react-table/deprecated';
4
4
  import { Checkbox } from '@patternfly/react-core';
5
+ import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
5
6
 
6
7
  interface Repository {
7
8
  name: string;
@@ -96,7 +97,7 @@ export const LegacyTableSelectable: React.FunctionComponent = () => {
96
97
  <div>
97
98
  <Checkbox
98
99
  label="Can select all"
99
- className="pf-v5-u-mb-lg"
100
+ className={spacing.mbLg}
100
101
  isChecked={canSelectAll}
101
102
  onChange={(_event, checked) => setCanSelectAll(checked)}
102
103
  aria-label="toggle select all checkbox"
@@ -32,6 +32,8 @@ import {
32
32
 
33
33
  import { css } from '@patternfly/react-styles';
34
34
  import styles from '@patternfly/react-styles/css/components/Table/table';
35
+ import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
36
+ import global_primary_color_100 from '@patternfly/react-tokens/dist/esm/global_primary_color_100';
35
37
 
36
38
  ## Table Columns
37
39
 
@@ -21,6 +21,7 @@ import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
21
21
  import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
22
22
  import { DashboardWrapper } from '@patternfly/react-core/src/demos/DashboardWrapper';
23
23
  import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
24
+ import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
24
25
 
25
26
  export const CompoundExpandable = () => {
26
27
  // In real usage, this data would come from some external source like an API via props.
@@ -248,7 +249,7 @@ export const CompoundExpandable = () => {
248
249
  <NestedItemsTable />
249
250
  ) : (
250
251
  <ExpandableRowContent>
251
- <div className="pf-v5-u-m-md">
252
+ <div className={spacing.mMd}>
252
253
  Expanded content for {repo.name}: {expandedCellKey} goes here!
253
254
  </div>
254
255
  </ExpandableRowContent>