2020-04-23 17:58:04 +02:00
|
|
|
import {Component, Input} from "@angular/core";
|
|
|
|
|
|
|
|
export interface Breadcrumb {
|
|
|
|
name: string;
|
|
|
|
route?: string;
|
2022-08-29 15:30:12 +02:00
|
|
|
keepFormat?: boolean
|
2020-04-23 17:58:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'breadcrumbs',
|
|
|
|
template: `
|
2022-02-14 17:02:00 +01:00
|
|
|
<ul class="uk-breadcrumb uk-margin-remove-bottom" [ngClass]="addClass" [class.uk-light]="light">
|
2020-04-23 17:58:04 +02:00
|
|
|
<li *ngFor="let breadcrumb of breadcrumbs">
|
2022-08-29 15:30:12 +02:00
|
|
|
<a [class.uk-text-capitalize]="!breadcrumb.keepFormat" *ngIf="breadcrumb.route" [routerLink]="breadcrumb.route">{{breadcrumb.name}}</a>
|
|
|
|
<span [class.uk-text-capitalize]="!breadcrumb.keepFormat" *ngIf="!breadcrumb.route">{{breadcrumb.name}}</span>
|
2020-04-23 17:58:04 +02:00
|
|
|
</li>
|
|
|
|
</ul>`
|
|
|
|
})
|
|
|
|
export class BreadcrumbsComponent {
|
|
|
|
|
|
|
|
@Input() public light: boolean = false;
|
|
|
|
@Input() public breadcrumbs: Breadcrumb[] = [];
|
2020-04-28 12:46:23 +02:00
|
|
|
@Input() public addClass = "";
|
2020-04-27 10:14:05 +02:00
|
|
|
}
|