@@ -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