@patternfly/react-table 4.70.1 → 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/CHANGELOG.md +27 -0
- package/dist/esm/components/Table/Table.js +1 -1
- package/dist/esm/components/Table/Table.js.map +1 -1
- package/dist/esm/components/Table/base/types.d.ts +2 -0
- package/dist/esm/components/Table/base/types.d.ts.map +1 -1
- package/dist/esm/components/Table/base/types.js.map +1 -1
- package/dist/esm/components/TableComposable/Td.d.ts.map +1 -1
- package/dist/esm/components/TableComposable/Td.js +1 -0
- package/dist/esm/components/TableComposable/Td.js.map +1 -1
- package/dist/js/components/Table/Table.js +1 -1
- package/dist/js/components/Table/Table.js.map +1 -1
- package/dist/js/components/Table/base/types.d.ts +2 -0
- package/dist/js/components/Table/base/types.d.ts.map +1 -1
- package/dist/js/components/Table/base/types.js.map +1 -1
- package/dist/js/components/TableComposable/Td.d.ts.map +1 -1
- package/dist/js/components/TableComposable/Td.js +1 -0
- package/dist/js/components/TableComposable/Td.js.map +1 -1
- package/dist/umd/react-table.css +75 -46
- package/dist/umd/react-table.js +55 -35
- package/dist/umd/react-table.min.css +108 -79
- package/dist/umd/react-table.min.js +3 -3
- package/package.json +6 -6
- package/src/components/Table/Table.tsx +1 -1
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +9 -75
- package/src/components/Table/base/types.tsx +2 -0
- package/src/components/TableComposable/Td.tsx +1 -0
- package/src/components/TableComposable/examples/ComposableTable.md +15 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "4.
|
|
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.
|
|
35
|
-
"@patternfly/react-icons": "^4.
|
|
36
|
-
"@patternfly/react-styles": "^4.
|
|
37
|
-
"@patternfly/react-tokens": "^4.
|
|
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": "
|
|
49
|
+
"gitHead": "fc88ddd5f942598163a34ad5a8df86215cc7a6a5"
|
|
50
50
|
}
|
|
@@ -143,7 +143,7 @@ export class Table extends React.Component<TableProps, {}> {
|
|
|
143
143
|
gridBreakPoint: TableGridBreakpoint.gridMd,
|
|
144
144
|
role: 'grid',
|
|
145
145
|
canSelectAll: true,
|
|
146
|
-
canCollapseAll:
|
|
146
|
+
canCollapseAll: false,
|
|
147
147
|
isHeaderSelectDisabled: false,
|
|
148
148
|
selectVariant: 'checkbox',
|
|
149
149
|
collapseAllAriaLabel: '',
|
|
@@ -1334,43 +1334,10 @@ exports[`Collapsible nested table 1`] = `
|
|
|
1334
1334
|
data-ouia-safe="true"
|
|
1335
1335
|
>
|
|
1336
1336
|
<th
|
|
1337
|
-
class="
|
|
1337
|
+
class=""
|
|
1338
1338
|
data-key="0"
|
|
1339
1339
|
data-label=""
|
|
1340
|
-
|
|
1341
|
-
>
|
|
1342
|
-
<button
|
|
1343
|
-
aria-disabled="false"
|
|
1344
|
-
aria-expanded="false"
|
|
1345
|
-
aria-label="Expand all rows"
|
|
1346
|
-
aria-labelledby="simple-node-1 expandable-toggle-1"
|
|
1347
|
-
class="pf-c-button pf-m-plain"
|
|
1348
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-10"
|
|
1349
|
-
data-ouia-component-type="PF4/Button"
|
|
1350
|
-
data-ouia-safe="true"
|
|
1351
|
-
id="expandable-toggle-1"
|
|
1352
|
-
type="button"
|
|
1353
|
-
>
|
|
1354
|
-
<div
|
|
1355
|
-
class="pf-c-table__toggle-icon"
|
|
1356
|
-
>
|
|
1357
|
-
<svg
|
|
1358
|
-
aria-hidden="true"
|
|
1359
|
-
fill="currentColor"
|
|
1360
|
-
height="1em"
|
|
1361
|
-
role="img"
|
|
1362
|
-
style="vertical-align: -0.125em;"
|
|
1363
|
-
viewBox="0 0 320 512"
|
|
1364
|
-
width="1em"
|
|
1365
|
-
>
|
|
1366
|
-
<path
|
|
1367
|
-
d="M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"
|
|
1368
|
-
/>
|
|
1369
|
-
</svg>
|
|
1370
|
-
</div>
|
|
1371
|
-
</button>
|
|
1372
|
-
|
|
1373
|
-
</th>
|
|
1340
|
+
/>
|
|
1374
1341
|
<th
|
|
1375
1342
|
aria-sort="none"
|
|
1376
1343
|
class="pf-c-table__sort"
|
|
@@ -1464,7 +1431,7 @@ exports[`Collapsible nested table 1`] = `
|
|
|
1464
1431
|
aria-label="Details"
|
|
1465
1432
|
aria-labelledby="simple-node0 expandable-toggle0"
|
|
1466
1433
|
class="pf-c-button pf-m-plain"
|
|
1467
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-
|
|
1434
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-9"
|
|
1468
1435
|
data-ouia-component-type="PF4/Button"
|
|
1469
1436
|
data-ouia-safe="true"
|
|
1470
1437
|
id="expandable-toggle0"
|
|
@@ -1546,7 +1513,7 @@ exports[`Collapsible nested table 1`] = `
|
|
|
1546
1513
|
aria-label="Details"
|
|
1547
1514
|
aria-labelledby="simple-node1 expandable-toggle1"
|
|
1548
1515
|
class="pf-c-button pf-m-plain pf-m-expanded"
|
|
1549
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-
|
|
1516
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-10"
|
|
1550
1517
|
data-ouia-component-type="PF4/Button"
|
|
1551
1518
|
data-ouia-safe="true"
|
|
1552
1519
|
id="expandable-toggle1"
|
|
@@ -1693,7 +1660,7 @@ exports[`Collapsible nested table 1`] = `
|
|
|
1693
1660
|
aria-label="Details"
|
|
1694
1661
|
aria-labelledby="simple-node3 expandable-toggle3"
|
|
1695
1662
|
class="pf-c-button pf-m-plain"
|
|
1696
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-
|
|
1663
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-11"
|
|
1697
1664
|
data-ouia-component-type="PF4/Button"
|
|
1698
1665
|
data-ouia-safe="true"
|
|
1699
1666
|
id="expandable-toggle3"
|
|
@@ -2059,43 +2026,10 @@ exports[`Collapsible table 1`] = `
|
|
|
2059
2026
|
data-ouia-safe="true"
|
|
2060
2027
|
>
|
|
2061
2028
|
<th
|
|
2062
|
-
class="
|
|
2029
|
+
class=""
|
|
2063
2030
|
data-key="0"
|
|
2064
2031
|
data-label=""
|
|
2065
|
-
|
|
2066
|
-
>
|
|
2067
|
-
<button
|
|
2068
|
-
aria-disabled="false"
|
|
2069
|
-
aria-expanded="false"
|
|
2070
|
-
aria-label="Expand all rows"
|
|
2071
|
-
aria-labelledby="simple-node-1 expandable-toggle-1"
|
|
2072
|
-
class="pf-c-button pf-m-plain"
|
|
2073
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-7"
|
|
2074
|
-
data-ouia-component-type="PF4/Button"
|
|
2075
|
-
data-ouia-safe="true"
|
|
2076
|
-
id="expandable-toggle-1"
|
|
2077
|
-
type="button"
|
|
2078
|
-
>
|
|
2079
|
-
<div
|
|
2080
|
-
class="pf-c-table__toggle-icon"
|
|
2081
|
-
>
|
|
2082
|
-
<svg
|
|
2083
|
-
aria-hidden="true"
|
|
2084
|
-
fill="currentColor"
|
|
2085
|
-
height="1em"
|
|
2086
|
-
role="img"
|
|
2087
|
-
style="vertical-align: -0.125em;"
|
|
2088
|
-
viewBox="0 0 320 512"
|
|
2089
|
-
width="1em"
|
|
2090
|
-
>
|
|
2091
|
-
<path
|
|
2092
|
-
d="M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"
|
|
2093
|
-
/>
|
|
2094
|
-
</svg>
|
|
2095
|
-
</div>
|
|
2096
|
-
</button>
|
|
2097
|
-
|
|
2098
|
-
</th>
|
|
2032
|
+
/>
|
|
2099
2033
|
<th
|
|
2100
2034
|
aria-sort="none"
|
|
2101
2035
|
class="pf-c-table__sort"
|
|
@@ -2189,7 +2123,7 @@ exports[`Collapsible table 1`] = `
|
|
|
2189
2123
|
aria-label="Details"
|
|
2190
2124
|
aria-labelledby="simple-node0 expandable-toggle0"
|
|
2191
2125
|
class="pf-c-button pf-m-plain pf-m-expanded"
|
|
2192
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-
|
|
2126
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-7"
|
|
2193
2127
|
data-ouia-component-type="PF4/Button"
|
|
2194
2128
|
data-ouia-safe="true"
|
|
2195
2129
|
id="expandable-toggle0"
|
|
@@ -2385,7 +2319,7 @@ exports[`Collapsible table 1`] = `
|
|
|
2385
2319
|
aria-label="Details"
|
|
2386
2320
|
aria-labelledby="simple-node3 expandable-toggle3"
|
|
2387
2321
|
class="pf-c-button pf-m-plain"
|
|
2388
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-
|
|
2322
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-8"
|
|
2389
2323
|
data-ouia-component-type="PF4/Button"
|
|
2390
2324
|
data-ouia-safe="true"
|
|
2391
2325
|
id="expandable-toggle3"
|
|
@@ -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
|
-
|
|
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`.
|