@patternfly/react-table 4.112.12 → 4.112.13

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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 4.112.13 (2023-01-06)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **TableComposable:** Fixed parent checkbox behavior ([#8490](https://github.com/patternfly/patternfly-react/issues/8490)) ([0be8ea8](https://github.com/patternfly/patternfly-react/commit/0be8ea8ce5c718f28ced02f32940404aff58d180))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [4.112.12](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@4.112.11...@patternfly/react-table@4.112.12) (2023-01-06)
7
18
 
8
19
  **Note:** Version bump only for package @patternfly/react-table
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-table",
3
- "version": "4.112.12",
3
+ "version": "4.112.13",
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",
@@ -54,5 +54,5 @@
54
54
  "react": "^16.8 || ^17 || ^18",
55
55
  "react-dom": "^16.8 || ^17 || ^18"
56
56
  },
57
- "gitHead": "a8d0266963a7cb1b09500077cb5131401e4abca5"
57
+ "gitHead": "7203503cdb89f84c750b5cb98afec69ff5edfb49"
58
58
  }
@@ -233,8 +233,6 @@ export type OnExpand = (
233
233
  ```ts file="ComposableTableControllingText.tsx"
234
234
  ```
235
235
 
236
- #### TODO: distinguish between the use cases for modifier on Td vs on TableText?
237
-
238
236
  ### Composable: Modifiers with table text
239
237
 
240
238
  ```ts file="ComposableTableTextModifiers.tsx"
@@ -88,8 +88,18 @@ export const ComposableTableTree: React.FunctionComponent = () => {
88
88
  const [expandedDetailsNodeNames, setExpandedDetailsNodeNames] = React.useState<string[]>([]);
89
89
  const [selectedNodeNames, setSelectedNodeNames] = React.useState<string[]>([]);
90
90
 
91
- const getDescendants = (node: RepositoriesTreeNode): RepositoriesTreeNode[] =>
92
- [node].concat(...(node.children ? node.children.map(getDescendants) : []));
91
+ const getDescendants = (node: RepositoriesTreeNode): RepositoriesTreeNode[] => {
92
+ if (!node.children || !node.children.length) {
93
+ return [node];
94
+ } else {
95
+ let children: RepositoriesTreeNode[] = [];
96
+ node.children.forEach(child => {
97
+ children = [...children, ...getDescendants(child)];
98
+ });
99
+ return children;
100
+ }
101
+ };
102
+
93
103
  const areAllDescendantsSelected = (node: RepositoriesTreeNode) =>
94
104
  getDescendants(node).every(n => selectedNodeNames.includes(n.name));
95
105
  const areSomeDescendantsSelected = (node: RepositoriesTreeNode) =>