From 57d87fa1c44cc2aa6c0d5f00230853dc927639f5 Mon Sep 17 00:00:00 2001 From: Sercan Yemen <117369+srcn@users.noreply.github.com> Date: Wed, 25 May 2022 12:17:56 +0300 Subject: [PATCH] (@fuse/navigation) Added "fragment" and "queryParams" support along with "preserveFragment" and "queryParamsHandling" --- .../horizontal/components/basic/basic.component.html | 8 ++++++++ src/@fuse/components/navigation/navigation.types.ts | 6 +++++- .../vertical/components/basic/basic.component.html | 8 ++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/@fuse/components/navigation/horizontal/components/basic/basic.component.html b/src/@fuse/components/navigation/horizontal/components/basic/basic.component.html index 48aab97d..01474ffd 100644 --- a/src/@fuse/components/navigation/horizontal/components/basic/basic.component.html +++ b/src/@fuse/components/navigation/horizontal/components/basic/basic.component.html @@ -10,6 +10,10 @@ class="fuse-horizontal-navigation-item" [ngClass]="{'fuse-horizontal-navigation-item-active-forced': item.active}" [routerLink]="[item.link]" + [fragment]="item.fragment ?? ''" + [preserveFragment]="item.preserveFragment ?? false" + [queryParams]="item.queryParams ?? null" + [queryParamsHandling]="item.queryParamsHandling ?? null" [routerLinkActive]="'fuse-horizontal-navigation-item-active'" [routerLinkActiveOptions]="isActiveMatchOptions" [matTooltip]="item.tooltip || ''"> @@ -45,6 +49,10 @@ class="fuse-horizontal-navigation-item" [ngClass]="{'fuse-horizontal-navigation-item-active-forced': item.active}" [routerLink]="[item.link]" + [fragment]="item.fragment ?? ''" + [preserveFragment]="item.preserveFragment ?? false" + [queryParams]="item.queryParams ?? null" + [queryParamsHandling]="item.queryParamsHandling ?? null" [routerLinkActive]="'fuse-horizontal-navigation-item-active'" [routerLinkActiveOptions]="isActiveMatchOptions" [matTooltip]="item.tooltip || ''" diff --git a/src/@fuse/components/navigation/navigation.types.ts b/src/@fuse/components/navigation/navigation.types.ts index 9b6b3504..1f2257ee 100644 --- a/src/@fuse/components/navigation/navigation.types.ts +++ b/src/@fuse/components/navigation/navigation.types.ts @@ -1,4 +1,4 @@ -import { IsActiveMatchOptions } from '@angular/router'; +import { IsActiveMatchOptions, Params, QueryParamsHandling } from '@angular/router'; export interface FuseNavigationItem { @@ -17,6 +17,10 @@ export interface FuseNavigationItem disabled?: boolean; tooltip?: string; link?: string; + fragment?: string; + preserveFragment?: boolean; + queryParams?: Params | null; + queryParamsHandling?: QueryParamsHandling | null; externalLink?: boolean; target?: | '_blank' diff --git a/src/@fuse/components/navigation/vertical/components/basic/basic.component.html b/src/@fuse/components/navigation/vertical/components/basic/basic.component.html index a9a9dd98..e14fe5b7 100644 --- a/src/@fuse/components/navigation/vertical/components/basic/basic.component.html +++ b/src/@fuse/components/navigation/vertical/components/basic/basic.component.html @@ -10,6 +10,10 @@ class="fuse-vertical-navigation-item" [ngClass]="{'fuse-vertical-navigation-item-active-forced': item.active}" [routerLink]="[item.link]" + [fragment]="item.fragment ?? ''" + [preserveFragment]="item.preserveFragment ?? false" + [queryParams]="item.queryParams ?? null" + [queryParamsHandling]="item.queryParamsHandling ?? null" [routerLinkActive]="'fuse-vertical-navigation-item-active'" [routerLinkActiveOptions]="isActiveMatchOptions" [matTooltip]="item.tooltip || ''"> @@ -45,6 +49,10 @@ class="fuse-vertical-navigation-item" [ngClass]="{'fuse-vertical-navigation-item-active-forced': item.active}" [routerLink]="[item.link]" + [fragment]="item.fragment ?? ''" + [preserveFragment]="item.preserveFragment ?? false" + [queryParams]="item.queryParams ?? null" + [queryParamsHandling]="item.queryParamsHandling ?? null" [routerLinkActive]="'fuse-vertical-navigation-item-active'" [routerLinkActiveOptions]="isActiveMatchOptions" [matTooltip]="item.tooltip || ''"