mirror of https://github.com/ghostfolio/ghostfolio
21 changed files with 123 additions and 389 deletions
@ -1,30 +1 @@ |
|||
<mat-tab-nav-panel #tabPanel class="flex-grow-1 overflow-auto"> |
|||
<router-outlet /> |
|||
</mat-tab-nav-panel> |
|||
|
|||
<nav |
|||
mat-align-tabs="center" |
|||
mat-tab-nav-bar |
|||
[disablePagination]="true" |
|||
[tabPanel]="tabPanel" |
|||
> |
|||
@for (tab of tabs; track tab) { |
|||
@if (tab.showCondition !== false) { |
|||
<a |
|||
#rla="routerLinkActive" |
|||
class="no-min-width px-3" |
|||
mat-tab-link |
|||
routerLinkActive |
|||
[active]="rla.isActive" |
|||
[routerLink]="tab.routerLink" |
|||
[routerLinkActiveOptions]="{ exact: true }" |
|||
> |
|||
<ion-icon |
|||
[name]="tab.iconName" |
|||
[size]="deviceType === 'mobile' ? 'large' : 'small'" |
|||
/> |
|||
<div class="d-none d-sm-block ml-2">{{ tab.label }}</div> |
|||
</a> |
|||
} |
|||
} |
|||
</nav> |
|||
<gf-page-tabs [tabs]="tabs" /> |
|||
|
|||
@ -1,30 +1 @@ |
|||
<mat-tab-nav-panel #tabPanel class="flex-grow-1 overflow-auto"> |
|||
<router-outlet /> |
|||
</mat-tab-nav-panel> |
|||
|
|||
<nav |
|||
mat-align-tabs="center" |
|||
mat-tab-nav-bar |
|||
[disablePagination]="true" |
|||
[tabPanel]="tabPanel" |
|||
> |
|||
@for (tab of tabs; track tab) { |
|||
@if (tab.showCondition !== false) { |
|||
<a |
|||
#rla="routerLinkActive" |
|||
class="no-min-width px-3" |
|||
mat-tab-link |
|||
routerLinkActive |
|||
[active]="rla.isActive" |
|||
[routerLink]="tab.routerLink" |
|||
[routerLinkActiveOptions]="{ exact: true }" |
|||
> |
|||
<ion-icon |
|||
[name]="tab.iconName" |
|||
[size]="deviceType === 'mobile' ? 'large' : 'small'" |
|||
/> |
|||
<div class="d-none d-sm-block ml-2" [innerHTML]="tab.label"></div> |
|||
</a> |
|||
} |
|||
} |
|||
</nav> |
|||
<gf-page-tabs [tabs]="tabs" /> |
|||
|
|||
@ -1,30 +1 @@ |
|||
<mat-tab-nav-panel #tabPanel class="flex-grow-1 overflow-auto"> |
|||
<router-outlet /> |
|||
</mat-tab-nav-panel> |
|||
|
|||
<nav |
|||
mat-align-tabs="center" |
|||
mat-tab-nav-bar |
|||
[disablePagination]="true" |
|||
[tabPanel]="tabPanel" |
|||
> |
|||
@for (tab of tabs; track tab) { |
|||
@if (tab.showCondition !== false) { |
|||
<a |
|||
#rla="routerLinkActive" |
|||
class="no-min-width px-3" |
|||
mat-tab-link |
|||
routerLinkActive |
|||
[active]="rla.isActive" |
|||
[routerLink]="tab.routerLink" |
|||
[routerLinkActiveOptions]="{ exact: true }" |
|||
> |
|||
<ion-icon |
|||
[name]="tab.iconName" |
|||
[size]="deviceType === 'mobile' ? 'large' : 'small'" |
|||
/> |
|||
<div class="d-none d-sm-block ml-2">{{ tab.label }}</div> |
|||
</a> |
|||
} |
|||
} |
|||
</nav> |
|||
<gf-page-tabs [tabs]="tabs" /> |
|||
|
|||
@ -1,30 +1 @@ |
|||
<mat-tab-nav-panel #tabPanel class="flex-grow-1 overflow-auto"> |
|||
<router-outlet /> |
|||
</mat-tab-nav-panel> |
|||
|
|||
<nav |
|||
mat-align-tabs="center" |
|||
mat-tab-nav-bar |
|||
[disablePagination]="true" |
|||
[tabPanel]="tabPanel" |
|||
> |
|||
@for (tab of tabs; track tab) { |
|||
@if (tab.showCondition !== false) { |
|||
<a |
|||
#rla="routerLinkActive" |
|||
class="no-min-width px-3" |
|||
mat-tab-link |
|||
routerLinkActive |
|||
[active]="rla.isActive" |
|||
[routerLink]="tab.routerLink" |
|||
[routerLinkActiveOptions]="{ exact: true }" |
|||
> |
|||
<ion-icon |
|||
[name]="tab.iconName" |
|||
[size]="deviceType === 'mobile' ? 'large' : 'small'" |
|||
/> |
|||
<div class="d-none d-sm-block ml-2">{{ tab.label }}</div> |
|||
</a> |
|||
} |
|||
} |
|||
</nav> |
|||
<gf-page-tabs [tabs]="tabs" /> |
|||
|
|||
@ -1,30 +1 @@ |
|||
<mat-tab-nav-panel #tabPanel class="flex-grow-1 overflow-auto"> |
|||
<router-outlet /> |
|||
</mat-tab-nav-panel> |
|||
|
|||
<nav |
|||
mat-align-tabs="center" |
|||
mat-tab-nav-bar |
|||
[disablePagination]="true" |
|||
[tabPanel]="tabPanel" |
|||
> |
|||
@for (tab of tabs; track tab) { |
|||
@if (tab.showCondition !== false) { |
|||
<a |
|||
#rla="routerLinkActive" |
|||
class="no-min-width px-3" |
|||
mat-tab-link |
|||
routerLinkActive |
|||
[active]="rla.isActive" |
|||
[routerLink]="tab.routerLink" |
|||
[routerLinkActiveOptions]="{ exact: true }" |
|||
> |
|||
<ion-icon |
|||
[name]="tab.iconName" |
|||
[size]="deviceType === 'mobile' ? 'large' : 'small'" |
|||
/> |
|||
<div class="d-none d-sm-block ml-2">{{ tab.label }}</div> |
|||
</a> |
|||
} |
|||
} |
|||
</nav> |
|||
<gf-page-tabs [tabs]="tabs" /> |
|||
|
|||
@ -1,30 +1 @@ |
|||
<mat-tab-nav-panel #tabPanel class="flex-grow-1 overflow-auto"> |
|||
<router-outlet /> |
|||
</mat-tab-nav-panel> |
|||
|
|||
<nav |
|||
mat-align-tabs="center" |
|||
mat-tab-nav-bar |
|||
[disablePagination]="true" |
|||
[tabPanel]="tabPanel" |
|||
> |
|||
@for (tab of tabs; track tab) { |
|||
@if (tab.showCondition !== false) { |
|||
<a |
|||
#rla="routerLinkActive" |
|||
class="no-min-width px-3" |
|||
mat-tab-link |
|||
routerLinkActive |
|||
[active]="rla.isActive" |
|||
[routerLink]="tab.routerLink" |
|||
[routerLinkActiveOptions]="{ exact: true }" |
|||
> |
|||
<ion-icon |
|||
[name]="tab.iconName" |
|||
[size]="deviceType === 'mobile' ? 'large' : 'small'" |
|||
/> |
|||
<div class="d-none d-sm-block ml-2">{{ tab.label }}</div> |
|||
</a> |
|||
} |
|||
} |
|||
</nav> |
|||
<gf-page-tabs [tabs]="tabs" /> |
|||
|
|||
@ -1,30 +1 @@ |
|||
<mat-tab-nav-panel #tabPanel class="flex-grow-1 overflow-auto"> |
|||
<router-outlet /> |
|||
</mat-tab-nav-panel> |
|||
|
|||
<nav |
|||
mat-align-tabs="center" |
|||
mat-tab-nav-bar |
|||
[disablePagination]="true" |
|||
[tabPanel]="tabPanel" |
|||
> |
|||
@for (tab of tabs; track tab) { |
|||
@if (tab.showCondition !== false) { |
|||
<a |
|||
#rla="routerLinkActive" |
|||
class="no-min-width px-3" |
|||
mat-tab-link |
|||
routerLinkActive |
|||
[active]="rla.isActive" |
|||
[routerLink]="tab.routerLink" |
|||
[routerLinkActiveOptions]="{ exact: true }" |
|||
> |
|||
<ion-icon |
|||
[name]="tab.iconName" |
|||
[size]="deviceType === 'mobile' ? 'large' : 'small'" |
|||
/> |
|||
<div class="d-none d-sm-block ml-2">{{ tab.label }}</div> |
|||
</a> |
|||
} |
|||
} |
|||
</nav> |
|||
<gf-page-tabs [tabs]="tabs" /> |
|||
|
|||
@ -1,30 +1 @@ |
|||
<mat-tab-nav-panel #tabPanel class="flex-grow-1 overflow-auto"> |
|||
<router-outlet /> |
|||
</mat-tab-nav-panel> |
|||
|
|||
<nav |
|||
mat-align-tabs="center" |
|||
mat-tab-nav-bar |
|||
[disablePagination]="true" |
|||
[tabPanel]="tabPanel" |
|||
> |
|||
@for (tab of tabs; track tab) { |
|||
@if (tab.showCondition !== false) { |
|||
<a |
|||
#rla="routerLinkActive" |
|||
class="no-min-width px-3" |
|||
mat-tab-link |
|||
routerLinkActive |
|||
[active]="rla.isActive" |
|||
[routerLink]="tab.routerLink" |
|||
[routerLinkActiveOptions]="{ exact: true }" |
|||
> |
|||
<ion-icon |
|||
[name]="tab.iconName" |
|||
[size]="deviceType === 'mobile' ? 'large' : 'small'" |
|||
/> |
|||
<div class="d-none d-sm-block ml-2">{{ tab.label }}</div> |
|||
</a> |
|||
} |
|||
} |
|||
</nav> |
|||
<gf-page-tabs [tabs]="tabs" /> |
|||
|
|||
@ -0,0 +1 @@ |
|||
export * from './page-tabs.component'; |
|||
@ -0,0 +1,30 @@ |
|||
<mat-tab-nav-panel #tabPanel class="flex-grow-1 overflow-auto"> |
|||
<router-outlet /> |
|||
</mat-tab-nav-panel> |
|||
|
|||
<nav |
|||
mat-align-tabs="center" |
|||
mat-tab-nav-bar |
|||
[disablePagination]="true" |
|||
[tabPanel]="tabPanel" |
|||
> |
|||
@for (tab of tabs(); track tab) { |
|||
@if (tab.showCondition !== false) { |
|||
<a |
|||
#rla="routerLinkActive" |
|||
class="no-min-width px-3" |
|||
mat-tab-link |
|||
routerLinkActive |
|||
[active]="rla.isActive" |
|||
[routerLink]="tab.routerLink" |
|||
[routerLinkActiveOptions]="{ exact: true }" |
|||
> |
|||
<ion-icon |
|||
[name]="tab.iconName" |
|||
[size]="deviceType === 'mobile' ? 'large' : 'small'" |
|||
/> |
|||
<div class="d-none d-sm-block ml-2" [innerHTML]="tab.label"></div> |
|||
</a> |
|||
} |
|||
} |
|||
</nav> |
|||
@ -0,0 +1,5 @@ |
|||
:host { |
|||
display: flex; |
|||
flex-direction: column; |
|||
width: 100%; |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
import { TabConfiguration } from '@ghostfolio/common/interfaces'; |
|||
|
|||
import { ChangeDetectionStrategy, Component, input } from '@angular/core'; |
|||
import { MatTabsModule } from '@angular/material/tabs'; |
|||
import { RouterModule } from '@angular/router'; |
|||
import { IonIcon } from '@ionic/angular/standalone'; |
|||
import { DeviceDetectorService } from 'ngx-device-detector'; |
|||
|
|||
@Component({ |
|||
changeDetection: ChangeDetectionStrategy.OnPush, |
|||
imports: [IonIcon, MatTabsModule, RouterModule], |
|||
selector: 'gf-page-tabs', |
|||
styleUrls: ['./page-tabs.component.scss'], |
|||
templateUrl: './page-tabs.component.html' |
|||
}) |
|||
export class GfPageTabsComponent { |
|||
public deviceType: string; |
|||
public readonly tabs = input.required<TabConfiguration[]>(); |
|||
|
|||
public constructor(deviceService: DeviceDetectorService) { |
|||
this.deviceType = deviceService.getDeviceInfo().deviceType; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue