From d51f1a843c3bb2be365763ca3f7ba04dd6c9da48 Mon Sep 17 00:00:00 2001 From: Igor Sinyak Date: Mon, 30 Oct 2023 10:53:44 +0300 Subject: [PATCH] feat: add deselect all button --- src/app/components/search/search.component.html | 5 ++++- src/app/components/search/search.component.scss | 5 +++++ src/app/components/search/search.component.ts | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/components/search/search.component.html b/src/app/components/search/search.component.html index 8cd042a2..036f63ab 100644 --- a/src/app/components/search/search.component.html +++ b/src/app/components/search/search.component.html @@ -7,7 +7,10 @@

Source

> {{ categories[i].name }} - +
+ + +
diff --git a/src/app/components/search/search.component.scss b/src/app/components/search/search.component.scss index 1fe6df7e..5c52459e 100644 --- a/src/app/components/search/search.component.scss +++ b/src/app/components/search/search.component.scss @@ -129,6 +129,11 @@ position: sticky; top: calc(72px + 36px); + .gc-select-all-buttons { + display: flex; + justify-content: space-between; + } + .gc-select-all { margin-top: 1.5rem; font-size: 0.875rem; diff --git a/src/app/components/search/search.component.ts b/src/app/components/search/search.component.ts index 783b6d83..b97c33df 100644 --- a/src/app/components/search/search.component.ts +++ b/src/app/components/search/search.component.ts @@ -87,9 +87,9 @@ export class SearchComponent implements OnInit, OnDestroy { this.page$.next(pageNumber); } - public selectAll(): void { + public selectAll(value: boolean): void { const formArray = this.filterForm.get('product') as FormArray; - formArray.patchValue(formArray.controls.map(() => true)); + formArray.patchValue(formArray.controls.map(() => value)); } public search(key: string): void {