From 4383a772413de3167d417db45f0c9b50a4b407b2 Mon Sep 17 00:00:00 2001 From: Michal Grzegorczyk Date: Sun, 3 Nov 2024 21:02:11 +0100 Subject: [PATCH] fix: linter --- package-lock.json | 77 ++++++++++--------- .../navigation/navigation.component.ts | 14 ++-- .../navigation/navigation.template.html | 62 +++++++-------- .../kit/components/input/input.component.ts | 20 +++-- .../kit/components/input/input.template.html | 1 - 5 files changed, 93 insertions(+), 81 deletions(-) diff --git a/package-lock.json b/package-lock.json index e2657cdd4c4f..f43d33ef373a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43845,8 +43845,8 @@ "@angular/common": ">=12.0.0", "@angular/core": ">=12.0.0", "@ng-web-apis/common": ">=3.2.3 <4", - "@taiga-ui/cdk": ">=3.95.2 <4", - "@taiga-ui/core": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", + "@taiga-ui/core": ">=3.96.0 <4", "@tinkoff/ng-polymorpheus": ">=4.3.0", "tslib": ">=2.7.0" } @@ -43863,10 +43863,10 @@ "@maskito/core": ">=1.9.0 <2", "@maskito/kit": ">=1.9.0 <2", "@ng-web-apis/common": ">=3.2.3 <4", - "@taiga-ui/cdk": ">=3.95.2 <4", - "@taiga-ui/core": ">=3.95.2 <4", - "@taiga-ui/i18n": ">=3.95.2 <4", - "@taiga-ui/kit": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", + "@taiga-ui/core": ">=3.96.0 <4", + "@taiga-ui/i18n": ">=3.96.0 <4", + "@taiga-ui/kit": ">=3.96.0 <4", "@tinkoff/ng-polymorpheus": ">=4.3.0", "rxjs": ">=6.0.0", "tslib": ">=2.7.0" @@ -43889,10 +43889,10 @@ "@angular/forms": ">=12.0.0", "@angular/router": ">=12.0.0", "@ng-web-apis/common": ">=3.2.3 <4", - "@taiga-ui/addon-mobile": ">=3.95.2 <4", - "@taiga-ui/cdk": ">=3.95.2 <4", - "@taiga-ui/core": ">=3.95.2 <4", - "@taiga-ui/kit": ">=3.95.2 <4", + "@taiga-ui/addon-mobile": ">=3.96.0 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", + "@taiga-ui/core": ">=3.96.0 <4", + "@taiga-ui/kit": ">=3.96.0 <4", "@tinkoff/ng-polymorpheus": ">=4.3.0", "tslib": ">=2.7.0" } @@ -43906,9 +43906,9 @@ "@angular/common": ">=12.0.0", "@angular/core": ">=12.0.0", "@ng-web-apis/common": ">=3.2.3 <4", - "@taiga-ui/cdk": ">=3.95.2 <4", - "@taiga-ui/core": ">=3.95.2 <4", - "@taiga-ui/kit": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", + "@taiga-ui/core": ">=3.96.0 <4", + "@taiga-ui/kit": ">=3.96.0 <4", "@tinkoff/ng-polymorpheus": ">=4.3.0", "rxjs": ">=6.0.0", "tslib": ">=2.7.0" @@ -43922,10 +43922,10 @@ "@angular/common": ">=12.0.0", "@angular/core": ">=12.0.0", "@ng-web-apis/mutation-observer": ">=3.1.0 <4", - "@taiga-ui/cdk": ">=3.95.2 <4", - "@taiga-ui/core": ">=3.95.2 <4", - "@taiga-ui/i18n": ">=3.95.2 <4", - "@taiga-ui/kit": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", + "@taiga-ui/core": ">=3.96.0 <4", + "@taiga-ui/i18n": ">=3.96.0 <4", + "@taiga-ui/kit": ">=3.96.0 <4", "@tinkoff/ng-polymorpheus": ">=4.3.0", "rxjs": ">=6.0.0", "tslib": ">=2.7.0" @@ -43939,10 +43939,10 @@ "@angular/common": ">=12.0.0", "@angular/core": ">=12.0.0", "@ng-web-apis/intersection-observer": ">=3.2.3 <4", - "@taiga-ui/cdk": ">=3.95.2 <4", - "@taiga-ui/core": ">=3.95.2 <4", - "@taiga-ui/i18n": ">=3.95.2 <4", - "@taiga-ui/kit": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", + "@taiga-ui/core": ">=3.96.0 <4", + "@taiga-ui/i18n": ">=3.96.0 <4", + "@taiga-ui/kit": ">=3.96.0 <4", "@tinkoff/ng-polymorpheus": ">=4.3.0", "rxjs": ">=6.0.0", "tslib": ">=2.7.0" @@ -43955,8 +43955,8 @@ "peerDependencies": { "@angular/common": ">=12.0.0", "@angular/core": ">=12.0.0", - "@taiga-ui/cdk": ">=3.95.2 <4", - "@taiga-ui/core": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", + "@taiga-ui/core": ">=3.96.0 <4", "@tinkoff/ng-polymorpheus": ">=4.3.0", "rxjs": ">=6.0.0", "tslib": ">=2.7.0" @@ -44008,8 +44008,8 @@ "@angular/router": ">=12.0.0", "@ng-web-apis/common": ">=3.2.3 <4", "@ng-web-apis/mutation-observer": ">=3.2.3 <4", - "@taiga-ui/cdk": ">=3.95.2 <4", - "@taiga-ui/i18n": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", + "@taiga-ui/i18n": ">=3.96.0 <4", "@tinkoff/ng-event-plugins": ">=3.2.0 <4", "@tinkoff/ng-polymorpheus": ">=4.3.0", "rxjs": ">=6.0.0", @@ -44043,6 +44043,7 @@ "name": "@taiga-ui/demo-cypress" }, "projects/demo-playwright": { + "name": "@taiga-ui/demo-playwright", "devDependencies": { "@playwright/test": "1.48.0" } @@ -44220,10 +44221,10 @@ "peerDependencies": { "@angular/common": ">=12.0.0", "@angular/core": ">=12.0.0", - "@taiga-ui/addon-commerce": ">=3.95.2 <4", - "@taiga-ui/cdk": ">=3.95.2 <4", - "@taiga-ui/core": ">=3.95.2 <4", - "@taiga-ui/kit": ">=3.95.2 <4", + "@taiga-ui/addon-commerce": ">=3.96.0 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", + "@taiga-ui/core": ">=3.96.0 <4", + "@taiga-ui/kit": ">=3.96.0 <4", "@tinkoff/ng-polymorpheus": ">=4.3.0", "rxjs": ">=6.0.0", "tslib": ">=2.7.0" @@ -44252,7 +44253,7 @@ "svgo": "3.1.0" }, "peerDependencies": { - "@taiga-ui/cdk": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", "tslib": ">=2.7.0" } }, @@ -44305,9 +44306,9 @@ "@ng-web-apis/common": ">=3.2.3 <4", "@ng-web-apis/mutation-observer": ">=3.2.3 <4", "@ng-web-apis/resize-observer": ">=3.2.3 <4", - "@taiga-ui/cdk": ">=3.95.2 <4", - "@taiga-ui/core": ">=3.95.2 <4", - "@taiga-ui/i18n": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", + "@taiga-ui/core": ">=3.96.0 <4", + "@taiga-ui/i18n": ">=3.96.0 <4", "@tinkoff/ng-polymorpheus": ">=4.3.0", "rxjs": ">=6.0.0", "tslib": ">=2.7.0" @@ -44320,8 +44321,8 @@ "peerDependencies": { "@angular/common": ">=12.0.0", "@angular/core": ">=12.0.0", - "@taiga-ui/cdk": ">=3.95.2 <4", - "@taiga-ui/core": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", + "@taiga-ui/core": ">=3.96.0 <4", "@tinkoff/ng-polymorpheus": ">=4.3.0", "rxjs": ">=6.0.0", "tslib": ">=2.7.0" @@ -44331,7 +44332,7 @@ "name": "@taiga-ui/styles", "version": "3.96.0", "peerDependencies": { - "@taiga-ui/cdk": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", "tslib": ">=2.7.0" } }, @@ -44343,7 +44344,7 @@ "@taiga-ui/cdk": "^3.96.0" }, "peerDependencies": { - "@taiga-ui/cdk": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", "tslib": ">=2.7.0" } }, @@ -44361,7 +44362,7 @@ "ts-jest": "29.1.1" }, "peerDependencies": { - "@taiga-ui/cdk": ">=3.95.2 <4", + "@taiga-ui/cdk": ">=3.96.0 <4", "tslib": ">=2.7.0" } } diff --git a/projects/addon-doc/components/navigation/navigation.component.ts b/projects/addon-doc/components/navigation/navigation.component.ts index b88718f86e10..d79e9706587e 100644 --- a/projects/addon-doc/components/navigation/navigation.component.ts +++ b/projects/addon-doc/components/navigation/navigation.component.ts @@ -56,8 +56,12 @@ export class TuiDocNavigationComponent { readonly search = new FormControl(''); + readonly isOpened$ = tuiControlValue(this.search).pipe( + map(val => this.isValidSearch(val)), + ); + readonly filtered$ = tuiControlValue(this.search).pipe( - filter(search => search.trim().length > 2), + filter(val => this.isValidSearch(val)), map(search => this.filterItems(this.flattenSubPages(this.items), search)), ); @@ -109,14 +113,14 @@ export class TuiDocNavigationComponent { .subscribe(anchor => this.navigateToAnchorLink(anchor)); } - get canOpen(): boolean { - return (this.search.value?.length ?? 0) > 2; - } - get itemsWithoutSections(): TuiDocPages { return this.items[this.items.length - 1]; } + isValidSearch(search: string): boolean { + return search.trim().length > 2; + } + $pages(pages: any): readonly TuiDocPage[] { return pages as TuiDocPage[]; } diff --git a/projects/addon-doc/components/navigation/navigation.template.html b/projects/addon-doc/components/navigation/navigation.template.html index 39b800faa440..71aa11be489c 100644 --- a/projects/addon-doc/components/navigation/navigation.template.html +++ b/projects/addon-doc/components/navigation/navigation.template.html @@ -3,25 +3,43 @@ tuiTextfieldSize="m" class="t-input" [formControl]="search" + [isOpened]="isOpened$ | async" [tuiAutoFocus]="!!sidebar" [tuiTextfieldCleaner]="true" [tuiTextfieldIconLeft]="docIcons.search" [tuiTextfieldLabelOutside]="true" > {{ searchText }} - - - - + + + + + + {{ item.title }} + + + + {{ item.title }} - - - - {{ item.title }} - - - - - - - + + + +