@recursyve/nice-data-filter-kit 15.1.1 → 15.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/nice-filter-view/components/advanced-filters/advanced-filters.component.mjs +24 -1
- package/esm2020/lib/components/nice-filter-view/components/advanced-filters/button/advanced-filters-button.component.mjs +5 -5
- package/esm2020/lib/components/nice-filter-view/components/advanced-filters/filter-selection/filter-selection.component.mjs +1 -1
- package/esm2020/lib/components/nice-filter-view/components/advanced-filters/utils/advanced-filters.utils.mjs +1 -1
- package/esm2020/lib/components/nice-filter-view/components/export-buttons/export-buttons.component.mjs +6 -7
- package/esm2020/lib/components/nice-filter-view/directives/mat-paginator.mjs +13 -24
- package/esm2020/lib/components/nice-filter-view/directives/mat-sort.mjs +20 -30
- package/esm2020/lib/components/nice-filter-view/models/order-options.model.mjs +2 -0
- package/esm2020/lib/components/nice-filter-view/nice-base-filter-view.component.mjs +43 -2
- package/esm2020/lib/components/nice-filter-view/nice-filter-view.component.mjs +1 -1
- package/esm2020/lib/components/nice-filter-view/nice-nested-filter-view.mjs +46 -0
- package/esm2020/lib/components/nice-filter-view/public-api.mjs +2 -1
- package/esm2020/lib/components/nice-filter-view/store/nice-filter-view.service.mjs +29 -2
- package/esm2020/lib/components/nice-filter-view/store/nice-filter-view.store.mjs +10 -1
- package/esm2020/lib/models/filter.model.mjs +1 -1
- package/fesm2015/recursyve-nice-data-filter-kit.mjs +269 -131
- package/fesm2015/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/fesm2020/recursyve-nice-data-filter-kit.mjs +266 -140
- package/fesm2020/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/lib/components/nice-filter-view/components/advanced-filters/advanced-filters.component.d.ts +1 -0
- package/lib/components/nice-filter-view/components/export-buttons/export-buttons.component.d.ts +1 -2
- package/lib/components/nice-filter-view/directives/mat-paginator.d.ts +4 -9
- package/lib/components/nice-filter-view/directives/mat-sort.d.ts +4 -9
- package/lib/components/nice-filter-view/models/order-options.model.d.ts +7 -0
- package/lib/components/nice-filter-view/nice-base-filter-view.component.d.ts +19 -0
- package/lib/components/nice-filter-view/nice-nested-filter-view.d.ts +23 -0
- package/lib/components/nice-filter-view/public-api.d.ts +1 -0
- package/lib/components/nice-filter-view/store/nice-filter-view.service.d.ts +4 -0
- package/lib/components/nice-filter-view/store/nice-filter-view.store.d.ts +4 -1
- package/lib/models/filter.model.d.ts +11 -11
- package/package.json +1 -1
package/lib/components/nice-filter-view/components/advanced-filters/advanced-filters.component.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare class NiceAdvancedFiltersComponent implements OnInit {
|
|
|
22
22
|
onClickDeleteRule(index: number): void;
|
|
23
23
|
onClose(): void;
|
|
24
24
|
onRefresh(): void;
|
|
25
|
+
removeEmptyRules(): void;
|
|
25
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<NiceAdvancedFiltersComponent, [{ optional: true; }, null, null, null, null]>;
|
|
26
27
|
static ɵcmp: i0.ɵɵComponentDeclaration<NiceAdvancedFiltersComponent, "nice-advanced-filters", never, {}, {}, never, never, false, never>;
|
|
27
28
|
}
|
package/lib/components/nice-filter-view/components/export-buttons/export-buttons.component.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export declare class NiceFilterExportButtonsComponent {
|
|
|
10
10
|
icons: NiceBaseIconOptions;
|
|
11
11
|
private readonly exportsSettings;
|
|
12
12
|
private niceFilterViewQuery;
|
|
13
|
-
private niceFilterViewService;
|
|
14
13
|
private selectableListService;
|
|
15
14
|
private query;
|
|
16
15
|
private service;
|
|
@@ -19,7 +18,7 @@ export declare class NiceFilterExportButtonsComponent {
|
|
|
19
18
|
downloadFileName: string;
|
|
20
19
|
canPrint: boolean;
|
|
21
20
|
loading$: import("rxjs").Observable<boolean>;
|
|
22
|
-
constructor(icons: NiceBaseIconOptions, exportsSettings: ExportSettings, niceFilterViewQuery: NiceFilterViewQuery,
|
|
21
|
+
constructor(icons: NiceBaseIconOptions, exportsSettings: ExportSettings, niceFilterViewQuery: NiceFilterViewQuery, selectableListService: NiceSelectableListService, query: NiceFilterViewQuery, service: NiceFilterViewService, bottomSheet: MatBottomSheet);
|
|
23
22
|
clickExport(): void;
|
|
24
23
|
clickXlsx(ids?: number[]): void;
|
|
25
24
|
clickCsv(ids?: number[]): void;
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnInit } from "@angular/core";
|
|
2
2
|
import { MatPaginator } from "@angular/material/paginator";
|
|
3
|
-
import {
|
|
4
|
-
import { NiceFilterViewService } from "../store/nice-filter-view.service";
|
|
3
|
+
import { NiceNestedFilterView } from "../nice-nested-filter-view";
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class NiceFilterMatPaginatorPaginationDirective implements OnInit
|
|
7
|
-
private query;
|
|
8
|
-
private service;
|
|
5
|
+
export declare class NiceFilterMatPaginatorPaginationDirective extends NiceNestedFilterView implements OnInit {
|
|
9
6
|
private paginator;
|
|
10
|
-
|
|
11
|
-
constructor(query: NiceFilterViewQuery, service: NiceFilterViewService, paginator: MatPaginator);
|
|
7
|
+
constructor(paginator: MatPaginator);
|
|
12
8
|
ngOnInit(): void;
|
|
13
|
-
ngOnDestroy(): void;
|
|
14
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<NiceFilterMatPaginatorPaginationDirective, never>;
|
|
15
10
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NiceFilterMatPaginatorPaginationDirective, "mat-paginator[niceFilterPagination]", never, {}, {}, never, never, false, never>;
|
|
16
11
|
}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnInit } from "@angular/core";
|
|
2
2
|
import { MatSort } from "@angular/material/sort";
|
|
3
|
-
import {
|
|
4
|
-
import { NiceFilterViewService } from "../store/nice-filter-view.service";
|
|
3
|
+
import { NiceNestedFilterView } from "../nice-nested-filter-view";
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class NiceFilterMatSortSortingDirective implements OnInit
|
|
7
|
-
private query;
|
|
8
|
-
private service;
|
|
5
|
+
export declare class NiceFilterMatSortSortingDirective extends NiceNestedFilterView implements OnInit {
|
|
9
6
|
private sort;
|
|
10
|
-
|
|
11
|
-
constructor(query: NiceFilterViewQuery, service: NiceFilterViewService, sort: MatSort);
|
|
7
|
+
constructor(sort: MatSort);
|
|
12
8
|
ngOnInit(): void;
|
|
13
|
-
ngOnDestroy(): void;
|
|
14
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<NiceFilterMatSortSortingDirective, never>;
|
|
15
10
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NiceFilterMatSortSortingDirective, "mat-table[matSort][niceFilterSorting]", never, {}, {}, never, never, false, never>;
|
|
16
11
|
}
|
|
@@ -5,6 +5,7 @@ import { QueryModel, QueryRuleModel, RuleModel } from "../../models/query.model"
|
|
|
5
5
|
import { NiceFilterService } from "../base-list/providers/base-filter.service";
|
|
6
6
|
import { NiceAdvancedFiltersButtonComponent } from "./components/advanced-filters/button/advanced-filters-button.component";
|
|
7
7
|
import { NiceFilterQueryParamsDirective } from "./directives/query-params.directive";
|
|
8
|
+
import { AfterQueryParamLoadedCallback } from "./nice-nested-filter-view";
|
|
8
9
|
import { NiceFilterViewQuery } from "./store/nice-filter-view.query";
|
|
9
10
|
import { NiceFilterViewService } from "./store/nice-filter-view.service";
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
@@ -20,6 +21,7 @@ export declare abstract class NiceBaseFilterViewComponent<Filter extends NiceFil
|
|
|
20
21
|
protected advancedFiltersButton: NiceAdvancedFiltersButtonComponent;
|
|
21
22
|
private advancedFilters;
|
|
22
23
|
private selectableListDirective;
|
|
24
|
+
private readonly _afterQueryParamHooks;
|
|
23
25
|
filterViewLoading$: Observable<boolean>;
|
|
24
26
|
filterViewCount$: Observable<number>;
|
|
25
27
|
ngOnInit(autoLoad?: boolean, { mode, loadConfig, configQueryParams }?: NiceBaseFilterViewInitOptions): void;
|
|
@@ -44,6 +46,21 @@ export declare abstract class NiceBaseFilterViewComponent<Filter extends NiceFil
|
|
|
44
46
|
* NOTE: These rules will be injected in each filter request.
|
|
45
47
|
*/
|
|
46
48
|
setBaseRules(rule: (QueryRuleModel | QueryModel)[], reload?: boolean): void;
|
|
49
|
+
/**
|
|
50
|
+
* Add a rule to the set of rules that won't be saved in the current filterParameters config.
|
|
51
|
+
* NOTE: These rules will be injected in each filter request.
|
|
52
|
+
*/
|
|
53
|
+
addBaseRule(rule: QueryRuleModel, reload?: boolean): void;
|
|
54
|
+
/**
|
|
55
|
+
* Add a rule to the set of rules that won't be saved in the current filterParameters config.
|
|
56
|
+
* NOTE: These rules will be injected in each filter request.
|
|
57
|
+
*/
|
|
58
|
+
upsertBaseRule(rule: QueryRuleModel, reload?: boolean): void;
|
|
59
|
+
/**
|
|
60
|
+
* Remove a rule to the set of rules that won't be saved in the current filterParameters config.
|
|
61
|
+
* NOTE: These rules will be injected in each filter request.
|
|
62
|
+
*/
|
|
63
|
+
removeBaseRule(id: string, reload?: boolean): void;
|
|
47
64
|
/**
|
|
48
65
|
* Reset all rules with a new set of rules.
|
|
49
66
|
*/
|
|
@@ -58,8 +75,10 @@ export declare abstract class NiceBaseFilterViewComponent<Filter extends NiceFil
|
|
|
58
75
|
* NOTE: This will only check for rules in the first element of the rules array in the current filterParameters.
|
|
59
76
|
*/
|
|
60
77
|
removeRule(id: string, reload?: boolean): void;
|
|
78
|
+
protected afterInit(fn: AfterQueryParamLoadedCallback): void;
|
|
61
79
|
private autoLoad;
|
|
62
80
|
private loadConfig;
|
|
81
|
+
private onInit;
|
|
63
82
|
static ɵfac: i0.ɵɵFactoryDeclaration<NiceBaseFilterViewComponent<any>, never>;
|
|
64
83
|
static ɵcmp: i0.ɵɵComponentDeclaration<NiceBaseFilterViewComponent<any>, "ng-component", never, {}, {}, never, never, false, never>;
|
|
65
84
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from "@angular/core";
|
|
2
|
+
import { Observable, Subject } from "rxjs";
|
|
3
|
+
import { NiceFilterService } from "../base-list/providers/base-filter.service";
|
|
4
|
+
import { NiceFilterQueryParamsDirective } from "./directives/query-params.directive";
|
|
5
|
+
import { NiceFilterViewQuery } from "./store/nice-filter-view.query";
|
|
6
|
+
import { NiceFilterViewService } from "./store/nice-filter-view.service";
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export type AfterQueryParamLoadedCallback = () => void;
|
|
9
|
+
export declare abstract class NiceNestedFilterView<Filter extends NiceFilterService<any> = NiceFilterService<any>> implements OnInit, OnDestroy {
|
|
10
|
+
private readonly _afterQueryParamHooks;
|
|
11
|
+
protected unsubscribeAll$: Subject<void>;
|
|
12
|
+
protected filterViewService: NiceFilterViewService<Filter>;
|
|
13
|
+
protected filterViewQuery: NiceFilterViewQuery;
|
|
14
|
+
protected queryParams: NiceFilterQueryParamsDirective | null;
|
|
15
|
+
filterViewLoading$: Observable<boolean>;
|
|
16
|
+
filterViewCount$: Observable<number>;
|
|
17
|
+
ngOnInit(): void;
|
|
18
|
+
ngOnDestroy(): void;
|
|
19
|
+
protected afterInit(fn: AfterQueryParamLoadedCallback): void;
|
|
20
|
+
private onInit;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NiceNestedFilterView<any>, never>;
|
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NiceNestedFilterView<any>, never, never, {}, {}, never, never, false, never>;
|
|
23
|
+
}
|
|
@@ -25,9 +25,13 @@ export declare class NiceFilterViewService<Filter extends NiceFilterService<any>
|
|
|
25
25
|
*/
|
|
26
26
|
setParameters(filterParameters: FilterParametersModel, reload: boolean): void;
|
|
27
27
|
setParameters(filterParameters: FilterParametersModel): void;
|
|
28
|
+
patchParameters(filterParameters: FilterParametersModel): void;
|
|
28
29
|
resetPaging(): void;
|
|
29
30
|
setQueryParams(queryParams: QueryParams): void;
|
|
30
31
|
setBaseRules(rule: (QueryRuleModel | QueryModel)[], reload: boolean): void;
|
|
32
|
+
addBaseRule(rule: QueryRuleModel, reload: boolean): void;
|
|
33
|
+
upsertBaseRules(rule: QueryRuleModel, reload: boolean): void;
|
|
34
|
+
removeBaseRules(key: string, reload: boolean): void;
|
|
31
35
|
setRules(rules: QueryModel | QueryModel[]): void;
|
|
32
36
|
upsertRule(id: string, newRule: RuleModel): void;
|
|
33
37
|
removeRule(id: string): void;
|
|
@@ -4,6 +4,7 @@ import { StoreConfigOptions } from "@datorama/akita/src/lib/storeConfig";
|
|
|
4
4
|
import { QueryParams } from "../../../api/filter.api";
|
|
5
5
|
import { FilterConfigurationModel, FilterParametersModel, FilterResultModel } from "../../../models/filter.model";
|
|
6
6
|
import { QueryModel, QueryRuleModel } from "../../../models/query.model";
|
|
7
|
+
import { OrderOptions } from "../models/order-options.model";
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
export interface NiceFilterViewState extends EntityState {
|
|
9
10
|
subStates: HashMap<any>;
|
|
@@ -16,7 +17,8 @@ export interface NiceFilterViewState extends EntityState {
|
|
|
16
17
|
filterResult: FilterResultModel | null;
|
|
17
18
|
filterParameters: FilterParametersModel;
|
|
18
19
|
baseRules: (QueryRuleModel | QueryModel)[];
|
|
19
|
-
queryParams: QueryParams;
|
|
20
|
+
queryParams: QueryParams | null;
|
|
21
|
+
orderColumns: OrderOptions | null;
|
|
20
22
|
resetResult: boolean;
|
|
21
23
|
}
|
|
22
24
|
export declare const initialValue: NiceFilterViewState;
|
|
@@ -24,6 +26,7 @@ export declare class NiceFilterViewStore extends EntityStore<NiceFilterViewState
|
|
|
24
26
|
constructor(state: Partial<NiceFilterViewState>, store: StoreConfigOptions);
|
|
25
27
|
setFilterConfigLoading(loading: boolean): void;
|
|
26
28
|
setParameters(filterParameters: FilterParametersModel): void;
|
|
29
|
+
patchParameters(filterParameters: FilterParametersModel): void;
|
|
27
30
|
setResult(filterResult: FilterResultModel): void;
|
|
28
31
|
addValue(value: any, opts?: AddEntitiesOptions): void;
|
|
29
32
|
addValues(values: any[], opts?: AddEntitiesOptions): void;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { QueryModel } from "./query.model";
|
|
2
2
|
export interface FilterParametersModel {
|
|
3
|
-
start?: number;
|
|
4
|
-
length?: number;
|
|
3
|
+
start?: number | null;
|
|
4
|
+
length?: number | null;
|
|
5
5
|
order?: OrderModel | null;
|
|
6
|
-
fallbackOrder?: OrderModel | OrderModel[];
|
|
7
|
-
search?: string;
|
|
8
|
-
rules?: QueryModel[];
|
|
9
|
-
draw?: number;
|
|
10
|
-
data?: object;
|
|
11
|
-
groupBy?: string;
|
|
6
|
+
fallbackOrder?: OrderModel | OrderModel[] | null;
|
|
7
|
+
search?: string | null;
|
|
8
|
+
rules?: QueryModel[] | null;
|
|
9
|
+
draw?: number | null;
|
|
10
|
+
data?: object | null;
|
|
11
|
+
groupBy?: string | null;
|
|
12
12
|
}
|
|
13
13
|
export interface FilterPageMode {
|
|
14
14
|
number: number;
|
|
@@ -18,9 +18,9 @@ export interface FilterSearchModel {
|
|
|
18
18
|
value: string;
|
|
19
19
|
}
|
|
20
20
|
export interface OrderModel {
|
|
21
|
-
column?: string;
|
|
22
|
-
direction?: "asc" | "desc";
|
|
23
|
-
nullLast?: boolean;
|
|
21
|
+
column?: string | null;
|
|
22
|
+
direction?: "asc" | "desc" | null;
|
|
23
|
+
nullLast?: boolean | null;
|
|
24
24
|
}
|
|
25
25
|
export interface FilterQueryModel {
|
|
26
26
|
page?: FilterPageMode;
|