@sumaris-net/ngx-components 18.21.14 → 18.22.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sumaris-net/ngx-components",
3
3
  "description": "SUMARiS Angular components",
4
- "version": "18.21.14",
4
+ "version": "18.22.1",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -6,7 +6,11 @@ import { FilterFn } from '../../shared/types';
6
6
  export declare class PersonFilter extends EntityFilter<PersonFilter, Person> {
7
7
  static FIELDS: (keyof PersonFilter)[];
8
8
  static fromObject: (source: any, opts?: any) => PersonFilter;
9
- static searchFilter(source: any): FilterFn<Person>;
9
+ static asFilterFn(source: any): FilterFn<Person>;
10
+ /**
11
+ * @deprecated Use `PersonFilter.asFilterFn` instead
12
+ */
13
+ static searchFilter: typeof PersonFilter.asFilterFn;
10
14
  email: string;
11
15
  pubkey: string;
12
16
  searchText: string;
@@ -5,21 +5,16 @@ export interface IEntityFilter<F extends IEntityFilter<F, T, ID, AO, FO>, T exte
5
5
  asFilterFn(): FilterFn<T>;
6
6
  isEmpty(): boolean;
7
7
  countNotEmptyCriteria(): number;
8
+ and(...filters: F[]): F;
9
+ or(...filters: F[]): F;
10
+ not(): F;
8
11
  }
9
12
  export declare abstract class EntityFilter<F extends IEntityFilter<F, T, ID, AO, FO>, T extends IEntity<T, any>, ID = number, AO extends EntityAsObjectOptions = EntityAsObjectOptions, FO = any> extends Entity<F, ID, AO, FO> implements IEntityFilter<F, T, ID, AO, FO> {
10
- /**
11
- * Compose some filter functions: all should return true
12
- *
13
- * @param filterFns
14
- */
15
- static composeFilters<T extends IEntity<T, any>>(filterFns: FilterFn<T>[]): FilterFn<T>;
16
- static compose<F extends EntityFilter<F, T>, T extends IEntity<T, any>>(filters: F[]): FilterFn<T>;
17
- /**
18
- * Compose some filter functions: all should return true
19
- *
20
- * @param filterFns
21
- */
22
- static composeFns<T extends IEntity<T, any>>(filterFns: FilterFn<T>[]): FilterFn<T>;
13
+ protected __and?: F[];
14
+ protected __or?: F[];
15
+ protected __not?: boolean;
16
+ static andFns<T extends IEntity<T, any>>(filterFns: FilterFn<T>[]): FilterFn<T>;
17
+ static orFns<T extends IEntity<T, any>>(filterFns: FilterFn<T>[]): FilterFn<T>;
23
18
  constructor(__typename?: string);
24
19
  /**
25
20
  * Clean a filter, before sending to the pod (e.g convert dates, remove internal properties, etc.)
@@ -28,9 +23,30 @@ export declare abstract class EntityFilter<F extends IEntityFilter<F, T, ID, AO,
28
23
  isEmpty(): boolean;
29
24
  countNotEmptyCriteria(): number;
30
25
  asFilterFn(): FilterFn<T>;
26
+ and(...filters: F[]): F;
27
+ or(...filters: F[]): F;
28
+ not(): F;
29
+ asObject(opts?: AO): any;
30
+ fromObject(source: any, opts?: FO): void;
31
31
  protected buildFilter(): FilterFn<T>[];
32
32
  protected isCriteriaNotEmpty(key: string, value: any): boolean;
33
33
  }
34
+ export declare class OrFilter<T extends IEntity<T, any>> extends EntityFilter<OrFilter<T>, T> {
35
+ protected filters: EntityFilter<any, T>[];
36
+ constructor(...filters: EntityFilter<any, T>[]);
37
+ protected buildFilter(): FilterFn<T>[];
38
+ }
39
+ export declare class NotFilter<T extends IEntity<T, any>> extends EntityFilter<NotFilter<T>, T> {
40
+ protected filter: EntityFilter<any, T>;
41
+ constructor(filter: EntityFilter<any, T>);
42
+ protected buildFilter(): FilterFn<T>[];
43
+ }
44
+ export declare class AndFilter<T extends IEntity<T, any>> extends EntityFilter<AndFilter<T>, T> {
45
+ protected filters: EntityFilter<any, T>[];
46
+ constructor(...filters: EntityFilter<any, T>[]);
47
+ and(...filters: EntityFilter<any, T>[]): AndFilter<T>;
48
+ protected buildFilter(): FilterFn<T>[];
49
+ }
34
50
  export declare abstract class EntityFilterUtils {
35
51
  static isEntityFilter<F extends EntityFilter<F, any>>(obj: Partial<F>): obj is F;
36
52
  static fromObject<F>(source: any, filterType: new () => F): F;
@@ -2,7 +2,7 @@
2
2
  "name": "ngx-sumaris-components",
3
3
  "short_name": "ngx-sumaris-components",
4
4
  "manifest_version": 1,
5
- "version": "18.21.14",
5
+ "version": "18.22.1",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{