@sumaris-net/ngx-components 2.4.85 → 2.4.86-rc1
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/esm2020/src/app/core/form/entity/entity-editor.class.mjs +34 -25
- package/esm2020/src/app/core/services/account.service.mjs +15 -19
- package/esm2020/src/app/core/services/local-settings.service.mjs +4 -4
- package/esm2020/src/app/core/services/model/config.model.mjs +3 -3
- package/esm2020/src/app/shared/functions.mjs +4 -1
- package/esm2020/src/app/shared/material/datetime/material.date.mjs +3 -3
- package/esm2020/src/app/shared/services/startable-service.class.mjs +6 -1
- package/fesm2015/sumaris-net.ngx-components.mjs +64 -47
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +59 -47
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/entity/entity-editor.class.d.ts +28 -25
- package/src/app/core/services/account.service.d.ts +0 -2
- package/src/app/core/services/platform.service.d.ts +2 -2
- package/src/app/shared/file/file.utils.d.ts +1 -1
- package/src/app/shared/functions.d.ts +1 -0
- package/src/app/shared/services/startable-service.class.d.ts +1 -0
package/package.json
CHANGED
|
@@ -46,6 +46,20 @@ export interface AppErrorWithDetails extends AppError {
|
|
|
46
46
|
export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends IEntityService<T, ID> = IEntityService<T, any>, ID = number> extends AppTabEditor<T, ID, EntityServiceLoadOptions> implements OnInit, OnDestroy, AfterViewInit, IAppEntityEditor {
|
|
47
47
|
protected dataType: new () => T;
|
|
48
48
|
protected dataService?: S;
|
|
49
|
+
data: T;
|
|
50
|
+
defaultBackHref: string;
|
|
51
|
+
historyIcon: {
|
|
52
|
+
icon?: string;
|
|
53
|
+
matIcon?: string;
|
|
54
|
+
};
|
|
55
|
+
$title: Subject<string>;
|
|
56
|
+
onUpdateView: EventEmitter<T>;
|
|
57
|
+
protected readonly dateFormat: DateFormatService;
|
|
58
|
+
protected readonly cd: ChangeDetectorRef;
|
|
59
|
+
protected readonly settings: LocalSettingsService;
|
|
60
|
+
protected readonly environment: Environment;
|
|
61
|
+
protected readonly routerOutlet: IonRouterOutlet;
|
|
62
|
+
protected errorTranslator: FormErrorTranslator;
|
|
49
63
|
private _usageMode;
|
|
50
64
|
private readonly _enableListenChanges;
|
|
51
65
|
private readonly _listenIntervalInSeconds;
|
|
@@ -55,20 +69,6 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
|
|
|
55
69
|
private readonly _autoUpdateRoute;
|
|
56
70
|
private _autoOpenNextTab;
|
|
57
71
|
private _listenChangesSubscription;
|
|
58
|
-
protected readonly dateFormat: DateFormatService;
|
|
59
|
-
protected readonly cd: ChangeDetectorRef;
|
|
60
|
-
protected readonly settings: LocalSettingsService;
|
|
61
|
-
protected readonly environment: Environment;
|
|
62
|
-
protected readonly routerOutlet: IonRouterOutlet;
|
|
63
|
-
protected errorTranslator: FormErrorTranslator;
|
|
64
|
-
data: T;
|
|
65
|
-
defaultBackHref: string;
|
|
66
|
-
historyIcon: {
|
|
67
|
-
icon?: string;
|
|
68
|
-
matIcon?: string;
|
|
69
|
-
};
|
|
70
|
-
$title: Subject<string>;
|
|
71
|
-
onUpdateView: EventEmitter<T>;
|
|
72
72
|
get usageMode(): UsageMode;
|
|
73
73
|
set usageMode(value: UsageMode);
|
|
74
74
|
get isOnFieldMode(): boolean;
|
|
@@ -82,12 +82,6 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
|
|
|
82
82
|
ngAfterViewInit(): void;
|
|
83
83
|
ngOnDestroy(): void;
|
|
84
84
|
waitIdle(opts?: WaitForOptions): Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* Load data from the snapshot route
|
|
87
|
-
*
|
|
88
|
-
* @protected
|
|
89
|
-
*/
|
|
90
|
-
protected loadFromRoute(): Promise<void>;
|
|
91
85
|
/**
|
|
92
86
|
* Load data from id, using the dataService
|
|
93
87
|
*
|
|
@@ -103,6 +97,7 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
|
|
|
103
97
|
canUserWrite(data: T, opts?: any): boolean;
|
|
104
98
|
startListenChanges(): void;
|
|
105
99
|
stopListenChanges(): void;
|
|
100
|
+
ready(opts?: WaitForOptions): Promise<void>;
|
|
106
101
|
updateView(data: T | null, opts?: {
|
|
107
102
|
emitEvent?: boolean;
|
|
108
103
|
openTabIndex?: number;
|
|
@@ -130,6 +125,7 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
|
|
|
130
125
|
/**
|
|
131
126
|
* Save the editor, by calling the dataService.save().
|
|
132
127
|
* Ensure that editor if valid. If not, display an error
|
|
128
|
+
*
|
|
133
129
|
* @param event
|
|
134
130
|
* @param opts
|
|
135
131
|
*/
|
|
@@ -151,13 +147,15 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
|
|
|
151
147
|
emitEvent?: boolean;
|
|
152
148
|
detailsCssClass?: string;
|
|
153
149
|
}): void;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
150
|
+
/**
|
|
151
|
+
* Load data from the snapshot route
|
|
152
|
+
*
|
|
153
|
+
* @protected
|
|
154
|
+
*/
|
|
155
|
+
protected loadFromRoute(): Promise<void>;
|
|
159
156
|
/**
|
|
160
157
|
* Return undefined to keep same tab
|
|
158
|
+
*
|
|
161
159
|
* @protected
|
|
162
160
|
*/
|
|
163
161
|
protected computeNextTabIndex(): number | undefined;
|
|
@@ -196,6 +194,11 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
|
|
|
196
194
|
* @protected
|
|
197
195
|
*/
|
|
198
196
|
protected updateRoute(data: T, queryParams?: any): Promise<boolean>;
|
|
197
|
+
protected abstract registerForms(): any;
|
|
198
|
+
protected abstract computeTitle(data: T): Promise<string>;
|
|
199
|
+
protected abstract setValue(data: T): Promise<void> | void;
|
|
200
|
+
protected abstract get form(): FormGroup;
|
|
201
|
+
protected abstract getFirstInvalidTabIndex(): number;
|
|
199
202
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppEntityEditor<any, any, any>, never>;
|
|
200
203
|
static ɵdir: i0.ɵɵDirectiveDeclaration<AppEntityEditor<any, any, any>, never, never, {}, {}, never, never, false>;
|
|
201
204
|
}
|
|
@@ -13,7 +13,6 @@ import { FormFieldDefinition } from '../../shared/form/field.model';
|
|
|
13
13
|
import { NetworkService } from './network.service';
|
|
14
14
|
import { AuthTokenType } from './network.types';
|
|
15
15
|
import { FileService } from '../../shared/file/file.service';
|
|
16
|
-
import { Referential } from './model/referential.model';
|
|
17
16
|
import { ShowToastOptions } from '../../shared/toast/toasts';
|
|
18
17
|
import { OverlayEventDetail } from '@ionic/core';
|
|
19
18
|
import { ToastController } from '@ionic/angular';
|
|
@@ -86,7 +85,6 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
|
|
|
86
85
|
*/
|
|
87
86
|
isUsageMode(mode: UsageMode): boolean;
|
|
88
87
|
isOnlyGuest(): boolean;
|
|
89
|
-
canUserWriteDataForDepartment(recorderDepartment: Referential | any): boolean;
|
|
90
88
|
register(data: RegisterData): Promise<Account>;
|
|
91
89
|
authenticate(data?: AuthData): Promise<void>;
|
|
92
90
|
login(data: AuthData): Promise<Account>;
|
|
@@ -19,8 +19,8 @@ import { OpenOptions } from '@capacitor/browser';
|
|
|
19
19
|
import { ILoggingService } from '../../shared/logging/logger.model';
|
|
20
20
|
import * as i0 from "@angular/core";
|
|
21
21
|
export declare const AndroidOsEnvironment: Readonly<{
|
|
22
|
-
DIRECTORY_DOWNLOADS:
|
|
23
|
-
DIRECTORY_DOWNLOADS_OLD:
|
|
22
|
+
DIRECTORY_DOWNLOADS: "Download";
|
|
23
|
+
DIRECTORY_DOWNLOADS_OLD: "Downloads";
|
|
24
24
|
}>;
|
|
25
25
|
export declare class PlatformService extends StartableService {
|
|
26
26
|
private ionicPlatform;
|
|
@@ -4,7 +4,7 @@ import { PopoverController } from '@ionic/angular';
|
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { OverlayEventDetail } from '@ionic/core';
|
|
6
6
|
export declare const MimeTypes: Readonly<{
|
|
7
|
-
ANDROID_APK:
|
|
7
|
+
ANDROID_APK: "application/vnd.android.package-archive";
|
|
8
8
|
}>;
|
|
9
9
|
export declare class FilesUtils {
|
|
10
10
|
static UTF8_BOM_CHAR: Uint8Array;
|
|
@@ -26,6 +26,7 @@ export declare function arrayGroupBy<T = any, K extends keyof T = any, M extends
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function arrayDistinct<T = any>(values: T[], propertiesOrKeyFn?: string | string[] | ((obj: T) => string)): T[];
|
|
28
28
|
export declare function nullIfUndefined<T>(obj: T | null | undefined): T | null;
|
|
29
|
+
export declare function undefinedIfNull<T>(obj: T | null | undefined): T | undefined;
|
|
29
30
|
export declare function trimEmptyToNull<T>(str: string | null | undefined): string | null;
|
|
30
31
|
export declare function toBoolean(obj: boolean | null | undefined | string, defaultValue?: boolean): boolean;
|
|
31
32
|
export declare function toNumber(obj: number | null | undefined, defaultValue?: number): number;
|
|
@@ -5,6 +5,7 @@ export interface IStartableService<T = any> {
|
|
|
5
5
|
stop(): Promise<void>;
|
|
6
6
|
ready(): Promise<T>;
|
|
7
7
|
}
|
|
8
|
+
export declare function isStartableService(data: any): data is IStartableService;
|
|
8
9
|
export declare abstract class StartableService<T = any, O = any> implements IStartableService<T> {
|
|
9
10
|
readonly startSubject: Subject<T>;
|
|
10
11
|
readonly stopSubject: Subject<void>;
|