@sumaris-net/ngx-components 18.22.11 → 18.22.13

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.22.11",
4
+ "version": "18.22.13",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -129,6 +129,9 @@ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, I
129
129
  get pending(): boolean;
130
130
  get touched(): boolean;
131
131
  get untouched(): boolean;
132
+ get loading(): boolean;
133
+ get loaded(): boolean;
134
+ get saving(): boolean;
132
135
  disable(opts?: {
133
136
  onlySelf?: boolean;
134
137
  emitEvent?: boolean;
@@ -181,8 +184,6 @@ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, I
181
184
  markAsNotReady(opts?: {
182
185
  emitEvent?: boolean;
183
186
  }): void;
184
- get loading(): boolean;
185
- get loaded(): boolean;
186
187
  enableSort(): void;
187
188
  disableSort(): void;
188
189
  set pageSize(value: number);
@@ -134,6 +134,9 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
134
134
  get pending(): boolean;
135
135
  get touched(): boolean;
136
136
  get untouched(): boolean;
137
+ get loading(): boolean;
138
+ get loaded(): boolean;
139
+ get saving(): boolean;
137
140
  disable(opts?: {
138
141
  onlySelf?: boolean;
139
142
  emitEvent?: boolean;
@@ -186,8 +189,6 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
186
189
  markAsNotReady(opts?: {
187
190
  emitEvent?: boolean;
188
191
  }): void;
189
- get loading(): boolean;
190
- get loaded(): boolean;
191
192
  enableSort(): void;
192
193
  disableSort(): void;
193
194
  set pageSize(value: number);
@@ -17,7 +17,7 @@ export interface InputElement extends FocusableElement {
17
17
  }
18
18
  export declare function isInputElement(object: any): object is InputElement;
19
19
  export declare function asInputElement<T = any>(object: ElementRef<T>): InputElement | undefined;
20
- export declare function tabindexComparator(a: InputElement, b: InputElement): 0 | 1 | -1;
20
+ export declare function tabindexComparator(a: InputElement, b: InputElement): 1 | 0 | -1;
21
21
  export interface CanGainFocusOptions {
22
22
  minTabindex?: number;
23
23
  maxTabindex?: number;
@@ -16,12 +16,12 @@ export declare interface LoadResult<T> {
16
16
  errors?: any[];
17
17
  fetchMore?: FetchMoreFn<LoadResult<T>>;
18
18
  }
19
- export type SuggestFn<T, F> = (value: any, filter?: F, sortBy?: string | keyof T, sortDirection?: SortDirection, opts?: {
19
+ export type SuggestFn<T, F, R = T[] | LoadResult<T>> = (value: any, filter?: F, sortBy?: string | keyof T, sortDirection?: SortDirection, opts?: {
20
20
  fetchPolicy?: FetchPolicy;
21
21
  offset?: number;
22
22
  size?: number;
23
23
  [key: string]: any;
24
- }) => Promise<T[] | LoadResult<T>>;
24
+ }) => Promise<R>;
25
25
  export declare interface SuggestService<T, F> {
26
26
  suggest: SuggestFn<T, F>;
27
27
  }
@@ -93,5 +93,24 @@ export declare interface IEntitiesService<T, F, O extends EntitiesServiceWatchOp
93
93
  export type LoadResultByPageFn<T> = (offset: number, size: number) => Promise<LoadResult<T>>;
94
94
  export interface IEntityFullService<T, ID, F, O extends EntitiesServiceWatchOptions & EntityServiceLoadOptions> extends IEntityService<T, ID, O>, IEntitiesService<T, F, O> {
95
95
  }
96
+ /**
97
+ * Merges two LoadResult objects into a single LoadResult object by combining their data arrays and summing their total counts.
98
+ *
99
+ * @param {LoadResult<T>} res1 - The first LoadResult object to merge.
100
+ * @param {LoadResult<T>} res2 - The second LoadResult object to merge.
101
+ * @return {LoadResult<T>} A new LoadResult object containing the combined data and total count from both input objects.
102
+ */
96
103
  export declare function mergeLoadResult<T>(res1: LoadResult<T>, res2: LoadResult<T>): LoadResult<T>;
104
+ /**
105
+ * Converts an array of items or an already structured LoadResult object
106
+ * into a LoadResult object.
107
+ *
108
+ * @param {T[] | LoadResult<T>} res - The input which can either be an
109
+ * array of items or a LoadResult object.
110
+ *
111
+ * @return {LoadResult<T>} Returns a LoadResult object. If the input is
112
+ * an array, it is converted into a LoadResult object with the data property
113
+ * containing the array. If the input is already a LoadResult, it is returned as is.
114
+ */
115
+ export declare function toLoadResult<T>(res: T[] | LoadResult<T>): LoadResult<T> | T[];
97
116
  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.22.11",
5
+ "version": "18.22.13",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{