-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tree-select): add option to provide custom header
- Loading branch information
1 parent
37f13ee
commit 26c7e70
Showing
5 changed files
with
68 additions
and
27 deletions.
There are no files selected for viewing
57 changes: 32 additions & 25 deletions
57
projects/angular/components/ui-tree-select/src/ui-tree-select.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,37 @@ | ||
<cdk-virtual-scroll-viewport (keydown)="onKeydown($event)" | ||
class="virtual-scroll-container" | ||
[itemSize]="itemSize" | ||
tabindex="0"> | ||
<mat-list *uiContentLoading="loading" | ||
role="tree" | ||
class="tree-container"> | ||
<ng-container *ngIf="dataSource.data.length == 0"> | ||
<ng-content select="[noDataMessage]"></ng-content> | ||
</ng-container> | ||
<ng-container *cdkVirtualFor="let node of dataSource; let i = index; trackBy: trackById;"> | ||
<ui-tree-item (selected)="select(node)" | ||
(collapsed)="collapse(node)" | ||
(expanded)="expand(node)" | ||
[node]="node" | ||
[attr.nodekey]="node.key" | ||
[isSelected]="isSelected(node)"> | ||
<ng-template *ngIf="itemTemplate" | ||
[ngTemplateOutlet]="itemTemplate" | ||
[ngTemplateOutletContext]="{ | ||
<div cdkVirtualScrollingElement | ||
class="ui-tree-select-container"> | ||
<ng-template *ngIf="headerTemplate" | ||
[ngTemplateOutlet]="headerTemplate"> | ||
</ng-template> | ||
|
||
<cdk-virtual-scroll-viewport (keydown)="onKeydown($event)" | ||
[itemSize]="itemSize" | ||
class="virtual-scroll-container" | ||
tabindex="0"> | ||
<mat-list *uiContentLoading="loading" | ||
role="tree" | ||
class="tree-container"> | ||
<ng-container *ngIf="dataSource.data.length == 0"> | ||
<ng-content select="[noDataMessage]"></ng-content> | ||
</ng-container> | ||
<ng-container *cdkVirtualFor="let node of dataSource; let i = index; trackBy: trackById;"> | ||
<ui-tree-item (selected)="select(node)" | ||
(collapsed)="collapse(node)" | ||
(expanded)="expand(node)" | ||
[node]="node" | ||
[attr.nodekey]="node.key" | ||
[isSelected]="isSelected(node)"> | ||
<ng-template *ngIf="itemTemplate" | ||
[ngTemplateOutlet]="itemTemplate" | ||
[ngTemplateOutletContext]="{ | ||
node: node, | ||
expanded: isExpanded(node), | ||
selected: isSelected(node), | ||
toggle: toggle(node) | ||
}"> | ||
</ng-template> | ||
</ui-tree-item> | ||
</ng-container> | ||
</mat-list> | ||
</cdk-virtual-scroll-viewport> | ||
</ng-template> | ||
</ui-tree-item> | ||
</ng-container> | ||
</mat-list> | ||
</cdk-virtual-scroll-viewport> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters