@sumaris-net/ngx-components 2.6.4-rc5 → 2.6.4-rc7
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/public_api.mjs +2 -1
- package/esm2020/src/app/shared/named-filter/named-filter.service.mjs +129 -0
- package/fesm2015/sumaris-net.ngx-components.mjs +7318 -7209
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +7113 -6998
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/src/app/shared/named-filter/named-filter.service.d.ts +80 -0
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -124,6 +124,7 @@ export * from './src/app/shared/validator/form-error-adapter.class';
|
|
|
124
124
|
export * from './src/app/shared/material/latlong/latlong.utils';
|
|
125
125
|
export * from './src/app/shared/debug/debug.module';
|
|
126
126
|
export * from './src/app/shared/debug/debug.component';
|
|
127
|
+
export * from './src/app/shared/named-filter/named-filter.service';
|
|
127
128
|
export * from './src/app/core/core.module';
|
|
128
129
|
export * from './src/app/core/services/model/account.model';
|
|
129
130
|
export * from './src/app/core/services/model/token.model';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { SortDirection } from '@angular/material/sort';
|
|
2
|
+
import { InjectionToken } from '@angular/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { Entity, EntityAsObjectOptions, IEntity } from '../../core/services/model/entity.model';
|
|
5
|
+
import { EntityFilter, IEntityFilter } from '../../core/services/model/filter.model';
|
|
6
|
+
import { EntitiesServiceLoadOptions, EntitiesServiceWatchOptions, IEntitiesService, IEntityService, LoadResult, SuggestService } from '../services/entity-service.class';
|
|
7
|
+
import { GraphqlService } from '../../core/graphql/graphql.service';
|
|
8
|
+
import { AccountService } from '../../core/services/account.service';
|
|
9
|
+
import { NetworkService } from '../../core/services/network.service';
|
|
10
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
11
|
+
import { BaseEntityGraphqlMutations, BaseEntityGraphqlQueries, BaseEntityService, BaseEntityServiceOptions } from '../../core/services/base-entity-service.class';
|
|
12
|
+
import { PlatformService } from '../../core/services/platform.service';
|
|
13
|
+
import { StoreObject } from '@apollo/client/core';
|
|
14
|
+
import * as i0 from "@angular/core";
|
|
15
|
+
export interface INamedFilter<T extends INamedFilter<T>> extends IEntity<T, number> {
|
|
16
|
+
name: string;
|
|
17
|
+
entityName: string;
|
|
18
|
+
content: any;
|
|
19
|
+
recorderPersonId: number;
|
|
20
|
+
recorderDepartmentId: number;
|
|
21
|
+
}
|
|
22
|
+
export declare class NamedFilter<T extends NamedFilter<any> = NamedFilter<any>> extends Entity<T, number> implements INamedFilter<T> {
|
|
23
|
+
static fromObject: (source: any, opts?: any) => NamedFilter;
|
|
24
|
+
name: string;
|
|
25
|
+
entityName: string;
|
|
26
|
+
content: any;
|
|
27
|
+
recorderPersonId: number;
|
|
28
|
+
recorderDepartmentId: number;
|
|
29
|
+
fromObject(source: any, opts?: any): void;
|
|
30
|
+
asObject(opts?: EntityAsObjectOptions): StoreObject;
|
|
31
|
+
}
|
|
32
|
+
export interface INamedFilterFilter<T extends INamedFilter<T>> extends IEntityFilter<any, T> {
|
|
33
|
+
searchText: string;
|
|
34
|
+
entityName: string;
|
|
35
|
+
recorderPersonId: number;
|
|
36
|
+
recorderDepartmentId: number;
|
|
37
|
+
}
|
|
38
|
+
export declare class NamedFilterFilter<F extends NamedFilterFilter<any, T> = NamedFilterFilter<any, any>, T extends NamedFilter<any> = NamedFilter<any>> extends EntityFilter<F, T> implements INamedFilterFilter<T> {
|
|
39
|
+
static fromObject: (source: any, opts?: any) => NamedFilterFilter;
|
|
40
|
+
searchText: string;
|
|
41
|
+
entityName: string;
|
|
42
|
+
recorderPersonId: number;
|
|
43
|
+
recorderDepartmentId: number;
|
|
44
|
+
fromObject(source: any, opts?: any): void;
|
|
45
|
+
}
|
|
46
|
+
export declare const APP_NAMED_FILTER_SERVICE: InjectionToken<INamedFilterService<any, any>>;
|
|
47
|
+
export interface INamedFilterServiceWatchOptions extends EntitiesServiceWatchOptions {
|
|
48
|
+
withContent: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface INamedFilterServiceLoadOptions extends EntitiesServiceLoadOptions {
|
|
51
|
+
withContent: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface INamedFilterService<T extends INamedFilter<T>, F extends EntityFilter<F, T>> extends IEntitiesService<T, F, INamedFilterServiceWatchOptions>, IEntityService<T, number, INamedFilterServiceLoadOptions>, SuggestService<T, F> {
|
|
54
|
+
defaultFilter(): F;
|
|
55
|
+
suggestFilter(searchText: string, filter?: Partial<F>): F;
|
|
56
|
+
}
|
|
57
|
+
interface INamedFilterQueries extends BaseEntityGraphqlQueries {
|
|
58
|
+
loadAllWithContent: any;
|
|
59
|
+
}
|
|
60
|
+
export declare abstract class AbstractNamedFilterService<T extends NamedFilter<T>, F extends NamedFilterFilter<F, T>, WO extends INamedFilterServiceWatchOptions = INamedFilterServiceWatchOptions, LO extends INamedFilterServiceLoadOptions = INamedFilterServiceLoadOptions, Q extends INamedFilterQueries = INamedFilterQueries, M extends BaseEntityGraphqlMutations = BaseEntityGraphqlMutations> extends BaseEntityService<T, F, number, WO, LO, Q, M> implements INamedFilterService<T, F> {
|
|
61
|
+
protected graphql: GraphqlService;
|
|
62
|
+
protected platform: PlatformService;
|
|
63
|
+
protected accountService: AccountService;
|
|
64
|
+
protected dataType: new () => T;
|
|
65
|
+
protected filterType: new () => F;
|
|
66
|
+
protected network: NetworkService;
|
|
67
|
+
protected translate: TranslateService;
|
|
68
|
+
protected options: BaseEntityServiceOptions<T, number, Q, M>;
|
|
69
|
+
protected constructor(graphql: GraphqlService, platform: PlatformService, accountService: AccountService, dataType: new () => T, filterType: new () => F, network: NetworkService, translate: TranslateService, options: BaseEntityServiceOptions<T, number, Q, M>);
|
|
70
|
+
abstract defaultFilter(): F;
|
|
71
|
+
watchAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: F, options?: WO): Observable<LoadResult<T>>;
|
|
72
|
+
loadAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: Partial<F>, options?: LO & {
|
|
73
|
+
debug?: boolean;
|
|
74
|
+
}): Promise<LoadResult<T>>;
|
|
75
|
+
suggest(value: any, filter: Partial<F>): Promise<LoadResult<T>>;
|
|
76
|
+
suggestFilter(searchText: string, filter?: Partial<F>): F;
|
|
77
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractNamedFilterService<any, any, any, any, any, any>, never>;
|
|
78
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractNamedFilterService<any, any, any, any, any, any>, never, never, {}, {}, never, never, false>;
|
|
79
|
+
}
|
|
80
|
+
export {};
|