@sumaris-net/ngx-components 18.22.11 → 18.22.12
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/doc/changelog.md +3 -0
- package/esm2022/src/app/shared/material/autocomplete/material.autocomplete.config.mjs +1 -1
- package/esm2022/src/app/shared/material/autocomplete/material.autocomplete.mjs +4 -4
- package/esm2022/src/app/shared/services/entity-service.class.mjs +27 -1
- package/fesm2022/sumaris-net.ngx-components.mjs +29 -3
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/services/entity-service.class.d.ts +21 -2
- package/src/assets/manifest.json +1 -1
package/package.json
CHANGED
|
@@ -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
|
|
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<
|
|
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>;
|
package/src/assets/manifest.json
CHANGED
|
@@ -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.
|
|
5
|
+
"version": "18.22.12",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|