@recursyve/nice-data-filter-kit 13.1.4 → 13.1.7
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 +46 -5
- package/esm2020/lib/components/base-list/base-list.component.mjs +14 -5
- package/esm2020/lib/components/base-list/providers/base-filter.service.mjs +11 -9
- 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 +3 -3
- package/esm2020/lib/components/multi-state-list/providers/multi-state-filter.service.mjs +1 -1
- package/fesm2015/recursyve-nice-data-filter-kit.mjs +94 -33
- package/fesm2015/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/fesm2020/recursyve-nice-data-filter-kit.mjs +91 -32
- package/fesm2020/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/lib/api/filter.api.d.ts +43 -4
- package/lib/components/base-list/base-list.component.d.ts +4 -1
- package/lib/components/base-list/providers/base-filter.service.d.ts +7 -7
- 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/lib/components/multi-state-list/providers/multi-state-filter.service.d.ts +3 -3
- package/package.json +3 -3
package/lib/api/filter.api.d.ts
CHANGED
|
@@ -1,19 +1,58 @@
|
|
|
1
|
-
import { HttpClient } from "@angular/common/http";
|
|
1
|
+
import { HttpClient, HttpContext, HttpHeaders, HttpParams } from "@angular/common/http";
|
|
2
|
+
import { HttpOptions, NiceHttpExceptionFactory } from "@recursyve/nice-ui-kit.v2";
|
|
3
|
+
import { AbstractConstructor, Constructor } from "@recursyve/nice-ui-kit.v2/lib/types/constructor";
|
|
2
4
|
import { Observable } from "rxjs";
|
|
3
5
|
import { FilterConfigurationModel, FilterQueryModel, FilterResultModel, SelectFilterValue } from "../models/filter.model";
|
|
4
|
-
export
|
|
6
|
+
export interface NiceHttpOptions {
|
|
7
|
+
headers?: HttpHeaders | {
|
|
8
|
+
[header: string]: string | string[];
|
|
9
|
+
};
|
|
10
|
+
context?: HttpContext;
|
|
11
|
+
params?: HttpParams | {
|
|
12
|
+
[param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
|
|
13
|
+
};
|
|
14
|
+
reportProgress?: boolean;
|
|
15
|
+
withCredentials?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface QueryParams {
|
|
18
|
+
[param: string]: any;
|
|
19
|
+
}
|
|
20
|
+
export interface NiceFilterApiDefinition {
|
|
21
|
+
filter(queryModel: FilterQueryModel, option?: HttpOptions): Observable<FilterResultModel>;
|
|
22
|
+
filterCount(queryModel: FilterQueryModel): Observable<number>;
|
|
23
|
+
downloadData(type: string, queryModel: FilterQueryModel): Observable<Blob>;
|
|
24
|
+
getPrintableHtml(queryModel: FilterQueryModel): Observable<string>;
|
|
25
|
+
getFilterConfig(option?: HttpOptions): Observable<FilterConfigurationModel[]>;
|
|
26
|
+
searchFilterValue(id: string, value: string): Observable<SelectFilterValue[]>;
|
|
27
|
+
searchFilterResourceValue(id: string, resourceId: number): Observable<SelectFilterValue>;
|
|
28
|
+
}
|
|
29
|
+
export declare class NiceFilterApi<T> implements NiceFilterApiDefinition {
|
|
5
30
|
private filterApiUrl;
|
|
6
31
|
private path;
|
|
7
32
|
protected http: HttpClient;
|
|
8
33
|
constructor(filterApiUrl: string, path: string, http: HttpClient);
|
|
9
|
-
filter(queryModel: FilterQueryModel): Observable<FilterResultModel
|
|
34
|
+
filter(queryModel: FilterQueryModel, option?: NiceHttpOptions): Observable<FilterResultModel<T>>;
|
|
10
35
|
filterCount(queryModel: FilterQueryModel): Observable<number>;
|
|
11
36
|
downloadData(type: string, queryModel: FilterQueryModel): Observable<Blob>;
|
|
12
37
|
getPrintableHtml(queryModel: FilterQueryModel): Observable<string>;
|
|
13
|
-
getFilterConfig(): Observable<FilterConfigurationModel[]>;
|
|
38
|
+
getFilterConfig(option?: NiceHttpOptions): Observable<FilterConfigurationModel[]>;
|
|
14
39
|
searchFilterValue(id: string, value: string): Observable<SelectFilterValue[]>;
|
|
15
40
|
searchFilterResourceValue(id: string, resourceId: number): Observable<SelectFilterValue>;
|
|
16
41
|
protected url(route?: string, queryParams?: object): string;
|
|
17
42
|
protected url(queryParams: object): string;
|
|
18
43
|
private transformUrlArgs;
|
|
19
44
|
}
|
|
45
|
+
export interface HasNiceFilterApiDefinition {
|
|
46
|
+
exceptionFactory: NiceHttpExceptionFactory;
|
|
47
|
+
httpClient: HttpClient;
|
|
48
|
+
apiUrl: string;
|
|
49
|
+
path: string;
|
|
50
|
+
url(route?: string): string;
|
|
51
|
+
delete<T>(route?: string, options?: HttpOptions): Observable<T>;
|
|
52
|
+
get<T>(route?: string, options?: HttpOptions): Observable<T>;
|
|
53
|
+
patch<T>(route?: string, body?: any, options?: HttpOptions): Observable<T>;
|
|
54
|
+
post<T>(route?: string, body?: any, options?: HttpOptions): Observable<T>;
|
|
55
|
+
put<T>(route?: string, body?: any, options?: HttpOptions): Observable<T>;
|
|
56
|
+
}
|
|
57
|
+
export declare type NiceFilterApiDefinitionCtor = Constructor<NiceFilterApiDefinition> & AbstractConstructor<NiceFilterApiDefinition>;
|
|
58
|
+
export declare function mixinNiceFilterApi<C extends AbstractConstructor<HasNiceFilterApiDefinition>>(base: C): NiceFilterApiDefinitionCtor & C;
|
|
@@ -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[];
|
|
@@ -99,5 +102,5 @@ export declare class NiceBaseListComponent<Filter extends NiceFilterService<any>
|
|
|
99
102
|
setColumns(columns: TableColumns[]): void;
|
|
100
103
|
addColumns(columns: TableColumns[], prepend?: boolean): void;
|
|
101
104
|
static ɵfac: i0.ɵɵFactoryDeclaration<NiceBaseListComponent<any>, [{ optional: true; }, null, null, null, null, null, null, null, null, null, null]>;
|
|
102
|
-
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>;
|
|
103
106
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
|
-
import {
|
|
2
|
+
import { NiceFilterApiDefinition, 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
|
-
protected api?:
|
|
13
|
-
constructor(api?:
|
|
14
|
-
filter(params: FilterParametersModel): Observable<FilterResultModel<T>>;
|
|
12
|
+
protected api?: NiceFilterApiDefinition;
|
|
13
|
+
constructor(api?: NiceFilterApiDefinition);
|
|
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> {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NiceFilterApiDefinition } from "../../../api/filter.api";
|
|
2
2
|
import { NiceFilterService } from "../../base-list/providers/base-filter.service";
|
|
3
3
|
export declare class NiceMultiStateFilterService extends NiceFilterService<any> {
|
|
4
4
|
protected filters: {
|
|
5
|
-
[state: string]:
|
|
5
|
+
[state: string]: NiceFilterApiDefinition;
|
|
6
6
|
};
|
|
7
7
|
protected constructor(filters: {
|
|
8
|
-
[state: string]:
|
|
8
|
+
[state: string]: NiceFilterApiDefinition;
|
|
9
9
|
});
|
|
10
10
|
switchState(state: string): void;
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@recursyve/nice-data-filter-kit",
|
|
3
|
-
"version": "13.1.
|
|
3
|
+
"version": "13.1.7",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"sass": "./_index.scss",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"@angular/material": "^13.0.0",
|
|
24
24
|
"@datorama/akita": "^7.0.0",
|
|
25
25
|
"@ngx-translate/core": "^14.0.0",
|
|
26
|
-
"@recursyve/nice-ui-kit.v2": "
|
|
27
|
-
"@recursyve/ngx-form-generator": "
|
|
26
|
+
"@recursyve/nice-ui-kit.v2": ">= 13.1.0-beta.88",
|
|
27
|
+
"@recursyve/ngx-form-generator": ">= 13.0.0-beta.27"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"tslib": "^2.0.0"
|