From 53e644903777496f1b89e429a2872b16feb491b1 Mon Sep 17 00:00:00 2001 From: develite98 Date: Mon, 30 Oct 2023 13:53:50 +0700 Subject: [PATCH] feat() update filter --- .../database-data.component.html | 6 ++++- .../src/app/stores/database-data.store.ts | 1 + libs/mix-share/src/bases/base-crud.store.ts | 2 +- .../dynamic-filter.component.html | 18 ++++++++++++- .../dynamic-filter.component.scss | 4 +++ .../dynamic-filter.component.ts | 27 ++++++++++++++++--- .../filter-input/filter-input.component.html | 6 ++++- .../filter-item/filter-item.component.html | 4 ++- .../filter-item/filter-item.component.scss | 3 ++- .../filter-item/filter-item.component.ts | 1 + 10 files changed, 63 insertions(+), 9 deletions(-) diff --git a/apps/mix-cms/src/app/pages/portal/database-data/database-data.component.html b/apps/mix-cms/src/app/pages/portal/database-data/database-data.component.html index 14681120..981aad39 100644 --- a/apps/mix-cms/src/app/pages/portal/database-data/database-data.component.html +++ b/apps/mix-cms/src/app/pages/portal/database-data/database-data.component.html @@ -88,8 +88,12 @@
+
+
+
+ { this.patchState((s) => ({ ...s, + status: 'SilentLoading', loadDataError: false, request: request, })); diff --git a/libs/mix-share/src/bases/base-crud.store.ts b/libs/mix-share/src/bases/base-crud.store.ts index 55345c80..ca77bb74 100644 --- a/libs/mix-share/src/bases/base-crud.store.ts +++ b/libs/mix-share/src/bases/base-crud.store.ts @@ -26,7 +26,7 @@ export interface BaseState { data: T[]; request: PaginationRequestModel; pageInfo: PaginationModel; - status: 'Loading' | 'Error' | 'Pending' | 'Success'; + status: 'Loading' | 'Error' | 'Pending' | 'Success' | 'SilentLoading'; } export const DEFAULT_DATA = { diff --git a/libs/mix-ui/src/dynamic-filter/dynamic-filter.component.html b/libs/mix-ui/src/dynamic-filter/dynamic-filter.component.html index 4a3909fb..46d5a9d8 100644 --- a/libs/mix-ui/src/dynamic-filter/dynamic-filter.component.html +++ b/libs/mix-ui/src/dynamic-filter/dynamic-filter.component.html @@ -21,11 +21,27 @@

Filter Record(s)

[columns]="columns" [filter]="filter" (filterChange)="onFilterValueChange($event, i)" + (deleteFilter)="deleteFilter(filter, i)" > +
+ *Meet + + + + of these conditions +
+ diff --git a/libs/mix-ui/src/dynamic-filter/filter-item/filter-item.component.scss b/libs/mix-ui/src/dynamic-filter/filter-item/filter-item.component.scss index 540ebbfb..9ecc5bb6 100644 --- a/libs/mix-ui/src/dynamic-filter/filter-item/filter-item.component.scss +++ b/libs/mix-ui/src/dynamic-filter/filter-item/filter-item.component.scss @@ -1,6 +1,7 @@ .filter-item { display: grid; - grid-template-columns: 120px 150px auto 50px; + grid-template-columns: 120px 150px auto min-content; grid-gap: 4px; margin-bottom: 6px; + align-items: center; } diff --git a/libs/mix-ui/src/dynamic-filter/filter-item/filter-item.component.ts b/libs/mix-ui/src/dynamic-filter/filter-item/filter-item.component.ts index f5dfb3db..d3d5c40b 100644 --- a/libs/mix-ui/src/dynamic-filter/filter-item/filter-item.component.ts +++ b/libs/mix-ui/src/dynamic-filter/filter-item/filter-item.component.ts @@ -48,6 +48,7 @@ export class FilterItemComponent { }); @Output() public filterChange = new EventEmitter(); + @Output() public deleteFilter = new EventEmitter(); ngOnInit() { this.form.controls.column.patchValue(