@sumaris-net/ngx-components 18.8.26 → 18.9.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.8.26",
4
+ "version": "18.9.1",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -1,5 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ApolloCache, InternalRefetchQueriesInclude, MutationUpdaterFn, MutationUpdaterFunction } from '@apollo/client/core';
2
+ import { ApolloCache, InternalRefetchQueriesInclude, MutationUpdaterFn, MutationUpdaterFunction, WatchQueryFetchPolicy } from '@apollo/client/core';
3
3
  import { SortDirection } from '@angular/material/sort';
4
4
  import { BaseGraphqlService } from './base-graphql-service.class';
5
5
  import { EntitiesServiceLoadOptions, EntitiesServiceWatchOptions, EntityServiceListenChangesOptions, IEntitiesService, IEntityService, LoadResult } from '../../shared/services/entity-service.class';
@@ -72,6 +72,7 @@ export declare abstract class BaseEntityService<T extends Entity<T, ID>, F exten
72
72
  protected readonly defaultSortBy: keyof T;
73
73
  protected readonly defaultSortDirection: SortDirection;
74
74
  protected readonly watchQueriesUpdatePolicy: MutableWatchQueriesUpdatePolicy;
75
+ get defaultFetchPolicy(): WatchQueryFetchPolicy;
75
76
  protected constructor(graphql: GraphqlService, platform: PlatformService, dataType: new () => T, filterType: new () => F, options: BaseEntityServiceOptions<T, ID, Q, M, S>);
76
77
  watch(id: number, opts?: WO): Observable<T>;
77
78
  load(id: ID, opts?: LO): Promise<T>;
@@ -5,6 +5,7 @@ import { OnDestroy } from '@angular/core';
5
5
  import { SortDirection } from '@angular/material/sort';
6
6
  import { CollectionViewer } from '@angular/cdk/collections';
7
7
  import { EntitiesServiceWatchOptions, FetchMoreFn, IEntitiesService, LoadResult } from '../../shared/services/entity-service.class';
8
+ import { FirstOptions } from '../../shared/observables';
8
9
  import { IEntitiesTableDataSource } from './table.model';
9
10
  import * as i0 from "@angular/core";
10
11
  export interface EntitiesAsyncTableDataSourceConfig<T extends IEntity<T, ID>, ID = number, WO extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions, SO = any> extends TableDataSourceConfig {
@@ -39,9 +40,8 @@ export declare class EntitiesAsyncTableDataSource<T extends IEntity<T, ID>, F =
39
40
  *
40
41
  * @param dataService A service to load and save data
41
42
  * @param dataType Type of data contained by the Table. If not specified, then `data` with at least one element must be specified.
42
- * @param environment
43
43
  * @param validatorService Service that create instances of the FormGroup used to validate row fields.
44
- * @param config Additional configuration for table.
44
+ * @param options Additional options
45
45
  */
46
46
  constructor(dataType: new () => T, dataService: IEntitiesService<T, F, WO>, validatorService?: V, options?: C);
47
47
  ngOnDestroy(): void;
@@ -52,8 +52,26 @@ export declare class EntitiesAsyncTableDataSource<T extends IEntity<T, ID>, F =
52
52
  emitEvent: boolean;
53
53
  }): void;
54
54
  connect(collectionViewer: CollectionViewer): Observable<R[] | ReadonlyArray<R>>;
55
+ /**
56
+ * Disconnects the data source, cleaning up any resources and subscriptions.
57
+ *
58
+ * @param {CollectionViewer} [collectionViewer] - Optional parameter representing the collection viewer to disconnect from.
59
+ * @return {void} - This method does not return a value.
60
+ */
55
61
  disconnect(collectionViewer?: CollectionViewer): void;
56
- waitIdle(debounceTimeMs?: number): Promise<any>;
62
+ /**
63
+ * Waits for the idle state based on the provided options.
64
+ *
65
+ * @param {number | { debounceTimeMs?: number } & FirstOptions} [opts] Options for controlling the wait behavior.
66
+ * - If a number is provided, it is treated as the debounce time in milliseconds.
67
+ * - If an object is provided, it can include the following properties:
68
+ * - debounceTimeMs: The debounce time in milliseconds. Defaults to 100 if not specified.
69
+ * - Additional options from `FirstOptions` interface.
70
+ * @return {Promise<any>} A Promise that resolves when the idle state is reached.
71
+ */
72
+ waitIdle(opts?: number | ({
73
+ debounceTimeMs?: number;
74
+ } & FirstOptions)): Promise<any>;
57
75
  confirmCreate(row: R): Promise<boolean>;
58
76
  confirmEdit(row: R): Promise<boolean>;
59
77
  startEdit(row: R): Promise<boolean>;
@@ -5,6 +5,7 @@ import { OnDestroy } from '@angular/core';
5
5
  import { SortDirection } from '@angular/material/sort';
6
6
  import { CollectionViewer } from '@angular/cdk/collections';
7
7
  import { EntitiesServiceWatchOptions, FetchMoreFn, IEntitiesService, LoadResult } from '../../shared/services/entity-service.class';
8
+ import { FirstOptions } from '../../shared/observables';
8
9
  import { IEntitiesTableDataSource } from './table.model';
9
10
  import * as i0 from "@angular/core";
10
11
  export interface EntitiesTableDataSourceConfig<T extends IEntity<T, ID>, ID = number, WO extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions, SO = any> extends TableDataSourceConfig {
@@ -48,14 +49,10 @@ export declare class EntitiesTableDataSource<T extends IEntity<T, ID>, F = any,
48
49
  *
49
50
  * @param dataService A service to load and save data
50
51
  * @param dataType Type of data contained by the Table. If not specified, then `data` with at least one element must be specified.
51
- * @param environment
52
52
  * @param validatorService Service that create instances of the FormGroup used to validate row fields.
53
- * @param config Additional configuration for table.
53
+ * @param options Additional options
54
54
  */
55
55
  constructor(dataType: new () => T, dataService: IEntitiesService<T, F, WO>, validatorService?: V, options?: C);
56
- /**
57
- * @deprecated use disconnect
58
- */
59
56
  ngOnDestroy(): void;
60
57
  /**
61
58
  * @deprecated use disconnect
@@ -68,8 +65,26 @@ export declare class EntitiesTableDataSource<T extends IEntity<T, ID>, F = any,
68
65
  emitEvent: boolean;
69
66
  }): void;
70
67
  connect(collectionViewer: CollectionViewer): Observable<R[] | ReadonlyArray<R>>;
68
+ /**
69
+ * Disconnects the data source, cleaning up any resources and subscriptions.
70
+ *
71
+ * @param {CollectionViewer} [collectionViewer] - Optional parameter representing the collection viewer to disconnect from.
72
+ * @return {void} - This method does not return a value.
73
+ */
71
74
  disconnect(collectionViewer?: CollectionViewer): void;
72
- waitIdle(debounceTimeMs?: number): Promise<any>;
75
+ /**
76
+ * Waits for the idle state based on the provided options.
77
+ *
78
+ * @param {number | { debounceTimeMs?: number } & FirstOptions} [opts] Options for controlling the wait behavior.
79
+ * - If a number is provided, it is treated as the debounce time in milliseconds.
80
+ * - If an object is provided, it can include the following properties:
81
+ * - debounceTimeMs: The debounce time in milliseconds. Defaults to 100 if not specified.
82
+ * - Additional options from `FirstOptions` interface.
83
+ * @return {Promise<any>} A Promise that resolves when the idle state is reached.
84
+ */
85
+ waitIdle(opts?: number | ({
86
+ debounceTimeMs?: number;
87
+ } & FirstOptions)): Promise<any>;
73
88
  confirmCreate(row: R): boolean;
74
89
  confirmEdit(row: R): boolean;
75
90
  startEdit(row: R): boolean;
@@ -391,7 +391,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
391
391
  private checkIfRowPristine;
392
392
  private checkIfPristine;
393
393
  private applyFilter;
394
- private listenDatasourceLoading;
394
+ private listenDataSourceLoading;
395
395
  private startCellValueChanges;
396
396
  private stopCellValueChanges;
397
397
  static ɵfac: i0.ɵɵFactoryDeclaration<AppTable<any, any, any>, never>;
@@ -140,6 +140,11 @@ export declare function collectByProperty<T>(values: T[], propertyName: keyof T)
140
140
  */
141
141
  export declare function equals(o1: any, o2: any): boolean;
142
142
  export declare class Beans {
143
+ /**
144
+ * Deep clone.
145
+ * See https://github.com/pvorb/clone
146
+ */
147
+ static clone: any;
143
148
  /**
144
149
  * Copy a source object, by including only properties of the given dataType.
145
150
  * IMPORTANT: extra properties that are NOT in the targetClass are NOT copied.
@@ -62,6 +62,7 @@ export declare interface EntitiesServiceWatchOptions<T = any> extends EntityServ
62
62
  withTotal?: boolean;
63
63
  }
64
64
  export declare interface IEntitiesService<T, F, O extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions<T>> {
65
+ readonly defaultFetchPolicy?: WatchQueryFetchPolicy;
65
66
  watchAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: Partial<F>, options?: O): Observable<LoadResult<T>>;
66
67
  saveAll(data: T[], opts?: any): Promise<T[]>;
67
68
  deleteAll(data: T[], opts?: any): Promise<any>;
@@ -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.26",
5
+ "version": "18.9.1",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{