42 lines
1.1 KiB
HTML
42 lines
1.1 KiB
HTML
<div (mouseleave)="hideDD()">
|
|
|
|
<div class="header">
|
|
<a class="toggle" [class.active]="ddVisible" (click)="toggleDD()">
|
|
<ico ico="plus_filled_24" [color]="ddVisible?'var(--active)':null" [size]="24"></ico>
|
|
<span [style.color]="ddVisible?'var(--active)':null">Добавить элемент</span>
|
|
<drop-down [visible]="ddVisible" [target]="menu"></drop-down>
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="menu" #menu>
|
|
<div *ngFor="let type of types" class="block">
|
|
|
|
<div *ngIf="type?.children?.data?.length > 0; else addItem">
|
|
|
|
<a class="item" (click)="subClick(type)">
|
|
{{type.title}}
|
|
<drop-down [visible]="type.showChilren" [target]="submenu"></drop-down>
|
|
</a>
|
|
<div #submenu>
|
|
<div *ngFor="let childrenType of type?.children?.data" class="block"
|
|
(click)="add(childrenType.name)">
|
|
<div [innerText]="childrenType.title" class="item"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<ng-template #addItem>
|
|
<div (click)="add(type.name)">
|
|
<div [innerText]="type.title" class="item"></div>
|
|
</div>
|
|
</ng-template>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|