Skip to content

Commit e641b49

Browse files
committed
feat(cdk/tree): deprecate the TreeControl APIs
1 parent 86d36db commit e641b49

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

src/cdk/tree/control/base-tree-control.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ import {SelectionModel} from '@angular/cdk/collections';
99
import {Observable} from 'rxjs';
1010
import {TreeControl} from './tree-control';
1111

12-
/** Base tree control. It has basic toggle/expand/collapse operations on a single data node. */
12+
/**
13+
* Base tree control. It has basic toggle/expand/collapse operations on a single data node.
14+
*
15+
* @deprecated Use one of levelAccessor or childrenAccessor
16+
*/
1317
export abstract class BaseTreeControl<T, K = T> implements TreeControl<T, K> {
1418
/** Gets a list of descendent data nodes of a subtree rooted at given data node recursively. */
1519
abstract getDescendants(dataNode: T): T[];

src/cdk/tree/control/flat-tree-control.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ export interface FlatTreeControlOptions<T, K> {
1313
trackBy?: (dataNode: T) => K;
1414
}
1515

16-
/** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */
16+
/**
17+
* Flat tree control. Able to expand/collapse a subtree recursively for flattened tree.
18+
*
19+
* @deprecated Use one of levelAccessor or childrenAccessor
20+
*/
1721
export class FlatTreeControl<T, K = T> extends BaseTreeControl<T, K> {
1822
/** Construct with flat tree data node functions getLevel and isExpandable. */
1923
constructor(

src/cdk/tree/control/nested-tree-control.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ export interface NestedTreeControlOptions<T, K> {
1414
trackBy?: (dataNode: T) => K;
1515
}
1616

17-
/** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */
17+
/**
18+
* Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type.
19+
*
20+
* @deprecated Use one of levelAccessor or childrenAccessor
21+
*/
1822
export class NestedTreeControl<T, K = T> extends BaseTreeControl<T, K> {
1923
/** Construct with nested tree function getChildren. */
2024
constructor(

src/cdk/tree/control/tree-control.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {Observable} from 'rxjs';
1212
* Tree control interface. User can implement TreeControl to expand/collapse dataNodes in the tree.
1313
* The CDKTree will use this TreeControl to expand/collapse a node.
1414
* User can also use it outside the `<cdk-tree>` to control the expansion status of the tree.
15+
*
16+
* @deprecated Use one of levelAccessor or childrenAccessor
1517
*/
1618
export interface TreeControl<T, K = T> {
1719
/** The saved tree nodes data for `expandAll` action. */

0 commit comments

Comments
 (0)