@patternfly/react-table 4.91.11 → 4.91.14
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/utils/decorators/collapsible.d.ts +1 -1
- package/dist/esm/components/Table/utils/decorators/collapsible.d.ts.map +1 -1
- package/dist/esm/components/Table/utils/decorators/collapsible.js +2 -3
- package/dist/esm/components/Table/utils/decorators/collapsible.js.map +1 -1
- package/dist/esm/components/Table/utils/headerUtils.d.ts +1 -0
- package/dist/esm/components/Table/utils/headerUtils.d.ts.map +1 -1
- package/dist/esm/components/Table/utils/headerUtils.js +2 -2
- package/dist/esm/components/Table/utils/headerUtils.js.map +1 -1
- package/dist/js/components/Table/utils/decorators/collapsible.d.ts +1 -1
- package/dist/js/components/Table/utils/decorators/collapsible.d.ts.map +1 -1
- package/dist/js/components/Table/utils/decorators/collapsible.js +2 -3
- package/dist/js/components/Table/utils/decorators/collapsible.js.map +1 -1
- package/dist/js/components/Table/utils/headerUtils.d.ts +1 -0
- package/dist/js/components/Table/utils/headerUtils.d.ts.map +1 -1
- package/dist/js/components/Table/utils/headerUtils.js +2 -2
- package/dist/js/components/Table/utils/headerUtils.js.map +1 -1
- package/dist/umd/react-table.css +52 -11
- package/dist/umd/react-table.js +7 -7
- package/dist/umd/react-table.min.css +52 -11
- package/dist/umd/react-table.min.js +1 -1
- package/package.json +6 -6
- package/src/components/Table/utils/decorators/collapsible.tsx +3 -3
- package/src/components/Table/utils/headerUtils.tsx +7 -2
- package/src/components/TableComposable/examples/ComposableTableExpandable.tsx +3 -3
- package/src/demos/Table.md +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "4.91.
|
|
3
|
+
"version": "4.91.14",
|
|
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.222.
|
|
35
|
-
"@patternfly/react-icons": "^4.73.
|
|
36
|
-
"@patternfly/react-styles": "^4.72.
|
|
37
|
-
"@patternfly/react-tokens": "^4.74.
|
|
34
|
+
"@patternfly/react-core": "^4.222.14",
|
|
35
|
+
"@patternfly/react-icons": "^4.73.14",
|
|
36
|
+
"@patternfly/react-styles": "^4.72.14",
|
|
37
|
+
"@patternfly/react-tokens": "^4.74.14",
|
|
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": "0d04c7d4c7970f2be7e485e1f4bd0bda94ee5d46"
|
|
50
50
|
}
|
|
@@ -71,7 +71,7 @@ export const expandable: IFormatter = (value: IFormatterValueType, { rowData }:
|
|
|
71
71
|
value
|
|
72
72
|
);
|
|
73
73
|
|
|
74
|
-
export const expandedRow = (colSpan?: number) => {
|
|
74
|
+
export const expandedRow = (colSpan?: number, additionalColSpan: number = 0) => {
|
|
75
75
|
const expandedRowFormatter = (
|
|
76
76
|
value: IFormatterValueType,
|
|
77
77
|
{
|
|
@@ -85,8 +85,8 @@ export const expandedRow = (colSpan?: number) => {
|
|
|
85
85
|
): decoratorReturnType =>
|
|
86
86
|
value &&
|
|
87
87
|
rowData.hasOwnProperty('parent') && {
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
colSpan:
|
|
89
|
+
!rowData.cells || rowData.cells.length === 1 ? colSpan + (rowData.fullWidth ? additionalColSpan + 1 : 0) : 1,
|
|
90
90
|
id: contentId + rowIndex + (columnIndex ? '-' + columnIndex : ''),
|
|
91
91
|
className: rowData.noPadding && css(styles.modifiers.noPadding)
|
|
92
92
|
};
|
|
@@ -211,6 +211,8 @@ const actionsTransforms = ({
|
|
|
211
211
|
export interface ICollapseTranform {
|
|
212
212
|
onCollapse: OnCollapse;
|
|
213
213
|
canCollapseAll: boolean;
|
|
214
|
+
// Account for additional added columns for full width
|
|
215
|
+
firstUserColumnIndex: number;
|
|
214
216
|
}
|
|
215
217
|
|
|
216
218
|
/**
|
|
@@ -220,13 +222,16 @@ export interface ICollapseTranform {
|
|
|
220
222
|
* @param {*} extraObject with onCollapse callback.
|
|
221
223
|
* @returns {*} object with empty title, tranforms - Array, cellTransforms - Array.
|
|
222
224
|
*/
|
|
223
|
-
const collapsibleTransforms = (
|
|
225
|
+
const collapsibleTransforms = (
|
|
226
|
+
header: (ICell | string)[],
|
|
227
|
+
{ onCollapse, canCollapseAll, firstUserColumnIndex }: ICollapseTranform
|
|
228
|
+
) => [
|
|
224
229
|
...(onCollapse
|
|
225
230
|
? [
|
|
226
231
|
{
|
|
227
232
|
title: '',
|
|
228
233
|
transforms: (canCollapseAll && [collapsible]) || null,
|
|
229
|
-
cellTransforms: [collapsible, expandedRow(header.length)]
|
|
234
|
+
cellTransforms: [collapsible, expandedRow(header.length, firstUserColumnIndex)]
|
|
230
235
|
}
|
|
231
236
|
]
|
|
232
237
|
: [])
|
|
@@ -141,14 +141,14 @@ export const ComposableTableExpandable: React.FunctionComponent = () => {
|
|
|
141
141
|
childIsFullWidth = [1, 3].includes(detailFormat);
|
|
142
142
|
childHasNoPadding = [2, 3].includes(detailFormat);
|
|
143
143
|
if (detail1 && !detail2 && !detail3) {
|
|
144
|
-
detail1Colspan = childIsFullWidth ? numColumns : numColumns + 1; // Account for toggle column
|
|
144
|
+
detail1Colspan = !childIsFullWidth ? numColumns : numColumns + 1; // Account for toggle column
|
|
145
145
|
} else if (detail1 && detail2 && !detail3) {
|
|
146
146
|
detail1Colspan = 2;
|
|
147
|
-
detail2Colspan = childIsFullWidth ? 3 : 4;
|
|
147
|
+
detail2Colspan = !childIsFullWidth ? 3 : 4;
|
|
148
148
|
} else if (detail1 && detail2 && detail3) {
|
|
149
149
|
detail1Colspan = 2;
|
|
150
150
|
detail2Colspan = 2;
|
|
151
|
-
detail3Colspan = childIsFullWidth ? 1 : 2;
|
|
151
|
+
detail3Colspan = !childIsFullWidth ? 1 : 2;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
return (
|
package/src/demos/Table.md
CHANGED
|
@@ -2332,6 +2332,8 @@ ComposableTableSortable = () => {
|
|
|
2332
2332
|
}
|
|
2333
2333
|
isPlain
|
|
2334
2334
|
isGrouped
|
|
2335
|
+
menuAppendTo='parent'
|
|
2336
|
+
isFlipEnabled
|
|
2335
2337
|
/>
|
|
2336
2338
|
</ToolbarItem>
|
|
2337
2339
|
<OverflowMenu breakpoint="lg">
|
|
@@ -2352,6 +2354,8 @@ ComposableTableSortable = () => {
|
|
|
2352
2354
|
toggle={<KebabToggle onToggle={() => setIsKebabDropdownOpen(!isKebabDropdownOpen)} />}
|
|
2353
2355
|
isOpen={isKebabDropdownOpen}
|
|
2354
2356
|
dropdownItems={kebabDropdownItems}
|
|
2357
|
+
isFlipEnabled
|
|
2358
|
+
menuAppendTo="parent"
|
|
2355
2359
|
/>
|
|
2356
2360
|
</OverflowMenuControl>
|
|
2357
2361
|
</OverflowMenu>
|