@patternfly/react-table 6.0.0-alpha.57 → 6.0.0-alpha.59

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 (60) hide show
  1. package/CHANGELOG.md +12 -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/EditableSelectInputCell.d.ts +3 -4
  11. package/dist/esm/components/Table/EditableSelectInputCell.d.ts.map +1 -1
  12. package/dist/esm/components/Table/EditableSelectInputCell.js +8 -4
  13. package/dist/esm/components/Table/EditableSelectInputCell.js.map +1 -1
  14. package/dist/esm/components/Table/TableTypes.d.ts +2 -3
  15. package/dist/esm/components/Table/TableTypes.d.ts.map +1 -1
  16. package/dist/esm/components/Table/TableTypes.js.map +1 -1
  17. package/dist/esm/components/Table/Td.js +3 -3
  18. package/dist/esm/components/Table/Td.js.map +1 -1
  19. package/dist/esm/components/Table/Th.js +3 -3
  20. package/dist/esm/components/Table/Th.js.map +1 -1
  21. package/dist/esm/components/Table/base/types.d.ts +6 -7
  22. package/dist/esm/components/Table/base/types.d.ts.map +1 -1
  23. package/dist/esm/components/Table/base/types.js.map +1 -1
  24. package/dist/esm/deprecated/components/Table/Table.d.ts.map +1 -1
  25. package/dist/esm/deprecated/components/Table/Table.js +2 -3
  26. package/dist/esm/deprecated/components/Table/Table.js.map +1 -1
  27. package/dist/js/components/Table/EditableSelectInputCell.d.ts +3 -4
  28. package/dist/js/components/Table/EditableSelectInputCell.d.ts.map +1 -1
  29. package/dist/js/components/Table/EditableSelectInputCell.js +8 -4
  30. package/dist/js/components/Table/EditableSelectInputCell.js.map +1 -1
  31. package/dist/js/components/Table/TableTypes.d.ts +2 -3
  32. package/dist/js/components/Table/TableTypes.d.ts.map +1 -1
  33. package/dist/js/components/Table/TableTypes.js +0 -1
  34. package/dist/js/components/Table/TableTypes.js.map +1 -1
  35. package/dist/js/components/Table/Td.js +3 -3
  36. package/dist/js/components/Table/Td.js.map +1 -1
  37. package/dist/js/components/Table/Th.js +3 -3
  38. package/dist/js/components/Table/Th.js.map +1 -1
  39. package/dist/js/components/Table/base/types.d.ts +6 -7
  40. package/dist/js/components/Table/base/types.d.ts.map +1 -1
  41. package/dist/js/components/Table/base/types.js +1 -2
  42. package/dist/js/components/Table/base/types.js.map +1 -1
  43. package/dist/js/deprecated/components/Table/Table.d.ts.map +1 -1
  44. package/dist/js/deprecated/components/Table/Table.js +9 -10
  45. package/dist/js/deprecated/components/Table/Table.js.map +1 -1
  46. package/dist/umd/react-table.min.js +3 -3
  47. package/package.json +6 -6
  48. package/src/components/Table/EditableSelectInputCell.tsx +15 -10
  49. package/src/components/Table/TableTypes.tsx +2 -3
  50. package/src/components/Table/Td.tsx +4 -4
  51. package/src/components/Table/Th.tsx +4 -4
  52. package/src/components/Table/base/types.tsx +6 -7
  53. package/src/components/Table/examples/Table.md +35 -4
  54. package/src/components/Table/examples/TableMisc.tsx +2 -2
  55. package/src/components/Table/utils/transformers.test.tsx +4 -7
  56. package/src/demos/Table.md +0 -1
  57. package/src/demos/examples/TableEmptyStateError.tsx +2 -3
  58. package/src/deprecated/components/Table/Table.tsx +2 -3
  59. package/src/deprecated/components/Table/examples/LegacyTableMisc.tsx +2 -2
  60. package/src/deprecated/components/Table/examples/Table.md +46 -39
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-table",
3
- "version": "6.0.0-alpha.57",
3
+ "version": "6.0.0-alpha.59",
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.js --config subpaths.config.json"
41
41
  },
42
42
  "dependencies": {
43
- "@patternfly/react-core": "^6.0.0-alpha.57",
44
- "@patternfly/react-icons": "^6.0.0-alpha.20",
45
- "@patternfly/react-styles": "^6.0.0-alpha.20",
46
- "@patternfly/react-tokens": "^6.0.0-alpha.20",
43
+ "@patternfly/react-core": "^6.0.0-alpha.59",
44
+ "@patternfly/react-icons": "^6.0.0-alpha.21",
45
+ "@patternfly/react-styles": "^6.0.0-alpha.21",
46
+ "@patternfly/react-tokens": "^6.0.0-alpha.21",
47
47
  "lodash": "^4.17.19",
48
48
  "tslib": "^2.5.0"
49
49
  },
@@ -55,5 +55,5 @@
55
55
  "react": "^17 || ^18",
56
56
  "react-dom": "^17 || ^18"
57
57
  },
58
- "gitHead": "b2e46fefe688b2809ccf36e1ca575867a0c82a78"
58
+ "gitHead": "6101cfe558acec0474dd1c0649e44c38bf01383f"
59
59
  }
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { css } from '@patternfly/react-styles';
3
- import { Select, SelectOptionObject } from '@patternfly/react-core/dist/esm/deprecated/components/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: string | SelectOptionObject,
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?: string | SelectOptionObject | (string | SelectOptionObject)[];
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 | React.ChangeEvent | React.KeyboardEvent | Event, isExpanded: boolean) => void;
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: string | SelectOptionObject,
52
- isPlaceholder: boolean
52
+ newValue: any | any[]
53
+ // isPlaceholder: boolean
53
54
  ) => {
54
- onSelect(event, newValue, rowIndex, cellIndex, isPlaceholder);
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
- onToggle={onToggle}
68
- selections={selections}
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?: DropdownPosition;
106
- dropdownDirection?: 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;
@@ -30,8 +30,8 @@ import {
30
30
  TdTreeRowType
31
31
  } from './base/types';
32
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';
33
+ import cssStickyCellInlineStart from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_InsetInlineStart';
34
+ import cssStickyCellInlineEnd from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_InsetInlineEnd';
35
35
 
36
36
  export interface TdProps extends BaseCellProps, Omit<React.HTMLProps<HTMLTableDataCellElement>, 'onSelect' | 'width'> {
37
37
  /**
@@ -294,8 +294,8 @@ const TdBase: React.FunctionComponent<TdProps> = ({
294
294
  {...(isStickyColumn && {
295
295
  style: {
296
296
  [cssStickyCellMinWidth.name]: stickyMinWidth ? stickyMinWidth : undefined,
297
- [cssStickyCellLeft.name]: stickyLeftOffset ? stickyLeftOffset : 0,
298
- [cssStickyCellRight.name]: stickyRightOffset ? stickyRightOffset : 0,
297
+ [cssStickyCellInlineStart.name]: stickyLeftOffset ? stickyLeftOffset : 0,
298
+ [cssStickyCellInlineEnd.name]: stickyRightOffset ? stickyRightOffset : 0,
299
299
  ...props.style
300
300
  } as React.CSSProperties
301
301
  })}
@@ -10,8 +10,8 @@ import { Tooltip, TooltipProps } from '@patternfly/react-core/dist/esm/component
10
10
  import { BaseCellProps } from './Table';
11
11
  import { IFormatterValueType, IColumn } from './TableTypes';
12
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';
13
+ import cssStickyCellInlineStart from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_InsetInlineStart';
14
+ import cssStickyCellInlineEnd from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_InsetInlineEnd';
15
15
 
16
16
  export interface ThProps
17
17
  extends BaseCellProps,
@@ -224,8 +224,8 @@ const ThBase: React.FunctionComponent<ThProps> = ({
224
224
  {...(isStickyColumn && {
225
225
  style: {
226
226
  [cssStickyCellMinWidth.name]: stickyMinWidth ? stickyMinWidth : undefined,
227
- [cssStickyCellLeft.name]: stickyLeftOffset ? stickyLeftOffset : 0,
228
- [cssStickyCellRight.name]: stickyRightOffset ? stickyRightOffset : 0,
227
+ [cssStickyCellInlineStart.name]: stickyLeftOffset ? stickyLeftOffset : 0,
228
+ [cssStickyCellInlineEnd.name]: stickyRightOffset ? stickyRightOffset : 0,
229
229
  ...props.style
230
230
  } as React.CSSProperties
231
231
  })}
@@ -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 { DropdownPosition, DropdownDirection } from '@patternfly/react-core/dist/esm/deprecated/components/Dropdown';
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?: DropdownPosition;
63
+ dropdownPosition?: 'right' | 'left';
65
64
  /** Actions dropdown direction */
66
- dropdownDirection?: 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
- /** String or SelectOptionObject, or array of strings or SelectOptionObjects representing current selections */
290
- selected: string | SelectOptionObject | (string | SelectOptionObject)[];
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 Select component */
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;
@@ -56,7 +56,7 @@ import { css } from '@patternfly/react-styles';
56
56
  import styles from '@patternfly/react-styles/css/components/Table/table';
57
57
  import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
58
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';
59
+ import global_background_color_secondary_default from '@patternfly/react-tokens/dist/esm/global_background_color_secondary_default';
60
60
 
61
61
  ## Table examples
62
62
 
@@ -71,6 +71,7 @@ Some general notes:
71
71
  ### Basic
72
72
 
73
73
  ```ts file="TableBasic.tsx"
74
+
74
75
  ```
75
76
 
76
77
  ### Custom row wrapper, header tooltips & popovers
@@ -82,6 +83,7 @@ Some general notes:
82
83
  To add a header tooltip or popover to `Th`, pass a `ThInfoType` object via the `info` prop.
83
84
 
84
85
  ```ts file="TableMisc.tsx"
86
+
85
87
  ```
86
88
 
87
89
  ### Sortable & wrapping headers
@@ -103,6 +105,7 @@ type OnSort = (
103
105
  The built in display for sorting is not fully responsive, as the column headers will be displayed per row when the screen size is small. To see a full page demo of a responsive sortable table, utilizing a toolbar item to control sorting for small screens, view the `Sortable - responsive` demo in the `React demos` tab.
104
106
 
105
107
  ```ts file="TableSortable.tsx"
108
+
106
109
  ```
107
110
 
108
111
  ### Sortable - custom control
@@ -110,6 +113,7 @@ The built in display for sorting is not fully responsive, as the column headers
110
113
  Sorting a table may also be controlled manually with a toolbar control. To see a full page demo of a responsive table, view the `Sortable - responsive` demo in the `React demos` tab.
111
114
 
112
115
  ```ts file="TableSortableCustom.tsx"
116
+
113
117
  ```
114
118
 
115
119
  ### Selectable with checkbox
@@ -140,6 +144,7 @@ type OnSelect = (
140
144
  checking checkboxes will check intermediate rows' checkboxes.
141
145
 
142
146
  ```ts file="TableSelectable.tsx"
147
+
143
148
  ```
144
149
 
145
150
  ### Selectable radio input
@@ -147,6 +152,7 @@ checking checkboxes will check intermediate rows' checkboxes.
147
152
  Similarly to the selectable example above, the radio buttons use the first column. The first header cell is empty, and each body row's first cell has radio button props.
148
153
 
149
154
  ```ts file="TableSelectableRadio.tsx"
155
+
150
156
  ```
151
157
 
152
158
  ### Row click handler, clickable rows
@@ -154,6 +160,7 @@ Similarly to the selectable example above, the radio buttons use the first colum
154
160
  This selectable rows feature is intended for use when a table is used to present a list of objects in a Primary-detail view.
155
161
 
156
162
  ```ts file="TableClickable.tsx"
163
+
157
164
  ```
158
165
 
159
166
  ### Actions
@@ -165,6 +172,7 @@ To make a cell an action cell, render an `ActionsColumn` component inside a row'
165
172
  If actions menus are getting clipped by other items on the page, such as sticky columns or rows, the `ActionsColumn` can be passed a `menuAppendTo` prop to adjust where the actions menu is appended.
166
173
 
167
174
  ```ts file="TableActions.tsx"
175
+
168
176
  ```
169
177
 
170
178
  ### Actions Overflow
@@ -172,6 +180,7 @@ If actions menus are getting clipped by other items on the page, such as sticky
172
180
  Useing an `OverflowMenu` in the actions column, allowing the actions to condense into a dropdown if necessary for space.
173
181
 
174
182
  ```ts file="TableActionsOverflow.tsx"
183
+
175
184
  ```
176
185
 
177
186
  ### Expandable
@@ -197,6 +206,7 @@ type OnCollapse = (
197
206
  Note: Table column widths will respond automatically when toggling expanded rows. To retain column widths between expanded and collapsed states, column header and/or data cell widths must be set.
198
207
 
199
208
  ```ts file="TableExpandable.tsx"
209
+
200
210
  ```
201
211
 
202
212
  ### Compound expandable
@@ -221,16 +231,19 @@ export type OnExpand = (
221
231
  ```
222
232
 
223
233
  ```ts file="TableCompoundExpandable.tsx"
234
+
224
235
  ```
225
236
 
226
237
  ### Cell width, breakpoint modifiers
227
238
 
228
239
  ```ts file="TableCellWidth.tsx"
240
+
229
241
  ```
230
242
 
231
243
  ### Controlling text
232
244
 
233
245
  ```ts file="TableControllingText.tsx"
246
+
234
247
  ```
235
248
 
236
249
  ### Modifiers with table text
@@ -238,11 +251,13 @@ export type OnExpand = (
238
251
  If the "wrapModifier" property is set to "truncate", it's needed to ensure that the corresponding tooltip can be opened using both keyboard and screen reader. Since this particular Td element is generic and doesn't have any predefined decorators, the focus management required to trigger the tooltip needs to be handled manually by defining and manipulating the requisite props.
239
252
 
240
253
  ```ts file="TableTextModifiers.tsx"
254
+
241
255
  ```
242
256
 
243
257
  ### Empty state
244
258
 
245
259
  ```ts file="TableEmptyState.tsx"
260
+
246
261
  ```
247
262
 
248
263
  ### Favoritable (implemented with sortable)
@@ -265,6 +280,7 @@ type OnFavorite = (
265
280
  To make a favoritable column sortable, pass a `ThSortType` object to the favoritable column's `Th` with `isFavorites` set to true.
266
281
 
267
282
  ```ts file="TableFavoritable.tsx"
283
+
268
284
  ```
269
285
 
270
286
  ### Tree table
@@ -298,6 +314,7 @@ aria-posinset, and aria-setsize as violations. This is an intentional choice at
298
314
  the voice over technologies will recognize the flat table structure as a tree.
299
315
 
300
316
  ```ts file="TableTree.tsx"
317
+
301
318
  ```
302
319
 
303
320
  ### Flat tree table with no inset
@@ -305,6 +322,7 @@ the voice over technologies will recognize the flat table structure as a tree.
305
322
  To remove the inset used to leave space for the expand/collapse toggle in a flat tree table, use the `hasNoInset` prop on the `Table` component.
306
323
 
307
324
  ```ts file="TableTreeNoInset.tsx"
325
+
308
326
  ```
309
327
 
310
328
  ### Draggable row table
@@ -318,6 +336,7 @@ To make a row draggable:
318
336
  5. The draggable `Td` in each row needs a `TdDraggableType` object passed to its `draggable` prop.
319
337
 
320
338
  ```ts isBeta file="TableDraggable.tsx"
339
+
321
340
  ```
322
341
 
323
342
  ### Sticky table modifiers
@@ -334,7 +353,7 @@ There are a few ways this can be handled:
334
353
 
335
354
  ### Sticky column
336
355
 
337
- To make a column sticky, wrap `Table` with `InnerScrollContainer` and add the following properties to the `Th` or `Td` that should be sticky:
356
+ To make a column sticky, wrap `Table` with `InnerScrollContainer` and add the following properties to the `Th` or `Td` that should be sticky:
338
357
 
339
358
  - `isStickyColumn`
340
359
  - `hasRightBorder` for a left-aligned sticky column, or `hasLeftBorder` for a right-aligned sticky column.
@@ -342,6 +361,7 @@ To make a column sticky, wrap `Table` with `InnerScrollContainer` and add the fo
342
361
  To prevent the default text wrapping behavior and allow horizontal scrolling, all `Th` or `Td` cells should also have the `modifier="nowrap"` property. To set the minimum width of the sticky column, use the `stickyMinWidth` property. For multiple sticky columns, use the `stickyLeftOffset` and `stickyRightOffset` properties for additional left or right sticky columns.
343
362
 
344
363
  ```ts file="TableStickyColumn.tsx"
364
+
345
365
  ```
346
366
 
347
367
  ### Multiple left-aligned sticky columns
@@ -351,11 +371,12 @@ To make multiple left-aligned columns sticky:
351
371
  - wrap `Table` with `InnerScrollContainer`
352
372
  - add `isStickyColumn` to all columns that should be sticky
353
373
  - add `hasRightBorder` to the rightmost sticky column
354
- - add `stickyLeftOffset` to each sticky column with a value that equals the combined width - set by `stickyMindWidth` - of the previous sticky columns. The leftmost sticky column should have a value of `0`, which is the default of this property.
374
+ - add `stickyLeftOffset` to each sticky column with a value that equals the combined width - set by `stickyMindWidth` - of the previous sticky columns. The leftmost sticky column should have a value of `0`, which is the default of this property.
355
375
 
356
376
  To prevent the default text wrapping behavior and allow horizontal scrolling, all `Th` or `Td` cells should also have the `modifier="nowrap"` property.
357
377
 
358
378
  ```ts file="TableMultipleStickyColumns.tsx"
379
+
359
380
  ```
360
381
 
361
382
  ### Multiple right-aligned sticky columns
@@ -365,11 +386,12 @@ To make multiple right-aligned columns sticky:
365
386
  - wrap `Table` with `InnerScrollContainer`
366
387
  - add `isStickyColumn` to all columns that should be sticky
367
388
  - add `hasLeftBorder` to the leftmost sticky column
368
- - add `stickyRightOffset` to each sticky column with a value that equals the combined width - set by `stickyMindWidth` - of the next sticky columns. The rightmost sticky column should have a value of `0`, which is the default of this property.
389
+ - add `stickyRightOffset` to each sticky column with a value that equals the combined width - set by `stickyMindWidth` - of the next sticky columns. The rightmost sticky column should have a value of `0`, which is the default of this property.
369
390
 
370
391
  To prevent the default text wrapping behavior and allow horizontal scrolling, all `Th` or `Td` cells should also have the `modifier="nowrap"` property.
371
392
 
372
393
  ```ts file="TableRightStickyColumn.tsx"
394
+
373
395
  ```
374
396
 
375
397
  ### Sticky columns and header
@@ -377,6 +399,7 @@ To prevent the default text wrapping behavior and allow horizontal scrolling, al
377
399
  To maintain proper sticky behavior across sticky columns and header, `Table` must be wrapped with `OuterScrollContainer` and `InnerScrollContainer`.
378
400
 
379
401
  ```ts file="TableStickyColumnsAndHeader.tsx"
402
+
380
403
  ```
381
404
 
382
405
  ### Nested column headers
@@ -393,21 +416,25 @@ The first `Tr` represents the top level of columns, and each must pass either `r
393
416
  The second `Tr` represents the second level of sub columns. The `Th` in this row each should pass `isSubHeader`, and the last sub column of a column should also pass `hasRightBorder`.
394
417
 
395
418
  ```ts file="TableNestedHeaders.tsx"
419
+
396
420
  ```
397
421
 
398
422
  ### Nested column headers and expandable rows
399
423
 
400
424
  ```ts file="TableNestedExpandable.tsx"
425
+
401
426
  ```
402
427
 
403
428
  ### Expandable with nested table
404
429
 
405
430
  ```ts file="TableNestedTableExpandable.tsx"
431
+
406
432
  ```
407
433
 
408
434
  ### Nested sticky header
409
435
 
410
436
  ```ts file="TableNestedStickyHeader.tsx"
437
+
411
438
  ```
412
439
 
413
440
  ### Striped
@@ -415,6 +442,7 @@ The second `Tr` represents the second level of sub columns. The `Th` in this row
415
442
  To apply striping to a basic table, add the `isStriped` property to `Table`.
416
443
 
417
444
  ```ts file="TableStriped.tsx"
445
+
418
446
  ```
419
447
 
420
448
  ### Striped expandable
@@ -422,6 +450,7 @@ To apply striping to a basic table, add the `isStriped` property to `Table`.
422
450
  To apply striping to an expandable table, add the `isStriped` and `isExpandable` properties to `Table`.
423
451
 
424
452
  ```ts file="TableStripedExpandable.tsx"
453
+
425
454
  ```
426
455
 
427
456
  ### Striped multiple tobdy
@@ -429,6 +458,7 @@ To apply striping to an expandable table, add the `isStriped` and `isExpandable`
429
458
  When there are multiple `Tbody` components within a table, a more granular application of striping may be controlled by adding either the `isEvenStriped` or `isOddStriped` properties to `Tbody`. These properties will stripe even or odd rows within that `Tbody` respectively.
430
459
 
431
460
  ```ts file="TableStripedMultipleTbody.tsx"
461
+
432
462
  ```
433
463
 
434
464
  ### Striped tr
@@ -436,4 +466,5 @@ When there are multiple `Tbody` components within a table, a more granular appli
436
466
  To manually control striping, add the `isStriped` property to each desired `Tr`. This replaces adding the `isStriped` property to `Table`.
437
467
 
438
468
  ```ts file="TableStripedTr.tsx"
469
+
439
470
  ```
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
3
3
  /* eslint-disable camelcase */
4
- import global_BackgroundColor_150 from '@patternfly/react-tokens/dist/esm/global_BackgroundColor_150';
4
+ import global_background_color_secondary_default from '@patternfly/react-tokens/dist/esm/global_background_color_secondary_default';
5
5
 
6
6
  interface Repository {
7
7
  name: string;
@@ -67,7 +67,7 @@ export const TableMisc: React.FunctionComponent = () => {
67
67
  {repositories.map((repo, rowIndex) => {
68
68
  const isOddRow = (rowIndex + 1) % 2;
69
69
  const customStyle = {
70
- backgroundColor: global_BackgroundColor_150.var
70
+ backgroundColor: global_background_color_secondary_default.var
71
71
  };
72
72
  // Some arbitrary logic to demonstrate that cell styles can be based on anything
73
73
  const nameColSpan = repo.branches === null && repo.prs === null ? 3 : 1;
@@ -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,
@@ -31,7 +30,7 @@ import {
31
30
  } from '../TableTypes';
32
31
  import { css } from '@patternfly/react-styles';
33
32
  import tableStyles from '@patternfly/react-styles/css/components/Table/table';
34
- import dropdownStyles from '@patternfly/react-styles/css/components/Dropdown/dropdown';
33
+ import menuStyles from '@patternfly/react-styles/css/components/Menu/menu';
35
34
 
36
35
  const testCellActions = async ({
37
36
  actions,
@@ -58,8 +57,8 @@ const testCellActions = async ({
58
57
  rowData,
59
58
  column: {
60
59
  extraParams: {
61
- dropdownPosition: DropdownPosition.right,
62
- dropdownDirection: DropdownDirection.down
60
+ dropdownPosition: 'right',
61
+ dropdownDirection: 'down'
63
62
  }
64
63
  }
65
64
  });
@@ -77,9 +76,7 @@ const testCellActions = async ({
77
76
  await user.click(screen.getAllByRole('button')[0]);
78
77
  await waitFor(() =>
79
78
  // eslint-disable-next-line testing-library/no-container
80
- expect(container.querySelectorAll(`.${dropdownStyles.dropdownMenu} li button`)).toHaveLength(
81
- expectDisabled ? 0 : 1
82
- )
79
+ expect(container.querySelectorAll(`.${menuStyles.menu} li button`)).toHaveLength(expectDisabled ? 0 : 1)
83
80
  );
84
81
  }
85
82
  };
@@ -57,7 +57,6 @@ import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclam
57
57
  import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
58
58
  import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
59
59
  import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
60
- import globalDangerColor200 from '@patternfly/react-tokens/dist/esm/global_danger_color_200';
61
60
  import AngleDownIcon from '@patternfly/react-icons/dist/esm/icons/angle-down-icon';
62
61
  import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
63
62
  import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
@@ -11,7 +11,6 @@ import {
11
11
  PageSection
12
12
  } from '@patternfly/react-core';
13
13
  import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
14
- import globalDangerColor200 from '@patternfly/react-tokens/dist/esm/global_danger_color_200';
15
14
  import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
16
15
 
17
16
  export const TableEmptyStateError: React.FunctionComponent = () => (
@@ -32,10 +31,10 @@ export const TableEmptyStateError: React.FunctionComponent = () => (
32
31
  <Tr>
33
32
  <Td colSpan={8}>
34
33
  <Bullseye>
35
- <EmptyState variant={EmptyStateVariant.sm}>
34
+ <EmptyState variant={EmptyStateVariant.sm} titleText="">
36
35
  <EmptyStateHeader
37
36
  titleText="Unable to connect"
38
- icon={<EmptyStateIcon icon={ExclamationCircleIcon} color={globalDangerColor200.value} />}
37
+ icon={<EmptyStateIcon icon={ExclamationCircleIcon} />}
39
38
  headingLevel="h2"
40
39
  />
41
40
  <EmptyStateBody>
@@ -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: DropdownPosition.right,
147
- dropdownDirection: DropdownDirection.down,
145
+ dropdownPosition: 'right',
146
+ dropdownDirection: 'down',
148
147
  actionsMenuAppendTo: 'inline',
149
148
  header: undefined as React.ReactNode,
150
149
  caption: undefined as React.ReactNode,
@@ -2,7 +2,7 @@ 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
4
  /* eslint-disable camelcase */
5
- import global_primary_color_100 from '@patternfly/react-tokens/dist/esm/global_primary_color_100';
5
+ import global_color_brand_default from '@patternfly/react-tokens/dist/esm/global_color_brand_default';
6
6
 
7
7
  interface Repository {
8
8
  name: string;
@@ -32,7 +32,7 @@ export const LegacyTableMisc: React.FunctionComponent = () => {
32
32
  const customRowWrapper: TableProps['rowWrapper'] = ({ trRef, className, rowProps, row: _row }) => {
33
33
  const isOddRow = rowProps ? !!((rowProps.rowIndex + 1) % 2) : true;
34
34
  const customStyle = {
35
- borderLeft: `3px solid ${global_primary_color_100.var}`
35
+ borderLeft: `3px solid ${global_color_brand_default.var}`
36
36
  };
37
37
  return (
38
38
  <tr