From d26706ddab4d95a76b110284e1aa3dc401e6b40b Mon Sep 17 00:00:00 2001 From: splincode Date: Mon, 26 Feb 2024 11:55:01 +0300 Subject: [PATCH] feat(addon-doc): support target property for links --- .../addon-doc/components/navigation/navigation.template.html | 3 +++ projects/addon-doc/interfaces/page.ts | 1 + projects/demo/src/modules/app/pages.ts | 2 ++ 3 files changed, 6 insertions(+) diff --git a/projects/addon-doc/components/navigation/navigation.template.html b/projects/addon-doc/components/navigation/navigation.template.html index 27e72cdf546bb..8117147dabfb6 100644 --- a/projects/addon-doc/components/navigation/navigation.template.html +++ b/projects/addon-doc/components/navigation/navigation.template.html @@ -20,6 +20,7 @@ tuiOption [fragment]="item.fragment" [routerLink]="item.route" + [target]="item.target" (click)="onClick(input)" > {{ item.title }} @@ -82,6 +83,7 @@ tuiLink class="t-sublink" [routerLink]="item.route" + [target]="item.target" [tuiScrollIntoViewLink]="isActive(item.route)" (click)="closeMenu()" > @@ -130,6 +132,7 @@ class="t-sublink t-sublink_small" [fragment]="subPage.fragment" [routerLink]="subPage.route" + [target]="item.target" [tuiScrollIntoViewLink]="isActive(subPage.route)" (click)="closeMenu()" > diff --git a/projects/addon-doc/interfaces/page.ts b/projects/addon-doc/interfaces/page.ts index bda048fdf02fd..5477d876e88fc 100644 --- a/projects/addon-doc/interfaces/page.ts +++ b/projects/addon-doc/interfaces/page.ts @@ -10,6 +10,7 @@ export interface TuiDocPage extends TuiDocPageBase { readonly keywords?: string; readonly route: string; readonly icon?: PolymorpheusContent; + readonly target?: '_blank' | '_parent' | '_self' | '_top'; } export interface TuiDocPageGroup extends TuiDocPageBase { diff --git a/projects/demo/src/modules/app/pages.ts b/projects/demo/src/modules/app/pages.ts index dda46bd3e3e77..d1b9bde032010 100644 --- a/projects/demo/src/modules/app/pages.ts +++ b/projects/demo/src/modules/app/pages.ts @@ -44,6 +44,8 @@ export const pages: TuiDocPages = [ title: 'StackBlitz', keywords: 'reproduce, issue, bug, sandbox, playground, test', route: '/stackblitz', + target: '_blank', + icon: 'tuiIconExternalLink', }, { section: 'Documentation',