|
1 | 1 | @switch (linkType) {
|
2 | 2 | @case ('disabled') {
|
3 |
| - <a [ngClass]="item | cSidebarNavLink" |
4 |
| - [cHtmlAttr]="item.attributes ?? {}" |
5 |
| - > |
| 3 | + <a [cHtmlAttr]="item.attributes ?? {}" [ngClass]="item | cSidebarNavLink"> |
6 | 4 | <ng-container *ngTemplateOutlet="iconTemplate; context: {$implicit: item}" />
|
7 | 5 | <c-sidebar-nav-link-content [item]="item" />
|
8 | 6 | @if (item.badge) {
|
|
11 | 9 | </a>
|
12 | 10 | }
|
13 | 11 | @case ('external') {
|
14 |
| - <a [ngClass]="item | cSidebarNavLink" |
15 |
| - [href]="href" |
16 |
| - [cHtmlAttr]="item.attributes ?? {}" |
17 |
| - (click)="linkClicked()" |
18 |
| - > |
| 12 | + <a (click)="linkClicked()" [cHtmlAttr]="item.attributes ?? {}" [href]="href" [ngClass]="item | cSidebarNavLink"> |
19 | 13 | <ng-container *ngTemplateOutlet="iconTemplate; context: {$implicit: item}" />
|
20 | 14 | <c-sidebar-nav-link-content [item]="item" />
|
21 | 15 | @if (item.badge) {
|
|
24 | 18 | </a>
|
25 | 19 | }
|
26 | 20 | @default {
|
27 |
| - <a [ngClass]="item | cSidebarNavLink" |
| 21 | + <a (click)="linkClicked()" |
28 | 22 | [cHtmlAttr]="item.attributes ?? {}"
|
29 |
| - [target]="item.attributes?.['target']" |
30 |
| - [queryParams]="item.linkProps?.queryParams ?? null" |
31 | 23 | [fragment]="item.linkProps?.fragment"
|
32 |
| - [queryParamsHandling]="item.linkProps?.queryParamsHandling" |
| 24 | + [ngClass]="item | cSidebarNavLink" |
33 | 25 | [preserveFragment]="item.linkProps?.preserveFragment ?? false"
|
34 |
| - [skipLocationChange]="item.linkProps?.skipLocationChange ?? false" |
| 26 | + [queryParamsHandling]="item.linkProps?.queryParamsHandling" |
| 27 | + [queryParams]="item.linkProps?.queryParams ?? null" |
35 | 28 | [replaceUrl]="item.linkProps?.replaceUrl ?? false"
|
36 |
| - [state]="item.linkProps?.state ?? {}" |
| 29 | + [routerLinkActiveOptions]="item.linkProps?.routerLinkActiveOptions ?? { exact: false }" |
37 | 30 | [routerLink]="item.url"
|
| 31 | + [skipLocationChange]="item.linkProps?.skipLocationChange ?? false" |
| 32 | + [state]="item.linkProps?.state ?? {}" |
| 33 | + [target]="item.attributes?.['target']" |
38 | 34 | routerLinkActive="active"
|
39 |
| - [routerLinkActiveOptions]="item.linkProps?.routerLinkActiveOptions ?? { exact: false }" |
40 |
| - (click)="linkClicked()" |
41 | 35 | >
|
42 | 36 | <!-- [class.active]="linkActive"-->
|
43 | 37 | <ng-container *ngTemplateOutlet="iconTemplate ; context: {$implicit: item}" />
|
|
48 | 42 | </a>
|
49 | 43 | }
|
50 | 44 | }
|
51 |
| - |
52 | 45 | <ng-template #iconTemplate let-item>
|
| 46 | + <!-- <i *ngIf="item?.icon" [ngClass]="item | cSidebarNavIcon"></i>--> |
53 | 47 | @if (item?.icon) {
|
54 |
| - <i [ngClass]="item | cSidebarNavIcon"></i> |
| 48 | + <span class="nav-icon"> |
| 49 | + <span [ngClass]="item.icon ?? ''"></span> |
| 50 | + </span> |
55 | 51 | }
|
56 | 52 | @if (item?.iconComponent) {
|
57 | 53 | <svg
|
58 | 54 | [cIcon]="item.iconComponent?.content"
|
59 |
| - [name]="item.iconComponent?.name" |
60 | 55 | [customClasses]="item | cSidebarNavIcon"
|
| 56 | + [name]="item.iconComponent?.name" |
61 | 57 | ></svg>
|
62 | 58 | }
|
63 | 59 | @if (!item?.icon && !item?.iconComponent) {
|
|
0 commit comments