@patternfly/react-table 4.71.0 → 4.71.1

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": "4.71.0",
3
+ "version": "4.71.1",
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",
@@ -31,10 +31,10 @@
31
31
  "clean": "rimraf dist"
32
32
  },
33
33
  "dependencies": {
34
- "@patternfly/react-core": "^4.202.0",
35
- "@patternfly/react-icons": "^4.53.0",
36
- "@patternfly/react-styles": "^4.52.0",
37
- "@patternfly/react-tokens": "^4.54.0",
34
+ "@patternfly/react-core": "^4.202.1",
35
+ "@patternfly/react-icons": "^4.53.1",
36
+ "@patternfly/react-styles": "^4.52.1",
37
+ "@patternfly/react-tokens": "^4.54.1",
38
38
  "lodash": "^4.17.19",
39
39
  "tslib": "^2.0.0"
40
40
  },
@@ -46,5 +46,5 @@
46
46
  "react": "^16.8.0 || ^17.0.0",
47
47
  "react-dom": "^16.8.0 || ^17.0.0"
48
48
  },
49
- "gitHead": "a328f46967c052f0d72d77dff763ecbb3318bc4e"
49
+ "gitHead": "fc88ddd5f942598163a34ad5a8df86215cc7a6a5"
50
50
  }
@@ -58,6 +58,8 @@ export interface TdSelectType {
58
58
  }
59
59
 
60
60
  export interface TdActionsType {
61
+ /** The row index */
62
+ rowIndex?: number;
61
63
  /** Cell actions */
62
64
  items: IActions;
63
65
  /** Whether to disable the actions */
@@ -111,6 +111,7 @@ const TdBase: React.FunctionComponent<TdProps> = ({
111
111
  const actionParamsFunc = actions ? cellActions(actions.items, null, null) : null;
112
112
  const actionParams = actionParamsFunc
113
113
  ? actionParamsFunc(null, {
114
+ rowIndex: actions?.rowIndex,
114
115
  rowData: {
115
116
  disableActions: actions?.disable
116
117
  },
@@ -311,6 +311,16 @@ To make a row draggable:
311
311
  ```ts isBeta file="ComposableTableDraggable.tsx"
312
312
  ```
313
313
 
314
+ ## Sticky table modifiers
315
+
316
+ **Note:** Sticky table headers and columns have a higher `z-index` than the `z-index` used for menus (dropdown, select, etc). The intent is that the contents of a scrollable table will scroll under the sticky header/column, including any expanded menus. However, there may be use cases where a menu needs to appear on top of a sticky header/column, such as an expanded menu in a toolbar above a table with a sticky header.
317
+
318
+ There are a few ways this can be handled:
319
+
320
+ - Manipulate the `z-index` of the menu and/or table headers/columns manually.
321
+ - Use the `menuAppendTo` prop in non-composable react components with menus to append the menu to an element outside of the table (e.g., the table's parent element) so that the menu has a higher stacking context than - and can appear on top of - sticky headers/columns as well as appear outside of any scrollable content in the table.
322
+ - In the case where the menu is outside of the table (e.g., above the table in a toolbar, or below the table and the menu expands up), assign the entire table a lower `z-index` than the `z-index` of the menu. This creates a lower stacking context for the entire table compared to the menu, while preserving the stacking context of the elements inside of the table.
323
+
314
324
  ### Composable: Sticky column
315
325
 
316
326
  To make a column sticky, wrap `TableComposable` with `InnerScrollContainer` and add the following properties to the `Th` that should be sticky: `isStickyColumn` and `hasRightBorder`. To prevent the default text wrapping behavior and allow horizontal scrolling, all `Th` should also have the `modifier="nowrap"` property. To set the minimum width of the sticky column, use the `stickyMinWidth` property.
@@ -332,7 +342,7 @@ To maintain proper sticky behavior across sticky columns and header, `TableCompo
332
342
  ```ts file="ComposableTableStickyColumnsAndHeader.tsx"
333
343
  ```
334
344
 
335
- ### Composable: Nested column headers
345
+ ## Nested column headers
336
346
 
337
347
  To make a nested column header:
338
348
 
@@ -345,6 +355,8 @@ The first `Tr` represents the top level of columns, and each must pass either `r
345
355
 
346
356
  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`.
347
357
 
358
+ ### Composable: Nested column headers
359
+
348
360
  ```ts file="ComposableTableNestedHeaders.tsx"
349
361
  ```
350
362
 
@@ -358,6 +370,8 @@ The second `Tr` represents the second level of sub columns. The `Th` in this row
358
370
  ```ts file="ComposableTableNestedTableExpandable.tsx"
359
371
  ```
360
372
 
373
+ ## Striped
374
+
361
375
  ### Composable: Striped
362
376
 
363
377
  To apply striping to a basic table, add the `isStriped` property to `TableComposable`.