Files
alfresco-content-app/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.html
MichalKinas 3e44f46575 [ACS-3552] Accessibility fixes for CSV file issues (#2705)
* [ACS-3552] Accessibility fixes for CSV file issues

* [ACS-3552] Fix tabindex attribute values
2022-10-11 23:46:10 +01:00

39 lines
1.4 KiB
HTML

<ng-container [ngSwitch]="actionRef.type">
<ng-container *ngSwitchCase="'menu'">
<button [id]="actionRef.id" mat-menu-item role="menuitem" tabindex="0" [disabled]="actionRef.disabled" [matMenuTriggerFor]="childMenu">
<adf-icon [value]="actionRef.icon"></adf-icon>
<span data-automation-id="menu-item-title">{{ actionRef.title | translate }}</span>
</button>
<mat-menu #childMenu="matMenu" class="app-create-menu__sub-menu">
<ng-container *ngFor="let child of actionRef.children; trackBy: trackByActionId">
<app-toolbar-menu-item [actionRef]="child"></app-toolbar-menu-item>
</ng-container>
</mat-menu>
</ng-container>
<ng-container *ngSwitchCase="'separator'">
<mat-divider></mat-divider>
</ng-container>
<ng-container *ngSwitchCase="'custom'">
<adf-dynamic-component [id]="actionRef.component"></adf-dynamic-component>
</ng-container>
<ng-container *ngSwitchDefault>
<button
[id]="actionRef.id"
role="menuitem"
mat-menu-item
[role]="'menuitem'"
tabindex="0"
[disabled]="actionRef.disabled"
[attr.title]="(actionRef.disabled ? actionRef['description-disabled'] : actionRef.description || actionRef.title) | translate"
(click)="runAction()"
>
<adf-icon [value]="actionRef.icon"></adf-icon>
<span data-automation-id="menu-item-title">{{ actionRef.title | translate }}</span>
</button>
</ng-container>
</ng-container>