@@ -29,102 +29,99 @@ const MINIMUM_OVERFLOW_THRESHOLD = 4;
2929@Component ( {
3030 selector : "cds-breadcrumb, ibm-breadcrumb" ,
3131 template : `
32- <nav #nav class="cds--breadcrumb"
33- [ngClass]="{
34- 'cds--skeleton' : skeleton,
35- 'cds--breadcrumb--no-trailing-slash' : noTrailingSlash
36- }"
37- [attr.aria-label]="ariaLabel">
38- <ng-template [ngIf]="shouldShowContent">
39- <ng-content></ng-content>
40- </ng-template>
41- <ng-template [ngIf]="!shouldShowOverflow">
42- <cds-breadcrumb-item
43- *ngFor="let item of items"
44- [href]="item.href"
45- [route]="item.route"
46- [routeExtras]="item.routeExtras"
47- [current]="item.current"
48- [ariaCurrent]="item.ariaCurrent"
49- (navigation)="navigation.emit($event)">
50- <ng-container *ngIf="!item.template">{{item.content}}</ng-container>
51- <ng-template
52- *ngIf="item.template"
53- [ngTemplateOutlet]="item.template"
54- [ngTemplateOutletContext]="{ $implicit: item }">
55- </ng-template>
56- </cds-breadcrumb-item>
57- </ng-template>
58- <ng-template [ngIf]="shouldShowOverflow">
59- <cds-breadcrumb-item
60- [href]="first?.href"
61- [route]="first?.route"
62- [routeExtras]="first?.routeExtras"
63- [current]="first?.current"
64- [ariaCurrent]="first?.ariaCurrent"
65- (navigation)="navigation.emit($event)">
66- <ng-container *ngIf="!first?.template">{{first?.content}}</ng-container>
67- <ng-template
68- *ngIf="first?.template"
69- [ngTemplateOutlet]="first?.template"
70- [ngTemplateOutletContext]="{ $implicit: first }">
71- </ng-template>
72- </cds-breadcrumb-item>
73- <cds-breadcrumb-item>
74- <ng-template #overflowMenuTrigger>
75- <svg class="cds--overflow-menu__icon" cdsIcon="overflow-menu--horizontal" size="16"></svg>
76- </ng-template>
77- <cds-overflow-menu
78- [customTrigger]="overflowMenuTrigger"
79- triggerClass="cds--btn--icon-only"
80- [description]="description"
81- [autoAlign]="autoAlign">
82- <li class="cds--overflow-menu-options__option"
83- *ngFor="let item of overflowItems">
84- <a class="cds--overflow-menu-options__btn"
85- href="{{item?.href}}"
86- (click)="navigate($event, item)"
87- style="text-decoration: none;">
88- <ng-container *ngIf="!item?.template">{{item?.content}}</ng-container>
89- <ng-template
90- *ngIf="item?.template"
91- [ngTemplateOutlet]="item?.template"
92- [ngTemplateOutletContext]="{ $implicit: item }">
93- </ng-template>
94- </a>
95- </li>
96- </cds-overflow-menu>
97- </cds-breadcrumb-item>
98- <cds-breadcrumb-item
99- [href]="secondLast?.href"
100- [route]="secondLast?.route"
101- [routeExtras]="secondLast?.routeExtras"
102- [current]="secondLast?.current"
103- [ariaCurrent]="secondLast?.ariaCurrent"
104- (navigation)="navigation.emit($event)">
105- <ng-container *ngIf="!secondLast?.template">{{secondLast?.content}}</ng-container>
106- <ng-template
107- *ngIf="secondLast?.template"
108- [ngTemplateOutlet]="secondLast?.template"
109- [ngTemplateOutletContext]="{ $implicit: secondLast }">
110- </ng-template>
111- </cds-breadcrumb-item>
112- <cds-breadcrumb-item
113- [href]="last?.href"
114- [route]="last?.route"
115- [routeExtras]="last?.routeExtras"
116- [current]="last?.current"
117- [ariaCurrent]="last?.ariaCurrent"
118- (navigation)="navigation.emit($event)">
119- <ng-container *ngIf="!last?.template">{{last?.content}}</ng-container>
120- <ng-template
121- *ngIf="last?.template"
122- [ngTemplateOutlet]="last?.template"
123- [ngTemplateOutletContext]="{ $implicit: last }">
124- </ng-template>
125- </cds-breadcrumb-item>
126- </ng-template>
127- </nav>`
32+ <nav #nav class="cds--breadcrumb"
33+ [ngClass]="{
34+ 'cds--skeleton' : skeleton,
35+ 'cds--breadcrumb--no-trailing-slash' : noTrailingSlash
36+ }"
37+ [attr.aria-label]="ariaLabel">
38+ @if (shouldShowContent) {
39+ <ng-content />
40+ }
41+ @if (shouldShowOverflow) {
42+ <cds-breadcrumb-item
43+ [href]="first?.href"
44+ [route]="first?.route"
45+ [routeExtras]="first?.routeExtras"
46+ [current]="first?.current"
47+ [ariaCurrent]="first?.ariaCurrent"
48+ (navigation)="navigation.emit($event)">
49+ @if (first?.template) {
50+ <ng-template [ngTemplateOutlet]="first?.template" [ngTemplateOutletContext]="{ $implicit: first }" />
51+ } @else {
52+ {{first?.content}}
53+ }
54+ </cds-breadcrumb-item>
55+ <cds-breadcrumb-item>
56+ <ng-template #overflowMenuTrigger>
57+ <svg class="cds--overflow-menu__icon" cdsIcon="overflow-menu--horizontal" size="16"></svg>
58+ </ng-template>
59+ <cds-overflow-menu
60+ [customTrigger]="overflowMenuTrigger"
61+ triggerClass="cds--btn--icon-only"
62+ [description]="description"
63+ [autoAlign]="autoAlign">
64+ @for (item of overflowItems; track item) {
65+ <li class="cds--overflow-menu-options__option">
66+ <a class="cds--overflow-menu-options__btn"
67+ href="{{item?.href}}"
68+ (click)="navigate($event, item)"
69+ style="text-decoration: none;">
70+ @if (item?.template) {
71+ <ng-template [ngTemplateOutlet]="item?.template" [ngTemplateOutletContext]="{ $implicit: item }" />
72+ } @else {
73+ {{item?.content}}
74+ }
75+ </a>
76+ </li>
77+ }
78+ </cds-overflow-menu>
79+ </cds-breadcrumb-item>
80+ <cds-breadcrumb-item
81+ [href]="secondLast?.href"
82+ [route]="secondLast?.route"
83+ [routeExtras]="secondLast?.routeExtras"
84+ [current]="secondLast?.current"
85+ [ariaCurrent]="secondLast?.ariaCurrent"
86+ (navigation)="navigation.emit($event)">
87+ @if (secondLast?.template) {
88+ <ng-template [ngTemplateOutlet]="secondLast?.template" [ngTemplateOutletContext]="{ $implicit: secondLast }" />
89+ } @else {
90+ {{secondLast?.content}}
91+ }
92+ </cds-breadcrumb-item>
93+ <cds-breadcrumb-item
94+ [href]="last?.href"
95+ [route]="last?.route"
96+ [routeExtras]="last?.routeExtras"
97+ [current]="last?.current"
98+ [ariaCurrent]="last?.ariaCurrent"
99+ (navigation)="navigation.emit($event)">
100+ @if (last?.template) {
101+ <ng-template [ngTemplateOutlet]="last?.template" [ngTemplateOutletContext]="{ $implicit: last }" />
102+ } @else {
103+ {{last?.content}}
104+ }
105+ </cds-breadcrumb-item>
106+ } @else {
107+ @for (item of items; track item) {
108+ <cds-breadcrumb-item
109+ [href]="item.href"
110+ [route]="item.route"
111+ [routeExtras]="item.routeExtras"
112+ [current]="item.current"
113+ [ariaCurrent]="item.ariaCurrent"
114+ (navigation)="navigation.emit($event)">
115+ @if (item.template) {
116+ <ng-template [ngTemplateOutlet]="item.template" [ngTemplateOutletContext]="{ $implicit: item }" />
117+ } @else {
118+ {{item.content}}
119+ }
120+ </cds-breadcrumb-item>
121+ }
122+ }
123+ </nav>
124+ `
128125} )
129126export class Breadcrumb implements AfterContentInit {
130127 @ContentChildren ( BreadcrumbItemComponent ) children : QueryList < BreadcrumbItemComponent > ;
0 commit comments