(node: GridNode<T>)
| 201 | |
| 202 | // Update each grid node in the treegrid table with values specific to a treegrid structure. Also store a set of flattened row nodes for TableCollection to consume |
| 203 | let visitNode = (node: GridNode<T>) => { |
| 204 | if (node.type === 'item') { |
| 205 | flattenedRows.push(node); |
| 206 | } |
| 207 | |
| 208 | keyMap.set(node.key, node); |
| 209 | |
| 210 | for (let child of node.childNodes) { |
| 211 | if (!(child.type === 'item' && expandedKeys !== 'all' && !expandedKeys.has(node.key))) { |
| 212 | if (child.type === 'item') { |
| 213 | visitNode(child); |
| 214 | } else { |
| 215 | // We enforce that the cells come before rows so can just reuse cell index |
| 216 | visitNode(child); |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | }; |
| 221 | |
| 222 | for (let node of topLevelRows) { |
| 223 | visitNode(node as GridNode<T>); |
no test coverage detected