@patternfly/react-table 5.0.0-alpha.79 → 5.0.0-alpha.80

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-table",
3
- "version": "5.0.0-alpha.79",
3
+ "version": "5.0.0-alpha.80",
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,7 +40,7 @@
40
40
  "subpaths": "node scripts/createSubpaths.js"
41
41
  },
42
42
  "dependencies": {
43
- "@patternfly/react-core": "^5.0.0-alpha.77",
43
+ "@patternfly/react-core": "^5.0.0-alpha.78",
44
44
  "@patternfly/react-icons": "^5.0.0-alpha.11",
45
45
  "@patternfly/react-styles": "^5.0.0-alpha.8",
46
46
  "@patternfly/react-tokens": "^5.0.0-alpha.7",
@@ -55,5 +55,5 @@
55
55
  "react": "^17 || ^18",
56
56
  "react-dom": "^17 || ^18"
57
57
  },
58
- "gitHead": "d9ed9a48d6cd077867203e29d39218feb24d6dd2"
58
+ "gitHead": "b4e11aa3349568d1e4737f648108689637766c60"
59
59
  }
@@ -11,7 +11,8 @@ import {
11
11
  cellWidth,
12
12
  Visibility,
13
13
  classNames,
14
- favoritable } from './utils';
14
+ favoritable
15
+ } from './utils';
15
16
  import { draggable } from './utils/decorators/draggable';
16
17
  import { treeRow } from './utils';
17
18
  import { mergeProps } from './base/merge-props';
@@ -263,7 +264,7 @@ const TdBase: React.FunctionComponent<TdProps> = ({
263
264
  isActionCell && styles.tableAction,
264
265
  textCenter && styles.modifiers.center,
265
266
  noPadding && styles.modifiers.noPadding,
266
- isStickyColumn && scrollStyles.tableStickyCell, // TODO: further updates will be made with issue #8829
267
+ isStickyColumn && scrollStyles.tableStickyCell,
267
268
  hasRightBorder && scrollStyles.modifiers.borderRight,
268
269
  hasLeftBorder && scrollStyles.modifiers.borderLeft,
269
270
  styles.modifiers[modifier as 'breakWord' | 'fitContent' | 'nowrap' | 'truncate' | 'wrap' | undefined],
@@ -275,9 +276,9 @@ const TdBase: React.FunctionComponent<TdProps> = ({
275
276
  {...props}
276
277
  {...(isStickyColumn && {
277
278
  style: {
278
- '--pf-c-table__sticky-column--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
279
- '--pf-c-table__sticky-column--Left': stickyLeftOffset ? stickyLeftOffset : undefined,
280
- right: stickyRightOffset ? stickyRightOffset : 0,
279
+ '--pf-c-table__sticky-cell--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
280
+ '--pf-c-table__sticky-cell--Left': stickyLeftOffset ? stickyLeftOffset : 0,
281
+ '--pf-c-table__sticky-cell--Right': stickyRightOffset ? stickyRightOffset : 0,
281
282
  ...props.style
282
283
  } as React.CSSProperties
283
284
  })}
@@ -2,17 +2,8 @@ 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 {
6
- info,
7
- sortable,
8
- sortableFavorites,
9
- selectable,
10
- collapsible,
11
- cellWidth,
12
- Visibility,
13
- classNames
14
- } from './utils';
15
- import { ThInfoType,ThSelectType, ThExpandType, ThSortType, formatterValueType } from './base/types';
5
+ import { info, sortable, sortableFavorites, selectable, collapsible, cellWidth, Visibility, classNames } from './utils';
6
+ import { ThInfoType, ThSelectType, ThExpandType, ThSortType, formatterValueType } from './base/types';
16
7
  import { mergeProps } from './base/merge-props';
17
8
  import { IVisibility } from './utils/decorators/classNames';
18
9
  import { Tooltip } from '@patternfly/react-core/dist/esm/components/Tooltip/Tooltip';
@@ -180,7 +171,7 @@ const ThBase: React.FunctionComponent<ThProps> = ({
180
171
  className,
181
172
  textCenter && styles.modifiers.center,
182
173
  isSubheader && styles.tableSubhead,
183
- isStickyColumn && scrollStyles.tableStickyCell, // TODO: further updates will be made with issue #8829
174
+ isStickyColumn && scrollStyles.tableStickyCell,
184
175
  hasRightBorder && scrollStyles.modifiers.borderRight,
185
176
  hasLeftBorder && scrollStyles.modifiers.borderLeft,
186
177
  modifier && styles.modifiers[modifier as 'breakWord' | 'fitContent' | 'nowrap' | 'truncate' | 'wrap'],
@@ -190,9 +181,9 @@ const ThBase: React.FunctionComponent<ThProps> = ({
190
181
  {...props}
191
182
  {...(isStickyColumn && {
192
183
  style: {
193
- '--pf-c-table__sticky-column--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
194
- '--pf-c-table__sticky-column--Left': stickyLeftOffset ? stickyLeftOffset : undefined,
195
- right: stickyRightOffset ? stickyRightOffset : 0,
184
+ '--pf-c-table__sticky-cell--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
185
+ '--pf-c-table__sticky-cell--Left': stickyLeftOffset ? stickyLeftOffset : 0,
186
+ '--pf-c-table__sticky-cell--Right': stickyRightOffset ? stickyRightOffset : 0,
196
187
  ...props.style
197
188
  } as React.CSSProperties
198
189
  })}
@@ -323,7 +323,12 @@ There are a few ways this can be handled:
323
323
 
324
324
  ### Sticky column
325
325
 
326
- To make a column sticky, wrap `Table` with `InnerScrollContainer` and add the following properties to the `Th` or `Td` that should be sticky: `isStickyColumn` and `hasRightBorder`. 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.
326
+ To make a column sticky, wrap `Table` with `InnerScrollContainer` and add the following properties to the `Th` or `Td` that should be sticky:
327
+
328
+ - `isStickyColumn`
329
+ - `hasRightBorder` for a left-aligned sticky column, or `hasLeftBorder` for a right-aligned sticky column.
330
+
331
+ 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.
327
332
 
328
333
  ```ts file="TableStickyColumn.tsx"
329
334
  ```
@@ -332,17 +337,10 @@ To make a column sticky, wrap `Table` with `InnerScrollContainer` and add the fo
332
337
 
333
338
  To make multiple left-aligned columns sticky:
334
339
 
335
- - wrap Table with InnerScrollContainer
336
- - add isStickyColumn to all columns that should be sticky
337
- - add hasRightBorder to the rightmost sticky column
338
- - add stickyLeftOffset to each sticky column after the first, with a value that equals the combined width - set by stickyMindWidth - of the previous sticky columns
339
-
340
- To prevent the default text wrapping behavior and allow horizontal scrolling, all Th or Td cells should also have the modifier="nowrap" property.
341
-
342
340
  - wrap `Table` with `InnerScrollContainer`
343
341
  - add `isStickyColumn` to all columns that should be sticky
344
342
  - add `hasRightBorder` to the rightmost sticky column
345
- - add `stickyLeftOffset` to each sticky column after the first, with a value that equals the combined width - set by `stickyMindWidth` - of the previous sticky columns
343
+ - 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.
346
344
 
347
345
  To prevent the default text wrapping behavior and allow horizontal scrolling, all `Th` or `Td` cells should also have the `modifier="nowrap"` property.
348
346
 
@@ -356,7 +354,7 @@ To make multiple right-aligned columns sticky:
356
354
  - wrap `Table` with `InnerScrollContainer`
357
355
  - add `isStickyColumn` to all columns that should be sticky
358
356
  - add `hasLeftBorder` to the leftmost sticky column
359
- - add `stickyRightOffset` to each sticky column preceding the last, with a value that equals the combined width - set by `stickyMindWidth` - of the next sticky columns
357
+ - 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.
360
358
 
361
359
  To prevent the default text wrapping behavior and allow horizontal scrolling, all `Th` or `Td` cells should also have the `modifier="nowrap"` property.
362
360