@sumaris-net/ngx-components 18.8.14 → 18.8.16

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.8.14",
4
+ "version": "18.8.16",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -24,7 +24,7 @@ export interface IEntity<T, ID = number, AO extends EntityAsObjectOptions = Enti
24
24
  asObject(opts?: AO): any;
25
25
  fromObject(source: any, opts?: FO): void;
26
26
  }
27
- export declare type OmitFunctions<T extends IEntity<T, ID>, ID = any> = {
27
+ export declare type OmitFunctions<T extends IEntity<T, any>> = {
28
28
  [K in keyof T as T[K] extends Function ? never : K]: T[K];
29
29
  };
30
30
  export declare abstract class Entity<T extends Entity<T, ID, AO, FO>, ID = number, AO extends EntityAsObjectOptions = EntityAsObjectOptions, FO = any> implements IEntity<T, ID, AO, FO> {
@@ -55,15 +55,15 @@ export declare abstract class EntityUtils {
55
55
  static getMapAsArray<T = any>(source?: ObjectMap<T>): ObjectMapEntry<T>[];
56
56
  static getPropertyArrayAsObject: typeof AppPropertiesUtils.arrayAsObject;
57
57
  static copyIdAndUpdateDate<T extends Entity<any, any, any>>(source: T, target: T): void;
58
- static fillLocalIds<T extends IEntity<T>>(items: T[], sequenceFactory: (firstEntity: T, incrementSize: number) => Promise<number>): Promise<void>;
59
- static cleanIdAndUpdateDate<T extends IEntity<T, ID>, ID = any>(source: T): void;
60
- static cleanIdsAndUpdateDates<T extends IEntity<T, ID>, ID = any>(items: T[]): void;
61
- static sort<T extends IEntity<T> | any>(data: T[], sortBy?: keyof T | string, sortDirection?: SortDirection): T[];
62
- static sortComparator<T extends IEntity<T> | any>(sortBy?: keyof T | string, sortDirection?: SortDirection): (a: T, b: T) => number;
63
- static compare<T extends IEntity<any>>(value1: T, value2: T, direction: 1 | -1, checkAttribute?: keyof T): number;
58
+ static fillLocalIds<T extends IEntity<T, any>>(items: T[], sequenceFactory: (firstEntity: T, incrementSize: number) => Promise<number>): Promise<void>;
59
+ static cleanIdAndUpdateDate<T extends IEntity<T, any>>(source: T): void;
60
+ static cleanIdsAndUpdateDates<T extends IEntity<T, any>>(items: T[]): void;
61
+ static sort<T extends IEntity<T, any> | any>(data: T[], sortBy?: keyof T | string, sortDirection?: SortDirection): T[];
62
+ static sortComparator<T extends IEntity<T, any> | any>(sortBy?: keyof T | string, sortDirection?: SortDirection): (a: T, b: T) => number;
63
+ static compare<T extends IEntity<T, any>>(value1: T, value2: T, direction: 1 | -1, checkAttribute?: keyof T): number;
64
64
  static compareValue<T>(value1: T, value2: T, direction: 1 | -1): number;
65
- static filter<T extends IEntity<T> | any>(data: T[], searchAttribute: string, searchText: string): T[];
66
- static searchTextFilter<T extends IEntity<T> | any>(searchAttribute: string | string[], searchText: string): FilterFn<T>;
65
+ static filter<T extends IEntity<T, any> | any>(data: T[], searchAttribute: string, searchText: string): T[];
66
+ static searchTextFilter<T extends IEntity<T, any> | any>(searchAttribute: string | string[], searchText: string): FilterFn<T>;
67
67
  /**
68
68
  * Transform a batch entity tree into a array list. This method keep links parent/children.
69
69
  *
@@ -106,4 +106,5 @@ export declare abstract class EntityUtils {
106
106
  static collectById<T extends IEntity<T, ID>, ID = any>(entities: T[]): ID[];
107
107
  static arrayDistinctFilterFn<E extends IEntity<any, any>>(item: E, index: number, values: E[]): boolean;
108
108
  static findById<E extends IEntity<any, ID> = IEntity<any, any>, ID = number>(items: E[], id: ID): E | undefined;
109
+ static fromObject<E extends IEntity<any, any>>(source: any, dataType: new () => E): E;
109
110
  }
@@ -13,7 +13,7 @@ export declare abstract class EntityFilter<F extends EntityFilter<F, T, ID, AO,
13
13
  * @param filterFns
14
14
  */
15
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>>(filters: F[]): FilterFn<T>;
16
+ static compose<F extends EntityFilter<F, T>, T extends IEntity<T, any>>(filters: F[]): FilterFn<T>;
17
17
  /**
18
18
  * Compose some filter functions: all should return true
19
19
  *
@@ -71,3 +71,4 @@ export declare type LoadResultByPageFn<T> = (offset: number, size: number) => Pr
71
71
  export interface IEntityFullService<T, ID, F, O extends EntitiesServiceWatchOptions & EntityServiceLoadOptions> extends IEntityService<T, ID, O>, IEntitiesService<T, F, O> {
72
72
  }
73
73
  export declare function mergeLoadResult<T>(res1: LoadResult<T>, res2: LoadResult<T>): LoadResult<T>;
74
+ export declare function isEntityService<T, ID>(service: any): service is IEntityService<T, ID>;
@@ -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.8.14",
5
+ "version": "18.8.16",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{