You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* For example, the input data of type `T` is nested, and contains its children data:
21
+
*
22
+
* 例如,类型为 `T` 的输入数据是嵌套的,并包含其子数据:
23
+
*
19
24
* SomeNode: {
20
25
* key: 'Fruits',
21
26
* children: [
@@ -27,7 +32,11 @@ import {map, take} from 'rxjs/operators';
27
32
* }
28
33
* ]
29
34
* }
35
+
*
30
36
* After flattener flatten the tree, the structure will become
37
+
*
38
+
* 当展平之后,其结构变为:
39
+
*
31
40
* SomeNode: {
32
41
* key: 'Fruits',
33
42
* expandable: true,
@@ -43,9 +52,9 @@ import {map, take} from 'rxjs/operators';
43
52
* expandable: false,
44
53
* level: 2
45
54
* }
55
+
*
46
56
* and the output flattened type is `F` with additional information.
47
57
*
48
-
* For example, the input data of type `T` is nested, and contains its children data: SomeNode: { key: 'Fruits', children: \[ NodeOne: { key: 'Apple', }, NodeTwo: { key: 'Pear', } ] } After flattener flatten the tree, the structure will become SomeNode: { key: 'Fruits', expandable: true, level: 1 }, NodeOne: { key: 'Apple', expandable: false, level: 2 }, NodeTwo: { key: 'Pear', expandable: false, level: 2 } and the output flattened type is `F` with additional information.
49
58
*
50
59
*/
51
60
exportclassMatTreeFlattener<T,F,K=F>{
@@ -89,6 +98,9 @@ export class MatTreeFlattener<T, F, K = F> {
89
98
* Flatten a list of node type T to flattened version of node F.
90
99
* Please note that type T may be nested, and the length of `structuredData` may be different
91
100
* from that of returned list `F[]`.
101
+
*
102
+
* 将节点类型为 T 的列表展平为节点类型为 F 的展平版本。请注意,类型 T 可能是嵌套的,而 `structuredData` 的长度可能与返回列表 `F[]` 的长度不同。
103
+
*
92
104
*/
93
105
flattenNodes(structuredData: T[]): F[]{
94
106
letresultNodes: F[]=[];
@@ -99,6 +111,9 @@ export class MatTreeFlattener<T, F, K = F> {
99
111
/**
100
112
* Expand flattened node with current expansion status.
0 commit comments