@sumaris-net/ngx-components 1.13.2 → 1.14.2
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 +260 -50
- 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/doc/changelog.md +5 -0
- package/esm2015/src/app/core/services/account.service.js +1 -3
- package/esm2015/src/app/core/services/config/core.config.js +7 -1
- package/esm2015/src/app/core/services/network.service.js +53 -4
- package/esm2015/src/app/core/services/network.utils.js +1 -1
- package/esm2015/src/app/core/services/platform.service.js +88 -5
- package/esm2015/src/app/shared/dates.js +24 -1
- package/esm2015/src/app/shared/http/http.utils.js +14 -2
- package/esm2015/src/app/shared/upload-file/upload-file.component.js +12 -7
- package/esm2015/src/app/shared/upload-file/upload-file.model.js +8 -1
- package/esm2015/src/app/shared/version/versions.js +5 -1
- package/esm2015/src/environments/environment.class.js +1 -1
- package/fesm2015/sumaris-net.ngx-components.js +198 -12
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +2 -1
- package/src/app/core/services/config/core.config.d.ts +1 -0
- package/src/app/core/services/network.service.d.ts +10 -1
- package/src/app/core/services/network.utils.d.ts +15 -0
- package/src/app/core/services/platform.service.d.ts +5 -0
- package/src/app/shared/dates.d.ts +7 -0
- package/src/app/shared/http/http.utils.d.ts +1 -0
- package/src/app/shared/upload-file/upload-file.model.d.ts +5 -3
- package/src/app/shared/version/versions.d.ts +2 -0
- package/src/assets/i18n/en-US.json +2 -5
- package/src/assets/i18n/en.json +2 -5
- package/src/assets/i18n/fr.json +4 -3
- package/src/assets/manifest.json +5 -5
- package/src/environments/environment.class.d.ts +1 -0
- package/src/theme/_responsive.scss +7 -3
- package/sumaris-net.ngx-components.metadata.json +1 -1
- package/src/assets/manifest.sumaris.json +0 -17
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": "1.
|
|
4
|
+
"version": "1.14.2",
|
|
5
5
|
"author": "contact@e-is.pro",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
7
7
|
"readmeFilename": "README.md",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"cordova-android": "9.1.0",
|
|
13
13
|
"lodash.clonedeep": "^4.5.0",
|
|
14
|
+
"moment-timezone": "^0.5.34",
|
|
14
15
|
"tslib": "^2.2.0"
|
|
15
16
|
},
|
|
16
17
|
"peerDependencies": {
|
|
@@ -12,7 +12,7 @@ import { Connection, Network } from '@ionic-native/network/ngx';
|
|
|
12
12
|
import { CacheService } from 'ionic-cache';
|
|
13
13
|
import { ShowToastOptions } from '../../shared/toast/toasts';
|
|
14
14
|
import { OverlayEventDetail } from '@ionic/core';
|
|
15
|
-
import { NodeInfo } from './network.utils';
|
|
15
|
+
import { AppManifest, NodeInfo } from './network.utils';
|
|
16
16
|
import { StartableService } from '../../shared/services/startable-service.class';
|
|
17
17
|
export declare type ConnectionType = 'none' | 'wifi' | 'ethernet' | 'cell' | 'unknown';
|
|
18
18
|
export declare type AuthTokenType = 'token' | 'basic' | 'basic-and-token';
|
|
@@ -85,6 +85,13 @@ export declare class NetworkService extends StartableService<Peer> {
|
|
|
85
85
|
showToast?: boolean;
|
|
86
86
|
}): Promise<boolean>;
|
|
87
87
|
getNodeInfo(peer?: string | Peer): Promise<NodeInfo>;
|
|
88
|
+
getAppManifest(peer?: string | Peer, opts?: {
|
|
89
|
+
nocache?: boolean;
|
|
90
|
+
}): Promise<AppManifest | undefined>;
|
|
91
|
+
getAppVersion(peer?: string | Peer, opts?: {
|
|
92
|
+
nocache?: boolean;
|
|
93
|
+
}): Promise<string | undefined>;
|
|
94
|
+
computePeerPath(peer: string | Peer | undefined, path: string): string | undefined;
|
|
88
95
|
/**
|
|
89
96
|
* Allow to force offline mode
|
|
90
97
|
*/
|
|
@@ -121,6 +128,8 @@ export declare class NetworkService extends StartableService<Peer> {
|
|
|
121
128
|
headers?: HttpHeaders | {
|
|
122
129
|
[header: string]: string | string[];
|
|
123
130
|
};
|
|
131
|
+
responseType?: 'json';
|
|
132
|
+
nocache?: boolean;
|
|
124
133
|
}): Promise<T>;
|
|
125
134
|
protected onDeviceConnectionChanged(connectionType?: string): void;
|
|
126
135
|
protected resetData(): void;
|
|
@@ -6,6 +6,21 @@ export interface NodeInfo {
|
|
|
6
6
|
nodeLabel?: string;
|
|
7
7
|
nodeName?: string;
|
|
8
8
|
}
|
|
9
|
+
export interface AppManifest {
|
|
10
|
+
manifest_version: number;
|
|
11
|
+
name: string;
|
|
12
|
+
version: string;
|
|
13
|
+
start_url: string;
|
|
14
|
+
short_name?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
version_name?: string;
|
|
17
|
+
author?: string;
|
|
18
|
+
default_locale?: string;
|
|
19
|
+
icons?: any | any[];
|
|
20
|
+
background_color?: string;
|
|
21
|
+
theme_color?: string;
|
|
22
|
+
display?: string;
|
|
23
|
+
}
|
|
9
24
|
export declare class NetworkUtils {
|
|
10
25
|
static getNodeInfo: typeof getNodeInfo;
|
|
11
26
|
}
|
|
@@ -45,6 +45,7 @@ export declare class PlatformService extends StartableService {
|
|
|
45
45
|
private _android;
|
|
46
46
|
private _ios;
|
|
47
47
|
private _downloadingJobs;
|
|
48
|
+
private checkAppVersionTimer;
|
|
48
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);
|
|
49
50
|
is(platformName: Platforms): boolean;
|
|
50
51
|
get mobile(): boolean;
|
|
@@ -73,6 +74,10 @@ export declare class PlatformService extends StartableService {
|
|
|
73
74
|
protected configureCordovaPlugins(): void;
|
|
74
75
|
protected configureTranslate(): void;
|
|
75
76
|
protected configureCache(online?: boolean): void;
|
|
77
|
+
protected checkAppVersion(opts?: {
|
|
78
|
+
canReload?: boolean;
|
|
79
|
+
silent?: boolean;
|
|
80
|
+
}): Promise<void>;
|
|
76
81
|
protected storageReady(): Promise<LocalForage>;
|
|
77
82
|
protected migrateStorage(storage: LocalForage): Promise<void>;
|
|
78
83
|
protected showToast(opts: ShowToastOptions): Promise<HTMLIonToastElement>;
|
|
@@ -9,6 +9,13 @@ export declare class DateUtils {
|
|
|
9
9
|
static max(date1: Moment, date2: Moment): Moment;
|
|
10
10
|
static equals(date1: Moment | string, date2: Moment | string): boolean;
|
|
11
11
|
static isSame(date1: Moment | string, date2: Moment | string, granularity?: unitOfTime.StartOf): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Create a copy of a date, without time fields (always return a new Moment object, or undefined).
|
|
14
|
+
* Same implementation as the Java class Dates.resetTime() (see any SUMARiS like Pod)
|
|
15
|
+
* @param value
|
|
16
|
+
* @param timezone a timezone (see https://momentjs.com/timezone/)
|
|
17
|
+
*/
|
|
18
|
+
static resetTime(value: Moment | string, timezone?: string): Moment | undefined;
|
|
12
19
|
}
|
|
13
20
|
export declare function toDateISOString(value: any): string | undefined;
|
|
14
21
|
export declare function fromDateISOString(value: any): Moment | undefined;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { HttpEventType, HttpProgressEvent, HttpResponse } from '@angular/common/http';
|
|
2
|
+
import { HttpEvent, HttpEventType, HttpProgressEvent, HttpResponse } from '@angular/common/http';
|
|
3
3
|
export declare class UploadFile<T> extends File {
|
|
4
4
|
progress?: number;
|
|
5
5
|
deleting?: boolean;
|
|
6
6
|
error?: string;
|
|
7
7
|
response?: FileResponse<T> | HttpResponse<T>;
|
|
8
8
|
}
|
|
9
|
-
export declare type FileUploadFn<T> = (file: File) => Observable<FileEvent<T>>;
|
|
9
|
+
export declare type FileUploadFn<T> = (file: File) => Observable<FileEvent<T> | HttpEvent<T>>;
|
|
10
10
|
export declare type FileDeleteFn<T> = (file: UploadFile<T>) => Promise<boolean>;
|
|
11
11
|
export interface FileProgressEvent {
|
|
12
|
-
type: HttpEventType;
|
|
12
|
+
type: HttpEventType.DownloadProgress | HttpEventType.UploadProgress;
|
|
13
13
|
loaded: number;
|
|
14
14
|
total?: number;
|
|
15
15
|
statusText?: string;
|
|
@@ -26,3 +26,5 @@ export declare class FileResponse<T> {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
export declare type FileEvent<T> = HttpProgressEvent | HttpResponse<T> | FileProgressEvent | FileResponse<T>;
|
|
29
|
+
export declare function isProgressEvent(event: HttpEvent<any> | FileEvent<any>): event is HttpProgressEvent | FileProgressEvent;
|
|
30
|
+
export declare function isResponseEvent<T>(event: HttpEvent<T> | FileEvent<T>): event is HttpResponse<T> | FileResponse<T>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare class VersionUtils {
|
|
2
2
|
static compare: typeof compareVersionNumbers;
|
|
3
3
|
static isCompatible: typeof isVersionCompatible;
|
|
4
|
+
static isSame: typeof isSameVersion;
|
|
4
5
|
}
|
|
5
6
|
/**
|
|
6
7
|
* Compare two software version numbers (e.g. 1.7.1)
|
|
@@ -22,3 +23,4 @@ export declare class VersionUtils {
|
|
|
22
23
|
*/
|
|
23
24
|
export declare function compareVersionNumbers(v1: any, v2: any): number;
|
|
24
25
|
export declare function isVersionCompatible(minVersion: any, actualVersion: any): boolean;
|
|
26
|
+
export declare function isSameVersion(v1: any, v2: any): boolean;
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
"BTN_SHOW_HELP": "Show help",
|
|
49
49
|
"BTN_HIDE": "Hide",
|
|
50
50
|
"BTN_HIDE_MENU": "Hide menu",
|
|
51
|
-
"BTN_SORT_BY_DOTS": "Sort by...",
|
|
52
51
|
"BTN_SHOW": "Show",
|
|
53
52
|
"BTN_SHOW_MENU": "Show menu",
|
|
54
53
|
"BTN_SHOW_MORE": "Show more",
|
|
@@ -107,7 +106,6 @@
|
|
|
107
106
|
"RECORDER": "Recorder",
|
|
108
107
|
"RESULT_COUNT": "{{count}} results",
|
|
109
108
|
"NO_RESULT": "No result",
|
|
110
|
-
"NO_DATA": "No data",
|
|
111
109
|
"LOADING_DOTS": "Loading...",
|
|
112
110
|
"MISSING": "Missing",
|
|
113
111
|
|
|
@@ -136,7 +134,6 @@
|
|
|
136
134
|
"ENABLE_GRAVATAR": "User > Enable Gravatar ?",
|
|
137
135
|
"DEFAULT_LOCALE": "Default Language",
|
|
138
136
|
"DEFAULT_LATLONG_FORMAT": "Default lat/lon format",
|
|
139
|
-
"NOT_SELF_DATA_ACCESS_MIN_ROLE": "User profile (min) to access other people data",
|
|
140
137
|
"APP_MIN_VERSION": "App > Minimal compatible version (x.y.z)",
|
|
141
138
|
"HELP_URL": "App > User manual (URL)",
|
|
142
139
|
"FORUM_URL": "App > Forum address (URL)",
|
|
@@ -494,7 +491,6 @@
|
|
|
494
491
|
"LOAD_ERROR": "Error while loading",
|
|
495
492
|
"SAVE_ERROR": "Error while saving",
|
|
496
493
|
"SUBSCRIBE_ERROR": "Error while subscribe to changes",
|
|
497
|
-
"FIELD_NOT_EXISTS": "Value doesn't exist",
|
|
498
494
|
"FIREFOX_NO_STORAGE": "The application cannot run with Firefox in 'private' mode or without keeping navigation history"
|
|
499
495
|
},
|
|
500
496
|
"CONFIRM": {
|
|
@@ -510,7 +506,8 @@
|
|
|
510
506
|
"DELETE_ROWS": "<b>Are you sure</b> you want to delete this rows?",
|
|
511
507
|
"CANCEL_ROW": "<b>Are you sure</b> you want to cancel changes on this row ?",
|
|
512
508
|
"CANCEL_ROWS": "<b>Are you sure</b> you want to cancel changes on these rows ?",
|
|
513
|
-
"SEND_DEBUG_DATA": "Do you want to send this data to the administrator for help?"
|
|
509
|
+
"SEND_DEBUG_DATA": "Do you want to send this data to the administrator for help?",
|
|
510
|
+
"RELOAD_APP": "A new <b>version {{version}}</b> is available for {{name}}:<ul><li><b>Save</b> any current changes<li>Click on the <b>Update</b> button, or refresh the browser tab.</ul>"
|
|
514
511
|
},
|
|
515
512
|
"INFO": {
|
|
516
513
|
"ALERT_HEADER": "Information",
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
"BTN_SHOW_HELP": "Show help",
|
|
49
49
|
"BTN_HIDE": "Hide",
|
|
50
50
|
"BTN_HIDE_MENU": "Hide menu",
|
|
51
|
-
"BTN_SORT_BY_DOTS": "Sort by...",
|
|
52
51
|
"BTN_SHOW": "Show",
|
|
53
52
|
"BTN_SHOW_MENU": "Show menu",
|
|
54
53
|
"BTN_SHOW_MORE": "Show more",
|
|
@@ -107,7 +106,6 @@
|
|
|
107
106
|
"RECORDER": "Recorder",
|
|
108
107
|
"RESULT_COUNT": "{{count}} results",
|
|
109
108
|
"NO_RESULT": "No result",
|
|
110
|
-
"NO_DATA": "No data",
|
|
111
109
|
"LOADING_DOTS": "Loading...",
|
|
112
110
|
"MISSING": "Missing",
|
|
113
111
|
|
|
@@ -136,7 +134,6 @@
|
|
|
136
134
|
"ENABLE_GRAVATAR": "User > Enable Gravatar ?",
|
|
137
135
|
"DEFAULT_LOCALE": "Default Language",
|
|
138
136
|
"DEFAULT_LATLONG_FORMAT": "Default lat/lon format",
|
|
139
|
-
"NOT_SELF_DATA_ACCESS_MIN_ROLE": "User profile (min) to access other people data",
|
|
140
137
|
"APP_MIN_VERSION": "App > Minimal compatible version (x.y.z)",
|
|
141
138
|
"HELP_URL": "App > User manual (URL)",
|
|
142
139
|
"FORUM_URL": "App > Forum address (URL)",
|
|
@@ -494,7 +491,6 @@
|
|
|
494
491
|
"LOAD_ERROR": "Error while loading",
|
|
495
492
|
"SAVE_ERROR": "Error while saving",
|
|
496
493
|
"SUBSCRIBE_ERROR": "Error while subscribe to changes",
|
|
497
|
-
"FIELD_NOT_EXISTS": "Value doesn't exist",
|
|
498
494
|
"FIREFOX_NO_STORAGE": "The application cannot run with Firefox in 'private' mode or without keeping navigation history"
|
|
499
495
|
},
|
|
500
496
|
"CONFIRM": {
|
|
@@ -510,7 +506,8 @@
|
|
|
510
506
|
"DELETE_ROWS": "<b>Are you sure</b> you want to delete this rows?",
|
|
511
507
|
"CANCEL_ROW": "<b>Are you sure</b> you want to cancel changes on this row ?",
|
|
512
508
|
"CANCEL_ROWS": "<b>Are you sure</b> you want to cancel changes on these rows ?",
|
|
513
|
-
"SEND_DEBUG_DATA": "Do you want to send this data to the administrator for help?"
|
|
509
|
+
"SEND_DEBUG_DATA": "Do you want to send this data to the administrator for help?",
|
|
510
|
+
"RELOAD_APP": "A new <b>version {{version}}</b> is available for {{name}}:<ul><li><b>Save</b> any current changes<li>Click on the <b>Update</b> button, or refresh the browser tab.</ul>"
|
|
514
511
|
},
|
|
515
512
|
"INFO": {
|
|
516
513
|
"ALERT_HEADER": "Information",
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"DATE_SHORT_PATTERN": "DD/MM/YY",
|
|
70
70
|
"DATE_MONTH_YEAR_PATTERN": "MM/YYYY",
|
|
71
71
|
"DATE_YEAR_PATTERN": "YYYY",
|
|
72
|
-
"DATE_YEAR_PLACEHOLDER": "
|
|
72
|
+
"DATE_YEAR_PLACEHOLDER": "aaaa",
|
|
73
73
|
"DATE_PLACEHOLDER": "jj/mm/aaaa",
|
|
74
74
|
"DATE_TIME_PLACEHOLDER": "jj/mm/aaaa hh:mm",
|
|
75
75
|
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
"LAT_LONG_FORMAT": "Format latitude/longitude"
|
|
282
282
|
},
|
|
283
283
|
"INFO": {
|
|
284
|
-
"RELOADED": "Votre compte utilisateur a été
|
|
284
|
+
"RELOADED": "Votre compte utilisateur a été <b>actualisé</b> !"
|
|
285
285
|
},
|
|
286
286
|
"ERROR": {
|
|
287
287
|
"SUBSCRIBE_ERROR": "Échec de l'abonnement distant au compte utilisateur."
|
|
@@ -507,7 +507,8 @@
|
|
|
507
507
|
"DELETE_ROWS": "<b>Êtes-vous sûr</b> de vouloir supprimer ces lignes ?",
|
|
508
508
|
"CANCEL_ROW": "<b>Êtes-vous sûr</b> de vouloir annuler les modifications sur cette ligne ?",
|
|
509
509
|
"CANCEL_ROWS": "<b>Êtes-vous sûr</b> de vouloir annuler les modifications sur ces lignes ?",
|
|
510
|
-
"SEND_DEBUG_DATA": "Voulez-vous envoyer ces données à l'administrateur, afin qu'il vous aide ?"
|
|
510
|
+
"SEND_DEBUG_DATA": "Voulez-vous envoyer ces données à l'administrateur, afin qu'il vous aide ?",
|
|
511
|
+
"RELOAD_APP": "Une nouvelle <b>version {{version}}</b> est disponible pour {{name}}:<ul><li><b>Enregistrer</b> vos éventuelles modifications en cours<li>Cliquez sur le bouton <b>Mettre à jour</b>, ou rafraichissez l'onglet du navigateur.</ul>"
|
|
511
512
|
},
|
|
512
513
|
"INFO": {
|
|
513
514
|
"ALERT_HEADER": "Information",
|
package/src/assets/manifest.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"short_name": "
|
|
2
|
+
"name": "ngx-sumaris-components",
|
|
3
|
+
"short_name": "ngx-sumaris-components",
|
|
4
4
|
"manifest_version": 1,
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.13.2",
|
|
6
6
|
"default_locale": "fr",
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|
|
9
|
-
"src": "assets/img/logo-
|
|
9
|
+
"src": "assets/img/logo/logo-sumaris.png",
|
|
10
10
|
"sizes": "183x120",
|
|
11
11
|
"type": "image/png"
|
|
12
12
|
}],
|
|
@@ -12,7 +12,6 @@ html.plt-mobile {
|
|
|
12
12
|
display: inherit !important;
|
|
13
13
|
visibility: visible !important;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
15
|
}
|
|
17
16
|
html:not(.plt-mobile) {
|
|
18
17
|
[visible-mobile],
|
|
@@ -46,6 +45,11 @@ html:not(.plt-mobile) {
|
|
|
46
45
|
.padding-top-xs {
|
|
47
46
|
padding-top: 10px;
|
|
48
47
|
}
|
|
48
|
+
|
|
49
|
+
ion-toolbar ion-title {
|
|
50
|
+
font-size: 18px;
|
|
51
|
+
padding-inline: 8px;
|
|
52
|
+
}
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
@media screen and (min-width: $screen-sm) {
|
|
@@ -329,8 +333,8 @@ html:not(.plt-mobile) {
|
|
|
329
333
|
text-align: start !important;
|
|
330
334
|
line-height: 37px;
|
|
331
335
|
margin-top: 0;
|
|
332
|
-
margin-bottom:
|
|
333
|
-
margin-right:
|
|
336
|
+
margin-bottom: 0;
|
|
337
|
+
margin-right: 0;
|
|
334
338
|
//padding-left: var(--ion-label-padding, 11px);
|
|
335
339
|
//background-color: var(--ion-color-light);
|
|
336
340
|
}
|