Skip to content

Commit ed67a5f

Browse files
committed
fix(cdk/tree): fix build errors
1 parent 3701501 commit ed67a5f

File tree

2 files changed

+2
-34
lines changed

2 files changed

+2
-34
lines changed

src/cdk/tree/nested-node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class CdkNestedTreeNode<T, K = T>
9595
}
9696
if (outlet && this._children) {
9797
const viewContainer = outlet.viewContainer;
98-
this._tree._renderNodeChanges(this._children, this._dataDiffer, viewContainer, this._data);
98+
this._tree.renderNodeChanges(this._children, this._dataDiffer, viewContainer, this._data);
9999
} else {
100100
// Reset the data differ if there's no children nodes displayed
101101
this._dataDiffer.diff([]);

src/cdk/tree/tree.ts

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -706,25 +706,9 @@ export class CdkTree<T, K = T> implements AfterContentChecked, CollectionViewer,
706706
return group.indexOf(dataNode) + 1;
707707
}
708708

709-
/**
710-
* Adds the specified node component to the tree's internal registry.
711-
*
712-
* This primarily facilitates keyboard navigation.
713-
*/
714-
_registerNode(node: CdkTreeNode<T, K>) {
715-
this._nodes.value.set(this._trackExpansionKey(node.data), node);
716-
this._nodes.next(this._nodes.value);
717-
}
718-
719-
/** Removes the specified node component from the tree's internal registry. */
720-
_unregisterNode(node: CdkTreeNode<T, K>) {
721-
this._nodes.value.delete(this._trackExpansionKey(node.data));
722-
this._nodes.next(this._nodes.value);
723-
}
724-
725709
/** Given a CdkTreeNode, gets the node that renders that node's parent's data. */
726710
_getNodeParent(node: CdkTreeNode<T, K>) {
727-
const parent = this._parents.get(node.data);
711+
const parent = this._parents.get(this._getExpansionKey(node.data));
728712
return parent && this._nodes.value.get(this._getExpansionKey(parent));
729713
}
730714

@@ -832,22 +816,6 @@ export class CdkTree<T, K = T> implements AfterContentChecked, CollectionViewer,
832816
return this.expansionKey?.(dataNode) ?? (dataNode as unknown as K);
833817
}
834818

835-
private _flattenChildren(nodes: readonly T[]): Observable<readonly T[]> {
836-
// If we're using TreeControl or levelAccessor, we don't need to manually
837-
// flatten things here.
838-
if (!this.childrenAccessor) {
839-
return observableOf(nodes);
840-
} else {
841-
return observableOf(...nodes).pipe(
842-
concatMap(node => concat(observableOf([node]), this._getAllChildrenRecursively(node))),
843-
reduce((results, nodes) => {
844-
results.push(...nodes);
845-
return results;
846-
}, [] as T[]),
847-
);
848-
}
849-
}
850-
851819
private _getNodeGroup(node: T) {
852820
const level = this._levels.get(this._getExpansionKey(node));
853821
const parent = this._parents.get(this._getExpansionKey(node));

0 commit comments

Comments
 (0)