@sumaris-net/ngx-components 0.26.4 → 0.27.0
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/bundles/sumaris-net.ngx-components.umd.js +170 -159
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/core/form/entity-editor.class.js +4 -5
- package/esm2015/src/app/core/form/form-buttons-bar.component.js +2 -1
- package/esm2015/src/app/core/form/form.class.js +3 -3
- package/esm2015/src/app/core/graphql/graphql.service.js +1 -2
- package/esm2015/src/app/core/services/config.service.js +1 -1
- package/esm2015/src/app/core/services/platform.service.js +67 -83
- package/esm2015/src/app/core/table/table.class.js +3 -3
- package/esm2015/src/app/shared/help/help.modal.js +1 -1
- package/esm2015/src/app/shared/material/autocomplete/material.autocomplete.js +2 -2
- package/esm2015/src/app/shared/material/badge/badge-icon.directive.js +9 -7
- package/esm2015/src/app/shared/pipes/form.pipes.js +3 -3
- package/esm2015/src/app/shared/services/startable-service.class.js +12 -5
- package/esm2015/src/app/shared/toolbar/modal-toolbar.js +6 -1
- package/esm2015/src/app/shared/validator/form-error-adapter.class.js +5 -5
- package/fesm2015/sumaris-net.ngx-components.js +97 -102
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +2 -2
- package/src/app/core/form/entity-editor.class.d.ts +2 -2
- package/src/app/core/form/form.class.d.ts +2 -2
- package/src/app/core/services/platform.service.d.ts +3 -15
- package/src/app/core/table/table.class.d.ts +2 -2
- package/src/app/shared/help/help.modal.d.ts +7 -1
- package/src/app/shared/pipes/form.pipes.d.ts +2 -2
- package/src/app/shared/services/startable-service.class.d.ts +2 -1
- package/src/app/shared/validator/form-error-adapter.class.d.ts +1 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
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": "0.
|
|
4
|
+
"version": "0.27.0",
|
|
5
5
|
"author": "contact@e-is.pro",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
7
7
|
"readmeFilename": "README.md",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"url": "https://gitlab.ifremer.fr/sih-public/sumaris/ngx-sumaris-components/-/issues"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">= 12.
|
|
28
|
+
"node": ">= 12.20.1",
|
|
29
29
|
"npm": ">= 6.14.4"
|
|
30
30
|
},
|
|
31
31
|
"cordova": {
|
|
@@ -9,7 +9,7 @@ import { EntityServiceLoadOptions, IEntityService } from '../../shared/services/
|
|
|
9
9
|
import { DateFormatPipe } from '../../shared/pipes/date-format.pipe';
|
|
10
10
|
import { HistoryPageReference } from '../services/model/history.model';
|
|
11
11
|
import { WaitForOptions } from '../../shared/observables';
|
|
12
|
-
import {
|
|
12
|
+
import { FormErrorTranslator } from '../../shared/validator/form-error-adapter.class';
|
|
13
13
|
export declare class AppEditorOptions extends AppTabEditorOptions {
|
|
14
14
|
autoLoad?: boolean;
|
|
15
15
|
autoLoadDelay?: number;
|
|
@@ -38,7 +38,7 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
|
|
|
38
38
|
protected dateFormat: DateFormatPipe;
|
|
39
39
|
protected cd: ChangeDetectorRef;
|
|
40
40
|
protected settings: LocalSettingsService;
|
|
41
|
-
protected formErrorAdapter:
|
|
41
|
+
protected formErrorAdapter: FormErrorTranslator;
|
|
42
42
|
data: T;
|
|
43
43
|
saving: boolean;
|
|
44
44
|
hasRemoteListener: boolean;
|
|
@@ -5,7 +5,7 @@ import { IAppForm } from './form.utils';
|
|
|
5
5
|
import { LocalSettingsService } from '../services/local-settings.service';
|
|
6
6
|
import { MatAutocompleteConfigHolder, MatAutocompleteFieldAddOptions, MatAutocompleteFieldConfig } from '../../shared/material/autocomplete/material.autocomplete';
|
|
7
7
|
import { WaitForOptions } from '../../shared/observables';
|
|
8
|
-
import {
|
|
8
|
+
import { FormErrorTranslator, FormErrorTranslatorOptions, IFormControlPathTranslator } from '../../shared/validator/form-error-adapter.class';
|
|
9
9
|
export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy, IFormControlPathTranslator {
|
|
10
10
|
autocompleteHelper: MatAutocompleteConfigHolder;
|
|
11
11
|
autocompleteFields: {
|
|
@@ -13,7 +13,7 @@ export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy,
|
|
|
13
13
|
};
|
|
14
14
|
error: string;
|
|
15
15
|
protected settings: LocalSettingsService;
|
|
16
|
-
protected errorTranslator:
|
|
16
|
+
protected errorTranslator: FormErrorTranslator;
|
|
17
17
|
protected _enable: boolean;
|
|
18
18
|
protected _loading: boolean;
|
|
19
19
|
protected i18nFieldPrefix: string;
|
|
@@ -19,7 +19,8 @@ import { Observable } from 'rxjs';
|
|
|
19
19
|
import { ConfigService } from './config.service';
|
|
20
20
|
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
|
21
21
|
import { Downloader, DownloadRequest } from '@ionic-native/downloader/ngx';
|
|
22
|
-
|
|
22
|
+
import { StartableService } from '../../shared/services/startable-service.class';
|
|
23
|
+
export declare class PlatformService extends StartableService {
|
|
23
24
|
private platform;
|
|
24
25
|
private cdkPlatform;
|
|
25
26
|
private toastController;
|
|
@@ -39,15 +40,11 @@ export declare class PlatformService {
|
|
|
39
40
|
private splashScreen;
|
|
40
41
|
private browser;
|
|
41
42
|
private downloader;
|
|
42
|
-
private readonly _debug;
|
|
43
|
-
private _started;
|
|
44
|
-
private _startPromise;
|
|
45
43
|
private _mobile;
|
|
46
44
|
private _cordova;
|
|
47
45
|
private _android;
|
|
48
46
|
private _downloadingJobs;
|
|
49
47
|
touchUi: boolean;
|
|
50
|
-
get started(): boolean;
|
|
51
48
|
get mobile(): boolean;
|
|
52
49
|
constructor(platform: Platform, cdkPlatform: CdkPlatform, toastController: ToastController, translate: TranslateService, dateAdapter: MomentDateAdapter, entitiesStorage: EntitiesStorage, settings: LocalSettingsService, networkService: NetworkService, accountService: AccountService, configService: ConfigService, cache: CacheService, storage: Storage, audioProvider: AudioProvider, environment: any, statusBar: StatusBar, keyboard: Keyboard, splashScreen: SplashScreen, browser: InAppBrowser, downloader: Downloader);
|
|
53
50
|
is(platformName: Platforms): boolean;
|
|
@@ -60,16 +57,7 @@ export declare class PlatformService {
|
|
|
60
57
|
get canDownload(): boolean;
|
|
61
58
|
width(): number;
|
|
62
59
|
height(): number;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Wait platform is ready.<br/>
|
|
66
|
-
* Important: this will NOT start the platform, has it should be started by the AppComponent
|
|
67
|
-
*
|
|
68
|
-
* @param opts
|
|
69
|
-
*/
|
|
70
|
-
ready(opts?: {
|
|
71
|
-
checkPeriod: number;
|
|
72
|
-
}): Promise<any>;
|
|
60
|
+
protected ngOnStart(): Promise<any>;
|
|
73
61
|
open(url: string, target?: string, features?: string, replace?: boolean): void;
|
|
74
62
|
getDownloadingJob(uri: string): Observable<string>;
|
|
75
63
|
download(request: {
|
|
@@ -20,7 +20,7 @@ import { CompletableEvent } from '../../shared/events';
|
|
|
20
20
|
import { ShowToastOptions } from '../../shared/toasts';
|
|
21
21
|
import { CdkColumnDef } from '@angular/cdk/table';
|
|
22
22
|
import { LoadResult } from '../../shared/services/entity-service.class';
|
|
23
|
-
import {
|
|
23
|
+
import { FormErrorTranslator, FormErrorTranslatorOptions, IFormControlPathTranslator } from '../../shared/validator/form-error-adapter.class';
|
|
24
24
|
export declare const SETTINGS_DISPLAY_COLUMNS = "displayColumns";
|
|
25
25
|
export declare const SETTINGS_SORTED_COLUMN = "sortedColumn";
|
|
26
26
|
export declare const SETTINGS_FILTER = "filter";
|
|
@@ -65,7 +65,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
65
65
|
protected alertCtrl: AlertController;
|
|
66
66
|
protected toastController: ToastController;
|
|
67
67
|
protected previouslyEditedRowId: number;
|
|
68
|
-
protected formErrorAdapter:
|
|
68
|
+
protected formErrorAdapter: FormErrorTranslator;
|
|
69
69
|
excludesColumns: string[];
|
|
70
70
|
displayedColumns: string[];
|
|
71
71
|
totalRowCount: number | null;
|
|
@@ -3,7 +3,13 @@ import { ModalController } from '@ionic/angular';
|
|
|
3
3
|
import { PlatformService } from '../../core/services/platform.service';
|
|
4
4
|
import { LocalSettingsService } from '../../core/services/local-settings.service';
|
|
5
5
|
import { TranslateService } from '@ngx-translate/core';
|
|
6
|
-
export
|
|
6
|
+
export interface AppHelpModalOptions {
|
|
7
|
+
title?: string;
|
|
8
|
+
markdownContent?: string;
|
|
9
|
+
docUrl?: string;
|
|
10
|
+
showError?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class AppHelpModal implements AppHelpModalOptions {
|
|
7
13
|
protected injector: Injector;
|
|
8
14
|
protected viewCtrl: ModalController;
|
|
9
15
|
protected platform: PlatformService;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PipeTransform } from '@angular/core';
|
|
2
2
|
import { FormGroup } from '@angular/forms';
|
|
3
|
-
import {
|
|
3
|
+
import { FormErrorTranslator, FormErrorTranslatorOptions } from '../validator/form-error-adapter.class';
|
|
4
4
|
export declare class FormErrorTranslatePipe implements PipeTransform {
|
|
5
5
|
private adapter;
|
|
6
|
-
constructor(adapter:
|
|
6
|
+
constructor(adapter: FormErrorTranslator);
|
|
7
7
|
transform(form: FormGroup, opts?: FormErrorTranslatorOptions): string;
|
|
8
8
|
}
|
|
@@ -8,11 +8,12 @@ export interface IStartableService<T = any> {
|
|
|
8
8
|
export declare abstract class StartableService<T = any> implements IStartableService<T> {
|
|
9
9
|
onStart: Subject<T>;
|
|
10
10
|
protected _debug: boolean;
|
|
11
|
+
protected _startByReadyFunction: boolean;
|
|
11
12
|
protected _data: T;
|
|
12
13
|
private _started;
|
|
13
14
|
private _startPromise;
|
|
14
15
|
private _startPrerequisite;
|
|
15
|
-
protected constructor(
|
|
16
|
+
protected constructor(prerequisiteService: {
|
|
16
17
|
ready: () => Promise<any>;
|
|
17
18
|
});
|
|
18
19
|
start(): Promise<T>;
|
|
@@ -12,7 +12,7 @@ export interface FormErrorTranslatorOptions {
|
|
|
12
12
|
separator?: string;
|
|
13
13
|
recursive?: boolean;
|
|
14
14
|
}
|
|
15
|
-
export declare class
|
|
15
|
+
export declare class FormErrorTranslator implements IFormControlPathTranslator {
|
|
16
16
|
private translate;
|
|
17
17
|
private readonly errorI18nKeys;
|
|
18
18
|
constructor(translate: TranslateService, errorI18nKeys: ObjectMap<string>);
|