@sumaris-net/ngx-components 18.22.13 → 18.22.15
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 +7 -0
- package/esm2022/public_api.mjs +2 -1
- package/esm2022/src/app/shared/observables.mjs +8 -4
- package/esm2022/src/app/shared/services/memory-entity-service.class.mjs +24 -19
- package/esm2022/src/app/shared/services/startable-observable-service.class.mjs +36 -10
- package/esm2022/src/app/shared/services/startable-service.class.mjs +20 -9
- package/fesm2022/sumaris-net.ngx-components.mjs +79 -34
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/src/app/shared/inputs.d.ts +1 -1
- package/src/app/shared/observables.d.ts +2 -0
- package/src/app/shared/services/memory-entity-service.class.d.ts +17 -10
- package/src/app/shared/services/startable-observable-service.class.d.ts +16 -1
- package/src/app/shared/services/startable-service.class.d.ts +2 -1
- package/src/assets/manifest.json +1 -1
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -115,6 +115,7 @@ export * from './src/app/shared/debug/debug-service.class';
|
|
|
115
115
|
export * from './src/app/shared/types';
|
|
116
116
|
export * from './src/app/shared/dates';
|
|
117
117
|
export * from './src/app/shared/functions';
|
|
118
|
+
export * from './src/app/shared/focusable';
|
|
118
119
|
export * from './src/app/shared/regexps';
|
|
119
120
|
export * from './src/app/shared/services';
|
|
120
121
|
export * from './src/app/shared/forms';
|
|
@@ -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):
|
|
20
|
+
export declare function tabindexComparator(a: InputElement, b: InputElement): 0 | 1 | -1;
|
|
21
21
|
export interface CanGainFocusOptions {
|
|
22
22
|
minTabindex?: number;
|
|
23
23
|
maxTabindex?: number;
|
|
@@ -12,12 +12,14 @@ export declare interface WaitForOptions extends FirstOptions {
|
|
|
12
12
|
export declare function filterNotNil<T = any>(obs: Observable<T>): Observable<T>;
|
|
13
13
|
export declare function filterTrue(obs: Observable<boolean>): Observable<boolean>;
|
|
14
14
|
export declare function filterFalse(obs: Observable<boolean>): Observable<boolean>;
|
|
15
|
+
export declare function decorateWithTakeUntil<T = any>(obs: Observable<T>, opts?: FirstOptions): Observable<T>;
|
|
15
16
|
export declare function firstNotNil<T = any>(obs: Observable<T>, opts?: FirstOptions): Observable<T>;
|
|
16
17
|
export declare function firstTrue<T = void>(obs: Observable<boolean>, opts?: FirstOptions, result?: T): Observable<T>;
|
|
17
18
|
export declare function firstFalse<T = void>(obs: Observable<boolean>, opts?: FirstOptions, result?: T): Observable<T>;
|
|
18
19
|
export declare function firstTruePromise(obs: Observable<boolean>, opts?: FirstOptions): Promise<void>;
|
|
19
20
|
export declare function firstFalsePromise(obs: Observable<boolean>, opts?: FirstOptions): Promise<void>;
|
|
20
21
|
export declare function firstNotNilPromise<T = any>(obs: Observable<T>, opts?: FirstOptions): Promise<T>;
|
|
22
|
+
export declare function firstPromise<T = any>(obs: Observable<T>, opts?: FirstOptions): Promise<T>;
|
|
21
23
|
export declare function chainPromises<T = any>(defers: (() => Promise<any>)[]): Promise<T[]>;
|
|
22
24
|
/**
|
|
23
25
|
* Wait form a predicate return true. This need to implement AppFormUtils.waitWhilePending(), AppFormUtils.waitIdle()
|
|
@@ -18,27 +18,34 @@ export interface InMemoryEntitiesServiceOptions<T, F> {
|
|
|
18
18
|
[key: string]: string;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
export declare class InMemoryEntitiesService<T extends IEntity<T, ID>, F = any, ID = number, O extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions> extends StartableObservableService<T[], T[]> implements IEntitiesService<T, F, O>, OnDestroy {
|
|
21
|
+
export declare class InMemoryEntitiesService<T extends IEntity<T, ID>, F = any, ID = number, O extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions, SO extends InMemoryEntitiesServiceOptions<T, F> = InMemoryEntitiesServiceOptions<T, F>> extends StartableObservableService<T[], T[]> implements IEntitiesService<T, F, O>, OnDestroy {
|
|
22
22
|
protected dataType: new () => T;
|
|
23
23
|
protected filterType: new () => F;
|
|
24
24
|
debug: boolean;
|
|
25
25
|
private _hiddenData;
|
|
26
26
|
readonly dirtySubject: BehaviorSubject<boolean>;
|
|
27
27
|
readonly savingSubject: BehaviorSubject<boolean>;
|
|
28
|
-
protected
|
|
28
|
+
protected sortByReplacement: {
|
|
29
29
|
[key: string]: string;
|
|
30
30
|
};
|
|
31
|
-
private
|
|
32
|
-
private
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
private
|
|
31
|
+
private _sortFn;
|
|
32
|
+
private _onLoad;
|
|
33
|
+
private _onSaveFn;
|
|
34
|
+
private _equalsFn;
|
|
35
|
+
private _filterFnFactory;
|
|
36
36
|
get defaultFetchPolicy(): 'cache-only';
|
|
37
37
|
set value(data: T[]);
|
|
38
38
|
get value(): T[];
|
|
39
39
|
get saving(): boolean;
|
|
40
40
|
get dirty(): boolean;
|
|
41
|
-
constructor(dataType: new () => T, filterType: new () => F, options?:
|
|
41
|
+
constructor(dataType: new () => T, filterType: new () => F, options?: SO);
|
|
42
|
+
/**
|
|
43
|
+
* Configures and sets options for the instance.
|
|
44
|
+
*
|
|
45
|
+
* @param {SO} options - An object containing configuration options such as `onSort`, `onLoad`, `onSave`, `equals`, `filterFnFactory`, and `sortByReplacement`.
|
|
46
|
+
* @return {void} This method does not return a value.
|
|
47
|
+
*/
|
|
48
|
+
setOptions(options: SO): void;
|
|
42
49
|
protected ngOnStart(data?: T[]): Promise<T[]>;
|
|
43
50
|
protected ngOnStop(): Promise<void>;
|
|
44
51
|
ngOnDestroy(): void;
|
|
@@ -74,6 +81,6 @@ export declare class InMemoryEntitiesService<T extends IEntity<T, ID>, F = any,
|
|
|
74
81
|
protected waitWhileSaving(opts?: WaitForOptions): Promise<void>;
|
|
75
82
|
protected markAsSaving(): void;
|
|
76
83
|
protected markAsSaved(): void;
|
|
77
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<InMemoryEntitiesService<any, any, any, any>, never>;
|
|
78
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<InMemoryEntitiesService<any, any, any, any>, never, never, {}, {}, never, never, false, never>;
|
|
84
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InMemoryEntitiesService<any, any, any, any, any>, never>;
|
|
85
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<InMemoryEntitiesService<any, any, any, any, any>, never, never, {}, {}, never, never, false, never>;
|
|
79
86
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BehaviorSubject, Subject, Subscription } from 'rxjs';
|
|
2
2
|
import { IStartableService } from './startable-service.class';
|
|
3
|
+
import { FirstOptions } from '../observables';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
/**
|
|
5
6
|
* Same as StartableService, but with a dataSubject instead of a simple 'data' property
|
|
@@ -17,8 +18,22 @@ export declare abstract class StartableObservableService<T = any, O = any> imple
|
|
|
17
18
|
protected constructor(prerequisiteService?: {
|
|
18
19
|
ready: () => Promise<any>;
|
|
19
20
|
});
|
|
21
|
+
/**
|
|
22
|
+
* Initiates the startup process for the service. If the service is already started,
|
|
23
|
+
* it returns the existing data or ensures that the start process executes correctly.
|
|
24
|
+
*
|
|
25
|
+
* @param {O} [opts] - Optional configuration or parameters for the startup process.
|
|
26
|
+
* @return {Promise<T>} A promise that resolves with the service's initialized data, or null if an error occurs during the startup.
|
|
27
|
+
*/
|
|
20
28
|
start(opts?: O): Promise<T>;
|
|
21
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Prepares the service to be ready, ensuring any required setup or initialization is complete.
|
|
31
|
+
* This method will wait until the service is started, either directly or via a promise, before resolving.
|
|
32
|
+
*
|
|
33
|
+
* @param {FirstOptions} [opts] - Optional configuration options that may affect the readiness of the service.
|
|
34
|
+
* @return {Promise<T>} A promise that resolves with the service's data once it is ready.
|
|
35
|
+
*/
|
|
36
|
+
ready(opts?: FirstOptions): Promise<T>;
|
|
22
37
|
stop(): Promise<void>;
|
|
23
38
|
restart(opts?: O): Promise<T>;
|
|
24
39
|
get started(): boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Subject, Subscription } from 'rxjs';
|
|
2
|
+
import { FirstOptions } from '../observables';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
export interface IStartableService<T = any> {
|
|
4
5
|
started: boolean;
|
|
@@ -21,7 +22,7 @@ export declare abstract class StartableService<T = any, O = any> implements ISta
|
|
|
21
22
|
ready: () => Promise<any>;
|
|
22
23
|
});
|
|
23
24
|
start(opts?: O): Promise<T>;
|
|
24
|
-
ready(): Promise<T>;
|
|
25
|
+
ready(opts?: FirstOptions): Promise<T>;
|
|
25
26
|
stop(): Promise<void>;
|
|
26
27
|
restart(opts?: O): Promise<T>;
|
|
27
28
|
get started(): boolean;
|
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.15",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|