Skip to content

Commit fbb05b5

Browse files
committed
main - 52cad9c docs(cdk/tree): fix several live example issues (#29875)
1 parent 4614bd8 commit fbb05b5

22 files changed

+108
-64
lines changed

cdk/tree/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export declare class CdkTreeFlatLevelAccessorExample {
7777
}
7878

7979
/**
80-
* @title Tree with nested nodes, using childAccessor
80+
* @title Tree with nested nodes using childAccessor
8181
*/
8282
export declare class CdkTreeNestedChildrenAccessorExample {
8383
tree: CdkTree<NestedFoodNode>;
@@ -102,7 +102,7 @@ export declare class CdkTreeNestedExample {
102102
}
103103

104104
/**
105-
* @title Tree with nested nodes
105+
* @title Tree with nested nodes and level accessor
106106
*/
107107
export declare class CdkTreeNestedLevelAccessorExample {
108108
tree: CdkTree<FlatFoodNode>;

docs-content/examples-highlighted/cdk/tree/cdk-tree-nested-children-accessor/cdk-tree-nested-children-accessor-example-css.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@
1616
<span class="hljs-selector-class">.example-tree-node</span> <span class="hljs-selector-class">.example-tree-node</span> {
1717
<span class="hljs-attribute">padding-left</span>: <span class="hljs-number">40px</span>;
1818
}
19+
20+
<span class="hljs-selector-class">.example-toggle</span> {
21+
<span class="hljs-attribute">vertical-align</span>: middle;
22+
}

docs-content/examples-highlighted/cdk/tree/cdk-tree-nested-children-accessor/cdk-tree-nested-children-accessor-example-html.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
<span class="hljs-tag">&lt;/<span class="hljs-name">cdk-nested-tree-node</span>&gt;</span>
99
<span class="hljs-comment">&lt;!-- This is the tree node template for expandable nodes --&gt;</span>
1010
<span class="hljs-tag">&lt;<span class="hljs-name">cdk-nested-tree-node</span> #<span class="hljs-attr">treeNode</span>=<span class="hljs-string">&quot;cdkNestedTreeNode&quot;</span>
11-
<span class="hljs-attr">cdkTreeNodeToggle</span>
12-
*<span class="hljs-attr">cdkTreeNodeDef</span>=<span class="hljs-string">&quot;let node; when: hasChild&quot;</span>
13-
[<span class="hljs-attr">cdkTreeNodeTypeaheadLabel</span>]=<span class="hljs-string">&quot;node.name&quot;</span>
14-
<span class="hljs-attr">isExpandable</span>
15-
<span class="hljs-attr">class</span>=<span class="hljs-string">&quot;example-tree-node&quot;</span>&gt;</span>
16-
<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">mat-icon-button</span> [<span class="hljs-attr">attr.aria-label</span>]=<span class="hljs-string">&quot;&#x27;Toggle &#x27; + node.name&quot;</span> <span class="hljs-attr">cdkTreeNodeToggle</span>&gt;</span>
11+
*<span class="hljs-attr">cdkTreeNodeDef</span>=<span class="hljs-string">&quot;let node; when: hasChild&quot;</span>
12+
[<span class="hljs-attr">cdkTreeNodeTypeaheadLabel</span>]=<span class="hljs-string">&quot;node.name&quot;</span>
13+
<span class="hljs-attr">isExpandable</span>
14+
<span class="hljs-attr">class</span>=<span class="hljs-string">&quot;example-tree-node&quot;</span>&gt;</span>
15+
<span class="hljs-tag">&lt;<span class="hljs-name">button</span>
16+
<span class="hljs-attr">mat-icon-button</span>
17+
<span class="hljs-attr">class</span>=<span class="hljs-string">&quot;example-toggle&quot;</span>
18+
[<span class="hljs-attr">attr.aria-label</span>]=<span class="hljs-string">&quot;&#x27;Toggle &#x27; + node.name&quot;</span>
19+
<span class="hljs-attr">cdkTreeNodeToggle</span>&gt;</span>
1720
<span class="hljs-tag">&lt;<span class="hljs-name">mat-icon</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;mat-icon-rtl-mirror&quot;</span>&gt;</span>
1821
{{tree.isExpanded(node) ? &#x27;expand_more&#x27; : &#x27;chevron_right&#x27;}}
1922
<span class="hljs-tag">&lt;/<span class="hljs-name">mat-icon</span>&gt;</span>

docs-content/examples-highlighted/cdk/tree/cdk-tree-nested-children-accessor/cdk-tree-nested-children-accessor-example-ts.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818

1919
<span class="hljs-comment">/**
20-
* <span class="hljs-doctag">@title </span>Tree with nested nodes, using childAccessor
20+
* <span class="hljs-doctag">@title </span>Tree with nested nodes using childAccessor
2121
*/</span>
2222
<span class="hljs-meta">@Component</span>({
2323
<span class="hljs-attr">selector</span>: <span class="hljs-string">&#x27;cdk-tree-nested-children-accessor-example&#x27;</span>,

docs-content/examples-highlighted/cdk/tree/cdk-tree-nested-level-accessor/cdk-tree-nested-level-accessor-example-css.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@
1616
<span class="hljs-selector-class">.example-tree-node</span> <span class="hljs-selector-class">.example-tree-node</span> {
1717
<span class="hljs-attribute">padding-left</span>: <span class="hljs-number">40px</span>;
1818
}
19+
20+
<span class="hljs-selector-class">.example-toggle</span> {
21+
<span class="hljs-attribute">vertical-align</span>: middle;
22+
}

docs-content/examples-highlighted/cdk/tree/cdk-tree-nested-level-accessor/cdk-tree-nested-level-accessor-example-html.html

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
{{node.name}}
88
<span class="hljs-tag">&lt;/<span class="hljs-name">cdk-nested-tree-node</span>&gt;</span>
99
<span class="hljs-comment">&lt;!-- This is the tree node template for expandable nodes --&gt;</span>
10-
<span class="hljs-tag">&lt;<span class="hljs-name">cdk-nested-tree-node</span> #<span class="hljs-attr">treeNode</span>=<span class="hljs-string">&quot;cdkNestedTreeNode&quot;</span>
11-
<span class="hljs-attr">cdkTreeNodeToggle</span>
12-
[<span class="hljs-attr">cdkTreeNodeTypeaheadLabel</span>]=<span class="hljs-string">&quot;node.name&quot;</span>
13-
*<span class="hljs-attr">cdkTreeNodeDef</span>=<span class="hljs-string">&quot;let node; when: hasChild&quot;</span>
14-
<span class="hljs-attr">isExpandable</span>
15-
<span class="hljs-attr">class</span>=<span class="hljs-string">&quot;example-tree-node&quot;</span>&gt;</span>
16-
<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">mat-icon-button</span> [<span class="hljs-attr">attr.aria-label</span>]=<span class="hljs-string">&quot;&#x27;Toggle &#x27; + node.name&quot;</span> <span class="hljs-attr">cdkTreeNodeToggle</span>&gt;</span>
10+
<span class="hljs-tag">&lt;<span class="hljs-name">cdk-nested-tree-node</span>
11+
#<span class="hljs-attr">treeNode</span>=<span class="hljs-string">&quot;cdkNestedTreeNode&quot;</span>
12+
[<span class="hljs-attr">cdkTreeNodeTypeaheadLabel</span>]=<span class="hljs-string">&quot;node.name&quot;</span>
13+
*<span class="hljs-attr">cdkTreeNodeDef</span>=<span class="hljs-string">&quot;let node; when: hasChild&quot;</span>
14+
<span class="hljs-attr">isExpandable</span>
15+
<span class="hljs-attr">class</span>=<span class="hljs-string">&quot;example-tree-node&quot;</span>&gt;</span>
16+
<span class="hljs-tag">&lt;<span class="hljs-name">button</span>
17+
<span class="hljs-attr">mat-icon-button</span>
18+
<span class="hljs-attr">class</span>=<span class="hljs-string">&quot;example-toggle&quot;</span>
19+
[<span class="hljs-attr">attr.aria-label</span>]=<span class="hljs-string">&quot;&#x27;Toggle &#x27; + node.name&quot;</span>
20+
<span class="hljs-attr">cdkTreeNodeToggle</span>&gt;</span>
1721
<span class="hljs-tag">&lt;<span class="hljs-name">mat-icon</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;mat-icon-rtl-mirror&quot;</span>&gt;</span>
1822
{{tree.isExpanded(node) ? &#x27;expand_more&#x27; : &#x27;chevron_right&#x27;}}
1923
<span class="hljs-tag">&lt;/<span class="hljs-name">mat-icon</span>&gt;</span>

docs-content/examples-highlighted/cdk/tree/cdk-tree-nested-level-accessor/cdk-tree-nested-level-accessor-example-ts.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<span class="hljs-keyword">import</span> {FLAT_DATA, FlatFoodNode} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;../tree-data&#x27;</span>;
77

88
<span class="hljs-comment">/**
9-
* <span class="hljs-doctag">@title </span>Tree with nested nodes
9+
* <span class="hljs-doctag">@title </span>Tree with nested nodes and level accessor
1010
*/</span>
1111
<span class="hljs-meta">@Component</span>({
1212
<span class="hljs-attr">selector</span>: <span class="hljs-string">&#x27;cdk-tree-nested-level-accessor-example&#x27;</span>,

docs-content/examples-highlighted/cdk/tree/cdk-tree-nested/cdk-tree-nested-example-css.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@
1515
<span class="hljs-selector-class">.example-tree-node</span> <span class="hljs-selector-class">.example-tree-node</span> {
1616
<span class="hljs-attribute">padding-left</span>: <span class="hljs-number">40px</span>;
1717
}
18+
19+
<span class="hljs-selector-class">.example-toggle</span> {
20+
<span class="hljs-attribute">vertical-align</span>: middle;
21+
}

docs-content/examples-highlighted/cdk/tree/cdk-tree-nested/cdk-tree-nested-example-html.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
<span class="hljs-tag">&lt;/<span class="hljs-name">cdk-nested-tree-node</span>&gt;</span>
99
<span class="hljs-comment">&lt;!-- This is the tree node template for expandable nodes --&gt;</span>
1010
<span class="hljs-tag">&lt;<span class="hljs-name">cdk-nested-tree-node</span> #<span class="hljs-attr">treeNode</span>=<span class="hljs-string">&quot;cdkNestedTreeNode&quot;</span>
11-
<span class="hljs-attr">cdkTreeNodeToggle</span>
12-
[<span class="hljs-attr">cdkTreeNodeTypeaheadLabel</span>]=<span class="hljs-string">&quot;node.name&quot;</span>
13-
*<span class="hljs-attr">cdkTreeNodeDef</span>=<span class="hljs-string">&quot;let node; when: hasChild&quot;</span>
14-
<span class="hljs-attr">isExpandable</span>
15-
<span class="hljs-attr">class</span>=<span class="hljs-string">&quot;example-tree-node&quot;</span>&gt;</span>
16-
<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">mat-icon-button</span> [<span class="hljs-attr">attr.aria-label</span>]=<span class="hljs-string">&quot;&#x27;Toggle &#x27; + node.name&quot;</span> <span class="hljs-attr">cdkTreeNodeToggle</span>&gt;</span>
11+
[<span class="hljs-attr">cdkTreeNodeTypeaheadLabel</span>]=<span class="hljs-string">&quot;node.name&quot;</span>
12+
*<span class="hljs-attr">cdkTreeNodeDef</span>=<span class="hljs-string">&quot;let node; when: hasChild&quot;</span>
13+
<span class="hljs-attr">isExpandable</span>
14+
<span class="hljs-attr">class</span>=<span class="hljs-string">&quot;example-tree-node&quot;</span>&gt;</span>
15+
<span class="hljs-tag">&lt;<span class="hljs-name">button</span>
16+
<span class="hljs-attr">mat-icon-button</span>
17+
<span class="hljs-attr">class</span>=<span class="hljs-string">&quot;example-toggle&quot;</span>
18+
[<span class="hljs-attr">attr.aria-label</span>]=<span class="hljs-string">&quot;&#x27;Toggle &#x27; + node.name&quot;</span>
19+
<span class="hljs-attr">cdkTreeNodeToggle</span>&gt;</span>
1720
<span class="hljs-tag">&lt;<span class="hljs-name">mat-icon</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;mat-icon-rtl-mirror&quot;</span>&gt;</span>
1821
{{treeControl.isExpanded(node) ? &#x27;expand_more&#x27; : &#x27;chevron_right&#x27;}}
1922
<span class="hljs-tag">&lt;/<span class="hljs-name">mat-icon</span>&gt;</span>

docs-content/examples-source/cdk/tree/cdk-tree-nested-children-accessor/cdk-tree-nested-children-accessor-example.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@
1616
.example-tree-node .example-tree-node {
1717
padding-left: 40px;
1818
}
19+
20+
.example-toggle {
21+
vertical-align: middle;
22+
}

0 commit comments

Comments
 (0)