|
1 |
| -<div class="pt-4" *ngFor="let menu of menuService.pagesMenu"> |
2 |
| - <div class="mx-1 mb-2 flex items-center justify-between"> |
| 1 | +<div *ngFor="let menu of menuService.pagesMenu"> |
| 2 | + <div *ngIf="menuService.showSideBar" class="mx-1 flex items-center justify-between py-3"> |
3 | 3 | <small [ngClass]="{ hidden: !menuService.showSideBar }" class="text-muted-foreground/50 text-xs font-semibold">
|
4 | 4 | {{ menu.group }}
|
5 | 5 | </small>
|
|
8 | 8 | <!-- List items -->
|
9 | 9 | <li *ngFor="let item of menu.items">
|
10 | 10 | <!-- Menu List -->
|
11 |
| - <div (click)="toggleMenu(item)" class="text-muted-foreground group relative"> |
| 11 | + <div |
| 12 | + (click)="toggleMenu(item)" |
| 13 | + [ngClass]="{ |
| 14 | + 'hover:bg-primary/10': !menuService.showSideBar && item.active, |
| 15 | + 'hover:bg-card/50': !menuService.showSideBar |
| 16 | + }" |
| 17 | + class="text-muted-foreground hover:text-foreground group relative flex grow items-center gap-4 rounded-lg px-2"> |
12 | 18 | <!-- Icon -->
|
13 |
| - <div |
14 |
| - [ngClass]="item.active && !menuService.showSideBar ? 'text-primary' : 'text-muted-foreground/50'" |
15 |
| - class="pointer-events-none absolute m-2"> |
| 19 | + <div [ngClass]="item.active && !menuService.showSideBar ? 'text-primary' : 'text-muted-foreground/50'"> |
16 | 20 | <svg-icon src="{{ item.icon }}" [svgClass]="'h-5 w-5'"> </svg-icon>
|
17 | 21 | </div>
|
18 | 22 |
|
|
28 | 32 | routerLink="{{ item.route }}"
|
29 | 33 | class="text-muted-foreground hover:text-primary flex h-[36px] cursor-pointer items-center justify-start rounded-sm">
|
30 | 34 | <a
|
| 35 | + [ngClass]="{ hidden: !menuService.showSideBar }" |
31 | 36 | routerLinkActive="text-primary"
|
32 |
| - class="ms-10 truncate text-xs font-semibold tracking-wide focus:outline-hidden"> |
| 37 | + class="truncate text-xs font-semibold tracking-wide focus:outline-hidden"> |
33 | 38 | {{ item.label }}
|
34 | 39 | </a>
|
35 | 40 | </div>
|
36 | 41 | </ng-template>
|
37 | 42 |
|
38 | 43 | <!-- Workaround:: Disable routerLink -->
|
39 | 44 | <ng-template #childMenu let-item="item">
|
40 |
| - <div class="flex h-[36px] cursor-pointer items-center justify-start rounded-sm"> |
| 45 | + <div class="flex h-9 grow cursor-pointer items-center justify-start rounded-sm"> |
41 | 46 | <a
|
42 |
| - class="text-muted-foreground group-hover:text-primary ms-10 truncate text-xs font-semibold tracking-wide focus:outline-hidden"> |
| 47 | + [ngClass]="{ hidden: !menuService.showSideBar }" |
| 48 | + class="text-muted-foreground group-hover:text-primary truncate text-xs font-semibold tracking-wide focus:outline-hidden"> |
43 | 49 | {{ item.label }}
|
44 | 50 | </a>
|
45 | 51 | </div>
|
|
49 | 55 | <button
|
50 | 56 | *ngIf="item.children"
|
51 | 57 | [ngClass]="{ hidden: !menuService.showSideBar }"
|
52 |
| - class="text-foreground/50 pointer-events-none absolute top-1 mx-1 flex items-center p-1 transition-all duration-500 ltr:right-0 rtl:left-0"> |
| 58 | + class="text-foreground/50 flex cursor-pointer items-center justify-end p-0 transition-all duration-500 ltr:right-0 rtl:left-0"> |
53 | 59 | @if(!item.expanded){
|
54 | 60 | <svg-icon src="assets/icons/heroicons/outline/plus.svg" svgClass="h-4 w-4"> </svg-icon>
|
55 | 61 | }@else {
|
|
58 | 64 | </button>
|
59 | 65 |
|
60 | 66 | <!-- Tooltip -->
|
61 |
| - <div class="fixed w-full" *ngIf="!menuService.showSideBar"> |
| 67 | + <div class="z-1 fixed h-[36px]" *ngIf="!menuService.showSideBar"> |
62 | 68 | <span
|
63 |
| - class="z-1 bg-foreground text-background absolute -top-[34px] w-auto min-w-max scale-0 rounded-md p-2 text-xs font-bold shadow-md transition-all duration-200 group-hover:scale-100 ltr:left-14 ltr:origin-left rtl:right-14 rtl:origin-right"> |
| 69 | + class="z-1 bg-foreground text-background absolute w-auto min-w-max translate-y-[2px] scale-0 rounded-md p-2 text-xs font-bold shadow-md transition-all duration-200 group-hover:scale-100 ltr:origin-left ltr:translate-x-10 rtl:origin-right rtl:-translate-x-10"> |
64 | 70 | {{ item.label }}
|
65 | 71 | </span>
|
66 | 72 | </div>
|
|
71 | 77 | </li>
|
72 | 78 | </ul>
|
73 | 79 |
|
74 |
| - <div class="pt-3" *ngIf="menu.separator"> |
| 80 | + <div class="py-3" *ngIf="menu.separator"> |
75 | 81 | <hr class="border-border border-dashed" />
|
76 | 82 | </div>
|
77 | 83 | </div>
|
0 commit comments