Denys Vuika fd729e76c0 [ADF-3053] breadcrumb fixes (#3406)
* translate breadcrumb root in demo shell

* optional "max items" feature and style fixes

* should not be restricted by default

* style updates

* toolbar and breadcrumb layout fixes

* breadcrumb demo and testing page

* full toolbar scenario

* fix translation issue with the dropdown and custom root

* a11y fixes

* fix issue with duplicate id, remove unused attribute
2018-05-25 21:42:24 +02:00

58 lines
1.9 KiB
HTML

<nav *ngIf="folderNode" data-automation-id="breadcrumb" class="adf-breadcrumb-container" role="list">
<button
*ngIf="hasPreviousNodes()"
tabindex="0"
class="adf-breadcrumb-dropdown-trigger"
(click)="open()">
<div class="adf-breadcrumb-dropdown-trigger-icon">
<mat-icon [class.isRoot]="!hasPreviousNodes()">folder</mat-icon>
<mat-icon [class.isRoot]="!hasPreviousNodes()" class="adf-breadcrumb-dropdown-trigger-arrow">arrow_drop_down</mat-icon>
</div>
</button>
<mat-select
#dropdown
*ngIf="hasPreviousNodes()"
class="adf-breadcrumb-dropdown-path"
tabindex="0">
<mat-option
*ngFor="let node of previousNodes;"
(click)="onRoutePathClick(node, $event)"
class="adf-breadcrumb-path-option"
tabindex="0">
{{ node.name | translate }}
</mat-option>
</mat-select>
<div *ngFor="let item of lastNodes; let last = last"
[class.active]="last"
[ngSwitch]="last"
title="{{ item.name | translate }}"
class="adf-breadcrumb-item"
role="listitem">
<a *ngSwitchDefault href="#" [attr.data-automation-id]="'breadcrumb_' + item.name"
class="adf-breadcrumb-item-anchor"
(click)="onRoutePathClick(item, $event)">
{{ item.name | translate }}
</a>
<div *ngSwitchCase="true" class="adf-breadcrumb-item-current">
{{ item.name | translate }}
</div>
<mat-icon class="adf-breadcrumb-item-chevron" *ngIf="!last">
chevron_right
</mat-icon>
</div>
</nav>
<nav *ngIf="!folderNode && hasRoot" data-automation-id="breadcrumb" role="navigation">
<div class="adf-breadcrumb-item active" role="listitem">
<div class="adf-breadcrumb-item-current">
{{ root | translate }}
</div>
</div>
</nav>