[develop]: Add ration in Icon class and use it in sidebar.

This commit is contained in:
Konstantinos Triantafyllou 2024-06-04 12:55:36 +03:00
parent 35276059f1
commit 9ae1ee928a
2 changed files with 4 additions and 3 deletions

View File

@ -40,7 +40,7 @@
<a [routerLink]="getItemRoute(item)" [title]="item.title" (click)="item.items.length === 0?closeOffcanvas():null"
[queryParams]="item.route?item.params:null" [queryParamsHandling]="item.route?queryParamsHandling:null" class="uk-flex uk-flex-middle">
<div *ngIf="item.icon && (item.icon.svg || item.icon.name)" class="uk-width-auto">
<icon class="menu-icon" [customClass]="item.icon.class" [name]="item.icon.name" [ratio]="item.icon.svg?1:0.9" [svg]="item.icon.svg" [flex]="true"></icon>
<icon class="menu-icon" [customClass]="item.icon.class" [name]="item.icon.name" [ratio]="item.icon.ratio?item.icon.ratio:0.9" [svg]="item.icon.svg" [flex]="true"></icon>
</div>
<span [class.hide-on-close]="item.icon" class="uk-width-expand@l uk-text-truncate uk-margin-small-left">{{item.title}}</span>
<span *ngIf="item.items.length > 0" class="uk-nav-parent-icon hide-on-close"></span>

View File

@ -1,7 +1,8 @@
export interface Icon {
name?: string,
svg?: string,
class?: string
class?: string,
ratio?: number
}
export class MenuItem {
@ -90,4 +91,4 @@ export class SideMenuItem extends MenuItem {
ukIcon: string = '';
}
export enum MenuAlignment {LEFT = "LEFT", CENTER = "CENTER", RIGHT = "RIGHT"}
export enum MenuAlignment {LEFT = "LEFT", CENTER = "CENTER", RIGHT = "RIGHT"}