@recursyve/nice-data-filter-kit 13.1.3 → 13.1.6
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/api/filter.api.mjs +5 -5
- package/esm2020/lib/components/base-list/base-list.component.mjs +30 -7
- package/esm2020/lib/components/base-list/providers/base-filter.service.mjs +5 -5
- package/esm2020/lib/components/base-list/store/base-list.service.mjs +20 -15
- package/esm2020/lib/components/base-list/store/base-list.store.mjs +3 -2
- package/esm2020/lib/components/multi-state-list/multi-state-list.component.mjs +4 -4
- package/fesm2015/recursyve-nice-data-filter-kit.mjs +62 -33
- package/fesm2015/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/fesm2020/recursyve-nice-data-filter-kit.mjs +61 -32
- package/fesm2020/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/lib/api/filter.api.d.ts +17 -3
- package/lib/components/base-list/base-list.component.d.ts +6 -2
- package/lib/components/base-list/providers/base-filter.service.d.ts +5 -5
- package/lib/components/base-list/store/base-list.service.d.ts +4 -2
- package/lib/components/base-list/store/base-list.store.d.ts +1 -0
- package/package.json +1 -1
package/lib/api/filter.api.d.ts
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
import { HttpClient } from "@angular/common/http";
|
|
1
|
+
import { HttpClient, HttpContext, HttpHeaders, HttpParams } from "@angular/common/http";
|
|
2
2
|
import { Observable } from "rxjs";
|
|
3
3
|
import { FilterConfigurationModel, FilterQueryModel, FilterResultModel, SelectFilterValue } from "../models/filter.model";
|
|
4
|
+
export interface NiceHttpOptions {
|
|
5
|
+
headers?: HttpHeaders | {
|
|
6
|
+
[header: string]: string | string[];
|
|
7
|
+
};
|
|
8
|
+
context?: HttpContext;
|
|
9
|
+
params?: HttpParams | {
|
|
10
|
+
[param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
|
|
11
|
+
};
|
|
12
|
+
reportProgress?: boolean;
|
|
13
|
+
withCredentials?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface QueryParams {
|
|
16
|
+
[param: string]: any;
|
|
17
|
+
}
|
|
4
18
|
export declare class NiceFilterApi<T> {
|
|
5
19
|
private filterApiUrl;
|
|
6
20
|
private path;
|
|
7
21
|
protected http: HttpClient;
|
|
8
22
|
constructor(filterApiUrl: string, path: string, http: HttpClient);
|
|
9
|
-
filter(queryModel: FilterQueryModel): Observable<FilterResultModel>;
|
|
23
|
+
filter(queryModel: FilterQueryModel, option?: NiceHttpOptions): Observable<FilterResultModel>;
|
|
10
24
|
filterCount(queryModel: FilterQueryModel): Observable<number>;
|
|
11
25
|
downloadData(type: string, queryModel: FilterQueryModel): Observable<Blob>;
|
|
12
26
|
getPrintableHtml(queryModel: FilterQueryModel): Observable<string>;
|
|
13
|
-
getFilterConfig(): Observable<FilterConfigurationModel[]>;
|
|
27
|
+
getFilterConfig(option?: NiceHttpOptions): Observable<FilterConfigurationModel[]>;
|
|
14
28
|
searchFilterValue(id: string, value: string): Observable<SelectFilterValue[]>;
|
|
15
29
|
searchFilterResourceValue(id: string, resourceId: number): Observable<SelectFilterValue>;
|
|
16
30
|
protected url(route?: string, queryParams?: object): string;
|
|
@@ -5,6 +5,7 @@ import { Sort } from "@angular/material/sort";
|
|
|
5
5
|
import { ActivatedRoute, Router } from "@angular/router";
|
|
6
6
|
import { ExportStrategy, NiceMediaWatcherService } from "@recursyve/nice-ui-kit.v2";
|
|
7
7
|
import { Observable } from "rxjs";
|
|
8
|
+
import { QueryParams } from "../../api/filter.api";
|
|
8
9
|
import { FilterConfigurationModel } from "../../models/filter.model";
|
|
9
10
|
import { QueryModel, QueryRuleModel } from "../../models/query.model";
|
|
10
11
|
import { NiceBaseListButtonsDirective } from "./directives/base-list-buttons.directive";
|
|
@@ -47,6 +48,8 @@ export declare class NiceBaseListComponent<Filter extends NiceFilterService<any>
|
|
|
47
48
|
canExport: boolean;
|
|
48
49
|
disableRouting: boolean;
|
|
49
50
|
customExport: ExportStrategy[];
|
|
51
|
+
queryParams: QueryParams;
|
|
52
|
+
configQueryParams: QueryParams;
|
|
50
53
|
newPage: EventEmitter<PageEvent>;
|
|
51
54
|
defaultPageSizeOptions: number[];
|
|
52
55
|
columnNames: string[];
|
|
@@ -96,7 +99,8 @@ export declare class NiceBaseListComponent<Filter extends NiceFilterService<any>
|
|
|
96
99
|
clickCsv(): void;
|
|
97
100
|
clickPrint(): void;
|
|
98
101
|
clickPdf(): void;
|
|
99
|
-
|
|
102
|
+
setColumns(columns: TableColumns[]): void;
|
|
103
|
+
addColumns(columns: TableColumns[], prepend?: boolean): void;
|
|
100
104
|
static ɵfac: i0.ɵɵFactoryDeclaration<NiceBaseListComponent<any>, [{ optional: true; }, null, null, null, null, null, null, null, null, null, null]>;
|
|
101
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NiceBaseListComponent<any>, "nice-base-list", never, { "mode": "mode"; "layout": "layout"; "layoutContent": "layoutContent"; "autoChangeLayout": "autoChangeLayout"; "baseRoute": "baseRoute"; "routeFn": "routeFn"; "navigateFn": "navigateFn"; "autoLoad": "autoLoad"; "pageTitle": "pageTitle"; "canExport": "canExport"; "disableRouting": "disableRouting"; "customExport": "customExport"; }, { "newPage": "newPage"; }, ["title", "table", "cards", "customContent", "filters", "emptyState", "buttons"], never>;
|
|
105
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NiceBaseListComponent<any>, "nice-base-list", never, { "mode": "mode"; "layout": "layout"; "layoutContent": "layoutContent"; "autoChangeLayout": "autoChangeLayout"; "baseRoute": "baseRoute"; "routeFn": "routeFn"; "navigateFn": "navigateFn"; "autoLoad": "autoLoad"; "pageTitle": "pageTitle"; "canExport": "canExport"; "disableRouting": "disableRouting"; "customExport": "customExport"; "queryParams": "queryParams"; "configQueryParams": "configQueryParams"; }, { "newPage": "newPage"; }, ["title", "table", "cards", "customContent", "filters", "emptyState", "buttons"], never>;
|
|
102
106
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
|
-
import { NiceFilterApi } from "../../../api/filter.api";
|
|
2
|
+
import { NiceFilterApi, NiceHttpOptions } from "../../../api/filter.api";
|
|
3
3
|
import { FilterConfigurationModel, FilterParametersModel, FilterResultModel, SelectFilterValue } from "../../../models/filter.model";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export interface INiceFilterService<T> {
|
|
6
|
-
getFilterConfig(): Observable<FilterConfigurationModel[]>;
|
|
7
|
-
filter(params: FilterParametersModel): Observable<FilterResultModel<T>>;
|
|
6
|
+
getFilterConfig(option: NiceHttpOptions): Observable<FilterConfigurationModel[]>;
|
|
7
|
+
filter(params: FilterParametersModel, option: NiceHttpOptions): Observable<FilterResultModel<T>>;
|
|
8
8
|
getFile(type: string, parameters: FilterParametersModel): Observable<Blob>;
|
|
9
9
|
getPrintableHtml(parameters: FilterParametersModel): Observable<string>;
|
|
10
10
|
}
|
|
11
11
|
export declare class NiceFilterService<T> implements INiceFilterService<T> {
|
|
12
12
|
protected api?: NiceFilterApi<T>;
|
|
13
13
|
constructor(api?: NiceFilterApi<T>);
|
|
14
|
-
filter(params: FilterParametersModel): Observable<FilterResultModel<T>>;
|
|
14
|
+
filter(params: FilterParametersModel, option?: NiceHttpOptions): Observable<FilterResultModel<T>>;
|
|
15
15
|
getFile(type: string, parameters: FilterParametersModel): Observable<Blob>;
|
|
16
16
|
getPrintableHtml(parameters: FilterParametersModel): Observable<string>;
|
|
17
|
-
getFilterConfig(): Observable<FilterConfigurationModel[]>;
|
|
17
|
+
getFilterConfig(option?: NiceHttpOptions): Observable<FilterConfigurationModel[]>;
|
|
18
18
|
searchFilterValue(filterConfig: FilterConfigurationModel, value: string): Observable<SelectFilterValue[]>;
|
|
19
19
|
searchFilterResourceValue(filterConfig: FilterConfigurationModel, resourceId: number): Observable<SelectFilterValue>;
|
|
20
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<NiceFilterService<any>, never>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApplicationRef } from "@angular/core";
|
|
2
2
|
import { ActivatedRoute, Router } from "@angular/router";
|
|
3
3
|
import { Subject } from "rxjs";
|
|
4
|
+
import { QueryParams } from "../../../api/filter.api";
|
|
4
5
|
import { FilterConfigurationModel, FilterParametersModel } from "../../../models/filter.model";
|
|
5
6
|
import { QueryModel, QueryRuleModel } from "../../../models/query.model";
|
|
6
7
|
import { NiceFilterService } from "../providers/base-filter.service";
|
|
@@ -19,7 +20,7 @@ export declare class NiceBaseListService<Filter extends NiceFilterService<any> =
|
|
|
19
20
|
protected loadingData: boolean;
|
|
20
21
|
constructor(store: NiceBaseListStore, filterService: Filter, activatedRoute: ActivatedRoute, router: Router, appRef: ApplicationRef);
|
|
21
22
|
get filter(): Filter;
|
|
22
|
-
init(): Promise<void>;
|
|
23
|
+
init(configQueryParams?: QueryParams): Promise<void>;
|
|
23
24
|
resetStore(): void;
|
|
24
25
|
resetData(): void;
|
|
25
26
|
closeSubscriptions(): void;
|
|
@@ -27,6 +28,7 @@ export declare class NiceBaseListService<Filter extends NiceFilterService<any> =
|
|
|
27
28
|
enableList(): void;
|
|
28
29
|
setLoading(loading: boolean): void;
|
|
29
30
|
setMode(mode: "normal" | "infinite-scroll"): void;
|
|
31
|
+
setQueryParams(queryParams: any): void;
|
|
30
32
|
loadQueryParams(autoLoad: boolean): void;
|
|
31
33
|
resetAndLoadData(parameters?: FilterParametersModel, updateQueryParams?: boolean): Promise<void>;
|
|
32
34
|
loadData(parameters?: FilterParametersModel, updateQueryParams?: boolean, reset?: boolean): Promise<void>;
|
|
@@ -45,8 +47,8 @@ export declare class NiceBaseListService<Filter extends NiceFilterService<any> =
|
|
|
45
47
|
addListValue(value: any, opts?: AddEntitiesOptions): void;
|
|
46
48
|
updateListValue(value: any, key?: string): void;
|
|
47
49
|
removeListValue(value: any, key?: string): void;
|
|
48
|
-
protected updateQueryParams(queryParams: any): Promise<void>;
|
|
49
50
|
getParameters(filterParameters?: FilterParametersModel): FilterParametersModel;
|
|
51
|
+
protected updateQueryParams(queryParams: any): Promise<void>;
|
|
50
52
|
private mergeParameters;
|
|
51
53
|
private setParameters;
|
|
52
54
|
static ɵfac: i0.ɵɵFactoryDeclaration<NiceBaseListService<any>, never>;
|
|
@@ -13,6 +13,7 @@ export interface NiceBaseListState {
|
|
|
13
13
|
filterConfig: FilterConfigurationModel[];
|
|
14
14
|
showQueryBuilder: boolean;
|
|
15
15
|
defaultRules: (QueryRuleModel | QueryModel)[];
|
|
16
|
+
queryParams: any;
|
|
16
17
|
}
|
|
17
18
|
export declare const initialBaseListState: NiceBaseListState;
|
|
18
19
|
export declare class NiceBaseListStore<T extends NiceBaseListState = NiceBaseListState> extends Store<T> {
|