22 lines
1.3 KiB
HTML
22 lines
1.3 KiB
HTML
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" (contextmenu)="onContextMenu($event)">
|
|
<!-- This is the tree node template for leaf nodes -->
|
|
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding matTreeNodePaddingIndent="10" [ngClass]="selectedGamesystem === node ? 'selected-node':''"
|
|
(click)="onSelectGamesystem(node)" (contextmenu)="onSelectGamesystem(node)" (dblclick)="openGamesystemEditor(node)">
|
|
<!-- use a disabled button to provide padding for tree leaf -->
|
|
<button mat-icon-button class="small-icon-button" [disabled]="true"></button>
|
|
{{node.name}}
|
|
</mat-tree-node>
|
|
<!-- This is the tree node template for expandable nodes -->
|
|
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding matTreeNodePaddingIndent="10"
|
|
(click)="onSelectGamesystem(node)" (contextmenu)="onSelectGamesystem(node)" [ngClass]="selectedGamesystem === node ? 'selected-node':''"
|
|
(dblclick)="openGamesystemEditor(node)">
|
|
<button mat-icon-button matTreeNodeToggle
|
|
[attr.aria-label]="'Toggle ' + node.name" class="small-icon-button">
|
|
<mat-icon class="mat-icon-rtl-mirror">
|
|
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
|
|
</mat-icon>
|
|
</button>
|
|
{{node.name}}
|
|
</mat-tree-node>
|
|
</mat-tree>
|